From 38125c147df234202d631b24e409380c41a0148d Mon Sep 17 00:00:00 2001 From: James Rodewig <40268737+jrodewig@users.noreply.github.com> Date: Sun, 26 Sep 2021 19:24:01 -0400 Subject: [PATCH 001/250] [DOCS] Remove `gateway.auto_import_dangling_indices` setting (#78280) Adds an 8.0 breaking change for PR #59698. --- .../migration/migrate_8_0/settings.asciidoc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/docs/reference/migration/migrate_8_0/settings.asciidoc b/docs/reference/migration/migrate_8_0/settings.asciidoc index 591cbf986b36f..5644b2bc7a906 100644 --- a/docs/reference/migration/migrate_8_0/settings.asciidoc +++ b/docs/reference/migration/migrate_8_0/settings.asciidoc @@ -298,4 +298,21 @@ allocation can be disabled by setting *Impact* + Discontinue use of the deprecated setting. ==== + +[[auto-import-dangling-indices-removed]] +.The `gateway.auto_import_dangling_indices` setting has been removed. +[%collapsible] +==== +*Details* + +The `gateway.auto_import_dangling_indices` cluster setting has been removed. +Previously, you could use this setting to automatically import +{ref}/modules-gateway.html#dangling-indices[dangling indices]. However, +automatically importing dangling indices is unsafe. Use the +{ref}/indices.html#dangling-indices-api[dangling indices APIs] to manage and +import dangling indices instead. + +*Impact* + +Discontinue use of the removed setting. Specifying the setting in +`elasticsearch.yml` will result in an error on startup. +==== //end::notable-breaking-changes[] From 421b3e80de0daca0ba439e87d6edbb18eadc24c2 Mon Sep 17 00:00:00 2001 From: Lukas Wegmann Date: Mon, 27 Sep 2021 09:57:45 +0200 Subject: [PATCH 002/250] Document missing_order param for composite aggregations (#77839) Documents the missing_order parameter for composite aggregations introduced in #76740 --- .../bucket/composite-aggregation.asciidoc | 25 +++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/docs/reference/aggregations/bucket/composite-aggregation.asciidoc b/docs/reference/aggregations/bucket/composite-aggregation.asciidoc index b7966b931c80b..2f052dcf76a3f 100644 --- a/docs/reference/aggregations/bucket/composite-aggregation.asciidoc +++ b/docs/reference/aggregations/bucket/composite-aggregation.asciidoc @@ -599,19 +599,30 @@ GET /_search "aggs": { "my_buckets": { "composite": { - "sources": [ - { "product_name": { "terms": { "field": "product", "missing_bucket": true } } } - ] + "sources": [{ + "product_name": { + "terms": { + "field": "product", + "missing_bucket": true, + "missing_order": "last" + } + } + }] } } } } -------------------------------------------------- -In the example above the source `product_name` will emit an explicit `null` value -for documents without a value for the field `product`. -The `order` specified in the source dictates whether the `null` values should rank -first (ascending order, `asc`) or last (descending order, `desc`). +In the above example, the `product_name` source emits an explicit `null` bucket +for documents without a `product` value. This bucket is placed last. + +You can control the position of the `null` bucket using the optional +`missing_order` parameter. If `missing_order` is `first` or `last`, the `null` +bucket is placed in the respective first or last position. If `missing_order` is +omitted or `default`, the source's `order` determines the bucket's position. If +`order` is `asc` (ascending), the bucket is in the first position. If `order` is +`desc` (descending), the bucket is in the last position. ==== Size From b75b030d8808049912e3ecb440a4413ceb633b98 Mon Sep 17 00:00:00 2001 From: Ignacio Vera Date: Mon, 27 Sep 2021 11:10:14 +0200 Subject: [PATCH 003/250] don't use endianness reverse util for writing KeyStore file (#78304) The different endianness of different versions is handled when reading files. --- .../cli/keystore/KeyStoreWrapperTests.java | 69 +++++++++----- .../keystore/UpgradeKeyStoreCommandTests.java | 19 ++-- .../format-v4-elasticsearch.keystore | Bin 0 -> 259 bytes .../common/settings/KeyStoreWrapper.java | 84 +++++++++++------- 4 files changed, 113 insertions(+), 59 deletions(-) create mode 100644 distribution/tools/keystore-cli/src/test/resources/format-v4-elasticsearch.keystore diff --git a/distribution/tools/keystore-cli/src/test/java/org/elasticsearch/cli/keystore/KeyStoreWrapperTests.java b/distribution/tools/keystore-cli/src/test/java/org/elasticsearch/cli/keystore/KeyStoreWrapperTests.java index 1c58e9bbd92c6..10fc229ac53e7 100644 --- a/distribution/tools/keystore-cli/src/test/java/org/elasticsearch/cli/keystore/KeyStoreWrapperTests.java +++ b/distribution/tools/keystore-cli/src/test/java/org/elasticsearch/cli/keystore/KeyStoreWrapperTests.java @@ -10,7 +10,6 @@ import org.apache.lucene.backward_codecs.store.EndiannessReverserUtil; import org.apache.lucene.codecs.CodecUtil; -import org.apache.lucene.store.DataOutput; import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IndexOutput; @@ -204,9 +203,9 @@ public void testFailWhenCannotConsumeSecretStream() throws Exception { Path configDir = env.configFile(); try ( Directory directory = newFSDirectory(configDir); - IndexOutput indexOutput = directory.createOutput("elasticsearch.keystore", IOContext.DEFAULT) + IndexOutput indexOutput = EndiannessReverserUtil.createOutput(directory, "elasticsearch.keystore", IOContext.DEFAULT) ) { - CodecUtil.writeHeader(indexOutput, "elasticsearch.keystore", 3); + CodecUtil.writeHeader(indexOutput, "elasticsearch.keystore", KeyStoreWrapper.V3_VERSION); indexOutput.writeByte((byte) 0); // No password SecureRandom random = Randomness.createSecure(); byte[] salt = new byte[64]; @@ -235,19 +234,19 @@ public void testFailWhenCannotConsumeEncryptedBytesStream() throws Exception { Path configDir = env.configFile(); try ( Directory directory = newFSDirectory(configDir); - IndexOutput indexOutput = directory.createOutput("elasticsearch.keystore", IOContext.DEFAULT) + IndexOutput indexOutput = EndiannessReverserUtil.createOutput(directory, "elasticsearch.keystore", IOContext.DEFAULT) ) { - CodecUtil.writeHeader(indexOutput, "elasticsearch.keystore", 3); + CodecUtil.writeHeader(indexOutput, "elasticsearch.keystore", KeyStoreWrapper.V3_VERSION); indexOutput.writeByte((byte) 0); // No password SecureRandom random = Randomness.createSecure(); byte[] salt = new byte[64]; random.nextBytes(salt); byte[] iv = new byte[12]; random.nextBytes(iv); + ByteArrayOutputStream bytes = new ByteArrayOutputStream(); CipherOutputStream cipherStream = getCipherStream(bytes, salt, iv); DataOutputStream output = new DataOutputStream(cipherStream); - possiblyAlterSecretString(output, 0); cipherStream.close(); final byte[] encryptedBytes = bytes.toByteArray(); @@ -259,7 +258,7 @@ public void testFailWhenCannotConsumeEncryptedBytesStream() throws Exception { KeyStoreWrapper keystore = KeyStoreWrapper.load(configDir); SecurityException e = expectThrows(SecurityException.class, () -> keystore.decrypt(new char[0])); assertThat(e.getMessage(), containsString("Keystore has been corrupted or tampered with")); - assertThat(e.getCause(), instanceOf(EOFException.class)); + assertThat(e.getCause(), instanceOf(ArrayIndexOutOfBoundsException.class)); } public void testFailWhenSecretStreamNotConsumed() throws Exception { @@ -267,9 +266,9 @@ public void testFailWhenSecretStreamNotConsumed() throws Exception { Path configDir = env.configFile(); try ( Directory directory = newFSDirectory(configDir); - IndexOutput indexOutput = directory.createOutput("elasticsearch.keystore", IOContext.DEFAULT) + IndexOutput indexOutput = EndiannessReverserUtil.createOutput(directory, "elasticsearch.keystore", IOContext.DEFAULT) ) { - CodecUtil.writeHeader(indexOutput, "elasticsearch.keystore", 3); + CodecUtil.writeHeader(indexOutput, "elasticsearch.keystore", KeyStoreWrapper.V3_VERSION); indexOutput.writeByte((byte) 0); // No password SecureRandom random = Randomness.createSecure(); byte[] salt = new byte[64]; @@ -297,9 +296,9 @@ public void testFailWhenEncryptedBytesStreamIsNotConsumed() throws Exception { Path configDir = env.configFile(); try ( Directory directory = newFSDirectory(configDir); - IndexOutput indexOutput = directory.createOutput("elasticsearch.keystore", IOContext.DEFAULT) + IndexOutput indexOutput = EndiannessReverserUtil.createOutput(directory, "elasticsearch.keystore", IOContext.DEFAULT) ) { - CodecUtil.writeHeader(indexOutput, "elasticsearch.keystore", 3); + CodecUtil.writeHeader(indexOutput, "elasticsearch.keystore", KeyStoreWrapper.V3_VERSION); indexOutput.writeByte((byte) 0); // No password SecureRandom random = Randomness.createSecure(); byte[] salt = new byte[64]; @@ -342,14 +341,8 @@ private void possiblyAlterSecretString(DataOutputStream output, int truncLength) output.write(secret_value); } - private void possiblyAlterEncryptedBytes( - IndexOutput indexOutput, - byte[] salt, - byte[] iv, - byte[] encryptedBytes, - int truncEncryptedDataLength - ) throws Exception { - DataOutput out = EndiannessReverserUtil.wrapDataOutput(indexOutput); + private void possiblyAlterEncryptedBytes(IndexOutput out, byte[] salt, byte[] iv, byte[] encryptedBytes, int truncEncryptedDataLength) + throws Exception { out.writeInt(4 + salt.length + 4 + iv.length + 4 + encryptedBytes.length); out.writeInt(salt.length); out.writeBytes(salt, salt.length); @@ -424,7 +417,7 @@ public void testBackcompatV2() throws Exception { Directory directory = newFSDirectory(configDir); IndexOutput output = EndiannessReverserUtil.createOutput(directory, "elasticsearch.keystore", IOContext.DEFAULT); ) { - CodecUtil.writeHeader(output, "elasticsearch.keystore", 2); + CodecUtil.writeHeader(output, "elasticsearch.keystore", KeyStoreWrapper.V2_VERSION); output.writeByte((byte) 0); // hasPassword = false output.writeString("PKCS12"); output.writeString("PBE"); // string algo @@ -474,6 +467,42 @@ public void testBackcompatV2() throws Exception { } } + public void testBackcompatV4() throws Exception { + assumeFalse("Can't run in a FIPS JVM as PBE is not available", inFipsJvm()); + Path configDir = env.configFile(); + try ( + Directory directory = newFSDirectory(configDir); + IndexOutput indexOutput = EndiannessReverserUtil.createOutput(directory, "elasticsearch.keystore", IOContext.DEFAULT) + ) { + CodecUtil.writeHeader(indexOutput, "elasticsearch.keystore", KeyStoreWrapper.V4_VERSION); + indexOutput.writeByte((byte) 0); // No password + SecureRandom random = Randomness.createSecure(); + byte[] salt = new byte[64]; + random.nextBytes(salt); + byte[] iv = new byte[12]; + random.nextBytes(iv); + ByteArrayOutputStream bytes = new ByteArrayOutputStream(); + CipherOutputStream cipherStream = getCipherStream(bytes, salt, iv); + DataOutputStream output = new DataOutputStream(cipherStream); + { + byte[] secret_value = "super_secret_value".getBytes(StandardCharsets.UTF_8); + output.writeInt(1); // One entry + output.writeUTF("string_setting"); + output.writeInt(secret_value.length); + output.write(secret_value); + } + cipherStream.close(); + final byte[] encryptedBytes = bytes.toByteArray(); + possiblyAlterEncryptedBytes(indexOutput, salt, iv, encryptedBytes, 0); + CodecUtil.writeFooter(indexOutput); + } + + KeyStoreWrapper keystore = KeyStoreWrapper.load(configDir); + keystore.decrypt(new char[0]); + SecureString testValue = keystore.getString("string_setting"); + assertThat(testValue.toString(), equalTo("super_secret_value")); + } + public void testStringAndFileDistinction() throws Exception { final char[] password = getPossibleKeystorePassword(); final KeyStoreWrapper wrapper = KeyStoreWrapper.create(); diff --git a/distribution/tools/keystore-cli/src/test/java/org/elasticsearch/cli/keystore/UpgradeKeyStoreCommandTests.java b/distribution/tools/keystore-cli/src/test/java/org/elasticsearch/cli/keystore/UpgradeKeyStoreCommandTests.java index 5c0138fac8bad..755c753d8db07 100644 --- a/distribution/tools/keystore-cli/src/test/java/org/elasticsearch/cli/keystore/UpgradeKeyStoreCommandTests.java +++ b/distribution/tools/keystore-cli/src/test/java/org/elasticsearch/cli/keystore/UpgradeKeyStoreCommandTests.java @@ -38,23 +38,28 @@ protected Environment createEnv(final Map settings) { }; } - public void testKeystoreUpgrade() throws Exception { + public void testKeystoreUpgradeV3() throws Exception { + assertKeystoreUpgrade("/format-v3-elasticsearch.keystore", KeyStoreWrapper.V3_VERSION); + } + + public void testKeystoreUpgradeV4() throws Exception { + assertKeystoreUpgrade("/format-v4-elasticsearch.keystore", KeyStoreWrapper.V4_VERSION); + } + + private void assertKeystoreUpgrade(String file, int version) throws Exception { assumeFalse("Cannot open unprotected keystore on FIPS JVM", inFipsJvm()); final Path keystore = KeyStoreWrapper.keystorePath(env.configFile()); - try ( - InputStream is = KeyStoreWrapperTests.class.getResourceAsStream("/format-v3-elasticsearch.keystore"); - OutputStream os = Files.newOutputStream(keystore) - ) { + try (InputStream is = KeyStoreWrapperTests.class.getResourceAsStream(file); OutputStream os = Files.newOutputStream(keystore)) { is.transferTo(os); } try (KeyStoreWrapper beforeUpgrade = KeyStoreWrapper.load(env.configFile())) { assertNotNull(beforeUpgrade); - assertThat(beforeUpgrade.getFormatVersion(), equalTo(3)); + assertThat(beforeUpgrade.getFormatVersion(), equalTo(version)); } execute(); try (KeyStoreWrapper afterUpgrade = KeyStoreWrapper.load(env.configFile())) { assertNotNull(afterUpgrade); - assertThat(afterUpgrade.getFormatVersion(), equalTo(KeyStoreWrapper.FORMAT_VERSION)); + assertThat(afterUpgrade.getFormatVersion(), equalTo(KeyStoreWrapper.CURRENT_VERSION)); afterUpgrade.decrypt(new char[0]); assertThat(afterUpgrade.getSettingNames(), hasItem(KeyStoreWrapper.SEED_SETTING.getKey())); } diff --git a/distribution/tools/keystore-cli/src/test/resources/format-v4-elasticsearch.keystore b/distribution/tools/keystore-cli/src/test/resources/format-v4-elasticsearch.keystore new file mode 100644 index 0000000000000000000000000000000000000000..e534175cc42b0d160941cd068ecc039363b76036 GIT binary patch literal 259 zcmcD&o+B=nnv+;ul9^nbnpl*ap_iRnSzMA|l*+)szyib!=YiNE#i3N{#>U*)od+I& z>vFs|l_}?z$g3;=cTFrVX4sM0?E1_nkipzwTTgWFnO97O)?O>`8Rgo4Z}!XD^LpO< z()); addBootstrapSeed(wrapper); return wrapper; @@ -234,10 +240,10 @@ public static KeyStoreWrapper load(Path configDir) throws IOException { } Directory directory = new NIOFSDirectory(configDir); - try (ChecksumIndexInput input = EndiannessReverserUtil.openChecksumInput(directory, KEYSTORE_FILENAME, IOContext.READONCE)) { + try (ChecksumIndexInput input = directory.openChecksumInput(KEYSTORE_FILENAME, IOContext.READONCE)) { final int formatVersion; try { - formatVersion = CodecUtil.checkHeader(input, KEYSTORE_FILENAME, MIN_FORMAT_VERSION, FORMAT_VERSION); + formatVersion = CodecUtil.checkHeader(input, KEYSTORE_FILENAME, MIN_FORMAT_VERSION, CURRENT_VERSION); } catch (IndexFormatTooOldException e) { throw new IllegalStateException("The Elasticsearch keystore [" + keystoreFile + "] format is too old. " + "You should delete and recreate it in order to upgrade.", e); @@ -252,7 +258,7 @@ public static KeyStoreWrapper load(Path configDir) throws IOException { + String.format(Locale.ROOT, "%02x", hasPasswordByte)); } - if (formatVersion <= 2) { + if (formatVersion <= V2_VERSION) { String type = input.readString(); if (type.equals("PKCS12") == false) { throw new IllegalStateException("Corrupted legacy keystore string encryption algorithm"); @@ -262,7 +268,7 @@ public static KeyStoreWrapper load(Path configDir) throws IOException { if (stringKeyAlgo.equals("PBE") == false) { throw new IllegalStateException("Corrupted legacy keystore string encryption algorithm"); } - if (formatVersion == 2) { + if (formatVersion == V2_VERSION) { final String fileKeyAlgo = input.readString(); if (fileKeyAlgo.equals("PBE") == false) { throw new IllegalStateException("Corrupted legacy keystore file encryption algorithm"); @@ -271,7 +277,7 @@ public static KeyStoreWrapper load(Path configDir) throws IOException { } final byte[] dataBytes; - if (formatVersion == 2) { + if (formatVersion == V2_VERSION) { // For v2 we had a map of strings containing the types for each setting. In v3 this map is now // part of the encrypted bytes. Unfortunately we cannot seek backwards with checksum input, so // we cannot just read the map and find out how long it is. So instead we read the map and @@ -284,14 +290,24 @@ public static KeyStoreWrapper load(Path configDir) throws IOException { output.writeUTF(entry.getKey()); output.writeUTF(entry.getValue()); } - int keystoreLen = input.readInt(); + final int keystoreLen; + if (formatVersion < LE_VERSION) { + keystoreLen = Integer.reverseBytes(input.readInt()); + } else { + keystoreLen = input.readInt(); + } byte[] keystoreBytes = new byte[keystoreLen]; input.readBytes(keystoreBytes, 0, keystoreLen); output.write(keystoreBytes); } dataBytes = bytes.toByteArray(); } else { - int dataBytesLen = input.readInt(); + int dataBytesLen; + if (formatVersion < LE_VERSION) { + dataBytesLen = Integer.reverseBytes(input.readInt()); + } else { + dataBytesLen = input.readInt(); + } dataBytes = new byte[dataBytesLen]; input.readBytes(dataBytes, 0, dataBytesLen); } @@ -303,7 +319,7 @@ public static KeyStoreWrapper load(Path configDir) throws IOException { /** Upgrades the format of the keystore, if necessary. */ public static void upgrade(KeyStoreWrapper wrapper, Path configDir, char[] password) throws Exception { - if (wrapper.getFormatVersion() == FORMAT_VERSION && wrapper.getSettingNames().contains(SEED_SETTING.getKey())) { + if (wrapper.getFormatVersion() == CURRENT_VERSION && wrapper.getSettingNames().contains(SEED_SETTING.getKey())) { return; } // add keystore.seed if necessary @@ -352,7 +368,7 @@ public void decrypt(char[] password) throws GeneralSecurityException, IOExceptio if (entries.get() != null) { throw new IllegalStateException("Keystore has already been decrypted"); } - if (formatVersion <= 2) { + if (formatVersion <= V2_VERSION) { decryptLegacyEntries(); if (password.length != 0) { throw new IllegalArgumentException("Keystore format does not accept non-empty passwords"); @@ -363,21 +379,18 @@ public void decrypt(char[] password) throws GeneralSecurityException, IOExceptio final byte[] salt; final byte[] iv; final byte[] encryptedBytes; - try (ByteArrayInputStream bytesStream = new ByteArrayInputStream(dataBytes); - DataInputStream input = new DataInputStream(bytesStream)) { - int saltLen = input.readInt(); - salt = new byte[saltLen]; - input.readFully(salt); - int ivLen = input.readInt(); - iv = new byte[ivLen]; - input.readFully(iv); - int encryptedLen = input.readInt(); - encryptedBytes = new byte[encryptedLen]; - input.readFully(encryptedBytes); - if (input.read() != -1) { + try { + final ByteArrayDataInput input = new ByteArrayDataInput(dataBytes); + // Wrap the DataInput for old version that are written in BE + final DataInput maybeWrappedInput = formatVersion < LE_VERSION ? EndiannessReverserUtil.wrapDataInput(input) : input; + salt = readByteArray(maybeWrappedInput); + iv = readByteArray(maybeWrappedInput); + encryptedBytes = readByteArray(maybeWrappedInput); + // check we read all the buffer + if (input.eof() == false) { throw new SecurityException("Keystore has been corrupted or tampered with"); } - } catch (EOFException e) { + } catch (ArrayIndexOutOfBoundsException e) { throw new SecurityException("Keystore has been corrupted or tampered with", e); } @@ -389,7 +402,7 @@ public void decrypt(char[] password) throws GeneralSecurityException, IOExceptio int numEntries = input.readInt(); while (numEntries-- > 0) { String setting = input.readUTF(); - if (formatVersion == 3) { + if (formatVersion == V3_VERSION) { // legacy, the keystore format would previously store the entry type input.readUTF(); } @@ -409,6 +422,13 @@ public void decrypt(char[] password) throws GeneralSecurityException, IOExceptio } } + private byte[] readByteArray(DataInput input) throws IOException { + final int len = input.readInt(); + final byte[] b = new byte[len]; + input.readBytes(b, 0, len); + return b; + } + /** Encrypt the keystore entries and return the encrypted data. */ private byte[] encrypt(char[] password, byte[] salt, byte[] iv) throws GeneralSecurityException, IOException { assert isLoaded(); @@ -435,7 +455,7 @@ private void decryptLegacyEntries() throws GeneralSecurityException, IOException ByteArrayInputStream inputBytes = new ByteArrayInputStream(dataBytes); try (DataInputStream input = new DataInputStream(inputBytes)) { // first read the setting types map - if (formatVersion == 2) { + if (formatVersion == V2_VERSION) { int numSettings = input.readInt(); for (int i = 0; i < numSettings; ++i) { String key = input.readUTF(); @@ -449,7 +469,7 @@ private void decryptLegacyEntries() throws GeneralSecurityException, IOException // verify the settings metadata matches the keystore entries Enumeration aliases = keystore.aliases(); - if (formatVersion == 1) { + if (formatVersion == MIN_FORMAT_VERSION) { while (aliases.hasMoreElements()) { settingTypes.put(aliases.nextElement(), EntryType.STRING); } @@ -513,8 +533,8 @@ public synchronized void save(Path configDir, char[] password, boolean preserveP // write to tmp file first, then overwrite String tmpFile = KEYSTORE_FILENAME + ".tmp"; Path keystoreTempFile = configDir.resolve(tmpFile); - try (IndexOutput output = EndiannessReverserUtil.createOutput(directory, tmpFile, IOContext.DEFAULT)) { - CodecUtil.writeHeader(output, KEYSTORE_FILENAME, FORMAT_VERSION); + try (IndexOutput output = directory.createOutput(tmpFile, IOContext.DEFAULT)) { + CodecUtil.writeHeader(output, KEYSTORE_FILENAME, CURRENT_VERSION); output.writeByte(password.length == 0 ? (byte)0 : (byte)1); // new cipher params From 377f546d82bbe144f380b679d7230eceb0be8e02 Mon Sep 17 00:00:00 2001 From: Armin Braun Date: Mon, 27 Sep 2021 11:23:57 +0200 Subject: [PATCH 004/250] Filter Unneeded SnapshotInfo Instances Early in TransportGetSnapshotsAction (#78032) Better to filter as early as possible to release the memory asap and not even fetch things we don't need to fetch to begin with. There's still a bunch of spots remaining where similar optimizations can be added quickly before we implement the system index for the remaining searching/fetching that we can't easily exclude up-front. This already gives vastly improved performance for many requests though for obvious reasons. --- .../get/TransportGetSnapshotsAction.java | 302 ++++++++++++------ 1 file changed, 203 insertions(+), 99 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/get/TransportGetSnapshotsAction.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/get/TransportGetSnapshotsAction.java index 327f74f2050de..f50f1d2023242 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/get/TransportGetSnapshotsAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/get/TransportGetSnapshotsAction.java @@ -55,6 +55,7 @@ import java.util.Map; import java.util.Objects; import java.util.Set; +import java.util.function.BiPredicate; import java.util.function.Predicate; import java.util.function.ToLongFunction; import java.util.stream.Collectors; @@ -107,7 +108,12 @@ protected void masterOperation( getMultipleReposSnapshotInfo( request.isSingleRepositoryRequest() == false, state.custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY), - TransportGetRepositoriesAction.getRepositories(state, request.repositories()), + maybeFilterRepositories( + TransportGetRepositoriesAction.getRepositories(state, request.repositories()), + request.sort(), + request.order(), + request.fromSortValue() + ), request.snapshots(), request.ignoreUnavailable(), request.verbose(), @@ -117,11 +123,31 @@ protected void masterOperation( request.offset(), request.size(), request.order(), - buildSnapshotPredicate(request.sort(), request.order(), request.policies(), request.fromSortValue()), + new SnapshotPredicates(request), listener ); } + /** + * Filters the list of repositories that a request will fetch snapshots from in the special case of sorting by repository + * name and having a non-null value for {@link GetSnapshotsRequest#fromSortValue()} on the request to exclude repositories outside + * the sort value range if possible. + */ + private static List maybeFilterRepositories( + List repositories, + GetSnapshotsRequest.SortBy sortBy, + SortOrder order, + @Nullable String fromSortValue + ) { + if (sortBy != GetSnapshotsRequest.SortBy.REPOSITORY || fromSortValue == null) { + return repositories; + } + final Predicate predicate = order == SortOrder.ASC + ? repositoryMetadata -> fromSortValue.compareTo(repositoryMetadata.name()) <= 0 + : repositoryMetadata -> fromSortValue.compareTo(repositoryMetadata.name()) >= 0; + return repositories.stream().filter(predicate).collect(Collectors.toUnmodifiableList()); + } + private void getMultipleReposSnapshotInfo( boolean isMultiRepoRequest, SnapshotsInProgress snapshotsInProgress, @@ -135,7 +161,7 @@ private void getMultipleReposSnapshotInfo( int offset, int size, SortOrder order, - @Nullable Predicate predicate, + SnapshotPredicates predicates, ActionListener listener ) { // short-circuit if there are no repos, because we can not create GroupedActionListener of size 0 @@ -155,7 +181,7 @@ private void getMultipleReposSnapshotInfo( .map(Tuple::v1) .filter(Objects::nonNull) .collect(Collectors.toMap(Tuple::v1, Tuple::v2)); - final SnapshotsInRepo snInfos = sortAndFilterSnapshots(allSnapshots, sortBy, after, offset, size, order, predicate); + final SnapshotsInRepo snInfos = sortSnapshots(allSnapshots, sortBy, after, offset, size, order); final List snapshotInfos = snInfos.snapshotInfos; final int remaining = snInfos.remaining + responses.stream() .map(Tuple::v2) @@ -179,7 +205,7 @@ private void getMultipleReposSnapshotInfo( snapshotsInProgress, repoName, snapshots, - predicate, + predicates, ignoreUnavailable, verbose, cancellableTask, @@ -201,7 +227,7 @@ private void getSingleRepoSnapshotInfo( SnapshotsInProgress snapshotsInProgress, String repo, String[] snapshots, - Predicate predicate, + SnapshotPredicates predicates, boolean ignoreUnavailable, boolean verbose, CancellableTask task, @@ -239,7 +265,7 @@ private void getSingleRepoSnapshotInfo( sortBy, after, order, - predicate, + predicates, listener ), listener::onFailure @@ -279,16 +305,19 @@ private void loadSnapshotInfos( GetSnapshotsRequest.SortBy sortBy, @Nullable final GetSnapshotsRequest.After after, SortOrder order, - @Nullable Predicate predicate, + SnapshotPredicates predicates, ActionListener listener ) { if (task.notifyIfCancelled(listener)) { return; } + final BiPredicate preflightPredicate = predicates.preflightPredicate(); if (repositoryData != null) { for (SnapshotId snapshotId : repositoryData.getSnapshotIds()) { - allSnapshotIds.put(snapshotId.getName(), new Snapshot(repo, snapshotId)); + if (preflightPredicate == null || preflightPredicate.test(snapshotId, repositoryData)) { + allSnapshotIds.put(snapshotId.getName(), new Snapshot(repo, snapshotId)); + } } } @@ -351,11 +380,11 @@ private void loadSnapshotInfos( sortBy, after, order, - predicate, + predicates.snapshotPredicate(), listener ); } else { - assert predicate == null : "filtering is not supported in non-verbose mode"; + assert predicates.snapshotPredicate() == null : "filtering is not supported in non-verbose mode"; final SnapshotsInRepo snapshotInfos; if (repositoryData != null) { // want non-current snapshots as well, which are found in the repository data @@ -407,7 +436,10 @@ private void snapshots( ); for (SnapshotsInProgress.Entry entry : entries) { if (snapshotIdsToIterate.remove(entry.snapshot().getSnapshotId())) { - snapshotSet.add(new SnapshotInfo(entry)); + final SnapshotInfo snapshotInfo = new SnapshotInfo(entry); + if (predicate == null || predicate.test(snapshotInfo)) { + snapshotSet.add(new SnapshotInfo(entry)); + } } } // then, look in the repository if there's any matching snapshots left @@ -420,7 +452,7 @@ private void snapshots( final ActionListener allDoneListener = listener.delegateFailure((l, v) -> { final ArrayList snapshotList = new ArrayList<>(snapshotInfos); snapshotList.addAll(snapshotSet); - listener.onResponse(sortAndFilterSnapshots(snapshotList, sortBy, after, 0, GetSnapshotsRequest.NO_LIMIT, order, predicate)); + listener.onResponse(sortSnapshots(snapshotList, sortBy, after, 0, GetSnapshotsRequest.NO_LIMIT, order)); }); if (snapshotIdsToIterate.isEmpty()) { allDoneListener.onResponse(null); @@ -438,7 +470,11 @@ private void snapshots( snapshotIdsToIterate, ignoreUnavailable == false, task::isCancelled, - (context, snapshotInfo) -> snapshotInfos.add(snapshotInfo), + predicate == null ? (context, snapshotInfo) -> snapshotInfos.add(snapshotInfo) : (context, snapshotInfo) -> { + if (predicate.test(snapshotInfo)) { + snapshotInfos.add(snapshotInfo); + } + }, allDoneListener ) ); @@ -508,43 +544,36 @@ private static SnapshotsInRepo buildSimpleSnapshotInfos( private static final Comparator BY_REPOSITORY = Comparator.comparing(SnapshotInfo::repository) .thenComparing(SnapshotInfo::snapshotId); - private static SnapshotsInRepo sortAndFilterSnapshots( - final List snapshotInfos, - final GetSnapshotsRequest.SortBy sortBy, - final @Nullable GetSnapshotsRequest.After after, - final int offset, - final int size, - final SortOrder order, - final @Nullable Predicate predicate - ) { - final List filteredSnapshotInfos; - if (predicate == null) { - filteredSnapshotInfos = snapshotInfos; - } else { - filteredSnapshotInfos = snapshotInfos.stream().filter(predicate).collect(Collectors.toUnmodifiableList()); + private static long getDuration(SnapshotId snapshotId, RepositoryData repositoryData) { + final RepositoryData.SnapshotDetails details = repositoryData.getSnapshotDetails(snapshotId); + if (details == null) { + return -1; + } + final long startTime = details.getStartTimeMillis(); + if (startTime == -1) { + return -1; } - return sortSnapshots(filteredSnapshotInfos, sortBy, after, offset, size, order); + final long endTime = details.getEndTimeMillis(); + if (endTime == -1) { + return -1; + } + return endTime - startTime; } - private static Predicate buildSnapshotPredicate( - GetSnapshotsRequest.SortBy sortBy, - SortOrder order, - String[] slmPolicies, - String fromSortValue - ) { - Predicate predicate = null; - if (slmPolicies.length > 0) { - predicate = filterBySLMPolicies(slmPolicies); - } - if (fromSortValue != null) { - final Predicate fromSortValuePredicate = buildFromSortValuePredicate(sortBy, fromSortValue, order, null, null); - if (predicate == null) { - predicate = fromSortValuePredicate; - } else { - predicate = fromSortValuePredicate.and(predicate); + private static long getStartTime(SnapshotId snapshotId, RepositoryData repositoryData) { + final RepositoryData.SnapshotDetails details = repositoryData.getSnapshotDetails(snapshotId); + return details == null ? -1 : details.getStartTimeMillis(); + } + + private static int indexCount(SnapshotId snapshotId, RepositoryData repositoryData) { + // TODO: this could be made more efficient by caching this number in RepositoryData + int indexCount = 0; + for (IndexId idx : repositoryData.getIndices().values()) { + if (repositoryData.getSnapshots(idx).contains(snapshotId)) { + indexCount++; } } - return predicate; + return indexCount; } private static SnapshotsInRepo sortSnapshots( @@ -586,7 +615,7 @@ private static SnapshotsInRepo sortSnapshots( if (after != null) { assert offset == 0 : "can't combine after and offset but saw [" + after + "] and offset [" + offset + "]"; - infos = infos.filter(buildFromSortValuePredicate(sortBy, after.value(), order, after.snapshotName(), after.repoName())); + infos = infos.filter(buildAfterPredicate(sortBy, after, order)); } infos = infos.sorted(order == SortOrder.DESC ? comparator.reversed() : comparator).skip(offset); final List allSnapshots = infos.collect(Collectors.toUnmodifiableList()); @@ -602,64 +631,39 @@ private static SnapshotsInRepo sortSnapshots( return new SnapshotsInRepo(resultSet, snapshotInfos.size(), allSnapshots.size() - resultSet.size()); } - private static Predicate buildFromSortValuePredicate( + private static Predicate buildAfterPredicate( GetSnapshotsRequest.SortBy sortBy, - String after, - SortOrder order, - @Nullable String snapshotName, - @Nullable String repoName + GetSnapshotsRequest.After after, + SortOrder order ) { - final Predicate isAfter; + final String snapshotName = after.snapshotName(); + final String repoName = after.repoName(); + final String value = after.value(); switch (sortBy) { case START_TIME: - isAfter = filterByLongOffset(SnapshotInfo::startTime, Long.parseLong(after), snapshotName, repoName, order); - break; + return filterByLongOffset(SnapshotInfo::startTime, Long.parseLong(value), snapshotName, repoName, order); case NAME: - if (snapshotName == null) { - assert repoName == null : "no snapshot name given but saw repo name [" + repoName + "]"; - isAfter = order == SortOrder.ASC - ? snapshotInfo -> after.compareTo(snapshotInfo.snapshotId().getName()) <= 0 - : snapshotInfo -> after.compareTo(snapshotInfo.snapshotId().getName()) >= 0; - } else { - isAfter = order == SortOrder.ASC - ? (info -> compareName(snapshotName, repoName, info) < 0) - : (info -> compareName(snapshotName, repoName, info) > 0); - } - break; + // TODO: cover via pre-flight predicate + return order == SortOrder.ASC + ? (info -> compareName(snapshotName, repoName, info) < 0) + : (info -> compareName(snapshotName, repoName, info) > 0); case DURATION: - isAfter = filterByLongOffset( - info -> info.endTime() - info.startTime(), - Long.parseLong(after), - snapshotName, - repoName, - order - ); - break; + return filterByLongOffset(info -> info.endTime() - info.startTime(), Long.parseLong(value), snapshotName, repoName, order); case INDICES: - isAfter = filterByLongOffset(info -> info.indices().size(), Integer.parseInt(after), snapshotName, repoName, order); - break; + // TODO: cover via pre-flight predicate + return filterByLongOffset(info -> info.indices().size(), Integer.parseInt(value), snapshotName, repoName, order); case SHARDS: - isAfter = filterByLongOffset(SnapshotInfo::totalShards, Integer.parseInt(after), snapshotName, repoName, order); - break; + return filterByLongOffset(SnapshotInfo::totalShards, Integer.parseInt(value), snapshotName, repoName, order); case FAILED_SHARDS: - isAfter = filterByLongOffset(SnapshotInfo::failedShards, Integer.parseInt(after), snapshotName, repoName, order); - break; + return filterByLongOffset(SnapshotInfo::failedShards, Integer.parseInt(value), snapshotName, repoName, order); case REPOSITORY: - if (snapshotName == null) { - assert repoName == null : "no snapshot name given but saw repo name [" + repoName + "]"; - isAfter = order == SortOrder.ASC - ? snapshotInfo -> after.compareTo(snapshotInfo.repository()) <= 0 - : snapshotInfo -> after.compareTo(snapshotInfo.repository()) >= 0; - } else { - isAfter = order == SortOrder.ASC - ? (info -> compareRepositoryName(snapshotName, repoName, info) < 0) - : (info -> compareRepositoryName(snapshotName, repoName, info) > 0); - } - break; + // TODO: cover via pre-flight predicate + return order == SortOrder.ASC + ? (info -> compareRepositoryName(snapshotName, repoName, info) < 0) + : (info -> compareRepositoryName(snapshotName, repoName, info) > 0); default: throw new AssertionError("unexpected sort column [" + sortBy + "]"); } - return isAfter; } private static Predicate filterBySLMPolicies(String[] slmPolicies) { @@ -701,20 +705,19 @@ private static Predicate filterBySLMPolicies(String[] slmPolicies) }; } + private static Predicate filterByLongOffset(ToLongFunction extractor, long after, SortOrder order) { + return order == SortOrder.ASC ? info -> after <= extractor.applyAsLong(info) : info -> after >= extractor.applyAsLong(info); + } + private static Predicate filterByLongOffset( ToLongFunction extractor, long after, - @Nullable String snapshotName, - @Nullable String repoName, + String snapshotName, + String repoName, SortOrder order ) { - if (snapshotName == null) { - assert repoName == null : "no snapshot name given but saw repo name [" + repoName + "]"; - return order == SortOrder.ASC ? info -> after <= extractor.applyAsLong(info) : info -> after >= extractor.applyAsLong(info); - } return order == SortOrder.ASC ? info -> { final long val = extractor.applyAsLong(info); - return after < val || (after == val && compareName(snapshotName, repoName, info) < 0); } : info -> { final long val = extractor.applyAsLong(info); @@ -738,6 +741,107 @@ private static int compareName(String name, String repoName, SnapshotInfo info) return repoName.compareTo(info.repository()); } + /** + * A pair of predicates for the get snapshots action. The {@link #preflightPredicate()} is applied to combinations of snapshot id and + * repository data to determine which snapshots to fully load from the repository and rules out all snapshots that do not match the + * given {@link GetSnapshotsRequest} that can be ruled out through the information in {@link RepositoryData}. + * The predicate returned by {@link #snapshotPredicate()} is then applied the instances of {@link SnapshotInfo} that were loaded from + * the repository to filter out those remaining that did not match the request but could not be ruled out without loading their + * {@link SnapshotInfo}. + */ + private static final class SnapshotPredicates { + + private final Predicate snapshotPredicate; + + private final BiPredicate preflightPredicate; + + SnapshotPredicates(GetSnapshotsRequest request) { + Predicate snapshotPredicate = null; + final String[] slmPolicies = request.policies(); + final String fromSortValue = request.fromSortValue(); + if (slmPolicies.length > 0) { + snapshotPredicate = filterBySLMPolicies(slmPolicies); + } + final GetSnapshotsRequest.SortBy sortBy = request.sort(); + final SortOrder order = request.order(); + if (fromSortValue == null) { + preflightPredicate = null; + } else { + final Predicate fromSortValuePredicate; + switch (sortBy) { + case START_TIME: + final long after = Long.parseLong(fromSortValue); + preflightPredicate = order == SortOrder.ASC ? (snapshotId, repositoryData) -> { + final long startTime = getStartTime(snapshotId, repositoryData); + return startTime == -1 || after <= startTime; + } : (snapshotId, repositoryData) -> { + final long startTime = getStartTime(snapshotId, repositoryData); + return startTime == -1 || after >= startTime; + }; + fromSortValuePredicate = filterByLongOffset(SnapshotInfo::startTime, after, order); + break; + case NAME: + preflightPredicate = order == SortOrder.ASC + ? (snapshotId, repositoryData) -> fromSortValue.compareTo(snapshotId.getName()) <= 0 + : (snapshotId, repositoryData) -> fromSortValue.compareTo(snapshotId.getName()) >= 0; + fromSortValuePredicate = null; + break; + case DURATION: + final long afterDuration = Long.parseLong(fromSortValue); + preflightPredicate = order == SortOrder.ASC ? (snapshotId, repositoryData) -> { + final long duration = getDuration(snapshotId, repositoryData); + return duration == -1 || afterDuration <= duration; + } : (snapshotId, repositoryData) -> { + final long duration = getDuration(snapshotId, repositoryData); + return duration == -1 || afterDuration >= duration; + }; + fromSortValuePredicate = filterByLongOffset(info -> info.endTime() - info.startTime(), afterDuration, order); + break; + case INDICES: + final int afterIndexCount = Integer.parseInt(fromSortValue); + preflightPredicate = order == SortOrder.ASC + ? (snapshotId, repositoryData) -> afterIndexCount <= indexCount(snapshotId, repositoryData) + : (snapshotId, repositoryData) -> afterIndexCount >= indexCount(snapshotId, repositoryData); + fromSortValuePredicate = null; + break; + case REPOSITORY: + // already handled in #maybeFilterRepositories + preflightPredicate = null; + fromSortValuePredicate = null; + break; + case SHARDS: + preflightPredicate = null; + fromSortValuePredicate = filterByLongOffset(SnapshotInfo::totalShards, Integer.parseInt(fromSortValue), order); + break; + case FAILED_SHARDS: + preflightPredicate = null; + fromSortValuePredicate = filterByLongOffset(SnapshotInfo::failedShards, Integer.parseInt(fromSortValue), order); + break; + default: + throw new AssertionError("unexpected sort column [" + sortBy + "]"); + } + + if (snapshotPredicate == null) { + snapshotPredicate = fromSortValuePredicate; + } else if (fromSortValuePredicate != null) { + snapshotPredicate = fromSortValuePredicate.and(snapshotPredicate); + } + } + this.snapshotPredicate = snapshotPredicate; + } + + @Nullable + public Predicate snapshotPredicate() { + return snapshotPredicate; + } + + @Nullable + public BiPredicate preflightPredicate() { + return preflightPredicate; + } + + } + private static final class SnapshotsInRepo { private final List snapshotInfos; From 28c74a0b5d28c879f01416f904bcd659442258d2 Mon Sep 17 00:00:00 2001 From: Ignacio Vera Date: Mon, 27 Sep 2021 13:18:04 +0200 Subject: [PATCH 005/250] Don't use endianness reverse util for writing metadata state file (#78309) The endianness of different versions is handled when reading files. --- .../gateway/MetadataStateFormat.java | 22 ++++++++++++------ .../gateway/MetadataStateFormatTests.java | 17 ++++++++++---- .../gateway/{global-3.st => global-3-V1.st} | Bin .../org/elasticsearch/gateway/global-3-V2.st | Bin 0 -> 267 bytes 4 files changed, 28 insertions(+), 11 deletions(-) rename server/src/test/resources/org/elasticsearch/gateway/{global-3.st => global-3-V1.st} (100%) create mode 100644 server/src/test/resources/org/elasticsearch/gateway/global-3-V2.st diff --git a/server/src/main/java/org/elasticsearch/gateway/MetadataStateFormat.java b/server/src/main/java/org/elasticsearch/gateway/MetadataStateFormat.java index 62815c03f47df..34d48db543d46 100644 --- a/server/src/main/java/org/elasticsearch/gateway/MetadataStateFormat.java +++ b/server/src/main/java/org/elasticsearch/gateway/MetadataStateFormat.java @@ -10,7 +10,6 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.message.ParameterizedMessage; -import org.apache.lucene.backward_codecs.store.EndiannessReverserUtil; import org.apache.lucene.codecs.CodecUtil; import org.apache.lucene.index.CorruptIndexException; import org.apache.lucene.index.IndexFormatTooNewException; @@ -56,8 +55,11 @@ public abstract class MetadataStateFormat { public static final String STATE_FILE_EXTENSION = ".st"; private static final String STATE_FILE_CODEC = "state"; + // original version format private static final int MIN_COMPATIBLE_STATE_FILE_VERSION = 1; - private static final int STATE_FILE_VERSION = 1; + // Lucene directory API changed to LE, ES 8.0 + private static final int LE_VERSION = 2; + private static final int CURRENT_VERSION = LE_VERSION; private final String prefix; private final Pattern stateFilePattern; @@ -92,8 +94,8 @@ private void writeStateToFirstLocation(final T state, Path stateLocation, Direct throws WriteStateException { try { deleteFileIfExists(stateLocation, stateDir, tmpFileName); - try (IndexOutput out = EndiannessReverserUtil.createOutput(stateDir, tmpFileName, IOContext.DEFAULT)) { - CodecUtil.writeHeader(out, STATE_FILE_CODEC, STATE_FILE_VERSION); + try (IndexOutput out = stateDir.createOutput(tmpFileName, IOContext.DEFAULT)) { + CodecUtil.writeHeader(out, STATE_FILE_CODEC, CURRENT_VERSION); out.writeInt(FORMAT.index()); try (XContentBuilder builder = newXContentBuilder(FORMAT, new IndexOutputOutputStream(out) { @Override @@ -268,11 +270,17 @@ protected XContentBuilder newXContentBuilder(XContentType type, OutputStream str */ public final T read(NamedXContentRegistry namedXContentRegistry, Path file) throws IOException { try (Directory dir = newDirectory(file.getParent())) { - try (IndexInput indexInput = EndiannessReverserUtil.openInput(dir, file.getFileName().toString(), IOContext.DEFAULT)) { + try (IndexInput indexInput = dir.openInput(file.getFileName().toString(), IOContext.DEFAULT)) { // We checksum the entire file before we even go and parse it. If it's corrupted we barf right here. CodecUtil.checksumEntireFile(indexInput); - CodecUtil.checkHeader(indexInput, STATE_FILE_CODEC, MIN_COMPATIBLE_STATE_FILE_VERSION, STATE_FILE_VERSION); - final XContentType xContentType = XContentType.values()[indexInput.readInt()]; + final int format = + CodecUtil.checkHeader(indexInput, STATE_FILE_CODEC, MIN_COMPATIBLE_STATE_FILE_VERSION, CURRENT_VERSION); + final XContentType xContentType; + if (format < LE_VERSION) { + xContentType = XContentType.values()[Integer.reverseBytes(indexInput.readInt())]; + } else { + xContentType = XContentType.values()[indexInput.readInt()]; + } if (xContentType != FORMAT) { throw new IllegalStateException("expected state in " + file + " to be " + FORMAT + " format but was " + xContentType); } diff --git a/server/src/test/java/org/elasticsearch/gateway/MetadataStateFormatTests.java b/server/src/test/java/org/elasticsearch/gateway/MetadataStateFormatTests.java index 8dc61cc03e039..791ffda50cb63 100644 --- a/server/src/test/java/org/elasticsearch/gateway/MetadataStateFormatTests.java +++ b/server/src/test/java/org/elasticsearch/gateway/MetadataStateFormatTests.java @@ -42,14 +42,23 @@ @LuceneTestCase.SuppressFileSystems("ExtrasFS") // TODO: fix test to work with ExtrasFS public class MetadataStateFormatTests extends ESTestCase { + + public void testReadClusterStateV1() throws IOException { + assertReadClusterState("global-3-V1.st"); + } + + public void testReadClusterStateV2() throws IOException { + assertReadClusterState("global-3-V2.st"); + } + /** * Ensure we can read a pre-generated cluster state. */ - public void testReadClusterState() throws IOException { + private void assertReadClusterState(String clusterState) throws IOException { final MetadataStateFormat format = new MetadataStateFormat("global-") { @Override - public void toXContent(XContentBuilder builder, Metadata state) { + public void toXContent(XContentBuilder builder, Metadata state) throws IOException { fail("this test doesn't write"); } @@ -59,9 +68,9 @@ public Metadata fromXContent(XContentParser parser) throws IOException { } }; Path tmp = createTempDir(); - final InputStream resource = this.getClass().getResourceAsStream("global-3.st"); + final InputStream resource = this.getClass().getResourceAsStream(clusterState); assertThat(resource, notNullValue()); - Path dst = tmp.resolve("global-3.st"); + Path dst = tmp.resolve(clusterState); Files.copy(resource, dst); Metadata read = format.read(xContentRegistry(), dst); assertThat(read, notNullValue()); diff --git a/server/src/test/resources/org/elasticsearch/gateway/global-3.st b/server/src/test/resources/org/elasticsearch/gateway/global-3-V1.st similarity index 100% rename from server/src/test/resources/org/elasticsearch/gateway/global-3.st rename to server/src/test/resources/org/elasticsearch/gateway/global-3-V1.st diff --git a/server/src/test/resources/org/elasticsearch/gateway/global-3-V2.st b/server/src/test/resources/org/elasticsearch/gateway/global-3-V2.st new file mode 100644 index 0000000000000000000000000000000000000000..44b3f3142fd8fc52a5cf6899bfe1121ef04f30b8 GIT binary patch literal 267 zcmcD&o+Hj$T#{Il%D}+D#0Vs;G`U!Rb>ya&B=lGNOS9H3{4fBo*u%u7kF&`mE&EK99SEK2#+S(2ZdR9upumkLt)`}YBj P$uEHZ1%t`^4yOVDdH{1B literal 0 HcmV?d00001 From 9f3b251741ca2e4f42064f7a5af997120f3ff62c Mon Sep 17 00:00:00 2001 From: Chris Hegarty <62058229+ChrisHegarty@users.noreply.github.com> Date: Mon, 27 Sep 2021 13:38:51 +0100 Subject: [PATCH 006/250] Fix split package org.apache.lucene.queryparser.classic (#78307) With LUCENE-10115 integrated, we can now remove the package -private dependency with org.apache.lucene.queryparser.classic. XQueryParser, and override getFuzzyDistance to customise the calculation of the similarity distance for fuzzy queries. --- server/build.gradle | 3 +- .../queryparser/classic/XQueryParser.java | 29 ------------------- .../index/search/QueryStringQueryParser.java | 17 +++++------ 3 files changed, 9 insertions(+), 40 deletions(-) delete mode 100644 server/src/main/java/org/apache/lucene/queryparser/classic/XQueryParser.java diff --git a/server/build.gradle b/server/build.gradle index c8b354d92ec79..c1a0b05f13a88 100644 --- a/server/build.gradle +++ b/server/build.gradle @@ -269,8 +269,7 @@ tasks.named("licenseHeaders").configure { tasks.named('splitPackagesAudit').configure { // Lucene packages should be owned by Lucene! - ignoreClasses 'org.apache.lucene.queryparser.classic.XQueryParser', - 'org.apache.lucene.queries.BinaryDocValuesRangeQuery', + ignoreClasses 'org.apache.lucene.queries.BinaryDocValuesRangeQuery', 'org.apache.lucene.queries.BlendedTermQuery', 'org.apache.lucene.queries.SpanMatchNoDocsQuery', 'org.apache.lucene.search.grouping.CollapseTopFieldDocs', diff --git a/server/src/main/java/org/apache/lucene/queryparser/classic/XQueryParser.java b/server/src/main/java/org/apache/lucene/queryparser/classic/XQueryParser.java deleted file mode 100644 index aa840bca89dc2..0000000000000 --- a/server/src/main/java/org/apache/lucene/queryparser/classic/XQueryParser.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * 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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -package org.apache.lucene.queryparser.classic; - -import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.search.Query; - -/** - * This class is just a workaround to make {@link QueryParser#handleBareFuzzy(String, Token, String)} accessible by sub-classes. - * It is needed for {@link QueryParser}s that need to override the parsing of the slop in a fuzzy query (e.g. word~2, word~). - * - * TODO: We should maybe rewrite this with the flexible query parser which matches the same syntax with more freedom. - */ -public class XQueryParser extends QueryParser { - public XQueryParser(String f, Analyzer a) { - super(f, a); - } - - @Override - protected Query handleBareFuzzy(String field, Token fuzzySlop, String termImage) throws ParseException { - return super.handleBareFuzzy(field, fuzzySlop, termImage); - } -} diff --git a/server/src/main/java/org/elasticsearch/index/search/QueryStringQueryParser.java b/server/src/main/java/org/elasticsearch/index/search/QueryStringQueryParser.java index e4d1d52bd9939..4b5536cfb2b87 100644 --- a/server/src/main/java/org/elasticsearch/index/search/QueryStringQueryParser.java +++ b/server/src/main/java/org/elasticsearch/index/search/QueryStringQueryParser.java @@ -17,8 +17,8 @@ import org.apache.lucene.queries.spans.SpanOrQuery; import org.apache.lucene.queries.spans.SpanQuery; import org.apache.lucene.queryparser.classic.ParseException; +import org.apache.lucene.queryparser.classic.QueryParser; import org.apache.lucene.queryparser.classic.Token; -import org.apache.lucene.queryparser.classic.XQueryParser; import org.apache.lucene.search.BooleanClause; import org.apache.lucene.search.BoostAttribute; import org.apache.lucene.search.BoostQuery; @@ -64,12 +64,12 @@ import static org.elasticsearch.index.search.QueryParserHelper.resolveMappingFields; /** - * A {@link XQueryParser} that uses the {@link MapperService} in order to build smarter + * A {@link QueryParser} that uses the {@link MapperService} in order to build smarter * queries based on the mapping information. - * This class uses {@link MultiMatchQueryParser} to build the text query around operators and {@link XQueryParser} + * This class uses {@link MultiMatchQueryParser} to build the text query around operators and {@link QueryParser} * to assemble the result logically. */ -public class QueryStringQueryParser extends XQueryParser { +public class QueryStringQueryParser extends QueryParser { private static final String EXISTS_FIELD = "_exists_"; private final SearchExecutionContext context; @@ -433,12 +433,11 @@ private Query getRangeQuerySingle(String field, String part1, String part2, } @Override - protected Query handleBareFuzzy(String field, Token fuzzySlop, String termImage) throws ParseException { - if (fuzzySlop.image.length() == 1) { - return getFuzzyQuery(field, termImage, fuzziness.asDistance(termImage)); + protected float getFuzzyDistance(Token fuzzyToken, String termStr) { + if (fuzzyToken.image.length() == 1) { + return fuzziness.asDistance(termStr); } - float distance = Fuzziness.fromString(fuzzySlop.image.substring(1)).asDistance(termImage); - return getFuzzyQuery(field, termImage, distance); + return Fuzziness.fromString(fuzzyToken.image.substring(1)).asDistance(termStr); } @Override From b20939f07148fdc886ae789b67b44a18e716e3a3 Mon Sep 17 00:00:00 2001 From: James Rodewig <40268737+jrodewig@users.noreply.github.com> Date: Mon, 27 Sep 2021 08:58:22 -0400 Subject: [PATCH 007/250] [DOCS] Document empty first line support for msearch API (#78284) Adds an 8.0 breaking change for PR #41011 --- .../migration/migrate_8_0/search.asciidoc | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docs/reference/migration/migrate_8_0/search.asciidoc b/docs/reference/migration/migrate_8_0/search.asciidoc index f8be8708ab983..20764fe968bae 100644 --- a/docs/reference/migration/migrate_8_0/search.asciidoc +++ b/docs/reference/migration/migrate_8_0/search.asciidoc @@ -6,6 +6,25 @@ //Installation and Upgrade Guide //tag::notable-breaking-changes[] +[[msearch-empty-line-support]] +.The multi search API now parses an empty first line as action metadata in text files. +[%collapsible] +==== +*Details* + +The multi search API now parses an empty first line as empty action metadata +when you provide a text file as the request body, such as when using curl's +`--data-binary` flag. + +The API no longer supports text files that contain: + +* An empty first line followed by a line containing only `{}`. +* An empty first line followed by another empty line. + +*Impact* + +Don't provide an unsupported text file to the multi search API. Requests that +include an unsupported file will return an error. +==== + [[remove-unmapped-type-string]] .The `unmapped_type: string` sort option has been removed. [%collapsible] From 272c55ec48a72ecc278131c5dcec6d1165b83fdf Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Mon, 27 Sep 2021 15:19:04 +0200 Subject: [PATCH 008/250] Warn when searching a frozen index. (#78184) The coordinating node should warn when a search request is targeting a frozen index. Relates to #70192 --- .../action/search/TransportSearchAction.java | 25 +++++++- .../search/SearchServiceTests.java | 9 ++- x-pack/plugin/build.gradle | 3 + .../index/engine/frozen/FrozenIndexTests.java | 57 +++++++++++-------- ...stractSearchableSnapshotsRestTestCase.java | 29 +++++++--- .../test/indices.freeze/10_basic.yml | 3 + .../xpack/restart/FullClusterRestartIT.java | 4 +- 7 files changed, 91 insertions(+), 39 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/action/search/TransportSearchAction.java b/server/src/main/java/org/elasticsearch/action/search/TransportSearchAction.java index 77da80ad0f7e0..e3c9608c808f9 100644 --- a/server/src/main/java/org/elasticsearch/action/search/TransportSearchAction.java +++ b/server/src/main/java/org/elasticsearch/action/search/TransportSearchAction.java @@ -20,6 +20,7 @@ import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.block.ClusterBlockException; import org.elasticsearch.cluster.block.ClusterBlockLevel; +import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.node.DiscoveryNodes; @@ -33,6 +34,8 @@ import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable; +import org.elasticsearch.common.logging.DeprecationCategory; +import org.elasticsearch.common.logging.DeprecationLogger; import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Setting.Property; import org.elasticsearch.common.util.concurrent.AtomicArray; @@ -92,6 +95,10 @@ public class TransportSearchAction extends HandledTransportAction { + private static final DeprecationLogger DEPRECATION_LOGGER = DeprecationLogger.getLogger(TransportSearchAction.class); + public static final String FROZEN_INDICES_DEPRECATION_MESSAGE = "Searching frozen indices [{}] is deprecated." + + " Consider cold or frozen tiers in place of frozen indices. The frozen feature will be removed in a feature release."; + /** The maximum number of shards for a single search request. */ public static final Setting SHARD_COUNT_LIMIT_SETTING = Setting.longSetting( "action.search.shard_count.limit", Long.MAX_VALUE, 1L, Property.Dynamic, Property.NodeScope); @@ -592,7 +599,23 @@ private Index[] resolveLocalIndices(OriginalIndices localIndices, if (localIndices == null) { return Index.EMPTY_ARRAY; //don't search on any local index (happens when only remote indices were specified) } - return indexNameExpressionResolver.concreteIndices(clusterState, localIndices, timeProvider.getAbsoluteStartMillis()); + + List frozenIndices = null; + Index[] indices = indexNameExpressionResolver.concreteIndices(clusterState, localIndices, timeProvider.getAbsoluteStartMillis()); + for (Index index : indices) { + IndexMetadata indexMetadata = clusterState.metadata().index(index); + if (indexMetadata.getSettings().getAsBoolean("index.frozen", false)) { + if (frozenIndices == null) { + frozenIndices = new ArrayList<>(); + } + frozenIndices.add(index.getName()); + } + } + if (frozenIndices != null) { + DEPRECATION_LOGGER.critical(DeprecationCategory.INDICES, "search-frozen-indices", FROZEN_INDICES_DEPRECATION_MESSAGE, + String.join(",", frozenIndices)); + } + return indices; } private void executeSearch(SearchTask task, SearchTimeProvider timeProvider, SearchRequest searchRequest, diff --git a/server/src/test/java/org/elasticsearch/search/SearchServiceTests.java b/server/src/test/java/org/elasticsearch/search/SearchServiceTests.java index 506c6845991dc..ca403ddfd1829 100644 --- a/server/src/test/java/org/elasticsearch/search/SearchServiceTests.java +++ b/server/src/test/java/org/elasticsearch/search/SearchServiceTests.java @@ -26,6 +26,7 @@ import org.elasticsearch.action.search.SearchScrollRequest; import org.elasticsearch.action.search.SearchShardTask; import org.elasticsearch.action.search.SearchType; +import org.elasticsearch.action.search.TransportSearchAction; import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.PlainActionFuture; import org.elasticsearch.action.support.WriteRequest; @@ -917,16 +918,18 @@ public void testExpandSearchThrottled() { } public void testExpandSearchFrozen() { - createIndex("frozen_index"); + String indexName = "frozen_index"; + createIndex(indexName); client().execute( InternalOrPrivateSettingsPlugin.UpdateInternalOrPrivateAction.INSTANCE, - new InternalOrPrivateSettingsPlugin.UpdateInternalOrPrivateAction.Request("frozen_index", + new InternalOrPrivateSettingsPlugin.UpdateInternalOrPrivateAction.Request(indexName, "index.frozen", "true")) .actionGet(); - client().prepareIndex("frozen_index").setId("1").setSource("field", "value").setRefreshPolicy(IMMEDIATE).get(); + client().prepareIndex(indexName).setId("1").setSource("field", "value").setRefreshPolicy(IMMEDIATE).get(); assertHitCount(client().prepareSearch().get(), 0L); assertHitCount(client().prepareSearch().setIndicesOptions(IndicesOptions.STRICT_EXPAND_OPEN_FORBID_CLOSED).get(), 1L); + assertWarnings(TransportSearchAction.FROZEN_INDICES_DEPRECATION_MESSAGE.replace("{}", indexName)); } public void testCreateReduceContext() { diff --git a/x-pack/plugin/build.gradle b/x-pack/plugin/build.gradle index ada3688e85aa0..8bbd98da21e3d 100644 --- a/x-pack/plugin/build.gradle +++ b/x-pack/plugin/build.gradle @@ -166,6 +166,9 @@ tasks.named("yamlRestTestV7CompatTransform").configure({ task -> }) tasks.named("yamlRestTestV7CompatTest").configure { systemProperty 'tests.rest.blacklist', [ + // UNMUTE after #78184 is backported to 7.x + 'indices.freeze/10_basic/Basic', + 'indices.freeze/10_basic/Test index options', // to support it, it would require to almost revert back the #48725 and complicate the code 'vectors/10_dense_vector_basic/Deprecated function signature', // not going to be supported diff --git a/x-pack/plugin/frozen-indices/src/internalClusterTest/java/org/elasticsearch/index/engine/frozen/FrozenIndexTests.java b/x-pack/plugin/frozen-indices/src/internalClusterTest/java/org/elasticsearch/index/engine/frozen/FrozenIndexTests.java index 85f1cb26056f3..7ff2c22e34ec3 100644 --- a/x-pack/plugin/frozen-indices/src/internalClusterTest/java/org/elasticsearch/index/engine/frozen/FrozenIndexTests.java +++ b/x-pack/plugin/frozen-indices/src/internalClusterTest/java/org/elasticsearch/index/engine/frozen/FrozenIndexTests.java @@ -20,6 +20,7 @@ import org.elasticsearch.action.search.SearchRequest; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.action.search.SearchType; +import org.elasticsearch.action.search.TransportSearchAction; import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.PlainActionFuture; import org.elasticsearch.cluster.block.ClusterBlockException; @@ -92,17 +93,18 @@ String openReaders(TimeValue keepAlive, String... indices) { } public void testCloseFreezeAndOpen() throws Exception { - createIndex("index", Settings.builder().put("index.number_of_shards", 2).build()); - client().prepareIndex("index").setId("1").setSource("field", "value").setRefreshPolicy(IMMEDIATE).get(); - client().prepareIndex("index").setId("2").setSource("field", "value").setRefreshPolicy(IMMEDIATE).get(); - client().prepareIndex("index").setId("3").setSource("field", "value").setRefreshPolicy(IMMEDIATE).get(); - assertAcked(client().execute(FreezeIndexAction.INSTANCE, new FreezeRequest("index")).actionGet()); + String indexName = "index"; + createIndex(indexName, Settings.builder().put("index.number_of_shards", 2).build()); + client().prepareIndex(indexName).setId("1").setSource("field", "value").setRefreshPolicy(IMMEDIATE).get(); + client().prepareIndex(indexName).setId("2").setSource("field", "value").setRefreshPolicy(IMMEDIATE).get(); + client().prepareIndex(indexName).setId("3").setSource("field", "value").setRefreshPolicy(IMMEDIATE).get(); + assertAcked(client().execute(FreezeIndexAction.INSTANCE, new FreezeRequest(indexName)).actionGet()); expectThrows( ClusterBlockException.class, - () -> client().prepareIndex("index").setId("4").setSource("field", "value").setRefreshPolicy(IMMEDIATE).get() + () -> client().prepareIndex(indexName).setId("4").setSource("field", "value").setRefreshPolicy(IMMEDIATE).get() ); IndicesService indexServices = getInstanceFromNode(IndicesService.class); - Index index = resolveIndex("index"); + Index index = resolveIndex(indexName); IndexService indexService = indexServices.indexServiceSafe(index); IndexShard shard = indexService.getShard(0); Engine engine = IndexShardTestCase.getEngine(shard); @@ -141,7 +143,7 @@ public void testCloseFreezeAndOpen() throws Exception { } while (searchResponse.getHits().getHits().length > 0); client().prepareClearScroll().addScrollId(searchResponse.getScrollId()).get(); - String pitId = openReaders(TimeValue.timeValueMinutes(1), "index"); + String pitId = openReaders(TimeValue.timeValueMinutes(1), indexName); try { for (int from = 0; from < 3; from++) { searchResponse = client().prepareSearch() @@ -160,6 +162,7 @@ public void testCloseFreezeAndOpen() throws Exception { assertFalse(((FrozenEngine) engine).isReaderOpen()); } } + assertWarnings(TransportSearchAction.FROZEN_INDICES_DEPRECATION_MESSAGE.replace("{}", indexName)); } finally { client().execute(ClosePointInTimeAction.INSTANCE, new ClosePointInTimeRequest(pitId)).get(); } @@ -177,11 +180,12 @@ public void testSearchAndGetAPIsAreThrottled() throws IOException { .endObject() .endObject() .endObject(); - createIndex("index", Settings.builder().put("index.number_of_shards", 2).build(), mapping); + String indexName = "index"; + createIndex(indexName, Settings.builder().put("index.number_of_shards", 2).build(), mapping); for (int i = 0; i < 10; i++) { - client().prepareIndex("index").setId("" + i).setSource("field", "foo bar baz").get(); + client().prepareIndex(indexName).setId("" + i).setSource("field", "foo bar baz").get(); } - assertAcked(client().execute(FreezeIndexAction.INSTANCE, new FreezeRequest("index")).actionGet()); + assertAcked(client().execute(FreezeIndexAction.INSTANCE, new FreezeRequest(indexName)).actionGet()); int numRequests = randomIntBetween(20, 50); int numRefreshes = 0; for (int i = 0; i < numRequests; i++) { @@ -190,10 +194,10 @@ public void testSearchAndGetAPIsAreThrottled() throws IOException { // searcher and rewrite the request outside of the search-throttle thread pool switch (randomFrom(Arrays.asList(0, 1, 2))) { case 0: - client().prepareGet("index", "" + randomIntBetween(0, 9)).get(); + client().prepareGet(indexName, "" + randomIntBetween(0, 9)).get(); break; case 1: - client().prepareSearch("index") + client().prepareSearch(indexName) .setIndicesOptions(IndicesOptions.STRICT_EXPAND_OPEN_FORBID_CLOSED) .setSearchType(SearchType.QUERY_THEN_FETCH) .get(); @@ -201,18 +205,19 @@ public void testSearchAndGetAPIsAreThrottled() throws IOException { numRefreshes += 3; break; case 2: - client().prepareTermVectors("index", "" + randomIntBetween(0, 9)).get(); + client().prepareTermVectors(indexName, "" + randomIntBetween(0, 9)).get(); break; case 3: - client().prepareExplain("index", "" + randomIntBetween(0, 9)).setQuery(new MatchAllQueryBuilder()).get(); + client().prepareExplain(indexName, "" + randomIntBetween(0, 9)).setQuery(new MatchAllQueryBuilder()).get(); break; default: assert false; } } - IndicesStatsResponse index = client().admin().indices().prepareStats("index").clear().setRefresh(true).get(); + IndicesStatsResponse index = client().admin().indices().prepareStats(indexName).clear().setRefresh(true).get(); assertEquals(numRefreshes, index.getTotal().refresh.getTotal()); + assertWarnings(TransportSearchAction.FROZEN_INDICES_DEPRECATION_MESSAGE.replace("{}", indexName)); } public void testFreezeAndUnfreeze() { @@ -298,26 +303,28 @@ public void testUnfreezeClosedIndices() { } public void testFreezePattern() { - createIndex("test-idx", Settings.builder().put("index.number_of_shards", 1).build()); - client().prepareIndex("test-idx").setId("1").setSource("field", "value").setRefreshPolicy(IMMEDIATE).get(); + String indexName = "test-idx"; + createIndex(indexName, Settings.builder().put("index.number_of_shards", 1).build()); + client().prepareIndex(indexName).setId("1").setSource("field", "value").setRefreshPolicy(IMMEDIATE).get(); createIndex("test-idx-1", Settings.builder().put("index.number_of_shards", 1).build()); client().prepareIndex("test-idx-1").setId("1").setSource("field", "value").setRefreshPolicy(IMMEDIATE).get(); - assertAcked(client().execute(FreezeIndexAction.INSTANCE, new FreezeRequest("test-idx")).actionGet()); - assertIndexFrozen("test-idx"); + assertAcked(client().execute(FreezeIndexAction.INSTANCE, new FreezeRequest(indexName)).actionGet()); + assertIndexFrozen(indexName); - IndicesStatsResponse index = client().admin().indices().prepareStats("test-idx").clear().setRefresh(true).get(); + IndicesStatsResponse index = client().admin().indices().prepareStats(indexName).clear().setRefresh(true).get(); assertEquals(0, index.getTotal().refresh.getTotal()); - assertHitCount(client().prepareSearch("test-idx").setIndicesOptions(IndicesOptions.STRICT_EXPAND_OPEN_FORBID_CLOSED).get(), 1); - index = client().admin().indices().prepareStats("test-idx").clear().setRefresh(true).get(); + assertHitCount(client().prepareSearch(indexName).setIndicesOptions(IndicesOptions.STRICT_EXPAND_OPEN_FORBID_CLOSED).get(), 1); + index = client().admin().indices().prepareStats(indexName).clear().setRefresh(true).get(); assertEquals(1, index.getTotal().refresh.getTotal()); assertAcked(client().execute(FreezeIndexAction.INSTANCE, new FreezeRequest("test*")).actionGet()); - assertIndexFrozen("test-idx"); + assertIndexFrozen(indexName); assertIndexFrozen("test-idx-1"); - index = client().admin().indices().prepareStats("test-idx").clear().setRefresh(true).get(); + index = client().admin().indices().prepareStats(indexName).clear().setRefresh(true).get(); assertEquals(1, index.getTotal().refresh.getTotal()); index = client().admin().indices().prepareStats("test-idx-1").clear().setRefresh(true).get(); assertEquals(0, index.getTotal().refresh.getTotal()); + assertWarnings(TransportSearchAction.FROZEN_INDICES_DEPRECATION_MESSAGE.replace("{}", indexName)); } public void testCanMatch() throws IOException { diff --git a/x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/AbstractSearchableSnapshotsRestTestCase.java b/x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/AbstractSearchableSnapshotsRestTestCase.java index e189c82c2c169..05da22b7ad48b 100644 --- a/x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/AbstractSearchableSnapshotsRestTestCase.java +++ b/x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/AbstractSearchableSnapshotsRestTestCase.java @@ -12,6 +12,7 @@ import org.apache.http.client.methods.HttpPut; import org.apache.http.entity.ContentType; import org.apache.http.entity.StringEntity; +import org.elasticsearch.action.search.TransportSearchAction; import org.elasticsearch.client.Request; import org.elasticsearch.client.RequestOptions; import org.elasticsearch.client.Response; @@ -29,6 +30,7 @@ import org.elasticsearch.test.rest.ESRestTestCase; import java.io.IOException; +import java.util.HashSet; import java.util.List; import java.util.Locale; import java.util.Map; @@ -470,19 +472,28 @@ protected static Number count(String index) throws IOException { protected static Map search(String index, QueryBuilder query, Boolean ignoreThrottled) throws IOException { final Request request = new Request(HttpPost.METHOD_NAME, '/' + index + "/_search"); request.setJsonEntity(new SearchSourceBuilder().trackTotalHits(true).query(query).toString()); + + // If warning are returned than these must exist in this set: + Set expectedWarnings = new HashSet<>(); + expectedWarnings.add(TransportSearchAction.FROZEN_INDICES_DEPRECATION_MESSAGE.replace("{}", index)); if (ignoreThrottled != null) { request.addParameter("ignore_throttled", ignoreThrottled.toString()); - RequestOptions requestOptions = RequestOptions.DEFAULT.toBuilder() - .setWarningsHandler( - warnings -> List.of( - "[ignore_throttled] parameter is deprecated because frozen indices have been deprecated. " - + "Consider cold or frozen tiers in place of frozen indices." - ).equals(warnings) == false - ) - .build(); - request.setOptions(requestOptions); + expectedWarnings.add( + "[ignore_throttled] parameter is deprecated because frozen indices have been deprecated. " + + "Consider cold or frozen tiers in place of frozen indices." + ); } + RequestOptions requestOptions = RequestOptions.DEFAULT.toBuilder().setWarningsHandler(warnings -> { + for (String warning : warnings) { + if (expectedWarnings.contains(warning) == false) { + return true; + } + } + return false; + }).build(); + request.setOptions(requestOptions); + final Response response = client().performRequest(request); assertThat( "Failed to execute search request on index [" + index + "]: " + response, diff --git a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/indices.freeze/10_basic.yml b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/indices.freeze/10_basic.yml index 9d02de5a95d9c..6d11fff4e81a7 100644 --- a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/indices.freeze/10_basic.yml +++ b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/indices.freeze/10_basic.yml @@ -23,6 +23,7 @@ - do: warnings: - "[ignore_throttled] parameter is deprecated because frozen indices have been deprecated. Consider cold or frozen tiers in place of frozen indices." + - "Searching frozen indices [test] is deprecated. Consider cold or frozen tiers in place of frozen indices. The frozen feature will be removed in a feature release." search: rest_total_hits_as_int: true index: test @@ -68,6 +69,7 @@ - do: warnings: - "[ignore_throttled] parameter is deprecated because frozen indices have been deprecated. Consider cold or frozen tiers in place of frozen indices." + - "Searching frozen indices [test,test-01] is deprecated. Consider cold or frozen tiers in place of frozen indices. The frozen feature will be removed in a feature release." search: rest_total_hits_as_int: true index: _all @@ -134,6 +136,7 @@ - do: warnings: - "[ignore_throttled] parameter is deprecated because frozen indices have been deprecated. Consider cold or frozen tiers in place of frozen indices." + - "Searching frozen indices [test] is deprecated. Consider cold or frozen tiers in place of frozen indices. The frozen feature will be removed in a feature release." search: rest_total_hits_as_int: true index: _all diff --git a/x-pack/qa/full-cluster-restart/src/test/java/org/elasticsearch/xpack/restart/FullClusterRestartIT.java b/x-pack/qa/full-cluster-restart/src/test/java/org/elasticsearch/xpack/restart/FullClusterRestartIT.java index abb90d998cc4e..195ba1fa038d2 100644 --- a/x-pack/qa/full-cluster-restart/src/test/java/org/elasticsearch/xpack/restart/FullClusterRestartIT.java +++ b/x-pack/qa/full-cluster-restart/src/test/java/org/elasticsearch/xpack/restart/FullClusterRestartIT.java @@ -739,7 +739,9 @@ public void testFrozenIndexAfterRestarted() throws Exception { assertNoFileBasedRecovery(index, n -> true); final Request request = new Request("GET", "/" + index + "/_search"); request.setOptions(expectWarnings("[ignore_throttled] parameter is deprecated because frozen " + - "indices have been deprecated. Consider cold or frozen tiers in place of frozen indices.")); + "indices have been deprecated. Consider cold or frozen tiers in place of frozen indices.", + "Searching frozen indices [" + index + "] is deprecated. " + + "Consider cold or frozen tiers in place of frozen indices. The frozen feature will be removed in a feature release.")); request.addParameter("ignore_throttled", "false"); assertThat(XContentMapValues.extractValue("hits.total.value", entityAsMap(client().performRequest(request))), equalTo(totalHits)); From 59149bf65f6e94252e63c3a1cc92bb1bc818f4e0 Mon Sep 17 00:00:00 2001 From: Dan Hermann Date: Mon, 27 Sep 2021 08:38:10 -0500 Subject: [PATCH 009/250] Consolidate logic for creating ingest pipelines (#78289) --- .../ingest/PutPipelineTransportAction.java | 53 ++----- .../elasticsearch/ingest/IngestService.java | 75 ++++++++-- .../PutPipelineTransportActionTests.java | 136 ------------------ .../ingest/IngestServiceTests.java | 127 +++++++++++++++- 4 files changed, 190 insertions(+), 201 deletions(-) delete mode 100644 server/src/test/java/org/elasticsearch/action/ingest/PutPipelineTransportActionTests.java diff --git a/server/src/main/java/org/elasticsearch/action/ingest/PutPipelineTransportAction.java b/server/src/main/java/org/elasticsearch/action/ingest/PutPipelineTransportAction.java index 9d084151fa4ea..119b0db82f644 100644 --- a/server/src/main/java/org/elasticsearch/action/ingest/PutPipelineTransportAction.java +++ b/server/src/main/java/org/elasticsearch/action/ingest/PutPipelineTransportAction.java @@ -8,9 +8,7 @@ package org.elasticsearch.action.ingest; -import org.elasticsearch.Version; import org.elasticsearch.action.ActionListener; -import org.elasticsearch.action.admin.cluster.node.info.NodeInfo; import org.elasticsearch.action.admin.cluster.node.info.NodesInfoRequest; import org.elasticsearch.action.support.ActionFilters; import org.elasticsearch.action.support.master.AcknowledgedResponse; @@ -21,20 +19,12 @@ import org.elasticsearch.cluster.block.ClusterBlockException; import org.elasticsearch.cluster.block.ClusterBlockLevel; import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; -import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.common.inject.Inject; -import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.ingest.IngestInfo; -import org.elasticsearch.ingest.IngestMetadata; import org.elasticsearch.ingest.IngestService; -import org.elasticsearch.ingest.Pipeline; import org.elasticsearch.tasks.Task; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.TransportService; -import java.util.HashMap; -import java.util.Map; - import static org.elasticsearch.ingest.IngestService.INGEST_ORIGIN; public class PutPipelineTransportAction extends AcknowledgedTransportMasterNodeAction { @@ -59,42 +49,15 @@ public PutPipelineTransportAction(ThreadPool threadPool, TransportService transp @Override protected void masterOperation(Task task, PutPipelineRequest request, ClusterState state, ActionListener listener) throws Exception { - - Map pipelineConfig = null; - IngestMetadata currentIngestMetadata = state.metadata().custom(IngestMetadata.TYPE); - if (currentIngestMetadata != null && currentIngestMetadata.getPipelines().containsKey(request.getId())) { - pipelineConfig = XContentHelper.convertToMap(request.getSource(), false, request.getXContentType()).v2(); - var currentPipeline = currentIngestMetadata.getPipelines().get(request.getId()); - if (currentPipeline.getConfigAsMap().equals(pipelineConfig)) { - // existing pipeline matches request pipeline -- no need to update - listener.onResponse(AcknowledgedResponse.TRUE); - return; - } - } - - if (state.getNodes().getMinNodeVersion().before(Version.V_7_15_0)) { - pipelineConfig = pipelineConfig == null - ? XContentHelper.convertToMap(request.getSource(), false, request.getXContentType()).v2() - : pipelineConfig; - if (pipelineConfig.containsKey(Pipeline.META_KEY)) { - throw new IllegalStateException("pipelines with _meta field require minimum node version of " + Version.V_7_15_0); + ingestService.putPipeline( + request, + listener, + (nodeListener) -> { + NodesInfoRequest nodesInfoRequest = new NodesInfoRequest(); + nodesInfoRequest.clear(); + nodesInfoRequest.addMetric(NodesInfoRequest.Metric.INGEST.metricName()); + client.admin().cluster().nodesInfo(nodesInfoRequest, nodeListener); } - } - NodesInfoRequest nodesInfoRequest = new NodesInfoRequest(); - nodesInfoRequest.clear(); - nodesInfoRequest.addMetric(NodesInfoRequest.Metric.INGEST.metricName()); - client.admin().cluster().nodesInfo( - nodesInfoRequest, - ActionListener.wrap( - nodeInfos -> { - Map ingestInfos = new HashMap<>(); - for (NodeInfo nodeInfo : nodeInfos.getNodes()) { - ingestInfos.put(nodeInfo.getNode(), nodeInfo.getInfo(IngestInfo.class)); - } - ingestService.putPipeline(ingestInfos, request, listener); - }, - listener::onFailure - ) ); } diff --git a/server/src/main/java/org/elasticsearch/ingest/IngestService.java b/server/src/main/java/org/elasticsearch/ingest/IngestService.java index 66f7ac8007f64..6a08f972f85ce 100644 --- a/server/src/main/java/org/elasticsearch/ingest/IngestService.java +++ b/server/src/main/java/org/elasticsearch/ingest/IngestService.java @@ -14,8 +14,11 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.ExceptionsHelper; import org.elasticsearch.ResourceNotFoundException; +import org.elasticsearch.Version; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.DocWriteRequest; +import org.elasticsearch.action.admin.cluster.node.info.NodeInfo; +import org.elasticsearch.action.admin.cluster.node.info.NodesInfoResponse; import org.elasticsearch.action.bulk.TransportBulkAction; import org.elasticsearch.action.index.IndexRequest; import org.elasticsearch.action.ingest.DeletePipelineRequest; @@ -34,12 +37,12 @@ import org.elasticsearch.cluster.metadata.MetadataIndexTemplateService; import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.service.ClusterService; -import org.elasticsearch.core.Tuple; import org.elasticsearch.common.regex.Regex; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.concurrent.AbstractRunnable; import org.elasticsearch.common.xcontent.XContentHelper; +import org.elasticsearch.core.TimeValue; +import org.elasticsearch.core.Tuple; import org.elasticsearch.env.Environment; import org.elasticsearch.gateway.GatewayService; import org.elasticsearch.index.IndexSettings; @@ -331,17 +334,56 @@ static List innerGetPipelines(IngestMetadata ingestMetada /** * Stores the specified pipeline definition in the request. */ - public void putPipeline(Map ingestInfos, PutPipelineRequest request, - ActionListener listener) throws Exception { - // validates the pipeline and processor configuration before submitting a cluster update task: - validatePipeline(ingestInfos, request); - clusterService.submitStateUpdateTask("put-pipeline-" + request.getId(), - new AckedClusterStateUpdateTask(request, listener) { - @Override - public ClusterState execute(ClusterState currentState) { - return innerPut(request, currentState); + public void putPipeline( + PutPipelineRequest request, + ActionListener listener, + Consumer> nodeInfoListener + ) throws Exception { + + Map pipelineConfig = null; + IngestMetadata currentIngestMetadata = state.metadata().custom(IngestMetadata.TYPE); + if (currentIngestMetadata != null && currentIngestMetadata.getPipelines().containsKey(request.getId())) { + pipelineConfig = XContentHelper.convertToMap(request.getSource(), false, request.getXContentType()).v2(); + var currentPipeline = currentIngestMetadata.getPipelines().get(request.getId()); + if (currentPipeline.getConfigAsMap().equals(pipelineConfig)) { + // existing pipeline matches request pipeline -- no need to update + listener.onResponse(AcknowledgedResponse.TRUE); + return; + } + } + + if (state.getNodes().getMinNodeVersion().before(Version.V_7_15_0)) { + pipelineConfig = pipelineConfig == null + ? XContentHelper.convertToMap(request.getSource(), false, request.getXContentType()).v2() + : pipelineConfig; + if (pipelineConfig.containsKey(Pipeline.META_KEY)) { + throw new IllegalStateException("pipelines with _meta field require minimum node version of " + Version.V_7_15_0); + } + } + + final Map config = pipelineConfig == null + ? XContentHelper.convertToMap(request.getSource(), false, request.getXContentType()).v2() + : pipelineConfig; + nodeInfoListener.accept(ActionListener.wrap( + nodeInfos -> { + Map ingestInfos = new HashMap<>(); + for (NodeInfo nodeInfo : nodeInfos.getNodes()) { + ingestInfos.put(nodeInfo.getNode(), nodeInfo.getInfo(IngestInfo.class)); } - }); + + validatePipeline(ingestInfos, request.getId(), config); + clusterService.submitStateUpdateTask( + "put-pipeline-" + request.getId(), + new AckedClusterStateUpdateTask(request, listener) { + @Override + public ClusterState execute(ClusterState currentState) { + return innerPut(request, currentState); + } + } + ); + }, + listener::onFailure) + ); } /** @@ -417,13 +459,16 @@ static ClusterState innerPut(PutPipelineRequest request, ClusterState currentSta return newState.build(); } - void validatePipeline(Map ingestInfos, PutPipelineRequest request) throws Exception { + void validatePipeline( + Map ingestInfos, + String pipelineId, + Map pipelineConfig + ) throws Exception { if (ingestInfos.isEmpty()) { throw new IllegalStateException("Ingest info is empty"); } - Map pipelineConfig = XContentHelper.convertToMap(request.getSource(), false, request.getXContentType()).v2(); - Pipeline pipeline = Pipeline.create(request.getId(), pipelineConfig, processorFactories, scriptService); + Pipeline pipeline = Pipeline.create(pipelineId, pipelineConfig, processorFactories, scriptService); List exceptions = new ArrayList<>(); for (Processor processor : pipeline.flattenAllProcessors()) { for (Map.Entry entry : ingestInfos.entrySet()) { diff --git a/server/src/test/java/org/elasticsearch/action/ingest/PutPipelineTransportActionTests.java b/server/src/test/java/org/elasticsearch/action/ingest/PutPipelineTransportActionTests.java deleted file mode 100644 index 22d7c6521f7d6..0000000000000 --- a/server/src/test/java/org/elasticsearch/action/ingest/PutPipelineTransportActionTests.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * 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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -package org.elasticsearch.action.ingest; - -import org.elasticsearch.action.ActionListener; -import org.elasticsearch.action.support.ActionFilters; -import org.elasticsearch.action.support.master.AcknowledgedResponse; -import org.elasticsearch.cluster.ClusterName; -import org.elasticsearch.cluster.ClusterState; -import org.elasticsearch.cluster.metadata.Metadata; -import org.elasticsearch.common.bytes.BytesArray; -import org.elasticsearch.common.util.concurrent.EsExecutors; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.core.Tuple; -import org.elasticsearch.ingest.IngestMetadata; -import org.elasticsearch.ingest.IngestService; -import org.elasticsearch.ingest.PipelineConfiguration; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.client.NoOpNodeClient; -import org.elasticsearch.threadpool.ThreadPool; -import org.elasticsearch.transport.TransportService; - -import java.io.OutputStream; -import java.util.Map; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.atomic.AtomicLong; - -import static org.elasticsearch.core.Tuple.tuple; -import static org.hamcrest.Matchers.equalTo; -import static org.mockito.Matchers.anyString; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - -public class PutPipelineTransportActionTests extends ESTestCase { - - public void testUpdatingRandomPipelineWithoutChangesIsNoOp() throws Exception { - var randomMap = randomMap(10, 50, PutPipelineTransportActionTests::randomMapEntry); - - XContentBuilder x = XContentBuilder.builder(XContentType.JSON.xContent()) - .startObject() - .field("processors", randomMap) - .endObject(); - - OutputStream os = x.getOutputStream(); - x.generator().close(); - testUpdatingPipeline(os.toString()); - } - - public void testUpdatingPipelineWithoutChangesIsNoOp() throws Exception { - var value = randomAlphaOfLength(5); - var pipelineString = "{\"processors\": [{\"set\" : {\"field\": \"_field\", \"value\": \"" + value + "\"}}]}"; - testUpdatingPipeline(pipelineString); - } - - private void testUpdatingPipeline(String pipelineString) throws Exception { - var threadPool = mock(ThreadPool.class); - when(threadPool.generic()).thenReturn(EsExecutors.DIRECT_EXECUTOR_SERVICE); - when(threadPool.executor(anyString())).thenReturn(EsExecutors.DIRECT_EXECUTOR_SERVICE); - var client = new NoOpNodeClient(threadPool); - var action = new PutPipelineTransportAction( - threadPool, - mock(TransportService.class), - mock(ActionFilters.class), - null, - mock(IngestService.class), - client - ); - - var pipelineId = randomAlphaOfLength(5); - var value = randomAlphaOfLength(5); - var existingPipeline = new PipelineConfiguration(pipelineId, new BytesArray(pipelineString), XContentType.JSON); - var clusterState = ClusterState.builder(new ClusterName("test")) - .metadata(Metadata.builder().putCustom( - IngestMetadata.TYPE, - new IngestMetadata(Map.of(pipelineId, existingPipeline)) - ).build() - ).build(); - - CountDownLatch latch = new CountDownLatch(1); - var listener = new ActionListener() { - final AtomicLong successCount = new AtomicLong(0); - final AtomicLong failureCount = new AtomicLong(0); - - @Override - public void onResponse(AcknowledgedResponse acknowledgedResponse) { - successCount.incrementAndGet(); - latch.countDown(); - } - - @Override - public void onFailure(Exception e) { - failureCount.incrementAndGet(); - latch.countDown(); - } - - public long getSuccessCount() { - return successCount.get(); - } - - public long getFailureCount() { - return failureCount.get(); - } - }; - - var request = new PutPipelineRequest(pipelineId, new BytesArray(pipelineString), XContentType.JSON); - action.masterOperation(null, request, clusterState, listener); - latch.await(); - - assertThat(client.getExecutionCount(), equalTo(0L)); - assertThat(listener.getSuccessCount(), equalTo(1L)); - assertThat(listener.getFailureCount(), equalTo(0L)); - } - - private static Tuple randomMapEntry() { - return tuple(randomAlphaOfLength(5), randomObject()); - } - - private static Object randomObject() { - return randomFrom( - random(), - ESTestCase::randomLong, - () -> generateRandomStringArray(10, 5, true), - () -> randomMap(3, 5, PutPipelineTransportActionTests::randomMapEntry), - () -> randomAlphaOfLength(5), - ESTestCase::randomTimeValue, - ESTestCase::randomDouble - ); - } -} diff --git a/server/src/test/java/org/elasticsearch/ingest/IngestServiceTests.java b/server/src/test/java/org/elasticsearch/ingest/IngestServiceTests.java index 6458cfc76cf18..631efa75ae36d 100644 --- a/server/src/test/java/org/elasticsearch/ingest/IngestServiceTests.java +++ b/server/src/test/java/org/elasticsearch/ingest/IngestServiceTests.java @@ -15,13 +15,16 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.ResourceNotFoundException; import org.elasticsearch.Version; +import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.DocWriteRequest; +import org.elasticsearch.action.admin.cluster.node.info.NodesInfoResponse; import org.elasticsearch.action.bulk.BulkRequest; import org.elasticsearch.action.bulk.TransportBulkAction; import org.elasticsearch.action.delete.DeleteRequest; import org.elasticsearch.action.index.IndexRequest; import org.elasticsearch.action.ingest.DeletePipelineRequest; import org.elasticsearch.action.ingest.PutPipelineRequest; +import org.elasticsearch.action.support.master.AcknowledgedResponse; import org.elasticsearch.action.update.UpdateRequest; import org.elasticsearch.client.Client; import org.elasticsearch.client.Requests; @@ -40,8 +43,10 @@ import org.elasticsearch.common.time.DateFormatter; import org.elasticsearch.common.util.concurrent.EsExecutors; import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.common.xcontent.XContentHelper; import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.common.xcontent.cbor.CborXContent; +import org.elasticsearch.core.Tuple; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.VersionType; import org.elasticsearch.plugins.IngestPlugin; @@ -59,6 +64,7 @@ import org.mockito.ArgumentMatcher; import org.mockito.invocation.InvocationOnMock; +import java.io.OutputStream; import java.nio.charset.StandardCharsets; import java.util.Arrays; import java.util.Collections; @@ -69,6 +75,7 @@ import java.util.Objects; import java.util.concurrent.CountDownLatch; import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.atomic.AtomicReference; import java.util.function.BiConsumer; import java.util.function.Consumer; @@ -78,6 +85,7 @@ import static java.util.Collections.emptyMap; import static java.util.Collections.emptySet; +import static org.elasticsearch.core.Tuple.tuple; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.greaterThanOrEqualTo; import static org.hamcrest.Matchers.instanceOf; @@ -274,13 +282,18 @@ public void testValidateNoIngestInfo() throws Exception { IngestService ingestService = createWithProcessors(); PutPipelineRequest putRequest = new PutPipelineRequest("_id", new BytesArray( "{\"processors\": [{\"set\" : {\"field\": \"_field\", \"value\": \"_value\"}}]}"), XContentType.JSON); - Exception e = expectThrows(IllegalStateException.class, () -> ingestService.validatePipeline(emptyMap(), putRequest)); + + var pipelineConfig = XContentHelper.convertToMap(putRequest.getSource(), false, putRequest.getXContentType()).v2(); + Exception e = expectThrows( + IllegalStateException.class, + () -> ingestService.validatePipeline(emptyMap(), putRequest.getId(), pipelineConfig) + ); assertEquals("Ingest info is empty", e.getMessage()); DiscoveryNode discoveryNode = new DiscoveryNode("_node_id", buildNewFakeTransportAddress(), emptyMap(), emptySet(), Version.CURRENT); IngestInfo ingestInfo = new IngestInfo(Collections.singletonList(new ProcessorInfo("set"))); - ingestService.validatePipeline(Collections.singletonMap(discoveryNode, ingestInfo), putRequest); + ingestService.validatePipeline(Collections.singletonMap(discoveryNode, ingestInfo), putRequest.getId(), pipelineConfig); } public void testGetProcessorsInPipeline() throws Exception { @@ -586,6 +599,7 @@ public void testValidate() throws Exception { "{\"processors\": [{\"set\" : {\"field\": \"_field\", \"value\": \"_value\", \"tag\": \"tag1\"}}," + "{\"remove\" : {\"field\": \"_field\", \"tag\": \"tag2\"}}]}"), XContentType.JSON); + var pipelineConfig = XContentHelper.convertToMap(putRequest.getSource(), false, putRequest.getXContentType()).v2(); DiscoveryNode node1 = new DiscoveryNode("_node_id1", buildNewFakeTransportAddress(), emptyMap(), emptySet(), Version.CURRENT); @@ -595,14 +609,17 @@ public void testValidate() throws Exception { ingestInfos.put(node1, new IngestInfo(Arrays.asList(new ProcessorInfo("set"), new ProcessorInfo("remove")))); ingestInfos.put(node2, new IngestInfo(Arrays.asList(new ProcessorInfo("set")))); - ElasticsearchParseException e = - expectThrows(ElasticsearchParseException.class, () -> ingestService.validatePipeline(ingestInfos, putRequest)); + ElasticsearchParseException e = expectThrows( + ElasticsearchParseException.class, + () -> ingestService.validatePipeline(ingestInfos, putRequest.getId(), pipelineConfig) + ); assertEquals("Processor type [remove] is not installed on node [" + node2 + "]", e.getMessage()); assertEquals("remove", e.getMetadata("es.processor_type").get(0)); assertEquals("tag2", e.getMetadata("es.processor_tag").get(0)); + var pipelineConfig2 = XContentHelper.convertToMap(putRequest.getSource(), false, putRequest.getXContentType()).v2(); ingestInfos.put(node2, new IngestInfo(Arrays.asList(new ProcessorInfo("set"), new ProcessorInfo("remove")))); - ingestService.validatePipeline(ingestInfos, putRequest); + ingestService.validatePipeline(ingestInfos, putRequest.getId(), pipelineConfig2); } public void testExecuteIndexPipelineExistsButFailedParsing() { @@ -1446,6 +1463,106 @@ public void testResolveRequestOrDefaultPipelineAndFinalPipeline() { } } + public void testUpdatingRandomPipelineWithoutChangesIsNoOp() throws Exception { + var randomMap = randomMap(10, 50, IngestServiceTests::randomMapEntry); + + XContentBuilder x = XContentBuilder.builder(XContentType.JSON.xContent()) + .startObject() + .field("processors", randomMap) + .endObject(); + + OutputStream os = x.getOutputStream(); + x.generator().close(); + testUpdatingPipeline(os.toString()); + } + + public void testUpdatingPipelineWithoutChangesIsNoOp() throws Exception { + var value = randomAlphaOfLength(5); + var pipelineString = "{\"processors\": [{\"set\" : {\"field\": \"_field\", \"value\": \"" + value + "\"}}]}"; + testUpdatingPipeline(pipelineString); + } + + private void testUpdatingPipeline(String pipelineString) throws Exception { + var pipelineId = randomAlphaOfLength(5); + var existingPipeline = new PipelineConfiguration(pipelineId, new BytesArray(pipelineString), XContentType.JSON); + var clusterState = ClusterState.builder(new ClusterName("test")) + .metadata(Metadata.builder().putCustom( + IngestMetadata.TYPE, + new IngestMetadata(Map.of(pipelineId, existingPipeline)) + ).build() + ).build(); + + Client client = mock(Client.class); + ClusterService clusterService = mock(ClusterService.class); + when(clusterService.state()).thenReturn(clusterState); + IngestService ingestService = new IngestService(clusterService, threadPool, null, null, + null, Collections.singletonList(DUMMY_PLUGIN), client); + ingestService.applyClusterState(new ClusterChangedEvent("", clusterState, clusterState)); + + CountDownLatch latch = new CountDownLatch(1); + var listener = new ActionListener() { + final AtomicLong successCount = new AtomicLong(0); + final AtomicLong failureCount = new AtomicLong(0); + + @Override + public void onResponse(AcknowledgedResponse acknowledgedResponse) { + successCount.incrementAndGet(); + latch.countDown(); + } + + @Override + public void onFailure(Exception e) { + failureCount.incrementAndGet(); + latch.countDown(); + } + + public long getSuccessCount() { + return successCount.get(); + } + + public long getFailureCount() { + return failureCount.get(); + } + }; + + var consumer = new Consumer>() { + final AtomicLong executionCount = new AtomicLong(0); + + @Override + public void accept(ActionListener nodesInfoResponseActionListener) { + executionCount.incrementAndGet(); + } + + public long getExecutionCount() { + return executionCount.get(); + } + }; + + var request = new PutPipelineRequest(pipelineId, new BytesArray(pipelineString), XContentType.JSON); + ingestService.putPipeline(request, listener, consumer); + latch.await(); + + assertThat(consumer.getExecutionCount(), equalTo(0L)); + assertThat(listener.getSuccessCount(), equalTo(1L)); + assertThat(listener.getFailureCount(), equalTo(0L)); + } + + private static Tuple randomMapEntry() { + return tuple(randomAlphaOfLength(5), randomObject()); + } + + private static Object randomObject() { + return randomFrom( + random(), + ESTestCase::randomLong, + () -> generateRandomStringArray(10, 5, true), + () -> randomMap(3, 5, IngestServiceTests::randomMapEntry), + () -> randomAlphaOfLength(5), + ESTestCase::randomTimeValue, + ESTestCase::randomDouble + ); + } + private IngestDocument eqIndexTypeId(final Map source) { return argThat(new IngestDocumentMatcher("_index", "_type", "_id", -3L, VersionType.INTERNAL, source)); } From db75c4bd2e0c940a866607ff682f033a3e3e6441 Mon Sep 17 00:00:00 2001 From: Stuart Tettemer Date: Mon, 27 Sep 2021 09:32:24 -0500 Subject: [PATCH 010/250] Script: compile/cache eviction history metric placeholders (#78257) Adds 5m/15m/24h metrics to _nodes/stats when those metrics are non-zero. Those metrics are not yet populated. BWC: history metrics are only sent between v8.0.0+ nodes, v7.16.0 nodes will not send those metrics until they are populated. Refs: #62899 --- .../script/ScriptContextStats.java | 106 ++++++++++++- .../elasticsearch/script/ScriptMetrics.java | 4 +- .../cluster/node/stats/NodeStatsTests.java | 26 +++- .../script/ScriptStatsTests.java | 141 +++++++++++++++++- 4 files changed, 270 insertions(+), 7 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/script/ScriptContextStats.java b/server/src/main/java/org/elasticsearch/script/ScriptContextStats.java index c0fc5d8b2493e..cf52d8d7a9347 100644 --- a/server/src/main/java/org/elasticsearch/script/ScriptContextStats.java +++ b/server/src/main/java/org/elasticsearch/script/ScriptContextStats.java @@ -8,6 +8,7 @@ package org.elasticsearch.script; +import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; @@ -20,14 +21,19 @@ public class ScriptContextStats implements Writeable, ToXContentFragment, Comparable { private final String context; private final long compilations; + private final TimeSeries compilationsHistory; private final long cacheEvictions; + private final TimeSeries cacheEvictionsHistory; private final long compilationLimitTriggered; - public ScriptContextStats(String context, long compilations, long cacheEvictions, long compilationLimitTriggered) { + public ScriptContextStats(String context, long compilations, long cacheEvictions, long compilationLimitTriggered, + TimeSeries compilationsHistory, TimeSeries cacheEvictionsHistory) { this.context = Objects.requireNonNull(context); this.compilations = compilations; this.cacheEvictions = cacheEvictions; this.compilationLimitTriggered = compilationLimitTriggered; + this.compilationsHistory = compilationsHistory; + this.cacheEvictionsHistory = cacheEvictionsHistory; } public ScriptContextStats(StreamInput in) throws IOException { @@ -35,6 +41,13 @@ public ScriptContextStats(StreamInput in) throws IOException { compilations = in.readVLong(); cacheEvictions = in.readVLong(); compilationLimitTriggered = in.readVLong(); + if (in.getVersion().onOrAfter(Version.V_8_0_0)) { + compilationsHistory = new TimeSeries(in); + cacheEvictionsHistory = new TimeSeries(in); + } else { + compilationsHistory = null; + cacheEvictionsHistory = null; + } } @Override @@ -43,6 +56,69 @@ public void writeTo(StreamOutput out) throws IOException { out.writeVLong(compilations); out.writeVLong(cacheEvictions); out.writeVLong(compilationLimitTriggered); + if (out.getVersion().onOrAfter(Version.V_8_0_0)) { + compilationsHistory.writeTo(out); + cacheEvictionsHistory.writeTo(out); + } + } + + public static class TimeSeries implements Writeable, ToXContentFragment { + public final long fiveMinutes; + public final long fifteenMinutes; + public final long twentyFourHours; + + public TimeSeries() { + this.fiveMinutes = 0; + this.fifteenMinutes = 0; + this.twentyFourHours = 0; + } + + public TimeSeries(long fiveMinutes, long fifteenMinutes, long twentyFourHours) { + assert fiveMinutes >= 0; + this.fiveMinutes = fiveMinutes; + assert fifteenMinutes >= fiveMinutes; + this.fifteenMinutes = fifteenMinutes; + assert twentyFourHours >= fifteenMinutes; + this.twentyFourHours = twentyFourHours; + } + + public TimeSeries(StreamInput in) throws IOException { + fiveMinutes = in.readVLong(); + fifteenMinutes = in.readVLong(); + twentyFourHours = in.readVLong(); + } + + @Override + public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { + builder.field(Fields.FIVE_MINUTES, fiveMinutes); + builder.field(Fields.FIFTEEN_MINUTES, fifteenMinutes); + builder.field(Fields.TWENTY_FOUR_HOURS, twentyFourHours); + return builder; + } + + @Override + public void writeTo(StreamOutput out) throws IOException { + out.writeVLong(fiveMinutes); + out.writeVLong(fifteenMinutes); + out.writeVLong(twentyFourHours); + } + + public boolean isEmpty() { + return twentyFourHours == 0; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + TimeSeries that = (TimeSeries) o; + return fiveMinutes == that.fiveMinutes && fifteenMinutes == that.fifteenMinutes && twentyFourHours == that.twentyFourHours; + } + + @Override + public int hashCode() { + return Objects.hash(fiveMinutes, fifteenMinutes, twentyFourHours); + } } public String getContext() { @@ -53,10 +129,18 @@ public long getCompilations() { return compilations; } + public TimeSeries getCompilationsHistory() { + return compilationsHistory; + } + public long getCacheEvictions() { return cacheEvictions; } + public TimeSeries getCacheEvictionsHistory() { + return cacheEvictionsHistory; + } + public long getCompilationLimitTriggered() { return compilationLimitTriggered; } @@ -66,7 +150,22 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws builder.startObject(); builder.field(Fields.CONTEXT, getContext()); builder.field(Fields.COMPILATIONS, getCompilations()); + + TimeSeries series = getCompilationsHistory(); + if (series != null && series.isEmpty() == false) { + builder.startObject(Fields.COMPILATIONS_HISTORY); + series.toXContent(builder, params); + builder.endObject(); + } + builder.field(Fields.CACHE_EVICTIONS, getCacheEvictions()); + series = getCacheEvictionsHistory(); + if (series != null && series.isEmpty() == false) { + builder.startObject(Fields.CACHE_EVICTIONS_HISTORY); + series.toXContent(builder, params); + builder.endObject(); + } + builder.field(Fields.COMPILATION_LIMIT_TRIGGERED, getCompilationLimitTriggered()); builder.endObject(); return builder; @@ -80,7 +179,12 @@ public int compareTo(ScriptContextStats o) { static final class Fields { static final String CONTEXT = "context"; static final String COMPILATIONS = "compilations"; + static final String COMPILATIONS_HISTORY = "compilations_history"; static final String CACHE_EVICTIONS = "cache_evictions"; + static final String CACHE_EVICTIONS_HISTORY = "cache_evictions_history"; static final String COMPILATION_LIMIT_TRIGGERED = "compilation_limit_triggered"; + static final String FIVE_MINUTES = "5m"; + static final String FIFTEEN_MINUTES = "15m"; + static final String TWENTY_FOUR_HOURS = "24h"; } } diff --git a/server/src/main/java/org/elasticsearch/script/ScriptMetrics.java b/server/src/main/java/org/elasticsearch/script/ScriptMetrics.java index 24ae237d62cc6..f853305c3cd45 100644 --- a/server/src/main/java/org/elasticsearch/script/ScriptMetrics.java +++ b/server/src/main/java/org/elasticsearch/script/ScriptMetrics.java @@ -32,6 +32,8 @@ public ScriptContextStats stats(String context) { context, compilationsMetric.count(), cacheEvictionsMetric.count(), - compilationLimitTriggered.count() + compilationLimitTriggered.count(), + new ScriptContextStats.TimeSeries(), + new ScriptContextStats.TimeSeries() ); }} diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/node/stats/NodeStatsTests.java b/server/src/test/java/org/elasticsearch/action/admin/cluster/node/stats/NodeStatsTests.java index 87ff0faa0937a..b6d90e9e15ed3 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/node/stats/NodeStatsTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/cluster/node/stats/NodeStatsTests.java @@ -260,6 +260,9 @@ public void testSerialization() throws IOException { compilations += generatedStats.getCompilations(); assertEquals(generatedStats.getCompilations(), deserStats.getCompilations()); + + assertEquals(generatedStats.getCacheEvictionsHistory(), deserStats.getCacheEvictionsHistory()); + assertEquals(generatedStats.getCompilationsHistory(), deserStats.getCompilationsHistory()); } assertEquals(evictions, scriptStats.getCacheEvictions()); assertEquals(limited, scriptStats.getCompilationLimitTriggered()); @@ -555,11 +558,17 @@ public static NodeStats createNodeStats() { List stats = new ArrayList<>(numContents); HashSet contexts = new HashSet<>(); for (int i = 0; i < numContents; i++) { + long compile = randomLongBetween(0, 1024); + long eviction = randomLongBetween(0, 1024); + String context = randomValueOtherThanMany(contexts::contains, () -> randomAlphaOfLength(12)); + contexts.add(context); stats.add(new ScriptContextStats( - randomValueOtherThanMany(contexts::contains, () -> randomAlphaOfLength(12)), - randomLongBetween(0, 1024), + context, + compile, + eviction, randomLongBetween(0, 1024), - randomLongBetween(0, 1024)) + randomTimeSeries(), + randomTimeSeries()) ); } scriptStats = new ScriptStats(stats); @@ -663,6 +672,17 @@ public static NodeStats createNodeStats() { ingestStats, adaptiveSelectionStats, null); } + private static ScriptContextStats.TimeSeries randomTimeSeries() { + if (randomBoolean()) { + long day = randomLongBetween(0, 1024); + long fifteen = day >= 1 ? randomLongBetween(0, day) : 0; + long five = fifteen >= 1 ? randomLongBetween(0, fifteen) : 0; + return new ScriptContextStats.TimeSeries(five, fifteen, day); + } else { + return new ScriptContextStats.TimeSeries(); + } + } + private IngestStats.Stats getPipelineStats(List pipelineStats, String id) { return pipelineStats.stream().filter(p1 -> p1.getPipelineId().equals(id)).findFirst().map(p2 -> p2.getStats()).orElse(null); } diff --git a/server/src/test/java/org/elasticsearch/script/ScriptStatsTests.java b/server/src/test/java/org/elasticsearch/script/ScriptStatsTests.java index bf521e79f896f..1967837aa108e 100644 --- a/server/src/test/java/org/elasticsearch/script/ScriptStatsTests.java +++ b/server/src/test/java/org/elasticsearch/script/ScriptStatsTests.java @@ -8,22 +8,31 @@ package org.elasticsearch.script; +import org.elasticsearch.Version; import org.elasticsearch.common.Strings; +import org.elasticsearch.common.io.stream.BytesStreamOutput; +import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.test.ESTestCase; import java.io.IOException; +import java.util.ArrayList; import java.util.List; +import java.util.Locale; +import java.util.function.Function; import static org.hamcrest.Matchers.equalTo; public class ScriptStatsTests extends ESTestCase { public void testXContent() throws IOException { List contextStats = List.of( - new ScriptContextStats("contextB", 100, 201, 302), - new ScriptContextStats("contextA", 1000, 2010, 3020) + new ScriptContextStats("contextB", 100, 201, 302, + new ScriptContextStats.TimeSeries(1000, 1001, 1002), + new ScriptContextStats.TimeSeries(2000, 2001, 2002) + ), + new ScriptContextStats("contextA", 1000, 2010, 3020, null, new ScriptContextStats.TimeSeries(0, 0, 0)) ); ScriptStats stats = new ScriptStats(contextStats); final XContentBuilder builder = XContentFactory.jsonBuilder().prettyPrint(); @@ -46,7 +55,17 @@ public void testXContent() throws IOException { " {\n" + " \"context\" : \"contextB\",\n" + " \"compilations\" : 100,\n" + + " \"compilations_history\" : {\n" + + " \"5m\" : 1000,\n" + + " \"15m\" : 1001,\n" + + " \"24h\" : 1002\n" + + " },\n" + " \"cache_evictions\" : 201,\n" + + " \"cache_evictions_history\" : {\n" + + " \"5m\" : 2000,\n" + + " \"15m\" : 2001,\n" + + " \"24h\" : 2002\n" + + " },\n" + " \"compilation_limit_triggered\" : 302\n" + " }\n" + " ]\n" + @@ -54,4 +73,122 @@ public void testXContent() throws IOException { "}"; assertThat(Strings.toString(builder), equalTo(expected)); } + + public void testSerializeEmptyTimeSeries() throws IOException { + ScriptContextStats.TimeSeries empty = new ScriptContextStats.TimeSeries(); + ScriptContextStats stats = new ScriptContextStats("c", 1111, 2222, 3333, null, empty); + + XContentBuilder builder = XContentFactory.jsonBuilder().prettyPrint(); + stats.toXContent(builder, ToXContent.EMPTY_PARAMS); + + String expected = + "{\n" + + " \"context\" : \"c\",\n" + + " \"compilations\" : 1111,\n" + + " \"cache_evictions\" : 2222,\n" + + " \"compilation_limit_triggered\" : 3333\n" + + "}"; + + assertThat(Strings.toString(builder), equalTo(expected)); + } + + public void testSerializeTimeSeries() throws IOException { + Function mkContextStats = + (ts) -> new ScriptContextStats("c", 1111, 2222, 3333, null, ts); + + ScriptContextStats.TimeSeries series = new ScriptContextStats.TimeSeries(0, 0, 5); + String format = + "{\n" + + " \"context\" : \"c\",\n" + + " \"compilations\" : 1111,\n" + + " \"cache_evictions\" : 2222,\n" + + " \"cache_evictions_history\" : {\n" + + " \"5m\" : %d,\n" + + " \"15m\" : %d,\n" + + " \"24h\" : %d\n" + + " },\n" + + " \"compilation_limit_triggered\" : 3333\n" + + "}"; + + XContentBuilder builder = XContentFactory.jsonBuilder().prettyPrint(); + mkContextStats.apply(series).toXContent(builder, ToXContent.EMPTY_PARAMS); + + assertThat(Strings.toString(builder), equalTo(String.format(Locale.ROOT, format, 0, 0, 5))); + + series = new ScriptContextStats.TimeSeries(0, 7, 1234); + builder = XContentFactory.jsonBuilder().prettyPrint(); + mkContextStats.apply(series).toXContent(builder, ToXContent.EMPTY_PARAMS); + assertThat(Strings.toString(builder), equalTo(String.format(Locale.ROOT, format, 0, 7, 1234))); + + series = new ScriptContextStats.TimeSeries(123, 456, 789); + builder = XContentFactory.jsonBuilder().prettyPrint(); + mkContextStats.apply(series).toXContent(builder, ToXContent.EMPTY_PARAMS); + assertThat(Strings.toString(builder), equalTo(String.format(Locale.ROOT, format, 123, 456, 789))); + } + + public void testTimeSeriesAssertions() { + expectThrows(AssertionError.class, () -> new ScriptContextStats.TimeSeries(-1, 1, 2)); + expectThrows(AssertionError.class, () -> new ScriptContextStats.TimeSeries(1, 0, 2)); + expectThrows(AssertionError.class, () -> new ScriptContextStats.TimeSeries(1, 3, 2)); + } + + public void testTimeSeriesIsEmpty() { + assertTrue((new ScriptContextStats.TimeSeries(0, 0, 0)).isEmpty()); + long day = randomLongBetween(1, 1024); + long fifteen = day >= 1 ? randomLongBetween(0, day) : 0; + long five = fifteen >= 1 ? randomLongBetween(0, fifteen) : 0; + assertFalse((new ScriptContextStats.TimeSeries(five, fifteen, day)).isEmpty()); + } + + public void testTimeSeriesSerialization() throws IOException { + ScriptContextStats stats = randomStats(); + + ScriptContextStats deserStats = serDeser(Version.V_8_0_0, Version.V_7_16_0, stats); + assertEquals(stats.getCompilations(), deserStats.getCompilations()); + assertEquals(stats.getCacheEvictions(), deserStats.getCacheEvictions()); + assertEquals(stats.getCompilationLimitTriggered(), deserStats.getCompilationLimitTriggered()); + assertNull(deserStats.getCompilationsHistory()); + assertNull(deserStats.getCacheEvictionsHistory()); + + deserStats = serDeser(Version.V_8_0_0, Version.V_8_0_0, stats); + assertEquals(stats.getCompilations(), deserStats.getCompilations()); + assertEquals(stats.getCacheEvictions(), deserStats.getCacheEvictions()); + assertEquals(stats.getCompilationLimitTriggered(), deserStats.getCompilationLimitTriggered()); + assertEquals(stats.getCompilationsHistory(), deserStats.getCompilationsHistory()); + assertEquals(stats.getCacheEvictionsHistory(), deserStats.getCacheEvictionsHistory()); + } + + public ScriptContextStats serDeser(Version outVersion, Version inVersion, ScriptContextStats stats) throws IOException { + try (BytesStreamOutput out = new BytesStreamOutput()) { + out.setVersion(outVersion); + stats.writeTo(out); + try (StreamInput in = out.bytes().streamInput()) { + in.setVersion(inVersion); + return new ScriptContextStats(in); + } + } + } + + public ScriptContextStats randomStats() { + long[] histStats = {randomLongBetween(0, 2048), randomLongBetween(0, 2048)}; + List timeSeries = new ArrayList<>(); + for (int j = 0; j < 2; j++) { + if (randomBoolean() && histStats[j] > 0) { + long day = randomLongBetween(0, histStats[j]); + long fifteen = day >= 1 ? randomLongBetween(0, day) : 0; + long five = fifteen >= 1 ? randomLongBetween(0, fifteen) : 0; + timeSeries.add(new ScriptContextStats.TimeSeries(five, fifteen, day)); + } else { + timeSeries.add(new ScriptContextStats.TimeSeries()); + } + } + return new ScriptContextStats( + randomAlphaOfLength(15), + histStats[0], + histStats[1], + randomLongBetween(0, 1024), + timeSeries.get(0), + timeSeries.get(1) + ); + } } From 9faf060bb3e9271972e4daf16a1fe9bb57ed645b Mon Sep 17 00:00:00 2001 From: Jake Landis Date: Mon, 27 Sep 2021 09:44:05 -0500 Subject: [PATCH 011/250] Introduce replaceValueInLength (#77656) This commit adds a new compatible test transform `replaceValueInLength` This transform allows to replace the value of a length assertion for the compatible YAML REST tests. --- .../YamlRestCompatTestPluginFuncTest.groovy | 5 +++ .../compat/RestCompatTestTransformTask.java | 24 ++++++++++ .../length/ReplaceValueInLength.java | 43 ++++++++++++++++++ .../length/ReplaceKeyInLengthTests.java | 2 +- .../length/ReplaceValueInLengthTests.java | 45 +++++++++++++++++++ ...yml => length_replace_transformed_key.yml} | 0 .../length_replace_transformed_value.yml | 18 ++++++++ 7 files changed, 136 insertions(+), 1 deletion(-) create mode 100644 build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/transform/length/ReplaceValueInLength.java create mode 100644 build-tools-internal/src/test/java/org/elasticsearch/gradle/internal/test/rest/transform/length/ReplaceValueInLengthTests.java rename build-tools-internal/src/test/resources/rest/transform/length/{length_replace_transformed.yml => length_replace_transformed_key.yml} (100%) create mode 100644 build-tools-internal/src/test/resources/rest/transform/length/length_replace_transformed_value.yml diff --git a/build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/internal/test/rest/YamlRestCompatTestPluginFuncTest.groovy b/build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/internal/test/rest/YamlRestCompatTestPluginFuncTest.groovy index 6e16b5a7be172..e6a640b3a5ad1 100644 --- a/build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/internal/test/rest/YamlRestCompatTestPluginFuncTest.groovy +++ b/build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/internal/test/rest/YamlRestCompatTestPluginFuncTest.groovy @@ -212,6 +212,7 @@ class YamlRestCompatTestPluginFuncTest extends AbstractRestResourcesFuncTest { task.replaceKeyInDo("do_.some.key_to_replace_in_two", "do_.some.key_that_was_replaced_in_two", "two") task.replaceKeyInMatch("match_.some.key_to_replace", "match_.some.key_that_was_replaced") task.replaceKeyInLength("key.in_length_to_replace", "key.in_length_that_was_replaced") + task.replaceValueInLength("value_to_replace", 99, "one") task.replaceValueTextByKeyValue("keyvalue", "toreplace", "replacedkeyvalue") task.replaceValueTextByKeyValue("index", "test", "test2", "two") }) @@ -242,6 +243,7 @@ class YamlRestCompatTestPluginFuncTest extends AbstractRestResourcesFuncTest { - is_true: "value_not_to_replace" - is_false: "value_not_to_replace" - length: { key.in_length_to_replace: 1 } + - length: { value_to_replace: 1 } --- "two": - do: @@ -258,6 +260,7 @@ class YamlRestCompatTestPluginFuncTest extends AbstractRestResourcesFuncTest { - is_false: "value_to_replace" - is_true: "value_not_to_replace" - is_false: "value_not_to_replace" + - length: { value_not_to_replace: 1 } --- "use cat with no header": - do: @@ -322,6 +325,7 @@ class YamlRestCompatTestPluginFuncTest extends AbstractRestResourcesFuncTest { - is_true: "value_not_to_replace" - is_false: "value_not_to_replace" - length: { key.in_length_that_was_replaced: 1 } + - length: { value_to_replace: 99 } - match: _source.added: name: "jake" @@ -355,6 +359,7 @@ class YamlRestCompatTestPluginFuncTest extends AbstractRestResourcesFuncTest { - is_false: "replaced_value" - is_true: "value_not_to_replace" - is_false: "value_not_to_replace" + - length: { value_not_to_replace: 1 } --- "use cat with no header": - do: diff --git a/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/rest/compat/RestCompatTestTransformTask.java b/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/rest/compat/RestCompatTestTransformTask.java index be964536f65bd..073f92b2d5226 100644 --- a/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/rest/compat/RestCompatTestTransformTask.java +++ b/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/rest/compat/RestCompatTestTransformTask.java @@ -13,6 +13,7 @@ import com.fasterxml.jackson.databind.ObjectReader; import com.fasterxml.jackson.databind.ObjectWriter; import com.fasterxml.jackson.databind.SequenceWriter; +import com.fasterxml.jackson.databind.node.NumericNode; import com.fasterxml.jackson.databind.node.ObjectNode; import com.fasterxml.jackson.databind.node.TextNode; import com.fasterxml.jackson.dataformat.yaml.YAMLFactory; @@ -24,6 +25,7 @@ import org.elasticsearch.gradle.internal.test.rest.transform.do_.ReplaceKeyInDo; import org.elasticsearch.gradle.internal.test.rest.transform.headers.InjectHeaders; import org.elasticsearch.gradle.internal.test.rest.transform.length.ReplaceKeyInLength; +import org.elasticsearch.gradle.internal.test.rest.transform.length.ReplaceValueInLength; import org.elasticsearch.gradle.internal.test.rest.transform.match.AddMatch; import org.elasticsearch.gradle.internal.test.rest.transform.match.RemoveMatch; import org.elasticsearch.gradle.internal.test.rest.transform.match.ReplaceKeyInMatch; @@ -163,6 +165,28 @@ public void replaceKeyInLength(String oldKeyName, String newKeyName) { transformations.add(new ReplaceKeyInLength(oldKeyName, newKeyName, null)); } + /** + * Replaces all the values of a length assertion for all project REST tests. + * For example "length":{"x": 1} to "length":{"x": 99} + * + * @param subKey the key name directly under match to replace. For example "x" + * @param value the value used in the replacement. For example 99 + */ + public void replaceValueInLength(String subKey, int value) { + transformations.add(new ReplaceValueInLength(subKey, MAPPER.convertValue(value, NumericNode.class))); + } + + /** + * Replaces all the values of a length assertion for the given REST test. + * For example "length":{"x": 1} to "length":{"x": 99} + * @param subKey the key name directly under match to replace. For example "x" + * @param value the value used in the replacement. For example 99 + * @param testName the testName to apply replacement + */ + public void replaceValueInLength(String subKey, int value, String testName) { + transformations.add(new ReplaceValueInLength(subKey, MAPPER.convertValue(value, NumericNode.class), testName)); + } + /** * A transformation to replace the key in a match assertion. * @see ReplaceKeyInMatch diff --git a/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/transform/length/ReplaceValueInLength.java b/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/transform/length/ReplaceValueInLength.java new file mode 100644 index 0000000000000..a70445d3e7832 --- /dev/null +++ b/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/transform/length/ReplaceValueInLength.java @@ -0,0 +1,43 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.gradle.internal.test.rest.transform.length; + +import com.fasterxml.jackson.databind.node.NumericNode; +import com.fasterxml.jackson.databind.node.ObjectNode; + +import org.elasticsearch.gradle.internal.test.rest.transform.ReplaceByKey; +import org.gradle.api.tasks.Internal; + +/** + * A transformation to replace the key in a length assertion, must be a numeric type + * For example, change from "length":{"index._doc": 1} to "length":{"index._doc": 2} + */ +public class ReplaceValueInLength extends ReplaceByKey { + + public ReplaceValueInLength(String replaceKey, NumericNode replacementNode) { + this(replaceKey, replacementNode, null); + } + + public ReplaceValueInLength(String replaceKey, NumericNode replacementNode, String testName) { + super(replaceKey, replaceKey, replacementNode, testName); + } + + @Override + @Internal + public String getKeyToFind() { + return "length"; + } + + @Override + public void transformTest(ObjectNode matchParent) { + ObjectNode matchNode = (ObjectNode) matchParent.get(getKeyToFind()); + matchNode.remove(requiredChildKey()); + matchNode.set(getNewChildKey(), getReplacementNode()); + } +} diff --git a/build-tools-internal/src/test/java/org/elasticsearch/gradle/internal/test/rest/transform/length/ReplaceKeyInLengthTests.java b/build-tools-internal/src/test/java/org/elasticsearch/gradle/internal/test/rest/transform/length/ReplaceKeyInLengthTests.java index b2423051af355..98bdb9280f534 100644 --- a/build-tools-internal/src/test/java/org/elasticsearch/gradle/internal/test/rest/transform/length/ReplaceKeyInLengthTests.java +++ b/build-tools-internal/src/test/java/org/elasticsearch/gradle/internal/test/rest/transform/length/ReplaceKeyInLengthTests.java @@ -23,7 +23,7 @@ public void testLengthKeyChange() throws Exception { String test_original = "/rest/transform/length/length_replace_original.yml"; List tests = getTests(test_original); - String test_transformed = "/rest/transform/length/length_replace_transformed.yml"; + String test_transformed = "/rest/transform/length/length_replace_transformed_key.yml"; List expectedTransformation = getTests(test_transformed); List transformedTests = transformTests( diff --git a/build-tools-internal/src/test/java/org/elasticsearch/gradle/internal/test/rest/transform/length/ReplaceValueInLengthTests.java b/build-tools-internal/src/test/java/org/elasticsearch/gradle/internal/test/rest/transform/length/ReplaceValueInLengthTests.java new file mode 100644 index 0000000000000..f44ed1ec9a789 --- /dev/null +++ b/build-tools-internal/src/test/java/org/elasticsearch/gradle/internal/test/rest/transform/length/ReplaceValueInLengthTests.java @@ -0,0 +1,45 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.gradle.internal.test.rest.transform.length; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.node.NumericNode; +import com.fasterxml.jackson.databind.node.ObjectNode; +import com.fasterxml.jackson.dataformat.yaml.YAMLFactory; + +import org.elasticsearch.gradle.internal.test.rest.transform.AssertObjectNodes; +import org.elasticsearch.gradle.internal.test.rest.transform.TransformTests; +import org.junit.Test; + +import java.util.Collections; +import java.util.List; + +public class ReplaceValueInLengthTests extends TransformTests { + + private static final YAMLFactory YAML_FACTORY = new YAMLFactory(); + private static final ObjectMapper MAPPER = new ObjectMapper(YAML_FACTORY); + + @Test + public void testReplaceMatch() throws Exception { + String test_original = "/rest/transform/length/length_replace_original.yml"; + List tests = getTests(test_original); + + String test_transformed = "/rest/transform/length/length_replace_transformed_value.yml"; + List expectedTransformation = getTests(test_transformed); + + NumericNode replacementNode = MAPPER.convertValue(99, NumericNode.class); + + List transformedTests = transformTests( + tests, + Collections.singletonList(new ReplaceValueInLength("key.in_length_to_replace", replacementNode, null)) + ); + + AssertObjectNodes.areEqual(transformedTests, expectedTransformation); + } +} diff --git a/build-tools-internal/src/test/resources/rest/transform/length/length_replace_transformed.yml b/build-tools-internal/src/test/resources/rest/transform/length/length_replace_transformed_key.yml similarity index 100% rename from build-tools-internal/src/test/resources/rest/transform/length/length_replace_transformed.yml rename to build-tools-internal/src/test/resources/rest/transform/length/length_replace_transformed_key.yml diff --git a/build-tools-internal/src/test/resources/rest/transform/length/length_replace_transformed_value.yml b/build-tools-internal/src/test/resources/rest/transform/length/length_replace_transformed_value.yml new file mode 100644 index 0000000000000..8814c63dcbca5 --- /dev/null +++ b/build-tools-internal/src/test/resources/rest/transform/length/length_replace_transformed_value.yml @@ -0,0 +1,18 @@ +--- +"First test": + + - do: + something: + that_is: true + + - do: + and: again + + - key_not_to_replace: { copied.from.real.test.total: 1 } + - length: { key.in_length_to_replace: 99 } + + - do: + and: again + + - key_not_to_replace: { hits.total: 1 } + From 8c0d7fa2fa19c7f93ef39ff0d11eddb0648af003 Mon Sep 17 00:00:00 2001 From: Przemyslaw Gomulka Date: Mon, 27 Sep 2021 16:56:26 +0200 Subject: [PATCH 012/250] [doc] Improve documentation for deprecation logging (#78326) adding a section on WARN messages relates #77030 --- docs/reference/setup/logging-config.asciidoc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/reference/setup/logging-config.asciidoc b/docs/reference/setup/logging-config.asciidoc index ae58c669a1df6..f4eb69d83c00b 100644 --- a/docs/reference/setup/logging-config.asciidoc +++ b/docs/reference/setup/logging-config.asciidoc @@ -200,8 +200,14 @@ By default, {es} rolls and compresses deprecation logs at 1GB. The default configuration preserves a maximum of five log files: four rolled logs and an active log. -{es} emits deprecation log messages at the `CRITICAL` level. To stop writing -deprecation log messages, set `logger.deprecation.level` to `OFF`: +{es} emits deprecation log messages at the `CRITICAL` level. Those messages +are indicating that a used deprecation feature will be removed in a next major +version. Deprecation log messages at the `WARN` level indicates that a less +critical feature was used, it won't be removed in next major version, but might +be removed in the future. + +To stop writing deprecation log messages, set `logger.deprecation.level` +to `OFF`: [source,properties] ---- From 4782cf4d9158e401d76b4bce3d63f8953890b120 Mon Sep 17 00:00:00 2001 From: David Turner Date: Mon, 27 Sep 2021 16:56:35 +0100 Subject: [PATCH 013/250] Add docs for pre-release version compatibility (#78317) The reference manual includes docs on version compatibility in various places, but it's not clear that these docs only apply to released versions and that the rules for pre-release versions are stricter than folks expect. This commit adds some words to the docs for unreleased versions which explains this subtlety. --- docs/reference/ccr/index.asciidoc | 2 +- .../modules/remote-clusters-shared.asciidoc | 24 +++++++++++++++++ .../modules/remote-clusters.asciidoc | 26 ++++++++----------- .../reference/snapshot-restore/index.asciidoc | 14 ++++++++++ docs/reference/upgrade.asciidoc | 12 +++++++++ 5 files changed, 62 insertions(+), 16 deletions(-) create mode 100644 docs/reference/modules/remote-clusters-shared.asciidoc diff --git a/docs/reference/ccr/index.asciidoc b/docs/reference/ccr/index.asciidoc index 777e5a829a827..b853587bf5cb1 100644 --- a/docs/reference/ccr/index.asciidoc +++ b/docs/reference/ccr/index.asciidoc @@ -32,7 +32,7 @@ If newer, the versions must also be compatible as outlined in the following matr [[ccr-version-compatibility]] .Version compatibility matrix ==== -include::../modules/remote-clusters.asciidoc[tag=remote-cluster-compatibility-matrix] +include::../modules/remote-clusters-shared.asciidoc[tag=remote-cluster-compatibility-matrix] ==== [discrete] diff --git a/docs/reference/modules/remote-clusters-shared.asciidoc b/docs/reference/modules/remote-clusters-shared.asciidoc new file mode 100644 index 0000000000000..36985f20eb5af --- /dev/null +++ b/docs/reference/modules/remote-clusters-shared.asciidoc @@ -0,0 +1,24 @@ +// tag::remote-cluster-compatibility-matrix[] +[cols="^,^,^,^,^,^,^,^"] +|==== +| 7+^h| Local cluster +h| Remote cluster | 5.0->5.5 | 5.6 | 6.0->6.6 | 6.7 | 6.8 | 7.0 | 7.1->7.x +| 5.0->5.5 | {yes-icon} | {yes-icon} | {no-icon} | {no-icon} | {no-icon} | {no-icon} | {no-icon} +| 5.6 | {yes-icon} | {yes-icon} | {yes-icon} | {yes-icon} | {yes-icon} | {no-icon} | {no-icon} +| 6.0->6.6 | {no-icon} | {yes-icon} | {yes-icon} | {yes-icon} | {yes-icon} | {no-icon} | {no-icon} +| 6.7 | {no-icon} | {yes-icon} | {yes-icon} | {yes-icon} | {yes-icon} | {yes-icon} | {no-icon} +| 6.8 | {no-icon} | {yes-icon} | {yes-icon} | {yes-icon} | {yes-icon} | {yes-icon} | {yes-icon} +| 7.0 | {no-icon} | {no-icon} | {no-icon} | {yes-icon} | {yes-icon} | {yes-icon} | {yes-icon} +| 7.1->7.x | {no-icon} | {no-icon} | {no-icon} | {no-icon} | {yes-icon} | {yes-icon} | {yes-icon} +|==== + +ifeval::["{release-state}"!="released"] +NOTE: This documentation is for {es} {version}, which is not yet released. The +above compatibility table only applies if the local or remote cluster is running +a released version of {es}. A local cluster running a pre-release build of {es} +can also communicate with remote clusters running the same pre-release build. +Running a mix of pre-release builds is unsupported and typically will not work, +even if the builds are the same version. +endif::[] + +// end::remote-cluster-compatibility-matrix[] diff --git a/docs/reference/modules/remote-clusters.asciidoc b/docs/reference/modules/remote-clusters.asciidoc index 2f1ca497e46c8..4a21e45de17b6 100644 --- a/docs/reference/modules/remote-clusters.asciidoc +++ b/docs/reference/modules/remote-clusters.asciidoc @@ -65,20 +65,7 @@ local and remote nodes. [%collapsible%open] .Version compatibility table ==== -// tag::remote-cluster-compatibility-matrix[] -[cols="^,^,^,^,^,^,^,^"] -|==== -| 7+^h| Local cluster -h| Remote cluster | 5.0->5.5 | 5.6 | 6.0->6.6 | 6.7 | 6.8 | 7.0 | 7.1->7.x -| 5.0->5.5 | {yes-icon} | {yes-icon} | {no-icon} | {no-icon} | {no-icon} | {no-icon} | {no-icon} -| 5.6 | {yes-icon} | {yes-icon} | {yes-icon} | {yes-icon} | {yes-icon} | {no-icon} | {no-icon} -| 6.0->6.6 | {no-icon} | {yes-icon} | {yes-icon} | {yes-icon} | {yes-icon} | {no-icon} | {no-icon} -| 6.7 | {no-icon} | {yes-icon} | {yes-icon} | {yes-icon} | {yes-icon} | {yes-icon} | {no-icon} -| 6.8 | {no-icon} | {yes-icon} | {yes-icon} | {yes-icon} | {yes-icon} | {yes-icon} | {yes-icon} -| 7.0 | {no-icon} | {no-icon} | {no-icon} | {yes-icon} | {yes-icon} | {yes-icon} | {yes-icon} -| 7.1->7.x | {no-icon} | {no-icon} | {no-icon} | {no-icon} | {yes-icon} | {yes-icon} | {yes-icon} -|==== -// end::remote-cluster-compatibility-matrix[] +include::remote-clusters-shared.asciidoc[tag=remote-cluster-compatibility-matrix] ==== * *role*: Dedicated master nodes are never selected as gateway nodes. @@ -100,7 +87,16 @@ to the sniff <>, the remote connections are subject to the same version compatibility rules as <>. +Proxy mode has the same version compatibility requirements as sniff mode. + +[%collapsible] +[[proxy-mode-version-compatibility]] +.Version compatibility matrix +==== +include::remote-clusters-shared.asciidoc[tag=remote-cluster-compatibility-matrix] +==== + include::cluster/remote-clusters-security.asciidoc[] include::cluster/remote-clusters-connect.asciidoc[] include::../../../x-pack/docs/en/security/authentication/remote-clusters-privileges.asciidoc[] -include::cluster/remote-clusters-settings.asciidoc[] \ No newline at end of file +include::cluster/remote-clusters-settings.asciidoc[] diff --git a/docs/reference/snapshot-restore/index.asciidoc b/docs/reference/snapshot-restore/index.asciidoc index a40eba86b2ca6..0f15ff4e5f071 100644 --- a/docs/reference/snapshot-restore/index.asciidoc +++ b/docs/reference/snapshot-restore/index.asciidoc @@ -94,6 +94,20 @@ The following conditions apply for restoring snapshots and indices across versio The one caveat is that snapshots taken by {es} 2.0 can be restored in clusters running {es} 5.0. ==== +ifeval::["{release-state}"!="released"] +[[snapshot-prerelease-build-compatibility]] +NOTE: This documentation is for {es} {version}, which is not yet released. The +compatibility table above applies only to snapshots taken in a released version +of {es}. If you're testing a pre-release build of {es} then you can also take +and restore snapshots as normal, but you must not use the same snapshot +repository with other builds of {es} even if the builds are the same version. +Different pre-release builds of {es} may use different and incompatible +repository layouts. If the repository layout is incompatible with the {es} build +in use then taking and restoring snapshots may result in errors or may appear to +succeed having silently lost some data. You should discard the repository when +moving to a different build. +endif::[] + Each snapshot can contain indices created in various versions of {es}. This includes backing indices created for data streams. When restoring a snapshot, it must be possible to restore all of these indices into the target cluster. If any diff --git a/docs/reference/upgrade.asciidoc b/docs/reference/upgrade.asciidoc index 16a35e5e85ed6..5c3d648023c3e 100644 --- a/docs/reference/upgrade.asciidoc +++ b/docs/reference/upgrade.asciidoc @@ -87,6 +87,18 @@ When upgrading to a new version of {es}, you need to upgrade each of the products in your Elastic Stack. For more information, see the {stack-ref}/upgrading-elastic-stack.html[Elastic Stack Installation and Upgrade Guide]. +ifeval::["{release-state}"!="released"] +[[upgrade-pre-release]] +NOTE: This documentation is for {es} {version}, which is not yet released. You +may run a pre-release build of {es} for testing, and you may upgrade from an +earlier released version to a pre-release build of {es} {version} if permitted +by the compatibility table above, but upgrading from a pre-release build to +another build (whether released or not) is unsupported. Upgrading a pre-release +build may result in errors or may appear to succeed having silently lost some +data. You should discard the contents of a cluster running a pre-release build +when moving to a different build. +endif::[] + -- include::upgrade/rolling_upgrade.asciidoc[] From dc3570f9c93c151f38204b5ddabebe686a9a6212 Mon Sep 17 00:00:00 2001 From: Rene Groeschke Date: Mon, 27 Sep 2021 18:04:42 +0200 Subject: [PATCH 014/250] Enforce common dependency configuration setup (#78310) * Enforce common dependency configuration setup * Tweak dependencies for plugin sql server tests * Fix test runtime dependencies after disabling transitive support --- .../internal/ElasticsearchJavaBasePlugin.java | 64 +++++++++++++++++-- .../internal/ElasticsearchJavaPlugin.java | 50 +-------------- .../test/rest/InternalYamlRestTestPlugin.java | 3 - qa/smoke-test-http/build.gradle | 2 +- x-pack/plugin/sql/qa/server/build.gradle | 11 ++-- x-pack/qa/security-tools-tests/build.gradle | 5 ++ 6 files changed, 72 insertions(+), 63 deletions(-) diff --git a/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/ElasticsearchJavaBasePlugin.java b/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/ElasticsearchJavaBasePlugin.java index c12891f7c6289..38978390ad37f 100644 --- a/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/ElasticsearchJavaBasePlugin.java +++ b/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/ElasticsearchJavaBasePlugin.java @@ -32,9 +32,9 @@ import java.util.List; import java.util.Objects; +import java.util.function.Predicate; import java.util.stream.Stream; - /** * A wrapper around Gradle's Java Base plugin that applies our * common configuration for production code. @@ -50,6 +50,7 @@ public void apply(Project project) { project.getPluginManager().apply(ElasticsearchTestBasePlugin.class); project.getPluginManager().apply(PrecommitTaskPlugin.class); + configureConfigurations(project); configureCompile(project); configureInputNormalization(project); @@ -57,6 +58,54 @@ public void apply(Project project) { project.getExtensions().getExtraProperties().set("versions", VersionProperties.getVersions()); } + /** + * Makes dependencies non-transitive. + *

+ * Gradle allows setting all dependencies as non-transitive very easily. + * Sadly this mechanism does not translate into maven pom generation. In order + * to effectively make the pom act as if it has no transitive dependencies, + * we must exclude each transitive dependency of each direct dependency. + *

+ * Determining the transitive deps of a dependency which has been resolved as + * non-transitive is difficult because the process of resolving removes the + * transitive deps. To sidestep this issue, we create a configuration per + * direct dependency version. This specially named and unique configuration + * will contain all of the transitive dependencies of this particular + * dependency. We can then use this configuration during pom generation + * to iterate the transitive dependencies and add excludes. + */ + public static void configureConfigurations(Project project) { + // we are not shipping these jars, we act like dumb consumers of these things + if (project.getPath().startsWith(":test:fixtures") || project.getPath().equals(":build-tools")) { + return; + } + // fail on any conflicting dependency versions + project.getConfigurations().all(configuration -> { + if (configuration.getName().endsWith("Fixture")) { + // just a self contained test-fixture configuration, likely transitive and hellacious + return; + } + configuration.resolutionStrategy(ResolutionStrategy::failOnVersionConflict); + }); + + // disable transitive dependency management + SourceSetContainer sourceSets = project.getExtensions().getByType(SourceSetContainer.class); + sourceSets.all(sourceSet -> disableTransitiveDependenciesForSourceSet(project, sourceSet)); + } + + private static void disableTransitiveDependenciesForSourceSet(Project project, SourceSet sourceSet) { + List sourceSetConfigurationNames = List.of( + sourceSet.getApiConfigurationName(), + sourceSet.getImplementationConfigurationName(), + sourceSet.getImplementationConfigurationName(), + sourceSet.getCompileOnlyConfigurationName(), + sourceSet.getRuntimeOnlyConfigurationName() + ); + + project.getConfigurations().matching(c -> sourceSetConfigurationNames.contains(c.getName())) + .configureEach(GradleUtils::disableTransitiveDependencies); + } + /** * Adds compiler settings to the project */ @@ -90,13 +139,16 @@ public static void configureCompile(Project project) { 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(GroovyCompile.class) + .configureEach( + compileTask -> { + // TODO: this probably shouldn't apply to groovy at all? + compileTask.getOptions().getRelease().set(releaseVersionProviderFromCompileTask(project, compileTask)); + } + ); } - /** * Apply runtime classpath input normalization so that changes in JAR manifests don't break build cacheability */ diff --git a/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/ElasticsearchJavaPlugin.java b/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/ElasticsearchJavaPlugin.java index fe845e2012c70..02a1c235108c1 100644 --- a/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/ElasticsearchJavaPlugin.java +++ b/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/ElasticsearchJavaPlugin.java @@ -59,48 +59,13 @@ public void apply(Project project) { project.getPluginManager().apply(ElasticsearchJavaBasePlugin.class); project.getPluginManager().apply(JavaLibraryPlugin.class); - configureConfigurations(project); +// configureConfigurations(project); configureJars(project); configureJarManifest(project); configureJavadoc(project); testCompileOnlyDeps(project); } - /** - * Makes dependencies non-transitive. - *

- * Gradle allows setting all dependencies as non-transitive very easily. - * Sadly this mechanism does not translate into maven pom generation. In order - * to effectively make the pom act as if it has no transitive dependencies, - * we must exclude each transitive dependency of each direct dependency. - *

- * Determining the transitive deps of a dependency which has been resolved as - * non-transitive is difficult because the process of resolving removes the - * transitive deps. To sidestep this issue, we create a configuration per - * direct dependency version. This specially named and unique configuration - * will contain all of the transitive dependencies of this particular - * dependency. We can then use this configuration during pom generation - * to iterate the transitive dependencies and add excludes. - */ - public static void configureConfigurations(Project project) { - // we are not shipping these jars, we act like dumb consumers of these things - if (project.getPath().startsWith(":test:fixtures") || project.getPath().equals(":build-tools")) { - return; - } - // fail on any conflicting dependency versions - project.getConfigurations().all(configuration -> { - if (configuration.getName().endsWith("Fixture")) { - // just a self contained test-fixture configuration, likely transitive and hellacious - return; - } - configuration.resolutionStrategy(ResolutionStrategy::failOnVersionConflict); - }); - - // disable transitive dependency management - SourceSetContainer sourceSets = project.getExtensions().getByType(SourceSetContainer.class); - sourceSets.all(sourceSet -> disableTransitiveDependenciesForSourceSet(project, sourceSet)); - } - private static void testCompileOnlyDeps(Project project) { // we want to test compileOnly deps! Configuration compileOnlyConfig = project.getConfigurations().getByName(JavaPlugin.COMPILE_ONLY_CONFIGURATION_NAME); @@ -192,17 +157,4 @@ private static void configureJavadoc(Project project) { project.getTasks().named(LifecycleBasePlugin.CHECK_TASK_NAME).configure(t -> t.dependsOn(javadoc)); } - private static void disableTransitiveDependenciesForSourceSet(Project project, SourceSet sourceSet) { - Stream.of( - sourceSet.getApiConfigurationName(), - sourceSet.getImplementationConfigurationName(), - sourceSet.getImplementationConfigurationName(), - sourceSet.getCompileOnlyConfigurationName(), - sourceSet.getRuntimeOnlyConfigurationName() - ) - .map(name -> project.getConfigurations().findByName(name)) - .filter(Objects::nonNull) - .forEach(GradleUtils::disableTransitiveDependencies); - } - } diff --git a/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/InternalYamlRestTestPlugin.java b/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/InternalYamlRestTestPlugin.java index 25ee8a24b9791..0ba0127663db3 100644 --- a/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/InternalYamlRestTestPlugin.java +++ b/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/InternalYamlRestTestPlugin.java @@ -8,7 +8,6 @@ package org.elasticsearch.gradle.internal.test.rest; -import org.elasticsearch.gradle.internal.ElasticsearchJavaPlugin; import org.elasticsearch.gradle.internal.test.RestTestBasePlugin; import org.elasticsearch.gradle.util.GradleUtils; import org.gradle.api.Plugin; @@ -31,8 +30,6 @@ public void apply(Project project) { project.getPluginManager().apply(RestTestBasePlugin.class); project.getPluginManager().apply(RestResourcesPlugin.class); - ElasticsearchJavaPlugin.configureConfigurations(project); - // create source set SourceSetContainer sourceSets = project.getExtensions().getByType(SourceSetContainer.class); SourceSet yamlTestSourceSet = sourceSets.create(SOURCE_SET_NAME); diff --git a/qa/smoke-test-http/build.gradle b/qa/smoke-test-http/build.gradle index 75c2ca3a09d01..7fbe58396d782 100644 --- a/qa/smoke-test-http/build.gradle +++ b/qa/smoke-test-http/build.gradle @@ -12,7 +12,7 @@ apply plugin: 'elasticsearch.rest-test' apply plugin: 'elasticsearch.test-with-dependencies' dependencies { - testImplementation "com.fasterxml.jackson.core:jackson-databind:2.8.11" + testImplementation "com.fasterxml.jackson.core:jackson-databind:2.10.4" testImplementation project(':modules:transport-netty4') // for http testImplementation project(':plugins:transport-nio') // for http } diff --git a/x-pack/plugin/sql/qa/server/build.gradle b/x-pack/plugin/sql/qa/server/build.gradle index 29441461ca588..00e9b214d24e6 100644 --- a/x-pack/plugin/sql/qa/server/build.gradle +++ b/x-pack/plugin/sql/qa/server/build.gradle @@ -74,10 +74,11 @@ subprojects { testRuntimeOnly "com.h2database:h2:${h2Version}" // H2GIS testing dependencies - testRuntimeOnly("org.orbisgis:h2gis:${h2gisVersion}") { - exclude group: "org.locationtech.jts" - exclude group: "com.fasterxml.jackson.core" - } + testRuntimeOnly("org.orbisgis:h2gis:${h2gisVersion}") + testRuntimeOnly("org.orbisgis:h2gis-api:${h2gisVersion}") + testRuntimeOnly("org.orbisgis:h2gis-utilities:${h2gisVersion}") + testRuntimeOnly("org.orbisgis:cts:1.5.2") + testRuntimeOnly project(path: xpackModule('sql:jdbc')) testRuntimeOnly xpackProject('plugin:sql:sql-client') @@ -99,6 +100,8 @@ subprojects { // spatial dependency testRuntimeOnly project(path: xpackModule('spatial')) + + testRuntimeOnly "org.slf4j:slf4j-api:1.7.25" } if (project.name != 'security') { diff --git a/x-pack/qa/security-tools-tests/build.gradle b/x-pack/qa/security-tools-tests/build.gradle index 1b482c1a1ef8f..ba66ac6a1d11e 100644 --- a/x-pack/qa/security-tools-tests/build.gradle +++ b/x-pack/qa/security-tools-tests/build.gradle @@ -7,6 +7,11 @@ dependencies { testRuntimeOnly "com.google.guava:guava:${versions.jimfs_guava}" } +configurations.all { + resolutionStrategy { + forcedModules = ["com.google.guava:guava:${versions.jimfs_guava}"] + } +} // add test resources from security, so certificate tool tests can use example certs tasks.named("processTestResources").configure { from(project(xpackModule('security')).sourceSets.test.resources.srcDirs) From 00defa38a976bfb8a10b49dab3e2ee103637e478 Mon Sep 17 00:00:00 2001 From: Benjamin Trent Date: Mon, 27 Sep 2021 12:46:13 -0400 Subject: [PATCH 015/250] [ML] adding some initial document for our pytorch NLP model support (#78270) Adding docs for: put vocab put model definition part start deployment all the new NLP configuration objects for trained model configurations --- .../apis/get-trained-models.asciidoc | 302 +++++++++++++++++- ...put-trained-model-definition-part.asciidoc | 30 +- .../put-trained-model-vocabulary.asciidoc | 36 ++- .../apis/put-trained-models.asciidoc | 258 +++++++++++++-- .../start-trained-model-deployment.asciidoc | 65 ++-- docs/reference/ml/ml-shared.asciidoc | 69 ++++ 6 files changed, 701 insertions(+), 59 deletions(-) diff --git a/docs/reference/ml/df-analytics/apis/get-trained-models.asciidoc b/docs/reference/ml/df-analytics/apis/get-trained-models.asciidoc index 2a74f20cf2522..9da47064a83d2 100644 --- a/docs/reference/ml/df-analytics/apis/get-trained-models.asciidoc +++ b/docs/reference/ml/df-analytics/apis/get-trained-models.asciidoc @@ -31,12 +31,8 @@ Requires the `monitor_ml` cluster privilege. This privilege is included in the `machine_learning_user` built-in role. -[[ml-get-trained-models-desc]] -== {api-description-title} - -You can get information for multiple trained models in a single API request by -using a comma-separated list of model IDs or a wildcard expression. - +//[[ml-get-trained-models-desc]] +//== {api-description-title} [[ml-get-trained-models-path-params]] == {api-path-parms-title} @@ -44,7 +40,9 @@ using a comma-separated list of model IDs or a wildcard expression. ``:: (Optional, string) include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=model-id-or-alias] - ++ +You can get information for multiple trained models in a single API request by +using a comma-separated list of model IDs or a wildcard expression. [[ml-get-trained-models-query-params]] == {api-query-parms-title} @@ -168,6 +166,155 @@ include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-results-field] (string) include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-classification-top-classes-results-field] ====== + +`fill_mask`:::: +(Optional, object) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-fill-mask] ++ +.Properties of fill_mask inference +[%collapsible%open] +====== +`tokenization`:::: +(Optional, object) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization] ++ +.Properties of tokenization +[%collapsible%open] +======= +`bert`:::: +(Optional, object) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert] ++ +.Properties of bert +[%collapsible%open] +======== +`do_lower_case`:::: +(Optional, boolean) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-do-lower-case] + +`max_sequence_length`:::: +(Optional, integer) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-max-sequence-length] + +`with_special_tokens`:::: +(Optional, boolean) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-with-special-tokens] +======== +======= +`vocabulary`:::: +(Optional, object) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-vocabulary] ++ +.Properties of vocabulary +[%collapsible%open] +======= +`index`:::: +(Required, string) +The index where the vocabulary is stored. +======= +====== + +`ner`:::: +(Optional, object) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-ner] ++ +.Properties of ner inference +[%collapsible%open] +====== +`classification_labels`:::: +(Optional, string) +An array of classification labels. NER supports only +Inside-Outside-Beginning labels (IOB) and only persons, organizations, locations, +and miscellaneous. For example: +`["O", "B-PER", "I-PER", "B-ORG", "I-ORG", "B-LOC", "I-LOC", "B-MISC", "I-MISC"]`. + +`tokenization`:::: +(Optional, object) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization] ++ +.Properties of tokenization +[%collapsible%open] +======= +`bert`:::: +(Optional, object) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert] ++ +.Properties of bert +[%collapsible%open] +======== +`do_lower_case`:::: +(Optional, boolean) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-do-lower-case] + +`max_sequence_length`:::: +(Optional, integer) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-max-sequence-length] + +`with_special_tokens`:::: +(Optional, boolean) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-with-special-tokens] +======== +======= +`vocabulary`:::: +(Optional, object) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-vocabulary] ++ +.Properties of vocabulary +[%collapsible%open] +======= +`index`:::: +(Required, string) +The index where the vocabulary is stored +======= +====== + +`pass_through`:::: +(Optional, object) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-pass-through] ++ +.Properties of pass_through inference +[%collapsible%open] +====== +`tokenization`:::: +(Optional, object) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization] ++ +.Properties of tokenization +[%collapsible%open] +======= +`bert`:::: +(Optional, object) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert] ++ +.Properties of bert +[%collapsible%open] +======== +`do_lower_case`:::: +(Optional, boolean) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-do-lower-case] + +`max_sequence_length`:::: +(Optional, integer) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-max-sequence-length] + +`with_special_tokens`:::: +(Optional, boolean) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-with-special-tokens] +======== +======= +`vocabulary`:::: +(Optional, object) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-vocabulary] ++ +.Properties of vocabulary +[%collapsible%open] +======= +`index`:::: +(Required, string) +The index where the vocabulary is stored. +======= +====== + `regression`:::: (object) Regression configuration for inference. @@ -183,11 +330,112 @@ include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-regression-num (string) include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-results-field] ====== +`text_classification`:::: +(Optional, object) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-text-classification] ++ +.Properties of text_classification inference +[%collapsible%open] +====== +`classification_labels`:::: +(Optional, string) +An array of classification labels. + +`num_top_classes`:::: +(Optional, integer) +Specifies the number of top class predictions to return. Defaults to all classes (-1). + +`tokenization`:::: +(Optional, object) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization] ++ +.Properties of tokenization +[%collapsible%open] +======= +`bert`:::: +(Optional, object) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert] ++ +.Properties of bert +[%collapsible%open] +======== +`do_lower_case`:::: +(Optional, boolean) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-do-lower-case] + +`max_sequence_length`:::: +(Optional, integer) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-max-sequence-length] + +`with_special_tokens`:::: +(Optional, boolean) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-with-special-tokens] +======== +======= + +`vocabulary`:::: +(Optional, object) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-vocabulary] ++ +.Properties of vocabulary +[%collapsible%open] +======= +`index`:::: +(Required, string) +The index where the vocabulary is stored. +======= +====== +`text_embedding`:::: +(Object, optional) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-text-embedding] ++ +.Properties of text_embedding inference +[%collapsible%open] +====== +`tokenization`:::: +(Optional, object) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization] ++ +.Properties of tokenization +[%collapsible%open] +======= +`bert`:::: +(Optional, object) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert] ++ +.Properties of bert +[%collapsible%open] +======== +`do_lower_case`:::: +(Optional, boolean) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-do-lower-case] + +`max_sequence_length`:::: +(Optional, integer) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-max-sequence-length] + +`with_special_tokens`:::: +(Optional, boolean) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-with-special-tokens] +======== +======= +`vocabulary`:::: +(Optional, object) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-vocabulary] ++ +.Properties of vocabulary +[%collapsible%open] +======= +`index`:::: +(Required, string) +The index where the vocabulary is stored. +======= +====== ===== `input`::: (object) -The input field names for the model definition.+ +The input field names for the model definition. + .Properties of `input` [%collapsible%open] @@ -197,11 +445,27 @@ The input field names for the model definition.+ An array of input field names for the model. ===== -`license_level`::: +// Begin location +`location`:: +(Optional, object) +The model definition location. Must be provided if the `definition` or `compressed_definition` are not +provided. ++ +.Properties of `location` +[%collapsible%open] +===== +`index`::: +(Required, object) +Indicates that the model definition is stored in an index. It is required to be empty as +the index for storing model definitions is configured automatically. +===== +// End location + +`license_level`:: (string) The license level of the trained model. -`metadata`::: +`metadata`:: (object) An object containing metadata about the trained model. For example, models created by {dfanalytics} contain `analysis_config` and `input` objects. @@ -331,15 +595,27 @@ include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-metadata-feature-impo ====== ===== -`model_id`::: +`model_id`:: (string) Identifier for the trained model. -`tags`::: +`model_type`:: +(Optional, string) +The created model type. By default the model type is `tree_ensemble`. +Appropriate types are: ++ +-- +* `tree_ensemble`: The model definition is an ensemble model of decision trees. +* `lang_ident`: A special type reserved for language identification models. +* `pytorch`: The stored definition is a PyTorch (specifically a TorchScript) model. Currently only +NLP models are supported. +-- + +`tags`:: (string) A comma delimited string of tags. A trained model can have many tags, or none. -`version`::: +`version`:: (string) The {es} version number in which the trained model was created. diff --git a/docs/reference/ml/df-analytics/apis/put-trained-model-definition-part.asciidoc b/docs/reference/ml/df-analytics/apis/put-trained-model-definition-part.asciidoc index 7b3170545e12a..71e02e620caf8 100644 --- a/docs/reference/ml/df-analytics/apis/put-trained-model-definition-part.asciidoc +++ b/docs/reference/ml/df-analytics/apis/put-trained-model-definition-part.asciidoc @@ -52,7 +52,33 @@ The total uncompressed definition length. (Required, number) The total number of parts that will be uploaded. Must be greater than 0. -//// [[ml-put-trained-model-definition-part-example]] == {api-examples-title} -//// + +The following example creates a model definition part for a previously +stored model configuration. The definition part is stored in the index +that is configured by the `location.index.name`. + + +NOTE: The value of the `definition` object is elided from the example +as it is a very large base64 encoded string. + +[source,console] +-------------------------------------------------- +PUT _ml/trained_models/elastic__distilbert-base-uncased-finetuned-conll03-english/part/0 +{ + "definition": "...", + "total_definition_length": 265632637, + "total_parts": 64 +} +-------------------------------------------------- +// TEST[skip:TBD] + +The API returns the following results: + +[source,console-result] +---- +{ + "acknowledged": true +} +---- \ No newline at end of file diff --git a/docs/reference/ml/df-analytics/apis/put-trained-model-vocabulary.asciidoc b/docs/reference/ml/df-analytics/apis/put-trained-model-vocabulary.asciidoc index 3d149011013cb..91faf598eae22 100644 --- a/docs/reference/ml/df-analytics/apis/put-trained-model-vocabulary.asciidoc +++ b/docs/reference/ml/df-analytics/apis/put-trained-model-vocabulary.asciidoc @@ -8,7 +8,7 @@ ++++ Creates a trained model vocabulary. -This is only supported on NLP type models. +This is supported only for natural language processing (NLP) models. experimental::[] @@ -25,6 +25,13 @@ Requires the `manage_ml` cluster privilege. This privilege is included in the `machine_learning_admin` built-in role. +[[ml-put-trained-model-vocabulary-desc]] +== {api-description-title} + +The vocabulary is stored in the index as described in +`inference_config.*.vocabulary` of the trained model definition. + + [[ml-put-trained-model-vocabulary-path-params]] == {api-path-parms-title} @@ -39,7 +46,30 @@ include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=model-id] (array) The model vocabulary. Must not be empty. -//// [[ml-put-trained-model-vocabulary-example]] == {api-examples-title} -//// + +The following example shows how to create a model vocabulary for a +previously stored trained model configuration. + +[source,js] +-------------------------------------------------- +PUT _ml/trained_models/elastic__distilbert-base-uncased-finetuned-conll03-english/vocabulary +{ + "vocabulary": [ + "[PAD]", + "[unused0]", + ... + ] +} +-------------------------------------------------- +// NOTCONSOLE + +The API returns the following results: + +[source,console-result] +---- +{ + "acknowledged": true +} +---- \ No newline at end of file diff --git a/docs/reference/ml/df-analytics/apis/put-trained-models.asciidoc b/docs/reference/ml/df-analytics/apis/put-trained-models.asciidoc index b8d6c8ced2d09..9edeb0a8d5565 100644 --- a/docs/reference/ml/df-analytics/apis/put-trained-models.asciidoc +++ b/docs/reference/ml/df-analytics/apis/put-trained-models.asciidoc @@ -376,13 +376,157 @@ A human-readable description of the {infer} trained model. //Begin inference_config `inference_config`:: (Required, object) -The default configuration for inference. This can be either a `regression` -or `classification` configuration. It must match the underlying -`definition.trained_model`'s `target_type`. +The default configuration for inference. This can be: `regression`, +`classification`, `fill_mask`, `ner`, `text_classification`, or `text_embedding`. +If `regression` or `classification`, it must match the `target_type` of the +underlying `definition.trained_model`. If `fill_mask`, `ner`, +`text_classification`, or `text_embedding`; the `model_type` must be `pytorch`. + .Properties of `inference_config` [%collapsible%open] ==== +`classification`::: +(Optional, object) +Classification configuration for inference. ++ +.Properties of classification inference +[%collapsible%open] +===== +`num_top_classes`:::: +(Optional, integer) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-classification-num-top-classes] + +`num_top_feature_importance_values`:::: +(Optional, integer) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-classification-num-top-feature-importance-values] + +`prediction_field_type`:::: +(Optional, string) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-classification-prediction-field-type] + +`results_field`:::: +(Optional, string) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-results-field] + +`top_classes_results_field`:::: +(Optional, string) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-classification-top-classes-results-field] +===== + +`fill_mask`::: +(Optional, object) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-fill-mask] ++ +.Properties of fill_mask inference +[%collapsible%open] +===== +`tokenization`:::: +(Optional, object) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization] ++ +.Properties of tokenization +[%collapsible%open] +====== +`bert`:::: +(Optional, object) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert] ++ +.Properties of bert +[%collapsible%open] +======= +`do_lower_case`:::: +(Optional, boolean) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-do-lower-case] + +`max_sequence_length`:::: +(Optional, integer) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-max-sequence-length] + +`with_special_tokens`:::: +(Optional, boolean) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-with-special-tokens] +======= +====== +===== + +`ner`::: +(Optional, object) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-ner] ++ +.Properties of ner inference +[%collapsible%open] +===== +`classification_labels`:::: +(Optional, string) +An array of classification labels. NER only supports Inside-Outside-Beginning labels (IOB) +and only persons, organizations, locations, and miscellaneous. +Example: ["O", "B-PER", "I-PER", "B-ORG", "I-ORG", "B-LOC", "I-LOC", "B-MISC", "I-MISC"] + +`tokenization`:::: +(Optional, object) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization] ++ +.Properties of tokenization +[%collapsible%open] +====== +`bert`:::: +(Optional, object) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert] ++ +.Properties of bert +[%collapsible%open] +======= +`do_lower_case`:::: +(Optional, boolean) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-do-lower-case] + +`max_sequence_length`:::: +(Optional, integer) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-max-sequence-length] + +`with_special_tokens`:::: +(Optional, boolean) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-with-special-tokens] +======= +====== +===== + +`pass_through`::: +(Optional, object) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-pass-through] ++ +.Properties of pass_through inference +[%collapsible%open] +===== +`tokenization`:::: +(Optional, object) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization] ++ +.Properties of tokenization +[%collapsible%open] +====== +`bert`:::: +(Optional, object) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert] ++ +.Properties of bert +[%collapsible%open] +======= +`do_lower_case`:::: +(Optional, boolean) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-do-lower-case] + +`max_sequence_length`:::: +(Optional, integer) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-max-sequence-length] + +`with_special_tokens`:::: +(Optional, boolean) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-with-special-tokens] +======= +====== +===== + `regression`::: (Optional, object) Regression configuration for inference. @@ -399,32 +543,82 @@ include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-regression-num include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-results-field] ===== -`classification`::: +`text_classification`::: (Optional, object) -Classification configuration for inference. +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-text-classification] + -.Properties of classification inference +.Properties of text_classification inference [%collapsible%open] ===== +`classification_labels`:::: +(Optional, string) An array of classification labels. + `num_top_classes`:::: (Optional, integer) -include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-classification-num-top-classes] +Specifies the number of top class predictions to return. Defaults to all classes (-1). -`num_top_feature_importance_values`:::: +`tokenization`:::: +(Optional, object) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization] ++ +.Properties of tokenization +[%collapsible%open] +====== +`bert`:::: +(Optional, object) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert] ++ +.Properties of bert +[%collapsible%open] +======= +`do_lower_case`:::: +(Optional, boolean) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-do-lower-case] + +`max_sequence_length`:::: (Optional, integer) -include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-classification-num-top-feature-importance-values] +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-max-sequence-length] -`prediction_field_type`:::: -(Optional, string) -include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-classification-prediction-field-type] +`with_special_tokens`:::: +(Optional, boolean) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-with-special-tokens] +======= +====== +===== +`text_embedding`::: +(Object, optional) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-text-embedding] ++ +.Properties of text_embedding inference +[%collapsible%open] +===== +`tokenization`:::: +(Optional, object) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization] ++ +.Properties of tokenization +[%collapsible%open] +====== +`bert`:::: +(Optional, object) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert] ++ +.Properties of bert +[%collapsible%open] +======= +`do_lower_case`:::: +(Optional, boolean) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-do-lower-case] -`results_field`:::: -(Optional, string) -include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-results-field] +`max_sequence_length`:::: +(Optional, integer) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-max-sequence-length] -`top_classes_results_field`:::: -(Optional, string) -include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-classification-top-classes-results-field] +`with_special_tokens`:::: +(Optional, boolean) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-with-special-tokens] +======= +====== ===== ==== //End of inference_config @@ -443,10 +637,38 @@ An array of input field names for the model. ==== //End input +// Begin location +`location`:: +(Optional, object) +The model definition location. If the `definition` or `compressed_definition` +are not specified, the `location` is required. ++ +.Properties of `location` +[%collapsible%open] +==== +`index`::: +(Required, object) +Indicates that the model definition is stored in an index. This object must be +empty as the index for storing model definitions is configured automatically. +==== +// End location + `metadata`:: (Optional, object) An object map that contains metadata about the model. +`model_type`:: +(Optional, string) +The created model type. By default the model type is `tree_ensemble`. +Appropriate types are: ++ +-- +* `tree_ensemble`: The model definition is an ensemble model of decision trees. +* `lang_ident`: A special type reserved for language identification models. +* `pytorch`: The stored definition is a PyTorch (specifically a TorchScript) model. Currently only +NLP models are supported. +-- + `tags`:: (Optional, string) An array of tags to organize the model. diff --git a/docs/reference/ml/df-analytics/apis/start-trained-model-deployment.asciidoc b/docs/reference/ml/df-analytics/apis/start-trained-model-deployment.asciidoc index 57248eadac3b8..083fdd2e84c3d 100644 --- a/docs/reference/ml/df-analytics/apis/start-trained-model-deployment.asciidoc +++ b/docs/reference/ml/df-analytics/apis/start-trained-model-deployment.asciidoc @@ -7,20 +7,23 @@ Start trained model deployment ++++ +Starts a new trained model deployment. + [[start-trained-model-deployment-request]] == {api-request-title} `POST _ml/trained_models//deployent/_start` -//// + [[start-trained-model-deployment-prereq]] == {api-prereq-title} +Requires the `manage_ml` cluster privilege. This privilege is included in the +`machine_learning_admin` built-in role. -//// -//// [[start-trained-model-deployment-desc]] == {api-description-title} -//// +Currently only `pytorch` models are supported for deployment. When deployed, +the model attempts allocation to every machine learning node. [[start-trained-model-deployment-path-params]] == {api-path-parms-title} @@ -39,25 +42,41 @@ to 20 seconds. `wait_for`:: (Optional, string) -Which allocation status to wait for before returning. Defaults to "started". -Valid values are: "starting", "started", and "fully_allocated". Each -indicating, respectively, deployment is starting but not yet on any -node, the model has started on at least one node, the deployment has -started on all valid nodes. - -//// -[role="child_attributes"] -[[start-trained-model-deployment-results]] -== {api-response-body-title} -//// - -//// -[[start-trained-models-response-codes]] -== {api-response-codes-title} -//// - -//// +Specifies the allocation status to wait for before returning. Defaults to +`started`. The value `starting` indicates deployment is starting but not yet on +any node. The value `started` indicates the model has started on at least one +node. The value `fully_allocated` indicates the deployment has started on all +valid nodes. + [[start-trained-model-deployment-example]] == {api-examples-title} -//// +The following example starts a new deployment for a +`elastic__d`istilbert-base-uncased-finetuned-conll03-english` trained model: + +[source,console] +-------------------------------------------------- +POST _ml/trained_models/elastic__distilbert-base-uncased-finetuned-conll03-english/deployment/_start?wait_for=started&timeout=1m +-------------------------------------------------- +// TEST[skip:TBD] + +The API returns the following results: + +[source,console-result] +---- +{ + "allocation": { + "task_parameters": { + "model_id": "elastic__distilbert-base-uncased-finetuned-conll03-english", + "model_bytes": 265632637 + }, + "routing_table": { + "uckeG3R8TLe2MMNBQ6AGrw": { + "routing_state": "started", + "reason": "" + } + }, + "allocation_state": "started" + } +} +---- diff --git a/docs/reference/ml/ml-shared.asciidoc b/docs/reference/ml/ml-shared.asciidoc index 6a5b3ee453240..d2fb3e41da0bc 100644 --- a/docs/reference/ml/ml-shared.asciidoc +++ b/docs/reference/ml/ml-shared.asciidoc @@ -912,6 +912,75 @@ Acceptable values are: `string`, `number`, `boolean`. When `boolean` is provided `1.0` is transformed to `true` and `0.0` to `false`. end::inference-config-classification-prediction-field-type[] +tag::inference-config-nlp-tokenization[] +Indicates the tokenization to perform and the desired settings. +end::inference-config-nlp-tokenization[] + +tag::inference-config-nlp-tokenization-bert[] +BERT-style tokenization is to be performed with the enclosed settings. +end::inference-config-nlp-tokenization-bert[] + +tag::inference-config-nlp-tokenization-bert-do-lower-case[] +Should the tokenization lower case the text sequence when building +the tokens. +end::inference-config-nlp-tokenization-bert-do-lower-case[] + +tag::inference-config-nlp-tokenization-bert-with-special-tokens[] +Tokenize with special tokens. The tokens typically included in BERT-style tokenization are: ++ +-- +* `[CLS]`: The first token of the sequence being classified. +* `[SEP]`: Indicates sequence separation. +-- +end::inference-config-nlp-tokenization-bert-with-special-tokens[] + +tag::inference-config-nlp-tokenization-bert-max-sequence-length[] +The maximum number of tokens allowed to be output by the tokenizer. +The default for BERT-style tokenization is `512`. +end::inference-config-nlp-tokenization-bert-max-sequence-length[] + +tag::inference-config-nlp-vocabulary[] +The configuration for retreiving the model's vocabulary. The vocabulary is then +used at inference time. This information is usually provided automatically by +storing vocabulary in a known, internally managed index. +end::inference-config-nlp-vocabulary[] + +tag::inference-config-nlp-fill-mask[] +Configuration for a fill_mask NLP task. The fill_mask task works with models +optimized for a fill mask action. For example, for BERT models, the following +text may be provided: "The capital of France is [MASK].". The response indicates +the value most likely to replace `[MASK]`. In this instance, the +most probable token is `paris`. +end::inference-config-nlp-fill-mask[] + +tag::inference-config-ner[] +Configures a named entity recognition (NER) task. NER is a special case of token +classification. Each token in the sequence is classified according to the +provided classification labels. Currently, the NER task requires the +`classification_labels` Inside-Outside-Beginning formatted labels. Only +person, organization, location, and miscellaneous are supported. +end::inference-config-ner[] + +tag::inference-config-pass-through[] +Configures a `pass_through` task. This task is useful for debugging as no +post-processing is done to the inference output and the raw pooling layer +results are returned to the caller. +end::inference-config-pass-through[] + +tag::inference-config-text-classification[] +A text classification task. Text classification classifies a provided text +sequence into previously known target classes. A specific example of this is +sentiment analysis, which returns the likely target classes indicating text +sentiment, such as "sad", "happy", or "angry". +end::inference-config-text-classification[] + +tag::inference-config-text-embedding[] +Text embedding takes an input sequence and transforms it into a vector of +numbers. These embeddings capture not simply tokens, but semantic meanings and +context. These embeddings can then be used in a <> +field for powerful insights. +end::inference-config-text-embedding[] + tag::inference-config-regression-num-top-feature-importance-values[] Specifies the maximum number of {ml-docs}/ml-feature-importance.html[{feat-imp}] values per document. From 52e73fe73d3dc50f295c8ca325e72544b388b829 Mon Sep 17 00:00:00 2001 From: Artem Prigoda Date: Mon, 27 Sep 2021 19:24:35 +0200 Subject: [PATCH 016/250] Report shard counts for ongoing snapshots (#77622) For in-progress snapshots we can try to calculate the amount of successful shards based on the shard state. We can use a similar approach for failures. Closes #76704 --- .../snapshots/GetSnapshotsIT.java | 13 +++++- .../SharedClusterSnapshotRestoreIT.java | 4 ++ .../snapshots/SnapshotStatusApisIT.java | 11 ++++- .../elasticsearch/snapshots/SnapshotInfo.java | 44 ++++++++++++------- 4 files changed, 51 insertions(+), 21 deletions(-) diff --git a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/GetSnapshotsIT.java b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/GetSnapshotsIT.java index 88aff5d411027..797f4ebbfe909 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/GetSnapshotsIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/GetSnapshotsIT.java @@ -14,6 +14,7 @@ import org.elasticsearch.action.admin.cluster.snapshots.get.GetSnapshotsRequest; import org.elasticsearch.action.admin.cluster.snapshots.get.GetSnapshotsRequestBuilder; import org.elasticsearch.action.admin.cluster.snapshots.get.GetSnapshotsResponse; +import org.elasticsearch.cluster.SnapshotsInProgress; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.search.sort.SortOrder; import org.elasticsearch.threadpool.ThreadPool; @@ -176,12 +177,20 @@ public void testSortAndPaginateWithInProgress() throws Exception { inProgressSnapshots.add(startFullSnapshot(repoName, snapshotName)); } awaitNumberOfSnapshotsInProgress(inProgressCount); - + awaitClusterState( + state -> state.custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY) + .entries() + .stream() + .flatMap(s -> s.shards().stream()) + .allMatch( + e -> e.getKey().getIndexName().equals("test-index-1") == false + || e.getValue().state() == SnapshotsInProgress.ShardState.SUCCESS + ) + ); final String[] repos = { repoName }; assertStablePagination(repos, allSnapshotNames, GetSnapshotsRequest.SortBy.START_TIME); assertStablePagination(repos, allSnapshotNames, GetSnapshotsRequest.SortBy.NAME); assertStablePagination(repos, allSnapshotNames, GetSnapshotsRequest.SortBy.INDICES); - assertThat( clusterAdmin().prepareGetSnapshots(matchAllPattern()) .setSnapshots(GetSnapshotsRequest.CURRENT_SNAPSHOT, "-snap*") diff --git a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/SharedClusterSnapshotRestoreIT.java b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/SharedClusterSnapshotRestoreIT.java index 20ec6259e2180..f258387e646f2 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/SharedClusterSnapshotRestoreIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/SharedClusterSnapshotRestoreIT.java @@ -1207,6 +1207,10 @@ public void testSnapshotStatus() throws Exception { assertThat(getResponse.getSnapshots().size(), equalTo(1)); SnapshotInfo snapshotInfo = getResponse.getSnapshots().get(0); assertThat(snapshotInfo.state(), equalTo(SnapshotState.IN_PROGRESS)); + snapshotStatus = client.admin().cluster().prepareSnapshotStatus().execute().actionGet().getSnapshots().get(0); + assertThat(snapshotInfo.totalShards(), equalTo(snapshotStatus.getIndices().get("test-idx").getShardsStats().getTotalShards())); + assertThat(snapshotInfo.successfulShards(), equalTo(snapshotStatus.getIndices().get("test-idx").getShardsStats().getDoneShards())); + assertThat(snapshotInfo.shardFailures().size(), equalTo(0)); logger.info("--> unblocking blocked node"); unblockNode("test-repo", blockedNode); diff --git a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/SnapshotStatusApisIT.java b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/SnapshotStatusApisIT.java index 860d5544dd803..2df49de96a2da 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/SnapshotStatusApisIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/SnapshotStatusApisIT.java @@ -409,7 +409,8 @@ public void testGetSnapshotsMultipleRepos() throws Exception { public void testGetSnapshotsWithSnapshotInProgress() throws Exception { createRepository("test-repo", "mock", Settings.builder().put("location", randomRepoPath()).put("block_on_data", true)); - createIndexWithContent("test-idx-1"); + String indexName = "test-idx-1"; + createIndexWithContent(indexName, indexSettingsNoReplicas(randomIntBetween(1, 10)).build()); ensureGreen(); ActionFuture createSnapshotResponseActionFuture = startFullSnapshot("test-repo", "test-snap"); @@ -426,7 +427,13 @@ public void testGetSnapshotsWithSnapshotInProgress() throws Exception { .get(); List snapshotInfoList = response1.getSnapshots(); assertEquals(1, snapshotInfoList.size()); - assertEquals(SnapshotState.IN_PROGRESS, snapshotInfoList.get(0).state()); + SnapshotInfo snapshotInfo = snapshotInfoList.get(0); + assertEquals(SnapshotState.IN_PROGRESS, snapshotInfo.state()); + + SnapshotStatus snapshotStatus = client().admin().cluster().prepareSnapshotStatus().execute().actionGet().getSnapshots().get(0); + assertThat(snapshotInfo.totalShards(), equalTo(snapshotStatus.getIndices().get(indexName).getShardsStats().getTotalShards())); + assertThat(snapshotInfo.successfulShards(), equalTo(snapshotStatus.getIndices().get(indexName).getShardsStats().getDoneShards())); + assertThat(snapshotInfo.shardFailures().size(), equalTo(0)); String notExistedSnapshotName = "snapshot_not_exist"; GetSnapshotsResponse response2 = client().admin() diff --git a/server/src/main/java/org/elasticsearch/snapshots/SnapshotInfo.java b/server/src/main/java/org/elasticsearch/snapshots/SnapshotInfo.java index 933f9d926b107..f6d14742456c1 100644 --- a/server/src/main/java/org/elasticsearch/snapshots/SnapshotInfo.java +++ b/server/src/main/java/org/elasticsearch/snapshots/SnapshotInfo.java @@ -7,6 +7,8 @@ */ package org.elasticsearch.snapshots; +import com.carrotsearch.hppc.cursors.ObjectObjectCursor; + import org.elasticsearch.Version; import org.elasticsearch.action.ShardOperationFailedException; import org.elasticsearch.action.admin.cluster.snapshots.get.GetSnapshotsRequest; @@ -28,6 +30,7 @@ import org.elasticsearch.common.xcontent.XContentParserUtils; import org.elasticsearch.core.Nullable; import org.elasticsearch.core.TimeValue; +import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.rest.RestStatus; import java.io.IOException; @@ -370,23 +373,30 @@ public SnapshotInfo( } public SnapshotInfo(SnapshotsInProgress.Entry entry) { - this( - entry.snapshot(), - List.copyOf(entry.indices().keySet()), - entry.dataStreams(), - entry.featureStates(), - null, - Version.CURRENT, - entry.startTime(), - 0L, - 0, - 0, - Collections.emptyList(), - entry.includeGlobalState(), - entry.userMetadata(), - SnapshotState.IN_PROGRESS, - Collections.emptyMap() - ); + int successfulShards = 0; + List shardFailures = new ArrayList<>(); + for (ObjectObjectCursor c : entry.shards()) { + if (c.value.state() == SnapshotsInProgress.ShardState.SUCCESS) { + successfulShards++; + } else if (c.value.state() == SnapshotsInProgress.ShardState.FAILED) { + shardFailures.add(new SnapshotShardFailure(c.value.nodeId(), c.key, c.value.reason())); + } + } + this.snapshot = Objects.requireNonNull(entry.snapshot()); + this.indices = List.copyOf(entry.indices().keySet()); + this.dataStreams = List.copyOf(entry.dataStreams()); + this.featureStates = List.copyOf(entry.featureStates()); + this.state = SnapshotState.IN_PROGRESS; + this.reason = null; + this.version = Version.CURRENT; + this.startTime = entry.startTime(); + this.endTime = 0L; + this.totalShards = entry.shards().size(); + this.successfulShards = successfulShards; + this.shardFailures = Collections.unmodifiableList(shardFailures); + this.includeGlobalState = entry.includeGlobalState(); + this.userMetadata = entry.userMetadata() == null ? null : Map.copyOf(entry.userMetadata()); + this.indexSnapshotDetails = Collections.emptyMap(); } public SnapshotInfo( From 60452dd794af71c459ac0d0c79e4b013e902efcb Mon Sep 17 00:00:00 2001 From: Christos Soulios <1561376+csoulios@users.noreply.github.com> Date: Mon, 27 Sep 2021 20:43:31 +0300 Subject: [PATCH 017/250] Added more tests for time_series mapping params (#78332) Added yaml tests for time_series_* mapping parameters to the histogram and aggregate_metric_double field types. Also, tests were made available to v7.16 --- .../rest-api-spec/test/tsdb/20_mappings.yml | 6 +- .../aggregate-metrics/90_tsdb_mappings.yml | 97 +++++++++++++++++++ .../test/analytics/histogram.yml | 75 ++++++++++++++ 3 files changed, 175 insertions(+), 3 deletions(-) create mode 100644 x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/aggregate-metrics/90_tsdb_mappings.yml diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/tsdb/20_mappings.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/tsdb/20_mappings.yml index e747f068f6f67..f8ea4e5209a0f 100644 --- a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/tsdb/20_mappings.yml +++ b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/tsdb/20_mappings.yml @@ -1,11 +1,11 @@ add time series mappings: - skip: - version: " - 7.99.99" - reason: introduced in 8.0.0 to be backported to 7.16.0 + version: " - 7.15.99" + reason: introduced in 7.16.0 - do: indices.create: - index: test_index + index: tsdb_index body: settings: index: diff --git a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/aggregate-metrics/90_tsdb_mappings.yml b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/aggregate-metrics/90_tsdb_mappings.yml new file mode 100644 index 0000000000000..36bc6ee842241 --- /dev/null +++ b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/aggregate-metrics/90_tsdb_mappings.yml @@ -0,0 +1,97 @@ +aggregate_double_metric with time series mappings: + - skip: + version: " - 7.15.99" + reason: introduced in 7.16.0 + + - do: + indices.create: + index: test_index + body: + settings: + index: + mode: time_series + number_of_replicas: 0 + number_of_shards: 2 + mappings: + properties: + "@timestamp": + type: date + metricset: + type: keyword + time_series_dimension: true + k8s: + properties: + pod: + properties: + uid: + type: keyword + time_series_dimension: true + name: + type: keyword + network: + properties: + tx: + type: aggregate_metric_double + metrics: [min, max, sum, value_count] + default_metric: max + time_series_metric: counter + rx: + type: aggregate_metric_double + metrics: [min, max, sum, value_count] + default_metric: max + time_series_metric: gauge + packets_dropped: + type: aggregate_metric_double + metrics: [min, max, sum, value_count] + default_metric: max + time_series_metric: summary + + +--- +aggregate_double_metric with wrong time series mappings: + - skip: + version: " - 7.15.99" + reason: introduced in 7.16.0 + - do: + catch: /Unknown value \[histogram\] for field \[time_series_metric\] \- accepted values are \[gauge, counter, summary\]/ + indices.create: + index: tsdb_index + body: + settings: + index: + mode: time_series + number_of_replicas: 0 + number_of_shards: 2 + mappings: + properties: + "@timestamp": + type: date + metricset: + type: keyword + time_series_dimension: true + k8s: + properties: + pod: + properties: + uid: + type: keyword + time_series_dimension: true + name: + type: keyword + network: + properties: + packets_dropped: + type: aggregate_metric_double + metrics: [ min, max, sum, value_count ] + default_metric: max + time_series_metric: summary + tx: + type: aggregate_metric_double + metrics: [min, max, sum, value_count] + default_metric: max + time_series_metric: counter + rx: + type: aggregate_metric_double + metrics: [min, max, sum, value_count] + default_metric: max + time_series_metric: histogram diff --git a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/analytics/histogram.yml b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/analytics/histogram.yml index 2a007b8d6fbe0..5a8639c2b8214 100644 --- a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/analytics/histogram.yml +++ b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/analytics/histogram.yml @@ -171,3 +171,78 @@ setup: - match: { aggregations.ranges.buckets.2.doc_count: 37 } - match: { aggregations.ranges.buckets.3.key: "0.5-*" } - match: { aggregations.ranges.buckets.3.doc_count: 11 } + +--- +histogram with time series mappings: + - skip: + version: " - 7.15.99" + reason: introduced in 7.16.0 + + - do: + + indices.create: + index: tsdb_index + body: + settings: + index: + mode: time_series + number_of_replicas: 0 + number_of_shards: 2 + mappings: + properties: + "@timestamp": + type: date + metricset: + type: keyword + time_series_dimension: true + k8s: + properties: + pod: + properties: + uid: + type: keyword + time_series_dimension: true + name: + type: keyword + network: + properties: + latency: + type: histogram + time_series_metric: histogram + +--- +histogram with wrong time series mappings: + - skip: + version: " - 7.15.99" + reason: introduced in 7.16.0 + - do: + catch: /Unknown value \[counter\] for field \[time_series_metric\] \- accepted values are \[histogram\]/ + indices.create: + index: tsdb_index + body: + settings: + index: + mode: time_series + number_of_replicas: 0 + number_of_shards: 2 + mappings: + properties: + "@timestamp": + type: date + metricset: + type: keyword + time_series_dimension: true + k8s: + properties: + pod: + properties: + uid: + type: keyword + time_series_dimension: true + name: + type: keyword + network: + properties: + latency: + type: histogram + time_series_metric: counter From 897485667a576875a949518b5cff6dd5b83f7267 Mon Sep 17 00:00:00 2001 From: Mark Vieira Date: Mon, 27 Sep 2021 12:29:10 -0700 Subject: [PATCH 018/250] Remove special handling for Azul JDKs in the build (#78281) --- .../internal/JdkDownloadPluginFuncTest.groovy | 18 +++------ .../fake_azuljdk_linux_aarch64.tar.gz | Bin 1072 -> 0 bytes .../internal/fake_azuljdk_osx_aarch64.tar.gz | Bin 1139 -> 0 bytes ...elasticsearch.runtime-jdk-provision.gradle | 2 +- .../elasticsearch/gradle/internal/Jdk.java | 2 +- .../gradle/internal/JdkDownloadPlugin.java | 38 ------------------ .../internal/JdkDownloadPluginTests.java | 2 +- .../gradle/VersionProperties.java | 23 ++--------- distribution/build.gradle | 4 +- 9 files changed, 14 insertions(+), 75 deletions(-) delete mode 100644 build-tools-internal/src/integTest/resources/org/elasticsearch/gradle/internal/fake_azuljdk_linux_aarch64.tar.gz delete mode 100644 build-tools-internal/src/integTest/resources/org/elasticsearch/gradle/internal/fake_azuljdk_osx_aarch64.tar.gz diff --git a/build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/internal/JdkDownloadPluginFuncTest.groovy b/build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/internal/JdkDownloadPluginFuncTest.groovy index 677bd6de8673c..677d2bf390db6 100644 --- a/build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/internal/JdkDownloadPluginFuncTest.groovy +++ b/build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/internal/JdkDownloadPluginFuncTest.groovy @@ -8,12 +8,13 @@ package org.elasticsearch.gradle.internal +import spock.lang.Unroll import com.github.tomakehurst.wiremock.WireMockServer + import org.elasticsearch.gradle.fixtures.AbstractGradleFuncTest import org.elasticsearch.gradle.fixtures.WiremockFixture import org.elasticsearch.gradle.transform.SymbolicLinkPreservingUntarTransform import org.elasticsearch.gradle.transform.UnzipTransform -import spock.lang.Unroll import java.nio.file.Files import java.nio.file.Path @@ -23,7 +24,6 @@ import java.util.regex.Pattern import static org.elasticsearch.gradle.internal.JdkDownloadPlugin.VENDOR_ADOPTIUM import static org.elasticsearch.gradle.internal.JdkDownloadPlugin.VENDOR_OPENJDK -import static org.elasticsearch.gradle.internal.JdkDownloadPlugin.VENDOR_AZUL class JdkDownloadPluginFuncTest extends AbstractGradleFuncTest { @@ -32,8 +32,7 @@ class JdkDownloadPluginFuncTest extends AbstractGradleFuncTest { private static final String ADOPT_JDK_VERSION_11 = "11.0.10+9" private static final String ADOPT_JDK_VERSION_15 = "15.0.2+7" private static final String OPEN_JDK_VERSION = "12.0.1+99@123456789123456789123456789abcde" - private static final String AZUL_AARCH_VERSION = "16.0.1+99@123456789123456789123456789abcde" - private static final Pattern JDK_HOME_LOGLINE = Pattern.compile("JDK HOME: (.*)"); + private static final Pattern JDK_HOME_LOGLINE = Pattern.compile("JDK HOME: (.*)") @Unroll def "jdk #jdkVendor for #platform#suffix are downloaded and extracted"() { @@ -84,8 +83,8 @@ class JdkDownloadPluginFuncTest extends AbstractGradleFuncTest { "darwin" | "x64" | VENDOR_OPENJDK | OPENJDK_VERSION_OLD | "Contents/Home/bin/java" | "(old version)" "mac" | "x64" | VENDOR_OPENJDK | OPEN_JDK_VERSION | "Contents/Home/bin/java" | "" "mac" | "x64" | VENDOR_OPENJDK | OPENJDK_VERSION_OLD | "Contents/Home/bin/java" | "(old version)" - "darwin" | "aarch64" | VENDOR_AZUL | AZUL_AARCH_VERSION | "Contents/Home/bin/java" | "" - "linux" | "aarch64" | VENDOR_AZUL | AZUL_AARCH_VERSION | "bin/java" | "" + "darwin" | "aarch64" | VENDOR_ADOPTIUM | ADOPT_JDK_VERSION | "Contents/Home/bin/java" | "" + "linux" | "aarch64" | VENDOR_ADOPTIUM | ADOPT_JDK_VERSION | "bin/java" | "" "linux" | "aarch64" | VENDOR_ADOPTIUM | ADOPT_JDK_VERSION_11 | "bin/java" | "(jdk 11)" "linux" | "aarch64" | VENDOR_ADOPTIUM | ADOPT_JDK_VERSION_15 | "bin/java" | "(jdk 15)" } @@ -212,10 +211,6 @@ class JdkDownloadPluginFuncTest extends AbstractGradleFuncTest { final String versionPath = isOld ? "jdk1/99" : "jdk12.0.1/123456789123456789123456789abcde/99"; final String filename = "openjdk-" + (isOld ? "1" : "12.0.1") + "_" + effectivePlatform + "-x64_bin." + extension(platform); return "/java/GA/" + versionPath + "/GPL/" + filename; - } else if (vendor.equals(VENDOR_AZUL)) { - final String module = isMac(platform) ? "macosx" : platform; - // we only test zulu 16 darwin aarch64 for now - return "/zulu${module.equals('linux') ? '-embedded' : ''}/bin/zulu16.32.15-ca-jdk16.0.2-${module}_${arch}.tar.gz"; } } @@ -225,9 +220,6 @@ class JdkDownloadPluginFuncTest extends AbstractGradleFuncTest { return JdkDownloadPluginFuncTest.class.getResourceAsStream("fake_adoptium_" + effectivePlatform + "." + extension(platform)).getBytes() } else if (vendor.equals(VENDOR_OPENJDK)) { JdkDownloadPluginFuncTest.class.getResourceAsStream("fake_openjdk_" + effectivePlatform + "." + extension(platform)).getBytes() - } else if (vendor.equals(VENDOR_AZUL)) { - String resourcePath = "fake_azuljdk_" + effectivePlatform + "_aarch64." + extension(platform) - JdkDownloadPluginFuncTest.class.getResourceAsStream(resourcePath).getBytes() } } diff --git a/build-tools-internal/src/integTest/resources/org/elasticsearch/gradle/internal/fake_azuljdk_linux_aarch64.tar.gz b/build-tools-internal/src/integTest/resources/org/elasticsearch/gradle/internal/fake_azuljdk_linux_aarch64.tar.gz deleted file mode 100644 index 299915707cd236faa951d16a0866e024fc97149b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1072 zcmV-01kd{)iwFSJ8y{c*1MQmKZre5(hAGEgpjsG0peF!Ab#`k{%B{3N|v z=hd)3q^8E28Z|e&V)J?L_h^-9Y_sor!_$rsLHCdwXmJQ3mTBU#@;NXh=NmKAU{l9SM-d$8d=sVHH-?#D4 zSQ2kTwWzSDypBq|{&&7pezmvvgItV{_$w+KsVd53`xJ-r5L=GABFCb^N4cFxEcNNL^CbD!7Ref^^bjbz)h1g>bE}R8kzA=F3tZ;w-7e3tC3f+ z;_;ui|Fw>`+wQbOKe+N=no0D3aKo72|J0iFzePzh{_Bwcl|r8U?+Hrszwv~8QKMC# zcgm^!@ATp*;C7NX{wH~2@o^w4{-^W5B>ow<2;_fdkk0=MZfI7c!F7{a4D!FFC-?ln z@a&%z|8e9SsrV-rwP5})31w&4qX@;*xr!34)Mi&zWw}H}>KYoq+o_|$vEBFWXzd^S z_}cFnxCz$A#YQgj?33yK>$`)HkbjlRTJ_E+cU5&=UH@$T*Y=@*(hfy99PEhTS-kdC zgon0V-t+zbyJcbj=sG8z`WIjOUMO783C0JzJtwO2%TKP?^G|mCq1PKco7$nOHMQ2M zZ=9WRi#^1KNzWhRvnC_avd+)XYwG<6^wGEbM}NFJ`}6$uo1_(rBAfGhs(EiG&Fc-i zeLK2AWwPmIJMj9x_Zv#yO#%P_tO|0>Q$PK$SW)I2}O}FC>1QVRjA1TurjPAQjh2V z$Mc{60RUKHlI4b)W2cY*80lBRz>&8>@#?*E!wIy|wC?o;^003o^ z-~VH~-h$UC;{UeD`1>C|GNx|^#7tB@FMWJ^M6Uq@PDHR zv#VzMzsKj3=Kufz007{21O9IS0OkSyZva?cQvUCG&;I}bEHRn>?|A$E)ba?;PXfUI q4FCXednxk$@40v>7P&^|_y5cOFRp|C2LJ%zM)?my#T0h{VgLYeQb76u diff --git a/build-tools-internal/src/integTest/resources/org/elasticsearch/gradle/internal/fake_azuljdk_osx_aarch64.tar.gz b/build-tools-internal/src/integTest/resources/org/elasticsearch/gradle/internal/fake_azuljdk_osx_aarch64.tar.gz deleted file mode 100644 index b3d1461c281f85390fb94640e2e67a859a61179c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1139 zcmV-(1dRJ1iwFRk*b-m>1MS^SZ{kK62k^&is;1pbPF0V-^oV!H^I|wuVt3Ojm#S5> zhu*Rdc-3SBNW4^0PMrF=`q66R$uQyf^#9cI743>K7AfT~tIjJ6WnK-ROU9&9lJUq-7ZpnK z)y|J-VLqM3lXO=m$tc;@E^YSV!GE^BWZ&OsD?GO7 zofU2J^}Bb!n=kJl*Mj3@(f@yo?=O;gkW5}#z7Lf3e7~x1W38;P7n5|J_Favi`s9`K#l9$TY@(N4z)l0Vm3a^Ha(z z{k^&Asae*v9=DY*={DNLNl`$zG^n~C>GF~uXij(O@^t-=gK7WndOW`KES?qs005LQ z1MBI_&$}A{aD=k=2jA45sf)aN=KhwcCr{QnGu1b>XX+xao@v)I^~BUuQ_oEGP3@Vw z$g6qN^32JHXCB!zXDFWefYS3#?O8o#fW~-{m$PjA|A`9E{{f)Jyp!|G^EdSAgkViJ z*81u4-n9AWam9jP1X}qAhTqeF?R-;vrY`b|Uj_gGT(Y?Smo;stccl&NvS8NvuaGOQ zkpFUF$K(HYJenn=*|gFN!Rq*jI?I0u9^&}Bu;cN!$^zQw|AgcM*Z-YB{;$z??Eh9- z!1DZ`Ug`ho@XwI{b3w38`9H=xyel{ofVH>l_-~U1w9o$u9z_`c9XU+?FQF05XqqMW zs_w^f<8NuaT=U8LNd5r;02~DJe*jPf`9FaALjDf`kpBY!Xo%ho+Q#;B&)48BA4Jld4Wv%7EklO+P z062Qce*r)dD1>HHr6>a8^YmEHdS$=3@)_6q>uOSG5#S4jxSCjY}(HvgAq znE$~Mia zWSIZSiM9M!M+UkZsVMA<4)R~Mx4-efI0I&t|H{XIDKP(&D^>GfRN?>sEw^X30RR91 z#|`-}04Rd|7eIX>{{;ZZe*pkA#NMv|-Nt{#1&>jB{eLb0r8L9!KLCJ(`WITB9T@<` F004GAdRG7d diff --git a/build-tools-internal/src/main/groovy/elasticsearch.runtime-jdk-provision.gradle b/build-tools-internal/src/main/groovy/elasticsearch.runtime-jdk-provision.gradle index 8804a258f0d62..ce577767d82b6 100644 --- a/build-tools-internal/src/main/groovy/elasticsearch.runtime-jdk-provision.gradle +++ b/build-tools-internal/src/main/groovy/elasticsearch.runtime-jdk-provision.gradle @@ -18,7 +18,7 @@ import org.elasticsearch.gradle.internal.info.BuildParams jdks { provisioned_runtime { vendor = VersionProperties.bundledJdkVendor - version = VersionProperties.getBundledJdk(OS.current().name().toLowerCase()) + version = VersionProperties.bundledJdkVersion platform = OS.current().name().toLowerCase() architecture = Architecture.current().name().toLowerCase() } diff --git a/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/Jdk.java b/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/Jdk.java index 0770c7b329d88..ebf4df18b12ee 100644 --- a/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/Jdk.java +++ b/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/Jdk.java @@ -23,7 +23,7 @@ public class Jdk implements Buildable, Iterable { private static final List ALLOWED_ARCHITECTURES = List.of("aarch64", "x64"); - private static final List ALLOWED_VENDORS = List.of("adoptium", "openjdk", "azul"); + private static final List ALLOWED_VENDORS = List.of("adoptium", "openjdk"); private static final List ALLOWED_PLATFORMS = List.of("darwin", "linux", "windows", "mac"); private static final Pattern VERSION_PATTERN = Pattern.compile("(\\d+)(\\.\\d+\\.\\d+)?\\+(\\d+(?:\\.\\d+)?)(@([a-f0-9]{32}))?"); private static final Pattern LEGACY_VERSION_PATTERN = Pattern.compile("(\\d)(u\\d+)\\+(b\\d+?)(@([a-f0-9]{32}))?"); diff --git a/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/JdkDownloadPlugin.java b/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/JdkDownloadPlugin.java index 011fc030be920..45ede27be9ac4 100644 --- a/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/JdkDownloadPlugin.java +++ b/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/JdkDownloadPlugin.java @@ -28,7 +28,6 @@ public class JdkDownloadPlugin implements Plugin { public static final String VENDOR_ADOPTIUM = "adoptium"; public static final String VENDOR_OPENJDK = "openjdk"; - public static final String VENDOR_AZUL = "azul"; private static final String REPO_NAME_PREFIX = "jdk_repo_"; private static final String EXTENSION_NAME = "jdks"; @@ -128,31 +127,6 @@ private void setupRepository(Project project, Jdk jdk) { + jdk.getBuild() + "/GPL/openjdk-[revision]_[module]-[classifier]_bin.[ext]"; } - } else if (jdk.getVendor().equals(VENDOR_AZUL)) { - repoUrl = "https://cdn.azul.com"; - // The following is an absolute hack until Adoptium provides Apple aarch64 builds - String zuluPathSuffix = jdk.getPlatform().equals("linux") ? "-embedded" : ""; - switch (jdk.getMajor()) { - case "17": // More hack until adoptium builds are out - case "16": - artifactPattern = "zulu" - + zuluPathSuffix - + "/bin/zulu16.32.15-ca-jdk16.0.2-" - + azulPlatform(jdk) - + "_[classifier].[ext]"; - break; - case "11": - artifactPattern = "zulu" - + zuluPathSuffix - + "/bin/zulu" - + jdk.getMajor() - + ".45.27-ca-jdk11.0.10-" - + azulPlatform(jdk) - + "_[classifier].[ext]"; - break; - default: - throw new GradleException("Unknown Azul JDK major version [" + jdk.getMajor() + "]"); - } } else { throw new GradleException("Unknown JDK vendor [" + jdk.getVendor() + "]"); } @@ -169,18 +143,6 @@ private void setupRepository(Project project, Jdk jdk) { } } - @NotNull - private String azulPlatform(Jdk jdk) { - switch (jdk.getPlatform()) { - case "linux": - return "linux"; - case "darwin": - return "macosx"; - default: - throw new GradleException("Unsupported Azul JDK platform requested version [" + jdk.getPlatform() + "]"); - } - } - @SuppressWarnings("unchecked") public static NamedDomainObjectContainer getContainer(Project project) { return (NamedDomainObjectContainer) project.getExtensions().getByName(EXTENSION_NAME); diff --git a/build-tools-internal/src/test/java/org/elasticsearch/gradle/internal/JdkDownloadPluginTests.java b/build-tools-internal/src/test/java/org/elasticsearch/gradle/internal/JdkDownloadPluginTests.java index 31c1058a0432c..c36ade03f7790 100644 --- a/build-tools-internal/src/test/java/org/elasticsearch/gradle/internal/JdkDownloadPluginTests.java +++ b/build-tools-internal/src/test/java/org/elasticsearch/gradle/internal/JdkDownloadPluginTests.java @@ -36,7 +36,7 @@ public void testUnknownVendor() { "11.0.2+33", "linux", "x64", - "unknown vendor [unknown] for jdk [testjdk], must be one of [adoptium, openjdk, azul]" + "unknown vendor [unknown] for jdk [testjdk], must be one of [adoptium, openjdk]" ); } diff --git a/build-tools/src/main/java/org/elasticsearch/gradle/VersionProperties.java b/build-tools/src/main/java/org/elasticsearch/gradle/VersionProperties.java index 48b1c10af79ed..895d0c60198e0 100644 --- a/build-tools/src/main/java/org/elasticsearch/gradle/VersionProperties.java +++ b/build-tools/src/main/java/org/elasticsearch/gradle/VersionProperties.java @@ -30,18 +30,8 @@ public static String getLucene() { return lucene; } - public static String getBundledJdk(final String platform) { - switch (platform) { - case "darwin": // fall trough - case "mac": - return bundledJdkDarwin; - case "linux": - return bundledJdkLinux; - case "windows": - return bundledJdkWindows; - default: - throw new IllegalArgumentException("unknown platform [" + platform + "]"); - } + public static String getBundledJdkVersion() { + return bundledJdkVersion; } public static String getBundledJdkVendor() { @@ -54,9 +44,7 @@ public static Map getVersions() { private static final String elasticsearch; private static final String lucene; - private static final String bundledJdkDarwin; - private static final String bundledJdkLinux; - private static final String bundledJdkWindows; + private static final String bundledJdkVersion; private static final String bundledJdkVendor; private static final Map versions = new HashMap(); @@ -65,10 +53,7 @@ public static Map getVersions() { elasticsearch = props.getProperty("elasticsearch"); lucene = props.getProperty("lucene"); bundledJdkVendor = props.getProperty("bundled_jdk_vendor"); - final String bundledJdk = props.getProperty("bundled_jdk"); - bundledJdkDarwin = props.getProperty("bundled_jdk_darwin", bundledJdk); - bundledJdkLinux = props.getProperty("bundled_jdk_linux", bundledJdk); - bundledJdkWindows = props.getProperty("bundled_jdk_windows", bundledJdk); + bundledJdkVersion = props.getProperty("bundled_jdk"); for (String property : props.stringPropertyNames()) { versions.put(property, props.getProperty(property)); diff --git a/distribution/build.gradle b/distribution/build.gradle index 6bc3bd8d889b3..66766ec1352ef 100644 --- a/distribution/build.gradle +++ b/distribution/build.gradle @@ -251,8 +251,8 @@ configure(subprojects.findAll { ['archives', 'packages'].contains(it.name) }) { (platform == 'linux' || platform == 'darwin' ? ['x64', 'aarch64'] : ['x64']).each { architecture -> "bundled_${platform}_${architecture}" { it.platform = platform - it.version = VersionProperties.getBundledJdk(platform) - it.vendor = (platform == 'darwin' && architecture == 'aarch64') ? 'azul' : VersionProperties.bundledJdkVendor + it.version = VersionProperties.bundledJdkVersion + it.vendor = VersionProperties.bundledJdkVendor it.architecture = architecture } } From f5dde6fd2d3dc0e82012d4580b88a4babde8f1e1 Mon Sep 17 00:00:00 2001 From: Mark Vieira Date: Mon, 27 Sep 2021 13:00:19 -0700 Subject: [PATCH 019/250] Fix import into Eclipse getting hung on example project included build (#78346) --- settings.gradle | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/settings.gradle b/settings.gradle index 7c7654c901629..00d7dd0c54d97 100644 --- a/settings.gradle +++ b/settings.gradle @@ -9,11 +9,20 @@ plugins { id "com.gradle.enterprise" version "3.6.4" } +def isEclipse = providers.systemProperty("eclipse.launcher").forUseAtConfigurationTime().isPresent() || // Detects gradle launched from Eclipse's IDE + providers.systemProperty("eclipse.application").forUseAtConfigurationTime().isPresent() || // Detects gradle launched from the Eclipse compiler server + gradle.startParameter.taskNames.contains('eclipse') || // Detects gradle launched from the command line to do eclipse stuff + gradle.startParameter.taskNames.contains('cleanEclipse') + includeBuild "build-conventions" includeBuild "build-tools" includeBuild "build-tools-internal" -includeBuild("plugins/examples") { - name = "example-plugins" + +// Eclipse will hang on import when examples are included in the composite build so omit them +if (isEclipse == false) { + includeBuild("plugins/examples") { + name = "example-plugins" + } } rootProject.name = "elasticsearch" From 61d2297debbe2e4d81418716809bedb21b14ee43 Mon Sep 17 00:00:00 2001 From: Mark Vieira Date: Mon, 27 Sep 2021 13:36:28 -0700 Subject: [PATCH 020/250] Mute GetSnapshotsIT --- .../java/org/elasticsearch/snapshots/GetSnapshotsIT.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/GetSnapshotsIT.java b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/GetSnapshotsIT.java index 797f4ebbfe909..ffe80d4f58bcd 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/GetSnapshotsIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/GetSnapshotsIT.java @@ -8,6 +8,7 @@ package org.elasticsearch.snapshots; +import org.apache.lucene.util.LuceneTestCase.AwaitsFix; import org.elasticsearch.action.ActionFuture; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.admin.cluster.snapshots.create.CreateSnapshotResponse; @@ -33,6 +34,7 @@ import static org.hamcrest.Matchers.in; import static org.hamcrest.Matchers.is; +@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/78348") public class GetSnapshotsIT extends AbstractSnapshotIntegTestCase { @Override From 90f565b53061987e79859fce57066673d3217a58 Mon Sep 17 00:00:00 2001 From: Mark Vieira Date: Mon, 27 Sep 2021 16:17:56 -0700 Subject: [PATCH 021/250] Mute PruneChangelogsTaskTests on Windows --- .../gradle/internal/release/PruneChangelogsTaskTests.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/build-tools-internal/src/test/java/org/elasticsearch/gradle/internal/release/PruneChangelogsTaskTests.java b/build-tools-internal/src/test/java/org/elasticsearch/gradle/internal/release/PruneChangelogsTaskTests.java index 51b9ce0fbf133..a7f9b2009d6cd 100644 --- a/build-tools-internal/src/test/java/org/elasticsearch/gradle/internal/release/PruneChangelogsTaskTests.java +++ b/build-tools-internal/src/test/java/org/elasticsearch/gradle/internal/release/PruneChangelogsTaskTests.java @@ -8,9 +8,11 @@ package org.elasticsearch.gradle.internal.release; +import org.elasticsearch.gradle.OS; import org.elasticsearch.gradle.internal.release.PruneChangelogsTask.DeleteHelper; import org.elasticsearch.gradle.internal.test.GradleUnitTestCase; import org.gradle.api.GradleException; +import org.junit.Assume; import org.junit.Before; import org.junit.Test; @@ -21,10 +23,13 @@ import java.util.stream.Collectors; import java.util.stream.Stream; +import static org.elasticsearch.gradle.OS.LINUX; +import static org.elasticsearch.gradle.OS.WINDOWS; import static org.elasticsearch.gradle.internal.release.PruneChangelogsTask.findAndDeleteFiles; import static org.elasticsearch.gradle.internal.release.PruneChangelogsTask.findPreviousVersion; import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.equalTo; +import static org.junit.Assume.assumeFalse; import static org.mockito.Matchers.any; import static org.mockito.Matchers.anyString; import static org.mockito.Mockito.mock; @@ -40,6 +45,8 @@ public class PruneChangelogsTaskTests extends GradleUnitTestCase { @Before public void setup() { + // TODO: Muted on windows until resolved: https://github.com/elastic/elasticsearch/issues/78318 + assumeFalse(OS.current() == WINDOWS); gitWrapper = mock(GitWrapper.class); deleteHelper = mock(DeleteHelper.class); } From 377bf23ae954ae7694873f775ecaeb6a2661bd00 Mon Sep 17 00:00:00 2001 From: Aleksandr Maus Date: Mon, 27 Sep 2021 16:49:46 -0700 Subject: [PATCH 022/250] Fleet: Add actions timeout mapping (#75628) * Fleet: Add actions timeout mapping * Bump up the fleet index version to 8, since added the new mapped field * Rollback the index version increment Co-authored-by: Elastic Machine --- x-pack/plugin/core/src/main/resources/fleet-actions.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/x-pack/plugin/core/src/main/resources/fleet-actions.json b/x-pack/plugin/core/src/main/resources/fleet-actions.json index 5fb5f6e13dfb4..e7d11a4b277e5 100644 --- a/x-pack/plugin/core/src/main/resources/fleet-actions.json +++ b/x-pack/plugin/core/src/main/resources/fleet-actions.json @@ -25,6 +25,9 @@ "input_type": { "type": "keyword" }, + "timeout": { + "type": "integer" + }, "@timestamp": { "type": "date" }, From 717d83df30b63381b59a3b0368161c70069b384a Mon Sep 17 00:00:00 2001 From: Yang Wang Date: Tue, 28 Sep 2021 09:53:22 +1000 Subject: [PATCH 023/250] Grant privileges required by package upgrade to kibana_system (#78049) Automated Fleet package upgrade requires additional privileges for the kibana_system user: * Manage ingest pipeline * Manage index lifecycle * Subset of manage privileges for Fleet data indices * Manage transform for indices used by the endpoint package --- .../authz/store/ReservedRolesStore.java | 26 +- .../authz/store/ReservedRolesStoreTests.java | 282 ++++++++++++++---- 2 files changed, 243 insertions(+), 65 deletions(-) diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/store/ReservedRolesStore.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/store/ReservedRolesStore.java index bd2de247fc245..8a8ca060ae5ac 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/store/ReservedRolesStore.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/store/ReservedRolesStore.java @@ -10,6 +10,9 @@ import org.elasticsearch.action.admin.cluster.remote.RemoteInfoAction; import org.elasticsearch.action.admin.cluster.repositories.get.GetRepositoriesAction; import org.elasticsearch.action.admin.indices.alias.IndicesAliasesAction; +import org.elasticsearch.action.admin.indices.mapping.put.PutMappingAction; +import org.elasticsearch.action.admin.indices.rollover.RolloverAction; +import org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsAction; import org.elasticsearch.common.collect.MapBuilder; import org.elasticsearch.xpack.core.ilm.action.GetLifecycleAction; import org.elasticsearch.xpack.core.ilm.action.PutLifecycleAction; @@ -360,8 +363,12 @@ public static RoleDescriptor kibanaSystemRoleDescriptor(String name) { return new RoleDescriptor(name, new String[] { "monitor", "manage_index_templates", MonitoringBulkAction.NAME, "manage_saml", "manage_token", "manage_oidc", + // For Fleet package upgrade + "manage_pipeline", "manage_ilm", + // For the endpoint package that ships a transform + "manage_transform", InvalidateApiKeyAction.NAME, "grant_api_key", - GetBuiltinPrivilegesAction.NAME, "delegate_pki", GetLifecycleAction.NAME, PutLifecycleAction.NAME, + GetBuiltinPrivilegesAction.NAME, "delegate_pki", // To facilitate ML UI functionality being controlled using Kibana security privileges "manage_ml", // The symbolic constant for this one is in SecurityActionMapper, so not accessible from X-Pack core @@ -432,7 +439,22 @@ public static RoleDescriptor kibanaSystemRoleDescriptor(String name) { // Endpoint metrics. Kibana requires read access to send telemetry RoleDescriptor.IndicesPrivileges.builder() .indices("metrics-endpoint.metrics-*") - .privileges("read").build() + .privileges("read").build(), + // Fleet package upgrade + RoleDescriptor.IndicesPrivileges.builder() + .indices("logs-*", "synthetics-*", "traces-*", + "/metrics-.*&~(metrics-endpoint\\.metadata.*)/") + .privileges(UpdateSettingsAction.NAME, PutMappingAction.NAME, RolloverAction.NAME) + .build(), + // For src/dest indices of the Endpoint package that ships a transform + RoleDescriptor.IndicesPrivileges.builder() + .indices("metrics-endpoint.metadata*") + .privileges("read", "view_index_metadata") + .build(), + RoleDescriptor.IndicesPrivileges.builder() + .indices("metrics-endpoint.metadata_current_default", "metrics-endpoint.metadata_united_default") + .privileges("create_index", "delete_index", "read", "index") + .build(), }, null, new ConfigurableClusterPrivilege[] { new ManageApplicationPrivileges(Collections.singleton("kibana-*")) }, diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/store/ReservedRolesStoreTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/store/ReservedRolesStoreTests.java index 5651b254ead84..7e8af5dd23618 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/store/ReservedRolesStoreTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/store/ReservedRolesStoreTests.java @@ -13,6 +13,7 @@ import org.elasticsearch.action.admin.cluster.repositories.put.PutRepositoryAction; import org.elasticsearch.action.admin.cluster.reroute.ClusterRerouteAction; import org.elasticsearch.action.admin.cluster.settings.ClusterUpdateSettingsAction; +import org.elasticsearch.action.admin.cluster.shards.ClusterSearchShardsAction; import org.elasticsearch.action.admin.cluster.snapshots.create.CreateSnapshotAction; import org.elasticsearch.action.admin.cluster.snapshots.get.GetSnapshotsAction; import org.elasticsearch.action.admin.cluster.snapshots.status.SnapshotsStatusAction; @@ -20,11 +21,16 @@ import org.elasticsearch.action.admin.cluster.stats.ClusterStatsAction; import org.elasticsearch.action.admin.indices.alias.IndicesAliasesAction; import org.elasticsearch.action.admin.indices.alias.get.GetAliasesAction; +import org.elasticsearch.action.admin.indices.create.AutoCreateAction; import org.elasticsearch.action.admin.indices.create.CreateIndexAction; import org.elasticsearch.action.admin.indices.delete.DeleteIndexAction; import org.elasticsearch.action.admin.indices.get.GetIndexAction; +import org.elasticsearch.action.admin.indices.mapping.get.GetFieldMappingsAction; import org.elasticsearch.action.admin.indices.mapping.get.GetMappingsAction; +import org.elasticsearch.action.admin.indices.mapping.put.PutMappingAction; import org.elasticsearch.action.admin.indices.recovery.RecoveryAction; +import org.elasticsearch.action.admin.indices.resolve.ResolveIndexAction; +import org.elasticsearch.action.admin.indices.rollover.RolloverAction; import org.elasticsearch.action.admin.indices.segments.IndicesSegmentsAction; import org.elasticsearch.action.admin.indices.settings.get.GetSettingsAction; import org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsAction; @@ -33,13 +39,16 @@ import org.elasticsearch.action.admin.indices.template.delete.DeleteIndexTemplateAction; import org.elasticsearch.action.admin.indices.template.get.GetIndexTemplatesAction; import org.elasticsearch.action.admin.indices.template.put.PutIndexTemplateAction; +import org.elasticsearch.action.admin.indices.validate.query.ValidateQueryAction; import org.elasticsearch.action.bulk.BulkAction; import org.elasticsearch.action.delete.DeleteAction; +import org.elasticsearch.action.fieldcaps.FieldCapabilitiesAction; import org.elasticsearch.action.get.GetAction; import org.elasticsearch.action.index.IndexAction; import org.elasticsearch.action.ingest.DeletePipelineAction; import org.elasticsearch.action.ingest.GetPipelineAction; import org.elasticsearch.action.ingest.PutPipelineAction; +import org.elasticsearch.action.ingest.SimulatePipelineAction; import org.elasticsearch.action.main.MainAction; import org.elasticsearch.action.search.MultiSearchAction; import org.elasticsearch.action.search.SearchAction; @@ -53,9 +62,15 @@ import org.elasticsearch.test.ESTestCase; import org.elasticsearch.transport.TransportRequest; import org.elasticsearch.xpack.core.XPackPlugin; +import org.elasticsearch.xpack.core.action.CreateDataStreamAction; +import org.elasticsearch.xpack.core.action.DeleteDataStreamAction; +import org.elasticsearch.xpack.core.action.GetDataStreamAction; import org.elasticsearch.xpack.core.action.XPackInfoAction; import org.elasticsearch.xpack.core.ilm.action.DeleteLifecycleAction; +import org.elasticsearch.xpack.core.ilm.action.ExplainLifecycleAction; import org.elasticsearch.xpack.core.ilm.action.GetLifecycleAction; +import org.elasticsearch.xpack.core.ilm.action.GetStatusAction; +import org.elasticsearch.xpack.core.ilm.action.MoveToStepAction; import org.elasticsearch.xpack.core.ilm.action.PutLifecycleAction; import org.elasticsearch.xpack.core.ilm.action.RemoveIndexLifecyclePolicyAction; import org.elasticsearch.xpack.core.ilm.action.StartILMAction; @@ -76,6 +91,7 @@ import org.elasticsearch.xpack.core.ml.action.EvaluateDataFrameAction; import org.elasticsearch.xpack.core.ml.action.ExplainDataFrameAnalyticsAction; import org.elasticsearch.xpack.core.ml.action.FinalizeJobExecutionAction; +import org.elasticsearch.xpack.core.rollup.action.GetRollupIndexCapsAction; import org.elasticsearch.xpack.core.textstructure.action.FindStructureAction; import org.elasticsearch.xpack.core.ml.action.FlushJobAction; import org.elasticsearch.xpack.core.ml.action.ForecastJobAction; @@ -167,6 +183,16 @@ import org.elasticsearch.xpack.core.transform.action.PutTransformAction; import org.elasticsearch.xpack.core.transform.action.StartTransformAction; import org.elasticsearch.xpack.core.transform.action.StopTransformAction; +import org.elasticsearch.xpack.core.transform.action.UpdateTransformAction; +import org.elasticsearch.xpack.core.transform.action.ValidateTransformAction; +import org.elasticsearch.xpack.core.transform.action.compat.DeleteTransformActionDeprecated; +import org.elasticsearch.xpack.core.transform.action.compat.GetTransformActionDeprecated; +import org.elasticsearch.xpack.core.transform.action.compat.GetTransformStatsActionDeprecated; +import org.elasticsearch.xpack.core.transform.action.compat.PreviewTransformActionDeprecated; +import org.elasticsearch.xpack.core.transform.action.compat.PutTransformActionDeprecated; +import org.elasticsearch.xpack.core.transform.action.compat.StartTransformActionDeprecated; +import org.elasticsearch.xpack.core.transform.action.compat.StopTransformActionDeprecated; +import org.elasticsearch.xpack.core.transform.action.compat.UpdateTransformActionDeprecated; import org.elasticsearch.xpack.core.transform.transforms.persistence.TransformInternalIndexConstants; import org.elasticsearch.xpack.core.watcher.execution.TriggeredWatchStoreField; import org.elasticsearch.xpack.core.watcher.history.HistoryStoreField; @@ -340,13 +366,6 @@ public void testKibanaSystemRole() { assertThat(kibanaRole.cluster().check(ClusterUpdateSettingsAction.NAME, request, authentication), is(false)); assertThat(kibanaRole.cluster().check(MonitoringBulkAction.NAME, request, authentication), is(true)); - // ILM - assertThat(kibanaRole.cluster().check(GetLifecycleAction.NAME, request, authentication), is(true)); - assertThat(kibanaRole.cluster().check(PutLifecycleAction.NAME, request, authentication), is(true)); - assertThat(kibanaRole.cluster().check(DeleteLifecycleAction.NAME, request, authentication), is(false)); - assertThat(kibanaRole.cluster().check(StartILMAction.NAME, request, authentication), is(false)); - assertThat(kibanaRole.cluster().check(StopILMAction.NAME, request, authentication), is(false)); - // SAML and token assertThat(kibanaRole.cluster().check(SamlPrepareAuthenticationAction.NAME, request, authentication), is(true)); assertThat(kibanaRole.cluster().check(SamlAuthenticateAction.NAME, request, authentication), is(true)); @@ -405,21 +424,7 @@ public void testKibanaSystemRole() { ReservedRolesStore.ALERTS_LEGACY_INDEX + randomAlphaOfLength(randomIntBetween(0, 13)), ReservedRolesStore.ALERTS_BACKING_INDEX + randomAlphaOfLength(randomIntBetween(0, 13)), ReservedRolesStore.ALERTS_INDEX_ALIAS + randomAlphaOfLength(randomIntBetween(0, 13)) - ).forEach((index) -> { - logger.info("index name [{}]", index); - assertThat(kibanaRole.indices().allowedIndicesMatcher("indices:foo").test(mockIndexAbstraction(index)), is(true)); - assertThat(kibanaRole.indices().allowedIndicesMatcher("indices:bar").test(mockIndexAbstraction(index)), is(true)); - assertThat(kibanaRole.indices().allowedIndicesMatcher(DeleteIndexAction.NAME).test(mockIndexAbstraction(index)), is(true)); - assertThat(kibanaRole.indices().allowedIndicesMatcher(CreateIndexAction.NAME).test(mockIndexAbstraction(index)), is(true)); - assertThat(kibanaRole.indices().allowedIndicesMatcher(IndexAction.NAME).test(mockIndexAbstraction(index)), is(true)); - assertThat(kibanaRole.indices().allowedIndicesMatcher(DeleteAction.NAME).test(mockIndexAbstraction(index)), is(true)); - assertThat(kibanaRole.indices().allowedIndicesMatcher(UpdateSettingsAction.NAME).test(mockIndexAbstraction(index)), is(true)); - assertThat(kibanaRole.indices().allowedIndicesMatcher(SearchAction.NAME).test(mockIndexAbstraction(index)), is(true)); - assertThat(kibanaRole.indices().allowedIndicesMatcher(MultiSearchAction.NAME).test(mockIndexAbstraction(index)), is(true)); - assertThat(kibanaRole.indices().allowedIndicesMatcher(GetAction.NAME).test(mockIndexAbstraction(index)), is(true)); - // inherits from 'all' - assertThat(kibanaRole.indices().allowedIndicesMatcher(READ_CROSS_CLUSTER_NAME).test(mockIndexAbstraction(index)), is(true)); - }); + ).forEach(index -> assertAllIndicesAccessAllowed(kibanaRole, index)); // read-only index access, including cross cluster Arrays.asList(".monitoring-" + randomAlphaOfLength(randomIntBetween(0, 13))).forEach((index) -> { @@ -515,31 +520,18 @@ public void testKibanaSystemRole() { ".fleet-policies", ".fleet-actions-results", ".fleet-servers" - ).forEach((index) -> { - assertThat(kibanaRole.indices().allowedIndicesMatcher("indices:foo").test(mockIndexAbstraction(index)), is(true)); - assertThat(kibanaRole.indices().allowedIndicesMatcher("indices:bar").test(mockIndexAbstraction(index)), is(true)); - assertThat(kibanaRole.indices().allowedIndicesMatcher(DeleteIndexAction.NAME).test(mockIndexAbstraction(index)), is(true)); - assertThat(kibanaRole.indices().allowedIndicesMatcher(GetIndexAction.NAME).test(mockIndexAbstraction(index)), is(true)); - assertThat(kibanaRole.indices().allowedIndicesMatcher(CreateIndexAction.NAME).test(mockIndexAbstraction(index)), is(true)); - assertThat(kibanaRole.indices().allowedIndicesMatcher(IndexAction.NAME).test(mockIndexAbstraction(index)), is(true)); - assertThat(kibanaRole.indices().allowedIndicesMatcher(DeleteAction.NAME).test(mockIndexAbstraction(index)), is(true)); - assertThat(kibanaRole.indices().allowedIndicesMatcher(UpdateSettingsAction.NAME).test(mockIndexAbstraction(index)), is(true)); - assertThat(kibanaRole.indices().allowedIndicesMatcher(SearchAction.NAME).test(mockIndexAbstraction(index)), is(true)); - assertThat(kibanaRole.indices().allowedIndicesMatcher(MultiSearchAction.NAME).test(mockIndexAbstraction(index)), is(true)); - assertThat(kibanaRole.indices().allowedIndicesMatcher(GetAction.NAME).test(mockIndexAbstraction(index)), is(true)); - assertThat(kibanaRole.indices().allowedIndicesMatcher(READ_CROSS_CLUSTER_NAME).test(mockIndexAbstraction(index)), is(true)); - }); + ).forEach(index -> assertAllIndicesAccessAllowed(kibanaRole, index)); // Data telemetry reads mappings, metadata and stats of indices - Arrays.asList(randomAlphaOfLengthBetween(8, 24), "packetbeat-*", "logs-*", + Arrays.asList(randomAlphaOfLengthBetween(8, 24), "packetbeat-*", // check system indices other than .security* and .async-search* ".watches", ".triggered-watches", ".tasks", ".enrich" ).forEach((index) -> { logger.info("index name [{}]", index); - assertThat(kibanaRole.indices().allowedIndicesMatcher(GetIndexAction.NAME).test(mockIndexAbstraction(index)), is(true)); - assertThat(kibanaRole.indices().allowedIndicesMatcher(GetMappingsAction.NAME).test(mockIndexAbstraction(index)), is(true)); assertThat(kibanaRole.indices().allowedIndicesMatcher(IndicesStatsAction.NAME).test(mockIndexAbstraction(index)), is(true)); + assertViewIndexMetadata(kibanaRole, index); + assertThat(kibanaRole.indices().allowedIndicesMatcher("indices:foo").test(mockIndexAbstraction(index)), is(false)); assertThat(kibanaRole.indices().allowedIndicesMatcher("indices:bar").test(mockIndexAbstraction(index)), is(false)); assertThat(kibanaRole.indices().allowedIndicesMatcher(DeleteIndexAction.NAME).test(mockIndexAbstraction(index)), is(false)); @@ -566,34 +558,40 @@ public void testKibanaSystemRole() { // read-only datastream for Endpoint policy responses Arrays.asList("metrics-endpoint.policy-" + randomAlphaOfLength(randomIntBetween(0, 13))).forEach((index) -> { - assertThat(kibanaRole.indices().allowedIndicesMatcher("indices:foo").test(mockIndexAbstraction(index)), is(false)); - assertThat(kibanaRole.indices().allowedIndicesMatcher("indices:bar").test(mockIndexAbstraction(index)), is(false)); - assertThat(kibanaRole.indices().allowedIndicesMatcher(DeleteIndexAction.NAME).test(mockIndexAbstraction(index)), is(false)); - assertThat(kibanaRole.indices().allowedIndicesMatcher(GetIndexAction.NAME).test(mockIndexAbstraction(index)), is(true)); - assertThat(kibanaRole.indices().allowedIndicesMatcher(CreateIndexAction.NAME).test(mockIndexAbstraction(index)), is(false)); - assertThat(kibanaRole.indices().allowedIndicesMatcher(IndexAction.NAME).test(mockIndexAbstraction(index)), is(false)); - assertThat(kibanaRole.indices().allowedIndicesMatcher(DeleteAction.NAME).test(mockIndexAbstraction(index)), is(false)); - assertThat(kibanaRole.indices().allowedIndicesMatcher(UpdateSettingsAction.NAME).test(mockIndexAbstraction(index)), is(false)); - assertThat(kibanaRole.indices().allowedIndicesMatcher(SearchAction.NAME).test(mockIndexAbstraction(index)), is(true)); - assertThat(kibanaRole.indices().allowedIndicesMatcher(MultiSearchAction.NAME).test(mockIndexAbstraction(index)), is(true)); - assertThat(kibanaRole.indices().allowedIndicesMatcher(GetAction.NAME).test(mockIndexAbstraction(index)), is(true)); - assertThat(kibanaRole.indices().allowedIndicesMatcher(READ_CROSS_CLUSTER_NAME).test(mockIndexAbstraction(index)), is(false)); + final IndexAbstraction indexAbstraction = mockIndexAbstraction(index); + assertThat(kibanaRole.indices().allowedIndicesMatcher("indices:foo").test(indexAbstraction), is(false)); + assertThat(kibanaRole.indices().allowedIndicesMatcher("indices:bar").test(indexAbstraction), is(false)); + assertThat(kibanaRole.indices().allowedIndicesMatcher(DeleteIndexAction.NAME).test(indexAbstraction), is(false)); + assertThat(kibanaRole.indices().allowedIndicesMatcher(GetIndexAction.NAME).test(indexAbstraction), is(true)); + assertThat(kibanaRole.indices().allowedIndicesMatcher(CreateIndexAction.NAME).test(indexAbstraction), is(false)); + assertThat(kibanaRole.indices().allowedIndicesMatcher(IndexAction.NAME).test(indexAbstraction), is(false)); + assertThat(kibanaRole.indices().allowedIndicesMatcher(DeleteAction.NAME).test(indexAbstraction), is(false)); + assertThat(kibanaRole.indices().allowedIndicesMatcher(SearchAction.NAME).test(indexAbstraction), is(true)); + assertThat(kibanaRole.indices().allowedIndicesMatcher(MultiSearchAction.NAME).test(indexAbstraction), is(true)); + assertThat(kibanaRole.indices().allowedIndicesMatcher(GetAction.NAME).test(indexAbstraction), is(true)); + assertThat(kibanaRole.indices().allowedIndicesMatcher(READ_CROSS_CLUSTER_NAME).test(indexAbstraction), is(false)); + assertThat(kibanaRole.indices().allowedIndicesMatcher(UpdateSettingsAction.NAME).test(indexAbstraction), is(true)); + assertThat(kibanaRole.indices().allowedIndicesMatcher(PutMappingAction.NAME).test(indexAbstraction), is(true)); + assertThat(kibanaRole.indices().allowedIndicesMatcher(RolloverAction.NAME).test(indexAbstraction), is(true)); }); // read-only datastream for Endpoint metrics Arrays.asList("metrics-endpoint.metrics-" + randomAlphaOfLength(randomIntBetween(0, 13))).forEach((index) -> { - assertThat(kibanaRole.indices().allowedIndicesMatcher("indices:foo").test(mockIndexAbstraction(index)), is(false)); - assertThat(kibanaRole.indices().allowedIndicesMatcher("indices:bar").test(mockIndexAbstraction(index)), is(false)); - assertThat(kibanaRole.indices().allowedIndicesMatcher(DeleteIndexAction.NAME).test(mockIndexAbstraction(index)), is(false)); - assertThat(kibanaRole.indices().allowedIndicesMatcher(GetIndexAction.NAME).test(mockIndexAbstraction(index)), is(true)); - assertThat(kibanaRole.indices().allowedIndicesMatcher(CreateIndexAction.NAME).test(mockIndexAbstraction(index)), is(false)); - assertThat(kibanaRole.indices().allowedIndicesMatcher(IndexAction.NAME).test(mockIndexAbstraction(index)), is(false)); - assertThat(kibanaRole.indices().allowedIndicesMatcher(DeleteAction.NAME).test(mockIndexAbstraction(index)), is(false)); - assertThat(kibanaRole.indices().allowedIndicesMatcher(UpdateSettingsAction.NAME).test(mockIndexAbstraction(index)), is(false)); - assertThat(kibanaRole.indices().allowedIndicesMatcher(SearchAction.NAME).test(mockIndexAbstraction(index)), is(true)); - assertThat(kibanaRole.indices().allowedIndicesMatcher(MultiSearchAction.NAME).test(mockIndexAbstraction(index)), is(true)); - assertThat(kibanaRole.indices().allowedIndicesMatcher(GetAction.NAME).test(mockIndexAbstraction(index)), is(true)); - assertThat(kibanaRole.indices().allowedIndicesMatcher(READ_CROSS_CLUSTER_NAME).test(mockIndexAbstraction(index)), is(false)); + final IndexAbstraction indexAbstraction = mockIndexAbstraction(index); + assertThat(kibanaRole.indices().allowedIndicesMatcher("indices:foo").test(indexAbstraction), is(false)); + assertThat(kibanaRole.indices().allowedIndicesMatcher("indices:bar").test(indexAbstraction), is(false)); + assertThat(kibanaRole.indices().allowedIndicesMatcher(DeleteIndexAction.NAME).test(indexAbstraction), is(false)); + assertThat(kibanaRole.indices().allowedIndicesMatcher(GetIndexAction.NAME).test(indexAbstraction), is(true)); + assertThat(kibanaRole.indices().allowedIndicesMatcher(CreateIndexAction.NAME).test(indexAbstraction), is(false)); + assertThat(kibanaRole.indices().allowedIndicesMatcher(IndexAction.NAME).test(indexAbstraction), is(false)); + assertThat(kibanaRole.indices().allowedIndicesMatcher(DeleteAction.NAME).test(indexAbstraction), is(false)); + assertThat(kibanaRole.indices().allowedIndicesMatcher(SearchAction.NAME).test(indexAbstraction), is(true)); + assertThat(kibanaRole.indices().allowedIndicesMatcher(MultiSearchAction.NAME).test(indexAbstraction), is(true)); + assertThat(kibanaRole.indices().allowedIndicesMatcher(GetAction.NAME).test(indexAbstraction), is(true)); + assertThat(kibanaRole.indices().allowedIndicesMatcher(READ_CROSS_CLUSTER_NAME).test(indexAbstraction), is(false)); + assertThat(kibanaRole.indices().allowedIndicesMatcher(UpdateSettingsAction.NAME).test(indexAbstraction), is(true)); + assertThat(kibanaRole.indices().allowedIndicesMatcher(PutMappingAction.NAME).test(indexAbstraction), is(true)); + assertThat(kibanaRole.indices().allowedIndicesMatcher(RolloverAction.NAME).test(indexAbstraction), is(true)); }); // Beats management index @@ -612,6 +610,130 @@ public void testKibanaSystemRole() { assertNoAccessAllowed(kibanaRole, RestrictedIndicesNames.RESTRICTED_NAMES); assertNoAccessAllowed(kibanaRole, XPackPlugin.ASYNC_RESULTS_INDEX + randomAlphaOfLengthBetween(0, 2)); + + // Fleet package upgrade + // 1. Pipeline + Arrays.asList( + GetPipelineAction.NAME, + PutPipelineAction.NAME, + DeletePipelineAction.NAME, + SimulatePipelineAction.NAME, + "cluster:admin/ingest/pipeline/" + randomAlphaOfLengthBetween(3, 8) + ).forEach(action -> assertThat(kibanaRole.cluster().check(action, request, authentication), is(true))); + + // 2. ILM + Arrays.asList( + StartILMAction.NAME, + DeleteLifecycleAction.NAME, + GetLifecycleAction.NAME, + GetStatusAction.NAME, + MoveToStepAction.NAME, + PutLifecycleAction.NAME, + StopILMAction.NAME, + "cluster:admin/ilm/" + randomAlphaOfLengthBetween(3, 8) + ).forEach(action -> assertThat(kibanaRole.cluster().check(action, request, authentication), is(true))); + + // 3. Fleet data indices + Arrays.asList( + "logs-" + randomAlphaOfLengthBetween(3, 8), + "metrics-" + randomAlphaOfLengthBetween(3, 8), + "synthetics-" + randomAlphaOfLengthBetween(3, 8), + "traces-" + randomAlphaOfLengthBetween(3, 8) + ).forEach(indexName -> { + logger.info("index name [{}]", indexName); + final IndexAbstraction indexAbstraction = mockIndexAbstraction(indexName); + assertThat(kibanaRole.indices().allowedIndicesMatcher(UpdateSettingsAction.NAME).test(indexAbstraction), is(true)); + assertThat(kibanaRole.indices().allowedIndicesMatcher(PutMappingAction.NAME).test(indexAbstraction), is(true)); + assertThat(kibanaRole.indices().allowedIndicesMatcher(RolloverAction.NAME).test(indexAbstraction), is(true)); + + // Implied by the overall view_index_metadata and monitor privilege + assertViewIndexMetadata(kibanaRole, indexName); + assertThat( + kibanaRole.indices().allowedIndicesMatcher("indices:monitor/" + randomAlphaOfLengthBetween(3, 8)).test(indexAbstraction), + is(true)); + + assertThat(kibanaRole.indices().allowedIndicesMatcher(CreateIndexAction.NAME).test(indexAbstraction), is(false)); + assertThat(kibanaRole.indices().allowedIndicesMatcher(AutoCreateAction.NAME).test(indexAbstraction), is(false)); + assertThat(kibanaRole.indices().allowedIndicesMatcher(CreateDataStreamAction.NAME).test(indexAbstraction), is(false)); + assertThat(kibanaRole.indices().allowedIndicesMatcher(DeleteIndexAction.NAME).test(indexAbstraction), is(false)); + assertThat(kibanaRole.indices().allowedIndicesMatcher(IndexAction.NAME).test(indexAbstraction), is(false)); + assertThat(kibanaRole.indices().allowedIndicesMatcher(DeleteAction.NAME).test(indexAbstraction), is(false)); + assertThat(kibanaRole.indices().allowedIndicesMatcher(GetAction.NAME).test(indexAbstraction), is(false)); + assertThat(kibanaRole.indices().allowedIndicesMatcher(SearchAction.NAME).test(indexAbstraction), is(false)); + assertThat(kibanaRole.indices().allowedIndicesMatcher(MultiSearchAction.NAME).test(indexAbstraction), is(false)); + }); + + // 4. Transform for endpoint package + Arrays.asList( + PreviewTransformAction.NAME, + DeleteTransformAction.NAME, + GetTransformAction.NAME, + GetTransformStatsAction.NAME, + PutTransformAction.NAME, + StartTransformAction.NAME, + StopTransformAction.NAME, + UpdateTransformAction.NAME, + ValidateTransformAction.NAME, + DeleteTransformActionDeprecated.NAME, + GetTransformActionDeprecated.NAME, + GetTransformStatsActionDeprecated.NAME, + PreviewTransformActionDeprecated.NAME, + PutTransformActionDeprecated.NAME, + StartTransformActionDeprecated.NAME, + StopTransformActionDeprecated.NAME, + UpdateTransformActionDeprecated.NAME, + "cluster:admin/data_frame/" + randomAlphaOfLengthBetween(3, 8), + "cluster:monitor/data_frame/" + randomAlphaOfLengthBetween(3, 8), + "cluster:admin/transform/" + randomAlphaOfLengthBetween(3, 8), + "cluster:monitor/transform/" + randomAlphaOfLengthBetween(3, 8) + ).forEach(action -> assertThat(kibanaRole.cluster().check(action, request, authentication), is(true))); + + Arrays.asList( + "metrics-endpoint.metadata" + randomAlphaOfLengthBetween(3, 8) + ).forEach(indexName -> { + assertOnlyReadAllowed(kibanaRole, indexName); + assertViewIndexMetadata(kibanaRole, indexName); + + final IndexAbstraction indexAbstraction = mockIndexAbstraction(indexName); + assertThat(kibanaRole.indices().allowedIndicesMatcher(UpdateSettingsAction.NAME).test(indexAbstraction), is(false)); + assertThat(kibanaRole.indices().allowedIndicesMatcher(PutMappingAction.NAME).test(indexAbstraction), is(false)); + assertThat(kibanaRole.indices().allowedIndicesMatcher(RolloverAction.NAME).test(indexAbstraction), is(false)); + }); + + Arrays.asList( + "metrics-endpoint.metadata_current_default", + "metrics-endpoint.metadata_united_default" + ).forEach(indexName -> { + logger.info("index name [{}]", indexName); + final IndexAbstraction indexAbstraction = mockIndexAbstraction(indexName); + // Allow indexing + assertThat(kibanaRole.indices().allowedIndicesMatcher(SearchAction.NAME).test(indexAbstraction), is(true)); + assertThat(kibanaRole.indices().allowedIndicesMatcher(GetAction.NAME).test(indexAbstraction), is(true)); + assertThat(kibanaRole.indices().allowedIndicesMatcher(IndexAction.NAME).test(indexAbstraction), is(true)); + assertThat(kibanaRole.indices().allowedIndicesMatcher(UpdateAction.NAME).test(indexAbstraction), is(true)); + assertThat(kibanaRole.indices().allowedIndicesMatcher(BulkAction.NAME).test(indexAbstraction), is(true)); + // Allow create and delete index + assertThat(kibanaRole.indices().allowedIndicesMatcher(CreateIndexAction.NAME).test(indexAbstraction), is(true)); + assertThat(kibanaRole.indices().allowedIndicesMatcher(AutoCreateAction.NAME).test(indexAbstraction), is(true)); + assertThat(kibanaRole.indices().allowedIndicesMatcher(CreateDataStreamAction.NAME).test(indexAbstraction), is(true)); + assertThat(kibanaRole.indices().allowedIndicesMatcher(DeleteIndexAction.NAME).test(indexAbstraction), is(true)); + assertThat(kibanaRole.indices().allowedIndicesMatcher(DeleteDataStreamAction.NAME).test(indexAbstraction), is(true)); + + // Implied by the overall view_index_metadata and monitor privilege + assertViewIndexMetadata(kibanaRole, indexName); + assertThat( + kibanaRole.indices().allowedIndicesMatcher("indices:monitor/" + randomAlphaOfLengthBetween(3, 8)).test(indexAbstraction), + is(true)); + + // Granted by bwc for index privilege + assertThat(kibanaRole.indices().allowedIndicesMatcher(PutMappingAction.NAME).test(indexAbstraction), + is(indexAbstraction.getType() != IndexAbstraction.Type.DATA_STREAM)); + + // Deny deleting documents and modifying the index settings + assertThat(kibanaRole.indices().allowedIndicesMatcher(DeleteAction.NAME).test(indexAbstraction), is(false)); + assertThat(kibanaRole.indices().allowedIndicesMatcher(UpdateSettingsAction.NAME).test(indexAbstraction), is(false)); + assertThat(kibanaRole.indices().allowedIndicesMatcher(RolloverAction.NAME).test(indexAbstraction), is(false)); + }); } public void testKibanaAdminRole() { @@ -1797,6 +1919,23 @@ public void testPredefinedEditorRole() { assertThat(role.runAs().check(randomAlphaOfLengthBetween(1, 20)), is(false)); } + private void assertAllIndicesAccessAllowed(Role role, String index) { + logger.info("index name [{}]", index); + assertThat(role.indices().allowedIndicesMatcher("indices:foo").test(mockIndexAbstraction(index)), is(true)); + assertThat(role.indices().allowedIndicesMatcher("indices:bar").test(mockIndexAbstraction(index)), is(true)); + assertThat(role.indices().allowedIndicesMatcher(DeleteIndexAction.NAME).test(mockIndexAbstraction(index)), is(true)); + assertThat(role.indices().allowedIndicesMatcher(GetIndexAction.NAME).test(mockIndexAbstraction(index)), is(true)); + assertThat(role.indices().allowedIndicesMatcher(CreateIndexAction.NAME).test(mockIndexAbstraction(index)), is(true)); + assertThat(role.indices().allowedIndicesMatcher(IndexAction.NAME).test(mockIndexAbstraction(index)), is(true)); + assertThat(role.indices().allowedIndicesMatcher(DeleteAction.NAME).test(mockIndexAbstraction(index)), is(true)); + assertThat(role.indices().allowedIndicesMatcher(UpdateSettingsAction.NAME).test(mockIndexAbstraction(index)), is(true)); + assertThat(role.indices().allowedIndicesMatcher(SearchAction.NAME).test(mockIndexAbstraction(index)), is(true)); + assertThat(role.indices().allowedIndicesMatcher(MultiSearchAction.NAME).test(mockIndexAbstraction(index)), is(true)); + assertThat(role.indices().allowedIndicesMatcher(GetAction.NAME).test(mockIndexAbstraction(index)), is(true)); + // inherits from 'all' + assertThat(role.indices().allowedIndicesMatcher(READ_CROSS_CLUSTER_NAME).test(mockIndexAbstraction(index)), is(true)); + } + private void assertReadWriteDocsAndMaintenanceButNotDeleteIndexAllowed(Role role, String index) { assertThat(role.indices().allowedIndicesMatcher(DeleteIndexAction.NAME).test(mockIndexAbstraction(index)), is(false)); assertThat(role.indices().allowedIndicesMatcher(SearchAction.NAME).test(mockIndexAbstraction(index)), is(true)); @@ -1836,6 +1975,23 @@ private void assertOnlyReadAllowed(Role role, String index) { assertNoAccessAllowed(role, XPackPlugin.ASYNC_RESULTS_INDEX + randomAlphaOfLengthBetween(0, 2)); } + private void assertViewIndexMetadata(Role role, String index) { + Arrays.asList( + GetAliasesAction.NAME, + GetIndexAction.NAME, + GetFieldMappingsAction.NAME + "*", + GetMappingsAction.NAME, + ClusterSearchShardsAction.NAME, + ValidateQueryAction.NAME + "*", + GetSettingsAction.NAME, + ExplainLifecycleAction.NAME, + GetDataStreamAction.NAME, + ResolveIndexAction.NAME, + FieldCapabilitiesAction.NAME + "*", + GetRollupIndexCapsAction.NAME + "*" + ).forEach(action -> assertThat(role.indices().allowedIndicesMatcher(action).test(mockIndexAbstraction(index)), is(true))); + } + private void assertNoAccessAllowed(Role role, Collection indices) { for (String index : indices) { assertNoAccessAllowed(role, index); From 450906fdcb8c0b39d47e832e27fffb9996eb28bf Mon Sep 17 00:00:00 2001 From: Artem Prigoda Date: Tue, 28 Sep 2021 09:33:04 +0200 Subject: [PATCH 024/250] Simplify StringBuilder usage in LoggingAuditTrailTests (#78146) Use a simple string concatention and chain calls to make code more terse Co-authored-by: Elastic Machine --- .../audit/logfile/LoggingAuditTrailTests.java | 85 ++++++++----------- 1 file changed, 36 insertions(+), 49 deletions(-) diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/audit/logfile/LoggingAuditTrailTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/audit/logfile/LoggingAuditTrailTests.java index 529ef0b5482ec..c2e94e56520dc 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/audit/logfile/LoggingAuditTrailTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/audit/logfile/LoggingAuditTrailTests.java @@ -462,8 +462,8 @@ public void testSecurityConfigChangeEventFormattingForRoles() throws IOException List allTestRoleDescriptors = List.of(nullRoleDescriptor, roleDescriptor1, roleDescriptor2, roleDescriptor3, roleDescriptor4); List keyRoleDescriptors = randomSubsetOf(allTestRoleDescriptors); - StringBuilder roleDescriptorsStringBuilder = new StringBuilder(); - roleDescriptorsStringBuilder.append("\"role_descriptors\":["); + StringBuilder roleDescriptorsStringBuilder = new StringBuilder() + .append("\"role_descriptors\":["); keyRoleDescriptors.forEach(roleDescriptor -> { roleDescriptorsStringBuilder.append(auditedRolesMap.get(roleDescriptor.getName())); roleDescriptorsStringBuilder.append(','); @@ -481,12 +481,10 @@ public void testSecurityConfigChangeEventFormattingForRoles() throws IOException CreateApiKeyRequest createApiKeyRequest = new CreateApiKeyRequest(keyName, keyRoleDescriptors, expiration); createApiKeyRequest.setRefreshPolicy(randomFrom(WriteRequest.RefreshPolicy.values())); auditTrail.accessGranted(requestId, authentication, CreateApiKeyAction.NAME, createApiKeyRequest, authorizationInfo); - StringBuilder createKeyAuditEventStringBuilder = new StringBuilder(); - createKeyAuditEventStringBuilder.append("\"create\":{\"apikey\":{\"name\":\"" + keyName + "\",\"expiration\":" + - (expiration != null ? "\"" + expiration.toString() + "\"" : "null") + ","); - createKeyAuditEventStringBuilder.append(roleDescriptorsStringBuilder.toString()); - createKeyAuditEventStringBuilder.append("}}"); - String expectedCreateKeyAuditEventString = createKeyAuditEventStringBuilder.toString(); + String expectedCreateKeyAuditEventString = "\"create\":{\"apikey\":{\"name\":\"" + keyName + "\",\"expiration\":" + + (expiration != null ? "\"" + expiration.toString() + "\"" : "null") + "," + + roleDescriptorsStringBuilder + + "}}"; List output = CapturingLogger.output(logger.getName(), Level.INFO); assertThat(output.size(), is(2)); String generatedCreateKeyAuditEventString = output.get(1); @@ -514,11 +512,10 @@ public void testSecurityConfigChangeEventFormattingForRoles() throws IOException output = CapturingLogger.output(logger.getName(), Level.INFO); assertThat(output.size(), is(2)); String generatedGrantKeyAuditEventString = output.get(1); - StringBuilder grantKeyAuditEventStringBuilder = new StringBuilder(); - grantKeyAuditEventStringBuilder.append("\"create\":{\"apikey\":{\"name\":\"" + keyName + "\",\"expiration\":" + - (expiration != null ? "\"" + expiration.toString() + "\"" : "null") + ","); - grantKeyAuditEventStringBuilder.append(roleDescriptorsStringBuilder.toString()); - grantKeyAuditEventStringBuilder.append("},\"grant\":{\"type\":"); + StringBuilder grantKeyAuditEventStringBuilder = new StringBuilder() + .append("\"create\":{\"apikey\":{\"name\":\"").append(keyName) + .append("\",\"expiration\":").append(expiration != null ? "\"" + expiration + "\"" : "null").append(",") + .append(roleDescriptorsStringBuilder).append("},\"grant\":{\"type\":"); if (grantApiKeyRequest.getGrant().getType() != null) { grantKeyAuditEventStringBuilder.append("\"").append(grantApiKeyRequest.getGrant().getType()).append("\""); } else { @@ -560,12 +557,10 @@ public void testSecurityConfigChangeEventFormattingForRoles() throws IOException output = CapturingLogger.output(logger.getName(), Level.INFO); assertThat(output.size(), is(2)); String generatedPutRoleAuditEventString = output.get(1); - StringBuilder putRoleAuditEventStringBuilder = new StringBuilder(); - putRoleAuditEventStringBuilder.append("\"put\":{\"role\":{\"name\":\"" + putRoleRequest.name() + "\",") - .append("\"role_descriptor\":") - .append(auditedRolesMap.get(putRoleRequest.name())) - .append("}}"); - String expectedPutRoleAuditEventString = putRoleAuditEventStringBuilder.toString(); + String expectedPutRoleAuditEventString = "\"put\":{\"role\":{\"name\":\"" + putRoleRequest.name() + "\"," + + "\"role_descriptor\":" + + auditedRolesMap.get(putRoleRequest.name()) + + "}}"; assertThat(generatedPutRoleAuditEventString, containsString(expectedPutRoleAuditEventString)); generatedPutRoleAuditEventString = generatedPutRoleAuditEventString.replace(", " + expectedPutRoleAuditEventString, ""); checkedFields = new MapBuilder<>(commonFields); @@ -586,8 +581,8 @@ public void testSecurityConfigChangeEventFormattingForRoles() throws IOException output = CapturingLogger.output(logger.getName(), Level.INFO); assertThat(output.size(), is(2)); String generatedDeleteRoleAuditEventString = output.get(1); - StringBuilder deleteRoleStringBuilder = new StringBuilder(); - deleteRoleStringBuilder.append("\"delete\":{\"role\":{\"name\":"); + StringBuilder deleteRoleStringBuilder = new StringBuilder() + .append("\"delete\":{\"role\":{\"name\":"); if (deleteRoleRequest.name() == null) { deleteRoleStringBuilder.append("null"); } else { @@ -626,8 +621,8 @@ public void testSecurityConfigChangeEventFormattingForApiKeyInvalidation() throw List output = CapturingLogger.output(logger.getName(), Level.INFO); assertThat(output.size(), is(2)); String generatedInvalidateKeyAuditEventString = output.get(1); - StringBuilder invalidateKeyEventStringBuilder = new StringBuilder(); - invalidateKeyEventStringBuilder.append("\"invalidate\":{\"apikeys\":{"); + StringBuilder invalidateKeyEventStringBuilder = new StringBuilder() + .append("\"invalidate\":{\"apikeys\":{"); if (invalidateApiKeyRequest.getIds() != null && invalidateApiKeyRequest.getIds().length > 0) { invalidateKeyEventStringBuilder.append("\"ids\":["); for (String apiKeyId : invalidateApiKeyRequest.getIds()) { @@ -699,8 +694,8 @@ public void testSecurityConfigChangeEventFormattingForApplicationPrivileges() th List output = CapturingLogger.output(logger.getName(), Level.INFO); assertThat(output.size(), is(2)); String generatedPutPrivilegesAuditEventString = output.get(1); - StringBuilder putPrivilegesAuditEventStringBuilder = new StringBuilder(); - putPrivilegesAuditEventStringBuilder.append("\"put\":{\"privileges\":["); + StringBuilder putPrivilegesAuditEventStringBuilder = new StringBuilder() + .append("\"put\":{\"privileges\":["); if (false == putPrivilegesRequest.getPrivileges().isEmpty()) { for (ApplicationPrivilegeDescriptor appPriv : putPrivilegesRequest.getPrivileges()) { putPrivilegesAuditEventStringBuilder.append("{\"application\":\"").append(appPriv.getApplication()).append("\"") @@ -743,8 +738,8 @@ public void testSecurityConfigChangeEventFormattingForApplicationPrivileges() th output = CapturingLogger.output(logger.getName(), Level.INFO); assertThat(output.size(), is(2)); String generatedDeletePrivilegesAuditEventString = output.get(1); - StringBuilder deletePrivilegesAuditEventStringBuilder = new StringBuilder(); - deletePrivilegesAuditEventStringBuilder.append("\"delete\":{\"privileges\":{\"application\":"); + StringBuilder deletePrivilegesAuditEventStringBuilder = new StringBuilder() + .append("\"delete\":{\"privileges\":{\"application\":"); if (deletePrivilegesRequest.application() != null) { deletePrivilegesAuditEventStringBuilder.append("\"").append(deletePrivilegesRequest.application()).append("\""); } else { @@ -836,8 +831,8 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws List output = CapturingLogger.output(logger.getName(), Level.INFO); assertThat(output.size(), is(2)); String generatedPutRoleMappingAuditEventString = output.get(1); - StringBuilder putRoleMappingAuditEventStringBuilder = new StringBuilder(); - putRoleMappingAuditEventStringBuilder.append("\"put\":{\"role_mapping\":{\"name\":"); + StringBuilder putRoleMappingAuditEventStringBuilder = new StringBuilder() + .append("\"put\":{\"role_mapping\":{\"name\":"); if (putRoleMappingRequest.getName() != null) { putRoleMappingAuditEventStringBuilder.append("\"").append(putRoleMappingRequest.getName()).append("\""); } else { @@ -898,8 +893,8 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws output = CapturingLogger.output(logger.getName(), Level.INFO); assertThat(output.size(), is(2)); String generatedDeleteRoleMappingAuditEventString = output.get(1); - StringBuilder deleteRoleMappingStringBuilder = new StringBuilder(); - deleteRoleMappingStringBuilder.append("\"delete\":{\"role_mapping\":{\"name\":"); + StringBuilder deleteRoleMappingStringBuilder = new StringBuilder() + .append("\"delete\":{\"role_mapping\":{\"name\":"); if (deleteRoleMappingRequest.getName() == null) { deleteRoleMappingStringBuilder.append("null"); } else { @@ -949,12 +944,12 @@ public void testSecurityConfigChangeEventFormattingForUsers() throws IOException assertThat(output.size(), is(2)); String generatedPutUserAuditEventString = output.get(1); - StringBuilder putUserAuditEventStringBuilder = new StringBuilder(); - putUserAuditEventStringBuilder.append("\"put\":{\"user\":{\"name\":"); - putUserAuditEventStringBuilder.append("\"" + putUserRequest.username() + "\""); - putUserAuditEventStringBuilder.append(",\"enabled\":"); - putUserAuditEventStringBuilder.append(putUserRequest.enabled()); - putUserAuditEventStringBuilder.append(",\"roles\":"); + StringBuilder putUserAuditEventStringBuilder = new StringBuilder() + .append("\"put\":{\"user\":{\"name\":") + .append("\"").append(putUserRequest.username()).append("\"") + .append(",\"enabled\":") + .append(putUserRequest.enabled()) + .append(",\"roles\":"); if (putUserRequest.roles() == null) { putUserAuditEventStringBuilder.append("null"); } else if (putUserRequest.roles().length == 0) { @@ -1003,9 +998,7 @@ public void testSecurityConfigChangeEventFormattingForUsers() throws IOException output = CapturingLogger.output(logger.getName(), Level.INFO); assertThat(output.size(), is(2)); String generatedEnableUserAuditEventString = output.get(1); - StringBuilder enableUserStringBuilder = new StringBuilder(); - enableUserStringBuilder.append("\"change\":{\"enable\":{\"user\":{\"name\":\"").append(username).append("\"}}}"); - String expectedEnableUserAuditEventString = enableUserStringBuilder.toString(); + String expectedEnableUserAuditEventString = "\"change\":{\"enable\":{\"user\":{\"name\":\"" + username + "\"}}}"; assertThat(generatedEnableUserAuditEventString, containsString(expectedEnableUserAuditEventString)); generatedEnableUserAuditEventString = generatedEnableUserAuditEventString.replace(", " + expectedEnableUserAuditEventString, ""); checkedFields = new MapBuilder<>(commonFields); @@ -1028,9 +1021,7 @@ public void testSecurityConfigChangeEventFormattingForUsers() throws IOException output = CapturingLogger.output(logger.getName(), Level.INFO); assertThat(output.size(), is(2)); String generatedDisableUserAuditEventString = output.get(1); - StringBuilder disableUserStringBuilder = new StringBuilder(); - disableUserStringBuilder.append("\"change\":{\"disable\":{\"user\":{\"name\":\"").append(username).append("\"}}}"); - String expectedDisableUserAuditEventString = disableUserStringBuilder.toString(); + String expectedDisableUserAuditEventString = "\"change\":{\"disable\":{\"user\":{\"name\":\"" + username + "\"}}}"; assertThat(generatedDisableUserAuditEventString, containsString(expectedDisableUserAuditEventString)); generatedDisableUserAuditEventString = generatedDisableUserAuditEventString.replace(", " + expectedDisableUserAuditEventString, ""); checkedFields = new MapBuilder<>(commonFields); @@ -1052,9 +1043,7 @@ public void testSecurityConfigChangeEventFormattingForUsers() throws IOException output = CapturingLogger.output(logger.getName(), Level.INFO); assertThat(output.size(), is(2)); String generatedChangePasswordAuditEventString = output.get(1); - StringBuilder changePasswordStringBuilder = new StringBuilder(); - changePasswordStringBuilder.append("\"change\":{\"password\":{\"user\":{\"name\":\"").append(username).append("\"}}}"); - String expectedChangePasswordAuditEventString = changePasswordStringBuilder.toString(); + String expectedChangePasswordAuditEventString = "\"change\":{\"password\":{\"user\":{\"name\":\"" + username + "\"}}}"; assertThat(generatedChangePasswordAuditEventString, containsString(expectedChangePasswordAuditEventString)); generatedChangePasswordAuditEventString = generatedChangePasswordAuditEventString.replace(", " + expectedChangePasswordAuditEventString, @@ -1077,9 +1066,7 @@ public void testSecurityConfigChangeEventFormattingForUsers() throws IOException output = CapturingLogger.output(logger.getName(), Level.INFO); assertThat(output.size(), is(2)); String generatedDeleteUserAuditEventString = output.get(1); - StringBuilder deleteUserStringBuilder = new StringBuilder(); - deleteUserStringBuilder.append("\"delete\":{\"user\":{\"name\":\"").append(username).append("\"}}"); - String expectedDeleteUserAuditEventString = deleteUserStringBuilder.toString(); + String expectedDeleteUserAuditEventString = "\"delete\":{\"user\":{\"name\":\"" + username + "\"}}"; assertThat(generatedDeleteUserAuditEventString, containsString(expectedDeleteUserAuditEventString)); generatedDeleteUserAuditEventString = generatedDeleteUserAuditEventString.replace(", " + expectedDeleteUserAuditEventString,""); From d5b1de1f2218bcb9bff6059055ba221268086a07 Mon Sep 17 00:00:00 2001 From: Lukas Wegmann Date: Tue, 28 Sep 2021 10:41:11 +0200 Subject: [PATCH 025/250] SQL: fix NULLS FIRST/LAST for aggregations (#77750) * SQL: fix NULLS FIRST/LAST for aggregations * adding bwc tests * address review comments --- .../eql/execution/search/SourceGenerator.java | 4 +- .../ql/execution/search/QlSourceBuilder.java | 1 + .../xpack/ql/expression/Order.java | 11 +- .../xpack/ql/querydsl/container/Sort.java | 56 +++++++- x-pack/plugin/sql/qa/mixed-node/build.gradle | 1 + .../xpack/sql/qa/mixed_node/SqlCompatIT.java | 127 ++++++++++++++++++ .../src/main/resources/agg-ordering.csv-spec | 65 +++++++++ .../src/main/resources/agg-ordering.sql-spec | 29 ++++ .../xpack/sql/execution/search/Querier.java | 10 +- .../sql/execution/search/SourceGenerator.java | 4 +- .../xpack/sql/planner/QueryFolder.java | 2 +- .../xpack/sql/querydsl/agg/Aggs.java | 5 +- .../querydsl/agg/GroupByDateHistogram.java | 17 +-- .../xpack/sql/querydsl/agg/GroupByKey.java | 21 ++- .../querydsl/agg/GroupByNumericHistogram.java | 13 +- .../xpack/sql/querydsl/agg/GroupByValue.java | 13 +- .../xpack/sql/querydsl/agg/TopHitsAgg.java | 4 +- .../xpack/sql/planner/QueryFolderTests.java | 53 ++++++++ .../sql/planner/querytranslator_tests.txt | 17 ++- 19 files changed, 398 insertions(+), 55 deletions(-) create mode 100644 x-pack/plugin/sql/qa/mixed-node/src/test/java/org/elasticsearch/xpack/sql/qa/mixed_node/SqlCompatIT.java diff --git a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/execution/search/SourceGenerator.java b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/execution/search/SourceGenerator.java index 0c126fe11c6ca..f1e3ea2a9c411 100644 --- a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/execution/search/SourceGenerator.java +++ b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/execution/search/SourceGenerator.java @@ -103,12 +103,12 @@ private static void sorting(QueryContainer container, SearchSourceBuilder source FieldAttribute fa = ((FieldAttribute) attr).exactAttribute(); sortBuilder = fieldSort(fa.name()) - .missing(as.missing().position()) + .missing(as.missing().searchOrder(as.direction())) .unmappedType(fa.dataType().esType()); if (fa.isNested()) { FieldSortBuilder fieldSort = fieldSort(fa.name()) - .missing(as.missing().position()) + .missing(as.missing().searchOrder(as.direction())) .unmappedType(fa.dataType().esType()); NestedSortBuilder newSort = new NestedSortBuilder(fa.nestedParent().name()); diff --git a/x-pack/plugin/ql/src/main/java/org/elasticsearch/xpack/ql/execution/search/QlSourceBuilder.java b/x-pack/plugin/ql/src/main/java/org/elasticsearch/xpack/ql/execution/search/QlSourceBuilder.java index 4f0c1f623b772..8977155fb222d 100644 --- a/x-pack/plugin/ql/src/main/java/org/elasticsearch/xpack/ql/execution/search/QlSourceBuilder.java +++ b/x-pack/plugin/ql/src/main/java/org/elasticsearch/xpack/ql/execution/search/QlSourceBuilder.java @@ -23,6 +23,7 @@ */ public class QlSourceBuilder { public static final Version SWITCH_TO_FIELDS_API_VERSION = Version.V_7_10_0; + public static final Version INTRODUCING_MISSING_ORDER_IN_COMPOSITE_AGGS_VERSION = Version.V_7_16_0; // The LinkedHashMaps preserve the order of the fields in the response private final Set fetchFields = new LinkedHashSet<>(); private final Map scriptFields = new LinkedHashMap<>(); diff --git a/x-pack/plugin/ql/src/main/java/org/elasticsearch/xpack/ql/expression/Order.java b/x-pack/plugin/ql/src/main/java/org/elasticsearch/xpack/ql/expression/Order.java index d934e49b504b3..bc8b0c162cadb 100644 --- a/x-pack/plugin/ql/src/main/java/org/elasticsearch/xpack/ql/expression/Order.java +++ b/x-pack/plugin/ql/src/main/java/org/elasticsearch/xpack/ql/expression/Order.java @@ -23,7 +23,14 @@ public enum OrderDirection { } public enum NullsPosition { - FIRST, LAST; + FIRST, LAST, + /** + * Nulls position has not been specified by the user and an appropriate default will be used. + * + * The default values are chosen such that it stays compatible with previous behavior. Unfortunately, this results in + * inconsistencies across different types of queries (see https://github.com/elastic/elasticsearch/issues/77068). + */ + ANY; } private final Expression child; @@ -34,7 +41,7 @@ public Order(Source source, Expression child, OrderDirection direction, NullsPos super(source, singletonList(child)); this.child = child; this.direction = direction; - this.nulls = nulls == null ? (direction == OrderDirection.DESC ? NullsPosition.FIRST : NullsPosition.LAST) : nulls; + this.nulls = nulls == null ? NullsPosition.ANY : nulls; } @Override diff --git a/x-pack/plugin/ql/src/main/java/org/elasticsearch/xpack/ql/querydsl/container/Sort.java b/x-pack/plugin/ql/src/main/java/org/elasticsearch/xpack/ql/querydsl/container/Sort.java index 9add380994e76..0899a40a2b42a 100644 --- a/x-pack/plugin/ql/src/main/java/org/elasticsearch/xpack/ql/querydsl/container/Sort.java +++ b/x-pack/plugin/ql/src/main/java/org/elasticsearch/xpack/ql/querydsl/container/Sort.java @@ -6,6 +6,7 @@ */ package org.elasticsearch.xpack.ql.querydsl.container; +import org.elasticsearch.search.aggregations.bucket.composite.MissingOrder; import org.elasticsearch.search.sort.SortOrder; import org.elasticsearch.xpack.ql.expression.Order.NullsPosition; import org.elasticsearch.xpack.ql.expression.Order.OrderDirection; @@ -25,20 +26,61 @@ public SortOrder asOrder() { } public enum Missing { - FIRST("_first"), LAST("_last"); + FIRST("_first", MissingOrder.FIRST), + LAST("_last", MissingOrder.LAST), + /** + * Nulls position has not been specified by the user and an appropriate default will be used. + * + * The default values are chosen such that it stays compatible with previous behavior. Unfortunately, this results in + * inconsistencies across different types of queries (see https://github.com/elastic/elasticsearch/issues/77068). + */ + ANY(null, null); - private final String position; + private final String searchOrder; + private final MissingOrder aggregationOrder; - Missing(String position) { - this.position = position; + Missing(String searchOrder, MissingOrder aggregationOrder) { + this.searchOrder = searchOrder; + this.aggregationOrder = aggregationOrder; } public static Missing from(NullsPosition pos) { - return pos == null || pos == NullsPosition.FIRST ? FIRST : LAST; + switch (pos) { + case FIRST: + return FIRST; + case LAST: + return LAST; + default: + return ANY; + } } - public String position() { - return position; + public String searchOrder() { + return searchOrder(null); + } + + /** + * Preferred order of null values in non-aggregation queries. + */ + public String searchOrder(Direction direction) { + if (searchOrder != null) { + return searchOrder; + } else { + switch (direction) { + case ASC: + return LAST.searchOrder; + case DESC: + return FIRST.searchOrder; + default: + throw new IllegalArgumentException("Unknown direction [" + direction + "]"); + } + } + } + /** + * Preferred order of null values in aggregation queries. + */ + public MissingOrder aggregationOrder() { + return aggregationOrder; } } diff --git a/x-pack/plugin/sql/qa/mixed-node/build.gradle b/x-pack/plugin/sql/qa/mixed-node/build.gradle index 98857b00500a1..3dca86cc81a9c 100644 --- a/x-pack/plugin/sql/qa/mixed-node/build.gradle +++ b/x-pack/plugin/sql/qa/mixed-node/build.gradle @@ -12,6 +12,7 @@ dependencies { testImplementation project(':x-pack:qa') testImplementation(project(xpackModule('ql:test-fixtures'))) testImplementation project(xpackModule('sql')) + testImplementation project(xpackModule('sql:qa:server')) } testClusters.configureEach { diff --git a/x-pack/plugin/sql/qa/mixed-node/src/test/java/org/elasticsearch/xpack/sql/qa/mixed_node/SqlCompatIT.java b/x-pack/plugin/sql/qa/mixed-node/src/test/java/org/elasticsearch/xpack/sql/qa/mixed_node/SqlCompatIT.java new file mode 100644 index 0000000000000..3538624b4f848 --- /dev/null +++ b/x-pack/plugin/sql/qa/mixed-node/src/test/java/org/elasticsearch/xpack/sql/qa/mixed_node/SqlCompatIT.java @@ -0,0 +1,127 @@ +/* + * 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.sql.qa.mixed_node; + +import org.apache.http.HttpHost; +import org.elasticsearch.Version; +import org.elasticsearch.client.Request; +import org.elasticsearch.client.Response; +import org.elasticsearch.client.RestClient; +import org.elasticsearch.common.xcontent.XContentHelper; +import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.core.internal.io.IOUtils; +import org.elasticsearch.xpack.ql.TestNode; +import org.elasticsearch.xpack.ql.TestNodes; +import org.elasticsearch.xpack.sql.qa.rest.BaseRestSqlTestCase; +import org.junit.AfterClass; +import org.junit.Before; + +import java.io.IOException; +import java.io.InputStream; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import static org.elasticsearch.xpack.ql.TestUtils.buildNodeAndVersions; +import static org.elasticsearch.xpack.ql.execution.search.QlSourceBuilder.INTRODUCING_MISSING_ORDER_IN_COMPOSITE_AGGS_VERSION; + +public class SqlCompatIT extends BaseRestSqlTestCase { + + private static RestClient newNodesClient; + private static RestClient oldNodesClient; + private static Version bwcVersion; + + @Before + public void initBwcClients() throws IOException { + if (newNodesClient == null) { + assertNull(oldNodesClient); + + TestNodes nodes = buildNodeAndVersions(client()); + bwcVersion = nodes.getBWCVersion(); + newNodesClient = buildClient( + restClientSettings(), + nodes.getNewNodes().stream().map(TestNode::getPublishAddress).toArray(HttpHost[]::new) + ); + oldNodesClient = buildClient( + restClientSettings(), + nodes.getBWCNodes().stream().map(TestNode::getPublishAddress).toArray(HttpHost[]::new) + ); + } + } + + @AfterClass + public static void cleanUpClients() throws IOException { + IOUtils.close(newNodesClient, oldNodesClient, () -> { + newNodesClient = null; + oldNodesClient = null; + bwcVersion = null; + }); + } + + public void testNullsOrderBeforeMissingOrderSupport() throws IOException { + assumeTrue( + "expected some nodes without support for missing_order but got none", + bwcVersion.before(INTRODUCING_MISSING_ORDER_IN_COMPOSITE_AGGS_VERSION) + ); + + for (RestClient bwcClient : Arrays.asList(newNodesClient, oldNodesClient)) { + List result = runOrderByNullsLastQuery(bwcClient); + + assertEquals(3, result.size()); + assertNull(result.get(0)); + assertEquals(Integer.valueOf(1), result.get(1)); + assertEquals(Integer.valueOf(2), result.get(2)); + } + } + + public void testNullsOrderWithMissingOrderSupport() throws IOException { + assumeTrue( + "expected all nodes with support for missing_order but got some without", + bwcVersion.onOrAfter(INTRODUCING_MISSING_ORDER_IN_COMPOSITE_AGGS_VERSION) + ); + + // TODO: add oldNodesClient once PR is backported to 7.x + for (RestClient bwcClient : Arrays.asList(newNodesClient)) { + List result = runOrderByNullsLastQuery(bwcClient); + + assertEquals(3, result.size()); + assertEquals(Integer.valueOf(1), result.get(0)); + assertEquals(Integer.valueOf(2), result.get(1)); + assertNull(result.get(2)); + } + } + + @SuppressWarnings("unchecked") + private List runOrderByNullsLastQuery(RestClient queryClient) throws IOException { + Request putIndex = new Request("PUT", "/test"); + putIndex.setJsonEntity("{\"settings\":{\"index\":{\"number_of_shards\":3}}}"); + client().performRequest(putIndex); + + Request indexDocs = new Request("POST", "/test/_bulk"); + indexDocs.addParameter("refresh", "true"); + StringBuilder bulk = new StringBuilder(); + for (String doc : Arrays.asList("{\"int\":1,\"kw\":\"foo\"}", "{\"int\":2,\"kw\":\"bar\"}", "{\"kw\":\"bar\"}")) { + bulk.append("{\"index\":{}\n").append(doc).append("\n"); + } + indexDocs.setJsonEntity(bulk.toString()); + client().performRequest(indexDocs); + + Request query = new Request("GET", "_sql"); + query.setJsonEntity("{\"query\":\"SELECT int FROM test GROUP BY 1 ORDER BY 1 NULLS LAST\"}"); + Response queryResponse = queryClient.performRequest(query); + + assertEquals(200, queryResponse.getStatusLine().getStatusCode()); + + InputStream content = queryResponse.getEntity().getContent(); + Map result = XContentHelper.convertToMap(JsonXContent.jsonXContent, content, false); + List> rows = (List>) result.get("rows"); + return rows.stream().map(row -> (Integer) row.get(0)).collect(Collectors.toList()); + } + +} diff --git a/x-pack/plugin/sql/qa/server/src/main/resources/agg-ordering.csv-spec b/x-pack/plugin/sql/qa/server/src/main/resources/agg-ordering.csv-spec index 64aa440a5dd7b..9fa1a5b208f06 100644 --- a/x-pack/plugin/sql/qa/server/src/main/resources/agg-ordering.csv-spec +++ b/x-pack/plugin/sql/qa/server/src/main/resources/agg-ordering.csv-spec @@ -70,3 +70,68 @@ null |10 1964-01-01T00:00:00.000Z|4 1965-01-01T00:00:00.000Z|1 ; + +aggGroupAndOrderByDerivedFieldAsc +SELECT languages - 2 l, SUM(salary) s FROM test_emp GROUP BY l ORDER BY l; + + l:i | s:l +---------------+--------------- +null |525196 +-1 |758650 +0 |915398 +1 |891121 +2 |859194 +3 |875296 +; + +aggGroupAndOrderByDerivedFieldDesc +SELECT languages - 2 l, SUM(salary) s FROM test_emp GROUP BY l ORDER BY l DESC; + l:i | s:l +---------------+--------------- +3 |875296 +2 |859194 +1 |891121 +0 |915398 +-1 |758650 +null |525196 +; + +orderByHistogramNullsLast +SELECT HISTOGRAM(languages, 3) l, COUNT(*) c FROM test_emp GROUP BY l ORDER BY l NULLS LAST; + + l:bt | c:l +---------------+--------------- +0 |34 +3 |56 +null |10 +; + +orderByHistogramDescNullsFirst +SELECT HISTOGRAM(languages, 3) l, COUNT(*) c FROM test_emp GROUP BY l ORDER BY l DESC NULLS FIRST; + + l:bt | c:l +---------------+--------------- +null |10 +3 |56 +0 |34 +; + +orderByDateHistogramNullsLast +SELECT HISTOGRAM(birth_date, INTERVAL 10 YEARS) b, COUNT(*) c FROM test_emp GROUP BY b ORDER BY b NULLS LAST; + + b:ts | c:l +------------------------+--------------- +1950-04-16T00:00:00.000Z|57 +1960-02-23T00:00:00.000Z|33 +null |10 +; + +orderByDateHistogramDescNullsFirst +SELECT HISTOGRAM(birth_date, INTERVAL 10 YEARS) b, COUNT(*) c FROM test_emp GROUP BY b ORDER BY b DESC NULLS FIRST; + + b:ts | c:l +------------------------+--------------- +null |10 +1960-02-23T00:00:00.000Z|33 +1950-04-16T00:00:00.000Z|57 +; diff --git a/x-pack/plugin/sql/qa/server/src/main/resources/agg-ordering.sql-spec b/x-pack/plugin/sql/qa/server/src/main/resources/agg-ordering.sql-spec index 2937b34f0a539..6e46e020bc1b5 100644 --- a/x-pack/plugin/sql/qa/server/src/main/resources/agg-ordering.sql-spec +++ b/x-pack/plugin/sql/qa/server/src/main/resources/agg-ordering.sql-spec @@ -159,3 +159,32 @@ SELECT CONCAT('foo', gender) g, MAX(salary) AS max, MIN(salary) AS min FROM test multipleGroupingsAndOrderingByGroupsAndAggregatesWithFunctions_4 SELECT CONCAT('foo', gender) g, MAX(salary) AS max, MIN(salary) AS min FROM test_emp GROUP BY g ORDER BY 3 DESC, 1 NULLS FIRST, 2; + +aggWithNullsFirst +SELECT gender FROM test_emp GROUP BY gender ORDER BY gender NULLS FIRST; +aggWithNullsLast +SELECT gender FROM test_emp GROUP BY gender ORDER BY gender NULLS LAST; +aggWithMultipleNullsLast +SELECT gender, languages FROM test_emp GROUP BY gender, languages ORDER BY gender NULLS LAST, languages NULLS LAST; +aggWithNullsLastDerivedField +SELECT languages - 2 l FROM test_emp GROUP BY l ORDER BY l NULLS LAST; +aggWithNullsFirstDerivedField +SELECT languages - 2 l FROM test_emp GROUP BY l ORDER BY l NULLS FIRST; +aggWithMultipleDerivedNullsLast +SELECT CONCAT(gender, 'A') g, languages - 2 l FROM test_emp GROUP BY g, l ORDER BY g NULLS LAST, l NULLS LAST; +aggWithMultipleDerivedNullsFirst +SELECT CONCAT(gender, 'A') g, languages - 2 l FROM test_emp GROUP BY g, l ORDER BY g NULLS FIRST, l NULLS FIRST; +aggWithDescNullsFirst +SELECT gender FROM test_emp GROUP BY gender ORDER BY gender DESC NULLS FIRST; +aggWithDescNullsLast +SELECT gender FROM test_emp GROUP BY gender ORDER BY gender DESC NULLS LAST; +aggWithMultipleDescNullsFirst +SELECT gender, languages FROM test_emp GROUP BY gender, languages ORDER BY gender DESC NULLS FIRST, languages DESC NULLS FIRST; +aggWithDescNullsFirstDerivedField +SELECT languages - 2 l FROM test_emp GROUP BY l ORDER BY l DESC NULLS FIRST; +aggWithDescNullsLastDerivedField +SELECT languages - 2 l FROM test_emp GROUP BY l ORDER BY l DESC NULLS LAST; +aggWithMultipleDerivedDescNullsLast +SELECT CONCAT(gender, 'A') g, languages - 2 l FROM test_emp GROUP BY g, l ORDER BY g DESC NULLS LAST, l DESC NULLS LAST; +aggWithMultipleDerivedDescNullsFirst +SELECT CONCAT(gender, 'A') g, languages - 2 l FROM test_emp GROUP BY g, l ORDER BY g DESC NULLS FIRST, l DESC NULLS FIRST; diff --git a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/execution/search/Querier.java b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/execution/search/Querier.java index 3d577fccb2525..395fdf2cc472d 100644 --- a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/execution/search/Querier.java +++ b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/execution/search/Querier.java @@ -14,12 +14,12 @@ import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.action.search.ShardSearchFailure; import org.elasticsearch.client.Client; -import org.elasticsearch.core.Nullable; import org.elasticsearch.common.Strings; -import org.elasticsearch.core.Tuple; -import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.CollectionUtils; import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.core.Nullable; +import org.elasticsearch.core.TimeValue; +import org.elasticsearch.core.Tuple; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.search.aggregations.Aggregation; import org.elasticsearch.search.aggregations.Aggregations; @@ -85,7 +85,7 @@ import static java.util.Collections.singletonList; import static org.elasticsearch.action.ActionListener.wrap; -import static org.elasticsearch.xpack.ql.execution.search.QlSourceBuilder.SWITCH_TO_FIELDS_API_VERSION; +import static org.elasticsearch.xpack.ql.execution.search.QlSourceBuilder.INTRODUCING_MISSING_ORDER_IN_COMPOSITE_AGGS_VERSION; // TODO: add retry/back-off public class Querier { @@ -156,7 +156,7 @@ public static SearchRequest prepareRequest(Client client, SearchSourceBuilder so String... indices) { source.timeout(timeout); - SearchRequest searchRequest = new SearchRequest(SWITCH_TO_FIELDS_API_VERSION); + SearchRequest searchRequest = new SearchRequest(INTRODUCING_MISSING_ORDER_IN_COMPOSITE_AGGS_VERSION); searchRequest.indices(indices); searchRequest.source(source); searchRequest.allowPartialSearchResults(false); diff --git a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/execution/search/SourceGenerator.java b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/execution/search/SourceGenerator.java index 1e9a72c67fa70..ab4da4c96be6f 100644 --- a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/execution/search/SourceGenerator.java +++ b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/execution/search/SourceGenerator.java @@ -116,12 +116,12 @@ private static void sorting(QueryContainer container, SearchSourceBuilder source FieldAttribute fa = ((FieldAttribute) attr).exactAttribute(); sortBuilder = fieldSort(fa.name()) - .missing(as.missing().position()) + .missing(as.missing().searchOrder(as.direction())) .unmappedType(fa.dataType().esType()); if (fa.isNested()) { FieldSortBuilder fieldSort = fieldSort(fa.name()) - .missing(as.missing().position()) + .missing(as.missing().searchOrder(as.direction())) .unmappedType(fa.dataType().esType()); NestedSortBuilder newSort = new NestedSortBuilder(fa.nestedParent().name()); diff --git a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/planner/QueryFolder.java b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/planner/QueryFolder.java index d33196c0bf327..01face7be8e22 100644 --- a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/planner/QueryFolder.java +++ b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/planner/QueryFolder.java @@ -724,7 +724,7 @@ protected PhysicalPlan rule(OrderExec plan) { // TODO: might need to validate whether the target field or group actually exist if (group != null && group != Aggs.IMPLICIT_GROUP_KEY) { - qContainer = qContainer.updateGroup(group.with(direction)); + qContainer = qContainer.updateGroup(group.with(direction, missing)); } // field diff --git a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/querydsl/agg/Aggs.java b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/querydsl/agg/Aggs.java index fd00ae1fa17b6..a47b3bbbbc16e 100644 --- a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/querydsl/agg/Aggs.java +++ b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/querydsl/agg/Aggs.java @@ -11,6 +11,7 @@ import org.elasticsearch.search.aggregations.bucket.composite.CompositeValuesSourceBuilder; import org.elasticsearch.search.aggregations.bucket.filter.FiltersAggregationBuilder; import org.elasticsearch.xpack.ql.querydsl.container.Sort.Direction; +import org.elasticsearch.xpack.ql.querydsl.container.Sort.Missing; import org.elasticsearch.xpack.ql.util.StringUtils; import org.elasticsearch.xpack.sql.SqlIllegalArgumentException; @@ -40,7 +41,7 @@ public class Aggs { public static final String ROOT_GROUP_NAME = "groupby"; - public static final GroupByKey IMPLICIT_GROUP_KEY = new GroupByKey(ROOT_GROUP_NAME, AggSource.of(StringUtils.EMPTY), null) { + public static final GroupByKey IMPLICIT_GROUP_KEY = new GroupByKey(ROOT_GROUP_NAME, AggSource.of(StringUtils.EMPTY), null, null) { @Override public CompositeValuesSourceBuilder createSourceBuilder() { @@ -48,7 +49,7 @@ public CompositeValuesSourceBuilder createSourceBuilder() { } @Override - protected GroupByKey copy(String id, AggSource source, Direction direction) { + protected GroupByKey copy(String id, AggSource source, Direction direction, Missing missing) { return this; } }; diff --git a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/querydsl/agg/GroupByDateHistogram.java b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/querydsl/agg/GroupByDateHistogram.java index 3d00f6264d525..ac8f4744f42bd 100644 --- a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/querydsl/agg/GroupByDateHistogram.java +++ b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/querydsl/agg/GroupByDateHistogram.java @@ -10,6 +10,7 @@ import org.elasticsearch.search.aggregations.bucket.composite.DateHistogramValuesSourceBuilder; import org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramInterval; import org.elasticsearch.xpack.ql.expression.gen.script.ScriptTemplate; +import org.elasticsearch.xpack.ql.querydsl.container.Sort.Missing; import org.elasticsearch.xpack.ql.querydsl.container.Sort.Direction; import org.elasticsearch.xpack.sql.SqlIllegalArgumentException; @@ -26,24 +27,24 @@ public class GroupByDateHistogram extends GroupByKey { private final ZoneId zoneId; public GroupByDateHistogram(String id, String fieldName, long fixedInterval, ZoneId zoneId) { - this(id, AggSource.of(fieldName), null, fixedInterval, null, zoneId); + this(id, AggSource.of(fieldName), null, null, fixedInterval, null, zoneId); } public GroupByDateHistogram(String id, ScriptTemplate script, long fixedInterval, ZoneId zoneId) { - this(id, AggSource.of(script), null, fixedInterval, null, zoneId); + this(id, AggSource.of(script), null, null, fixedInterval, null, zoneId); } public GroupByDateHistogram(String id, String fieldName, String calendarInterval, ZoneId zoneId) { - this(id, AggSource.of(fieldName), null, -1L, calendarInterval, zoneId); + this(id, AggSource.of(fieldName), null, null, -1L, calendarInterval, zoneId); } public GroupByDateHistogram(String id, ScriptTemplate script, String calendarInterval, ZoneId zoneId) { - this(id, AggSource.of(script), null, -1L, calendarInterval, zoneId); + this(id, AggSource.of(script), null, null, -1L, calendarInterval, zoneId); } - private GroupByDateHistogram(String id, AggSource source, Direction direction, long fixedInterval, + private GroupByDateHistogram(String id, AggSource source, Direction direction, Missing missing, long fixedInterval, String calendarInterval, ZoneId zoneId) { - super(id, source, direction); + super(id, source, direction, missing); if (fixedInterval <= 0 && (calendarInterval == null || calendarInterval.isBlank())) { throw new SqlIllegalArgumentException("Either fixed interval or calendar interval needs to be specified"); } @@ -65,8 +66,8 @@ protected CompositeValuesSourceBuilder createSourceBuilder() { } @Override - protected GroupByKey copy(String id, AggSource source, Direction direction) { - return new GroupByDateHistogram(id, source(), direction, fixedInterval, calendarInterval, zoneId); + protected GroupByKey copy(String id, AggSource source, Direction direction, Missing missing) { + return new GroupByDateHistogram(id, source(), direction, missing, fixedInterval, calendarInterval, zoneId); } @Override diff --git a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/querydsl/agg/GroupByKey.java b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/querydsl/agg/GroupByKey.java index 48a70fccead24..ada3e94bfbdb4 100644 --- a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/querydsl/agg/GroupByKey.java +++ b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/querydsl/agg/GroupByKey.java @@ -10,6 +10,7 @@ import org.elasticsearch.search.aggregations.support.ValueType; import org.elasticsearch.xpack.ql.expression.gen.script.ScriptTemplate; import org.elasticsearch.xpack.ql.querydsl.container.Sort.Direction; +import org.elasticsearch.xpack.ql.querydsl.container.Sort.Missing; import org.elasticsearch.xpack.ql.type.DataTypes; import java.util.Objects; @@ -26,11 +27,13 @@ public abstract class GroupByKey extends Agg { protected final Direction direction; + private final Missing missing; - protected GroupByKey(String id, AggSource source, Direction direction) { + protected GroupByKey(String id, AggSource source, Direction direction, Missing missing) { super(id, source); // ASC is the default order of CompositeValueSource this.direction = direction == null ? Direction.ASC : direction; + this.missing = missing == null ? Missing.ANY : missing; } public ScriptTemplate script() { @@ -64,16 +67,22 @@ public final CompositeValuesSourceBuilder asValueSource() { else { builder.field(source().fieldName()); } - return builder.order(direction.asOrder()) - .missingBucket(true); + builder.order(direction.asOrder()) + .missingBucket(true); + + if (missing.aggregationOrder() != null) { + builder.missingOrder(missing.aggregationOrder()); + } + + return builder; } protected abstract CompositeValuesSourceBuilder createSourceBuilder(); - protected abstract GroupByKey copy(String id, AggSource source, Direction direction); + protected abstract GroupByKey copy(String id, AggSource source, Direction direction, Missing missing); - public GroupByKey with(Direction direction) { - return this.direction == direction ? this : copy(id(), source(), direction); + public GroupByKey with(Direction direction, Missing missing) { + return this.direction == direction && this.missing == missing ? this : copy(id(), source(), direction, missing); } @Override diff --git a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/querydsl/agg/GroupByNumericHistogram.java b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/querydsl/agg/GroupByNumericHistogram.java index e181b9a1bdfc6..911912dca04d4 100644 --- a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/querydsl/agg/GroupByNumericHistogram.java +++ b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/querydsl/agg/GroupByNumericHistogram.java @@ -10,6 +10,7 @@ import org.elasticsearch.search.aggregations.bucket.composite.HistogramValuesSourceBuilder; import org.elasticsearch.xpack.ql.expression.gen.script.ScriptTemplate; import org.elasticsearch.xpack.ql.querydsl.container.Sort.Direction; +import org.elasticsearch.xpack.ql.querydsl.container.Sort.Missing; import java.util.Objects; @@ -21,15 +22,15 @@ public class GroupByNumericHistogram extends GroupByKey { private final double interval; public GroupByNumericHistogram(String id, String fieldName, double interval) { - this(id, AggSource.of(fieldName), null, interval); + this(id, AggSource.of(fieldName), null, null, interval); } public GroupByNumericHistogram(String id, ScriptTemplate script, double interval) { - this(id, AggSource.of(script), null, interval); + this(id, AggSource.of(script), null, null, interval); } - private GroupByNumericHistogram(String id, AggSource aggSource, Direction direction, double interval) { - super(id, aggSource, direction); + private GroupByNumericHistogram(String id, AggSource aggSource, Direction direction, Missing missing, double interval) { + super(id, aggSource, direction, missing); this.interval = interval; } @@ -40,8 +41,8 @@ protected CompositeValuesSourceBuilder createSourceBuilder() { } @Override - protected GroupByKey copy(String id, AggSource source, Direction direction) { - return new GroupByNumericHistogram(id, source(), direction, interval); + protected GroupByKey copy(String id, AggSource source, Direction direction, Missing missing) { + return new GroupByNumericHistogram(id, source(), direction, missing, interval); } @Override diff --git a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/querydsl/agg/GroupByValue.java b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/querydsl/agg/GroupByValue.java index 2ea6e92aa1966..dec3c710709ba 100644 --- a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/querydsl/agg/GroupByValue.java +++ b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/querydsl/agg/GroupByValue.java @@ -10,6 +10,7 @@ import org.elasticsearch.search.aggregations.bucket.composite.TermsValuesSourceBuilder; import org.elasticsearch.xpack.ql.expression.gen.script.ScriptTemplate; import org.elasticsearch.xpack.ql.querydsl.container.Sort.Direction; +import org.elasticsearch.xpack.ql.querydsl.container.Sort.Missing; /** * GROUP BY key for fields or scripts. @@ -17,15 +18,15 @@ public class GroupByValue extends GroupByKey { public GroupByValue(String id, String fieldName) { - this(id, AggSource.of(fieldName), null); + this(id, AggSource.of(fieldName), null, null); } public GroupByValue(String id, ScriptTemplate script) { - this(id, AggSource.of(script), null); + this(id, AggSource.of(script), null, null); } - private GroupByValue(String id, AggSource source, Direction direction) { - super(id, source, direction); + private GroupByValue(String id, AggSource source, Direction direction, Missing missing) { + super(id, source, direction, missing); } @Override @@ -34,7 +35,7 @@ protected CompositeValuesSourceBuilder createSourceBuilder() { } @Override - protected GroupByKey copy(String id, AggSource source, Direction direction) { - return new GroupByValue(id, source(), direction); + protected GroupByKey copy(String id, AggSource source, Direction direction, Missing missing) { + return new GroupByValue(id, source(), direction, missing); } } diff --git a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/querydsl/agg/TopHitsAgg.java b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/querydsl/agg/TopHitsAgg.java index 07848eceea6b7..9f70badec6958 100644 --- a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/querydsl/agg/TopHitsAgg.java +++ b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/querydsl/agg/TopHitsAgg.java @@ -53,7 +53,7 @@ AggregationBuilder toBuilder() { if (sortSource.fieldName() != null) { sortBuilderList.add( new FieldSortBuilder(sortSource.fieldName()).order(sortOrder) - .missing(LAST.position()) + .missing(LAST.searchOrder()) .unmappedType(sortFieldDataType.esType()) ); } else if (sortSource.script() != null) { @@ -70,7 +70,7 @@ AggregationBuilder toBuilder() { if (source().fieldName() != null) { sortBuilderList.add( - new FieldSortBuilder(source().fieldName()).order(sortOrder).missing(LAST.position()).unmappedType(fieldDataType.esType()) + new FieldSortBuilder(source().fieldName()).order(sortOrder).missing(LAST.searchOrder()).unmappedType(fieldDataType.esType()) ); } else { sortBuilderList.add( diff --git a/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/planner/QueryFolderTests.java b/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/planner/QueryFolderTests.java index 238b59ce15652..65bd468f633ae 100644 --- a/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/planner/QueryFolderTests.java +++ b/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/planner/QueryFolderTests.java @@ -6,6 +6,8 @@ */ package org.elasticsearch.xpack.sql.planner; +import org.elasticsearch.core.Tuple; +import org.elasticsearch.search.aggregations.bucket.composite.MissingOrder; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.ql.expression.Expressions; import org.elasticsearch.xpack.ql.expression.ReferenceAttribute; @@ -32,6 +34,7 @@ import org.junit.AfterClass; import org.junit.BeforeClass; +import java.util.Arrays; import java.util.List; import java.util.Map; @@ -555,6 +558,56 @@ public void testFoldShadowedOrderBy() { assertEquals(Sort.Direction.DESC, as2.direction()); } + public void testFoldGroupByWithNullsOrdering() { + for (Tuple orderDirectiveWithExpectedMissing : Arrays.asList( + Tuple.tuple("", MissingOrder.DEFAULT), + Tuple.tuple("ASC", MissingOrder.DEFAULT), + Tuple.tuple("ASC NULLS FIRST", MissingOrder.FIRST), + Tuple.tuple("ASC NULLS LAST", MissingOrder.LAST), + Tuple.tuple("DESC", MissingOrder.DEFAULT), + Tuple.tuple("DESC NULLS FIRST", MissingOrder.FIRST), + Tuple.tuple("DESC NULLS LAST", MissingOrder.LAST) + )) { + PhysicalPlan p = plan( + "SELECT MAX(int), keyword FROM test GROUP BY keyword ORDER BY keyword " + orderDirectiveWithExpectedMissing.v1() + ); + + assertEquals(EsQueryExec.class, p.getClass()); + EsQueryExec ee = (EsQueryExec) p; + + assertEquals( + "Order directive [" + orderDirectiveWithExpectedMissing.v1() + "]", + orderDirectiveWithExpectedMissing.v2(), + ee.queryContainer().aggs().groups().get(0).asValueSource().missingOrder() + ); + } + } + + public void testFoldGroupByHistogramWithNullsOrdering() { + for (Tuple orderDirectiveWithExpectedMissing : Arrays.asList( + Tuple.tuple("", MissingOrder.DEFAULT), + Tuple.tuple("ASC", MissingOrder.DEFAULT), + Tuple.tuple("ASC NULLS FIRST", MissingOrder.FIRST), + Tuple.tuple("ASC NULLS LAST", MissingOrder.LAST), + Tuple.tuple("DESC", MissingOrder.DEFAULT), + Tuple.tuple("DESC NULLS FIRST", MissingOrder.FIRST), + Tuple.tuple("DESC NULLS LAST", MissingOrder.LAST) + )) { + PhysicalPlan p = plan( + "SELECT HISTOGRAM(int, 100) h FROM test GROUP BY h ORDER BY h " + orderDirectiveWithExpectedMissing.v1() + ); + + assertEquals(EsQueryExec.class, p.getClass()); + EsQueryExec ee = (EsQueryExec) p; + + assertEquals( + "Order directive [" + orderDirectiveWithExpectedMissing.v1() + "]", + orderDirectiveWithExpectedMissing.v2(), + ee.queryContainer().aggs().groups().get(0).asValueSource().missingOrder() + ); + } + } + private static String randomOrderByAndLimit(int noOfSelectArgs) { return SqlTestUtils.randomOrderByAndLimit(noOfSelectArgs, random()); } diff --git a/x-pack/plugin/sql/src/test/resources/org/elasticsearch/xpack/sql/planner/querytranslator_tests.txt b/x-pack/plugin/sql/src/test/resources/org/elasticsearch/xpack/sql/planner/querytranslator_tests.txt index 8183ceb6f1c11..1dbe95eba2144 100644 --- a/x-pack/plugin/sql/src/test/resources/org/elasticsearch/xpack/sql/planner/querytranslator_tests.txt +++ b/x-pack/plugin/sql/src/test/resources/org/elasticsearch/xpack/sql/planner/querytranslator_tests.txt @@ -265,6 +265,11 @@ SELECT MAX(int) FROM test GROUP BY HISTOGRAM(date, INTERVAL 2 YEARS); "date_histogram":{"field":"date","missing_bucket":true,"order":"asc","fixed_interval":"62208000000ms","time_zone":"Z"}}}]} ; +GroupByHistogramNullsLast +SELECT MAX(int) FROM test GROUP BY HISTOGRAM(date, INTERVAL 2 YEARS) ORDER BY HISTOGRAM(date, INTERVAL 2 YEARS) NULLS LAST; +"date_histogram":{"field":"date","missing_bucket":true,"missing_order":"last","order":"asc","fixed_interval":"62208000000ms","time_zone":"Z"}}}]} +; + GroupByHistogramWithScalars SELECT MAX(int), HISTOGRAM(date, INTERVAL 5 YEARS - INTERVAL 6 MONTHS) AS h FROM test @@ -363,7 +368,7 @@ GROUP BY CAST(ABS(EXTRACT(YEAR FROM date)) AS BIGINT) ORDER BY CAST(ABS(EXTRACT(YEAR FROM date)) AS BIGINT) NULLS FIRST; InternalSqlScriptUtils.cast(InternalSqlScriptUtils.abs(InternalSqlScriptUtils.dateTimeExtract(InternalQlScriptUtils.docValue(doc,params.v0),params.v1,params.v2)),params.v3) "params":{"v0":"date","v1":"Z","v2":"YEAR","v3":"LONG" -"missing_bucket":true +"missing_bucket":true,"missing_order":"first" "value_type":"long","order":"asc" ; @@ -374,7 +379,7 @@ GROUP BY "cast" ORDER BY "cast" NULLS FIRST; "InternalSqlScriptUtils.cast(InternalSqlScriptUtils.abs(InternalSqlScriptUtils.dateTimeExtract(InternalQlScriptUtils.docValue(doc,params.v0),params.v1,params.v2)),params.v3) "params":{"v0":"date","v1":"Z","v2":"YEAR","v3":"LONG"} -"missing_bucket":true +"missing_bucket":true,"missing_order":"first" "value_type":"long","order":"asc" ; @@ -385,7 +390,7 @@ GROUP BY 1 ORDER BY 1 NULLS FIRST; InternalSqlScriptUtils.cast(InternalSqlScriptUtils.abs(InternalSqlScriptUtils.dateTimeExtract(InternalQlScriptUtils.docValue(doc,params.v0),params.v1,params.v2)),params.v3) "params":{"v0":"date","v1":"Z","v2":"YEAR","v3":"LONG"} -"missing_bucket":true +"missing_bucket":true,"missing_order":"first" "value_type":"long","order":"asc" ; @@ -407,7 +412,7 @@ GROUP BY CONVERT(ABS(EXTRACT(YEAR FROM date)), SQL_BIGINT) ORDER BY CONVERT(ABS(EXTRACT(YEAR FROM date)), SQL_BIGINT) NULLS FIRST; InternalSqlScriptUtils.cast(InternalSqlScriptUtils.abs(InternalSqlScriptUtils.dateTimeExtract(InternalQlScriptUtils.docValue(doc,params.v0),params.v1,params.v2)),params.v3) "params":{"v0":"date","v1":"Z","v2":"YEAR","v3":"LONG"} -"missing_bucket":true +"missing_bucket":true,"missing_order":"first" "value_type":"long","order":"asc" ; @@ -428,7 +433,7 @@ GROUP BY "convert" ORDER BY "convert" NULLS FIRST; InternalSqlScriptUtils.cast(InternalSqlScriptUtils.abs(InternalSqlScriptUtils.dateTimeExtract(InternalQlScriptUtils.docValue(doc,params.v0),params.v1,params.v2)),params.v3) "params":{"v0":"date","v1":"Z","v2":"YEAR","v3":"LONG"} -"missing_bucket":true +"missing_bucket":true,"missing_order":"first" "value_type":"long","order":"asc" ; @@ -449,7 +454,7 @@ GROUP BY 1 ORDER BY 1 NULLS FIRST; InternalSqlScriptUtils.cast(InternalSqlScriptUtils.abs(InternalSqlScriptUtils.dateTimeExtract(InternalQlScriptUtils.docValue(doc,params.v0),params.v1,params.v2)),params.v3) "params":{"v0":"date","v1":"Z","v2":"YEAR","v3":"LONG"} -"missing_bucket":true +"missing_bucket":true,"missing_order":"first" "value_type":"long","order":"asc" ; From 2339ea5fcbbe3884f89f8783703a9f2fa86967d3 Mon Sep 17 00:00:00 2001 From: Yannick Welsch Date: Tue, 28 Sep 2021 12:08:35 +0200 Subject: [PATCH 026/250] Support request cache on frozen tier (#77694) The indices request cache is currently invalidated on the frozen tier after any search, making it completely useless. This commit fixes the situation by tying the lifecycle of the cache entry to the lifecycle of the shard instead of the underlying reader. --- .../index/ElasticsearchDirectoryReader.java | 39 ++++- .../index/engine/ReadOnlyEngine.java | 9 +- .../elasticsearch/index/shard/IndexShard.java | 5 + .../elasticsearch/indices/ESCacheHelper.java | 65 ++++++++ .../indices/IndicesRequestCache.java | 29 ++-- .../indices/IndicesRequestCacheUtils.java | 30 ++++ .../index/engine/frozen/FrozenEngine.java | 30 +++- .../FrozenSearchableSnapshotsIntegTests.java | 140 ++++++++++++++++++ 8 files changed, 327 insertions(+), 20 deletions(-) create mode 100644 server/src/main/java/org/elasticsearch/indices/ESCacheHelper.java create mode 100644 test/framework/src/main/java/org/elasticsearch/indices/IndicesRequestCacheUtils.java diff --git a/server/src/main/java/org/elasticsearch/common/lucene/index/ElasticsearchDirectoryReader.java b/server/src/main/java/org/elasticsearch/common/lucene/index/ElasticsearchDirectoryReader.java index 53750940380da..7d53ca958aa2c 100644 --- a/server/src/main/java/org/elasticsearch/common/lucene/index/ElasticsearchDirectoryReader.java +++ b/server/src/main/java/org/elasticsearch/common/lucene/index/ElasticsearchDirectoryReader.java @@ -11,8 +11,10 @@ import org.apache.lucene.index.FilterDirectoryReader; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.LeafReader; +import org.elasticsearch.core.Nullable; import org.elasticsearch.core.SuppressForbidden; import org.elasticsearch.index.shard.ShardId; +import org.elasticsearch.indices.ESCacheHelper; import java.io.IOException; @@ -24,12 +26,15 @@ public final class ElasticsearchDirectoryReader extends FilterDirectoryReader { private final ShardId shardId; private final FilterDirectoryReader.SubReaderWrapper wrapper; + @Nullable + private final ESCacheHelper esCacheHelper; private ElasticsearchDirectoryReader(DirectoryReader in, FilterDirectoryReader.SubReaderWrapper wrapper, - ShardId shardId) throws IOException { + ShardId shardId, @Nullable ESCacheHelper esCacheHelper) throws IOException { super(in, wrapper); this.wrapper = wrapper; this.shardId = shardId; + this.esCacheHelper = esCacheHelper; } /** @@ -47,7 +52,7 @@ public CacheHelper getReaderCacheHelper() { @Override protected DirectoryReader doWrapDirectoryReader(DirectoryReader in) throws IOException { - return new ElasticsearchDirectoryReader(in, wrapper, shardId); + return new ElasticsearchDirectoryReader(in, wrapper, shardId, esCacheHelper); } /** @@ -59,7 +64,35 @@ protected DirectoryReader doWrapDirectoryReader(DirectoryReader in) throws IOExc * @param shardId the shard ID to expose via the elasticsearch internal reader wrappers. */ public static ElasticsearchDirectoryReader wrap(DirectoryReader reader, ShardId shardId) throws IOException { - return new ElasticsearchDirectoryReader(reader, new SubReaderWrapper(shardId), shardId); + return wrap(reader, shardId, null); + } + + /** + * Wraps the given reader in a {@link ElasticsearchDirectoryReader} as + * well as all it's sub-readers in {@link ElasticsearchLeafReader} to + * expose the given shard Id. + * @param reader the reader to wrap + * @param shardId the shard ID to expose via the elasticsearch internal reader wrappers. + * @param esCacheHelper the custom {@link ESCacheHelper} implementation that doesn't tie + * its lifecycle to that of the underlying reader + */ + public static ElasticsearchDirectoryReader wrap(DirectoryReader reader, ShardId shardId, @Nullable ESCacheHelper esCacheHelper) + throws IOException { + return new ElasticsearchDirectoryReader(reader, new SubReaderWrapper(shardId), shardId, esCacheHelper); + } + + /** + * Retrieves Elasticsearch's version of the reader cache helper (see {@link ESCacheHelper}) + */ + public static ESCacheHelper getESReaderCacheHelper(DirectoryReader reader) { + ElasticsearchDirectoryReader esReader = getElasticsearchDirectoryReader(reader); + assert esReader != null; + // even though we assert that the reader is non-null, we are a bit lenient here, + // as falling back to the underlying cache helper does not affect correctness + if (esReader == null || esReader.esCacheHelper == null) { + return new ESCacheHelper.Wrapper(reader.getReaderCacheHelper()); + } + return esReader.esCacheHelper; } private static final class SubReaderWrapper extends FilterDirectoryReader.SubReaderWrapper { diff --git a/server/src/main/java/org/elasticsearch/index/engine/ReadOnlyEngine.java b/server/src/main/java/org/elasticsearch/index/engine/ReadOnlyEngine.java index 9ac33c4a901ce..2d652bb0feecc 100644 --- a/server/src/main/java/org/elasticsearch/index/engine/ReadOnlyEngine.java +++ b/server/src/main/java/org/elasticsearch/index/engine/ReadOnlyEngine.java @@ -25,6 +25,7 @@ import org.elasticsearch.common.lucene.Lucene; import org.elasticsearch.common.lucene.index.ElasticsearchDirectoryReader; import org.elasticsearch.common.util.concurrent.ReleasableLock; +import org.elasticsearch.core.Nullable; import org.elasticsearch.core.internal.io.IOUtils; import org.elasticsearch.index.mapper.DocumentParser; import org.elasticsearch.index.mapper.MappingLookup; @@ -36,6 +37,7 @@ import org.elasticsearch.index.translog.TranslogConfig; import org.elasticsearch.index.translog.TranslogDeletionPolicy; import org.elasticsearch.index.translog.TranslogStats; +import org.elasticsearch.indices.ESCacheHelper; import org.elasticsearch.search.suggest.completion.CompletionStats; import org.elasticsearch.transport.Transports; @@ -116,7 +118,7 @@ public ReadOnlyEngine(EngineConfig config, SeqNoStats seqNoStats, TranslogStats this.seqNoStats = seqNoStats; this.indexCommit = Lucene.getIndexCommit(lastCommittedSegmentInfos, directory); this.lazilyLoadSoftDeletes = lazilyLoadSoftDeletes; - reader = wrapReader(open(indexCommit), readerWrapperFunction); + reader = wrapReader(open(indexCommit), readerWrapperFunction, null); readerManager = new ElasticsearchReaderManager(reader); assert translogStats != null || obtainLock : "mutiple translogs instances should not be opened at the same time"; this.translogStats = translogStats != null ? translogStats : translogStats(config, lastCommittedSegmentInfos); @@ -193,9 +195,10 @@ public void verifyEngineBeforeIndexClosing() throws IllegalStateException { } protected final ElasticsearchDirectoryReader wrapReader(DirectoryReader reader, - Function readerWrapperFunction) throws IOException { + Function readerWrapperFunction, + @Nullable ESCacheHelper esCacheHelper) throws IOException { reader = readerWrapperFunction.apply(reader); - return ElasticsearchDirectoryReader.wrap(reader, engineConfig.getShardId()); + return ElasticsearchDirectoryReader.wrap(reader, engineConfig.getShardId(), esCacheHelper); } protected DirectoryReader open(IndexCommit commit) throws IOException { diff --git a/server/src/main/java/org/elasticsearch/index/shard/IndexShard.java b/server/src/main/java/org/elasticsearch/index/shard/IndexShard.java index 641bbde77c8ed..32cefdb43de01 100644 --- a/server/src/main/java/org/elasticsearch/index/shard/IndexShard.java +++ b/server/src/main/java/org/elasticsearch/index/shard/IndexShard.java @@ -3687,4 +3687,9 @@ public void verifyShardBeforeIndexClosing() throws IllegalStateException { RetentionLeaseSyncer getRetentionLeaseSyncer() { return retentionLeaseSyncer; } + + @Override + public String toString() { + return "IndexShard(shardRouting=" + shardRouting + ")"; + } } diff --git a/server/src/main/java/org/elasticsearch/indices/ESCacheHelper.java b/server/src/main/java/org/elasticsearch/indices/ESCacheHelper.java new file mode 100644 index 0000000000000..abf979c3f732d --- /dev/null +++ b/server/src/main/java/org/elasticsearch/indices/ESCacheHelper.java @@ -0,0 +1,65 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.indices; + +import org.apache.lucene.index.IndexReader; + +/** + * Cache helper that allows swapping in implementations that are different to Lucene's + * IndexReader.CacheHelper which ties its lifecycle to that of the underlying reader. + * + * For FrozenEngine, which opens / closes readers on-demand, we don't want caches + * to be invalidated as soon as a given search terminates, but want to tie the + * entry in the cache to the lifecycle of the shard. + */ +public interface ESCacheHelper { + + /** + * Get a key that the resource can be cached on. The given entry can be + * compared using identity, i.e., {@link Object#equals} is implemented as + * {@code ==} and {@link Object#hashCode} is implemented as + * {@link System#identityHashCode}. + */ + Object getKey(); + + + /** + * Adds a listener which will be called when the resource guarded + * by {@link #getKey()} is closed. + */ + void addClosedListener(ClosedListener listener); + + @FunctionalInterface + interface ClosedListener { + void onClose(Object key); + } + + /** + * Implementation of {@link ESCacheHelper} that wraps an {@link IndexReader.CacheHelper}. + */ + class Wrapper implements ESCacheHelper { + + private final IndexReader.CacheHelper cacheHelper; + + public Wrapper(IndexReader.CacheHelper cacheHelper) { + this.cacheHelper = cacheHelper; + } + + @Override + public Object getKey() { + return cacheHelper.getKey(); + } + + @Override + public void addClosedListener(ClosedListener listener) { + cacheHelper.addClosedListener(listener::onClose); + } + + } +} diff --git a/server/src/main/java/org/elasticsearch/indices/IndicesRequestCache.java b/server/src/main/java/org/elasticsearch/indices/IndicesRequestCache.java index fce85eaa29540..432f9fd9907b8 100644 --- a/server/src/main/java/org/elasticsearch/indices/IndicesRequestCache.java +++ b/server/src/main/java/org/elasticsearch/indices/IndicesRequestCache.java @@ -10,8 +10,8 @@ import com.carrotsearch.hppc.ObjectHashSet; import com.carrotsearch.hppc.ObjectSet; + import org.apache.lucene.index.DirectoryReader; -import org.apache.lucene.index.IndexReader; import org.apache.lucene.util.Accountable; import org.apache.lucene.util.RamUsageEstimator; import org.elasticsearch.common.CheckedSupplier; @@ -26,8 +26,8 @@ import org.elasticsearch.common.settings.Setting.Property; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.concurrent.ConcurrentCollections; +import org.elasticsearch.core.TimeValue; import org.elasticsearch.index.mapper.MappingLookup; import java.io.Closeable; @@ -100,18 +100,19 @@ public void onRemoval(RemovalNotification notification) { BytesReference getOrCompute(CacheEntity cacheEntity, CheckedSupplier loader, MappingLookup.CacheKey mappingCacheKey, DirectoryReader reader, BytesReference cacheKey) throws Exception { - assert reader.getReaderCacheHelper() != null; - final Key key = new Key(cacheEntity, mappingCacheKey, reader.getReaderCacheHelper().getKey(), cacheKey); + final ESCacheHelper cacheHelper = ElasticsearchDirectoryReader.getESReaderCacheHelper(reader); + assert cacheHelper != null; + final Key key = new Key(cacheEntity, mappingCacheKey, cacheHelper.getKey(), cacheKey); Loader cacheLoader = new Loader(cacheEntity, loader); BytesReference value = cache.computeIfAbsent(key, cacheLoader); if (cacheLoader.isLoaded()) { key.entity.onMiss(); // see if its the first time we see this reader, and make sure to register a cleanup key - CleanupKey cleanupKey = new CleanupKey(cacheEntity, reader.getReaderCacheHelper().getKey()); + CleanupKey cleanupKey = new CleanupKey(cacheEntity, cacheHelper.getKey()); if (registeredClosedListeners.containsKey(cleanupKey) == false) { Boolean previous = registeredClosedListeners.putIfAbsent(cleanupKey, Boolean.TRUE); if (previous == null) { - ElasticsearchDirectoryReader.addReaderCloseListener(reader, cleanupKey); + cacheHelper.addClosedListener(cleanupKey); } } /* @@ -207,10 +208,10 @@ static class Key implements Accountable { public final CacheEntity entity; // use as identity equality public final MappingLookup.CacheKey mappingCacheKey; - public final IndexReader.CacheKey readerCacheKey; + public final Object readerCacheKey; public final BytesReference value; - Key(CacheEntity entity, MappingLookup.CacheKey mappingCacheKey, IndexReader.CacheKey readerCacheKey, BytesReference value) { + Key(CacheEntity entity, MappingLookup.CacheKey mappingCacheKey, Object readerCacheKey, BytesReference value) { this.entity = entity; this.mappingCacheKey = Objects.requireNonNull(mappingCacheKey); this.readerCacheKey = Objects.requireNonNull(readerCacheKey); @@ -263,17 +264,17 @@ public String toString() { } } - private class CleanupKey implements IndexReader.ClosedListener { + private class CleanupKey implements ESCacheHelper.ClosedListener { final CacheEntity entity; - final IndexReader.CacheKey readerCacheKey; + final Object readerCacheKey; - private CleanupKey(CacheEntity entity, IndexReader.CacheKey readerCacheKey) { + private CleanupKey(CacheEntity entity, Object readerCacheKey) { this.entity = entity; this.readerCacheKey = readerCacheKey; } @Override - public void onClose(IndexReader.CacheKey cacheKey) { + public void onClose(Object cacheKey) { Boolean remove = registeredClosedListeners.remove(this); if (remove != null) { keysToClean.add(this); @@ -341,6 +342,10 @@ int count() { return cache.count(); } + Iterable cachedKeys() { + return cache.keys(); + } + int numRegisteredCloseListeners() { // for testing return registeredClosedListeners.size(); } diff --git a/test/framework/src/main/java/org/elasticsearch/indices/IndicesRequestCacheUtils.java b/test/framework/src/main/java/org/elasticsearch/indices/IndicesRequestCacheUtils.java new file mode 100644 index 0000000000000..c06fd1af6a09f --- /dev/null +++ b/test/framework/src/main/java/org/elasticsearch/indices/IndicesRequestCacheUtils.java @@ -0,0 +1,30 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.indices; + +import java.util.stream.Collectors; +import java.util.stream.StreamSupport; + +public class IndicesRequestCacheUtils { + private IndicesRequestCacheUtils() { + // no instances of this class should be created + } + + public static IndicesRequestCache getRequestCache(IndicesService indicesService) { + return indicesService.indicesRequestCache; + } + + public static Iterable cachedKeys(IndicesRequestCache cache) { + return StreamSupport.stream(cache.cachedKeys().spliterator(), false).map(Object::toString).collect(Collectors.toList()); + } + + public static void cleanCache(IndicesRequestCache cache) { + cache.cleanCache(); + } +} diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/index/engine/frozen/FrozenEngine.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/index/engine/frozen/FrozenEngine.java index 0402b39f1451b..34ad2fc7e6b04 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/index/engine/frozen/FrozenEngine.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/index/engine/frozen/FrozenEngine.java @@ -15,10 +15,10 @@ import org.apache.lucene.index.SegmentReader; import org.apache.lucene.search.ReferenceManager; import org.apache.lucene.store.Directory; -import org.elasticsearch.core.SuppressForbidden; import org.elasticsearch.common.lucene.Lucene; import org.elasticsearch.common.lucene.index.ElasticsearchDirectoryReader; import org.elasticsearch.common.settings.Setting; +import org.elasticsearch.core.SuppressForbidden; import org.elasticsearch.core.internal.io.IOUtils; import org.elasticsearch.index.engine.Engine; import org.elasticsearch.index.engine.EngineConfig; @@ -29,9 +29,14 @@ import org.elasticsearch.index.shard.DocsStats; import org.elasticsearch.index.store.Store; import org.elasticsearch.index.translog.TranslogStats; +import org.elasticsearch.indices.ESCacheHelper; +import java.io.Closeable; import java.io.IOException; import java.io.UncheckedIOException; +import java.util.Objects; +import java.util.Set; +import java.util.concurrent.CopyOnWriteArraySet; import java.util.concurrent.CountDownLatch; import java.util.function.Function; @@ -53,6 +58,8 @@ public final class FrozenEngine extends ReadOnlyEngine { private final DocsStats docsStats; private volatile ElasticsearchDirectoryReader lastOpenedReader; private final ElasticsearchDirectoryReader canMatchReader; + private final Object cacheIdentity = new Object(); + private final Set closedListeners = new CopyOnWriteArraySet<>(); public FrozenEngine(EngineConfig config, boolean requireCompleteHistory, boolean lazilyLoadSoftDeletes) { this(config, null, null, true, Function.identity(), requireCompleteHistory, lazilyLoadSoftDeletes); @@ -161,7 +168,17 @@ private synchronized ElasticsearchDirectoryReader getOrOpenReader() throws IOExc listeners.beforeRefresh(); } final DirectoryReader dirReader = openDirectory(engineConfig.getStore().directory()); - reader = lastOpenedReader = wrapReader(dirReader, Function.identity()); + reader = lastOpenedReader = wrapReader(dirReader, Function.identity(), new ESCacheHelper() { + @Override + public Object getKey() { + return cacheIdentity; + } + + @Override + public void addClosedListener(ClosedListener listener) { + closedListeners.add(Objects.requireNonNull(listener)); + } + }); reader.getReaderCacheHelper().addClosedListener(this::onReaderClosed); for (ReferenceManager.RefreshListener listeners : config().getInternalRefreshListener()) { listeners.afterRefresh(true); @@ -264,7 +281,16 @@ public SegmentsStats segmentsStats(boolean includeSegmentFileSizes, boolean incl } else { return super.segmentsStats(includeSegmentFileSizes, includeUnloadedSegments); } + } + @Override + protected void closeNoLock(String reason, CountDownLatch closedLatch) { + super.closeNoLock(reason, closedLatch); + synchronized(closedListeners) { + IOUtils.closeWhileHandlingException( + closedListeners.stream().map(t -> (Closeable) () -> t.onClose(cacheIdentity))::iterator); + closedListeners.clear(); + } } @Override diff --git a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/FrozenSearchableSnapshotsIntegTests.java b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/FrozenSearchableSnapshotsIntegTests.java index 7feeed718ef8f..264dcfdca2a66 100644 --- a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/FrozenSearchableSnapshotsIntegTests.java +++ b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/FrozenSearchableSnapshotsIntegTests.java @@ -19,6 +19,9 @@ import org.elasticsearch.action.admin.indices.shrink.ResizeType; import org.elasticsearch.action.admin.indices.stats.IndicesStatsResponse; import org.elasticsearch.action.admin.indices.stats.ShardStats; +import org.elasticsearch.action.search.SearchResponse; +import org.elasticsearch.action.search.SearchType; +import org.elasticsearch.client.Client; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.routing.ShardRouting; @@ -33,11 +36,16 @@ import org.elasticsearch.index.IndexModule; import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.index.IndexSettings; +import org.elasticsearch.index.cache.request.RequestCacheStats; import org.elasticsearch.index.shard.IndexLongFieldRange; import org.elasticsearch.index.store.Store; import org.elasticsearch.index.store.StoreStats; import org.elasticsearch.indices.IndexClosedException; +import org.elasticsearch.indices.IndicesRequestCache; +import org.elasticsearch.indices.IndicesRequestCacheUtils; import org.elasticsearch.indices.IndicesService; +import org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramInterval; +import org.elasticsearch.search.aggregations.bucket.histogram.Histogram; import org.elasticsearch.snapshots.SnapshotInfo; import org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider; import org.elasticsearch.xpack.core.DataTier; @@ -47,6 +55,7 @@ import org.elasticsearch.xpack.searchablesnapshots.action.SearchableSnapshotsStatsAction; import org.elasticsearch.xpack.searchablesnapshots.action.SearchableSnapshotsStatsRequest; +import java.time.ZoneId; import java.util.Arrays; import java.util.Collections; import java.util.List; @@ -57,13 +66,17 @@ import static org.elasticsearch.index.IndexSettings.INDEX_SOFT_DELETES_SETTING; import static org.elasticsearch.index.query.QueryBuilders.matchQuery; +import static org.elasticsearch.search.aggregations.AggregationBuilders.dateHistogram; import static org.elasticsearch.snapshots.SearchableSnapshotsSettings.SEARCHABLE_SNAPSHOT_STORE_TYPE; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; +import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse; import static org.elasticsearch.xpack.searchablesnapshots.SearchableSnapshots.SNAPSHOT_RECOVERY_STATE_FACTORY_KEY; import static org.hamcrest.Matchers.arrayWithSize; +import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.greaterThan; import static org.hamcrest.Matchers.instanceOf; +import static org.hamcrest.Matchers.not; import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.Matchers.oneOf; import static org.hamcrest.Matchers.sameInstance; @@ -448,4 +461,131 @@ public void testCreateAndRestorePartialSearchableSnapshot() throws Exception { assertTotalHits(aliasName, originalAllHits, originalBarHits); } + public void testRequestCacheOnFrozen() throws Exception { + assertAcked( + client().admin() + .indices() + .prepareCreate("test-index") + .setMapping("f", "type=date") + .setSettings( + Settings.builder() + .put(IndicesRequestCache.INDEX_CACHE_REQUEST_ENABLED_SETTING.getKey(), true) + .put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1) + .put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0) + ) + .get() + ); + indexRandom( + true, + client().prepareIndex("test-index").setSource("f", "2014-03-10T00:00:00.000Z"), + client().prepareIndex("test-index").setSource("f", "2014-05-13T00:00:00.000Z") + ); + ensureSearchable("test-index"); + + createRepository("repo", "fs", Settings.builder().put("location", randomRepoPath())); + + createFullSnapshot("repo", "snap"); + + assertAcked(client().admin().indices().prepareDelete("test-index")); + + logger.info("--> restoring index [{}]", "test-index"); + + Settings.Builder indexSettingsBuilder = Settings.builder().put(SearchableSnapshots.SNAPSHOT_CACHE_ENABLED_SETTING.getKey(), true); + final MountSearchableSnapshotRequest req = new MountSearchableSnapshotRequest( + "test-index", + "repo", + "snap", + "test-index", + indexSettingsBuilder.build(), + Strings.EMPTY_ARRAY, + true, + MountSearchableSnapshotRequest.Storage.SHARED_CACHE + ); + + final RestoreSnapshotResponse restoreSnapshotResponse = client().execute(MountSearchableSnapshotAction.INSTANCE, req).get(); + assertThat(restoreSnapshotResponse.getRestoreInfo().failedShards(), equalTo(0)); + ensureSearchable("test-index"); + + // use a fixed client for the searches, as clients randomize timeouts, which leads to different cache entries + Client client = client(); + + final SearchResponse r1 = client.prepareSearch("test-index") + .setSize(0) + .setSearchType(SearchType.QUERY_THEN_FETCH) + .addAggregation( + dateHistogram("histo").field("f").timeZone(ZoneId.of("+01:00")).minDocCount(0).calendarInterval(DateHistogramInterval.MONTH) + ) + .get(); + assertSearchResponse(r1); + + assertRequestCacheState(client(), "test-index", 0, 1); + + // The cached is actually used + assertThat( + client().admin() + .indices() + .prepareStats("test-index") + .setRequestCache(true) + .get() + .getTotal() + .getRequestCache() + .getMemorySizeInBytes(), + greaterThan(0L) + ); + + for (int i = 0; i < 10; ++i) { + final SearchResponse r2 = client.prepareSearch("test-index") + .setSize(0) + .setSearchType(SearchType.QUERY_THEN_FETCH) + .addAggregation( + dateHistogram("histo").field("f") + .timeZone(ZoneId.of("+01:00")) + .minDocCount(0) + .calendarInterval(DateHistogramInterval.MONTH) + ) + .get(); + assertSearchResponse(r2); + assertRequestCacheState(client(), "test-index", i + 1, 1); + Histogram h1 = r1.getAggregations().get("histo"); + Histogram h2 = r2.getAggregations().get("histo"); + final List buckets1 = h1.getBuckets(); + final List buckets2 = h2.getBuckets(); + assertEquals(buckets1.size(), buckets2.size()); + for (int j = 0; j < buckets1.size(); ++j) { + final Histogram.Bucket b1 = buckets1.get(j); + final Histogram.Bucket b2 = buckets2.get(j); + assertEquals(b1.getKey(), b2.getKey()); + assertEquals(b1.getDocCount(), b2.getDocCount()); + } + } + + // shut down shard and check that cache entries are actually removed + client().admin().indices().prepareClose("test-index").get(); + ensureGreen("test-index"); + + for (IndicesService indicesService : internalCluster().getInstances(IndicesService.class)) { + IndicesRequestCache indicesRequestCache = IndicesRequestCacheUtils.getRequestCache(indicesService); + IndicesRequestCacheUtils.cleanCache(indicesRequestCache); + for (String key : IndicesRequestCacheUtils.cachedKeys(indicesRequestCache)) { + assertThat(key, not(containsString("test-index"))); + } + } + } + + private static void assertRequestCacheState(Client client, String index, long expectedHits, long expectedMisses) { + RequestCacheStats requestCacheStats = client.admin() + .indices() + .prepareStats(index) + .setRequestCache(true) + .get() + .getTotal() + .getRequestCache(); + // Check the hit count and miss count together so if they are not + // correct we can see both values + assertEquals( + Arrays.asList(expectedHits, expectedMisses, 0L), + Arrays.asList(requestCacheStats.getHitCount(), requestCacheStats.getMissCount(), requestCacheStats.getEvictions()) + ); + } + } From 2d6f6b6421c7f3899c5d83c69cc88e296512c006 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20Zolt=C3=A1n=20Szab=C3=B3?= Date: Tue, 28 Sep 2021 12:30:12 +0200 Subject: [PATCH 027/250] [DOCS] Removes new HLRC section from Java REST Client book. (#78368) --- docs/java-rest/index.asciidoc | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/java-rest/index.asciidoc b/docs/java-rest/index.asciidoc index 2877431bcb3f3..9fc15fd69c89b 100644 --- a/docs/java-rest/index.asciidoc +++ b/docs/java-rest/index.asciidoc @@ -11,6 +11,4 @@ include::low-level/index.asciidoc[] include::high-level/index.asciidoc[] -include::{elasticsearch-java-root}/docs/index.asciidoc[] - include::redirects.asciidoc[] \ No newline at end of file From dfd65beaf66968b8b3d49ee5062a885cf7f40da0 Mon Sep 17 00:00:00 2001 From: Hendrik Muhs Date: Tue, 28 Sep 2021 13:15:52 +0200 Subject: [PATCH 028/250] [Transform] fix version check for beta transforms (#78364) fix the version check for deprecated beta transforms, this was introduced in #77565, but contained a typo (7.15 instead of 7.5) --- .../transform/transforms/TransformConfig.java | 8 +++---- .../transforms/TransformConfigTests.java | 24 ++++++++++++++++++- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformConfig.java index 06de022e507b8..05bce04b3f3ee 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformConfig.java @@ -371,14 +371,14 @@ public List checkForDeprecations(NamedXContentRegistry namedXC List deprecations = new ArrayList<>(); - // V_8_0_0 deprecate beta transforms - if (getVersion() == null || getVersion().before(Version.V_7_15_0)) { + // deprecate beta transforms + if (getVersion() == null || getVersion().before(Version.V_7_5_0)) { deprecations.add( new DeprecationIssue( - Level.CRITICAL, // change to WARNING for 7.x + Level.CRITICAL, "Transform [" + id + "] is too old", TransformDeprecations.BREAKING_CHANGES_BASE_URL, - "The configuration uses an old format, you can use [_update] or [_upgrade] to update to configuration", + "The configuration uses an old format, you can use [_update] or [_upgrade] to update", false, null ) diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformConfigTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformConfigTests.java index 3d3b54d9c59c9..20d0c7b6114a5 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformConfigTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformConfigTests.java @@ -724,6 +724,28 @@ public void testCheckForDeprecations() { ) ); + deprecatedConfig = randomTransformConfigWithDeprecatedFields(id, Version.V_7_10_0); + + // check _and_ clear warnings + assertWarnings("[max_page_search_size] is deprecated inside pivot please use settings instead"); + + // important: checkForDeprecations does _not_ create new deprecation warnings + assertThat( + deprecatedConfig.checkForDeprecations(xContentRegistry()), + equalTo( + List.of( + new DeprecationIssue( + Level.WARNING, + "Transform [" + id + "] uses deprecated max_page_search_size", + "https://www.elastic.co/guide/en/elasticsearch/reference/master/migrating-8.0.html", + "[max_page_search_size] is deprecated inside pivot please use settings instead", + false, + null + ) + ) + ) + ); + deprecatedConfig = randomTransformConfigWithDeprecatedFields(id, Version.V_7_4_0); // check _and_ clear warnings @@ -738,7 +760,7 @@ public void testCheckForDeprecations() { Level.CRITICAL, "Transform [" + id + "] is too old", "https://www.elastic.co/guide/en/elasticsearch/reference/master/migrating-8.0.html", - "The configuration uses an old format, you can use [_update] or [_upgrade] to update to configuration", + "The configuration uses an old format, you can use [_update] or [_upgrade] to update", false, null ), From 1764fa0e8f98da6f6583b4183192bd7bb851db37 Mon Sep 17 00:00:00 2001 From: James Rodewig <40268737+jrodewig@users.noreply.github.com> Date: Tue, 28 Sep 2021 08:44:06 -0400 Subject: [PATCH 029/250] [DOCS] Remove `type` query (#78334) Adds an 8.0 breaking change for PR #47207. --- docs/reference/migration/migrate_8_0/search.asciidoc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/reference/migration/migrate_8_0/search.asciidoc b/docs/reference/migration/migrate_8_0/search.asciidoc index 20764fe968bae..7a5459d4f4481 100644 --- a/docs/reference/migration/migrate_8_0/search.asciidoc +++ b/docs/reference/migration/migrate_8_0/search.asciidoc @@ -234,4 +234,15 @@ been removed in 8.0.0. This parameter is a no-op and has no effect on the query. Discontinue use of the `type` parameter. `geo_bounding_box` queries that include this parameter will return an error. ==== + +.The `type` query has been removed. +[%collapsible] +==== +*Details* + +The `type` query has been removed. Mapping types have been removed in 8.0. + +*Impact* + +Discontinue use of the `type` query. Requests that include the `type` query +will return an error. +==== //end::notable-breaking-changes[] From 0c01bcdd9f175061f30c67be813a60a719bcff19 Mon Sep 17 00:00:00 2001 From: James Rodewig <40268737+jrodewig@users.noreply.github.com> Date: Tue, 28 Sep 2021 08:44:25 -0400 Subject: [PATCH 030/250] [DOCS] Remove index API's `types` option (#78335) Adds an 8.0 breaking change for PR #47203. --- .../migration/migrate_8_0/indices.asciidoc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/reference/migration/migrate_8_0/indices.asciidoc b/docs/reference/migration/migrate_8_0/indices.asciidoc index 2bfa618fbbf77..b04c34e392205 100644 --- a/docs/reference/migration/migrate_8_0/indices.asciidoc +++ b/docs/reference/migration/migrate_8_0/indices.asciidoc @@ -116,4 +116,17 @@ index setting]. Accept the new behaviour, or specify `?wait_for_active_shards=0` to preserve the old behaviour if needed. ==== + +.The index stats API's `types` query parameter has been removed. +[%collapsible] +==== +*Details* + +The index stats API's `types` query parameter has been removed. Previously, you +could combine `types` with the `indexing` query parameter to return indexing +stats for specific mapping types. Mapping types have been removed in 8.0. + +*Impact* + +Discontinue use of the `types` query parameter. Requests that include the +parameter will return an error. +==== //end::notable-breaking-changes[] From 485e7deaa06d014c5224615514974712d37a84c1 Mon Sep 17 00:00:00 2001 From: James Rodewig <40268737+jrodewig@users.noreply.github.com> Date: Tue, 28 Sep 2021 09:20:45 -0400 Subject: [PATCH 031/250] [DOCS] Re-add docs for multiple data paths (MDP) (#78342) We deprecated support for multiple data paths (MDP) in 7.13. However, we won't remove support until after 8.0. Changes: * Reverts PR #72267, which removed MDP docs * Removes a related item from the 8.0 breaking changes. --- docs/reference/commands/node-tool.asciidoc | 6 +- .../migration/migrate_8_0/node.asciidoc | 97 ---------------- .../important-settings/path-settings.asciidoc | 109 ++++++++++++++++++ .../multi-data-path-widget.asciidoc | 39 +++++++ .../tab-widgets/multi-data-path.asciidoc | 26 +++++ 5 files changed, 177 insertions(+), 100 deletions(-) create mode 100644 docs/reference/tab-widgets/multi-data-path-widget.asciidoc create mode 100644 docs/reference/tab-widgets/multi-data-path.asciidoc diff --git a/docs/reference/commands/node-tool.asciidoc b/docs/reference/commands/node-tool.asciidoc index d44d3fae34b5a..4582d9b2b7caa 100644 --- a/docs/reference/commands/node-tool.asciidoc +++ b/docs/reference/commands/node-tool.asciidoc @@ -137,10 +137,10 @@ repaired. If the cluster is still available then you can start up a fresh node on another host and {es} will bring this node into the cluster in place of the failed node. -Each node stores its data in the data directory defined by the +Each node stores its data in the data directories defined by the <>. This means that in a disaster you can -also restart a node by moving its data directory to another host, presuming -that that data directory can be recovered from the faulty host. +also restart a node by moving its data directories to another host, presuming +that those data directories can be recovered from the faulty host. {es} <> in order to elect a master and to update the cluster diff --git a/docs/reference/migration/migrate_8_0/node.asciidoc b/docs/reference/migration/migrate_8_0/node.asciidoc index 58b730bc28e32..f5b09bffa440c 100644 --- a/docs/reference/migration/migrate_8_0/node.asciidoc +++ b/docs/reference/migration/migrate_8_0/node.asciidoc @@ -46,103 +46,6 @@ all the corresponding subfolders in parallel. Each node uses the same subfolder (e.g. `nodes/2`) across all its data paths. ==== -.Support for multiple data paths has been removed. -[%collapsible] -==== -*Details* + -In earlier versions the `path.data` setting accepted a list of data paths, but -if you specified multiple paths then the behaviour was unintuitive and usually -did not give the desired outcomes. Support for multiple data paths is now -removed. - -*Impact* + -Specify a single path in `path.data`. If needed, you can create a filesystem -which spans multiple disks with a hardware virtualisation layer such as RAID, -or a software virtualisation layer such as Logical Volume Manager (LVM) on -Linux or Storage Spaces on Windows. If you wish to use multiple data paths on a -single machine then you must run one node for each data path. - -If you currently use multiple data paths in a -{ref}/high-availability-cluster-design.html[highly available cluster] then you -can migrate to a setup that uses a single path for each node without downtime -using a process similar to a -{ref}/restart-cluster.html#restart-cluster-rolling[rolling restart]: shut each -node down in turn and replace it with one or more nodes each configured to use -a single data path. In more detail, for each node that currently has multiple -data paths you should follow the following process. In principle you can -perform this migration during a rolling upgrade to 8.0, but we recommend -migrating to a single-data-path setup before starting to upgrade. - -1. Take a snapshot to protect your data in case of disaster. - -2. Optionally, migrate the data away from the target node by using an -{ref}/modules-cluster.html#cluster-shard-allocation-filtering[allocation filter]: -+ -[source,console] --------------------------------------------------- -PUT _cluster/settings -{ - "transient": { - "cluster.routing.allocation.exclude._name": "target-node-name" - } -} --------------------------------------------------- -+ -You can use the {ref}/cat-allocation.html[cat allocation API] to track progress -of this data migration. If some shards do not migrate then the -{ref}/cluster-allocation-explain.html[cluster allocation explain API] will help -you to determine why. - -3. Follow the steps in the -{ref}/restart-cluster.html#restart-cluster-rolling[rolling restart process] -up to and including shutting the target node down. - -4. Ensure your cluster health is `yellow` or `green`, so that there is a copy -of every shard assigned to at least one of the other nodes in your cluster. - -5. If applicable, remove the allocation filter applied in the earlier step. -+ -[source,console] --------------------------------------------------- -PUT _cluster/settings -{ - "transient": { - "cluster.routing.allocation.exclude._name": null - } -} --------------------------------------------------- - -6. Discard the data held by the stopped node by deleting the contents of its -data paths. - -7. Reconfigure your storage. For instance, combine your disks into a single -filesystem using LVM or Storage Spaces. Ensure that your reconfigured storage -has sufficient space for the data that it will hold. - -8. Reconfigure your node by adjusting the `path.data` setting in its -`elasticsearch.yml` file. If needed, install more nodes each with their own -`path.data` setting pointing at a separate data path. - -9. Start the new nodes and follow the rest of the -{ref}/restart-cluster.html#restart-cluster-rolling[rolling restart process] for -them. - -10. Ensure your cluster health is `green`, so that every shard has been -assigned. - -You can alternatively add some number of single-data-path nodes to your -cluster, migrate all your data over to these new nodes using -{ref}/modules-cluster.html#cluster-shard-allocation-filtering[allocation filters], -and then remove the old nodes from the cluster. This approach will temporarily -double the size of your cluster so it will only work if you have the capacity to -expand your cluster like this. - -If you currently use multiple data paths but your cluster is not highly -available then the you can migrate to a non-deprecated configuration by taking -a snapshot, creating a new cluster with the desired configuration and restoring -the snapshot into it. -==== - .Closed indices created in {es} 6.x and earlier versions are not supported. [%collapsible] ==== diff --git a/docs/reference/setup/important-settings/path-settings.asciidoc b/docs/reference/setup/important-settings/path-settings.asciidoc index 2ecb5e377794b..c3a4558335917 100644 --- a/docs/reference/setup/important-settings/path-settings.asciidoc +++ b/docs/reference/setup/important-settings/path-settings.asciidoc @@ -26,3 +26,112 @@ Supported `path.data` and `path.logs` values vary by platform: include::{es-repo-dir}/tab-widgets/code.asciidoc[] include::{es-repo-dir}/tab-widgets/customize-data-log-path-widget.asciidoc[] + +[discrete] +==== Multiple data paths +deprecated::[7.13.0] + +If needed, you can specify multiple paths in `path.data`. {es} stores the node's +data across all provided paths but keeps each shard's data on the same path. + +{es} does not balance shards across a node's data paths. High disk +usage in a single path can trigger a <> for the entire node. If triggered, {es} will not add shards to +the node, even if the node’s other paths have available disk space. If you need +additional disk space, we recommend you add a new node rather than additional +data paths. + +include::{es-repo-dir}/tab-widgets/multi-data-path-widget.asciidoc[] + +[discrete] +[[mdp-migrate]] +==== Migrate from multiple data paths + +Support for multiple data paths was deprecated in 7.13 and will be removed +in a future release. + +As an alternative to multiple data paths, you can create a filesystem which +spans multiple disks with a hardware virtualisation layer such as RAID, or a +software virtualisation layer such as Logical Volume Manager (LVM) on Linux or +Storage Spaces on Windows. If you wish to use multiple data paths on a single +machine then you must run one node for each data path. + +If you currently use multiple data paths in a +{ref}/high-availability-cluster-design.html[highly available cluster] then you +can migrate to a setup that uses a single path for each node without downtime +using a process similar to a +{ref}/restart-cluster.html#restart-cluster-rolling[rolling restart]: shut each +node down in turn and replace it with one or more nodes each configured to use +a single data path. In more detail, for each node that currently has multiple +data paths you should follow the following process. In principle you can +perform this migration during a rolling upgrade to 8.0, but we recommend +migrating to a single-data-path setup before starting to upgrade. + +1. Take a snapshot to protect your data in case of disaster. + +2. Optionally, migrate the data away from the target node by using an +{ref}/modules-cluster.html#cluster-shard-allocation-filtering[allocation filter]: ++ +[source,console] +-------------------------------------------------- +PUT _cluster/settings +{ + "transient": { + "cluster.routing.allocation.exclude._name": "target-node-name" + } +} +-------------------------------------------------- ++ +You can use the {ref}/cat-allocation.html[cat allocation API] to track progress +of this data migration. If some shards do not migrate then the +{ref}/cluster-allocation-explain.html[cluster allocation explain API] will help +you to determine why. + +3. Follow the steps in the +{ref}/restart-cluster.html#restart-cluster-rolling[rolling restart process] +up to and including shutting the target node down. + +4. Ensure your cluster health is `yellow` or `green`, so that there is a copy +of every shard assigned to at least one of the other nodes in your cluster. + +5. If applicable, remove the allocation filter applied in the earlier step. ++ +[source,console] +-------------------------------------------------- +PUT _cluster/settings +{ + "transient": { + "cluster.routing.allocation.exclude._name": null + } +} +-------------------------------------------------- + +6. Discard the data held by the stopped node by deleting the contents of its +data paths. + +7. Reconfigure your storage. For instance, combine your disks into a single +filesystem using LVM or Storage Spaces. Ensure that your reconfigured storage +has sufficient space for the data that it will hold. + +8. Reconfigure your node by adjusting the `path.data` setting in its +`elasticsearch.yml` file. If needed, install more nodes each with their own +`path.data` setting pointing at a separate data path. + +9. Start the new nodes and follow the rest of the +{ref}/restart-cluster.html#restart-cluster-rolling[rolling restart process] for +them. + +10. Ensure your cluster health is `green`, so that every shard has been +assigned. + +You can alternatively add some number of single-data-path nodes to your +cluster, migrate all your data over to these new nodes using +{ref}/modules-cluster.html#cluster-shard-allocation-filtering[allocation filters], +and then remove the old nodes from the cluster. This approach will temporarily +double the size of your cluster so it will only work if you have the capacity to +expand your cluster like this. + +If you currently use multiple data paths but your cluster is not highly +available then the you can migrate to a non-deprecated configuration by taking +a snapshot, creating a new cluster with the desired configuration and restoring +the snapshot into it. diff --git a/docs/reference/tab-widgets/multi-data-path-widget.asciidoc b/docs/reference/tab-widgets/multi-data-path-widget.asciidoc new file mode 100644 index 0000000000000..f665e7a1cc912 --- /dev/null +++ b/docs/reference/tab-widgets/multi-data-path-widget.asciidoc @@ -0,0 +1,39 @@ +++++ +

+
+ + +
+
+++++ + +include::multi-data-path.asciidoc[tag=unix] + +++++ +
+ +
+++++ \ No newline at end of file diff --git a/docs/reference/tab-widgets/multi-data-path.asciidoc b/docs/reference/tab-widgets/multi-data-path.asciidoc new file mode 100644 index 0000000000000..0a63c7791f66c --- /dev/null +++ b/docs/reference/tab-widgets/multi-data-path.asciidoc @@ -0,0 +1,26 @@ +// tag::unix[] +Linux and macOS installations support multiple Unix-style paths in `path.data`: + +[source,yaml] +---- +path: + data: + - /mnt/elasticsearch_1 + - /mnt/elasticsearch_2 + - /mnt/elasticsearch_3 +---- +// end::unix[] + + +// tag::win[] +Windows installations support multiple DOS paths in `path.data`: + +[source,yaml] +---- +path: + data: + - "C:\\Elastic\\Elasticsearch_1" + - "E:\\Elastic\\Elasticsearch_1" + - "F:\\Elastic\\Elasticsearch_3" +---- +// end::win[] From 408489310cd5796e78f155205b94fe0243d85af3 Mon Sep 17 00:00:00 2001 From: Benjamin Trent Date: Tue, 28 Sep 2021 09:38:23 -0400 Subject: [PATCH 032/250] [ML] add zero_shot_classification task for BERT nlp models (#77799) Zero-Shot classification allows for text classification tasks without a pre-trained collection of target labels. This is achieved through models trained on the Multi-Genre Natural Language Inference (MNLI) dataset. This dataset pairs text sequences with "entailment" clauses. An example could be: "Throughout all of history, man kind has shown itself resourceful, yet astoundingly short-sighted" could have been paired with the entailment clauses: ["This example is history", "This example is sociology"...]. This training set combined with the attention and semantic knowledge in modern day NLP models (BERT, BART, etc.) affords a powerful tool for ad-hoc text classification. See https://arxiv.org/abs/1909.00161 for a deeper explanation of the MNLI training and how zero-shot works. The zeroshot classification task is configured as follows: ```js { // model configuration "inference_config" : { "zero_shot_classification": { "classification_labels": ["entailment", "neutral", "contradiction"], // <1> "labels": ["sad", "glad", "mad", "rad"], // <2> "multi_label": false, // <3> "hypothesis_template": "This example is {}.", // <4> "tokenization": { /* tokenization configuration */} } } } ``` * <1> For all zero_shot models, there returns 3 particular labels when classification the target sequence. "entailment" is the positive case, "neutral" the case where the sequence isn't positive or negative, and "contradiction" is the negative case * <2> This is an optional parameter for the default zero_shot labels to attempt to classify * <3> When returning the probabilities, should the results assume there is only one true label or multiple true labels * <4> The hypothesis template when tokenizing the labels. When combining with `sad` the sequence looks like `This example is sad.` For inference in a pipeline one may provide label updates: ```js { // pipeline definition "processors": [ // other processors { "inference": { // general configuration "inference_config": { "zero_shot_classification": { "labels": ["humanities", "science", "mathematics", "technology"], // <1> "multi_label": true // <2> } } } } // other processors ] } ``` * <1> The `labels` we care about, these replace the default ones if they exist. * <2> Should the results allow multiple true labels Similarly one may provide label changes against the `_infer` endpoint ```js { "docs":[{ "text_field": "This is a very happy person"}], "inference_config":{"zero_shot_classification":{"labels": ["glad", "sad", "bad", "rad"], "multi_label": false}} } ``` --- .../apis/get-trained-models.asciidoc | 98 +++++-- .../apis/put-trained-models.asciidoc | 57 +++- docs/reference/ml/ml-shared.asciidoc | 176 ++++++++----- .../InferTrainedModelDeploymentAction.java | 49 ++-- .../MlInferenceNamedXContentProvider.java | 18 ++ .../trainedmodel/NlpConfigUpdate.java | 21 ++ .../ZeroShotClassificationConfig.java | 245 ++++++++++++++++++ .../ZeroShotClassificationConfigUpdate.java | 201 ++++++++++++++ ...erTrainedModelDeploymentRequestsTests.java | 33 ++- .../ZeroShotClassificationConfigTests.java | 61 +++++ ...roShotClassificationConfigUpdateTests.java | 134 ++++++++++ ...portInferTrainedModelDeploymentAction.java | 5 +- .../TransportInternalInferModelAction.java | 12 +- .../TrainedModelAllocationNodeService.java | 8 +- .../deployment/DeploymentManager.java | 20 +- .../TrainedModelDeploymentTask.java | 28 +- .../inference/ingest/InferenceProcessor.java | 8 +- .../ml/inference/nlp/BertRequestBuilder.java | 14 +- .../ml/inference/nlp/FillMaskProcessor.java | 10 +- .../xpack/ml/inference/nlp/NerProcessor.java | 15 +- .../xpack/ml/inference/nlp/NlpTask.java | 10 +- .../inference/nlp/PassThroughProcessor.java | 5 +- .../xpack/ml/inference/nlp/TaskType.java | 7 + .../nlp/TextClassificationProcessor.java | 5 +- .../inference/nlp/TextEmbeddingProcessor.java | 5 +- .../nlp/ZeroShotClassificationProcessor.java | 194 ++++++++++++++ .../nlp/tokenizers/BertTokenizer.java | 162 ++++++++---- .../nlp/tokenizers/NlpTokenizer.java | 6 +- .../nlp/tokenizers/TokenizationResult.java | 21 +- .../inference/nlp/FillMaskProcessorTests.java | 4 +- .../ml/inference/nlp/NerProcessorTests.java | 2 +- .../nlp/TextClassificationProcessorTests.java | 2 +- .../nlp/tokenizers/BertTokenizerTests.java | 112 +++++--- 33 files changed, 1493 insertions(+), 255 deletions(-) create mode 100644 x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NlpConfigUpdate.java create mode 100644 x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ZeroShotClassificationConfig.java create mode 100644 x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ZeroShotClassificationConfigUpdate.java create mode 100644 x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ZeroShotClassificationConfigTests.java create mode 100644 x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ZeroShotClassificationConfigUpdateTests.java create mode 100644 x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/ZeroShotClassificationProcessor.java diff --git a/docs/reference/ml/df-analytics/apis/get-trained-models.asciidoc b/docs/reference/ml/df-analytics/apis/get-trained-models.asciidoc index 9da47064a83d2..10b298c76b327 100644 --- a/docs/reference/ml/df-analytics/apis/get-trained-models.asciidoc +++ b/docs/reference/ml/df-analytics/apis/get-trained-models.asciidoc @@ -27,7 +27,7 @@ Retrieves configuration information for a trained model. [[ml-get-trained-models-prereq]] == {api-prereq-title} -Requires the `monitor_ml` cluster privilege. This privilege is included in the +Requires the `monitor_ml` cluster privilege. This privilege is included in the `machine_learning_user` built-in role. @@ -71,9 +71,9 @@ default value is empty, indicating no optional fields are included. Valid options are: - `definition`: Includes the model definition. - `feature_importance_baseline`: Includes the baseline for {feat-imp} values. - - `hyperparameters`: Includes the information about hyperparameters used to - train the model. This information consists of the value, the absolute and - relative importance of the hyperparameter as well as an indicator of whether + - `hyperparameters`: Includes the information about hyperparameters used to + train the model. This information consists of the value, the absolute and + relative importance of the hyperparameter as well as an indicator of whether it was specified by the user or tuned during hyperparameter optimization. - `total_feature_importance`: Includes the total {feat-imp} for the training data set. @@ -222,8 +222,8 @@ include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-ner] [%collapsible%open] ====== `classification_labels`:::: -(Optional, string) -An array of classification labels. NER supports only +(Optional, string) +An array of classification labels. NER supports only Inside-Outside-Beginning labels (IOB) and only persons, organizations, locations, and miscellaneous. For example: `["O", "B-PER", "I-PER", "B-ORG", "I-ORG", "B-LOC", "I-LOC", "B-MISC", "I-MISC"]`. @@ -338,7 +338,7 @@ include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-text-classific [%collapsible%open] ====== `classification_labels`:::: -(Optional, string) +(Optional, string) An array of classification labels. `num_top_classes`:::: @@ -414,6 +414,68 @@ include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenizati (Optional, integer) include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-max-sequence-length] +`with_special_tokens`:::: +(Optional, boolean) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-with-special-tokens] +======== +======= +`vocabulary`:::: +(Optional, object) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-vocabulary] ++ +.Properties of vocabulary +[%collapsible%open] +======= +`index`:::: +(Required, string) +The index where the vocabulary is stored. +======= +====== +`zero_shot_classification`:::: +(Object, optional) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-zero-shot-classification] ++ +.Properties of zero_shot_classification inference +[%collapsible%open] +====== +`classification_labels`:::: +(Required, array) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-zero-shot-classification-classification-labels] + +`hypothesis_template`:::: +(Optional, string) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-zero-shot-classification-hypothesis-template] + +`labels`:::: +(Optional, array) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-zero-shot-classification-labels] + +`multi_label`:::: +(Optional, boolean) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-zero-shot-classification-multi-label] + +`tokenization`:::: +(Optional, object) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization] ++ +.Properties of tokenization +[%collapsible%open] +======= +`bert`:::: +(Optional, object) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert] ++ +.Properties of bert +[%collapsible%open] +======== +`do_lower_case`:::: +(Optional, boolean) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-do-lower-case] + +`max_sequence_length`:::: +(Optional, integer) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-max-sequence-length] + `with_special_tokens`:::: (Optional, boolean) include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-with-special-tokens] @@ -456,7 +518,7 @@ provided. ===== `index`::: (Required, object) -Indicates that the model definition is stored in an index. It is required to be empty as +Indicates that the model definition is stored in an index. It is required to be empty as the index for storing model definitions is configured automatically. ===== // End location @@ -480,7 +542,7 @@ it is a single value. For {classanalysis}, there is a value for each class. `hyperparameters`::: (array) -List of the available hyperparameters optimized during the +List of the available hyperparameters optimized during the `fine_parameter_tuning` phase as well as specified by the user. + .Properties of hyperparameters @@ -488,10 +550,10 @@ List of the available hyperparameters optimized during the ====== `absolute_importance`:::: (double) -A positive number showing how much the parameter influences the variation of the -{ml-docs}/dfa-regression-lossfunction.html[loss function]. For -hyperparameters with values that are not specified by the user but tuned during -hyperparameter optimization. +A positive number showing how much the parameter influences the variation of the +{ml-docs}/dfa-regression-lossfunction.html[loss function]. For +hyperparameters with values that are not specified by the user but tuned during +hyperparameter optimization. `max_trees`:::: (integer) @@ -503,14 +565,14 @@ Name of the hyperparameter. `relative_importance`:::: (double) -A number between 0 and 1 showing the proportion of influence on the variation of -the loss function among all tuned hyperparameters. For hyperparameters with -values that are not specified by the user but tuned during hyperparameter +A number between 0 and 1 showing the proportion of influence on the variation of +the loss function among all tuned hyperparameters. For hyperparameters with +values that are not specified by the user but tuned during hyperparameter optimization. `supplied`:::: (Boolean) -Indicates if the hyperparameter is specified by the user (`true`) or optimized +Indicates if the hyperparameter is specified by the user (`true`) or optimized (`false`). `value`:::: @@ -602,7 +664,7 @@ Identifier for the trained model. `model_type`:: (Optional, string) The created model type. By default the model type is `tree_ensemble`. -Appropriate types are: +Appropriate types are: + -- * `tree_ensemble`: The model definition is an ensemble model of decision trees. diff --git a/docs/reference/ml/df-analytics/apis/put-trained-models.asciidoc b/docs/reference/ml/df-analytics/apis/put-trained-models.asciidoc index 9edeb0a8d5565..07ca8304985ec 100644 --- a/docs/reference/ml/df-analytics/apis/put-trained-models.asciidoc +++ b/docs/reference/ml/df-analytics/apis/put-trained-models.asciidoc @@ -377,7 +377,7 @@ A human-readable description of the {infer} trained model. `inference_config`:: (Required, object) The default configuration for inference. This can be: `regression`, -`classification`, `fill_mask`, `ner`, `text_classification`, or `text_embedding`. +`classification`, `fill_mask`, `ner`, `text_classification`, `text_embedding` or `zero_shot_classification`. If `regression` or `classification`, it must match the `target_type` of the underlying `definition.trained_model`. If `fill_mask`, `ner`, `text_classification`, or `text_embedding`; the `model_type` must be `pytorch`. @@ -457,7 +457,7 @@ include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-ner] [%collapsible%open] ===== `classification_labels`:::: -(Optional, string) +(Optional, string) An array of classification labels. NER only supports Inside-Outside-Beginning labels (IOB) and only persons, organizations, locations, and miscellaneous. Example: ["O", "B-PER", "I-PER", "B-ORG", "I-ORG", "B-LOC", "I-LOC", "B-MISC", "I-MISC"] @@ -614,6 +614,57 @@ include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenizati (Optional, integer) include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-max-sequence-length] +`with_special_tokens`:::: +(Optional, boolean) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-with-special-tokens] +======= +====== +===== +`zero_shot_classification`::: +(Object, optional) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-zero-shot-classification] ++ +.Properties of zero_shot_classification inference +[%collapsible%open] +===== +`classification_labels`:::: +(Required, array) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-zero-shot-classification-classification-labels] + +`hypothesis_template`:::: +(Optional, string) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-zero-shot-classification-hypothesis-template] + +`labels`:::: +(Optional, array) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-zero-shot-classification-labels] + +`multi_label`:::: +(Optional, boolean) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-zero-shot-classification-multi-label] + +`tokenization`:::: +(Optional, object) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization] ++ +.Properties of tokenization +[%collapsible%open] +====== +`bert`:::: +(Optional, object) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert] ++ +.Properties of bert +[%collapsible%open] +======= +`do_lower_case`:::: +(Optional, boolean) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-do-lower-case] + +`max_sequence_length`:::: +(Optional, integer) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-max-sequence-length] + `with_special_tokens`:::: (Optional, boolean) include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-with-special-tokens] @@ -660,7 +711,7 @@ An object map that contains metadata about the model. `model_type`:: (Optional, string) The created model type. By default the model type is `tree_ensemble`. -Appropriate types are: +Appropriate types are: + -- * `tree_ensemble`: The model definition is an ensemble model of decision trees. diff --git a/docs/reference/ml/ml-shared.asciidoc b/docs/reference/ml/ml-shared.asciidoc index d2fb3e41da0bc..7d0c1e72fd02b 100644 --- a/docs/reference/ml/ml-shared.asciidoc +++ b/docs/reference/ml/ml-shared.asciidoc @@ -323,7 +323,7 @@ end::custom-preprocessor[] tag::custom-rules[] An array of custom rule objects, which enable you to customize the way detectors operate. For example, a rule may dictate to the detector conditions under which -results should be skipped. {kib} refers to custom rules as _job rules_. For more +results should be skipped. {kib} refers to custom rules as _job rules_. For more examples, see {ml-docs}/ml-configuring-detector-custom-rules.html[Customizing detectors with custom rules]. end::custom-rules[] @@ -526,21 +526,21 @@ end::detector-index[] tag::dfas-alpha[] Advanced configuration option. {ml-cap} uses loss guided tree growing, which means that the decision trees grow where the regularized loss decreases most -quickly. This parameter affects loss calculations by acting as a multiplier of -the tree depth. Higher alpha values result in shallower trees and faster -training times. By default, this value is calculated during hyperparameter -optimization. It must be greater than or equal to zero. +quickly. This parameter affects loss calculations by acting as a multiplier of +the tree depth. Higher alpha values result in shallower trees and faster +training times. By default, this value is calculated during hyperparameter +optimization. It must be greater than or equal to zero. end::dfas-alpha[] tag::dfas-downsample-factor[] -Advanced configuration option. Controls the fraction of data that is used to -compute the derivatives of the loss function for tree training. A small value -results in the use of a small fraction of the data. If this value is set to be -less than 1, accuracy typically improves. However, too small a value may result +Advanced configuration option. Controls the fraction of data that is used to +compute the derivatives of the loss function for tree training. A small value +results in the use of a small fraction of the data. If this value is set to be +less than 1, accuracy typically improves. However, too small a value may result in poor convergence for the ensemble and so require more trees. For more information about shrinkage, refer to {wikipedia}/Gradient_boosting#Stochastic_gradient_boosting[this wiki article]. -By default, this value is calculated during hyperparameter optimization. It +By default, this value is calculated during hyperparameter optimization. It must be greater than zero and less than or equal to 1. end::dfas-downsample-factor[] @@ -553,9 +553,9 @@ By default, early stoppping is enabled. end::dfas-early-stopping-enabled[] tag::dfas-eta-growth[] -Advanced configuration option. Specifies the rate at which `eta` increases for -each new tree that is added to the forest. For example, a rate of 1.05 -increases `eta` by 5% for each extra tree. By default, this value is calculated +Advanced configuration option. Specifies the rate at which `eta` increases for +each new tree that is added to the forest. For example, a rate of 1.05 +increases `eta` by 5% for each extra tree. By default, this value is calculated during hyperparameter optimization. It must be between 0.5 and 2. end::dfas-eta-growth[] @@ -565,16 +565,16 @@ candidate split. end::dfas-feature-bag-fraction[] tag::dfas-feature-processors[] -Advanced configuration option. A collection of feature preprocessors that modify -one or more included fields. The analysis uses the resulting one or more -features instead of the original document field. However, these features are -ephemeral; they are not stored in the destination index. Multiple -`feature_processors` entries can refer to the same document fields. Automatic -categorical {ml-docs}/ml-feature-encoding.html[feature encoding] still occurs +Advanced configuration option. A collection of feature preprocessors that modify +one or more included fields. The analysis uses the resulting one or more +features instead of the original document field. However, these features are +ephemeral; they are not stored in the destination index. Multiple +`feature_processors` entries can refer to the same document fields. Automatic +categorical {ml-docs}/ml-feature-encoding.html[feature encoding] still occurs for the fields that are unprocessed by a custom processor or that have -categorical values. Use this property only if you want to override the automatic -feature encoding of the specified fields. Refer to -{ml-docs}/ml-feature-processors.html[{dfanalytics} feature processors] to learn +categorical values. Use this property only if you want to override the automatic +feature encoding of the specified fields. Refer to +{ml-docs}/ml-feature-processors.html[{dfanalytics} feature processors] to learn more. end::dfas-feature-processors[] @@ -591,13 +591,13 @@ The configuration information necessary to perform frequency encoding. end::dfas-feature-processors-frequency[] tag::dfas-feature-processors-frequency-map[] -The resulting frequency map for the field value. If the field value is missing +The resulting frequency map for the field value. If the field value is missing from the `frequency_map`, the resulting value is `0`. end::dfas-feature-processors-frequency-map[] tag::dfas-feature-processors-multi[] -The configuration information necessary to perform multi encoding. It allows -multiple processors to be changed together. This way the output of a processor +The configuration information necessary to perform multi encoding. It allows +multiple processors to be changed together. This way the output of a processor can then be passed to another as an input. end::dfas-feature-processors-multi[] @@ -606,10 +606,10 @@ The ordered array of custom processors to execute. Must be more than 1. end::dfas-feature-processors-multi-proc[] tag::dfas-feature-processors-ngram[] -The configuration information necessary to perform n-gram encoding. Features -created by this encoder have the following name format: -`.`. For example, if the -`feature_prefix` is `f`, the feature name for the second unigram in a string is +The configuration information necessary to perform n-gram encoding. Features +created by this encoder have the following name format: +`.`. For example, if the +`feature_prefix` is `f`, the feature name for the second unigram in a string is `f.11`. end::dfas-feature-processors-ngram[] @@ -622,17 +622,17 @@ The name of the text field to encode. end::dfas-feature-processors-ngram-field[] tag::dfas-feature-processors-ngram-length[] -Specifies the length of the n-gram substring. Defaults to `50`. Must be greater +Specifies the length of the n-gram substring. Defaults to `50`. Must be greater than `0`. end::dfas-feature-processors-ngram-length[] tag::dfas-feature-processors-ngram-ngrams[] -Specifies which n-grams to gather. It’s an array of integer values where the +Specifies which n-grams to gather. It’s an array of integer values where the minimum value is 1, and a maximum value is 5. end::dfas-feature-processors-ngram-ngrams[] tag::dfas-feature-processors-ngram-start[] -Specifies the zero-indexed start of the n-gram substring. Negative values are +Specifies the zero-indexed start of the n-gram substring. Negative values are allowed for encoding n-grams of string suffixes. Defaults to `0`. end::dfas-feature-processors-ngram-start[] @@ -686,19 +686,19 @@ decision tree when the tree is trained. end::dfas-num-splits[] tag::dfas-soft-limit[] -Advanced configuration option. {ml-cap} uses loss guided tree growing, which -means that the decision trees grow where the regularized loss decreases most -quickly. This soft limit combines with the `soft_tree_depth_tolerance` to -penalize trees that exceed the specified depth; the regularized loss increases -quickly beyond this depth. By default, this value is calculated during +Advanced configuration option. {ml-cap} uses loss guided tree growing, which +means that the decision trees grow where the regularized loss decreases most +quickly. This soft limit combines with the `soft_tree_depth_tolerance` to +penalize trees that exceed the specified depth; the regularized loss increases +quickly beyond this depth. By default, this value is calculated during hyperparameter optimization. It must be greater than or equal to 0. end::dfas-soft-limit[] tag::dfas-soft-tolerance[] -Advanced configuration option. This option controls how quickly the regularized -loss increases when the tree depth exceeds `soft_tree_depth_limit`. By default, -this value is calculated during hyperparameter optimization. It must be greater -than or equal to 0.01. +Advanced configuration option. This option controls how quickly the regularized +loss increases when the tree depth exceeds `soft_tree_depth_limit`. By default, +this value is calculated during hyperparameter optimization. It must be greater +than or equal to 0.01. end::dfas-soft-tolerance[] tag::dfas-timestamp[] @@ -744,7 +744,7 @@ end::empty-bucket-count[] tag::eta[] Advanced configuration option. The shrinkage applied to the weights. Smaller values result in larger forests which have a better generalization error. -However, larger forests cause slower training. For more information about +However, larger forests cause slower training. For more information about shrinkage, refer to {wikipedia}/Gradient_boosting#Shrinkage[this wiki article]. By default, this value is calculated during hyperparameter optimization. It must @@ -833,10 +833,10 @@ end::function[] tag::gamma[] Advanced configuration option. Regularization parameter to prevent overfitting -on the training data set. Multiplies a linear penalty associated with the size -of individual trees in the forest. A high gamma value causes training to prefer -small trees. A small gamma value results in larger individual trees and slower -training. By default, this value is calculated during hyperparameter +on the training data set. Multiplies a linear penalty associated with the size +of individual trees in the forest. A high gamma value causes training to prefer +small trees. A small gamma value results in larger individual trees and slower +training. By default, this value is calculated during hyperparameter optimization. It must be a nonnegative value. end::gamma[] @@ -849,7 +849,7 @@ An array of index names. Wildcards are supported. For example: `["it_ops_metrics", "server*"]`. + -- -NOTE: If any indices are in remote clusters then the {ml} nodes need to have the +NOTE: If any indices are in remote clusters then the {ml} nodes need to have the `remote_cluster_client` role. -- @@ -921,7 +921,7 @@ BERT-style tokenization is to be performed with the enclosed settings. end::inference-config-nlp-tokenization-bert[] tag::inference-config-nlp-tokenization-bert-do-lower-case[] -Should the tokenization lower case the text sequence when building +Should the tokenization lower case the text sequence when building the tokens. end::inference-config-nlp-tokenization-bert-do-lower-case[] @@ -930,7 +930,7 @@ Tokenize with special tokens. The tokens typically included in BERT-style tokeni + -- * `[CLS]`: The first token of the sequence being classified. -* `[SEP]`: Indicates sequence separation. +* `[SEP]`: Indicates sequence separation. -- end::inference-config-nlp-tokenization-bert-with-special-tokens[] @@ -998,6 +998,46 @@ prediction. Defaults to the `results_field` value of the {dfanalytics-job} that used to train the model, which defaults to `_prediction`. end::inference-config-results-field-processor[] +tag::inference-config-zero-shot-classification[] +Configures a zero-shot classification task. Zero-shot classification allows for +text classification to occur without pre-determined labels. At inference time, +it is possible to adjust the labels to classify. This makes this type of model +and task exceptionally flexible. + +If consistently classifying the same labels, it may be better to use a fine turned +text classification model. +end::inference-config-zero-shot-classification[] + +tag::inference-config-zero-shot-classification-classification-labels[] +The classification labels used during the zero-shot classification. Classification +labels must not be empty or null and only set at model creation. They must be all three +of ["entailment", "neutral", "contradiction"]. + +NOTE: This is NOT the same as `labels` which are the values that zero-shot is attempting to + classify. +end::inference-config-zero-shot-classification-classification-labels[] + +tag::inference-config-zero-shot-classification-hypothesis-template[] +This is the template used when tokenizing the sequences for classification. + +The labels replace the `{}` value in the text. The default value is: +`This example is {}.` +end::inference-config-zero-shot-classification-hypothesis-template[] + +tag::inference-config-zero-shot-classification-labels[] +The labels to classify. Can be set at creation for default labels, and +then updated during inference. +end::inference-config-zero-shot-classification-labels[] + +tag::inference-config-zero-shot-classification-multi-label[] +Indicates if more than one `true` label is possible given the input. + +This is useful when labeling text that could pertain to more than one of the +input labels. + +Defaults to `false`. +end::inference-config-zero-shot-classification-multi-label[] + tag::inference-metadata-feature-importance-feature-name[] The feature for which this importance was calculated. end::inference-metadata-feature-importance-feature-name[] @@ -1102,11 +1142,11 @@ end::job-id-datafeed[] tag::lambda[] Advanced configuration option. Regularization parameter to prevent overfitting on the training data set. Multiplies an L2 regularization term which applies to -leaf weights of the individual trees in the forest. A high lambda value causes -training to favor small leaf weights. This behavior makes the prediction +leaf weights of the individual trees in the forest. A high lambda value causes +training to favor small leaf weights. This behavior makes the prediction function smoother at the expense of potentially not being able to capture relevant relationships between the features and the {depvar}. A small lambda -value results in large individual trees and slower training. By default, this +value results in large individual trees and slower training. By default, this value is calculated during hyperparameter optimization. It must be a nonnegative value. end::lambda[] @@ -1151,13 +1191,13 @@ set. end::max-empty-searches[] tag::max-trees[] -Advanced configuration option. Defines the maximum number of decision trees in -the forest. The maximum value is 2000. By default, this value is calculated +Advanced configuration option. Defines the maximum number of decision trees in +the forest. The maximum value is 2000. By default, this value is calculated during hyperparameter optimization. end::max-trees[] tag::max-trees-trained-models[] -The maximum number of decision trees in the forest. The maximum value is 2000. +The maximum number of decision trees in the forest. The maximum value is 2000. By default, this value is calculated during hyperparameter optimization. end::max-trees-trained-models[] @@ -1222,7 +1262,7 @@ default value for jobs created in version 6.1 and later is `1024mb`. If the than `1024mb`, however, that value is used instead. The default value is relatively small to ensure that high resource usage is a conscious decision. If you have jobs that are expected to analyze high cardinality fields, you will -likely need to use a higher value. +likely need to use a higher value. + If you specify a number instead of a string, the units are assumed to be MiB. Specifying a string is recommended for clarity. If you specify a byte size unit @@ -1299,11 +1339,11 @@ Only the specified `terms` can be viewed when using the Single Metric Viewer. end::model-plot-config-terms[] tag::model-prune-window[] -Advanced configuration option. -Affects the pruning of models that have not been updated for the given time -duration. The value must be set to a multiple of the `bucket_span`. If set too -low, important information may be removed from the model. Typically, set to -`30d` or longer. If not set, model pruning only occurs if the model memory +Advanced configuration option. +Affects the pruning of models that have not been updated for the given time +duration. The value must be set to a multiple of the `bucket_span`. If set too +low, important information may be removed from the model. Typically, set to +`30d` or longer. If not set, model pruning only occurs if the model memory status reaches the soft limit or the hard limit. end::model-prune-window[] @@ -1391,10 +1431,10 @@ end::open-time[] tag::out-of-order-timestamp-count[] The number of input documents that have a timestamp chronologically -preceding the start of the current anomaly detection bucket offset by -the latency window. This information is applicable only when you provide -data to the {anomaly-job} by using the <>. -These out of order documents are discarded, since jobs require time +preceding the start of the current anomaly detection bucket offset by +the latency window. This information is applicable only when you provide +data to the {anomaly-job} by using the <>. +These out of order documents are discarded, since jobs require time series data to be in ascending chronological order. end::out-of-order-timestamp-count[] @@ -1459,9 +1499,9 @@ number of {es} documents. end::processed-record-count[] tag::randomize-seed[] -Defines the seed for the random generator that is used to pick training data. By -default, it is randomly generated. Set it to a specific value to use the same -training data each time you start a job (assuming other related parameters such +Defines the seed for the random generator that is used to pick training data. By +default, it is randomly generated. Set it to a specific value to use the same +training data each time you start a job (assuming other related parameters such as `source` and `analyzed_fields` are the same). end::randomize-seed[] diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/InferTrainedModelDeploymentAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/InferTrainedModelDeploymentAction.java index b8eebfe4c6764..d880433cc76a2 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/InferTrainedModelDeploymentAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/InferTrainedModelDeploymentAction.java @@ -11,19 +11,19 @@ import org.elasticsearch.action.ActionType; import org.elasticsearch.action.support.tasks.BaseTasksRequest; import org.elasticsearch.action.support.tasks.BaseTasksResponse; -import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.xcontent.ObjectParser; import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.ToXContentObject; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.core.TimeValue; import org.elasticsearch.tasks.Task; import org.elasticsearch.xpack.core.ml.inference.results.InferenceResults; +import org.elasticsearch.xpack.core.ml.inference.trainedmodel.EmptyConfigUpdate; +import org.elasticsearch.xpack.core.ml.inference.trainedmodel.InferenceConfigUpdate; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; import java.io.IOException; @@ -31,6 +31,7 @@ import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.Optional; import static org.elasticsearch.action.ValidateActions.addValidationError; @@ -45,11 +46,12 @@ public InferTrainedModelDeploymentAction() { super(NAME, InferTrainedModelDeploymentAction.Response::new); } - public static class Request extends BaseTasksRequest implements ToXContentObject { + public static class Request extends BaseTasksRequest { public static final ParseField DEPLOYMENT_ID = new ParseField("deployment_id"); public static final ParseField DOCS = new ParseField("docs"); public static final ParseField TIMEOUT = new ParseField("timeout"); + public static final ParseField INFERENCE_CONFIG = new ParseField("inference_config"); public static final TimeValue DEFAULT_TIMEOUT = TimeValue.timeValueSeconds(10); @@ -58,6 +60,11 @@ public static class Request extends BaseTasksRequest implements ToXCont PARSER.declareString(Request.Builder::setDeploymentId, DEPLOYMENT_ID); PARSER.declareObjectArray(Request.Builder::setDocs, (p, c) -> p.mapOrdered(), DOCS); PARSER.declareString(Request.Builder::setTimeout, TIMEOUT); + PARSER.declareNamedObject( + Request.Builder::setUpdate, + ((p, c, name) -> p.namedObject(InferenceConfigUpdate.class, name, c)), + INFERENCE_CONFIG + ); } public static Request parseRequest(String deploymentId, XContentParser parser) { @@ -70,16 +77,19 @@ public static Request parseRequest(String deploymentId, XContentParser parser) { private final String deploymentId; private final List> docs; + private final InferenceConfigUpdate update; - public Request(String deploymentId, List> docs) { + public Request(String deploymentId, InferenceConfigUpdate update, List> docs) { this.deploymentId = ExceptionsHelper.requireNonNull(deploymentId, DEPLOYMENT_ID); this.docs = ExceptionsHelper.requireNonNull(Collections.unmodifiableList(docs), DOCS); + this.update = update; } public Request(StreamInput in) throws IOException { super(in); deploymentId = in.readString(); docs = Collections.unmodifiableList(in.readList(StreamInput::readMap)); + update = in.readOptionalNamedWriteable(InferenceConfigUpdate.class); } public String getDeploymentId() { @@ -90,6 +100,10 @@ public List> getDocs() { return docs; } + public InferenceConfigUpdate getUpdate() { + return Optional.ofNullable(update).orElse(new EmptyConfigUpdate()); + } + @Override public TimeValue getTimeout() { TimeValue tv = super.getTimeout(); @@ -124,16 +138,7 @@ public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); out.writeString(deploymentId); out.writeCollection(docs, StreamOutput::writeMap); - } - - @Override - public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException { - builder.startObject(); - builder.field(DEPLOYMENT_ID.getPreferredName(), deploymentId); - builder.field(DOCS.getPreferredName(), docs); - builder.field(TIMEOUT.getPreferredName(), getTimeout().getStringRep()); - builder.endObject(); - return builder; + out.writeOptionalNamedWriteable(update); } @Override @@ -148,17 +153,13 @@ public boolean equals(Object o) { InferTrainedModelDeploymentAction.Request that = (InferTrainedModelDeploymentAction.Request) o; return Objects.equals(deploymentId, that.deploymentId) && Objects.equals(docs, that.docs) + && Objects.equals(update, that.update) && Objects.equals(getTimeout(), that.getTimeout()); } @Override public int hashCode() { - return Objects.hash(deploymentId, docs, getTimeout()); - } - - @Override - public String toString() { - return Strings.toString(this); + return Objects.hash(deploymentId, update, docs, getTimeout()); } public static class Builder { @@ -166,6 +167,7 @@ public static class Builder { private String deploymentId; private List> docs; private TimeValue timeout; + private InferenceConfigUpdate update; private Builder() {} @@ -184,12 +186,17 @@ public Builder setTimeout(TimeValue timeout) { return this; } + public Builder setUpdate(InferenceConfigUpdate update) { + this.update = update; + return this; + } + private Builder setTimeout(String timeout) { return setTimeout(TimeValue.parseTimeValue(timeout, TIMEOUT.getPreferredName())); } public Request build() { - Request request = new Request(deploymentId, docs); + Request request = new Request(deploymentId, update, docs); if (timeout != null) { request.setTimeout(timeout); } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/MlInferenceNamedXContentProvider.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/MlInferenceNamedXContentProvider.java index 6e2ed1179e600..8dc59193aef36 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/MlInferenceNamedXContentProvider.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/MlInferenceNamedXContentProvider.java @@ -52,6 +52,8 @@ import org.elasticsearch.xpack.core.ml.inference.trainedmodel.Tokenization; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.TrainedModel; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.TrainedModelLocation; +import org.elasticsearch.xpack.core.ml.inference.trainedmodel.ZeroShotClassificationConfig; +import org.elasticsearch.xpack.core.ml.inference.trainedmodel.ZeroShotClassificationConfigUpdate; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.ensemble.Ensemble; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.ensemble.Exponent; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.ensemble.LenientlyParsedOutputAggregator; @@ -184,11 +186,23 @@ public List getNamedXContentParsers() { new ParseField(TextEmbeddingConfig.NAME), TextEmbeddingConfig::fromXContentLenient)); namedXContent.add(new NamedXContentRegistry.Entry(StrictlyParsedInferenceConfig.class, new ParseField(TextEmbeddingConfig.NAME), TextEmbeddingConfig::fromXContentStrict)); + namedXContent.add(new NamedXContentRegistry.Entry(LenientlyParsedInferenceConfig.class, + new ParseField(ZeroShotClassificationConfig.NAME), ZeroShotClassificationConfig::fromXContentLenient)); + namedXContent.add(new NamedXContentRegistry.Entry(StrictlyParsedInferenceConfig.class, + new ParseField(ZeroShotClassificationConfig.NAME), + ZeroShotClassificationConfig::fromXContentStrict)); namedXContent.add(new NamedXContentRegistry.Entry(InferenceConfigUpdate.class, ClassificationConfigUpdate.NAME, ClassificationConfigUpdate::fromXContentStrict)); namedXContent.add(new NamedXContentRegistry.Entry(InferenceConfigUpdate.class, RegressionConfigUpdate.NAME, RegressionConfigUpdate::fromXContentStrict)); + namedXContent.add( + new NamedXContentRegistry.Entry( + InferenceConfigUpdate.class, + new ParseField(ZeroShotClassificationConfigUpdate.NAME), + ZeroShotClassificationConfigUpdate::fromXContentStrict + ) + ); // Inference models namedXContent.add(new NamedXContentRegistry.Entry(InferenceModel.class, Ensemble.NAME, EnsembleInferenceModel::fromXContent)); @@ -288,6 +302,8 @@ public List getNamedWriteables() { PassThroughConfig.NAME, PassThroughConfig::new)); namedWriteables.add(new NamedWriteableRegistry.Entry(InferenceConfig.class, TextEmbeddingConfig.NAME, TextEmbeddingConfig::new)); + namedWriteables.add(new NamedWriteableRegistry.Entry(InferenceConfig.class, + ZeroShotClassificationConfig.NAME, ZeroShotClassificationConfig::new)); namedWriteables.add(new NamedWriteableRegistry.Entry(InferenceConfigUpdate.class, ClassificationConfigUpdate.NAME.getPreferredName(), ClassificationConfigUpdate::new)); @@ -297,6 +313,8 @@ public List getNamedWriteables() { ResultsFieldUpdate.NAME, ResultsFieldUpdate::new)); namedWriteables.add(new NamedWriteableRegistry.Entry(InferenceConfigUpdate.class, EmptyConfigUpdate.NAME, EmptyConfigUpdate::new)); + namedWriteables.add(new NamedWriteableRegistry.Entry(InferenceConfigUpdate.class, + ZeroShotClassificationConfigUpdate.NAME, ZeroShotClassificationConfigUpdate::new)); // Location namedWriteables.add(new NamedWriteableRegistry.Entry(TrainedModelLocation.class, diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NlpConfigUpdate.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NlpConfigUpdate.java new file mode 100644 index 0000000000000..27c4b1bfaf5ee --- /dev/null +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NlpConfigUpdate.java @@ -0,0 +1,21 @@ +/* + * 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.core.ml.inference.trainedmodel; + +import org.elasticsearch.common.xcontent.ParseField; + +public abstract class NlpConfigUpdate implements InferenceConfigUpdate { + + static ParseField CLASSIFICATION_LABELS = new ParseField("classification_labels"); + + @Override + public InferenceConfig toConfig() { + throw new UnsupportedOperationException("cannot serialize to nodes before 7.8"); + } + +} diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ZeroShotClassificationConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ZeroShotClassificationConfig.java new file mode 100644 index 0000000000000..16cbdad586f76 --- /dev/null +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ZeroShotClassificationConfig.java @@ -0,0 +1,245 @@ +/* + * 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.core.ml.inference.trainedmodel; + +import org.elasticsearch.Version; +import org.elasticsearch.common.io.stream.StreamInput; +import org.elasticsearch.common.io.stream.StreamOutput; +import org.elasticsearch.common.xcontent.ConstructingObjectParser; +import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.core.Nullable; +import org.elasticsearch.xpack.core.ml.inference.persistence.InferenceIndexConstants; +import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; +import org.elasticsearch.xpack.core.ml.utils.NamedXContentObjectHelper; + +import java.io.IOException; +import java.util.List; +import java.util.Locale; +import java.util.Objects; +import java.util.Optional; +import java.util.Set; +import java.util.TreeSet; +import java.util.stream.Collectors; + +/** + * This builds out a 0-shot classification task. + * + * The 0-shot methodology assumed is MNLI optimized task. For further info see: https://arxiv.org/abs/1909.00161 + * + */ +public class ZeroShotClassificationConfig implements NlpConfig { + + public static final String NAME = "zero_shot_classification"; + public static final ParseField HYPOTHESIS_TEMPLATE = new ParseField("hypothesis_template"); + public static final ParseField MULTI_LABEL = new ParseField("multi_label"); + public static final ParseField LABELS = new ParseField("labels"); + + public static ZeroShotClassificationConfig fromXContentStrict(XContentParser parser) { + return STRICT_PARSER.apply(parser, null); + } + + public static ZeroShotClassificationConfig fromXContentLenient(XContentParser parser) { + return LENIENT_PARSER.apply(parser, null); + } + + private static final Set REQUIRED_CLASSIFICATION_LABELS = new TreeSet<>(List.of("entailment", "neutral", "contradiction")); + private static final String DEFAULT_HYPOTHESIS_TEMPLATE = "This example is {}."; + private static final ConstructingObjectParser STRICT_PARSER = createParser(false); + private static final ConstructingObjectParser LENIENT_PARSER = createParser(true); + + @SuppressWarnings({ "unchecked"}) + private static ConstructingObjectParser createParser(boolean ignoreUnknownFields) { + ConstructingObjectParser parser = new ConstructingObjectParser<>( + NAME, + ignoreUnknownFields, + a -> new ZeroShotClassificationConfig( + (List)a[0], + (VocabularyConfig) a[1], + (Tokenization) a[2], + (String) a[3], + (Boolean) a[4], + (List) a[5] + ) + ); + parser.declareStringArray(ConstructingObjectParser.constructorArg(), CLASSIFICATION_LABELS); + parser.declareObject( + ConstructingObjectParser.optionalConstructorArg(), + (p, c) -> { + if (ignoreUnknownFields == false) { + throw ExceptionsHelper.badRequestException( + "illegal setting [{}] on inference model creation", + VOCABULARY.getPreferredName() + ); + } + return VocabularyConfig.fromXContentLenient(p); + }, + VOCABULARY + ); + parser.declareNamedObject( + ConstructingObjectParser.optionalConstructorArg(), (p, c, n) -> p.namedObject(Tokenization.class, n, ignoreUnknownFields), + TOKENIZATION + ); + parser.declareString(ConstructingObjectParser.optionalConstructorArg(), HYPOTHESIS_TEMPLATE); + parser.declareBoolean(ConstructingObjectParser.optionalConstructorArg(), MULTI_LABEL); + parser.declareStringArray(ConstructingObjectParser.optionalConstructorArg(), LABELS); + return parser; + } + + private final VocabularyConfig vocabularyConfig; + private final Tokenization tokenization; + private final List classificationLabels; + private final List labels; + private final boolean isMultiLabel; + private final String hypothesisTemplate; + + public ZeroShotClassificationConfig( + List classificationLabels, + @Nullable VocabularyConfig vocabularyConfig, + @Nullable Tokenization tokenization, + @Nullable String hypothesisTemplate, + @Nullable Boolean isMultiLabel, + @Nullable List labels + ) { + this.classificationLabels = ExceptionsHelper.requireNonNull(classificationLabels, CLASSIFICATION_LABELS); + if (this.classificationLabels.size() != 3) { + throw ExceptionsHelper.badRequestException( + "[{}] must contain exactly the three values {}", + CLASSIFICATION_LABELS.getPreferredName(), + REQUIRED_CLASSIFICATION_LABELS + ); + } + List badLabels = classificationLabels.stream() + .map(s -> s.toLowerCase(Locale.ROOT)) + .filter(c -> REQUIRED_CLASSIFICATION_LABELS.contains(c) == false) + .collect(Collectors.toList()); + if (badLabels.isEmpty() == false) { + throw ExceptionsHelper.badRequestException( + "[{}] must contain exactly the three values {}. Invalid labels {}", + CLASSIFICATION_LABELS.getPreferredName(), + REQUIRED_CLASSIFICATION_LABELS, + badLabels + ); + } + this.vocabularyConfig = Optional.ofNullable(vocabularyConfig) + .orElse(new VocabularyConfig(InferenceIndexConstants.nativeDefinitionStore())); + this.tokenization = tokenization == null ? Tokenization.createDefault() : tokenization; + this.isMultiLabel = isMultiLabel != null && isMultiLabel; + this.hypothesisTemplate = Optional.ofNullable(hypothesisTemplate).orElse(DEFAULT_HYPOTHESIS_TEMPLATE); + this.labels = labels; + if (labels != null && labels.isEmpty()) { + throw ExceptionsHelper.badRequestException("[{}] must not be empty", LABELS.getPreferredName()); + } + } + + public ZeroShotClassificationConfig(StreamInput in) throws IOException { + vocabularyConfig = new VocabularyConfig(in); + tokenization = in.readNamedWriteable(Tokenization.class); + classificationLabels = in.readStringList(); + isMultiLabel = in.readBoolean(); + hypothesisTemplate = in.readString(); + labels = in.readOptionalStringList(); + } + + @Override + public void writeTo(StreamOutput out) throws IOException { + vocabularyConfig.writeTo(out); + out.writeNamedWriteable(tokenization); + out.writeStringCollection(classificationLabels); + out.writeBoolean(isMultiLabel); + out.writeString(hypothesisTemplate); + out.writeOptionalStringCollection(labels); + } + + @Override + public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { + builder.startObject(); + builder.field(VOCABULARY.getPreferredName(), vocabularyConfig, params); + NamedXContentObjectHelper.writeNamedObject(builder, params, TOKENIZATION.getPreferredName(), tokenization); + builder.field(CLASSIFICATION_LABELS.getPreferredName(), classificationLabels); + builder.field(MULTI_LABEL.getPreferredName(), isMultiLabel); + builder.field(HYPOTHESIS_TEMPLATE.getPreferredName(), hypothesisTemplate); + if (labels != null) { + builder.field(LABELS.getPreferredName(), labels); + } + builder.endObject(); + return builder; + } + + @Override + public String getWriteableName() { + return NAME; + } + + @Override + public boolean isTargetTypeSupported(TargetType targetType) { + return false; + } + + @Override + public Version getMinimalSupportedVersion() { + return Version.V_8_0_0; + } + + @Override + public String getName() { + return NAME; + } + + @Override + public boolean equals(Object o) { + if (o == this) return true; + if (o == null || getClass() != o.getClass()) return false; + + ZeroShotClassificationConfig that = (ZeroShotClassificationConfig) o; + return Objects.equals(vocabularyConfig, that.vocabularyConfig) + && Objects.equals(tokenization, that.tokenization) + && Objects.equals(isMultiLabel, that.isMultiLabel) + && Objects.equals(hypothesisTemplate, that.hypothesisTemplate) + && Objects.equals(labels, that.labels) + && Objects.equals(classificationLabels, that.classificationLabels); + } + + @Override + public int hashCode() { + return Objects.hash(vocabularyConfig, tokenization, classificationLabels, hypothesisTemplate, isMultiLabel, labels); + } + + @Override + public VocabularyConfig getVocabularyConfig() { + return vocabularyConfig; + } + + @Override + public Tokenization getTokenization() { + return tokenization; + } + + public List getClassificationLabels() { + return classificationLabels; + } + + public boolean isMultiLabel() { + return isMultiLabel; + } + + public String getHypothesisTemplate() { + return hypothesisTemplate; + } + + public List getLabels() { + return Optional.ofNullable(labels).orElse(List.of()); + } + + @Override + public boolean isAllocateOnly() { + return true; + } + +} diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ZeroShotClassificationConfigUpdate.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ZeroShotClassificationConfigUpdate.java new file mode 100644 index 0000000000000..dea06726fe1ca --- /dev/null +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ZeroShotClassificationConfigUpdate.java @@ -0,0 +1,201 @@ +/* + * 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.core.ml.inference.trainedmodel; + +import org.elasticsearch.common.io.stream.StreamInput; +import org.elasticsearch.common.io.stream.StreamOutput; +import org.elasticsearch.common.xcontent.ConstructingObjectParser; +import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.core.Nullable; +import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; +import org.elasticsearch.xpack.core.ml.utils.NamedXContentObject; + +import java.io.IOException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +import static org.elasticsearch.xpack.core.ml.inference.trainedmodel.ZeroShotClassificationConfig.LABELS; +import static org.elasticsearch.xpack.core.ml.inference.trainedmodel.ZeroShotClassificationConfig.MULTI_LABEL; + +public class ZeroShotClassificationConfigUpdate extends NlpConfigUpdate implements NamedXContentObject { + + public static final String NAME = "zero_shot_classification"; + + public static ZeroShotClassificationConfigUpdate fromXContentStrict(XContentParser parser) { + return STRICT_PARSER.apply(parser, null); + } + + @SuppressWarnings({ "unchecked"}) + public static ZeroShotClassificationConfigUpdate fromMap(Map map) { + Map options = new HashMap<>(map); + Boolean isMultiLabel = (Boolean)options.remove(MULTI_LABEL.getPreferredName()); + List labels = (List)options.remove(LABELS.getPreferredName()); + if (options.isEmpty() == false) { + throw ExceptionsHelper.badRequestException("Unrecognized fields {}.", map.keySet()); + } + return new ZeroShotClassificationConfigUpdate(labels, isMultiLabel); + } + + @SuppressWarnings({ "unchecked"}) + private static final ConstructingObjectParser STRICT_PARSER = new ConstructingObjectParser<>( + NAME, + a -> new ZeroShotClassificationConfigUpdate((List)a[0], (Boolean) a[1]) + ); + + static { + STRICT_PARSER.declareStringArray(ConstructingObjectParser.optionalConstructorArg(), LABELS); + STRICT_PARSER.declareBoolean(ConstructingObjectParser.optionalConstructorArg(), MULTI_LABEL); + } + + private final List labels; + private final Boolean isMultiLabel; + + public ZeroShotClassificationConfigUpdate( + @Nullable List labels, + @Nullable Boolean isMultiLabel + ) { + this.labels = labels; + if (labels != null && labels.isEmpty()) { + throw ExceptionsHelper.badRequestException("[{}] must not be empty", LABELS.getPreferredName()); + } + this.isMultiLabel = isMultiLabel; + } + + public ZeroShotClassificationConfigUpdate(StreamInput in) throws IOException { + labels = in.readOptionalStringList(); + isMultiLabel = in.readOptionalBoolean(); + } + + @Override + public void writeTo(StreamOutput out) throws IOException { + out.writeOptionalStringCollection(labels); + out.writeOptionalBoolean(isMultiLabel); + } + + @Override + public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { + builder.startObject(); + if (labels != null) { + builder.field(LABELS.getPreferredName(), labels); + } + if (isMultiLabel != null) { + builder.field(MULTI_LABEL.getPreferredName(), isMultiLabel); + } + builder.endObject(); + return builder; + } + + @Override + public String getWriteableName() { + return NAME; + } + + @Override + public InferenceConfig apply(InferenceConfig originalConfig) { + if (originalConfig instanceof ZeroShotClassificationConfig == false) { + throw ExceptionsHelper.badRequestException( + "Inference config of type [{}] can not be updated with a inference request of type [{}]", + originalConfig.getName(), + getName()); + } + + ZeroShotClassificationConfig zeroShotConfig = (ZeroShotClassificationConfig)originalConfig; + if ((labels == null || labels.isEmpty()) && (zeroShotConfig.getLabels() == null || zeroShotConfig.getLabels().isEmpty())) { + throw ExceptionsHelper.badRequestException( + "stored configuration has no [{}] defined, supplied inference_config update must supply [{}]", + LABELS.getPreferredName(), + LABELS.getPreferredName() + ); + } + if (isNoop(zeroShotConfig)) { + return originalConfig; + } + return new ZeroShotClassificationConfig( + zeroShotConfig.getClassificationLabels(), + zeroShotConfig.getVocabularyConfig(), + zeroShotConfig.getTokenization(), + zeroShotConfig.getHypothesisTemplate(), + Optional.ofNullable(isMultiLabel).orElse(zeroShotConfig.isMultiLabel()), + Optional.ofNullable(labels).orElse(zeroShotConfig.getLabels()) + ); + } + + boolean isNoop(ZeroShotClassificationConfig originalConfig) { + return (labels == null || labels.equals(originalConfig.getClassificationLabels())) + && (isMultiLabel == null || isMultiLabel.equals(originalConfig.isMultiLabel())); + } + + @Override + public boolean isSupported(InferenceConfig config) { + return config instanceof ZeroShotClassificationConfig; + } + + @Override + public String getResultsField() { + return null; + } + + @Override + public InferenceConfigUpdate.Builder, ? extends InferenceConfigUpdate> newBuilder() { + return new Builder().setLabels(labels).setMultiLabel(isMultiLabel); + } + + @Override + public String getName() { + return NAME; + } + + @Override + public boolean equals(Object o) { + if (o == this) return true; + if (o == null || getClass() != o.getClass()) return false; + + ZeroShotClassificationConfigUpdate that = (ZeroShotClassificationConfigUpdate) o; + return Objects.equals(isMultiLabel, that.isMultiLabel) && Objects.equals(labels, that.labels); + } + + @Override + public int hashCode() { + return Objects.hash(labels, isMultiLabel); + } + + public List getLabels() { + return labels; + } + + public static class Builder implements InferenceConfigUpdate.Builder< + ZeroShotClassificationConfigUpdate.Builder, + ZeroShotClassificationConfigUpdate + > { + private List labels; + private Boolean isMultiLabel; + + @Override + public ZeroShotClassificationConfigUpdate.Builder setResultsField(String resultsField) { + throw new IllegalArgumentException(); + } + + public Builder setLabels(List labels) { + this.labels = labels; + return this; + } + + public Builder setMultiLabel(Boolean multiLabel) { + isMultiLabel = multiLabel; + return this; + } + + public ZeroShotClassificationConfigUpdate build() { + return new ZeroShotClassificationConfigUpdate(labels, isMultiLabel); + } + } +} diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/InferTrainedModelDeploymentRequestsTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/InferTrainedModelDeploymentRequestsTests.java index a801c0b27d8f9..b621640f5e75a 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/InferTrainedModelDeploymentRequestsTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/InferTrainedModelDeploymentRequestsTests.java @@ -7,19 +7,24 @@ package org.elasticsearch.xpack.core.ml.action; +import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.core.Tuple; -import org.elasticsearch.test.AbstractSerializingTestCase; +import org.elasticsearch.test.AbstractWireSerializingTestCase; +import org.elasticsearch.xpack.core.ml.inference.MlInferenceNamedXContentProvider; +import org.elasticsearch.xpack.core.ml.inference.trainedmodel.EmptyConfigUpdateTests; +import org.elasticsearch.xpack.core.ml.inference.trainedmodel.InferenceConfigUpdate; +import org.elasticsearch.xpack.core.ml.inference.trainedmodel.ZeroShotClassificationConfigUpdateTests; -import java.io.IOException; +import java.util.ArrayList; import java.util.List; import java.util.Map; -public class InferTrainedModelDeploymentRequestsTests extends AbstractSerializingTestCase { - @Override - protected InferTrainedModelDeploymentAction.Request doParseInstance(XContentParser parser) throws IOException { - return InferTrainedModelDeploymentAction.Request.parseRequest(null, parser); +public class InferTrainedModelDeploymentRequestsTests extends AbstractWireSerializingTestCase { + + + private static InferenceConfigUpdate randomInferenceConfigUpdate() { + return randomFrom(ZeroShotClassificationConfigUpdateTests.createRandom(), EmptyConfigUpdateTests.testInstance()); } @Override @@ -32,14 +37,24 @@ protected InferTrainedModelDeploymentAction.Request createTestInstance() { List> docs = randomList(5, () -> randomMap(1, 3, () -> Tuple.tuple(randomAlphaOfLength(7), randomAlphaOfLength(7)))); - InferTrainedModelDeploymentAction.Request request = - new InferTrainedModelDeploymentAction.Request(randomAlphaOfLength(4), docs); + InferTrainedModelDeploymentAction.Request request = new InferTrainedModelDeploymentAction.Request( + randomAlphaOfLength(4), + randomBoolean() ? null : randomInferenceConfigUpdate(), + docs + ); if (randomBoolean()) { request.setTimeout(randomTimeValue()); } return request; } + @Override + protected NamedWriteableRegistry getNamedWriteableRegistry() { + List entries = new ArrayList<>(); + entries.addAll(new MlInferenceNamedXContentProvider().getNamedWriteables()); + return new NamedWriteableRegistry(entries); + } + public void testTimeoutNotNull() { assertNotNull(createTestInstance().getTimeout()); } diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ZeroShotClassificationConfigTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ZeroShotClassificationConfigTests.java new file mode 100644 index 0000000000000..f292683ddc314 --- /dev/null +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ZeroShotClassificationConfigTests.java @@ -0,0 +1,61 @@ +/* + * 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.core.ml.inference.trainedmodel; + +import org.elasticsearch.Version; +import org.elasticsearch.common.io.stream.Writeable; +import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xpack.core.ml.inference.InferenceConfigItemTestCase; + +import java.io.IOException; +import java.util.List; +import java.util.function.Predicate; + +public class ZeroShotClassificationConfigTests extends InferenceConfigItemTestCase { + + @Override + protected boolean supportsUnknownFields() { + return true; + } + + @Override + protected Predicate getRandomFieldsExcludeFilter() { + return field -> field.isEmpty() == false; + } + + @Override + protected ZeroShotClassificationConfig doParseInstance(XContentParser parser) throws IOException { + return ZeroShotClassificationConfig.fromXContentLenient(parser); + } + + @Override + protected Writeable.Reader instanceReader() { + return ZeroShotClassificationConfig::new; + } + + @Override + protected ZeroShotClassificationConfig createTestInstance() { + return createRandom(); + } + + @Override + protected ZeroShotClassificationConfig mutateInstanceForVersion(ZeroShotClassificationConfig instance, Version version) { + return instance; + } + + public static ZeroShotClassificationConfig createRandom() { + return new ZeroShotClassificationConfig( + randomFrom(List.of("entailment", "neutral", "contradiction"), List.of("contradiction", "neutral", "entailment")), + randomBoolean() ? null : VocabularyConfigTests.createRandom(), + randomBoolean() ? null : BertTokenizationTests.createRandom(), + randomAlphaOfLength(10), + randomBoolean(), + randomBoolean() ? null : randomList(1, 5, () -> randomAlphaOfLength(10)) + ); + } +} diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ZeroShotClassificationConfigUpdateTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ZeroShotClassificationConfigUpdateTests.java new file mode 100644 index 0000000000000..ab63fb67861fd --- /dev/null +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ZeroShotClassificationConfigUpdateTests.java @@ -0,0 +1,134 @@ +/* + * 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.core.ml.inference.trainedmodel; + +import org.elasticsearch.ElasticsearchException; +import org.elasticsearch.Version; +import org.elasticsearch.common.io.stream.Writeable; +import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xpack.core.ml.inference.InferenceConfigItemTestCase; + +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.equalTo; + +public class ZeroShotClassificationConfigUpdateTests extends InferenceConfigItemTestCase { + + @Override + protected boolean supportsUnknownFields() { + return false; + } + + @Override + protected ZeroShotClassificationConfigUpdate doParseInstance(XContentParser parser) throws IOException { + return ZeroShotClassificationConfigUpdate.fromXContentStrict(parser); + } + + @Override + protected Writeable.Reader instanceReader() { + return ZeroShotClassificationConfigUpdate::new; + } + + @Override + protected ZeroShotClassificationConfigUpdate createTestInstance() { + return createRandom(); + } + + @Override + protected ZeroShotClassificationConfigUpdate mutateInstanceForVersion(ZeroShotClassificationConfigUpdate instance, Version version) { + return instance; + } + + public void testFromMap() { + ZeroShotClassificationConfigUpdate expected = new ZeroShotClassificationConfigUpdate(List.of("foo", "bar"), false); + Map config = new HashMap<>(){{ + put(ZeroShotClassificationConfig.LABELS.getPreferredName(), List.of("foo", "bar")); + put(ZeroShotClassificationConfig.MULTI_LABEL.getPreferredName(), false); + }}; + assertThat(ZeroShotClassificationConfigUpdate.fromMap(config), equalTo(expected)); + } + + public void testFromMapWithUnknownField() { + ElasticsearchException ex = expectThrows(ElasticsearchException.class, + () -> ZeroShotClassificationConfigUpdate.fromMap(Collections.singletonMap("some_key", 1))); + assertThat(ex.getMessage(), equalTo("Unrecognized fields [some_key].")); + } + + public void testApply() { + ZeroShotClassificationConfig originalConfig = new ZeroShotClassificationConfig( + randomFrom(List.of("entailment", "neutral", "contradiction"), List.of("contradiction", "neutral", "entailment")), + randomBoolean() ? null : VocabularyConfigTests.createRandom(), + randomBoolean() ? null : BertTokenizationTests.createRandom(), + randomAlphaOfLength(10), + randomBoolean(), + randomList(1, 5, () -> randomAlphaOfLength(10)) + ); + + assertThat(originalConfig, equalTo(new ZeroShotClassificationConfigUpdate.Builder().build().apply(originalConfig))); + + assertThat( + new ZeroShotClassificationConfig( + originalConfig.getClassificationLabels(), + originalConfig.getVocabularyConfig(), + originalConfig.getTokenization(), + originalConfig.getHypothesisTemplate(), + originalConfig.isMultiLabel(), + List.of("foo", "bar") + ), + equalTo( + new ZeroShotClassificationConfigUpdate.Builder() + .setLabels(List.of("foo", "bar")).build() + .apply(originalConfig) + ) + ); + assertThat( + new ZeroShotClassificationConfig( + originalConfig.getClassificationLabels(), + originalConfig.getVocabularyConfig(), + originalConfig.getTokenization(), + originalConfig.getHypothesisTemplate(), + true, + originalConfig.getLabels() + ), + equalTo( + new ZeroShotClassificationConfigUpdate.Builder() + .setMultiLabel(true).build() + .apply(originalConfig) + ) + ); + } + + public void testApplyWithEmptyLabelsInConfigAndUpdate() { + ZeroShotClassificationConfig originalConfig = new ZeroShotClassificationConfig( + randomFrom(List.of("entailment", "neutral", "contradiction"), List.of("contradiction", "neutral", "entailment")), + randomBoolean() ? null : VocabularyConfigTests.createRandom(), + randomBoolean() ? null : BertTokenizationTests.createRandom(), + randomAlphaOfLength(10), + randomBoolean(), + null + ); + + Exception ex = expectThrows(Exception.class, () -> new ZeroShotClassificationConfigUpdate.Builder().build().apply(originalConfig)); + assertThat( + ex.getMessage(), + containsString("stored configuration has no [labels] defined, supplied inference_config update must supply [labels]") + ); + } + + public static ZeroShotClassificationConfigUpdate createRandom() { + return new ZeroShotClassificationConfigUpdate( + randomBoolean() ? null : randomList(1,5, () -> randomAlphaOfLength(10)), + randomBoolean() ? null : randomBoolean() + ); + } +} diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportInferTrainedModelDeploymentAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportInferTrainedModelDeploymentAction.java index 160d7a489177d..fa8794dbcd8f6 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportInferTrainedModelDeploymentAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportInferTrainedModelDeploymentAction.java @@ -80,7 +80,10 @@ protected InferTrainedModelDeploymentAction.Response newResponse(InferTrainedMod @Override protected void taskOperation(InferTrainedModelDeploymentAction.Request request, TrainedModelDeploymentTask task, ActionListener listener) { - task.infer(request.getDocs().get(0), request.getTimeout(), + task.infer( + request.getDocs().get(0), + request.getUpdate(), + request.getTimeout(), ActionListener.wrap( pyTorchResult -> listener.onResponse(new InferTrainedModelDeploymentAction.Response(pyTorchResult)), listener::onFailure) diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportInternalInferModelAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportInternalInferModelAction.java index fe8403368734b..0979f54eada8a 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportInternalInferModelAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportInternalInferModelAction.java @@ -25,6 +25,7 @@ import org.elasticsearch.xpack.core.ml.action.InternalInferModelAction.Response; import org.elasticsearch.xpack.core.ml.inference.results.InferenceResults; import org.elasticsearch.xpack.core.ml.inference.results.WarningInferenceResults; +import org.elasticsearch.xpack.core.ml.inference.trainedmodel.InferenceConfigUpdate; import org.elasticsearch.xpack.ml.inference.allocation.TrainedModelAllocationMetadata; import org.elasticsearch.xpack.ml.inference.loadingservice.LocalModel; import org.elasticsearch.xpack.ml.inference.loadingservice.ModelLoadingService; @@ -138,7 +139,7 @@ private void inferAgainstAllocatedModel(Request request, Response.Builder respon // Always fail immediately and return an error ex -> true); request.getObjectsToInfer().forEach(stringObjectMap -> typedChainTaskExecutor.add( - chainedTask -> inferSingleDocAgainstAllocatedModel(request.getModelId(), stringObjectMap, chainedTask))); + chainedTask -> inferSingleDocAgainstAllocatedModel(request.getModelId(), request.getUpdate(), stringObjectMap, chainedTask))); typedChainTaskExecutor.execute(ActionListener.wrap( inferenceResults -> listener.onResponse(responseBuilder.setInferenceResults(inferenceResults) @@ -148,11 +149,16 @@ private void inferAgainstAllocatedModel(Request request, Response.Builder respon )); } - private void inferSingleDocAgainstAllocatedModel(String modelId, Map doc, ActionListener listener) { + private void inferSingleDocAgainstAllocatedModel( + String modelId, + InferenceConfigUpdate inferenceConfigUpdate, + Map doc, + ActionListener listener + ) { executeAsyncWithOrigin(client, ML_ORIGIN, InferTrainedModelDeploymentAction.INSTANCE, - new InferTrainedModelDeploymentAction.Request(modelId, Collections.singletonList(doc)), + new InferTrainedModelDeploymentAction.Request(modelId, inferenceConfigUpdate, Collections.singletonList(doc)), ActionListener.wrap( r -> listener.onResponse(r.getResults()), e -> listener.onResponse(new WarningInferenceResults(e.getMessage())) diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/allocation/TrainedModelAllocationNodeService.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/allocation/TrainedModelAllocationNodeService.java index e066b044f4002..48cb56dea77f8 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/allocation/TrainedModelAllocationNodeService.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/allocation/TrainedModelAllocationNodeService.java @@ -33,6 +33,7 @@ import org.elasticsearch.xpack.core.ml.inference.allocation.RoutingStateAndReason; import org.elasticsearch.xpack.core.ml.inference.allocation.TrainedModelAllocation; import org.elasticsearch.xpack.core.ml.inference.results.InferenceResults; +import org.elasticsearch.xpack.core.ml.inference.trainedmodel.InferenceConfig; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; import org.elasticsearch.xpack.ml.MachineLearning; import org.elasticsearch.xpack.ml.inference.deployment.DeploymentManager; @@ -227,9 +228,12 @@ public void stopDeploymentAndNotify(TrainedModelDeploymentTask task, String reas ); } - public void infer(TrainedModelDeploymentTask task, Map doc, TimeValue timeout, + public void infer(TrainedModelDeploymentTask task, + InferenceConfig config, + Map doc, + TimeValue timeout, ActionListener listener) { - deploymentManager.infer(task, doc, timeout, listener); + deploymentManager.infer(task, config, doc, timeout, listener); } public Optional modelStats(TrainedModelDeploymentTask task) { diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/deployment/DeploymentManager.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/deployment/DeploymentManager.java index 4937ef18b60f2..f05e134434ea2 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/deployment/DeploymentManager.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/deployment/DeploymentManager.java @@ -33,6 +33,7 @@ import org.elasticsearch.xpack.core.ml.inference.TrainedModelInput; import org.elasticsearch.xpack.core.ml.inference.results.InferenceResults; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.IndexLocation; +import org.elasticsearch.xpack.core.ml.inference.trainedmodel.InferenceConfig; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.NlpConfig; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.TrainedModelLocation; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.VocabularyConfig; @@ -131,6 +132,7 @@ private void doStartDeployment(TrainedModelDeploymentTask task, ActionListener doc, TimeValue timeout, + InferenceConfig config, + Map doc, + TimeValue timeout, ActionListener listener) { if (task.isStopped()) { listener.onFailure( @@ -240,12 +244,20 @@ protected void doRun() { List text = Collections.singletonList(NlpTask.extractInput(processContext.modelInput.get(), doc)); NlpTask.Processor processor = processContext.nlpTaskProcessor.get(); processor.validateInputs(text); - NlpTask.Request request = processor.getRequestBuilder().buildRequest(text, requestId); + assert config instanceof NlpConfig; + NlpTask.Request request = processor.getRequestBuilder((NlpConfig) config).buildRequest(text, requestId); logger.trace(() -> "Inference Request "+ request.processInput.utf8ToString()); PyTorchResultProcessor.PendingResult pendingResult = processContext.resultProcessor.registerRequest(requestId); processContext.process.get().writeInferenceRequest(request.processInput); - waitForResult(processContext, pendingResult, request.tokenization, requestId, timeout, processor.getResultProcessor(), - listener); + waitForResult( + processContext, + pendingResult, + request.tokenization, + requestId, + timeout, + processor.getResultProcessor((NlpConfig) config), + listener + ); } catch (IOException e) { logger.error(new ParameterizedMessage("[{}] error writing to process", processContext.modelId), e); onFailure(ExceptionsHelper.serverError("error writing to process", e)); diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/deployment/TrainedModelDeploymentTask.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/deployment/TrainedModelDeploymentTask.java index 82b25026c1173..60cde1bb204cf 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/deployment/TrainedModelDeploymentTask.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/deployment/TrainedModelDeploymentTask.java @@ -18,6 +18,8 @@ import org.elasticsearch.xpack.core.ml.action.StartTrainedModelDeploymentAction; import org.elasticsearch.xpack.core.ml.action.StartTrainedModelDeploymentAction.TaskParams; import org.elasticsearch.xpack.core.ml.inference.results.InferenceResults; +import org.elasticsearch.xpack.core.ml.inference.trainedmodel.InferenceConfig; +import org.elasticsearch.xpack.core.ml.inference.trainedmodel.InferenceConfigUpdate; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; import org.elasticsearch.xpack.ml.inference.allocation.TrainedModelAllocationNodeService; @@ -32,6 +34,7 @@ public class TrainedModelDeploymentTask extends CancellableTask implements Start private final TrainedModelAllocationNodeService trainedModelAllocationNodeService; private volatile boolean stopped; private final SetOnce stoppedReason = new SetOnce<>(); + private final SetOnce inferenceConfig = new SetOnce<>(); public TrainedModelDeploymentTask( long id, @@ -50,6 +53,10 @@ public TrainedModelDeploymentTask( ); } + void init(InferenceConfig inferenceConfig) { + this.inferenceConfig.set(inferenceConfig); + } + public String getModelId() { return params.getModelId(); } @@ -85,8 +92,25 @@ protected void onCancelled() { stop(reason); } - public void infer(Map doc, TimeValue timeout, ActionListener listener) { - trainedModelAllocationNodeService.infer(this, doc, timeout, listener); + public void infer(Map doc, InferenceConfigUpdate update, TimeValue timeout, ActionListener listener) { + if (inferenceConfig.get() == null) { + listener.onFailure( + ExceptionsHelper.badRequestException("[{}] inference not possible against uninitialized model", params.getModelId()) + ); + return; + } + if (update.isSupported(inferenceConfig.get()) == false) { + listener.onFailure( + ExceptionsHelper.badRequestException( + "[{}] inference not possible. Task is configured with [{}] but received update of type [{}]", + params.getModelId(), + inferenceConfig.get().getName(), + update.getName() + ) + ); + return; + } + trainedModelAllocationNodeService.infer(this, update.apply(inferenceConfig.get()), doc, timeout, listener); } public Optional modelStats() { diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/ingest/InferenceProcessor.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/ingest/InferenceProcessor.java index 4cf4d453d0391..3ea64a9ba9b80 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/ingest/InferenceProcessor.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/ingest/InferenceProcessor.java @@ -37,6 +37,8 @@ import org.elasticsearch.xpack.core.ml.inference.trainedmodel.InferenceConfigUpdate; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.RegressionConfig; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.RegressionConfigUpdate; +import org.elasticsearch.xpack.core.ml.inference.trainedmodel.ZeroShotClassificationConfig; +import org.elasticsearch.xpack.core.ml.inference.trainedmodel.ZeroShotClassificationConfigUpdate; import org.elasticsearch.xpack.core.ml.job.messages.Messages; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; import org.elasticsearch.xpack.ml.inference.loadingservice.LocalModel; @@ -358,7 +360,11 @@ InferenceConfigUpdate inferenceConfigUpdateFromMap(Map configMap } else if (configMap.containsKey(RegressionConfig.NAME.getPreferredName())) { checkSupportedVersion(RegressionConfig.EMPTY_PARAMS); return RegressionConfigUpdate.fromMap(valueMap); - } else { + } else if (configMap.containsKey(ZeroShotClassificationConfig.NAME)) { + checkSupportedVersion(new ZeroShotClassificationConfig(List.of("unused"), null, null, null, null, null)); + return ZeroShotClassificationConfigUpdate.fromMap(valueMap); + } + else { throw ExceptionsHelper.badRequestException("unrecognized inference configuration type {}. Supported types {}", configMap.keySet(), Arrays.asList(ClassificationConfig.NAME.getPreferredName(), RegressionConfig.NAME.getPreferredName())); diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/BertRequestBuilder.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/BertRequestBuilder.java index 0572e664ea0e0..4fe4e0392bcd6 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/BertRequestBuilder.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/BertRequestBuilder.java @@ -15,6 +15,7 @@ import java.io.IOException; import java.util.List; +import java.util.stream.Collectors; public class BertRequestBuilder implements NlpTask.RequestBuilder { @@ -37,7 +38,18 @@ public NlpTask.Request buildRequest(List inputs, String requestId) throw " token in its vocabulary"); } - TokenizationResult tokenization = tokenizer.tokenize(inputs); + TokenizationResult tokenization = tokenizer.buildTokenizationResult( + inputs.stream().map(tokenizer::tokenize).collect(Collectors.toList()) + ); + return buildRequest(tokenization, requestId); + } + + @Override + public NlpTask.Request buildRequest(TokenizationResult tokenization, String requestId) throws IOException { + if (tokenizer.getPadToken().isEmpty()) { + throw new IllegalStateException("The input tokenizer does not have a " + BertTokenizer.PAD_TOKEN + + " token in its vocabulary"); + } return new NlpTask.Request(tokenization, jsonRequest(tokenization, tokenizer.getPadToken().getAsInt(), requestId)); } diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/FillMaskProcessor.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/FillMaskProcessor.java index a8c1e5e601620..ed43da44a02bb 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/FillMaskProcessor.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/FillMaskProcessor.java @@ -10,12 +10,14 @@ import org.elasticsearch.xpack.core.ml.inference.results.FillMaskResults; import org.elasticsearch.xpack.core.ml.inference.results.InferenceResults; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.FillMaskConfig; +import org.elasticsearch.xpack.core.ml.inference.trainedmodel.NlpConfig; import org.elasticsearch.xpack.ml.inference.deployment.PyTorchResult; import org.elasticsearch.xpack.ml.inference.nlp.tokenizers.BertTokenizer; import org.elasticsearch.xpack.ml.inference.nlp.tokenizers.NlpTokenizer; import org.elasticsearch.xpack.ml.inference.nlp.tokenizers.TokenizationResult; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; import java.util.List; @@ -49,23 +51,23 @@ public void validateInputs(List inputs) { } @Override - public NlpTask.RequestBuilder getRequestBuilder() { + public NlpTask.RequestBuilder getRequestBuilder(NlpConfig config) { return requestBuilder; } @Override - public NlpTask.ResultProcessor getResultProcessor() { + public NlpTask.ResultProcessor getResultProcessor(NlpConfig config) { return this::processResult; } InferenceResults processResult(TokenizationResult tokenization, PyTorchResult pyTorchResult) { if (tokenization.getTokenizations().isEmpty() || - tokenization.getTokenizations().get(0).getTokens().isEmpty()) { + tokenization.getTokenizations().get(0).getTokens().length == 0) { return new FillMaskResults(Collections.emptyList()); } - int maskTokenIndex = tokenization.getTokenizations().get(0).getTokens().indexOf(BertTokenizer.MASK_TOKEN); + int maskTokenIndex = Arrays.asList(tokenization.getTokenizations().get(0).getTokens()).indexOf(BertTokenizer.MASK_TOKEN); // TODO - process all results in the batch double[] normalizedScores = NlpHelpers.convertToProbabilitiesBySoftMax(pyTorchResult.getInferenceResult()[0][maskTokenIndex]); diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/NerProcessor.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/NerProcessor.java index 1aa7582d9575f..a1f61be3c7680 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/NerProcessor.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/NerProcessor.java @@ -13,6 +13,7 @@ import org.elasticsearch.xpack.core.ml.inference.results.InferenceResults; import org.elasticsearch.xpack.core.ml.inference.results.NerResults; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.NerConfig; +import org.elasticsearch.xpack.core.ml.inference.trainedmodel.NlpConfig; import org.elasticsearch.xpack.ml.inference.deployment.PyTorchResult; import org.elasticsearch.xpack.ml.inference.nlp.tokenizers.NlpTokenizer; import org.elasticsearch.xpack.ml.inference.nlp.tokenizers.TokenizationResult; @@ -124,12 +125,12 @@ public void validateInputs(List inputs) { } @Override - public NlpTask.RequestBuilder getRequestBuilder() { + public NlpTask.RequestBuilder getRequestBuilder(NlpConfig config) { return requestBuilder; } @Override - public NlpTask.ResultProcessor getResultProcessor() { + public NlpTask.ResultProcessor getResultProcessor(NlpConfig config) { return new NerResultProcessor(iobMap); } @@ -143,7 +144,7 @@ static class NerResultProcessor implements NlpTask.ResultProcessor { @Override public InferenceResults processResult(TokenizationResult tokenization, PyTorchResult pyTorchResult) { if (tokenization.getTokenizations().isEmpty() || - tokenization.getTokenizations().get(0).getTokens().isEmpty()) { + tokenization.getTokenizations().get(0).getTokens().length == 0) { return new NerResults(Collections.emptyList()); } // TODO - process all results in the batch @@ -171,7 +172,7 @@ static List tagTokens(TokenizationResult.Tokenization tokenization, IobTag[] iobMap) { List taggedTokens = new ArrayList<>(); int startTokenIndex = 0; - while (startTokenIndex < tokenization.getTokens().size()) { + while (startTokenIndex < tokenization.getTokens().length) { int inputMapping = tokenization.getTokenMap()[startTokenIndex]; if (inputMapping < 0) { // This token does not map to a token in the input (special tokens) @@ -179,14 +180,14 @@ static List tagTokens(TokenizationResult.Tokenization tokenization, continue; } int endTokenIndex = startTokenIndex; - StringBuilder word = new StringBuilder(tokenization.getTokens().get(startTokenIndex)); - while (endTokenIndex < tokenization.getTokens().size() - 1 + StringBuilder word = new StringBuilder(tokenization.getTokens()[startTokenIndex]); + while (endTokenIndex < tokenization.getTokens().length - 1 && tokenization.getTokenMap()[endTokenIndex + 1] == inputMapping) { endTokenIndex++; // TODO Here we try to get rid of the continuation hashes at the beginning of sub-tokens. // It is probably more correct to implement detokenization on the tokenizer // that does reverse lookup based on token IDs. - String endTokenWord = tokenization.getTokens().get(endTokenIndex).substring(2); + String endTokenWord = tokenization.getTokens()[endTokenIndex].substring(2); word.append(endTokenWord); } double[] avgScores = Arrays.copyOf(scores[startTokenIndex], iobMap.length); diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/NlpTask.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/NlpTask.java index b92b8743930bc..856481de738ba 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/NlpTask.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/NlpTask.java @@ -56,6 +56,8 @@ interface TokenLookupFunction { Request buildRequest(List inputs, String requestId) throws IOException; + Request buildRequest(TokenizationResult tokenizationResult, String requestId) throws IOException; + static void writePaddedTokens(String fieldName, TokenizationResult tokenization, int padToken, @@ -97,10 +99,6 @@ public interface ResultProcessor { InferenceResults processResult(TokenizationResult tokenization, PyTorchResult pyTorchResult); } - public interface ResultProcessorFactory { - ResultProcessor build(TokenizationResult tokenizationResult); - } - public interface Processor { /** * Validate the task input string. @@ -110,8 +108,8 @@ public interface Processor { */ void validateInputs(List inputs); - RequestBuilder getRequestBuilder(); - ResultProcessor getResultProcessor(); + RequestBuilder getRequestBuilder(NlpConfig config); + ResultProcessor getResultProcessor(NlpConfig config); } public static String extractInput(TrainedModelInput input, Map doc) { diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/PassThroughProcessor.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/PassThroughProcessor.java index 307196b18ecf6..c577aaaa87b69 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/PassThroughProcessor.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/PassThroughProcessor.java @@ -9,6 +9,7 @@ import org.elasticsearch.xpack.core.ml.inference.results.InferenceResults; import org.elasticsearch.xpack.core.ml.inference.results.PyTorchPassThroughResults; +import org.elasticsearch.xpack.core.ml.inference.trainedmodel.NlpConfig; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.PassThroughConfig; import org.elasticsearch.xpack.ml.inference.deployment.PyTorchResult; import org.elasticsearch.xpack.ml.inference.nlp.tokenizers.NlpTokenizer; @@ -34,12 +35,12 @@ public void validateInputs(List inputs) { } @Override - public NlpTask.RequestBuilder getRequestBuilder() { + public NlpTask.RequestBuilder getRequestBuilder(NlpConfig config) { return requestBuilder; } @Override - public NlpTask.ResultProcessor getResultProcessor() { + public NlpTask.ResultProcessor getResultProcessor(NlpConfig config) { return PassThroughProcessor::processResult; } diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/TaskType.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/TaskType.java index 78d0cca9f829d..e47846e488080 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/TaskType.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/TaskType.java @@ -13,6 +13,7 @@ import org.elasticsearch.xpack.core.ml.inference.trainedmodel.NlpConfig; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.TextClassificationConfig; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.TextEmbeddingConfig; +import org.elasticsearch.xpack.core.ml.inference.trainedmodel.ZeroShotClassificationConfig; import org.elasticsearch.xpack.ml.inference.nlp.tokenizers.NlpTokenizer; import java.util.Locale; @@ -48,6 +49,12 @@ public NlpTask.Processor createProcessor(NlpTokenizer tokenizer, NlpConfig confi public NlpTask.Processor createProcessor(NlpTokenizer tokenizer, NlpConfig config) { return new TextEmbeddingProcessor(tokenizer, (TextEmbeddingConfig) config); } + }, + ZERO_SHOT_CLASSIFICATION { + @Override + public NlpTask.Processor createProcessor(NlpTokenizer tokenizer, NlpConfig config) { + return new ZeroShotClassificationProcessor(tokenizer, (ZeroShotClassificationConfig) config); + } }; public NlpTask.Processor createProcessor(NlpTokenizer tokenizer, NlpConfig config) { diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/TextClassificationProcessor.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/TextClassificationProcessor.java index 611df64176332..d44cbbffd5182 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/TextClassificationProcessor.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/TextClassificationProcessor.java @@ -13,6 +13,7 @@ import org.elasticsearch.xpack.core.ml.inference.results.TextClassificationResults; import org.elasticsearch.xpack.core.ml.inference.results.TopClassEntry; import org.elasticsearch.xpack.core.ml.inference.results.WarningInferenceResults; +import org.elasticsearch.xpack.core.ml.inference.trainedmodel.NlpConfig; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.TextClassificationConfig; import org.elasticsearch.xpack.ml.inference.deployment.PyTorchResult; import org.elasticsearch.xpack.ml.inference.nlp.tokenizers.NlpTokenizer; @@ -73,12 +74,12 @@ public void validateInputs(List inputs) { } @Override - public NlpTask.RequestBuilder getRequestBuilder() { + public NlpTask.RequestBuilder getRequestBuilder(NlpConfig config) { return requestBuilder; } @Override - public NlpTask.ResultProcessor getResultProcessor() { + public NlpTask.ResultProcessor getResultProcessor(NlpConfig config) { return this::processResult; } diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/TextEmbeddingProcessor.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/TextEmbeddingProcessor.java index 997f437ab3712..29886094d7e0e 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/TextEmbeddingProcessor.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/TextEmbeddingProcessor.java @@ -9,6 +9,7 @@ import org.elasticsearch.xpack.core.ml.inference.results.InferenceResults; import org.elasticsearch.xpack.core.ml.inference.results.TextEmbeddingResults; +import org.elasticsearch.xpack.core.ml.inference.trainedmodel.NlpConfig; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.TextEmbeddingConfig; import org.elasticsearch.xpack.ml.inference.deployment.PyTorchResult; import org.elasticsearch.xpack.ml.inference.nlp.tokenizers.NlpTokenizer; @@ -33,12 +34,12 @@ public void validateInputs(List inputs) { } @Override - public NlpTask.RequestBuilder getRequestBuilder() { + public NlpTask.RequestBuilder getRequestBuilder(NlpConfig config) { return requestBuilder; } @Override - public NlpTask.ResultProcessor getResultProcessor() { + public NlpTask.ResultProcessor getResultProcessor(NlpConfig config) { return TextEmbeddingProcessor::processResult; } diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/ZeroShotClassificationProcessor.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/ZeroShotClassificationProcessor.java new file mode 100644 index 0000000000000..eeeeb1cc2aa56 --- /dev/null +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/ZeroShotClassificationProcessor.java @@ -0,0 +1,194 @@ +/* + * 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.ml.inference.nlp; + +import org.elasticsearch.common.logging.LoggerMessageFormat; +import org.elasticsearch.xpack.core.ml.inference.results.InferenceResults; +import org.elasticsearch.xpack.core.ml.inference.results.TextClassificationResults; +import org.elasticsearch.xpack.core.ml.inference.results.TopClassEntry; +import org.elasticsearch.xpack.core.ml.inference.results.WarningInferenceResults; +import org.elasticsearch.xpack.core.ml.inference.trainedmodel.NlpConfig; +import org.elasticsearch.xpack.core.ml.inference.trainedmodel.ZeroShotClassificationConfig; +import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; +import org.elasticsearch.xpack.ml.inference.deployment.PyTorchResult; +import org.elasticsearch.xpack.ml.inference.nlp.tokenizers.NlpTokenizer; +import org.elasticsearch.xpack.ml.inference.nlp.tokenizers.TokenizationResult; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Comparator; +import java.util.List; +import java.util.Locale; +import java.util.Optional; +import java.util.stream.Collectors; +import java.util.stream.IntStream; + +public class ZeroShotClassificationProcessor implements NlpTask.Processor { + + private final NlpTokenizer tokenizer; + private final int entailmentPos; + private final int contraPos; + private final String[] labels; + private final String hypothesisTemplate; + private final boolean isMultiLabel; + + ZeroShotClassificationProcessor(NlpTokenizer tokenizer, ZeroShotClassificationConfig config) { + this.tokenizer = tokenizer; + List lowerCased = config.getClassificationLabels() + .stream() + .map(s -> s.toLowerCase(Locale.ROOT)) + .collect(Collectors.toList()); + this.entailmentPos = lowerCased.indexOf("entailment"); + this.contraPos = lowerCased.indexOf("contradiction"); + if (entailmentPos == -1 || contraPos == -1) { + throw ExceptionsHelper.badRequestException( + "zero_shot_classification requires [entailment] and [contradiction] in classification_labels" + ); + } + this.labels = Optional.ofNullable(config.getLabels()).orElse(List.of()).toArray(String[]::new); + this.hypothesisTemplate = config.getHypothesisTemplate(); + this.isMultiLabel = config.isMultiLabel(); + } + + @Override + public void validateInputs(List inputs) { + // nothing to validate + } + + @Override + public NlpTask.RequestBuilder getRequestBuilder(NlpConfig nlpConfig) { + final String[] labels; + if (nlpConfig instanceof ZeroShotClassificationConfig) { + ZeroShotClassificationConfig zeroShotConfig = (ZeroShotClassificationConfig) nlpConfig; + labels = zeroShotConfig.getLabels().toArray(new String[0]); + } else { + labels = this.labels; + } + if (this.labels == null || this.labels.length == 0) { + throw ExceptionsHelper.badRequestException("zero_shot_classification requires non-empty [labels]"); + } + return new RequestBuilder(tokenizer, labels, hypothesisTemplate); + } + + @Override + public NlpTask.ResultProcessor getResultProcessor(NlpConfig nlpConfig) { + final String[] labels; + final boolean isMultiLabel; + if (nlpConfig instanceof ZeroShotClassificationConfig) { + ZeroShotClassificationConfig zeroShotConfig = (ZeroShotClassificationConfig) nlpConfig; + labels = zeroShotConfig.getLabels().toArray(new String[0]); + isMultiLabel = zeroShotConfig.isMultiLabel(); + } else { + labels = this.labels; + isMultiLabel = this.isMultiLabel; + } + return new ResultProcessor(entailmentPos, contraPos, labels, isMultiLabel); + } + + static class RequestBuilder implements NlpTask.RequestBuilder { + + private final NlpTokenizer tokenizer; + private final String[] labels; + private final String hypothesisTemplate; + + RequestBuilder(NlpTokenizer tokenizer, String[] labels, String hypothesisTemplate) { + this.tokenizer = tokenizer; + this.labels = labels; + this.hypothesisTemplate = hypothesisTemplate; + } + + @Override + public NlpTask.Request buildRequest(List inputs, String requestId) throws IOException { + if (inputs.size() > 1) { + throw new IllegalArgumentException("Unable to do zero-shot classification on more than one text input at a time"); + } + List tokenizations = new ArrayList<>(labels.length); + for (String label : labels) { + tokenizations.add(tokenizer.tokenize(inputs.get(0), LoggerMessageFormat.format(null, hypothesisTemplate, label))); + } + TokenizationResult result = tokenizer.buildTokenizationResult(tokenizations); + return buildRequest(result, requestId); + } + + @Override + public NlpTask.Request buildRequest(TokenizationResult tokenizationResult, String requestId) throws IOException { + return tokenizer.requestBuilder().buildRequest(tokenizationResult, requestId); + } + } + + static class ResultProcessor implements NlpTask.ResultProcessor { + private final int entailmentPos; + private final int contraPos; + private final String[] labels; + private final boolean isMultiLabel; + + ResultProcessor(int entailmentPos, int contraPos, String[] labels, boolean isMultiLabel) { + this.entailmentPos = entailmentPos; + this.contraPos = contraPos; + this.labels = labels; + this.isMultiLabel = isMultiLabel; + } + + @Override + public InferenceResults processResult(TokenizationResult tokenization, PyTorchResult pyTorchResult) { + if (pyTorchResult.getInferenceResult().length < 1) { + return new WarningInferenceResults("Zero shot classification result has no data"); + } + // TODO only the first entry in the batch result is verified and + // checked. Implement for all in batch + if (pyTorchResult.getInferenceResult()[0].length != labels.length) { + return new WarningInferenceResults( + "Expected exactly [{}] values in zero shot classification result; got [{}]", + labels.length, + pyTorchResult.getInferenceResult().length + ); + } + final double[] normalizedScores; + if (isMultiLabel) { + normalizedScores = new double[pyTorchResult.getInferenceResult()[0].length]; + int v = 0; + for (double[] vals : pyTorchResult.getInferenceResult()[0]) { + if (vals.length != 3) { + return new WarningInferenceResults( + "Expected exactly [{}] values in inner zero shot classification result; got [{}]", + 3, + vals.length + ); + } + // assume entailment is `0`, softmax between entailment and contradiction + normalizedScores[v++] = NlpHelpers.convertToProbabilitiesBySoftMax( + new double[]{vals[entailmentPos], vals[contraPos]} + )[0]; + } + } else { + double[] entailmentScores = new double[pyTorchResult.getInferenceResult()[0].length]; + int v = 0; + for (double[] vals : pyTorchResult.getInferenceResult()[0]) { + if (vals.length != 3) { + return new WarningInferenceResults( + "Expected exactly [{}] values in inner zero shot classification result; got [{}]", + 3, + vals.length + ); + } + entailmentScores[v++] = vals[entailmentPos]; + } + normalizedScores = NlpHelpers.convertToProbabilitiesBySoftMax(entailmentScores); + } + + return new TextClassificationResults( + IntStream.range(0, normalizedScores.length) + .mapToObj(i -> new TopClassEntry(labels[i], normalizedScores[i])) + // Put the highest scoring class first + .sorted(Comparator.comparing(TopClassEntry::getProbability).reversed()) + .limit(labels.length) + .collect(Collectors.toList()) + ); + } + } +} diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/tokenizers/BertTokenizer.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/tokenizers/BertTokenizer.java index 48e5154261fd5..52c7c758887a4 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/tokenizers/BertTokenizer.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/tokenizers/BertTokenizer.java @@ -7,6 +7,7 @@ package org.elasticsearch.xpack.ml.inference.nlp.tokenizers; import org.elasticsearch.common.util.set.Sets; +import org.elasticsearch.core.Tuple; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.Tokenization; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; import org.elasticsearch.xpack.ml.inference.nlp.BertRequestBuilder; @@ -76,74 +77,63 @@ protected BertTokenizer(List originalVocab, this.requestBuilder = requestBuilderFactory.apply(this); } + @Override + public OptionalInt getPadToken() { + Integer pad = vocab.get(PAD_TOKEN); + if (pad != null) { + return OptionalInt.of(pad); + } else { + return OptionalInt.empty(); + } + } + + @Override + public TokenizationResult buildTokenizationResult(List tokenizations) { + TokenizationResult tokenizationResult = new TokenizationResult(originalVocab); + for (TokenizationResult.Tokenization tokenization : tokenizations) { + tokenizationResult.addTokenization(tokenization); + } + return tokenizationResult; + } + /** - * Tokenize the list of inputs according to the basic tokenization + * Tokenize the input according to the basic tokenization * options then perform Word Piece tokenization with the given vocabulary. * * The result is the Word Piece tokens, a map of the Word Piece * token position to the position of the token in the source for * each input string grouped into a {@link Tokenization}. * - * @param text Text to tokenize + * @param seq Text to tokenize * @return A {@link Tokenization} */ @Override - public TokenizationResult tokenize(List text) { - TokenizationResult tokenization = new TokenizationResult(originalVocab); - - for (String input: text) { - addTokenization(tokenization, input); - } - return tokenization; - } - - - private void addTokenization(TokenizationResult tokenization, String text) { - BasicTokenizer basicTokenizer = new BasicTokenizer(doLowerCase, doTokenizeCjKChars, doStripAccents, neverSplit); - - List delineatedTokens = basicTokenizer.tokenize(text); - List wordPieceTokens = new ArrayList<>(); - List tokenPositionMap = new ArrayList<>(); - if (withSpecialTokens) { - // insert the first token to simplify the loop counter logic later - tokenPositionMap.add(SPECIAL_TOKEN_POSITION); - } - - for (int sourceIndex = 0; sourceIndex < delineatedTokens.size(); sourceIndex++) { - String token = delineatedTokens.get(sourceIndex); - if (neverSplit.contains(token)) { - wordPieceTokens.add(new WordPieceTokenizer.TokenAndId(token, vocab.getOrDefault(token, vocab.get(UNKNOWN_TOKEN)))); - tokenPositionMap.add(sourceIndex); - } else { - List tokens = wordPieceTokenizer.tokenize(token); - for (int tokenCount = 0; tokenCount < tokens.size(); tokenCount++) { - tokenPositionMap.add(sourceIndex); - } - wordPieceTokens.addAll(tokens); - } - } - + public TokenizationResult.Tokenization tokenize(String seq) { + var innerResult = innerTokenize(seq); + List wordPieceTokens = innerResult.v1(); + List tokenPositionMap = innerResult.v2(); int numTokens = withSpecialTokens ? wordPieceTokens.size() + 2 : wordPieceTokens.size(); - List tokens = new ArrayList<>(numTokens); - int [] tokenIds = new int[numTokens]; - int [] tokenMap = new int[numTokens]; + String[] tokens = new String[numTokens]; + int[] tokenIds = new int[numTokens]; + int[] tokenMap = new int[numTokens]; if (withSpecialTokens) { - tokens.add(CLASS_TOKEN); + tokens[0] = CLASS_TOKEN; tokenIds[0] = vocab.get(CLASS_TOKEN); tokenMap[0] = SPECIAL_TOKEN_POSITION; } int i = withSpecialTokens ? 1 : 0; + final int decrementHandler = withSpecialTokens ? 1 : 0; for (WordPieceTokenizer.TokenAndId tokenAndId : wordPieceTokens) { - tokens.add(tokenAndId.getToken()); + tokens[i] = tokenAndId.getToken(); tokenIds[i] = tokenAndId.getId(); - tokenMap[i] = tokenPositionMap.get(i); + tokenMap[i] = tokenPositionMap.get(i-decrementHandler); i++; } if (withSpecialTokens) { - tokens.add(SEPARATOR_TOKEN); + tokens[i] = SEPARATOR_TOKEN; tokenIds[i] = vocab.get(SEPARATOR_TOKEN); tokenMap[i] = SPECIAL_TOKEN_POSITION; } @@ -155,18 +145,86 @@ private void addTokenization(TokenizationResult tokenization, String text) { maxSequenceLength ); } - - tokenization.addTokenization(text, tokens, tokenIds, tokenMap); + return new TokenizationResult.Tokenization(seq, tokens, tokenIds, tokenMap); } @Override - public OptionalInt getPadToken() { - Integer pad = vocab.get(PAD_TOKEN); - if (pad != null) { - return OptionalInt.of(pad); - } else { - return OptionalInt.empty(); + public TokenizationResult.Tokenization tokenize(String seq1, String seq2) { + var innerResult = innerTokenize(seq1); + List wordPieceTokenSeq1s = innerResult.v1(); + List tokenPositionMapSeq1 = innerResult.v2(); + innerResult = innerTokenize(seq2); + List wordPieceTokenSeq2s = innerResult.v1(); + List tokenPositionMapSeq2 = innerResult.v2(); + if (withSpecialTokens == false) { + throw new IllegalArgumentException("Unable to do sequence pair tokenization without special tokens"); + } + // [CLS] seq1 [SEP] seq2 [SEP] + int numTokens = wordPieceTokenSeq1s.size() + wordPieceTokenSeq2s.size() + 3; + String[] tokens = new String[numTokens]; + int[] tokenIds = new int[numTokens]; + int[] tokenMap = new int[numTokens]; + + tokens[0] = CLASS_TOKEN; + tokenIds[0] = vocab.get(CLASS_TOKEN); + tokenMap[0] = SPECIAL_TOKEN_POSITION; + + int i = 1; + for (WordPieceTokenizer.TokenAndId tokenAndId : wordPieceTokenSeq1s) { + tokens[i] = tokenAndId.getToken(); + tokenIds[i] = tokenAndId.getId(); + tokenMap[i] = tokenPositionMapSeq1.get(i - 1); + i++; + } + tokens[i] = SEPARATOR_TOKEN; + tokenIds[i] = vocab.get(SEPARATOR_TOKEN); + tokenMap[i] = SPECIAL_TOKEN_POSITION; + ++i; + + int j = 0; + for (WordPieceTokenizer.TokenAndId tokenAndId : wordPieceTokenSeq2s) { + tokens[i] = tokenAndId.getToken(); + tokenIds[i] = tokenAndId.getId(); + tokenMap[i] = tokenPositionMapSeq2.get(j); + i++; + j++; + } + + tokens[i] = SEPARATOR_TOKEN; + tokenIds[i] = vocab.get(SEPARATOR_TOKEN); + tokenMap[i] = SPECIAL_TOKEN_POSITION; + + // TODO handle seq1 truncation + if (tokenIds.length > maxSequenceLength) { + throw ExceptionsHelper.badRequestException( + "Input too large. The tokenized input length [{}] exceeds the maximum sequence length [{}]", + tokenIds.length, + maxSequenceLength + ); + } + return new TokenizationResult.Tokenization(seq1 + seq2, tokens, tokenIds, tokenMap); + } + + private Tuple, List> innerTokenize(String seq) { + BasicTokenizer basicTokenizer = new BasicTokenizer(doLowerCase, doTokenizeCjKChars, doStripAccents, neverSplit); + List delineatedTokens = basicTokenizer.tokenize(seq); + List wordPieceTokens = new ArrayList<>(); + List tokenPositionMap = new ArrayList<>(); + + for (int sourceIndex = 0; sourceIndex < delineatedTokens.size(); sourceIndex++) { + String token = delineatedTokens.get(sourceIndex); + if (neverSplit.contains(token)) { + wordPieceTokens.add(new WordPieceTokenizer.TokenAndId(token, vocab.getOrDefault(token, vocab.get(UNKNOWN_TOKEN)))); + tokenPositionMap.add(sourceIndex); + } else { + List tokens = wordPieceTokenizer.tokenize(token); + for (int tokenCount = 0; tokenCount < tokens.size(); tokenCount++) { + tokenPositionMap.add(sourceIndex); + } + wordPieceTokens.addAll(tokens); + } } + return Tuple.tuple(wordPieceTokens, tokenPositionMap); } @Override diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/tokenizers/NlpTokenizer.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/tokenizers/NlpTokenizer.java index ef8870ecc58c1..63073cc2d571a 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/tokenizers/NlpTokenizer.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/tokenizers/NlpTokenizer.java @@ -22,7 +22,11 @@ public interface NlpTokenizer { - TokenizationResult tokenize(List text); + TokenizationResult buildTokenizationResult(List tokenizations); + + TokenizationResult.Tokenization tokenize(String seq); + + TokenizationResult.Tokenization tokenize(String seq1, String seq2); NlpTask.RequestBuilder requestBuilder(); diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/tokenizers/TokenizationResult.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/tokenizers/TokenizationResult.java index 1fac5c9f096c3..418cf7bff4746 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/tokenizers/TokenizationResult.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/tokenizers/TokenizationResult.java @@ -29,26 +29,31 @@ public List getTokenizations() { return tokenizations; } - public void addTokenization(String input, List tokens, int[] tokenIds, int[] tokenMap) { + public void addTokenization(String input, String[] tokens, int[] tokenIds, int[] tokenMap) { maxLength = Math.max(maxLength, tokenIds.length); tokenizations.add(new Tokenization(input, tokens, tokenIds, tokenMap)); } + public void addTokenization(Tokenization tokenization) { + maxLength = Math.max(maxLength, tokenization.tokenIds.length); + tokenizations.add(tokenization); + } + public int getLongestSequenceLength() { return maxLength; } public static class Tokenization { - String input; - private final List tokens; + private final String inputSeqs; + private final String[] tokens; private final int[] tokenIds; private final int[] tokenMap; - public Tokenization(String input, List tokens, int[] tokenIds, int[] tokenMap) { - assert tokens.size() == tokenIds.length; + public Tokenization(String input, String[] tokens, int[] tokenIds, int[] tokenMap) { + assert tokens.length == tokenIds.length; assert tokenIds.length == tokenMap.length; - this.input = input; + this.inputSeqs = input; this.tokens = tokens; this.tokenIds = tokenIds; this.tokenMap = tokenMap; @@ -59,7 +64,7 @@ public Tokenization(String input, List tokens, int[] tokenIds, int[] tok * * @return A list of tokens */ - public List getTokens() { + public String[] getTokens() { return tokens; } @@ -84,7 +89,7 @@ public int[] getTokenMap() { } public String getInput() { - return input; + return inputSeqs; } } } diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/FillMaskProcessorTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/FillMaskProcessorTests.java index 5eb8e84647303..3747954df85eb 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/FillMaskProcessorTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/FillMaskProcessorTests.java @@ -41,7 +41,7 @@ public void testProcessResults() { String input = "The capital of " + BertTokenizer.MASK_TOKEN + " is Paris"; List vocab = Arrays.asList("The", "capital", "of", BertTokenizer.MASK_TOKEN, "is", "Paris", "France"); - List tokens = Arrays.asList(input.split(" ")); + String[] tokens = input.split(" "); int[] tokenMap = new int[] {0, 1, 2, 3, 4, 5}; int[] tokenIds = new int[] {0, 1, 2, 3, 4, 5}; @@ -68,7 +68,7 @@ public void testProcessResults() { public void testProcessResults_GivenMissingTokens() { TokenizationResult tokenization = new TokenizationResult(Collections.emptyList()); - tokenization.addTokenization("", Collections.emptyList(), new int[] {}, new int[] {}); + tokenization.addTokenization("", new String[]{}, new int[] {}, new int[] {}); FillMaskConfig config = new FillMaskConfig(new VocabularyConfig("test-index"), null); FillMaskProcessor processor = new FillMaskProcessor(mock(BertTokenizer.class), config); diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/NerProcessorTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/NerProcessorTests.java index 2a03ff0a28397..a3837fe5c4e26 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/NerProcessorTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/NerProcessorTests.java @@ -222,6 +222,6 @@ private static TokenizationResult tokenize(List vocab, String input) { vocab, new BertTokenization(true, false, null) ).setDoLowerCase(true).setWithSpecialTokens(false).build(); - return tokenizer.tokenize(List.of(input)); + return tokenizer.buildTokenizationResult(List.of(tokenizer.tokenize(input))); } } diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/TextClassificationProcessorTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/TextClassificationProcessorTests.java index cc996c6b45170..5b0d99112faba 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/TextClassificationProcessorTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/TextClassificationProcessorTests.java @@ -65,7 +65,7 @@ public void testBuildRequest() throws IOException { TextClassificationConfig config = new TextClassificationConfig(new VocabularyConfig("test-index"), null, null, null); TextClassificationProcessor processor = new TextClassificationProcessor(tokenizer, config); - NlpTask.Request request = processor.getRequestBuilder().buildRequest(List.of("Elasticsearch fun"), "request1"); + NlpTask.Request request = processor.getRequestBuilder(config).buildRequest(List.of("Elasticsearch fun"), "request1"); Map jsonDocAsMap = XContentHelper.convertToMap(request.processInput, true, XContentType.JSON).v2(); diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/tokenizers/BertTokenizerTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/tokenizers/BertTokenizerTests.java index c176a0c3a2227..53b31540be509 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/tokenizers/BertTokenizerTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/tokenizers/BertTokenizerTests.java @@ -15,7 +15,7 @@ import java.util.Collections; import java.util.List; -import static org.hamcrest.Matchers.contains; +import static org.hamcrest.Matchers.arrayContaining; import static org.hamcrest.Matchers.hasSize; public class BertTokenizerTests extends ESTestCase { @@ -26,9 +26,8 @@ public void testTokenize() { new BertTokenization(null, false, null) ).build(); - TokenizationResult tr = tokenizer.tokenize(List.of("Elasticsearch fun")); - TokenizationResult.Tokenization tokenization = tr.getTokenizations().get(0); - assertThat(tokenization.getTokens(), contains("Elastic", "##search", "fun")); + TokenizationResult.Tokenization tokenization = tokenizer.tokenize("Elasticsearch fun"); + assertThat(tokenization.getTokens(), arrayContaining("Elastic", "##search", "fun")); assertArrayEquals(new int[] {0, 1, 2}, tokenization.getTokenIds()); assertArrayEquals(new int[] {0, 0, 1}, tokenization.getTokenMap()); } @@ -39,9 +38,8 @@ public void testTokenizeAppendSpecialTokens() { Tokenization.createDefault() ).build(); - TokenizationResult tr = tokenizer.tokenize(List.of("elasticsearch fun")); - TokenizationResult.Tokenization tokenization = tr.getTokenizations().get(0); - assertThat(tokenization.getTokens(), contains("[CLS]", "elastic", "##search", "fun", "[SEP]")); + TokenizationResult.Tokenization tokenization = tokenizer.tokenize("elasticsearch fun"); + assertThat(tokenization.getTokens(), arrayContaining("[CLS]", "elastic", "##search", "fun", "[SEP]")); assertArrayEquals(new int[] {3, 0, 1, 2, 4}, tokenization.getTokenIds()); assertArrayEquals(new int[] {-1, 0, 0, 1, -1}, tokenization.getTokenMap()); } @@ -56,9 +54,8 @@ public void testNeverSplitTokens() { .setWithSpecialTokens(false) .build(); - TokenizationResult tr = tokenizer.tokenize(List.of("Elasticsearch " + specialToken + " fun")); - TokenizationResult.Tokenization tokenization = tr.getTokenizations().get(0); - assertThat(tokenization.getTokens(), contains("Elastic", "##search", specialToken, "fun")); + TokenizationResult.Tokenization tokenization = tokenizer.tokenize("Elasticsearch " + specialToken + " fun"); + assertThat(tokenization.getTokens(), arrayContaining("Elastic", "##search", specialToken, "fun")); assertArrayEquals(new int[] {0, 1, 3, 2}, tokenization.getTokenIds()); assertArrayEquals(new int[] {0, 0, 1, 2}, tokenization.getTokenMap()); } @@ -72,15 +69,13 @@ public void testDoLowerCase() { .setWithSpecialTokens(false) .build(); - TokenizationResult tr = tokenizer.tokenize(List.of("Elasticsearch fun")); - TokenizationResult.Tokenization tokenization = tr.getTokenizations().get(0); - assertThat(tokenization.getTokens(), contains(BertTokenizer.UNKNOWN_TOKEN, "fun")); + TokenizationResult.Tokenization tokenization = tokenizer.tokenize("Elasticsearch fun"); + assertThat(tokenization.getTokens(), arrayContaining(BertTokenizer.UNKNOWN_TOKEN, "fun")); assertArrayEquals(new int[] {3, 2}, tokenization.getTokenIds()); assertArrayEquals(new int[] {0, 1}, tokenization.getTokenMap()); - tr = tokenizer.tokenize(List.of("elasticsearch fun")); - tokenization = tr.getTokenizations().get(0); - assertThat(tokenization.getTokens(), contains("elastic", "##search", "fun")); + tokenization = tokenizer.tokenize("elasticsearch fun"); + assertThat(tokenization.getTokens(), arrayContaining("elastic", "##search", "fun")); } { @@ -89,9 +84,8 @@ public void testDoLowerCase() { .setWithSpecialTokens(false) .build(); - TokenizationResult tr = tokenizer.tokenize(List.of("Elasticsearch fun")); - TokenizationResult.Tokenization tokenization = tr.getTokenizations().get(0); - assertThat(tokenization.getTokens(), contains("elastic", "##search", "fun")); + TokenizationResult.Tokenization tokenization = tokenizer.tokenize("Elasticsearch fun"); + assertThat(tokenization.getTokens(), arrayContaining("elastic", "##search", "fun")); } } @@ -101,15 +95,13 @@ public void testPunctuation() { Tokenization.createDefault() ).setWithSpecialTokens(false).build(); - TokenizationResult tr = tokenizer.tokenize(List.of("Elasticsearch, fun.")); - TokenizationResult.Tokenization tokenization = tr.getTokenizations().get(0); - assertThat(tokenization.getTokens(), contains("Elastic", "##search", ",", "fun", ".")); + TokenizationResult.Tokenization tokenization = tokenizer.tokenize("Elasticsearch, fun."); + assertThat(tokenization.getTokens(), arrayContaining("Elastic", "##search", ",", "fun", ".")); assertArrayEquals(new int[] {0, 1, 4, 2, 3}, tokenization.getTokenIds()); assertArrayEquals(new int[] {0, 0, 1, 2, 3}, tokenization.getTokenMap()); - tr = tokenizer.tokenize(List.of("Elasticsearch, fun [MASK].")); - tokenization = tr.getTokenizations().get(0); - assertThat(tokenization.getTokens(), contains("Elastic", "##search", ",", "fun", "[MASK]", ".")); + tokenization = tokenizer.tokenize("Elasticsearch, fun [MASK]."); + assertThat(tokenization.getTokens(), arrayContaining("Elastic", "##search", ",", "fun", "[MASK]", ".")); assertArrayEquals(new int[] {0, 1, 4, 2, 5, 3}, tokenization.getTokenIds()); assertArrayEquals(new int[] {0, 0, 1, 2, 3, 4}, tokenization.getTokenMap()); } @@ -124,31 +116,83 @@ public void testBatchInput() { new BertTokenization(null, false, null) ).build(); - TokenizationResult tr = tokenizer.tokenize(List.of("Elasticsearch", - "my little red car", - "Godzilla day", - "Godzilla Pancake red car day" - )); + TokenizationResult tr = tokenizer.buildTokenizationResult( + List.of( + tokenizer.tokenize("Elasticsearch"), + tokenizer.tokenize("my little red car"), + tokenizer.tokenize("Godzilla day"), + tokenizer.tokenize("Godzilla Pancake red car day") + ) + ); assertThat(tr.getTokenizations(), hasSize(4)); TokenizationResult.Tokenization tokenization = tr.getTokenizations().get(0); - assertThat(tokenization.getTokens(), contains("Elastic", "##search")); + assertThat(tokenization.getTokens(), arrayContaining("Elastic", "##search")); assertArrayEquals(new int[] {0, 1}, tokenization.getTokenIds()); assertArrayEquals(new int[] {0, 0}, tokenization.getTokenMap()); tokenization = tr.getTokenizations().get(1); - assertThat(tokenization.getTokens(), contains("my", "little", "red", "car")); + assertThat(tokenization.getTokens(), arrayContaining("my", "little", "red", "car")); assertArrayEquals(new int[] {5, 6, 7, 8}, tokenization.getTokenIds()); assertArrayEquals(new int[] {0, 1, 2, 3}, tokenization.getTokenMap()); tokenization = tr.getTokenizations().get(2); - assertThat(tokenization.getTokens(), contains("God", "##zilla", "day")); + assertThat(tokenization.getTokens(), arrayContaining("God", "##zilla", "day")); assertArrayEquals(new int[] {9, 10, 4}, tokenization.getTokenIds()); assertArrayEquals(new int[] {0, 0, 1}, tokenization.getTokenMap()); tokenization = tr.getTokenizations().get(3); - assertThat(tokenization.getTokens(), contains("God", "##zilla", "Pancake", "red", "car", "day")); + assertThat(tokenization.getTokens(), arrayContaining("God", "##zilla", "Pancake", "red", "car", "day")); assertArrayEquals(new int[] {9, 10, 3, 7, 8, 4}, tokenization.getTokenIds()); assertArrayEquals(new int[] {0, 0, 1, 2, 3, 4}, tokenization.getTokenMap()); } + + public void testMultiSeqTokenization() { + List vocab = List.of( + "Elastic", + "##search", + "is", + "fun", + "my", + "little", + "red", + "car", + "God", + "##zilla", + BertTokenizer.CLASS_TOKEN, + BertTokenizer.SEPARATOR_TOKEN + ); + BertTokenizer tokenizer = BertTokenizer.builder(vocab, Tokenization.createDefault()) + .setDoLowerCase(false) + .setWithSpecialTokens(true) + .build(); + TokenizationResult.Tokenization tokenization = tokenizer.tokenize("Elasticsearch is fun", "Godzilla my little red car"); + assertThat( + tokenization.getTokens(), + arrayContaining( + BertTokenizer.CLASS_TOKEN, + "Elastic", + "##search", + "is", + "fun", + BertTokenizer.SEPARATOR_TOKEN, + "God", + "##zilla", + "my", + "little", + "red", + "car", + BertTokenizer.SEPARATOR_TOKEN + ) + ); + assertArrayEquals(new int[] { 10, 0, 1, 2, 3, 11, 8, 9, 4, 5, 6, 7, 11 }, tokenization.getTokenIds()); + } + + public void testMultiSeqRequiresSpecialTokens() { + BertTokenizer tokenizer = BertTokenizer.builder(List.of("foo"), Tokenization.createDefault()) + .setDoLowerCase(false) + .setWithSpecialTokens(false) + .build(); + expectThrows(Exception.class, () -> tokenizer.tokenize("foo", "foo")); + } } From 57267f4e99ce3ed1fa177daf5c2d8a8af691315d Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Tue, 28 Sep 2021 16:37:41 +0200 Subject: [PATCH 033/250] Resolve aliases from IndexAbstraction (#78372) Resolve aliases from IndexAbstraction.DataStream and IndexAbstraction.Index Helps with this specifically: https://github.com/elastic/elasticsearch/pull/78327/files#r717141768 Relates to #78327 --- .../cluster/metadata/IndexAbstraction.java | 28 ++++++- .../cluster/metadata/Metadata.java | 39 ++++++---- .../cluster/metadata/MetadataTests.java | 74 ++++++++++++++++--- .../xpack/security/authz/RBACEngineTests.java | 4 +- 4 files changed, 117 insertions(+), 28 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/IndexAbstraction.java b/server/src/main/java/org/elasticsearch/cluster/metadata/IndexAbstraction.java index c2f6267c18dc5..e4fe233ef3b0a 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/IndexAbstraction.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/IndexAbstraction.java @@ -74,6 +74,13 @@ default boolean isDataStreamRelated() { return false; } + /** + * @return the names of aliases referring to this instance. + * Returns null if aliases can't point to this instance. + */ + @Nullable + List getAliases(); + /** * An index abstraction type. */ @@ -161,6 +168,11 @@ public boolean isHidden() { public boolean isSystem() { return concreteIndex.isSystem(); } + + @Override + public List getAliases() { + return List.of(concreteIndex.getAliases().keys().toArray(String.class)); + } } /** @@ -253,6 +265,11 @@ public boolean isDataStreamRelated() { return dataStreamAlias; } + @Override + public List getAliases() { + return null; + } + private void validateAliasProperties() { // Validate hidden status final Map> groupedByHiddenStatus = referenceIndexMetadatas.stream() @@ -302,11 +319,15 @@ class DataStream implements IndexAbstraction { private final org.elasticsearch.cluster.metadata.DataStream dataStream; private final List dataStreamIndices; private final IndexMetadata writeIndex; + private final List referencedByDataStreamAliases; - public DataStream(org.elasticsearch.cluster.metadata.DataStream dataStream, List dataStreamIndices) { + public DataStream(org.elasticsearch.cluster.metadata.DataStream dataStream, + List dataStreamIndices, + List aliases) { this.dataStream = dataStream; this.dataStreamIndices = List.copyOf(dataStreamIndices); this.writeIndex = dataStreamIndices.get(dataStreamIndices.size() - 1); + this.referencedByDataStreamAliases = aliases; } @Override @@ -349,6 +370,11 @@ public boolean isDataStreamRelated() { return true; } + @Override + public List getAliases() { + return referencedByDataStreamAliases; + } + public org.elasticsearch.cluster.metadata.DataStream getDataStream() { return dataStream; } diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/Metadata.java b/server/src/main/java/org/elasticsearch/cluster/metadata/Metadata.java index 199b6dcb2cea0..95e817d8e823b 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/Metadata.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/Metadata.java @@ -63,6 +63,7 @@ import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; +import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Objects; @@ -1525,24 +1526,14 @@ private SortedMap buildIndicesLookup() { DataStreamMetadata dataStreamMetadata = (DataStreamMetadata) this.customs.get(DataStreamMetadata.TYPE); // If there are no indices, then skip data streams. This happens only when metadata is read from disk if (dataStreamMetadata != null && indices.size() > 0) { - for (DataStream dataStream : dataStreamMetadata.dataStreams().values()) { - List backingIndices = dataStream.getIndices().stream() - .map(index -> indices.get(index.getName())) - .collect(Collectors.toList()); - assert backingIndices.isEmpty() == false; - assert backingIndices.contains(null) == false; - - IndexAbstraction existing = indicesLookup.put(dataStream.getName(), - new IndexAbstraction.DataStream(dataStream, backingIndices)); - assert existing == null : "duplicate data stream for " + dataStream.getName(); - - for (Index i : dataStream.getIndices()) { - indexToDataStreamLookup.put(i.getName(), dataStream); - } - } + Map> dataStreamToAliasLookup = new HashMap<>(); for (DataStreamAlias alias : dataStreamMetadata.getDataStreamAliases().values()) { List allIndicesOfAllDataStreams = alias.getDataStreams().stream() - .map(name -> dataStreamMetadata.dataStreams().get(name)) + .map(name -> { + List aliases = dataStreamToAliasLookup.computeIfAbsent(name, k -> new LinkedList<>()); + aliases.add(alias.getName()); + return dataStreamMetadata.dataStreams().get(name); + }) .flatMap(ds -> ds.getIndices().stream()) .map(index -> indices.get(index.getName())) .collect(Collectors.toList()); @@ -1555,6 +1546,22 @@ private SortedMap buildIndicesLookup() { new IndexAbstraction.Alias(alias, allIndicesOfAllDataStreams, writeIndexOfWriteDataStream)); assert existing == null : "duplicate data stream alias for " + alias.getName(); } + for (DataStream dataStream : dataStreamMetadata.dataStreams().values()) { + List backingIndices = dataStream.getIndices().stream() + .map(index -> indices.get(index.getName())) + .collect(Collectors.toList()); + assert backingIndices.isEmpty() == false; + assert backingIndices.contains(null) == false; + + List aliases = dataStreamToAliasLookup.getOrDefault(dataStream.getName(), List.of()); + IndexAbstraction existing = indicesLookup.put(dataStream.getName(), + new IndexAbstraction.DataStream(dataStream, backingIndices, aliases)); + assert existing == null : "duplicate data stream for " + dataStream.getName(); + + for (Index i : dataStream.getIndices()) { + indexToDataStreamLookup.put(i.getName(), dataStream); + } + } } Map> aliasToIndices = new HashMap<>(); diff --git a/server/src/test/java/org/elasticsearch/cluster/metadata/MetadataTests.java b/server/src/test/java/org/elasticsearch/cluster/metadata/MetadataTests.java index 10a632b6054c8..66369532798b9 100644 --- a/server/src/test/java/org/elasticsearch/cluster/metadata/MetadataTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/metadata/MetadataTests.java @@ -53,6 +53,7 @@ import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.containsInAnyOrder; import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.empty; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.greaterThanOrEqualTo; import static org.hamcrest.Matchers.is; @@ -1021,14 +1022,7 @@ public void testBuildIndicesLookupForDataStreams() { int numDataStreams = randomIntBetween(2, 8); for (int i = 0; i < numDataStreams; i++) { String name = "data-stream-" + i; - int numBackingIndices = randomIntBetween(1, 4); - List indices = new ArrayList<>(numBackingIndices); - for (int j = 1; j <= numBackingIndices; j++) { - IndexMetadata idx = createBackingIndex(name, j).build(); - indices.add(idx.getIndex()); - b.put(idx, true); - } - b.put(new DataStream(name, createTimestampField("@timestamp"), indices)); + addDataStream(name, b); } Metadata metadata = b.build(); @@ -1048,6 +1042,68 @@ public void testBuildIndicesLookupForDataStreams() { } } + public void testBuildIndicesLookupForDataStreamAliases() { + Metadata.Builder b = Metadata.builder(); + + addDataStream("d1", b); + addDataStream("d2", b); + addDataStream("d3", b); + addDataStream("d4", b); + + b.put("a1", "d1", null, null); + b.put("a1", "d2", null, null); + b.put("a2", "d3", null, null); + b.put("a3", "d1", null, null); + + Metadata metadata = b.build(); + assertThat(metadata.dataStreams().size(), equalTo(4)); + IndexAbstraction value = metadata.getIndicesLookup().get("d1"); + assertThat(value, notNullValue()); + assertThat(value.getType(), equalTo(IndexAbstraction.Type.DATA_STREAM)); + assertThat(value.getAliases(), containsInAnyOrder("a1", "a3")); + + value = metadata.getIndicesLookup().get("d2"); + assertThat(value, notNullValue()); + assertThat(value.getType(), equalTo(IndexAbstraction.Type.DATA_STREAM)); + assertThat(value.getAliases(), contains("a1")); + + value = metadata.getIndicesLookup().get("d3"); + assertThat(value, notNullValue()); + assertThat(value.getType(), equalTo(IndexAbstraction.Type.DATA_STREAM)); + assertThat(value.getAliases(), contains("a2")); + + value = metadata.getIndicesLookup().get("d4"); + assertThat(value, notNullValue()); + assertThat(value.getType(), equalTo(IndexAbstraction.Type.DATA_STREAM)); + assertThat(value.getAliases(), empty()); + + value = metadata.getIndicesLookup().get("a1"); + assertThat(value, notNullValue()); + assertThat(value.getType(), equalTo(IndexAbstraction.Type.ALIAS)); + assertThat(value.getAliases(), nullValue()); + + value = metadata.getIndicesLookup().get("a2"); + assertThat(value, notNullValue()); + assertThat(value.getType(), equalTo(IndexAbstraction.Type.ALIAS)); + assertThat(value.getAliases(), nullValue()); + + value = metadata.getIndicesLookup().get("a3"); + assertThat(value, notNullValue()); + assertThat(value.getType(), equalTo(IndexAbstraction.Type.ALIAS)); + assertThat(value.getAliases(), nullValue()); + } + + private void addDataStream(String name, Metadata.Builder b) { + int numBackingIndices = randomIntBetween(1, 4); + List indices = new ArrayList<>(numBackingIndices); + for (int j = 1; j <= numBackingIndices; j++) { + IndexMetadata idx = createBackingIndex(name, j).build(); + indices.add(idx.getIndex()); + b.put(idx, true); + } + b.put(new DataStream(name, createTimestampField("@timestamp"), indices)); + } + public void testIndicesLookupRecordsDataStreamForBackingIndices() { final int numIndices = randomIntBetween(2, 5); final int numBackingIndices = randomIntBetween(2, 5); @@ -1149,7 +1205,7 @@ public void testValidateDataStreamsAllowsPrefixedBackingIndices() { backingIndices.stream().map(IndexMetadata::getIndex).collect(Collectors.toList()) ); - IndexAbstraction.DataStream dataStreamAbstraction = new IndexAbstraction.DataStream(dataStream, backingIndices); + IndexAbstraction.DataStream dataStreamAbstraction = new IndexAbstraction.DataStream(dataStream, backingIndices, List.of()); // manually building the indices lookup as going through Metadata.Builder#build would trigger the validate method already SortedMap indicesLookup = new TreeMap<>(); for (IndexMetadata indexMeta : backingIndices) { diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/RBACEngineTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/RBACEngineTests.java index 999f967c48d4e..56a63d0e77697 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/RBACEngineTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/RBACEngineTests.java @@ -1067,7 +1067,7 @@ public void testBackingIndicesAreIncludedForAuthorizedDataStreams() { } DataStream ds = new DataStream(dataStreamName, null, backingIndices.stream().map(IndexMetadata::getIndex).collect(Collectors.toList())); - IndexAbstraction.DataStream iads = new IndexAbstraction.DataStream(ds, backingIndices); + IndexAbstraction.DataStream iads = new IndexAbstraction.DataStream(ds, backingIndices, List.of()); lookup.put(ds.getName(), iads); for (IndexMetadata im : backingIndices) { lookup.put(im.getIndex().getName(), new IndexAbstraction.Index(im, iads)); @@ -1100,7 +1100,7 @@ public void testExplicitMappingUpdatesAreNotGrantedWithIngestPrivileges() { } DataStream ds = new DataStream(dataStreamName, null, backingIndices.stream().map(IndexMetadata::getIndex).collect(Collectors.toList())); - IndexAbstraction.DataStream iads = new IndexAbstraction.DataStream(ds, backingIndices); + IndexAbstraction.DataStream iads = new IndexAbstraction.DataStream(ds, backingIndices, List.of()); lookup.put(ds.getName(), iads); for (IndexMetadata im : backingIndices) { lookup.put(im.getIndex().getName(), new IndexAbstraction.Index(im, iads)); From f9cbacb69a4865287eac602a871d72eb7ebb1728 Mon Sep 17 00:00:00 2001 From: Jack Conradson Date: Tue, 28 Sep 2021 08:36:47 -0700 Subject: [PATCH 034/250] Split up Painless Fields API conversion tests (#78345) This change has three small parts. * Refactors the tests to have a base test class that contains predefined fields for each relevant type conversion. This base test class allows availability of predefined fields for any new fields added outside of core. * Splits the conversions test cases into a one to one matching for each possible conversion where we do field type to other field type, and if possible, the reverse as well within a single test. * Fixes a bug where we relied on the delegating method values for get long and get double, but in some cases this was giving non-converted data. --- .../index/fielddata/ScriptDocValues.java | 4 +- .../script/field/BigIntegerField.java | 33 +- .../script/field/BooleanField.java | 8 +- .../script/field/DateMillisField.java | 4 +- .../script/field/DateNanosField.java | 4 +- .../script/field/DelegatingFieldValues.java | 10 - .../script/field/DoubleField.java | 24 +- .../elasticsearch/script/field/LongField.java | 12 +- .../script/field/StringField.java | 23 +- .../script/field/ConvertersTestBase.java | 509 ++++++++++++++++++ .../script/field/ConvertersTests.java | 384 +++++-------- .../xpack/unsignedlong/UnsignedLongField.java | 16 +- 12 files changed, 723 insertions(+), 308 deletions(-) create mode 100644 server/src/test/java/org/elasticsearch/script/field/ConvertersTestBase.java diff --git a/server/src/main/java/org/elasticsearch/index/fielddata/ScriptDocValues.java b/server/src/main/java/org/elasticsearch/index/fielddata/ScriptDocValues.java index 62a03e6da175d..ca7d2f0e5d66f 100644 --- a/server/src/main/java/org/elasticsearch/index/fielddata/ScriptDocValues.java +++ b/server/src/main/java/org/elasticsearch/index/fielddata/ScriptDocValues.java @@ -681,12 +681,12 @@ public final String getValue() { @Override public long getLongValue() { - return StringField.toLong(get(0)); + return Long.parseLong(get(0)); } @Override public double getDoubleValue() { - return StringField.toDouble(get(0)); + return Double.parseDouble(get(0)); } @Override diff --git a/server/src/main/java/org/elasticsearch/script/field/BigIntegerField.java b/server/src/main/java/org/elasticsearch/script/field/BigIntegerField.java index 03a0f4d73ddf8..5eab119f155de 100644 --- a/server/src/main/java/org/elasticsearch/script/field/BigIntegerField.java +++ b/server/src/main/java/org/elasticsearch/script/field/BigIntegerField.java @@ -8,7 +8,6 @@ package org.elasticsearch.script.field; -import java.math.BigInteger; import java.util.List; import java.util.stream.Collectors; @@ -21,10 +20,10 @@ public class BigIntegerField extends Field { * Longs and Doubles are wrapped as BigIntegers. * Strings are parsed as either Longs or Doubles and wrapped in a BigInteger. */ - public static final Converter BigInteger; + public static final Converter BigInteger; static { - BigInteger = new Converter() { + BigInteger = new Converter() { @Override public BigIntegerField convert(Field sourceField) { if (sourceField instanceof LongField) { @@ -60,8 +59,8 @@ public Class getFieldClass() { } @Override - public Class getTargetClass() { - return BigInteger.class; + public Class getTargetClass() { + return java.math.BigInteger.class; } }; } @@ -69,43 +68,33 @@ public Class getTargetClass() { /* ---- Conversion Helpers To Other Fields ---- */ public static LongField toLongField(BigIntegerField sourceField) { - FieldValues fv = sourceField.getFieldValues(); - return new LongField(sourceField.getName(), new DelegatingFieldValues(fv) { + FieldValues fv = sourceField.getFieldValues(); + return new LongField(sourceField.getName(), new DelegatingFieldValues(fv) { @Override public List getValues() { - return values.getValues().stream().map(BigIntegerField::toLong).collect(Collectors.toList()); + return values.getValues().stream().map(java.math.BigInteger::longValue).collect(Collectors.toList()); } @Override public Long getNonPrimitiveValue() { - return toLong(values.getNonPrimitiveValue()); + return values.getNonPrimitiveValue().longValue(); } @Override public long getLongValue() { - return toLong(values.getNonPrimitiveValue()); + return values.getLongValue(); } @Override public double getDoubleValue() { - return toDouble(values.getNonPrimitiveValue()); + return values.getDoubleValue(); } }); } - /* ---- Conversion Helpers To Other Types ---- */ - - public static long toLong(BigInteger bigInteger) { - return bigInteger.longValue(); - } - - public static double toDouble(BigInteger bigInteger) { - return bigInteger.doubleValue(); - } - /* ---- Big Integer Field Members ---- */ - public BigIntegerField(String name, FieldValues values) { + public BigIntegerField(String name, FieldValues values) { super(name, values); } } diff --git a/server/src/main/java/org/elasticsearch/script/field/BooleanField.java b/server/src/main/java/org/elasticsearch/script/field/BooleanField.java index 951a31d80c586..eec6dc453df2a 100644 --- a/server/src/main/java/org/elasticsearch/script/field/BooleanField.java +++ b/server/src/main/java/org/elasticsearch/script/field/BooleanField.java @@ -20,7 +20,7 @@ public static LongField toLongField(BooleanField sourceField) { return new LongField(sourceField.getName(), new DelegatingFieldValues(fv) { @Override public List getValues() { - return values.getValues().stream().map(bool -> bool ? 1L : 0L).collect(Collectors.toList()); + return values.getValues().stream().map(BooleanField::toLong).collect(Collectors.toList()); } @Override @@ -30,12 +30,12 @@ public Long getNonPrimitiveValue() { @Override public long getLongValue() { - return toLong(values.getNonPrimitiveValue()); + return values.getLongValue(); } @Override public double getDoubleValue() { - return toLong(values.getNonPrimitiveValue()); + return (long)values.getDoubleValue(); } }); } @@ -47,7 +47,7 @@ public static long toLong(boolean bool) { } public static double toDouble(boolean bool) { - return bool ? 1.0d : 0.0d; + return bool ? 1.0 : 0.0; } /* ---- Boolean Field Members ---- */ diff --git a/server/src/main/java/org/elasticsearch/script/field/DateMillisField.java b/server/src/main/java/org/elasticsearch/script/field/DateMillisField.java index ce24ee7f31319..19beaa251dbe0 100644 --- a/server/src/main/java/org/elasticsearch/script/field/DateMillisField.java +++ b/server/src/main/java/org/elasticsearch/script/field/DateMillisField.java @@ -32,12 +32,12 @@ public Long getNonPrimitiveValue() { @Override public long getLongValue() { - return toLong(values.getNonPrimitiveValue()); + return values.getLongValue(); } @Override public double getDoubleValue() { - return toLong(values.getNonPrimitiveValue()); + return (long)values.getDoubleValue(); } }); } diff --git a/server/src/main/java/org/elasticsearch/script/field/DateNanosField.java b/server/src/main/java/org/elasticsearch/script/field/DateNanosField.java index 9d2ce50660bbe..c169e762731ba 100644 --- a/server/src/main/java/org/elasticsearch/script/field/DateNanosField.java +++ b/server/src/main/java/org/elasticsearch/script/field/DateNanosField.java @@ -38,12 +38,12 @@ public Long getNonPrimitiveValue() { @Override public long getLongValue() { - return toLong(values.getNonPrimitiveValue()); + return values.getLongValue(); } @Override public double getDoubleValue() { - return toLong(values.getNonPrimitiveValue()); + return (long)values.getDoubleValue(); } }); } diff --git a/server/src/main/java/org/elasticsearch/script/field/DelegatingFieldValues.java b/server/src/main/java/org/elasticsearch/script/field/DelegatingFieldValues.java index 5a08bd9aababf..fce2bd7a486c5 100644 --- a/server/src/main/java/org/elasticsearch/script/field/DelegatingFieldValues.java +++ b/server/src/main/java/org/elasticsearch/script/field/DelegatingFieldValues.java @@ -28,14 +28,4 @@ public boolean isEmpty() { public int size() { return values.size(); } - - @Override - public long getLongValue() { - return values.getLongValue(); - } - - @Override - public double getDoubleValue() { - return values.getDoubleValue(); - } } diff --git a/server/src/main/java/org/elasticsearch/script/field/DoubleField.java b/server/src/main/java/org/elasticsearch/script/field/DoubleField.java index e5080335bcb00..75411c890dc0c 100644 --- a/server/src/main/java/org/elasticsearch/script/field/DoubleField.java +++ b/server/src/main/java/org/elasticsearch/script/field/DoubleField.java @@ -19,7 +19,7 @@ public class DoubleField extends Field { public static BigIntegerField toBigIntegerField(DoubleField sourceField) { FieldValues fv = sourceField.getFieldValues(); - return new BigIntegerField(sourceField.getName(), new DelegatingFieldValues(fv) { + return new BigIntegerField(sourceField.getName(), new DelegatingFieldValues(fv) { @Override public List getValues() { return values.getValues().stream().map(DoubleField::toBigInteger).collect(Collectors.toList()); @@ -27,7 +27,17 @@ public List getValues() { @Override public BigInteger getNonPrimitiveValue() { - return toBigInteger(values.getDoubleValue()); + return toBigInteger(values.getNonPrimitiveValue()); + } + + @Override + public long getLongValue() { + return values.getLongValue(); + } + + @Override + public double getDoubleValue() { + return toBigInteger(values.getDoubleValue()).doubleValue(); } }); } @@ -42,8 +52,18 @@ public List getValues() { @Override public Long getNonPrimitiveValue() { + return values.getNonPrimitiveValue().longValue(); + } + + @Override + public long getLongValue() { return values.getLongValue(); } + + @Override + public double getDoubleValue() { + return (long)values.getDoubleValue(); + } }); } diff --git a/server/src/main/java/org/elasticsearch/script/field/LongField.java b/server/src/main/java/org/elasticsearch/script/field/LongField.java index f131c8fecdaef..c6c3beb9f628b 100644 --- a/server/src/main/java/org/elasticsearch/script/field/LongField.java +++ b/server/src/main/java/org/elasticsearch/script/field/LongField.java @@ -82,7 +82,17 @@ public List getValues() { @Override public BigInteger getNonPrimitiveValue() { - return BigInteger.valueOf(values.getLongValue()); + return BigInteger.valueOf(values.getNonPrimitiveValue()); + } + + @Override + public long getLongValue() { + return values.getLongValue(); + } + + @Override + public double getDoubleValue() { + return DoubleField.toBigInteger(values.getDoubleValue()).doubleValue(); } }); } diff --git a/server/src/main/java/org/elasticsearch/script/field/StringField.java b/server/src/main/java/org/elasticsearch/script/field/StringField.java index 95df4e5fd0e98..4a15e63aecc5f 100644 --- a/server/src/main/java/org/elasticsearch/script/field/StringField.java +++ b/server/src/main/java/org/elasticsearch/script/field/StringField.java @@ -33,12 +33,12 @@ public BigInteger getNonPrimitiveValue() { @Override public long getLongValue() { - return getNonPrimitiveValue().longValue(); + return values.getLongValue(); } @Override public double getDoubleValue() { - return getNonPrimitiveValue().doubleValue(); + return DoubleField.toBigInteger(values.getDoubleValue()).doubleValue(); } }); } @@ -48,23 +48,22 @@ public static LongField toLongField(StringField sourceField) { return new LongField(sourceField.getName(), new DelegatingFieldValues(fv) { @Override public List getValues() { - return values.getValues().stream().map(StringField::toLong).collect(Collectors.toList()); + return values.getValues().stream().map(Long::parseLong).collect(Collectors.toList()); } @Override public Long getNonPrimitiveValue() { - return toLong(values.getNonPrimitiveValue()); + return Long.parseLong(values.getNonPrimitiveValue()); } @Override public long getLongValue() { - return toLong(values.getNonPrimitiveValue()); + return values.getLongValue(); } @Override public double getDoubleValue() { - // conversion is to LongField, doesn't make sense to parse a Double out of the String here. - return toLong(values.getNonPrimitiveValue()); + return (long)values.getDoubleValue(); } }); } @@ -74,19 +73,11 @@ public double getDoubleValue() { public static BigInteger toBigInteger(String str) { try { return new BigInteger(str); - } catch (NumberFormatException e) { + } catch (NumberFormatException nfe) { return new BigDecimal(str).toBigInteger(); } } - public static long toLong(String str) { - return Long.parseLong(str); - } - - public static double toDouble(String str) { - return Double.parseDouble(str); - } - /* ---- String Field Members ---- */ public StringField(String name, FieldValues values) { diff --git a/server/src/test/java/org/elasticsearch/script/field/ConvertersTestBase.java b/server/src/test/java/org/elasticsearch/script/field/ConvertersTestBase.java new file mode 100644 index 0000000000000..103180e336f3e --- /dev/null +++ b/server/src/test/java/org/elasticsearch/script/field/ConvertersTestBase.java @@ -0,0 +1,509 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.script.field; + +import org.elasticsearch.common.geo.GeoPoint; +import org.elasticsearch.script.JodaCompatibleZonedDateTime; +import org.elasticsearch.test.ESTestCase; +import org.junit.Before; + +import java.math.BigDecimal; +import java.math.BigInteger; +import java.time.Instant; +import java.time.ZoneOffset; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.DoubleStream; +import java.util.stream.LongStream; +import java.util.stream.Stream; + +/** + * A set of the standard available field types for scripting with raw values + * contained in a test field to test conversions to other field types. + */ +public abstract class ConvertersTestBase extends ESTestCase { + + protected boolean[] rawBooleanValues; + protected FieldValues booleanFieldValues; + protected Field booleanField; + + @Before + public void setupBooleanField() { + rawBooleanValues = new boolean[] { + true, + false + }; + + booleanFieldValues = new FieldValues() { + @Override + public boolean isEmpty() { + return false; + } + + @Override + public int size() { + return rawBooleanValues.length; + } + + @Override + public List getValues() { + List values = new ArrayList<>(); + + for (boolean bool : rawBooleanValues) { + values.add(bool); + } + + return values; + } + + @Override + public Boolean getNonPrimitiveValue() { + return rawBooleanValues[0]; + } + + @Override + public long getLongValue() { + return BooleanField.toLong(rawBooleanValues[0]); + } + + @Override + public double getDoubleValue() { + return BooleanField.toDouble(rawBooleanValues[0]); + } + }; + + booleanField = new BooleanField("boolean_field", booleanFieldValues); + } + + protected long[] rawLongValues; + protected FieldValues longFieldValues; + protected Field longField; + + @Before + public void setupLongField() { + rawLongValues = new long[] { + 15, + -1, + 0, + 1, + Long.MIN_VALUE, + Long.MAX_VALUE, + Integer.MIN_VALUE, + Integer.MAX_VALUE + }; + + longFieldValues = new FieldValues() { + @Override + public boolean isEmpty() { + return false; + } + + @Override + public int size() { + return rawLongValues.length; + } + + @Override + public List getValues() { + return LongStream.of(rawLongValues).boxed().collect(Collectors.toList()); + } + + @Override + public Long getNonPrimitiveValue() { + return rawLongValues[0]; + } + + @Override + public long getLongValue() { + return rawLongValues[0]; + } + + @Override + public double getDoubleValue() { + return rawLongValues[0]; + } + }; + + longField = new LongField("long_field", longFieldValues); + } + + protected double[] rawDoubleValues; + protected FieldValues doubleFieldValues; + protected Field doubleField; + + @Before + public void setupDoubleField() { + rawDoubleValues = new double[] { + 3.456, + 0.0, + -1.0, + 1.0, + -1.5, + 1.5, + Double.MAX_VALUE, + Double.MIN_VALUE, + Float.MAX_VALUE, + Float.MIN_VALUE, + Long.MAX_VALUE, + Long.MIN_VALUE, + }; + + doubleFieldValues = new FieldValues() { + @Override + public boolean isEmpty() { + return false; + } + + @Override + public int size() { + return rawDoubleValues.length; + } + + @Override + public List getValues() { + return DoubleStream.of(rawDoubleValues).boxed().collect(Collectors.toList()); + } + + @Override + public Double getNonPrimitiveValue() { + return rawDoubleValues[0]; + } + + @Override + public long getLongValue() { + return (long)rawDoubleValues[0]; + } + + @Override + public double getDoubleValue() { + return rawDoubleValues[0]; + } + }; + + doubleField = new DoubleField("double_field", doubleFieldValues); + } + + protected BigInteger[] rawBigIntegerValues; + protected FieldValues bigIntegerFieldValues; + protected Field bigIntegerField; + + @Before + public void setupBigIntegerField() { + rawBigIntegerValues = new BigInteger[] { + BigInteger.valueOf(123), + BigDecimal.valueOf(Double.MAX_VALUE).toBigInteger(), + BigDecimal.valueOf(Double.MIN_VALUE).toBigInteger(), + BigDecimal.valueOf(Float.MAX_VALUE).toBigInteger(), + BigDecimal.valueOf(Float.MIN_VALUE).toBigInteger(), + BigInteger.valueOf(Long.MAX_VALUE), + BigInteger.valueOf(Long.MIN_VALUE), + BigInteger.ZERO, + BigInteger.ONE, + BigInteger.TWO, + BigInteger.valueOf(-1) + }; + + bigIntegerFieldValues = new FieldValues() { + @Override + public boolean isEmpty() { + return false; + } + + @Override + public int size() { + return rawBigIntegerValues.length; + } + + @Override + public List getValues() { + return Stream.of(rawBigIntegerValues).collect(Collectors.toList()); + } + + @Override + public BigInteger getNonPrimitiveValue() { + return rawBigIntegerValues[0]; + } + + @Override + public long getLongValue() { + return rawBigIntegerValues[0].longValue(); + } + + @Override + public double getDoubleValue() { + return rawBigIntegerValues[0].doubleValue(); + } + }; + + bigIntegerField = new BigIntegerField("big_integer_field", bigIntegerFieldValues); + } + + protected String[] rawStringValuesAsLongs; + protected FieldValues stringFieldValuesAsLongs; + protected Field stringFieldAsLongs; + + @Before + public void setupStringFieldAsLongs() { + rawStringValuesAsLongs = new String[] { + "72", + "0", + "-1", + "1", + ((Integer)Integer.MAX_VALUE).toString(), + ((Integer)Integer.MIN_VALUE).toString(), + ((Long)Long.MAX_VALUE).toString(), + ((Long)Long.MIN_VALUE).toString() + }; + + stringFieldValuesAsLongs = new FieldValues() { + @Override + public boolean isEmpty() { + return false; + } + + @Override + public int size() { + return rawStringValuesAsLongs.length; + } + + @Override + public List getValues() { + return Stream.of(rawStringValuesAsLongs).collect(Collectors.toList()); + } + + @Override + public String getNonPrimitiveValue() { + return rawStringValuesAsLongs[0]; + } + + @Override + public long getLongValue() { + return Long.parseLong(rawStringValuesAsLongs[0]); + } + + @Override + public double getDoubleValue() { + return Double.parseDouble(rawStringValuesAsLongs[0]); + } + }; + + stringFieldAsLongs = new StringField("string_field_as_longs", stringFieldValuesAsLongs); + } + + protected String[] rawStringValuesAsDoubles; + protected FieldValues stringFieldValuesAsDoubles; + protected Field stringFieldAsDoubles; + + @Before + public void setupStringFieldAsDoubles() { + rawStringValuesAsDoubles = new String[] { + "72", + "0", + "-1", + "1", + ((Long)Long.MAX_VALUE).toString(), + ((Long)Long.MIN_VALUE).toString(), + ((Double)Double.MAX_VALUE).toString(), + ((Double)Double.MIN_VALUE).toString() + }; + + stringFieldValuesAsDoubles = new FieldValues() { + @Override + public boolean isEmpty() { + return false; + } + + @Override + public int size() { + return rawStringValuesAsDoubles.length; + } + + @Override + public List getValues() { + return Stream.of(rawStringValuesAsDoubles).collect(Collectors.toList()); + } + + @Override + public String getNonPrimitiveValue() { + return rawStringValuesAsDoubles[0]; + } + + @Override + public long getLongValue() { + return Long.parseLong(rawStringValuesAsDoubles[0]); + } + + @Override + public double getDoubleValue() { + return Double.parseDouble(rawStringValuesAsDoubles[0]); + } + }; + + stringFieldAsDoubles = new StringField("string_field_as_doubles", stringFieldValuesAsDoubles); + } + + long[] rawLongMillisValues; + List rawDateMillisValues; + protected FieldValues dateMillisFieldValues; + protected Field dateMillisField; + + @Before + public void setupDateMillisField() { + rawLongMillisValues = new long[] { + 1629830752000L, + 0L, + 2040057952000L, + -6106212564000L + }; + + rawDateMillisValues = List.of( + new JodaCompatibleZonedDateTime(Instant.ofEpochMilli(rawLongMillisValues[0]), ZoneOffset.ofHours(-7)), + new JodaCompatibleZonedDateTime(Instant.ofEpochMilli(rawLongMillisValues[1]), ZoneOffset.ofHours(-6)), + new JodaCompatibleZonedDateTime(Instant.ofEpochMilli(rawLongMillisValues[2]), ZoneOffset.ofHours(0)), + new JodaCompatibleZonedDateTime(Instant.ofEpochMilli(rawLongMillisValues[3]), ZoneOffset.ofHours(-5)) + ); + + dateMillisFieldValues = new FieldValues() { + @Override + public boolean isEmpty() { + return false; + } + + @Override + public int size() { + return rawDateMillisValues.size(); + } + + @Override + public List getValues() { + return Collections.unmodifiableList(rawDateMillisValues); + } + + @Override + public JodaCompatibleZonedDateTime getNonPrimitiveValue() { + return rawDateMillisValues.get(0); + } + + @Override + public long getLongValue() { + return DateMillisField.toLong(rawDateMillisValues.get(0)); + } + + @Override + public double getDoubleValue() { + return getLongValue(); + } + }; + + dateMillisField = new DateMillisField("millis_date_field", dateMillisFieldValues); + } + + long[] rawLongNanosValues; + List rawDateNanosValues; + protected FieldValues dateNanosFieldValues; + protected Field dateNanosField; + + @Before + public void setupDateNanosField() { + rawLongNanosValues = new long[] { + 1629830752000L, + 0L, + 2040057952000L, + -6106212564000L + }; + + rawDateNanosValues = List.of( + new JodaCompatibleZonedDateTime(Instant.EPOCH.plusNanos(rawLongNanosValues[0]), ZoneOffset.ofHours(-7)), + new JodaCompatibleZonedDateTime(Instant.EPOCH.plusNanos(rawLongNanosValues[1]), ZoneOffset.ofHours(-6)), + new JodaCompatibleZonedDateTime(Instant.EPOCH.plusNanos(rawLongNanosValues[2]), ZoneOffset.ofHours(0)), + new JodaCompatibleZonedDateTime(Instant.EPOCH.plusNanos(rawLongNanosValues[3]), ZoneOffset.ofHours(-5)) + ); + + dateNanosFieldValues = new FieldValues() { + @Override + public boolean isEmpty() { + return false; + } + + @Override + public int size() { + return rawDateNanosValues.size(); + } + + @Override + public List getValues() { + return Collections.unmodifiableList(rawDateNanosValues); + } + + @Override + public JodaCompatibleZonedDateTime getNonPrimitiveValue() { + return rawDateNanosValues.get(0); + } + + @Override + public long getLongValue() { + return DateNanosField.toLong(rawDateNanosValues.get(0)); + } + + @Override + public double getDoubleValue() { + return getLongValue(); + } + }; + + dateNanosField = new DateNanosField("nanos_date_field", dateNanosFieldValues); + } + + List rawGeoPointValues; + protected FieldValues getPointFieldValues; + protected Field getPointField; + + @Before + public void setupGeoPointField() { + rawGeoPointValues = List.of( + new GeoPoint(0.0, 0.0) + ); + + getPointFieldValues = new FieldValues() { + @Override + public boolean isEmpty() { + return false; + } + + @Override + public int size() { + return rawGeoPointValues.size(); + } + + @Override + public List getValues() { + return Collections.unmodifiableList(rawGeoPointValues); + } + + @Override + public GeoPoint getNonPrimitiveValue() { + return rawGeoPointValues.get(0); + } + + @Override + public long getLongValue() { + throw new UnsupportedOperationException(); + } + + @Override + public double getDoubleValue() { + throw new UnsupportedOperationException(); + } + }; + + getPointField = new GeoPointField("geo_point_field", getPointFieldValues); + } +} diff --git a/server/src/test/java/org/elasticsearch/script/field/ConvertersTests.java b/server/src/test/java/org/elasticsearch/script/field/ConvertersTests.java index 54e27d2ac78fa..116fedacaf8f8 100644 --- a/server/src/test/java/org/elasticsearch/script/field/ConvertersTests.java +++ b/server/src/test/java/org/elasticsearch/script/field/ConvertersTests.java @@ -8,277 +8,173 @@ package org.elasticsearch.script.field; -import org.elasticsearch.common.geo.GeoPoint; -import org.elasticsearch.script.JodaCompatibleZonedDateTime; -import org.elasticsearch.test.ESTestCase; - import java.math.BigInteger; -import java.time.Instant; -import java.time.ZoneOffset; +import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; -import java.util.stream.DoubleStream; import java.util.stream.LongStream; +import java.util.stream.Stream; -public class ConvertersTests extends ESTestCase { - public void testLongToBigIntegerToLong() { - long[] raw = { randomLong(), Long.MIN_VALUE, Long.MAX_VALUE, ((long) Integer.MIN_VALUE - 1), ((long) Integer.MAX_VALUE + 1), - -1L, 0L, 1L }; - Field src = new LongField("", new FieldValues() { - @Override - public boolean isEmpty() { - return false; - } - - @Override - public int size() { - return raw.length; - } - - @Override - public List getValues() { - return LongStream.of(raw).boxed().collect(Collectors.toList()); - } - - @Override - public Long getNonPrimitiveValue() { - return raw[0]; - } - - @Override - public long getLongValue() { - return raw[0]; - } - - @Override - public double getDoubleValue() { - return raw[0]; - } - }); - - Field dst = src.as(BigIntegerField.BigInteger); - - List expected = LongStream.of(raw).mapToObj(BigInteger::valueOf).collect(Collectors.toList()); - assertEquals(expected, dst.getValues()); - assertEquals(expected.get(0), dst.getValue(null)); - // dst has data so a junk default value should be ignored - assertEquals(raw[0], dst.getLong(10)); - assertEquals((double) raw[0], dst.getDouble(10.0d), 0.1d); - - Field dstLong = dst.as(LongField.Long); - assertEquals(LongStream.of(raw).boxed().collect(Collectors.toList()), dstLong.getValues()); - assertEquals(Long.valueOf(raw[0]), dstLong.getValue(null)); - assertEquals(raw[0], dstLong.getLong(10)); - assertEquals((double) raw[0], dstLong.getDouble(10.0d), 0.1d); - } - - public void testDoubleTo() { - double[] raw = { Double.MAX_VALUE, Double.MIN_VALUE, ((double) Float.MAX_VALUE) * 10d, ((double) Float.MIN_VALUE), 0.1d, - Long.MAX_VALUE, Long.MIN_VALUE }; - Field src = new DoubleField("", new FieldValues() { - @Override - public boolean isEmpty() { - return false; - } - - @Override - public int size() { - return raw.length; - } +public class ConvertersTests extends ConvertersTestBase{ - @Override - public List getValues() { - return DoubleStream.of(raw).boxed().collect(Collectors.toList()); - } - - @Override - public Double getNonPrimitiveValue() { - return raw[0]; - } - - @Override - public long getLongValue() { - return (long) raw[0]; - } - - @Override - public double getDoubleValue() { - return raw[0]; - } - }); - - Field dst = src.as(BigIntegerField.BigInteger); - BigInteger maxDouble = new BigInteger("17976931348623157" + "0".repeat(292)); - List expected = List.of(maxDouble, BigInteger.ZERO, new BigInteger("34028234663852886" + "0".repeat(23)), - BigInteger.ZERO, BigInteger.ZERO, - new BigInteger("9223372036854776000"), // Long.MAX_VALUE: 9223372036854775807 - new BigInteger("-9223372036854776000")); // Long.MIN_VALUE: -9223372036854775808 - assertEquals(expected, dst.getValues()); - assertEquals(expected.get(0), dst.getValue(null)); - assertEquals(Long.MAX_VALUE, dst.getLong(10)); - assertEquals(Double.MAX_VALUE, dst.getDouble(10.0d), 0.1d); + public void testInvalidFieldConversion() { + InvalidConversion ic = expectThrows(InvalidConversion.class, () -> getPointField.as(BigIntegerField.BigInteger)); + assertEquals("Cannot convert from [GeoPointField] using converter [BigIntegerField]", ic.getMessage()); - Field lng = src.as(LongField.Long); - List lngExpected = List.of(Long.MAX_VALUE, 0L, Long.MAX_VALUE, 0L, 0L, Long.MAX_VALUE, Long.MIN_VALUE); - assertEquals(lngExpected, lng.getValues()); - assertEquals(Long.valueOf(Long.MAX_VALUE), lng.getValue(null)); - assertEquals(Long.MAX_VALUE, lng.getLong(10)); - assertEquals(Double.MAX_VALUE, lng.getDouble(10.0d), 0.1d); + ic = expectThrows(InvalidConversion.class, () -> getPointField.as(LongField.Long)); + assertEquals("Cannot convert from [GeoPointField] using converter [LongField]", ic.getMessage()); } - public void testStringToBigInteger() { - List raw = List.of(Long.MAX_VALUE + "0", randomLong() + "", Long.MIN_VALUE + "0", Double.MAX_VALUE + "", - Double.MIN_VALUE + ""); - Field src = new StringField("", new ListFieldValues<>(raw)); - - Field dst = src.as(BigIntegerField.BigInteger); - BigInteger maxDouble = new BigInteger("17976931348623157" + "0".repeat(292)); - List expected = List.of(new BigInteger(raw.get(0)), new BigInteger(raw.get(1)), new BigInteger(raw.get(2)), maxDouble, - BigInteger.ZERO); - assertEquals(expected, dst.getValues()); - assertEquals(expected.get(0), dst.getValue(null)); - assertEquals(-10L, dst.getLong(10)); // overflow - assertEquals(9.223372036854776E19, dst.getDouble(10.0d), 0.1d); + public void testLongFieldToBigIntegerField() { + // transform: long field to big integer field + List expectedBigIntegers = LongStream.of(rawLongValues).mapToObj(BigInteger::valueOf).collect(Collectors.toList()); + Field toBigIntegerField = longField.as(BigIntegerField.BigInteger); + assertEquals(expectedBigIntegers, toBigIntegerField.getValues()); + assertEquals(expectedBigIntegers.get(0), toBigIntegerField.getValue(null)); // default value ignored + assertEquals(rawLongValues[0], toBigIntegerField.getLong(10)); // default value ignored + assertEquals((double)rawLongValues[0], toBigIntegerField.getDouble(10.0), 0.0001); // default value ignored + + // reverse transform (symmetric): big integer field to long field + Field toLongField = toBigIntegerField.as(LongField.Long); + assertEquals(LongStream.of(rawLongValues).boxed().collect(Collectors.toList()), toLongField.getValues()); + assertEquals(Long.valueOf(rawLongValues[0]), toLongField.getValue(null)); // default value ignored + assertEquals(rawLongValues[0], toLongField.getLong(10)); // default value ignored + assertEquals((double)rawLongValues[0], toLongField.getDouble(10.0d), 0.0001d); // default value ignored } - public void testStringToLong() { - long rand = randomLong(); - List raw = List.of(rand + "", Long.MAX_VALUE + "", Long.MIN_VALUE + "", "0", "100"); - Field src = new StringField("", new ListFieldValues<>(raw)); - - Field dst = src.as(LongField.Long); - assertEquals(List.of(rand, Long.MAX_VALUE, Long.MIN_VALUE, 0L, 100L), dst.getValues()); - assertEquals(Long.valueOf(rand), dst.getValue(null)); - assertEquals(rand, dst.getLong(10)); // overflow - assertEquals(rand + 0.0d, dst.getDouble(10.0d), 0.9d); + public void testBigIntegerFieldToLongField() { + // transform: big integer field to long field + List expectedLongs = Stream.of(rawBigIntegerValues).mapToLong(BigInteger::longValue).boxed().collect(Collectors.toList()); + Field toLongField = bigIntegerField.as(LongField.Long); + assertEquals(expectedLongs, toLongField.getValues()); + assertEquals(expectedLongs.get(0), toLongField.getValue(null)); // default value ignored + assertEquals(rawBigIntegerValues[0].longValue(), toLongField.getLong(10)); // default value ignored + assertEquals(rawBigIntegerValues[0].doubleValue(), toLongField.getDouble(10.0), 0.0001); // default value ignored + + // reverse transform (asymmetric): long field to big integer field + Field toBigIntegerField = toLongField.as(BigIntegerField.BigInteger); + assertEquals(expectedLongs.stream().map(BigInteger::valueOf).collect(Collectors.toList()), toBigIntegerField.getValues()); + assertEquals( + BigInteger.valueOf(rawBigIntegerValues[0].longValue()), + toBigIntegerField.getValue(null)); // default value ignored + assertEquals(rawBigIntegerValues[0].longValue(), toBigIntegerField.getLong(10)); // default value ignored + assertEquals( + rawBigIntegerValues[0].doubleValue(), + toBigIntegerField.getDouble(10.0d), // default value ignored + 0.0001d); } - public void testBooleanTo() { - List raw = List.of(Boolean.TRUE, Boolean.FALSE); - Field src = new BooleanField("", new ListFieldValues<>(raw)); - - Field dst = src.as(BigIntegerField.BigInteger); - assertEquals(List.of(BigInteger.ONE, BigInteger.ZERO), dst.getValues()); - assertEquals(BigInteger.ONE, dst.getValue(null)); - assertEquals(1L, dst.getLong(10L)); - assertEquals(1.0d, dst.getDouble(1234.0d), 0.1d); - - Field dstLong = src.as(LongField.Long); - assertEquals(List.of(1L, 0L), dstLong.getValues()); - assertEquals(Long.valueOf(1), dstLong.getValue(null)); - assertEquals(1L, dstLong.getLong(10L)); - assertEquals(1.0d, dstLong.getDouble(1234.0d), 0.1d); - - List rawRev = List.of(Boolean.FALSE, Boolean.TRUE); - src = new BooleanField("", new ListFieldValues<>(rawRev)); - dst = src.as(BigIntegerField.BigInteger); - - assertEquals(List.of(BigInteger.ZERO, BigInteger.ONE), dst.getValues()); - assertEquals(BigInteger.ZERO, dst.getValue(null)); - assertEquals(0L, dst.getLong(10L)); - assertEquals(0.0d, dst.getDouble(1234.0d), 0.1d); - - dstLong = src.as(LongField.Long); - assertEquals(List.of(0L, 1L), dstLong.getValues()); - assertEquals(Long.valueOf(0), dstLong.getValue(null)); - assertEquals(0L, dstLong.getLong(10L)); - assertEquals(0.0d, dstLong.getDouble(1234.0d), 0.1d); + public void testDoubleFieldToBigIntegerField() { + // transform: double field to big integer field + List expectedBigIntegers = + Arrays.stream(rawDoubleValues).mapToObj(DoubleField::toBigInteger).collect(Collectors.toList()); + Field toBigIntegerField = doubleField.as(BigIntegerField.BigInteger); + assertEquals(expectedBigIntegers, toBigIntegerField.getValues()); + assertEquals(expectedBigIntegers.get(0), toBigIntegerField.getValue(null)); // default value ignored + assertEquals((long)rawDoubleValues[0], toBigIntegerField.getLong(10)); // default value ignored + assertEquals( + expectedBigIntegers.get(0).doubleValue(), + toBigIntegerField.getDouble(10.0d), // default value ignored + 0.00001d); } - public void testInvalidFieldConversion() { - Field src = new GeoPointField("", new ListFieldValues<>(List.of(new GeoPoint(0, 0)))); - InvalidConversion ic = expectThrows(InvalidConversion.class, () -> src.as(BigIntegerField.BigInteger)); - assertEquals("Cannot convert from [GeoPointField] using converter [BigIntegerField]", ic.getMessage()); - - ic = expectThrows(InvalidConversion.class, () -> src.as(LongField.Long)); - assertEquals("Cannot convert from [GeoPointField] using converter [LongField]", ic.getMessage()); + public void testDoubleFieldToLongField() { + // transform: double field to long field + List expectedLongs = Arrays.stream(rawDoubleValues).mapToLong(d -> (long)d).boxed().collect(Collectors.toList()); + Field toLongField = doubleField.as(LongField.Long); + assertEquals(expectedLongs, toLongField.getValues()); + assertEquals((Long)(long)rawDoubleValues[0], toLongField.getValue(null)); // default value ignored + assertEquals((long)rawDoubleValues[0], toLongField.getLong(10)); // default value ignored + assertEquals((double)(long)rawDoubleValues[0], toLongField.getDouble(10.0d), 0.1d); // default value ignored } - public void testDateMillisTo() { - long[] rawMilli = { 1629830752000L, 0L, 2040057952000L, -6106212564000L}; - List raw = List.of( - new JodaCompatibleZonedDateTime(Instant.ofEpochMilli(rawMilli[0]), ZoneOffset.ofHours(-7)), - new JodaCompatibleZonedDateTime(Instant.ofEpochMilli(rawMilli[1]), ZoneOffset.ofHours(-6)), - new JodaCompatibleZonedDateTime(Instant.ofEpochMilli(rawMilli[2]), ZoneOffset.ofHours(0)), - new JodaCompatibleZonedDateTime(Instant.ofEpochMilli(rawMilli[3]), ZoneOffset.ofHours(-5)) - ); - Field src = new DateMillisField("", new ListFieldValues<>(raw)); - - List expectedBigInteger = LongStream.of(rawMilli).mapToObj(BigInteger::valueOf).collect(Collectors.toList()); - Field dstBigInteger = src.as(BigIntegerField.BigInteger); - assertEquals(expectedBigInteger, dstBigInteger.getValues()); - assertEquals(expectedBigInteger.get(0), dstBigInteger.getValue(null)); - assertEquals(rawMilli[0], dstBigInteger.getLong(-1000L)); - assertEquals((double) rawMilli[0], dstBigInteger.getDouble(-1234.5d), 1.1d); - - Field dstLong = src.as(LongField.Long); - assertEquals(LongStream.of(rawMilli).boxed().collect(Collectors.toList()), dstLong.getValues()); - assertEquals(LongStream.of(rawMilli).boxed().collect(Collectors.toList()), dstLong.getValues()); - assertEquals(Long.valueOf(rawMilli[0]), dstLong.getValue(-100L)); - assertEquals(rawMilli[0], dstLong.getLong(-100L)); - assertEquals((double) rawMilli[0], dstLong.getDouble(-1234.5d), 1.1d); + public void testStringFieldToBigIntegerField() { + // transform: string field to big integer field + List expectedBigIntegers = + Arrays.stream(rawStringValuesAsDoubles).map(StringField::toBigInteger).collect(Collectors.toList()); + Field toBigIntegerField = stringFieldAsDoubles.as(BigIntegerField.BigInteger); + assertEquals(expectedBigIntegers, toBigIntegerField.getValues()); + assertEquals(expectedBigIntegers.get(0), toBigIntegerField.getValue(null)); // default value ignored + assertEquals(expectedBigIntegers.get(0).longValue(), toBigIntegerField.getLong(10)); // default value ignored + assertEquals(expectedBigIntegers.get(0).doubleValue(), toBigIntegerField.getDouble(10.0d), 0.1d); // default value ignored } - public void testDateNanoTo() { - long[] rawNanos = { 1629830752000123L, 0L, 2040057952000456L, -6106212564000789L}; - List raw = List.of( - new JodaCompatibleZonedDateTime(Instant.EPOCH.plusNanos(rawNanos[0]), ZoneOffset.ofHours(-7)), - new JodaCompatibleZonedDateTime(Instant.EPOCH.plusNanos(rawNanos[1]), ZoneOffset.ofHours(-6)), - new JodaCompatibleZonedDateTime(Instant.EPOCH.plusNanos(rawNanos[2]), ZoneOffset.ofHours(0)), - new JodaCompatibleZonedDateTime(Instant.EPOCH.plusNanos(rawNanos[3]), ZoneOffset.ofHours(-5)) - ); - Field src = new DateNanosField("", new ListFieldValues<>(raw)); - - List expectedBigInteger = LongStream.of(rawNanos).mapToObj(BigInteger::valueOf).collect(Collectors.toList()); - Field dstBigInteger = src.as(BigIntegerField.BigInteger); - assertEquals(expectedBigInteger, dstBigInteger.getValues()); - assertEquals(expectedBigInteger.get(0), dstBigInteger.getValue(null)); - assertEquals(rawNanos[0], dstBigInteger.getLong(-1000L)); - assertEquals((double) rawNanos[0], dstBigInteger.getDouble(-1234.5d), 1.1d); - - Field dstLong = src.as(LongField.Long); - assertEquals(LongStream.of(rawNanos).boxed().collect(Collectors.toList()), dstLong.getValues()); - assertEquals(LongStream.of(rawNanos).boxed().collect(Collectors.toList()), dstLong.getValues()); - assertEquals(Long.valueOf(rawNanos[0]), dstLong.getValue(-100L)); - assertEquals(rawNanos[0], dstLong.getLong(-100L)); - assertEquals((double) rawNanos[0], dstLong.getDouble(-1234.5d), 1.1d); + public void testStringFieldToLongField() { + // transform: string field to long field + List expectedLongs = Arrays.stream(rawStringValuesAsLongs).map(Long::parseLong).collect(Collectors.toList()); + Field toLongField = stringFieldAsLongs.as(LongField.Long); + assertEquals(expectedLongs, toLongField.getValues()); + assertEquals(expectedLongs.get(0), toLongField.getValue(null)); // default value ignored + assertEquals(expectedLongs.get(0).longValue(), toLongField.getLong(10)); // default value ignored + assertEquals(expectedLongs.get(0).doubleValue(), toLongField.getDouble(10.0d), 0.1d); // default value ignored } - static class ListFieldValues implements FieldValues { - final List values; - - ListFieldValues(List values) { - this.values = values; - } - - @Override - public boolean isEmpty() { - return values.isEmpty(); + public void testBooleanFieldToBigIntegerField() { + // transform: boolean field to big integer field + List expectedBigIntegers = new ArrayList<>(); + for (boolean bool : rawBooleanValues) { + expectedBigIntegers.add(BigInteger.valueOf(BooleanField.toLong(bool))); } + Field toBigIntegerField = booleanField.as(BigIntegerField.BigInteger); + assertEquals(expectedBigIntegers, toBigIntegerField.getValues()); + assertEquals(expectedBigIntegers.get(0), toBigIntegerField.getValue(null)); // default value ignored + assertEquals(expectedBigIntegers.get(0).longValue(), toBigIntegerField.getLong(10)); // default value ignored + assertEquals(expectedBigIntegers.get(0).doubleValue(), toBigIntegerField.getDouble(10.0d), 0.1d); // default value ignored + } - @Override - public int size() { - return values.size(); + public void testBooleanFieldToLongField() { + // transform: boolean field to long field + List expectedLongs = new ArrayList<>(); + for (boolean bool : rawBooleanValues) { + expectedLongs.add(BooleanField.toLong(bool)); } + Field toLongField = booleanField.as(LongField.Long); + assertEquals(expectedLongs, toLongField.getValues()); + assertEquals(expectedLongs.get(0), toLongField.getValue(null)); // default value ignored + assertEquals(expectedLongs.get(0).longValue(), toLongField.getLong(10)); // default value ignored + assertEquals(expectedLongs.get(0).doubleValue(), toLongField.getDouble(10.0d), 0.1d); // default value ignored + } - @Override - public List getValues() { - return values; - } + public void testDateMillisFieldToBigIntegerField() { + // transform: boolean field to big integer field + List expectedBigIntegers = + rawDateMillisValues.stream().map(DateMillisField::toLong).map(BigInteger::valueOf).collect(Collectors.toList()); + Field toBigIntegerField = dateMillisField.as(BigIntegerField.BigInteger); + assertEquals(expectedBigIntegers, toBigIntegerField.getValues()); + assertEquals(expectedBigIntegers.get(0), toBigIntegerField.getValue(null)); // default value ignored + assertEquals(expectedBigIntegers.get(0).longValue(), toBigIntegerField.getLong(10)); // default value ignored + assertEquals(expectedBigIntegers.get(0).doubleValue(), toBigIntegerField.getDouble(10.0d), 0.1d); // default value ignored + } - @Override - public T getNonPrimitiveValue() { - return values.get(0); - } + public void testDateMillisFieldToLongField() { + // transform: boolean field to long field + List expectedLongs = rawDateMillisValues.stream().map(DateMillisField::toLong).collect(Collectors.toList()); + Field toLongField = dateMillisField.as(LongField.Long); + assertEquals(expectedLongs, toLongField.getValues()); + assertEquals(expectedLongs.get(0), toLongField.getValue(null)); // default value ignored + assertEquals(expectedLongs.get(0).longValue(), toLongField.getLong(10)); // default value ignored + assertEquals(expectedLongs.get(0).doubleValue(), toLongField.getDouble(10.0d), 0.1d); // default value ignored + } - @Override - public long getLongValue() { - return 0; - } + public void testDateNanosFieldToBigIntegerField() { + // transform: boolean field to big integer field + List expectedBigIntegers = + rawDateNanosValues.stream().map(DateNanosField::toLong).map(BigInteger::valueOf).collect(Collectors.toList()); + Field toBigIntegerField = dateNanosField.as(BigIntegerField.BigInteger); + assertEquals(expectedBigIntegers, toBigIntegerField.getValues()); + assertEquals(expectedBigIntegers.get(0), toBigIntegerField.getValue(null)); // default value ignored + assertEquals(expectedBigIntegers.get(0).longValue(), toBigIntegerField.getLong(10)); // default value ignored + assertEquals(expectedBigIntegers.get(0).doubleValue(), toBigIntegerField.getDouble(10.0d), 0.1d); // default value ignored + } - @Override - public double getDoubleValue() { - return 0; - } + public void testDateNanosFieldToLongField() { + // transform: boolean field to long field + List expectedLongs = rawDateNanosValues.stream().map(DateNanosField::toLong).collect(Collectors.toList()); + Field toLongField = dateNanosField.as(LongField.Long); + assertEquals(expectedLongs, toLongField.getValues()); + assertEquals(expectedLongs.get(0), toLongField.getValue(null)); // default value ignored + assertEquals(expectedLongs.get(0).longValue(), toLongField.getLong(10)); // default value ignored + assertEquals(expectedLongs.get(0).doubleValue(), toLongField.getDouble(10.0d), 0.1d); // default value ignored } } diff --git a/x-pack/plugin/mapper-unsigned-long/src/main/java/org/elasticsearch/xpack/unsignedlong/UnsignedLongField.java b/x-pack/plugin/mapper-unsigned-long/src/main/java/org/elasticsearch/xpack/unsignedlong/UnsignedLongField.java index 5e1010c731e80..071722a36139d 100644 --- a/x-pack/plugin/mapper-unsigned-long/src/main/java/org/elasticsearch/xpack/unsignedlong/UnsignedLongField.java +++ b/x-pack/plugin/mapper-unsigned-long/src/main/java/org/elasticsearch/xpack/unsignedlong/UnsignedLongField.java @@ -53,7 +53,7 @@ public Class getTargetClass() { public static BigIntegerField toBigIntegerField(UnsignedLongField sourceField) { FieldValues fv = sourceField.getFieldValues(); - return new BigIntegerField(sourceField.getName(), new DelegatingFieldValues(fv) { + return new BigIntegerField(sourceField.getName(), new DelegatingFieldValues(fv) { private BigInteger toBigInteger(long formatted) { return java.math.BigInteger.valueOf(formatted).and(BIGINTEGER_2_64_MINUS_ONE); } @@ -65,7 +65,17 @@ public List getValues() { @Override public BigInteger getNonPrimitiveValue() { - return toBigInteger(values.getLongValue()); + return toBigInteger(values.getNonPrimitiveValue()); + } + + @Override + public long getLongValue() { + return toBigInteger(values.getNonPrimitiveValue()).longValue(); + } + + @Override + public double getDoubleValue() { + return toBigInteger(values.getNonPrimitiveValue()).doubleValue(); } }); } @@ -77,7 +87,7 @@ public static UnsignedLongField fromBigIntegerField(BigIntegerField sourceField) return new UnsignedLongField(sourceField.getName(), new DelegatingFieldValues<>(fv) { @Override public List getValues() { - return values.getValues().stream().map(BigIntegerField::toLong).collect(Collectors.toList()); + return values.getValues().stream().map(BigInteger::longValue).collect(Collectors.toList()); } @Override From c6928edbd4e1fe70a015d575e08a2d1a47c1b4f8 Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Tue, 28 Sep 2021 17:39:39 +0200 Subject: [PATCH 035/250] Unmute tests after #78184 has been backported (#78395) --- x-pack/plugin/build.gradle | 3 --- 1 file changed, 3 deletions(-) diff --git a/x-pack/plugin/build.gradle b/x-pack/plugin/build.gradle index 8bbd98da21e3d..ada3688e85aa0 100644 --- a/x-pack/plugin/build.gradle +++ b/x-pack/plugin/build.gradle @@ -166,9 +166,6 @@ tasks.named("yamlRestTestV7CompatTransform").configure({ task -> }) tasks.named("yamlRestTestV7CompatTest").configure { systemProperty 'tests.rest.blacklist', [ - // UNMUTE after #78184 is backported to 7.x - 'indices.freeze/10_basic/Basic', - 'indices.freeze/10_basic/Test index options', // to support it, it would require to almost revert back the #48725 and complicate the code 'vectors/10_dense_vector_basic/Deprecated function signature', // not going to be supported From e801035acb293c7d2c6f2a8d38b5396dce3312bc Mon Sep 17 00:00:00 2001 From: Dan Hermann Date: Tue, 28 Sep 2021 11:03:31 -0500 Subject: [PATCH 036/250] Remove some obsolete BWC version checks (#78258) --- .../ingest/geoip/GeoIpTaskState.java | 7 ++--- .../geoip/stats/GeoIpDownloaderStats.java | 13 ++------- .../indices/alias/get/GetAliasesResponse.java | 8 ++---- .../admin/indices/stats/CommonStats.java | 8 ++---- .../admin/indices/stats/CommonStatsFlags.java | 8 ++---- .../delete/DeleteComponentTemplateAction.java | 13 ++------- .../DeleteComposableIndexTemplateAction.java | 13 ++------- .../cluster/metadata/DataStreamAlias.java | 21 ++++++-------- .../cluster/metadata/DataStreamMetadata.java | 21 ++++---------- .../elasticsearch/ingest/IngestService.java | 10 ------- .../org/elasticsearch/monitor/fs/FsInfo.java | 28 +++++-------------- .../core/deprecation/DeprecationIssue.java | 15 ++++------ .../ilm/IndexLifecycleFeatureSetUsage.java | 10 ++----- .../xpack/core/ilm/LifecyclePolicy.java | 15 +++------- .../core/ilm/action/GetLifecycleAction.java | 12 ++------ .../core/ilm/action/MoveToStepAction.java | 17 ++--------- .../core/slm/SnapshotInvocationRecord.java | 11 ++------ .../action/InternalExecutePolicyAction.java | 3 -- .../InternalExecutePolicyActionTests.java | 15 ---------- 19 files changed, 53 insertions(+), 195 deletions(-) diff --git a/modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/GeoIpTaskState.java b/modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/GeoIpTaskState.java index b1f40c7843492..cbc6acd277ed9 100644 --- a/modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/GeoIpTaskState.java +++ b/modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/GeoIpTaskState.java @@ -68,8 +68,7 @@ public static GeoIpTaskState fromXContent(XContentParser parser) throws IOExcept databases = Collections.unmodifiableMap(input.readMap(StreamInput::readString, in -> { long lastUpdate = in.readLong(); - return new Metadata(lastUpdate, in.readVInt(), in.readVInt(), in.readString(), - in.getVersion().onOrAfter(Version.V_7_14_0) ? in.readLong() : lastUpdate); + return new Metadata(lastUpdate, in.readVInt(), in.readVInt(), in.readString(), in.readLong()); })); } @@ -135,9 +134,7 @@ public void writeTo(StreamOutput out) throws IOException { o.writeVInt(v.firstChunk); o.writeVInt(v.lastChunk); o.writeString(v.md5); - if (o.getVersion().onOrAfter(Version.V_7_14_0)) { - o.writeLong(v.lastCheck); - } + o.writeLong(v.lastCheck); }); } diff --git a/modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/stats/GeoIpDownloaderStats.java b/modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/stats/GeoIpDownloaderStats.java index f87c276741fe6..73dbcee7e46a3 100644 --- a/modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/stats/GeoIpDownloaderStats.java +++ b/modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/stats/GeoIpDownloaderStats.java @@ -8,12 +8,11 @@ package org.elasticsearch.ingest.geoip.stats; -import org.elasticsearch.Version; -import org.elasticsearch.common.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.xcontent.ConstructingObjectParser; +import org.elasticsearch.common.xcontent.ParseField; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.ingest.geoip.GeoIpDownloader; @@ -59,11 +58,7 @@ public GeoIpDownloaderStats(StreamInput in) throws IOException { totalDownloadTime = in.readVLong(); databasesCount = in.readVInt(); skippedDownloads = in.readVInt(); - if (in.getVersion().onOrAfter(Version.V_7_14_0)) { - expiredDatabases = in.readVInt(); - } else { - expiredDatabases = 0; - } + expiredDatabases = in.readVInt(); } private GeoIpDownloaderStats(int successfulDownloads, int failedDownloads, long totalDownloadTime, int databasesCount, @@ -149,9 +144,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeVLong(totalDownloadTime); out.writeVInt(databasesCount); out.writeVInt(skippedDownloads); - if (out.getVersion().onOrAfter(Version.V_7_14_0)) { - out.writeVInt(expiredDatabases); - } + out.writeVInt(expiredDatabases); } @Override diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/alias/get/GetAliasesResponse.java b/server/src/main/java/org/elasticsearch/action/admin/indices/alias/get/GetAliasesResponse.java index a98a4d21132cb..45b9acb95c072 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/alias/get/GetAliasesResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/alias/get/GetAliasesResponse.java @@ -11,7 +11,6 @@ import org.elasticsearch.action.ActionResponse; import org.elasticsearch.cluster.metadata.AliasMetadata; import org.elasticsearch.cluster.metadata.DataStreamAlias; -import org.elasticsearch.cluster.metadata.DataStreamMetadata; import org.elasticsearch.common.collect.ImmutableOpenMap; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -34,8 +33,7 @@ public GetAliasesResponse(ImmutableOpenMap> aliases, public GetAliasesResponse(StreamInput in) throws IOException { super(in); aliases = in.readImmutableMap(StreamInput::readString, i -> i.readList(AliasMetadata::new)); - dataStreamAliases = in.getVersion().onOrAfter(DataStreamMetadata.DATA_STREAM_ALIAS_VERSION) ? - in.readMap(StreamInput::readString, in1 -> in1.readList(DataStreamAlias::new)) : Map.of(); + dataStreamAliases = in.readMap(StreamInput::readString, in1 -> in1.readList(DataStreamAlias::new)); } public ImmutableOpenMap> getAliases() { @@ -49,9 +47,7 @@ public Map> getDataStreamAliases() { @Override public void writeTo(StreamOutput out) throws IOException { out.writeMap(aliases, StreamOutput::writeString, StreamOutput::writeList); - if (out.getVersion().onOrAfter(DataStreamMetadata.DATA_STREAM_ALIAS_VERSION)) { - out.writeMap(dataStreamAliases, StreamOutput::writeString, StreamOutput::writeList); - } + out.writeMap(dataStreamAliases, StreamOutput::writeString, StreamOutput::writeList); } @Override diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/stats/CommonStats.java b/server/src/main/java/org/elasticsearch/action/admin/indices/stats/CommonStats.java index f5270ec448f49..40051fbd01adf 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/stats/CommonStats.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/stats/CommonStats.java @@ -258,9 +258,7 @@ public CommonStats(StreamInput in) throws IOException { if (in.getVersion().onOrAfter(Version.V_8_0_0)) { bulk = in.readOptionalWriteable(BulkStats::new); } - if (in.getVersion().onOrAfter(Version.V_7_15_0)) { - shards = in.readOptionalWriteable(ShardCountStats::new); - } + shards = in.readOptionalWriteable(ShardCountStats::new); } @Override @@ -284,9 +282,7 @@ public void writeTo(StreamOutput out) throws IOException { if (out.getVersion().onOrAfter(Version.V_8_0_0)) { out.writeOptionalWriteable(bulk); } - if (out.getVersion().onOrAfter(Version.V_7_15_0)) { - out.writeOptionalWriteable(shards); - } + out.writeOptionalWriteable(shards); } public void add(CommonStats stats) { diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/stats/CommonStatsFlags.java b/server/src/main/java/org/elasticsearch/action/admin/indices/stats/CommonStatsFlags.java index dd89fa3323d02..fc1238a3d3486 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/stats/CommonStatsFlags.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/stats/CommonStatsFlags.java @@ -55,9 +55,7 @@ public CommonStatsFlags(StreamInput in) throws IOException { fieldDataFields = in.readStringArray(); completionDataFields = in.readStringArray(); includeSegmentFileSizes = in.readBoolean(); - if (in.getVersion().onOrAfter(Version.V_7_2_0)) { - includeUnloadedSegments = in.readBoolean(); - } + includeUnloadedSegments = in.readBoolean(); } @Override @@ -75,9 +73,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeStringArrayNullable(fieldDataFields); out.writeStringArrayNullable(completionDataFields); out.writeBoolean(includeSegmentFileSizes); - if (out.getVersion().onOrAfter(Version.V_7_2_0)) { - out.writeBoolean(includeUnloadedSegments); - } + out.writeBoolean(includeUnloadedSegments); } /** diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/template/delete/DeleteComponentTemplateAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/template/delete/DeleteComponentTemplateAction.java index 7041f2389aec4..167739c3e5319 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/template/delete/DeleteComponentTemplateAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/template/delete/DeleteComponentTemplateAction.java @@ -8,7 +8,6 @@ package org.elasticsearch.action.admin.indices.template.delete; -import org.elasticsearch.Version; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionType; import org.elasticsearch.action.support.master.AcknowledgedResponse; @@ -38,11 +37,7 @@ public static class Request extends MasterNodeRequest { public Request(StreamInput in) throws IOException { super(in); - if (in.getVersion().onOrAfter(Version.V_7_13_0)) { - names = in.readStringArray(); - } else { - names = new String[] {in.readString()}; - } + names = in.readStringArray(); } /** @@ -71,11 +66,7 @@ public String[] names() { @Override public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); - if (out.getVersion().onOrAfter(Version.V_7_13_0)) { - out.writeStringArray(names); - } else { - out.writeString(names[0]); - } + out.writeStringArray(names); } } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/template/delete/DeleteComposableIndexTemplateAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/template/delete/DeleteComposableIndexTemplateAction.java index 876621eb7d019..5613db61bb4d4 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/template/delete/DeleteComposableIndexTemplateAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/template/delete/DeleteComposableIndexTemplateAction.java @@ -8,7 +8,6 @@ package org.elasticsearch.action.admin.indices.template.delete; -import org.elasticsearch.Version; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionType; import org.elasticsearch.action.support.master.AcknowledgedResponse; @@ -38,11 +37,7 @@ public static class Request extends MasterNodeRequest { public Request(StreamInput in) throws IOException { super(in); - if (in.getVersion().onOrAfter(Version.V_7_13_0)) { - names = in.readStringArray(); - } else { - names = new String[] {in.readString()}; - } + names = in.readStringArray(); } /** @@ -71,11 +66,7 @@ public String[] names() { @Override public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); - if (out.getVersion().onOrAfter(Version.V_7_13_0)) { - out.writeStringArray(names); - } else { - out.writeString(names[0]); - } + out.writeStringArray(names); } @Override diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/DataStreamAlias.java b/server/src/main/java/org/elasticsearch/cluster/metadata/DataStreamAlias.java index 598cddd4e8e60..3046c9d4ba039 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/DataStreamAlias.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/DataStreamAlias.java @@ -7,17 +7,16 @@ */ package org.elasticsearch.cluster.metadata; -import org.elasticsearch.Version; import org.elasticsearch.cluster.AbstractDiffable; import org.elasticsearch.cluster.Diff; +import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.compress.CompressedXContent; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.xcontent.ConstructingObjectParser; +import org.elasticsearch.common.xcontent.ObjectParser; +import org.elasticsearch.common.xcontent.ParseField; import org.elasticsearch.common.xcontent.ToXContentFragment; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentFactory; @@ -108,7 +107,7 @@ public DataStreamAlias(StreamInput in) throws IOException { this.name = in.readString(); this.dataStreams = in.readStringList(); this.writeDataStream = in.readOptionalString(); - this.filter = in.getVersion().onOrAfter(Version.V_7_15_0) && in.readBoolean() ? CompressedXContent.readCompressedString(in) : null; + this.filter = in.readBoolean() ? CompressedXContent.readCompressedString(in) : null; } /** @@ -297,13 +296,11 @@ public void writeTo(StreamOutput out) throws IOException { out.writeString(name); out.writeStringCollection(dataStreams); out.writeOptionalString(writeDataStream); - if (out.getVersion().onOrAfter(Version.V_7_15_0)) { - if (filter != null) { - out.writeBoolean(true); - filter.writeTo(out); - } else { - out.writeBoolean(false); - } + if (filter != null) { + out.writeBoolean(true); + filter.writeTo(out); + } else { + out.writeBoolean(false); } } diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/DataStreamMetadata.java b/server/src/main/java/org/elasticsearch/cluster/metadata/DataStreamMetadata.java index cf76bf6b127d2..611e7a78e7064 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/DataStreamMetadata.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/DataStreamMetadata.java @@ -64,8 +64,6 @@ public class DataStreamMetadata implements Metadata.Custom { }, DATA_STREAM_ALIASES); } - public static final Version DATA_STREAM_ALIAS_VERSION = Version.V_7_14_0; - private final Map dataStreams; private final Map dataStreamAliases; @@ -76,8 +74,7 @@ public DataStreamMetadata(Map dataStreams, } public DataStreamMetadata(StreamInput in) throws IOException { - this(in.readMap(StreamInput::readString, DataStream::new), in.getVersion().onOrAfter(DATA_STREAM_ALIAS_VERSION) ? - in.readMap(StreamInput::readString, DataStreamAlias::new) : Map.of()); + this(in.readMap(StreamInput::readString, DataStream::new), in.readMap(StreamInput::readString, DataStreamAlias::new)); } public Map dataStreams() { @@ -115,9 +112,7 @@ public Version getMinimalSupportedVersion() { @Override public void writeTo(StreamOutput out) throws IOException { out.writeMap(this.dataStreams, StreamOutput::writeString, (stream, val) -> val.writeTo(stream)); - if (out.getVersion().onOrAfter(DATA_STREAM_ALIAS_VERSION)) { - out.writeMap(this.dataStreamAliases, StreamOutput::writeString, (stream, val) -> val.writeTo(stream)); - } + out.writeMap(this.dataStreamAliases, StreamOutput::writeString, (stream, val) -> val.writeTo(stream)); } public static DataStreamMetadata fromXContent(XContentParser parser) throws IOException { @@ -177,12 +172,8 @@ static class DataStreamMetadataDiff implements NamedDiff { DataStreamMetadataDiff(StreamInput in) throws IOException { this.dataStreamDiff = DiffableUtils.readJdkMapDiff(in, DiffableUtils.getStringKeySerializer(), DataStream::new, DataStream::readDiffFrom); - if (in.getVersion().onOrAfter(DATA_STREAM_ALIAS_VERSION)) { - this.dataStreamAliasDiff = DiffableUtils.readJdkMapDiff(in, DiffableUtils.getStringKeySerializer(), - DataStreamAlias::new, DataStreamAlias::readDiffFrom); - } else { - this.dataStreamAliasDiff = null; - } + this.dataStreamAliasDiff = DiffableUtils.readJdkMapDiff(in, DiffableUtils.getStringKeySerializer(), + DataStreamAlias::new, DataStreamAlias::readDiffFrom); } @Override @@ -196,9 +187,7 @@ public Metadata.Custom apply(Metadata.Custom part) { @Override public void writeTo(StreamOutput out) throws IOException { dataStreamDiff.writeTo(out); - if (out.getVersion().onOrAfter(DATA_STREAM_ALIAS_VERSION)) { - dataStreamAliasDiff.writeTo(out); - } + dataStreamAliasDiff.writeTo(out); } @Override diff --git a/server/src/main/java/org/elasticsearch/ingest/IngestService.java b/server/src/main/java/org/elasticsearch/ingest/IngestService.java index 6a08f972f85ce..98ea8a351e607 100644 --- a/server/src/main/java/org/elasticsearch/ingest/IngestService.java +++ b/server/src/main/java/org/elasticsearch/ingest/IngestService.java @@ -14,7 +14,6 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.ExceptionsHelper; import org.elasticsearch.ResourceNotFoundException; -import org.elasticsearch.Version; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.DocWriteRequest; import org.elasticsearch.action.admin.cluster.node.info.NodeInfo; @@ -352,15 +351,6 @@ public void putPipeline( } } - if (state.getNodes().getMinNodeVersion().before(Version.V_7_15_0)) { - pipelineConfig = pipelineConfig == null - ? XContentHelper.convertToMap(request.getSource(), false, request.getXContentType()).v2() - : pipelineConfig; - if (pipelineConfig.containsKey(Pipeline.META_KEY)) { - throw new IllegalStateException("pipelines with _meta field require minimum node version of " + Version.V_7_15_0); - } - } - final Map config = pipelineConfig == null ? XContentHelper.convertToMap(request.getSource(), false, request.getXContentType()).v2() : pipelineConfig; diff --git a/server/src/main/java/org/elasticsearch/monitor/fs/FsInfo.java b/server/src/main/java/org/elasticsearch/monitor/fs/FsInfo.java index c9f3c6206484b..b21278bedfd51 100644 --- a/server/src/main/java/org/elasticsearch/monitor/fs/FsInfo.java +++ b/server/src/main/java/org/elasticsearch/monitor/fs/FsInfo.java @@ -8,8 +8,6 @@ package org.elasticsearch.monitor.fs; -import org.elasticsearch.Version; -import org.elasticsearch.core.Nullable; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; @@ -17,6 +15,7 @@ import org.elasticsearch.common.xcontent.ToXContentFragment; import org.elasticsearch.common.xcontent.ToXContentObject; import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.core.Nullable; import java.io.IOException; import java.util.Arrays; @@ -237,13 +236,8 @@ public DeviceStats(StreamInput in) throws IOException { previousSectorsRead = in.readLong(); currentSectorsWritten = in.readLong(); previousSectorsWritten = in.readLong(); - if (in.getVersion().onOrAfter(Version.V_7_14_0)) { - currentIOTime = in.readLong(); - previousIOTime = in.readLong(); - } else { - currentIOTime = -1; - previousIOTime = -1; - } + currentIOTime = in.readLong(); + previousIOTime = in.readLong(); } @Override @@ -259,10 +253,8 @@ public void writeTo(StreamOutput out) throws IOException { out.writeLong(previousSectorsRead); out.writeLong(currentSectorsWritten); out.writeLong(previousSectorsWritten); - if (out.getVersion().onOrAfter(Version.V_7_14_0)) { - out.writeLong(currentIOTime); - out.writeLong(previousIOTime); - } + out.writeLong(currentIOTime); + out.writeLong(previousIOTime); } public long operations() { @@ -370,11 +362,7 @@ public IoStats(StreamInput in) throws IOException { this.totalWriteOperations = in.readLong(); this.totalReadKilobytes = in.readLong(); this.totalWriteKilobytes = in.readLong(); - if (in.getVersion().onOrAfter(Version.V_7_14_0)) { - this.totalIOTimeInMillis = in.readLong(); - } else { - this.totalIOTimeInMillis = -1; - } + this.totalIOTimeInMillis = in.readLong(); } @Override @@ -388,9 +376,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeLong(totalWriteOperations); out.writeLong(totalReadKilobytes); out.writeLong(totalWriteKilobytes); - if (out.getVersion().onOrAfter(Version.V_7_14_0)) { - out.writeLong(totalIOTimeInMillis); - } + out.writeLong(totalIOTimeInMillis); } public DeviceStats[] getDevicesStats() { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/deprecation/DeprecationIssue.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/deprecation/DeprecationIssue.java index 402f3b1285c7f..56ac3ab35a09e 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/deprecation/DeprecationIssue.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/deprecation/DeprecationIssue.java @@ -6,14 +6,13 @@ */ package org.elasticsearch.xpack.core.deprecation; -import org.elasticsearch.Version; -import org.elasticsearch.core.Nullable; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.xcontent.ToXContentObject; import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.core.Nullable; import java.io.IOException; import java.util.Locale; @@ -82,8 +81,8 @@ public DeprecationIssue(StreamInput in) throws IOException { message = in.readString(); url = in.readString(); details = in.readOptionalString(); - resolveDuringRollingUpgrade = in.getVersion().onOrAfter(Version.V_7_15_0) && in.readBoolean(); - meta = in.getVersion().onOrAfter(Version.V_7_14_0) ? in.readMap() : null; + resolveDuringRollingUpgrade = in.readBoolean(); + meta = in.readMap(); } public Level getLevel() { @@ -123,12 +122,8 @@ public void writeTo(StreamOutput out) throws IOException { out.writeString(message); out.writeString(url); out.writeOptionalString(details); - if (out.getVersion().onOrAfter(Version.V_7_15_0)) { - out.writeBoolean(resolveDuringRollingUpgrade); - } - if (out.getVersion().onOrAfter(Version.V_7_14_0)) { - out.writeMap(meta); - } + out.writeBoolean(resolveDuringRollingUpgrade); + out.writeMap(meta); } @Override diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/IndexLifecycleFeatureSetUsage.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/IndexLifecycleFeatureSetUsage.java index 45eb921167ac8..26e544915b7fc 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/IndexLifecycleFeatureSetUsage.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/IndexLifecycleFeatureSetUsage.java @@ -172,20 +172,14 @@ public PhaseStats(TimeValue after, String[] actionNames, ActionConfigStats confi public PhaseStats(StreamInput in) throws IOException { actionNames = in.readStringArray(); minimumAge = in.readTimeValue(); - if (in.getVersion().onOrAfter(Version.V_7_15_0)) { - configurations = new ActionConfigStats(in); - } else { - configurations = ActionConfigStats.builder().build(); - } + configurations = new ActionConfigStats(in); } @Override public void writeTo(StreamOutput out) throws IOException { out.writeStringArray(actionNames); out.writeTimeValue(minimumAge); - if (out.getVersion().onOrAfter(Version.V_7_15_0)) { - configurations.writeTo(out); - } + configurations.writeTo(out); } @Override diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/LifecyclePolicy.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/LifecyclePolicy.java index d4b9e20b02d1f..5ba80505ac911 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/LifecyclePolicy.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/LifecyclePolicy.java @@ -6,19 +6,18 @@ */ package org.elasticsearch.xpack.core.ilm; -import org.elasticsearch.Version; import org.elasticsearch.client.Client; import org.elasticsearch.cluster.AbstractDiffable; import org.elasticsearch.cluster.Diffable; -import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.xcontent.ConstructingObjectParser; +import org.elasticsearch.common.xcontent.ParseField; import org.elasticsearch.common.xcontent.ToXContentObject; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.core.Nullable; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.xpack.core.ilm.Step.StepKey; @@ -100,11 +99,7 @@ public LifecyclePolicy(StreamInput in) throws IOException { type = in.readNamedWriteable(LifecycleType.class); name = in.readString(); phases = Collections.unmodifiableMap(in.readMap(StreamInput::readString, Phase::new)); - if (in.getVersion().onOrAfter(Version.V_7_14_0)) { - this.metadata = in.readMap(); - } else { - this.metadata = null; - } + this.metadata = in.readMap(); } /** @@ -138,9 +133,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeNamedWriteable(type); out.writeString(name); out.writeMap(phases, StreamOutput::writeString, (o, val) -> val.writeTo(o)); - if (out.getVersion().onOrAfter(Version.V_7_14_0)) { - out.writeMap(this.metadata); - } + out.writeMap(this.metadata); } /** diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/action/GetLifecycleAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/action/GetLifecycleAction.java index 3a4088f6ab79d..e8de1905af238 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/action/GetLifecycleAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/action/GetLifecycleAction.java @@ -7,7 +7,6 @@ package org.elasticsearch.xpack.core.ilm.action; -import org.elasticsearch.Version; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.ActionType; @@ -23,7 +22,6 @@ import java.io.IOException; import java.util.Arrays; -import java.util.Collections; import java.util.List; import java.util.Objects; @@ -166,11 +164,7 @@ public LifecyclePolicyResponseItem(LifecyclePolicy lifecyclePolicy, long version this.lifecyclePolicy = new LifecyclePolicy(in); this.version = in.readVLong(); this.modifiedDate = in.readString(); - if (in.getVersion().onOrAfter(Version.V_7_14_0)) { - this.usage = new ItemUsage(in); - } else { - this.usage = new ItemUsage(Collections.emptyList(), Collections.emptyList(), Collections.emptyList()); - } + this.usage = new ItemUsage(in); } @Override @@ -178,9 +172,7 @@ public void writeTo(StreamOutput out) throws IOException { lifecyclePolicy.writeTo(out); out.writeVLong(version); out.writeString(modifiedDate); - if (out.getVersion().onOrAfter(Version.V_7_14_0)) { - this.usage.writeTo(out); - } + this.usage.writeTo(out); } public LifecyclePolicy getLifecyclePolicy() { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/action/MoveToStepAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/action/MoveToStepAction.java index 9910720750488..6a0ad231ab345 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/action/MoveToStepAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/action/MoveToStepAction.java @@ -7,7 +7,6 @@ */ package org.elasticsearch.xpack.core.ilm.action; -import org.elasticsearch.Version; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionType; import org.elasticsearch.action.support.master.AcknowledgedRequest; @@ -67,12 +66,7 @@ public Request(StreamInput in) throws IOException { super(in); this.index = in.readString(); this.currentStepKey = new StepKey(in); - if (in.getVersion().onOrAfter(Version.V_7_15_0)) { - this.nextStepKey = new PartialStepKey(in); - } else { - StepKey spec = new StepKey(in); - this.nextStepKey = new PartialStepKey(spec.getPhase(), spec.getAction(), spec.getName()); - } + this.nextStepKey = new PartialStepKey(in); } public Request() { @@ -104,14 +98,7 @@ public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); out.writeString(index); currentStepKey.writeTo(out); - if (out.getVersion().onOrAfter(Version.V_7_15_0)) { - nextStepKey.writeTo(out); - } else { - String action = nextStepKey.getAction(); - String name = nextStepKey.getName(); - StepKey key = new StepKey(nextStepKey.getPhase(), action == null ? "" : action, name == null ? "" : name); - key.writeTo(out); - } + nextStepKey.writeTo(out); } @Override diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/SnapshotInvocationRecord.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/SnapshotInvocationRecord.java index 55ef99e155781..38fd95aac9af0 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/SnapshotInvocationRecord.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/SnapshotInvocationRecord.java @@ -7,7 +7,6 @@ package org.elasticsearch.xpack.core.slm; -import org.elasticsearch.Version; import org.elasticsearch.cluster.AbstractDiffable; import org.elasticsearch.cluster.Diffable; import org.elasticsearch.common.io.stream.StreamInput; @@ -64,11 +63,7 @@ public SnapshotInvocationRecord(String snapshotName, Long snapshotStartTimestamp public SnapshotInvocationRecord(StreamInput in) throws IOException { this.snapshotName = in.readString(); - if (in.getVersion().onOrAfter(Version.V_7_15_0)) { - this.snapshotStartTimestamp = in.readOptionalVLong(); - } else { - this.snapshotStartTimestamp = null; - } + this.snapshotStartTimestamp = in.readOptionalVLong(); this.snapshotFinishTimestamp = in.readVLong(); this.details = in.readOptionalString(); } @@ -93,9 +88,7 @@ public String getDetails() { @Override public void writeTo(StreamOutput out) throws IOException { out.writeString(snapshotName); - if (out.getVersion().onOrAfter(Version.V_7_15_0)) { - out.writeOptionalVLong(snapshotStartTimestamp); - } + out.writeOptionalVLong(snapshotStartTimestamp); out.writeVLong(snapshotFinishTimestamp); out.writeOptionalString(details); } diff --git a/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/action/InternalExecutePolicyAction.java b/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/action/InternalExecutePolicyAction.java index 83422939ac2ad..2298e861341a7 100644 --- a/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/action/InternalExecutePolicyAction.java +++ b/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/action/InternalExecutePolicyAction.java @@ -8,7 +8,6 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.elasticsearch.Version; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.ActionListenerResponseHandler; import org.elasticsearch.action.ActionType; @@ -167,8 +166,6 @@ DiscoveryNode selectNodeForPolicyExecution(DiscoveryNodes discoNodes) { .filter(discoNode -> discoNode.getId().equals(discoNodes.getMasterNodeId()) == false) // filter out dedicated master nodes .filter(discoNode -> discoNode.getRoles().equals(Set.of(DiscoveryNodeRole.MASTER_ROLE)) == false) - // Filter out nodes that don't have this action yet - .filter(discoNode -> discoNode.getVersion().onOrAfter(Version.V_7_15_0)) .toArray(DiscoveryNode[]::new); if (nodes.length == 0) { throw new IllegalStateException("no suitable node was found to perform enrich policy execution"); diff --git a/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/action/InternalExecutePolicyActionTests.java b/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/action/InternalExecutePolicyActionTests.java index 612407d584357..e4fa6c53ae068 100644 --- a/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/action/InternalExecutePolicyActionTests.java +++ b/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/action/InternalExecutePolicyActionTests.java @@ -91,21 +91,6 @@ public void testSelectNodeForPolicyExecutionNoNodeWithIngestRole() { assertThat(e.getMessage(), equalTo("no ingest nodes in this cluster")); } - public void testSelectNodeForPolicyExecutionMixedVersions() { - var node1 = newNode(randomAlphaOfLength(4), Version.V_7_14_0); - var node2 = newNode(randomAlphaOfLength(4), Version.V_7_14_0); - var node3 = newNode(randomAlphaOfLength(4)); - var discoNodes = DiscoveryNodes.builder() - .add(node1) - .add(node2) - .add(node3) - .masterNodeId(node3.getId()) - .localNodeId(node3.getId()) - .build(); - var e = expectThrows(IllegalStateException.class, () -> transportAction.selectNodeForPolicyExecution(discoNodes)); - assertThat(e.getMessage(), equalTo("no suitable node was found to perform enrich policy execution")); - } - public void testSelectNodeForPolicyExecutionPickLocalNodeIfNotElectedMaster() { var node1 = newNode(randomAlphaOfLength(4)); var node2 = newNode(randomAlphaOfLength(4)); From 90d9403c8209ef54870e10de71243aa807051551 Mon Sep 17 00:00:00 2001 From: Lukas Wegmann Date: Tue, 28 Sep 2021 18:06:46 +0200 Subject: [PATCH 037/250] Enable full BWC tests for #77750 Fixes and enables the full bwc tests introduced in #77750 after backporting to 7.16. The changes to the tests have already been applied to 7.x in the backport PR #78363. --- .../xpack/sql/qa/mixed_node/SqlCompatIT.java | 45 ++++++++++++------- 1 file changed, 28 insertions(+), 17 deletions(-) diff --git a/x-pack/plugin/sql/qa/mixed-node/src/test/java/org/elasticsearch/xpack/sql/qa/mixed_node/SqlCompatIT.java b/x-pack/plugin/sql/qa/mixed-node/src/test/java/org/elasticsearch/xpack/sql/qa/mixed_node/SqlCompatIT.java index 3538624b4f848..0759f1b4ce24d 100644 --- a/x-pack/plugin/sql/qa/mixed-node/src/test/java/org/elasticsearch/xpack/sql/qa/mixed_node/SqlCompatIT.java +++ b/x-pack/plugin/sql/qa/mixed-node/src/test/java/org/elasticsearch/xpack/sql/qa/mixed_node/SqlCompatIT.java @@ -64,37 +64,48 @@ public static void cleanUpClients() throws IOException { }); } - public void testNullsOrderBeforeMissingOrderSupport() throws IOException { + public void testNullsOrderBeforeMissingOrderSupportQueryingNewNode() throws IOException { + testNullsOrderBeforeMissingOrderSupport(newNodesClient); + } + + public void testNullsOrderBeforeMissingOrderSupportQueryingOldNode() throws IOException { + testNullsOrderBeforeMissingOrderSupport(oldNodesClient); + } + + private void testNullsOrderBeforeMissingOrderSupport(RestClient client) throws IOException { assumeTrue( "expected some nodes without support for missing_order but got none", bwcVersion.before(INTRODUCING_MISSING_ORDER_IN_COMPOSITE_AGGS_VERSION) ); - for (RestClient bwcClient : Arrays.asList(newNodesClient, oldNodesClient)) { - List result = runOrderByNullsLastQuery(bwcClient); + List result = runOrderByNullsLastQuery(client); - assertEquals(3, result.size()); - assertNull(result.get(0)); - assertEquals(Integer.valueOf(1), result.get(1)); - assertEquals(Integer.valueOf(2), result.get(2)); - } + assertEquals(3, result.size()); + assertNull(result.get(0)); + assertEquals(Integer.valueOf(1), result.get(1)); + assertEquals(Integer.valueOf(2), result.get(2)); } - public void testNullsOrderWithMissingOrderSupport() throws IOException { + public void testNullsOrderWithMissingOrderSupportQueryingNewNode() throws IOException { + testNullsOrderWithMissingOrderSupport(newNodesClient); + } + + public void testNullsOrderWithMissingOrderSupportQueryingOldNode() throws IOException { + testNullsOrderWithMissingOrderSupport(oldNodesClient); + } + + private void testNullsOrderWithMissingOrderSupport(RestClient client) throws IOException { assumeTrue( "expected all nodes with support for missing_order but got some without", bwcVersion.onOrAfter(INTRODUCING_MISSING_ORDER_IN_COMPOSITE_AGGS_VERSION) ); - // TODO: add oldNodesClient once PR is backported to 7.x - for (RestClient bwcClient : Arrays.asList(newNodesClient)) { - List result = runOrderByNullsLastQuery(bwcClient); + List result = runOrderByNullsLastQuery(client); - assertEquals(3, result.size()); - assertEquals(Integer.valueOf(1), result.get(0)); - assertEquals(Integer.valueOf(2), result.get(1)); - assertNull(result.get(2)); - } + assertEquals(3, result.size()); + assertEquals(Integer.valueOf(1), result.get(0)); + assertEquals(Integer.valueOf(2), result.get(1)); + assertNull(result.get(2)); } @SuppressWarnings("unchecked") From b08f0fde074cab1352772819efbb4f24d0462fbe Mon Sep 17 00:00:00 2001 From: Benjamin Trent Date: Tue, 28 Sep 2021 12:52:23 -0400 Subject: [PATCH 038/250] [ML] fixing ML composite agg restart test (#78329) The test failure is due to data generation. This isn't caused by a bug, but is instead a test set up failure. The issue is that scroll is seeing the data as a partial result, and aggs is not. Consequently, the first bucket is sometimes only present in scroll, but missing in aggs. This is acceptable. This commit fixes the test to make it more deterministic. closes #76075 --- .../xpack/ml/integration/DatafeedJobsIT.java | 30 +++++++++++++++++-- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/DatafeedJobsIT.java b/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/DatafeedJobsIT.java index f6d7137bd6e71..447bb81f75780 100644 --- a/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/DatafeedJobsIT.java +++ b/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/DatafeedJobsIT.java @@ -43,6 +43,7 @@ import org.elasticsearch.xpack.core.ml.job.config.JobState; import org.elasticsearch.xpack.core.ml.job.process.autodetect.state.DataCounts; import org.elasticsearch.xpack.core.ml.job.results.Bucket; +import org.elasticsearch.xpack.core.ml.utils.Intervals; import org.hamcrest.Matcher; import org.junit.After; @@ -309,12 +310,32 @@ public void testStopAndRestartCompositeDatafeed() throws Exception { .setMapping("time", "type=date") .get(); long numDocs = randomIntBetween(32, 2048); + final long intervalMillis = TimeValue.timeValueHours(1).millis(); long now = System.currentTimeMillis(); long oneWeekAgo = now - 604800000; long twoWeeksAgo = oneWeekAgo - 604800000; - indexDocs(logger, indexName, numDocs, twoWeeksAgo, oneWeekAgo); + indexDocs( + logger, + indexName, + 1, + Intervals.alignToCeil(twoWeeksAgo, intervalMillis), + Intervals.alignToCeil(twoWeeksAgo, intervalMillis) + 1 + ); + indexDocs( + logger, + indexName, + numDocs - 1, + Intervals.alignToCeil(twoWeeksAgo, intervalMillis) + intervalMillis, + Intervals.alignToFloor(oneWeekAgo, intervalMillis) + ); long numDocs2 = randomIntBetween(32, 2048); - indexDocs(logger, indexName, numDocs2, oneWeekAgo, now); + indexDocs( + logger, + indexName, + numDocs2, + Intervals.alignToCeil(oneWeekAgo, intervalMillis), + Intervals.alignToFloor(now, intervalMillis) + ); client().admin().cluster().prepareHealth(indexName).setWaitForYellowStatus().get(); String scrollJobId = "stop-restart-scroll"; @@ -423,7 +444,10 @@ public void testStopAndRestartCompositeDatafeed() throws Exception { Bucket scrollBucket = scrollBuckets.get(i); Bucket compositeBucket = compositeBuckets.get(i); try { - assertThat(compositeBucket.getTimestamp(), equalTo(scrollBucket.getTimestamp())); + assertThat("scroll buckets " + scrollBuckets + " composite buckets " + compositeBuckets, + compositeBucket.getTimestamp(), + equalTo(scrollBucket.getTimestamp()) + ); assertThat( "composite bucket [" + compositeBucket.getTimestamp() + "] [" + compositeBucket.getEventCount() + "] does not equal" + " scroll bucket [" + scrollBucket.getTimestamp() + "] [" + scrollBucket.getEventCount() + "]", From d49bdf977341b17bd884548240340d2371b1d2d1 Mon Sep 17 00:00:00 2001 From: Christos Soulios <1561376+csoulios@users.noreply.github.com> Date: Tue, 28 Sep 2021 21:38:05 +0300 Subject: [PATCH 039/250] Remove index.mode setting from time series mappings tests (#78406) PR removes index.mode setting from yaml tests that only test time_series_* mapping parameters. index.mode: time_series is not needed for testing the mapping parameters and tests fail when the feature flag is not enabled. Closes #78361 --- .../resources/rest-api-spec/test/tsdb/20_mappings.yml | 1 - .../rest-api-spec/test/aggregate-metrics/90_tsdb_mappings.yml | 2 -- .../resources/rest-api-spec/test/analytics/histogram.yml | 1 - 3 files changed, 4 deletions(-) diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/tsdb/20_mappings.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/tsdb/20_mappings.yml index f8ea4e5209a0f..f32dfb34bfee1 100644 --- a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/tsdb/20_mappings.yml +++ b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/tsdb/20_mappings.yml @@ -9,7 +9,6 @@ add time series mappings: body: settings: index: - mode: time_series number_of_replicas: 0 number_of_shards: 2 mappings: diff --git a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/aggregate-metrics/90_tsdb_mappings.yml b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/aggregate-metrics/90_tsdb_mappings.yml index 36bc6ee842241..2090603957f65 100644 --- a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/aggregate-metrics/90_tsdb_mappings.yml +++ b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/aggregate-metrics/90_tsdb_mappings.yml @@ -9,7 +9,6 @@ aggregate_double_metric with time series mappings: body: settings: index: - mode: time_series number_of_replicas: 0 number_of_shards: 2 mappings: @@ -59,7 +58,6 @@ aggregate_double_metric with wrong time series mappings: body: settings: index: - mode: time_series number_of_replicas: 0 number_of_shards: 2 mappings: diff --git a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/analytics/histogram.yml b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/analytics/histogram.yml index 5a8639c2b8214..127dbb82fc5ea 100644 --- a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/analytics/histogram.yml +++ b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/analytics/histogram.yml @@ -222,7 +222,6 @@ histogram with wrong time series mappings: body: settings: index: - mode: time_series number_of_replicas: 0 number_of_shards: 2 mappings: From 58595e7af5b176d8d270609ea0cfb68013606dfb Mon Sep 17 00:00:00 2001 From: James Rodewig <40268737+jrodewig@users.noreply.github.com> Date: Tue, 28 Sep 2021 14:51:45 -0400 Subject: [PATCH 040/250] [DOCS] Searches on the `_type` field are no longer supported (#78400) Adds an 8.0 breaking change for PR #68564 --- .../migration/migrate_8_0/search.asciidoc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/docs/reference/migration/migrate_8_0/search.asciidoc b/docs/reference/migration/migrate_8_0/search.asciidoc index 7a5459d4f4481..6fe9b400e0489 100644 --- a/docs/reference/migration/migrate_8_0/search.asciidoc +++ b/docs/reference/migration/migrate_8_0/search.asciidoc @@ -6,6 +6,23 @@ //Installation and Upgrade Guide //tag::notable-breaking-changes[] +[[_type-search-matches-no-docs]] +.Searches on the `_type` field are no longer supported. +[%collapsible] +==== +*Details* + +In 8.x, the `_type` metadata field has been removed. {es} now handles a search +on the `_type` field as a search on a non-existent field. A search on a +non-existent field matches no documents, regardless of the query string. + +In 7.x, a search for `_doc` in the `_type` field would match the same documents +as a `match_all` query. + +*Impact* + +Remove queries on the `_type` field from your search requests and search +templates. Searches that include these queries may return no results. +==== + [[msearch-empty-line-support]] .The multi search API now parses an empty first line as action metadata in text files. [%collapsible] From 6c58c51bcf6c90c0ca24dbbd15ab740007508902 Mon Sep 17 00:00:00 2001 From: Benjamin Trent Date: Tue, 28 Sep 2021 15:30:33 -0400 Subject: [PATCH 041/250] [ML] prevent opening anomaly detection jobs with a current model snapshot before 7.0.0 (#78401) Anomaly detection jobs with current model snapshot's where the min_version is before 7.0.0 shouldn't open. To remediate, the user should do one of the following BEFORE upgrading to 8.0.0: - Delete the model snapshot - Revert to a separate snapshot with a later minimum version - Reset the job to empty - Call the upgrade model snapshot: https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-upgrade-job-model-snapshot.html The only remediations AFTER upgrading to 8.0.0 are: - Revert to a separate snapshot with a later minimum version - Reset the job to empty - Delete the model snapshot closes #78382 --- .../ml/integration/AnomalyJobCRUDIT.java | 41 +++++++++++ .../ml/action/TransportOpenJobAction.java | 53 +++++++++++++- .../task/OpenJobPersistentTasksExecutor.java | 73 ++++++++++++++++++- 3 files changed, 163 insertions(+), 4 deletions(-) diff --git a/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/AnomalyJobCRUDIT.java b/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/AnomalyJobCRUDIT.java index 81aae66b3aa15..ef430554946a0 100644 --- a/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/AnomalyJobCRUDIT.java +++ b/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/AnomalyJobCRUDIT.java @@ -8,6 +8,7 @@ import static org.elasticsearch.xpack.core.ClientHelper.ML_ORIGIN; import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.hasSize; import java.util.ArrayList; import java.util.Arrays; @@ -28,7 +29,10 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.threadpool.ThreadPool; +import org.elasticsearch.xpack.core.ml.action.GetModelSnapshotsAction; +import org.elasticsearch.xpack.core.ml.action.OpenJobAction; import org.elasticsearch.xpack.core.ml.action.PutJobAction; +import org.elasticsearch.xpack.core.ml.action.RevertModelSnapshotAction; import org.elasticsearch.xpack.core.ml.action.UpdateJobAction; import org.elasticsearch.xpack.core.ml.job.config.AnalysisConfig; import org.elasticsearch.xpack.core.ml.job.config.AnalysisLimits; @@ -38,6 +42,8 @@ import org.elasticsearch.xpack.core.ml.job.config.Job; import org.elasticsearch.xpack.core.ml.job.config.JobUpdate; import org.elasticsearch.xpack.core.ml.job.process.autodetect.state.ModelSizeStats; +import org.elasticsearch.xpack.core.ml.job.process.autodetect.state.ModelSnapshot; +import org.elasticsearch.xpack.core.ml.job.process.autodetect.state.Quantiles; import org.elasticsearch.xpack.ml.MlSingleNodeTestCase; import org.elasticsearch.xpack.ml.inference.ingest.InferenceProcessor; import org.elasticsearch.xpack.ml.job.persistence.JobResultsPersister; @@ -147,6 +153,41 @@ public void testPutJobWithClosedStateIndex() { client().admin().indices().prepareDelete(".ml-state-000001").get(); } + public void testOpenJobWithOldSnapshot() { + String jobId = "open-job-with-old-model-snapshot"; + Date timestamp = new Date(); + createJob(jobId); + ModelSnapshot snapshot = new ModelSnapshot + .Builder(jobId) + .setMinVersion("6.0.0") + .setSnapshotId("snap_1") + .setQuantiles(new Quantiles(jobId, timestamp, "quantiles-1")) + .setSnapshotDocCount(1) + .setModelSizeStats(new ModelSizeStats.Builder(jobId).setTimestamp(timestamp).setLogTime(timestamp)) + .build(); + indexModelSnapshot(snapshot); + GetModelSnapshotsAction.Response getResponse = + client().execute(GetModelSnapshotsAction.INSTANCE, new GetModelSnapshotsAction.Request(jobId, "snap_1")).actionGet(); + assertThat(getResponse.getResources().results(), hasSize(1)); + client().execute(RevertModelSnapshotAction.INSTANCE, new RevertModelSnapshotAction.Request(jobId, "snap_1")).actionGet(); + + // should fail? + Exception ex = expectThrows(Exception.class, + () -> client() + .execute(OpenJobAction.INSTANCE, new OpenJobAction.Request(jobId)) + .actionGet()); + assertThat(ex.getMessage(), + containsString( + "[open-job-with-old-model-snapshot] job snapshot [snap_1] has min version before [7.0.0], " + + "please revert to a newer model snapshot or reset the job" + ) + ); + } + + private void indexModelSnapshot(ModelSnapshot snapshot) { + jobResultsPersister.persistModelSnapshot(snapshot, WriteRequest.RefreshPolicy.IMMEDIATE, () -> true); + } + private void testCreateWithExistingDocs(IndexRequest indexRequest, String jobId) { OriginSettingClient client = new OriginSettingClient(client(), ML_ORIGIN); client.index(indexRequest).actionGet(); diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportOpenJobAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportOpenJobAction.java index aefdbd466e5a6..e1e3ef2f79a2a 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportOpenJobAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportOpenJobAction.java @@ -12,10 +12,12 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.ElasticsearchStatusException; import org.elasticsearch.ResourceAlreadyExistsException; +import org.elasticsearch.ResourceNotFoundException; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.support.ActionFilters; import org.elasticsearch.action.support.master.TransportMasterNodeAction; import org.elasticsearch.client.Client; +import org.elasticsearch.client.OriginSettingClient; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.block.ClusterBlockException; import org.elasticsearch.cluster.block.ClusterBlockLevel; @@ -35,6 +37,7 @@ import org.elasticsearch.xpack.core.XPackField; import org.elasticsearch.xpack.core.ml.MlConfigIndex; import org.elasticsearch.xpack.core.ml.MlTasks; +import org.elasticsearch.xpack.core.ml.action.GetModelSnapshotsAction; import org.elasticsearch.xpack.core.ml.action.NodeAcknowledgedResponse; import org.elasticsearch.xpack.core.ml.action.OpenJobAction; import org.elasticsearch.xpack.core.ml.job.config.Job; @@ -51,6 +54,8 @@ import java.util.Optional; import java.util.function.Predicate; +import static org.elasticsearch.xpack.core.ClientHelper.ML_ORIGIN; +import static org.elasticsearch.xpack.ml.job.task.OpenJobPersistentTasksExecutor.MIN_SUPPORTED_SNAPSHOT_VERSION; import static org.elasticsearch.xpack.ml.job.task.OpenJobPersistentTasksExecutor.checkAssignmentState; /* @@ -86,7 +91,7 @@ public TransportOpenJobAction(Settings settings, TransportService transportServi this.jobConfigProvider = jobConfigProvider; this.memoryTracker = memoryTracker; this.migrationEligibilityCheck = new MlConfigMigrationEligibilityCheck(settings, clusterService); - this.client = client; + this.client = new OriginSettingClient(client, ML_ORIGIN); } @Override @@ -149,12 +154,56 @@ public void onFailure(Exception e) { ); // Tell the job tracker to refresh the memory requirement for this job and all other jobs that have persistent tasks - ActionListener getJobHandler = ActionListener.wrap( + ActionListener modelSnapshotValidationListener = ActionListener.wrap( response -> memoryTracker.refreshAnomalyDetectorJobMemoryAndAllOthers(jobParams.getJobId(), memoryRequirementRefreshListener), listener::onFailure ); + // Validate the model snapshot is supported + ActionListener getJobHandler = ActionListener.wrap( + response -> { + if (jobParams.getJob().getModelSnapshotId() == null) { + modelSnapshotValidationListener.onResponse(true); + return; + } + client.execute( + GetModelSnapshotsAction.INSTANCE, + new GetModelSnapshotsAction.Request(jobParams.getJobId(), jobParams.getJob().getModelSnapshotId()), + ActionListener.wrap( + modelSnapshot -> { + if (modelSnapshot.getPage().results().isEmpty()) { + modelSnapshotValidationListener.onResponse(true); + return; + } + assert modelSnapshot.getPage().results().size() == 1; + if (modelSnapshot.getPage().results().get(0).getMinVersion().onOrAfter(MIN_SUPPORTED_SNAPSHOT_VERSION)) { + modelSnapshotValidationListener.onResponse(true); + return; + } + listener.onFailure( + ExceptionsHelper.serverError( + "[{}] job snapshot [{}] has min version before [{}], " + + "please revert to a newer model snapshot or reset the job", + jobParams.getJobId(), + jobParams.getJob().getModelSnapshotId(), + MIN_SUPPORTED_SNAPSHOT_VERSION.toString() + ) + ); + }, + failure -> { + if (ExceptionsHelper.unwrapCause(failure) instanceof ResourceNotFoundException) { + modelSnapshotValidationListener.onResponse(true); + return; + } + listener.onFailure(ExceptionsHelper.serverError("Unable to validate model snapshot", failure)); + } + ) + ); + }, + listener::onFailure + ); + // Get the job config jobConfigProvider.getJob(jobParams.getJobId(), ActionListener.wrap( builder -> { diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/task/OpenJobPersistentTasksExecutor.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/task/OpenJobPersistentTasksExecutor.java index 050dd9a563751..5c55be11b5e09 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/task/OpenJobPersistentTasksExecutor.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/task/OpenJobPersistentTasksExecutor.java @@ -35,6 +35,7 @@ import org.elasticsearch.xpack.core.ml.MlTasks; import org.elasticsearch.xpack.core.ml.action.FinalizeJobExecutionAction; import org.elasticsearch.xpack.core.ml.action.GetJobsAction; +import org.elasticsearch.xpack.core.ml.action.GetModelSnapshotsAction; import org.elasticsearch.xpack.core.ml.action.OpenJobAction; import org.elasticsearch.xpack.core.ml.action.ResetJobAction; import org.elasticsearch.xpack.core.ml.action.RevertModelSnapshotAction; @@ -72,6 +73,7 @@ public class OpenJobPersistentTasksExecutor extends AbstractJobPersistentTasksExecutor { private static final Logger logger = LogManager.getLogger(OpenJobPersistentTasksExecutor.class); + public static final Version MIN_SUPPORTED_SNAPSHOT_VERSION = Version.V_7_0_0; // Resuming a job with a running datafeed from its current snapshot was added in 7.11 and // can only be done if the master node is on or after that version. @@ -208,7 +210,7 @@ protected void nodeOperation(AllocatedPersistentTask task, OpenJobAction.JobPara jobTask.setAutodetectProcessManager(autodetectProcessManager); JobTaskState jobTaskState = (JobTaskState) state; JobState jobState = jobTaskState == null ? null : jobTaskState.getState(); - ActionListener resultsMappingUpdateHandler = ActionListener.wrap( + ActionListener checkSnapshotVersionListener = ActionListener.wrap( mappingsUpdate -> jobResultsProvider.setRunningForecastsToFailed(params.getJobId(), ActionListener.wrap( r -> runJob(jobTask, jobState, params), e -> { @@ -218,13 +220,24 @@ protected void nodeOperation(AllocatedPersistentTask task, OpenJobAction.JobPara } } )), + e -> { + if (autodetectProcessManager.isNodeDying() == false) { + logger.error(new ParameterizedMessage("[{}] Failed verifying snapshot version", params.getJobId()), e); + failTask(jobTask, "failed snapshot verification; cause: " + e.getMessage()); + } + } + ); + + ActionListener resultsMappingUpdateHandler = ActionListener.wrap( + mappingsUpdate -> verifyCurrentSnapshotVersion(params.getJobId(), checkSnapshotVersionListener), e -> { if (autodetectProcessManager.isNodeDying() == false) { logger.error(new ParameterizedMessage("[{}] Failed to update results mapping", params.getJobId()), e); - failTask(jobTask, "failed to update results mapping"); + failTask(jobTask, "failed to update results mapping; cause: " + e.getMessage()); } } ); + // We need to update the results index as we MAY update the current forecast results, setting the running forcasts to failed // This writes to the results index, which might need updating ElasticsearchMappings.addDocMappingIfMissing( @@ -326,6 +339,62 @@ private void hasRunningDatafeedTask(String jobId, ActionListener listen datafeedConfigProvider.findDatafeedIdsForJobIds(Collections.singleton(jobId), datafeedListener); } + private void verifyCurrentSnapshotVersion(String jobId, ActionListener listener) { + ActionListener jobListener = ActionListener.wrap( + jobResponse -> { + List jobPage = jobResponse.getResponse().results(); + // We requested a single concrete job so if it didn't exist we would get an error + assert jobPage.size() == 1; + String jobSnapshotId = jobPage.get(0).getModelSnapshotId(); + if (jobSnapshotId == null) { + listener.onResponse(true); + return; + } + executeAsyncWithOrigin( + client, + ML_ORIGIN, + GetModelSnapshotsAction.INSTANCE, + new GetModelSnapshotsAction.Request(jobId, jobSnapshotId), + ActionListener.wrap( + snapshot -> { + if (snapshot.getPage().count() == 0) { + listener.onResponse(true); + return; + } + assert snapshot.getPage().results().size() == 1; + ModelSnapshot snapshotObj = snapshot.getPage().results().get(0); + if (snapshotObj.getMinVersion().onOrAfter(MIN_SUPPORTED_SNAPSHOT_VERSION)) { + listener.onResponse(true); + return; + } + listener.onFailure( + ExceptionsHelper.serverError( + "[{}] job snapshot [{}] has min version before [{}], " + + "please revert to a newer model snapshot or reset the job", + jobId, + jobSnapshotId, + MIN_SUPPORTED_SNAPSHOT_VERSION.toString() + ) + ); + }, + snapshotFailure -> { + if (ExceptionsHelper.unwrapCause(snapshotFailure) instanceof ResourceNotFoundException) { + listener.onResponse(true); + return; + } + listener.onFailure( + ExceptionsHelper.serverError("[{}] failed finding snapshot [{}]", snapshotFailure, jobId, jobSnapshotId) + ); + } + ) + ); + }, + error -> listener.onFailure(ExceptionsHelper.serverError("[{}] error getting job", error, jobId)) + ); + GetJobsAction.Request request = new GetJobsAction.Request(jobId).masterNodeTimeout(PERSISTENT_TASK_MASTER_NODE_TIMEOUT); + executeAsyncWithOrigin(client, ML_ORIGIN, GetJobsAction.INSTANCE, request, jobListener); + } + private void revertToCurrentSnapshot(String jobId, ActionListener listener) { ActionListener jobListener = ActionListener.wrap( jobResponse -> { From eafbd336c25f3c3ad3ce8977b38a271e35d5fa55 Mon Sep 17 00:00:00 2001 From: James Baiera Date: Tue, 28 Sep 2021 16:10:02 -0400 Subject: [PATCH 042/250] Remove Monitoring ingest pipelines (#77459) Monitoring installs a number of ingest pipelines which have been historically used to upgrade documents when mappings and document structures change between versions. Since there aren't any changes to the document format, nor will there be by the time the format is completely retired, we can comfortably remove these pipelines. --- docs/reference/migration/migrate_8_0.asciidoc | 2 + .../migration/migrate_8_0/monitoring.asciidoc | 33 ++++ .../exporter/MonitoringTemplateUtils.java | 108 ------------ .../test/enrich/CommonEnrichRestTestCase.java | 4 +- .../exporter/http/HttpExporterIT.java | 65 ++----- .../xpack/monitoring/exporter/Exporter.java | 10 +- .../exporter/http/HttpExporter.java | 45 +---- .../exporter/http/PipelineHttpResource.java | 90 ---------- .../monitoring/exporter/local/LocalBulk.java | 9 +- .../exporter/local/LocalExporter.java | 98 +---------- .../monitoring/exporter/ExportersTests.java | 8 +- .../MonitoringTemplateUtilsTests.java | 18 -- .../http/HttpExporterResourceTests.java | 166 +----------------- .../exporter/http/HttpExporterTests.java | 31 +--- .../http/PipelineHttpResourceTests.java | 93 ---------- .../local/LocalExporterIntegTests.java | 23 --- .../LocalExporterResourceIntegTests.java | 62 ------- .../test/MonitoringIntegTestCase.java | 20 --- 18 files changed, 69 insertions(+), 816 deletions(-) create mode 100644 docs/reference/migration/migrate_8_0/monitoring.asciidoc delete mode 100644 x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/http/PipelineHttpResource.java delete mode 100644 x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/http/PipelineHttpResourceTests.java diff --git a/docs/reference/migration/migrate_8_0.asciidoc b/docs/reference/migration/migrate_8_0.asciidoc index d95e9d556fbb2..bdedee2a972e2 100644 --- a/docs/reference/migration/migrate_8_0.asciidoc +++ b/docs/reference/migration/migrate_8_0.asciidoc @@ -25,6 +25,7 @@ coming[8.0.0] * <> * <> * <> +* <> * <> * <> * <> @@ -126,6 +127,7 @@ include::migrate_8_0/indices.asciidoc[] include::migrate_8_0/ingest.asciidoc[] include::migrate_8_0/java.asciidoc[] include::migrate_8_0/mappings.asciidoc[] +include::migrate_8_0/monitoring.asciidoc[] include::migrate_8_0/network.asciidoc[] include::migrate_8_0/node.asciidoc[] include::migrate_8_0/packaging.asciidoc[] diff --git a/docs/reference/migration/migrate_8_0/monitoring.asciidoc b/docs/reference/migration/migrate_8_0/monitoring.asciidoc new file mode 100644 index 0000000000000..6f13fb9f67b4a --- /dev/null +++ b/docs/reference/migration/migrate_8_0/monitoring.asciidoc @@ -0,0 +1,33 @@ +[discreet] +[[breaking_80_monitoring_changes]] +=== Monitoring changes + +//NOTE: The notable-breaking-changes tagged regions are re-used in the +//Installation and Upgrade Guide + +//tag::notable-breaking-changes[] +.The `use_ingest` setting on Monitoring exporter configurations has been removed. +[%collapsible] +==== +*Details* + +The `xpack.monitoring.exporters.*.use_ingest` property was deprecated in 7.16.0 and +has been removed. This parameter controlled the creation of pipelines for monitoring +indices that previously had no function. + +*Impact* + +Discontinue the use of the `xpack.monitoring.exporters.*.use_ingest` setting. +==== + +.The `index.pipeline.master_timeout` setting on Monitoring HTTP exporter configurations has been removed. +[%collapsible] +==== +*Details* + +The `xpack.monitoring.exporters.*.index.pipeline.master_timeout` property was +deprecated in 7.16.0. This parameter set the timeout when waiting for the remote +Monitoring cluster to create pipelines. Those pipelines for monitoring indices previously +had no function and are now removed in 8.0.0. + +*Impact* + +Discontinue the use of the `xpack.monitoring.exporters.*.index.pipeline.master_timeout` setting. +==== +//end::notable-breaking-changes[] diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/monitoring/exporter/MonitoringTemplateUtils.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/monitoring/exporter/MonitoringTemplateUtils.java index 413c2e773b569..7657d99544c34 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/monitoring/exporter/MonitoringTemplateUtils.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/monitoring/exporter/MonitoringTemplateUtils.java @@ -7,15 +7,10 @@ package org.elasticsearch.xpack.core.monitoring.exporter; import org.elasticsearch.Version; -import org.elasticsearch.common.Strings; -import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.time.DateFormatter; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.xpack.core.monitoring.MonitoredSystem; import org.elasticsearch.xpack.core.template.TemplateUtils; -import java.io.IOException; import java.time.Instant; import java.util.Locale; @@ -60,11 +55,6 @@ public final class MonitoringTemplateUtils { */ public static final String[] OLD_TEMPLATE_IDS = { "data", "es", "kibana", "logstash" }; //excluding alerts since 6.x watches use it - /** - * IDs of pipelines that can be used with - */ - public static final String[] PIPELINE_IDS = { TEMPLATE_VERSION, OLD_TEMPLATE_VERSION }; - private MonitoringTemplateUtils() { } /** @@ -107,104 +97,6 @@ public static String createEmptyTemplate(final String id) { return "{\"index_patterns\":[\".monitoring-" + id + "-" + OLD_TEMPLATE_VERSION + "*\"],\"version\":" + LAST_UPDATED_VERSION + "}"; } - /** - * Get a pipeline name for any template ID. - * - * @param id The template identifier. - * @return Never {@code null} {@link String} prefixed by "xpack_monitoring_" and the {@code id}. - * @see #TEMPLATE_IDS - */ - public static String pipelineName(String id) { - return "xpack_monitoring_" + id; - } - - /** - * Create a pipeline that allows documents for different template versions to be upgraded. - *

- * The expectation is that you will call either {@link Strings#toString(XContentBuilder)} or - * {@link BytesReference#bytes(XContentBuilder)}}. - * - * @param id The API version (e.g., "6") to use - * @param type The type of data you want to format for the request - * @return Never {@code null}. Always an ended-object. - * @throws IllegalArgumentException if {@code apiVersion} is unrecognized - * @see #PIPELINE_IDS - */ - public static XContentBuilder loadPipeline(final String id, final XContentType type) { - switch (id) { - case TEMPLATE_VERSION: - return emptyPipeline(type); - case OLD_TEMPLATE_VERSION: - return pipelineForApiVersion6(type); - } - - throw new IllegalArgumentException("unrecognized pipeline API version [" + id + "]"); - } - - /** - * Create a pipeline to upgrade documents from {@link MonitoringTemplateUtils#OLD_TEMPLATE_VERSION} - * The expectation is that you will call either {@link Strings#toString(XContentBuilder)} or - * {@link BytesReference#bytes(XContentBuilder)}}. - * - * @param type The type of data you want to format for the request - * @return Never {@code null}. Always an ended-object. - * @see #LAST_UPDATED_VERSION - */ - static XContentBuilder pipelineForApiVersion6(final XContentType type) { - try { - return XContentBuilder.builder(type.xContent()).startObject() - .field("description", "This pipeline upgrades documents from the older version of the Monitoring API to " + - "the newer version (" + TEMPLATE_VERSION + ") by fixing breaking " + - "changes in those older documents before they are indexed from the older version (" + - OLD_TEMPLATE_VERSION + ").") - .field("version", LAST_UPDATED_VERSION) - .startArray("processors") - .startObject() - // remove the type - .startObject("script") - .field("source","ctx._type = null" ) - .endObject() - .endObject() - .startObject() - // ensure the data lands in the correct index - .startObject("gsub") - .field("field", "_index") - .field("pattern", "(.monitoring-\\w+-)6(-.+)") - .field("replacement", "$1" + TEMPLATE_VERSION + "$2") - .endObject() - .endObject() - .endArray() - .endObject(); - } catch (final IOException e) { - throw new RuntimeException("Failed to create pipeline to upgrade from older version [" + OLD_TEMPLATE_VERSION + - "] to the newer version [" + TEMPLATE_VERSION + "].", e); - } - } - - /** - * Create an empty pipeline. - * The expectation is that you will call either {@link Strings#toString(XContentBuilder)} or - * {@link BytesReference#bytes(XContentBuilder)}}. - * - * @param type The type of data you want to format for the request - * @return Never {@code null}. Always an ended-object. - * @see #LAST_UPDATED_VERSION - */ - public static XContentBuilder emptyPipeline(final XContentType type) { - try { - // For now: We prepend the API version to the string so that it's easy to parse in the future; if we ever add metadata - // to pipelines, then it would better serve this use case - return XContentBuilder.builder(type.xContent()).startObject() - .field("description", "This is a placeholder pipeline for Monitoring API version " + TEMPLATE_VERSION + - " so that future versions may fix breaking changes.") - .field("version", LAST_UPDATED_VERSION) - .startArray("processors").endArray() - .endObject(); - } catch (final IOException e) { - throw new RuntimeException("Failed to create empty pipeline", e); - } - } - /** * Get the index name given a specific date format, a monitored system and a timestamp. * diff --git a/x-pack/plugin/enrich/qa/common/src/main/java/org/elasticsearch/test/enrich/CommonEnrichRestTestCase.java b/x-pack/plugin/enrich/qa/common/src/main/java/org/elasticsearch/test/enrich/CommonEnrichRestTestCase.java index 2d9d5be12cd65..31ae9477a0e22 100644 --- a/x-pack/plugin/enrich/qa/common/src/main/java/org/elasticsearch/test/enrich/CommonEnrichRestTestCase.java +++ b/x-pack/plugin/enrich/qa/common/src/main/java/org/elasticsearch/test/enrich/CommonEnrichRestTestCase.java @@ -210,8 +210,10 @@ public void testDeleteExistingPipeline() throws Exception { ); assertTrue( exc.getMessage() - .contains("Could not delete policy [my_policy] because" + " a pipeline is referencing it [my_pipeline, another_pipeline]") + .contains("Could not delete policy [my_policy] because a pipeline is referencing it [") ); + assertTrue(exc.getMessage().contains("another_pipeline")); + assertTrue(exc.getMessage().contains("my_pipeline")); // delete the pipelines so the policies can be deleted client().performRequest(new Request("DELETE", "/_ingest/pipeline/my_pipeline")); diff --git a/x-pack/plugin/monitoring/src/internalClusterTest/java/org/elasticsearch/xpack/monitoring/exporter/http/HttpExporterIT.java b/x-pack/plugin/monitoring/src/internalClusterTest/java/org/elasticsearch/xpack/monitoring/exporter/http/HttpExporterIT.java index 8968e37f60e4b..53b81459ec774 100644 --- a/x-pack/plugin/monitoring/src/internalClusterTest/java/org/elasticsearch/xpack/monitoring/exporter/http/HttpExporterIT.java +++ b/x-pack/plugin/monitoring/src/internalClusterTest/java/org/elasticsearch/xpack/monitoring/exporter/http/HttpExporterIT.java @@ -95,7 +95,6 @@ public class HttpExporterIT extends MonitoringIntegTestCase { rarely() ? randomSubsetOf(Arrays.asList(ClusterAlertsUtil.WATCH_IDS)) : Collections.emptyList(); private final boolean templatesExistsAlready = randomBoolean(); private final boolean includeOldTemplates = randomBoolean(); - private final boolean pipelineExistsAlready = randomBoolean(); private final boolean remoteClusterAllowsWatcher = randomBoolean(); private final boolean currentLicenseAllowsWatcher = true; private final boolean watcherAlreadyExists = randomBoolean(); @@ -157,7 +156,7 @@ public void testExport() throws Exception { enqueueGetClusterVersionResponse(Version.CURRENT); enqueueSetupResponses(webServer, - templatesExistsAlready, includeOldTemplates, pipelineExistsAlready, + templatesExistsAlready, includeOldTemplates, remoteClusterAllowsWatcher, currentLicenseAllowsWatcher, watcherAlreadyExists); enqueueResponse(200, "{\"errors\": false, \"msg\": \"successful bulk request\"}"); @@ -165,7 +164,7 @@ public void testExport() throws Exception { export(settings, newRandomMonitoringDocs(nbDocs)); assertMonitorResources(webServer, - templatesExistsAlready, includeOldTemplates, pipelineExistsAlready, + templatesExistsAlready, includeOldTemplates, remoteClusterAllowsWatcher, currentLicenseAllowsWatcher, watcherAlreadyExists); assertBulk(webServer, nbDocs); } @@ -184,7 +183,7 @@ public void testSecureSetting() throws Exception { enqueueGetClusterVersionResponse(Version.CURRENT); enqueueSetupResponses(webServer, - templatesExistsAlready, includeOldTemplates, pipelineExistsAlready, + templatesExistsAlready, includeOldTemplates, remoteClusterAllowsWatcher, currentLicenseAllowsWatcher, watcherAlreadyExists); enqueueResponse(200, "{\"errors\": false, \"msg\": \"successful bulk request\"}"); @@ -197,7 +196,7 @@ public void testSecureSetting() throws Exception { localStateMonitoring.getMonitoring().reload(settings); enqueueGetClusterVersionResponse(Version.CURRENT); enqueueSetupResponses(webServer, - templatesExistsAlready, includeOldTemplates, pipelineExistsAlready, + templatesExistsAlready, includeOldTemplates, remoteClusterAllowsWatcher, currentLicenseAllowsWatcher, watcherAlreadyExists); enqueueResponse(200, "{\"errors\": false, \"msg\": \"successful bulk request\"}"); @@ -223,7 +222,7 @@ public void testExportWithHeaders() throws Exception { enqueueGetClusterVersionResponse(Version.CURRENT); enqueueSetupResponses(webServer, - templatesExistsAlready, includeOldTemplates, pipelineExistsAlready, + templatesExistsAlready, includeOldTemplates, remoteClusterAllowsWatcher, currentLicenseAllowsWatcher, watcherAlreadyExists); enqueueResponse(200, "{\"errors\": false, \"msg\": \"successful bulk request\"}"); @@ -231,7 +230,7 @@ public void testExportWithHeaders() throws Exception { export(settings, newRandomMonitoringDocs(nbDocs)); assertMonitorResources(webServer, - templatesExistsAlready, includeOldTemplates, pipelineExistsAlready, + templatesExistsAlready, includeOldTemplates, remoteClusterAllowsWatcher, currentLicenseAllowsWatcher, watcherAlreadyExists, headers, null); assertBulk(webServer, nbDocs, headers, null); @@ -276,7 +275,7 @@ public void testExportWithBasePath() throws Exception { enqueueGetClusterVersionResponse(Version.CURRENT); enqueueSetupResponses(webServer, - templatesExistsAlready, includeOldTemplates, pipelineExistsAlready, + templatesExistsAlready, includeOldTemplates, remoteClusterAllowsWatcher, currentLicenseAllowsWatcher, watcherAlreadyExists); enqueueResponse(200, "{\"errors\": false}"); @@ -284,7 +283,7 @@ public void testExportWithBasePath() throws Exception { export(builder.build(), newRandomMonitoringDocs(nbDocs)); assertMonitorResources(webServer, - templatesExistsAlready, includeOldTemplates, pipelineExistsAlready, + templatesExistsAlready, includeOldTemplates, remoteClusterAllowsWatcher, currentLicenseAllowsWatcher, watcherAlreadyExists, headers, basePath); assertBulk(webServer, nbDocs, headers, basePath); @@ -295,14 +294,14 @@ public void testHostChangeReChecksTemplate() throws Exception { enqueueGetClusterVersionResponse(Version.CURRENT); enqueueSetupResponses(webServer, - templatesExistsAlready, includeOldTemplates, pipelineExistsAlready, + templatesExistsAlready, includeOldTemplates, remoteClusterAllowsWatcher, currentLicenseAllowsWatcher, watcherAlreadyExists); enqueueResponse(200, "{\"errors\": false}"); export(settings, Collections.singletonList(newRandomMonitoringDoc())); assertMonitorResources(webServer, - templatesExistsAlready, includeOldTemplates, pipelineExistsAlready, + templatesExistsAlready, includeOldTemplates, remoteClusterAllowsWatcher, currentLicenseAllowsWatcher, watcherAlreadyExists); assertBulk(webServer); @@ -327,7 +326,6 @@ public void testHostChangeReChecksTemplate() throws Exception { } } // opposite of if it existed before - enqueuePipelineResponses(secondWebServer, pipelineExistsAlready == false); enqueueWatcherResponses(secondWebServer, remoteClusterAllowsWatcher, currentLicenseAllowsWatcher, watcherAlreadyExists); enqueueResponse(secondWebServer, 200, "{\"errors\": false}"); @@ -351,7 +349,6 @@ public void testHostChangeReChecksTemplate() throws Exception { assertThat(recordedRequest.getBody(), equalTo(getExternalTemplateRepresentation(template.v2()))); } } - assertMonitorPipelines(secondWebServer, pipelineExistsAlready == false, null, null); assertMonitorWatches(secondWebServer, remoteClusterAllowsWatcher, currentLicenseAllowsWatcher, watcherAlreadyExists, null, null); assertBulk(secondWebServer); @@ -402,7 +399,7 @@ public void testDynamicIndexFormatChange() throws Exception { enqueueGetClusterVersionResponse(Version.CURRENT); enqueueSetupResponses(webServer, - templatesExistsAlready, includeOldTemplates, pipelineExistsAlready, + templatesExistsAlready, includeOldTemplates, remoteClusterAllowsWatcher, currentLicenseAllowsWatcher, watcherAlreadyExists); enqueueResponse(200, "{\"errors\": false, \"msg\": \"successful bulk request\"}"); @@ -410,7 +407,7 @@ public void testDynamicIndexFormatChange() throws Exception { export(settings, Collections.singletonList(doc)); assertMonitorResources(webServer, - templatesExistsAlready, includeOldTemplates, pipelineExistsAlready, + templatesExistsAlready, includeOldTemplates, remoteClusterAllowsWatcher, currentLicenseAllowsWatcher, watcherAlreadyExists); MockRequest recordedRequest = assertBulk(webServer); @@ -431,7 +428,7 @@ public void testDynamicIndexFormatChange() throws Exception { .build(); enqueueGetClusterVersionResponse(Version.CURRENT); - enqueueSetupResponses(webServer, true, includeOldTemplates, true, + enqueueSetupResponses(webServer, true, includeOldTemplates, true, true, true); enqueueResponse(200, "{\"errors\": false, \"msg\": \"successful bulk request\"}"); @@ -443,7 +440,7 @@ public void testDynamicIndexFormatChange() throws Exception { String expectedMonitoringIndex = ".monitoring-es-" + TEMPLATE_VERSION + "-" + newTimeFormatter.format(Instant.ofEpochMilli(doc.getTimestamp())); - assertMonitorResources(webServer, true, includeOldTemplates, true, + assertMonitorResources(webServer, true, includeOldTemplates, true, true, true); recordedRequest = assertBulk(webServer); @@ -473,24 +470,21 @@ private void assertMonitorVersion(final MockWebServer webServer, @Nullable final private void assertMonitorResources(final MockWebServer webServer, final boolean templateAlreadyExists, final boolean includeOldTemplates, - final boolean pipelineAlreadyExists, final boolean remoteClusterAllowsWatcher, final boolean currentLicenseAllowsWatcher, final boolean watcherAlreadyExists) throws Exception { - assertMonitorResources(webServer, templateAlreadyExists, includeOldTemplates, pipelineAlreadyExists, + assertMonitorResources(webServer, templateAlreadyExists, includeOldTemplates, remoteClusterAllowsWatcher, currentLicenseAllowsWatcher, watcherAlreadyExists, null, null); } private void assertMonitorResources(final MockWebServer webServer, final boolean templateAlreadyExists, final boolean includeOldTemplates, - final boolean pipelineAlreadyExists, final boolean remoteClusterAllowsWatcher, final boolean currentLicenseAllowsWatcher, final boolean watcherAlreadyExists, @Nullable final Map customHeaders, @Nullable final String basePath) throws Exception { assertMonitorVersion(webServer, customHeaders, basePath); assertMonitorTemplates(webServer, templateAlreadyExists, includeOldTemplates, customHeaders, basePath); - assertMonitorPipelines(webServer, pipelineAlreadyExists, customHeaders, basePath); assertMonitorWatches(webServer, remoteClusterAllowsWatcher, currentLicenseAllowsWatcher, watcherAlreadyExists, customHeaders, basePath); } @@ -505,14 +499,6 @@ private void assertMonitorTemplates(final MockWebServer webServer, assertMonitorVersionResource(webServer, alreadyExists, "/_template/", templates, customHeaders, basePath); } - private void assertMonitorPipelines(final MockWebServer webServer, - final boolean alreadyExists, - @Nullable final Map customHeaders, - @Nullable final String basePath) throws Exception { - assertMonitorVersionResource(webServer, alreadyExists, "/_ingest/pipeline/", monitoringPipelines(), - customHeaders, basePath); - } - private void assertMonitorVersionResource(final MockWebServer webServer, final boolean alreadyExists, final String resourcePrefix, final List> resources, @Nullable final Map customHeaders, @@ -722,9 +708,8 @@ private String watcherCheckQueryString() { } private String bulkQueryString() { - final String pipelineName = MonitoringTemplateUtils.pipelineName(TEMPLATE_VERSION); - return "pipeline=" + pipelineName + "&filter_path=" + "errors,items.*.error"; + return "filter_path=" + "errors,items.*.error"; } private void enqueueGetClusterVersionResponse(Version v) throws IOException { @@ -739,11 +724,9 @@ private void enqueueGetClusterVersionResponse(MockWebServer mockWebServer, Versi private void enqueueSetupResponses(final MockWebServer webServer, final boolean templatesAlreadyExists, final boolean includeOldTemplates, - final boolean pipelineAlreadyExists, final boolean remoteClusterAllowsWatcher, final boolean currentLicenseAllowsWatcher, final boolean watcherAlreadyExists) throws IOException { enqueueTemplateResponses(webServer, templatesAlreadyExists, includeOldTemplates); - enqueuePipelineResponses(webServer, pipelineAlreadyExists); enqueueWatcherResponses(webServer, remoteClusterAllowsWatcher, currentLicenseAllowsWatcher, watcherAlreadyExists); } @@ -769,22 +752,6 @@ private void enqueueTemplateResponsesExistsAlready(final MockWebServer webServer enqueueVersionedResourceResponsesExistsAlready(monitoringTemplateNames(includeOldTemplates), webServer); } - private void enqueuePipelineResponses(final MockWebServer webServer, final boolean alreadyExists) throws IOException { - if (alreadyExists) { - enqueuePipelineResponsesExistsAlready(webServer); - } else { - enqueuePipelineResponsesDoesNotExistYet(webServer); - } - } - - private void enqueuePipelineResponsesDoesNotExistYet(final MockWebServer webServer) throws IOException { - enqueueVersionedResourceResponsesDoesNotExistYet(monitoringPipelineNames(), webServer); - } - - private void enqueuePipelineResponsesExistsAlready(final MockWebServer webServer) throws IOException { - enqueueVersionedResourceResponsesExistsAlready(monitoringPipelineNames(), webServer); - } - private void enqueueVersionedResourceResponsesDoesNotExistYet(final List names, final MockWebServer webServer) throws IOException { for (String resource : names) { diff --git a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/Exporter.java b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/Exporter.java index cb83852d02ae4..26ee9eacfae2e 100644 --- a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/Exporter.java +++ b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/Exporter.java @@ -81,14 +81,6 @@ public Iterator> settings() { }, Property.Dynamic, Property.NodeScope)); - /** - * Every {@code Exporter} adds the ingest pipeline to bulk requests, but they should, at the exporter level, allow that to be disabled. - *

- * Note: disabling it obviously loses any benefit of using it, but it does allow clusters that don't run with ingest to not use it. - */ - public static final Setting.AffixSetting USE_INGEST_PIPELINE_SETTING = - Setting.affixKeySetting("xpack.monitoring.exporters.","use_ingest", - key -> Setting.boolSetting(key, true, Property.Dynamic, Property.NodeScope), TYPE_DEPENDENCY); /** * Every {@code Exporter} allows users to explicitly disable cluster alerts. */ @@ -178,7 +170,7 @@ protected static DateFormatter dateTimeFormatter(final Config config) { } public static List> getSettings() { - return Arrays.asList(USE_INGEST_PIPELINE_SETTING, CLUSTER_ALERTS_MANAGEMENT_SETTING, TYPE_SETTING, ENABLED_SETTING, + return Arrays.asList(CLUSTER_ALERTS_MANAGEMENT_SETTING, TYPE_SETTING, ENABLED_SETTING, INDEX_NAME_TIME_FORMAT_SETTING, CLUSTER_ALERTS_BLACKLIST_SETTING); } diff --git a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/http/HttpExporter.java b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/http/HttpExporter.java index 0e60e2a4a8331..774e07b943714 100644 --- a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/http/HttpExporter.java +++ b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/http/HttpExporter.java @@ -27,7 +27,6 @@ import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.core.Nullable; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.SecureSetting; import org.elasticsearch.common.settings.SecureString; import org.elasticsearch.common.settings.Setting; @@ -40,7 +39,6 @@ import org.elasticsearch.common.util.Maps; import org.elasticsearch.common.util.concurrent.ThreadContext; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.license.XPackLicenseState.Feature; import org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils; import org.elasticsearch.xpack.core.ssl.SSLConfigurationSettings; @@ -332,13 +330,6 @@ public Iterator> settings() { public static final Setting.AffixSetting TEMPLATE_CREATE_LEGACY_VERSIONS_SETTING = Setting.affixKeySetting("xpack.monitoring.exporters.","index.template.create_legacy_templates", (key) -> Setting.boolSetting(key, true, Property.Dynamic, Property.NodeScope), HTTP_TYPE_DEPENDENCY); - /** - * ES level timeout used when checking and writing pipelines (used to speed up tests) - */ - public static final Setting.AffixSetting PIPELINE_CHECK_TIMEOUT_SETTING = - Setting.affixKeySetting("xpack.monitoring.exporters.","index.pipeline.master_timeout", - (key) -> Setting.timeSetting(key, TimeValue.MINUS_ONE, Property.Dynamic, Property.NodeScope), HTTP_TYPE_DEPENDENCY); - /** * Minimum supported version of the remote monitoring cluster (same major). */ @@ -621,8 +612,6 @@ static Resources createResources(final Config config) { resources.add(new VersionHttpResource(resourceOwnerName, MIN_SUPPORTED_CLUSTER_VERSION)); // load all templates (template bodies are lazily loaded on demand) configureTemplateResources(config, resourceOwnerName, resources); - // load the pipeline (this will get added to as the monitoring API version increases) - configurePipelineResources(config, resourceOwnerName, resources); // load the watches for cluster alerts if Watcher is available final HttpResource alertingResource = configureClusterAlertsResources(config, resourceOwnerName); @@ -817,11 +806,6 @@ static Map createDefaultParams(final Config config) { entries.add(entry("timeout", bulkTimeout.toString())); } - // allow the use of ingest pipelines to be completely optional - if (USE_INGEST_PIPELINE_SETTING.getConcreteSettingForNamespace(config.name()).get(config.settings())) { - entries.add(entry("pipeline", MonitoringTemplateUtils.pipelineName(MonitoringTemplateUtils.TEMPLATE_VERSION))); - } - // widdle down the response to just what we care to check entries.add(entry("filter_path", "errors,items.*.error")); @@ -863,33 +847,6 @@ private static void configureTemplateResources(final Config config, } } - /** - * Adds the {@code resources} necessary for checking and publishing monitoring pipelines. - * - * @param config The HTTP Exporter's configuration - * @param resourceOwnerName The resource owner name to display for any logging messages. - * @param resources The resources to add too. - */ - private static void configurePipelineResources(final Config config, final String resourceOwnerName, - final List resources) { - // don't require pipelines if we're not using them - if (USE_INGEST_PIPELINE_SETTING.getConcreteSettingForNamespace(config.name()).get(config.settings())) { - final TimeValue pipelineTimeout = - PIPELINE_CHECK_TIMEOUT_SETTING.getConcreteSettingForNamespace(config.name()).get(config.settings()); - - // add all pipelines - for (final String pipelineId : MonitoringTemplateUtils.PIPELINE_IDS) { - final String pipelineName = MonitoringTemplateUtils.pipelineName(pipelineId); - // lazily load the pipeline - final Supplier pipeline = - () -> BytesReference.toBytes(BytesReference.bytes(MonitoringTemplateUtils.loadPipeline(pipelineId, - XContentType.JSON))); - - resources.add(new PipelineHttpResource(resourceOwnerName, pipelineTimeout, pipelineName, pipeline)); - } - } - } - /** * Adds the {@code resources} necessary for checking and publishing cluster alerts. * @@ -994,7 +951,7 @@ public void doClose() { public static List> getDynamicSettings() { return Arrays.asList(HOST_SETTING, TEMPLATE_CREATE_LEGACY_VERSIONS_SETTING, AUTH_USERNAME_SETTING, BULK_TIMEOUT_SETTING, - CONNECTION_READ_TIMEOUT_SETTING, CONNECTION_TIMEOUT_SETTING, PIPELINE_CHECK_TIMEOUT_SETTING, PROXY_BASE_PATH_SETTING, + CONNECTION_READ_TIMEOUT_SETTING, CONNECTION_TIMEOUT_SETTING, PROXY_BASE_PATH_SETTING, SNIFF_ENABLED_SETTING, TEMPLATE_CHECK_TIMEOUT_SETTING, SSL_SETTING, HEADERS_SETTING); } diff --git a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/http/PipelineHttpResource.java b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/http/PipelineHttpResource.java deleted file mode 100644 index a58a22e763f8a..0000000000000 --- a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/http/PipelineHttpResource.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * 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.monitoring.exporter.http; - -import org.apache.http.HttpEntity; -import org.apache.http.entity.ByteArrayEntity; -import org.apache.http.entity.ContentType; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.elasticsearch.action.ActionListener; -import org.elasticsearch.client.RestClient; -import org.elasticsearch.core.Nullable; -import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils; - -import java.util.Collections; -import java.util.Objects; -import java.util.function.Supplier; - -/** - * {@code PipelineHttpResource}s allow the checking and uploading of ingest pipelines to a remote cluster. - *

- * In the future, we will need to also support the transformation or replacement of pipelines based on their version, but we do not need - * that functionality until some breaking change in the Monitoring API requires it. - */ -public class PipelineHttpResource extends PublishableHttpResource { - - private static final Logger logger = LogManager.getLogger(PipelineHttpResource.class); - - /** - * The name of the pipeline that is sent to the remote cluster. - */ - private final String pipelineName; - /** - * Provides a fully formed template (e.g., no variables that need replaced). - */ - private final Supplier pipeline; - - /** - * Create a new {@link PipelineHttpResource}. - * - * @param resourceOwnerName The user-recognizable name - * @param masterTimeout Master timeout to use with any request. - * @param pipelineName The name of the template (e.g., ".pipeline123"). - * @param pipeline The pipeline provider. - */ - public PipelineHttpResource(final String resourceOwnerName, @Nullable final TimeValue masterTimeout, - final String pipelineName, final Supplier pipeline) { - super(resourceOwnerName, masterTimeout, PublishableHttpResource.RESOURCE_VERSION_PARAMETERS); - - this.pipelineName = Objects.requireNonNull(pipelineName); - this.pipeline = Objects.requireNonNull(pipeline); - } - - /** - * Determine if the current {@linkplain #pipelineName pipeline} exists. - */ - @Override - protected void doCheck(final RestClient client, final ActionListener listener) { - versionCheckForResource(client, listener, logger, - "/_ingest/pipeline", pipelineName, "monitoring pipeline", - resourceOwnerName, "monitoring cluster", - XContentType.JSON.xContent(), MonitoringTemplateUtils.LAST_UPDATED_VERSION); - } - - /** - * Publish the current {@linkplain #pipelineName pipeline}. - */ - @Override - protected void doPublish(final RestClient client, final ActionListener listener) { - putResource(client, listener, logger, - "/_ingest/pipeline", pipelineName, Collections.emptyMap(), this::pipelineToHttpEntity, "monitoring pipeline", - resourceOwnerName, "monitoring cluster"); - } - - /** - * Create a {@link HttpEntity} for the {@link #pipeline}. - * - * @return Never {@code null}. - */ - HttpEntity pipelineToHttpEntity() { - return new ByteArrayEntity(pipeline.get(), ContentType.APPLICATION_JSON); - } - -} diff --git a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/local/LocalBulk.java b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/local/LocalBulk.java index 1083f75491f94..c1c6e925edfe3 100644 --- a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/local/LocalBulk.java +++ b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/local/LocalBulk.java @@ -39,17 +39,15 @@ public class LocalBulk extends ExportBulk { private final Logger logger; private final Client client; private final DateFormatter formatter; - private final boolean usePipeline; private BulkRequestBuilder requestBuilder; - LocalBulk(String name, Logger logger, Client client, DateFormatter dateTimeFormatter, boolean usePipeline) { + LocalBulk(String name, Logger logger, Client client, DateFormatter dateTimeFormatter) { super(name, client.threadPool().getThreadContext()); this.logger = logger; this.client = client; this.formatter = dateTimeFormatter; - this.usePipeline = usePipeline; } @Override @@ -72,11 +70,6 @@ protected void doAdd(Collection docs) throws ExportException { final BytesReference source = XContentHelper.toXContent(doc, XContentType.SMILE, false); request.source(source, XContentType.SMILE); - // allow the use of ingest pipelines to be completely optional - if (usePipeline) { - request.setPipeline(MonitoringTemplateUtils.pipelineName(MonitoringTemplateUtils.TEMPLATE_VERSION)); - } - requestBuilder.add(request); if (logger.isTraceEnabled()) { diff --git a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/local/LocalExporter.java b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/local/LocalExporter.java index 03b739edde455..07557ee2bf090 100644 --- a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/local/LocalExporter.java +++ b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/local/LocalExporter.java @@ -16,7 +16,6 @@ import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest; import org.elasticsearch.action.admin.indices.template.put.PutIndexTemplateRequest; -import org.elasticsearch.action.ingest.PutPipelineRequest; import org.elasticsearch.action.support.master.AcknowledgedResponse; import org.elasticsearch.client.Client; import org.elasticsearch.cluster.ClusterChangedEvent; @@ -29,7 +28,6 @@ import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.core.Nullable; import org.elasticsearch.common.bytes.BytesArray; -import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.regex.Regex; import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Setting.Property; @@ -39,8 +37,6 @@ import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.gateway.GatewayService; import org.elasticsearch.index.IndexNotFoundException; -import org.elasticsearch.ingest.IngestMetadata; -import org.elasticsearch.ingest.PipelineConfiguration; import org.elasticsearch.license.LicenseStateListener; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.protocol.xpack.watcher.DeleteWatchRequest; @@ -82,10 +78,7 @@ import static org.elasticsearch.xpack.core.ClientHelper.MONITORING_ORIGIN; import static org.elasticsearch.xpack.core.ClientHelper.executeAsyncWithOrigin; import static org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils.LAST_UPDATED_VERSION; -import static org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils.PIPELINE_IDS; import static org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils.TEMPLATE_VERSION; -import static org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils.loadPipeline; -import static org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils.pipelineName; import static org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils.templateName; public class LocalExporter extends Exporter implements ClusterStateListener, CleanerService.Listener, LicenseStateListener { @@ -108,7 +101,6 @@ public class LocalExporter extends Exporter implements ClusterStateListener, Cle private final ClusterService clusterService; private final XPackLicenseState licenseState; private final CleanerService cleanerService; - private final boolean useIngest; private final DateFormatter dateTimeFormatter; private final List clusterAlertBlacklist; private final boolean decommissionClusterAlerts; @@ -127,7 +119,6 @@ public LocalExporter(Exporter.Config config, Client client, MonitoringMigrationC this.client = client; this.clusterService = config.clusterService(); this.licenseState = config.licenseState(); - this.useIngest = USE_INGEST_PIPELINE_SETTING.getConcreteSettingForNamespace(config.name()).get(config.settings()); this.clusterAlertBlacklist = ClusterAlertsUtil.getClusterAlertsBlacklist(config); this.decommissionClusterAlerts = Monitoring.MIGRATION_DECOMMISSION_ALERTS.get(config.settings()); this.migrationCoordinator = migrationCoordinator; @@ -277,7 +268,7 @@ LocalBulk resolveBulk(ClusterState clusterState, boolean clusterStateChange) { clusterService.removeListener(this); } - return new LocalBulk(name(), logger, client, dateTimeFormatter, useIngest); + return new LocalBulk(name(), logger, client, dateTimeFormatter); } /** @@ -298,7 +289,7 @@ private boolean performSetup(ClusterState clusterState, boolean clusterStateChan } /** - * When not on the elected master, we require all resources (mapping types, templates, and pipelines) to be available before we + * When not on the elected master, we require all resources (mapping types, templates) to be available before we * attempt to run the exporter. If those resources do not exist, then it means the elected master's exporter has not yet run, so the * monitoring cluster (this one, as the local exporter) is not setup yet. * @@ -315,25 +306,14 @@ private boolean setupIfNotElectedMaster(final ClusterState clusterState) { } } - // if we don't have the ingest pipeline, then it's going to fail anyway - if (useIngest) { - for (final String pipelineId : PIPELINE_IDS) { - if (hasIngestPipeline(clusterState, pipelineId) == false) { - logger.debug("monitoring ingest pipeline [{}] does not exist, so service cannot start (waiting on master)", - pipelineName(pipelineId)); - return false; - } - } - } - - logger.trace("monitoring index templates and pipelines are installed, service can start"); + logger.trace("monitoring index templates are installed, service can start"); // everything is setup return true; } /** - * When on the elected master, we setup all resources (mapping types, templates, and pipelines) before we attempt to run the exporter. + * When on the elected master, we setup all resources (mapping types, templates) before we attempt to run the exporter. * If those resources do not exist, then we will create them. * * @param clusterState The current cluster state. @@ -376,24 +356,6 @@ private boolean setupIfElectedMaster(final ClusterState clusterState, final bool } } - if (useIngest) { - final List missingPipelines = Arrays.stream(PIPELINE_IDS) - .filter(id -> hasIngestPipeline(clusterState, id) == false) - .collect(Collectors.toList()); - - // if we don't have the ingest pipeline, then install it - if (missingPipelines.isEmpty() == false) { - for (final String pipelineId : missingPipelines) { - final String pipelineName = pipelineName(pipelineId); - logger.debug("pipeline [{}] not found", pipelineName); - asyncActions.add(() -> putIngestPipeline(pipelineId, - new ResponseActionListener<>("pipeline", pipelineName, pendingResponses))); - } - } else { - logger.trace("all pipelines found"); - } - } - // avoid constantly trying to setup Watcher, which requires a lot of overhead and avoid attempting to setup during a cluster state // change. Provide a way to force it to initialize though. setupClusterAlertsTasks(clusterState, clusterStateChange, asyncActions, pendingResponses); @@ -410,7 +372,7 @@ private boolean setupIfElectedMaster(final ClusterState clusterState, final bool return false; } } else { - logger.debug("monitoring index templates and pipelines are installed on master node, service can start"); + logger.debug("monitoring index templates are installed on master node, service can start"); } // everything is setup (or running) @@ -483,54 +445,6 @@ private void responseReceived(final AtomicInteger pendingResponses, final boolea } } - /** - * Determine if the ingest pipeline for {@code pipelineId} exists in the cluster or not with an appropriate minimum version. - * - * @param clusterState The current cluster state - * @param pipelineId The ID of the pipeline to check (e.g., "3") - * @return {@code true} if the {@code clusterState} contains the pipeline with an appropriate minimum version - */ - private boolean hasIngestPipeline(final ClusterState clusterState, final String pipelineId) { - final String pipelineName = MonitoringTemplateUtils.pipelineName(pipelineId); - final IngestMetadata ingestMetadata = clusterState.getMetadata().custom(IngestMetadata.TYPE); - - // we ensure that we both have the pipeline and its version represents the current (or later) version - if (ingestMetadata != null) { - final PipelineConfiguration pipeline = ingestMetadata.getPipelines().get(pipelineName); - - return pipeline != null && hasValidVersion(pipeline.getConfigAsMap().get("version"), LAST_UPDATED_VERSION); - } - - return false; - } - - /** - * Create the pipeline required to handle past data as well as to future-proof ingestion for current documents (the pipeline - * is initially empty, but it can be replaced later with one that translates it as-needed). - *

- * This should only be invoked by the elected master node. - *

- * Whenever we eventually make a backwards incompatible change, then we need to override any pipeline that already exists that is - * older than this one. This uses the Elasticsearch version, down to the alpha portion, to determine the version of the last change. - *


-     * {
-     *   "description": "...",
-     *   "pipelines" : [ ... ],
-     *   "version": 6000001
-     * }
-     * 
- */ - private void putIngestPipeline(final String pipelineId, final ActionListener listener) { - final String pipelineName = pipelineName(pipelineId); - final BytesReference pipeline = BytesReference.bytes(loadPipeline(pipelineId, XContentType.JSON)); - final PutPipelineRequest request = new PutPipelineRequest(pipelineName, pipeline, XContentType.JSON); - - logger.debug("installing ingest pipeline [{}]", pipelineName); - - executeAsyncWithOrigin(client.threadPool().getThreadContext(), MONITORING_ORIGIN, request, listener, - client.admin().cluster()::putPipeline); - } - private boolean hasTemplate(final ClusterState clusterState, final String templateName) { final IndexTemplateMetadata template = clusterState.getMetadata().getTemplates().get(templateName); @@ -726,7 +640,7 @@ enum State { } /** - * Acknowledge success / failure for any given creation attempt (e.g., template or pipeline). + * Acknowledge success / failure for any given creation attempt (e.g., templates). */ private class ResponseActionListener implements ActionListener { diff --git a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/ExportersTests.java b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/ExportersTests.java index 5767939861e8b..4bf308aeb6ef8 100644 --- a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/ExportersTests.java +++ b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/ExportersTests.java @@ -253,8 +253,8 @@ InitializedExporters initExporters(Settings settings) { assertEquals(settings.get("xpack.monitoring.exporters._name1.type"), "http"); Settings update = Settings.builder() - .put("xpack.monitoring.exporters._name0.use_ingest", true) - .put("xpack.monitoring.exporters._name1.use_ingest", false) + .put("xpack.monitoring.exporters._name0.cluster_alerts.management.blacklist", true) + .put("xpack.monitoring.exporters._name1.cluster_alerts.management.blacklist", false) .build(); clusterSettings.applySettings(update); assertThat(settingsHolder.get(), notNullValue()); @@ -262,9 +262,9 @@ InitializedExporters initExporters(Settings settings) { logger.info(settings); assertThat(settings.size(), is(4)); assertEquals(settings.get("xpack.monitoring.exporters._name0.type"), "local"); - assertEquals(settings.get("xpack.monitoring.exporters._name0.use_ingest"), "true"); + assertEquals(settings.get("xpack.monitoring.exporters._name0.cluster_alerts.management.blacklist"), "true"); assertEquals(settings.get("xpack.monitoring.exporters._name1.type"), "http"); - assertEquals(settings.get("xpack.monitoring.exporters._name1.use_ingest"), "false"); + assertEquals(settings.get("xpack.monitoring.exporters._name1.cluster_alerts.management.blacklist"), "false"); } public void testExporterBlocksOnClusterState() { diff --git a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/MonitoringTemplateUtilsTests.java b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/MonitoringTemplateUtilsTests.java index 73c80a9d541b3..aa7762af3cd40 100644 --- a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/MonitoringTemplateUtilsTests.java +++ b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/MonitoringTemplateUtilsTests.java @@ -6,9 +6,7 @@ */ package org.elasticsearch.xpack.monitoring.exporter; -import org.elasticsearch.common.Strings; import org.elasticsearch.common.time.DateFormatter; -import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.monitoring.MonitoredSystem; import org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils; @@ -23,7 +21,6 @@ import static org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils.TEMPLATE_VERSION; import static org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils.indexName; import static org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils.oldTemplateName; -import static org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils.pipelineName; import static org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils.templateName; import static org.elasticsearch.xpack.core.template.TemplateUtilsTests.assertTemplate; import static org.hamcrest.Matchers.containsString; @@ -77,21 +74,6 @@ public void testCreateEmptyTemplate() throws IOException { assertThat(json, containsString("\"version\":" + LAST_UPDATED_VERSION)); } - public void testPipelineName() { - assertThat(pipelineName("aBc123"), equalTo("xpack_monitoring_aBc123")); - assertThat(pipelineName(TEMPLATE_VERSION), equalTo("xpack_monitoring_" + TEMPLATE_VERSION)); - assertThat(pipelineName(OLD_TEMPLATE_VERSION), equalTo("xpack_monitoring_" + OLD_TEMPLATE_VERSION)); - } - - public void testEmptyPipeline() throws IOException { - final String json = Strings.toString(MonitoringTemplateUtils.emptyPipeline(XContentType.JSON)); - - // ensure the description contains the API version - assertThat(json, containsString("Monitoring API version " + MonitoringTemplateUtils.TEMPLATE_VERSION)); - assertThat(json, containsString("\"processors\":[]")); - assertThat(json, containsString("\"version\":" + LAST_UPDATED_VERSION)); - } - public void testIndexName() { final long timestamp = ZonedDateTime.of(2017, 8, 3, 13, 47, 58, 0, ZoneOffset.UTC).toInstant().toEpochMilli(); diff --git a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/http/HttpExporterResourceTests.java b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/http/HttpExporterResourceTests.java index 97e8bb33888d7..ce46d0cceaab0 100644 --- a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/http/HttpExporterResourceTests.java +++ b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/http/HttpExporterResourceTests.java @@ -39,7 +39,6 @@ import java.util.stream.Collectors; import static org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils.OLD_TEMPLATE_IDS; -import static org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils.PIPELINE_IDS; import static org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils.TEMPLATE_IDS; import static org.elasticsearch.xpack.monitoring.exporter.http.AsyncHttpResourceHelper.whenPerformRequestAsyncWith; import static org.elasticsearch.xpack.monitoring.exporter.http.AsyncHttpResourceHelper.wrapMockListener; @@ -70,13 +69,11 @@ public class HttpExporterResourceTests extends AbstractPublishableHttpResourceTe * kibana, logstash, and beats */ private final int EXPECTED_TEMPLATES = TEMPLATE_IDS.length + (createOldTemplates ? OLD_TEMPLATE_IDS.length : 0); - private final int EXPECTED_PIPELINES = PIPELINE_IDS.length; private final int EXPECTED_WATCHES = ClusterAlertsUtil.WATCH_IDS.length; private final RestClient client = mock(RestClient.class); private final Response versionResponse = mock(Response.class); private final List templateNames = new ArrayList<>(EXPECTED_TEMPLATES); - private final List pipelineNames = new ArrayList<>(EXPECTED_PIPELINES); private final List watchNames = new ArrayList<>(EXPECTED_WATCHES); private final Settings exporterSettings = Settings.builder() @@ -96,11 +93,9 @@ public void setupResources() { Arrays.stream(OLD_TEMPLATE_IDS).map(MonitoringTemplateUtils::oldTemplateName).collect(Collectors.toList())); } - pipelineNames.addAll(Arrays.stream(PIPELINE_IDS).map(MonitoringTemplateUtils::pipelineName).collect(Collectors.toList())); watchNames.addAll(Arrays.stream(ClusterAlertsUtil.WATCH_IDS).map(id -> "my_cluster_uuid_" + id).collect(Collectors.toList())); assertThat("Not all templates are supplied", templateNames, hasSize(EXPECTED_TEMPLATES)); - assertThat("Not all pipelines are supplied", pipelineNames, hasSize(EXPECTED_PIPELINES)); assertThat("Not all watches are supplied", watchNames, hasSize(EXPECTED_WATCHES)); } @@ -229,114 +224,14 @@ public void testTemplatePublishBlocksAfterSuccessfulVersion() { verifyNoMoreInteractions(client); } - public void testPipelineCheckBlocksAfterSuccessfulTemplates() { + public void testWatcherCheckBlocksAfterSuccessfulTemplatePublish() { final int successfulGetTemplates = randomIntBetween(0, EXPECTED_TEMPLATES); final int unsuccessfulGetTemplates = EXPECTED_TEMPLATES - successfulGetTemplates; final Exception exception = failureGetException(); - final boolean firstSucceeds = randomBoolean(); - int expectedGets = 1; - int expectedPuts = 0; - - whenValidVersionResponse(); - whenGetTemplates(successfulGetTemplates, unsuccessfulGetTemplates); - whenSuccessfulPutTemplates(EXPECTED_TEMPLATES); - - // failure in the middle of various templates being checked/published; suggests a node dropped - if (firstSucceeds) { - final boolean successfulFirst = randomBoolean(); - final String pipelineName = pipelineNames.get(0); - - final Response first; - - if (successfulFirst) { - first = successfulGetResourceResponse("/_ingest/pipeline/", pipelineName); - } else { - first = unsuccessfulGetResourceResponse("/_ingest/pipeline/", pipelineName); - } - - // last check fails - whenPerformRequestAsyncWith(client, new RequestMatcher(is("GET"), startsWith("/_ingest/pipeline/")), first, exception); - if (successfulFirst == false) { - whenSuccessfulPutPipelines(1); - } - - expectedGets = EXPECTED_PIPELINES; - expectedPuts = successfulFirst ? 0 : 1; - } else { - whenPerformRequestAsyncWith(client, new RequestMatcher(is("GET"), startsWith("/_ingest/pipeline/")), exception); - } - - assertTrue(resources.isDirty()); - awaitCheckAndPublish(null); - // ensure it didn't magically become not-dirty - assertTrue(resources.isDirty()); - - verifyVersionCheck(); - verifyGetTemplates(EXPECTED_TEMPLATES); - verifyPutTemplates(unsuccessfulGetTemplates); - verifyGetPipelines(expectedGets); - verifyPutPipelines(expectedPuts); - verifyNoMoreInteractions(client); - } - - public void testPipelinePublishBlocksAfterSuccessfulTemplates() { - final int successfulGetTemplates = randomIntBetween(0, EXPECTED_TEMPLATES); - final int unsuccessfulGetTemplates = EXPECTED_TEMPLATES - successfulGetTemplates; - final Exception exception = failurePutException(); - final boolean firstSucceeds = randomBoolean(); - int expectedGets = 1; - int expectedPuts = 1; - - whenValidVersionResponse(); - whenGetTemplates(successfulGetTemplates, unsuccessfulGetTemplates); - whenSuccessfulPutTemplates(EXPECTED_TEMPLATES); - - // failure in the middle of various templates being checked/published; suggests a node dropped - if (firstSucceeds) { - final Response firstSuccess = successfulPutResponse(); - - // We only have two pipelines for now, so the both GETs need to be "unsuccessful" for until we have a third - whenGetPipelines(0, 2); - - // previous publishes must have succeeded - whenPerformRequestAsyncWith(client, new RequestMatcher(is("PUT"), startsWith("/_ingest/pipeline/")), firstSuccess, exception); - - // GETs required for each PUT attempt (first is guaranteed "unsuccessful") - expectedGets += 1; - // unsuccessful are PUT attempts - expectedPuts += 1; - } else { - // fail the check so that it has to attempt the PUT - whenGetPipelines(0, 1); - - whenPerformRequestAsyncWith(client, new RequestMatcher(is("PUT"), startsWith("/_ingest/pipeline/")), exception); - } - - assertTrue(resources.isDirty()); - awaitCheckAndPublish(null); - // ensure it didn't magically become not-dirty - assertTrue(resources.isDirty()); - - verifyVersionCheck(); - verifyGetTemplates(EXPECTED_TEMPLATES); - verifyPutTemplates(unsuccessfulGetTemplates); - verifyGetPipelines(expectedGets); - verifyPutPipelines(expectedPuts); - verifyNoMoreInteractions(client); - } - - public void testWatcherCheckBlocksAfterSuccessfulPipelines() { - final int successfulGetTemplates = randomIntBetween(0, EXPECTED_TEMPLATES); - final int unsuccessfulGetTemplates = EXPECTED_TEMPLATES - successfulGetTemplates; - final int successfulGetPipelines = randomIntBetween(0, EXPECTED_PIPELINES); - final int unsuccessfulGetPipelines = EXPECTED_PIPELINES - successfulGetPipelines; - final Exception exception = failureGetException(); whenValidVersionResponse(); whenGetTemplates(successfulGetTemplates, unsuccessfulGetTemplates); whenSuccessfulPutTemplates(unsuccessfulGetTemplates); - whenGetPipelines(successfulGetPipelines, unsuccessfulGetPipelines); - whenSuccessfulPutPipelines(unsuccessfulGetPipelines); // there's only one check whenPerformRequestAsyncWith(client, new RequestMatcher(is("GET"), is("/_xpack")), exception); @@ -349,8 +244,6 @@ public void testWatcherCheckBlocksAfterSuccessfulPipelines() { verifyVersionCheck(); verifyGetTemplates(EXPECTED_TEMPLATES); verifyPutTemplates(unsuccessfulGetTemplates); - verifyGetPipelines(EXPECTED_PIPELINES); - verifyPutPipelines(unsuccessfulGetPipelines); verifyWatcherCheck(); verifyNoMoreInteractions(client); } @@ -358,8 +251,6 @@ public void testWatcherCheckBlocksAfterSuccessfulPipelines() { public void testWatchCheckBlocksAfterSuccessfulWatcherCheck() { final int successfulGetTemplates = randomIntBetween(0, EXPECTED_TEMPLATES); final int unsuccessfulGetTemplates = EXPECTED_TEMPLATES - successfulGetTemplates; - final int successfulGetPipelines = randomIntBetween(0, EXPECTED_PIPELINES); - final int unsuccessfulGetPipelines = EXPECTED_PIPELINES - successfulGetPipelines; final Exception exception = validLicense ? failureGetException() : failureDeleteException(); final boolean firstSucceeds = randomBoolean(); int expectedGets = 1; @@ -368,8 +259,6 @@ public void testWatchCheckBlocksAfterSuccessfulWatcherCheck() { whenValidVersionResponse(); whenGetTemplates(successfulGetTemplates, unsuccessfulGetTemplates); whenSuccessfulPutTemplates(unsuccessfulGetTemplates); - whenGetPipelines(successfulGetPipelines, unsuccessfulGetPipelines); - whenSuccessfulPutPipelines(unsuccessfulGetPipelines); whenWatcherCanBeUsed(validLicense); // failure in the middle of various watches being checked/published; suggests a node dropped @@ -421,8 +310,6 @@ public void testWatchCheckBlocksAfterSuccessfulWatcherCheck() { verifyVersionCheck(); verifyGetTemplates(EXPECTED_TEMPLATES); verifyPutTemplates(unsuccessfulGetTemplates); - verifyGetPipelines(EXPECTED_PIPELINES); - verifyPutPipelines(unsuccessfulGetPipelines); verifyWatcherCheck(); if (validLicense) { verifyGetWatches(expectedGets); @@ -436,8 +323,6 @@ public void testWatchCheckBlocksAfterSuccessfulWatcherCheck() { public void testWatchPublishBlocksAfterSuccessfulWatcherCheck() { final int successfulGetTemplates = randomIntBetween(0, EXPECTED_TEMPLATES); final int unsuccessfulGetTemplates = EXPECTED_TEMPLATES - successfulGetTemplates; - final int successfulGetPipelines = randomIntBetween(0, EXPECTED_PIPELINES); - final int unsuccessfulGetPipelines = EXPECTED_PIPELINES - successfulGetPipelines; final Exception exception = failurePutException(); final boolean firstSucceeds = randomBoolean(); int expectedGets = 1; @@ -446,8 +331,6 @@ public void testWatchPublishBlocksAfterSuccessfulWatcherCheck() { whenValidVersionResponse(); whenGetTemplates(successfulGetTemplates, unsuccessfulGetTemplates); whenSuccessfulPutTemplates(unsuccessfulGetTemplates); - whenGetPipelines(successfulGetPipelines, unsuccessfulGetPipelines); - whenSuccessfulPutPipelines(unsuccessfulGetPipelines); // license needs to be valid, otherwise we'll do DELETEs, which are tested earlier whenWatcherCanBeUsed(true); @@ -487,8 +370,6 @@ public void testWatchPublishBlocksAfterSuccessfulWatcherCheck() { verifyVersionCheck(); verifyGetTemplates(EXPECTED_TEMPLATES); verifyPutTemplates(unsuccessfulGetTemplates); - verifyGetPipelines(EXPECTED_PIPELINES); - verifyPutPipelines(unsuccessfulGetPipelines); verifyWatcherCheck(); verifyGetWatches(expectedGets); verifyPutWatches(expectedPuts); @@ -498,15 +379,11 @@ public void testWatchPublishBlocksAfterSuccessfulWatcherCheck() { public void testDeployClusterAlerts() { final int successfulGetTemplates = randomIntBetween(0, EXPECTED_TEMPLATES); final int unsuccessfulGetTemplates = EXPECTED_TEMPLATES - successfulGetTemplates; - final int successfulGetPipelines = randomIntBetween(0, EXPECTED_PIPELINES); - final int unsuccessfulGetPipelines = EXPECTED_PIPELINES - successfulGetPipelines; final Exception exception = failurePutException(); whenValidVersionResponse(); whenGetTemplates(successfulGetTemplates, unsuccessfulGetTemplates); whenSuccessfulPutTemplates(unsuccessfulGetTemplates); - whenGetPipelines(successfulGetPipelines, unsuccessfulGetPipelines); - whenSuccessfulPutPipelines(unsuccessfulGetPipelines); // license needs to be valid, otherwise we'll do DELETEs, which are tested earlier whenWatcherCanBeUsed(true); @@ -536,8 +413,6 @@ public void testDeployClusterAlerts() { verifyVersionCheck(); verifyGetTemplates(EXPECTED_TEMPLATES); verifyPutTemplates(unsuccessfulGetTemplates); - verifyGetPipelines(EXPECTED_PIPELINES); - verifyPutPipelines(unsuccessfulGetPipelines); verifyWatcherCheck(); verifyGetWatches(0); verifyPutWatches(0); @@ -548,16 +423,12 @@ public void testDeployClusterAlerts() { public void testSuccessfulChecksOnElectedMasterNode() { final int successfulGetTemplates = randomIntBetween(0, EXPECTED_TEMPLATES); final int unsuccessfulGetTemplates = EXPECTED_TEMPLATES - successfulGetTemplates; - final int successfulGetPipelines = randomIntBetween(0, EXPECTED_PIPELINES); - final int unsuccessfulGetPipelines = EXPECTED_PIPELINES - successfulGetPipelines; final int successfulGetWatches = randomIntBetween(0, EXPECTED_WATCHES); final int unsuccessfulGetWatches = EXPECTED_WATCHES - successfulGetWatches; whenValidVersionResponse(); whenGetTemplates(successfulGetTemplates, unsuccessfulGetTemplates); whenSuccessfulPutTemplates(unsuccessfulGetTemplates); - whenGetPipelines(successfulGetPipelines, unsuccessfulGetPipelines); - whenSuccessfulPutPipelines(unsuccessfulGetPipelines); if (remoteClusterHasWatcher) { whenWatcherCanBeUsed(validLicense); if (validLicense) { @@ -579,8 +450,6 @@ public void testSuccessfulChecksOnElectedMasterNode() { verifyVersionCheck(); verifyGetTemplates(EXPECTED_TEMPLATES); verifyPutTemplates(unsuccessfulGetTemplates); - verifyGetPipelines(EXPECTED_PIPELINES); - verifyPutPipelines(unsuccessfulGetPipelines); verifyWatcherCheck(); if (remoteClusterHasWatcher) { if (validLicense) { @@ -606,14 +475,10 @@ public void testSuccessfulChecksIfNotElectedMasterNode() { final int successfulGetTemplates = randomIntBetween(0, EXPECTED_TEMPLATES); final int unsuccessfulGetTemplates = EXPECTED_TEMPLATES - successfulGetTemplates; - final int successfulGetPipelines = randomIntBetween(0, 1); - final int unsuccessfulGetPipelines = EXPECTED_PIPELINES - successfulGetPipelines; whenValidVersionResponse(); whenGetTemplates(successfulGetTemplates, unsuccessfulGetTemplates); whenSuccessfulPutTemplates(unsuccessfulGetTemplates); - whenGetPipelines(successfulGetPipelines, unsuccessfulGetPipelines); - whenSuccessfulPutPipelines(1); assertTrue(resources.isDirty()); @@ -626,8 +491,6 @@ public void testSuccessfulChecksIfNotElectedMasterNode() { verifyVersionCheck(); verifyGetTemplates(EXPECTED_TEMPLATES); verifyPutTemplates(unsuccessfulGetTemplates); - verifyGetPipelines(EXPECTED_PIPELINES); - verifyPutPipelines(unsuccessfulGetPipelines); verifyNoMoreInteractions(client); } @@ -703,10 +566,6 @@ private List getTemplateResponses(final int skip, final int successful return getResourceResponses("/_template/", templateNames, skip, successful, unsuccessful); } - private List getPipelineResponses(final int skip, final int successful, final int unsuccessful) { - return getResourceResponses("/_ingest/pipeline/", pipelineNames, skip, successful, unsuccessful); - } - private List getWatcherResponses(final int skip, final int successful, final int unsuccessful) { final List responses = new ArrayList<>(successful + unsuccessful); @@ -777,19 +636,6 @@ private void whenSuccessfulPutTemplates(final int successful) { whenPerformRequestAsyncWith(client, new RequestMatcher(is("PUT"), startsWith("/_template/")), successfulPuts); } - private void whenGetPipelines(final int successful, final int unsuccessful) { - final List gets = getPipelineResponses(0, successful, unsuccessful); - - whenPerformRequestAsyncWith(client, new RequestMatcher(is("GET"), startsWith("/_ingest/pipeline/")), gets); - } - - private void whenSuccessfulPutPipelines(final int successful) { - final List successfulPuts = successfulPutResponses(successful); - - // empty is possible if they all exist - whenPerformRequestAsyncWith(client, new RequestMatcher(is("PUT"), startsWith("/_ingest/pipeline/")), successfulPuts); - } - private void whenWatcherCanBeUsed(final boolean validLicense) { final Metadata metadata = mock(Metadata.class); @@ -856,16 +702,6 @@ private void verifyPutTemplates(final int called) { .performRequestAsync(argThat(new RequestMatcher(is("PUT"), startsWith("/_template/"))), any(ResponseListener.class)); } - private void verifyGetPipelines(final int called) { - verify(client, times(called)) - .performRequestAsync(argThat(new RequestMatcher(is("GET"), startsWith("/_ingest/pipeline/"))), any(ResponseListener.class)); - } - - private void verifyPutPipelines(final int called) { - verify(client, times(called)) - .performRequestAsync(argThat(new RequestMatcher(is("PUT"), startsWith("/_ingest/pipeline/"))), any(ResponseListener.class)); - } - private void verifyWatcherCheck() { verify(client).performRequestAsync(argThat(new RequestMatcher(is("GET"), is("/_xpack"))), any(ResponseListener.class)); } diff --git a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/http/HttpExporterTests.java b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/http/HttpExporterTests.java index acd6faefd2eba..e2c932119ff56 100644 --- a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/http/HttpExporterTests.java +++ b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/http/HttpExporterTests.java @@ -27,7 +27,6 @@ import org.elasticsearch.common.util.concurrent.ThreadContext; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils; import org.elasticsearch.xpack.core.ssl.SSLService; import org.elasticsearch.xpack.monitoring.exporter.ClusterAlertsUtil; import org.elasticsearch.xpack.monitoring.exporter.ExportBulk; @@ -49,7 +48,6 @@ import java.util.stream.Collectors; import static org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils.OLD_TEMPLATE_IDS; -import static org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils.PIPELINE_IDS; import static org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils.TEMPLATE_IDS; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; @@ -389,19 +387,13 @@ public void testCreateSniffer() throws IOException { } public void testCreateResources() { - final boolean useIngest = randomBoolean(); final boolean clusterAlertManagement = randomBoolean(); final boolean createOldTemplates = randomBoolean(); final TimeValue templateTimeout = randomFrom(TimeValue.timeValueSeconds(30), null); - final TimeValue pipelineTimeout = randomFrom(TimeValue.timeValueSeconds(30), null); final Settings.Builder builder = Settings.builder() .put("xpack.monitoring.exporters._http.type", "http"); - if (useIngest == false) { - builder.put("xpack.monitoring.exporters._http.use_ingest", false); - } - if (clusterAlertManagement == false) { builder.put("xpack.monitoring.exporters._http.cluster_alerts.management.enabled", false); } @@ -414,11 +406,6 @@ public void testCreateResources() { builder.put("xpack.monitoring.exporters._http.index.template.master_timeout", templateTimeout.getStringRep()); } - // note: this shouldn't get used with useIngest == false, but it doesn't hurt to try to cause issues - if (pipelineTimeout != null) { - builder.put("xpack.monitoring.exporters._http.index.pipeline.master_timeout", pipelineTimeout.getStringRep()); - } - final Config config = createConfig(builder.build()); final MultiHttpResource multiResource = HttpExporter.createResources(config).allResources; @@ -429,10 +416,6 @@ public void testCreateResources() { resources.stream().filter((resource) -> resource instanceof TemplateHttpResource) .map(TemplateHttpResource.class::cast) .collect(Collectors.toList()); - final List pipelines = - resources.stream().filter((resource) -> resource instanceof PipelineHttpResource) - .map(PipelineHttpResource.class::cast) - .collect(Collectors.toList()); final List watcherCheck = resources.stream().filter((resource) -> resource instanceof WatcherExistsHttpResource) .map(WatcherExistsHttpResource.class::cast) @@ -449,16 +432,14 @@ public void testCreateResources() { // expected number of resources assertThat(multiResource.getResources().size(), - equalTo(version + templates.size() + pipelines.size() + watcherCheck.size())); + equalTo(version + templates.size() + watcherCheck.size())); assertThat(version, equalTo(1)); assertThat(templates, hasSize(createOldTemplates ? TEMPLATE_IDS.length + OLD_TEMPLATE_IDS.length : TEMPLATE_IDS.length)); - assertThat(pipelines, hasSize(useIngest ? PIPELINE_IDS.length : 0)); assertThat(watcherCheck, hasSize(clusterAlertManagement ? 1 : 0)); assertThat(watches, hasSize(clusterAlertManagement ? ClusterAlertsUtil.WATCH_IDS.length : 0)); // timeouts assertMasterTimeoutSet(templates, templateTimeout); - assertMasterTimeoutSet(pipelines, pipelineTimeout); // logging owner names final List uniqueOwners = @@ -470,7 +451,6 @@ public void testCreateResources() { public void testCreateDefaultParams() { final TimeValue bulkTimeout = randomFrom(TimeValue.timeValueSeconds(30), null); - final boolean useIngest = randomBoolean(); final Settings.Builder builder = Settings.builder() .put("xpack.monitoring.exporters._http.type", "http"); @@ -479,10 +459,6 @@ public void testCreateDefaultParams() { builder.put("xpack.monitoring.exporters._http.bulk.timeout", bulkTimeout.toString()); } - if (useIngest == false) { - builder.put("xpack.monitoring.exporters._http.use_ingest", false); - } - final Config config = createConfig(builder.build()); final Map parameters = new HashMap<>(HttpExporter.createDefaultParams(config)); @@ -495,11 +471,6 @@ public void testCreateDefaultParams() { assertNull(parameters.remove("timeout")); } - if (useIngest) { - assertThat(parameters.remove("pipeline"), - equalTo(MonitoringTemplateUtils.pipelineName(MonitoringTemplateUtils.TEMPLATE_VERSION))); - } - // should have removed everything assertThat(parameters.size(), equalTo(0)); } diff --git a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/http/PipelineHttpResourceTests.java b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/http/PipelineHttpResourceTests.java deleted file mode 100644 index dac8c19b05a22..0000000000000 --- a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/http/PipelineHttpResourceTests.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * 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.monitoring.exporter.http; - -import org.apache.http.HttpEntity; -import org.apache.http.entity.ByteArrayEntity; -import org.apache.http.entity.ContentType; -import org.elasticsearch.Version; -import org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils; - -import java.io.IOException; -import java.io.InputStream; -import java.util.Collections; -import java.util.function.Supplier; - -import static org.hamcrest.Matchers.is; - -/** - * Tests {@link PipelineHttpResource}. - */ -public class PipelineHttpResourceTests extends AbstractPublishableHttpResourceTestCase { - - private final String pipelineName = ".my_pipeline"; - private final byte[] pipelineBytes = new byte[] { randomByte(), randomByte(), randomByte() }; - private final Supplier pipeline = () -> pipelineBytes; - private final int minimumVersion = Math.min(MonitoringTemplateUtils.LAST_UPDATED_VERSION, Version.CURRENT.id); - - private final PipelineHttpResource resource = new PipelineHttpResource(owner, masterTimeout, pipelineName, pipeline); - - public void testPipelineToHttpEntity() throws IOException { - final HttpEntity entity = resource.pipelineToHttpEntity(); - - assertThat(entity.getContentType().getValue(), is(ContentType.APPLICATION_JSON.toString())); - - final InputStream byteStream = entity.getContent(); - - assertThat(byteStream.available(), is(pipelineBytes.length)); - - for (final byte pipelineByte : pipelineBytes) { - assertThat(pipelineByte, is((byte)byteStream.read())); - } - - assertThat(byteStream.available(), is(0)); - } - - public void testDoCheckExists() { - final HttpEntity entity = entityForResource(true, pipelineName, minimumVersion); - - doCheckWithStatusCode(resource, "/_ingest/pipeline", pipelineName, successfulCheckStatus(), true, entity); - } - - public void testDoCheckDoesNotExist() { - if (randomBoolean()) { - // it does not exist because it's literally not there - assertCheckDoesNotExist(resource, "/_ingest/pipeline", pipelineName); - } else { - // it does not exist because we need to replace it - final HttpEntity entity = entityForResource(false, pipelineName, minimumVersion); - - doCheckWithStatusCode(resource, "/_ingest/pipeline", pipelineName, - successfulCheckStatus(), false, entity); - } - } - - public void testDoCheckError() { - if (randomBoolean()) { - // error because of a server error - assertCheckWithException(resource, "/_ingest/pipeline", pipelineName); - } else { - // error because of a malformed response - final HttpEntity entity = entityForResource(null, pipelineName, minimumVersion); - - doCheckWithStatusCode(resource, "/_ingest/pipeline", pipelineName, successfulCheckStatus(), null, entity); - } - } - - public void testDoPublishTrue() { - assertPublishSucceeds(resource, "/_ingest/pipeline", pipelineName, Collections.emptyMap(), ByteArrayEntity.class); - } - - public void testDoPublishFalseWithException() { - assertPublishWithException(resource, "/_ingest/pipeline", pipelineName, Collections.emptyMap(), ByteArrayEntity.class); - } - - public void testParameters() { - assertVersionParameters(resource); - } - -} diff --git a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/local/LocalExporterIntegTests.java b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/local/LocalExporterIntegTests.java index 2eed872d6878d..825c065b91ea9 100644 --- a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/local/LocalExporterIntegTests.java +++ b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/local/LocalExporterIntegTests.java @@ -9,7 +9,6 @@ import org.elasticsearch.action.admin.cluster.state.ClusterStateResponse; import org.elasticsearch.action.admin.indices.template.get.GetIndexTemplatesResponse; import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.ingest.GetPipelineResponse; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.cluster.metadata.IndexTemplateMetadata; import org.elasticsearch.common.Strings; @@ -19,7 +18,6 @@ import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.index.query.QueryBuilders; -import org.elasticsearch.ingest.PipelineConfiguration; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.aggregations.bucket.terms.Terms; @@ -28,7 +26,6 @@ import org.elasticsearch.xpack.core.monitoring.MonitoredSystem; import org.elasticsearch.xpack.core.monitoring.action.MonitoringBulkDoc; import org.elasticsearch.xpack.core.monitoring.action.MonitoringBulkRequestBuilder; -import org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils; import org.elasticsearch.xpack.monitoring.MonitoringService; import org.elasticsearch.xpack.monitoring.MonitoringTestUtils; @@ -37,7 +34,6 @@ import java.time.ZoneOffset; import java.time.ZonedDateTime; import java.util.ArrayList; -import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Map; @@ -51,7 +47,6 @@ import static org.elasticsearch.xpack.core.monitoring.MonitoredSystem.BEATS; import static org.elasticsearch.xpack.core.monitoring.MonitoredSystem.KIBANA; import static org.elasticsearch.xpack.core.monitoring.MonitoredSystem.LOGSTASH; -import static org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils.PIPELINE_IDS; import static org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils.TEMPLATE_VERSION; import static org.hamcrest.Matchers.greaterThan; import static org.hamcrest.Matchers.is; @@ -120,7 +115,6 @@ public void testExport() throws Exception { }); checkMonitoringTemplates(); - checkMonitoringPipelines(); checkMonitoringDocs(); } @@ -174,7 +168,6 @@ public void testExport() throws Exception { }, 30L, TimeUnit.SECONDS); checkMonitoringTemplates(); - checkMonitoringPipelines(); checkMonitoringDocs(); } finally { stopMonitoring(); @@ -230,22 +223,6 @@ private void checkMonitoringTemplates() { assertEquals(templates, actualTemplates); } - /** - * Checks that the monitoring ingest pipelines have been created by the local exporter - */ - private void checkMonitoringPipelines() { - final Set expectedPipelines = - Arrays.stream(PIPELINE_IDS).map(MonitoringTemplateUtils::pipelineName).collect(Collectors.toSet()); - - final GetPipelineResponse response = client().admin().cluster().prepareGetPipeline("xpack_monitoring_*").get(); - - // actual pipelines - final Set pipelines = response.pipelines().stream().map(PipelineConfiguration::getId).collect(Collectors.toSet()); - - assertEquals("Missing expected pipelines", expectedPipelines, pipelines); - assertTrue("monitoring ingest pipeline not found", response.isFound()); - } - /** * Checks that the monitoring documents all have the cluster_uuid, timestamp and source_node * fields and belongs to the right data or timestamped index. diff --git a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/local/LocalExporterResourceIntegTests.java b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/local/LocalExporterResourceIntegTests.java index 12a0e741a01af..78c4a8defd70c 100644 --- a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/local/LocalExporterResourceIntegTests.java +++ b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/local/LocalExporterResourceIntegTests.java @@ -17,7 +17,6 @@ import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.index.query.QueryBuilders; -import org.elasticsearch.ingest.PipelineConfiguration; import org.elasticsearch.protocol.xpack.watcher.PutWatchRequest; import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.builder.SearchSourceBuilder; @@ -39,7 +38,6 @@ import static org.elasticsearch.test.ESIntegTestCase.Scope.TEST; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.hamcrest.Matchers.containsString; -import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.not; import static org.hamcrest.Matchers.notNullValue; @@ -79,7 +77,6 @@ public void testCreateWhenResourcesShouldNotBeReplaced() throws Exception { // these were "newer" or at least the same version, so they shouldn't be replaced assertTemplateNotUpdated(); - assertPipelinesNotUpdated(); } public void testRemoveWhenResourcesShouldBeRemoved() throws Exception { @@ -95,7 +92,6 @@ public void testRemoveWhenResourcesShouldBeRemoved() throws Exception { waitNoPendingTasksOnAll(); assertBusy(() -> { assertTemplatesExist(); - assertPipelinesExist(); assertNoWatchesExist(); }); } @@ -178,7 +174,6 @@ private void putResources(final Integer version) throws Exception { waitNoPendingTasksOnAll(); putTemplate(version); - putPipelines(version); putWatches(version); } @@ -189,45 +184,6 @@ private void putTemplate(final Integer version) throws Exception { assertAcked(client().admin().indices().preparePutTemplate(templateName).setSource(source, XContentType.JSON).get()); } - private void putPipelines(final Integer version) { - for (final String pipelineId : MonitoringTemplateUtils.PIPELINE_IDS) { - putPipeline(MonitoringTemplateUtils.pipelineName(pipelineId), version); - } - } - - private void putPipeline(final String pipelineName, final Integer version) { - assertAcked(client().admin().cluster().preparePutPipeline(pipelineName, replaceablePipeline(version), XContentType.JSON).get()); - } - - /** - * Create a pipeline with nothing in it whose description is literally "test". - * - * @param version Version to add to the pipeline, if any - * @return Never {@code null}. - */ - private BytesReference replaceablePipeline(final Integer version) { - try { - final XContentBuilder builder = XContentBuilder.builder(XContentType.JSON.xContent()); - - builder.startObject(); - - { - builder.startArray("processors").endArray(); - // something we can quickly check to ensure we have/have not replaced it - builder.field("description", getTestName()); - - // sometimes give it a version that should be overwritten (and sometimes don't give it a version at all) - if (version != null) { - builder.field("version", version); - } - } - - return BytesReference.bytes(builder.endObject()); - } catch (final IOException e) { - throw new RuntimeException("Failed to create pipeline", e); - } - } - /** * Create a cluster alert that does nothing. * @param version Version to add to the watch, if any @@ -297,15 +253,6 @@ private void assertTemplatesExist() { } } - private void assertPipelinesExist() { - for (PipelineConfiguration pipeline : client().admin().cluster().prepareGetPipeline("xpack_monitoring_*").get().pipelines()) { - final Object description = pipeline.getConfigAsMap().get("description"); - - // this just ensures that it's set; not who set it - assertThat(description, notNullValue()); - } - } - private void assertWatchesExist() { // Check if watches index exists if (client().admin().indices().prepareGetIndex().addIndices(".watches").get().getIndices().length == 0) { @@ -358,7 +305,6 @@ private void assertResourcesExist() throws Exception { assertBusy(() -> { assertTemplatesExist(); - assertPipelinesExist(); assertWatchesExist(); }); } @@ -373,12 +319,4 @@ private void assertTemplateNotUpdated() { assertThat(docMapping, containsString("test")); } } - - private void assertPipelinesNotUpdated() { - for (PipelineConfiguration pipeline : client().admin().cluster().prepareGetPipeline("xpack_monitoring_*").get().pipelines()) { - final Object description = pipeline.getConfigAsMap().get("description"); - - assertThat(description, equalTo(getTestName())); - } - } } diff --git a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/test/MonitoringIntegTestCase.java b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/test/MonitoringIntegTestCase.java index 5b71d31f8b2a0..7f8652fd136df 100644 --- a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/test/MonitoringIntegTestCase.java +++ b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/test/MonitoringIntegTestCase.java @@ -14,7 +14,6 @@ import org.elasticsearch.common.regex.Regex; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.CountDown; -import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.test.ESIntegTestCase; @@ -135,25 +134,6 @@ protected List monitoringTemplateNames() { .collect(Collectors.toList()); } - private Tuple monitoringPipeline(final String pipelineId) { - final XContentType json = XContentType.JSON; - - return new Tuple<>(MonitoringTemplateUtils.pipelineName(pipelineId), - Strings.toString(MonitoringTemplateUtils.loadPipeline(pipelineId, json))); - } - - protected List> monitoringPipelines() { - return Arrays.stream(MonitoringTemplateUtils.PIPELINE_IDS) - .map(this::monitoringPipeline) - .collect(Collectors.toList()); - } - - protected List monitoringPipelineNames() { - return Arrays.stream(MonitoringTemplateUtils.PIPELINE_IDS) - .map(MonitoringTemplateUtils::pipelineName) - .collect(Collectors.toList()); - } - protected List> monitoringWatches() { final ClusterService clusterService = clusterService(); From 44749127597d01c879a60fd1e5746a5671968208 Mon Sep 17 00:00:00 2001 From: Rory Hunter Date: Tue, 28 Sep 2021 21:31:04 +0100 Subject: [PATCH 043/250] Fix PruneChangelogsTaskTests to work on Windows (#78366) Closes #78318. The test `findAndDeleteFiles_withFilesToDeleteButDeleteFails_throwsException` in `PruneChangelogsTaskTests` was failing because the path in the expected error output changes on Windows. Fix this by using a `Path`. --- .../gradle/internal/release/PruneChangelogsTaskTests.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build-tools-internal/src/test/java/org/elasticsearch/gradle/internal/release/PruneChangelogsTaskTests.java b/build-tools-internal/src/test/java/org/elasticsearch/gradle/internal/release/PruneChangelogsTaskTests.java index a7f9b2009d6cd..be3a4738c035a 100644 --- a/build-tools-internal/src/test/java/org/elasticsearch/gradle/internal/release/PruneChangelogsTaskTests.java +++ b/build-tools-internal/src/test/java/org/elasticsearch/gradle/internal/release/PruneChangelogsTaskTests.java @@ -205,7 +205,9 @@ public void findAndDeleteFiles_withFilesToDeleteButDeleteFails_throwsException() ) ); - assertThat(e.getMessage(), equalTo("Failed to delete some files:\n\n\tdocs/changelog/1234.yml\n")); + // Use a `Path` so that the test works across platforms + final Path failedPath = Path.of("docs", "changelog", "1234.yml"); + assertThat(e.getMessage(), equalTo("Failed to delete some files:\n\n\t" + failedPath + "\n")); } /** From 2227a7bce91631950e57bcf942c24590fd3fd03f Mon Sep 17 00:00:00 2001 From: Igor Motov Date: Tue, 28 Sep 2021 11:16:57 -1000 Subject: [PATCH 044/250] Adds some REST tests for boxplot metric aggregations. (#78354) Adds more REST tests for boxplot metric aggregations. Related to #26220 --- .../rest-api-spec/test/analytics/boxplot.yml | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/analytics/boxplot.yml b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/analytics/boxplot.yml index f65b9923f1948..3247920e29d83 100644 --- a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/analytics/boxplot.yml +++ b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/analytics/boxplot.yml @@ -35,6 +35,11 @@ setup: - index: _index: "latency" - load_time: 15 + + - index: + _index: "latency" + - { } + --- "Basic Search": @@ -54,3 +59,55 @@ setup: - match: { aggregations.plot.q2: 5.0 } - match: { aggregations.plot.q3: 11.25 } +--- +"Search With Runtime Field": + + - do: + search: + index: "latency" + body: + query: + exists: + field: load_time + runtime_mappings: + load_time_adjusted: + type: long + script: + source: "emit((long)((doc['load_time'].value == 10 ? 1000 : doc['load_time'].value) * params.multiplier))" + params: + multiplier: 10 + size: 0 + aggs: + plot: + boxplot: + field: "load_time_adjusted" + + - match: { aggregations.plot.min: 20.0 } + - match: { aggregations.plot.max: 10000.0 } + - match: { aggregations.plot.q1: 27.5 } + - match: { aggregations.plot.q2: 50.0 } + - match: { aggregations.plot.q3: 2612.5 } + - match: { aggregations.plot.lower: 20.0 } + - match: { aggregations.plot.upper: 150.0 } + +--- +"Search With Missing": + + - do: + search: + index: "latency" + body: + size: 0 + aggs: + plot: + boxplot: + field: "load_time" + missing: 10000 + + - match: { aggregations.plot.min: 2.0 } + - match: { aggregations.plot.max: 10000.0 } + - match: { aggregations.plot.q1: 3 } + - match: { aggregations.plot.q2: 7.5 } + - match: { aggregations.plot.q3: 15.0 } + - match: { aggregations.plot.lower: 2.0 } + - match: { aggregations.plot.upper: 15.0 } From a9ae3136ebe190208b44b9855a9bf42ee9a2c97b Mon Sep 17 00:00:00 2001 From: Mark Vieira Date: Tue, 28 Sep 2021 14:31:21 -0700 Subject: [PATCH 045/250] Remove example-plugins included build (#78408) --- .../gradle/internal/test/DistroTestPlugin.java | 6 +++--- build.gradle | 3 --- plugins/examples/settings.gradle | 2 -- .../elasticsearch/packaging/test/PluginCliTests.java | 4 +++- settings.gradle | 12 ------------ 5 files changed, 6 insertions(+), 21 deletions(-) diff --git a/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/DistroTestPlugin.java b/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/DistroTestPlugin.java index 1be66342c3e95..02490232e1fd8 100644 --- a/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/DistroTestPlugin.java +++ b/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/DistroTestPlugin.java @@ -102,7 +102,7 @@ public void apply(Project project) { Map> versionTasks = versionTasks(project, "destructiveDistroUpgradeTest"); TaskProvider destructiveDistroTest = project.getTasks().register("destructiveDistroTest"); - Configuration examplePlugin = configureExamplePlugin(project); + // Configuration examplePlugin = configureExamplePlugin(project); List> windowsTestTasks = new ArrayList<>(); Map>> linuxTestTasks = new HashMap<>(); @@ -113,12 +113,12 @@ public void apply(Project project) { String taskname = destructiveDistroTestTaskName(distribution); TaskProvider depsTask = project.getTasks().register(taskname + "#deps"); // explicitly depend on the archive not on the implicit extracted distribution - depsTask.configure(t -> t.dependsOn(distribution.getArchiveDependencies(), examplePlugin)); + depsTask.configure(t -> t.dependsOn(distribution.getArchiveDependencies())); depsTasks.put(taskname, depsTask); TaskProvider destructiveTask = configureTestTask(project, taskname, distribution, t -> { t.onlyIf(t2 -> distribution.isDocker() == false || dockerSupport.get().getDockerAvailability().isAvailable); addDistributionSysprop(t, DISTRIBUTION_SYSPROP, distribution::getFilepath); - addDistributionSysprop(t, EXAMPLE_PLUGIN_SYSPROP, () -> examplePlugin.getSingleFile().toString()); + //addDistributionSysprop(t, EXAMPLE_PLUGIN_SYSPROP, () -> examplePlugin.getSingleFile().toString()); t.exclude("**/PackageUpgradeTests.class"); }, depsTask); diff --git a/build.gradle b/build.gradle index 62fc02dc75d02..44ca1d8db708c 100644 --- a/build.gradle +++ b/build.gradle @@ -369,7 +369,6 @@ tasks.register("branchConsistency") { } tasks.named("wrapper").configure { - dependsOn gradle.includedBuild('example-plugins').task(':wrapper') distributionType = 'ALL' doLast { final DistributionLocator locator = new DistributionLocator() @@ -410,13 +409,11 @@ gradle.projectsEvaluated { tasks.named("precommit") { dependsOn gradle.includedBuild('build-tools').task(':precommit') dependsOn gradle.includedBuild('build-tools-internal').task(':precommit') - dependsOn gradle.includedBuild('example-plugins').task(':precommit') } tasks.named("checkPart1").configure { dependsOn gradle.includedBuild('build-tools').task(':check') dependsOn gradle.includedBuild('build-tools-internal').task(':check') - dependsOn gradle.includedBuild('example-plugins').task(':check') } tasks.named("assemble").configure { diff --git a/plugins/examples/settings.gradle b/plugins/examples/settings.gradle index 5ef2f7768ff4f..bb626a6e7b676 100644 --- a/plugins/examples/settings.gradle +++ b/plugins/examples/settings.gradle @@ -6,8 +6,6 @@ * Side Public License, v 1. */ -includeBuild '../../' - // Include all subdirectories as example projects rootDir.listFiles().findAll { it.directory && new File(it, 'build.gradle').exists() }.each { subDir -> include ":${subDir.name}" diff --git a/qa/os/src/test/java/org/elasticsearch/packaging/test/PluginCliTests.java b/qa/os/src/test/java/org/elasticsearch/packaging/test/PluginCliTests.java index 05cc993efd7bb..13a95f0b05c3f 100644 --- a/qa/os/src/test/java/org/elasticsearch/packaging/test/PluginCliTests.java +++ b/qa/os/src/test/java/org/elasticsearch/packaging/test/PluginCliTests.java @@ -9,6 +9,7 @@ package org.elasticsearch.packaging.test; import org.apache.http.client.fluent.Request; +import org.elasticsearch.packaging.test.PackagingTestCase.AwaitsFix; import org.elasticsearch.packaging.util.Installation; import org.elasticsearch.packaging.util.Platforms; import org.elasticsearch.packaging.util.Shell; @@ -24,13 +25,14 @@ import static org.junit.Assume.assumeFalse; import static org.junit.Assume.assumeTrue; +@AwaitsFix(bugUrl = "Needs to be re-enabled") public class PluginCliTests extends PackagingTestCase { private static final String EXAMPLE_PLUGIN_NAME = "custom-settings"; private static final Path EXAMPLE_PLUGIN_ZIP; static { // re-read before each test so the plugin path can be manipulated within tests - EXAMPLE_PLUGIN_ZIP = Paths.get(System.getProperty("tests.example-plugin")); + EXAMPLE_PLUGIN_ZIP = Paths.get(System.getProperty("tests.example-plugin", "/dummy/path")); } @Before diff --git a/settings.gradle b/settings.gradle index 00d7dd0c54d97..e3c74074eba1b 100644 --- a/settings.gradle +++ b/settings.gradle @@ -9,22 +9,10 @@ plugins { id "com.gradle.enterprise" version "3.6.4" } -def isEclipse = providers.systemProperty("eclipse.launcher").forUseAtConfigurationTime().isPresent() || // Detects gradle launched from Eclipse's IDE - providers.systemProperty("eclipse.application").forUseAtConfigurationTime().isPresent() || // Detects gradle launched from the Eclipse compiler server - gradle.startParameter.taskNames.contains('eclipse') || // Detects gradle launched from the command line to do eclipse stuff - gradle.startParameter.taskNames.contains('cleanEclipse') - includeBuild "build-conventions" includeBuild "build-tools" includeBuild "build-tools-internal" -// Eclipse will hang on import when examples are included in the composite build so omit them -if (isEclipse == false) { - includeBuild("plugins/examples") { - name = "example-plugins" - } -} - rootProject.name = "elasticsearch" List projects = [ From 0a2232694d0cf508a3b6bd878c4dd916d7aa9429 Mon Sep 17 00:00:00 2001 From: Rene Groeschke Date: Wed, 29 Sep 2021 02:24:39 +0200 Subject: [PATCH 046/250] Ensure remote-cluster cluster is available when configuring tasks using it (#78397) Fixes #78389 Co-authored-by: Elastic Machine --- qa/multi-cluster-search/build.gradle | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qa/multi-cluster-search/build.gradle b/qa/multi-cluster-search/build.gradle index 481f2b8035552..622c01bef74d3 100644 --- a/qa/multi-cluster-search/build.gradle +++ b/qa/multi-cluster-search/build.gradle @@ -12,10 +12,13 @@ apply plugin: 'elasticsearch.internal-testclusters' apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.rest-resources' + dependencies { testImplementation project(":client:rest-high-level") } +testClusters.register('remote-cluster') + tasks.register('remote-cluster', RestIntegTestTask) { mustRunAfter("precommit") systemProperty 'tests.rest.suite', 'remote_cluster' From 990aa3456185060d9065681cbdbd1e504e2a6a73 Mon Sep 17 00:00:00 2001 From: Armin Braun Date: Wed, 29 Sep 2021 07:49:32 +0200 Subject: [PATCH 047/250] Prevent Duplicate ILM Cluster State Updates from Being Created (#78390) Prevent duplicate ILM tasks from being enqueued to fix the most immediate issues around #78246. The ILM logic should be further improved though. I did not include `MoveToErrorStepUpdateTask` in this change yet as I wasn't entirely sure how valid/safe hashing/comparing arbitrary `Exception`s would be. That could be looked into in a follow-up as well. Relates #77466 Closes #78246 --- .../xpack/core/ilm/BranchingStep.java | 8 +-- .../xpack/ilm/ExecuteStepsUpdateTask.java | 28 ++++++--- .../IndexLifecycleClusterStateUpdateTask.java | 62 +++++++++++++++++++ .../xpack/ilm/IndexLifecycleRunner.java | 33 +++++++++- .../xpack/ilm/IndexLifecycleService.java | 4 +- .../xpack/ilm/MoveToNextStepUpdateTask.java | 51 ++++++++------- .../xpack/ilm/SetStepInfoUpdateTask.java | 28 +++++++-- .../xpack/slm/SnapshotLifecycleTask.java | 2 +- .../ilm/ExecuteStepsUpdateTaskTests.java | 7 +-- .../xpack/ilm/IndexLifecycleRunnerTests.java | 3 +- .../ilm/MoveToNextStepUpdateTaskTests.java | 7 +-- .../xpack/ilm/SetStepInfoUpdateTaskTests.java | 2 +- 12 files changed, 175 insertions(+), 60 deletions(-) create mode 100644 x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycleClusterStateUpdateTask.java diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/BranchingStep.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/BranchingStep.java index 617bd56d0481b..32f0920708057 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/BranchingStep.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/BranchingStep.java @@ -27,10 +27,10 @@ public class BranchingStep extends ClusterStateActionStep { private static final Logger logger = LogManager.getLogger(BranchingStep.class); - private StepKey nextStepKeyOnFalse; - private StepKey nextStepKeyOnTrue; - private BiPredicate predicate; - private SetOnce predicateValue; + private final StepKey nextStepKeyOnFalse; + private final StepKey nextStepKeyOnTrue; + private final BiPredicate predicate; + private final SetOnce predicateValue; /** * {@link BranchingStep} is a step whose next step is based on diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/ExecuteStepsUpdateTask.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/ExecuteStepsUpdateTask.java index 8ce5d2ab631e7..9890ee65ddc3c 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/ExecuteStepsUpdateTask.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/ExecuteStepsUpdateTask.java @@ -9,7 +9,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.elasticsearch.ElasticsearchException; +import org.apache.logging.log4j.message.ParameterizedMessage; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.ClusterStateUpdateTask; import org.elasticsearch.cluster.metadata.IndexMetadata; @@ -24,9 +24,10 @@ import org.elasticsearch.xpack.core.ilm.TerminalPolicyStep; import java.io.IOException; +import java.util.Objects; import java.util.function.LongSupplier; -public class ExecuteStepsUpdateTask extends ClusterStateUpdateTask { +public class ExecuteStepsUpdateTask extends IndexLifecycleClusterStateUpdateTask { private static final Logger logger = LogManager.getLogger(ExecuteStepsUpdateTask.class); private final String policy; private final Index index; @@ -175,7 +176,7 @@ public ClusterState execute(final ClusterState currentState) throws IOException } @Override - public void clusterStateProcessed(String source, ClusterState oldState, ClusterState newState) { + public void onClusterStateProcessed(String source, ClusterState oldState, ClusterState newState) { if (oldState.equals(newState) == false) { IndexMetadata indexMetadata = newState.metadata().index(index); if (indexMetadata != null) { @@ -200,15 +201,28 @@ public void clusterStateProcessed(String source, ClusterState oldState, ClusterS } @Override - public void onFailure(String source, Exception e) { - throw new ElasticsearchException( - "policy [" + policy + "] for index [" + index.getName() + "] failed on step [" + startStep.getKey() + "].", e); + public void handleFailure(String source, Exception e) { + logger.warn(new ParameterizedMessage("policy [{}] for index [{}] failed on step [{}].", policy, index, startStep.getKey()), e); } private ClusterState moveToErrorStep(final ClusterState state, Step.StepKey currentStepKey, Exception cause) throws IOException { this.failure = cause; - logger.error("policy [{}] for index [{}] failed on cluster state step [{}]. Moving to ERROR step", policy, index.getName(), + logger.warn("policy [{}] for index [{}] failed on cluster state step [{}]. Moving to ERROR step", policy, index.getName(), currentStepKey); return IndexLifecycleTransition.moveClusterStateToErrorStep(index, state, cause, nowSupplier, policyStepsRegistry::getStep); } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + ExecuteStepsUpdateTask that = (ExecuteStepsUpdateTask) o; + return policy.equals(that.policy) && index.equals(that.index) + && Objects.equals(startStep, that.startStep); + } + + @Override + public int hashCode() { + return Objects.hash(policy, index, startStep); + } } diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycleClusterStateUpdateTask.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycleClusterStateUpdateTask.java new file mode 100644 index 0000000000000..a3b5622a5670c --- /dev/null +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycleClusterStateUpdateTask.java @@ -0,0 +1,62 @@ +/* + * 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.ilm; + +import org.elasticsearch.action.ActionListener; +import org.elasticsearch.cluster.ClusterState; +import org.elasticsearch.cluster.ClusterStateUpdateTask; +import org.elasticsearch.common.util.concurrent.ListenableFuture; + +/** + * Base class for index lifecycle cluster state update tasks that requires implementing {@code equals} and {@code hashCode} to allow + * for these tasks to be deduplicated by {@link IndexLifecycleRunner}. + */ +public abstract class IndexLifecycleClusterStateUpdateTask extends ClusterStateUpdateTask { + + private final ListenableFuture listener = new ListenableFuture<>(); + + @Override + public final void clusterStateProcessed(String source, ClusterState oldState, ClusterState newState) { + listener.onResponse(null); + onClusterStateProcessed(source, oldState, newState); + } + + @Override + public final void onFailure(String source, Exception e) { + listener.onFailure(e); + handleFailure(source, e); + } + + /** + * Add a listener that is resolved once this update has been processed or failed and before either the + * {@link #onClusterStateProcessed(String, ClusterState, ClusterState)} or the {@link #handleFailure(String, Exception)} hooks are + * executed. + */ + public final void addListener(ActionListener listener) { + this.listener.addListener(listener); + } + + /** + * This method is functionally the same as {@link ClusterStateUpdateTask#clusterStateProcessed(String, ClusterState, ClusterState)} + * and implementations can override it as they would override {@code ClusterStateUpdateTask#clusterStateProcessed}. + */ + protected void onClusterStateProcessed(String source, ClusterState oldState, ClusterState newState) { + } + + @Override + public abstract boolean equals(Object other); + + @Override + public abstract int hashCode(); + + /** + * This method is functionally the same as {@link ClusterStateUpdateTask#onFailure(String, Exception)} and implementations can override + * it as they would override {@code ClusterStateUpdateTask#onFailure}. + */ + protected abstract void handleFailure(String source, Exception e); +} diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycleRunner.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycleRunner.java index f61934ff4693e..d82437691b916 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycleRunner.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycleRunner.java @@ -12,6 +12,7 @@ import org.elasticsearch.action.ActionListener; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.ClusterStateObserver; +import org.elasticsearch.cluster.ClusterStateTaskConfig; import org.elasticsearch.cluster.ClusterStateUpdateTask; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.cluster.metadata.Metadata; @@ -35,7 +36,10 @@ import org.elasticsearch.xpack.ilm.history.ILMHistoryItem; import org.elasticsearch.xpack.ilm.history.ILMHistoryStore; +import java.util.Collections; +import java.util.HashSet; import java.util.Locale; +import java.util.Set; import java.util.function.LongSupplier; import static org.elasticsearch.xpack.core.ilm.LifecycleSettings.LIFECYCLE_ORIGINATION_DATE; @@ -374,7 +378,7 @@ void runPolicyAfterStateChange(String policy, IndexMetadata indexMetadata) { } } else if (currentStep instanceof ClusterStateActionStep || currentStep instanceof ClusterStateWaitStep) { logger.debug("[{}] running policy with current-step [{}]", indexMetadata.getIndex().getName(), currentStep.getKey()); - clusterService.submitStateUpdateTask(String.format(Locale.ROOT, "ilm-execute-cluster-state-steps [%s]", currentStep), + submitUnlessAlreadyQueued(String.format(Locale.ROOT, "ilm-execute-cluster-state-steps [%s]", currentStep), new ExecuteStepsUpdateTask(policy, indexMetadata.getIndex(), currentStep, stepRegistry, this, nowSupplier)); } else { logger.trace("[{}] ignoring step execution from cluster state change event [{}]", index, currentStep.getKey()); @@ -387,7 +391,7 @@ void runPolicyAfterStateChange(String policy, IndexMetadata indexMetadata) { */ private void moveToStep(Index index, String policy, Step.StepKey currentStepKey, Step.StepKey newStepKey) { logger.debug("[{}] moving to step [{}] {} -> {}", index.getName(), policy, currentStepKey, newStepKey); - clusterService.submitStateUpdateTask( + submitUnlessAlreadyQueued( String.format(Locale.ROOT, "ilm-move-to-step {policy [%s], index [%s], currentStep [%s], nextStep [%s]}", policy, index.getName(), currentStepKey, newStepKey), new MoveToNextStepUpdateTask(index, policy, currentStepKey, newStepKey, nowSupplier, stepRegistry, clusterState -> @@ -420,7 +424,7 @@ private void moveToErrorStep(Index index, String policy, Step.StepKey currentSte * changing other execution state. */ private void setStepInfo(Index index, String policy, @Nullable Step.StepKey currentStepKey, ToXContentObject stepInfo) { - clusterService.submitStateUpdateTask( + submitUnlessAlreadyQueued( String.format(Locale.ROOT, "ilm-set-step-info {policy [%s], index [%s], currentStep [%s]}", policy, index.getName(), currentStepKey), new SetStepInfoUpdateTask(index, policy, currentStepKey, stepInfo)); @@ -504,4 +508,27 @@ void registerFailedOperation(IndexMetadata indexMetadata, Exception failure) { LifecycleExecutionState.fromIndexMetadata(indexMetadata), failure)); } + + private final Set executingTasks = Collections.synchronizedSet(new HashSet<>()); + + /** + * Tracks already executing {@link IndexLifecycleClusterStateUpdateTask} tasks in {@link #executingTasks} to prevent queueing up + * duplicate cluster state updates. + * TODO: refactor ILM logic so that this is not required any longer. It is unreasonably expensive to only filter out duplicate tasks at + * this point given how these tasks are mostly set up on the cluster state applier thread. + * + * @param source source string as used in {@link ClusterService#submitStateUpdateTask(String, ClusterStateTaskConfig)} + * @param task task to submit unless already tracked in {@link #executingTasks}. + */ + private void submitUnlessAlreadyQueued(String source, IndexLifecycleClusterStateUpdateTask task) { + if (executingTasks.add(task)) { + task.addListener(ActionListener.wrap(() -> { + final boolean removed = executingTasks.remove(task); + assert removed : "tried to unregister unknown task [" + task + "]"; + })); + clusterService.submitStateUpdateTask(source, task); + } else { + logger.trace("skipped redundant execution of [{}]", source); + } + } } diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycleService.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycleService.java index 715c42f7c8e2c..1c879a623db1a 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycleService.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycleService.java @@ -77,8 +77,8 @@ public class IndexLifecycleService private final PolicyStepsRegistry policyRegistry; private final IndexLifecycleRunner lifecycleRunner; private final Settings settings; - private ClusterService clusterService; - private LongSupplier nowSupplier; + private final ClusterService clusterService; + private final LongSupplier nowSupplier; private SchedulerEngine.Job scheduledJob; public IndexLifecycleService(Settings settings, Client client, ClusterService clusterService, ThreadPool threadPool, Clock clock, diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/MoveToNextStepUpdateTask.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/MoveToNextStepUpdateTask.java index e30144e14f8d0..03efd7b2c3150 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/MoveToNextStepUpdateTask.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/MoveToNextStepUpdateTask.java @@ -8,9 +8,8 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.elasticsearch.ElasticsearchException; +import org.apache.logging.log4j.message.ParameterizedMessage; import org.elasticsearch.cluster.ClusterState; -import org.elasticsearch.cluster.ClusterStateUpdateTask; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.index.Index; @@ -18,10 +17,11 @@ import org.elasticsearch.xpack.core.ilm.LifecycleSettings; import org.elasticsearch.xpack.core.ilm.Step; +import java.util.Objects; import java.util.function.Consumer; import java.util.function.LongSupplier; -public class MoveToNextStepUpdateTask extends ClusterStateUpdateTask { +public class MoveToNextStepUpdateTask extends IndexLifecycleClusterStateUpdateTask { private static final Logger logger = LogManager.getLogger(MoveToNextStepUpdateTask.class); private final Index index; @@ -44,22 +44,6 @@ public MoveToNextStepUpdateTask(Index index, String policy, Step.StepKey current this.stateChangeConsumer = stateChangeConsumer; } - Index getIndex() { - return index; - } - - String getPolicy() { - return policy; - } - - Step.StepKey getCurrentStepKey() { - return currentStepKey; - } - - Step.StepKey getNextStepKey() { - return nextStepKey; - } - @Override public ClusterState execute(ClusterState currentState) { IndexMetadata indexMetadata = currentState.getMetadata().index(index); @@ -82,15 +66,36 @@ public ClusterState execute(ClusterState currentState) { } @Override - public void clusterStateProcessed(String source, ClusterState oldState, ClusterState newState) { + public void onClusterStateProcessed(String source, ClusterState oldState, ClusterState newState) { if (oldState.equals(newState) == false) { stateChangeConsumer.accept(newState); } } @Override - public void onFailure(String source, Exception e) { - throw new ElasticsearchException("policy [" + policy + "] for index [" + index.getName() + "] failed trying to move from step [" - + currentStepKey + "] to step [" + nextStepKey + "].", e); + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + MoveToNextStepUpdateTask that = (MoveToNextStepUpdateTask) o; + return index.equals(that.index) + && policy.equals(that.policy) + && currentStepKey.equals(that.currentStepKey) + && nextStepKey.equals(that.nextStepKey); + } + + @Override + public int hashCode() { + return Objects.hash(index, policy, currentStepKey, nextStepKey); + } + + @Override + public void handleFailure(String source, Exception e) { + logger.warn( + new ParameterizedMessage( + "policy [{}] for index [{}] failed trying to move from step [{}] to step [{}].", + policy, index, currentStepKey, nextStepKey + ), + e + ); } } diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/SetStepInfoUpdateTask.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/SetStepInfoUpdateTask.java index afd016ef2d78f..5d92d3a1038be 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/SetStepInfoUpdateTask.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/SetStepInfoUpdateTask.java @@ -12,7 +12,6 @@ import org.apache.logging.log4j.message.ParameterizedMessage; import org.elasticsearch.ElasticsearchException; import org.elasticsearch.cluster.ClusterState; -import org.elasticsearch.cluster.ClusterStateUpdateTask; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.ToXContentObject; @@ -25,7 +24,7 @@ import java.io.IOException; import java.util.Objects; -public class SetStepInfoUpdateTask extends ClusterStateUpdateTask { +public class SetStepInfoUpdateTask extends IndexLifecycleClusterStateUpdateTask { private static final Logger logger = LogManager.getLogger(SetStepInfoUpdateTask.class); @@ -78,9 +77,28 @@ public ClusterState execute(ClusterState currentState) throws IOException { } @Override - public void onFailure(String source, Exception e) { - logger.warn(new ParameterizedMessage("policy [{}] for index [{}] failed trying to set step info for step [{}].", - policy, index.getName(), currentStepKey), e); + public void handleFailure(String source, Exception e) { + logger.warn( + new ParameterizedMessage( + "policy [{}] for index [{}] failed trying to set step info for step [{}].", + policy, index, currentStepKey + ), + e + ); + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + SetStepInfoUpdateTask that = (SetStepInfoUpdateTask) o; + return index.equals(that.index) && policy.equals(that.policy) + && currentStepKey.equals(that.currentStepKey) && Objects.equals(stepInfo, that.stepInfo); + } + + @Override + public int hashCode() { + return Objects.hash(index, policy, currentStepKey, stepInfo); } public static class ExceptionWrapper implements ToXContentObject { diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/slm/SnapshotLifecycleTask.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/slm/SnapshotLifecycleTask.java index b50bbd7c586b8..f4ef567dc6dae 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/slm/SnapshotLifecycleTask.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/slm/SnapshotLifecycleTask.java @@ -48,7 +48,7 @@ public class SnapshotLifecycleTask implements SchedulerEngine.Listener { - private static Logger logger = LogManager.getLogger(SnapshotLifecycleTask.class); + private static final Logger logger = LogManager.getLogger(SnapshotLifecycleTask.class); private final Client client; private final ClusterService clusterService; diff --git a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/ExecuteStepsUpdateTaskTests.java b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/ExecuteStepsUpdateTaskTests.java index 7f3eca69d02b4..a43e0458f6f0e 100644 --- a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/ExecuteStepsUpdateTaskTests.java +++ b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/ExecuteStepsUpdateTaskTests.java @@ -7,7 +7,6 @@ package org.elasticsearch.xpack.ilm; -import org.elasticsearch.ElasticsearchException; import org.elasticsearch.Version; import org.elasticsearch.client.Client; import org.elasticsearch.cluster.ClusterName; @@ -250,11 +249,7 @@ public void testOnFailure() throws IOException { long now = randomNonNegativeLong(); ExecuteStepsUpdateTask task = new ExecuteStepsUpdateTask(mixedPolicyName, index, startStep, policyStepsRegistry, null, () -> now); Exception expectedException = new RuntimeException(); - ElasticsearchException exception = expectThrows(ElasticsearchException.class, - () -> task.onFailure(randomAlphaOfLength(10), expectedException)); - assertEquals("policy [" + mixedPolicyName + "] for index [" + index.getName() + "] failed on step [" + startStep.getKey() + "].", - exception.getMessage()); - assertSame(expectedException, exception.getCause()); + task.onFailure(randomAlphaOfLength(10), expectedException); } public void testClusterActionStepThrowsException() throws IOException { diff --git a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/IndexLifecycleRunnerTests.java b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/IndexLifecycleRunnerTests.java index 4ea09d7128537..0ad5e2d29992f 100644 --- a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/IndexLifecycleRunnerTests.java +++ b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/IndexLifecycleRunnerTests.java @@ -164,8 +164,7 @@ public void testRunPolicyPhaseCompleteWithMoreStepsPolicyStep() { runner.runPolicyAfterStateChange(policyName, indexMetadata); runner.runPeriodicStep(policyName, Metadata.builder().put(indexMetadata, true).build(), indexMetadata); - Mockito.verify(clusterService, times(2)).submitStateUpdateTask(any(), any()); - + Mockito.verify(clusterService, times(1)).submitStateUpdateTask(any(), any()); } public void testRunPolicyErrorStep() { diff --git a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/MoveToNextStepUpdateTaskTests.java b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/MoveToNextStepUpdateTaskTests.java index b1a3113260cea..098bf4902499a 100644 --- a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/MoveToNextStepUpdateTaskTests.java +++ b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/MoveToNextStepUpdateTaskTests.java @@ -7,7 +7,6 @@ package org.elasticsearch.xpack.ilm; import org.apache.lucene.util.SetOnce; -import org.elasticsearch.ElasticsearchException; import org.elasticsearch.Version; import org.elasticsearch.cluster.ClusterName; import org.elasticsearch.cluster.ClusterState; @@ -139,11 +138,7 @@ public void testOnFailure() { MoveToNextStepUpdateTask task = new MoveToNextStepUpdateTask(index, policy, currentStepKey, nextStepKey, () -> now, new AlwaysExistingStepRegistry(), state -> {}); Exception expectedException = new RuntimeException(); - ElasticsearchException exception = expectThrows(ElasticsearchException.class, - () -> task.onFailure(randomAlphaOfLength(10), expectedException)); - assertEquals("policy [" + policy + "] for index [" + index.getName() + "] failed trying to move from step [" + currentStepKey - + "] to step [" + nextStepKey + "].", exception.getMessage()); - assertSame(expectedException, exception.getCause()); + task.onFailure(randomAlphaOfLength(10), expectedException); } /** diff --git a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/SetStepInfoUpdateTaskTests.java b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/SetStepInfoUpdateTaskTests.java index 2d9a25ee57e59..1f757acb68ac0 100644 --- a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/SetStepInfoUpdateTaskTests.java +++ b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/SetStepInfoUpdateTaskTests.java @@ -126,7 +126,7 @@ public void testOnFailure() throws IllegalAccessException { "warning", SetStepInfoUpdateTask.class.getCanonicalName(), Level.WARN, - "*policy [" + policy + "] for index [" + index.getName() + "] failed trying to set step info for step [" + "*policy [" + policy + "] for index [" + index + "] failed trying to set step info for step [" + currentStepKey + "].")); final Logger taskLogger = LogManager.getLogger(SetStepInfoUpdateTask.class); From 4e845aa45b0da594fdc2c16fd04d57242b51314e Mon Sep 17 00:00:00 2001 From: Rene Groeschke Date: Wed, 29 Sep 2021 09:15:49 +0200 Subject: [PATCH 048/250] Simplify test artifact compile classpath (#78238) - This fixes having transitive compile only dependencies on the classpath for consumers of test artifacts - We remove compile dependencies from the testArtifact configuration dependencies here as this leaks implementation and compile only deps to consuming projects --- .../gradle/internal/InternalTestArtifactExtension.java | 2 -- x-pack/plugin/analytics/build.gradle | 6 +++--- x-pack/plugin/async-search/build.gradle | 2 ++ x-pack/plugin/async-search/qa/security/build.gradle | 1 + x-pack/plugin/build.gradle | 1 + x-pack/plugin/ccr/build.gradle | 1 + x-pack/plugin/eql/build.gradle | 2 ++ x-pack/plugin/eql/qa/common/build.gradle | 2 +- x-pack/plugin/eql/qa/correctness/build.gradle | 1 + x-pack/plugin/identity-provider/build.gradle | 10 +++++++--- .../identity-provider/qa/idp-rest-tests/build.gradle | 1 + x-pack/plugin/ilm/qa/multi-node/build.gradle | 1 + x-pack/plugin/ilm/qa/with-security/build.gradle | 1 + x-pack/plugin/ml/build.gradle | 3 +++ .../plugin/ml/qa/native-multi-node-tests/build.gradle | 7 +++++++ x-pack/plugin/monitoring/build.gradle | 4 ++-- x-pack/plugin/ql/build.gradle | 8 ++++---- .../plugin/repository-encrypted/qa/azure/build.gradle | 4 ++++ x-pack/plugin/repository-encrypted/qa/gcs/build.gradle | 5 +++++ x-pack/plugin/repository-encrypted/qa/s3/build.gradle | 4 ++++ x-pack/plugin/security/build.gradle | 3 +++ x-pack/plugin/security/cli/build.gradle | 3 ++- x-pack/plugin/security/qa/security-basic/build.gradle | 1 + x-pack/plugin/security/qa/security-trial/build.gradle | 2 ++ .../security/qa/smoke-test-all-realms/build.gradle | 1 + x-pack/plugin/transform/build.gradle | 4 +++- .../plugin/transform/qa/multi-node-tests/build.gradle | 1 + .../plugin/transform/qa/single-node-tests/build.gradle | 1 + x-pack/plugin/watcher/build.gradle | 3 +++ x-pack/qa/evil-tests/build.gradle | 10 ++++++++++ x-pack/qa/reindex-tests-with-security/build.gradle | 3 ++- x-pack/qa/runtime-fields/with-security/build.gradle | 1 + x-pack/qa/security-tools-tests/build.gradle | 2 ++ x-pack/qa/third-party/active-directory/build.gradle | 1 + 34 files changed, 84 insertions(+), 18 deletions(-) diff --git a/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/InternalTestArtifactExtension.java b/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/InternalTestArtifactExtension.java index 4989348da03af..c87f29698d687 100644 --- a/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/InternalTestArtifactExtension.java +++ b/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/InternalTestArtifactExtension.java @@ -39,8 +39,6 @@ public void registerTestArtifactFromSourceSet(SourceSet sourceSet) { featureSpec.disablePublication(); }); - Configuration testApiElements = project.getConfigurations().getByName(sourceSet.getApiElementsConfigurationName()); - testApiElements.extendsFrom(project.getConfigurations().getByName(sourceSet.getCompileClasspathConfigurationName())); DependencyHandler dependencies = project.getDependencies(); project.getPlugins().withType(JavaPlugin.class, javaPlugin -> { Dependency projectDependency = dependencies.create(project); diff --git a/x-pack/plugin/analytics/build.gradle b/x-pack/plugin/analytics/build.gradle index 50a87c35b439d..3f1ba843af178 100644 --- a/x-pack/plugin/analytics/build.gradle +++ b/x-pack/plugin/analytics/build.gradle @@ -8,10 +8,10 @@ esplugin { archivesBaseName = 'x-pack-analytics' dependencies { - compileOnly project(":server") - + api 'org.apache.commons:commons-math3:3.6.1' compileOnly project(path: xpackModule('core')) + compileOnly project(":server") testImplementation(testArtifact(project(xpackModule('core')))) - api 'org.apache.commons:commons-math3:3.6.1' + testImplementation(project(":client:rest-high-level")) } diff --git a/x-pack/plugin/async-search/build.gradle b/x-pack/plugin/async-search/build.gradle index 1116ea05b9758..134cdd0f92748 100644 --- a/x-pack/plugin/async-search/build.gradle +++ b/x-pack/plugin/async-search/build.gradle @@ -16,6 +16,8 @@ dependencies { compileOnly project(path: xpackModule('core')) testImplementation(testArtifact(project(xpackModule('core')))) testImplementation project(path: xpackModule('async')) + + internalClusterTestImplementation project(":modules:reindex") } diff --git a/x-pack/plugin/async-search/qa/security/build.gradle b/x-pack/plugin/async-search/qa/security/build.gradle index e814b9c95581d..0ae64a3bd81d4 100644 --- a/x-pack/plugin/async-search/qa/security/build.gradle +++ b/x-pack/plugin/async-search/qa/security/build.gradle @@ -4,6 +4,7 @@ dependencies { javaRestTestImplementation(testArtifact(project(xpackModule('core')))) javaRestTestImplementation project(xpackModule('async-search')) javaRestTestImplementation project(':test:framework') + javaRestTestImplementation project(":client:rest-high-level") } testClusters.configureEach { diff --git a/x-pack/plugin/build.gradle b/x-pack/plugin/build.gradle index ada3688e85aa0..8c58b406cc37d 100644 --- a/x-pack/plugin/build.gradle +++ b/x-pack/plugin/build.gradle @@ -13,6 +13,7 @@ archivesBaseName = 'x-pack' dependencies { testImplementation project(xpackModule('core')) testImplementation(testArtifact(project(xpackModule('core')))) + testImplementation project(':test:framework') } // let the yamlRestTests see the classpath of test diff --git a/x-pack/plugin/ccr/build.gradle b/x-pack/plugin/ccr/build.gradle index b6e9319776489..e985d4dcfefd7 100644 --- a/x-pack/plugin/ccr/build.gradle +++ b/x-pack/plugin/ccr/build.gradle @@ -33,6 +33,7 @@ dependencies { compileOnly project(path: xpackModule('core')) testImplementation(testArtifact(project(xpackModule('core')))) testImplementation(testArtifact(project(xpackModule('monitoring')))) + testImplementation(project(":modules:analysis-common")) } tasks.named("testingConventions").configure { diff --git a/x-pack/plugin/eql/build.gradle b/x-pack/plugin/eql/build.gradle index 5ef76c21ec580..03f7671d5abdd 100644 --- a/x-pack/plugin/eql/build.gradle +++ b/x-pack/plugin/eql/build.gradle @@ -31,6 +31,8 @@ dependencies { testImplementation project(path: ':plugins:transport-nio') // for http in RestEqlCancellationIT testImplementation 'io.ous:jtoml:2.0.0' + + internalClusterTestImplementation project(":client:rest-high-level") } diff --git a/x-pack/plugin/eql/qa/common/build.gradle b/x-pack/plugin/eql/qa/common/build.gradle index a6962d4fa3f75..b085678da26cd 100644 --- a/x-pack/plugin/eql/qa/common/build.gradle +++ b/x-pack/plugin/eql/qa/common/build.gradle @@ -6,7 +6,7 @@ dependencies { api project(path: xpackModule('core')) api(testArtifact(project(xpackModule('core')))) api project(xpackModule('ql:test-fixtures')) - + implementation project(":client:rest-high-level") // TOML parser for EqlActionIT tests api 'io.ous:jtoml:2.0.0' } diff --git a/x-pack/plugin/eql/qa/correctness/build.gradle b/x-pack/plugin/eql/qa/correctness/build.gradle index 96d238be7ef37..04a638791a22e 100644 --- a/x-pack/plugin/eql/qa/correctness/build.gradle +++ b/x-pack/plugin/eql/qa/correctness/build.gradle @@ -10,6 +10,7 @@ dependencies { javaRestTestImplementation project(':test:framework') javaRestTestImplementation(testArtifact(project(xpackModule('core')))) javaRestTestImplementation project(xpackModule('ql:test-fixtures')) + javaRestTestImplementation project(":client:rest-high-level") javaRestTestImplementation 'io.ous:jtoml:2.0.0' } diff --git a/x-pack/plugin/identity-provider/build.gradle b/x-pack/plugin/identity-provider/build.gradle index 050fac69bcce8..930a575229aa7 100644 --- a/x-pack/plugin/identity-provider/build.gradle +++ b/x-pack/plugin/identity-provider/build.gradle @@ -13,9 +13,7 @@ archivesBaseName = 'x-pack-identity-provider' dependencies { compileOnly project(path: xpackModule('core')) - testImplementation(testArtifact(project(xpackModule('core')))) - // So that we can extend LocalStateCompositeXPackPlugin - testImplementation(testArtifact(project(xpackModule('security')))) + // the following are all SAML dependencies - might as well download the whole internet api "org.opensaml:opensaml-core:${versions.opensaml}" api "org.opensaml:opensaml-saml-api:${versions.opensaml}" @@ -52,6 +50,12 @@ dependencies { testImplementation 'org.elasticsearch:securemock:1.2' testImplementation "org.elasticsearch:mocksocket:${versions.mocksocket}" + testImplementation(testArtifact(project(xpackModule('core')))) + // So that we can extend LocalStateCompositeXPackPlugin + testImplementation(testArtifact(project(xpackModule('security')))) + testImplementation project(':modules:lang-mustache') + internalClusterTestImplementation project(":modules:analysis-common") + } tasks.named("dependencyLicenses").configure { diff --git a/x-pack/plugin/identity-provider/qa/idp-rest-tests/build.gradle b/x-pack/plugin/identity-provider/qa/idp-rest-tests/build.gradle index 2640317e0ba14..42ad771145117 100644 --- a/x-pack/plugin/identity-provider/qa/idp-rest-tests/build.gradle +++ b/x-pack/plugin/identity-provider/qa/idp-rest-tests/build.gradle @@ -5,6 +5,7 @@ dependencies { javaRestTestImplementation(testArtifact(project(xpackModule('core')))) //TODO: update javaRestTests to not rely on any code that it is testing javaRestTestImplementation project(path: xpackModule('identity-provider')) + javaRestTestImplementation project(":client:rest-high-level") } testClusters.configureEach { diff --git a/x-pack/plugin/ilm/qa/multi-node/build.gradle b/x-pack/plugin/ilm/qa/multi-node/build.gradle index 03fd419c21697..cf314f88f5841 100644 --- a/x-pack/plugin/ilm/qa/multi-node/build.gradle +++ b/x-pack/plugin/ilm/qa/multi-node/build.gradle @@ -5,6 +5,7 @@ apply plugin: 'elasticsearch.internal-java-rest-test' dependencies { javaRestTestImplementation(testArtifact(project(xpackModule('core')))) + javaRestTestImplementation project(":client:rest-high-level") } File repoDir = file("$buildDir/testclusters/repo") diff --git a/x-pack/plugin/ilm/qa/with-security/build.gradle b/x-pack/plugin/ilm/qa/with-security/build.gradle index 29ec940ce600b..2599c4977e3e4 100644 --- a/x-pack/plugin/ilm/qa/with-security/build.gradle +++ b/x-pack/plugin/ilm/qa/with-security/build.gradle @@ -3,6 +3,7 @@ apply plugin: 'elasticsearch.authenticated-testclusters' dependencies { javaRestTestImplementation(testArtifact(project(xpackModule('core')))) + javaRestTestImplementation project(":client:rest-high-level") } testClusters.configureEach { diff --git a/x-pack/plugin/ml/build.gradle b/x-pack/plugin/ml/build.gradle index d06ba65ebbb30..28245cd949b94 100644 --- a/x-pack/plugin/ml/build.gradle +++ b/x-pack/plugin/ml/build.gradle @@ -62,7 +62,10 @@ dependencies { testImplementation project(path: xpackModule('ilm')) testImplementation project(path: xpackModule('shutdown')) testImplementation project(path: xpackModule('data-streams')) + testImplementation project(path: xpackModule('monitoring')) testImplementation project(':modules:ingest-common') + testImplementation project(':modules:reindex') + testImplementation project(':modules:analysis-common') // This should not be here testImplementation(testArtifact(project(xpackModule('security')))) // ml deps diff --git a/x-pack/plugin/ml/qa/native-multi-node-tests/build.gradle b/x-pack/plugin/ml/qa/native-multi-node-tests/build.gradle index cfbb7310547b2..9ec7ee72f7848 100644 --- a/x-pack/plugin/ml/qa/native-multi-node-tests/build.gradle +++ b/x-pack/plugin/ml/qa/native-multi-node-tests/build.gradle @@ -4,9 +4,16 @@ apply plugin: 'elasticsearch.internal-java-rest-test' dependencies { javaRestTestImplementation(testArtifact(project(xpackModule('core')))) javaRestTestImplementation(testArtifact(project(xpackModule('ml')))) + javaRestTestImplementation(testArtifact(project(xpackModule('security')))) javaRestTestImplementation project(path: ':modules:ingest-common') + javaRestTestImplementation project(path: ':modules:reindex') + javaRestTestImplementation project(path: ':modules:transport-netty4') + javaRestTestImplementation project(path: xpackModule('autoscaling')) javaRestTestImplementation project(path: xpackModule('data-streams')) + javaRestTestImplementation project(path: xpackModule('ilm')) + javaRestTestImplementation project(path: xpackModule('monitoring')) javaRestTestImplementation project(path: xpackModule('transform')) + javaRestTestImplementation project(":client:rest-high-level") } // location for keys and certificates diff --git a/x-pack/plugin/monitoring/build.gradle b/x-pack/plugin/monitoring/build.gradle index 647b0c04dd0a7..c1f68a63dfe1f 100644 --- a/x-pack/plugin/monitoring/build.gradle +++ b/x-pack/plugin/monitoring/build.gradle @@ -12,17 +12,17 @@ archivesBaseName = 'x-pack-monitoring' dependencies { compileOnly project(path: xpackModule('core')) - testImplementation(testArtifact(project(xpackModule('core')))) // monitoring deps api project(':client:rest') api project(':client:sniffer') // baz - this goes away after we separate out the actions #27759 + testImplementation project(":modules:analysis-common") testImplementation project(xpackModule('watcher')) - testImplementation project(xpackModule('ilm')) testImplementation project(xpackModule('data-streams')) + testImplementation(testArtifact(project(xpackModule('core')))) } tasks.named("dependencyLicenses").configure { diff --git a/x-pack/plugin/ql/build.gradle b/x-pack/plugin/ql/build.gradle index 4f5128b7d0e72..81ef6a52be28e 100644 --- a/x-pack/plugin/ql/build.gradle +++ b/x-pack/plugin/ql/build.gradle @@ -15,11 +15,11 @@ ext { archivesBaseName = 'x-pack-ql' dependencies { + api "org.antlr:antlr4-runtime:${antlrVersion}" compileOnly project(path: xpackModule('core')) - testImplementation project(':test:framework') - testImplementation(testArtifact(project(xpackModule('core')))) - testImplementation(project(xpackModule('ql:test-fixtures'))) { + testApi(project(xpackModule('ql:test-fixtures'))) { exclude group: 'org.elasticsearch.plugin', module: 'ql' } - api "org.antlr:antlr4-runtime:${antlrVersion}" + testImplementation project(':test:framework') + testImplementation(testArtifact(project(xpackModule('core')))) } diff --git a/x-pack/plugin/repository-encrypted/qa/azure/build.gradle b/x-pack/plugin/repository-encrypted/qa/azure/build.gradle index 8158ecbe3ddec..9f1cfbd781a95 100644 --- a/x-pack/plugin/repository-encrypted/qa/azure/build.gradle +++ b/x-pack/plugin/repository-encrypted/qa/azure/build.gradle @@ -4,4 +4,8 @@ apply plugin: 'elasticsearch.java' dependencies { internalClusterTestImplementation testArtifact(project(':plugins:repository-azure'), 'internalClusterTest') internalClusterTestImplementation testArtifact(project(':x-pack:plugin:repository-encrypted'), 'test') + internalClusterTestImplementation project(':server') + internalClusterTestImplementation project(':test:framework') + internalClusterTestImplementation project(':x-pack:plugin:core') + internalClusterTestImplementation testArtifact(project(':x-pack:plugin:core')) } diff --git a/x-pack/plugin/repository-encrypted/qa/gcs/build.gradle b/x-pack/plugin/repository-encrypted/qa/gcs/build.gradle index 9978841184430..1653332f41642 100644 --- a/x-pack/plugin/repository-encrypted/qa/gcs/build.gradle +++ b/x-pack/plugin/repository-encrypted/qa/gcs/build.gradle @@ -4,4 +4,9 @@ apply plugin: 'elasticsearch.java' dependencies { internalClusterTestImplementation testArtifact(project(':plugins:repository-gcs'), 'internalClusterTest') internalClusterTestImplementation testArtifact(project(':x-pack:plugin:repository-encrypted'), 'test') + internalClusterTestImplementation project(':server') + internalClusterTestImplementation project(':test:framework') + internalClusterTestImplementation project(':x-pack:plugin:core') + internalClusterTestImplementation testArtifact(project(':x-pack:plugin:core')) + } diff --git a/x-pack/plugin/repository-encrypted/qa/s3/build.gradle b/x-pack/plugin/repository-encrypted/qa/s3/build.gradle index da65d028f7981..b82dc1cf16588 100644 --- a/x-pack/plugin/repository-encrypted/qa/s3/build.gradle +++ b/x-pack/plugin/repository-encrypted/qa/s3/build.gradle @@ -4,4 +4,8 @@ apply plugin: 'elasticsearch.java' dependencies { internalClusterTestImplementation testArtifact(project(':plugins:repository-s3'), 'internalClusterTest') internalClusterTestImplementation testArtifact(project(':x-pack:plugin:repository-encrypted'), 'test') + internalClusterTestImplementation project(':server') + internalClusterTestImplementation project(':test:framework') + internalClusterTestImplementation project(':x-pack:plugin:core') + internalClusterTestImplementation testArtifact(project(':x-pack:plugin:core')) } diff --git a/x-pack/plugin/security/build.gradle b/x-pack/plugin/security/build.gradle index 054feb162f7df..3d78c8362c83a 100644 --- a/x-pack/plugin/security/build.gradle +++ b/x-pack/plugin/security/build.gradle @@ -22,6 +22,9 @@ dependencies { testImplementation project(path: xpackModule('spatial')) testImplementation project(path: ':modules:percolator') testImplementation project(path: xpackModule('sql:sql-action')) + testImplementation project(path: ':modules:analysis-common') + testImplementation project(path: ':modules:reindex') + testImplementation project(":client:rest-high-level") testImplementation(testArtifact(project(xpackModule('core')))) internalClusterTestImplementation(testArtifact(project(xpackModule('core')))) diff --git a/x-pack/plugin/security/cli/build.gradle b/x-pack/plugin/security/cli/build.gradle index 738dcaf338de4..1bb98caf51c4b 100644 --- a/x-pack/plugin/security/cli/build.gradle +++ b/x-pack/plugin/security/cli/build.gradle @@ -16,7 +16,8 @@ dependencies { } testRuntimeOnly "com.google.guava:guava:${versions.jimfs_guava}" testImplementation project(":test:framework") -testImplementation(testArtifact(project(xpackModule('core'))))} + testImplementation(testArtifact(project(xpackModule('core')))) +} tasks.named("dependencyLicenses").configure { mapping from: /bc.*/, to: 'bouncycastle' diff --git a/x-pack/plugin/security/qa/security-basic/build.gradle b/x-pack/plugin/security/qa/security-basic/build.gradle index 932e3fcedd968..ee78cf4e2097f 100644 --- a/x-pack/plugin/security/qa/security-basic/build.gradle +++ b/x-pack/plugin/security/qa/security-basic/build.gradle @@ -6,6 +6,7 @@ import org.elasticsearch.gradle.internal.info.BuildParams dependencies { javaRestTestImplementation(testArtifact(project(xpackModule('security')))) javaRestTestImplementation(testArtifact(project(xpackModule('core')))) + javaRestTestImplementation project(":client:rest-high-level") } if (BuildParams.inFipsJvm){ diff --git a/x-pack/plugin/security/qa/security-trial/build.gradle b/x-pack/plugin/security/qa/security-trial/build.gradle index e9e8b47fbf86f..6910525b56a90 100644 --- a/x-pack/plugin/security/qa/security-trial/build.gradle +++ b/x-pack/plugin/security/qa/security-trial/build.gradle @@ -3,6 +3,8 @@ apply plugin: 'elasticsearch.internal-java-rest-test' dependencies { javaRestTestImplementation project(path: xpackModule('core')) javaRestTestImplementation(testArtifact(project(xpackModule('security')))) + javaRestTestImplementation(testArtifact(project(xpackModule('core')))) + javaRestTestImplementation project(":client:rest-high-level") } testClusters.matching { it.name == 'javaRestTest' }.configureEach { diff --git a/x-pack/plugin/security/qa/smoke-test-all-realms/build.gradle b/x-pack/plugin/security/qa/smoke-test-all-realms/build.gradle index a159d4857cda4..1f1f4f688f6a2 100644 --- a/x-pack/plugin/security/qa/smoke-test-all-realms/build.gradle +++ b/x-pack/plugin/security/qa/smoke-test-all-realms/build.gradle @@ -11,6 +11,7 @@ apply plugin: 'elasticsearch.internal-java-rest-test' dependencies { javaRestTestImplementation(testArtifact(project(xpackModule('security')))) javaRestTestImplementation(testArtifact(project(xpackModule('core')))) + javaRestTestImplementation(project(":client:rest-high-level")) } testClusters.matching { it.name == 'javaRestTest' }.configureEach { diff --git a/x-pack/plugin/transform/build.gradle b/x-pack/plugin/transform/build.gradle index 28b4e9e342bc5..2bf28b5a0e6ac 100644 --- a/x-pack/plugin/transform/build.gradle +++ b/x-pack/plugin/transform/build.gradle @@ -9,12 +9,14 @@ esplugin { dependencies { compileOnly project(":server") - compileOnly project(path: xpackModule('core')) + testImplementation(testArtifact(project(xpackModule('core')))) testImplementation project(path: xpackModule('analytics')) testImplementation project(path: ':modules:aggs-matrix-stats') testImplementation project(path: xpackModule('spatial')) + + internalClusterTestImplementation project(":modules:reindex") } addQaCheckDependencies() diff --git a/x-pack/plugin/transform/qa/multi-node-tests/build.gradle b/x-pack/plugin/transform/qa/multi-node-tests/build.gradle index 5b2def3c01800..d88b7c9493e9d 100644 --- a/x-pack/plugin/transform/qa/multi-node-tests/build.gradle +++ b/x-pack/plugin/transform/qa/multi-node-tests/build.gradle @@ -3,6 +3,7 @@ apply plugin: 'elasticsearch.internal-java-rest-test' dependencies { javaRestTestImplementation(testArtifact(project(xpackModule('core')))) javaRestTestImplementation project(path: xpackModule('transform')) + javaRestTestImplementation project(":client:rest-high-level") } // location for keys and certificates diff --git a/x-pack/plugin/transform/qa/single-node-tests/build.gradle b/x-pack/plugin/transform/qa/single-node-tests/build.gradle index c28d6561aebc3..be073f64a2ef5 100644 --- a/x-pack/plugin/transform/qa/single-node-tests/build.gradle +++ b/x-pack/plugin/transform/qa/single-node-tests/build.gradle @@ -4,6 +4,7 @@ apply plugin: 'elasticsearch.internal-java-rest-test' dependencies { javaRestTestImplementation(testArtifact(project(xpackModule('core')))) javaRestTestImplementation project(path: xpackModule('transform')) + javaRestTestImplementation project(":client:rest-high-level") } testClusters.configureEach { diff --git a/x-pack/plugin/watcher/build.gradle b/x-pack/plugin/watcher/build.gradle index 165d7497c213f..bcad5dbca8579 100644 --- a/x-pack/plugin/watcher/build.gradle +++ b/x-pack/plugin/watcher/build.gradle @@ -27,6 +27,7 @@ dependencies { testImplementation(testArtifact(project(xpackModule('core')))) testImplementation project(xpackModule('ilm')) testImplementation project(xpackModule('data-streams')) + testImplementation project(':modules:lang-mustache') // watcher deps api 'com.googlecode.owasp-java-html-sanitizer:owasp-java-html-sanitizer:20191001.1' @@ -40,6 +41,8 @@ dependencies { testImplementation 'org.subethamail:subethasmtp:3.1.7' // needed for subethasmtp, has @GuardedBy annotation testImplementation 'com.google.code.findbugs:jsr305:3.0.2' + + internalClusterTestImplementation project(":modules:analysis-common") } // classes are missing, e.g. com.ibm.icu.lang.UCharacter diff --git a/x-pack/qa/evil-tests/build.gradle b/x-pack/qa/evil-tests/build.gradle index 1e60e65b18b56..fe379c2ae6892 100644 --- a/x-pack/qa/evil-tests/build.gradle +++ b/x-pack/qa/evil-tests/build.gradle @@ -1,6 +1,16 @@ apply plugin: 'elasticsearch.standalone-test' dependencies { + testImplementation(project(xpackModule('core'))) + testImplementation("org.apache.kerby:kerb-admin:1.1.1") + testImplementation("org.apache.kerby:kerb-client:1.1.1") + testImplementation("org.apache.kerby:kerb-common:1.1.1") + testImplementation("org.apache.kerby:kerb-core:1.1.1") + testImplementation("org.apache.kerby:kerb-server:1.1.1") + testImplementation("org.apache.kerby:kerb-simplekdc:1.1.1") + testImplementation("org.apache.kerby:kerb-util:1.1.1") + testImplementation("org.apache.kerby:kerby-config:1.1.1") + testImplementation(testArtifact(project(xpackModule('security')))) } diff --git a/x-pack/qa/reindex-tests-with-security/build.gradle b/x-pack/qa/reindex-tests-with-security/build.gradle index 2d002666b4377..28377da6325a7 100644 --- a/x-pack/qa/reindex-tests-with-security/build.gradle +++ b/x-pack/qa/reindex-tests-with-security/build.gradle @@ -8,7 +8,8 @@ apply plugin: 'elasticsearch.rest-resources' dependencies { testImplementation(testArtifact(project(xpackModule('core')))) testImplementation(testArtifact(project(xpackModule('security')))) - testImplementation project(path: ':modules:reindex') + testImplementation(project(':modules:reindex')) + testImplementation(project(":client:rest-high-level")) } tasks.named("forbiddenPatterns").configure { diff --git a/x-pack/qa/runtime-fields/with-security/build.gradle b/x-pack/qa/runtime-fields/with-security/build.gradle index 659c4f57f9c24..95a874014ccb2 100644 --- a/x-pack/qa/runtime-fields/with-security/build.gradle +++ b/x-pack/qa/runtime-fields/with-security/build.gradle @@ -3,6 +3,7 @@ apply plugin: 'elasticsearch.authenticated-testclusters' dependencies { javaRestTestImplementation(testArtifact(project(xpackModule('core')))) + javaRestTestImplementation project(":client:rest-high-level") } testClusters.configureEach { diff --git a/x-pack/qa/security-tools-tests/build.gradle b/x-pack/qa/security-tools-tests/build.gradle index ba66ac6a1d11e..130f482724198 100644 --- a/x-pack/qa/security-tools-tests/build.gradle +++ b/x-pack/qa/security-tools-tests/build.gradle @@ -1,7 +1,9 @@ apply plugin: 'elasticsearch.standalone-test' dependencies { + testImplementation project(xpackModule('core')) testImplementation project(xpackModule('security')) + testImplementation(testArtifact(project(xpackModule('core')))) testImplementation(testArtifact(project(xpackModule('security')))) testImplementation "com.google.jimfs:jimfs:${versions.jimfs}" testRuntimeOnly "com.google.guava:guava:${versions.jimfs_guava}" diff --git a/x-pack/qa/third-party/active-directory/build.gradle b/x-pack/qa/third-party/active-directory/build.gradle index 7f6f5d832d89d..f5c4e6d63d37c 100644 --- a/x-pack/qa/third-party/active-directory/build.gradle +++ b/x-pack/qa/third-party/active-directory/build.gradle @@ -2,6 +2,7 @@ apply plugin: 'elasticsearch.standalone-test' apply plugin: 'elasticsearch.test.fixtures' dependencies { + testImplementation project(xpackModule('core')) testImplementation project(xpackModule('security')) testImplementation(testArtifact(project(xpackModule('security'))))} From 07a2acac932cad33ac676c3bed38893defa059f2 Mon Sep 17 00:00:00 2001 From: David Turner Date: Wed, 29 Sep 2021 09:49:07 +0100 Subject: [PATCH 049/250] Improve docs for pre-release version compatibility (#78428) * Improve docs for pre-release version compatibility Follow-up to #78317 clarifying a couple of points: - a pre-release build can restore snapshots from released builds - compatibility applies if at least one of the local or remote cluster is a released build * Remote cluster build date nit --- .../modules/remote-clusters-shared.asciidoc | 14 ++++++++------ docs/reference/snapshot-restore/index.asciidoc | 17 ++++++++++------- docs/reference/upgrade.asciidoc | 16 ++++++++-------- 3 files changed, 26 insertions(+), 21 deletions(-) diff --git a/docs/reference/modules/remote-clusters-shared.asciidoc b/docs/reference/modules/remote-clusters-shared.asciidoc index 36985f20eb5af..077671d14207b 100644 --- a/docs/reference/modules/remote-clusters-shared.asciidoc +++ b/docs/reference/modules/remote-clusters-shared.asciidoc @@ -13,12 +13,14 @@ h| Remote cluster | 5.0->5.5 | 5.6 | 6.0->6.6 | 6.7 | 6.8 | 7.0 | 7.1->7.x |==== ifeval::["{release-state}"!="released"] -NOTE: This documentation is for {es} {version}, which is not yet released. The -above compatibility table only applies if the local or remote cluster is running -a released version of {es}. A local cluster running a pre-release build of {es} -can also communicate with remote clusters running the same pre-release build. -Running a mix of pre-release builds is unsupported and typically will not work, -even if the builds are the same version. +NOTE: This documentation is for {es} version {version}, which is not yet +released. The above compatibility table applies if both clusters are running a +released version of {es}, or if one of the clusters is running a released +version and the other is running a pre-release build with a later build date. A +cluster running a pre-release build of {es} can also communicate with remote +clusters running the same pre-release build. Running a mix of pre-release +builds is unsupported and typically will not work, even if the builds have the +same version number. endif::[] // end::remote-cluster-compatibility-matrix[] diff --git a/docs/reference/snapshot-restore/index.asciidoc b/docs/reference/snapshot-restore/index.asciidoc index 0f15ff4e5f071..94132aa96b8c7 100644 --- a/docs/reference/snapshot-restore/index.asciidoc +++ b/docs/reference/snapshot-restore/index.asciidoc @@ -96,16 +96,19 @@ The one caveat is that snapshots taken by {es} 2.0 can be restored in clusters r ifeval::["{release-state}"!="released"] [[snapshot-prerelease-build-compatibility]] -NOTE: This documentation is for {es} {version}, which is not yet released. The -compatibility table above applies only to snapshots taken in a released version -of {es}. If you're testing a pre-release build of {es} then you can also take -and restore snapshots as normal, but you must not use the same snapshot -repository with other builds of {es} even if the builds are the same version. +NOTE: This documentation is for {es} version {version}, which is not yet +released. The compatibility table above applies only to snapshots taken in a +released version of {es}. If you're testing a pre-release build of {es} then you +can still restore snapshots taken in earlier released builds as permitted by +this compatibility table. You can also take snapshots using your pre-release +build, and restore them using the same build. However once a pre-release build +of {es} has written to a snapshot repository you must not use the same +repository with other builds of {es}, even if the builds have the same version. Different pre-release builds of {es} may use different and incompatible repository layouts. If the repository layout is incompatible with the {es} build in use then taking and restoring snapshots may result in errors or may appear to -succeed having silently lost some data. You should discard the repository when -moving to a different build. +succeed having silently lost some data. You should discard your repository +before using a different build. endif::[] Each snapshot can contain indices created in various versions of {es}. This diff --git a/docs/reference/upgrade.asciidoc b/docs/reference/upgrade.asciidoc index 5c3d648023c3e..a5f77cc41947b 100644 --- a/docs/reference/upgrade.asciidoc +++ b/docs/reference/upgrade.asciidoc @@ -89,14 +89,14 @@ of the products in your Elastic Stack. For more information, see the ifeval::["{release-state}"!="released"] [[upgrade-pre-release]] -NOTE: This documentation is for {es} {version}, which is not yet released. You -may run a pre-release build of {es} for testing, and you may upgrade from an -earlier released version to a pre-release build of {es} {version} if permitted -by the compatibility table above, but upgrading from a pre-release build to -another build (whether released or not) is unsupported. Upgrading a pre-release -build may result in errors or may appear to succeed having silently lost some -data. You should discard the contents of a cluster running a pre-release build -when moving to a different build. +NOTE: This documentation is for {es} version {version}, which is not yet +released. You may run a pre-release build of {es} for testing, and you may +upgrade from an earlier released version to a pre-release build of {es} +{version} if permitted by the compatibility table above, but upgrading from a +pre-release build to another build (whether released or not) is unsupported. +Upgrading a pre-release build may result in errors or may appear to succeed +having silently lost some data. You should discard the contents of a cluster +running a pre-release build before using a different build. endif::[] -- From 2fdb5a8b7ee05c7d46420b91ccab47f15500f0e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Fern=C3=A1ndez=20Casta=C3=B1o?= Date: Wed, 29 Sep 2021 11:26:11 +0200 Subject: [PATCH 050/250] Fix SnapshotBasedRecoveryIT#testSnapshotBasedRecovery (#77134) Move the shard to a replica in an older version when the primary is located in the upgraded node during the first rolling restart round. Closes #76595 --- .../upgrades/SnapshotBasedRecoveryIT.java | 128 ++++++++++++++++-- 1 file changed, 117 insertions(+), 11 deletions(-) diff --git a/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/SnapshotBasedRecoveryIT.java b/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/SnapshotBasedRecoveryIT.java index 894c4dd101e4f..eb11d8b2264b5 100644 --- a/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/SnapshotBasedRecoveryIT.java +++ b/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/SnapshotBasedRecoveryIT.java @@ -8,12 +8,17 @@ package org.elasticsearch.upgrades; +import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpPost; +import org.elasticsearch.Version; import org.elasticsearch.client.Request; import org.elasticsearch.client.Response; import org.elasticsearch.cluster.metadata.IndexMetadata; +import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.support.XContentMapValues; +import org.elasticsearch.core.Nullable; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.repositories.blobstore.BlobStoreRepository; @@ -25,11 +30,13 @@ import static org.elasticsearch.cluster.routing.UnassignedInfo.INDEX_DELAYED_NODE_LEFT_TIMEOUT_SETTING; import static org.elasticsearch.cluster.routing.allocation.decider.MaxRetryAllocationDecider.SETTING_ALLOCATION_MAX_RETRY; -import static org.elasticsearch.upgrades.AbstractRollingTestCase.ClusterType.MIXED; +import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.allOf; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.greaterThanOrEqualTo; +import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.lessThan; +import static org.hamcrest.Matchers.notNullValue; public class SnapshotBasedRecoveryIT extends AbstractRollingTestCase { public void testSnapshotBasedRecovery() throws Exception { @@ -65,17 +72,41 @@ public void testSnapshotBasedRecovery() throws Exception { break; case MIXED: case UPGRADED: - // the following `if` for first round mixed was added as a selective test mute. Sometimes the primary shard ends - // on the upgraded node. This causes issues when removing and adding replicas, since then we cannot allocate to - // any of the old nodes. That is an issue only for the first mixed round, hence this check. - // Ideally we would find the reason the primary ends on the upgraded node and fix that (or figure out that it - // is all good). - // @AwaitsFix(bugUrl = https://github.com/elastic/elasticsearch/issues/76595) - if (CLUSTER_TYPE != MIXED || FIRST_MIXED_ROUND == false) { - // Drop replicas - updateIndexSettings(indexName, Settings.builder().put(IndexMetadata.INDEX_NUMBER_OF_REPLICAS_SETTING.getKey(), 0)); + if (FIRST_MIXED_ROUND) { + String upgradedNodeId = getUpgradedNodeId(); + + if (upgradedNodeId != null) { + updateIndexSettings( + indexName, + Settings.builder() + .put("index.routing.allocation.exclude._id", upgradedNodeId) + ); + } + + String primaryNodeId = getPrimaryNodeIdOfShard(indexName, 0); + Version primaryNodeVersion = getNodeVersion(primaryNodeId); + + // Sometimes the primary shard ends on the upgraded node (i.e. after a rebalance) + // This causes issues when removing and adding replicas, since then we cannot allocate to any of the old nodes. + // That is an issue only for the first mixed round. + // In that case we exclude the upgraded node from the shard allocation and cancel the shard to force moving + // the primary to a node in the old version, this allows adding replicas in the first mixed round. + if (primaryNodeVersion.after(UPGRADE_FROM_VERSION)) { + cancelShard(indexName, 0, primaryNodeId); + + String currentPrimaryNodeId = getPrimaryNodeIdOfShard(indexName, 0); + assertThat(getNodeVersion(currentPrimaryNodeId), is(equalTo(UPGRADE_FROM_VERSION))); + } + } else { + updateIndexSettings( + indexName, + Settings.builder() + .putNull("index.routing.allocation.exclude._id") + ); } - ensureGreen(indexName); + + // Drop replicas + updateIndexSettings(indexName, Settings.builder().put(IndexMetadata.INDEX_NUMBER_OF_REPLICAS_SETTING.getKey(), 0)); updateIndexSettings(indexName, Settings.builder().put(IndexMetadata.INDEX_NUMBER_OF_REPLICAS_SETTING.getKey(), 1)); ensureGreen(indexName); @@ -87,6 +118,81 @@ public void testSnapshotBasedRecovery() throws Exception { } } + @Nullable + private String getUpgradedNodeId() throws IOException { + Request request = new Request(HttpGet.METHOD_NAME, "_nodes/_all"); + Response response = client().performRequest(request); + Map responseMap = responseAsMap(response); + Map> nodes = extractValue(responseMap, "nodes"); + for (Map.Entry> nodeInfoEntry : nodes.entrySet()) { + Version nodeVersion = Version.fromString(extractValue(nodeInfoEntry.getValue(), "version")); + if (nodeVersion.after(UPGRADE_FROM_VERSION)) { + return nodeInfoEntry.getKey(); + } + } + return null; + } + + private Version getNodeVersion(String primaryNodeId) throws IOException { + Request request = new Request(HttpGet.METHOD_NAME, "_nodes/" + primaryNodeId); + Response response = client().performRequest(request); + String nodeVersion = extractValue(responseAsMap(response), "nodes." + primaryNodeId + ".version"); + return Version.fromString(nodeVersion); + } + + private String getPrimaryNodeIdOfShard(String indexName, int shard) throws Exception { + String primaryNodeId; + try (XContentBuilder builder = jsonBuilder()) { + builder.startObject(); + { + builder.field("index", indexName); + builder.field("shard", shard); + builder.field("primary", true); + } + builder.endObject(); + + Request request = new Request(HttpGet.METHOD_NAME, "_cluster/allocation/explain"); + request.setJsonEntity(Strings.toString(builder)); + + Response response = client().performRequest(request); + Map responseMap = responseAsMap(response); + primaryNodeId = extractValue(responseMap, "current_node.id"); + } + assertThat(primaryNodeId, is(notNullValue())); + + return primaryNodeId; + } + + private void cancelShard(String indexName, int shard, String nodeName) throws IOException { + try (XContentBuilder builder = jsonBuilder()) { + builder.startObject(); + { + builder.startArray("commands"); + { + builder.startObject(); + { + builder.startObject("cancel"); + { + builder.field("index", indexName); + builder.field("shard", shard); + builder.field("node", nodeName); + builder.field("allow_primary", true); + } + builder.endObject(); + } + builder.endObject(); + } + builder.endArray(); + } + builder.endObject(); + + Request request = new Request(HttpPost.METHOD_NAME, "/_cluster/reroute"); + request.setJsonEntity(Strings.toString(builder)); + Response response = client().performRequest(request); + assertOK(response); + } + } + private void assertMatchAllReturnsAllDocuments(String indexName, int numDocs) throws IOException { Map searchResults = search(indexName, QueryBuilders.matchAllQuery()); assertThat(extractValue(searchResults, "hits.total.value"), equalTo(numDocs)); From bceb38a6dc57bc5c5835e5d499d457105d505e76 Mon Sep 17 00:00:00 2001 From: Benjamin Trent Date: Wed, 29 Sep 2021 07:09:38 -0400 Subject: [PATCH 051/250] [ML] fixing zero_shot_classification config override (#78415) bug in zero_shot_classification didn't take the provided override labels into account. --- .../nlp/ZeroShotClassificationProcessor.java | 2 +- .../ZeroShotClassificationProcessorTests.java | 64 +++++++++++++++++++ 2 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/ZeroShotClassificationProcessorTests.java diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/ZeroShotClassificationProcessor.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/ZeroShotClassificationProcessor.java index eeeeb1cc2aa56..b9a4c53ea428d 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/ZeroShotClassificationProcessor.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/ZeroShotClassificationProcessor.java @@ -69,7 +69,7 @@ public NlpTask.RequestBuilder getRequestBuilder(NlpConfig nlpConfig) { } else { labels = this.labels; } - if (this.labels == null || this.labels.length == 0) { + if (labels == null || labels.length == 0) { throw ExceptionsHelper.badRequestException("zero_shot_classification requires non-empty [labels]"); } return new RequestBuilder(tokenizer, labels, hypothesisTemplate); diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/ZeroShotClassificationProcessorTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/ZeroShotClassificationProcessorTests.java new file mode 100644 index 0000000000000..bb57d038e7b3a --- /dev/null +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/ZeroShotClassificationProcessorTests.java @@ -0,0 +1,64 @@ +/* + * 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.ml.inference.nlp; + +import org.elasticsearch.common.xcontent.XContentHelper; +import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.test.ESTestCase; +import org.elasticsearch.xpack.core.ml.inference.trainedmodel.BertTokenization; +import org.elasticsearch.xpack.core.ml.inference.trainedmodel.NlpConfig; +import org.elasticsearch.xpack.core.ml.inference.trainedmodel.VocabularyConfig; +import org.elasticsearch.xpack.core.ml.inference.trainedmodel.ZeroShotClassificationConfig; +import org.elasticsearch.xpack.core.ml.inference.trainedmodel.ZeroShotClassificationConfigUpdate; +import org.elasticsearch.xpack.ml.inference.nlp.tokenizers.BertTokenizer; +import org.elasticsearch.xpack.ml.inference.nlp.tokenizers.NlpTokenizer; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +import static org.hamcrest.Matchers.hasSize; + +public class ZeroShotClassificationProcessorTests extends ESTestCase { + + @SuppressWarnings("unchecked") + public void testBuildRequest() throws IOException { + NlpTokenizer tokenizer = NlpTokenizer.build( + new Vocabulary( + Arrays.asList("Elastic", "##search", "fun", "default", "label", "new", "stuff", "This", "example", "is", ".", + BertTokenizer.CLASS_TOKEN, BertTokenizer.SEPARATOR_TOKEN, BertTokenizer.PAD_TOKEN), + randomAlphaOfLength(10) + ), + new BertTokenization(null, true, 512)); + + ZeroShotClassificationConfig config = new ZeroShotClassificationConfig( + List.of("entailment", "neutral", "contradiction"), + new VocabularyConfig("test-index"), + null, + null, + null, + null + ); + ZeroShotClassificationProcessor processor = new ZeroShotClassificationProcessor(tokenizer, config); + + NlpTask.Request request = processor.getRequestBuilder( + (NlpConfig)new ZeroShotClassificationConfigUpdate.Builder().setLabels(List.of("new", "stuff")).build().apply(config) + ).buildRequest(List.of("Elasticsearch fun"), "request1"); + + Map jsonDocAsMap = XContentHelper.convertToMap(request.processInput, true, XContentType.JSON).v2(); + + assertThat(jsonDocAsMap.keySet(), hasSize(5)); + assertEquals("request1", jsonDocAsMap.get("request_id")); + assertEquals(Arrays.asList(11, 0, 1, 2, 12, 7, 8, 9, 5, 10, 12), ((List>)jsonDocAsMap.get("tokens")).get(0)); + assertEquals(Arrays.asList(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), ((List>)jsonDocAsMap.get("arg_1")).get(0)); + assertEquals(Arrays.asList(11, 0, 1, 2, 12, 7, 8, 9, 6, 10, 12), ((List>)jsonDocAsMap.get("tokens")).get(1)); + assertEquals(Arrays.asList(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), ((List>)jsonDocAsMap.get("arg_1")).get(1)); + } + +} From b96d929af30a4481ee0692c66b94d41d9a8b0f7f Mon Sep 17 00:00:00 2001 From: Benjamin Trent Date: Wed, 29 Sep 2021 07:20:25 -0400 Subject: [PATCH 052/250] [ML] add documentation for get deployment stats API (#78412) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [ML] add documentation for get deployment stats API * Apply suggestions from code review Co-authored-by: István Zoltán Szabó Co-authored-by: István Zoltán Szabó --- ...et-trained-model-deployment-stats.asciidoc | 299 ++++++++++++++++++ .../ml/df-analytics/apis/index.asciidoc | 1 + .../apis/ml-df-analytics-apis.asciidoc | 1 + 3 files changed, 301 insertions(+) create mode 100644 docs/reference/ml/df-analytics/apis/get-trained-model-deployment-stats.asciidoc diff --git a/docs/reference/ml/df-analytics/apis/get-trained-model-deployment-stats.asciidoc b/docs/reference/ml/df-analytics/apis/get-trained-model-deployment-stats.asciidoc new file mode 100644 index 0000000000000..aa8074ae882a8 --- /dev/null +++ b/docs/reference/ml/df-analytics/apis/get-trained-model-deployment-stats.asciidoc @@ -0,0 +1,299 @@ +[role="xpack"] +[testenv="basic"] +[[get-trained-model-deployment-stats]] += Get trained model deployment statistics API +[subs="attributes"] +++++ +Get trained model deployment stats +++++ + +Retrieves usage information for trained model deployments. + + +[[ml-get-trained-model-deployment-stats-request]] +== {api-request-title} + +`GET _ml/trained_models//deployment/_stats` + + +`GET _ml/trained_models/,/deployment/_stats` + + +`GET _ml/trained_models/,/deployment/_stats` + +[[ml-get-trained-model-deployment-stats-prereq]] +== {api-prereq-title} + +Requires the `monitor_ml` cluster privilege. This privilege is included in the +`machine_learning_user` built-in role. + + +[[ml-get-trained-model-deployment-stats-desc]] +== {api-description-title} + +You can get deployment information for multiple trained models in a single API +request by using a comma-separated list of model IDs or a wildcard expression. + + +[[ml-get-trained-model-deployment-stats-path-params]] +== {api-path-parms-title} + +``:: +(Optional, string) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=model-id] + + +[[ml-get-trained-model-deployment-stats-query-params]] +== {api-query-parms-title} + +`allow_no_match`:: +(Optional, Boolean) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=allow-no-match-models] + +[role="child_attributes"] +[[ml-get-trained-model-deployment-stats-results]] +== {api-response-body-title} + +`count`:: +(integer) +The total number of deployment statistics that matched the requested ID +patterns. + +`deployment_stats`:: +(array) +An array of trained model deployment statistics, which are sorted by the `model_id` value +in ascending order. ++ +.Properties of trained model deployment stats +[%collapsible%open] +==== +`model_id`::: +(string) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=model-id] + +`model_size`::: +(<>) +The size of the loaded model in bytes. + +`state`::: +(string) +The overall state of the deployment. The values may be: ++ +-- +* `starting`: The deployment has recently started but is not yet usable as the model is not allocated on any nodes. +* `started`: The deployment is usable as at least one node has the model allocated. +* `stopping`: The deployment is preparing to stop and un-allocate the model from the relevant nodes. +-- + +`allocation_status`::: +(object) +The detailed allocation status given the deployment configuration. ++ +.Properties of allocation stats +[%collapsible%open] +===== +`allocation_count`::: +(integer) +The current number of nodes where the model is allocated. + +`target_allocation_count`::: +(integer) +The desired number of nodes for model allocation. + +`state`::: +(string) +The detailed allocation state related to the nodes. ++ +-- +* `starting`: Allocations are being attempted but no node currently has the model allocated. +* `started`: At least one node has the model allocated. +* `fully_allocated`: The deployment is fully allocated and satisfies the `target_allocation_count`. +-- +===== + +`nodes`::: +(array of objects) +The deployment stats for each node that currently has the model allocated. ++ +.Properties of node stats +[%collapsible%open] +===== +`average_inference_time_ms`::: +(double) +The average time for each inference call to complete on this node. + +`inference_count`::: +(integer) +The total number of inference calls made against this node for this model. + +`last_access`::: +(long) +The epoch time stamp of the last inference call for the model on this node. + +`node`::: +(object) +Information pertaining to the node. ++ +.Properties of node +[%collapsible%open] +====== +`attributes`::: +(object) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=node-attributes] + +`ephemeral_id`::: +(string) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=node-ephemeral-id] + +`id`::: +(string) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=node-id] + +`name`::: +(string) The node name. + +`transport_address`::: +(string) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=node-transport-address] +====== + +`routing_state`::: +(object) +The current routing state and reason for the current routing state for this allocation. ++ +-- +* `starting`: The model is attempting to allocate on this model, inference calls are not yet accepted. +* `started`: The model is allocated and ready to accept inference requests. +* `stopping`: The model is being de-allocated from this node. +* `stopped`: The model is fully de-allocated from this node. +* `failed`: The allocation attempt failed, see `reason` field for the potential cause. +-- + +`reason`::: +(string) +The reason for the current state. Usually only populated when the `routing_state` is `failed`. + +===== +==== + +[[ml-get-trained-model-deployment-stats-response-codes]] +== {api-response-codes-title} + +`404` (Missing resources):: + If `allow_no_match` is `false`, this code indicates that there are no + resources that match the request or only partial matches for the request. + +[[ml-get-trained-model-deployment-stats-example]] +== {api-examples-title} + +The following example gets deployment information for all currently started model deployments: + +[source,console] +-------------------------------------------------- +GET _ml/trained_models/*/deployment/_stats +-------------------------------------------------- +// TEST[skip:TBD] + + +The API returns the following results: + +[source,console-result] +---- +{ + "count": 2, + "deployment_stats": [ + { + "model_id": "elastic__distilbert-base-uncased-finetuned-conll03-english", + "model_size": "253.3mb", + "state": "started", + "allocation_status": { + "allocation_count": 1, + "target_allocation_count": 1, + "state": "fully_allocated" + }, + "nodes": [ + { + "node": { + "6pzZQ9OmQUWAaswMlwVEwg": { + "name": "runTask-0", + "ephemeral_id": "aI1OwkPMRCiAJ_1XkEAqdw", + "transport_address": "127.0.0.1:9300", + "attributes": { + "ml.machine_memory": "68719476736", + "xpack.installed": "true", + "testattr": "test", + "ml.max_open_jobs": "512", + "ml.max_jvm_size": "4181590016" + }, + "roles": [ + "data", + "data_cold", + "data_content", + "data_frozen", + "data_hot", + "data_warm", + "ingest", + "master", + "ml", + "remote_cluster_client", + "transform" + ] + } + }, + "routing_state": { + "routing_state": "started" + }, + "inference_count": 9, + "average_inference_time_ms": 51, + "last_access": 1632855681069 + } + ] + }, + { + "model_id": "typeform__distilbert-base-uncased-mnli", + "model_size": "255.5mb", + "state": "started", + "allocation_status": { + "allocation_count": 1, + "target_allocation_count": 1, + "state": "fully_allocated" + }, + "nodes": [ + { + "node": { + "6pzZQ9OmQUWAaswMlwVEwg": { + "name": "runTask-0", + "ephemeral_id": "aI1OwkPMRCiAJ_1XkEAqdw", + "transport_address": "127.0.0.1:9300", + "attributes": { + "ml.machine_memory": "68719476736", + "xpack.installed": "true", + "testattr": "test", + "ml.max_open_jobs": "512", + "ml.max_jvm_size": "4181590016" + }, + "roles": [ + "data", + "data_cold", + "data_content", + "data_frozen", + "data_hot", + "data_warm", + "ingest", + "master", + "ml", + "remote_cluster_client", + "transform" + ] + } + }, + "routing_state": { + "routing_state": "started" + }, + "inference_count": 0, + "average_inference_time_ms": 0 + } + ] + } + ] +} +---- +// NOTCONSOLE diff --git a/docs/reference/ml/df-analytics/apis/index.asciidoc b/docs/reference/ml/df-analytics/apis/index.asciidoc index b893a2d48b93f..e0db3f24f58c5 100644 --- a/docs/reference/ml/df-analytics/apis/index.asciidoc +++ b/docs/reference/ml/df-analytics/apis/index.asciidoc @@ -19,6 +19,7 @@ include::explain-dfanalytics.asciidoc[leveloffset=+2] include::get-dfanalytics.asciidoc[leveloffset=+2] include::get-dfanalytics-stats.asciidoc[leveloffset=+2] include::get-trained-models.asciidoc[leveloffset=+2] +include::get-trained-model-deployment-stats.asciidoc[leveloffset=+2] include::get-trained-models-stats.asciidoc[leveloffset=+2] //INFER include::infer-trained-model-deployment.asciidoc[leveloffset=+2] diff --git a/docs/reference/ml/df-analytics/apis/ml-df-analytics-apis.asciidoc b/docs/reference/ml/df-analytics/apis/ml-df-analytics-apis.asciidoc index 1393181aac100..69f6af4945f90 100644 --- a/docs/reference/ml/df-analytics/apis/ml-df-analytics-apis.asciidoc +++ b/docs/reference/ml/df-analytics/apis/ml-df-analytics-apis.asciidoc @@ -26,6 +26,7 @@ You can use the following APIs to perform {infer} operations: * <> * <> * <> +* <> You can deploy a trained model to make predictions in an ingest pipeline or in an aggregation. Refer to the following documentation to learn more: From f24709997c1b4d95531039ba933bfaf0e461d123 Mon Sep 17 00:00:00 2001 From: Artem Prigoda Date: Wed, 29 Sep 2021 13:55:42 +0200 Subject: [PATCH 053/250] Increase the amount of snapshot pool threads for GetSnapshotsIT (#78437) We need that for the testSortAndPaginateWithInProgress test where we need to make sure that one index get successfully snapshotted whilst the other one gets blocked. --- .../java/org/elasticsearch/snapshots/GetSnapshotsIT.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/GetSnapshotsIT.java b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/GetSnapshotsIT.java index ffe80d4f58bcd..48341b0ad746f 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/GetSnapshotsIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/GetSnapshotsIT.java @@ -8,7 +8,6 @@ package org.elasticsearch.snapshots; -import org.apache.lucene.util.LuceneTestCase.AwaitsFix; import org.elasticsearch.action.ActionFuture; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.admin.cluster.snapshots.create.CreateSnapshotResponse; @@ -34,13 +33,13 @@ import static org.hamcrest.Matchers.in; import static org.hamcrest.Matchers.is; -@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/78348") public class GetSnapshotsIT extends AbstractSnapshotIntegTestCase { @Override protected Settings nodeSettings(int nodeOrdinal, Settings otherSettings) { return Settings.builder() .put(super.nodeSettings(nodeOrdinal, otherSettings)) + .put(LARGE_SNAPSHOT_POOL_SETTINGS) .put(ThreadPool.ESTIMATED_TIME_INTERVAL_SETTING.getKey(), 0) // We have tests that check by-timestamp order .build(); } From f8c43ad9803750f35a9bb099d265623e07112998 Mon Sep 17 00:00:00 2001 From: Armin Braun Date: Wed, 29 Sep 2021 13:57:06 +0200 Subject: [PATCH 054/250] Fix Empty Step Info not Comparing Correctly (#78442) Follow up to #78390. The `EmptyInfo` would not compare correctly because it doesn't implement equals or hashcode, breaking deduplication for `SetStepInfoUpdateTask`. => just making it a singleton to fix this and have a fast comp via instance equality. --- .../xpack/core/ilm/WaitForRolloverReadyStep.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/WaitForRolloverReadyStep.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/WaitForRolloverReadyStep.java index 2f52531b1fcff..91e51888c7431 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/WaitForRolloverReadyStep.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/WaitForRolloverReadyStep.java @@ -65,7 +65,7 @@ public void evaluateCondition(Metadata metadata, Index index, Listener listener, logger.warn("index [{}] is not the write index for data stream [{}]. skipping rollover for policy [{}]", index.getName(), dataStream.getName(), LifecycleSettings.LIFECYCLE_NAME_SETTING.get(metadata.index(index).getSettings())); - listener.onResponse(true, new WaitForRolloverReadyStep.EmptyInfo()); + listener.onResponse(true, EmptyInfo.INSTANCE); return; } rolloverTarget = dataStream.getName(); @@ -83,7 +83,7 @@ public void evaluateCondition(Metadata metadata, Index index, Listener listener, if (indexMetadata.getRolloverInfos().get(rolloverAlias) != null) { logger.info("index [{}] was already rolled over for alias [{}], not attempting to roll over again", index.getName(), rolloverAlias); - listener.onResponse(true, new WaitForRolloverReadyStep.EmptyInfo()); + listener.onResponse(true, EmptyInfo.INSTANCE); return; } @@ -117,7 +117,7 @@ public void evaluateCondition(Metadata metadata, Index index, Listener listener, return; } - listener.onResponse(true, new WaitForRolloverReadyStep.EmptyInfo()); + listener.onResponse(true, EmptyInfo.INSTANCE); return; } @@ -155,7 +155,7 @@ public void evaluateCondition(Metadata metadata, Index index, Listener listener, } getClient().admin().indices().rolloverIndex(rolloverRequest, ActionListener.wrap(response -> listener.onResponse(response.getConditionStatus().values().stream().anyMatch(i -> i), - new WaitForRolloverReadyStep.EmptyInfo()), listener::onFailure)); + EmptyInfo.INSTANCE), listener::onFailure)); } ByteSizeValue getMaxSize() { @@ -196,7 +196,10 @@ public boolean equals(Object obj) { } // We currently have no information to provide for this AsyncWaitStep, so this is an empty object - private class EmptyInfo implements ToXContentObject { + private static final class EmptyInfo implements ToXContentObject { + + static final EmptyInfo INSTANCE = new EmptyInfo(); + private EmptyInfo() { } From c7ef3a6c3a67ca59deba88c2598903a3787b8fec Mon Sep 17 00:00:00 2001 From: Costin Leau Date: Wed, 29 Sep 2021 15:09:37 +0300 Subject: [PATCH 055/250] EQL: Introduce repeatable queries (#75082) Allow individual queries within a sequence to be ran multiple times through using the [runs=number] construct as a suffix without having to redeclare the query. sequence queryA [runs=2] queryB queryC [runs=3] queryD is the same as: sequence queryA queryA queryB queryC queryC queryC queryD but more concise. --- .../resources/additional_test_queries.toml | 34 +- .../src/main/resources/test_queries.toml | 236 +++++++- .../src/javaRestTest/resources/queries.toml | 36 ++ x-pack/plugin/eql/src/main/antlr/EqlBase.g4 | 4 +- .../xpack/eql/parser/EqlBaseParser.java | 560 +++++++++--------- .../xpack/eql/parser/LogicalPlanBuilder.java | 47 +- .../xpack/eql/parser/LogicalPlanTests.java | 10 + .../eql/planner/QueryTranslatorFailTests.java | 18 +- 8 files changed, 634 insertions(+), 311 deletions(-) diff --git a/x-pack/plugin/eql/qa/common/src/main/resources/additional_test_queries.toml b/x-pack/plugin/eql/qa/common/src/main/resources/additional_test_queries.toml index 26a4a06354cf6..37aaa74a4f68a 100644 --- a/x-pack/plugin/eql/qa/common/src/main/resources/additional_test_queries.toml +++ b/x-pack/plugin/eql/qa/common/src/main/resources/additional_test_queries.toml @@ -228,19 +228,35 @@ sequence by unique_pid [any where true] [any where serial_event_id < 72] ''' -expected_event_ids = [ - 54, 55, 59, - 55, 59, 61, - 59, 61, 65, - 16, 60, 66, - 61, 65, 67, - 65, 67, 70, - 60, 66, 71] +expected_event_ids = [ + 54, 55, 59, + 55, 59, 61, + 59, 61, 65, + 16, 60, 66, + 61, 65, 67, + 65, 67, 70, + 60, 66, 71] + +[[queries]] +name = "sequenceWithMoreThan10Results-Runs" +query = ''' +sequence by unique_pid + [any where true] [runs=2] + [any where serial_event_id < 72] +''' +expected_event_ids = [ + 54, 55, 59, + 55, 59, 61, + 59, 61, 65, + 16, 60, 66, + 61, 65, 67, + 65, 67, 70, + 60, 66, 71] [[queries]] name = "seqSingleArg" query = 'process where string(serial_event_id) : ("1")' -expected_event_ids = [1] +expected_event_ids = [1] [[queries]] name = "seqSingleArgPattern" diff --git a/x-pack/plugin/eql/qa/common/src/main/resources/test_queries.toml b/x-pack/plugin/eql/qa/common/src/main/resources/test_queries.toml index 308fe5292f41e..92a8bc4b5b974 100644 --- a/x-pack/plugin/eql/qa/common/src/main/resources/test_queries.toml +++ b/x-pack/plugin/eql/qa/common/src/main/resources/test_queries.toml @@ -554,7 +554,16 @@ sequence [process where true] [process where true] ''' -expected_event_ids = [1, 2, 3] +expected_event_ids = [1, 2, 3] + +[[queries]] +name = "sequenceOneManyMany-Runs" +query = ''' +sequence + [process where serial_event_id == 1] + [process where true] [runs=2] +''' +expected_event_ids = [1, 2, 3] [[queries]] name = "sequenceConditionManyMany" @@ -567,6 +576,18 @@ sequence expected_event_ids = [1, 2, 3, 2, 3, 4, 3, 4, 5] + +[[queries]] +name = "sequenceConditionManyMany-Runs" +query = ''' +sequence + [process where serial_event_id <= 3] + [process where true] [runs=2] +''' +expected_event_ids = [1, 2, 3, + 2, 3, 4, + 3, 4, 5] + [[queries]] name = "sequenceManyConditionMany" query = ''' @@ -577,6 +598,7 @@ sequence ''' expected_event_ids = [1, 2, 3, 2, 3, 4] + [[queries]] name = "sequenceManyManyCondition" query = ''' @@ -585,7 +607,16 @@ sequence [process where true] [process where serial_event_id <= 3] ''' -expected_event_ids = [1, 2, 3] +expected_event_ids = [1, 2, 3] + +[[queries]] +name = "sequenceManyManyCondition-Runs" +query = ''' +sequence + [process where true] [runs=2] + [process where serial_event_id <= 3] +''' +expected_event_ids = [1, 2, 3] [[queries]] name = "sequenceThreeManyCondition1" @@ -596,10 +627,22 @@ sequence [process where true] [process where true] ''' -expected_event_ids = [1, 2, 3, 4, - 2, 3, 4, 5, - 3, 4, 5, 6, - 4, 5, 6, 7] +expected_event_ids = [1, 2, 3, 4, + 2, 3, 4, 5, + 3, 4, 5, 6, + 4, 5, 6, 7] + +[[queries]] +name = "sequenceThreeManyCondition1-Runs" +query = ''' +sequence + [process where serial_event_id <= 4] + [process where true] [runs=3] +''' +expected_event_ids = [1, 2, 3, 4, + 2, 3, 4, 5, + 3, 4, 5, 6, + 4, 5, 6, 7] [[queries]] name = "sequenceThreeManyCondition2" @@ -610,9 +653,21 @@ sequence [process where true] [process where true] ''' -expected_event_ids = [1, 2, 3, 4, - 2, 3, 4, 5, - 3, 4, 5, 6] +expected_event_ids = [1, 2, 3, 4, + 2, 3, 4, 5, + 3, 4, 5, 6] + +[[queries]] +name = "sequenceThreeManyCondition2-Runs" +query = ''' +sequence + [process where true] + [process where serial_event_id <= 4] + [process where true] [runs=2] +''' +expected_event_ids = [1, 2, 3, 4, + 2, 3, 4, 5, + 3, 4, 5, 6] [[queries]] name = "sequenceThreeManyCondition3" @@ -623,8 +678,19 @@ sequence [process where serial_event_id <= 4] [process where true] ''' -expected_event_ids = [1, 2, 3, 4, - 2, 3, 4, 5] +expected_event_ids = [1, 2, 3, 4, + 2, 3, 4, 5] + +[[queries]] +name = "sequenceThreeManyCondition3-Runs" +query = ''' +sequence + [process where true] [runs=2] + [process where serial_event_id <= 4] + [process where true] +''' +expected_event_ids = [1, 2, 3, 4, + 2, 3, 4, 5] [[queries]] name = "sequenceThreeManyCondition4" @@ -635,7 +701,16 @@ sequence [process where true] [process where serial_event_id <= 4] ''' -expected_event_ids = [1, 2, 3, 4] +expected_event_ids = [1, 2, 3, 4] + +[[queries]] +name = "sequenceThreeManyCondition4-Runs" +query = ''' +sequence + [process where true] [runs=3] + [process where serial_event_id <= 4] +''' +expected_event_ids = [1, 2, 3, 4] [[queries]] name = "twoSequencesWithKeys" @@ -644,10 +719,10 @@ sequence [process where true] by unique_pid [process where opcode == 1] by unique_ppid ''' -expected_event_ids = [48, 53, - 53, 54, - 54, 56, - 97, 98] +expected_event_ids = [48, 53, + 53, 54, + 54, 56, + 97, 98] [[queries]] name = "twoSequencesWithTwoKeys" @@ -672,7 +747,19 @@ sequence until [file where opcode == 2] by unique_pid ''' -expected_event_ids = [] +expected_event_ids = [] + +[[queries]] +name = "fourSequencesByPidWithUntil1-Runs" +query = ''' +sequence + [process where opcode == 1] by unique_pid + [file where opcode == 0] by unique_pid [runs=3] +until + [file where opcode == 2] by unique_pid +''' +expected_event_ids = [] + [[queries]] name = "fourSequencesByPidWithUntil2" @@ -685,7 +772,19 @@ sequence until [file where opcode == 200] by unique_pid ''' -expected_event_ids = [54, 55, 61, 67] +expected_event_ids = [54, 55, 61, 67] + +[[queries]] +name = "fourSequencesByPidWithUntil2-Runs" +query = ''' +sequence + [process where opcode == 1] by unique_pid + [file where opcode == 0] by unique_pid [runs=3] +until + [file where opcode == 200] by unique_pid +''' +expected_event_ids = [54, 55, 61, 67] + #[[queries]] #name = "fourSequencesByPidWithUntil3" @@ -707,7 +806,16 @@ sequence [file where opcode == 0] by unique_pid [file where opcode == 0] by unique_pid ''' -expected_event_ids = [54, 55, 61, 67] +expected_event_ids = [54, 55, 61, 67] + +[[queries]] +name = "fourSequencesByPid-Runs" +query = ''' +sequence + [process where opcode == 1] by unique_pid + [file where opcode == 0] by unique_pid [runs=3] +''' +expected_event_ids = [54, 55, 61, 67] [[queries]] @@ -719,8 +827,16 @@ sequence [file where opcode == 0] by unique_pid, process_path [file where opcode == 0] by unique_pid, process_path ''' -expected_event_ids = [54, 55, 61, 67] +expected_event_ids = [54, 55, 61, 67] +[[queries]] +name = "fourSequencesByPidAndProcessPath1-Runs" +query = ''' +sequence + [process where opcode == 1] by unique_pid, process_path + [file where opcode == 0] by unique_pid, process_path [runs=3] +''' +expected_event_ids = [54, 55, 61, 67] [[queries]] name = "fourSequencesByPidAndProcessPathWithUntil" @@ -733,7 +849,30 @@ sequence until [file where opcode == 200] by unique_pid, process_path ''' -expected_event_ids = [54, 55, 61, 67] +expected_event_ids = [54, 55, 61, 67] + +[[queries]] +name = "fourSequencesByPidAndProcessPathWithUntil-Runs" +query = ''' +sequence + [process where opcode == 1] by unique_pid, process_path + [file where opcode == 0] by unique_pid, process_path [runs=3] +until + [file where opcode == 200] by unique_pid, process_path +''' +expected_event_ids = [54, 55, 61, 67] + +[[queries]] +name = "fourSequencesByPidAndProcessPathWithUntil-RunsExtra" +query = ''' +sequence + [process where opcode == 1] by unique_pid, process_path + [file where opcode == 0] by unique_pid, process_path [runs=2] + [file where opcode == 0] by unique_pid, process_path [runs=1] +until + [file where opcode == 200] by unique_pid, process_path +''' +expected_event_ids = [54, 55, 61, 67] [[queries]] name = "sequenceOneManyWithJoin" @@ -742,7 +881,7 @@ sequence [process where serial_event_id==1] by unique_pid [process where true] by unique_ppid ''' -expected_event_ids = [1, 2] +expected_event_ids = [1, 2] [[queries]] @@ -879,9 +1018,20 @@ sequence [process where serial_event_id < 5] [process where serial_event_id < 5] ''' -expected_event_ids = [1, 2, - 2, 3, - 3, 4] +expected_event_ids = [1, 2, + 2, 3, + 3, 4] + +[[queries]] +name = "doubleSameSequence-Runs" +query = ''' +sequence + [process where serial_event_id < 5] [runs=2] +''' +expected_event_ids = [1, 2, + 2, 3, + 3, 4] + [[queries]] name = "sequencesOnDifferentEventTypesWithBy" @@ -890,7 +1040,7 @@ sequence [file where opcode==0 and file_name:"svchost.exe"] by unique_pid [process where opcode == 1] by unique_ppid ''' -expected_event_ids = [55, 56] +expected_event_ids = [55, 56] [[queries]] name = "doubleSameSequenceWithBy" @@ -900,7 +1050,17 @@ sequence [file where opcode==0] by unique_pid | head 1 ''' -expected_event_ids = [55, 61] +expected_event_ids = [55, 61] + +[[queries]] +name = "doubleSameSequenceWithBy-Runs" +query = ''' +sequence + [file where opcode==0] by unique_pid [runs=2] +| head 1 +''' +expected_event_ids = [55, 61] + #[[queries]] #name = "doubleSameSequenceWithByAndFilter" @@ -921,7 +1081,17 @@ sequence until [process where opcode==5000] by unique_ppid | head 1 ''' -expected_event_ids = [55, 61] +expected_event_ids = [55, 61] + +[[queries]] +name = "doubleSameSequenceWithByUntilAndHead1-Runs" +query = ''' +sequence + [file where opcode==0 and file_name:"*.exe"] by unique_pid [runs=2] +until [process where opcode==5000] by unique_ppid +| head 1 +''' +expected_event_ids = [55, 61] [[queries]] name = "doubleSameSequenceWithByUntilAndHead2" @@ -934,6 +1104,16 @@ until [process where opcode==1] by unique_ppid ''' expected_event_ids = [] +[[queries]] +name = "doubleSameSequenceWithByUntilAndHead2-Runs" +query = ''' +sequence + [file where opcode==0 and file_name:"*.exe"] by unique_pid [runs=2] +until [process where opcode==1] by unique_ppid +| head 1 +''' +expected_event_ids = [] + #[[queries]] #name = "doubleJoinWithByUntilAndHead" #query = ''' diff --git a/x-pack/plugin/eql/qa/correctness/src/javaRestTest/resources/queries.toml b/x-pack/plugin/eql/qa/correctness/src/javaRestTest/resources/queries.toml index aaab73c7c4f76..3a2a7dac84b7b 100644 --- a/x-pack/plugin/eql/qa/correctness/src/javaRestTest/resources/queries.toml +++ b/x-pack/plugin/eql/qa/correctness/src/javaRestTest/resources/queries.toml @@ -383,6 +383,25 @@ sequence by source_address, hostname with maxspan=5s time = 2.8286166191101074 type = "sequence" +[[queries]] +queryNo = 231 +count = 0 +expected_event_ids = [] +filter_counts = [6, 6, 6, 6] +filters = [ + 'security where hostname != "newyork" and event_id == 4625', + 'security where hostname != "newyork" and event_id == 4625', + 'security where hostname != "newyork" and event_id == 4625', + 'security where hostname != "newyork" and event_id == 4625' +] +query = ''' +sequence by source_address, hostname with maxspan=5s + [security where hostname != "newyork" and event_id == 4625] [runs=4] +''' +time = 2.8286166191101074 +type = "sequence" + + [[queries]] queryNo = 24 count = 1 @@ -402,6 +421,23 @@ sequence by source_address, hostname with maxspan=10s time = 2.765869617462158 type = "sequence" +[[queries]] +queryNo = 241 +count = 1 +expected_event_ids = [2860083, 2860090, 2860098] +filter_counts = [6, 6, 6] +filters = [ + 'security where hostname != "newyork" and event_id == 4625', + 'security where hostname != "newyork" and event_id == 4625', + 'security where hostname != "newyork" and event_id == 4625' +] +query = ''' +sequence by source_address, hostname with maxspan=10s + [security where hostname != "newyork" and event_id == 4625] [runs=3] +''' +time = 2.765869617462158 +type = "sequence" + [[queries]] queryNo = 25 count = 0 diff --git a/x-pack/plugin/eql/src/main/antlr/EqlBase.g4 b/x-pack/plugin/eql/src/main/antlr/EqlBase.g4 index 5c8ebcc068ee9..dfffb4aa06368 100644 --- a/x-pack/plugin/eql/src/main/antlr/EqlBase.g4 +++ b/x-pack/plugin/eql/src/main/antlr/EqlBase.g4 @@ -32,7 +32,7 @@ sequenceParams sequence : SEQUENCE (by=joinKeys sequenceParams? | sequenceParams disallowed=joinKeys?)? - sequenceTerm sequenceTerm+ + sequenceTerm+ (UNTIL until=sequenceTerm)? ; @@ -56,7 +56,7 @@ joinTerm ; sequenceTerm - : subquery (by=joinKeys)? + : subquery (by=joinKeys)? (LB key=IDENTIFIER ASGN value=number RB)? ; subquery diff --git a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseParser.java b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseParser.java index 67f2652b5496a..0043df2122746 100644 --- a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseParser.java +++ b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseParser.java @@ -412,15 +412,15 @@ public static class SequenceContext extends ParserRuleContext { public JoinKeysContext disallowed; public SequenceTermContext until; public TerminalNode SEQUENCE() { return getToken(EqlBaseParser.SEQUENCE, 0); } + public SequenceParamsContext sequenceParams() { + return getRuleContext(SequenceParamsContext.class,0); + } public List sequenceTerm() { return getRuleContexts(SequenceTermContext.class); } public SequenceTermContext sequenceTerm(int i) { return getRuleContext(SequenceTermContext.class,i); } - public SequenceParamsContext sequenceParams() { - return getRuleContext(SequenceParamsContext.class,0); - } public TerminalNode UNTIL() { return getToken(EqlBaseParser.UNTIL, 0); } public JoinKeysContext joinKeys() { return getRuleContext(JoinKeysContext.class,0); @@ -493,30 +493,28 @@ public final SequenceContext sequence() throws RecognitionException { default: break; } - setState(96); - sequenceTerm(); - setState(98); + setState(97); _errHandler.sync(this); _la = _input.LA(1); do { { { - setState(97); + setState(96); sequenceTerm(); } } - setState(100); + setState(99); _errHandler.sync(this); _la = _input.LA(1); } while ( _la==LB ); - setState(104); + setState(103); _errHandler.sync(this); _la = _input.LA(1); if (_la==UNTIL) { { - setState(102); + setState(101); match(UNTIL); - setState(103); + setState(102); ((SequenceContext)_localctx).until = sequenceTerm(); } } @@ -574,42 +572,42 @@ public final JoinContext join() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(106); + setState(105); match(JOIN); - setState(108); + setState(107); _errHandler.sync(this); _la = _input.LA(1); if (_la==BY) { { - setState(107); + setState(106); ((JoinContext)_localctx).by = joinKeys(); } } - setState(110); + setState(109); joinTerm(); - setState(112); + setState(111); _errHandler.sync(this); _la = _input.LA(1); do { { { - setState(111); + setState(110); joinTerm(); } } - setState(114); + setState(113); _errHandler.sync(this); _la = _input.LA(1); } while ( _la==LB ); - setState(118); + setState(117); _errHandler.sync(this); _la = _input.LA(1); if (_la==UNTIL) { { - setState(116); + setState(115); match(UNTIL); - setState(117); + setState(116); ((JoinContext)_localctx).until = joinTerm(); } } @@ -667,30 +665,30 @@ public final PipeContext pipe() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(120); + setState(119); match(PIPE); - setState(121); + setState(120); ((PipeContext)_localctx).kind = match(IDENTIFIER); - setState(130); + setState(129); _errHandler.sync(this); _la = _input.LA(1); if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << FALSE) | (1L << NOT) | (1L << NULL) | (1L << TRUE) | (1L << PLUS) | (1L << MINUS) | (1L << LP) | (1L << STRING) | (1L << INTEGER_VALUE) | (1L << DECIMAL_VALUE) | (1L << IDENTIFIER) | (1L << QUOTED_IDENTIFIER) | (1L << TILDE_IDENTIFIER))) != 0)) { { - setState(122); + setState(121); booleanExpression(0); - setState(127); + setState(126); _errHandler.sync(this); _la = _input.LA(1); while (_la==COMMA) { { { - setState(123); + setState(122); match(COMMA); - setState(124); + setState(123); booleanExpression(0); } } - setState(129); + setState(128); _errHandler.sync(this); _la = _input.LA(1); } @@ -748,23 +746,23 @@ public final JoinKeysContext joinKeys() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(132); + setState(131); match(BY); - setState(133); + setState(132); expression(); - setState(138); + setState(137); _errHandler.sync(this); _la = _input.LA(1); while (_la==COMMA) { { { - setState(134); + setState(133); match(COMMA); - setState(135); + setState(134); expression(); } } - setState(140); + setState(139); _errHandler.sync(this); _la = _input.LA(1); } @@ -815,14 +813,14 @@ public final JoinTermContext joinTerm() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(141); + setState(140); subquery(); - setState(143); + setState(142); _errHandler.sync(this); _la = _input.LA(1); if (_la==BY) { { - setState(142); + setState(141); ((JoinTermContext)_localctx).by = joinKeys(); } } @@ -842,12 +840,21 @@ public final JoinTermContext joinTerm() throws RecognitionException { public static class SequenceTermContext extends ParserRuleContext { public JoinKeysContext by; + public Token key; + public NumberContext value; public SubqueryContext subquery() { return getRuleContext(SubqueryContext.class,0); } + public TerminalNode LB() { return getToken(EqlBaseParser.LB, 0); } + public TerminalNode ASGN() { return getToken(EqlBaseParser.ASGN, 0); } + public TerminalNode RB() { return getToken(EqlBaseParser.RB, 0); } public JoinKeysContext joinKeys() { return getRuleContext(JoinKeysContext.class,0); } + public TerminalNode IDENTIFIER() { return getToken(EqlBaseParser.IDENTIFIER, 0); } + public NumberContext number() { + return getRuleContext(NumberContext.class,0); + } public SequenceTermContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @@ -874,18 +881,36 @@ public final SequenceTermContext sequenceTerm() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(145); + setState(144); subquery(); - setState(147); + setState(146); _errHandler.sync(this); _la = _input.LA(1); if (_la==BY) { { - setState(146); + setState(145); ((SequenceTermContext)_localctx).by = joinKeys(); } } + setState(154); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,15,_ctx) ) { + case 1: + { + setState(148); + match(LB); + setState(149); + ((SequenceTermContext)_localctx).key = match(IDENTIFIER); + setState(150); + match(ASGN); + setState(151); + ((SequenceTermContext)_localctx).value = number(); + setState(152); + match(RB); + } + break; + } } } catch (RecognitionException re) { @@ -930,11 +955,11 @@ public final SubqueryContext subquery() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(149); + setState(156); match(LB); - setState(150); + setState(157); eventFilter(); - setState(151); + setState(158); match(RB); } } @@ -978,7 +1003,7 @@ public final EventQueryContext eventQuery() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(153); + setState(160); eventFilter(); } } @@ -1028,28 +1053,28 @@ public final EventFilterContext eventFilter() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(157); + setState(164); _errHandler.sync(this); switch (_input.LA(1)) { case ANY: { - setState(155); + setState(162); match(ANY); } break; case STRING: case IDENTIFIER: { - setState(156); + setState(163); ((EventFilterContext)_localctx).event = eventValue(); } break; default: throw new NoViableAltException(this); } - setState(159); + setState(166); match(WHERE); - setState(160); + setState(167); expression(); } } @@ -1093,7 +1118,7 @@ public final ExpressionContext expression() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(162); + setState(169); booleanExpression(0); } } @@ -1223,18 +1248,18 @@ private BooleanExpressionContext booleanExpression(int _p) throws RecognitionExc int _alt; enterOuterAlt(_localctx, 1); { - setState(171); + setState(178); _errHandler.sync(this); - switch ( getInterpreter().adaptivePredict(_input,16,_ctx) ) { + switch ( getInterpreter().adaptivePredict(_input,17,_ctx) ) { case 1: { _localctx = new LogicalNotContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(165); + setState(172); match(NOT); - setState(166); + setState(173); booleanExpression(5); } break; @@ -1243,11 +1268,11 @@ private BooleanExpressionContext booleanExpression(int _p) throws RecognitionExc _localctx = new ProcessCheckContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(167); + setState(174); ((ProcessCheckContext)_localctx).relationship = match(IDENTIFIER); - setState(168); + setState(175); match(OF); - setState(169); + setState(176); subquery(); } break; @@ -1256,33 +1281,33 @@ private BooleanExpressionContext booleanExpression(int _p) throws RecognitionExc _localctx = new BooleanDefaultContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(170); + setState(177); valueExpression(); } break; } _ctx.stop = _input.LT(-1); - setState(181); + setState(188); _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,18,_ctx); + _alt = getInterpreter().adaptivePredict(_input,19,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { if ( _alt==1 ) { if ( _parseListeners!=null ) triggerExitRuleEvent(); _prevctx = _localctx; { - setState(179); + setState(186); _errHandler.sync(this); - switch ( getInterpreter().adaptivePredict(_input,17,_ctx) ) { + switch ( getInterpreter().adaptivePredict(_input,18,_ctx) ) { case 1: { _localctx = new LogicalBinaryContext(new BooleanExpressionContext(_parentctx, _parentState)); ((LogicalBinaryContext)_localctx).left = _prevctx; pushNewRecursionContext(_localctx, _startState, RULE_booleanExpression); - setState(173); + setState(180); if (!(precpred(_ctx, 2))) throw new FailedPredicateException(this, "precpred(_ctx, 2)"); - setState(174); + setState(181); ((LogicalBinaryContext)_localctx).operator = match(AND); - setState(175); + setState(182); ((LogicalBinaryContext)_localctx).right = booleanExpression(3); } break; @@ -1291,20 +1316,20 @@ private BooleanExpressionContext booleanExpression(int _p) throws RecognitionExc _localctx = new LogicalBinaryContext(new BooleanExpressionContext(_parentctx, _parentState)); ((LogicalBinaryContext)_localctx).left = _prevctx; pushNewRecursionContext(_localctx, _startState, RULE_booleanExpression); - setState(176); + setState(183); if (!(precpred(_ctx, 1))) throw new FailedPredicateException(this, "precpred(_ctx, 1)"); - setState(177); + setState(184); ((LogicalBinaryContext)_localctx).operator = match(OR); - setState(178); + setState(185); ((LogicalBinaryContext)_localctx).right = booleanExpression(2); } break; } } } - setState(183); + setState(190); _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,18,_ctx); + _alt = getInterpreter().adaptivePredict(_input,19,_ctx); } } } @@ -1381,14 +1406,14 @@ public final ValueExpressionContext valueExpression() throws RecognitionExceptio ValueExpressionContext _localctx = new ValueExpressionContext(_ctx, getState()); enterRule(_localctx, 32, RULE_valueExpression); try { - setState(189); + setState(196); _errHandler.sync(this); - switch ( getInterpreter().adaptivePredict(_input,19,_ctx) ) { + switch ( getInterpreter().adaptivePredict(_input,20,_ctx) ) { case 1: _localctx = new ValueExpressionDefaultContext(_localctx); enterOuterAlt(_localctx, 1); { - setState(184); + setState(191); operatorExpression(0); } break; @@ -1396,11 +1421,11 @@ public final ValueExpressionContext valueExpression() throws RecognitionExceptio _localctx = new ComparisonContext(_localctx); enterOuterAlt(_localctx, 2); { - setState(185); + setState(192); ((ComparisonContext)_localctx).left = operatorExpression(0); - setState(186); + setState(193); comparisonOperator(); - setState(187); + setState(194); ((ComparisonContext)_localctx).right = operatorExpression(0); } break; @@ -1519,7 +1544,7 @@ private OperatorExpressionContext operatorExpression(int _p) throws RecognitionE int _alt; enterOuterAlt(_localctx, 1); { - setState(198); + setState(205); _errHandler.sync(this); switch (_input.LA(1)) { case FALSE: @@ -1537,14 +1562,14 @@ private OperatorExpressionContext operatorExpression(int _p) throws RecognitionE _ctx = _localctx; _prevctx = _localctx; - setState(192); + setState(199); primaryExpression(); - setState(194); + setState(201); _errHandler.sync(this); - switch ( getInterpreter().adaptivePredict(_input,20,_ctx) ) { + switch ( getInterpreter().adaptivePredict(_input,21,_ctx) ) { case 1: { - setState(193); + setState(200); predicate(); } break; @@ -1557,7 +1582,7 @@ private OperatorExpressionContext operatorExpression(int _p) throws RecognitionE _localctx = new ArithmeticUnaryContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(196); + setState(203); ((ArithmeticUnaryContext)_localctx).operator = _input.LT(1); _la = _input.LA(1); if ( !(_la==PLUS || _la==MINUS) ) { @@ -1568,7 +1593,7 @@ private OperatorExpressionContext operatorExpression(int _p) throws RecognitionE _errHandler.reportMatch(this); consume(); } - setState(197); + setState(204); operatorExpression(3); } break; @@ -1576,25 +1601,25 @@ private OperatorExpressionContext operatorExpression(int _p) throws RecognitionE throw new NoViableAltException(this); } _ctx.stop = _input.LT(-1); - setState(208); + setState(215); _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,23,_ctx); + _alt = getInterpreter().adaptivePredict(_input,24,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { if ( _alt==1 ) { if ( _parseListeners!=null ) triggerExitRuleEvent(); _prevctx = _localctx; { - setState(206); + setState(213); _errHandler.sync(this); - switch ( getInterpreter().adaptivePredict(_input,22,_ctx) ) { + switch ( getInterpreter().adaptivePredict(_input,23,_ctx) ) { case 1: { _localctx = new ArithmeticBinaryContext(new OperatorExpressionContext(_parentctx, _parentState)); ((ArithmeticBinaryContext)_localctx).left = _prevctx; pushNewRecursionContext(_localctx, _startState, RULE_operatorExpression); - setState(200); + setState(207); if (!(precpred(_ctx, 2))) throw new FailedPredicateException(this, "precpred(_ctx, 2)"); - setState(201); + setState(208); ((ArithmeticBinaryContext)_localctx).operator = _input.LT(1); _la = _input.LA(1); if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << ASTERISK) | (1L << SLASH) | (1L << PERCENT))) != 0)) ) { @@ -1605,7 +1630,7 @@ private OperatorExpressionContext operatorExpression(int _p) throws RecognitionE _errHandler.reportMatch(this); consume(); } - setState(202); + setState(209); ((ArithmeticBinaryContext)_localctx).right = operatorExpression(3); } break; @@ -1614,9 +1639,9 @@ private OperatorExpressionContext operatorExpression(int _p) throws RecognitionE _localctx = new ArithmeticBinaryContext(new OperatorExpressionContext(_parentctx, _parentState)); ((ArithmeticBinaryContext)_localctx).left = _prevctx; pushNewRecursionContext(_localctx, _startState, RULE_operatorExpression); - setState(203); + setState(210); if (!(precpred(_ctx, 1))) throw new FailedPredicateException(this, "precpred(_ctx, 1)"); - setState(204); + setState(211); ((ArithmeticBinaryContext)_localctx).operator = _input.LT(1); _la = _input.LA(1); if ( !(_la==PLUS || _la==MINUS) ) { @@ -1627,16 +1652,16 @@ private OperatorExpressionContext operatorExpression(int _p) throws RecognitionE _errHandler.reportMatch(this); consume(); } - setState(205); + setState(212); ((ArithmeticBinaryContext)_localctx).right = operatorExpression(2); } break; } } } - setState(210); + setState(217); _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,23,_ctx); + _alt = getInterpreter().adaptivePredict(_input,24,_ctx); } } } @@ -1703,23 +1728,23 @@ public final PredicateContext predicate() throws RecognitionException { enterRule(_localctx, 36, RULE_predicate); int _la; try { - setState(240); + setState(247); _errHandler.sync(this); - switch ( getInterpreter().adaptivePredict(_input,27,_ctx) ) { + switch ( getInterpreter().adaptivePredict(_input,28,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { - setState(212); + setState(219); _errHandler.sync(this); _la = _input.LA(1); if (_la==NOT) { { - setState(211); + setState(218); match(NOT); } } - setState(214); + setState(221); ((PredicateContext)_localctx).kind = _input.LT(1); _la = _input.LA(1); if ( !(_la==IN || _la==IN_INSENSITIVE) ) { @@ -1730,34 +1755,34 @@ public final PredicateContext predicate() throws RecognitionException { _errHandler.reportMatch(this); consume(); } - setState(215); + setState(222); match(LP); - setState(216); + setState(223); expression(); - setState(221); + setState(228); _errHandler.sync(this); _la = _input.LA(1); while (_la==COMMA) { { { - setState(217); + setState(224); match(COMMA); - setState(218); + setState(225); expression(); } } - setState(223); + setState(230); _errHandler.sync(this); _la = _input.LA(1); } - setState(224); + setState(231); match(RP); } break; case 2: enterOuterAlt(_localctx, 2); { - setState(226); + setState(233); ((PredicateContext)_localctx).kind = _input.LT(1); _la = _input.LA(1); if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << LIKE) | (1L << LIKE_INSENSITIVE) | (1L << REGEX) | (1L << REGEX_INSENSITIVE) | (1L << SEQ))) != 0)) ) { @@ -1768,14 +1793,14 @@ public final PredicateContext predicate() throws RecognitionException { _errHandler.reportMatch(this); consume(); } - setState(227); + setState(234); constant(); } break; case 3: enterOuterAlt(_localctx, 3); { - setState(228); + setState(235); ((PredicateContext)_localctx).kind = _input.LT(1); _la = _input.LA(1); if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << LIKE) | (1L << LIKE_INSENSITIVE) | (1L << REGEX) | (1L << REGEX_INSENSITIVE) | (1L << SEQ))) != 0)) ) { @@ -1786,27 +1811,27 @@ public final PredicateContext predicate() throws RecognitionException { _errHandler.reportMatch(this); consume(); } - setState(229); + setState(236); match(LP); - setState(230); + setState(237); constant(); - setState(235); + setState(242); _errHandler.sync(this); _la = _input.LA(1); while (_la==COMMA) { { { - setState(231); + setState(238); match(COMMA); - setState(232); + setState(239); constant(); } } - setState(237); + setState(244); _errHandler.sync(this); _la = _input.LA(1); } - setState(238); + setState(245); match(RP); } break; @@ -1917,14 +1942,14 @@ public final PrimaryExpressionContext primaryExpression() throws RecognitionExce PrimaryExpressionContext _localctx = new PrimaryExpressionContext(_ctx, getState()); enterRule(_localctx, 38, RULE_primaryExpression); try { - setState(249); + setState(256); _errHandler.sync(this); - switch ( getInterpreter().adaptivePredict(_input,28,_ctx) ) { + switch ( getInterpreter().adaptivePredict(_input,29,_ctx) ) { case 1: _localctx = new ConstantDefaultContext(_localctx); enterOuterAlt(_localctx, 1); { - setState(242); + setState(249); constant(); } break; @@ -1932,7 +1957,7 @@ public final PrimaryExpressionContext primaryExpression() throws RecognitionExce _localctx = new FunctionContext(_localctx); enterOuterAlt(_localctx, 2); { - setState(243); + setState(250); functionExpression(); } break; @@ -1940,7 +1965,7 @@ public final PrimaryExpressionContext primaryExpression() throws RecognitionExce _localctx = new DereferenceContext(_localctx); enterOuterAlt(_localctx, 3); { - setState(244); + setState(251); qualifiedName(); } break; @@ -1948,11 +1973,11 @@ public final PrimaryExpressionContext primaryExpression() throws RecognitionExce _localctx = new ParenthesizedExpressionContext(_localctx); enterOuterAlt(_localctx, 4); { - setState(245); + setState(252); match(LP); - setState(246); + setState(253); expression(); - setState(247); + setState(254); match(RP); } break; @@ -2012,37 +2037,37 @@ public final FunctionExpressionContext functionExpression() throws RecognitionEx try { enterOuterAlt(_localctx, 1); { - setState(251); + setState(258); ((FunctionExpressionContext)_localctx).name = functionName(); - setState(252); + setState(259); match(LP); - setState(261); + setState(268); _errHandler.sync(this); _la = _input.LA(1); if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << FALSE) | (1L << NOT) | (1L << NULL) | (1L << TRUE) | (1L << PLUS) | (1L << MINUS) | (1L << LP) | (1L << STRING) | (1L << INTEGER_VALUE) | (1L << DECIMAL_VALUE) | (1L << IDENTIFIER) | (1L << QUOTED_IDENTIFIER) | (1L << TILDE_IDENTIFIER))) != 0)) { { - setState(253); + setState(260); expression(); - setState(258); + setState(265); _errHandler.sync(this); _la = _input.LA(1); while (_la==COMMA) { { { - setState(254); + setState(261); match(COMMA); - setState(255); + setState(262); expression(); } } - setState(260); + setState(267); _errHandler.sync(this); _la = _input.LA(1); } } } - setState(263); + setState(270); match(RP); } } @@ -2086,7 +2111,7 @@ public final FunctionNameContext functionName() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(265); + setState(272); _la = _input.LA(1); if ( !(_la==IDENTIFIER || _la==TILDE_IDENTIFIER) ) { _errHandler.recoverInline(this); @@ -2199,14 +2224,14 @@ public final ConstantContext constant() throws RecognitionException { ConstantContext _localctx = new ConstantContext(_ctx, getState()); enterRule(_localctx, 44, RULE_constant); try { - setState(271); + setState(278); _errHandler.sync(this); switch (_input.LA(1)) { case NULL: _localctx = new NullLiteralContext(_localctx); enterOuterAlt(_localctx, 1); { - setState(267); + setState(274); match(NULL); } break; @@ -2215,7 +2240,7 @@ public final ConstantContext constant() throws RecognitionException { _localctx = new NumericLiteralContext(_localctx); enterOuterAlt(_localctx, 2); { - setState(268); + setState(275); number(); } break; @@ -2224,7 +2249,7 @@ public final ConstantContext constant() throws RecognitionException { _localctx = new BooleanLiteralContext(_localctx); enterOuterAlt(_localctx, 3); { - setState(269); + setState(276); booleanValue(); } break; @@ -2232,7 +2257,7 @@ public final ConstantContext constant() throws RecognitionException { _localctx = new StringLiteralContext(_localctx); enterOuterAlt(_localctx, 4); { - setState(270); + setState(277); string(); } break; @@ -2284,7 +2309,7 @@ public final ComparisonOperatorContext comparisonOperator() throws RecognitionEx try { enterOuterAlt(_localctx, 1); { - setState(273); + setState(280); _la = _input.LA(1); if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << EQ) | (1L << NEQ) | (1L << LT) | (1L << LTE) | (1L << GT) | (1L << GTE))) != 0)) ) { _errHandler.recoverInline(this); @@ -2336,7 +2361,7 @@ public final BooleanValueContext booleanValue() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(275); + setState(282); _la = _input.LA(1); if ( !(_la==FALSE || _la==TRUE) ) { _errHandler.recoverInline(this); @@ -2409,44 +2434,44 @@ public final QualifiedNameContext qualifiedName() throws RecognitionException { int _alt; enterOuterAlt(_localctx, 1); { - setState(277); + setState(284); identifier(); - setState(289); + setState(296); _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,34,_ctx); + _alt = getInterpreter().adaptivePredict(_input,35,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { if ( _alt==1 ) { { - setState(287); + setState(294); _errHandler.sync(this); switch (_input.LA(1)) { case DOT: { - setState(278); + setState(285); match(DOT); - setState(279); + setState(286); identifier(); } break; case LB: { - setState(280); + setState(287); match(LB); - setState(282); + setState(289); _errHandler.sync(this); _la = _input.LA(1); do { { { - setState(281); + setState(288); match(INTEGER_VALUE); } } - setState(284); + setState(291); _errHandler.sync(this); _la = _input.LA(1); } while ( _la==INTEGER_VALUE ); - setState(286); + setState(293); match(RB); } break; @@ -2455,9 +2480,9 @@ public final QualifiedNameContext qualifiedName() throws RecognitionException { } } } - setState(291); + setState(298); _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,34,_ctx); + _alt = getInterpreter().adaptivePredict(_input,35,_ctx); } } } @@ -2501,7 +2526,7 @@ public final IdentifierContext identifier() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(292); + setState(299); _la = _input.LA(1); if ( !(_la==IDENTIFIER || _la==QUOTED_IDENTIFIER) ) { _errHandler.recoverInline(this); @@ -2556,14 +2581,14 @@ public final TimeUnitContext timeUnit() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(294); + setState(301); number(); - setState(296); + setState(303); _errHandler.sync(this); _la = _input.LA(1); if (_la==IDENTIFIER) { { - setState(295); + setState(302); ((TimeUnitContext)_localctx).unit = match(IDENTIFIER); } } @@ -2631,14 +2656,14 @@ public final NumberContext number() throws RecognitionException { NumberContext _localctx = new NumberContext(_ctx, getState()); enterRule(_localctx, 56, RULE_number); try { - setState(300); + setState(307); _errHandler.sync(this); switch (_input.LA(1)) { case DECIMAL_VALUE: _localctx = new DecimalLiteralContext(_localctx); enterOuterAlt(_localctx, 1); { - setState(298); + setState(305); match(DECIMAL_VALUE); } break; @@ -2646,7 +2671,7 @@ public final NumberContext number() throws RecognitionException { _localctx = new IntegerLiteralContext(_localctx); enterOuterAlt(_localctx, 2); { - setState(299); + setState(306); match(INTEGER_VALUE); } break; @@ -2692,7 +2717,7 @@ public final StringContext string() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(302); + setState(309); match(STRING); } } @@ -2736,7 +2761,7 @@ public final EventValueContext eventValue() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(304); + setState(311); _la = _input.LA(1); if ( !(_la==STRING || _la==IDENTIFIER) ) { _errHandler.recoverInline(this); @@ -2788,113 +2813,116 @@ private boolean operatorExpression_sempred(OperatorExpressionContext _localctx, } public static final String _serializedATN = - "\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3\64\u0135\4\2\t\2"+ + "\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3\64\u013c\4\2\t\2"+ "\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13"+ "\t\13\4\f\t\f\4\r\t\r\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22"+ "\4\23\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31\t\31"+ "\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\4\36\t\36\4\37\t\37\4 \t \3\2"+ "\3\2\3\2\3\3\3\3\3\3\3\4\3\4\7\4I\n\4\f\4\16\4L\13\4\3\5\3\5\3\5\5\5Q"+ "\n\5\3\6\3\6\3\6\3\6\3\6\3\7\3\7\3\7\5\7[\n\7\3\7\3\7\5\7_\n\7\5\7a\n"+ - "\7\3\7\3\7\6\7e\n\7\r\7\16\7f\3\7\3\7\5\7k\n\7\3\b\3\b\5\bo\n\b\3\b\3"+ - "\b\6\bs\n\b\r\b\16\bt\3\b\3\b\5\by\n\b\3\t\3\t\3\t\3\t\3\t\7\t\u0080\n"+ - "\t\f\t\16\t\u0083\13\t\5\t\u0085\n\t\3\n\3\n\3\n\3\n\7\n\u008b\n\n\f\n"+ - "\16\n\u008e\13\n\3\13\3\13\5\13\u0092\n\13\3\f\3\f\5\f\u0096\n\f\3\r\3"+ - "\r\3\r\3\r\3\16\3\16\3\17\3\17\5\17\u00a0\n\17\3\17\3\17\3\17\3\20\3\20"+ - "\3\21\3\21\3\21\3\21\3\21\3\21\3\21\5\21\u00ae\n\21\3\21\3\21\3\21\3\21"+ - "\3\21\3\21\7\21\u00b6\n\21\f\21\16\21\u00b9\13\21\3\22\3\22\3\22\3\22"+ - "\3\22\5\22\u00c0\n\22\3\23\3\23\3\23\5\23\u00c5\n\23\3\23\3\23\5\23\u00c9"+ - "\n\23\3\23\3\23\3\23\3\23\3\23\3\23\7\23\u00d1\n\23\f\23\16\23\u00d4\13"+ - "\23\3\24\5\24\u00d7\n\24\3\24\3\24\3\24\3\24\3\24\7\24\u00de\n\24\f\24"+ - "\16\24\u00e1\13\24\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\24\7\24\u00ec"+ - "\n\24\f\24\16\24\u00ef\13\24\3\24\3\24\5\24\u00f3\n\24\3\25\3\25\3\25"+ - "\3\25\3\25\3\25\3\25\5\25\u00fc\n\25\3\26\3\26\3\26\3\26\3\26\7\26\u0103"+ - "\n\26\f\26\16\26\u0106\13\26\5\26\u0108\n\26\3\26\3\26\3\27\3\27\3\30"+ - "\3\30\3\30\3\30\5\30\u0112\n\30\3\31\3\31\3\32\3\32\3\33\3\33\3\33\3\33"+ - "\3\33\6\33\u011d\n\33\r\33\16\33\u011e\3\33\7\33\u0122\n\33\f\33\16\33"+ - "\u0125\13\33\3\34\3\34\3\35\3\35\5\35\u012b\n\35\3\36\3\36\5\36\u012f"+ - "\n\36\3\37\3\37\3 \3 \3 \2\4 $!\2\4\6\b\n\f\16\20\22\24\26\30\32\34\36"+ - " \"$&(*,.\60\62\64\668:<>\2\13\3\2 !\3\2\"$\3\2\7\b\5\2\n\13\21\22\30"+ - "\30\4\2//\61\61\3\2\32\37\4\2\6\6\24\24\3\2/\60\4\2,,//\2\u0142\2@\3\2"+ - "\2\2\4C\3\2\2\2\6F\3\2\2\2\bP\3\2\2\2\nR\3\2\2\2\fW\3\2\2\2\16l\3\2\2"+ - "\2\20z\3\2\2\2\22\u0086\3\2\2\2\24\u008f\3\2\2\2\26\u0093\3\2\2\2\30\u0097"+ - "\3\2\2\2\32\u009b\3\2\2\2\34\u009f\3\2\2\2\36\u00a4\3\2\2\2 \u00ad\3\2"+ - "\2\2\"\u00bf\3\2\2\2$\u00c8\3\2\2\2&\u00f2\3\2\2\2(\u00fb\3\2\2\2*\u00fd"+ - "\3\2\2\2,\u010b\3\2\2\2.\u0111\3\2\2\2\60\u0113\3\2\2\2\62\u0115\3\2\2"+ - "\2\64\u0117\3\2\2\2\66\u0126\3\2\2\28\u0128\3\2\2\2:\u012e\3\2\2\2<\u0130"+ - "\3\2\2\2>\u0132\3\2\2\2@A\5\6\4\2AB\7\2\2\3B\3\3\2\2\2CD\5\36\20\2DE\7"+ - "\2\2\3E\5\3\2\2\2FJ\5\b\5\2GI\5\20\t\2HG\3\2\2\2IL\3\2\2\2JH\3\2\2\2J"+ - "K\3\2\2\2K\7\3\2\2\2LJ\3\2\2\2MQ\5\f\7\2NQ\5\16\b\2OQ\5\32\16\2PM\3\2"+ - "\2\2PN\3\2\2\2PO\3\2\2\2Q\t\3\2\2\2RS\7\27\2\2ST\7\f\2\2TU\7\31\2\2UV"+ - "\58\35\2V\13\3\2\2\2W`\7\23\2\2XZ\5\22\n\2Y[\5\n\6\2ZY\3\2\2\2Z[\3\2\2"+ - "\2[a\3\2\2\2\\^\5\n\6\2]_\5\22\n\2^]\3\2\2\2^_\3\2\2\2_a\3\2\2\2`X\3\2"+ - "\2\2`\\\3\2\2\2`a\3\2\2\2ab\3\2\2\2bd\5\26\f\2ce\5\26\f\2dc\3\2\2\2ef"+ - "\3\2\2\2fd\3\2\2\2fg\3\2\2\2gj\3\2\2\2hi\7\25\2\2ik\5\26\f\2jh\3\2\2\2"+ - "jk\3\2\2\2k\r\3\2\2\2ln\7\t\2\2mo\5\22\n\2nm\3\2\2\2no\3\2\2\2op\3\2\2"+ - "\2pr\5\24\13\2qs\5\24\13\2rq\3\2\2\2st\3\2\2\2tr\3\2\2\2tu\3\2\2\2ux\3"+ - "\2\2\2vw\7\25\2\2wy\5\24\13\2xv\3\2\2\2xy\3\2\2\2y\17\3\2\2\2z{\7+\2\2"+ - "{\u0084\7/\2\2|\u0081\5 \21\2}~\7&\2\2~\u0080\5 \21\2\177}\3\2\2\2\u0080"+ - "\u0083\3\2\2\2\u0081\177\3\2\2\2\u0081\u0082\3\2\2\2\u0082\u0085\3\2\2"+ - "\2\u0083\u0081\3\2\2\2\u0084|\3\2\2\2\u0084\u0085\3\2\2\2\u0085\21\3\2"+ - "\2\2\u0086\u0087\7\5\2\2\u0087\u008c\5\36\20\2\u0088\u0089\7&\2\2\u0089"+ - "\u008b\5\36\20\2\u008a\u0088\3\2\2\2\u008b\u008e\3\2\2\2\u008c\u008a\3"+ - "\2\2\2\u008c\u008d\3\2\2\2\u008d\23\3\2\2\2\u008e\u008c\3\2\2\2\u008f"+ - "\u0091\5\30\r\2\u0090\u0092\5\22\n\2\u0091\u0090\3\2\2\2\u0091\u0092\3"+ - "\2\2\2\u0092\25\3\2\2\2\u0093\u0095\5\30\r\2\u0094\u0096\5\22\n\2\u0095"+ - "\u0094\3\2\2\2\u0095\u0096\3\2\2\2\u0096\27\3\2\2\2\u0097\u0098\7\'\2"+ - "\2\u0098\u0099\5\34\17\2\u0099\u009a\7(\2\2\u009a\31\3\2\2\2\u009b\u009c"+ - "\5\34\17\2\u009c\33\3\2\2\2\u009d\u00a0\7\4\2\2\u009e\u00a0\5> \2\u009f"+ - "\u009d\3\2\2\2\u009f\u009e\3\2\2\2\u00a0\u00a1\3\2\2\2\u00a1\u00a2\7\26"+ - "\2\2\u00a2\u00a3\5\36\20\2\u00a3\35\3\2\2\2\u00a4\u00a5\5 \21\2\u00a5"+ - "\37\3\2\2\2\u00a6\u00a7\b\21\1\2\u00a7\u00a8\7\r\2\2\u00a8\u00ae\5 \21"+ - "\7\u00a9\u00aa\7/\2\2\u00aa\u00ab\7\17\2\2\u00ab\u00ae\5\30\r\2\u00ac"+ - "\u00ae\5\"\22\2\u00ad\u00a6\3\2\2\2\u00ad\u00a9\3\2\2\2\u00ad\u00ac\3"+ - "\2\2\2\u00ae\u00b7\3\2\2\2\u00af\u00b0\f\4\2\2\u00b0\u00b1\7\3\2\2\u00b1"+ - "\u00b6\5 \21\5\u00b2\u00b3\f\3\2\2\u00b3\u00b4\7\20\2\2\u00b4\u00b6\5"+ - " \21\4\u00b5\u00af\3\2\2\2\u00b5\u00b2\3\2\2\2\u00b6\u00b9\3\2\2\2\u00b7"+ - "\u00b5\3\2\2\2\u00b7\u00b8\3\2\2\2\u00b8!\3\2\2\2\u00b9\u00b7\3\2\2\2"+ - "\u00ba\u00c0\5$\23\2\u00bb\u00bc\5$\23\2\u00bc\u00bd\5\60\31\2\u00bd\u00be"+ - "\5$\23\2\u00be\u00c0\3\2\2\2\u00bf\u00ba\3\2\2\2\u00bf\u00bb\3\2\2\2\u00c0"+ - "#\3\2\2\2\u00c1\u00c2\b\23\1\2\u00c2\u00c4\5(\25\2\u00c3\u00c5\5&\24\2"+ - "\u00c4\u00c3\3\2\2\2\u00c4\u00c5\3\2\2\2\u00c5\u00c9\3\2\2\2\u00c6\u00c7"+ - "\t\2\2\2\u00c7\u00c9\5$\23\5\u00c8\u00c1\3\2\2\2\u00c8\u00c6\3\2\2\2\u00c9"+ - "\u00d2\3\2\2\2\u00ca\u00cb\f\4\2\2\u00cb\u00cc\t\3\2\2\u00cc\u00d1\5$"+ - "\23\5\u00cd\u00ce\f\3\2\2\u00ce\u00cf\t\2\2\2\u00cf\u00d1\5$\23\4\u00d0"+ - "\u00ca\3\2\2\2\u00d0\u00cd\3\2\2\2\u00d1\u00d4\3\2\2\2\u00d2\u00d0\3\2"+ - "\2\2\u00d2\u00d3\3\2\2\2\u00d3%\3\2\2\2\u00d4\u00d2\3\2\2\2\u00d5\u00d7"+ - "\7\r\2\2\u00d6\u00d5\3\2\2\2\u00d6\u00d7\3\2\2\2\u00d7\u00d8\3\2\2\2\u00d8"+ - "\u00d9\t\4\2\2\u00d9\u00da\7)\2\2\u00da\u00df\5\36\20\2\u00db\u00dc\7"+ - "&\2\2\u00dc\u00de\5\36\20\2\u00dd\u00db\3\2\2\2\u00de\u00e1\3\2\2\2\u00df"+ - "\u00dd\3\2\2\2\u00df\u00e0\3\2\2\2\u00e0\u00e2\3\2\2\2\u00e1\u00df\3\2"+ - "\2\2\u00e2\u00e3\7*\2\2\u00e3\u00f3\3\2\2\2\u00e4\u00e5\t\5\2\2\u00e5"+ - "\u00f3\5.\30\2\u00e6\u00e7\t\5\2\2\u00e7\u00e8\7)\2\2\u00e8\u00ed\5.\30"+ - "\2\u00e9\u00ea\7&\2\2\u00ea\u00ec\5.\30\2\u00eb\u00e9\3\2\2\2\u00ec\u00ef"+ - "\3\2\2\2\u00ed\u00eb\3\2\2\2\u00ed\u00ee\3\2\2\2\u00ee\u00f0\3\2\2\2\u00ef"+ - "\u00ed\3\2\2\2\u00f0\u00f1\7*\2\2\u00f1\u00f3\3\2\2\2\u00f2\u00d6\3\2"+ - "\2\2\u00f2\u00e4\3\2\2\2\u00f2\u00e6\3\2\2\2\u00f3\'\3\2\2\2\u00f4\u00fc"+ - "\5.\30\2\u00f5\u00fc\5*\26\2\u00f6\u00fc\5\64\33\2\u00f7\u00f8\7)\2\2"+ - "\u00f8\u00f9\5\36\20\2\u00f9\u00fa\7*\2\2\u00fa\u00fc\3\2\2\2\u00fb\u00f4"+ - "\3\2\2\2\u00fb\u00f5\3\2\2\2\u00fb\u00f6\3\2\2\2\u00fb\u00f7\3\2\2\2\u00fc"+ - ")\3\2\2\2\u00fd\u00fe\5,\27\2\u00fe\u0107\7)\2\2\u00ff\u0104\5\36\20\2"+ - "\u0100\u0101\7&\2\2\u0101\u0103\5\36\20\2\u0102\u0100\3\2\2\2\u0103\u0106"+ - "\3\2\2\2\u0104\u0102\3\2\2\2\u0104\u0105\3\2\2\2\u0105\u0108\3\2\2\2\u0106"+ - "\u0104\3\2\2\2\u0107\u00ff\3\2\2\2\u0107\u0108\3\2\2\2\u0108\u0109\3\2"+ - "\2\2\u0109\u010a\7*\2\2\u010a+\3\2\2\2\u010b\u010c\t\6\2\2\u010c-\3\2"+ - "\2\2\u010d\u0112\7\16\2\2\u010e\u0112\5:\36\2\u010f\u0112\5\62\32\2\u0110"+ - "\u0112\5<\37\2\u0111\u010d\3\2\2\2\u0111\u010e\3\2\2\2\u0111\u010f\3\2"+ - "\2\2\u0111\u0110\3\2\2\2\u0112/\3\2\2\2\u0113\u0114\t\7\2\2\u0114\61\3"+ - "\2\2\2\u0115\u0116\t\b\2\2\u0116\63\3\2\2\2\u0117\u0123\5\66\34\2\u0118"+ - "\u0119\7%\2\2\u0119\u0122\5\66\34\2\u011a\u011c\7\'\2\2\u011b\u011d\7"+ - "-\2\2\u011c\u011b\3\2\2\2\u011d\u011e\3\2\2\2\u011e\u011c\3\2\2\2\u011e"+ - "\u011f\3\2\2\2\u011f\u0120\3\2\2\2\u0120\u0122\7(\2\2\u0121\u0118\3\2"+ - "\2\2\u0121\u011a\3\2\2\2\u0122\u0125\3\2\2\2\u0123\u0121\3\2\2\2\u0123"+ - "\u0124\3\2\2\2\u0124\65\3\2\2\2\u0125\u0123\3\2\2\2\u0126\u0127\t\t\2"+ - "\2\u0127\67\3\2\2\2\u0128\u012a\5:\36\2\u0129\u012b\7/\2\2\u012a\u0129"+ - "\3\2\2\2\u012a\u012b\3\2\2\2\u012b9\3\2\2\2\u012c\u012f\7.\2\2\u012d\u012f"+ - "\7-\2\2\u012e\u012c\3\2\2\2\u012e\u012d\3\2\2\2\u012f;\3\2\2\2\u0130\u0131"+ - "\7,\2\2\u0131=\3\2\2\2\u0132\u0133\t\n\2\2\u0133?\3\2\2\2\'JPZ^`fjntx"+ - "\u0081\u0084\u008c\u0091\u0095\u009f\u00ad\u00b5\u00b7\u00bf\u00c4\u00c8"+ - "\u00d0\u00d2\u00d6\u00df\u00ed\u00f2\u00fb\u0104\u0107\u0111\u011e\u0121"+ - "\u0123\u012a\u012e"; + "\7\3\7\6\7d\n\7\r\7\16\7e\3\7\3\7\5\7j\n\7\3\b\3\b\5\bn\n\b\3\b\3\b\6"+ + "\br\n\b\r\b\16\bs\3\b\3\b\5\bx\n\b\3\t\3\t\3\t\3\t\3\t\7\t\177\n\t\f\t"+ + "\16\t\u0082\13\t\5\t\u0084\n\t\3\n\3\n\3\n\3\n\7\n\u008a\n\n\f\n\16\n"+ + "\u008d\13\n\3\13\3\13\5\13\u0091\n\13\3\f\3\f\5\f\u0095\n\f\3\f\3\f\3"+ + "\f\3\f\3\f\3\f\5\f\u009d\n\f\3\r\3\r\3\r\3\r\3\16\3\16\3\17\3\17\5\17"+ + "\u00a7\n\17\3\17\3\17\3\17\3\20\3\20\3\21\3\21\3\21\3\21\3\21\3\21\3\21"+ + "\5\21\u00b5\n\21\3\21\3\21\3\21\3\21\3\21\3\21\7\21\u00bd\n\21\f\21\16"+ + "\21\u00c0\13\21\3\22\3\22\3\22\3\22\3\22\5\22\u00c7\n\22\3\23\3\23\3\23"+ + "\5\23\u00cc\n\23\3\23\3\23\5\23\u00d0\n\23\3\23\3\23\3\23\3\23\3\23\3"+ + "\23\7\23\u00d8\n\23\f\23\16\23\u00db\13\23\3\24\5\24\u00de\n\24\3\24\3"+ + "\24\3\24\3\24\3\24\7\24\u00e5\n\24\f\24\16\24\u00e8\13\24\3\24\3\24\3"+ + "\24\3\24\3\24\3\24\3\24\3\24\3\24\7\24\u00f3\n\24\f\24\16\24\u00f6\13"+ + "\24\3\24\3\24\5\24\u00fa\n\24\3\25\3\25\3\25\3\25\3\25\3\25\3\25\5\25"+ + "\u0103\n\25\3\26\3\26\3\26\3\26\3\26\7\26\u010a\n\26\f\26\16\26\u010d"+ + "\13\26\5\26\u010f\n\26\3\26\3\26\3\27\3\27\3\30\3\30\3\30\3\30\5\30\u0119"+ + "\n\30\3\31\3\31\3\32\3\32\3\33\3\33\3\33\3\33\3\33\6\33\u0124\n\33\r\33"+ + "\16\33\u0125\3\33\7\33\u0129\n\33\f\33\16\33\u012c\13\33\3\34\3\34\3\35"+ + "\3\35\5\35\u0132\n\35\3\36\3\36\5\36\u0136\n\36\3\37\3\37\3 \3 \3 \2\4"+ + " $!\2\4\6\b\n\f\16\20\22\24\26\30\32\34\36 \"$&(*,.\60\62\64\668:<>\2"+ + "\13\3\2 !\3\2\"$\3\2\7\b\5\2\n\13\21\22\30\30\4\2//\61\61\3\2\32\37\4"+ + "\2\6\6\24\24\3\2/\60\4\2,,//\2\u014a\2@\3\2\2\2\4C\3\2\2\2\6F\3\2\2\2"+ + "\bP\3\2\2\2\nR\3\2\2\2\fW\3\2\2\2\16k\3\2\2\2\20y\3\2\2\2\22\u0085\3\2"+ + "\2\2\24\u008e\3\2\2\2\26\u0092\3\2\2\2\30\u009e\3\2\2\2\32\u00a2\3\2\2"+ + "\2\34\u00a6\3\2\2\2\36\u00ab\3\2\2\2 \u00b4\3\2\2\2\"\u00c6\3\2\2\2$\u00cf"+ + "\3\2\2\2&\u00f9\3\2\2\2(\u0102\3\2\2\2*\u0104\3\2\2\2,\u0112\3\2\2\2."+ + "\u0118\3\2\2\2\60\u011a\3\2\2\2\62\u011c\3\2\2\2\64\u011e\3\2\2\2\66\u012d"+ + "\3\2\2\28\u012f\3\2\2\2:\u0135\3\2\2\2<\u0137\3\2\2\2>\u0139\3\2\2\2@"+ + "A\5\6\4\2AB\7\2\2\3B\3\3\2\2\2CD\5\36\20\2DE\7\2\2\3E\5\3\2\2\2FJ\5\b"+ + "\5\2GI\5\20\t\2HG\3\2\2\2IL\3\2\2\2JH\3\2\2\2JK\3\2\2\2K\7\3\2\2\2LJ\3"+ + "\2\2\2MQ\5\f\7\2NQ\5\16\b\2OQ\5\32\16\2PM\3\2\2\2PN\3\2\2\2PO\3\2\2\2"+ + "Q\t\3\2\2\2RS\7\27\2\2ST\7\f\2\2TU\7\31\2\2UV\58\35\2V\13\3\2\2\2W`\7"+ + "\23\2\2XZ\5\22\n\2Y[\5\n\6\2ZY\3\2\2\2Z[\3\2\2\2[a\3\2\2\2\\^\5\n\6\2"+ + "]_\5\22\n\2^]\3\2\2\2^_\3\2\2\2_a\3\2\2\2`X\3\2\2\2`\\\3\2\2\2`a\3\2\2"+ + "\2ac\3\2\2\2bd\5\26\f\2cb\3\2\2\2de\3\2\2\2ec\3\2\2\2ef\3\2\2\2fi\3\2"+ + "\2\2gh\7\25\2\2hj\5\26\f\2ig\3\2\2\2ij\3\2\2\2j\r\3\2\2\2km\7\t\2\2ln"+ + "\5\22\n\2ml\3\2\2\2mn\3\2\2\2no\3\2\2\2oq\5\24\13\2pr\5\24\13\2qp\3\2"+ + "\2\2rs\3\2\2\2sq\3\2\2\2st\3\2\2\2tw\3\2\2\2uv\7\25\2\2vx\5\24\13\2wu"+ + "\3\2\2\2wx\3\2\2\2x\17\3\2\2\2yz\7+\2\2z\u0083\7/\2\2{\u0080\5 \21\2|"+ + "}\7&\2\2}\177\5 \21\2~|\3\2\2\2\177\u0082\3\2\2\2\u0080~\3\2\2\2\u0080"+ + "\u0081\3\2\2\2\u0081\u0084\3\2\2\2\u0082\u0080\3\2\2\2\u0083{\3\2\2\2"+ + "\u0083\u0084\3\2\2\2\u0084\21\3\2\2\2\u0085\u0086\7\5\2\2\u0086\u008b"+ + "\5\36\20\2\u0087\u0088\7&\2\2\u0088\u008a\5\36\20\2\u0089\u0087\3\2\2"+ + "\2\u008a\u008d\3\2\2\2\u008b\u0089\3\2\2\2\u008b\u008c\3\2\2\2\u008c\23"+ + "\3\2\2\2\u008d\u008b\3\2\2\2\u008e\u0090\5\30\r\2\u008f\u0091\5\22\n\2"+ + "\u0090\u008f\3\2\2\2\u0090\u0091\3\2\2\2\u0091\25\3\2\2\2\u0092\u0094"+ + "\5\30\r\2\u0093\u0095\5\22\n\2\u0094\u0093\3\2\2\2\u0094\u0095\3\2\2\2"+ + "\u0095\u009c\3\2\2\2\u0096\u0097\7\'\2\2\u0097\u0098\7/\2\2\u0098\u0099"+ + "\7\31\2\2\u0099\u009a\5:\36\2\u009a\u009b\7(\2\2\u009b\u009d\3\2\2\2\u009c"+ + "\u0096\3\2\2\2\u009c\u009d\3\2\2\2\u009d\27\3\2\2\2\u009e\u009f\7\'\2"+ + "\2\u009f\u00a0\5\34\17\2\u00a0\u00a1\7(\2\2\u00a1\31\3\2\2\2\u00a2\u00a3"+ + "\5\34\17\2\u00a3\33\3\2\2\2\u00a4\u00a7\7\4\2\2\u00a5\u00a7\5> \2\u00a6"+ + "\u00a4\3\2\2\2\u00a6\u00a5\3\2\2\2\u00a7\u00a8\3\2\2\2\u00a8\u00a9\7\26"+ + "\2\2\u00a9\u00aa\5\36\20\2\u00aa\35\3\2\2\2\u00ab\u00ac\5 \21\2\u00ac"+ + "\37\3\2\2\2\u00ad\u00ae\b\21\1\2\u00ae\u00af\7\r\2\2\u00af\u00b5\5 \21"+ + "\7\u00b0\u00b1\7/\2\2\u00b1\u00b2\7\17\2\2\u00b2\u00b5\5\30\r\2\u00b3"+ + "\u00b5\5\"\22\2\u00b4\u00ad\3\2\2\2\u00b4\u00b0\3\2\2\2\u00b4\u00b3\3"+ + "\2\2\2\u00b5\u00be\3\2\2\2\u00b6\u00b7\f\4\2\2\u00b7\u00b8\7\3\2\2\u00b8"+ + "\u00bd\5 \21\5\u00b9\u00ba\f\3\2\2\u00ba\u00bb\7\20\2\2\u00bb\u00bd\5"+ + " \21\4\u00bc\u00b6\3\2\2\2\u00bc\u00b9\3\2\2\2\u00bd\u00c0\3\2\2\2\u00be"+ + "\u00bc\3\2\2\2\u00be\u00bf\3\2\2\2\u00bf!\3\2\2\2\u00c0\u00be\3\2\2\2"+ + "\u00c1\u00c7\5$\23\2\u00c2\u00c3\5$\23\2\u00c3\u00c4\5\60\31\2\u00c4\u00c5"+ + "\5$\23\2\u00c5\u00c7\3\2\2\2\u00c6\u00c1\3\2\2\2\u00c6\u00c2\3\2\2\2\u00c7"+ + "#\3\2\2\2\u00c8\u00c9\b\23\1\2\u00c9\u00cb\5(\25\2\u00ca\u00cc\5&\24\2"+ + "\u00cb\u00ca\3\2\2\2\u00cb\u00cc\3\2\2\2\u00cc\u00d0\3\2\2\2\u00cd\u00ce"+ + "\t\2\2\2\u00ce\u00d0\5$\23\5\u00cf\u00c8\3\2\2\2\u00cf\u00cd\3\2\2\2\u00d0"+ + "\u00d9\3\2\2\2\u00d1\u00d2\f\4\2\2\u00d2\u00d3\t\3\2\2\u00d3\u00d8\5$"+ + "\23\5\u00d4\u00d5\f\3\2\2\u00d5\u00d6\t\2\2\2\u00d6\u00d8\5$\23\4\u00d7"+ + "\u00d1\3\2\2\2\u00d7\u00d4\3\2\2\2\u00d8\u00db\3\2\2\2\u00d9\u00d7\3\2"+ + "\2\2\u00d9\u00da\3\2\2\2\u00da%\3\2\2\2\u00db\u00d9\3\2\2\2\u00dc\u00de"+ + "\7\r\2\2\u00dd\u00dc\3\2\2\2\u00dd\u00de\3\2\2\2\u00de\u00df\3\2\2\2\u00df"+ + "\u00e0\t\4\2\2\u00e0\u00e1\7)\2\2\u00e1\u00e6\5\36\20\2\u00e2\u00e3\7"+ + "&\2\2\u00e3\u00e5\5\36\20\2\u00e4\u00e2\3\2\2\2\u00e5\u00e8\3\2\2\2\u00e6"+ + "\u00e4\3\2\2\2\u00e6\u00e7\3\2\2\2\u00e7\u00e9\3\2\2\2\u00e8\u00e6\3\2"+ + "\2\2\u00e9\u00ea\7*\2\2\u00ea\u00fa\3\2\2\2\u00eb\u00ec\t\5\2\2\u00ec"+ + "\u00fa\5.\30\2\u00ed\u00ee\t\5\2\2\u00ee\u00ef\7)\2\2\u00ef\u00f4\5.\30"+ + "\2\u00f0\u00f1\7&\2\2\u00f1\u00f3\5.\30\2\u00f2\u00f0\3\2\2\2\u00f3\u00f6"+ + "\3\2\2\2\u00f4\u00f2\3\2\2\2\u00f4\u00f5\3\2\2\2\u00f5\u00f7\3\2\2\2\u00f6"+ + "\u00f4\3\2\2\2\u00f7\u00f8\7*\2\2\u00f8\u00fa\3\2\2\2\u00f9\u00dd\3\2"+ + "\2\2\u00f9\u00eb\3\2\2\2\u00f9\u00ed\3\2\2\2\u00fa\'\3\2\2\2\u00fb\u0103"+ + "\5.\30\2\u00fc\u0103\5*\26\2\u00fd\u0103\5\64\33\2\u00fe\u00ff\7)\2\2"+ + "\u00ff\u0100\5\36\20\2\u0100\u0101\7*\2\2\u0101\u0103\3\2\2\2\u0102\u00fb"+ + "\3\2\2\2\u0102\u00fc\3\2\2\2\u0102\u00fd\3\2\2\2\u0102\u00fe\3\2\2\2\u0103"+ + ")\3\2\2\2\u0104\u0105\5,\27\2\u0105\u010e\7)\2\2\u0106\u010b\5\36\20\2"+ + "\u0107\u0108\7&\2\2\u0108\u010a\5\36\20\2\u0109\u0107\3\2\2\2\u010a\u010d"+ + "\3\2\2\2\u010b\u0109\3\2\2\2\u010b\u010c\3\2\2\2\u010c\u010f\3\2\2\2\u010d"+ + "\u010b\3\2\2\2\u010e\u0106\3\2\2\2\u010e\u010f\3\2\2\2\u010f\u0110\3\2"+ + "\2\2\u0110\u0111\7*\2\2\u0111+\3\2\2\2\u0112\u0113\t\6\2\2\u0113-\3\2"+ + "\2\2\u0114\u0119\7\16\2\2\u0115\u0119\5:\36\2\u0116\u0119\5\62\32\2\u0117"+ + "\u0119\5<\37\2\u0118\u0114\3\2\2\2\u0118\u0115\3\2\2\2\u0118\u0116\3\2"+ + "\2\2\u0118\u0117\3\2\2\2\u0119/\3\2\2\2\u011a\u011b\t\7\2\2\u011b\61\3"+ + "\2\2\2\u011c\u011d\t\b\2\2\u011d\63\3\2\2\2\u011e\u012a\5\66\34\2\u011f"+ + "\u0120\7%\2\2\u0120\u0129\5\66\34\2\u0121\u0123\7\'\2\2\u0122\u0124\7"+ + "-\2\2\u0123\u0122\3\2\2\2\u0124\u0125\3\2\2\2\u0125\u0123\3\2\2\2\u0125"+ + "\u0126\3\2\2\2\u0126\u0127\3\2\2\2\u0127\u0129\7(\2\2\u0128\u011f\3\2"+ + "\2\2\u0128\u0121\3\2\2\2\u0129\u012c\3\2\2\2\u012a\u0128\3\2\2\2\u012a"+ + "\u012b\3\2\2\2\u012b\65\3\2\2\2\u012c\u012a\3\2\2\2\u012d\u012e\t\t\2"+ + "\2\u012e\67\3\2\2\2\u012f\u0131\5:\36\2\u0130\u0132\7/\2\2\u0131\u0130"+ + "\3\2\2\2\u0131\u0132\3\2\2\2\u01329\3\2\2\2\u0133\u0136\7.\2\2\u0134\u0136"+ + "\7-\2\2\u0135\u0133\3\2\2\2\u0135\u0134\3\2\2\2\u0136;\3\2\2\2\u0137\u0138"+ + "\7,\2\2\u0138=\3\2\2\2\u0139\u013a\t\n\2\2\u013a?\3\2\2\2(JPZ^`eimsw\u0080"+ + "\u0083\u008b\u0090\u0094\u009c\u00a6\u00b4\u00bc\u00be\u00c6\u00cb\u00cf"+ + "\u00d7\u00d9\u00dd\u00e6\u00f4\u00f9\u0102\u010b\u010e\u0118\u0125\u0128"+ + "\u012a\u0131\u0135"; public static final ATN _ATN = new ATNDeserializer().deserialize(_serializedATN.toCharArray()); static { diff --git a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/LogicalPlanBuilder.java b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/LogicalPlanBuilder.java index 80eda6632adf9..4a7198ac7eea7 100644 --- a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/LogicalPlanBuilder.java +++ b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/LogicalPlanBuilder.java @@ -6,9 +6,10 @@ */ package org.elasticsearch.xpack.eql.parser; +import org.antlr.v4.runtime.Token; import org.antlr.v4.runtime.tree.ParseTree; -import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.set.Sets; +import org.elasticsearch.core.TimeValue; import org.elasticsearch.xpack.eql.parser.EqlBaseParser.BooleanExpressionContext; import org.elasticsearch.xpack.eql.parser.EqlBaseParser.EventFilterContext; import org.elasticsearch.xpack.eql.parser.EqlBaseParser.IntegerLiteralContext; @@ -62,7 +63,7 @@ public abstract class LogicalPlanBuilder extends ExpressionBuilder { - static final String FILTER_PIPE = "filter", HEAD_PIPE = "head", TAIL_PIPE = "tail"; + static final String FILTER_PIPE = "filter", HEAD_PIPE = "head", TAIL_PIPE = "tail", RUNS = "runs"; static final Set SUPPORTED_PIPES = Sets.newHashSet("count", FILTER_PIPE, HEAD_PIPE, "sort", TAIL_PIPE, "unique", "unique_count"); @@ -253,7 +254,45 @@ public Sequence visitSequence(SequenceContext ctx) { found); } } - queries.add(sequenceTerm); + // check runs + Token key = sequenceTermCtx.key; + if (key != null) { + String k = key.getText(); + if (RUNS.equals(k) == false) { + throw new ParsingException(source(key), "Unrecognized option [{}], expecting [{}]", k, RUNS); + } + } + + int runs = 1; + NumberContext numberCtx = sequenceTermCtx.number(); + if (numberCtx instanceof IntegerLiteralContext) { + Number number = (Number) visitIntegerLiteral((IntegerLiteralContext) numberCtx).fold(); + long value = number.longValue(); + if (value < 1) { + throw new ParsingException(source(numberCtx), "A positive runs value is required; found [{}]", value); + } + if (value > 100) { + throw new ParsingException(source(numberCtx), "A query cannot be repeated more than 100 times; found [{}]", value); + } + runs = (int) value; + } + + int numberOfQueries = queries.size() + runs; + if (numberOfQueries > 256) { + throw new ParsingException( + source(sequenceTermCtx), + "Sequence cannot contain more than 256 queries; found [{}]", + numberOfQueries + ); + } + + for (int i = 0; i < runs; i++) { + queries.add(sequenceTerm); + } + } + + if (queries.size() < 2) { + throw new ParsingException(source, "A sequence requires a minimum of 2 queries, found [{}]", queries.size()); } // until is already parsed through sequenceTerm() above @@ -266,7 +305,7 @@ public Sequence visitSequence(SequenceContext ctx) { return new Sequence(source, queries, until, maxSpan, fieldTimestamp(), fieldTiebreaker(), resultPosition()); } - public KeyedFilter visitSequenceTerm(SequenceTermContext ctx, List joinKeys) { + private KeyedFilter visitSequenceTerm(SequenceTermContext ctx, List joinKeys) { return keyedFilter(joinKeys, ctx, ctx.by, ctx.subquery()); } diff --git a/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/parser/LogicalPlanTests.java b/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/parser/LogicalPlanTests.java index 7b956feeede27..b5267a3241c90 100644 --- a/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/parser/LogicalPlanTests.java +++ b/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/parser/LogicalPlanTests.java @@ -179,6 +179,16 @@ public void testQuotedEventType() { assertEquals(new TimeValue(2, TimeUnit.SECONDS), maxSpan); } + public void testRepeatedQuery() throws Exception { + LogicalPlan plan = parser.createStatement("sequence " + " [any where true] [runs=2]" + " [any where true]"); + plan = defaultPipes(plan); + assertEquals(Sequence.class, plan.getClass()); + Sequence seq = (Sequence) plan; + + List queries = seq.queries(); + assertEquals(3, queries.size()); + } + private LogicalPlan wrapFilter(Expression exp) { LogicalPlan filter = new Filter(Source.EMPTY, relation(), exp); Order order = new Order(Source.EMPTY, timestamp(), OrderDirection.ASC, NullsPosition.FIRST); diff --git a/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/planner/QueryTranslatorFailTests.java b/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/planner/QueryTranslatorFailTests.java index ee1959e1caa36..bfd66f28337bc 100644 --- a/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/planner/QueryTranslatorFailTests.java +++ b/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/planner/QueryTranslatorFailTests.java @@ -7,6 +7,7 @@ package org.elasticsearch.xpack.eql.planner; +import org.elasticsearch.xpack.eql.EqlClientException; import org.elasticsearch.xpack.eql.analysis.VerificationException; import org.elasticsearch.xpack.ql.ParsingException; import org.elasticsearch.xpack.ql.QlIllegalArgumentException; @@ -208,9 +209,22 @@ public void testStringContainsWrongParams() { public void testLikeWithNumericField() { VerificationException e = expectThrows(VerificationException.class, - () -> plan("process where pid like \"*.exe\"")); + () -> plan("process where pid like \"*.exe\"") + ); String msg = e.getMessage(); assertEquals("Found 1 problem\n" + - "line 1:15: argument of [pid like \"*.exe\"] must be [string], found value [pid] type [long]", msg); + "line 1:15: argument of [pid like \"*.exe\"] must be [string], found value [pid] type [long]", msg); } + + public void testSequenceWithTooLittleQueries() throws Exception { + String s = errorParsing("sequence [any where true]"); + assertEquals("1:2: A sequence requires a minimum of 2 queries, found [1]", s); + } + + public void testSequenceWithIncorrectOption() throws Exception { + EqlClientException e = expectThrows(EqlClientException.class, () -> plan("sequence [any where true] [repeat=123]")); + String msg = e.getMessage(); + assertEquals("line 1:29: Unrecognized option [repeat], expecting [runs]", msg); + } + } From c364701280e6d71ccf9196071d0f601ce2adb2b4 Mon Sep 17 00:00:00 2001 From: Alan Woodward Date: Wed, 29 Sep 2021 13:53:13 +0100 Subject: [PATCH 056/250] Remove server jar accessDeclaredMembers permission (#78431) We added this permission to get CI passing with the initial lucene 9 upgrade, but it turns out this was only necessary for SPI reloading of analysis components, which we do separately. This commit removes the permission. --- .../main/resources/org/elasticsearch/bootstrap/security.policy | 2 -- 1 file changed, 2 deletions(-) diff --git a/server/src/main/resources/org/elasticsearch/bootstrap/security.policy b/server/src/main/resources/org/elasticsearch/bootstrap/security.policy index b7e02350c0d66..85f36cf300b35 100644 --- a/server/src/main/resources/org/elasticsearch/bootstrap/security.policy +++ b/server/src/main/resources/org/elasticsearch/bootstrap/security.policy @@ -22,8 +22,6 @@ grant codeBase "${codebase.elasticsearch-secure-sm}" { grant codeBase "${codebase.elasticsearch}" { // needed for loading plugins which may expect the context class loader to be set permission java.lang.RuntimePermission "setContextClassLoader"; - // needed for SPI class loading - permission java.lang.RuntimePermission "accessDeclaredMembers"; // needed by HotThreads to enable wait/block time accounting on demand permission java.lang.management.ManagementPermission "control"; }; From f4b5ef74165e3823da03d860dc52018c8d23f619 Mon Sep 17 00:00:00 2001 From: James Rodewig <40268737+jrodewig@users.noreply.github.com> Date: Wed, 29 Sep 2021 09:00:15 -0400 Subject: [PATCH 057/250] [DOCS] Remove `include_type_name` query parameter (#78394) Adds an 8.0 breaking change for PR #48632. --- .../migration/migrate_8_0/mappings.asciidoc | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/docs/reference/migration/migrate_8_0/mappings.asciidoc b/docs/reference/migration/migrate_8_0/mappings.asciidoc index 3e88cc6f65c72..71721120dd7d7 100644 --- a/docs/reference/migration/migrate_8_0/mappings.asciidoc +++ b/docs/reference/migration/migrate_8_0/mappings.asciidoc @@ -18,7 +18,6 @@ Use a maximum of 10 completion contexts in a completion field. Specifying more than 10 completion contexts will return an error. ==== - .Mapping API endpoints containing mapping types have been removed. [%collapsible] ==== @@ -108,4 +107,18 @@ These parameters have been removed in 8.0.0. In 8.0, you can no longer create mappings that include these parameters. However, 7.x indices that use these mapping parameters will continue to work. ==== + +.The `include_type_name` query parameter has been removed. +[%collapsible] +==== +*Details* + +The `include_type_name` query parameter has been removed from the index +creation, index template, and mapping APIs. Previously, you could set +`include_type_name` to `true` to indicate that requests and responses should +include a mapping type name. Mapping types have been removed in 8.x. + +*Impact* + +Discontinue use of the `include_type_name` query parameter. Requests that +include the parameter will return an error. +==== // end::notable-breaking-changes[] From 4544ab2dbbb2c005916d7bb0db459ed4c115879b Mon Sep 17 00:00:00 2001 From: James Rodewig <40268737+jrodewig@users.noreply.github.com> Date: Wed, 29 Sep 2021 09:10:30 -0400 Subject: [PATCH 058/250] [DOCS] Always enable file and native realms unless explicitly disabled (#78405) * [DOCS] Always enable file and native realms by default Adds an 8.0 breaking change for PR #69096. The copy is based on the 7.13 deprecation notice added with PR #69320. * reword * Update docs/reference/migration/migrate_8_0/security.asciidoc Co-authored-by: Yang Wang * Update docs/reference/migration/migrate_8_0/security.asciidoc Co-authored-by: Yang Wang Co-authored-by: Yang Wang --- .../migration/migrate_8_0/security.asciidoc | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/docs/reference/migration/migrate_8_0/security.asciidoc b/docs/reference/migration/migrate_8_0/security.asciidoc index e9179430e16e8..9a91b4b503cbc 100644 --- a/docs/reference/migration/migrate_8_0/security.asciidoc +++ b/docs/reference/migration/migrate_8_0/security.asciidoc @@ -6,6 +6,40 @@ //Installation and Upgrade Guide //tag::notable-breaking-changes[] +.The file and native realms are now enabled unless explicitly disabled. +[%collapsible] +==== +*Details* + +The file and native realms are now enabled unless explicitly disabled. If +explicitly disabled, the file and native realms remain disabled at all times. + +Previously, the file and native realms had the following implicit behaviors: + +* If the file and native realms were not configured, they were implicitly disabled +if any other realm was configured. + +* If no other realm was available because realms were either not configured, +not perrmitted by license, or explicitly disabled, the file and native realms +were enabled, even if explicitly disabled. + +*Impact* + +To explicilty disable the file or native realm, set the respective +`file..enabled` or `native..enabled` setting to `false` +under the `xpack.security.authc.realms` namespace in `elasticsearch.yml`. + +The following configuration example disables the native realm and the file realm. + +[source,yaml] +---- +xpack.security.authc.realms: + + native.realm1.enabled: false + file.realm2.enabled: false + + ... +---- +==== + .The realm `order` setting is now required. [%collapsible] ==== From 498e6e3d0fc1fac74b5a6cc0075b56c48f012a8b Mon Sep 17 00:00:00 2001 From: Benjamin Trent Date: Wed, 29 Sep 2021 09:11:42 -0400 Subject: [PATCH 059/250] [ML] adding docs for estimated heap and operations (#78376) Add docs for optionally supplying memory and operation estimates in put model --- .../df-analytics/apis/put-trained-models.asciidoc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/reference/ml/df-analytics/apis/put-trained-models.asciidoc b/docs/reference/ml/df-analytics/apis/put-trained-models.asciidoc index 07ca8304985ec..93bea72f9a0ad 100644 --- a/docs/reference/ml/df-analytics/apis/put-trained-models.asciidoc +++ b/docs/reference/ml/df-analytics/apis/put-trained-models.asciidoc @@ -373,6 +373,20 @@ An array of `trained_model` objects. Supported trained models are `tree` and (Optional, string) A human-readable description of the {infer} trained model. +`estimated_heap_memory_usage_bytes`::: +(Optional, integer) +The estimated heap usage in bytes to keep the trained model in memory. + +Can only be supplied if `defer_definition_decompression` is `true` or the +model definition is not supplied. + +`estimated_operations`::: +(Optional, integer) +The estimated number of operations to use the trained model during inference. + +Can only be supplied if `defer_definition_decompression` is `true` or the +model definition is not supplied. + //Begin inference_config `inference_config`:: (Required, object) From 036440610000118b5d6645eb92e847190ca9a77d Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Wed, 29 Sep 2021 16:31:10 +0200 Subject: [PATCH 060/250] Fix a potential NPE in DataStreamAlias#toString() (#78399) --- .../org/elasticsearch/cluster/metadata/DataStreamAlias.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/DataStreamAlias.java b/server/src/main/java/org/elasticsearch/cluster/metadata/DataStreamAlias.java index 3046c9d4ba039..5cc4555cb18ed 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/DataStreamAlias.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/DataStreamAlias.java @@ -326,7 +326,7 @@ public String toString() { "name='" + name + '\'' + ", dataStreams=" + dataStreams + ", writeDataStream='" + writeDataStream + '\'' + - ", filter=" + filter.string() + + ", filter=" + (filter != null ? filter.string() : "null") + '}'; } } From 59700a016dbda9ecbc742de374a028a01e909184 Mon Sep 17 00:00:00 2001 From: Hendrik Muhs Date: Wed, 29 Sep 2021 17:07:09 +0200 Subject: [PATCH 061/250] integrate transform deprecations into deprecation API (#78171) integrates transform deprecation checks into the deprecation API --- .../deprecation/DeprecationInfoAction.java | 8 ++ .../TransformDeprecationChecker.java | 75 +++++++++++++++++++ .../TransportDeprecationInfoAction.java | 4 +- 3 files changed, 85 insertions(+), 2 deletions(-) create mode 100644 x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/TransformDeprecationChecker.java diff --git a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/DeprecationInfoAction.java b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/DeprecationInfoAction.java index ba2b7b8ac21ae..9a01b8aa1e954 100644 --- a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/DeprecationInfoAction.java +++ b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/DeprecationInfoAction.java @@ -211,6 +211,14 @@ public static DeprecationInfoAction.Response from(ClusterState state, } } + // WORKAROUND: move transform deprecation issues into cluster_settings + List transformDeprecations = pluginSettingIssues.remove( + TransformDeprecationChecker.TRANSFORM_DEPRECATION_KEY + ); + if (transformDeprecations != null) { + clusterSettingsIssues.addAll(transformDeprecations); + } + return new DeprecationInfoAction.Response(clusterSettingsIssues, nodeSettingsIssues, indexSettingsIssues, pluginSettingIssues); } } diff --git a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/TransformDeprecationChecker.java b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/TransformDeprecationChecker.java new file mode 100644 index 0000000000000..9f3840d95a65a --- /dev/null +++ b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/TransformDeprecationChecker.java @@ -0,0 +1,75 @@ +/* + * 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.deprecation; + +import org.elasticsearch.action.ActionListener; +import org.elasticsearch.cluster.metadata.Metadata; +import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.xpack.core.action.util.PageParams; +import org.elasticsearch.xpack.core.deprecation.DeprecationIssue; +import org.elasticsearch.xpack.core.transform.action.GetTransformAction; +import org.elasticsearch.xpack.core.transform.transforms.TransformConfig; + +import java.util.ArrayList; +import java.util.List; + +public class TransformDeprecationChecker implements DeprecationChecker { + + public static final String TRANSFORM_DEPRECATION_KEY = "transform_settings"; + + @Override + public boolean enabled(Settings settings) { + // always enabled + return true; + } + + @Override + public void check(Components components, ActionListener deprecationIssueListener) { + + PageParams startPage = new PageParams(0, PageParams.DEFAULT_SIZE); + List issues = new ArrayList<>(); + recursiveGetTransformsAndCollectDeprecations( + components, + issues, + startPage, + ActionListener.wrap( + allIssues -> { deprecationIssueListener.onResponse(new CheckResult(getName(), allIssues)); }, + deprecationIssueListener::onFailure + ) + ); + } + + @Override + public String getName() { + return TRANSFORM_DEPRECATION_KEY; + } + + private void recursiveGetTransformsAndCollectDeprecations( + Components components, + List issues, + PageParams page, + ActionListener> listener + ) { + final GetTransformAction.Request request = new GetTransformAction.Request(Metadata.ALL); + request.setPageParams(page); + request.setAllowNoResources(true); + + components.client().execute(GetTransformAction.INSTANCE, request, ActionListener.wrap(getTransformResponse -> { + for (TransformConfig config : getTransformResponse.getTransformConfigurations()) { + issues.addAll(config.checkForDeprecations(components.xContentRegistry())); + } + if (getTransformResponse.getCount() >= (page.getFrom() + page.getSize())) { + PageParams nextPage = new PageParams(page.getFrom() + page.getSize(), PageParams.DEFAULT_SIZE); + recursiveGetTransformsAndCollectDeprecations(components, issues, nextPage, listener); + } else { + listener.onResponse(issues); + } + + }, listener::onFailure)); + } +} diff --git a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/TransportDeprecationInfoAction.java b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/TransportDeprecationInfoAction.java index 8550f9a5624e6..47ceb494efbb3 100644 --- a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/TransportDeprecationInfoAction.java +++ b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/TransportDeprecationInfoAction.java @@ -38,8 +38,8 @@ import static org.elasticsearch.xpack.deprecation.DeprecationChecks.INDEX_SETTINGS_CHECKS; public class TransportDeprecationInfoAction extends TransportMasterNodeReadAction { - private static final List PLUGIN_CHECKERS = List.of(new MlDeprecationChecker()); + DeprecationInfoAction.Response> { + private static final List PLUGIN_CHECKERS = List.of(new MlDeprecationChecker(), new TransformDeprecationChecker()); private static final Logger logger = LogManager.getLogger(TransportDeprecationInfoAction.class); private final NodeClient client; From dfdbb758e11e78fad8a007ea790f52416582144f Mon Sep 17 00:00:00 2001 From: Mark Vieira Date: Wed, 29 Sep 2021 08:07:50 -0700 Subject: [PATCH 062/250] Ensure docker test fixture preProcess task is always executed (#78421) --- .../testfixtures/TestFixturesPlugin.java | 1 - distribution/docker/build.gradle | 8 ++++---- distribution/docker/docker-compose.yml | 8 ++++---- qa/remote-clusters/build.gradle | 16 ++++++++-------- qa/remote-clusters/docker-compose.yml | 8 ++++---- x-pack/test/idp-fixture/build.gradle | 2 +- x-pack/test/idp-fixture/docker-compose.yml | 2 +- 7 files changed, 22 insertions(+), 23 deletions(-) diff --git a/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/testfixtures/TestFixturesPlugin.java b/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/testfixtures/TestFixturesPlugin.java index ea55c91be3722..d19b803d09e5a 100644 --- a/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/testfixtures/TestFixturesPlugin.java +++ b/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/testfixtures/TestFixturesPlugin.java @@ -77,7 +77,6 @@ public void apply(Project project) { project.getPluginManager().apply(DockerComposePlugin.class); TaskProvider preProcessFixture = project.getTasks().register("preProcessFixture", t -> { - t.getOutputs().dir(testfixturesDir); t.doFirst(new Action() { @Override public void execute(Task task) { diff --git a/distribution/docker/build.gradle b/distribution/docker/build.gradle index dc9e4544791c6..6d30753bef5b3 100644 --- a/distribution/docker/build.gradle +++ b/distribution/docker/build.gradle @@ -186,12 +186,12 @@ tasks.named("preProcessFixture").configure { doLast { // tests expect to have an empty repo project.delete( - "${buildDir}/repo", + "${testFixturesDir}/repo", ) createAndSetWritable( - "${buildDir}/repo", - "${buildDir}/logs/default-1", - "${buildDir}/logs/default-2", + "${testFixturesDir}/repo", + "${testFixturesDir}/logs/default-1", + "${testFixturesDir}/logs/default-2", ) } } diff --git a/distribution/docker/docker-compose.yml b/distribution/docker/docker-compose.yml index c5441934b01f4..defa5ed3c5970 100644 --- a/distribution/docker/docker-compose.yml +++ b/distribution/docker/docker-compose.yml @@ -33,10 +33,10 @@ services: - xpack.license.self_generated.type=trial - action.destructive_requires_name=false volumes: - - ./build/repo:/tmp/es-repo + - ./testfixtures_shared/repo:/tmp/es-repo - ./build/certs/testnode.pem:/usr/share/elasticsearch/config/testnode.pem - ./build/certs/testnode.crt:/usr/share/elasticsearch/config/testnode.crt - - ./build/logs/default-1:/usr/share/elasticsearch/logs + - ./testfixtures_shared/logs/default-1:/usr/share/elasticsearch/logs - ./docker-test-entrypoint.sh:/docker-test-entrypoint.sh ports: - "9200" @@ -86,10 +86,10 @@ services: - xpack.license.self_generated.type=trial - action.destructive_requires_name=false volumes: - - ./build/repo:/tmp/es-repo + - ./testfixtures_shared/repo:/tmp/es-repo - ./build/certs/testnode.pem:/usr/share/elasticsearch/config/testnode.pem - ./build/certs/testnode.crt:/usr/share/elasticsearch/config/testnode.crt - - ./build/logs/default-2:/usr/share/elasticsearch/logs + - ./testfixtures_shared/logs/default-2:/usr/share/elasticsearch/logs - ./docker-test-entrypoint.sh:/docker-test-entrypoint.sh ports: - "9200" diff --git a/qa/remote-clusters/build.gradle b/qa/remote-clusters/build.gradle index 0d6d629940546..6ffb2b857195e 100644 --- a/qa/remote-clusters/build.gradle +++ b/qa/remote-clusters/build.gradle @@ -49,16 +49,16 @@ tasks.named("preProcessFixture").configure { doLast { // tests expect to have an empty repo project.delete( - "${buildDir}/repo", - "${buildDir}/oss-repo" + "${testFixturesDir}/repo", + "${testFixturesDir}/oss-repo" ) createAndSetWritable( - "${buildDir}/repo", - "${buildDir}/oss-repo", - "${buildDir}/logs/default-1", - "${buildDir}/logs/default-2", - "${buildDir}/logs/oss-1", - "${buildDir}/logs/oss-2" + "${testFixturesDir}/repo", + "${testFixturesDir}/oss-repo", + "${testFixturesDir}/logs/default-1", + "${testFixturesDir}/logs/default-2", + "${testFixturesDir}/logs/oss-1", + "${testFixturesDir}/logs/oss-2" ) } } diff --git a/qa/remote-clusters/docker-compose.yml b/qa/remote-clusters/docker-compose.yml index 2847b05fdb280..55ec3a60a8365 100644 --- a/qa/remote-clusters/docker-compose.yml +++ b/qa/remote-clusters/docker-compose.yml @@ -34,10 +34,10 @@ services: - xpack.license.self_generated.type=trial - action.destructive_requires_name=false volumes: - - ./build/repo:/tmp/es-repo + - ./testfixtures_shared/repo:/tmp/es-repo - ./build/certs/testnode.pem:/usr/share/elasticsearch/config/testnode.pem - ./build/certs/testnode.crt:/usr/share/elasticsearch/config/testnode.crt - - ./build/logs/default-1:/usr/share/elasticsearch/logs + - ./testfixtures_shared/logs/default-1:/usr/share/elasticsearch/logs - ./docker-test-entrypoint.sh:/docker-test-entrypoint.sh ports: - "9200" @@ -89,10 +89,10 @@ services: - xpack.license.self_generated.type=trial - action.destructive_requires_name=false volumes: - - ./build/repo:/tmp/es-repo + - ./testfixtures_shared/repo:/tmp/es-repo - ./build/certs/testnode.pem:/usr/share/elasticsearch/config/testnode.pem - ./build/certs/testnode.crt:/usr/share/elasticsearch/config/testnode.crt - - ./build/logs/default-2:/usr/share/elasticsearch/logs + - ./testfixtures_shared/logs/default-2:/usr/share/elasticsearch/logs - ./docker-test-entrypoint.sh:/docker-test-entrypoint.sh ports: - "9200" diff --git a/x-pack/test/idp-fixture/build.gradle b/x-pack/test/idp-fixture/build.gradle index c41ff7729ed73..75e152bafae2e 100644 --- a/x-pack/test/idp-fixture/build.gradle +++ b/x-pack/test/idp-fixture/build.gradle @@ -27,7 +27,7 @@ elasticsearch_distributions { tasks.named("preProcessFixture").configure { dependsOn "copyKeystore", elasticsearch_distributions.docker doLast { - File file = file("${buildDir}/logs/node1") + File file = file("${testFixturesDir}/logs/node1") file.mkdirs() file.setWritable(true, false) } diff --git a/x-pack/test/idp-fixture/docker-compose.yml b/x-pack/test/idp-fixture/docker-compose.yml index ee9ba763272e3..12c7750d8e1ea 100644 --- a/x-pack/test/idp-fixture/docker-compose.yml +++ b/x-pack/test/idp-fixture/docker-compose.yml @@ -93,7 +93,7 @@ services: - xpack.security.authc.realms.oidc.c2id-jwt.claims.mail=email - xpack.security.authc.realms.oidc.c2id-jwt.claims.groups=groups volumes: - - ./build/logs/node1:/usr/share/elasticsearch/logs + - ./testfixtures_shared/logs/node1:/usr/share/elasticsearch/logs - ./build/certs/testnode.jks:/usr/share/elasticsearch/config/testnode.jks - ./docker-test-entrypoint.sh:/docker-test-entrypoint.sh - ./oidc/op-jwks.json:/usr/share/elasticsearch/config/op-jwks.json From 6a68bed10ba5e0a33d9341143081588d142a5ad5 Mon Sep 17 00:00:00 2001 From: Artem Prigoda Date: Wed, 29 Sep 2021 17:17:20 +0200 Subject: [PATCH 063/250] Revert "Report shard counts for ongoing snapshots (#77622)" (#78458) This reverts commit 52e73fe73d3dc50f295c8ca325e72544b388b829. --- .../snapshots/GetSnapshotsIT.java | 13 +----- .../SharedClusterSnapshotRestoreIT.java | 4 -- .../snapshots/SnapshotStatusApisIT.java | 11 +---- .../elasticsearch/snapshots/SnapshotInfo.java | 44 +++++++------------ 4 files changed, 21 insertions(+), 51 deletions(-) diff --git a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/GetSnapshotsIT.java b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/GetSnapshotsIT.java index 48341b0ad746f..12bb6c5e226e6 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/GetSnapshotsIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/GetSnapshotsIT.java @@ -14,7 +14,6 @@ import org.elasticsearch.action.admin.cluster.snapshots.get.GetSnapshotsRequest; import org.elasticsearch.action.admin.cluster.snapshots.get.GetSnapshotsRequestBuilder; import org.elasticsearch.action.admin.cluster.snapshots.get.GetSnapshotsResponse; -import org.elasticsearch.cluster.SnapshotsInProgress; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.search.sort.SortOrder; import org.elasticsearch.threadpool.ThreadPool; @@ -178,20 +177,12 @@ public void testSortAndPaginateWithInProgress() throws Exception { inProgressSnapshots.add(startFullSnapshot(repoName, snapshotName)); } awaitNumberOfSnapshotsInProgress(inProgressCount); - awaitClusterState( - state -> state.custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY) - .entries() - .stream() - .flatMap(s -> s.shards().stream()) - .allMatch( - e -> e.getKey().getIndexName().equals("test-index-1") == false - || e.getValue().state() == SnapshotsInProgress.ShardState.SUCCESS - ) - ); + final String[] repos = { repoName }; assertStablePagination(repos, allSnapshotNames, GetSnapshotsRequest.SortBy.START_TIME); assertStablePagination(repos, allSnapshotNames, GetSnapshotsRequest.SortBy.NAME); assertStablePagination(repos, allSnapshotNames, GetSnapshotsRequest.SortBy.INDICES); + assertThat( clusterAdmin().prepareGetSnapshots(matchAllPattern()) .setSnapshots(GetSnapshotsRequest.CURRENT_SNAPSHOT, "-snap*") diff --git a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/SharedClusterSnapshotRestoreIT.java b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/SharedClusterSnapshotRestoreIT.java index f258387e646f2..20ec6259e2180 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/SharedClusterSnapshotRestoreIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/SharedClusterSnapshotRestoreIT.java @@ -1207,10 +1207,6 @@ public void testSnapshotStatus() throws Exception { assertThat(getResponse.getSnapshots().size(), equalTo(1)); SnapshotInfo snapshotInfo = getResponse.getSnapshots().get(0); assertThat(snapshotInfo.state(), equalTo(SnapshotState.IN_PROGRESS)); - snapshotStatus = client.admin().cluster().prepareSnapshotStatus().execute().actionGet().getSnapshots().get(0); - assertThat(snapshotInfo.totalShards(), equalTo(snapshotStatus.getIndices().get("test-idx").getShardsStats().getTotalShards())); - assertThat(snapshotInfo.successfulShards(), equalTo(snapshotStatus.getIndices().get("test-idx").getShardsStats().getDoneShards())); - assertThat(snapshotInfo.shardFailures().size(), equalTo(0)); logger.info("--> unblocking blocked node"); unblockNode("test-repo", blockedNode); diff --git a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/SnapshotStatusApisIT.java b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/SnapshotStatusApisIT.java index 2df49de96a2da..860d5544dd803 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/SnapshotStatusApisIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/SnapshotStatusApisIT.java @@ -409,8 +409,7 @@ public void testGetSnapshotsMultipleRepos() throws Exception { public void testGetSnapshotsWithSnapshotInProgress() throws Exception { createRepository("test-repo", "mock", Settings.builder().put("location", randomRepoPath()).put("block_on_data", true)); - String indexName = "test-idx-1"; - createIndexWithContent(indexName, indexSettingsNoReplicas(randomIntBetween(1, 10)).build()); + createIndexWithContent("test-idx-1"); ensureGreen(); ActionFuture createSnapshotResponseActionFuture = startFullSnapshot("test-repo", "test-snap"); @@ -427,13 +426,7 @@ public void testGetSnapshotsWithSnapshotInProgress() throws Exception { .get(); List snapshotInfoList = response1.getSnapshots(); assertEquals(1, snapshotInfoList.size()); - SnapshotInfo snapshotInfo = snapshotInfoList.get(0); - assertEquals(SnapshotState.IN_PROGRESS, snapshotInfo.state()); - - SnapshotStatus snapshotStatus = client().admin().cluster().prepareSnapshotStatus().execute().actionGet().getSnapshots().get(0); - assertThat(snapshotInfo.totalShards(), equalTo(snapshotStatus.getIndices().get(indexName).getShardsStats().getTotalShards())); - assertThat(snapshotInfo.successfulShards(), equalTo(snapshotStatus.getIndices().get(indexName).getShardsStats().getDoneShards())); - assertThat(snapshotInfo.shardFailures().size(), equalTo(0)); + assertEquals(SnapshotState.IN_PROGRESS, snapshotInfoList.get(0).state()); String notExistedSnapshotName = "snapshot_not_exist"; GetSnapshotsResponse response2 = client().admin() diff --git a/server/src/main/java/org/elasticsearch/snapshots/SnapshotInfo.java b/server/src/main/java/org/elasticsearch/snapshots/SnapshotInfo.java index f6d14742456c1..933f9d926b107 100644 --- a/server/src/main/java/org/elasticsearch/snapshots/SnapshotInfo.java +++ b/server/src/main/java/org/elasticsearch/snapshots/SnapshotInfo.java @@ -7,8 +7,6 @@ */ package org.elasticsearch.snapshots; -import com.carrotsearch.hppc.cursors.ObjectObjectCursor; - import org.elasticsearch.Version; import org.elasticsearch.action.ShardOperationFailedException; import org.elasticsearch.action.admin.cluster.snapshots.get.GetSnapshotsRequest; @@ -30,7 +28,6 @@ import org.elasticsearch.common.xcontent.XContentParserUtils; import org.elasticsearch.core.Nullable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.rest.RestStatus; import java.io.IOException; @@ -373,30 +370,23 @@ public SnapshotInfo( } public SnapshotInfo(SnapshotsInProgress.Entry entry) { - int successfulShards = 0; - List shardFailures = new ArrayList<>(); - for (ObjectObjectCursor c : entry.shards()) { - if (c.value.state() == SnapshotsInProgress.ShardState.SUCCESS) { - successfulShards++; - } else if (c.value.state() == SnapshotsInProgress.ShardState.FAILED) { - shardFailures.add(new SnapshotShardFailure(c.value.nodeId(), c.key, c.value.reason())); - } - } - this.snapshot = Objects.requireNonNull(entry.snapshot()); - this.indices = List.copyOf(entry.indices().keySet()); - this.dataStreams = List.copyOf(entry.dataStreams()); - this.featureStates = List.copyOf(entry.featureStates()); - this.state = SnapshotState.IN_PROGRESS; - this.reason = null; - this.version = Version.CURRENT; - this.startTime = entry.startTime(); - this.endTime = 0L; - this.totalShards = entry.shards().size(); - this.successfulShards = successfulShards; - this.shardFailures = Collections.unmodifiableList(shardFailures); - this.includeGlobalState = entry.includeGlobalState(); - this.userMetadata = entry.userMetadata() == null ? null : Map.copyOf(entry.userMetadata()); - this.indexSnapshotDetails = Collections.emptyMap(); + this( + entry.snapshot(), + List.copyOf(entry.indices().keySet()), + entry.dataStreams(), + entry.featureStates(), + null, + Version.CURRENT, + entry.startTime(), + 0L, + 0, + 0, + Collections.emptyList(), + entry.includeGlobalState(), + entry.userMetadata(), + SnapshotState.IN_PROGRESS, + Collections.emptyMap() + ); } public SnapshotInfo( From 6870cdfdccd2e9f748045276bb736d27d4d3e7a9 Mon Sep 17 00:00:00 2001 From: Mark Vieira Date: Wed, 29 Sep 2021 08:37:57 -0700 Subject: [PATCH 064/250] Increase CI job data retention period --- .ci/jobs.t/defaults.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/jobs.t/defaults.yml b/.ci/jobs.t/defaults.yml index b09ceb1256fbc..fa59584cefeed 100644 --- a/.ci/jobs.t/defaults.yml +++ b/.ci/jobs.t/defaults.yml @@ -15,7 +15,7 @@ concurrent: true logrotate: daysToKeep: 30 - numToKeep: 90 + numToKeep: 500 artifactDaysToKeep: 7 parameters: - string: From bd51d1df88901f2685f8621ab6f55d1c581ec5fb Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Wed, 29 Sep 2021 09:10:36 -0700 Subject: [PATCH 065/250] Revert "Remove shard multiple data path selections. (#75822)" (#78416) This reverts commit 4d8d88b97d71832aa96d0cbbcad7d6a14a90195e. relates #71205 --- .../org/elasticsearch/index/IndexService.java | 40 +++++++++++++++++-- .../elasticsearch/index/shard/ShardPath.java | 4 +- 2 files changed, 39 insertions(+), 5 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/index/IndexService.java b/server/src/main/java/org/elasticsearch/index/IndexService.java index 5c156847942c6..8ac8c4f455aee 100644 --- a/server/src/main/java/org/elasticsearch/index/IndexService.java +++ b/server/src/main/java/org/elasticsearch/index/IndexService.java @@ -23,18 +23,18 @@ import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.routing.ShardRouting; import org.elasticsearch.cluster.service.ClusterService; +import org.elasticsearch.core.CheckedFunction; +import org.elasticsearch.core.Nullable; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Setting.Property; import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.BigArrays; import org.elasticsearch.common.util.Maps; import org.elasticsearch.common.util.concurrent.AbstractAsyncTask; import org.elasticsearch.common.util.concurrent.AbstractRunnable; import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.core.CheckedFunction; -import org.elasticsearch.core.Nullable; -import org.elasticsearch.core.TimeValue; import org.elasticsearch.core.internal.io.IOUtils; import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.env.ShardLock; @@ -77,6 +77,7 @@ import java.io.Closeable; import java.io.IOException; +import java.nio.file.Path; import java.util.Collections; import java.util.HashMap; import java.util.Iterator; @@ -91,6 +92,7 @@ import java.util.function.Consumer; import java.util.function.Function; import java.util.function.LongSupplier; +import java.util.function.LongUnaryOperator; import java.util.function.Supplier; import static java.util.Collections.emptyMap; @@ -366,6 +368,21 @@ public String indexUUID() { return indexSettings.getUUID(); } + // NOTE: O(numShards) cost, but numShards should be smallish? + private long getAvgShardSizeInBytes() throws IOException { + long sum = 0; + int count = 0; + for (IndexShard indexShard : this) { + sum += indexShard.store().stats(0L, LongUnaryOperator.identity()).sizeInBytes(); + count++; + } + if (count == 0) { + return -1L; + } else { + return sum / count; + } + } + public synchronized IndexShard createShard( final ShardRouting routing, final Consumer globalCheckpointSyncer, @@ -404,7 +421,22 @@ public synchronized IndexShard createShard( } if (path == null) { - path = ShardPath.selectNewPathForShard(nodeEnv, shardId, this.indexSettings); + // TODO: we should, instead, hold a "bytes reserved" of how large we anticipate this shard will be, e.g. for a shard + // that's being relocated/replicated we know how large it will become once it's done copying: + // Count up how many shards are currently on each data path: + Map dataPathToShardCount = new HashMap<>(); + for (IndexShard shard : this) { + Path dataPath = shard.shardPath().getRootStatePath(); + Integer curCount = dataPathToShardCount.get(dataPath); + if (curCount == null) { + curCount = 0; + } + dataPathToShardCount.put(dataPath, curCount + 1); + } + path = ShardPath.selectNewPathForShard(nodeEnv, shardId, this.indexSettings, + routing.getExpectedShardSize() == ShardRouting.UNAVAILABLE_EXPECTED_SHARD_SIZE + ? getAvgShardSizeInBytes() : routing.getExpectedShardSize(), + dataPathToShardCount); logger.debug("{} creating using a new path [{}]", shardId, path); } else { logger.debug("{} creating using an existing path [{}]", shardId, path); diff --git a/server/src/main/java/org/elasticsearch/index/shard/ShardPath.java b/server/src/main/java/org/elasticsearch/index/shard/ShardPath.java index 144ec49b0ac49..12172d09fe0af 100644 --- a/server/src/main/java/org/elasticsearch/index/shard/ShardPath.java +++ b/server/src/main/java/org/elasticsearch/index/shard/ShardPath.java @@ -19,6 +19,7 @@ import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; +import java.util.Map; import java.util.Objects; import java.util.function.Consumer; @@ -164,7 +165,8 @@ public static void deleteLeftoverShardDirectory( } } - public static ShardPath selectNewPathForShard(NodeEnvironment env, ShardId shardId, IndexSettings indexSettings) { + public static ShardPath selectNewPathForShard(NodeEnvironment env, ShardId shardId, IndexSettings indexSettings, + long avgShardSizeInBytes, Map dataPathToShardCount) throws IOException { final Path dataPath; final Path statePath; From 5ff82e2a6ee2c754720d81c090e46d48f8530994 Mon Sep 17 00:00:00 2001 From: zhangchao <80152403@qq.com> Date: Thu, 30 Sep 2021 00:59:56 +0800 Subject: [PATCH 066/250] Support mem type in nodes hot_threads API (#72850) Add new HotThreads report type to capture allocated memory per Elasticsearch thread. --- .../action/admin/HotThreadsIT.java | 5 +- .../elasticsearch/monitor/jvm/HotThreads.java | 48 +++++-- .../monitor/jvm/SunThreadInfo.java | 93 +++++++++++++ .../monitor/jvm/HotThreadsTests.java | 131 ++++++++++++++---- 4 files changed, 238 insertions(+), 39 deletions(-) create mode 100644 server/src/main/java/org/elasticsearch/monitor/jvm/SunThreadInfo.java diff --git a/server/src/internalClusterTest/java/org/elasticsearch/action/admin/HotThreadsIT.java b/server/src/internalClusterTest/java/org/elasticsearch/action/admin/HotThreadsIT.java index f7a00f85c6e78..ef0ff769cf56c 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/action/admin/HotThreadsIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/action/admin/HotThreadsIT.java @@ -55,7 +55,10 @@ public void testHotThreadsDontFail() throws ExecutionException, InterruptedExcep } nodesHotThreadsRequestBuilder.setIgnoreIdleThreads(randomBoolean()); if (randomBoolean()) { - switch (randomIntBetween(0, 2)) { + switch (randomIntBetween(0, 3)) { + case 3: + type = "mem"; + break; case 2: type = "cpu"; break; diff --git a/server/src/main/java/org/elasticsearch/monitor/jvm/HotThreads.java b/server/src/main/java/org/elasticsearch/monitor/jvm/HotThreads.java index c3eee471de707..faa4d3d87ff1d 100644 --- a/server/src/main/java/org/elasticsearch/monitor/jvm/HotThreads.java +++ b/server/src/main/java/org/elasticsearch/monitor/jvm/HotThreads.java @@ -11,6 +11,7 @@ import org.apache.lucene.util.CollectionUtil; import org.elasticsearch.ElasticsearchException; import org.elasticsearch.common.time.DateFormatter; +import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; import java.lang.management.ManagementFactory; @@ -63,7 +64,8 @@ public enum ReportType { CPU("cpu"), WAIT("wait"), - BLOCK("block"); + BLOCK("block"), + MEM("mem"); private final String type; @@ -117,7 +119,7 @@ public HotThreads type(ReportType type) { public String detect() throws Exception { synchronized (mutex) { - return innerDetect(ManagementFactory.getThreadMXBean(), Thread.currentThread().getId()); + return innerDetect(ManagementFactory.getThreadMXBean(), SunThreadInfo.INSTANCE, Thread.currentThread().getId()); } } @@ -145,7 +147,7 @@ static boolean isIdleThread(ThreadInfo threadInfo) { return false; } - Map getAllValidThreadInfos(ThreadMXBean threadBean, long currentThreadId) { + Map getAllValidThreadInfos(ThreadMXBean threadBean, SunThreadInfo sunThreadInfo, long currentThreadId) { long[] threadIds = threadBean.getAllThreadIds(); ThreadInfo[] threadInfos = threadBean.getThreadInfo(threadIds); Map result = new HashMap<>(threadIds.length); @@ -158,7 +160,8 @@ Map getAllValidThreadInfos(ThreadMXBean threadBean, if (cpuTime == INVALID_TIMING) { continue; } - result.put(threadIds[i], new ThreadTimeAccumulator(threadInfos[i], cpuTime)); + long allocatedBytes = type == ReportType.MEM ? sunThreadInfo.getThreadAllocatedBytes(threadIds[i]) : 0; + result.put(threadIds[i], new ThreadTimeAccumulator(threadInfos[i], cpuTime, allocatedBytes)); } return result; @@ -186,11 +189,15 @@ private void setThreadWaitBlockTimeMonitoringEnabled(ThreadMXBean threadBean, bo } } - String innerDetect(ThreadMXBean threadBean, long currentThreadId) throws Exception { + String innerDetect(ThreadMXBean threadBean, SunThreadInfo sunThreadInfo, long currentThreadId) throws Exception { if (threadBean.isThreadCpuTimeSupported() == false) { throw new ElasticsearchException("thread CPU time is not supported on this JDK"); } + if (type == ReportType.MEM && sunThreadInfo.isThreadAllocatedMemorySupported() == false) { + throw new ElasticsearchException("thread allocated memory is not supported on this JDK"); + } + StringBuilder sb = new StringBuilder() .append("Hot threads at ") .append(DATE_TIME_FORMATTER.format(LocalDateTime.now(Clock.systemUTC()))) @@ -207,9 +214,9 @@ String innerDetect(ThreadMXBean threadBean, long currentThreadId) throws Excepti try { // Capture before and after thread state with timings - Map previousThreadInfos = getAllValidThreadInfos(threadBean, currentThreadId); + Map previousThreadInfos = getAllValidThreadInfos(threadBean, sunThreadInfo, currentThreadId); Thread.sleep(interval.millis()); - Map latestThreadInfos = getAllValidThreadInfos(threadBean, currentThreadId); + Map latestThreadInfos = getAllValidThreadInfos(threadBean, sunThreadInfo, currentThreadId); latestThreadInfos.forEach((threadId, accumulator) -> accumulator.subtractPrevious(previousThreadInfos.get(threadId))); @@ -225,7 +232,7 @@ String innerDetect(ThreadMXBean threadBean, long currentThreadId) throws Excepti ThreadInfo[][] allInfos = captureThreadStacks(threadBean, topThreadIds); for (int t = 0; t < topThreads.size(); t++) { - long time = getter.applyAsLong(topThreads.get(t)); + long timeOrBytes = getter.applyAsLong(topThreads.get(t)); String threadName = null; for (ThreadInfo[] info : allInfos) { if (info != null && info[t] != null) { @@ -240,9 +247,15 @@ String innerDetect(ThreadMXBean threadBean, long currentThreadId) throws Excepti if (threadName == null) { continue; // thread is not alive yet or died before the first snapshot - ignore it! } - double percent = (((double) time) / interval.nanos()) * 100; - sb.append(String.format(Locale.ROOT, "%n%4.1f%% (%s out of %s) %s usage by thread '%s'%n", - percent, TimeValue.timeValueNanos(time), interval, type.getTypeValue(), threadName)); + + if (type == ReportType.MEM) { + sb.append(String.format(Locale.ROOT, "%n%s memory allocated by thread '%s'%n", + new ByteSizeValue(timeOrBytes), threadName)); + } else { + double percent = (((double) timeOrBytes) / interval.nanos()) * 100; + sb.append(String.format(Locale.ROOT, "%n%4.1f%% (%s out of %s) %s usage by thread '%s'%n", + percent, TimeValue.timeValueNanos(timeOrBytes), interval, type.getTypeValue(), threadName)); + } // for each snapshot (2nd array index) find later snapshot for same thread with max number of // identical StackTraceElements (starting from end of each) boolean[] done = new boolean[threadElementsSnapshotCount]; @@ -311,11 +324,13 @@ static class ThreadTimeAccumulator { private long cpuTime; private long blockedTime; private long waitedTime; + private long allocatedBytes; - ThreadTimeAccumulator(ThreadInfo info, long cpuTime) { + ThreadTimeAccumulator(ThreadInfo info, long cpuTime, long allocatedBytes) { this.blockedTime = info.getBlockedTime(); this.waitedTime = info.getWaitedTime(); this.cpuTime = cpuTime; + this.allocatedBytes = allocatedBytes; this.threadId = info.getThreadId(); } @@ -329,6 +344,7 @@ void subtractPrevious(ThreadTimeAccumulator previous) { this.blockedTime -= previous.blockedTime; this.waitedTime -= previous.waitedTime; this.cpuTime -= previous.cpuTime; + this.allocatedBytes -= previous.allocatedBytes; } } @@ -346,6 +362,10 @@ public long getWaitedTime() { return Math.max(waitedTime, 0); } + public long getAllocatedBytes() { + return Math.max(allocatedBytes, 0); + } + public long getThreadId() { return threadId; } @@ -358,8 +378,10 @@ static ToLongFunction valueGetterForReportType(ReportType return ThreadTimeAccumulator::getWaitedTime; case BLOCK: return ThreadTimeAccumulator::getBlockedTime; + case MEM: + return ThreadTimeAccumulator::getAllocatedBytes; } - throw new IllegalArgumentException("expected thread type to be either 'cpu', 'wait', or 'block', but was " + type); + throw new IllegalArgumentException("expected thread type to be either 'cpu', 'wait', 'mem', or 'block', but was " + type); } } } diff --git a/server/src/main/java/org/elasticsearch/monitor/jvm/SunThreadInfo.java b/server/src/main/java/org/elasticsearch/monitor/jvm/SunThreadInfo.java new file mode 100644 index 0000000000000..20809749ca9fc --- /dev/null +++ b/server/src/main/java/org/elasticsearch/monitor/jvm/SunThreadInfo.java @@ -0,0 +1,93 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.monitor.jvm; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import java.lang.management.ThreadMXBean; +import java.lang.management.ManagementFactory; +import java.lang.reflect.Method; + +public class SunThreadInfo { + + private static final ThreadMXBean threadMXBean; + private static final Method getThreadAllocatedBytes; + private static final Method isThreadAllocatedMemorySupported; + private static final Method isThreadAllocatedMemoryEnabled; + + private static final Logger logger = LogManager.getLogger(SunThreadInfo.class); + public static final SunThreadInfo INSTANCE = new SunThreadInfo(); + + static { + threadMXBean = ManagementFactory.getThreadMXBean(); + getThreadAllocatedBytes = getMethod("getThreadAllocatedBytes", long.class); + isThreadAllocatedMemorySupported = getMethod("isThreadAllocatedMemorySupported"); + isThreadAllocatedMemoryEnabled = getMethod("isThreadAllocatedMemoryEnabled"); + } + + public boolean isThreadAllocatedMemorySupported() { + if (isThreadAllocatedMemorySupported == null) { + return false; + } + + try { + return (boolean) isThreadAllocatedMemorySupported.invoke(threadMXBean); + } catch (Exception e) { + logger.warn("exception while invoke isThreadAllocatedMemorySupported", e); + return false; + } + } + + public boolean isThreadAllocatedMemoryEnabled() { + if (isThreadAllocatedMemoryEnabled == null) { + return false; + } + + try { + return (boolean) isThreadAllocatedMemoryEnabled.invoke(threadMXBean); + } catch (Exception e) { + logger.warn("exception while invoke isThreadAllocatedMemoryEnabled", e); + return false; + } + } + + public long getThreadAllocatedBytes(long id) { + if (getThreadAllocatedBytes == null) { + return 0; + } + + if (isThreadAllocatedMemorySupported() == false || isThreadAllocatedMemoryEnabled() == false) { + return 0; + } + + if (id <= 0) { + return 0; + } + + try { + long bytes = (long) getThreadAllocatedBytes.invoke(threadMXBean, id); + assert bytes >= 0 : "OS reported a negative thread allocated size [" + bytes + "], thread id [" + id + "]."; + return Math.max(0, bytes); + } catch (Exception e) { + logger.warn("exception retrieving thread allocated memory", e); + return 0; + } + } + + private static Method getMethod(String methodName, Class... parameterTypes) { + try { + Method method = Class.forName("com.sun.management.ThreadMXBean").getMethod(methodName, parameterTypes); + return method; + } catch (Exception e) { + // not available + return null; + } + } +} diff --git a/server/src/test/java/org/elasticsearch/monitor/jvm/HotThreadsTests.java b/server/src/test/java/org/elasticsearch/monitor/jvm/HotThreadsTests.java index d40ffe50f2f36..68f536716f926 100644 --- a/server/src/test/java/org/elasticsearch/monitor/jvm/HotThreadsTests.java +++ b/server/src/test/java/org/elasticsearch/monitor/jvm/HotThreadsTests.java @@ -8,6 +8,7 @@ package org.elasticsearch.monitor.jvm; +import org.elasticsearch.ElasticsearchException; import org.elasticsearch.core.TimeValue; import org.elasticsearch.test.ESTestCase; import org.mockito.InOrder; @@ -22,6 +23,7 @@ import java.util.stream.Collectors; import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.equalTo; import static org.mockito.Matchers.anyInt; import static org.mockito.Matchers.eq; import static org.mockito.Mockito.inOrder; @@ -31,11 +33,11 @@ public class HotThreadsTests extends ESTestCase { public void testSupportedThreadsReportType() { - for (String type : new String[]{"unsupported", "", null, "CPU", "WAIT", "BLOCK"}) { + for (String type : new String[]{"unsupported", "", null, "CPU", "WAIT", "BLOCK", "MEM"}) { expectThrows(IllegalArgumentException.class, () -> new HotThreads().type(HotThreads.ReportType.of(type))); } - for (String type : new String[]{"cpu", "wait", "block"}) { + for (String type : new String[]{"cpu", "wait", "block", "mem"}) { try { new HotThreads().type(HotThreads.ReportType.of(type)); } catch (IllegalArgumentException e) { @@ -238,6 +240,10 @@ public void testInnerDetect() throws Exception { ThreadMXBean mockedMXBean = mock(ThreadMXBean.class); when(mockedMXBean.isThreadCpuTimeSupported()).thenReturn(true); + SunThreadInfo mockedSunThreadInfo = mock(SunThreadInfo.class); + when(mockedSunThreadInfo.isThreadAllocatedMemorySupported()).thenReturn(true); + when(mockedSunThreadInfo.isThreadAllocatedMemoryEnabled()).thenReturn(true); + long[] threadIds = new long[]{1, 2, 3, 4}; // Adds up to 10, the intervalNanos for calculating time percentages long mockCurrentThreadId = 0L; when(mockedMXBean.getAllThreadIds()).thenReturn(threadIds); @@ -253,7 +259,7 @@ public void testInnerDetect() throws Exception { .threadElementsSnapshotCount(11) .ignoreIdleThreads(false); - String innerResult = hotThreads.innerDetect(mockedMXBean, mockCurrentThreadId); + String innerResult = hotThreads.innerDetect(mockedMXBean, mockedSunThreadInfo, mockCurrentThreadId); assertThat(innerResult, containsString("Hot threads at ")); assertThat(innerResult, containsString("interval=10nanos, busiestThreads=4, ignoreIdleThreads=false:")); @@ -267,7 +273,7 @@ public void testInnerDetect() throws Exception { assertThat(innerResult, containsString("org.elasticsearch.monitor.testOther.methodFinal(Some_File:1)")); // Let's ask again without progressing the CPU thread counters, e.g. resetting the mocks - innerResult = hotThreads.innerDetect(mockedMXBean, mockCurrentThreadId); + innerResult = hotThreads.innerDetect(mockedMXBean, mockedSunThreadInfo, mockCurrentThreadId); assertThat(innerResult, containsString("0.0% (0s out of 10nanos) cpu usage by thread 'Thread 4'")); assertThat(innerResult, containsString("0.0% (0s out of 10nanos) cpu usage by thread 'Thread 3'")); @@ -285,7 +291,7 @@ public void testInnerDetect() throws Exception { List waitOrderedInfos = List.of(allInfos.get(3), allInfos.get(1), allInfos.get(0), allInfos.get(2)); when(mockedMXBean.getThreadInfo(Matchers.any(), anyInt())).thenReturn(waitOrderedInfos.toArray(new ThreadInfo[0])); - String waitInnerResult = hotWaitingThreads.innerDetect(mockedMXBean, mockCurrentThreadId); + String waitInnerResult = hotWaitingThreads.innerDetect(mockedMXBean, mockedSunThreadInfo, mockCurrentThreadId); assertThat(waitInnerResult, containsString("40.0% (4nanos out of 10nanos) wait usage by thread 'Thread 4'")); assertThat(waitInnerResult, containsString("20.0% (2nanos out of 10nanos) wait usage by thread 'Thread 2'")); @@ -303,7 +309,7 @@ public void testInnerDetect() throws Exception { List blockOrderedInfos = List.of(allInfos.get(2), allInfos.get(0), allInfos.get(1), allInfos.get(3)); when(mockedMXBean.getThreadInfo(Matchers.any(), anyInt())).thenReturn(blockOrderedInfos.toArray(new ThreadInfo[0])); - String blockInnerResult = hotBlockedThreads.innerDetect(mockedMXBean, mockCurrentThreadId); + String blockInnerResult = hotBlockedThreads.innerDetect(mockedMXBean, mockedSunThreadInfo, mockCurrentThreadId); assertThat(blockInnerResult, containsString("30.0% (3nanos out of 10nanos) block usage by thread 'Thread 3'")); assertThat(blockInnerResult, containsString("10.0% (1nanos out of 10nanos) block usage by thread 'Thread 1'")); @@ -323,7 +329,7 @@ public void testInnerDetect() throws Exception { .threadElementsSnapshotCount(1) .ignoreIdleThreads(false); - String singleResult = hotThreads.innerDetect(mockedMXBean, mockCurrentThreadId); + String singleResult = hotThreads.innerDetect(mockedMXBean, mockedSunThreadInfo, mockCurrentThreadId); assertThat(singleResult, containsString(" unique snapshot")); assertEquals(5, singleResult.split(" unique snapshot").length); @@ -334,6 +340,28 @@ public void testInnerDetect() throws Exception { assertThat(innerResult, containsString("org.elasticsearch.monitor.test.method_0(Some_File:1)")); assertThat(innerResult, containsString("org.elasticsearch.monitor.test.method_1(Some_File:1)")); assertThat(innerResult, containsString("org.elasticsearch.monitor.testOther.methodFinal(Some_File:1)")); + + allInfos = makeThreadInfoMocksHelper(mockedMXBean, threadIds); + cpuOrderedInfos = List.of(allInfos.get(3), allInfos.get(2), allInfos.get(1), allInfos.get(0)); + when(mockedMXBean.getThreadInfo(Matchers.any(), anyInt())).thenReturn(cpuOrderedInfos.toArray(new ThreadInfo[0])); + + for (long threadId : threadIds) { + when(mockedSunThreadInfo.getThreadAllocatedBytes(threadId)).thenReturn(0L).thenReturn(threadId*100); + } + + hotThreads = new HotThreads() + .busiestThreads(4) + .type(HotThreads.ReportType.MEM) + .interval(TimeValue.timeValueNanos(10)) + .threadElementsSnapshotCount(1) + .ignoreIdleThreads(false); + + String memInnerResult = hotThreads.innerDetect(mockedMXBean, mockedSunThreadInfo, mockCurrentThreadId); + assertThat(memInnerResult, containsString(" unique snapshot")); + assertThat(memInnerResult, containsString("400b memory allocated by thread 'Thread 4'")); + assertThat(memInnerResult, containsString("300b memory allocated by thread 'Thread 3'")); + assertThat(memInnerResult, containsString("200b memory allocated by thread 'Thread 2'")); + assertThat(memInnerResult, containsString("100b memory allocated by thread 'Thread 1'")); } public void testEnsureInnerDetectSkipsCurrentThread() throws Exception { @@ -355,7 +383,7 @@ public void testEnsureInnerDetectSkipsCurrentThread() throws Exception { .threadElementsSnapshotCount(11) .ignoreIdleThreads(false); - String innerResult = hotThreads.innerDetect(mockedMXBean, mockCurrentThreadId); + String innerResult = hotThreads.innerDetect(mockedMXBean, mock(SunThreadInfo.class), mockCurrentThreadId); assertEquals(1, innerResult.lines().count()); } @@ -366,11 +394,12 @@ public void testReportTypeValueGetter() { when(mockedThreadInfo.getBlockedTime()).thenReturn(2L).thenReturn(0L); when(mockedThreadInfo.getWaitedTime()).thenReturn(3L).thenReturn(0L); - HotThreads.ThreadTimeAccumulator info = new HotThreads.ThreadTimeAccumulator(mockedThreadInfo, 1L); + HotThreads.ThreadTimeAccumulator info = new HotThreads.ThreadTimeAccumulator(mockedThreadInfo, 1L, 4L); assertEquals(1L, HotThreads.ThreadTimeAccumulator.valueGetterForReportType(HotThreads.ReportType.CPU).applyAsLong(info)); assertEquals(3L, HotThreads.ThreadTimeAccumulator.valueGetterForReportType(HotThreads.ReportType.WAIT).applyAsLong(info)); assertEquals(2L, HotThreads.ThreadTimeAccumulator.valueGetterForReportType(HotThreads.ReportType.BLOCK).applyAsLong(info)); + assertEquals(4L, HotThreads.ThreadTimeAccumulator.valueGetterForReportType(HotThreads.ReportType.MEM).applyAsLong(info)); //Ensure all enum types have a report type getter for (HotThreads.ReportType type : HotThreads.ReportType.values()) { @@ -381,6 +410,7 @@ public void testReportTypeValueGetter() { public void testGetAllValidThreadInfos() { ThreadMXBean mockedMXBean = mock(ThreadMXBean.class); when(mockedMXBean.isThreadCpuTimeSupported()).thenReturn(true); + SunThreadInfo mockedSunThreadInfo = mock(SunThreadInfo.class); long[] threadIds = new long[]{1, 2, 3, 4}; // Adds up to 10, the intervalNanos for calculating time percentages long mockCurrentThreadId = 0L; @@ -396,7 +426,8 @@ public void testGetAllValidThreadInfos() { // Test the case when all threads exist before and after sleep List allInfos = makeThreadInfoMocksHelper(mockedMXBean, threadIds); - Map validInfos = hotThreads.getAllValidThreadInfos(mockedMXBean, mockCurrentThreadId); + Map validInfos = hotThreads.getAllValidThreadInfos(mockedMXBean, mockedSunThreadInfo, + mockCurrentThreadId); assertEquals(allInfos.size(), validInfos.size()); for (long threadId : threadIds) { @@ -409,7 +440,8 @@ public void testGetAllValidThreadInfos() { // Fake sleep, e.g don't sleep call the mock again - Map afterValidInfos = hotThreads.getAllValidThreadInfos(mockedMXBean, mockCurrentThreadId); + Map afterValidInfos = hotThreads.getAllValidThreadInfos(mockedMXBean, mockedSunThreadInfo, + mockCurrentThreadId); assertEquals(allInfos.size(), afterValidInfos.size()); for (long threadId : threadIds) { HotThreads.ThreadTimeAccumulator accumulator = afterValidInfos.get(threadId); @@ -424,7 +456,7 @@ public void testGetAllValidThreadInfos() { // Test when a thread has terminated during sleep, we don't report that thread allInfos = makeThreadInfoMocksHelper(mockedMXBean, threadIds); - validInfos = hotThreads.getAllValidThreadInfos(mockedMXBean, mockCurrentThreadId); + validInfos = hotThreads.getAllValidThreadInfos(mockedMXBean, mockedSunThreadInfo, mockCurrentThreadId); assertEquals(allInfos.size(), validInfos.size()); ThreadInfo removedInfo = allInfos.remove(0); @@ -435,7 +467,7 @@ public void testGetAllValidThreadInfos() { // Fake sleep - afterValidInfos = hotThreads.getAllValidThreadInfos(mockedMXBean, mockCurrentThreadId); + afterValidInfos = hotThreads.getAllValidThreadInfos(mockedMXBean, mockedSunThreadInfo, mockCurrentThreadId); assertEquals(reducedThreadIds.length, afterValidInfos.size()); for (long threadId : reducedThreadIds) { @@ -456,7 +488,7 @@ public void testGetAllValidThreadInfos() { // Fake sleep - afterValidInfos = hotThreads.getAllValidThreadInfos(mockedMXBean, mockCurrentThreadId); + afterValidInfos = hotThreads.getAllValidThreadInfos(mockedMXBean, mockedSunThreadInfo, mockCurrentThreadId); assertEquals(threadIds.length, afterValidInfos.size()); HotThreads.ThreadTimeAccumulator firstAccumulator = afterValidInfos.get(removedInfo.getThreadId()); @@ -465,19 +497,19 @@ public void testGetAllValidThreadInfos() { assertEquals(1, firstAccumulator.getBlockedTime()); // Test skipping of current thread - validInfos = hotThreads.getAllValidThreadInfos(mockedMXBean, threadIds[threadIds.length - 1]); + validInfos = hotThreads.getAllValidThreadInfos(mockedMXBean, mockedSunThreadInfo, threadIds[threadIds.length - 1]); assertEquals(threadIds.length - 1, validInfos.size()); assertFalse(validInfos.containsKey(threadIds[threadIds.length - 1])); // Test skipping threads with CPU time of -1 when(mockedMXBean.getThreadCpuTime(threadIds[0])).thenReturn(-1L); - validInfos = hotThreads.getAllValidThreadInfos(mockedMXBean, mockCurrentThreadId); + validInfos = hotThreads.getAllValidThreadInfos(mockedMXBean, mockedSunThreadInfo, mockCurrentThreadId); assertEquals(threadIds.length - 1, validInfos.size()); assertFalse(validInfos.containsKey(threadIds[0])); // Test skipping null thread infos when(mockedMXBean.getThreadInfo(eq(threadIds[0]), anyInt())).thenReturn(null); - validInfos = hotThreads.getAllValidThreadInfos(mockedMXBean, mockCurrentThreadId); + validInfos = hotThreads.getAllValidThreadInfos(mockedMXBean, mockedSunThreadInfo, mockCurrentThreadId); assertEquals(threadIds.length - 1, validInfos.size()); assertFalse(validInfos.containsKey(threadIds[0])); } @@ -523,25 +555,27 @@ public void testThreadInfoAccumulator() { ThreadInfo threadOne = makeThreadInfoMocksHelper(mockedMXBean, 1L); ThreadInfo threadTwo = makeThreadInfoMocksHelper(mockedMXBean, 2L); - HotThreads.ThreadTimeAccumulator acc = new HotThreads.ThreadTimeAccumulator(threadOne, 100L); - HotThreads.ThreadTimeAccumulator accNext = new HotThreads.ThreadTimeAccumulator(threadOne, 250L); + HotThreads.ThreadTimeAccumulator acc = new HotThreads.ThreadTimeAccumulator(threadOne, 100L, 1000L); + HotThreads.ThreadTimeAccumulator accNext = new HotThreads.ThreadTimeAccumulator(threadOne, 250L, 2500L); accNext.subtractPrevious(acc); + assertEquals(1500, accNext.getAllocatedBytes()); assertEquals(150, accNext.getCpuTime()); assertEquals(0, accNext.getWaitedTime()); assertEquals(1, accNext.getBlockedTime()); - HotThreads.ThreadTimeAccumulator accNotMoving = new HotThreads.ThreadTimeAccumulator(threadOne, 250L); - HotThreads.ThreadTimeAccumulator accNotMovingNext = new HotThreads.ThreadTimeAccumulator(threadOne, 250L); + HotThreads.ThreadTimeAccumulator accNotMoving = new HotThreads.ThreadTimeAccumulator(threadOne, 250L, 2500L); + HotThreads.ThreadTimeAccumulator accNotMovingNext = new HotThreads.ThreadTimeAccumulator(threadOne, 250L, 2500L); accNotMovingNext.subtractPrevious(accNotMoving); + assertEquals(0, accNotMovingNext.getAllocatedBytes()); assertEquals(0, accNotMovingNext.getCpuTime()); assertEquals(0, accNotMovingNext.getWaitedTime()); assertEquals(0, accNotMovingNext.getBlockedTime()); - HotThreads.ThreadTimeAccumulator accOne = new HotThreads.ThreadTimeAccumulator(threadOne, 250L); - HotThreads.ThreadTimeAccumulator accTwo = new HotThreads.ThreadTimeAccumulator(threadTwo, 350L); + HotThreads.ThreadTimeAccumulator accOne = new HotThreads.ThreadTimeAccumulator(threadOne, 250L, 2500L); + HotThreads.ThreadTimeAccumulator accTwo = new HotThreads.ThreadTimeAccumulator(threadTwo, 350L, 3500L); expectThrows(IllegalStateException.class, () -> accTwo.subtractPrevious(accOne)); } @@ -566,7 +600,7 @@ public void testWaitBlockTimeMonitoringEnabled() throws Exception { .threadElementsSnapshotCount(11) .ignoreIdleThreads(false); - String innerResult = hotThreads.innerDetect(mockedMXBean, mockCurrentThreadId); + String innerResult = hotThreads.innerDetect(mockedMXBean, mock(SunThreadInfo.class), mockCurrentThreadId); assertThat(innerResult, containsString("Hot threads at ")); assertThat(innerResult, containsString("interval=10nanos, busiestThreads=4, ignoreIdleThreads=false:")); @@ -599,11 +633,58 @@ public void testWaitBlockTimeMonitoringEnabledWithException() { .threadElementsSnapshotCount(11) .ignoreIdleThreads(false); - expectThrows(RuntimeException.class, () -> hotThreads.innerDetect(mockedMXBean, 0L)); + expectThrows(RuntimeException.class, () -> hotThreads.innerDetect(mockedMXBean, mock(SunThreadInfo.class), 0L)); // Ensure we called the monitoring enabled with true and then with false even with exception thrown InOrder orderVerifier = inOrder(mockedMXBean); orderVerifier.verify(mockedMXBean).setThreadContentionMonitoringEnabled(true); orderVerifier.verify(mockedMXBean).setThreadContentionMonitoringEnabled(false); } + + public void testGetThreadAllocatedBytesFailures() throws Exception { + ThreadMXBean mockedMXBean = mock(ThreadMXBean.class); + when(mockedMXBean.isThreadCpuTimeSupported()).thenReturn(true); + when(mockedMXBean.isThreadContentionMonitoringSupported()).thenReturn(true); + + SunThreadInfo mockedSunThreadInfo = mock(SunThreadInfo.class); + when(mockedSunThreadInfo.isThreadAllocatedMemorySupported()).thenReturn(false); + + long[] threadIds = new long[]{1, 2, 3, 4}; // Adds up to 10, the intervalNanos for calculating time percentages + long mockCurrentThreadId = 0L; + when(mockedMXBean.getAllThreadIds()).thenReturn(threadIds); + + List allInfos = makeThreadInfoMocksHelper(mockedMXBean, threadIds); + List cpuOrderedInfos = List.of(allInfos.get(3), allInfos.get(2), allInfos.get(1), allInfos.get(0)); + when(mockedMXBean.getThreadInfo(Matchers.any(), anyInt())).thenReturn(cpuOrderedInfos.toArray(new ThreadInfo[0])); + + HotThreads hotThreads0 = new HotThreads() + .busiestThreads(4) + .type(HotThreads.ReportType.MEM) + .interval(TimeValue.timeValueNanos(10)) + .threadElementsSnapshotCount(1) + .ignoreIdleThreads(false); + + ElasticsearchException exception = expectThrows(ElasticsearchException.class, + () -> hotThreads0.innerDetect(mockedMXBean, mockedSunThreadInfo, 0L)); + assertThat(exception.getMessage(), equalTo("thread allocated memory is not supported on this JDK")); + + // making sure CPU type was not affected when isThreadAllocatedMemorySupported() == false + + HotThreads hotThreads1 = new HotThreads() + .busiestThreads(4) + .type(HotThreads.ReportType.CPU) + .interval(TimeValue.timeValueNanos(10)) + .threadElementsSnapshotCount(1) + .ignoreIdleThreads(false); + + String innerResult = hotThreads1.innerDetect(mockedMXBean, mockedSunThreadInfo, mockCurrentThreadId); + assertThat(innerResult, containsString("Hot threads at ")); + assertThat(innerResult, containsString("40.0% (4nanos out of 10nanos) cpu usage by thread 'Thread 4'")); + assertThat(innerResult, containsString("30.0% (3nanos out of 10nanos) cpu usage by thread 'Thread 3'")); + assertThat(innerResult, containsString("20.0% (2nanos out of 10nanos) cpu usage by thread 'Thread 2'")); + assertThat(innerResult, containsString("10.0% (1nanos out of 10nanos) cpu usage by thread 'Thread 1'")); + assertThat(innerResult, containsString("org.elasticsearch.monitor.test.method_0(Some_File:1)")); + assertThat(innerResult, containsString("org.elasticsearch.monitor.test.method_1(Some_File:1)")); + assertThat(innerResult, containsString("org.elasticsearch.monitor.testOther.methodFinal(Some_File:1)")); + } } From 74d0a9f87325539d45d737b48532538378737ee6 Mon Sep 17 00:00:00 2001 From: Joe Gallo Date: Wed, 29 Sep 2021 14:54:42 -0400 Subject: [PATCH 067/250] Rename INDEX_ROUTING_PREFER to TIER_PREFERENCE (#78411) --- .../storage/ReactiveStorageIT.java | 4 +-- .../ReactiveStorageDeciderService.java | 4 +-- .../xpack/autoscaling/util/FrozenUtils.java | 2 +- .../ReactiveStorageDeciderDecisionTests.java | 4 +-- .../ReactiveStorageDeciderServiceTests.java | 4 +-- .../autoscaling/util/FrozenUtilsTests.java | 2 +- .../routing/allocation/DataTierIT.java | 34 +++++++++---------- .../allocation/DataTierAllocationDecider.java | 18 ++++++---- .../mapper/DataTierFieldMapper.java | 2 +- .../elasticsearch/xpack/core/DataTier.java | 17 +++++----- .../core/DataTiersUsageTransportAction.java | 12 +++---- .../elasticsearch/xpack/core/XPackPlugin.java | 2 +- .../core/ilm/DataTierMigrationRoutedStep.java | 4 +-- .../xpack/core/ilm/MigrateAction.java | 2 +- .../xpack/core/ilm/MountSnapshotStep.java | 2 +- .../DataTierAllocationDeciderTests.java | 24 ++++++------- .../mapper/DataTierFieldTypeTests.java | 2 +- .../DataTiersUsageTransportActionTests.java | 4 +-- .../ilm/DataTierMigrationRoutedStepTests.java | 10 +++--- .../xpack/core/ilm/MigrateActionTests.java | 6 ++-- .../datastreams/DataTierDataStreamIT.java | 4 +-- .../xpack/MigrateToDataTiersIT.java | 12 +++---- .../actions/SearchableSnapshotActionIT.java | 4 +-- .../xpack/ilm/actions/ShrinkActionIT.java | 6 +--- .../xpack/ilm/DataTiersMigrationsTests.java | 2 +- ...adataMigrateToDataTiersRoutingService.java | 8 ++--- ...MigrateToDataTiersRoutingServiceTests.java | 24 ++++++------- .../FrozenSearchableSnapshotsIntegTests.java | 4 +-- .../SearchableSnapshotsIntegTests.java | 4 +-- .../SearchableSnapshotsResizeIntegTests.java | 2 +- .../SearchableSnapshotDataTierIntegTests.java | 8 ++--- ...ableSnapshotsBlobStoreCacheIntegTests.java | 2 +- ...tiallyCachedShardAllocationIntegTests.java | 4 +-- .../SearchableSnapshots.java | 2 +- ...ransportMountSearchableSnapshotAction.java | 4 +-- 35 files changed, 121 insertions(+), 128 deletions(-) diff --git a/x-pack/plugin/autoscaling/src/internalClusterTest/java/org/elasticsearch/xpack/autoscaling/storage/ReactiveStorageIT.java b/x-pack/plugin/autoscaling/src/internalClusterTest/java/org/elasticsearch/xpack/autoscaling/storage/ReactiveStorageIT.java index 69d9d577ddab4..1216e153fc629 100644 --- a/x-pack/plugin/autoscaling/src/internalClusterTest/java/org/elasticsearch/xpack/autoscaling/storage/ReactiveStorageIT.java +++ b/x-pack/plugin/autoscaling/src/internalClusterTest/java/org/elasticsearch/xpack/autoscaling/storage/ReactiveStorageIT.java @@ -118,7 +118,7 @@ private void testScaleFromEmptyWarm(boolean allocatable) throws Exception { .put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0) .put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 6) .put(INDEX_STORE_STATS_REFRESH_INTERVAL_SETTING.getKey(), "0ms") - .put(DataTierAllocationDecider.INDEX_ROUTING_PREFER, allocatable ? "data_hot" : "data_content") + .put(DataTierAllocationDecider.TIER_PREFERENCE, allocatable ? "data_hot" : "data_content") .build() ).setWaitForActiveShards(allocatable ? ActiveShardCount.DEFAULT : ActiveShardCount.NONE) ); @@ -132,7 +132,7 @@ private void testScaleFromEmptyWarm(boolean allocatable) throws Exception { .indices() .updateSettings( new UpdateSettingsRequest(indexName).settings( - Settings.builder().put(DataTierAllocationDecider.INDEX_ROUTING_PREFER, "data_warm,data_hot") + Settings.builder().put(DataTierAllocationDecider.TIER_PREFERENCE, "data_warm,data_hot") ) ) .actionGet() diff --git a/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/storage/ReactiveStorageDeciderService.java b/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/storage/ReactiveStorageDeciderService.java index c9bb84f1f516f..1e509cf9b9190 100644 --- a/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/storage/ReactiveStorageDeciderService.java +++ b/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/storage/ReactiveStorageDeciderService.java @@ -288,9 +288,7 @@ public boolean canRemainOnlyHighestTierPreference(ShardRouting shard, RoutingAll ) != Decision.NO; if (result && nodes.isEmpty() - && Strings.hasText( - DataTierAllocationDecider.INDEX_ROUTING_PREFER_SETTING.get(indexMetadata(shard, allocation).getSettings()) - )) { + && Strings.hasText(DataTierAllocationDecider.TIER_PREFERENCE_SETTING.get(indexMetadata(shard, allocation).getSettings()))) { // The data tier decider allows a shard to remain on a lower preference tier when no nodes exists on higher preference // tiers. // Here we ensure that if our policy governs the highest preference tier, we assume the shard needs to move to that tier diff --git a/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/util/FrozenUtils.java b/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/util/FrozenUtils.java index 91eadf1adaa66..6c090c50b703e 100644 --- a/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/util/FrozenUtils.java +++ b/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/util/FrozenUtils.java @@ -13,7 +13,7 @@ public class FrozenUtils { public static boolean isFrozenIndex(Settings indexSettings) { - String tierPreference = DataTierAllocationDecider.INDEX_ROUTING_PREFER_SETTING.get(indexSettings); + String tierPreference = DataTierAllocationDecider.TIER_PREFERENCE_SETTING.get(indexSettings); String[] preferredTiers = DataTierAllocationDecider.parseTierList(tierPreference); if (preferredTiers.length >= 1 && preferredTiers[0].equals(DataTier.DATA_FROZEN)) { assert preferredTiers.length == 1 : "frozen tier preference must be frozen only"; diff --git a/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/storage/ReactiveStorageDeciderDecisionTests.java b/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/storage/ReactiveStorageDeciderDecisionTests.java index 6a1a068660593..51d6305b6db72 100644 --- a/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/storage/ReactiveStorageDeciderDecisionTests.java +++ b/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/storage/ReactiveStorageDeciderDecisionTests.java @@ -292,7 +292,7 @@ private IndexMetadata moveToCold(IndexMetadata imd) { overrideSetting( imd, builder, - DataTierAllocationDecider.INDEX_ROUTING_PREFER_SETTING, + DataTierAllocationDecider.TIER_PREFERENCE_SETTING, randomFrom(DataTier.DATA_COLD, DataTier.DATA_COLD + "," + DataTier.DATA_HOT) ); return IndexMetadata.builder(imd).settings(builder).build(); @@ -593,7 +593,7 @@ public Long getShardSize(ShardRouting shardRouting) { } private static ClusterState addRandomIndices(int minShards, int maxShardCopies, ClusterState state) { - String[] tierSettingNames = new String[] { DataTierAllocationDecider.INDEX_ROUTING_PREFER }; + String[] tierSettingNames = new String[] { DataTierAllocationDecider.TIER_PREFERENCE }; int shards = randomIntBetween(minShards, 20); Metadata.Builder builder = Metadata.builder(); RoutingTable.Builder routingTableBuilder = RoutingTable.builder(); diff --git a/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/storage/ReactiveStorageDeciderServiceTests.java b/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/storage/ReactiveStorageDeciderServiceTests.java index bacdb2f6e06cb..479503e678dc3 100644 --- a/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/storage/ReactiveStorageDeciderServiceTests.java +++ b/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/storage/ReactiveStorageDeciderServiceTests.java @@ -513,7 +513,7 @@ public Decision canRemain(ShardRouting shardRouting, RoutingNode node, RoutingAl public ClusterState addPreference(IndexMetadata indexMetadata, ClusterState clusterState, String preference) { IndexMetadata indexMetadataWithPreference = IndexMetadata.builder(indexMetadata) - .settings(Settings.builder().put(indexMetadata.getSettings()).put(DataTierAllocationDecider.INDEX_ROUTING_PREFER, preference)) + .settings(Settings.builder().put(indexMetadata.getSettings()).put(DataTierAllocationDecider.TIER_PREFERENCE, preference)) .build(); return ClusterState.builder(clusterState) @@ -552,7 +552,7 @@ public void testNeedsThisTier() { Metadata.Builder metaBuilder = Metadata.builder(); Settings.Builder settings = settings(Version.CURRENT); if (randomBoolean()) { - settings.put(DataTierAllocationDecider.INDEX_ROUTING_PREFER, randomBoolean() ? DataTier.DATA_HOT : "data_hot,data_warm"); + settings.put(DataTierAllocationDecider.TIER_PREFERENCE, randomBoolean() ? DataTier.DATA_HOT : "data_hot,data_warm"); } IndexMetadata indexMetadata = IndexMetadata.builder(randomAlphaOfLength(5)) .settings(settings) diff --git a/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/util/FrozenUtilsTests.java b/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/util/FrozenUtilsTests.java index 4f1f2ec354606..f6b8f4d9be346 100644 --- a/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/util/FrozenUtilsTests.java +++ b/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/util/FrozenUtilsTests.java @@ -42,7 +42,7 @@ public static String randomNonFrozenTierPreference() { public static Settings indexSettings(String tierPreference) { Settings.Builder settings = Settings.builder() .put(randomAlphaOfLength(10), randomLong()) - .put(DataTierAllocationDecider.INDEX_ROUTING_PREFER, tierPreference) + .put(DataTierAllocationDecider.TIER_PREFERENCE, tierPreference) .put(IndexMetadata.SETTING_VERSION_CREATED, Version.CURRENT); // pass setting validator. if (Objects.equals(tierPreference, DataTier.DATA_FROZEN)) { diff --git a/x-pack/plugin/core/src/internalClusterTest/java/org/elasticsearch/xpack/cluster/routing/allocation/DataTierIT.java b/x-pack/plugin/core/src/internalClusterTest/java/org/elasticsearch/xpack/cluster/routing/allocation/DataTierIT.java index 891a2c19dc59b..daf632cc4e81f 100644 --- a/x-pack/plugin/core/src/internalClusterTest/java/org/elasticsearch/xpack/cluster/routing/allocation/DataTierIT.java +++ b/x-pack/plugin/core/src/internalClusterTest/java/org/elasticsearch/xpack/cluster/routing/allocation/DataTierIT.java @@ -47,7 +47,7 @@ public void testDefaultIndexAllocateToContent() { client().admin().indices().prepareCreate(index).setWaitForActiveShards(0).get(); Settings idxSettings = client().admin().indices().prepareGetIndex().addIndices(index).get().getSettings().get(index); - assertThat(DataTierAllocationDecider.INDEX_ROUTING_PREFER_SETTING.get(idxSettings), equalTo(DataTier.DATA_CONTENT)); + assertThat(DataTierAllocationDecider.TIER_PREFERENCE_SETTING.get(idxSettings), equalTo(DataTier.DATA_CONTENT)); // index should be red assertThat(client().admin().cluster().prepareHealth(index).get().getIndices().get(index).getStatus(), @@ -73,11 +73,11 @@ public void testOverrideDefaultAllocation() { client().admin().indices().prepareCreate(index) .setWaitForActiveShards(0) .setSettings(Settings.builder() - .put(DataTierAllocationDecider.INDEX_ROUTING_PREFER, DataTier.DATA_WARM)) + .put(DataTierAllocationDecider.TIER_PREFERENCE, DataTier.DATA_WARM)) .get(); Settings idxSettings = client().admin().indices().prepareGetIndex().addIndices(index).get().getSettings().get(index); - assertThat(idxSettings.get(DataTierAllocationDecider.INDEX_ROUTING_PREFER), equalTo(DataTier.DATA_WARM)); + assertThat(idxSettings.get(DataTierAllocationDecider.TIER_PREFERENCE), equalTo(DataTier.DATA_WARM)); // index should be yellow logger.info("--> waiting for {} to be yellow", index); @@ -92,13 +92,13 @@ public void testRequestSettingOverridesAllocation() { client().admin().indices().prepareCreate(index) .setWaitForActiveShards(0) .setSettings(Settings.builder() - .putNull(DataTierAllocationDecider.INDEX_ROUTING_PREFER)) + .putNull(DataTierAllocationDecider.TIER_PREFERENCE)) .get(); Settings idxSettings = client().admin().indices().prepareGetIndex().addIndices(index).get().getSettings().get(index); - assertThat(DataTierAllocationDecider.INDEX_ROUTING_PREFER_SETTING.get(idxSettings), equalTo("")); + assertThat(DataTierAllocationDecider.TIER_PREFERENCE_SETTING.get(idxSettings), equalTo("")); // Even the key shouldn't exist if it has been nulled out - assertFalse(idxSettings.keySet().toString(), idxSettings.keySet().contains(DataTierAllocationDecider.INDEX_ROUTING_PREFER)); + assertFalse(idxSettings.keySet().toString(), idxSettings.keySet().contains(DataTierAllocationDecider.TIER_PREFERENCE)); // index should be yellow logger.info("--> waiting for {} to be yellow", index); @@ -114,9 +114,9 @@ public void testRequestSettingOverridesAllocation() { .get(); idxSettings = client().admin().indices().prepareGetIndex().addIndices(index).get().getSettings().get(index); - assertThat(DataTierAllocationDecider.INDEX_ROUTING_PREFER_SETTING.get(idxSettings), equalTo("")); + assertThat(DataTierAllocationDecider.TIER_PREFERENCE_SETTING.get(idxSettings), equalTo("")); // The key should not be put in place since it was overridden - assertFalse(idxSettings.keySet().contains(DataTierAllocationDecider.INDEX_ROUTING_PREFER)); + assertFalse(idxSettings.keySet().contains(DataTierAllocationDecider.TIER_PREFERENCE)); assertThat(idxSettings.get(IndexMetadata.INDEX_ROUTING_REQUIRE_GROUP_PREFIX + ".box"), equalTo("cold")); // index should be yellow @@ -137,7 +137,7 @@ public void testShrinkStaysOnTier() { .setSettings(Settings.builder() .put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 2) .put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0) - .put(DataTierAllocationDecider.INDEX_ROUTING_PREFER, "data_warm")) + .put(DataTierAllocationDecider.TIER_PREFERENCE, "data_warm")) .get(); client().admin().indices().prepareAddBlock(IndexMetadata.APIBlock.READ_ONLY, index).get(); @@ -153,7 +153,7 @@ public void testShrinkStaysOnTier() { Settings idxSettings = client().admin().indices().prepareGetIndex().addIndices(index + "-shrunk") .get().getSettings().get(index + "-shrunk"); // It should inherit the setting of its originator - assertThat(DataTierAllocationDecider.INDEX_ROUTING_PREFER_SETTING.get(idxSettings), equalTo(DataTier.DATA_WARM)); + assertThat(DataTierAllocationDecider.TIER_PREFERENCE_SETTING.get(idxSettings), equalTo(DataTier.DATA_WARM)); // Required or else the test cleanup fails because it can't delete the indices client().admin().indices().prepareUpdateSettings(index, index + "-shrunk") @@ -177,7 +177,7 @@ public void testTemplateOverridesDefaults() { client().admin().indices().prepareCreate(index).setWaitForActiveShards(0).get(); Settings idxSettings = client().admin().indices().prepareGetIndex().addIndices(index).get().getSettings().get(index); - assertThat(idxSettings.keySet().contains(DataTierAllocationDecider.INDEX_ROUTING_PREFER), equalTo(false)); + assertThat(idxSettings.keySet().contains(DataTierAllocationDecider.TIER_PREFERENCE), equalTo(false)); // index should be yellow ensureYellow(index); @@ -185,7 +185,7 @@ public void testTemplateOverridesDefaults() { client().admin().indices().prepareDelete(index).get(); t = new Template(Settings.builder() - .putNull(DataTierAllocationDecider.INDEX_ROUTING_PREFER) + .putNull(DataTierAllocationDecider.TIER_PREFERENCE) .build(), null, null); ct = new ComposableIndexTemplate.Builder().indexPatterns(Collections.singletonList(index)) .template(t).build(); @@ -195,7 +195,7 @@ public void testTemplateOverridesDefaults() { client().admin().indices().prepareCreate(index).setWaitForActiveShards(0).get(); idxSettings = client().admin().indices().prepareGetIndex().addIndices(index).get().getSettings().get(index); - assertThat(idxSettings.keySet().contains(DataTierAllocationDecider.INDEX_ROUTING_PREFER), equalTo(false)); + assertThat(idxSettings.keySet().contains(DataTierAllocationDecider.TIER_PREFERENCE), equalTo(false)); ensureYellow(index); } @@ -207,7 +207,7 @@ public void testDataTierTelemetry() { client().admin().indices().prepareCreate(index) .setSettings(Settings.builder() - .put(DataTierAllocationDecider.INDEX_ROUTING_PREFER, "data_hot") + .put(DataTierAllocationDecider.TIER_PREFERENCE, "data_hot") .put("index.number_of_shards", 2) .put("index.number_of_replicas", 0)) .setWaitForActiveShards(0) @@ -253,7 +253,7 @@ public void testIllegalOnFrozen() { () -> createIndex(index, Settings.builder() .put("index.number_of_shards", 1) .put("index.number_of_replicas", 0) - .put(DataTierAllocationDecider.INDEX_ROUTING_PREFER, DataTier.DATA_FROZEN) + .put(DataTierAllocationDecider.TIER_PREFERENCE, DataTier.DATA_FROZEN) .build())); assertThat(e.getMessage(), equalTo("[data_frozen] tier can only be used for partial searchable snapshots")); @@ -261,7 +261,7 @@ public void testIllegalOnFrozen() { createIndex(index, Settings.builder() .put("index.number_of_shards", 1) .put("index.number_of_replicas", 0) - .put(DataTierAllocationDecider.INDEX_ROUTING_PREFER, initialTier) + .put(DataTierAllocationDecider.TIER_PREFERENCE, initialTier) .build()); IllegalArgumentException e2 = expectThrows(IllegalArgumentException.class, () -> updatePreference(DataTier.DATA_FROZEN)); @@ -272,7 +272,7 @@ public void testIllegalOnFrozen() { private void updatePreference(String tier) { client().admin().indices().updateSettings(new UpdateSettingsRequest(index) - .settings(Map.of(DataTierAllocationDecider.INDEX_ROUTING_PREFER, tier))).actionGet(); + .settings(Map.of(DataTierAllocationDecider.TIER_PREFERENCE, tier))).actionGet(); } private DataTiersFeatureSetUsage getUsage() { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/cluster/routing/allocation/DataTierAllocationDecider.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/cluster/routing/allocation/DataTierAllocationDecider.java index 86ffda2d4ad09..6ff489bad3626 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/cluster/routing/allocation/DataTierAllocationDecider.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/cluster/routing/allocation/DataTierAllocationDecider.java @@ -20,6 +20,7 @@ import org.elasticsearch.cluster.routing.allocation.decider.Decision; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Setting; +import org.elasticsearch.common.settings.Setting.Property; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.index.IndexModule; import org.elasticsearch.snapshots.SearchableSnapshotsSettings; @@ -45,26 +46,29 @@ public class DataTierAllocationDecider extends AllocationDecider { public static final String NAME = "data_tier"; - public static final String INDEX_ROUTING_PREFER = "index.routing.allocation.include._tier_preference"; + public static final String TIER_PREFERENCE = "index.routing.allocation.include._tier_preference"; private static final DataTierValidator VALIDATOR = new DataTierValidator(); - public static final Setting INDEX_ROUTING_PREFER_SETTING = new Setting<>(new Setting.SimpleKey(INDEX_ROUTING_PREFER), - DataTierValidator::getDefaultTierPreference, Function.identity(), VALIDATOR, Setting.Property.Dynamic, Setting.Property.IndexScope); + public static final Setting TIER_PREFERENCE_SETTING = new Setting<>(new Setting.SimpleKey(TIER_PREFERENCE), + DataTierValidator::getDefaultTierPreference, Function.identity(), VALIDATOR, Property.Dynamic, Property.IndexScope); private static void validateTierSetting(String setting) { if (Strings.hasText(setting)) { for (String s : setting.split(",")) { if (DataTier.validTierName(s) == false) { throw new IllegalArgumentException( - "invalid tier names found in [" + setting + "] allowed values are " + DataTier.ALL_DATA_TIERS); + "invalid tier names found in [" + setting + "] allowed values are " + DataTier.ALL_DATA_TIERS); } } } } private static class DataTierValidator implements Setting.Validator { - private static final Collection> dependencies = List.of(IndexModule.INDEX_STORE_TYPE_SETTING, - SearchableSnapshotsConstants.SNAPSHOT_PARTIAL_SETTING); + + private static final Collection> dependencies = List.of( + IndexModule.INDEX_STORE_TYPE_SETTING, + SearchableSnapshotsConstants.SNAPSHOT_PARTIAL_SETTING + ); public static String getDefaultTierPreference(Settings settings) { if (SearchableSnapshotsSettings.isPartialSearchableSnapshotIndex(settings)) { @@ -149,7 +153,7 @@ public Decision shouldFilter(IndexMetadata indexMd, Set roles private Decision shouldIndexPreferTier(IndexMetadata indexMetadata, Set roles, PreferredTierFunction preferredTierFunction, RoutingAllocation allocation) { Settings indexSettings = indexMetadata.getSettings(); - String tierPreference = INDEX_ROUTING_PREFER_SETTING.get(indexSettings); + String tierPreference = TIER_PREFERENCE_SETTING.get(indexSettings); if (Strings.hasText(tierPreference)) { Optional tier = preferredTierFunction.apply(tierPreference, allocation.nodes()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/cluster/routing/allocation/mapper/DataTierFieldMapper.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/cluster/routing/allocation/mapper/DataTierFieldMapper.java index 45da755e63fd2..7b51e3360cdd6 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/cluster/routing/allocation/mapper/DataTierFieldMapper.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/cluster/routing/allocation/mapper/DataTierFieldMapper.java @@ -89,7 +89,7 @@ public ValueFetcher valueFetcher(SearchExecutionContext context, String format) */ private String getTierPreference(SearchExecutionContext context) { Settings settings = context.getIndexSettings().getSettings(); - String value = DataTierAllocationDecider.INDEX_ROUTING_PREFER_SETTING.get(settings); + String value = DataTierAllocationDecider.TIER_PREFERENCE_SETTING.get(settings); if (Strings.hasText(value) == false) { return null; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/DataTier.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/DataTier.java index e19aeed5170ec..25ab37d16b51c 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/DataTier.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/DataTier.java @@ -43,13 +43,12 @@ public class DataTier { for (String tier : ALL_DATA_TIERS) { assert tier.equals(DATA_FROZEN) || tier.contains(DATA_FROZEN) == false : "can't have two tier names containing [" + DATA_FROZEN + "] because it would break setting validation optimizations" + - " in the data tier allocation decider"; + " in the data tier allocation decider"; } } // Represents an ordered list of data tiers from frozen to hot (or slow to fast) - private static final List ORDERED_FROZEN_TO_HOT_TIERS = - List.of(DataTier.DATA_FROZEN, DataTier.DATA_COLD, DataTier.DATA_WARM, DataTier.DATA_HOT); + private static final List ORDERED_FROZEN_TO_HOT_TIERS = List.of(DATA_FROZEN, DATA_COLD, DATA_WARM, DATA_HOT); /** * Returns true if the given tier name is a valid tier @@ -61,7 +60,7 @@ public static boolean validTierName(String tierName) { /** * Based on the provided target tier it will return a comma separated list of preferred tiers. * ie. if `data_cold` is the target tier, it will return `data_cold,data_warm,data_hot` - * This is usually used in conjunction with {@link DataTierAllocationDecider#INDEX_ROUTING_PREFER_SETTING} + * This is usually used in conjunction with {@link DataTierAllocationDecider#TIER_PREFERENCE_SETTING} */ public static String getPreferredTiersConfiguration(String targetTier) { int indexOfTargetTier = ORDERED_FROZEN_TO_HOT_TIERS.indexOf(targetTier); @@ -129,9 +128,9 @@ public static class DefaultHotAllocationSettingProvider implements IndexSettingP @Override public Settings getAdditionalIndexSettings(String indexName, boolean isDataStreamIndex, Settings indexSettings) { Set settings = indexSettings.keySet(); - if (settings.contains(DataTierAllocationDecider.INDEX_ROUTING_PREFER)) { - // It's okay to put it, it will be removed or overridden by the template/request settings - return Settings.builder().put(DataTierAllocationDecider.INDEX_ROUTING_PREFER, DATA_HOT).build(); + if (settings.contains(DataTierAllocationDecider.TIER_PREFERENCE)) { + // just a marker -- this null value will be removed or overridden by the template/request settings + return Settings.builder().putNull(DataTierAllocationDecider.TIER_PREFERENCE).build(); } else if (settings.stream().anyMatch(s -> s.startsWith(IndexMetadata.INDEX_ROUTING_REQUIRE_GROUP_PREFIX + ".")) || settings.stream().anyMatch(s -> s.startsWith(IndexMetadata.INDEX_ROUTING_EXCLUDE_GROUP_PREFIX + ".")) || settings.stream().anyMatch(s -> s.startsWith(IndexMetadata.INDEX_ROUTING_INCLUDE_GROUP_PREFIX + "."))) { @@ -143,9 +142,9 @@ public Settings getAdditionalIndexSettings(String indexName, boolean isDataStrea // tier if the index is part of a data stream, the "content" // tier if it is not. if (isDataStreamIndex) { - return Settings.builder().put(DataTierAllocationDecider.INDEX_ROUTING_PREFER, DATA_HOT).build(); + return Settings.builder().put(DataTierAllocationDecider.TIER_PREFERENCE, DATA_HOT).build(); } else { - return Settings.builder().put(DataTierAllocationDecider.INDEX_ROUTING_PREFER, DATA_CONTENT).build(); + return Settings.builder().put(DataTierAllocationDecider.TIER_PREFERENCE, DATA_CONTENT).build(); } } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/DataTiersUsageTransportAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/DataTiersUsageTransportAction.java index 8500df8a12b61..faf49641524aa 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/DataTiersUsageTransportAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/DataTiersUsageTransportAction.java @@ -83,7 +83,7 @@ protected void masterOperation(Task task, XPackUsageRequest request, ClusterStat static Map tierIndices(ImmutableOpenMap indices) { Map indexByTier = new HashMap<>(); indices.forEach(entry -> { - String tierPref = entry.value.getSettings().get(DataTierAllocationDecider.INDEX_ROUTING_PREFER); + String tierPref = entry.value.getSettings().get(DataTierAllocationDecider.TIER_PREFERENCE); if (Strings.hasText(tierPref)) { String[] tiers = tierPref.split(","); if (tiers.length > 0) { @@ -110,8 +110,8 @@ private static class TierStatsAccumulator { // Visible for testing static Map calculateStats(List nodesStats, - Map indexByTier, - RoutingNodes routingNodes) { + Map indexByTier, + RoutingNodes routingNodes) { Map statsAccumulators = new HashMap<>(); for (NodeStats nodeStats : nodesStats) { aggregateDataTierNodeCounts(nodeStats, statsAccumulators); @@ -130,7 +130,7 @@ static Map calculateStats(Li private static void aggregateDataTierNodeCounts(NodeStats nodeStats, Map tiersStats) { nodeStats.getNode().getRoles().stream() .map(DiscoveryNodeRole::roleName) - .filter(DataTier.ALL_DATA_TIERS::contains) + .filter(DataTier::validTierName) .forEach(tier -> tiersStats.computeIfAbsent(tier, k -> new TierStatsAccumulator()).nodeCount++); } @@ -138,7 +138,7 @@ private static void aggregateDataTierNodeCounts(NodeStats nodeStats, Map indexByTier, - Map accumulators) { + Map accumulators) { final RoutingNode node = routingNodes.node(nodeStats.getNode().getId()); if (node != null) { StreamSupport.stream(node.spliterator(), false) @@ -152,7 +152,7 @@ private static void aggregateDataTierIndexStats(NodeStats nodeStats, RoutingNode * Determine which tier an index belongs in, then accumulate its stats into that tier's stats. */ private static void classifyIndexAndCollectStats(Index index, NodeStats nodeStats, Map indexByTier, - RoutingNode node, Map accumulators) { + RoutingNode node, Map accumulators) { // Look up which tier this index belongs to (its most preferred) String indexTier = indexByTier.get(index.getName()); if (indexTier != null) { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/XPackPlugin.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/XPackPlugin.java index bdd355c750aad..f276ead608e33 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/XPackPlugin.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/XPackPlugin.java @@ -384,7 +384,7 @@ public Optional getEngineFactory(IndexSettings indexSettings) { public List> getSettings() { List> settings = super.getSettings(); settings.add(SourceOnlySnapshotRepository.SOURCE_ONLY); - settings.add(DataTierAllocationDecider.INDEX_ROUTING_PREFER_SETTING); + settings.add(DataTierAllocationDecider.TIER_PREFERENCE_SETTING); return settings; } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/DataTierMigrationRoutedStep.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/DataTierMigrationRoutedStep.java index b1bbfea714ca3..b3f8ae321efc9 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/DataTierMigrationRoutedStep.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/DataTierMigrationRoutedStep.java @@ -21,7 +21,7 @@ import java.util.Locale; import java.util.Optional; -import static org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider.INDEX_ROUTING_PREFER_SETTING; +import static org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider.TIER_PREFERENCE_SETTING; import static org.elasticsearch.xpack.core.ilm.AllocationRoutedStep.getPendingAllocations; import static org.elasticsearch.xpack.core.ilm.step.info.AllocationInfo.waitingForActiveShardsAllocationInfo; @@ -56,7 +56,7 @@ public Result isConditionMet(Index index, ClusterState clusterState) { logger.debug("[{}] lifecycle action for index [{}] executed but index no longer exists", getKey().getAction(), index.getName()); return new Result(false, null); } - String preferredTierConfiguration = INDEX_ROUTING_PREFER_SETTING.get(idxMeta.getSettings()); + String preferredTierConfiguration = TIER_PREFERENCE_SETTING.get(idxMeta.getSettings()); Optional availableDestinationTier = DataTierAllocationDecider.preferredAvailableTier(preferredTierConfiguration, clusterState.getNodes()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/MigrateAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/MigrateAction.java index ba1b0589dfbcb..17a0f9ce720d4 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/MigrateAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/MigrateAction.java @@ -117,7 +117,7 @@ public List toSteps(Client client, String phase, StepKey nextStepKey) { }); UpdateSettingsStep updateMigrationSettingStep = new UpdateSettingsStep(migrationKey, migrationRoutedKey, client, Settings.builder() - .put(DataTierAllocationDecider.INDEX_ROUTING_PREFER, getPreferredTiersConfiguration(targetTier)) + .put(DataTierAllocationDecider.TIER_PREFERENCE, getPreferredTiersConfiguration(targetTier)) .build()); DataTierMigrationRoutedStep migrationRoutedStep = new DataTierMigrationRoutedStep(migrationRoutedKey, nextStepKey); return List.of(conditionalSkipActionStep, updateMigrationSettingStep, migrationRoutedStep); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/MountSnapshotStep.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/MountSnapshotStep.java index b75290e2f6a6b..4dac280f856f1 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/MountSnapshotStep.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/MountSnapshotStep.java @@ -107,7 +107,7 @@ void performDuringNoSnapshot(IndexMetadata indexMetadata, ClusterState currentCl final Settings.Builder settingsBuilder = Settings.builder(); overrideTierPreference(this.getKey().getPhase()) - .ifPresent(override -> settingsBuilder.put(DataTierAllocationDecider.INDEX_ROUTING_PREFER, override)); + .ifPresent(override -> settingsBuilder.put(DataTierAllocationDecider.TIER_PREFERENCE, override)); final MountSearchableSnapshotRequest mountSearchableSnapshotRequest = new MountSearchableSnapshotRequest(mountedIndexName, snapshotRepository, snapshotName, indexName, settingsBuilder.build(), diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/cluster/routing/allocation/DataTierAllocationDeciderTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/cluster/routing/allocation/DataTierAllocationDeciderTests.java index ac677c173ea0a..a5800a2dbb5af 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/cluster/routing/allocation/DataTierAllocationDeciderTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/cluster/routing/allocation/DataTierAllocationDeciderTests.java @@ -86,7 +86,7 @@ public void testIndexPrefer() { .put(IndexMetadata.SETTING_INDEX_UUID, "myindex") .put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1) .put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0) - .put(DataTierAllocationDecider.INDEX_ROUTING_PREFER, "data_warm,data_cold") + .put(DataTierAllocationDecider.TIER_PREFERENCE, "data_warm,data_cold") .build())) .build()) .build(); @@ -121,7 +121,7 @@ public void testIndexPrefer() { .put(IndexMetadata.SETTING_INDEX_UUID, "myindex") .put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1) .put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0) - .put(DataTierAllocationDecider.INDEX_ROUTING_PREFER, "data_warm,data_cold") + .put(DataTierAllocationDecider.TIER_PREFERENCE, "data_warm,data_cold") .build())) .build()) .build(); @@ -217,7 +217,7 @@ public void testFrozenIllegalForRegularIndices() { Randomness.shuffle(tierList); String value = Strings.join(tierList, ","); - Setting setting = DataTierAllocationDecider.INDEX_ROUTING_PREFER_SETTING; + Setting setting = DataTierAllocationDecider.TIER_PREFERENCE_SETTING; Settings.Builder builder = Settings.builder().put(setting.getKey(), value); if (randomBoolean()) { builder.put(IndexModule.INDEX_STORE_TYPE_SETTING.getKey(), SearchableSnapshotsSettings.SEARCHABLE_SNAPSHOT_STORE_TYPE); @@ -229,7 +229,7 @@ public void testFrozenIllegalForRegularIndices() { } public void testFrozenLegalForPartialSnapshot() { - Setting setting = DataTierAllocationDecider.INDEX_ROUTING_PREFER_SETTING; + Setting setting = DataTierAllocationDecider.TIER_PREFERENCE_SETTING; Settings.Builder builder = Settings.builder().put(setting.getKey(), DATA_FROZEN); builder.put(IndexModule.INDEX_STORE_TYPE_SETTING.getKey(), SearchableSnapshotsSettings.SEARCHABLE_SNAPSHOT_STORE_TYPE); builder.put(SearchableSnapshotsConstants.SNAPSHOT_PARTIAL_SETTING.getKey(), true); @@ -250,53 +250,53 @@ public void testNonFrozenIllegalForPartialSnapshot() { { String value = Strings.join(tierList, ","); - Settings.Builder builder = Settings.builder().put(DataTierAllocationDecider.INDEX_ROUTING_PREFER, value); + Settings.Builder builder = Settings.builder().put(DataTierAllocationDecider.TIER_PREFERENCE, value); builder.put(IndexModule.INDEX_STORE_TYPE_SETTING.getKey(), SearchableSnapshotsSettings.SEARCHABLE_SNAPSHOT_STORE_TYPE); builder.put(SearchableSnapshotsConstants.SNAPSHOT_PARTIAL_SETTING.getKey(), true); Settings settings = builder.build(); IllegalArgumentException e = expectThrows(IllegalArgumentException.class, - () -> DataTierAllocationDecider.INDEX_ROUTING_PREFER_SETTING.get(settings)); + () -> DataTierAllocationDecider.TIER_PREFERENCE_SETTING.get(settings)); assertThat(e.getMessage(), containsString("only the [data_frozen] tier preference may be used for partial searchable snapshots")); } { - Settings.Builder builder = Settings.builder().put(DataTierAllocationDecider.INDEX_ROUTING_PREFER, ""); + Settings.Builder builder = Settings.builder().put(DataTierAllocationDecider.TIER_PREFERENCE, ""); builder.put(IndexModule.INDEX_STORE_TYPE_SETTING.getKey(), SearchableSnapshotsSettings.SEARCHABLE_SNAPSHOT_STORE_TYPE); builder.put(SearchableSnapshotsConstants.SNAPSHOT_PARTIAL_SETTING.getKey(), true); Settings settings = builder.build(); IllegalArgumentException e = expectThrows(IllegalArgumentException.class, - () -> DataTierAllocationDecider.INDEX_ROUTING_PREFER_SETTING.get(settings)); + () -> DataTierAllocationDecider.TIER_PREFERENCE_SETTING.get(settings)); assertThat(e.getMessage(), containsString("only the [data_frozen] tier preference may be used for partial searchable snapshots")); } { - Settings.Builder builder = Settings.builder().put(DataTierAllocationDecider.INDEX_ROUTING_PREFER, " "); + Settings.Builder builder = Settings.builder().put(DataTierAllocationDecider.TIER_PREFERENCE, " "); builder.put(IndexModule.INDEX_STORE_TYPE_SETTING.getKey(), SearchableSnapshotsSettings.SEARCHABLE_SNAPSHOT_STORE_TYPE); builder.put(SearchableSnapshotsConstants.SNAPSHOT_PARTIAL_SETTING.getKey(), true); Settings settings = builder.build(); IllegalArgumentException e = expectThrows(IllegalArgumentException.class, - () -> DataTierAllocationDecider.INDEX_ROUTING_PREFER_SETTING.get(settings)); + () -> DataTierAllocationDecider.TIER_PREFERENCE_SETTING.get(settings)); assertThat(e.getMessage(), containsString("only the [data_frozen] tier preference may be used for partial searchable snapshots")); } } public void testDefaultValueForPreference() { - assertThat(DataTierAllocationDecider.INDEX_ROUTING_PREFER_SETTING.get(Settings.EMPTY), equalTo("")); + assertThat(DataTierAllocationDecider.TIER_PREFERENCE_SETTING.get(Settings.EMPTY), equalTo("")); Settings.Builder builder = Settings.builder(); builder.put(IndexModule.INDEX_STORE_TYPE_SETTING.getKey(), SearchableSnapshotsSettings.SEARCHABLE_SNAPSHOT_STORE_TYPE); builder.put(SearchableSnapshotsConstants.SNAPSHOT_PARTIAL_SETTING.getKey(), true); Settings settings = builder.build(); - assertThat(DataTierAllocationDecider.INDEX_ROUTING_PREFER_SETTING.get(settings), equalTo(DATA_FROZEN)); + assertThat(DataTierAllocationDecider.TIER_PREFERENCE_SETTING.get(settings), equalTo(DATA_FROZEN)); } } diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/cluster/routing/allocation/mapper/DataTierFieldTypeTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/cluster/routing/allocation/mapper/DataTierFieldTypeTests.java index 586e69223dc97..1150c9e30e5bb 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/cluster/routing/allocation/mapper/DataTierFieldTypeTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/cluster/routing/allocation/mapper/DataTierFieldTypeTests.java @@ -101,7 +101,7 @@ private SearchExecutionContext createContext() { Settings.builder() .put(IndexMetadata.SETTING_VERSION_CREATED, Version.CURRENT) // Tier can be an ordered list of preferences - starting with primary and followed by fallbacks. - .put(DataTierAllocationDecider.INDEX_ROUTING_PREFER, "data_warm,data_hot") + .put(DataTierAllocationDecider.TIER_PREFERENCE, "data_warm,data_hot") ) .numberOfShards(1) .numberOfReplicas(0) diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/DataTiersUsageTransportActionTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/DataTiersUsageTransportActionTests.java index 639b10c1ccab6..6e47c0a77d4e1 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/DataTiersUsageTransportActionTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/DataTiersUsageTransportActionTests.java @@ -697,9 +697,9 @@ private static IndexMetadata indexMetadata(String indexName, int numberOfShards, for (int idx = 1; idx < dataTierPrefs.length; idx++) { tierBuilder.append(',').append(dataTierPrefs[idx]); } - settingsBuilder.put(DataTierAllocationDecider.INDEX_ROUTING_PREFER, tierBuilder.toString()); + settingsBuilder.put(DataTierAllocationDecider.TIER_PREFERENCE, tierBuilder.toString()); } else if (dataTierPrefs.length == 1) { - settingsBuilder.put(DataTierAllocationDecider.INDEX_ROUTING_PREFER, dataTierPrefs[0]); + settingsBuilder.put(DataTierAllocationDecider.TIER_PREFERENCE, dataTierPrefs[0]); } return IndexMetadata.builder(indexName) diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/DataTierMigrationRoutedStepTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/DataTierMigrationRoutedStepTests.java index 57349053e9e11..3e8acf8ad14c6 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/DataTierMigrationRoutedStepTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/DataTierMigrationRoutedStepTests.java @@ -28,7 +28,7 @@ import java.util.Set; import static java.util.Collections.emptyMap; -import static org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider.INDEX_ROUTING_PREFER; +import static org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider.TIER_PREFERENCE; import static org.elasticsearch.xpack.core.ilm.CheckShrinkReadyStepTests.randomUnassignedInfo; import static org.elasticsearch.xpack.core.ilm.step.info.AllocationInfo.waitingForActiveShardsAllocationInfo; import static org.hamcrest.Matchers.is; @@ -94,7 +94,7 @@ public void testExecuteWithUnassignedShard() { public void testExecuteWithPendingShards() { IndexMetadata indexMetadata = IndexMetadata.builder(randomAlphaOfLengthBetween(5, 10)) - .settings(settings(Version.CURRENT).put(INDEX_ROUTING_PREFER, DataTier.DATA_WARM)) + .settings(settings(Version.CURRENT).put(TIER_PREFERENCE, DataTier.DATA_WARM)) .numberOfShards(1).numberOfReplicas(0).build(); Index index = indexMetadata.getIndex(); IndexRoutingTable.Builder indexRoutingTable = IndexRoutingTable.builder(index) @@ -121,7 +121,7 @@ public void testExecuteWithPendingShards() { public void testExecuteWithPendingShardsAndTargetRoleNotPresentInCluster() { IndexMetadata indexMetadata = IndexMetadata.builder(randomAlphaOfLengthBetween(5, 10)) - .settings(settings(Version.CURRENT).put(INDEX_ROUTING_PREFER, DataTier.DATA_WARM)) + .settings(settings(Version.CURRENT).put(TIER_PREFERENCE, DataTier.DATA_WARM)) .numberOfShards(1).numberOfReplicas(0).build(); Index index = indexMetadata.getIndex(); IndexRoutingTable.Builder indexRoutingTable = IndexRoutingTable.builder(index) @@ -157,7 +157,7 @@ public void testExecuteIndexMissing() { public void testExecuteIsComplete() { IndexMetadata indexMetadata = IndexMetadata.builder(randomAlphaOfLengthBetween(5, 10)) - .settings(settings(Version.CURRENT).put(INDEX_ROUTING_PREFER, DataTier.DATA_WARM)) + .settings(settings(Version.CURRENT).put(TIER_PREFERENCE, DataTier.DATA_WARM)) .numberOfShards(1).numberOfReplicas(0).build(); Index index = indexMetadata.getIndex(); IndexRoutingTable.Builder indexRoutingTable = IndexRoutingTable.builder(index) @@ -179,7 +179,7 @@ public void testExecuteIsComplete() { public void testExecuteWithGenericDataNodes() { IndexMetadata indexMetadata = IndexMetadata.builder(randomAlphaOfLengthBetween(5, 10)) - .settings(settings(Version.CURRENT).put(INDEX_ROUTING_PREFER, DataTier.DATA_WARM)) + .settings(settings(Version.CURRENT).put(TIER_PREFERENCE, DataTier.DATA_WARM)) .numberOfShards(1).numberOfReplicas(0).build(); Index index = indexMetadata.getIndex(); IndexRoutingTable.Builder indexRoutingTable = IndexRoutingTable.builder(index) diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/MigrateActionTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/MigrateActionTests.java index 34201f97753a9..839689c879cf4 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/MigrateActionTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/MigrateActionTests.java @@ -89,19 +89,19 @@ public void testMigrateActionsConfiguresTierPreference() { { List steps = action.toSteps(null, HOT_PHASE, nextStepKey); UpdateSettingsStep firstStep = (UpdateSettingsStep) steps.get(1); - assertThat(DataTierAllocationDecider.INDEX_ROUTING_PREFER_SETTING.get(firstStep.getSettings()), + assertThat(DataTierAllocationDecider.TIER_PREFERENCE_SETTING.get(firstStep.getSettings()), is(DATA_HOT)); } { List steps = action.toSteps(null, WARM_PHASE, nextStepKey); UpdateSettingsStep firstStep = (UpdateSettingsStep) steps.get(1); - assertThat(DataTierAllocationDecider.INDEX_ROUTING_PREFER_SETTING.get(firstStep.getSettings()), + assertThat(DataTierAllocationDecider.TIER_PREFERENCE_SETTING.get(firstStep.getSettings()), is(DATA_WARM + "," + DATA_HOT)); } { List steps = action.toSteps(null, COLD_PHASE, nextStepKey); UpdateSettingsStep firstStep = (UpdateSettingsStep) steps.get(1); - assertThat(DataTierAllocationDecider.INDEX_ROUTING_PREFER_SETTING.get(firstStep.getSettings()), + assertThat(DataTierAllocationDecider.TIER_PREFERENCE_SETTING.get(firstStep.getSettings()), is(DATA_COLD + "," + DATA_WARM + "," + DATA_HOT)); } } diff --git a/x-pack/plugin/data-streams/src/internalClusterTest/java/org/elasticsearch/xpack/datastreams/DataTierDataStreamIT.java b/x-pack/plugin/data-streams/src/internalClusterTest/java/org/elasticsearch/xpack/datastreams/DataTierDataStreamIT.java index d08fa6038689e..ed163fbc6a7d1 100644 --- a/x-pack/plugin/data-streams/src/internalClusterTest/java/org/elasticsearch/xpack/datastreams/DataTierDataStreamIT.java +++ b/x-pack/plugin/data-streams/src/internalClusterTest/java/org/elasticsearch/xpack/datastreams/DataTierDataStreamIT.java @@ -60,7 +60,7 @@ public void testDefaultDataStreamAllocateToHot() { .get() .getSettings() .get(DataStream.getDefaultBackingIndexName(index, 1)); - assertThat(DataTierAllocationDecider.INDEX_ROUTING_PREFER_SETTING.get(idxSettings), equalTo(DataTier.DATA_HOT)); + assertThat(DataTierAllocationDecider.TIER_PREFERENCE_SETTING.get(idxSettings), equalTo(DataTier.DATA_HOT)); logger.info("--> waiting for {} to be yellow", index); ensureYellow(index); @@ -74,7 +74,7 @@ public void testDefaultDataStreamAllocateToHot() { .get() .getSettings() .get(DataStream.getDefaultBackingIndexName(index, 2)); - assertThat(DataTierAllocationDecider.INDEX_ROUTING_PREFER_SETTING.get(idxSettings), equalTo(DataTier.DATA_HOT)); + assertThat(DataTierAllocationDecider.TIER_PREFERENCE_SETTING.get(idxSettings), equalTo(DataTier.DATA_HOT)); client().execute(DeleteDataStreamAction.INSTANCE, new DeleteDataStreamAction.Request(new String[] { index })); } diff --git a/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/MigrateToDataTiersIT.java b/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/MigrateToDataTiersIT.java index 4d3942ae2445c..59ca2a95c7adb 100644 --- a/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/MigrateToDataTiersIT.java +++ b/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/MigrateToDataTiersIT.java @@ -10,8 +10,6 @@ import org.apache.http.entity.ContentType; import org.apache.http.entity.StringEntity; import org.apache.http.util.EntityUtils; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; import org.elasticsearch.client.Request; import org.elasticsearch.client.Response; import org.elasticsearch.client.ResponseException; @@ -116,7 +114,7 @@ public void testMigrateToDataTiersAction() throws Exception { .put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1) .put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0) .put(LifecycleSettings.LIFECYCLE_NAME, policy) - .putNull(DataTierAllocationDecider.INDEX_ROUTING_PREFER) + .putNull(DataTierAllocationDecider.TIER_PREFERENCE) .put(RolloverAction.LIFECYCLE_ROLLOVER_ALIAS, alias) ); @@ -138,7 +136,7 @@ public void testMigrateToDataTiersAction() throws Exception { createIndexWithSettings(client(), rolloverIndexPrefix + "-00000" + i, alias + i, Settings.builder() .put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1) .put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0) - .putNull(DataTierAllocationDecider.INDEX_ROUTING_PREFER) + .putNull(DataTierAllocationDecider.TIER_PREFERENCE) .put(RolloverAction.LIFECYCLE_ROLLOVER_ALIAS, alias + i) ); } @@ -179,7 +177,7 @@ public void testMigrateToDataTiersAction() throws Exception { // let's assert the require.data:warm configuration the "indexWithDataWarmRouting" had was migrated to // _tier_preference:data_warm,data_hot Map indexSettings = getOnlyIndexSettings(client(), indexWithDataWarmRouting); - assertThat(indexSettings.get(DataTierAllocationDecider.INDEX_ROUTING_PREFER), is("data_warm,data_hot")); + assertThat(indexSettings.get(DataTierAllocationDecider.TIER_PREFERENCE), is("data_warm,data_hot")); // let's retrieve the migrated policy and check it was migrated correctly - namely the warm phase should not contain any allocate // action anymore and the cold phase should contain an allocate action that only configures the number of replicas @@ -237,7 +235,7 @@ public void testMigrationDryRun() throws Exception { .put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1) .put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0) .put(LifecycleSettings.LIFECYCLE_NAME, policy) - .putNull(DataTierAllocationDecider.INDEX_ROUTING_PREFER) + .putNull(DataTierAllocationDecider.TIER_PREFERENCE) .put(RolloverAction.LIFECYCLE_ROLLOVER_ALIAS, alias) ); @@ -286,7 +284,7 @@ public void testMigrationDryRun() throws Exception { // the index settings should not contain the _tier_preference Map indexSettings = getOnlyIndexSettings(client(), indexWithDataWarmRouting); - assertThat(indexSettings.get(DataTierAllocationDecider.INDEX_ROUTING_PREFER), nullValue()); + assertThat(indexSettings.get(DataTierAllocationDecider.TIER_PREFERENCE), nullValue()); // let's check the ILM policy was not migrated - ie. the warm phase still contains the allocate action Request getPolicy = new Request("GET", "/_ilm/policy/" + policy); diff --git a/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ilm/actions/SearchableSnapshotActionIT.java b/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ilm/actions/SearchableSnapshotActionIT.java index a4fd849a7886a..e8897fcd03738 100644 --- a/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ilm/actions/SearchableSnapshotActionIT.java +++ b/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ilm/actions/SearchableSnapshotActionIT.java @@ -497,7 +497,7 @@ snapshotRepo, randomBoolean())) indexDocument(client(), dataStream, true); String firstGenIndex = DataStream.getDefaultBackingIndexName(dataStream, 1L); Map indexSettings = getIndexSettingsAsMap(firstGenIndex); - assertThat(indexSettings.get(DataTierAllocationDecider.INDEX_ROUTING_PREFER), is("data_hot")); + assertThat(indexSettings.get(DataTierAllocationDecider.TIER_PREFERENCE), is("data_hot")); // rollover the data stream so searchable_snapshot can complete rolloverMaxOneDocCondition(client(), dataStream); @@ -512,7 +512,7 @@ snapshotRepo, randomBoolean())) Map hotIndexSettings = getIndexSettingsAsMap(restoredIndex); // searchable snapshots mounted in the hot phase should be pinned to hot nodes - assertThat(hotIndexSettings.get(DataTierAllocationDecider.INDEX_ROUTING_PREFER), + assertThat(hotIndexSettings.get(DataTierAllocationDecider.TIER_PREFERENCE), is("data_hot")); } } diff --git a/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ilm/actions/ShrinkActionIT.java b/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ilm/actions/ShrinkActionIT.java index bdbc6094c4c2c..a187a74af0a84 100644 --- a/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ilm/actions/ShrinkActionIT.java +++ b/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ilm/actions/ShrinkActionIT.java @@ -13,7 +13,6 @@ import org.elasticsearch.client.ResponseException; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.cluster.routing.allocation.decider.ShardsLimitAllocationDecider; -import org.elasticsearch.core.Nullable; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; @@ -25,14 +24,12 @@ import org.elasticsearch.xpack.core.ilm.CheckTargetShardsCountStep; import org.elasticsearch.xpack.core.ilm.LifecycleAction; import org.elasticsearch.xpack.core.ilm.LifecyclePolicy; -import org.elasticsearch.xpack.core.ilm.LifecycleSettings; import org.elasticsearch.xpack.core.ilm.MigrateAction; import org.elasticsearch.xpack.core.ilm.Phase; import org.elasticsearch.xpack.core.ilm.PhaseCompleteStep; import org.elasticsearch.xpack.core.ilm.RolloverAction; import org.elasticsearch.xpack.core.ilm.SetSingleNodeAllocateStep; import org.elasticsearch.xpack.core.ilm.ShrinkAction; -import org.elasticsearch.xpack.core.ilm.ShrinkStep; import org.elasticsearch.xpack.core.ilm.Step; import org.junit.Before; @@ -42,7 +39,6 @@ import java.util.concurrent.TimeUnit; import static java.util.Collections.singletonMap; -import static org.elasticsearch.cluster.metadata.IndexMetadata.SETTING_NUMBER_OF_REPLICAS; import static org.elasticsearch.cluster.metadata.IndexMetadata.SETTING_NUMBER_OF_SHARDS; import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.xpack.TimeSeriesRestDriver.createIndexWithSettings; @@ -212,7 +208,7 @@ public void testSetSingleNodeAllocationRetriesUntilItSucceeds() throws Exception createIndexWithSettings(client(), index, alias, Settings.builder() .put(SETTING_NUMBER_OF_SHARDS, numShards) .put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0) - .putNull(DataTierAllocationDecider.INDEX_ROUTING_PREFER)); + .putNull(DataTierAllocationDecider.TIER_PREFERENCE)); ensureGreen(index); diff --git a/x-pack/plugin/ilm/src/internalClusterTest/java/org/elasticsearch/xpack/ilm/DataTiersMigrationsTests.java b/x-pack/plugin/ilm/src/internalClusterTest/java/org/elasticsearch/xpack/ilm/DataTiersMigrationsTests.java index ea39c22ec7903..aae84b3a625db 100644 --- a/x-pack/plugin/ilm/src/internalClusterTest/java/org/elasticsearch/xpack/ilm/DataTiersMigrationsTests.java +++ b/x-pack/plugin/ilm/src/internalClusterTest/java/org/elasticsearch/xpack/ilm/DataTiersMigrationsTests.java @@ -190,7 +190,7 @@ public void testUserOptsOutOfTierMigration() throws Exception { assertReplicaIsUnassigned(); }, 30, TimeUnit.SECONDS); - Settings removeTierRoutingSetting = Settings.builder().putNull(DataTierAllocationDecider.INDEX_ROUTING_PREFER).build(); + Settings removeTierRoutingSetting = Settings.builder().putNull(DataTierAllocationDecider.TIER_PREFERENCE).build(); UpdateSettingsRequest updateSettingsRequest = new UpdateSettingsRequest(managedIndex).settings(removeTierRoutingSetting); assertAcked(client().admin().indices().updateSettings(updateSettingsRequest).actionGet()); diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/cluster/metadata/MetadataMigrateToDataTiersRoutingService.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/cluster/metadata/MetadataMigrateToDataTiersRoutingService.java index 0e9df6c08c20e..87bfe72079b64 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/cluster/metadata/MetadataMigrateToDataTiersRoutingService.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/cluster/metadata/MetadataMigrateToDataTiersRoutingService.java @@ -50,7 +50,7 @@ import static org.elasticsearch.cluster.metadata.IndexMetadata.INDEX_ROUTING_EXCLUDE_GROUP_SETTING; import static org.elasticsearch.cluster.metadata.IndexMetadata.INDEX_ROUTING_INCLUDE_GROUP_SETTING; import static org.elasticsearch.cluster.metadata.IndexMetadata.INDEX_ROUTING_REQUIRE_GROUP_SETTING; -import static org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider.INDEX_ROUTING_PREFER; +import static org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider.TIER_PREFERENCE; import static org.elasticsearch.xpack.core.ilm.LifecycleExecutionState.ILM_CUSTOM_METADATA_KEY; import static org.elasticsearch.xpack.core.ilm.OperationMode.STOPPED; import static org.elasticsearch.xpack.core.ilm.PhaseCacheManagement.updateIndicesForPolicy; @@ -418,7 +418,7 @@ private static Settings maybeMigrateRoutingSettingToTierPreference(String attrib // look at the value, get the correct tiers config and update the settings and index metadata Settings.Builder newSettingsBuilder = Settings.builder().put(currentIndexSettings); String indexName = indexMetadata.getIndex().getName(); - if (currentIndexSettings.keySet().contains(INDEX_ROUTING_PREFER)) { + if (currentIndexSettings.keySet().contains(TIER_PREFERENCE)) { newSettingsBuilder.remove(attributeBasedRoutingSettingName); logger.debug("index [{}]: removed setting [{}]", indexName, attributeBasedRoutingSettingName); } else { @@ -426,11 +426,11 @@ private static Settings maybeMigrateRoutingSettingToTierPreference(String attrib String attributeValue = currentIndexSettings.get(attributeBasedRoutingSettingName); String convertedTierPreference = convertAttributeValueToTierPreference(attributeValue); if (convertedTierPreference != null) { - newSettingsBuilder.put(INDEX_ROUTING_PREFER, convertedTierPreference); + newSettingsBuilder.put(TIER_PREFERENCE, convertedTierPreference); newSettingsBuilder.remove(attributeBasedRoutingSettingName); logger.debug("index [{}]: removed setting [{}]", indexName, attributeBasedRoutingSettingName); logger.debug("index [{}]: configured setting [{}] to [{}]", indexName, - INDEX_ROUTING_PREFER, convertedTierPreference); + TIER_PREFERENCE, convertedTierPreference); } else { // log warning and do *not* remove setting, return the settings unchanged logger.warn("index [{}]: could not convert attribute based setting [{}] value of [{}] to a tier preference " + diff --git a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/cluster/metadata/MetadataMigrateToDataTiersRoutingServiceTests.java b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/cluster/metadata/MetadataMigrateToDataTiersRoutingServiceTests.java index a738c373b0a1c..dc52f3280fc50 100644 --- a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/cluster/metadata/MetadataMigrateToDataTiersRoutingServiceTests.java +++ b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/cluster/metadata/MetadataMigrateToDataTiersRoutingServiceTests.java @@ -53,7 +53,7 @@ import static org.elasticsearch.xpack.cluster.metadata.MetadataMigrateToDataTiersRoutingService.migrateIlmPolicies; import static org.elasticsearch.xpack.cluster.metadata.MetadataMigrateToDataTiersRoutingService.migrateIndices; import static org.elasticsearch.xpack.cluster.metadata.MetadataMigrateToDataTiersRoutingService.migrateToDataTiersRouting; -import static org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider.INDEX_ROUTING_PREFER; +import static org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider.TIER_PREFERENCE; import static org.elasticsearch.xpack.core.ilm.LifecycleExecutionState.ILM_CUSTOM_METADATA_KEY; import static org.hamcrest.Matchers.empty; import static org.hamcrest.Matchers.is; @@ -374,7 +374,7 @@ public void testMigrateIndices() { ClusterState migratedState = ClusterState.builder(ClusterName.DEFAULT).metadata(mb).build(); IndexMetadata migratedIndex = migratedState.metadata().index("indexWitWarmDataAttribute"); assertThat(migratedIndex.getSettings().get(DATA_ROUTING_REQUIRE_SETTING), nullValue()); - assertThat(migratedIndex.getSettings().get(INDEX_ROUTING_PREFER), is("data_warm,data_hot")); + assertThat(migratedIndex.getSettings().get(TIER_PREFERENCE), is("data_warm,data_hot")); } { @@ -394,7 +394,7 @@ public void testMigrateIndices() { ClusterState migratedState = ClusterState.builder(ClusterName.DEFAULT).metadata(mb).build(); IndexMetadata migratedIndex = migratedState.metadata().index("indexWitWarmDataAttribute"); assertThat(migratedIndex.getSettings().get(DATA_ROUTING_INCLUDE_SETTING), nullValue()); - assertThat(migratedIndex.getSettings().get(INDEX_ROUTING_PREFER), is("data_warm,data_hot")); + assertThat(migratedIndex.getSettings().get(TIER_PREFERENCE), is("data_warm,data_hot")); } { @@ -404,7 +404,7 @@ public void testMigrateIndices() { IndexMetadata.builder("indexWithTierPreferenceAndDataAttribute").settings(getBaseIndexSettings() .put(DATA_ROUTING_REQUIRE_SETTING, "cold") .put(DATA_ROUTING_INCLUDE_SETTING, "hot") - .put(INDEX_ROUTING_PREFER, "data_warm,data_hot") + .put(TIER_PREFERENCE, "data_warm,data_hot") ); ClusterState state = ClusterState.builder(ClusterName.DEFAULT).metadata(Metadata.builder().put(indexWithTierPreferenceAndDataAttribute)).build(); @@ -419,7 +419,7 @@ public void testMigrateIndices() { IndexMetadata migratedIndex = migratedState.metadata().index("indexWithTierPreferenceAndDataAttribute"); assertThat(migratedIndex.getSettings().get(DATA_ROUTING_REQUIRE_SETTING), nullValue()); assertThat(migratedIndex.getSettings().get(DATA_ROUTING_INCLUDE_SETTING), nullValue()); - assertThat(migratedIndex.getSettings().get(INDEX_ROUTING_PREFER), is("data_warm,data_hot")); + assertThat(migratedIndex.getSettings().get(TIER_PREFERENCE), is("data_warm,data_hot")); } { @@ -428,7 +428,7 @@ public void testMigrateIndices() { IndexMetadata.Builder indexWithTierPreferenceAndDataAttribute = IndexMetadata.builder("indexWithTierPreferenceAndDataAttribute").settings(getBaseIndexSettings() .put(DATA_ROUTING_INCLUDE_SETTING, "cold") - .put(INDEX_ROUTING_PREFER, "data_warm,data_hot") + .put(TIER_PREFERENCE, "data_warm,data_hot") ); ClusterState state = ClusterState.builder(ClusterName.DEFAULT).metadata(Metadata.builder().put(indexWithTierPreferenceAndDataAttribute)).build(); @@ -442,7 +442,7 @@ public void testMigrateIndices() { ClusterState migratedState = ClusterState.builder(ClusterName.DEFAULT).metadata(mb).build(); IndexMetadata migratedIndex = migratedState.metadata().index("indexWithTierPreferenceAndDataAttribute"); assertThat(migratedIndex.getSettings().get(DATA_ROUTING_INCLUDE_SETTING), nullValue()); - assertThat(migratedIndex.getSettings().get(INDEX_ROUTING_PREFER), is("data_warm,data_hot")); + assertThat(migratedIndex.getSettings().get(TIER_PREFERENCE), is("data_warm,data_hot")); } { @@ -481,7 +481,7 @@ public void testMigrateIndices() { IndexMetadata migratedIndex = migratedState.metadata().index("indexWithDataAndBoxAttribute"); assertThat(migratedIndex.getSettings().get(DATA_ROUTING_REQUIRE_SETTING), nullValue()); assertThat(migratedIndex.getSettings().get(BOX_ROUTING_REQUIRE_SETTING), is("box1")); - assertThat(migratedIndex.getSettings().get(INDEX_ROUTING_PREFER), is("data_warm,data_hot")); + assertThat(migratedIndex.getSettings().get(TIER_PREFERENCE), is("data_warm,data_hot")); } { @@ -500,7 +500,7 @@ public void testMigrateIndices() { IndexMetadata migratedIndex = migratedState.metadata().index("indexWithBoxAttribute"); assertThat(migratedIndex.getSettings().get(DATA_ROUTING_REQUIRE_SETTING), nullValue()); assertThat(migratedIndex.getSettings().get(BOX_ROUTING_REQUIRE_SETTING), is("warm")); - assertThat(migratedIndex.getSettings().get(INDEX_ROUTING_PREFER), nullValue()); + assertThat(migratedIndex.getSettings().get(TIER_PREFERENCE), nullValue()); } { @@ -518,7 +518,7 @@ public void testMigrateIndices() { IndexMetadata migratedIndex = migratedState.metadata().index("indexNoRoutingAttribute"); assertThat(migratedIndex.getSettings().get(DATA_ROUTING_REQUIRE_SETTING), nullValue()); assertThat(migratedIndex.getSettings().get(BOX_ROUTING_REQUIRE_SETTING), nullValue()); - assertThat(migratedIndex.getSettings().get(INDEX_ROUTING_PREFER), nullValue()); + assertThat(migratedIndex.getSettings().get(TIER_PREFERENCE), nullValue()); } } @@ -544,7 +544,7 @@ public void testRequireAttributeIndexSettingTakesPriorityOverInclude() { assertThat(migratedIndex.getSettings().get(DATA_ROUTING_INCLUDE_SETTING), nullValue()); assertThat(migratedIndex.getSettings().get(DATA_ROUTING_REQUIRE_SETTING), nullValue()); assertThat(migratedIndex.getSettings().get(DATA_ROUTING_EXCLUDE_SETTING), nullValue()); - assertThat(migratedIndex.getSettings().get(INDEX_ROUTING_PREFER), is("data_warm,data_hot")); + assertThat(migratedIndex.getSettings().get(TIER_PREFERENCE), is("data_warm,data_hot")); } public void testMigrateToDataTiersRouting() { @@ -633,7 +633,7 @@ public void testMigrateToDataTiersRouting() { assertThat(migratedEntities.migratedIndices.get(0), is("indexWitWarmDataAttribute")); IndexMetadata migratedIndex = migratedEntitiesTuple.v1().metadata().index("indexWitWarmDataAttribute"); - assertThat(migratedIndex.getSettings().get(INDEX_ROUTING_PREFER), is("data_warm,data_hot")); + assertThat(migratedIndex.getSettings().get(TIER_PREFERENCE), is("data_warm,data_hot")); } } diff --git a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/FrozenSearchableSnapshotsIntegTests.java b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/FrozenSearchableSnapshotsIntegTests.java index 264dcfdca2a66..1fb4bdc079f05 100644 --- a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/FrozenSearchableSnapshotsIntegTests.java +++ b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/FrozenSearchableSnapshotsIntegTests.java @@ -300,7 +300,7 @@ public void testCreateAndRestorePartialSearchableSnapshot() throws Exception { assertTrue(SearchableSnapshots.SNAPSHOT_INDEX_ID_SETTING.exists(settings)); assertThat(IndexMetadata.INDEX_AUTO_EXPAND_REPLICAS_SETTING.get(settings).toString(), equalTo("false")); assertThat(IndexMetadata.INDEX_NUMBER_OF_REPLICAS_SETTING.get(settings), equalTo(expectedReplicas)); - assertThat(DataTierAllocationDecider.INDEX_ROUTING_PREFER_SETTING.get(settings), equalTo(expectedDataTiersPreference)); + assertThat(DataTierAllocationDecider.TIER_PREFERENCE_SETTING.get(settings), equalTo(expectedDataTiersPreference)); assertTrue(SearchableSnapshotsConstants.SNAPSHOT_PARTIAL_SETTING.get(settings)); assertTrue(DiskThresholdDecider.SETTING_IGNORE_DISK_WATERMARKS.get(settings)); assertThat(IndexSettings.INDEX_CHECK_ON_STARTUP.get(settings), equalTo(indexCheckOnStartup)); @@ -436,7 +436,7 @@ public void testCreateAndRestorePartialSearchableSnapshot() throws Exception { Settings.builder() .putNull(IndexModule.INDEX_STORE_TYPE_SETTING.getKey()) .putNull(IndexModule.INDEX_RECOVERY_TYPE_SETTING.getKey()) - .put(DataTierAllocationDecider.INDEX_ROUTING_PREFER, DataTier.DATA_HOT) + .put(DataTierAllocationDecider.TIER_PREFERENCE, DataTier.DATA_HOT) .build() ) ); diff --git a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsIntegTests.java b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsIntegTests.java index 7b535818e0f8c..69d9f2f3e4491 100644 --- a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsIntegTests.java +++ b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsIntegTests.java @@ -203,7 +203,7 @@ public void testCreateAndRestoreSearchableSnapshot() throws Exception { DataTier.ALL_DATA_TIERS.stream().filter(tier -> tier.equals(DataTier.DATA_FROZEN) == false).collect(Collectors.toSet()) ) ); - indexSettingsBuilder.put(DataTierAllocationDecider.INDEX_ROUTING_PREFER, expectedDataTiersPreference); + indexSettingsBuilder.put(DataTierAllocationDecider.TIER_PREFERENCE, expectedDataTiersPreference); } else { expectedDataTiersPreference = MountSearchableSnapshotRequest.Storage.FULL_COPY.defaultDataTiersPreference(); } @@ -247,7 +247,7 @@ public void testCreateAndRestoreSearchableSnapshot() throws Exception { assertTrue(SearchableSnapshots.SNAPSHOT_INDEX_ID_SETTING.exists(settings)); assertThat(IndexMetadata.INDEX_AUTO_EXPAND_REPLICAS_SETTING.get(settings).toString(), equalTo("false")); assertThat(IndexMetadata.INDEX_NUMBER_OF_REPLICAS_SETTING.get(settings), equalTo(expectedReplicas)); - assertThat(DataTierAllocationDecider.INDEX_ROUTING_PREFER_SETTING.get(settings), equalTo(expectedDataTiersPreference)); + assertThat(DataTierAllocationDecider.TIER_PREFERENCE_SETTING.get(settings), equalTo(expectedDataTiersPreference)); assertThat(IndexSettings.INDEX_CHECK_ON_STARTUP.get(settings), equalTo("false")); checkSoftDeletesNotEagerlyLoaded(restoredIndexName); diff --git a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsResizeIntegTests.java b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsResizeIntegTests.java index a08e6f5f28c9c..334e49f03198f 100644 --- a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsResizeIntegTests.java +++ b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsResizeIntegTests.java @@ -120,7 +120,7 @@ public void testCloneSearchableSnapshotIndex() { Settings.builder() .putNull(IndexModule.INDEX_STORE_TYPE_SETTING.getKey()) .putNull(IndexModule.INDEX_RECOVERY_TYPE_SETTING.getKey()) - .put(DataTierAllocationDecider.INDEX_ROUTING_PREFER, DataTier.DATA_HOT) + .put(DataTierAllocationDecider.TIER_PREFERENCE, DataTier.DATA_HOT) .put(INDEX_NUMBER_OF_REPLICAS_SETTING.getKey(), 0) .build() ) diff --git a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/allocation/SearchableSnapshotDataTierIntegTests.java b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/allocation/SearchableSnapshotDataTierIntegTests.java index 1e509eeca553d..89e902ac94fb3 100644 --- a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/allocation/SearchableSnapshotDataTierIntegTests.java +++ b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/allocation/SearchableSnapshotDataTierIntegTests.java @@ -25,7 +25,7 @@ public class SearchableSnapshotDataTierIntegTests extends BaseFrozenSearchableSn private static final String snapshotName = "test-snapshot"; private static final String mountedIndexName = "test-index-mounted"; private static final Settings frozenSettings = Settings.builder() - .put(DataTierAllocationDecider.INDEX_ROUTING_PREFER, DataTier.DATA_FROZEN) + .put(DataTierAllocationDecider.TIER_PREFERENCE, DataTier.DATA_FROZEN) .build(); public void testPartialLegalOnFrozen() throws Exception { @@ -64,7 +64,7 @@ public void testFullIllegalOnFrozen() throws Exception { Settings.EMPTY, Settings.builder() .put( - DataTierAllocationDecider.INDEX_ROUTING_PREFER, + DataTierAllocationDecider.TIER_PREFERENCE, randomValueOtherThan(DataTier.DATA_FROZEN, () -> randomFrom(DataTier.ALL_DATA_TIERS)) ) .build() @@ -77,9 +77,7 @@ public void testFullIllegalOnFrozen() throws Exception { private void updatePreference(String tier) { client().admin() .indices() - .updateSettings( - new UpdateSettingsRequest(mountedIndexName).settings(Map.of(DataTierAllocationDecider.INDEX_ROUTING_PREFER, tier)) - ) + .updateSettings(new UpdateSettingsRequest(mountedIndexName).settings(Map.of(DataTierAllocationDecider.TIER_PREFERENCE, tier))) .actionGet(); } } diff --git a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/cache/blob/SearchableSnapshotsBlobStoreCacheIntegTests.java b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/cache/blob/SearchableSnapshotsBlobStoreCacheIntegTests.java index 53e05525530d2..8ff3b79164ded 100644 --- a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/cache/blob/SearchableSnapshotsBlobStoreCacheIntegTests.java +++ b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/cache/blob/SearchableSnapshotsBlobStoreCacheIntegTests.java @@ -205,7 +205,7 @@ public void testBlobStoreCache() throws Exception { .indices() .prepareGetSettings(SNAPSHOT_BLOB_CACHE_INDEX) .get() - .getSetting(SNAPSHOT_BLOB_CACHE_INDEX, DataTierAllocationDecider.INDEX_ROUTING_PREFER), + .getSetting(SNAPSHOT_BLOB_CACHE_INDEX, DataTierAllocationDecider.TIER_PREFERENCE), equalTo("data_content,data_hot") ); diff --git a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/cache/shared/PartiallyCachedShardAllocationIntegTests.java b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/cache/shared/PartiallyCachedShardAllocationIntegTests.java index c499512231ae6..b6d7047414bab 100644 --- a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/cache/shared/PartiallyCachedShardAllocationIntegTests.java +++ b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/cache/shared/PartiallyCachedShardAllocationIntegTests.java @@ -53,7 +53,7 @@ import static org.elasticsearch.index.IndexSettings.INDEX_SOFT_DELETES_SETTING; import static org.elasticsearch.test.NodeRoles.onlyRole; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; -import static org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider.INDEX_ROUTING_PREFER; +import static org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider.TIER_PREFERENCE; import static org.elasticsearch.xpack.searchablesnapshots.cache.shared.FrozenCacheService.SNAPSHOT_CACHE_SIZE_SETTING; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasItem; @@ -163,7 +163,7 @@ public void testOnlyPartialSearchableSnapshotAllocatedToDedicatedFrozenNodes() t .build() ); - createIndex("other-index", Settings.builder().putNull(INDEX_ROUTING_PREFER).build()); + createIndex("other-index", Settings.builder().putNull(TIER_PREFERENCE).build()); ensureGreen("other-index"); final RoutingNodes routingNodes = client().admin() .cluster() diff --git a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshots.java b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshots.java index 427c4879bcb76..c61a9103383b8 100644 --- a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshots.java +++ b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshots.java @@ -592,7 +592,7 @@ private Settings getIndexSettings() { .put(IndexMetadata.SETTING_AUTO_EXPAND_REPLICAS, "0-1") .put(IndexMetadata.SETTING_PRIORITY, "900") .put(IndexSettings.INDEX_TRANSLOG_DURABILITY_SETTING.getKey(), Translog.Durability.ASYNC) - .put(DataTierAllocationDecider.INDEX_ROUTING_PREFER, DATA_TIERS_CACHE_INDEX_PREFERENCE) + .put(DataTierAllocationDecider.TIER_PREFERENCE, DATA_TIERS_CACHE_INDEX_PREFERENCE) .build(); } diff --git a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/action/TransportMountSearchableSnapshotAction.java b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/action/TransportMountSearchableSnapshotAction.java index 562efd4079336..ce8f9edd7f76a 100644 --- a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/action/TransportMountSearchableSnapshotAction.java +++ b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/action/TransportMountSearchableSnapshotAction.java @@ -72,7 +72,7 @@ public class TransportMountSearchableSnapshotAction extends TransportMasterNodeA RestoreSnapshotResponse> { private static final Collection> DATA_TIER_ALLOCATION_SETTINGS = List.of( - DataTierAllocationDecider.INDEX_ROUTING_PREFER_SETTING + DataTierAllocationDecider.TIER_PREFERENCE_SETTING ); private final Client client; @@ -233,7 +233,7 @@ protected void masterOperation( .put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0) // can be overridden .put(IndexMetadata.SETTING_AUTO_EXPAND_REPLICAS, false) // can be overridden .put(IndexSettings.INDEX_CHECK_ON_STARTUP.getKey(), false) // can be overridden - .put(DataTierAllocationDecider.INDEX_ROUTING_PREFER, request.storage().defaultDataTiersPreference()) + .put(DataTierAllocationDecider.TIER_PREFERENCE, request.storage().defaultDataTiersPreference()) .put(request.indexSettings()) .put( buildIndexSettings( From 3714812b5e74de23d7e99cc8e0b9944ce73ea85c Mon Sep 17 00:00:00 2001 From: Artem Prigoda Date: Wed, 29 Sep 2021 21:30:41 +0200 Subject: [PATCH 068/250] Add support for getting a key set for ImmutableOpenMap (#77897) * Add support for getting a Java stream over ImmutableOpenMap keys Currently, we support only getting an iterator which is quite cumbersome to work with. The Streams API interacts much better with Java Collections. * Remove the cursor variable * Add tests for ImmutableOpenMapTests#keysStream * Add more tests for ImmutableOpenMapTests#keysStream * Use a method reference for ImmutableOpenMap::builder * Provide keySet instead of keyStream * Rename keysSet to keySet to be consistent with JUC * Bring back indexMetadata.getAliases().keysIt().forEachRemaining(allAliases::add) * Revert "Bring back indexMetadata.getAliases().keysIt().forEachRemaining(allAliases::add)" This reverts commit 9066ef62dce78e736c146ca320eb2e16074511bc. * Bring back indexMetadata.getAliases().keysIt().forEachRemaining(allAliases::add) * Fix testEmptyKeySetWorks check It returns ints * Inline the keysIt call * Override contains on AbstractSet --- .../client/AbstractResponseTestCase.java | 9 +-- .../alias/get/TransportGetAliasesAction.java | 6 +- .../indices/resolve/ResolveIndexAction.java | 11 +--- .../common/collect/ImmutableOpenMap.java | 25 ++++++++ .../indices/AssociatedIndexDescriptor.java | 15 ++--- .../indices/SystemDataStreamDescriptor.java | 12 +--- .../indices/SystemIndexDescriptor.java | 13 ++--- .../alias/get/GetAliasesResponseTests.java | 13 +---- .../cluster/node/DiscoveryNodesTests.java | 17 ++---- .../common/collect/ImmutableOpenMapTests.java | 58 +++++++++++++++++-- .../xpack/ccr/repository/CcrRepository.java | 8 +-- .../MachineLearningUsageTransportAction.java | 9 +-- .../TransportGetTrainedModelsStatsAction.java | 11 +--- 13 files changed, 111 insertions(+), 96 deletions(-) diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/AbstractResponseTestCase.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/AbstractResponseTestCase.java index c11f549b24af5..d08de164e8d9d 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/AbstractResponseTestCase.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/AbstractResponseTestCase.java @@ -19,8 +19,6 @@ import org.elasticsearch.test.ESTestCase; import java.io.IOException; -import java.util.HashSet; -import java.util.Iterator; import java.util.Map; import java.util.Set; @@ -80,12 +78,7 @@ protected ToXContent.Params getParams() { } protected static void assertMapEquals(ImmutableOpenMap expected, Map actual) { - Set expectedKeys = new HashSet<>(); - Iterator keysIt = expected.keysIt(); - while (keysIt.hasNext()) { - expectedKeys.add(keysIt.next()); - } - + Set expectedKeys = expected.keySet(); assertEquals(expectedKeys, actual.keySet()); for (String key : expectedKeys) { assertEquals(expected.get(key), actual.get(key)); diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/alias/get/TransportGetAliasesAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/alias/get/TransportGetAliasesAction.java index 30fcc16c8ac08..3ed8e76da6ebf 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/alias/get/TransportGetAliasesAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/alias/get/TransportGetAliasesAction.java @@ -35,7 +35,6 @@ import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; -import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.function.Predicate; @@ -136,8 +135,7 @@ private static void checkSystemIndexAccess(GetAliasesRequest request, SystemIndi List netNewSystemIndices = new ArrayList<>(); List systemIndicesNames = new ArrayList<>(); - for (Iterator it = aliasesMap.keysIt(); it.hasNext(); ) { - String indexName = it.next(); + aliasesMap.keySet().forEach(indexName -> { IndexMetadata index = state.metadata().index(indexName); if (index != null && index.isSystem()) { if (systemIndexAccessAllowPredicate.test(index) == false) { @@ -148,7 +146,7 @@ private static void checkSystemIndexAccess(GetAliasesRequest request, SystemIndi } } } - } + }); if (systemIndicesNames.isEmpty() == false) { deprecationLogger.critical(DeprecationCategory.API, "open_system_index_access", "this request accesses system indices: {}, but in a future major version, direct access to system " + diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/resolve/ResolveIndexAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/resolve/ResolveIndexAction.java index 7e04b78dbbc1f..5143e6c9dab42 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/resolve/ResolveIndexAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/resolve/ResolveIndexAction.java @@ -26,16 +26,16 @@ import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; import org.elasticsearch.cluster.metadata.Metadata; import org.elasticsearch.cluster.service.ClusterService; -import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.util.concurrent.CountDown; +import org.elasticsearch.common.xcontent.ParseField; import org.elasticsearch.common.xcontent.ToXContentObject; import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.core.Nullable; import org.elasticsearch.tasks.Task; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.RemoteClusterAware; @@ -51,9 +51,7 @@ import java.util.Map; import java.util.Objects; import java.util.SortedMap; -import java.util.Spliterators; import java.util.TreeMap; -import java.util.stream.StreamSupport; public class ResolveIndexAction extends ActionType { @@ -540,10 +538,7 @@ private static void enrichIndexAbstraction(String indexAbstraction, SortedMap attributes = new ArrayList<>(); attributes.add(index.getWriteIndex().getState() == IndexMetadata.State.OPEN ? "open" : "closed"); diff --git a/server/src/main/java/org/elasticsearch/common/collect/ImmutableOpenMap.java b/server/src/main/java/org/elasticsearch/common/collect/ImmutableOpenMap.java index 2b6c87432e302..2f4720f619884 100644 --- a/server/src/main/java/org/elasticsearch/common/collect/ImmutableOpenMap.java +++ b/server/src/main/java/org/elasticsearch/common/collect/ImmutableOpenMap.java @@ -21,8 +21,10 @@ import com.carrotsearch.hppc.procedures.ObjectObjectProcedure; import java.util.AbstractMap; +import java.util.AbstractSet; import java.util.Iterator; import java.util.Map; +import java.util.Set; import java.util.Spliterator; import java.util.Spliterators; import java.util.function.Consumer; @@ -136,6 +138,29 @@ public void remove() { }; } + /** + * Returns a {@link Set} view of the keys contained in this map. + */ + public Set keySet() { + return new AbstractSet<>() { + @Override + public Iterator iterator() { + return keysIt(); + } + + @Override + public int size() { + return map.size(); + } + + @Override + @SuppressWarnings("unchecked") + public boolean contains(Object o) { + return map.containsKey((KType) o); + } + }; + } + /** * @return Returns a container with all values stored in this map. */ diff --git a/server/src/main/java/org/elasticsearch/indices/AssociatedIndexDescriptor.java b/server/src/main/java/org/elasticsearch/indices/AssociatedIndexDescriptor.java index 02df93800e86a..43fc8bbd20185 100644 --- a/server/src/main/java/org/elasticsearch/indices/AssociatedIndexDescriptor.java +++ b/server/src/main/java/org/elasticsearch/indices/AssociatedIndexDescriptor.java @@ -13,10 +13,9 @@ import org.apache.lucene.util.automaton.RegExp; import org.elasticsearch.cluster.metadata.Metadata; -import java.util.ArrayList; -import java.util.Collections; import java.util.List; import java.util.Objects; +import java.util.stream.Collectors; /** * An "associated index" is an index that is related to or derived from a system @@ -107,14 +106,10 @@ static Automaton buildAutomaton(String pattern) { */ @Override public List getMatchingIndices(Metadata metadata) { - ArrayList matchingIndices = new ArrayList<>(); - metadata.indices().keysIt().forEachRemaining(indexName -> { - if (matchesIndexPattern(indexName)) { - matchingIndices.add(indexName); - } - }); - - return Collections.unmodifiableList(matchingIndices); + return metadata.indices().keySet() + .stream() + .filter(this::matchesIndexPattern) + .collect(Collectors.toUnmodifiableList()); } /** diff --git a/server/src/main/java/org/elasticsearch/indices/SystemDataStreamDescriptor.java b/server/src/main/java/org/elasticsearch/indices/SystemDataStreamDescriptor.java index 6ef0c835595a0..e9f49c809cd3f 100644 --- a/server/src/main/java/org/elasticsearch/indices/SystemDataStreamDescriptor.java +++ b/server/src/main/java/org/elasticsearch/indices/SystemDataStreamDescriptor.java @@ -14,11 +14,10 @@ import org.elasticsearch.cluster.metadata.DataStream; import org.elasticsearch.cluster.metadata.Metadata; -import java.util.ArrayList; -import java.util.Collections; import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.stream.Collectors; import static org.elasticsearch.indices.AssociatedIndexDescriptor.buildAutomaton; @@ -92,14 +91,7 @@ public String getDataStreamName() { * @return List of names of backing indices */ public List getBackingIndexNames(Metadata metadata) { - ArrayList matchingIndices = new ArrayList<>(); - metadata.indices().keysIt().forEachRemaining(indexName -> { - if (this.characterRunAutomaton.run(indexName)) { - matchingIndices.add(indexName); - } - }); - - return Collections.unmodifiableList(matchingIndices); + return metadata.indices().keySet().stream().filter(this.characterRunAutomaton::run).collect(Collectors.toUnmodifiableList()); } public String getDescription() { diff --git a/server/src/main/java/org/elasticsearch/indices/SystemIndexDescriptor.java b/server/src/main/java/org/elasticsearch/indices/SystemIndexDescriptor.java index 0fad85af8ac35..930b4e7f5a0d3 100644 --- a/server/src/main/java/org/elasticsearch/indices/SystemIndexDescriptor.java +++ b/server/src/main/java/org/elasticsearch/indices/SystemIndexDescriptor.java @@ -31,6 +31,7 @@ import java.util.Map; import java.util.Objects; import java.util.Set; +import java.util.stream.Collectors; /** * A system index descriptor describes one or more system indices. It can match a number of indices using @@ -348,14 +349,10 @@ public boolean matchesIndexPattern(String index) { */ @Override public List getMatchingIndices(Metadata metadata) { - ArrayList matchingIndices = new ArrayList<>(); - metadata.indices().keysIt().forEachRemaining(indexName -> { - if (matchesIndexPattern(indexName)) { - matchingIndices.add(indexName); - } - }); - - return Collections.unmodifiableList(matchingIndices); + return metadata.indices().keySet() + .stream() + .filter(this::matchesIndexPattern) + .collect(Collectors.toUnmodifiableList()); } /** diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/alias/get/GetAliasesResponseTests.java b/server/src/test/java/org/elasticsearch/action/admin/indices/alias/get/GetAliasesResponseTests.java index 84abb9ec84b52..9fb8f2c2b98c6 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/alias/get/GetAliasesResponseTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/indices/alias/get/GetAliasesResponseTests.java @@ -8,17 +8,15 @@ package org.elasticsearch.action.admin.indices.alias.get; -import org.elasticsearch.cluster.metadata.DataStreamTestHelper; import org.elasticsearch.cluster.metadata.AliasMetadata; import org.elasticsearch.cluster.metadata.AliasMetadata.Builder; +import org.elasticsearch.cluster.metadata.DataStreamTestHelper; import org.elasticsearch.common.collect.ImmutableOpenMap; -import org.elasticsearch.core.Tuple; import org.elasticsearch.common.io.stream.Writeable; +import org.elasticsearch.core.Tuple; import org.elasticsearch.test.AbstractWireSerializingTestCase; import java.util.ArrayList; -import java.util.HashSet; -import java.util.Iterator; import java.util.List; import java.util.Set; import java.util.function.Predicate; @@ -53,12 +51,7 @@ private static ImmutableOpenMap> mutateAliases(Immut return builder.build(); } - Set indices = new HashSet<>(); - Iterator keys = aliases.keysIt(); - while (keys.hasNext()) { - indices.add(keys.next()); - } - + Set indices = aliases.keySet(); List indicesToBeModified = randomSubsetOf(randomIntBetween(1, indices.size()), indices); ImmutableOpenMap.Builder> builder = ImmutableOpenMap.builder(); diff --git a/server/src/test/java/org/elasticsearch/cluster/node/DiscoveryNodesTests.java b/server/src/test/java/org/elasticsearch/cluster/node/DiscoveryNodesTests.java index 91b38a88f7f62..813035b5f629b 100644 --- a/server/src/test/java/org/elasticsearch/cluster/node/DiscoveryNodesTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/node/DiscoveryNodesTests.java @@ -9,6 +9,7 @@ package org.elasticsearch.cluster.node; import com.carrotsearch.randomizedtesting.generators.RandomPicks; + import org.elasticsearch.Version; import org.elasticsearch.common.transport.TransportAddress; import org.elasticsearch.test.ESTestCase; @@ -309,30 +310,22 @@ Set matchingNodeIds(DiscoveryNodes nodes) { }, MASTER_ELIGIBLE(DiscoveryNodeRole.MASTER_ROLE.roleName() + ":true") { @Override Set matchingNodeIds(DiscoveryNodes nodes) { - Set ids = new HashSet<>(); - nodes.getMasterNodes().keysIt().forEachRemaining(ids::add); - return ids; + return nodes.getMasterNodes().keySet(); } }, DATA(DiscoveryNodeRole.DATA_ROLE.roleName() + ":true") { @Override Set matchingNodeIds(DiscoveryNodes nodes) { - Set ids = new HashSet<>(); - nodes.getDataNodes().keysIt().forEachRemaining(ids::add); - return ids; + return nodes.getDataNodes().keySet(); } }, INGEST(DiscoveryNodeRole.INGEST_ROLE.roleName() + ":true") { @Override Set matchingNodeIds(DiscoveryNodes nodes) { - Set ids = new HashSet<>(); - nodes.getIngestNodes().keysIt().forEachRemaining(ids::add); - return ids; + return nodes.getIngestNodes().keySet(); } }, COORDINATING_ONLY(DiscoveryNode.COORDINATING_ONLY + ":true") { @Override Set matchingNodeIds(DiscoveryNodes nodes) { - Set ids = new HashSet<>(); - nodes.getCoordinatingOnlyNodes().keysIt().forEachRemaining(ids::add); - return ids; + return nodes.getCoordinatingOnlyNodes().keySet(); } }, CUSTOM_ATTRIBUTE("attr:value") { @Override diff --git a/server/src/test/java/org/elasticsearch/common/collect/ImmutableOpenMapTests.java b/server/src/test/java/org/elasticsearch/common/collect/ImmutableOpenMapTests.java index 73f98db92f070..1480bb0ddf902 100644 --- a/server/src/test/java/org/elasticsearch/common/collect/ImmutableOpenMapTests.java +++ b/server/src/test/java/org/elasticsearch/common/collect/ImmutableOpenMapTests.java @@ -19,7 +19,9 @@ import java.util.List; import java.util.Map; import java.util.Set; +import java.util.SortedSet; import java.util.TreeMap; +import java.util.TreeSet; import java.util.stream.Collectors; import static org.hamcrest.Matchers.equalTo; @@ -45,11 +47,7 @@ public void testSortedStream() { } public void testStreamOperationsOnRandomMap() { - ImmutableOpenMap map = Randomness.get().longs(randomIntBetween(1, 1000)) - .mapToObj(e -> Tuple.tuple(e, randomAlphaOfLength(8))) - .collect(() -> ImmutableOpenMap.builder(), (builder, t) -> builder.fPut(t.v1(), t.v2()), - ImmutableOpenMap.Builder::putAll) - .build(); + ImmutableOpenMap map = randomImmutableOpenMap(); int limit = randomIntBetween(0, map.size()); Map> collectedViaStreams = map.stream() @@ -79,4 +77,54 @@ public void testStreamOperationsOnRandomMap() { public void testEmptyStreamWorks() { assertThat(ImmutableOpenMap.of().stream().count(), equalTo(0L)); } + + public void testKeySetStreamOperationsAreSupported() { + assertThat(regionCurrencySymbols.keySet().stream().filter(e -> e.startsWith("U") == false).collect(Collectors.toSet()), + equalTo(Set.of("Japan", "EU", "Korea"))); + } + + public void testSortedKeysSet() { + assertThat(regionCurrencySymbols.keySet(), + equalTo(Set.of("EU", "Japan", "Korea", "UK", "USA"))); + } + + public void testStreamOperationsOnRandomMapKeys() { + ImmutableOpenMap map = randomImmutableOpenMap(); + + int limit = randomIntBetween(0, map.size()); + List collectedViaStream = map.keySet() + .stream() + .filter(e -> e > 0) + .sorted() + .limit(limit) + .collect(Collectors.toList()); + + SortedSet positiveNumbers = new TreeSet<>(); + for (ObjectObjectCursor cursor : map) { + if (cursor.key > 0) { + positiveNumbers.add(cursor.key); + } + } + int i = 0; + List collectedIteratively = new ArrayList<>(); + for (Long l : positiveNumbers) { + if (i++ >= limit) { + break; + } + collectedIteratively.add(l); + } + assertThat(collectedViaStream, equalTo(collectedIteratively)); + } + + public void testEmptyKeySetWorks() { + assertThat(ImmutableOpenMap.of().keySet().size(), equalTo(0)); + } + + private static ImmutableOpenMap randomImmutableOpenMap() { + return Randomness.get().longs(randomIntBetween(1, 1000)) + .mapToObj(e -> Tuple.tuple(e, randomAlphaOfLength(8))) + .collect(ImmutableOpenMap::builder, (builder, t) -> builder.fPut(t.v1(), t.v2()), + ImmutableOpenMap.Builder::putAll) + .build(); + } } diff --git a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/repository/CcrRepository.java b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/repository/CcrRepository.java index 86cdec8bb25aa..71d5971593d13 100644 --- a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/repository/CcrRepository.java +++ b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/repository/CcrRepository.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.ccr.repository; import com.carrotsearch.hppc.cursors.IntObjectCursor; + import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.message.ParameterizedMessage; @@ -39,12 +40,12 @@ import org.elasticsearch.common.UUIDs; import org.elasticsearch.common.collect.ImmutableOpenMap; import org.elasticsearch.common.component.AbstractLifecycleComponent; -import org.elasticsearch.core.Releasable; import org.elasticsearch.common.metrics.CounterMetric; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.concurrent.ThreadContext; +import org.elasticsearch.core.Releasable; +import org.elasticsearch.core.TimeValue; import org.elasticsearch.core.internal.io.IOUtils; import org.elasticsearch.index.Index; import org.elasticsearch.index.engine.EngineException; @@ -185,8 +186,7 @@ public void getSnapshotInfo(GetSnapshotInfoContext context) { .get(ccrSettings.getRecoveryActionTimeout()); Metadata metadata = response.getState().metadata(); ImmutableOpenMap indicesMap = metadata.indices(); - ArrayList indices = new ArrayList<>(indicesMap.size()); - indicesMap.keysIt().forEachRemaining(indices::add); + List indices = new ArrayList<>(indicesMap.keySet()); // fork to the snapshot meta pool because the context expects to run on it and asserts that it does threadPool.executor(ThreadPool.Names.SNAPSHOT_META).execute(() -> context.onResponse( diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/MachineLearningUsageTransportAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/MachineLearningUsageTransportAction.java index d2fd480539867..3cc3a4ef7fe44 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/MachineLearningUsageTransportAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/MachineLearningUsageTransportAction.java @@ -57,7 +57,6 @@ import java.util.Collections; import java.util.HashMap; import java.util.HashSet; -import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; import java.util.Locale; @@ -413,12 +412,6 @@ private static int mlNodeCount(final ClusterState clusterState) { } private static String[] ingestNodes(final ClusterState clusterState) { - String[] ingestNodes = new String[clusterState.nodes().getIngestNodes().size()]; - Iterator nodeIterator = clusterState.nodes().getIngestNodes().keysIt(); - int i = 0; - while(nodeIterator.hasNext()) { - ingestNodes[i++] = nodeIterator.next(); - } - return ingestNodes; + return clusterState.nodes().getIngestNodes().keySet().toArray(String[]::new); } } diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportGetTrainedModelsStatsAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportGetTrainedModelsStatsAction.java index 09c3e7a9943a1..01775e27a74cc 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportGetTrainedModelsStatsAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportGetTrainedModelsStatsAction.java @@ -17,10 +17,10 @@ import org.elasticsearch.client.Client; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.service.ClusterService; -import org.elasticsearch.core.Tuple; import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.metrics.CounterMetric; import org.elasticsearch.common.util.set.Sets; +import org.elasticsearch.core.Tuple; import org.elasticsearch.ingest.IngestMetadata; import org.elasticsearch.ingest.IngestService; import org.elasticsearch.ingest.IngestStats; @@ -36,7 +36,6 @@ import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; -import java.util.Iterator; import java.util.LinkedHashMap; import java.util.LinkedHashSet; import java.util.List; @@ -153,13 +152,7 @@ static Map inferenceIngestStatsByModelId(NodesStatsResponse } static String[] ingestNodes(final ClusterState clusterState) { - String[] ingestNodes = new String[clusterState.nodes().getIngestNodes().size()]; - Iterator nodeIterator = clusterState.nodes().getIngestNodes().keysIt(); - int i = 0; - while(nodeIterator.hasNext()) { - ingestNodes[i++] = nodeIterator.next(); - } - return ingestNodes; + return clusterState.nodes().getIngestNodes().keySet().toArray(String[]::new); } static Map> pipelineIdsByModelIdsOrAliases(ClusterState state, IngestService ingestService, Set modelIds) { From 086ba1aefb9782ec72083ea0d3dd99ded7175736 Mon Sep 17 00:00:00 2001 From: Jack Conradson Date: Wed, 29 Sep 2021 13:01:40 -0700 Subject: [PATCH 069/250] Remove JodaCompatibleZonedDateTime (#78417) This change removes JodaCompatibleZonedDateTime and replaces it with ZonedDateTime for use in scripting. Breaking changes: * JodaCompatibleDateTime no longer exists and cannot be cast to in Painless. Use ZonedDateTime instead. * The dayOfWeek method on ZonedDateTime returns the DayOfWeek enum instead of an int from JodaCompatibleDateTime. dayOfWeekEnum still exists on ZonedDateTime as an augmentation to support the transition to ZonedDateTime, but is now deprecated in favor of dayOfWeek on ZonedDateTime. --- .../index.asciidoc | 6 +- docs/reference/migration/migrate_8_0.asciidoc | 2 + .../migration/migrate_8_0/scripting.asciidoc | 25 + .../painless/AnalyzerCaster.java | 10 - .../java/org/elasticsearch/painless/Def.java | 11 - .../elasticsearch/painless/MethodWriter.java | 11 - .../org/elasticsearch/painless/Utility.java | 9 - .../painless/WriterConstants.java | 9 - .../painless/api/Augmentation.java | 6 + .../org/elasticsearch/painless/java.time.txt | 1 + .../org.elasticsearch.script.score.txt | 6 +- .../painless/org.elasticsearch.txt | 79 +-- .../elasticsearch/painless/BasicAPITests.java | 10 - .../elasticsearch/painless/DefCastTests.java | 13 - .../painless/org.elasticsearch.painless.test | 5 - .../common/io/stream/StreamInput.java | 9 +- .../common/io/stream/StreamOutput.java | 12 - .../XContentElasticsearchExtension.java | 4 - .../index/fielddata/ScriptDocValues.java | 18 +- .../script/JodaCompatibleZonedDateTime.java | 516 ------------------ .../script/ScoreScriptUtils.java | 7 +- .../script/field/DateMillisField.java | 13 +- .../script/field/DateNanosField.java | 15 +- .../support/values/ScriptDoubleValues.java | 3 - .../support/values/ScriptLongValues.java | 3 - .../common/io/stream/BytesStreamsTests.java | 10 +- .../JodaCompatibleZonedDateTimeTests.java | 270 --------- .../script/field/ConvertersTestBase.java | 42 +- .../core/watcher/actions/ActionWrapper.java | 3 +- .../watcher/support/WatcherDateTimeUtils.java | 4 - .../core/watcher/trigger/TriggerEvent.java | 4 +- .../whitelist/InternalSqlScriptUtils.java | 12 +- .../SqlBinaryArithmeticOperation.java | 11 - x-pack/plugin/watcher/qa/rest/build.gradle | 9 + .../test/mustache/30_search_input.yml | 8 +- .../test/mustache/40_search_transform.yml | 4 +- .../xpack/watcher/support/Variables.java | 5 +- .../schedule/ScheduleTriggerEvent.java | 4 +- .../actions/email/EmailActionTests.java | 8 +- .../actions/logging/LoggingActionTests.java | 8 +- .../pagerduty/PagerDutyActionTests.java | 8 +- .../actions/slack/SlackActionTests.java | 8 +- .../condition/ScriptConditionTests.java | 4 +- .../xpack/watcher/support/VariablesTests.java | 4 +- 44 files changed, 136 insertions(+), 1093 deletions(-) create mode 100644 docs/reference/migration/migrate_8_0/scripting.asciidoc delete mode 100644 server/src/main/java/org/elasticsearch/script/JodaCompatibleZonedDateTime.java delete mode 100644 server/src/test/java/org/elasticsearch/script/JodaCompatibleZonedDateTimeTests.java diff --git a/docs/painless/painless-api-reference/painless-api-reference-score/index.asciidoc b/docs/painless/painless-api-reference/painless-api-reference-score/index.asciidoc index d9cb42f2e8a38..e91b8026dc333 100644 --- a/docs/painless/painless-api-reference/painless-api-reference-score/index.asciidoc +++ b/docs/painless/painless-api-reference/painless-api-reference-score/index.asciidoc @@ -11,9 +11,9 @@ The following specialized API is available in the Score context. The following methods are directly callable without a class/instance qualifier. Note parameters denoted by a (*) are treated as read-only values. * double cosineSimilarity(List *, String *) -* double decayDateExp(String *, String *, String *, double *, JodaCompatibleZonedDateTime) -* double decayDateGauss(String *, String *, String *, double *, JodaCompatibleZonedDateTime) -* double decayDateLinear(String *, String *, String *, double *, JodaCompatibleZonedDateTime) +* double decayDateExp(String *, String *, String *, double *, ZonedDateTime) +* double decayDateGauss(String *, String *, String *, double *, ZonedDateTime) +* double decayDateLinear(String *, String *, String *, double *, ZonedDateTime) * double decayGeoExp(String *, String *, String *, double *, GeoPoint) * double decayGeoGauss(String *, String *, String *, double *, GeoPoint) * double decayGeoLinear(String *, String *, String *, double *, GeoPoint) diff --git a/docs/reference/migration/migrate_8_0.asciidoc b/docs/reference/migration/migrate_8_0.asciidoc index bdedee2a972e2..e166a6eb83740 100644 --- a/docs/reference/migration/migrate_8_0.asciidoc +++ b/docs/reference/migration/migrate_8_0.asciidoc @@ -32,6 +32,7 @@ coming[8.0.0] * <> * <> * <> +* <> * <> * <> * <> @@ -134,6 +135,7 @@ include::migrate_8_0/packaging.asciidoc[] include::migrate_8_0/reindex.asciidoc[] include::migrate_8_0/api.asciidoc[] include::migrate_8_0/rollup.asciidoc[] +include::migrate_8_0/scripting.asciidoc[] include::migrate_8_0/search.asciidoc[] include::migrate_8_0/security.asciidoc[] include::migrate_8_0/settings.asciidoc[] diff --git a/docs/reference/migration/migrate_8_0/scripting.asciidoc b/docs/reference/migration/migrate_8_0/scripting.asciidoc new file mode 100644 index 0000000000000..f4e9724d04c63 --- /dev/null +++ b/docs/reference/migration/migrate_8_0/scripting.asciidoc @@ -0,0 +1,25 @@ +[discrete] +[[breaking_80_scripting_changes]] +==== Scripting changes + +//NOTE: The notable-breaking-changes tagged regions are re-used in the +//Installation and Upgrade Guide + +//tag::notable-breaking-changes[] +.The `JodaCompatibleDateTime` class has been removed. +[%collapsible] +==== +*Details* + +As a transition from Joda datetime to Java datetime, scripting used +an intermediate class called `JodaCompatibleDateTime`. This class has +been removed and is replaced by `ZonedDateTime`. Any use of casting +to a `JodaCompatibleDateTime` in a script will result in a compilation +error, and may not allow the upgraded node to start. + +*Impact* + +Before upgrading, replace `getDayOfWeek` with `getDayOfWeekEnum().value` in any +scripts. Any use of `getDayOfWeek` expecting a return value of `int` will result +in a compilation error or runtime error and may not allow the upgraded node to +start. +==== +// end::notable-breaking-changes[] \ No newline at end of file diff --git a/modules/lang-painless/src/main/java/org/elasticsearch/painless/AnalyzerCaster.java b/modules/lang-painless/src/main/java/org/elasticsearch/painless/AnalyzerCaster.java index e3beb83a7c482..c3646b86a445b 100644 --- a/modules/lang-painless/src/main/java/org/elasticsearch/painless/AnalyzerCaster.java +++ b/modules/lang-painless/src/main/java/org/elasticsearch/painless/AnalyzerCaster.java @@ -11,9 +11,7 @@ import org.elasticsearch.painless.lookup.PainlessCast; import org.elasticsearch.painless.lookup.PainlessLookupUtility; import org.elasticsearch.painless.lookup.def; -import org.elasticsearch.script.JodaCompatibleZonedDateTime; -import java.time.ZonedDateTime; import java.util.Objects; /** @@ -63,19 +61,11 @@ public static PainlessCast getLegalCast(Location location, Class actual, Clas return PainlessCast.originalTypetoTargetType(def.class, Float.class, explicit); } else if (expected == Double.class) { return PainlessCast.originalTypetoTargetType(def.class, Double.class, explicit); - // TODO: remove this when the transition from Joda to Java datetimes is completed - } else if (expected == ZonedDateTime.class) { - return PainlessCast.originalTypetoTargetType(def.class, ZonedDateTime.class, explicit); } } else if (actual == String.class) { if (expected == char.class && explicit) { return PainlessCast.originalTypetoTargetType(String.class, char.class, true); } - // TODO: remove this when the transition from Joda to Java datetimes is completed - } else if (actual == JodaCompatibleZonedDateTime.class) { - if (expected == ZonedDateTime.class) { - return PainlessCast.originalTypetoTargetType(JodaCompatibleZonedDateTime.class, ZonedDateTime.class, explicit); - } } else if (actual == boolean.class) { if (expected == def.class) { return PainlessCast.boxOriginalType(Boolean.class, def.class, explicit, boolean.class); diff --git a/modules/lang-painless/src/main/java/org/elasticsearch/painless/Def.java b/modules/lang-painless/src/main/java/org/elasticsearch/painless/Def.java index d1a97d42bcb79..b6f6c10a3859b 100644 --- a/modules/lang-painless/src/main/java/org/elasticsearch/painless/Def.java +++ b/modules/lang-painless/src/main/java/org/elasticsearch/painless/Def.java @@ -12,13 +12,11 @@ import org.elasticsearch.painless.lookup.PainlessLookupUtility; import org.elasticsearch.painless.lookup.PainlessMethod; import org.elasticsearch.painless.symbol.FunctionTable; -import org.elasticsearch.script.JodaCompatibleZonedDateTime; import java.lang.invoke.CallSite; import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandles; import java.lang.invoke.MethodType; -import java.time.ZonedDateTime; import java.util.BitSet; import java.util.Collections; import java.util.Iterator; @@ -1202,15 +1200,6 @@ public static String defToStringExplicit(final Object value) { } } - // TODO: remove this when the transition from Joda to Java datetimes is completed - public static ZonedDateTime defToZonedDateTime(final Object value) { - if (value instanceof JodaCompatibleZonedDateTime) { - return ((JodaCompatibleZonedDateTime)value).getZonedDateTime(); - } - - return (ZonedDateTime)value; - } - /** * "Normalizes" the index into a {@code Map} by making no change to the index. */ diff --git a/modules/lang-painless/src/main/java/org/elasticsearch/painless/MethodWriter.java b/modules/lang-painless/src/main/java/org/elasticsearch/painless/MethodWriter.java index 237a006293a8d..919543d54f1fd 100644 --- a/modules/lang-painless/src/main/java/org/elasticsearch/painless/MethodWriter.java +++ b/modules/lang-painless/src/main/java/org/elasticsearch/painless/MethodWriter.java @@ -11,7 +11,6 @@ import org.elasticsearch.painless.lookup.PainlessCast; import org.elasticsearch.painless.lookup.PainlessMethod; import org.elasticsearch.painless.lookup.def; -import org.elasticsearch.script.JodaCompatibleZonedDateTime; import org.objectweb.asm.ClassVisitor; import org.objectweb.asm.Label; import org.objectweb.asm.Opcodes; @@ -20,7 +19,6 @@ import org.objectweb.asm.commons.Method; import java.lang.reflect.Modifier; -import java.time.ZonedDateTime; import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Arrays; @@ -62,10 +60,8 @@ import static org.elasticsearch.painless.WriterConstants.DEF_TO_P_SHORT_IMPLICIT; import static org.elasticsearch.painless.WriterConstants.DEF_TO_STRING_EXPLICIT; import static org.elasticsearch.painless.WriterConstants.DEF_TO_STRING_IMPLICIT; -import static org.elasticsearch.painless.WriterConstants.DEF_TO_ZONEDDATETIME; import static org.elasticsearch.painless.WriterConstants.DEF_UTIL_TYPE; import static org.elasticsearch.painless.WriterConstants.INDY_STRING_CONCAT_BOOTSTRAP_HANDLE; -import static org.elasticsearch.painless.WriterConstants.JCZDT_TO_ZONEDDATETIME; import static org.elasticsearch.painless.WriterConstants.LAMBDA_BOOTSTRAP_HANDLE; import static org.elasticsearch.painless.WriterConstants.MAX_INDY_STRING_CONCAT_ARGS; import static org.elasticsearch.painless.WriterConstants.PAINLESS_ERROR_TYPE; @@ -153,9 +149,6 @@ public void writeCast(PainlessCast cast) { invokeStatic(UTILITY_TYPE, CHAR_TO_STRING); } else if (cast.originalType == String.class && cast.targetType == char.class) { invokeStatic(UTILITY_TYPE, STRING_TO_CHAR); - // TODO: remove this when the transition from Joda to Java datetimes is completed - } else if (cast.originalType == JodaCompatibleZonedDateTime.class && cast.targetType == ZonedDateTime.class) { - invokeStatic(UTILITY_TYPE, JCZDT_TO_ZONEDDATETIME); } else if (cast.unboxOriginalType != null && cast.boxTargetType != null) { unbox(getType(cast.unboxOriginalType)); writeCast(cast.unboxOriginalType, cast.boxTargetType); @@ -191,8 +184,6 @@ public void writeCast(PainlessCast cast) { else if (cast.targetType == Float.class) invokeStatic(DEF_UTIL_TYPE, DEF_TO_B_FLOAT_EXPLICIT); else if (cast.targetType == Double.class) invokeStatic(DEF_UTIL_TYPE, DEF_TO_B_DOUBLE_EXPLICIT); else if (cast.targetType == String.class) invokeStatic(DEF_UTIL_TYPE, DEF_TO_STRING_EXPLICIT); - // TODO: remove this when the transition from Joda to Java datetimes is completed - else if (cast.targetType == ZonedDateTime.class) invokeStatic(DEF_UTIL_TYPE, DEF_TO_ZONEDDATETIME); else { writeCast(cast.originalType, cast.targetType); } @@ -214,8 +205,6 @@ public void writeCast(PainlessCast cast) { else if (cast.targetType == Float.class) invokeStatic(DEF_UTIL_TYPE, DEF_TO_B_FLOAT_IMPLICIT); else if (cast.targetType == Double.class) invokeStatic(DEF_UTIL_TYPE, DEF_TO_B_DOUBLE_IMPLICIT); else if (cast.targetType == String.class) invokeStatic(DEF_UTIL_TYPE, DEF_TO_STRING_IMPLICIT); - // TODO: remove this when the transition from Joda to Java datetimes is completed - else if (cast.targetType == ZonedDateTime.class) invokeStatic(DEF_UTIL_TYPE, DEF_TO_ZONEDDATETIME); else { writeCast(cast.originalType, cast.targetType); } diff --git a/modules/lang-painless/src/main/java/org/elasticsearch/painless/Utility.java b/modules/lang-painless/src/main/java/org/elasticsearch/painless/Utility.java index 6e8ebdfe7b5c0..03608224d31e0 100644 --- a/modules/lang-painless/src/main/java/org/elasticsearch/painless/Utility.java +++ b/modules/lang-painless/src/main/java/org/elasticsearch/painless/Utility.java @@ -8,10 +8,6 @@ package org.elasticsearch.painless; -import org.elasticsearch.script.JodaCompatibleZonedDateTime; - -import java.time.ZonedDateTime; - /** * A set of methods for non-native boxing and non-native * exact math operations used at both compile-time and runtime. @@ -36,10 +32,5 @@ public static char StringTochar(final String value) { return value.charAt(0); } - // TODO: remove this when the transition from Joda to Java datetimes is completed - public static ZonedDateTime JCZDTToZonedDateTime(final JodaCompatibleZonedDateTime jczdt) { - return jczdt.getZonedDateTime(); - } - private Utility() {} } diff --git a/modules/lang-painless/src/main/java/org/elasticsearch/painless/WriterConstants.java b/modules/lang-painless/src/main/java/org/elasticsearch/painless/WriterConstants.java index f7ba9a084a9aa..2e211cbfc8c75 100644 --- a/modules/lang-painless/src/main/java/org/elasticsearch/painless/WriterConstants.java +++ b/modules/lang-painless/src/main/java/org/elasticsearch/painless/WriterConstants.java @@ -8,7 +8,6 @@ package org.elasticsearch.painless; -import org.elasticsearch.script.JodaCompatibleZonedDateTime; import org.objectweb.asm.Handle; import org.objectweb.asm.Opcodes; import org.objectweb.asm.Type; @@ -18,7 +17,6 @@ import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandles; import java.lang.invoke.MethodType; -import java.time.ZonedDateTime; import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; @@ -58,10 +56,6 @@ public final class WriterConstants { public static final Method STRING_TO_CHAR = getAsmMethod(char.class, "StringTochar", String.class); public static final Method CHAR_TO_STRING = getAsmMethod(String.class, "charToString", char.class); - // TODO: remove this when the transition from Joda to Java datetimes is completed - public static final Method JCZDT_TO_ZONEDDATETIME = - getAsmMethod(ZonedDateTime.class, "JCZDTToZonedDateTime", JodaCompatibleZonedDateTime.class); - /** * A Method instance for {@linkplain Pattern}. This isn't available from PainlessLookup because we intentionally don't add it * there so that the script can't create regexes without this syntax. Essentially, our static regex syntax has a monopoly on building @@ -117,9 +111,6 @@ public final class WriterConstants { public static final Method DEF_TO_STRING_IMPLICIT = getAsmMethod(String.class, "defToStringImplicit", Object.class); public static final Method DEF_TO_STRING_EXPLICIT = getAsmMethod(String.class, "defToStringExplicit", Object.class); - // TODO: remove this when the transition from Joda to Java datetimes is completed - public static final Method DEF_TO_ZONEDDATETIME = getAsmMethod(ZonedDateTime.class, "defToZonedDateTime", Object.class); - /** invokedynamic bootstrap for lambda expression/method references */ public static final MethodType LAMBDA_BOOTSTRAP_TYPE = MethodType.methodType(CallSite.class, MethodHandles.Lookup.class, String.class, MethodType.class, diff --git a/modules/lang-painless/src/main/java/org/elasticsearch/painless/api/Augmentation.java b/modules/lang-painless/src/main/java/org/elasticsearch/painless/api/Augmentation.java index b313850d9a3e7..03657f2200a59 100644 --- a/modules/lang-painless/src/main/java/org/elasticsearch/painless/api/Augmentation.java +++ b/modules/lang-painless/src/main/java/org/elasticsearch/painless/api/Augmentation.java @@ -11,7 +11,9 @@ import org.elasticsearch.common.hash.MessageDigests; import java.nio.charset.StandardCharsets; +import java.time.DayOfWeek; import java.time.Instant; +import java.time.ZonedDateTime; import java.time.temporal.ChronoField; import java.time.temporal.TemporalAccessor; import java.util.ArrayList; @@ -714,4 +716,8 @@ public static Matcher matcher(Pattern receiver, int limitFactor, CharSequence in public static long toEpochMilli(TemporalAccessor v) { return v.getLong(ChronoField.INSTANT_SECONDS) * 1_000 + v.get(ChronoField.NANO_OF_SECOND) / 1_000_000; } + + public static DayOfWeek getDayOfWeekEnum(ZonedDateTime receiver) { + return receiver.getDayOfWeek(); + } } diff --git a/modules/lang-painless/src/main/resources/org/elasticsearch/painless/java.time.txt b/modules/lang-painless/src/main/resources/org/elasticsearch/painless/java.time.txt index 202461f3a27f9..de9780e9a6fc3 100644 --- a/modules/lang-painless/src/main/resources/org/elasticsearch/painless/java.time.txt +++ b/modules/lang-painless/src/main/resources/org/elasticsearch/painless/java.time.txt @@ -474,6 +474,7 @@ class java.time.YearMonth { class java.time.ZonedDateTime { int getDayOfMonth() DayOfWeek getDayOfWeek() + DayOfWeek org.elasticsearch.painless.api.Augmentation getDayOfWeekEnum() int getDayOfYear() int getHour() LocalDate toLocalDate() diff --git a/modules/lang-painless/src/main/resources/org/elasticsearch/painless/org.elasticsearch.script.score.txt b/modules/lang-painless/src/main/resources/org/elasticsearch/painless/org.elasticsearch.script.score.txt index b77943e0691e5..111cf71d0affa 100644 --- a/modules/lang-painless/src/main/resources/org/elasticsearch/painless/org.elasticsearch.script.score.txt +++ b/modules/lang-painless/src/main/resources/org/elasticsearch/painless/org.elasticsearch.script.score.txt @@ -24,8 +24,8 @@ static_import { double decayNumericLinear(double, double, double, double, double)bound_to org.elasticsearch.script.ScoreScriptUtils$DecayNumericLinear double decayNumericExp(double, double, double, double, double) bound_to org.elasticsearch.script.ScoreScriptUtils$DecayNumericExp double decayNumericGauss(double, double, double, double, double) bound_to org.elasticsearch.script.ScoreScriptUtils$DecayNumericGauss - double decayDateLinear(String, String, String, double, JodaCompatibleZonedDateTime) bound_to org.elasticsearch.script.ScoreScriptUtils$DecayDateLinear - double decayDateExp(String, String, String, double, JodaCompatibleZonedDateTime) bound_to org.elasticsearch.script.ScoreScriptUtils$DecayDateExp - double decayDateGauss(String, String, String, double, JodaCompatibleZonedDateTime) bound_to org.elasticsearch.script.ScoreScriptUtils$DecayDateGauss + double decayDateLinear(String, String, String, double, ZonedDateTime) bound_to org.elasticsearch.script.ScoreScriptUtils$DecayDateLinear + double decayDateExp(String, String, String, double, ZonedDateTime) bound_to org.elasticsearch.script.ScoreScriptUtils$DecayDateExp + double decayDateGauss(String, String, String, double, ZonedDateTime) bound_to org.elasticsearch.script.ScoreScriptUtils$DecayDateGauss } diff --git a/modules/lang-painless/src/main/resources/org/elasticsearch/painless/org.elasticsearch.txt b/modules/lang-painless/src/main/resources/org/elasticsearch/painless/org.elasticsearch.txt index 5ff8535c967a1..907a98be5b973 100644 --- a/modules/lang-painless/src/main/resources/org/elasticsearch/painless/org.elasticsearch.txt +++ b/modules/lang-painless/src/main/resources/org/elasticsearch/painless/org.elasticsearch.txt @@ -69,84 +69,9 @@ class org.elasticsearch.index.fielddata.ScriptDocValues$Longs { long getValue() } -class org.elasticsearch.script.JodaCompatibleZonedDateTime { - ##### ZonedDateTime methods - int getDayOfMonth() - int getDayOfYear() - int getHour() - LocalDate toLocalDate() - LocalDateTime toLocalDateTime() - int getMinute() - Month getMonth() - int getMonthValue() - int getNano() - int getSecond() - int getYear() - ZonedDateTime minus(TemporalAmount) - ZonedDateTime minus(long,TemporalUnit) - ZonedDateTime minusYears(long) - ZonedDateTime minusMonths(long) - ZonedDateTime minusWeeks(long) - ZonedDateTime minusDays(long) - ZonedDateTime minusHours(long) - ZonedDateTime minusMinutes(long) - ZonedDateTime minusSeconds(long) - ZonedDateTime minusNanos(long) - ZonedDateTime plus(TemporalAmount) - ZonedDateTime plus(long,TemporalUnit) - ZonedDateTime plusDays(long) - ZonedDateTime plusHours(long) - ZonedDateTime plusMinutes(long) - ZonedDateTime plusMonths(long) - ZonedDateTime plusNanos(long) - ZonedDateTime plusSeconds(long) - ZonedDateTime plusWeeks(long) - ZonedDateTime plusYears(long) - OffsetDateTime toOffsetDateTime() - ZonedDateTime truncatedTo(TemporalUnit) - ZonedDateTime with(TemporalAdjuster) - ZonedDateTime with(TemporalField,long) - ZonedDateTime withDayOfMonth(int) - ZonedDateTime withDayOfYear(int) - ZonedDateTime withEarlierOffsetAtOverlap() - ZonedDateTime withFixedOffsetZone() - ZonedDateTime withHour(int) - ZonedDateTime withLaterOffsetAtOverlap() - ZonedDateTime withMinute(int) - ZonedDateTime withMonth(int) - ZonedDateTime withNano(int) - ZonedDateTime withSecond(int) - ZonedDateTime withYear(int) - ZonedDateTime withZoneSameLocal(ZoneId) - ZonedDateTime withZoneSameInstant(ZoneId) - - #### Joda time methods - long getMillis() - int getCenturyOfEra() - int getEra() - int getHourOfDay() - int getMillisOfDay() - int getMillisOfSecond() - int getMinuteOfDay() - int getMinuteOfHour() - int getMonthOfYear() - int getSecondOfDay() - int getSecondOfMinute() - int getWeekOfWeekyear() - int getWeekyear() - int getYearOfCentury() - int getYearOfEra() - String toString(String) - String toString(String,Locale) - - # conflicting methods - DayOfWeek getDayOfWeekEnum() - int getDayOfWeek() -} - class org.elasticsearch.index.fielddata.ScriptDocValues$Dates { - JodaCompatibleZonedDateTime get(int) - JodaCompatibleZonedDateTime getValue() + ZonedDateTime get(int) + ZonedDateTime getValue() } class org.elasticsearch.index.fielddata.ScriptDocValues$Doubles { diff --git a/modules/lang-painless/src/test/java/org/elasticsearch/painless/BasicAPITests.java b/modules/lang-painless/src/test/java/org/elasticsearch/painless/BasicAPITests.java index 16fc928ad7b9b..28bc3a2cc378b 100644 --- a/modules/lang-painless/src/test/java/org/elasticsearch/painless/BasicAPITests.java +++ b/modules/lang-painless/src/test/java/org/elasticsearch/painless/BasicAPITests.java @@ -132,16 +132,6 @@ public void testStatic() { assertEquals(15.5f, exec("staticAddFloatsTest(6.5f, 9.0f)")); } - // TODO: remove this when the transition from Joda to Java datetimes is completed - public void testJCZDTToZonedDateTime() { - assertEquals(0L, exec( - "Instant instant = Instant.ofEpochMilli(434931330000L);" + - "JodaCompatibleZonedDateTime d = new JodaCompatibleZonedDateTime(instant, ZoneId.of('Z'));" + - "ZonedDateTime t = d;" + - "return ChronoUnit.MILLIS.between(d, t);" - )); - } - public void testRandomUUID() { assertTrue( Pattern.compile("\\p{XDigit}{8}(-\\p{XDigit}{4}){3}-\\p{XDigit}{12}").matcher( diff --git a/modules/lang-painless/src/test/java/org/elasticsearch/painless/DefCastTests.java b/modules/lang-painless/src/test/java/org/elasticsearch/painless/DefCastTests.java index 8923ae93f63df..d0dd246fd8689 100644 --- a/modules/lang-painless/src/test/java/org/elasticsearch/painless/DefCastTests.java +++ b/modules/lang-painless/src/test/java/org/elasticsearch/painless/DefCastTests.java @@ -685,17 +685,4 @@ public void testConstFoldingDefCast() { assertFalse((boolean)exec("def chr = (char)10L; return (chr > (byte)10);")); assertFalse((boolean)exec("def chr = (char)10L; return (chr > (double)(byte)(char)10);")); } - - // TODO: remove this when the transition from Joda to Java datetimes is completed - public void testdefToZonedDateTime() { - assertEquals(0L, exec( - "Instant instant = Instant.ofEpochMilli(434931330000L);" + - "def d = new JodaCompatibleZonedDateTime(instant, ZoneId.of('Z'));" + - "def x = new HashMap(); x.put('dt', d);" + - "ZonedDateTime t = x['dt'];" + - "def y = t;" + - "t = y;" + - "return ChronoUnit.MILLIS.between(d, t);" - )); - } } diff --git a/modules/lang-painless/src/test/resources/org/elasticsearch/painless/org.elasticsearch.painless.test b/modules/lang-painless/src/test/resources/org/elasticsearch/painless/org.elasticsearch.painless.test index f79e42ceca8cf..d6d81579211a7 100644 --- a/modules/lang-painless/src/test/resources/org/elasticsearch/painless/org.elasticsearch.painless.test +++ b/modules/lang-painless/src/test/resources/org/elasticsearch/painless/org.elasticsearch.painless.test @@ -1,10 +1,5 @@ # whitelist for tests -# TODO: remove this when the transition from Joda to Java datetimes is completed -class org.elasticsearch.script.JodaCompatibleZonedDateTime { - (Instant, ZoneId) -} - # for unit tests only class org.elasticsearch.painless.api.Json { def load(String) diff --git a/server/src/main/java/org/elasticsearch/common/io/stream/StreamInput.java b/server/src/main/java/org/elasticsearch/common/io/stream/StreamInput.java index 20168ef9296f8..c6c20ef9045ac 100644 --- a/server/src/main/java/org/elasticsearch/common/io/stream/StreamInput.java +++ b/server/src/main/java/org/elasticsearch/common/io/stream/StreamInput.java @@ -32,7 +32,6 @@ import org.elasticsearch.common.time.DateUtils; import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.concurrent.EsRejectedExecutionException; -import org.elasticsearch.script.JodaCompatibleZonedDateTime; import org.joda.time.DateTimeZone; import java.io.EOFException; @@ -812,12 +811,12 @@ private List readArrayList() throws IOException { return list; } - private JodaCompatibleZonedDateTime readDateTime() throws IOException { - // we reuse DateTime to communicate with older nodes that don't know about the joda compat layer, but - // here we are on a new node so we always want a compat datetime + private ZonedDateTime readDateTime() throws IOException { + // any JodaCompatibleZonedDateTime is read from an older version + // so convert this a standard ZonedDateTime final ZoneId zoneId = DateUtils.dateTimeZoneToZoneId(DateTimeZone.forID(readString())); long millis = readLong(); - return new JodaCompatibleZonedDateTime(Instant.ofEpochMilli(millis), zoneId); + return ZonedDateTime.ofInstant(Instant.ofEpochMilli(millis), zoneId); } private ZonedDateTime readZonedDateTime() throws IOException { diff --git a/server/src/main/java/org/elasticsearch/common/io/stream/StreamOutput.java b/server/src/main/java/org/elasticsearch/common/io/stream/StreamOutput.java index 61cf0ad0424ad..4da2817ac6c85 100644 --- a/server/src/main/java/org/elasticsearch/common/io/stream/StreamOutput.java +++ b/server/src/main/java/org/elasticsearch/common/io/stream/StreamOutput.java @@ -31,7 +31,6 @@ import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.concurrent.EsRejectedExecutionException; import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.script.JodaCompatibleZonedDateTime; import org.joda.time.DateTimeZone; import org.joda.time.ReadableInstant; @@ -791,17 +790,6 @@ public final void writeOptionalInstant(@Nullable Instant instant) throws IOExcep o.writeString(zonedDateTime.getZone().getId()); o.writeLong(zonedDateTime.toInstant().toEpochMilli()); }), - entry( - JodaCompatibleZonedDateTime.class, - (o, v) -> { - // write the joda compatibility datetime as joda datetime - o.writeByte((byte) 13); - final JodaCompatibleZonedDateTime zonedDateTime = (JodaCompatibleZonedDateTime) v; - String zoneId = zonedDateTime.getZonedDateTime().getZone().getId(); - // joda does not understand "Z" for utc, so we must special case - o.writeString(zoneId.equals("Z") ? DateTimeZone.UTC.getID() : zoneId); - o.writeLong(zonedDateTime.toInstant().toEpochMilli()); - }), entry( Set.class, (o, v) -> { diff --git a/server/src/main/java/org/elasticsearch/common/xcontent/XContentElasticsearchExtension.java b/server/src/main/java/org/elasticsearch/common/xcontent/XContentElasticsearchExtension.java index 78f9703cdf5b1..4ee2f199e8527 100644 --- a/server/src/main/java/org/elasticsearch/common/xcontent/XContentElasticsearchExtension.java +++ b/server/src/main/java/org/elasticsearch/common/xcontent/XContentElasticsearchExtension.java @@ -13,7 +13,6 @@ import org.elasticsearch.common.time.DateFormatter; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.script.JodaCompatibleZonedDateTime; import org.joda.time.DateTime; import org.joda.time.DateTimeZone; import org.joda.time.Instant; @@ -82,7 +81,6 @@ public Map, XContentBuilder.Writer> getXContentWriters() { writers.put(Year.class, (b, v) -> b.value(v.toString())); writers.put(Duration.class, (b, v) -> b.value(v.toString())); writers.put(Period.class, (b, v) -> b.value(v.toString())); - writers.put(JodaCompatibleZonedDateTime.class, XContentBuilder::timeValue); writers.put(BytesReference.class, (b, v) -> { if (v == null) { @@ -131,8 +129,6 @@ public Map, Function> getDateTransformers() { d -> DEFAULT_FORMATTER.format(ZonedDateTime.ofInstant((java.time.Instant) d, ZoneOffset.UTC))); transformers.put(LocalDate.class, d -> ((LocalDate) d).toString()); transformers.put(LocalTime.class, d -> LOCAL_TIME_FORMATTER.format((LocalTime) d)); - transformers.put(JodaCompatibleZonedDateTime.class, - d -> DEFAULT_FORMATTER.format(((JodaCompatibleZonedDateTime) d).getZonedDateTime())); return transformers; } } diff --git a/server/src/main/java/org/elasticsearch/index/fielddata/ScriptDocValues.java b/server/src/main/java/org/elasticsearch/index/fielddata/ScriptDocValues.java index ca7d2f0e5d66f..68d9076cdf310 100644 --- a/server/src/main/java/org/elasticsearch/index/fielddata/ScriptDocValues.java +++ b/server/src/main/java/org/elasticsearch/index/fielddata/ScriptDocValues.java @@ -26,13 +26,13 @@ import org.elasticsearch.script.field.FieldValues; import org.elasticsearch.script.field.GeoPointField; import org.elasticsearch.script.field.InvalidConversion; -import org.elasticsearch.script.JodaCompatibleZonedDateTime; import org.elasticsearch.script.field.LongField; import org.elasticsearch.script.field.StringField; import java.io.IOException; import java.time.Instant; import java.time.ZoneOffset; +import java.time.ZonedDateTime; import java.util.AbstractList; import java.util.Arrays; import java.util.Comparator; @@ -171,7 +171,7 @@ public Field toField(String fieldName) { } } - public static final class Dates extends ScriptDocValues { + public static final class Dates extends ScriptDocValues { private final SortedNumericDocValues in; private final boolean isNanos; @@ -179,7 +179,7 @@ public static final class Dates extends ScriptDocValues].size()==0 to check if a document is missing a field!"); @@ -233,13 +233,13 @@ void refreshArray() throws IOException { } if (dates == null || count > dates.length) { // Happens for the document. We delay allocating dates so we can allocate it with a reasonable size. - dates = new JodaCompatibleZonedDateTime[count]; + dates = new ZonedDateTime[count]; } for (int i = 0; i < count; ++i) { if (isNanos) { - dates[i] = new JodaCompatibleZonedDateTime(DateUtils.toInstant(in.nextValue()), ZoneOffset.UTC); + dates[i] = ZonedDateTime.ofInstant(DateUtils.toInstant(in.nextValue()), ZoneOffset.UTC); } else { - dates[i] = new JodaCompatibleZonedDateTime(Instant.ofEpochMilli(in.nextValue()), ZoneOffset.UTC); + dates[i] = ZonedDateTime.ofInstant(Instant.ofEpochMilli(in.nextValue()), ZoneOffset.UTC); } } } @@ -259,7 +259,7 @@ public double getDoubleValue() { } @Override - public Field toField(String fieldName) { + public Field toField(String fieldName) { if (isNanos) { return new DateNanosField(fieldName, this); } diff --git a/server/src/main/java/org/elasticsearch/script/JodaCompatibleZonedDateTime.java b/server/src/main/java/org/elasticsearch/script/JodaCompatibleZonedDateTime.java deleted file mode 100644 index f88103ef8a712..0000000000000 --- a/server/src/main/java/org/elasticsearch/script/JodaCompatibleZonedDateTime.java +++ /dev/null @@ -1,516 +0,0 @@ -/* - * 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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -package org.elasticsearch.script; - -import org.elasticsearch.core.SuppressForbidden; -import org.elasticsearch.common.SuppressLoggerChecks; -import org.elasticsearch.common.logging.DeprecationCategory; -import org.elasticsearch.common.logging.DeprecationLogger; -import org.elasticsearch.common.time.DateFormatter; -import org.elasticsearch.common.time.DateFormatters; -import org.elasticsearch.common.time.DateUtils; -import org.joda.time.DateTime; - -import java.security.AccessController; -import java.security.PrivilegedAction; -import java.time.DayOfWeek; -import java.time.Instant; -import java.time.LocalDate; -import java.time.LocalDateTime; -import java.time.LocalTime; -import java.time.Month; -import java.time.OffsetDateTime; -import java.time.ZoneId; -import java.time.ZoneOffset; -import java.time.ZonedDateTime; -import java.time.chrono.ChronoZonedDateTime; -import java.time.chrono.Chronology; -import java.time.format.DateTimeFormatter; -import java.time.temporal.ChronoField; -import java.time.temporal.Temporal; -import java.time.temporal.TemporalAccessor; -import java.time.temporal.TemporalAdjuster; -import java.time.temporal.TemporalAmount; -import java.time.temporal.TemporalField; -import java.time.temporal.TemporalQuery; -import java.time.temporal.TemporalUnit; -import java.time.temporal.ValueRange; -import java.util.Locale; -import java.util.Objects; - -/** - * A wrapper around ZonedDateTime that exposes joda methods for backcompat. - */ -public class JodaCompatibleZonedDateTime - implements Comparable>, ChronoZonedDateTime, Temporal, TemporalAccessor { - - private static final DateFormatter DATE_FORMATTER = DateFormatter.forPattern("strict_date_time"); - private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(JodaCompatibleZonedDateTime.class); - - private static void logDeprecated(DeprecationCategory category, String key, String message, Object... params) { - AccessController.doPrivileged(new PrivilegedAction() { - @SuppressLoggerChecks(reason = "safely delegates to logger") - @Override - public Void run() { - deprecationLogger.critical(category, key, message, params); - return null; - } - }); - } - - private static void logDeprecatedMethod(String oldMethod, String newMethod) { - logDeprecated(DeprecationCategory.PARSING, oldMethod, "Use of the joda time method [{}] is deprecated. Use [{}] instead.", - oldMethod, newMethod); - } - - private ZonedDateTime dt; - - public JodaCompatibleZonedDateTime(Instant instant, ZoneId zone) { - this.dt = ZonedDateTime.ofInstant(instant, zone); - } - - // access the underlying ZonedDateTime - public ZonedDateTime getZonedDateTime() { - return dt; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null)return false; - if (o.getClass() == JodaCompatibleZonedDateTime.class) { - JodaCompatibleZonedDateTime that = (JodaCompatibleZonedDateTime) o; - return Objects.equals(dt, that.dt); - } else if (o.getClass() == ZonedDateTime.class) { - ZonedDateTime that = (ZonedDateTime) o; - return Objects.equals(dt, that); - } - return false; - } - - @Override - public int hashCode() { - return dt.hashCode(); - } - - @Override - public String toString() { - return DATE_FORMATTER.format(dt); - } - - @Override - public String format(DateTimeFormatter formatter) { - return dt.format(formatter); - } - - @Override - public ValueRange range(TemporalField field) { - return dt.range(field); - } - - @Override - public int get(TemporalField field) { - return dt.get(field); - } - - @Override - public long getLong(TemporalField field) { - return dt.getLong(field); - } - - @Override - public Chronology getChronology() { - return dt.getChronology(); - } - - @Override - public ZoneOffset getOffset() { - return dt.getOffset(); - } - - @Override - public boolean isSupported(TemporalField field) { - return dt.isSupported(field); - } - - @Override - public boolean isSupported(TemporalUnit unit) { - return dt.isSupported(unit); - } - - @Override - public long toEpochSecond() { - return dt.toEpochSecond(); - } - - @Override - public int compareTo(ChronoZonedDateTime other) { - return dt.compareTo(other); - } - - @Override - public boolean isBefore(ChronoZonedDateTime other) { - return dt.isBefore(other); - } - - @Override - public boolean isAfter(ChronoZonedDateTime other) { - return dt.isAfter(other); - } - - @Override - public boolean isEqual(ChronoZonedDateTime other) { - return dt.isEqual(other); - } - - @Override - public LocalTime toLocalTime() { - return dt.toLocalTime(); - } - - public int getDayOfMonth() { - return dt.getDayOfMonth(); - } - - public int getDayOfYear() { - return dt.getDayOfYear(); - } - - public int getHour() { - return dt.getHour(); - } - - @Override - public LocalDate toLocalDate() { - return dt.toLocalDate(); - } - - @Override - public LocalDateTime toLocalDateTime() { - return dt.toLocalDateTime(); - } - - public int getMinute() { - return dt.getMinute(); - } - - public Month getMonth() { - return dt.getMonth(); - } - - public int getMonthValue() { - return dt.getMonthValue(); - } - - public int getNano() { - return dt.getNano(); - } - - public int getSecond() { - return dt.getSecond(); - } - - public int getYear() { - return dt.getYear(); - } - - @Override - public ZoneId getZone() { - return dt.getZone(); - } - - @Override - public ZonedDateTime minus(TemporalAmount delta) { - return dt.minus(delta); - } - - @Override - public ZonedDateTime minus(long amount, TemporalUnit unit) { - return dt.minus(amount, unit); - } - - @Override - public R query(TemporalQuery query) { - return dt.query(query); - } - - @Override - public long until(Temporal temporal, TemporalUnit temporalUnit) { - return dt.until(temporal, temporalUnit); - } - - public ZonedDateTime minusYears(long amount) { - return dt.minusYears(amount); - } - - public ZonedDateTime minusMonths(long amount) { - return dt.minusMonths(amount); - } - - public ZonedDateTime minusWeeks(long amount) { - return dt.minusWeeks(amount); - } - - public ZonedDateTime minusDays(long amount) { - return dt.minusDays(amount); - } - - public ZonedDateTime minusHours(long amount) { - return dt.minusHours(amount); - } - - public ZonedDateTime minusMinutes(long amount) { - return dt.minusMinutes(amount); - } - - public ZonedDateTime minusSeconds(long amount) { - return dt.minusSeconds(amount); - } - - public ZonedDateTime minusNanos(long amount) { - return dt.minusNanos(amount); - } - - @Override - public ZonedDateTime plus(TemporalAmount amount) { - return dt.plus(amount); - } - - @Override - public ZonedDateTime plus(long amount,TemporalUnit unit) { - return dt.plus(amount, unit); - } - - public ZonedDateTime plusDays(long amount) { - return dt.plusDays(amount); - } - - public ZonedDateTime plusHours(long amount) { - return dt.plusHours(amount); - } - - public ZonedDateTime plusMinutes(long amount) { - return dt.plusMinutes(amount); - } - - public ZonedDateTime plusMonths(long amount) { - return dt.plusMonths(amount); - } - - public ZonedDateTime plusNanos(long amount) { - return dt.plusNanos(amount); - } - - public ZonedDateTime plusSeconds(long amount) { - return dt.plusSeconds(amount); - } - - public ZonedDateTime plusWeeks(long amount) { - return dt.plusWeeks(amount); - } - - public ZonedDateTime plusYears(long amount) { - return dt.plusYears(amount); - } - - @Override - public Instant toInstant() { - return dt.toInstant(); - } - - public OffsetDateTime toOffsetDateTime() { - return dt.toOffsetDateTime(); - } - - @SuppressForbidden(reason = "only exposing the method as a passthrough") - public ZonedDateTime truncatedTo(TemporalUnit unit) { - return dt.truncatedTo(unit); - } - - @Override - public ZonedDateTime with(TemporalAdjuster adjuster) { - return dt.with(adjuster); - } - - @Override - public ZonedDateTime with(TemporalField field, long newValue) { - return dt.with(field, newValue); - } - - public ZonedDateTime withDayOfMonth(int value) { - return dt.withDayOfMonth(value); - } - - public ZonedDateTime withDayOfYear(int value) { - return dt.withDayOfYear(value); - } - - @Override - public ZonedDateTime withEarlierOffsetAtOverlap() { - return dt.withEarlierOffsetAtOverlap(); - } - - public ZonedDateTime withFixedOffsetZone() { - return dt.withFixedOffsetZone(); - } - - public ZonedDateTime withHour(int value) { - return dt.withHour(value); - } - - @Override - public ZonedDateTime withLaterOffsetAtOverlap() { - return dt.withLaterOffsetAtOverlap(); - } - - public ZonedDateTime withMinute(int value) { - return dt.withMinute(value); - } - - public ZonedDateTime withMonth(int value) { - return dt.withMonth(value); - } - - public ZonedDateTime withNano(int value) { - return dt.withNano(value); - } - - public ZonedDateTime withSecond(int value) { - return dt.withSecond(value); - } - - public ZonedDateTime withYear(int value) { - return dt.withYear(value); - } - - @Override - public ZonedDateTime withZoneSameLocal(ZoneId zone) { - return dt.withZoneSameLocal(zone); - } - - @Override - public ZonedDateTime withZoneSameInstant(ZoneId zone) { - return dt.withZoneSameInstant(zone); - } - - @Deprecated - public long getMillis() { - logDeprecatedMethod("getMillis()", "toInstant().toEpochMilli()"); - return dt.toInstant().toEpochMilli(); - } - - @Deprecated - public int getCenturyOfEra() { - logDeprecatedMethod("getCenturyOfEra()", "get(ChronoField.YEAR_OF_ERA) / 100"); - return dt.get(ChronoField.YEAR_OF_ERA) / 100; - } - - @Deprecated - public int getEra() { - logDeprecatedMethod("getEra()", "get(ChronoField.ERA)"); - return dt.get(ChronoField.ERA); - } - - @Deprecated - public int getHourOfDay() { - logDeprecatedMethod("getHourOfDay()", "getHour()"); - return dt.getHour(); - } - - @Deprecated - public int getMillisOfDay() { - logDeprecatedMethod("getMillisOfDay()", "get(ChronoField.MILLI_OF_DAY)"); - return dt.get(ChronoField.MILLI_OF_DAY); - } - - @Deprecated - public int getMillisOfSecond() { - logDeprecatedMethod("getMillisOfSecond()", "get(ChronoField.MILLI_OF_SECOND)"); - return dt.get(ChronoField.MILLI_OF_SECOND); - } - - @Deprecated - public int getMinuteOfDay() { - logDeprecatedMethod("getMinuteOfDay()", "get(ChronoField.MINUTE_OF_DAY)"); - return dt.get(ChronoField.MINUTE_OF_DAY); - } - - @Deprecated - public int getMinuteOfHour() { - logDeprecatedMethod("getMinuteOfHour()", "getMinute()"); - return dt.getMinute(); - } - - @Deprecated - public int getMonthOfYear() { - logDeprecatedMethod("getMonthOfYear()", "getMonthValue()"); - return dt.getMonthValue(); - } - - @Deprecated - public int getSecondOfDay() { - logDeprecatedMethod("getSecondOfDay()", "get(ChronoField.SECOND_OF_DAY)"); - return dt.get(ChronoField.SECOND_OF_DAY); - } - - @Deprecated - public int getSecondOfMinute() { - logDeprecatedMethod("getSecondOfMinute()", "getSecond()"); - return dt.getSecond(); - } - - @Deprecated - public int getWeekOfWeekyear() { - logDeprecatedMethod("getWeekOfWeekyear()", "get(DateFormatters.WEEK_FIELDS.weekOfWeekBasedYear())"); - return dt.get(DateFormatters.WEEK_FIELDS_ROOT.weekOfWeekBasedYear()); - } - - @Deprecated - public int getWeekyear() { - logDeprecatedMethod("getWeekyear()", "get(DateFormatters.WEEK_FIELDS.weekBasedYear())"); - return dt.get(DateFormatters.WEEK_FIELDS_ROOT.weekBasedYear()); - } - - @Deprecated - public int getYearOfCentury() { - logDeprecatedMethod("getYearOfCentury()", "get(ChronoField.YEAR_OF_ERA) % 100"); - return dt.get(ChronoField.YEAR_OF_ERA) % 100; - } - - @Deprecated - public int getYearOfEra() { - logDeprecatedMethod("getYearOfEra()", "get(ChronoField.YEAR_OF_ERA)"); - return dt.get(ChronoField.YEAR_OF_ERA); - } - - @Deprecated - public String toString(String format) { - logDeprecatedMethod("toString(String)", "a DateTimeFormatter"); - // TODO: replace with bwc formatter - return new DateTime(dt.toInstant().toEpochMilli(), DateUtils.zoneIdToDateTimeZone(dt.getZone())).toString(format); - } - - @Deprecated - public String toString(String format, Locale locale) { - logDeprecatedMethod("toString(String,Locale)", "a DateTimeFormatter"); - // TODO: replace with bwc formatter - return new DateTime(dt.toInstant().toEpochMilli(), DateUtils.zoneIdToDateTimeZone(dt.getZone())).toString(format, locale); - } - - public DayOfWeek getDayOfWeekEnum() { - return dt.getDayOfWeek(); - } - - @Deprecated - public int getDayOfWeek() { - logDeprecated(DeprecationCategory.PARSING, "getDayOfWeek()", - "The return type of [getDayOfWeek()] will change to an enum in 7.0. Use getDayOfWeekEnum().getValue()."); - return dt.getDayOfWeek().getValue(); - } -} diff --git a/server/src/main/java/org/elasticsearch/script/ScoreScriptUtils.java b/server/src/main/java/org/elasticsearch/script/ScoreScriptUtils.java index 841a263dddd1a..d1ddf0bc88c50 100644 --- a/server/src/main/java/org/elasticsearch/script/ScoreScriptUtils.java +++ b/server/src/main/java/org/elasticsearch/script/ScoreScriptUtils.java @@ -21,6 +21,7 @@ import org.elasticsearch.index.mapper.DateFieldMapper; import java.time.ZoneId; +import java.time.ZonedDateTime; import static com.carrotsearch.hppc.BitMixer.mix32; @@ -231,7 +232,7 @@ public DecayDateLinear(String originStr, String scaleStr, String offsetStr, doub this.scaling = scale / (1.0 - decay); } - public double decayDateLinear(JodaCompatibleZonedDateTime docValueDate) { + public double decayDateLinear(ZonedDateTime docValueDate) { long docValue = docValueDate.toInstant().toEpochMilli(); // as java.lang.Math#abs(long) is a forbidden API, have to use this comparison instead long diff = (docValue >= origin) ? (docValue - origin) : (origin - docValue); @@ -254,7 +255,7 @@ public DecayDateExp(String originStr, String scaleStr, String offsetStr, double this.scaling = Math.log(decay) / scale; } - public double decayDateExp(JodaCompatibleZonedDateTime docValueDate) { + public double decayDateExp(ZonedDateTime docValueDate) { long docValue = docValueDate.toInstant().toEpochMilli(); long diff = (docValue >= origin) ? (docValue - origin) : (origin - docValue); long distance = Math.max(0, diff - offset); @@ -277,7 +278,7 @@ public DecayDateGauss(String originStr, String scaleStr, String offsetStr, doubl this.scaling = 0.5 * Math.pow(scale, 2.0) / Math.log(decay); } - public double decayDateGauss(JodaCompatibleZonedDateTime docValueDate) { + public double decayDateGauss(ZonedDateTime docValueDate) { long docValue = docValueDate.toInstant().toEpochMilli(); long diff = (docValue >= origin) ? (docValue - origin) : (origin - docValue); long distance = Math.max(0, diff - offset); diff --git a/server/src/main/java/org/elasticsearch/script/field/DateMillisField.java b/server/src/main/java/org/elasticsearch/script/field/DateMillisField.java index 19beaa251dbe0..a8f1ccd1dd2d7 100644 --- a/server/src/main/java/org/elasticsearch/script/field/DateMillisField.java +++ b/server/src/main/java/org/elasticsearch/script/field/DateMillisField.java @@ -8,18 +8,17 @@ package org.elasticsearch.script.field; -import org.elasticsearch.script.JodaCompatibleZonedDateTime; - +import java.time.ZonedDateTime; import java.util.List; import java.util.stream.Collectors; -public class DateMillisField extends Field { +public class DateMillisField extends Field { /* ---- Conversion Helpers To Other Fields ---- */ public static LongField toLongField(DateMillisField sourceField) { - FieldValues fv = sourceField.getFieldValues(); - return new LongField(sourceField.getName(), new DelegatingFieldValues(fv) { + FieldValues fv = sourceField.getFieldValues(); + return new LongField(sourceField.getName(), new DelegatingFieldValues(fv) { @Override public List getValues() { return values.getValues().stream().map(dt -> dt.toInstant().toEpochMilli()).collect(Collectors.toList()); @@ -44,13 +43,13 @@ public double getDoubleValue() { /* ---- Conversion Helpers To Other Types ---- */ - public static long toLong(JodaCompatibleZonedDateTime dt) { + public static long toLong(ZonedDateTime dt) { return dt.toInstant().toEpochMilli(); } /* ---- DateMillis Field Members ---- */ - public DateMillisField(String name, FieldValues values) { + public DateMillisField(String name, FieldValues values) { super(name, values); } } diff --git a/server/src/main/java/org/elasticsearch/script/field/DateNanosField.java b/server/src/main/java/org/elasticsearch/script/field/DateNanosField.java index c169e762731ba..23bc4422f7053 100644 --- a/server/src/main/java/org/elasticsearch/script/field/DateNanosField.java +++ b/server/src/main/java/org/elasticsearch/script/field/DateNanosField.java @@ -8,21 +8,20 @@ package org.elasticsearch.script.field; -import org.elasticsearch.script.JodaCompatibleZonedDateTime; - import java.time.Instant; +import java.time.ZonedDateTime; import java.time.temporal.ChronoUnit; import java.util.List; import java.util.stream.Collectors; -public class DateNanosField extends Field { +public class DateNanosField extends Field { /* ---- Conversion Helpers To Other Fields ---- */ public static LongField toLongField(DateNanosField sourceField) { - FieldValues fv = sourceField.getFieldValues(); - return new LongField(sourceField.getName(), new DelegatingFieldValues(fv) { - protected long nanoLong(JodaCompatibleZonedDateTime dt) { + FieldValues fv = sourceField.getFieldValues(); + return new LongField(sourceField.getName(), new DelegatingFieldValues(fv) { + protected long nanoLong(ZonedDateTime dt) { return ChronoUnit.NANOS.between(Instant.EPOCH, dt.toInstant()); } @@ -50,13 +49,13 @@ public double getDoubleValue() { /* ---- Conversion Helpers To Other Types ---- */ - public static long toLong(JodaCompatibleZonedDateTime dt) { + public static long toLong(ZonedDateTime dt) { return ChronoUnit.NANOS.between(Instant.EPOCH, dt.toInstant()); } /* ---- DateNanos Field Members ---- */ - public DateNanosField(String name, FieldValues values) { + public DateNanosField(String name, FieldValues values) { super(name, values); } } diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/support/values/ScriptDoubleValues.java b/server/src/main/java/org/elasticsearch/search/aggregations/support/values/ScriptDoubleValues.java index 97de6e1f47568..f88ec278a8576 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/support/values/ScriptDoubleValues.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/support/values/ScriptDoubleValues.java @@ -11,7 +11,6 @@ import org.elasticsearch.common.lucene.ScorerAware; import org.elasticsearch.index.fielddata.SortingNumericDoubleValues; import org.elasticsearch.script.AggregationScript; -import org.elasticsearch.script.JodaCompatibleZonedDateTime; import org.elasticsearch.search.aggregations.AggregationExecutionException; import org.joda.time.ReadableInstant; @@ -85,8 +84,6 @@ private static double toDoubleValue(Object o) { return ((ReadableInstant) o).getMillis(); } else if (o instanceof ZonedDateTime) { return ((ZonedDateTime) o).toInstant().toEpochMilli(); - } else if (o instanceof JodaCompatibleZonedDateTime) { - return ((JodaCompatibleZonedDateTime) o).toInstant().toEpochMilli(); } else if (o instanceof Boolean) { // We do expose boolean fields as boolean in scripts, however aggregations still expect // that scripts return the same internal representation as regular fields, so boolean diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/support/values/ScriptLongValues.java b/server/src/main/java/org/elasticsearch/search/aggregations/support/values/ScriptLongValues.java index 18053c98e7d3d..126794ba6cdb9 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/support/values/ScriptLongValues.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/support/values/ScriptLongValues.java @@ -12,7 +12,6 @@ import org.elasticsearch.common.lucene.ScorerAware; import org.elasticsearch.index.fielddata.AbstractSortingNumericDocValues; import org.elasticsearch.script.AggregationScript; -import org.elasticsearch.script.JodaCompatibleZonedDateTime; import org.elasticsearch.search.aggregations.AggregationExecutionException; import org.joda.time.ReadableInstant; @@ -84,8 +83,6 @@ private static long toLongValue(Object o) { return ((ReadableInstant) o).getMillis(); } else if (o instanceof ZonedDateTime) { return ((ZonedDateTime) o).toInstant().toEpochMilli(); - } else if (o instanceof JodaCompatibleZonedDateTime) { - return ((JodaCompatibleZonedDateTime) o).toInstant().toEpochMilli(); } else if (o instanceof Boolean) { // We do expose boolean fields as boolean in scripts, however aggregations still expect // that scripts return the same internal representation as regular fields, so boolean diff --git a/server/src/test/java/org/elasticsearch/common/io/stream/BytesStreamsTests.java b/server/src/test/java/org/elasticsearch/common/io/stream/BytesStreamsTests.java index 9ceac9ee8a9cd..be4ba4d1b37cd 100644 --- a/server/src/test/java/org/elasticsearch/common/io/stream/BytesStreamsTests.java +++ b/server/src/test/java/org/elasticsearch/common/io/stream/BytesStreamsTests.java @@ -18,7 +18,6 @@ import org.elasticsearch.common.lucene.BytesRefs; import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.PageCacheRecycler; -import org.elasticsearch.script.JodaCompatibleZonedDateTime; import org.elasticsearch.test.ESTestCase; import org.joda.time.DateTime; import org.joda.time.DateTimeZone; @@ -27,6 +26,7 @@ import java.io.IOException; import java.time.OffsetTime; import java.time.ZoneId; +import java.time.ZonedDateTime; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -337,10 +337,10 @@ public void testSimpleStreams() throws Exception { assertEquals(DateTimeZone.getDefault(), in.readOptionalTimeZone()); assertNull(in.readOptionalTimeZone()); Object dt = in.readGenericValue(); - assertThat(dt, instanceOf(JodaCompatibleZonedDateTime.class)); - JodaCompatibleZonedDateTime jdt = (JodaCompatibleZonedDateTime) dt; - assertThat(jdt.getZonedDateTime().toInstant().toEpochMilli(), equalTo(123456L)); - assertThat(jdt.getZonedDateTime().getZone(), equalTo(ZoneId.of("America/Los_Angeles"))); + assertThat(dt, instanceOf(ZonedDateTime.class)); + ZonedDateTime zdt = (ZonedDateTime)dt; + assertThat(zdt.toInstant().toEpochMilli(), equalTo(123456L)); + assertThat(zdt.getZone(), equalTo(ZoneId.of("America/Los_Angeles"))); assertThat(in.readGenericValue(), equalTo(offsetNow)); assertEquals(0, in.available()); IllegalArgumentException ex = expectThrows(IllegalArgumentException.class, () -> out.writeGenericValue(new Object() { diff --git a/server/src/test/java/org/elasticsearch/script/JodaCompatibleZonedDateTimeTests.java b/server/src/test/java/org/elasticsearch/script/JodaCompatibleZonedDateTimeTests.java deleted file mode 100644 index 8e035eba0f250..0000000000000 --- a/server/src/test/java/org/elasticsearch/script/JodaCompatibleZonedDateTimeTests.java +++ /dev/null @@ -1,270 +0,0 @@ -/* - * 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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -package org.elasticsearch.script; - -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.apache.logging.log4j.core.Appender; -import org.apache.logging.log4j.core.LogEvent; -import org.apache.logging.log4j.core.appender.AbstractAppender; -import org.elasticsearch.common.logging.Loggers; -import org.elasticsearch.test.ESTestCase; -import org.joda.time.DateTime; -import org.joda.time.DateTimeZone; -import org.junit.Before; - -import java.security.AccessControlContext; -import java.security.AccessController; -import java.security.PermissionCollection; -import java.security.Permissions; -import java.security.PrivilegedAction; -import java.security.ProtectionDomain; -import java.time.DayOfWeek; -import java.time.Instant; -import java.time.LocalDate; -import java.time.LocalDateTime; -import java.time.Month; -import java.time.ZoneOffset; -import java.util.Locale; - -import static org.hamcrest.Matchers.equalTo; - -public class JodaCompatibleZonedDateTimeTests extends ESTestCase { - private static final Logger DEPRECATION_LOGGER = - LogManager.getLogger("org.elasticsearch.deprecation.script.JodaCompatibleZonedDateTime"); - - // each call to get or getValue will be run with limited permissions, just as they are in scripts - private static PermissionCollection NO_PERMISSIONS = new Permissions(); - private static AccessControlContext NO_PERMISSIONS_ACC = new AccessControlContext( - new ProtectionDomain[] { - new ProtectionDomain(null, NO_PERMISSIONS) - } - ); - - private JodaCompatibleZonedDateTime javaTime; - private DateTime jodaTime; - - @Before - public void setupTime() { - long millis = randomIntBetween(0, Integer.MAX_VALUE); - javaTime = new JodaCompatibleZonedDateTime(Instant.ofEpochMilli(millis), ZoneOffset.ofHours(-7)); - jodaTime = new DateTime(millis, DateTimeZone.forOffsetHours(-7)); - } - - void assertDeprecation(Runnable assertions, String message) { - Appender appender = new AbstractAppender("test", null, null) { - @Override - public void append(LogEvent event) { - /* Create a temporary directory to prove we are running with the - * server's permissions. */ - createTempDir(); - } - }; - appender.start(); - Loggers.addAppender(DEPRECATION_LOGGER, appender); - try { - // the assertions are run with the same reduced privileges scripts run with - AccessController.doPrivileged((PrivilegedAction) () -> { - assertions.run(); - return null; - }, NO_PERMISSIONS_ACC); - } finally { - appender.stop(); - Loggers.removeAppender(DEPRECATION_LOGGER, appender); - } - - assertWarnings(message); - } - - void assertMethodDeprecation(Runnable assertions, String oldMethod, String newMethod) { - assertDeprecation(assertions, "Use of the joda time method [" + oldMethod + "] is deprecated. Use [" + newMethod + "] instead."); - } - - public void testEquals() { - assertThat(javaTime, equalTo(javaTime)); - } - - public void testToString() { - assertThat(javaTime.toString(), equalTo(jodaTime.toString())); - } - - public void testDayOfMonth() { - assertThat(javaTime.getDayOfMonth(), equalTo(jodaTime.getDayOfMonth())); - } - - public void testDayOfYear() { - assertThat(javaTime.getDayOfYear(), equalTo(jodaTime.getDayOfYear())); - } - - public void testHour() { - assertThat(javaTime.getHour(), equalTo(jodaTime.getHourOfDay())); - } - - public void testLocalDate() { - assertThat(javaTime.toLocalDate(), equalTo(LocalDate.of(jodaTime.getYear(), jodaTime.getMonthOfYear(), jodaTime.getDayOfMonth()))); - } - - public void testLocalDateTime() { - LocalDateTime dt = LocalDateTime.of(jodaTime.getYear(), jodaTime.getMonthOfYear(), jodaTime.getDayOfMonth(), - jodaTime.getHourOfDay(), jodaTime.getMinuteOfHour(), jodaTime.getSecondOfMinute(), - jodaTime.getMillisOfSecond() * 1000000); - assertThat(javaTime.toLocalDateTime(), equalTo(dt)); - } - - public void testMinute() { - assertThat(javaTime.getMinute(), equalTo(jodaTime.getMinuteOfHour())); - } - - public void testMonth() { - assertThat(javaTime.getMonth(), equalTo(Month.of(jodaTime.getMonthOfYear()))); - } - - public void testMonthValue() { - assertThat(javaTime.getMonthValue(), equalTo(jodaTime.getMonthOfYear())); - } - - public void testNano() { - assertThat(javaTime.getNano(), equalTo(jodaTime.getMillisOfSecond() * 1000000)); - } - - public void testSecond() { - assertThat(javaTime.getSecond(), equalTo(jodaTime.getSecondOfMinute())); - } - - public void testYear() { - assertThat(javaTime.getYear(), equalTo(jodaTime.getYear())); - } - - public void testZone() { - assertThat(javaTime.getZone().getId(), equalTo(jodaTime.getZone().getID())); - } - - public void testMillis() { - assertMethodDeprecation(() -> assertThat(javaTime.getMillis(), equalTo(jodaTime.getMillis())), - "getMillis()", "toInstant().toEpochMilli()"); - } - - public void testCenturyOfEra() { - assertMethodDeprecation(() -> assertThat(javaTime.getCenturyOfEra(), equalTo(jodaTime.getCenturyOfEra())), - "getCenturyOfEra()", "get(ChronoField.YEAR_OF_ERA) / 100"); - } - - public void testEra() { - assertMethodDeprecation(() -> assertThat(javaTime.getEra(), equalTo(jodaTime.getEra())), - "getEra()", "get(ChronoField.ERA)"); - } - - public void testHourOfDay() { - assertMethodDeprecation(() -> assertThat(javaTime.getHourOfDay(), equalTo(jodaTime.getHourOfDay())), - "getHourOfDay()", "getHour()"); - } - - public void testMillisOfDay() { - assertMethodDeprecation(() -> assertThat(javaTime.getMillisOfDay(), equalTo(jodaTime.getMillisOfDay())), - "getMillisOfDay()", "get(ChronoField.MILLI_OF_DAY)"); - } - - public void testMillisOfSecond() { - assertMethodDeprecation(() -> assertThat(javaTime.getMillisOfSecond(), equalTo(jodaTime.getMillisOfSecond())), - "getMillisOfSecond()", "get(ChronoField.MILLI_OF_SECOND)"); - } - - public void testMinuteOfDay() { - assertMethodDeprecation(() -> assertThat(javaTime.getMinuteOfDay(), equalTo(jodaTime.getMinuteOfDay())), - "getMinuteOfDay()", "get(ChronoField.MINUTE_OF_DAY)"); - } - - public void testMinuteOfHour() { - assertMethodDeprecation(() -> assertThat(javaTime.getMinuteOfHour(), equalTo(jodaTime.getMinuteOfHour())), - "getMinuteOfHour()", "getMinute()"); - } - - public void testMonthOfYear() { - assertMethodDeprecation(() -> assertThat(javaTime.getMonthOfYear(), equalTo(jodaTime.getMonthOfYear())), - "getMonthOfYear()", "getMonthValue()"); - } - - public void testSecondOfDay() { - assertMethodDeprecation(() -> assertThat(javaTime.getSecondOfDay(), equalTo(jodaTime.getSecondOfDay())), - "getSecondOfDay()", "get(ChronoField.SECOND_OF_DAY)"); - } - - public void testSecondOfMinute() { - assertMethodDeprecation(() -> assertThat(javaTime.getSecondOfMinute(), equalTo(jodaTime.getSecondOfMinute())), - "getSecondOfMinute()", "getSecond()"); - } - - public void testWeekOfWeekyear() { - assertMethodDeprecation(() -> assertThat(javaTime.getWeekOfWeekyear(), equalTo(jodaTime.getWeekOfWeekyear())), - "getWeekOfWeekyear()", "get(DateFormatters.WEEK_FIELDS.weekOfWeekBasedYear())"); - } - - public void testWeekyear() { - assertMethodDeprecation(() -> assertThat(javaTime.getWeekyear(), equalTo(jodaTime.getWeekyear())), - "getWeekyear()", "get(DateFormatters.WEEK_FIELDS.weekBasedYear())"); - } - - public void testYearOfCentury() { - assertMethodDeprecation(() -> assertThat(javaTime.getYearOfCentury(), equalTo(jodaTime.getYearOfCentury())), - "getYearOfCentury()", "get(ChronoField.YEAR_OF_ERA) % 100"); - } - - public void testYearOfEra() { - assertMethodDeprecation(() -> assertThat(javaTime.getYearOfEra(), equalTo(jodaTime.getYearOfEra())), - "getYearOfEra()", "get(ChronoField.YEAR_OF_ERA)"); - } - - public void testToString1() { - assertMethodDeprecation(() -> assertThat(javaTime.toString("YYYY/MM/dd HH:mm:ss.SSS"), - equalTo(jodaTime.toString("YYYY/MM/dd HH:mm:ss.SSS"))), "toString(String)", "a DateTimeFormatter"); - } - - public void testToString2() { - assertMethodDeprecation(() -> assertThat(javaTime.toString("EEE", Locale.GERMANY), - equalTo(jodaTime.toString("EEE", Locale.GERMANY))), "toString(String,Locale)", "a DateTimeFormatter"); - } - - public void testDayOfWeek() { - assertDeprecation(() -> assertThat(javaTime.getDayOfWeek(), equalTo(jodaTime.getDayOfWeek())), - "The return type of [getDayOfWeek()] will change to an enum in 7.0. Use getDayOfWeekEnum().getValue()."); - } - - public void testDayOfWeekEnum() { - assertThat(javaTime.getDayOfWeekEnum(), equalTo(DayOfWeek.of(jodaTime.getDayOfWeek()))); - } - - public void testToStringWithLocaleAndZeroOffset() { - JodaCompatibleZonedDateTime dt = new JodaCompatibleZonedDateTime(Instant.EPOCH, ZoneOffset.ofTotalSeconds(0)); - assertMethodDeprecation(() -> dt.toString("yyyy-MM-dd hh:mm", Locale.ROOT), "toString(String,Locale)", "a DateTimeFormatter"); - } - - public void testToStringAndZeroOffset() { - JodaCompatibleZonedDateTime dt = new JodaCompatibleZonedDateTime(Instant.EPOCH, ZoneOffset.ofTotalSeconds(0)); - assertMethodDeprecation(() -> dt.toString("yyyy-MM-dd hh:mm"), "toString(String)", "a DateTimeFormatter"); - } - - public void testIsEqual() { - assertTrue(javaTime.isEqual(javaTime)); - } - - public void testIsAfter() { - long millis = randomLongBetween(0, Integer.MAX_VALUE / 2); - JodaCompatibleZonedDateTime beforeTime = new JodaCompatibleZonedDateTime(Instant.ofEpochMilli(millis), ZoneOffset.ofHours(-7)); - millis = randomLongBetween(millis + 1, Integer.MAX_VALUE); - JodaCompatibleZonedDateTime afterTime = new JodaCompatibleZonedDateTime(Instant.ofEpochMilli(millis), ZoneOffset.ofHours(-7)); - assertTrue(afterTime.isAfter(beforeTime)); - } - public void testIsBefore() { - long millis = randomLongBetween(0, Integer.MAX_VALUE / 2); - JodaCompatibleZonedDateTime beforeTime = new JodaCompatibleZonedDateTime(Instant.ofEpochMilli(millis), ZoneOffset.ofHours(-7)); - millis = randomLongBetween(millis + 1, Integer.MAX_VALUE); - JodaCompatibleZonedDateTime afterTime = new JodaCompatibleZonedDateTime(Instant.ofEpochMilli(millis), ZoneOffset.ofHours(-7)); - assertTrue(beforeTime.isBefore(afterTime)); - } -} diff --git a/server/src/test/java/org/elasticsearch/script/field/ConvertersTestBase.java b/server/src/test/java/org/elasticsearch/script/field/ConvertersTestBase.java index 103180e336f3e..0b1ab21b26e6b 100644 --- a/server/src/test/java/org/elasticsearch/script/field/ConvertersTestBase.java +++ b/server/src/test/java/org/elasticsearch/script/field/ConvertersTestBase.java @@ -9,7 +9,6 @@ package org.elasticsearch.script.field; import org.elasticsearch.common.geo.GeoPoint; -import org.elasticsearch.script.JodaCompatibleZonedDateTime; import org.elasticsearch.test.ESTestCase; import org.junit.Before; @@ -17,6 +16,7 @@ import java.math.BigInteger; import java.time.Instant; import java.time.ZoneOffset; +import java.time.ZonedDateTime; import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -351,9 +351,9 @@ public double getDoubleValue() { } long[] rawLongMillisValues; - List rawDateMillisValues; - protected FieldValues dateMillisFieldValues; - protected Field dateMillisField; + List rawDateMillisValues; + protected FieldValues dateMillisFieldValues; + protected Field dateMillisField; @Before public void setupDateMillisField() { @@ -365,13 +365,13 @@ public void setupDateMillisField() { }; rawDateMillisValues = List.of( - new JodaCompatibleZonedDateTime(Instant.ofEpochMilli(rawLongMillisValues[0]), ZoneOffset.ofHours(-7)), - new JodaCompatibleZonedDateTime(Instant.ofEpochMilli(rawLongMillisValues[1]), ZoneOffset.ofHours(-6)), - new JodaCompatibleZonedDateTime(Instant.ofEpochMilli(rawLongMillisValues[2]), ZoneOffset.ofHours(0)), - new JodaCompatibleZonedDateTime(Instant.ofEpochMilli(rawLongMillisValues[3]), ZoneOffset.ofHours(-5)) + ZonedDateTime.ofInstant(Instant.ofEpochMilli(rawLongMillisValues[0]), ZoneOffset.ofHours(-7)), + ZonedDateTime.ofInstant(Instant.ofEpochMilli(rawLongMillisValues[1]), ZoneOffset.ofHours(-6)), + ZonedDateTime.ofInstant(Instant.ofEpochMilli(rawLongMillisValues[2]), ZoneOffset.ofHours(0)), + ZonedDateTime.ofInstant(Instant.ofEpochMilli(rawLongMillisValues[3]), ZoneOffset.ofHours(-5)) ); - dateMillisFieldValues = new FieldValues() { + dateMillisFieldValues = new FieldValues() { @Override public boolean isEmpty() { return false; @@ -383,12 +383,12 @@ public int size() { } @Override - public List getValues() { + public List getValues() { return Collections.unmodifiableList(rawDateMillisValues); } @Override - public JodaCompatibleZonedDateTime getNonPrimitiveValue() { + public ZonedDateTime getNonPrimitiveValue() { return rawDateMillisValues.get(0); } @@ -407,9 +407,9 @@ public double getDoubleValue() { } long[] rawLongNanosValues; - List rawDateNanosValues; - protected FieldValues dateNanosFieldValues; - protected Field dateNanosField; + List rawDateNanosValues; + protected FieldValues dateNanosFieldValues; + protected Field dateNanosField; @Before public void setupDateNanosField() { @@ -421,13 +421,13 @@ public void setupDateNanosField() { }; rawDateNanosValues = List.of( - new JodaCompatibleZonedDateTime(Instant.EPOCH.plusNanos(rawLongNanosValues[0]), ZoneOffset.ofHours(-7)), - new JodaCompatibleZonedDateTime(Instant.EPOCH.plusNanos(rawLongNanosValues[1]), ZoneOffset.ofHours(-6)), - new JodaCompatibleZonedDateTime(Instant.EPOCH.plusNanos(rawLongNanosValues[2]), ZoneOffset.ofHours(0)), - new JodaCompatibleZonedDateTime(Instant.EPOCH.plusNanos(rawLongNanosValues[3]), ZoneOffset.ofHours(-5)) + ZonedDateTime.ofInstant(Instant.EPOCH.plusNanos(rawLongNanosValues[0]), ZoneOffset.ofHours(-7)), + ZonedDateTime.ofInstant(Instant.EPOCH.plusNanos(rawLongNanosValues[1]), ZoneOffset.ofHours(-6)), + ZonedDateTime.ofInstant(Instant.EPOCH.plusNanos(rawLongNanosValues[2]), ZoneOffset.ofHours(0)), + ZonedDateTime.ofInstant(Instant.EPOCH.plusNanos(rawLongNanosValues[3]), ZoneOffset.ofHours(-5)) ); - dateNanosFieldValues = new FieldValues() { + dateNanosFieldValues = new FieldValues() { @Override public boolean isEmpty() { return false; @@ -439,12 +439,12 @@ public int size() { } @Override - public List getValues() { + public List getValues() { return Collections.unmodifiableList(rawDateNanosValues); } @Override - public JodaCompatibleZonedDateTime getNonPrimitiveValue() { + public ZonedDateTime getNonPrimitiveValue() { return rawDateNanosValues.get(0); } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/actions/ActionWrapper.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/actions/ActionWrapper.java index 97cd6489388f2..0a7aa4288593a 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/actions/ActionWrapper.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/actions/ActionWrapper.java @@ -18,7 +18,6 @@ import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.license.XPackLicenseState; -import org.elasticsearch.script.JodaCompatibleZonedDateTime; import org.elasticsearch.xpack.core.watcher.actions.throttler.ActionThrottler; import org.elasticsearch.xpack.core.watcher.actions.throttler.Throttler; import org.elasticsearch.xpack.core.watcher.actions.throttler.ThrottlerField; @@ -235,7 +234,7 @@ private Map toMap(WatchExecutionContext ctx) { Map model = new HashMap<>(); model.put("id", ctx.id().value()); model.put("watch_id", ctx.id().watchId()); - model.put("execution_time", new JodaCompatibleZonedDateTime(ctx.executionTime().toInstant(), ZoneOffset.UTC)); + model.put("execution_time", ZonedDateTime.ofInstant(ctx.executionTime().toInstant(), ZoneOffset.UTC)); model.put("trigger", ctx.triggerEvent().data()); model.put("metadata", ctx.watch().metadata()); model.put("vars", ctx.vars()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/support/WatcherDateTimeUtils.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/support/WatcherDateTimeUtils.java index 6f6392a04be19..01794daee29da 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/support/WatcherDateTimeUtils.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/support/WatcherDateTimeUtils.java @@ -17,7 +17,6 @@ import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.mapper.DateFieldMapper; -import org.elasticsearch.script.JodaCompatibleZonedDateTime; import java.io.IOException; import java.time.Clock; @@ -41,9 +40,6 @@ public static ZonedDateTime convertToDate(Object value, Clock clock) { if (value instanceof ZonedDateTime) { return (ZonedDateTime) value; } - if (value instanceof JodaCompatibleZonedDateTime) { - return ((JodaCompatibleZonedDateTime) value).getZonedDateTime(); - } if (value instanceof String) { return parseDateMath((String) value, ZoneOffset.UTC, clock); } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/trigger/TriggerEvent.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/trigger/TriggerEvent.java index 56690f0d3e98f..033d650f043d5 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/trigger/TriggerEvent.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/trigger/TriggerEvent.java @@ -9,7 +9,6 @@ import org.elasticsearch.common.xcontent.ParseField; import org.elasticsearch.common.xcontent.ToXContentObject; import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.script.JodaCompatibleZonedDateTime; import org.elasticsearch.xpack.core.watcher.support.WatcherDateTimeUtils; import java.io.IOException; @@ -28,8 +27,7 @@ public TriggerEvent(String jobName, ZonedDateTime triggeredTime) { this.jobName = jobName; this.triggeredTime = triggeredTime; this.data = new HashMap<>(); - data.put(Field.TRIGGERED_TIME.getPreferredName(), - new JodaCompatibleZonedDateTime(triggeredTime.toInstant(), ZoneOffset.UTC)); + data.put(Field.TRIGGERED_TIME.getPreferredName(), ZonedDateTime.ofInstant(triggeredTime.toInstant(), ZoneOffset.UTC)); } public String jobName() { diff --git a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/expression/function/scalar/whitelist/InternalSqlScriptUtils.java b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/expression/function/scalar/whitelist/InternalSqlScriptUtils.java index 91e63e60bd302..53016c81a862c 100644 --- a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/expression/function/scalar/whitelist/InternalSqlScriptUtils.java +++ b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/expression/function/scalar/whitelist/InternalSqlScriptUtils.java @@ -8,7 +8,6 @@ import org.elasticsearch.common.geo.GeoPoint; import org.elasticsearch.index.fielddata.ScriptDocValues; -import org.elasticsearch.script.JodaCompatibleZonedDateTime; import org.elasticsearch.xpack.ql.expression.function.scalar.whitelist.InternalQlScriptUtils; import org.elasticsearch.xpack.sql.SqlIllegalArgumentException; import org.elasticsearch.xpack.sql.expression.function.scalar.datetime.DateAddProcessor; @@ -217,12 +216,12 @@ public static Number sqrt(Number value) { public static Number tan(Number value) { return MathOperation.TAN.apply(value); } - - + + // // Date/Time functions - // + // @Deprecated public static Integer dateTimeChrono(Object dateTime, String tzId, String chronoName) { String extractorName = null; @@ -238,7 +237,7 @@ public static Integer dateTimeChrono(Object dateTime, String tzId, String chrono } return dateTimeExtract(dateTime, tzId, extractorName); } - + public static Integer dateTimeExtract(Object dateTime, String tzId, String extractorName) { if (dateTime == null || tzId == null || extractorName == null) { return null; @@ -335,9 +334,6 @@ private static Object asDateTime(Object dateTime, boolean lenient) { if (dateTime == null) { return null; } - if (dateTime instanceof JodaCompatibleZonedDateTime) { - return ((JodaCompatibleZonedDateTime) dateTime).getZonedDateTime(); - } if (dateTime instanceof ZonedDateTime) { return dateTime; } diff --git a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/expression/predicate/operator/arithmetic/SqlBinaryArithmeticOperation.java b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/expression/predicate/operator/arithmetic/SqlBinaryArithmeticOperation.java index e6a24b23b434c..35c1412cd54d9 100644 --- a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/expression/predicate/operator/arithmetic/SqlBinaryArithmeticOperation.java +++ b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/expression/predicate/operator/arithmetic/SqlBinaryArithmeticOperation.java @@ -9,7 +9,6 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.script.JodaCompatibleZonedDateTime; import org.elasticsearch.xpack.ql.QlIllegalArgumentException; import org.elasticsearch.xpack.ql.expression.predicate.operator.arithmetic.Arithmetics; import org.elasticsearch.xpack.ql.expression.predicate.operator.arithmetic.Arithmetics.NumericArithmetic; @@ -38,8 +37,6 @@ public enum SqlBinaryArithmeticOperation implements BinaryArithmeticOperation { if (l instanceof IntervalDayTime && r instanceof IntervalDayTime) { return ((IntervalDayTime) l).add((IntervalDayTime) r); } - l = unwrapJodaTime(l); - r = unwrapJodaTime(r); if ((l instanceof ZonedDateTime || l instanceof OffsetTime) && r instanceof IntervalYearMonth) { return IntervalArithmetics.add((Temporal) l, ((IntervalYearMonth) r).interval()); } @@ -66,8 +63,6 @@ public enum SqlBinaryArithmeticOperation implements BinaryArithmeticOperation { if (l instanceof IntervalDayTime && r instanceof IntervalDayTime) { return ((IntervalDayTime) l).sub((IntervalDayTime) r); } - l = unwrapJodaTime(l); - r = unwrapJodaTime(r); if ((l instanceof ZonedDateTime || l instanceof OffsetTime) && r instanceof IntervalYearMonth) { return IntervalArithmetics.sub((Temporal) l, ((IntervalYearMonth) r).interval()); } @@ -85,8 +80,6 @@ public enum SqlBinaryArithmeticOperation implements BinaryArithmeticOperation { if (l instanceof Number && r instanceof Number) { return Arithmetics.mul((Number) l, (Number) r); } - l = unwrapJodaTime(l); - r = unwrapJodaTime(r); if (l instanceof Number && r instanceof IntervalYearMonth) { return ((IntervalYearMonth) r).mul(((Number) l).intValue()); } @@ -148,8 +141,4 @@ public void writeTo(StreamOutput out) throws IOException { public static SqlBinaryArithmeticOperation read(StreamInput in) throws IOException { return in.readEnum(SqlBinaryArithmeticOperation.class); } - - private static Object unwrapJodaTime(Object o) { - return o instanceof JodaCompatibleZonedDateTime ? ((JodaCompatibleZonedDateTime) o).getZonedDateTime() : o; - } } diff --git a/x-pack/plugin/watcher/qa/rest/build.gradle b/x-pack/plugin/watcher/qa/rest/build.gradle index cfb75b244aa5b..a4bbaa399fccc 100644 --- a/x-pack/plugin/watcher/qa/rest/build.gradle +++ b/x-pack/plugin/watcher/qa/rest/build.gradle @@ -35,6 +35,15 @@ if (BuildParams.inFipsJvm){ tasks.named("yamlRestTest").configure{enabled = false } } +tasks.named("yamlRestTestV7CompatTest").configure { + systemProperty 'tests.rest.blacklist', [ + // remove JodaCompatibleDateTime -- ZonedDateTime doesn't output millis/nanos if they're 0 (#78417) + 'mustache/30_search_input/Test search input mustache integration (using request body and rest_total_hits_as_int)', + 'mustache/30_search_input/Test search input mustache integration (using request body)', + 'mustache/40_search_transform/Test search transform mustache integration (using request body)' + ].join(',') +} + tasks.named("yamlRestTestV7CompatTransform").configure({ task -> task.replaceKeyInDo("watcher.ack_watch", "xpack-watcher.ack_watch") task.replaceKeyInDo("watcher.activate_watch", "xpack-watcher.activate_watch") diff --git a/x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/mustache/30_search_input.yml b/x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/mustache/30_search_input.yml index 807071411064a..954f0d3e3f214 100644 --- a/x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/mustache/30_search_input.yml +++ b/x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/mustache/30_search_input.yml @@ -92,8 +92,8 @@ setup: - match: { "watch_record.result.input.status": "success" } - match: { "watch_record.result.input.payload.hits.total": 4 } # makes sure that the mustache template snippets have been resolved correctly: - - match: { "watch_record.result.input.search.request.body.query.bool.filter.0.range.date.gte": "2015-01-04T00:00:00.000Z||-3d" } - - match: { "watch_record.result.input.search.request.body.query.bool.filter.0.range.date.lte": "2015-01-04T00:00:00.000Z" } + - match: { "watch_record.result.input.search.request.body.query.bool.filter.0.range.date.gte": "2015-01-04T00:00Z||-3d" } + - match: { "watch_record.result.input.search.request.body.query.bool.filter.0.range.date.lte": "2015-01-04T00:00Z" } --- "Test search input mustache integration (using request template)": @@ -210,8 +210,8 @@ setup: - match: { "watch_record.result.input.status": "success" } - match: { "watch_record.result.input.payload.hits.total": 4 } # makes sure that the mustache template snippets have been resolved correctly: - - match: { "watch_record.result.input.search.request.body.query.bool.filter.0.range.date.gte": "2015-01-04T00:00:00.000Z||-3d" } - - match: { "watch_record.result.input.search.request.body.query.bool.filter.0.range.date.lte": "2015-01-04T00:00:00.000Z" } + - match: { "watch_record.result.input.search.request.body.query.bool.filter.0.range.date.gte": "2015-01-04T00:00Z||-3d" } + - match: { "watch_record.result.input.search.request.body.query.bool.filter.0.range.date.lte": "2015-01-04T00:00Z" } --- "Test search input mustache integration (using request template and rest_total_hits_as_int)": diff --git a/x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/mustache/40_search_transform.yml b/x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/mustache/40_search_transform.yml index 068de0adb4649..91b76e5c66eae 100644 --- a/x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/mustache/40_search_transform.yml +++ b/x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/mustache/40_search_transform.yml @@ -99,8 +99,8 @@ setup: - match: { "watch_record.result.transform.payload.hits.total": 1 } - match: { "watch_record.result.transform.payload.hits.hits.0._id": "3" } # makes sure that the mustache template snippets have been resolved correctly: - - match: { "watch_record.result.transform.search.request.body.query.bool.filter.0.range.date.gte": "2015-01-04T00:00:00.000Z||-1d" } - - match: { "watch_record.result.transform.search.request.body.query.bool.filter.0.range.date.lte": "2015-01-04T00:00:00.000Z" } + - match: { "watch_record.result.transform.search.request.body.query.bool.filter.0.range.date.gte": "2015-01-04T00:00Z||-1d" } + - match: { "watch_record.result.transform.search.request.body.query.bool.filter.0.range.date.lte": "2015-01-04T00:00Z" } - match: { "watch_record.result.transform.search.request.body.query.bool.filter.1.term.value": "val_3" } --- diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/Variables.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/Variables.java index 71c5054716c47..0d9ec4626c9fd 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/Variables.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/Variables.java @@ -6,11 +6,11 @@ */ package org.elasticsearch.xpack.watcher.support; -import org.elasticsearch.script.JodaCompatibleZonedDateTime; import org.elasticsearch.xpack.core.watcher.execution.WatchExecutionContext; import org.elasticsearch.xpack.core.watcher.watch.Payload; import java.time.ZoneOffset; +import java.time.ZonedDateTime; import java.util.HashMap; import java.util.Map; @@ -37,8 +37,7 @@ public static Map createCtx(WatchExecutionContext ctx, Payload p Map ctxModel = new HashMap<>(); ctxModel.put(ID, ctx.id().value()); ctxModel.put(WATCH_ID, ctx.id().watchId()); - ctxModel.put(EXECUTION_TIME, - new JodaCompatibleZonedDateTime(ctx.executionTime().toInstant(), ZoneOffset.UTC)); + ctxModel.put(EXECUTION_TIME, ZonedDateTime.ofInstant(ctx.executionTime().toInstant(), ZoneOffset.UTC)); ctxModel.put(TRIGGER, ctx.triggerEvent().data()); if (payload != null) { ctxModel.put(PAYLOAD, payload.data()); diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/ScheduleTriggerEvent.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/ScheduleTriggerEvent.java index 67d43f6f876a6..b2f552611b599 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/ScheduleTriggerEvent.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/ScheduleTriggerEvent.java @@ -10,7 +10,6 @@ import org.elasticsearch.common.xcontent.ParseField; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.script.JodaCompatibleZonedDateTime; import org.elasticsearch.xpack.core.watcher.support.WatcherDateTimeUtils; import org.elasticsearch.xpack.core.watcher.trigger.TriggerEvent; @@ -30,8 +29,7 @@ public ScheduleTriggerEvent(ZonedDateTime triggeredTime, ZonedDateTime scheduled public ScheduleTriggerEvent(String jobName, ZonedDateTime triggeredTime, ZonedDateTime scheduledTime) { super(jobName, triggeredTime); this.scheduledTime = scheduledTime; - data.put(Field.SCHEDULED_TIME.getPreferredName(), - new JodaCompatibleZonedDateTime(scheduledTime.toInstant(), ZoneOffset.UTC)); + data.put(Field.SCHEDULED_TIME.getPreferredName(), ZonedDateTime.ofInstant(scheduledTime.toInstant(), ZoneOffset.UTC)); } @Override diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/email/EmailActionTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/email/EmailActionTests.java index c4b0c9bf18dae..7fe8c83136144 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/email/EmailActionTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/email/EmailActionTests.java @@ -18,7 +18,6 @@ import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.json.JsonXContent; -import org.elasticsearch.script.JodaCompatibleZonedDateTime; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.ssl.SSLService; import org.elasticsearch.xpack.core.watcher.actions.Action; @@ -134,7 +133,6 @@ public void testExecute() throws Exception { Map metadata = MapBuilder.newMapBuilder().put("_key", "_val").map(); ZonedDateTime now = ZonedDateTime.now(ZoneOffset.UTC); - JodaCompatibleZonedDateTime jodaJavaNow = new JodaCompatibleZonedDateTime(now.toInstant(), ZoneOffset.UTC); Wid wid = new Wid("watch1", now); WatchExecutionContext ctx = mockExecutionContextBuilder("watch1") @@ -145,14 +143,14 @@ public void testExecute() throws Exception { .buildMock(); Map triggerModel = new HashMap<>(); - triggerModel.put("triggered_time", jodaJavaNow); - triggerModel.put("scheduled_time", jodaJavaNow); + triggerModel.put("triggered_time", now); + triggerModel.put("scheduled_time", now); Map ctxModel = new HashMap<>(); ctxModel.put("id", ctx.id().value()); ctxModel.put("watch_id", "watch1"); ctxModel.put("payload", data); ctxModel.put("metadata", metadata); - ctxModel.put("execution_time", jodaJavaNow); + ctxModel.put("execution_time", now); ctxModel.put("trigger", triggerModel); ctxModel.put("vars", emptyMap()); Map expectedModel = singletonMap("ctx", ctxModel); diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/logging/LoggingActionTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/logging/LoggingActionTests.java index f0a29534a37ca..0e741a10b8ca9 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/logging/LoggingActionTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/logging/LoggingActionTests.java @@ -11,7 +11,6 @@ import org.elasticsearch.common.SuppressLoggerChecks; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.script.JodaCompatibleZonedDateTime; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.watcher.actions.Action; import org.elasticsearch.xpack.core.watcher.execution.WatchExecutionContext; @@ -57,19 +56,18 @@ public void init() throws IOException { public void testExecute() throws Exception { final ZonedDateTime now = ZonedDateTime.now(ZoneOffset.UTC); - JodaCompatibleZonedDateTime jodaJavaNow = new JodaCompatibleZonedDateTime(now.toInstant(), ZoneOffset.UTC); WatchExecutionContext ctx = WatcherTestUtils.mockExecutionContextBuilder("_watch_id") .time("_watch_id", now) .buildMock(); Map triggerModel = new HashMap<>(); - triggerModel.put("scheduled_time", jodaJavaNow); - triggerModel.put("triggered_time", jodaJavaNow); + triggerModel.put("scheduled_time", now); + triggerModel.put("triggered_time", now); Map ctxModel = new HashMap<>(); ctxModel.put("id", ctx.id().value()); ctxModel.put("watch_id", "_watch_id"); - ctxModel.put("execution_time", jodaJavaNow); + ctxModel.put("execution_time", now); ctxModel.put("payload", emptyMap()); ctxModel.put("metadata", emptyMap()); ctxModel.put("vars", emptyMap()); diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/pagerduty/PagerDutyActionTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/pagerduty/PagerDutyActionTests.java index f70dbfbe43c1a..2f01e1dd06e30 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/pagerduty/PagerDutyActionTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/pagerduty/PagerDutyActionTests.java @@ -14,7 +14,6 @@ import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.json.JsonXContent; -import org.elasticsearch.script.JodaCompatibleZonedDateTime; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.watcher.actions.Action; import org.elasticsearch.xpack.core.watcher.execution.WatchExecutionContext; @@ -80,7 +79,6 @@ public void testExecute() throws Exception { Map metadata = MapBuilder.newMapBuilder().put("_key", "_val").map(); ZonedDateTime now = ZonedDateTime.now(ZoneOffset.UTC); - JodaCompatibleZonedDateTime jodaJavaNow = new JodaCompatibleZonedDateTime(now.toInstant(), ZoneOffset.UTC); Wid wid = new Wid(randomAlphaOfLength(5), now); WatchExecutionContext ctx = mockExecutionContextBuilder(wid.watchId()) @@ -95,10 +93,10 @@ public void testExecute() throws Exception { ctxModel.put("watch_id", wid.watchId()); ctxModel.put("payload", data); ctxModel.put("metadata", metadata); - ctxModel.put("execution_time", jodaJavaNow); + ctxModel.put("execution_time", now); Map triggerModel = new HashMap<>(); - triggerModel.put("triggered_time", jodaJavaNow); - triggerModel.put("scheduled_time", jodaJavaNow); + triggerModel.put("triggered_time", now); + triggerModel.put("scheduled_time", now); ctxModel.put("trigger", triggerModel); ctxModel.put("vars", Collections.emptyMap()); Map expectedModel = new HashMap<>(); diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/slack/SlackActionTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/slack/SlackActionTests.java index 025574a76cb1d..8abcbebd9d852 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/slack/SlackActionTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/slack/SlackActionTests.java @@ -13,7 +13,6 @@ import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.json.JsonXContent; -import org.elasticsearch.script.JodaCompatibleZonedDateTime; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.watcher.actions.Action; import org.elasticsearch.xpack.core.watcher.execution.WatchExecutionContext; @@ -77,7 +76,6 @@ public void testExecute() throws Exception { Map metadata = MapBuilder.newMapBuilder().put("_key", "_val").map(); ZonedDateTime now = ZonedDateTime.now(ZoneOffset.UTC); - JodaCompatibleZonedDateTime jodaJavaNow = new JodaCompatibleZonedDateTime(now.toInstant(), ZoneOffset.UTC); Wid wid = new Wid(randomAlphaOfLength(5), now); WatchExecutionContext ctx = mockExecutionContextBuilder(wid.watchId()) @@ -88,14 +86,14 @@ public void testExecute() throws Exception { .buildMock(); Map triggerModel = new HashMap<>(); - triggerModel.put("triggered_time", jodaJavaNow); - triggerModel.put("scheduled_time", jodaJavaNow); + triggerModel.put("triggered_time", now); + triggerModel.put("scheduled_time", now); Map ctxModel = new HashMap<>(); ctxModel.put("id", ctx.id().value()); ctxModel.put("watch_id", wid.watchId()); ctxModel.put("payload", data); ctxModel.put("metadata", metadata); - ctxModel.put("execution_time", jodaJavaNow); + ctxModel.put("execution_time", now); ctxModel.put("trigger", triggerModel); ctxModel.put("vars", emptyMap()); Map expectedModel = singletonMap("ctx", ctxModel); diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/condition/ScriptConditionTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/condition/ScriptConditionTests.java index ff69c9b9d07e6..39bdfd1eaa9b8 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/condition/ScriptConditionTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/condition/ScriptConditionTests.java @@ -21,7 +21,6 @@ import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.script.GeneralScriptException; -import org.elasticsearch.script.JodaCompatibleZonedDateTime; import org.elasticsearch.script.Script; import org.elasticsearch.script.ScriptException; import org.elasticsearch.script.ScriptMetadata; @@ -62,8 +61,7 @@ public void init() throws IOException { scripts.put("return new Object()", s -> new Object()); scripts.put("ctx.trigger.scheduled_time.toInstant().toEpochMill() < new Date().time", vars -> { - JodaCompatibleZonedDateTime scheduledTime = - (JodaCompatibleZonedDateTime) XContentMapValues.extractValue("ctx.trigger.scheduled_time", vars); + ZonedDateTime scheduledTime = (ZonedDateTime) XContentMapValues.extractValue("ctx.trigger.scheduled_time", vars); return scheduledTime.toInstant().toEpochMilli() < new Date().getTime(); }); diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/support/VariablesTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/support/VariablesTests.java index 477bf4b48051c..b56b3b1c1f0d0 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/support/VariablesTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/support/VariablesTests.java @@ -7,7 +7,6 @@ package org.elasticsearch.xpack.watcher.support; import org.elasticsearch.common.xcontent.ObjectPath; -import org.elasticsearch.script.JodaCompatibleZonedDateTime; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.watcher.execution.WatchExecutionContext; import org.elasticsearch.xpack.core.watcher.execution.Wid; @@ -47,8 +46,7 @@ public void testCreateCtxModel() throws Exception { assertThat(model, notNullValue()); assertThat(model.size(), is(1)); - JodaCompatibleZonedDateTime jodaJavaExecutionTime = - new JodaCompatibleZonedDateTime(executionTime.toInstant(), ZoneOffset.UTC); + ZonedDateTime jodaJavaExecutionTime = ZonedDateTime.ofInstant(executionTime.toInstant(), ZoneOffset.UTC); assertThat(ObjectPath.eval("ctx", model), instanceOf(Map.class)); assertThat(ObjectPath.eval("ctx.id", model), is(wid.value())); // NOTE: we use toString() here because two ZonedDateTime are *not* equal, we need to check with isEqual From 8c2fe902f3e1d017382255202c2a328fffe1f551 Mon Sep 17 00:00:00 2001 From: William Brafford Date: Wed, 29 Sep 2021 16:25:15 -0400 Subject: [PATCH 070/250] Feature upgrade rest stubs (#77827) * Add stubs for get API * Add stub for post API * Register new actions in ActionModule * HLRC stubs * Unit tests * Add rest api spec and tests * Add new action to non-operator actions list --- .../elasticsearch/client/MigrationClient.java | 80 ++++++ .../client/MigrationRequestConverters.java | 29 +++ .../GetFeatureUpgradeStatusRequest.java | 18 ++ .../GetFeatureUpgradeStatusResponse.java | 209 +++++++++++++++ .../migration/PostFeatureUpgradeRequest.java | 18 ++ .../migration/PostFeatureUpgradeResponse.java | 162 ++++++++++++ .../org/elasticsearch/client/MigrationIT.java | 29 +++ .../GetFeatureUpgradeStatusResponseTests.java | 89 +++++++ .../PostFeatureUpgradeResponseTests.java | 90 +++++++ .../migration/apis/feature_upgrade.asciidoc | 88 +++++++ docs/reference/migration/migration.asciidoc | 1 + .../migration.get_feature_upgrade_status.json | 24 ++ .../api/migration.post_feature_upgrade.json | 24 ++ .../10_get_feature_upgrade_status.yml | 11 + .../migration/20_post_feature_upgrade.yml | 11 + .../elasticsearch/action/ActionModule.java | 10 + .../GetFeatureUpgradeStatusAction.java | 24 ++ .../GetFeatureUpgradeStatusRequest.java | 34 +++ .../GetFeatureUpgradeStatusResponse.java | 243 ++++++++++++++++++ .../migration/PostFeatureUpgradeAction.java | 24 ++ .../migration/PostFeatureUpgradeRequest.java | 34 +++ .../migration/PostFeatureUpgradeResponse.java | 200 ++++++++++++++ ...ransportGetFeatureUpgradeStatusAction.java | 79 ++++++ .../TransportPostFeatureUpgradeAction.java | 74 ++++++ .../RestGetFeatureUpgradeStatusAction.java | 50 ++++ .../cluster/RestPostFeatureUpgradeAction.java | 50 ++++ .../GetFeatureUpgradeStatusResponseTests.java | 70 +++++ .../PostFeatureUpgradeResponseTests.java | 73 ++++++ .../xpack/security/operator/Constants.java | 2 + 29 files changed, 1850 insertions(+) create mode 100644 client/rest-high-level/src/main/java/org/elasticsearch/client/migration/GetFeatureUpgradeStatusRequest.java create mode 100644 client/rest-high-level/src/main/java/org/elasticsearch/client/migration/GetFeatureUpgradeStatusResponse.java create mode 100644 client/rest-high-level/src/main/java/org/elasticsearch/client/migration/PostFeatureUpgradeRequest.java create mode 100644 client/rest-high-level/src/main/java/org/elasticsearch/client/migration/PostFeatureUpgradeResponse.java create mode 100644 client/rest-high-level/src/test/java/org/elasticsearch/client/migration/GetFeatureUpgradeStatusResponseTests.java create mode 100644 client/rest-high-level/src/test/java/org/elasticsearch/client/migration/PostFeatureUpgradeResponseTests.java create mode 100644 docs/reference/migration/apis/feature_upgrade.asciidoc create mode 100644 rest-api-spec/src/main/resources/rest-api-spec/api/migration.get_feature_upgrade_status.json create mode 100644 rest-api-spec/src/main/resources/rest-api-spec/api/migration.post_feature_upgrade.json create mode 100644 rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/migration/10_get_feature_upgrade_status.yml create mode 100644 rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/migration/20_post_feature_upgrade.yml create mode 100644 server/src/main/java/org/elasticsearch/action/admin/cluster/migration/GetFeatureUpgradeStatusAction.java create mode 100644 server/src/main/java/org/elasticsearch/action/admin/cluster/migration/GetFeatureUpgradeStatusRequest.java create mode 100644 server/src/main/java/org/elasticsearch/action/admin/cluster/migration/GetFeatureUpgradeStatusResponse.java create mode 100644 server/src/main/java/org/elasticsearch/action/admin/cluster/migration/PostFeatureUpgradeAction.java create mode 100644 server/src/main/java/org/elasticsearch/action/admin/cluster/migration/PostFeatureUpgradeRequest.java create mode 100644 server/src/main/java/org/elasticsearch/action/admin/cluster/migration/PostFeatureUpgradeResponse.java create mode 100644 server/src/main/java/org/elasticsearch/action/admin/cluster/migration/TransportGetFeatureUpgradeStatusAction.java create mode 100644 server/src/main/java/org/elasticsearch/action/admin/cluster/migration/TransportPostFeatureUpgradeAction.java create mode 100644 server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestGetFeatureUpgradeStatusAction.java create mode 100644 server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestPostFeatureUpgradeAction.java create mode 100644 server/src/test/java/org/elasticsearch/action/admin/cluster/migration/GetFeatureUpgradeStatusResponseTests.java create mode 100644 server/src/test/java/org/elasticsearch/action/admin/cluster/migration/PostFeatureUpgradeResponseTests.java diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/MigrationClient.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/MigrationClient.java index 76ec143a4c291..d1c53fc3ad96b 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/MigrationClient.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/MigrationClient.java @@ -11,6 +11,10 @@ import org.elasticsearch.action.ActionListener; import org.elasticsearch.client.migration.DeprecationInfoRequest; import org.elasticsearch.client.migration.DeprecationInfoResponse; +import org.elasticsearch.client.migration.GetFeatureUpgradeStatusRequest; +import org.elasticsearch.client.migration.GetFeatureUpgradeStatusResponse; +import org.elasticsearch.client.migration.PostFeatureUpgradeRequest; +import org.elasticsearch.client.migration.PostFeatureUpgradeResponse; import java.io.IOException; import java.util.Collections; @@ -54,4 +58,80 @@ public Cancellable getDeprecationInfoAsync(DeprecationInfoRequest request, Reque return restHighLevelClient.performRequestAsyncAndParseEntity(request, MigrationRequestConverters::getDeprecationInfo, options, DeprecationInfoResponse::fromXContent, listener, Collections.emptySet()); } + + /** + * Get a list of system features that need to be upgraded for the next release + * @param request the request + * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized + * @return the response + * @throws IOException in case there is a problem sending the request or parsing back the response + */ + public GetFeatureUpgradeStatusResponse getFeatureUpgradeStatus( + GetFeatureUpgradeStatusRequest request, RequestOptions options) throws IOException { + return restHighLevelClient.performRequestAndParseEntity( + request, + MigrationRequestConverters::getFeatureUpgradeStatus, + options, + GetFeatureUpgradeStatusResponse::parse, + Collections.emptySet() + ); + } + + /** + * Asynchronously get a list of system features that need to be upgraded for the next release + * @param request the request + * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized + * @param listener the listener to be notified upon request completion + * @return cancellable that may be used to cancel the request + */ + public Cancellable getFeatureUpgradeStatusAsync(GetFeatureUpgradeStatusRequest request, + RequestOptions options, ActionListener listener) { + return restHighLevelClient.performRequestAsyncAndParseEntity( + request, + MigrationRequestConverters::getFeatureUpgradeStatus, + options, + GetFeatureUpgradeStatusResponse::parse, + listener, + Collections.emptySet() + ); + } + + /** + * Trigger a system feature upgrade + * @param request the request + * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized + * @return the response + * @throws IOException in case there is a problem sending the request or parsing back the response + */ + public PostFeatureUpgradeResponse postFeatureUpgrade( + PostFeatureUpgradeRequest request, RequestOptions options) throws IOException { + return restHighLevelClient.performRequestAndParseEntity( + request, + MigrationRequestConverters::postFeatureUpgrade, + options, + PostFeatureUpgradeResponse::parse, + Collections.emptySet() + ); + } + + /** + * Asynchronously trigger a system feature upgrade + * @param request the request + * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized + * @param listener the listener to be notified upon request completion + * @return cancellable that may be used to cancel the request + */ + public Cancellable postFeatureUpgradeAsync( + PostFeatureUpgradeRequest request, RequestOptions options, + ActionListener listener) throws IOException { + return restHighLevelClient.performRequestAsyncAndParseEntity( + request, + MigrationRequestConverters::postFeatureUpgrade, + options, + PostFeatureUpgradeResponse::parse, + listener, + Collections.emptySet() + ); + } + } diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/MigrationRequestConverters.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/MigrationRequestConverters.java index 62897cffa5ce1..41a0c437a121e 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/MigrationRequestConverters.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/MigrationRequestConverters.java @@ -9,7 +9,10 @@ package org.elasticsearch.client; import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; import org.elasticsearch.client.migration.DeprecationInfoRequest; +import org.elasticsearch.client.migration.GetFeatureUpgradeStatusRequest; +import org.elasticsearch.client.migration.PostFeatureUpgradeRequest; final class MigrationRequestConverters { @@ -24,4 +27,30 @@ static Request getDeprecationInfo(DeprecationInfoRequest deprecationInfoRequest) return new Request(HttpGet.METHOD_NAME, endpoint); } + + /** + * Convert a {@link GetFeatureUpgradeStatusRequest} to a {@link Request} + * @param getFeatureUpgradeStatusRequest a request for feature upgrade status + * @return a {@link Request} with the correct path and HTTP request type + */ + static Request getFeatureUpgradeStatus(GetFeatureUpgradeStatusRequest getFeatureUpgradeStatusRequest) { + String endpoint = new RequestConverters.EndpointBuilder() + .addPathPartAsIs("_migration", "system_features") + .build(); + + return new Request(HttpGet.METHOD_NAME, endpoint); + } + + /** + * Convert a {@link PostFeatureUpgradeRequest} to a {@link Request} + * @param postFeatureUpgradeRequest a request for feature upgrade status + * @return a {@link Request} with the correct path and HTTP request type + */ + static Request postFeatureUpgrade(PostFeatureUpgradeRequest postFeatureUpgradeRequest) { + String endpoint = new RequestConverters.EndpointBuilder() + .addPathPartAsIs("_migration", "system_features") + .build(); + + return new Request(HttpPost.METHOD_NAME, endpoint); + } } diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/migration/GetFeatureUpgradeStatusRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/migration/GetFeatureUpgradeStatusRequest.java new file mode 100644 index 0000000000000..5d6c71793484b --- /dev/null +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/migration/GetFeatureUpgradeStatusRequest.java @@ -0,0 +1,18 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.client.migration; + +import org.elasticsearch.client.TimedRequest; + +/** + * A request for information about which system features need to be upgraded. + */ +public class GetFeatureUpgradeStatusRequest extends TimedRequest { + +} diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/migration/GetFeatureUpgradeStatusResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/migration/GetFeatureUpgradeStatusResponse.java new file mode 100644 index 0000000000000..7b70dc41a83f2 --- /dev/null +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/migration/GetFeatureUpgradeStatusResponse.java @@ -0,0 +1,209 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.client.migration; + +import org.elasticsearch.common.xcontent.ConstructingObjectParser; +import org.elasticsearch.common.xcontent.ObjectParser; +import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.common.xcontent.XContentParser; + +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Objects; + +/** + * Information about which system features need to be upgraded before the next + * major version. + */ +public class GetFeatureUpgradeStatusResponse { + + private static final ParseField FEATURE_UPGRADE_STATUSES = new ParseField("features"); + private static final ParseField UPGRADE_STATUS = new ParseField("upgrade_status"); + + private final List featureUpgradeStatuses; + private final String upgradeStatus; + + @SuppressWarnings("unchecked") + private static final ConstructingObjectParser PARSER = new ConstructingObjectParser<>( + "get_feature_upgrade_response", true, (a, ctx) -> new GetFeatureUpgradeStatusResponse( + (List) a[0], (String) a[1]) + ); + + static { + PARSER.declareObjectArray(ConstructingObjectParser.optionalConstructorArg(), + FeatureUpgradeStatus::parse, FEATURE_UPGRADE_STATUSES); + PARSER.declareField(ConstructingObjectParser.constructorArg(), + (p, c) -> p.text(), UPGRADE_STATUS, ObjectParser.ValueType.STRING); + } + + /** + * Constructor for the response object + * @param featureUpgradeStatuses A list of feature, their upgrade statuses, and other relevant information for upgrading + * @param upgradeStatus Does this feature need to be upgraded or not? + */ + public GetFeatureUpgradeStatusResponse(List featureUpgradeStatuses, String upgradeStatus) { + this.featureUpgradeStatuses = Objects.nonNull(featureUpgradeStatuses) ? featureUpgradeStatuses : Collections.emptyList(); + this.upgradeStatus = upgradeStatus; + } + + public static GetFeatureUpgradeStatusResponse parse(XContentParser parser) throws IOException { + return PARSER.apply(parser, null); + } + + public List getFeatureUpgradeStatuses() { + return featureUpgradeStatuses; + } + + public String getUpgradeStatus() { + return upgradeStatus; + } + + /** + * This class represents a particular feature and whether it needs to be upgraded. + */ + public static class FeatureUpgradeStatus { + private final String featureName; + private final String minimumIndexVersion; + private final String upgradeStatus; + private final List indexVersions; + + private static final ParseField FEATURE_NAME = new ParseField("feature_name"); + private static final ParseField MINIMUM_INDEX_VERSION = new ParseField("minimum_index_version"); + private static final ParseField UPGRADE_STATUS = new ParseField("upgrade_status"); + private static final ParseField INDEX_VERSIONS = new ParseField("indices"); + + @SuppressWarnings("unchecked") + private static final ConstructingObjectParser PARSER = new ConstructingObjectParser<>( + "feature_upgrade_status", true, (a, ctx) -> new FeatureUpgradeStatus( + (String) a[0], (String) a[1], (String) a[2], (List) a[3])); + + static { + PARSER.declareField(ConstructingObjectParser.constructorArg(), + (p, c) -> p.text(), FEATURE_NAME, ObjectParser.ValueType.STRING); + PARSER.declareField(ConstructingObjectParser.constructorArg(), + (p, c) -> p.text(), MINIMUM_INDEX_VERSION, ObjectParser.ValueType.STRING); + PARSER.declareField(ConstructingObjectParser.constructorArg(), + (p, c) -> p.text(), UPGRADE_STATUS, ObjectParser.ValueType.STRING); + PARSER.declareObjectArray(ConstructingObjectParser.constructorArg(), IndexVersion::parse, INDEX_VERSIONS); + } + + /** + * A feature upgrade status object + * @param featureName Name of the feature + * @param minimumIndexVersion The earliest version of Elasticsearch used to create one of this feature's system indices + * @param upgradeStatus Whether this feature needs to be upgraded + * @param indexVersions A list of individual indices and which version of Elasticsearch created them + */ + public FeatureUpgradeStatus( + String featureName, + String minimumIndexVersion, + String upgradeStatus, + List indexVersions + ) { + this.featureName = featureName; + this.minimumIndexVersion = minimumIndexVersion; + this.upgradeStatus = upgradeStatus; + this.indexVersions = indexVersions; + } + + public static FeatureUpgradeStatus parse(XContentParser parser, Void ctx) { + return PARSER.apply(parser, null); + } + + public String getFeatureName() { + return featureName; + } + + public String getMinimumIndexVersion() { + return minimumIndexVersion; + } + + public String getUpgradeStatus() { + return upgradeStatus; + } + + public List getIndexVersions() { + return indexVersions; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + FeatureUpgradeStatus that = (FeatureUpgradeStatus) o; + return Objects.equals(featureName, that.featureName) + && Objects.equals(minimumIndexVersion, that.minimumIndexVersion) + && Objects.equals(upgradeStatus, that.upgradeStatus) + && Objects.equals(indexVersions, that.indexVersions); + } + + @Override + public int hashCode() { + return Objects.hash(featureName, minimumIndexVersion, upgradeStatus, indexVersions); + } + } + + /** + * A class representing an index and the version of Elasticsearch that created it. + */ + public static class IndexVersion { + private final String indexName; + private final String version; + + /** + * Constructor + * @param indexName Name of a concrete index + * @param version Version of Elasticsearch used to create the index + */ + public IndexVersion(String indexName, String version) { + this.indexName = indexName; + this.version = version; + } + + private static final ParseField INDEX_NAME = new ParseField("index"); + private static final ParseField VERSION = new ParseField("version"); + + private static final ConstructingObjectParser PARSER = new ConstructingObjectParser<>( + "index_version", true, (a, ctx) -> new IndexVersion((String) a[0], (String) a[1]) + ); + + static { + PARSER.declareField(ConstructingObjectParser.constructorArg(), + (p, c) -> p.text(), INDEX_NAME, ObjectParser.ValueType.STRING); + PARSER.declareField(ConstructingObjectParser.constructorArg(), + (p, c) -> p.text(), VERSION, ObjectParser.ValueType.STRING); + } + + public static IndexVersion parse(XContentParser parser, Void ctx) { + return PARSER.apply(parser, ctx); + } + + public String getIndexName() { + return indexName; + } + + public String getVersion() { + return version; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + IndexVersion that = (IndexVersion) o; + return Objects.equals(indexName, that.indexName) && Objects.equals(version, that.version); + } + + @Override + public int hashCode() { + return Objects.hash(indexName, version); + } + } +} diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/migration/PostFeatureUpgradeRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/migration/PostFeatureUpgradeRequest.java new file mode 100644 index 0000000000000..8e5d962e17e24 --- /dev/null +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/migration/PostFeatureUpgradeRequest.java @@ -0,0 +1,18 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.client.migration; + +import org.elasticsearch.client.TimedRequest; + +/** + * A request to begin a system feature update + */ +public class PostFeatureUpgradeRequest extends TimedRequest { + +} diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/migration/PostFeatureUpgradeResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/migration/PostFeatureUpgradeResponse.java new file mode 100644 index 0000000000000..e1fb953787dfa --- /dev/null +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/migration/PostFeatureUpgradeResponse.java @@ -0,0 +1,162 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.client.migration; + +import org.elasticsearch.ElasticsearchException; +import org.elasticsearch.common.xcontent.ConstructingObjectParser; +import org.elasticsearch.common.xcontent.ObjectParser; +import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.core.Nullable; + +import java.util.Collections; +import java.util.List; +import java.util.Objects; + +/** + * Response to a request to begin a feature update + */ +public class PostFeatureUpgradeResponse { + + private final boolean accepted; + private final List features; + + @Nullable private final String reason; + @Nullable private final ElasticsearchException elasticsearchException; + + private static final ParseField ACCEPTED = new ParseField("accepted"); + private static final ParseField FEATURES = new ParseField("features"); + private static final ParseField REASON = new ParseField("reason"); + private static final ParseField ELASTICSEARCH_EXCEPTION = new ParseField("exception"); + + @SuppressWarnings("unchecked") + private static final ConstructingObjectParser PARSER = new ConstructingObjectParser<>( + "post_feature_upgrade_response", true, (a, ctx) -> new PostFeatureUpgradeResponse( + (Boolean) a[0], + (List) a[1], + (String) a[2], + (ElasticsearchException) a[3] + )); + + static { + PARSER.declareField(ConstructingObjectParser.constructorArg(), + (p, c) -> p.booleanValue(), ACCEPTED, ObjectParser.ValueType.BOOLEAN); + PARSER.declareObjectArray(ConstructingObjectParser.optionalConstructorArg(), + Feature::parse, FEATURES); + PARSER.declareField(ConstructingObjectParser.optionalConstructorArg(), + (p, c) -> p.text(), REASON, ObjectParser.ValueType.STRING); + PARSER.declareObject(ConstructingObjectParser.optionalConstructorArg(), + (p, c) -> ElasticsearchException.fromXContent(p), ELASTICSEARCH_EXCEPTION); + } + + public static PostFeatureUpgradeResponse parse(XContentParser parser) { + return PARSER.apply(parser, null); + } + + /** + * @param accepted Whether the request to begin an upgrade was accepted by the server + * @param features List of features that will be upgraded, empty for rejected requests + * @param reason If the request was rejected, an explanation of why it was rejected, null otherwise. + * @param elasticsearchException If a request was request because of an exception, the exception. Null otherwise. + */ + public PostFeatureUpgradeResponse( + boolean accepted, + List features, + @Nullable String reason, + @Nullable ElasticsearchException elasticsearchException + ) { + this.accepted = accepted; + this.features = Objects.nonNull(features) ? features : Collections.emptyList(); + this.reason = reason; + this.elasticsearchException = elasticsearchException; + } + + public boolean isAccepted() { + return accepted; + } + + public List getFeatures() { + return Objects.isNull(features) ? Collections.emptyList() : features; + } + + @Nullable + public String getReason() { + return reason; + } + + @Nullable + public ElasticsearchException getElasticsearchException() { + return elasticsearchException; + } + + /** + * We disregard exceptions when determining response equality + */ + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + PostFeatureUpgradeResponse that = (PostFeatureUpgradeResponse) o; + return accepted == that.accepted && Objects.equals(features, that.features) && Objects.equals(reason, that.reason); + } + + /** + * We disregard exceptions when calculating hash code + */ + @Override + public int hashCode() { + return Objects.hash(accepted, features, reason); + } + + /** + * A data class representing a feature. + */ + public static class Feature { + private final String featureName; + + private static final ParseField FEATURE_NAME = new ParseField("feature_name"); + + private static final ConstructingObjectParser PARSER = new ConstructingObjectParser<>( + "feature", true, (a, ctx) -> new Feature((String) a[0]) + ); + + static { + PARSER.declareField(ConstructingObjectParser.constructorArg(), + (p, c) -> p.text(), FEATURE_NAME, ObjectParser.ValueType.STRING); + } + + public static Feature parse(XContentParser parser, Void ctx) { + return PARSER.apply(parser, ctx); + } + + /** + * @param featureName Name of the feature being upgraded. + */ + public Feature(String featureName) { + this.featureName = featureName; + } + + public String getFeatureName() { + return featureName; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + Feature feature = (Feature) o; + return Objects.equals(featureName, feature.featureName); + } + + @Override + public int hashCode() { + return Objects.hash(featureName); + } + } +} diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/MigrationIT.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/MigrationIT.java index f6fbdc2c97cfd..219e41ade3980 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/MigrationIT.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/MigrationIT.java @@ -10,12 +10,17 @@ import org.elasticsearch.client.migration.DeprecationInfoRequest; import org.elasticsearch.client.migration.DeprecationInfoResponse; +import org.elasticsearch.client.migration.GetFeatureUpgradeStatusRequest; +import org.elasticsearch.client.migration.GetFeatureUpgradeStatusResponse; +import org.elasticsearch.client.migration.PostFeatureUpgradeRequest; +import org.elasticsearch.client.migration.PostFeatureUpgradeResponse; import org.elasticsearch.common.settings.Settings; import java.io.IOException; import java.util.Collections; import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.nullValue; public class MigrationIT extends ESRestHighLevelClientTestCase { @@ -29,4 +34,28 @@ public void testGetDeprecationInfo() throws IOException { assertThat(response.getNodeSettingsIssues().size(), equalTo(0)); assertThat(response.getMlSettingsIssues().size(), equalTo(0)); } + + public void testGetFeatureUpgradeStatus() throws IOException { + GetFeatureUpgradeStatusRequest request = new GetFeatureUpgradeStatusRequest(); + GetFeatureUpgradeStatusResponse response = highLevelClient().migration().getFeatureUpgradeStatus(request, RequestOptions.DEFAULT); + assertThat(response.getUpgradeStatus(), equalTo("UPGRADE_NEEDED")); + assertThat(response.getFeatureUpgradeStatuses().size(), equalTo(1)); + GetFeatureUpgradeStatusResponse.FeatureUpgradeStatus status = response.getFeatureUpgradeStatuses().get(0); + assertThat(status.getUpgradeStatus(), equalTo("UPGRADE_NEEDED")); + assertThat(status.getMinimumIndexVersion(), equalTo("7.1.1")); + assertThat(status.getFeatureName(), equalTo("security")); + assertThat(status.getIndexVersions().size(), equalTo(1)); + } + + public void testPostFeatureUpgradeStatus() throws IOException { + PostFeatureUpgradeRequest request = new PostFeatureUpgradeRequest(); + PostFeatureUpgradeResponse response = highLevelClient().migration().postFeatureUpgrade(request, RequestOptions.DEFAULT); + // a test like this cannot test actual deprecations + assertThat(response.isAccepted(), equalTo(true)); + assertThat(response.getFeatures().size(), equalTo(1)); + PostFeatureUpgradeResponse.Feature feature = response.getFeatures().get(0); + assertThat(feature.getFeatureName(), equalTo("security")); + assertThat(response.getReason(), nullValue()); + assertThat(response.getElasticsearchException(), nullValue()); + } } diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/migration/GetFeatureUpgradeStatusResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/migration/GetFeatureUpgradeStatusResponseTests.java new file mode 100644 index 0000000000000..9c9c4ef32b514 --- /dev/null +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/migration/GetFeatureUpgradeStatusResponseTests.java @@ -0,0 +1,89 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.client.migration; + +import org.elasticsearch.client.AbstractResponseTestCase; +import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.common.xcontent.XContentType; + +import java.io.IOException; +import java.util.Collections; + +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.hasSize; +import static org.hamcrest.Matchers.notNullValue; + +public class GetFeatureUpgradeStatusResponseTests extends AbstractResponseTestCase< + org.elasticsearch.action.admin.cluster.migration.GetFeatureUpgradeStatusResponse, GetFeatureUpgradeStatusResponse> { + + /** Our constructor should convert nulls to empty lists */ + public void testConstructorHandlesNullLists() { + GetFeatureUpgradeStatusResponse response = new GetFeatureUpgradeStatusResponse(null, "status"); + assertThat(response.getFeatureUpgradeStatuses(), notNullValue()); + assertThat(response.getFeatureUpgradeStatuses(), equalTo(Collections.emptyList())); + + } + + @Override + protected org.elasticsearch.action.admin.cluster.migration.GetFeatureUpgradeStatusResponse createServerTestInstance( + XContentType xContentType) { + return new org.elasticsearch.action.admin.cluster.migration.GetFeatureUpgradeStatusResponse( + randomList(5, + () -> new org.elasticsearch.action.admin.cluster.migration.GetFeatureUpgradeStatusResponse.FeatureUpgradeStatus( + randomAlphaOfLengthBetween(3, 20), + randomAlphaOfLengthBetween(5, 9), + randomAlphaOfLengthBetween(4, 16), + randomList(4, + () -> new org.elasticsearch.action.admin.cluster.migration.GetFeatureUpgradeStatusResponse.IndexVersion( + randomAlphaOfLengthBetween(3, 20), + randomAlphaOfLengthBetween(5, 9))) + )), + randomAlphaOfLength(5) + ); + } + + @Override + protected GetFeatureUpgradeStatusResponse doParseToClientInstance(XContentParser parser) throws IOException { + return GetFeatureUpgradeStatusResponse.parse(parser); + } + + @Override + protected void assertInstances( + org.elasticsearch.action.admin.cluster.migration.GetFeatureUpgradeStatusResponse serverTestInstance, + GetFeatureUpgradeStatusResponse clientInstance) { + + assertThat(clientInstance.getUpgradeStatus(), equalTo(serverTestInstance.getUpgradeStatus())); + + assertNotNull(serverTestInstance.getFeatureUpgradeStatuses()); + assertNotNull(clientInstance.getFeatureUpgradeStatuses()); + + assertThat(clientInstance.getFeatureUpgradeStatuses(), hasSize(serverTestInstance.getFeatureUpgradeStatuses().size())); + + for (int i = 0; i < clientInstance.getFeatureUpgradeStatuses().size(); i++) { + org.elasticsearch.action.admin.cluster.migration.GetFeatureUpgradeStatusResponse.FeatureUpgradeStatus serverTestStatus + = serverTestInstance.getFeatureUpgradeStatuses().get(i); + GetFeatureUpgradeStatusResponse.FeatureUpgradeStatus clientStatus = clientInstance.getFeatureUpgradeStatuses().get(i); + + assertThat(clientStatus.getFeatureName(), equalTo(serverTestStatus.getFeatureName())); + assertThat(clientStatus.getMinimumIndexVersion(), equalTo(serverTestStatus.getMinimumIndexVersion())); + assertThat(clientStatus.getUpgradeStatus(), equalTo(serverTestStatus.getUpgradeStatus())); + + assertThat(clientStatus.getIndexVersions(), hasSize(serverTestStatus.getIndexVersions().size())); + + for (int j = 0; i < clientStatus.getIndexVersions().size(); i++) { + org.elasticsearch.action.admin.cluster.migration.GetFeatureUpgradeStatusResponse.IndexVersion serverIndexVersion + = serverTestStatus.getIndexVersions().get(j); + GetFeatureUpgradeStatusResponse.IndexVersion clientIndexVersion = clientStatus.getIndexVersions().get(j); + + assertThat(clientIndexVersion.getIndexName(), equalTo(serverIndexVersion.getIndexName())); + assertThat(clientIndexVersion.getVersion(), equalTo(serverIndexVersion.getVersion())); + } + } + } +} diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/migration/PostFeatureUpgradeResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/migration/PostFeatureUpgradeResponseTests.java new file mode 100644 index 0000000000000..60a5764f982e3 --- /dev/null +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/migration/PostFeatureUpgradeResponseTests.java @@ -0,0 +1,90 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.client.migration; + +import org.elasticsearch.ElasticsearchException; +import org.elasticsearch.client.AbstractResponseTestCase; +import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.common.xcontent.XContentType; + +import java.io.IOException; +import java.util.Collections; +import java.util.Objects; + +import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.hasSize; +import static org.hamcrest.Matchers.notNullValue; +import static org.hamcrest.Matchers.nullValue; + +public class PostFeatureUpgradeResponseTests extends AbstractResponseTestCase< + org.elasticsearch.action.admin.cluster.migration.PostFeatureUpgradeResponse, PostFeatureUpgradeResponse> { + + /** Our constructor should convert nulls to empty lists */ + public void testConstructorHandlesNullLists() { + PostFeatureUpgradeResponse response = new PostFeatureUpgradeResponse(true, null, null, null); + assertThat(response.getFeatures(), notNullValue()); + assertThat(response.getFeatures(), equalTo(Collections.emptyList())); + } + + @Override + protected org.elasticsearch.action.admin.cluster.migration.PostFeatureUpgradeResponse createServerTestInstance( + XContentType xContentType) { + if (randomBoolean()) { + return new org.elasticsearch.action.admin.cluster.migration.PostFeatureUpgradeResponse( + true, + randomList(5, + () -> new org.elasticsearch.action.admin.cluster.migration.PostFeatureUpgradeResponse.Feature( + randomAlphaOfLengthBetween(5, 15) + )), + null, + null + ); + } else { + return new org.elasticsearch.action.admin.cluster.migration.PostFeatureUpgradeResponse( + false, + Collections.emptyList(), + randomAlphaOfLengthBetween(10, 20), + new ElasticsearchException(randomAlphaOfLengthBetween(10, 20))); + } + } + + @Override + protected PostFeatureUpgradeResponse doParseToClientInstance(XContentParser parser) throws IOException { + return PostFeatureUpgradeResponse.parse(parser); + } + + @Override + protected void assertInstances( + org.elasticsearch.action.admin.cluster.migration.PostFeatureUpgradeResponse serverTestInstance, + PostFeatureUpgradeResponse clientInstance) { + + assertThat(clientInstance.isAccepted(), equalTo(serverTestInstance.isAccepted())); + + assertThat(clientInstance.getFeatures(), hasSize(serverTestInstance.getFeatures().size())); + + for (int i = 0; i < clientInstance.getFeatures().size(); i++) { + org.elasticsearch.action.admin.cluster.migration.PostFeatureUpgradeResponse.Feature serverFeature + = serverTestInstance.getFeatures().get(i); + PostFeatureUpgradeResponse.Feature clientFeature = clientInstance.getFeatures().get(i); + + assertThat(clientFeature.getFeatureName(), equalTo(serverFeature.getFeatureName())); + } + + assertThat(clientInstance.getReason(), equalTo(serverTestInstance.getReason())); + + if (Objects.isNull(serverTestInstance.getElasticsearchException())) { + assertThat(clientInstance.getElasticsearchException(), nullValue()); + } else { + assertThat(clientInstance.getElasticsearchException(), notNullValue()); + assertThat(clientInstance.getElasticsearchException().getMessage(), + containsString(serverTestInstance.getElasticsearchException().getMessage())); + } + } +} diff --git a/docs/reference/migration/apis/feature_upgrade.asciidoc b/docs/reference/migration/apis/feature_upgrade.asciidoc new file mode 100644 index 0000000000000..7c50460e8b27d --- /dev/null +++ b/docs/reference/migration/apis/feature_upgrade.asciidoc @@ -0,0 +1,88 @@ +[role="xpack"] +[testenv="basic"] +[[migration-api-feature-upgrade]] +=== Feature Upgrade APIs +++++ +Feature upgrade APIs +++++ + +IMPORTANT: Use this API to check for system features that need to be upgraded before +a major version upgrade. You should run it on the last minor version of the +major version you are upgrading from. + +The feature upgrade APIs are to be used to retrieve information about system features +that have to be upgraded before a cluster can be migrated to the next major version number, +and to trigger an automated system upgrade that might potentially involve downtime for +{es} system features. + +[[feature-upgrade-api-request]] +==== {api-request-title} + +`GET /migration/system_features` + +[[feature-upgrade-api-prereqs]] +==== {api-prereq-title} + +* If the {es} {security-features} are enabled, you must have the `manage` +<> to use this API. (TODO: true?) + +[[feature-upgrade-api-example]] +==== {api-examples-title} + +To see the list of system features needing upgrades, submit a GET request to the +`_migration/system_features` endpoint: + +[source,console] +-------------------------------------------------- +GET /_migration/system_features +-------------------------------------------------- + +Example response: + +[source,console-result] +-------------------------------------------------- +{ + "features" : [ + { + "feature_name" : "security", + "minimum_index_version" : "7.1.1", + "upgrade_status" : "UPGRADE_NEEDED", + "indices" : [ + { + "index" : ".security-7", + "version" : "7.1.1" + } + ] + } + ], + "upgrade_status" : "UPGRADE_NEEDED" +} +-------------------------------------------------- + +This response tells us that Elasticsearch security needs its internal +indices upgraded before we can upgrade the cluster to 8.0. + +To perform the required upgrade, submit a POST request to the same endpoint. + +[source,console] +-------------------------------------------------- +POST /_migration/system_features +-------------------------------------------------- + +Example response: + +[source,console-result] +-------------------------------------------------- +{ + "accepted" : true, + "features" : [ + { + "feature_name" : "security" + } + ] +} +-------------------------------------------------- + +This tells us that the security index is being upgraded. To check the +overall status of the upgrade, call the endpoint with GET. + diff --git a/docs/reference/migration/migration.asciidoc b/docs/reference/migration/migration.asciidoc index bf46b3b5a5bdf..23385a20dc004 100644 --- a/docs/reference/migration/migration.asciidoc +++ b/docs/reference/migration/migration.asciidoc @@ -8,3 +8,4 @@ The migration APIs simplify upgrading {xpack} indices from one version to anothe * <> include::apis/deprecation.asciidoc[] +include::apis/feature_upgrade.asciidoc[] diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/migration.get_feature_upgrade_status.json b/rest-api-spec/src/main/resources/rest-api-spec/api/migration.get_feature_upgrade_status.json new file mode 100644 index 0000000000000..27e142c6f3462 --- /dev/null +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/migration.get_feature_upgrade_status.json @@ -0,0 +1,24 @@ +{ + "migration.get_feature_upgrade_status":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-feature-upgrade.html", + "description":"Find out whether system features need to be upgraded or not" + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_migration/system_features", + "methods":[ + "GET" + ] + } + ] + }, + "params":{} + } +} diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/migration.post_feature_upgrade.json b/rest-api-spec/src/main/resources/rest-api-spec/api/migration.post_feature_upgrade.json new file mode 100644 index 0000000000000..6bafdfc69fde7 --- /dev/null +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/migration.post_feature_upgrade.json @@ -0,0 +1,24 @@ +{ + "migration.post_feature_upgrade":{ + "documentation":{ + "url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-feature-upgrade.html", + "description":"Begin upgrades for system features" + }, + "stability":"stable", + "visibility":"public", + "headers":{ + "accept": [ "application/json"] + }, + "url":{ + "paths":[ + { + "path":"/_migration/system_features", + "methods":[ + "POST" + ] + } + ] + }, + "params":{} + } +} diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/migration/10_get_feature_upgrade_status.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/migration/10_get_feature_upgrade_status.yml new file mode 100644 index 0000000000000..1fd5bc9c85a24 --- /dev/null +++ b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/migration/10_get_feature_upgrade_status.yml @@ -0,0 +1,11 @@ +"Get feature upgrade status": + + - skip: + version: " - 7.99.99" + reason: "Not yet backported" + + - do: + migration.get_feature_upgrade_status: {} + + - is_true: upgrade_status + - is_true: features diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/migration/20_post_feature_upgrade.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/migration/20_post_feature_upgrade.yml new file mode 100644 index 0000000000000..fd7e157240dda --- /dev/null +++ b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/migration/20_post_feature_upgrade.yml @@ -0,0 +1,11 @@ +"Get feature upgrade status": + + - skip: + version: " - 7.99.99" + reason: "Not yet backported" + + - do: + migration.get_feature_upgrade_status: {} + + - is_false: accepted + - is_true: features diff --git a/server/src/main/java/org/elasticsearch/action/ActionModule.java b/server/src/main/java/org/elasticsearch/action/ActionModule.java index 030ebb0e33967..197f1c567a416 100644 --- a/server/src/main/java/org/elasticsearch/action/ActionModule.java +++ b/server/src/main/java/org/elasticsearch/action/ActionModule.java @@ -18,6 +18,10 @@ import org.elasticsearch.action.admin.cluster.configuration.TransportClearVotingConfigExclusionsAction; import org.elasticsearch.action.admin.cluster.health.ClusterHealthAction; import org.elasticsearch.action.admin.cluster.health.TransportClusterHealthAction; +import org.elasticsearch.action.admin.cluster.migration.GetFeatureUpgradeStatusAction; +import org.elasticsearch.action.admin.cluster.migration.PostFeatureUpgradeAction; +import org.elasticsearch.action.admin.cluster.migration.TransportGetFeatureUpgradeStatusAction; +import org.elasticsearch.action.admin.cluster.migration.TransportPostFeatureUpgradeAction; import org.elasticsearch.action.admin.cluster.node.hotthreads.NodesHotThreadsAction; import org.elasticsearch.action.admin.cluster.node.hotthreads.TransportNodesHotThreadsAction; import org.elasticsearch.action.admin.cluster.node.info.NodesInfoAction; @@ -278,6 +282,7 @@ import org.elasticsearch.rest.action.admin.cluster.RestDeleteRepositoryAction; import org.elasticsearch.rest.action.admin.cluster.RestDeleteSnapshotAction; import org.elasticsearch.rest.action.admin.cluster.RestDeleteStoredScriptAction; +import org.elasticsearch.rest.action.admin.cluster.RestGetFeatureUpgradeStatusAction; import org.elasticsearch.rest.action.admin.cluster.RestGetRepositoriesAction; import org.elasticsearch.rest.action.admin.cluster.RestGetScriptContextAction; import org.elasticsearch.rest.action.admin.cluster.RestGetScriptLanguageAction; @@ -290,6 +295,7 @@ import org.elasticsearch.rest.action.admin.cluster.RestNodesStatsAction; import org.elasticsearch.rest.action.admin.cluster.RestNodesUsageAction; import org.elasticsearch.rest.action.admin.cluster.RestPendingClusterTasksAction; +import org.elasticsearch.rest.action.admin.cluster.RestPostFeatureUpgradeAction; import org.elasticsearch.rest.action.admin.cluster.RestPutRepositoryAction; import org.elasticsearch.rest.action.admin.cluster.RestPutStoredScriptAction; import org.elasticsearch.rest.action.admin.cluster.RestReloadSecureSettingsAction; @@ -526,6 +532,8 @@ public void reg actions.register(SnapshotsStatusAction.INSTANCE, TransportSnapshotsStatusAction.class); actions.register(SnapshottableFeaturesAction.INSTANCE, TransportSnapshottableFeaturesAction.class); actions.register(ResetFeatureStateAction.INSTANCE, TransportResetFeatureStateAction.class); + actions.register(GetFeatureUpgradeStatusAction.INSTANCE, TransportGetFeatureUpgradeStatusAction.class); + actions.register(PostFeatureUpgradeAction.INSTANCE, TransportPostFeatureUpgradeAction.class); actions.register(GetShardSnapshotAction.INSTANCE, TransportGetShardSnapshotAction.class); actions.register(IndicesStatsAction.INSTANCE, TransportIndicesStatsAction.class); @@ -680,6 +688,8 @@ public void initRestHandlers(Supplier nodesInCluster) { registerHandler.accept(new RestSnapshotsStatusAction()); registerHandler.accept(new RestSnapshottableFeaturesAction()); registerHandler.accept(new RestResetFeatureStateAction()); + registerHandler.accept(new RestGetFeatureUpgradeStatusAction()); + registerHandler.accept(new RestPostFeatureUpgradeAction()); registerHandler.accept(new RestGetIndicesAction()); registerHandler.accept(new RestIndicesStatsAction()); registerHandler.accept(new RestIndicesSegmentsAction(threadPool)); diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/migration/GetFeatureUpgradeStatusAction.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/migration/GetFeatureUpgradeStatusAction.java new file mode 100644 index 0000000000000..85c6c9ef9e133 --- /dev/null +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/migration/GetFeatureUpgradeStatusAction.java @@ -0,0 +1,24 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.action.admin.cluster.migration; + +import org.elasticsearch.action.ActionType; + +/** + * Action for getting a feature upgrade status. + */ +public class GetFeatureUpgradeStatusAction extends ActionType { + + public static final GetFeatureUpgradeStatusAction INSTANCE = new GetFeatureUpgradeStatusAction(); + public static final String NAME = "cluster:admin/migration/get_system_feature"; + + private GetFeatureUpgradeStatusAction() { + super(NAME, GetFeatureUpgradeStatusResponse::new); + } +} diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/migration/GetFeatureUpgradeStatusRequest.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/migration/GetFeatureUpgradeStatusRequest.java new file mode 100644 index 0000000000000..e6e7d3f143b31 --- /dev/null +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/migration/GetFeatureUpgradeStatusRequest.java @@ -0,0 +1,34 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.action.admin.cluster.migration; + +import org.elasticsearch.action.ActionRequestValidationException; +import org.elasticsearch.action.support.master.MasterNodeRequest; +import org.elasticsearch.common.io.stream.StreamInput; + +import java.io.IOException; + +/** + * Request for whether system features need to be upgraded + */ +public class GetFeatureUpgradeStatusRequest extends MasterNodeRequest { + + public GetFeatureUpgradeStatusRequest() { + super(); + } + + public GetFeatureUpgradeStatusRequest(StreamInput in) throws IOException { + super(in); + } + + @Override + public ActionRequestValidationException validate() { + return null; + } +} diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/migration/GetFeatureUpgradeStatusResponse.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/migration/GetFeatureUpgradeStatusResponse.java new file mode 100644 index 0000000000000..63e0fd451fad4 --- /dev/null +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/migration/GetFeatureUpgradeStatusResponse.java @@ -0,0 +1,243 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.action.admin.cluster.migration; + +import org.elasticsearch.action.ActionResponse; +import org.elasticsearch.common.io.stream.StreamInput; +import org.elasticsearch.common.io.stream.StreamOutput; +import org.elasticsearch.common.io.stream.Writeable; +import org.elasticsearch.common.xcontent.ToXContentObject; +import org.elasticsearch.common.xcontent.XContentBuilder; + +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Objects; + +/** + * A response showing whether system features need to be upgraded and, feature by feature, which + * indices need to be upgraded. + */ +public class GetFeatureUpgradeStatusResponse extends ActionResponse implements ToXContentObject { + + private final List featureUpgradeStatuses; + private final String upgradeStatus; + + /** + * @param statuses A list of feature statuses + * @param upgradeStatus Whether system features need to be upgraded + */ + public GetFeatureUpgradeStatusResponse(List statuses, String upgradeStatus) { + this.featureUpgradeStatuses = Objects.nonNull(statuses) ? statuses : Collections.emptyList(); + this.upgradeStatus = upgradeStatus; + } + + /** + * @param in A stream input for a serialized response object + * @throws IOException if we can't deserialize the object + */ + public GetFeatureUpgradeStatusResponse(StreamInput in) throws IOException { + super(in); + this.featureUpgradeStatuses = in.readList(FeatureUpgradeStatus::new); + this.upgradeStatus = in.readString(); + } + + @Override + public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { + builder.startObject(); + builder.startArray("features"); + for (FeatureUpgradeStatus featureUpgradeStatus : featureUpgradeStatuses) { + builder.value(featureUpgradeStatus); + } + builder.endArray(); + builder.field("upgrade_status", upgradeStatus); + builder.endObject(); + return builder; + } + + @Override + public void writeTo(StreamOutput out) throws IOException { + out.writeList(this.featureUpgradeStatuses); + out.writeString(upgradeStatus); + } + + public List getFeatureUpgradeStatuses() { + return featureUpgradeStatuses; + } + + public String getUpgradeStatus() { + return upgradeStatus; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + GetFeatureUpgradeStatusResponse that = (GetFeatureUpgradeStatusResponse) o; + return Objects.equals(featureUpgradeStatuses, that.featureUpgradeStatuses) && Objects.equals(upgradeStatus, that.upgradeStatus); + } + + @Override + public int hashCode() { + return Objects.hash(featureUpgradeStatuses, upgradeStatus); + } + + /** + * A class for a particular feature, showing whether it needs to be upgraded and the earliest + * Elasticsearch version used to create one of this feature's system indices. + */ + public static class FeatureUpgradeStatus implements Writeable, ToXContentObject { + private final String featureName; + private final String minimumIndexVersion; + private final String upgradeStatus; + private final List indexVersions; + + /** + * @param featureName Name of the feature + * @param minimumIndexVersion Earliest Elasticsearch version used to create a system index for this feature + * @param upgradeStatus Whether the feature needs to be upgraded + * @param indexVersions A list of this feature's concrete indices and the Elasticsearch version that created them + */ + public FeatureUpgradeStatus(String featureName, String minimumIndexVersion, + String upgradeStatus, List indexVersions) { + this.featureName = featureName; + this.minimumIndexVersion = minimumIndexVersion; + this.upgradeStatus = upgradeStatus; + this.indexVersions = indexVersions; + } + + /** + * @param in A stream input for a serialized feature status object + * @throws IOException if we can't deserialize the object + */ + public FeatureUpgradeStatus(StreamInput in) throws IOException { + this.featureName = in.readString(); + this.minimumIndexVersion = in.readString(); + this.upgradeStatus = in.readString(); + this.indexVersions = in.readList(IndexVersion::new); + } + + public String getFeatureName() { + return this.featureName; + } + + public String getMinimumIndexVersion() { + return this.minimumIndexVersion; + } + + public String getUpgradeStatus() { + return this.upgradeStatus; + } + + public List getIndexVersions() { + return this.indexVersions; + } + + @Override + public void writeTo(StreamOutput out) throws IOException { + out.writeString(this.featureName); + out.writeString(this.minimumIndexVersion); + out.writeString(this.upgradeStatus); + out.writeList(this.indexVersions); + } + + @Override + public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { + builder.startObject(); + builder.field("feature_name", this.featureName); + builder.field("minimum_index_version", this.minimumIndexVersion); + builder.field("upgrade_status", this.upgradeStatus); + builder.startArray("indices"); + for (IndexVersion version : this.indexVersions) { + builder.value(version); + } + builder.endArray(); + builder.endObject(); + return builder; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + FeatureUpgradeStatus that = (FeatureUpgradeStatus) o; + return Objects.equals(featureName, that.featureName) + && Objects.equals(minimumIndexVersion, that.minimumIndexVersion) + && Objects.equals(upgradeStatus, that.upgradeStatus) + && Objects.equals(indexVersions, that.indexVersions); + } + + @Override + public int hashCode() { + return Objects.hash(featureName, minimumIndexVersion, upgradeStatus, indexVersions); + } + } + + /** + * A data class that holds an index name and the version of Elasticsearch with which that index was created + */ + public static class IndexVersion implements Writeable, ToXContentObject { + private final String indexName; + private final String version; + + /** + * @param indexName Name of the index + * @param version Version of Elasticsearch that created the index + */ + public IndexVersion(String indexName, String version) { + this.indexName = indexName; + this.version = version; + } + + /** + * @param in A stream input for a serialized index version object + * @throws IOException if we can't deserialize the object + */ + public IndexVersion(StreamInput in) throws IOException { + this.indexName = in.readString(); + this.version = in.readString(); + } + + public String getIndexName() { + return this.indexName; + } + + public String getVersion() { + return this.version; + } + + @Override + public void writeTo(StreamOutput out) throws IOException { + out.writeString(this.indexName); + out.writeString(this.version); + } + + @Override + public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { + builder.startObject(); + builder.field("index", this.indexName); + builder.field("version", this.version); + builder.endObject(); + return builder; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + IndexVersion that = (IndexVersion) o; + return indexName.equals(that.indexName) && version.equals(that.version); + } + + @Override + public int hashCode() { + return Objects.hash(indexName, version); + } + } +} diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/migration/PostFeatureUpgradeAction.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/migration/PostFeatureUpgradeAction.java new file mode 100644 index 0000000000000..e45fc5fe806c7 --- /dev/null +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/migration/PostFeatureUpgradeAction.java @@ -0,0 +1,24 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.action.admin.cluster.migration; + +import org.elasticsearch.action.ActionType; + +/** + * Action for beginning a system feature upgrade + */ +public class PostFeatureUpgradeAction extends ActionType { + + public static final PostFeatureUpgradeAction INSTANCE = new PostFeatureUpgradeAction(); + public static final String NAME = "cluster:admin/migration/post_system_feature"; + + private PostFeatureUpgradeAction() { + super(NAME, PostFeatureUpgradeResponse::new); + } +} diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/migration/PostFeatureUpgradeRequest.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/migration/PostFeatureUpgradeRequest.java new file mode 100644 index 0000000000000..ccc4a62a1138f --- /dev/null +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/migration/PostFeatureUpgradeRequest.java @@ -0,0 +1,34 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.action.admin.cluster.migration; + +import org.elasticsearch.action.ActionRequestValidationException; +import org.elasticsearch.action.support.master.MasterNodeRequest; +import org.elasticsearch.common.io.stream.StreamInput; + +import java.io.IOException; + +/** + * Request to begin an upgrade of system features + */ +public class PostFeatureUpgradeRequest extends MasterNodeRequest { + + public PostFeatureUpgradeRequest() { + super(); + } + + public PostFeatureUpgradeRequest(StreamInput in) throws IOException { + super(in); + } + + @Override + public ActionRequestValidationException validate() { + return null; + } +} diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/migration/PostFeatureUpgradeResponse.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/migration/PostFeatureUpgradeResponse.java new file mode 100644 index 0000000000000..4b113f14a4999 --- /dev/null +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/migration/PostFeatureUpgradeResponse.java @@ -0,0 +1,200 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.action.admin.cluster.migration; + +import org.elasticsearch.ElasticsearchException; +import org.elasticsearch.action.ActionResponse; +import org.elasticsearch.common.io.stream.StreamInput; +import org.elasticsearch.common.io.stream.StreamOutput; +import org.elasticsearch.common.io.stream.Writeable; +import org.elasticsearch.common.xcontent.ToXContentObject; +import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.core.Nullable; + +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Objects; + +/** + * The response to return to a request for a system feature upgrade + */ +public class PostFeatureUpgradeResponse extends ActionResponse implements ToXContentObject { + + private final boolean accepted; + private final List features; + @Nullable private final String reason; + @Nullable private final ElasticsearchException elasticsearchException; + + /** + * @param accepted Whether the upgrade request is accepted by the server + * @param features A list of the features that will be upgraded + * @param reason If the upgrade is rejected, the reason for rejection. Null otherwise. + * @param exception If the upgrade is rejected because of an exception, the exception. Null otherwise. + */ + public PostFeatureUpgradeResponse(boolean accepted, List features, + @Nullable String reason, @Nullable ElasticsearchException exception) { + this.accepted = accepted; + this.features = Objects.nonNull(features) ? features : Collections.emptyList(); + this.reason = reason; + this.elasticsearchException = exception; + } + + /** + * @param in A stream input for a serialized response object + * @throws IOException if we can't deserialize the object + */ + public PostFeatureUpgradeResponse(StreamInput in) throws IOException { + super(in); + this.accepted = in.readBoolean(); + this.features = in.readList(Feature::new); + this.reason = in.readOptionalString(); + this.elasticsearchException = in.readOptionalWriteable(ElasticsearchException::new); + } + + @Override + public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { + builder.startObject(); + builder.field("accepted", this.accepted); + if (accepted) { + builder.startArray("features"); + for (Feature feature : this.features) { + feature.toXContent(builder, params); + } + builder.endArray(); + } + if (Objects.nonNull(this.reason)) { + builder.field("reason", this.reason); + } + if (Objects.nonNull(this.elasticsearchException)) { + builder.field("exception"); + builder.startObject(); + elasticsearchException.toXContent(builder, params); + builder.endObject(); + } + builder.endObject(); + return builder; + } + + @Override + public void writeTo(StreamOutput out) throws IOException { + out.writeBoolean(this.accepted); + out.writeList(this.features); + out.writeOptionalString(this.reason); + out.writeOptionalWriteable(this.elasticsearchException); + } + + public boolean isAccepted() { + return accepted; + } + + public List getFeatures() { + return Objects.isNull(features) ? Collections.emptyList() : features; + } + + @Nullable + public String getReason() { + return reason; + } + + @Nullable + public ElasticsearchException getElasticsearchException() { + return elasticsearchException; + } + + /** + * We disregard exceptions when determining response equality + */ + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + PostFeatureUpgradeResponse that = (PostFeatureUpgradeResponse) o; + return accepted == that.accepted + && Objects.equals(features, that.features) + && Objects.equals(reason, that.reason); + } + + /** + * We disregard exceptions when calculating hash code + */ + @Override + public int hashCode() { + return Objects.hash(accepted, features, reason); + } + + @Override + public String toString() { + return "PostFeatureUpgradeResponse{" + + "accepted=" + accepted + + ", features=" + features + + ", reason='" + reason + '\'' + + ", elasticsearchException=" + elasticsearchException + + '}'; + } + + /** + * A data class representing a feature that to be upgraded + */ + public static class Feature implements Writeable, ToXContentObject { + private final String featureName; + + /** + * @param featureName Name of the feature + */ + public Feature(String featureName) { + this.featureName = featureName; + } + + /** + * @param in A stream input for a serialized feature object + * @throws IOException if we can't deserialize the object + */ + public Feature(StreamInput in) throws IOException { + this.featureName = in.readString(); + } + + @Override + public void writeTo(StreamOutput out) throws IOException { + out.writeString(featureName); + } + + @Override + public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { + builder.startObject(); + builder.field("feature_name", this.featureName); + builder.endObject(); + return builder; + } + + public String getFeatureName() { + return featureName; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + Feature feature = (Feature) o; + return Objects.equals(featureName, feature.featureName); + } + + @Override + public int hashCode() { + return Objects.hash(featureName); + } + + @Override + public String toString() { + return "Feature{" + + "featureName='" + featureName + '\'' + + '}'; + } + } +} diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/migration/TransportGetFeatureUpgradeStatusAction.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/migration/TransportGetFeatureUpgradeStatusAction.java new file mode 100644 index 0000000000000..77261d9463304 --- /dev/null +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/migration/TransportGetFeatureUpgradeStatusAction.java @@ -0,0 +1,79 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.action.admin.cluster.migration; + +import org.elasticsearch.action.ActionListener; +import org.elasticsearch.action.support.ActionFilters; +import org.elasticsearch.action.support.master.TransportMasterNodeAction; +import org.elasticsearch.cluster.ClusterState; +import org.elasticsearch.cluster.block.ClusterBlockException; +import org.elasticsearch.cluster.block.ClusterBlockLevel; +import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; +import org.elasticsearch.cluster.service.ClusterService; +import org.elasticsearch.common.inject.Inject; +import org.elasticsearch.indices.SystemIndices; +import org.elasticsearch.tasks.Task; +import org.elasticsearch.threadpool.ThreadPool; +import org.elasticsearch.transport.TransportService; + +import java.util.ArrayList; +import java.util.List; + +/** + * Transport class for the get feature upgrade status action + */ +public class TransportGetFeatureUpgradeStatusAction extends TransportMasterNodeAction< + GetFeatureUpgradeStatusRequest, + GetFeatureUpgradeStatusResponse> { + + private final SystemIndices systemIndices; + + @Inject + public TransportGetFeatureUpgradeStatusAction( + TransportService transportService, + ThreadPool threadPool, + ActionFilters actionFilters, + ClusterService clusterService, + IndexNameExpressionResolver indexNameExpressionResolver, + SystemIndices systemIndices + ) { + super( + GetFeatureUpgradeStatusAction.NAME, + transportService, + clusterService, + threadPool, + actionFilters, + GetFeatureUpgradeStatusRequest::new, + indexNameExpressionResolver, + GetFeatureUpgradeStatusResponse::new, + ThreadPool.Names.SAME + ); + this.systemIndices = systemIndices; + } + + @Override + protected void masterOperation(Task task, GetFeatureUpgradeStatusRequest request, ClusterState state, + ActionListener listener) throws Exception { + List indexVersions = new ArrayList<>(); + indexVersions.add(new GetFeatureUpgradeStatusResponse.IndexVersion(".security-7", "7.1.1")); + List features = new ArrayList<>(); + features.add(new GetFeatureUpgradeStatusResponse.FeatureUpgradeStatus( + "security", + "7.1.1", + "UPGRADE_NEEDED", + indexVersions + )); + listener.onResponse(new GetFeatureUpgradeStatusResponse(features, "UPGRADE_NEEDED")); + } + + @Override + protected ClusterBlockException checkBlock(GetFeatureUpgradeStatusRequest request, ClusterState state) { + return state.blocks().globalBlockedException(ClusterBlockLevel.METADATA_READ); + } +} diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/migration/TransportPostFeatureUpgradeAction.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/migration/TransportPostFeatureUpgradeAction.java new file mode 100644 index 0000000000000..3ede3d4c4b463 --- /dev/null +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/migration/TransportPostFeatureUpgradeAction.java @@ -0,0 +1,74 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.action.admin.cluster.migration; + +import org.elasticsearch.action.ActionListener; +import org.elasticsearch.action.support.ActionFilters; +import org.elasticsearch.action.support.master.TransportMasterNodeAction; +import org.elasticsearch.cluster.ClusterState; +import org.elasticsearch.cluster.block.ClusterBlockException; +import org.elasticsearch.cluster.block.ClusterBlockLevel; +import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; +import org.elasticsearch.cluster.service.ClusterService; +import org.elasticsearch.common.inject.Inject; +import org.elasticsearch.indices.SystemIndices; +import org.elasticsearch.tasks.Task; +import org.elasticsearch.threadpool.ThreadPool; +import org.elasticsearch.transport.TransportService; + +import java.util.ArrayList; +import java.util.List; + +/** + * Transport action for post feature upgrade action + */ +public class TransportPostFeatureUpgradeAction extends TransportMasterNodeAction< + PostFeatureUpgradeRequest, + PostFeatureUpgradeResponse> { + + private final SystemIndices systemIndices; + + @Inject + public TransportPostFeatureUpgradeAction( + TransportService transportService, + ThreadPool threadPool, + ActionFilters actionFilters, + ClusterService clusterService, + IndexNameExpressionResolver indexNameExpressionResolver, + SystemIndices systemIndices + ) { + super( + PostFeatureUpgradeAction.NAME, + transportService, + clusterService, + threadPool, + actionFilters, + PostFeatureUpgradeRequest::new, + indexNameExpressionResolver, + PostFeatureUpgradeResponse::new, + ThreadPool.Names.SAME + ); + this.systemIndices = systemIndices; + } + + @Override + protected void masterOperation(Task task, PostFeatureUpgradeRequest request, ClusterState state, + ActionListener listener) throws Exception { + List features = new ArrayList<>(); + features.add(new PostFeatureUpgradeResponse.Feature("security")); + listener.onResponse(new PostFeatureUpgradeResponse( + // TODO: implement operation for this action + true, features, null, null)); + } + + @Override + protected ClusterBlockException checkBlock(PostFeatureUpgradeRequest request, ClusterState state) { + return state.blocks().globalBlockedException(ClusterBlockLevel.METADATA_READ); + } +} diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestGetFeatureUpgradeStatusAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestGetFeatureUpgradeStatusAction.java new file mode 100644 index 0000000000000..1c3152003c116 --- /dev/null +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestGetFeatureUpgradeStatusAction.java @@ -0,0 +1,50 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.rest.action.admin.cluster; + +import org.elasticsearch.action.admin.cluster.migration.GetFeatureUpgradeStatusAction; +import org.elasticsearch.action.admin.cluster.migration.GetFeatureUpgradeStatusRequest; +import org.elasticsearch.client.node.NodeClient; +import org.elasticsearch.rest.BaseRestHandler; +import org.elasticsearch.rest.RestRequest; +import org.elasticsearch.rest.action.RestToXContentListener; + +import java.io.IOException; +import java.util.List; + +/** + * Endpoint for getting the system feature upgrade status + */ +public class RestGetFeatureUpgradeStatusAction extends BaseRestHandler { + @Override + public String getName() { + return "get_feature_upgrade_status"; + } + + @Override + public List routes() { + return List.of(new Route(RestRequest.Method.GET, "/_migration/system_features")); + } + + @Override + public boolean allowSystemIndexAccessByDefault() { + return true; + } + + @Override + protected RestChannelConsumer prepareRequest(RestRequest request, NodeClient client) throws IOException { + + final GetFeatureUpgradeStatusRequest req = new GetFeatureUpgradeStatusRequest(); + req.masterNodeTimeout(request.paramAsTime("master_timeout", req.masterNodeTimeout())); + + return restChannel -> { + client.execute(GetFeatureUpgradeStatusAction.INSTANCE, req, new RestToXContentListener<>(restChannel)); + }; + } +} diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestPostFeatureUpgradeAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestPostFeatureUpgradeAction.java new file mode 100644 index 0000000000000..7fde4c0ca170c --- /dev/null +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestPostFeatureUpgradeAction.java @@ -0,0 +1,50 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.rest.action.admin.cluster; + +import org.elasticsearch.action.admin.cluster.migration.PostFeatureUpgradeAction; +import org.elasticsearch.action.admin.cluster.migration.PostFeatureUpgradeRequest; +import org.elasticsearch.client.node.NodeClient; +import org.elasticsearch.rest.BaseRestHandler; +import org.elasticsearch.rest.RestRequest; +import org.elasticsearch.rest.action.RestToXContentListener; + +import java.io.IOException; +import java.util.List; + +/** + * Endpoint for triggering a system feature upgrade + */ +public class RestPostFeatureUpgradeAction extends BaseRestHandler { + @Override + public String getName() { + return "post_feature_upgrade"; + } + + @Override + public List routes() { + return List.of(new Route(RestRequest.Method.POST, "/_migration/system_features")); + } + + @Override + public boolean allowSystemIndexAccessByDefault() { + return true; + } + + @Override + protected RestChannelConsumer prepareRequest(RestRequest request, NodeClient client) throws IOException { + + final PostFeatureUpgradeRequest req = new PostFeatureUpgradeRequest(); + req.masterNodeTimeout(request.paramAsTime("master_timeout", req.masterNodeTimeout())); + + return restChannel -> { + client.execute(PostFeatureUpgradeAction.INSTANCE, req, new RestToXContentListener<>(restChannel)); + }; + } +} diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/migration/GetFeatureUpgradeStatusResponseTests.java b/server/src/test/java/org/elasticsearch/action/admin/cluster/migration/GetFeatureUpgradeStatusResponseTests.java new file mode 100644 index 0000000000000..58483df600b72 --- /dev/null +++ b/server/src/test/java/org/elasticsearch/action/admin/cluster/migration/GetFeatureUpgradeStatusResponseTests.java @@ -0,0 +1,70 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.action.admin.cluster.migration; + +import org.elasticsearch.common.io.stream.Writeable; +import org.elasticsearch.test.AbstractWireSerializingTestCase; + +import java.io.IOException; +import java.util.Collections; + +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.notNullValue; + +/** + * Tests for the Get Feature Upgrade Status response object. + */ +public class GetFeatureUpgradeStatusResponseTests extends AbstractWireSerializingTestCase { + + @Override + protected Writeable.Reader instanceReader() { + return GetFeatureUpgradeStatusResponse::new; + } + + @Override + protected GetFeatureUpgradeStatusResponse createTestInstance() { + return new GetFeatureUpgradeStatusResponse( + randomList(8, GetFeatureUpgradeStatusResponseTests::createFeatureStatus), + randomAlphaOfLengthBetween(4, 16) + ); + } + + @Override + protected GetFeatureUpgradeStatusResponse mutateInstance(GetFeatureUpgradeStatusResponse instance) throws IOException { + return new GetFeatureUpgradeStatusResponse( + randomList(8, + () -> randomValueOtherThanMany(instance.getFeatureUpgradeStatuses()::contains, + GetFeatureUpgradeStatusResponseTests::createFeatureStatus)), + randomValueOtherThan(instance.getUpgradeStatus(), () -> randomAlphaOfLengthBetween(4, 16)) + ); + } + + /** If constructor is called with null for a list, we just use an empty list */ + public void testConstructorHandlesNullLists() { + GetFeatureUpgradeStatusResponse response = new GetFeatureUpgradeStatusResponse(null, "status"); + assertThat(response.getFeatureUpgradeStatuses(), notNullValue()); + assertThat(response.getFeatureUpgradeStatuses(), equalTo(Collections.emptyList())); + } + + private static GetFeatureUpgradeStatusResponse.FeatureUpgradeStatus createFeatureStatus() { + return new GetFeatureUpgradeStatusResponse.FeatureUpgradeStatus( + randomAlphaOfLengthBetween(3, 20), + randomAlphaOfLengthBetween(5, 9), + randomAlphaOfLengthBetween(4, 16), + randomList(4, GetFeatureUpgradeStatusResponseTests::getIndexVersion) + ); + } + + private static GetFeatureUpgradeStatusResponse.IndexVersion getIndexVersion() { + return new GetFeatureUpgradeStatusResponse.IndexVersion( + randomAlphaOfLengthBetween(3, 20), + randomAlphaOfLengthBetween(5, 9) + ); + } +} diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/migration/PostFeatureUpgradeResponseTests.java b/server/src/test/java/org/elasticsearch/action/admin/cluster/migration/PostFeatureUpgradeResponseTests.java new file mode 100644 index 0000000000000..b71b50100ae35 --- /dev/null +++ b/server/src/test/java/org/elasticsearch/action/admin/cluster/migration/PostFeatureUpgradeResponseTests.java @@ -0,0 +1,73 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.action.admin.cluster.migration; + +import org.elasticsearch.ElasticsearchException; +import org.elasticsearch.common.io.stream.Writeable; +import org.elasticsearch.test.AbstractWireSerializingTestCase; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; + +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.notNullValue; + +/** + * Tests for the Post Feature Upgrade response object. + */ +public class PostFeatureUpgradeResponseTests extends AbstractWireSerializingTestCase { + + @Override + protected Writeable.Reader instanceReader() { + return PostFeatureUpgradeResponse::new; + } + + @Override + protected PostFeatureUpgradeResponse createTestInstance() { + if (randomBoolean()) { + return new PostFeatureUpgradeResponse( + true, + randomList(9, PostFeatureUpgradeResponseTests::createFeature), + null, + null); + } + return new PostFeatureUpgradeResponse(false, + new ArrayList<>(), + randomAlphaOfLengthBetween(10, 30), + new ElasticsearchException(randomAlphaOfLengthBetween(10, 30))); + } + + @Override + protected PostFeatureUpgradeResponse mutateInstance(PostFeatureUpgradeResponse instance) throws IOException { + if (instance.isAccepted()) { + return new PostFeatureUpgradeResponse( + true, + randomList(1, 9, () -> + randomValueOtherThanMany(instance.getFeatures()::contains, PostFeatureUpgradeResponseTests::createFeature)), + null, + null); + } + return new PostFeatureUpgradeResponse(false, + new ArrayList<>(), + randomValueOtherThan(instance.getReason(), () -> randomAlphaOfLengthBetween(10, 30)), + instance.getElasticsearchException()); + } + + /** If constructor is called with null for a list, we just use an empty list */ + public void testConstructorHandlesNullLists() { + PostFeatureUpgradeResponse response = new PostFeatureUpgradeResponse(true, null, null, null); + assertThat(response.getFeatures(), notNullValue()); + assertThat(response.getFeatures(), equalTo(Collections.emptyList())); + } + + private static PostFeatureUpgradeResponse.Feature createFeature() { + return new PostFeatureUpgradeResponse.Feature(randomAlphaOfLengthBetween(4, 12)); + } +} diff --git a/x-pack/plugin/security/qa/operator-privileges-tests/src/javaRestTest/java/org/elasticsearch/xpack/security/operator/Constants.java b/x-pack/plugin/security/qa/operator-privileges-tests/src/javaRestTest/java/org/elasticsearch/xpack/security/operator/Constants.java index 3e24c561b5046..1d854704df4d8 100644 --- a/x-pack/plugin/security/qa/operator-privileges-tests/src/javaRestTest/java/org/elasticsearch/xpack/security/operator/Constants.java +++ b/x-pack/plugin/security/qa/operator-privileges-tests/src/javaRestTest/java/org/elasticsearch/xpack/security/operator/Constants.java @@ -45,6 +45,8 @@ public class Constants { "cluster:admin/logstash/pipeline/get", "cluster:admin/logstash/pipeline/put", "cluster:admin/migrate_to_data_tiers", + "cluster:admin/migration/get_system_feature", + "cluster:admin/migration/post_system_feature", "cluster:admin/nodes/reload_secure_settings", "cluster:admin/persistent/completion", "cluster:admin/persistent/remove", From 2e60f3c3620245e29d1a252157325b158b0df238 Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Wed, 29 Sep 2021 13:52:39 -0700 Subject: [PATCH 071/250] Revert "Removed multiple paths from MetadataStateFormat (#72821)" (#78475) This reverts commit 76e515a279f3a332e276abe85030a318ac07c795. relates #71205 --- .../gateway/MetadataStateFormat.java | 157 +++++++++------ .../gateway/MetadataStateFormatTests.java | 188 +++++++++++------- .../index/shard/IndexShardTests.java | 8 +- 3 files changed, 219 insertions(+), 134 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/gateway/MetadataStateFormat.java b/server/src/main/java/org/elasticsearch/gateway/MetadataStateFormat.java index 34d48db543d46..cc37538eaf5d4 100644 --- a/server/src/main/java/org/elasticsearch/gateway/MetadataStateFormat.java +++ b/server/src/main/java/org/elasticsearch/gateway/MetadataStateFormat.java @@ -19,8 +19,8 @@ import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.IndexOutput; import org.apache.lucene.store.NIOFSDirectory; -import org.elasticsearch.ElasticsearchException; import org.elasticsearch.core.Tuple; +import org.elasticsearch.ExceptionsHelper; import org.elasticsearch.common.lucene.store.IndexOutputOutputStream; import org.elasticsearch.common.lucene.store.InputStreamIndexInput; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; @@ -39,10 +39,12 @@ import java.nio.file.NoSuchFileException; import java.nio.file.Path; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; +import java.util.stream.Collectors; /** * MetadataStateFormat is a base class to write checksummed @@ -169,10 +171,10 @@ private static void performStateDirectoriesFsync(List> st /** * Writes the given state to the given directories and performs cleanup of old state files if the write succeeds or * newly created state file if write fails. - * See also {@link #write(Object, Path)} and {@link #cleanupOldFiles(long, Path)}. + * See also {@link #write(Object, Path...)} and {@link #cleanupOldFiles(long, Path[])}. */ - public final long writeAndCleanup(final T state, final Path location) throws WriteStateException { - return write(state, true, location); + public final long writeAndCleanup(final T state, final Path... locations) throws WriteStateException { + return write(state, true, locations); } /** @@ -187,26 +189,29 @@ public final long writeAndCleanup(final T state, final Path location) throws Wri * If this method fails with an exception, it performs cleanup of newly created state file. * But if this method succeeds, it does not perform cleanup of old state files. * If this write succeeds, but some further write fails, you may want to rollback the transaction and keep old file around. - * After transaction is finished use {@link #cleanupOldFiles(long, Path)} for the clean-up. - * If this write is not a part of bigger transaction, consider using {@link #writeAndCleanup(Object, Path)} method instead. + * After transaction is finished use {@link #cleanupOldFiles(long, Path[])} for the clean-up. + * If this write is not a part of bigger transaction, consider using {@link #writeAndCleanup(Object, Path...)} method instead. * * @param state the state object to write - * @param location the data dir the state should be written into + * @param locations the locations where the state should be written to. * @throws WriteStateException if some exception during writing state occurs. See also {@link WriteStateException#isDirty()}. * @return generation of newly written state. */ - public final long write(final T state, final Path location) throws WriteStateException { - return write(state, false, location); + public final long write(final T state, final Path... locations) throws WriteStateException { + return write(state, false, locations); } - private long write(final T state, boolean cleanup, final Path location) throws WriteStateException { - if (location == null) { + private long write(final T state, boolean cleanup, final Path... locations) throws WriteStateException { + if (locations == null) { throw new IllegalArgumentException("Locations must not be null"); } + if (locations.length <= 0) { + throw new IllegalArgumentException("One or more locations required"); + } final long oldGenerationId, newGenerationId; try { - oldGenerationId = findMaxGenerationId(prefix, location); + oldGenerationId = findMaxGenerationId(prefix, locations); newGenerationId = oldGenerationId + 1; } catch (Exception e) { throw new WriteStateException(false, "exception during looking up new generation id", e); @@ -218,11 +223,13 @@ private long write(final T state, boolean cleanup, final Path location) throws W List> directories = new ArrayList<>(); try { - Path stateLocation = location.resolve(STATE_DIR_NAME); - try { - directories.add(new Tuple<>(location, newDirectory(stateLocation))); - } catch (IOException e) { - throw new WriteStateException(false, "failed to open state directory " + stateLocation, e); + for (Path location : locations) { + Path stateLocation = location.resolve(STATE_DIR_NAME); + try { + directories.add(new Tuple<>(location, newDirectory(stateLocation))); + } catch (IOException e) { + throw new WriteStateException(false, "failed to open state directory " + stateLocation, e); + } } writeStateToFirstLocation(state, directories.get(0).v1(), directories.get(0).v2(), tmpFileName); @@ -231,7 +238,7 @@ private long write(final T state, boolean cleanup, final Path location) throws W performStateDirectoriesFsync(directories); } catch (WriteStateException e) { if (cleanup) { - cleanupOldFiles(oldGenerationId, location); + cleanupOldFiles(oldGenerationId, locations); } throw e; } finally { @@ -242,7 +249,7 @@ private long write(final T state, boolean cleanup, final Path location) throws W } if (cleanup) { - cleanupOldFiles(newGenerationId, location); + cleanupOldFiles(newGenerationId, locations); } return newGenerationId; @@ -309,20 +316,22 @@ protected Directory newDirectory(Path dir) throws IOException { * Clean ups all state files not matching passed generation. * * @param currentGeneration state generation to keep. - * @param location data dir. + * @param locations state paths. */ - public void cleanupOldFiles(final long currentGeneration, Path location) { + public void cleanupOldFiles(final long currentGeneration, Path... locations) { final String fileNameToKeep = getStateFileName(currentGeneration); - logger.trace("cleanupOldFiles: cleaning up {}", location); - Path stateLocation = location.resolve(STATE_DIR_NAME); - try (Directory stateDir = newDirectory(stateLocation)) { - for (String file : stateDir.listAll()) { - if (file.startsWith(prefix) && file.equals(fileNameToKeep) == false) { - deleteFileIgnoreExceptions(stateLocation, stateDir, file); + for (Path location : locations) { + logger.trace("cleanupOldFiles: cleaning up {}", location); + Path stateLocation = location.resolve(STATE_DIR_NAME); + try (Directory stateDir = newDirectory(stateLocation)) { + for (String file : stateDir.listAll()) { + if (file.startsWith(prefix) && file.equals(fileNameToKeep) == false) { + deleteFileIgnoreExceptions(stateLocation, stateDir, file); + } } + } catch (Exception e) { + logger.trace("clean up failed for state location {}", stateLocation); } - } catch (Exception e) { - logger.trace("clean up failed for state location {}", stateLocation); } } @@ -330,20 +339,22 @@ public void cleanupOldFiles(final long currentGeneration, Path location) { * Finds state file with maximum id. * * @param prefix - filename prefix - * @param dataLocation - path to directory with state folder + * @param locations - paths to directories with state folder * @return maximum id of state file or -1 if no such files are found * @throws IOException if IOException occurs */ - private long findMaxGenerationId(final String prefix, Path dataLocation) throws IOException { + private long findMaxGenerationId(final String prefix, Path... locations) throws IOException { long maxId = -1; - final Path resolve = dataLocation.resolve(STATE_DIR_NAME); - if (Files.exists(resolve)) { - try (DirectoryStream stream = Files.newDirectoryStream(resolve, prefix + "*")) { - for (Path stateFile : stream) { - final Matcher matcher = stateFilePattern.matcher(stateFile.getFileName().toString()); - if (matcher.matches()) { - final long id = Long.parseLong(matcher.group(1)); - maxId = Math.max(maxId, id); + for (Path dataLocation : locations) { + final Path resolve = dataLocation.resolve(STATE_DIR_NAME); + if (Files.exists(resolve)) { + try (DirectoryStream stream = Files.newDirectoryStream(resolve, prefix + "*")) { + for (Path stateFile : stream) { + final Matcher matcher = stateFilePattern.matcher(stateFile.getFileName().toString()); + if (matcher.matches()) { + final long id = Long.parseLong(matcher.group(1)); + maxId = Math.max(maxId, id); + } } } } @@ -351,19 +362,22 @@ private long findMaxGenerationId(final String prefix, Path dataLocation) throws return maxId; } - private Path findStateFilesByGeneration(final long generation, Path dataLocation) { + private List findStateFilesByGeneration(final long generation, Path... locations) { + List files = new ArrayList<>(); if (generation == -1) { - return null; + return files; } final String fileName = getStateFileName(generation); - final Path stateFilePath = dataLocation.resolve(STATE_DIR_NAME).resolve(fileName); - if (Files.exists(stateFilePath)) { - logger.trace("found state file: {}", stateFilePath); - return stateFilePath; + for (Path dataLocation : locations) { + final Path stateFilePath = dataLocation.resolve(STATE_DIR_NAME).resolve(fileName); + if (Files.exists(stateFilePath)) { + logger.trace("found state file: {}", stateFilePath); + files.add(stateFilePath); + } } - return null; + return files; } public String getStateFileName(long generation) { @@ -376,22 +390,31 @@ public String getStateFileName(long generation) { * * @param logger a logger instance. * @param generation the generation to be loaded. - * @param dataLocation the data dir to read from + * @param dataLocations the data-locations to try. * @return the state of asked generation or null if no state was found. */ - public T loadGeneration(Logger logger, NamedXContentRegistry namedXContentRegistry, long generation, Path dataLocation) { - Path stateFile = findStateFilesByGeneration(generation, dataLocation); + public T loadGeneration(Logger logger, NamedXContentRegistry namedXContentRegistry, long generation, Path... dataLocations) { + List stateFiles = findStateFilesByGeneration(generation, dataLocations); - if (stateFile != null) { + final List exceptions = new ArrayList<>(); + for (Path stateFile : stateFiles) { try { T state = read(namedXContentRegistry, stateFile); logger.trace("generation id [{}] read from [{}]", generation, stateFile.getFileName()); return state; } catch (Exception e) { - logger.debug(() -> new ParameterizedMessage("{}: failed to read [{}], ignoring...", stateFile, prefix), e); - throw new ElasticsearchException("failed to read " + stateFile, e); + exceptions.add(new IOException("failed to read " + stateFile, e)); + logger.debug(() -> new ParameterizedMessage( + "{}: failed to read [{}], ignoring...", stateFile, prefix), e); } } + // if we reach this something went wrong + ExceptionsHelper.maybeThrowRuntimeAndSuppress(exceptions); + if (stateFiles.size() > 0) { + // We have some state files but none of them gave us a usable state + throw new IllegalStateException("Could not find a state file to recover from among " + + stateFiles.stream().map(Object::toString).collect(Collectors.joining(", "))); + } return null; } @@ -399,17 +422,20 @@ public T loadGeneration(Logger logger, NamedXContentRegistry namedXContentRegist * Tries to load the latest state from the given data-locations. * * @param logger a logger instance. - * @param dataLocation the data dir to read from + * @param dataLocations the data-locations to try. * @return tuple of the latest state and generation. (null, -1) if no state is found. */ - public Tuple loadLatestStateWithGeneration(Logger logger, NamedXContentRegistry namedXContentRegistry, Path dataLocation) + public Tuple loadLatestStateWithGeneration(Logger logger, NamedXContentRegistry namedXContentRegistry, Path... dataLocations) throws IOException { - long generation = findMaxGenerationId(prefix, dataLocation); - T state = loadGeneration(logger, namedXContentRegistry, generation, dataLocation); + long generation = findMaxGenerationId(prefix, dataLocations); + T state = loadGeneration(logger, namedXContentRegistry, generation, dataLocations); if (generation > -1 && state == null) { throw new IllegalStateException("unable to find state files with generation id " + generation + - " returned by findMaxGenerationId function, in data folder [" + dataLocation + "], concurrent writes?"); + " returned by findMaxGenerationId function, in data folders [" + + Arrays.stream(dataLocations). + map(Object::toString).collect(Collectors.joining(", ")) + + "], concurrent writes?"); } return Tuple.tuple(state, generation); } @@ -418,19 +444,24 @@ public Tuple loadLatestStateWithGeneration(Logger logger, NamedXContent * Tries to load the latest state from the given data-locations. * * @param logger a logger instance. - * @param dataLocation the data dir to read from + * @param dataLocations the data-locations to try. * @return the latest state or null if no state was found. */ - public T loadLatestState(Logger logger, NamedXContentRegistry namedXContentRegistry, Path dataLocation) throws IOException { - return loadLatestStateWithGeneration(logger, namedXContentRegistry, dataLocation).v1(); + public T loadLatestState(Logger logger, NamedXContentRegistry namedXContentRegistry, Path... dataLocations) throws + IOException { + return loadLatestStateWithGeneration(logger, namedXContentRegistry, dataLocations).v1(); } /** * Deletes all meta state directories recursively for the given data locations - * @param dataLocation the data dir to delete state from + * @param dataLocations the data location to delete */ - public static void deleteMetaState(Path dataLocation) throws IOException { - IOUtils.rm(dataLocation.resolve(STATE_DIR_NAME)); + public static void deleteMetaState(Path... dataLocations) throws IOException { + Path[] stateDirectories = new Path[dataLocations.length]; + for (int i = 0; i < dataLocations.length; i++) { + stateDirectories[i] = dataLocations[i].resolve(STATE_DIR_NAME); + } + IOUtils.rm(stateDirectories); } public String getPrefix() { diff --git a/server/src/test/java/org/elasticsearch/gateway/MetadataStateFormatTests.java b/server/src/test/java/org/elasticsearch/gateway/MetadataStateFormatTests.java index 791ffda50cb63..f28c53f1b9a6d 100644 --- a/server/src/test/java/org/elasticsearch/gateway/MetadataStateFormatTests.java +++ b/server/src/test/java/org/elasticsearch/gateway/MetadataStateFormatTests.java @@ -14,6 +14,7 @@ import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.MockDirectoryWrapper; +import org.apache.lucene.store.NIOFSDirectory; import org.apache.lucene.util.LuceneTestCase; import org.elasticsearch.cluster.ClusterModule; import org.elasticsearch.cluster.metadata.Metadata; @@ -79,14 +80,17 @@ public Metadata fromXContent(XContentParser parser) throws IOException { } public void testReadWriteState() throws IOException { - final Path dir = createTempDir(); - final long id = addDummyFiles("foo-", dir); + Path[] dirs = new Path[randomIntBetween(1, 5)]; + for (int i = 0; i < dirs.length; i++) { + dirs[i] = createTempDir(); + } + final long id = addDummyFiles("foo-", dirs); Format format = new Format("foo-"); DummyState state = new DummyState(randomRealisticUnicodeOfCodepointLengthBetween(1, 1000), randomInt(), randomLong(), randomDouble(), randomBoolean()); - format.writeAndCleanup(state, dir); - { - Path[] list = content("*", dir); + format.writeAndCleanup(state, dirs); + for (Path file : dirs) { + Path[] list = content("*", file); assertEquals(list.length, 1); assertThat(list[0].getFileName().toString(), equalTo(MetadataStateFormat.STATE_DIR_NAME)); Path stateDir = list[0]; @@ -97,68 +101,79 @@ public void testReadWriteState() throws IOException { DummyState read = format.read(NamedXContentRegistry.EMPTY, list[0]); assertThat(read, equalTo(state)); } - DummyState state2 = new DummyState(randomRealisticUnicodeOfCodepointLengthBetween(1, 1000), randomInt(), randomLong(), - randomDouble(), randomBoolean()); - format.writeAndCleanup(state2, dir); + DummyState state2 = new DummyState(randomRealisticUnicodeOfCodepointLengthBetween(1, 1000), randomInt(), randomLong(), + randomDouble(), randomBoolean()); + format.writeAndCleanup(state2, dirs); - { - Path[] list = content("*", dir); + for (Path file : dirs) { + Path[] list = content("*", file); assertEquals(list.length, 1); assertThat(list[0].getFileName().toString(), equalTo(MetadataStateFormat.STATE_DIR_NAME)); Path stateDir = list[0]; assertThat(Files.isDirectory(stateDir), is(true)); list = content("foo-*", stateDir); - assertEquals(list.length, 1); - assertThat(list[0].getFileName().toString(), equalTo("foo-" + (id + 1) + ".st")); + assertEquals(list.length,1); + assertThat(list[0].getFileName().toString(), equalTo("foo-"+ (id+1) + ".st")); DummyState read = format.read(NamedXContentRegistry.EMPTY, list[0]); assertThat(read, equalTo(state2)); + } } public void testVersionMismatch() throws IOException { - final Path dir = createTempDir(); - final long id = addDummyFiles("foo-", dir); + Path[] dirs = new Path[randomIntBetween(1, 5)]; + for (int i = 0; i < dirs.length; i++) { + dirs[i] = createTempDir(); + } + final long id = addDummyFiles("foo-", dirs); Format format = new Format("foo-"); DummyState state = new DummyState(randomRealisticUnicodeOfCodepointLengthBetween(1, 1000), randomInt(), randomLong(), randomDouble(), randomBoolean()); - format.writeAndCleanup(state, dir); - Path[] list = content("*", dir); - assertEquals(list.length, 1); - assertThat(list[0].getFileName().toString(), equalTo(MetadataStateFormat.STATE_DIR_NAME)); - Path stateDir = list[0]; - assertThat(Files.isDirectory(stateDir), is(true)); - list = content("foo-*", stateDir); - assertEquals(list.length, 1); - assertThat(list[0].getFileName().toString(), equalTo("foo-" + id + ".st")); - DummyState read = format.read(NamedXContentRegistry.EMPTY, list[0]); - assertThat(read, equalTo(state)); + format.writeAndCleanup(state, dirs); + for (Path file : dirs) { + Path[] list = content("*", file); + assertEquals(list.length, 1); + assertThat(list[0].getFileName().toString(), equalTo(MetadataStateFormat.STATE_DIR_NAME)); + Path stateDir = list[0]; + assertThat(Files.isDirectory(stateDir), is(true)); + list = content("foo-*", stateDir); + assertEquals(list.length, 1); + assertThat(list[0].getFileName().toString(), equalTo("foo-" + id + ".st")); + DummyState read = format.read(NamedXContentRegistry.EMPTY, list[0]); + assertThat(read, equalTo(state)); + } } public void testCorruption() throws IOException { - final Path dir = createTempDir(); - final long id = addDummyFiles("foo-", dir); + Path[] dirs = new Path[randomIntBetween(1, 5)]; + for (int i = 0; i < dirs.length; i++) { + dirs[i] = createTempDir(); + } + final long id = addDummyFiles("foo-", dirs); Format format = new Format("foo-"); DummyState state = new DummyState(randomRealisticUnicodeOfCodepointLengthBetween(1, 1000), randomInt(), randomLong(), randomDouble(), randomBoolean()); - format.writeAndCleanup(state, dir); - Path[] list = content("*", dir); - assertEquals(list.length, 1); - assertThat(list[0].getFileName().toString(), equalTo(MetadataStateFormat.STATE_DIR_NAME)); - Path stateDir = list[0]; - assertThat(Files.isDirectory(stateDir), is(true)); - list = content("foo-*", stateDir); - assertEquals(list.length, 1); - assertThat(list[0].getFileName().toString(), equalTo("foo-" + id + ".st")); - DummyState read = format.read(NamedXContentRegistry.EMPTY, list[0]); - assertThat(read, equalTo(state)); - // now corrupt it - corruptFile(list[0], logger); - try { - format.read(NamedXContentRegistry.EMPTY, list[0]); - fail("corrupted file"); - } catch (CorruptStateException ex) { - // expected + format.writeAndCleanup(state, dirs); + for (Path file : dirs) { + Path[] list = content("*", file); + assertEquals(list.length, 1); + assertThat(list[0].getFileName().toString(), equalTo(MetadataStateFormat.STATE_DIR_NAME)); + Path stateDir = list[0]; + assertThat(Files.isDirectory(stateDir), is(true)); + list = content("foo-*", stateDir); + assertEquals(list.length, 1); + assertThat(list[0].getFileName().toString(), equalTo("foo-" + id + ".st")); + DummyState read = format.read(NamedXContentRegistry.EMPTY, list[0]); + assertThat(read, equalTo(state)); + // now corrupt it + corruptFile(list[0], logger); + try { + format.read(NamedXContentRegistry.EMPTY, list[0]); + fail("corrupted file"); + } catch (CorruptStateException ex) { + // expected + } } } @@ -203,15 +218,24 @@ public static void corruptFile(Path fileToCorrupt, Logger logger) throws IOExcep } } - private DummyState writeAndReadStateSuccessfully(Format format, Path path) throws IOException { + private DummyState writeAndReadStateSuccessfully(Format format, Path... paths) throws IOException { format.noFailures(); DummyState state = new DummyState(randomRealisticUnicodeOfCodepointLengthBetween(1, 100), randomInt(), randomLong(), randomDouble(), randomBoolean()); - format.writeAndCleanup(state, path); - assertEquals(state, format.loadLatestState(logger, NamedXContentRegistry.EMPTY, path)); + format.writeAndCleanup(state, paths); + assertEquals(state, format.loadLatestState(logger, NamedXContentRegistry.EMPTY, paths)); + ensureOnlyOneStateFile(paths); return state; } + private static void ensureOnlyOneStateFile(Path[] paths) throws IOException { + for (Path path : paths) { + try (Directory dir = new NIOFSDirectory(path.resolve(MetadataStateFormat.STATE_DIR_NAME))) { + assertThat(dir.listAll().length, equalTo(1)); + } + } + } + public void testFailWriteAndReadPreviousState() throws IOException { Path path = createTempDir(); Format format = new Format("foo-"); @@ -256,12 +280,38 @@ public void testFailWriteAndReadAnyState() throws IOException { writeAndReadStateSuccessfully(format, path); } + public void testFailCopyTmpFileToExtraLocation() throws IOException { + Path paths[] = new Path[randomIntBetween(2, 5)]; + for (int i = 0; i < paths.length; i++) { + paths[i] = createTempDir(); + } + Format format = new Format("foo-"); + + DummyState initialState = writeAndReadStateSuccessfully(format, paths); + + for (int i = 0; i < randomIntBetween(1, 5); i++) { + format.failOnMethods(Format.FAIL_OPEN_STATE_FILE_WHEN_COPYING); + DummyState newState = new DummyState(randomRealisticUnicodeOfCodepointLengthBetween(1, 100), randomInt(), randomLong(), + randomDouble(), randomBoolean()); + WriteStateException ex = expectThrows(WriteStateException.class, () -> format.writeAndCleanup(newState, paths)); + assertFalse(ex.isDirty()); + + format.noFailures(); + assertEquals(initialState, format.loadLatestState(logger, NamedXContentRegistry.EMPTY, paths)); + } + + writeAndReadStateSuccessfully(format, paths); + } + public void testFailRandomlyAndReadAnyState() throws IOException { - Path path = createTempDir(); + Path paths[] = new Path[randomIntBetween(1, 5)]; + for (int i = 0; i < paths.length; i++) { + paths[i] = createTempDir(); + } Format format = new Format("foo-"); Set possibleStates = new HashSet<>(); - DummyState initialState = writeAndReadStateSuccessfully(format, path); + DummyState initialState = writeAndReadStateSuccessfully(format, paths); possibleStates.add(initialState); for (int i = 0; i < randomIntBetween(1, 5); i++) { @@ -269,7 +319,7 @@ public void testFailRandomlyAndReadAnyState() throws IOException { DummyState newState = new DummyState(randomRealisticUnicodeOfCodepointLengthBetween(1, 100), randomInt(), randomLong(), randomDouble(), randomBoolean()); try { - format.writeAndCleanup(newState, path); + format.writeAndCleanup(newState, paths); possibleStates.clear(); possibleStates.add(newState); } catch (WriteStateException e) { @@ -279,17 +329,19 @@ public void testFailRandomlyAndReadAnyState() throws IOException { } format.noFailures(); - DummyState stateOnDisk = format.loadLatestState(logger, NamedXContentRegistry.EMPTY, path); + //we call loadLatestState not on full path set, but only on random paths from this set. This is to emulate disk failures. + Path[] randomPaths = randomSubsetOf(randomIntBetween(1, paths.length), paths).toArray(new Path[0]); + DummyState stateOnDisk = format.loadLatestState(logger, NamedXContentRegistry.EMPTY, randomPaths); assertTrue(possibleStates.contains(stateOnDisk)); if (possibleStates.size() > 1) { //if there was a WriteStateException we need to override current state before we continue - newState = writeAndReadStateSuccessfully(format, path); + newState = writeAndReadStateSuccessfully(format, paths); possibleStates.clear(); possibleStates.add(newState); } } - writeAndReadStateSuccessfully(format, path); + writeAndReadStateSuccessfully(format, paths); } private static class Format extends MetadataStateFormat { @@ -486,21 +538,23 @@ public Path[] content(String glob, Path dir) throws IOException { } } - public long addDummyFiles(String prefix, Path path) throws IOException { + public long addDummyFiles(String prefix, Path... paths) throws IOException { int realId = -1; - if (randomBoolean()) { - Path stateDir = path.resolve(MetadataStateFormat.STATE_DIR_NAME); - Files.createDirectories(stateDir); - String actualPrefix = prefix; - int id = randomIntBetween(0, 10); + for (Path path : paths) { if (randomBoolean()) { - actualPrefix = "dummy-"; - } else { - realId = Math.max(realId, id); - } - try (OutputStream stream = - Files.newOutputStream(stateDir.resolve(actualPrefix + id + MetadataStateFormat.STATE_FILE_EXTENSION))) { - stream.write(0); + Path stateDir = path.resolve(MetadataStateFormat.STATE_DIR_NAME); + Files.createDirectories(stateDir); + String actualPrefix = prefix; + int id = randomIntBetween(0, 10); + if (randomBoolean()) { + actualPrefix = "dummy-"; + } else { + realId = Math.max(realId, id); + } + try (OutputStream stream = + Files.newOutputStream(stateDir.resolve(actualPrefix + id + MetadataStateFormat.STATE_FILE_EXTENSION))) { + stream.write(0); + } } } return realId + 1; diff --git a/server/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java b/server/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java index 0c0f7e43a9c87..123ef459fbdd0 100644 --- a/server/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java +++ b/server/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java @@ -189,13 +189,13 @@ */ public class IndexShardTests extends IndexShardTestCase { - public static ShardStateMetadata load(Logger logger, Path shardPath) throws IOException { - return ShardStateMetadata.FORMAT.loadLatestState(logger, NamedXContentRegistry.EMPTY, shardPath); + public static ShardStateMetadata load(Logger logger, Path... shardPaths) throws IOException { + return ShardStateMetadata.FORMAT.loadLatestState(logger, NamedXContentRegistry.EMPTY, shardPaths); } public static void write(ShardStateMetadata shardStateMetadata, - Path shardPath) throws IOException { - ShardStateMetadata.FORMAT.writeAndCleanup(shardStateMetadata, shardPath); + Path... shardPaths) throws IOException { + ShardStateMetadata.FORMAT.writeAndCleanup(shardStateMetadata, shardPaths); } public static Engine getEngineFromShard(IndexShard shard) { From e2bdeedd0dc6643749e5c53a8c17bd62da7e7392 Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Wed, 29 Sep 2021 15:04:47 -0700 Subject: [PATCH 072/250] Revert "Remove multiple paths from ShardPath (#72713)" (#78485) This reverts commit 08a89c89925eafb78fe61219af302d4b00c314b8. --- .../RemoveCorruptedShardDataCommand.java | 2 +- .../elasticsearch/index/shard/ShardPath.java | 49 ++++++++++++------- 2 files changed, 33 insertions(+), 18 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/index/shard/RemoveCorruptedShardDataCommand.java b/server/src/main/java/org/elasticsearch/index/shard/RemoveCorruptedShardDataCommand.java index 92dc44d0d8beb..929e301fd9d5f 100644 --- a/server/src/main/java/org/elasticsearch/index/shard/RemoveCorruptedShardDataCommand.java +++ b/server/src/main/java/org/elasticsearch/index/shard/RemoveCorruptedShardDataCommand.java @@ -160,7 +160,7 @@ protected void findAndProcessShardPath(OptionSet options, Environment environmen .resolve(Integer.toString(shId.id())); if (Files.exists(shardPathLocation)) { final ShardPath shardPath = ShardPath.loadShardPath(logger, shId, indexSettings.customDataPath(), - shardPathLocation, dataPath); + new Path[]{shardPathLocation}, dataPath); if (shardPath != null) { consumer.accept(shardPath); } diff --git a/server/src/main/java/org/elasticsearch/index/shard/ShardPath.java b/server/src/main/java/org/elasticsearch/index/shard/ShardPath.java index 12172d09fe0af..ea8203556ccb2 100644 --- a/server/src/main/java/org/elasticsearch/index/shard/ShardPath.java +++ b/server/src/main/java/org/elasticsearch/index/shard/ShardPath.java @@ -99,44 +99,59 @@ public boolean isCustomDataPath() { } /** - * This method resolves the node's shard path using the given {@link NodeEnvironment}. + * This method walks through the nodes shard paths to find the data and state path for the given shard. If multiple + * directories with a valid shard state exist the one with the highest version will be used. * Note: this method resolves custom data locations for the shard if such a custom data path is provided. */ public static ShardPath loadShardPath(Logger logger, NodeEnvironment env, ShardId shardId, String customDataPath) throws IOException { final Path shardPath = env.availableShardPath(shardId); final Path sharedDataPath = env.sharedDataPath(); - return loadShardPath(logger, shardId, customDataPath, shardPath, sharedDataPath); + return loadShardPath(logger, shardId, customDataPath, new Path[] { shardPath }, sharedDataPath); } /** - * This method resolves the node's shard path using the given data paths. + * This method walks through the nodes shard paths to find the data and state path for the given shard. If multiple + * directories with a valid shard state exist the one with the highest version will be used. * Note: this method resolves custom data locations for the shard. */ - public static ShardPath loadShardPath(Logger logger, ShardId shardId, String customDataPath, Path shardPath, + public static ShardPath loadShardPath(Logger logger, ShardId shardId, String customDataPath, Path[] availableShardPaths, Path sharedDataPath) throws IOException { final String indexUUID = shardId.getIndex().getUUID(); - // EMPTY is safe here because we never call namedObject - ShardStateMetadata load = ShardStateMetadata.FORMAT.loadLatestState(logger, NamedXContentRegistry.EMPTY, shardPath); - if (load != null) { - if (load.indexUUID.equals(indexUUID) == false && IndexMetadata.INDEX_UUID_NA_VALUE.equals(load.indexUUID) == false) { - logger.warn("{} found shard on path: [{}] with a different index UUID - this " - + "shard seems to be leftover from a different index with the same name. " - + "Remove the leftover shard in order to reuse the path with the current index", shardId, shardPath); - throw new IllegalStateException(shardId + " index UUID in shard state was: " + load.indexUUID - + " expected: " + indexUUID + " on shard path: " + shardPath); + Path loadedPath = null; + for (Path path : availableShardPaths) { + // EMPTY is safe here because we never call namedObject + ShardStateMetadata load = ShardStateMetadata.FORMAT.loadLatestState(logger, NamedXContentRegistry.EMPTY, path); + if (load != null) { + if (load.indexUUID.equals(indexUUID) == false && IndexMetadata.INDEX_UUID_NA_VALUE.equals(load.indexUUID) == false) { + logger.warn("{} found shard on path: [{}] with a different index UUID - this " + + "shard seems to be leftover from a different index with the same name. " + + "Remove the leftover shard in order to reuse the path with the current index", shardId, path); + throw new IllegalStateException(shardId + " index UUID in shard state was: " + load.indexUUID + + " expected: " + indexUUID + " on shard path: " + path); + } + if (loadedPath == null) { + loadedPath = path; + } else{ + throw new IllegalStateException(shardId + " more than one shard state found"); + } } + + } + if (loadedPath == null) { + return null; + } else { final Path dataPath; + final Path statePath = loadedPath; final boolean hasCustomDataPath = Strings.isNotEmpty(customDataPath); if (hasCustomDataPath) { dataPath = NodeEnvironment.resolveCustomLocation(customDataPath, shardId, sharedDataPath); } else { - dataPath = shardPath; + dataPath = statePath; } - logger.debug("{} loaded data path [{}], state path [{}]", shardId, dataPath, shardPath); - return new ShardPath(hasCustomDataPath, dataPath, shardPath, shardId); + logger.debug("{} loaded data path [{}], state path [{}]", shardId, dataPath, statePath); + return new ShardPath(hasCustomDataPath, dataPath, statePath, shardId); } - return null; } /** From 7431a9656ece618b93b2a99ed4e1c250642adaa7 Mon Sep 17 00:00:00 2001 From: debadair Date: Wed, 29 Sep 2021 15:12:13 -0700 Subject: [PATCH 073/250] [DOCS] Fix erroneous page break. (#78487) --- docs/reference/migration/migrate_8_0/monitoring.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference/migration/migrate_8_0/monitoring.asciidoc b/docs/reference/migration/migrate_8_0/monitoring.asciidoc index 6f13fb9f67b4a..e0e0e3fd6d0e8 100644 --- a/docs/reference/migration/migrate_8_0/monitoring.asciidoc +++ b/docs/reference/migration/migrate_8_0/monitoring.asciidoc @@ -1,4 +1,4 @@ -[discreet] +[discrete] [[breaking_80_monitoring_changes]] === Monitoring changes From 56e5822097836ca2dd75e8bc28ac887ed01619ea Mon Sep 17 00:00:00 2001 From: Armin Braun Date: Thu, 30 Sep 2021 07:39:12 +0200 Subject: [PATCH 074/250] Skip Inspecting Busy Indices on ILM CS Application (#78471) If the current combination of current-step and index has a running CS update task enqueued there is no point in adding yet another task for this combination on the applier and we can skip the expensive inspection for the index. follow up to #78390 --- .../xpack/ilm/ExecuteStepsUpdateTask.java | 7 +------ .../IndexLifecycleClusterStateUpdateTask.java | 19 +++++++++++++++++++ .../xpack/ilm/IndexLifecycleRunner.java | 17 ++++++++++++++++- .../xpack/ilm/MoveToNextStepUpdateTask.java | 5 +---- .../xpack/ilm/SetStepInfoUpdateTask.java | 13 +------------ 5 files changed, 38 insertions(+), 23 deletions(-) diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/ExecuteStepsUpdateTask.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/ExecuteStepsUpdateTask.java index 9890ee65ddc3c..033015b48c5ea 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/ExecuteStepsUpdateTask.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/ExecuteStepsUpdateTask.java @@ -30,7 +30,6 @@ public class ExecuteStepsUpdateTask extends IndexLifecycleClusterStateUpdateTask { private static final Logger logger = LogManager.getLogger(ExecuteStepsUpdateTask.class); private final String policy; - private final Index index; private final Step startStep; private final PolicyStepsRegistry policyStepsRegistry; private final IndexLifecycleRunner lifecycleRunner; @@ -40,8 +39,8 @@ public class ExecuteStepsUpdateTask extends IndexLifecycleClusterStateUpdateTask public ExecuteStepsUpdateTask(String policy, Index index, Step startStep, PolicyStepsRegistry policyStepsRegistry, IndexLifecycleRunner lifecycleRunner, LongSupplier nowSupplier) { + super(index, startStep.getKey()); this.policy = policy; - this.index = index; this.startStep = startStep; this.policyStepsRegistry = policyStepsRegistry; this.nowSupplier = nowSupplier; @@ -52,10 +51,6 @@ String getPolicy() { return policy; } - Index getIndex() { - return index; - } - Step getStartStep() { return startStep; } diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycleClusterStateUpdateTask.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycleClusterStateUpdateTask.java index a3b5622a5670c..419b76f58727a 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycleClusterStateUpdateTask.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycleClusterStateUpdateTask.java @@ -11,6 +11,8 @@ import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.ClusterStateUpdateTask; import org.elasticsearch.common.util.concurrent.ListenableFuture; +import org.elasticsearch.index.Index; +import org.elasticsearch.xpack.core.ilm.Step; /** * Base class for index lifecycle cluster state update tasks that requires implementing {@code equals} and {@code hashCode} to allow @@ -20,6 +22,23 @@ public abstract class IndexLifecycleClusterStateUpdateTask extends ClusterStateU private final ListenableFuture listener = new ListenableFuture<>(); + protected final Index index; + + protected final Step.StepKey currentStepKey; + + protected IndexLifecycleClusterStateUpdateTask(Index index, Step.StepKey currentStepKey) { + this.index = index; + this.currentStepKey = currentStepKey; + } + + final Index getIndex() { + return index; + } + + final Step.StepKey getCurrentStepKey() { + return currentStepKey; + } + @Override public final void clusterStateProcessed(String source, ClusterState oldState, ClusterState newState) { listener.onResponse(null); diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycleRunner.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycleRunner.java index d82437691b916..f1cf2f0c0df1d 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycleRunner.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycleRunner.java @@ -20,6 +20,7 @@ import org.elasticsearch.common.xcontent.ToXContentObject; import org.elasticsearch.core.Nullable; import org.elasticsearch.core.TimeValue; +import org.elasticsearch.core.Tuple; import org.elasticsearch.index.Index; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.xpack.core.ilm.AsyncActionStep; @@ -331,6 +332,11 @@ public void onFailure(Exception e) { void runPolicyAfterStateChange(String policy, IndexMetadata indexMetadata) { String index = indexMetadata.getIndex().getName(); LifecycleExecutionState lifecycleState = LifecycleExecutionState.fromIndexMetadata(indexMetadata); + final StepKey currentStepKey = LifecycleExecutionState.getCurrentStepKey(lifecycleState); + if (busyIndices.contains(Tuple.tuple(indexMetadata.getIndex(), currentStepKey))) { + // try later again, already doing work for this index at this step, no need to check for more work yet + return; + } final Step currentStep; try { currentStep = getCurrentStep(stepRegistry, policy, indexMetadata, lifecycleState); @@ -343,7 +349,6 @@ void runPolicyAfterStateChange(String policy, IndexMetadata indexMetadata) { markPolicyDoesNotExist(policy, indexMetadata.getIndex(), lifecycleState); return; } else { - Step.StepKey currentStepKey = LifecycleExecutionState.getCurrentStepKey(lifecycleState); if (TerminalPolicyStep.KEY.equals(currentStepKey)) { // This index is a leftover from before we halted execution on the final phase // instead of going to the completed phase, so it's okay to ignore this index @@ -511,6 +516,12 @@ void registerFailedOperation(IndexMetadata indexMetadata, Exception failure) { private final Set executingTasks = Collections.synchronizedSet(new HashSet<>()); + /** + * Set of all index and current step key combinations that have an in-flight cluster state update at the moment. Used to not inspect + * indices that are already executing an update at their current step on cluster state update thread needlessly. + */ + private final Set> busyIndices = Collections.synchronizedSet(new HashSet<>()); + /** * Tracks already executing {@link IndexLifecycleClusterStateUpdateTask} tasks in {@link #executingTasks} to prevent queueing up * duplicate cluster state updates. @@ -522,8 +533,12 @@ void registerFailedOperation(IndexMetadata indexMetadata, Exception failure) { */ private void submitUnlessAlreadyQueued(String source, IndexLifecycleClusterStateUpdateTask task) { if (executingTasks.add(task)) { + final Tuple dedupKey = Tuple.tuple(task.index, task.currentStepKey); + // index+step-key combination on a best-effort basis to skip checking for more work for an index on CS application + busyIndices.add(dedupKey); task.addListener(ActionListener.wrap(() -> { final boolean removed = executingTasks.remove(task); + busyIndices.remove(dedupKey); assert removed : "tried to unregister unknown task [" + task + "]"; })); clusterService.submitStateUpdateTask(source, task); diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/MoveToNextStepUpdateTask.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/MoveToNextStepUpdateTask.java index 03efd7b2c3150..0fe21a683648c 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/MoveToNextStepUpdateTask.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/MoveToNextStepUpdateTask.java @@ -24,9 +24,7 @@ public class MoveToNextStepUpdateTask extends IndexLifecycleClusterStateUpdateTask { private static final Logger logger = LogManager.getLogger(MoveToNextStepUpdateTask.class); - private final Index index; private final String policy; - private final Step.StepKey currentStepKey; private final Step.StepKey nextStepKey; private final LongSupplier nowSupplier; private final PolicyStepsRegistry stepRegistry; @@ -35,9 +33,8 @@ public class MoveToNextStepUpdateTask extends IndexLifecycleClusterStateUpdateTa public MoveToNextStepUpdateTask(Index index, String policy, Step.StepKey currentStepKey, Step.StepKey nextStepKey, LongSupplier nowSupplier, PolicyStepsRegistry stepRegistry, Consumer stateChangeConsumer) { - this.index = index; + super(index, currentStepKey); this.policy = policy; - this.currentStepKey = currentStepKey; this.nextStepKey = nextStepKey; this.nowSupplier = nowSupplier; this.stepRegistry = stepRegistry; diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/SetStepInfoUpdateTask.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/SetStepInfoUpdateTask.java index 5d92d3a1038be..1de4cbc39e9a1 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/SetStepInfoUpdateTask.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/SetStepInfoUpdateTask.java @@ -28,30 +28,19 @@ public class SetStepInfoUpdateTask extends IndexLifecycleClusterStateUpdateTask private static final Logger logger = LogManager.getLogger(SetStepInfoUpdateTask.class); - private final Index index; private final String policy; - private final Step.StepKey currentStepKey; private final ToXContentObject stepInfo; public SetStepInfoUpdateTask(Index index, String policy, Step.StepKey currentStepKey, ToXContentObject stepInfo) { - this.index = index; + super(index, currentStepKey); this.policy = policy; - this.currentStepKey = currentStepKey; this.stepInfo = stepInfo; } - Index getIndex() { - return index; - } - String getPolicy() { return policy; } - Step.StepKey getCurrentStepKey() { - return currentStepKey; - } - ToXContentObject getStepInfo() { return stepInfo; } From 9e01fe3e3ac503965bbfe6b2c5ffaf1dc844faf1 Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Thu, 30 Sep 2021 11:10:47 +0200 Subject: [PATCH 075/250] Mute 'histogram with time series mappings' test yaml test (#78502) See #78443 --- .../resources/rest-api-spec/test/analytics/histogram.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/analytics/histogram.yml b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/analytics/histogram.yml index 127dbb82fc5ea..87c40a1ad771a 100644 --- a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/analytics/histogram.yml +++ b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/analytics/histogram.yml @@ -175,8 +175,8 @@ setup: --- histogram with time series mappings: - skip: - version: " - 7.15.99" - reason: introduced in 7.16.0 + version: "all" + reason: "AwaitsFix https://github.com/elastic/elasticsearch/issues/78443" - do: From 448eb504dedcf5820bd413b2c792b1d617a9f737 Mon Sep 17 00:00:00 2001 From: Tanguy Leroux Date: Thu, 30 Sep 2021 11:31:56 +0200 Subject: [PATCH 076/250] Adjust assertion in BlobStoreCacheMaintenanceService (#78448) If the deleted index comes from the index graveyard there is no index metadata in the previous cluster state. Closes #78316 --- .../cache/blob/BlobStoreCacheMaintenanceService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/cache/blob/BlobStoreCacheMaintenanceService.java b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/cache/blob/BlobStoreCacheMaintenanceService.java index d19a6e42ef5ce..e9bed4a79f91c 100644 --- a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/cache/blob/BlobStoreCacheMaintenanceService.java +++ b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/cache/blob/BlobStoreCacheMaintenanceService.java @@ -143,7 +143,8 @@ protected void doRun() { for (Index deletedIndex : event.indicesDeleted()) { final IndexMetadata indexMetadata = event.previousState().metadata().index(deletedIndex); - assert indexMetadata != null : "no previous metadata found for " + deletedIndex; + assert indexMetadata != null || state.metadata().indexGraveyard().containsIndex(deletedIndex) + : "no previous metadata found for " + deletedIndex; if (indexMetadata != null) { final Settings indexSetting = indexMetadata.getSettings(); if (SearchableSnapshotsSettings.isSearchableSnapshotStore(indexSetting)) { From 9d5395e9d873e290b4acfd5b551c83adf827879a Mon Sep 17 00:00:00 2001 From: Dan Hermann Date: Thu, 30 Sep 2021 06:47:45 -0500 Subject: [PATCH 077/250] Properly handle wildcards in data stream deletion requests (#78463) --- .../DeleteDataStreamTransportAction.java | 1 - .../test/data_stream/10_basic.yml | 37 +++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/x-pack/plugin/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/DeleteDataStreamTransportAction.java b/x-pack/plugin/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/DeleteDataStreamTransportAction.java index 7741594cfa744..94a2302b20d6e 100644 --- a/x-pack/plugin/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/DeleteDataStreamTransportAction.java +++ b/x-pack/plugin/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/DeleteDataStreamTransportAction.java @@ -86,7 +86,6 @@ protected void masterOperation( for (String name : names) { systemIndices.validateDataStreamAccess(name, threadPool.getThreadContext()); } - request.indices(names.toArray(Strings.EMPTY_ARRAY)); clusterService.submitStateUpdateTask( "remove-data-stream [" + Strings.arrayToCommaDelimitedString(request.getNames()) + "]", diff --git a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/10_basic.yml b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/10_basic.yml index 0d38217cada59..1032a13aa8104 100644 --- a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/10_basic.yml +++ b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/10_basic.yml @@ -403,6 +403,43 @@ setup: indices.delete_data_stream: name: simple-data-stream2 +--- +"Delete data stream by wildcard": + - skip: + version: " - 7.99.99" + reason: "change to [-7.8.99] and [data streams only supported in 7.9+] after backport" + + - do: + indices.create_data_stream: + name: simple-data-stream1 + - is_true: acknowledged + + - do: + indices.create_data_stream: + name: simple-data-stream2 + - is_true: acknowledged + + - do: + indices.delete_data_stream: + name: no-matching-data-streams* + - is_true: acknowledged + + - do: + indices.get_data_stream: + name: "*" + - match: { data_streams.0.name: simple-data-stream1 } + - match: { data_streams.1.name: simple-data-stream2 } + + - do: + indices.delete_data_stream: + name: simple-data-stream* + - is_true: acknowledged + + - do: + indices.get_data_stream: + name: "*" + - length: { data_streams: 0 } + --- "append-only writes to backing indices prohibited": - skip: From 12019a89fd7c75a6b435e9745e7f71a6ab856b6a Mon Sep 17 00:00:00 2001 From: James Rodewig <40268737+jrodewig@users.noreply.github.com> Date: Thu, 30 Sep 2021 09:27:53 -0400 Subject: [PATCH 078/250] [DOCS] Document archived settings (#78351) Documents `archived.*` persistent cluster settings and index settings. These settings are commonly produced during a major version upgrade. Closes #28027 --- docs/reference/upgrade.asciidoc | 2 + .../upgrade/archived-settings.asciidoc | 76 +++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 docs/reference/upgrade/archived-settings.asciidoc diff --git a/docs/reference/upgrade.asciidoc b/docs/reference/upgrade.asciidoc index a5f77cc41947b..ba760707202aa 100644 --- a/docs/reference/upgrade.asciidoc +++ b/docs/reference/upgrade.asciidoc @@ -106,3 +106,5 @@ include::upgrade/rolling_upgrade.asciidoc[] include::upgrade/cluster_restart.asciidoc[] include::upgrade/reindex_upgrade.asciidoc[] + +include::upgrade/archived-settings.asciidoc[] diff --git a/docs/reference/upgrade/archived-settings.asciidoc b/docs/reference/upgrade/archived-settings.asciidoc new file mode 100644 index 0000000000000..d1b65b27e4cb3 --- /dev/null +++ b/docs/reference/upgrade/archived-settings.asciidoc @@ -0,0 +1,76 @@ +[[archived-settings]] +== Archived settings + +{es} typically removes support for deprecated settings at major version +releases. If you upgrade a cluster with a deprecated persistent cluster setting +to a version that no longer supports the setting, {es} automatically archives +that setting. Similarly, if you upgrade a cluster that contains an index with an +unsupported index setting, {es} archives the index setting. + +Archived settings start with the `archived.` prefix and are ignored by {es}. + +[discrete] +[[archived-cluster-settings]] +=== Archived cluster settings + +After an upgrade, you can view archived cluster settings using the +<>. + +[source,console] +---- +GET _cluster/settings?flat_settings=true&filter_path=persistent.archived* +---- + +You can remove archived cluster settings using the +<>. + +[source,console] +---- +PUT _cluster/settings +{ + "persistent": { + "archived.*": null + } +} +---- + +{es} doesn't archive transient cluster settings or settings in +`elasticsearch.yml`. If a node includes an unsupported setting in +`elasticsearch.yml`, it will return an error at startup. + +[discrete] +[[archived-index-settings]] +=== Archived index settings + +IMPORTANT: Before you upgrade, remove any unsupported index settings from index +and component templates. {es} doesn't archive unsupported index settings in +templates during an upgrade. Attempts to use a template that contains an +unsupported index setting will fail and return an error. This includes automated +operations, such the {ilm-init} rollover action. + +You can view archived settings for an index using the <>. + +[source,console] +---- +GET my-index/_settings?flat_settings=true&filter_path=**.settings.archived* +---- +// TEST[s/^/PUT my-index\n/] + +Removing archived index settings requires a reindex after the upgrade. However, +reindexing can be resource intensive. Because {es} ignores archived settings, +you can safely leave them in place if wanted. + +[source,console] +---- +POST _reindex +{ + "source": { + "index": "my-index" + }, + "dest": { + "index": "reindexed-v8-my-index" + } +} +---- +// TEST[s/^/PUT my-index\n/] \ No newline at end of file From 8bf2ecf4302424e89796912d5dcfde0a13b4b338 Mon Sep 17 00:00:00 2001 From: Ioannis Kakavas Date: Thu, 30 Sep 2021 16:38:11 +0300 Subject: [PATCH 079/250] Print enrollment token on startup (#78293) This change introduces the functionality for elasticsearch nodes to auto-generate an enrollment token for Kibana and calculate the SHA256 fingerprint of the HTTP CA certificate and print these to stdout (when available) in addition to the password of the elastic user, the first time a node starts and auto-configuration is enabled. --- ...chiveGenerateInitialCredentialsTests.java} | 114 +++++----- .../packaging/util/ServerUtils.java | 59 +++++- .../packaging/util/docker/Docker.java | 2 +- .../bin/elasticsearch-security-config.bat | 2 +- ...teInitialBuiltinUsersPasswordListener.java | 121 ----------- .../InitialSecurityConfigurationListener.java | 193 +++++++++++++++++ .../xpack/security/Security.java | 17 +- .../BaseEnrollmentTokenGenerator.java | 86 ++++++++ ... => ExternalEnrollmentTokenGenerator.java} | 75 +------ .../InternalEnrollmentTokenGenerator.java | 124 +++++++++++ ...swordAndEnrollmentTokenForInitialNode.java | 144 ------------- .../tool/CreateEnrollmentTokenTool.java | 14 +- ...xternalEnrollmentTokenGeneratorTests.java} | 58 ++--- ...InternalEnrollmentTokenGeneratorTests.java | 183 ++++++++++++++++ ...AndEnrollmentTokenForInitialNodeTests.java | 198 ------------------ .../tool/CreateEnrollmentTokenToolTests.java | 18 +- 16 files changed, 767 insertions(+), 641 deletions(-) rename qa/os/src/test/java/org/elasticsearch/packaging/test/{ArchiveGenerateInitialPasswordTests.java => ArchiveGenerateInitialCredentialsTests.java} (52%) delete mode 100644 x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/GenerateInitialBuiltinUsersPasswordListener.java create mode 100644 x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/InitialSecurityConfigurationListener.java create mode 100644 x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/enrollment/BaseEnrollmentTokenGenerator.java rename x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/enrollment/{EnrollmentTokenGenerator.java => ExternalEnrollmentTokenGenerator.java} (67%) create mode 100644 x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/enrollment/InternalEnrollmentTokenGenerator.java delete mode 100644 x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/enrollment/tool/BootstrapPasswordAndEnrollmentTokenForInitialNode.java rename x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/enrollment/{EnrollmentTokenGeneratorTests.java => ExternalEnrollmentTokenGeneratorTests.java} (86%) create mode 100644 x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/enrollment/InternalEnrollmentTokenGeneratorTests.java delete mode 100644 x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/enrollment/tool/BootstrapPasswordAndEnrollmentTokenForInitialNodeTests.java diff --git a/qa/os/src/test/java/org/elasticsearch/packaging/test/ArchiveGenerateInitialPasswordTests.java b/qa/os/src/test/java/org/elasticsearch/packaging/test/ArchiveGenerateInitialCredentialsTests.java similarity index 52% rename from qa/os/src/test/java/org/elasticsearch/packaging/test/ArchiveGenerateInitialPasswordTests.java rename to qa/os/src/test/java/org/elasticsearch/packaging/test/ArchiveGenerateInitialCredentialsTests.java index d1e9764e8ddca..80f0f901b8046 100644 --- a/qa/os/src/test/java/org/elasticsearch/packaging/test/ArchiveGenerateInitialPasswordTests.java +++ b/qa/os/src/test/java/org/elasticsearch/packaging/test/ArchiveGenerateInitialCredentialsTests.java @@ -15,8 +15,6 @@ import org.elasticsearch.packaging.util.Shell; import org.junit.BeforeClass; -import java.util.HashMap; -import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -24,14 +22,22 @@ import static org.elasticsearch.packaging.util.Archives.verifyArchiveInstallation; import static org.elasticsearch.packaging.util.FileExistenceMatchers.fileExists; import static org.hamcrest.CoreMatchers.containsString; -import static org.hamcrest.Matchers.equalTo; -import static org.hamcrest.Matchers.is; +import static org.hamcrest.CoreMatchers.notNullValue; +import static org.hamcrest.CoreMatchers.nullValue; import static org.hamcrest.Matchers.not; import static org.junit.Assume.assumeTrue; -public class ArchiveGenerateInitialPasswordTests extends PackagingTestCase { +public class ArchiveGenerateInitialCredentialsTests extends PackagingTestCase { - private static final Pattern PASSWORD_REGEX = Pattern.compile("Password for the (\\w+) user is: (.+)$", Pattern.MULTILINE); + private static final Pattern PASSWORD_REGEX = Pattern.compile("Password for the elastic user is: (.+)$", Pattern.MULTILINE); + private static final Pattern TOKEN_REGEX = Pattern.compile( + "Enrollment token for kibana, valid for the next 30 minutes:\n(.+)$", + Pattern.MULTILINE + ); + private static final Pattern FINGERPRINT_REGEX = Pattern.compile( + "Fingerprint of the generated CA certificate for HTTP:\n(.+)$", + Pattern.MULTILINE + ); @BeforeClass public static void filterDistros() { @@ -39,80 +45,94 @@ public static void filterDistros() { } public void test10Install() throws Exception { + // security config tool would run as administrator and change the owner of the config file, which is elasticsearch + // We can re-enable this when #77231 is merged, but the rest of the tests in class are also currently muted on windows + assumeTrue("Don't run on windows", distribution.platform != Distribution.Platform.WINDOWS); installation = installArchive(sh, distribution()); // Enable security for these tests only where it is necessary, until we can enable it for all + // TODO: Remove this when https://github.com/elastic/elasticsearch/pull/77231 is merged ServerUtils.enableSecurityFeatures(installation); verifyArchiveInstallation(installation, distribution()); + installation.executables().securityConfigTool.run(""); } - public void test20NoAutoGenerationWhenBootstrapPassword() throws Exception { + public void test20NoAutoGenerationWhenAutoConfigurationDisabled() throws Exception { /* Windows issue awaits fix: https://github.com/elastic/elasticsearch/issues/49340 */ assumeTrue("expect command isn't on Windows", distribution.platform != Distribution.Platform.WINDOWS); - installation.executables().keystoreTool.run("create"); - installation.executables().keystoreTool.run("add --stdin bootstrap.password", "some-password-here"); - Shell.Result result = awaitElasticsearchStartupWithResult(runElasticsearchStartCommand(null, false, true), 10000); - Map usersAndPasswords = parseUsersAndPasswords(result.stdout); - assertThat(usersAndPasswords.isEmpty(), is(true)); - String response = ServerUtils.makeRequest(Request.Get("http://localhost:9200"), "elastic", "some-password-here", null); - assertThat(response, containsString("You Know, for Search")); - } - - public void test30NoAutoGenerationWhenAutoConfigurationDisabled() throws Exception { - /* Windows issue awaits fix: https://github.com/elastic/elasticsearch/issues/49340 */ - assumeTrue("expect command isn't on Windows", distribution.platform != Distribution.Platform.WINDOWS); - stopElasticsearch(); - installation.executables().keystoreTool.run("remove bootstrap.password"); ServerUtils.disableSecurityAutoConfiguration(installation); - Shell.Result result = awaitElasticsearchStartupWithResult(runElasticsearchStartCommand(null, false, true), 10000); - Map usersAndPasswords = parseUsersAndPasswords(result.stdout); - assertThat(usersAndPasswords.isEmpty(), is(true)); + Shell.Result result = awaitElasticsearchStartupWithResult(runElasticsearchStartCommand(null, false, true)); + assertThat(parseElasticPassword(result.stdout), nullValue()); + assertThat(parseKibanaToken(result.stdout), nullValue()); + assertThat(parseFingerprint(result.stdout), nullValue()); + stopElasticsearch(); } - public void test40NoAutogenerationWhenDaemonized() throws Exception { + public void test30NoAutogenerationWhenDaemonized() throws Exception { /* Windows issue awaits fix: https://github.com/elastic/elasticsearch/issues/49340 */ assumeTrue("expect command isn't on Windows", distribution.platform != Distribution.Platform.WINDOWS); - stopElasticsearch(); ServerUtils.enableSecurityAutoConfiguration(installation); awaitElasticsearchStartup(runElasticsearchStartCommand(null, true, true)); assertThat(installation.logs.resolve("elasticsearch.log"), fileExists()); String logfile = FileUtils.slurp(installation.logs.resolve("elasticsearch.log")); assertThat(logfile, not(containsString("Password for the elastic user is"))); + assertThat(logfile, not(containsString("Enrollment token for kibana (valid for the next 30 minutes) :"))); } - @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/77621") - public void test50VerifyAutogeneratedCredentials() throws Exception { + public void test40VerifyAutogeneratedCredentials() throws Exception { /* Windows issue awaits fix: https://github.com/elastic/elasticsearch/issues/49340 */ assumeTrue("expect command isn't on Windows", distribution.platform != Distribution.Platform.WINDOWS); stopElasticsearch(); ServerUtils.enableSecurityAutoConfiguration(installation); - Shell.Result result = awaitElasticsearchStartupWithResult(runElasticsearchStartCommand(null, false, true), 10000); - Map usersAndPasswords = parseUsersAndPasswords(result.stdout); - assertThat(usersAndPasswords.size(), equalTo(2)); - assertThat(usersAndPasswords.containsKey("elastic"), is(true)); - assertThat(usersAndPasswords.containsKey("kibana_system"), is(true)); - for (Map.Entry userpass : usersAndPasswords.entrySet()) { - String response = ServerUtils.makeRequest(Request.Get("http://localhost:9200"), userpass.getKey(), userpass.getValue(), null); - assertThat(response, containsString("You Know, for Search")); - } + Shell.Result result = awaitElasticsearchStartupWithResult(runElasticsearchStartCommand(null, false, true)); + assertThat(parseElasticPassword(result.stdout), notNullValue()); + assertThat(parseKibanaToken(result.stdout), notNullValue()); + assertThat(parseFingerprint(result.stdout), notNullValue()); + String response = ServerUtils.makeRequest( + Request.Get("https://localhost:9200"), + "elastic", + parseElasticPassword(result.stdout), + ServerUtils.getCaCert(installation.config) + ); + assertThat(response, containsString("You Know, for Search")); } - @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/77796") - public void test60PasswordAutogenerationOnlyOnce() throws Exception { + public void test50CredentialAutogenerationOnlyOnce() throws Exception { /* Windows issue awaits fix: https://github.com/elastic/elasticsearch/issues/49340 */ assumeTrue("expect command isn't on Windows", distribution.platform != Distribution.Platform.WINDOWS); stopElasticsearch(); - Shell.Result result = awaitElasticsearchStartupWithResult(runElasticsearchStartCommand(null, false, true), 10000); - Map usersAndPasswords = parseUsersAndPasswords(result.stdout); - assertThat(usersAndPasswords.isEmpty(), is(true)); + Shell.Result result = awaitElasticsearchStartupWithResult(runElasticsearchStartCommand(null, false, true)); + assertThat(parseElasticPassword(result.stdout), nullValue()); + assertThat(parseKibanaToken(result.stdout), nullValue()); + assertThat(parseFingerprint(result.stdout), nullValue()); } - private Map parseUsersAndPasswords(String output) { + private String parseElasticPassword(String output) { Matcher matcher = PASSWORD_REGEX.matcher(output); assertNotNull(matcher); - Map usersAndPasswords = new HashMap<>(); - while (matcher.find()) { - usersAndPasswords.put(matcher.group(1), matcher.group(2)); + if (matcher.find()) { + return matcher.group(1); + } else { + return null; + } + } + + private String parseKibanaToken(String output) { + Matcher matcher = TOKEN_REGEX.matcher(output); + assertNotNull(matcher); + if (matcher.find()) { + return matcher.group(1); + } else { + return null; + } + } + + private String parseFingerprint(String output) { + Matcher matcher = FINGERPRINT_REGEX.matcher(output); + assertNotNull(matcher); + if (matcher.find()) { + return matcher.group(1); + } else { + return null; } - return usersAndPasswords; } } diff --git a/qa/os/src/test/java/org/elasticsearch/packaging/util/ServerUtils.java b/qa/os/src/test/java/org/elasticsearch/packaging/util/ServerUtils.java index d1b4cc92c44ee..4f28dd2467553 100644 --- a/qa/os/src/test/java/org/elasticsearch/packaging/util/ServerUtils.java +++ b/qa/os/src/test/java/org/elasticsearch/packaging/util/ServerUtils.java @@ -90,7 +90,7 @@ public static void waitForElasticsearch(Installation installation) throws Except // make the http port available until the system is really ready to serve requests waitForXpack(); } else { - waitForElasticsearch("green", null, installation, null, null); + waitForElasticsearch("green", null, installation, null, null, null); } } @@ -161,9 +161,41 @@ private static void waitForXpack() { throw new RuntimeException("Elasticsearch (with x-pack) did not start"); } - public static void waitForElasticsearch(String status, String index, Installation installation, String username, String password) - throws Exception { + public static Path getCaCert(Path configPath) throws IOException { + boolean enrollmentEnabled = false; + boolean httpSslEnabled = false; + Path caCert = configPath.resolve("certs/ca/ca.crt"); + Path configFilePath = configPath.resolve("elasticsearch.yml"); + if (Files.exists(configFilePath)) { + // In docker we might not even have a file, and if we do it's not in the host's FS + String configFile = Files.readString(configFilePath, StandardCharsets.UTF_8); + enrollmentEnabled = configFile.contains("xpack.security.enrollment.enabled: true"); + httpSslEnabled = configFile.contains("xpack.security.http.ssl.enabled: true"); + } + if (enrollmentEnabled && httpSslEnabled) { + assert Files.exists(caCert) == false; + Path autoConfigTlsDir = Files.list(configPath) + .filter(p -> p.getFileName().toString().startsWith("tls_auto_config_initial_node_")) + .findFirst() + .get(); + caCert = autoConfigTlsDir.resolve("http_ca.crt"); + logger.info("Node has TLS auto-configured [" + caCert + "]"); + assert Files.exists(caCert); + } else if (Files.exists(caCert) == false) { + logger.info("No TLS certificate configured"); + caCert = null; // no cert, so don't use ssl + } + return caCert; + } + public static void waitForElasticsearch( + String status, + String index, + Installation installation, + String username, + String password, + Path caCert + ) throws Exception { Objects.requireNonNull(status); // we loop here rather than letting httpclient handle retries so we can measure the entire waiting time @@ -172,10 +204,8 @@ public static void waitForElasticsearch(String status, String index, Installatio long timeElapsed = 0; boolean started = false; Throwable thrownException = null; - - Path caCert = installation.config("certs/ca/ca.crt"); - if (Files.exists(caCert) == false) { - caCert = null; // no cert, so don't use ssl + if (caCert == null) { + caCert = getCaCert(installation.config); } while (started == false && timeElapsed < waitTime) { @@ -183,7 +213,7 @@ public static void waitForElasticsearch(String status, String index, Installatio try { final HttpResponse response = execute( - Request.Get("http://localhost:9200/_cluster/health") + Request.Get((caCert != null ? "https" : "http") + "://localhost:9200/_cluster/health") .connectTimeout((int) timeoutLength) .socketTimeout((int) timeoutLength), username, @@ -223,9 +253,18 @@ public static void waitForElasticsearch(String status, String index, Installatio final String url; if (index == null) { - url = "http://localhost:9200/_cluster/health?wait_for_status=" + status + "&timeout=60s&pretty"; + url = (caCert != null ? "https" : "http") + + "://localhost:9200/_cluster/health?wait_for_status=" + + status + + "&timeout=60s" + + "&pretty"; } else { - url = "http://localhost:9200/_cluster/health/" + index + "?wait_for_status=" + status + "&timeout=60s&pretty"; + url = (caCert != null ? "https" : "http") + + "://localhost:9200/_cluster/health/" + + index + + "?wait_for_status=" + + status + + "&timeout=60s&pretty"; } final String body = makeRequest(Request.Get(url), username, password, caCert); diff --git a/qa/os/src/test/java/org/elasticsearch/packaging/util/docker/Docker.java b/qa/os/src/test/java/org/elasticsearch/packaging/util/docker/Docker.java index 117ffcd52b79c..ba014f4c5c474 100644 --- a/qa/os/src/test/java/org/elasticsearch/packaging/util/docker/Docker.java +++ b/qa/os/src/test/java/org/elasticsearch/packaging/util/docker/Docker.java @@ -460,7 +460,7 @@ public static void waitForElasticsearch(Installation installation) throws Except public static void waitForElasticsearch(String status, String index, Installation installation, String username, String password) throws Exception { - withLogging(() -> ServerUtils.waitForElasticsearch(status, index, installation, username, password)); + withLogging(() -> ServerUtils.waitForElasticsearch(status, index, installation, username, password, null)); } public static void waitForElasticsearch(Installation installation, String username, String password) { diff --git a/x-pack/plugin/security/src/main/bin/elasticsearch-security-config.bat b/x-pack/plugin/security/src/main/bin/elasticsearch-security-config.bat index 189495c765da1..0b3070df8a65f 100644 --- a/x-pack/plugin/security/src/main/bin/elasticsearch-security-config.bat +++ b/x-pack/plugin/security/src/main/bin/elasticsearch-security-config.bat @@ -11,7 +11,7 @@ setlocal enableextensions set ES_MAIN_CLASS=org.elasticsearch.xpack.security.cli.ConfigInitialNode set ES_ADDITIONAL_SOURCES=x-pack-env;x-pack-security-env set ES_ADDITIONAL_CLASSPATH_DIRECTORIES=lib/tools/security-cli -call "%~dp0elasticsearch-cli.bat -strict" ^ +call "%~dp0elasticsearch-cli.bat" "-strict" ^ %%* ^ || goto exit diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/GenerateInitialBuiltinUsersPasswordListener.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/GenerateInitialBuiltinUsersPasswordListener.java deleted file mode 100644 index bc11a678bdb16..0000000000000 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/GenerateInitialBuiltinUsersPasswordListener.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * 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.security; - -import org.apache.log4j.LogManager; -import org.apache.log4j.Logger; -import org.elasticsearch.action.ActionListener; -import org.elasticsearch.action.DocWriteRequest; -import org.elasticsearch.action.support.WriteRequest; -import org.elasticsearch.bootstrap.BootstrapInfo; -import org.elasticsearch.common.settings.SecureString; -import org.elasticsearch.core.Nullable; -import org.elasticsearch.index.engine.VersionConflictEngineException; -import org.elasticsearch.xpack.core.security.user.ElasticUser; -import org.elasticsearch.xpack.core.security.user.KibanaSystemUser; -import org.elasticsearch.xpack.security.authc.esnative.NativeUsersStore; -import org.elasticsearch.xpack.security.support.SecurityIndexManager; - -import java.io.PrintStream; -import java.util.function.BiConsumer; - -import static org.elasticsearch.xpack.security.tool.CommandUtils.generatePassword; - -public class GenerateInitialBuiltinUsersPasswordListener implements BiConsumer { - - private static final Logger LOGGER = LogManager.getLogger(GenerateInitialBuiltinUsersPasswordListener.class); - private final NativeUsersStore nativeUsersStore; - private final SecurityIndexManager securityIndexManager; - - public GenerateInitialBuiltinUsersPasswordListener(NativeUsersStore nativeUsersStore, SecurityIndexManager securityIndexManager) { - this.nativeUsersStore = nativeUsersStore; - this.securityIndexManager = securityIndexManager; - } - - @Override - public void accept(SecurityIndexManager.State previousState, SecurityIndexManager.State currentState) { - final PrintStream out = BootstrapInfo.getOriginalStandardOut(); - // Check if it has been closed, try to write something so that we trigger PrintStream#ensureOpen - out.println(); - if (out.checkError()) { - outputOnError(null); - return; - } - if (previousState.equals(SecurityIndexManager.State.UNRECOVERED_STATE) - && currentState.equals(SecurityIndexManager.State.UNRECOVERED_STATE) == false - && securityIndexManager.indexExists() == false) { - - final SecureString elasticPassword = new SecureString(generatePassword(20)); - final SecureString kibanaSystemPassword = new SecureString(generatePassword(20)); - nativeUsersStore - .updateReservedUser( - ElasticUser.NAME, - elasticPassword.getChars(), - DocWriteRequest.OpType.CREATE, - WriteRequest.RefreshPolicy.IMMEDIATE, - ActionListener.wrap(result -> { - nativeUsersStore - .updateReservedUser( - KibanaSystemUser.NAME, - kibanaSystemPassword.getChars(), - DocWriteRequest.OpType.CREATE, - WriteRequest.RefreshPolicy.IMMEDIATE, - ActionListener.wrap( - r -> { - outputOnSuccess(elasticPassword, kibanaSystemPassword, out); - }, this::outputOnError - ) - ); - }, this::outputOnError)); - securityIndexManager.removeStateListener(this); - } - } - - private void outputOnSuccess(SecureString elasticPassword, SecureString kibanaSystemPassword, PrintStream out) { - out.println(); - out.println("-----------------------------------------------------------------"); - out.println(); - out.println("Password for the elastic user is: " + elasticPassword); - out.println(); - out.println("Password for the kibana_system user is: " + kibanaSystemPassword); - out.println(); - out.println("Please note these down as they will not be shown again."); - out.println(); - out.println(); - out.println("You can use 'bin/elasticsearch-reset-elastic-password' at any time"); - out.println("in order to reset the password for the elastic user."); - out.println(); - out.println("You can use 'bin/elasticsearch-reset-kibana-system-password' at any time"); - out.println("in order to reset the password for the kibana_system user."); - out.println(); - out.println("-----------------------------------------------------------------"); - out.println(); - } - - private void outputOnError(@Nullable Exception e) { - if (e instanceof VersionConflictEngineException == false) { - LOGGER.info(""); - LOGGER.info("-----------------------------------------------------------------"); - LOGGER.info(""); - LOGGER.info("Unable set the password for the elastic and kibana_system users "); - LOGGER.info("automatically."); - LOGGER.info(""); - LOGGER.info("You can use 'bin/elasticsearch-reset-elastic-password'"); - LOGGER.info("in order to set the password for the elastic user."); - LOGGER.info(""); - LOGGER.info("You can use 'bin/elasticsearch-reset-kibana-system-password'"); - LOGGER.info("in order to set the password for the kibana_system user."); - LOGGER.info(""); - LOGGER.info("-----------------------------------------------------------------"); - LOGGER.info(""); - } - if (null != e) { - LOGGER.warn("Error initializing passwords for elastic and kibana_system users", e); - } - } -} diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/InitialSecurityConfigurationListener.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/InitialSecurityConfigurationListener.java new file mode 100644 index 0000000000000..9b1935228aa4b --- /dev/null +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/InitialSecurityConfigurationListener.java @@ -0,0 +1,193 @@ +/* + * 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.security; + +import org.apache.log4j.LogManager; +import org.apache.log4j.Logger; +import org.elasticsearch.action.ActionListener; +import org.elasticsearch.action.DocWriteRequest; +import org.elasticsearch.action.support.GroupedActionListener; +import org.elasticsearch.action.support.WriteRequest; +import org.elasticsearch.bootstrap.BootstrapInfo; +import org.elasticsearch.client.Client; +import org.elasticsearch.common.settings.SecureString; +import org.elasticsearch.core.Nullable; +import org.elasticsearch.env.Environment; +import org.elasticsearch.index.engine.VersionConflictEngineException; +import org.elasticsearch.xpack.core.XPackSettings; +import org.elasticsearch.xpack.core.security.user.ElasticUser; +import org.elasticsearch.xpack.core.ssl.SSLService; +import org.elasticsearch.xpack.security.authc.esnative.NativeUsersStore; +import org.elasticsearch.xpack.security.enrollment.InternalEnrollmentTokenGenerator; +import org.elasticsearch.xpack.security.support.SecurityIndexManager; + +import java.io.PrintStream; +import java.util.HashMap; +import java.util.Map; +import java.util.function.BiConsumer; + +import static org.elasticsearch.xpack.security.authc.esnative.ReservedRealm.AUTOCONFIG_BOOOTSTRAP_ELASTIC_PASSWORD_HASH; +import static org.elasticsearch.xpack.security.authc.esnative.ReservedRealm.BOOTSTRAP_ELASTIC_PASSWORD; +import static org.elasticsearch.xpack.security.tool.CommandUtils.generatePassword; + +public class InitialSecurityConfigurationListener implements BiConsumer { + + private static final String tokenKey = "token"; + private static final String fingerprintKey = "caCertFingerprint"; + private static final String passwordKey = "elasticPassword"; + + private static final Logger LOGGER = LogManager.getLogger(InitialSecurityConfigurationListener.class); + private final NativeUsersStore nativeUsersStore; + private final SecurityIndexManager securityIndexManager; + private final Environment environment; + private final SSLService sslService; + private final Client client; + + public InitialSecurityConfigurationListener( + NativeUsersStore nativeUsersStore, + SecurityIndexManager securityIndexManager, + SSLService sslService, + Client client, + Environment environment + ) { + this.nativeUsersStore = nativeUsersStore; + this.securityIndexManager = securityIndexManager; + this.sslService = sslService; + this.client = client; + this.environment = environment; + } + + @Override + public void accept(SecurityIndexManager.State previousState, SecurityIndexManager.State currentState) { + final PrintStream out = BootstrapInfo.getOriginalStandardOut(); + // Check if it has been closed, try to write something so that we trigger PrintStream#ensureOpen + out.println(); + if (out.checkError()) { + outputOnError(null); + return; + } + if (previousState.equals(SecurityIndexManager.State.UNRECOVERED_STATE) + && currentState.equals(SecurityIndexManager.State.UNRECOVERED_STATE) == false + && securityIndexManager.indexExists() == false + && XPackSettings.ENROLLMENT_ENABLED.get(environment.settings())) { + GroupedActionListener> groupedActionListener = new GroupedActionListener<>(ActionListener.wrap(results -> { + final Map allResultsMap = new HashMap<>(); + for (Map result : results) { + allResultsMap.putAll(result); + } + final String password = allResultsMap.get(passwordKey); + final String token = allResultsMap.get(tokenKey); + final String caCertFingerprint = allResultsMap.get(fingerprintKey); + outputInformationToConsole(password, token, caCertFingerprint, out); + }, this::outputOnError), 2); + + if (false == BOOTSTRAP_ELASTIC_PASSWORD.exists(environment.settings()) + && false == AUTOCONFIG_BOOOTSTRAP_ELASTIC_PASSWORD_HASH.exists(environment.settings())) { + final SecureString elasticPassword = new SecureString(generatePassword(20)); + nativeUsersStore.updateReservedUser( + ElasticUser.NAME, + elasticPassword.getChars(), + DocWriteRequest.OpType.CREATE, + WriteRequest.RefreshPolicy.IMMEDIATE, + groupedActionListener.map(ignore -> Map.of(passwordKey, elasticPassword.toString())) + ); + } else { + groupedActionListener.onResponse(Map.of()); + } + final InternalEnrollmentTokenGenerator enrollmentTokenGenerator = new InternalEnrollmentTokenGenerator( + environment, + sslService, + client + ); + enrollmentTokenGenerator.createKibanaEnrollmentToken( + groupedActionListener.map(token -> token == null ? Map.of() : Map.of(tokenKey, token.getEncoded(), fingerprintKey, + token.getFingerprint())) + ); + securityIndexManager.removeStateListener(this); + } + } + + private void outputInformationToConsole(String elasticPassword, String enrollmentToken, String caCertFingerprint, PrintStream out) { + StringBuilder builder = new StringBuilder(); + builder.append(System.lineSeparator()); + builder.append(System.lineSeparator()); + builder.append("-----------------------------------------------------------------"); + builder.append(System.lineSeparator()); + builder.append(System.lineSeparator()); + if (null != elasticPassword) { + builder.append("Password for the elastic user is: "); + builder.append(elasticPassword); + } else { + builder.append("Unable to set the password for the elastic user automatically"); + } + builder.append(System.lineSeparator()); + builder.append(System.lineSeparator()); + if (null != enrollmentToken) { + builder.append("Enrollment token for kibana, valid for the next 30 minutes:"); + builder.append(System.lineSeparator()); + builder.append(enrollmentToken); + builder.append(System.lineSeparator()); + } else { + builder.append("Unable to generate an enrollment token for kibana automatically"); + builder.append(System.lineSeparator()); + } + builder.append(System.lineSeparator()); + if (null != caCertFingerprint) { + builder.append("Fingerprint of the generated CA certificate for HTTP:"); + builder.append(System.lineSeparator()); + builder.append(caCertFingerprint); + builder.append(System.lineSeparator()); + } + builder.append(System.lineSeparator()); + builder.append(System.lineSeparator()); + builder.append("You can use 'bin/elasticsearch-reset-elastic-password' at any time"); + builder.append(System.lineSeparator()); + builder.append("in order to set or reset the password for the elastic user."); + builder.append(System.lineSeparator()); + builder.append(System.lineSeparator()); + builder.append("You can use 'bin/elasticsearch-create-enrollment-token -s kibana' at any time"); + builder.append(System.lineSeparator()); + builder.append("in order to get a new, valid, enrollment token for kibana."); + builder.append(System.lineSeparator()); + builder.append(System.lineSeparator()); + builder.append("You can use 'bin/elasticsearch-create-enrollment-token -s node' at any time"); + builder.append(System.lineSeparator()); + builder.append("in order to get a new, valid, enrollment token for new elasticsearch nodes."); + builder.append(System.lineSeparator()); + builder.append(System.lineSeparator()); + builder.append("-----------------------------------------------------------------"); + builder.append(System.lineSeparator()); + builder.append(System.lineSeparator()); + out.println(builder); + } + + private void outputOnError(@Nullable Exception e) { + if (e instanceof VersionConflictEngineException == false) { + LOGGER.info(""); + LOGGER.info("-----------------------------------------------------------------"); + LOGGER.info(""); + LOGGER.info("Unable set the password for the elastic and generate a kibana "); + LOGGER.info("enrollment token automatically."); + LOGGER.info(""); + LOGGER.info("You can use 'bin/elasticsearch-reset-elastic-password'"); + LOGGER.info("in order to set the password for the elastic user."); + LOGGER.info(""); + LOGGER.info("You can use 'bin/elasticsearch-create-enrollment-token -s kibana'"); + LOGGER.info("in order to generate an enrollment token for kibana."); + LOGGER.info(""); + LOGGER.info("You can use 'bin/elasticsearch-create-enrollment-token -s node'"); + LOGGER.info("in order to generate an enrollment token for new elasticsearch nodes."); + LOGGER.info(""); + LOGGER.info("-----------------------------------------------------------------"); + LOGGER.info(""); + } + if (null != e) { + LOGGER.warn("Error setting initial password for elastic and generating a kibana enrollment token", e); + } + } +} diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/Security.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/Security.java index a9fca4aff7ba8..0432a2d1b84a4 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/Security.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/Security.java @@ -339,7 +339,6 @@ import static org.elasticsearch.xpack.core.XPackSettings.SECURITY_AUTOCONFIGURATION_ENABLED; import static org.elasticsearch.xpack.core.security.index.RestrictedIndicesNames.SECURITY_MAIN_ALIAS; import static org.elasticsearch.xpack.core.security.index.RestrictedIndicesNames.SECURITY_TOKENS_ALIAS; -import static org.elasticsearch.xpack.security.authc.esnative.ReservedRealm.BOOTSTRAP_ELASTIC_PASSWORD; import static org.elasticsearch.xpack.security.operator.OperatorPrivileges.OPERATOR_PRIVILEGES_ENABLED; import static org.elasticsearch.xpack.security.support.SecurityIndexManager.INTERNAL_MAIN_INDEX_FORMAT; import static org.elasticsearch.xpack.security.support.SecurityIndexManager.INTERNAL_TOKENS_INDEX_FORMAT; @@ -494,11 +493,7 @@ Collection createComponents(Client client, ThreadPool threadPool, Cluste // realms construction final NativeUsersStore nativeUsersStore = new NativeUsersStore(settings, client, securityIndex.get()); - GenerateInitialBuiltinUsersPasswordListener generateInitialBuiltinUsersPasswordListener = - new GenerateInitialBuiltinUsersPasswordListener(nativeUsersStore, securityIndex.get()); - if (BOOTSTRAP_ELASTIC_PASSWORD.exists(settings) == false && SECURITY_AUTOCONFIGURATION_ENABLED.get(settings)) { - securityIndex.get().addStateListener(generateInitialBuiltinUsersPasswordListener); - } + final NativeRoleMappingStore nativeRoleMappingStore = new NativeRoleMappingStore(settings, client, securityIndex.get(), scriptService); final AnonymousUser anonymousUser = new AnonymousUser(settings); @@ -571,6 +566,16 @@ Collection createComponents(Client client, ThreadPool threadPool, Cluste new DeprecationRoleDescriptorConsumer(clusterService, threadPool)); securityIndex.get().addStateListener(allRolesStore::onSecurityIndexStateChange); + if (SECURITY_AUTOCONFIGURATION_ENABLED.get(settings)) { + InitialSecurityConfigurationListener initialSecurityConfigurationListener = new InitialSecurityConfigurationListener( + nativeUsersStore, + securityIndex.get(), + getSslService(), + client, + environment + ); + securityIndex.get().addStateListener(initialSecurityConfigurationListener); + } // to keep things simple, just invalidate all cached entries on license change. this happens so rarely that the impact should be // minimal getLicenseState().addListener(allRolesStore::invalidateAll); diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/enrollment/BaseEnrollmentTokenGenerator.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/enrollment/BaseEnrollmentTokenGenerator.java new file mode 100644 index 0000000000000..3468e3e9d3688 --- /dev/null +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/enrollment/BaseEnrollmentTokenGenerator.java @@ -0,0 +1,86 @@ +/* + * 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.security.enrollment; + +import org.elasticsearch.common.ssl.SslKeyConfig; +import org.elasticsearch.common.ssl.SslUtil; +import org.elasticsearch.common.ssl.StoreKeyConfig; +import org.elasticsearch.core.Tuple; +import org.elasticsearch.xpack.core.ssl.SSLService; + +import java.net.Inet4Address; +import java.net.Inet6Address; +import java.net.InetAddress; +import java.net.URI; +import java.security.PrivateKey; +import java.security.cert.X509Certificate; +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +public class BaseEnrollmentTokenGenerator { + + public BaseEnrollmentTokenGenerator() { + } + + static String getCaFingerprint(SSLService sslService) throws Exception { + final SslKeyConfig keyConfig = sslService.getHttpTransportSSLConfiguration().getKeyConfig(); + if (keyConfig instanceof StoreKeyConfig == false) { + throw new IllegalStateException("Unable to create an enrollment token. Elasticsearch node HTTP layer SSL configuration is " + + "not configured with a keystore"); + } + final List> httpCaKeysAndCertificates = + ((StoreKeyConfig) keyConfig).getKeys().stream() + .filter(t -> t.v2().getBasicConstraints() != -1) + .collect(Collectors.toList()); + if (httpCaKeysAndCertificates.isEmpty()) { + throw new IllegalStateException("Unable to create an enrollment token. Elasticsearch node HTTP layer SSL configuration " + + "Keystore doesn't contain any PrivateKey entries where the associated certificate is a CA certificate"); + } else if (httpCaKeysAndCertificates.size() > 1) { + throw new IllegalStateException("Unable to create an enrollment token. Elasticsearch node HTTP layer SSL configuration " + + "Keystore contains multiple PrivateKey entries where the associated certificate is a CA certificate"); + } + return SslUtil.calculateFingerprint(httpCaKeysAndCertificates.get(0).v2(), "SHA-256"); + } + + static List getFilteredAddresses(List addresses) throws Exception { + List filteredAddresses = new ArrayList<>(); + for (String boundAddress : addresses){ + InetAddress inetAddress = getInetAddressFromString(boundAddress); + if (inetAddress.isLoopbackAddress() != true) { + filteredAddresses.add(boundAddress); + } + } + if (filteredAddresses.isEmpty()) { + filteredAddresses = addresses; + } + // Sort the list prioritizing IPv4 addresses when possible, as it is more probable to be reachable when token consumer iterates + // addresses for the initial node and it is less surprising for users to see in the UI or config + filteredAddresses.sort((String a, String b) -> { + try { + final InetAddress addressA = getInetAddressFromString(a); + final InetAddress addressB = getInetAddressFromString(b); + if (addressA instanceof Inet4Address && addressB instanceof Inet6Address) { + return -1; + } else if (addressA instanceof Inet6Address && addressB instanceof Inet4Address) { + return 1; + } else { + return 0; + } + } catch (Exception e) { + return 0; + } + }); + return filteredAddresses; + } + + private static InetAddress getInetAddressFromString(String address) throws Exception { + URI uri = new URI("http://" + address); + return InetAddress.getByName(uri.getHost()); + } +} diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/enrollment/EnrollmentTokenGenerator.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/enrollment/ExternalEnrollmentTokenGenerator.java similarity index 67% rename from x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/enrollment/EnrollmentTokenGenerator.java rename to x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/enrollment/ExternalEnrollmentTokenGenerator.java index 89381d993daa8..d7469c15056b7 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/enrollment/EnrollmentTokenGenerator.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/enrollment/ExternalEnrollmentTokenGenerator.java @@ -14,9 +14,6 @@ import org.elasticsearch.common.UUIDs; import org.elasticsearch.common.io.Streams; import org.elasticsearch.common.settings.SecureString; -import org.elasticsearch.common.ssl.SslUtil; -import org.elasticsearch.common.ssl.SslKeyConfig; -import org.elasticsearch.common.ssl.StoreKeyConfig; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.core.Tuple; @@ -32,36 +29,29 @@ import java.io.IOException; import java.io.InputStream; import java.net.HttpURLConnection; -import java.net.Inet4Address; -import java.net.Inet6Address; -import java.net.InetAddress; import java.net.MalformedURLException; -import java.net.URI; import java.net.URISyntaxException; import java.net.URL; -import java.security.PrivateKey; -import java.security.cert.X509Certificate; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.stream.Collectors; -public class EnrollmentTokenGenerator { +public class ExternalEnrollmentTokenGenerator extends BaseEnrollmentTokenGenerator { protected static final String ENROLL_API_KEY_EXPIRATION = "30m"; - private static final Logger logger = LogManager.getLogger(EnrollmentTokenGenerator.class); + private static final Logger logger = LogManager.getLogger(ExternalEnrollmentTokenGenerator.class); private final Environment environment; private final SSLService sslService; private final CommandLineHttpClient client; private final URL defaultUrl; - public EnrollmentTokenGenerator(Environment environment) throws MalformedURLException { + public ExternalEnrollmentTokenGenerator(Environment environment) throws MalformedURLException { this(environment, new CommandLineHttpClient(environment)); } // protected for testing - protected EnrollmentTokenGenerator(Environment environment, CommandLineHttpClient client) throws MalformedURLException { + protected ExternalEnrollmentTokenGenerator(Environment environment, CommandLineHttpClient client) throws MalformedURLException { this.environment = environment; this.sslService = new SSLService(environment); this.client = client; @@ -80,7 +70,7 @@ protected EnrollmentToken create(String user, SecureString password, String acti if (XPackSettings.ENROLLMENT_ENABLED.get(environment.settings()) != true) { throw new IllegalStateException("[xpack.security.enrollment.enabled] must be set to `true` to create an enrollment token"); } - final String fingerprint = getCaFingerprint(); + final String fingerprint = getCaFingerprint(sslService); final String apiKey = getApiKeyCredentials(user, password, action); final Tuple, String> httpInfo = getNodeInfo(user, password); return new EnrollmentToken(apiKey, fingerprint, httpInfo.v2(), httpInfo.v1()); @@ -181,59 +171,4 @@ protected Tuple, String> getNodeInfo(String user, SecureString pass return new Tuple<>(filteredAddresses, stackVersion); } - protected String getCaFingerprint() throws Exception { - final SslKeyConfig keyConfig = sslService.getHttpTransportSSLConfiguration().getKeyConfig(); - if (keyConfig instanceof StoreKeyConfig == false) { - throw new IllegalStateException("Unable to create an enrollment token. Elasticsearch node HTTP layer SSL configuration is " + - "not configured with a keystore"); - } - final List> httpCaKeysAndCertificates = - ((StoreKeyConfig) keyConfig).getKeys().stream() - .filter(t -> t.v2().getBasicConstraints() != -1) - .collect(Collectors.toList()); - if (httpCaKeysAndCertificates.isEmpty()) { - throw new IllegalStateException("Unable to create an enrollment token. Elasticsearch node HTTP layer SSL configuration " + - "Keystore doesn't contain any PrivateKey entries where the associated certificate is a CA certificate"); - } else if (httpCaKeysAndCertificates.size() > 1) { - throw new IllegalStateException("Unable to create an enrollment token. Elasticsearch node HTTP layer SSL configuration " + - "Keystore contains multiple PrivateKey entries where the associated certificate is a CA certificate"); - } - return SslUtil.calculateFingerprint(httpCaKeysAndCertificates.get(0).v2(), "SHA-256"); - } - - static List getFilteredAddresses(List addresses) throws Exception { - List filteredAddresses = new ArrayList<>(); - for (String boundAddress : addresses){ - InetAddress inetAddress = getInetAddressFromString(boundAddress); - if (inetAddress.isLoopbackAddress() != true) { - filteredAddresses.add(boundAddress); - } - } - if (filteredAddresses.isEmpty()) { - filteredAddresses = addresses; - } - // Sort the list prioritizing IPv4 addresses when possible, as it is more probable to be reachable when token consumer iterates - // addresses for the initial node and it is less surprising for users to see in the UI or config - filteredAddresses.sort((String a, String b) -> { - try { - final InetAddress addressA = getInetAddressFromString(a); - final InetAddress addressB = getInetAddressFromString(b); - if (addressA instanceof Inet4Address && addressB instanceof Inet6Address) { - return -1; - } else if (addressA instanceof Inet6Address && addressB instanceof Inet4Address) { - return 1; - } else { - return 0; - } - } catch (Exception e) { - return 0; - } - }); - return filteredAddresses; - } - - private static InetAddress getInetAddressFromString(String address) throws Exception { - URI uri = new URI("http://" + address); - return InetAddress.getByName(uri.getHost()); - } } diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/enrollment/InternalEnrollmentTokenGenerator.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/enrollment/InternalEnrollmentTokenGenerator.java new file mode 100644 index 0000000000000..6e8f82b301551 --- /dev/null +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/enrollment/InternalEnrollmentTokenGenerator.java @@ -0,0 +1,124 @@ +/* + * 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.security.enrollment; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.elasticsearch.Version; +import org.elasticsearch.action.ActionListener; +import org.elasticsearch.action.admin.cluster.node.info.NodeInfo; +import org.elasticsearch.action.admin.cluster.node.info.NodesInfoAction; +import org.elasticsearch.action.admin.cluster.node.info.NodesInfoRequest; +import org.elasticsearch.client.Client; +import org.elasticsearch.client.OriginSettingClient; +import org.elasticsearch.common.UUIDs; +import org.elasticsearch.common.transport.TransportAddress; +import org.elasticsearch.core.TimeValue; +import org.elasticsearch.env.Environment; +import org.elasticsearch.http.HttpInfo; +import org.elasticsearch.xpack.core.XPackSettings; +import org.elasticsearch.xpack.core.security.EnrollmentToken; +import org.elasticsearch.xpack.core.security.action.CreateApiKeyAction; +import org.elasticsearch.xpack.core.security.action.CreateApiKeyRequest; +import org.elasticsearch.xpack.core.security.action.enrollment.KibanaEnrollmentAction; +import org.elasticsearch.xpack.core.security.action.enrollment.NodeEnrollmentAction; +import org.elasticsearch.xpack.core.security.authz.RoleDescriptor; +import org.elasticsearch.xpack.core.ssl.SSLService; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + +import static org.elasticsearch.xpack.core.ClientHelper.SECURITY_ORIGIN; + +public class InternalEnrollmentTokenGenerator extends BaseEnrollmentTokenGenerator { + protected static final long ENROLL_API_KEY_EXPIRATION = 30L; + + private static final Logger LOGGER = LogManager.getLogger(InternalEnrollmentTokenGenerator.class); + private final Environment environment; + private final SSLService sslService; + private final Client client; + + public InternalEnrollmentTokenGenerator(Environment environment, SSLService sslService, Client client) { + this.environment = environment; + this.sslService = sslService; + this.client = new OriginSettingClient(client, SECURITY_ORIGIN); + } + + /** + * Creates an enrollment token for an elasticsearch node + * @param tokenListener The listener to be notified with the result. It will be passed the {@link EnrollmentToken} if creation was + * successful, null otherwise. + */ + public void createNodeEnrollmentToken(ActionListener tokenListener) { + create(NodeEnrollmentAction.NAME, tokenListener); + } + + /** + * Creates an enrollment token for a kibana instance + * @param tokenListener The listener to be notified with the result. It will be passed the {@link EnrollmentToken} if creation was + * successful, null otherwise. + */ + public void createKibanaEnrollmentToken(ActionListener tokenListener) { + create(KibanaEnrollmentAction.NAME, tokenListener); + } + + protected void create(String action, ActionListener listener) { + if (XPackSettings.ENROLLMENT_ENABLED.get(environment.settings()) != true) { + LOGGER.warn("[xpack.security.enrollment.enabled] must be set to `true` to create an enrollment token"); + listener.onResponse(null); + return; + } + final String fingerprint; + try { + fingerprint = getCaFingerprint(sslService); + } catch (Exception e) { + LOGGER.warn( + "Error creating an Enrollment Token.Failed to get the fingerprint of the CA Certificate for the HTTP layer of elasticsearch" + ); + listener.onResponse(null); + return; + } + final CreateApiKeyRequest apiKeyRequest = new CreateApiKeyRequest( + "enrollment_token_API_key_" + UUIDs.base64UUID(), + List.of(new RoleDescriptor("create_enrollment_token", new String[] { action }, null, null)), + TimeValue.timeValueMinutes(ENROLL_API_KEY_EXPIRATION) + ); + + client.execute(CreateApiKeyAction.INSTANCE, apiKeyRequest, ActionListener.wrap(createApiKeyResponse -> { + final String apiKey = createApiKeyResponse.getId() + ":" + createApiKeyResponse.getKey().toString(); + final NodesInfoRequest nodesInfoRequest = new NodesInfoRequest().nodesIds("_local") + .addMetric(NodesInfoRequest.Metric.HTTP.metricName()); + final List httpAddressesList = new ArrayList<>(); + client.execute(NodesInfoAction.INSTANCE, nodesInfoRequest, ActionListener.wrap(response -> { + for (NodeInfo nodeInfo : response.getNodes()) { + httpAddressesList.addAll( + Arrays.stream(nodeInfo.getInfo(HttpInfo.class).getAddress().boundAddresses()) + .map(TransportAddress::toString) + .collect(Collectors.toList()) + ); + } + final EnrollmentToken enrollmentToken = new EnrollmentToken( + apiKey, + fingerprint, + Version.CURRENT.toString(), + httpAddressesList + ); + listener.onResponse(enrollmentToken); + }, e -> { + LOGGER.warn("Error creating an Enrollment Token. Failed to get HTTP info from the Nodes Info API", e); + listener.onResponse(null); + })); + }, e -> { + LOGGER.warn("Error creating an Enrollment Token. Failed to generate API key", e); + listener.onResponse(null); + })); + } + +} diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/enrollment/tool/BootstrapPasswordAndEnrollmentTokenForInitialNode.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/enrollment/tool/BootstrapPasswordAndEnrollmentTokenForInitialNode.java deleted file mode 100644 index 38ecc8d709dc1..0000000000000 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/enrollment/tool/BootstrapPasswordAndEnrollmentTokenForInitialNode.java +++ /dev/null @@ -1,144 +0,0 @@ -/* - * 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.security.enrollment.tool; - -import joptsimple.OptionSet; -import joptsimple.OptionSpec; - -import org.elasticsearch.cli.ExitCodes; -import org.elasticsearch.cli.KeyStoreAwareCommand; -import org.elasticsearch.cli.Terminal; -import org.elasticsearch.cli.UserException; -import org.elasticsearch.common.Strings; -import org.elasticsearch.common.settings.KeyStoreWrapper; -import org.elasticsearch.common.settings.SecureString; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; -import org.elasticsearch.core.CheckedFunction; -import org.elasticsearch.env.Environment; -import org.elasticsearch.xpack.core.security.user.ElasticUser; -import org.elasticsearch.xpack.security.authc.esnative.ReservedRealm; -import org.elasticsearch.xpack.core.security.EnrollmentToken; -import org.elasticsearch.xpack.security.enrollment.EnrollmentTokenGenerator; -import org.elasticsearch.xpack.core.security.CommandLineHttpClient; -import org.elasticsearch.xpack.core.security.HttpResponse; - -import java.io.IOException; -import java.net.HttpURLConnection; -import java.net.MalformedURLException; -import java.net.URISyntaxException; -import java.net.URL; -import java.util.function.Function; - -import static org.elasticsearch.xpack.core.security.CommandLineHttpClient.createURL; -import static org.elasticsearch.xpack.security.tool.CommandUtils.generatePassword; - -public class BootstrapPasswordAndEnrollmentTokenForInitialNode extends KeyStoreAwareCommand { - private final CheckedFunction createEnrollmentTokenFunction; - private final Function clientFunction; - private final CheckedFunction keyStoreFunction; - private final OptionSpec includeNodeEnrollmentToken; - - BootstrapPasswordAndEnrollmentTokenForInitialNode() { - this( - environment -> new CommandLineHttpClient(environment), - environment -> KeyStoreWrapper.load(environment.configFile()), - environment -> new EnrollmentTokenGenerator(environment) - ); - } - - BootstrapPasswordAndEnrollmentTokenForInitialNode(Function clientFunction, - CheckedFunction keyStoreFunction, - CheckedFunction - createEnrollmentTokenFunction){ - super("Set elastic password and generate enrollment token for initial node"); - this.clientFunction = clientFunction; - this.keyStoreFunction = keyStoreFunction; - this.createEnrollmentTokenFunction = createEnrollmentTokenFunction; - includeNodeEnrollmentToken = parser.accepts("include-node-enrollment-token", "determine that we have to generate " + - "a node enrollment token"); - } - - public static void main(String[] args) throws Exception { - exit(new BootstrapPasswordAndEnrollmentTokenForInitialNode().main(args, Terminal.DEFAULT)); - } - - @Override - protected void execute(Terminal terminal, OptionSet options, Environment env) throws Exception { - final SecureString keystorePassword; - try { - keystorePassword = new SecureString(terminal.readSecret("")); - } catch (Exception e) { - throw new UserException(ExitCodes.USAGE, null); - } - - final Environment secureEnvironment = readSecureSettings(env, keystorePassword); - final CommandLineHttpClient client = clientFunction.apply(secureEnvironment); - final EnrollmentTokenGenerator enrollmentTokenGenerator = createEnrollmentTokenFunction.apply(secureEnvironment); - final SecureString bootstrapPassword = ReservedRealm.BOOTSTRAP_ELASTIC_PASSWORD.get(secureEnvironment.settings()); - try { - String output; - client.checkClusterHealthWithRetriesWaitingForCluster(ElasticUser.NAME, bootstrapPassword, 15); - final EnrollmentToken kibanaToken = enrollmentTokenGenerator.createKibanaEnrollmentToken(ElasticUser.NAME, bootstrapPassword); - output = "Kibana enrollment token: " + kibanaToken.getEncoded() + System.lineSeparator(); - output += "CA fingerprint: " + kibanaToken.getFingerprint() + System.lineSeparator(); - if (options.has(includeNodeEnrollmentToken)) { - final EnrollmentToken nodeToken = enrollmentTokenGenerator.createNodeEnrollmentToken(ElasticUser.NAME, bootstrapPassword); - output += "Node enrollment token: " + nodeToken.getEncoded() + System.lineSeparator(); - } - if (ReservedRealm.BOOTSTRAP_ELASTIC_PASSWORD.exists(secureEnvironment.settings()) == false) { - output += "elastic user password: " + setElasticUserPassword(client, bootstrapPassword); - } - terminal.println(output); - } catch (Exception e) { - throw new UserException(ExitCodes.UNAVAILABLE, null); - } - } - - protected SecureString setElasticUserPassword(CommandLineHttpClient client, SecureString bootstrapPassword) throws Exception { - final URL passwordSetUrl = setElasticUserPasswordUrl(client); - final HttpResponse response; - SecureString password = new SecureString(generatePassword(20)); - try { - response = client.execute("POST", passwordSetUrl, ElasticUser.NAME, bootstrapPassword, - () -> { - XContentBuilder xContentBuilder = JsonXContent.contentBuilder(); - xContentBuilder.startObject().field("password", password.toString()).endObject(); - return Strings.toString(xContentBuilder); - }, CommandLineHttpClient::responseBuilder); - if (response.getHttpStatus() != HttpURLConnection.HTTP_OK) { - throw new UserException(ExitCodes.UNAVAILABLE, null); - } - } catch (IOException e) { - throw new UserException(ExitCodes.IO_ERROR, null); - } - return password; - } - - Environment readSecureSettings(Environment env, SecureString keystorePassword) throws Exception { - final KeyStoreWrapper keyStoreWrapper = keyStoreFunction.apply(env); - keyStoreWrapper.decrypt(keystorePassword.getChars()); - Settings.Builder settingsBuilder = Settings.builder(); - settingsBuilder.put(env.settings(), true); - if (settingsBuilder.getSecureSettings() == null) { - settingsBuilder.setSecureSettings(keyStoreWrapper); - } - final Settings settings = settingsBuilder.build(); - return new Environment(settings, env.configFile()); - } - - public static URL checkClusterHealthUrl(CommandLineHttpClient client) throws MalformedURLException, URISyntaxException { - return createURL(new URL(client.getDefaultURL()), "_cluster/health", "?pretty"); - } - - public static URL setElasticUserPasswordUrl(CommandLineHttpClient client) throws MalformedURLException, URISyntaxException { - return createURL(new URL(client.getDefaultURL()), "/_security/user/" + ElasticUser.NAME + "/_password", - "?pretty"); - } -} diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/enrollment/tool/CreateEnrollmentTokenTool.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/enrollment/tool/CreateEnrollmentTokenTool.java index a5dc2947cc7b1..2314ca4009924 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/enrollment/tool/CreateEnrollmentTokenTool.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/enrollment/tool/CreateEnrollmentTokenTool.java @@ -18,7 +18,7 @@ import org.elasticsearch.core.CheckedFunction; import org.elasticsearch.env.Environment; import org.elasticsearch.xpack.core.XPackSettings; -import org.elasticsearch.xpack.security.enrollment.EnrollmentTokenGenerator; +import org.elasticsearch.xpack.security.enrollment.ExternalEnrollmentTokenGenerator; import org.elasticsearch.xpack.security.tool.BaseRunAsSuperuserCommand; import org.elasticsearch.xpack.core.security.CommandLineHttpClient; @@ -28,21 +28,21 @@ public class CreateEnrollmentTokenTool extends BaseRunAsSuperuserCommand { private final OptionSpec scope; - private final CheckedFunction createEnrollmentTokenFunction; + private final CheckedFunction createEnrollmentTokenFunction; static final List ALLOWED_SCOPES = List.of("node", "kibana"); CreateEnrollmentTokenTool() { this( environment -> new CommandLineHttpClient(environment), environment -> KeyStoreWrapper.load(environment.configFile()), - environment -> new EnrollmentTokenGenerator(environment) + environment -> new ExternalEnrollmentTokenGenerator(environment) ); } CreateEnrollmentTokenTool( Function clientFunction, CheckedFunction keyStoreFunction, - CheckedFunction createEnrollmentTokenFunction + CheckedFunction createEnrollmentTokenFunction ) { super(clientFunction, keyStoreFunction, "Creates enrollment tokens for elasticsearch nodes and kibana instances"); this.createEnrollmentTokenFunction = createEnrollmentTokenFunction; @@ -75,11 +75,11 @@ protected void executeCommand(Terminal terminal, OptionSet options, Environment throws Exception { final String tokenScope = scope.value(options); try { - EnrollmentTokenGenerator enrollmentTokenGenerator = createEnrollmentTokenFunction.apply(env); + ExternalEnrollmentTokenGenerator externalEnrollmentTokenGenerator = createEnrollmentTokenFunction.apply(env); if (tokenScope.equals("node")) { - terminal.println(enrollmentTokenGenerator.createNodeEnrollmentToken(username, password).getEncoded()); + terminal.println(externalEnrollmentTokenGenerator.createNodeEnrollmentToken(username, password).getEncoded()); } else { - terminal.println(enrollmentTokenGenerator.createKibanaEnrollmentToken(username, password).getEncoded()); + terminal.println(externalEnrollmentTokenGenerator.createKibanaEnrollmentToken(username, password).getEncoded()); } } catch (Exception e) { terminal.errorPrintln("Unable to create enrollment token for scope [" + tokenScope + "]"); diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/enrollment/EnrollmentTokenGeneratorTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/enrollment/ExternalEnrollmentTokenGeneratorTests.java similarity index 86% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/enrollment/EnrollmentTokenGeneratorTests.java rename to x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/enrollment/ExternalEnrollmentTokenGeneratorTests.java index 784dc7750ce5c..fc430c00b5a4b 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/enrollment/EnrollmentTokenGeneratorTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/enrollment/ExternalEnrollmentTokenGeneratorTests.java @@ -41,7 +41,7 @@ import static org.elasticsearch.test.CheckedFunctionUtils.anyCheckedFunction; import static org.elasticsearch.test.CheckedFunctionUtils.anyCheckedSupplier; -import static org.elasticsearch.xpack.security.enrollment.EnrollmentTokenGenerator.getFilteredAddresses; +import static org.elasticsearch.xpack.security.enrollment.ExternalEnrollmentTokenGenerator.getFilteredAddresses; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasSize; import static org.mockito.Matchers.any; @@ -50,7 +50,7 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -public class EnrollmentTokenGeneratorTests extends ESTestCase { +public class ExternalEnrollmentTokenGeneratorTests extends ESTestCase { private Environment environment; @BeforeClass @@ -84,9 +84,9 @@ public void setupMocks() throws Exception { public void testCreateSuccess() throws Exception { final CommandLineHttpClient client = mock(CommandLineHttpClient.class); when(client.getDefaultURL()).thenReturn("http://localhost:9200"); - final EnrollmentTokenGenerator enrollmentTokenGenerator = new EnrollmentTokenGenerator(environment, client); - final URL createAPIKeyURL = enrollmentTokenGenerator.createAPIKeyUrl(); - final URL getHttpInfoURL = enrollmentTokenGenerator.getHttpInfoUrl(); + final ExternalEnrollmentTokenGenerator externalEnrollmentTokenGenerator = new ExternalEnrollmentTokenGenerator(environment, client); + final URL createAPIKeyURL = externalEnrollmentTokenGenerator.createAPIKeyUrl(); + final URL getHttpInfoURL = externalEnrollmentTokenGenerator.getHttpInfoUrl(); final HttpResponse httpResponseOK = new HttpResponse(HttpURLConnection.HTTP_OK, new HashMap<>()); when(client.execute(anyString(), any(URL.class), anyString(), any(SecureString.class), anyCheckedSupplier(), @@ -131,8 +131,10 @@ public void testCreateSuccess() throws Exception { anyCheckedSupplier(), anyCheckedFunction())) .thenReturn(createHttpResponse(HttpURLConnection.HTTP_OK, getHttpInfoResponseBody)); - final String tokenNode = enrollmentTokenGenerator.createNodeEnrollmentToken("elastic", new SecureString("elastic".toCharArray())) - .getEncoded(); + final String tokenNode = externalEnrollmentTokenGenerator.createNodeEnrollmentToken( + "elastic", + new SecureString("elastic".toCharArray()) + ).getEncoded(); Map infoNode = getDecoded(tokenNode); assertEquals("8.0.0", infoNode.get("ver")); @@ -140,7 +142,7 @@ public void testCreateSuccess() throws Exception { assertEquals("ce480d53728605674fcfd8ffb51000d8a33bf32de7c7f1e26b4d428f8a91362d", infoNode.get("fgr")); assertEquals("DR6CzXkBDf8amV_48yYX:x3YqU_rqQwm-ESrkExcnOg", infoNode.get("key")); - final String tokenKibana = enrollmentTokenGenerator.createKibanaEnrollmentToken("elastic", + final String tokenKibana = externalEnrollmentTokenGenerator.createKibanaEnrollmentToken("elastic", new SecureString("elastic".toCharArray())).getEncoded(); Map infoKibana = getDecoded(tokenKibana); @@ -153,24 +155,24 @@ public void testCreateSuccess() throws Exception { public void testFailedCreateApiKey() throws Exception { final CommandLineHttpClient client = mock(CommandLineHttpClient.class); when(client.getDefaultURL()).thenReturn("http://localhost:9200"); - final EnrollmentTokenGenerator enrollmentTokenGenerator = new EnrollmentTokenGenerator(environment, client); - final URL createAPIKeyURL = enrollmentTokenGenerator.createAPIKeyUrl(); + final ExternalEnrollmentTokenGenerator externalEnrollmentTokenGenerator = new ExternalEnrollmentTokenGenerator(environment, client); + final URL createAPIKeyURL = externalEnrollmentTokenGenerator.createAPIKeyUrl(); final HttpResponse httpResponseNotOK = new HttpResponse(HttpURLConnection.HTTP_BAD_REQUEST, new HashMap<>()); when(client.execute(anyString(), eq(createAPIKeyURL), anyString(), any(SecureString.class), anyCheckedSupplier(), anyCheckedFunction())).thenReturn(httpResponseNotOK); IllegalStateException ex = expectThrows(IllegalStateException.class, () -> - enrollmentTokenGenerator.createNodeEnrollmentToken("elastic", new SecureString("elastic".toCharArray())).getEncoded()); + externalEnrollmentTokenGenerator.createNodeEnrollmentToken("elastic", new SecureString("elastic".toCharArray())).getEncoded()); assertThat(ex.getMessage(), Matchers.containsString("Unexpected response code [400] from calling POST ")); } public void testFailedRetrieveHttpInfo() throws Exception { final CommandLineHttpClient client = mock(CommandLineHttpClient.class); when(client.getDefaultURL()).thenReturn("http://localhost:9200"); - final EnrollmentTokenGenerator enrollmentTokenGenerator = new EnrollmentTokenGenerator(environment, client); - final URL createAPIKeyURL = enrollmentTokenGenerator.createAPIKeyUrl(); - final URL getHttpInfoURL = enrollmentTokenGenerator.getHttpInfoUrl(); + final ExternalEnrollmentTokenGenerator externalEnrollmentTokenGenerator = new ExternalEnrollmentTokenGenerator(environment, client); + final URL createAPIKeyURL = externalEnrollmentTokenGenerator.createAPIKeyUrl(); + final URL getHttpInfoURL = externalEnrollmentTokenGenerator.getHttpInfoUrl(); final HttpResponse httpResponseOK = new HttpResponse(HttpURLConnection.HTTP_OK, new HashMap<>()); when(client.execute(anyString(), eq(createAPIKeyURL), anyString(), any(SecureString.class), anyCheckedSupplier(), @@ -195,7 +197,7 @@ public void testFailedRetrieveHttpInfo() throws Exception { anyCheckedFunction())).thenReturn(httpResponseNotOK); IllegalStateException ex = expectThrows(IllegalStateException.class, () -> - enrollmentTokenGenerator.createNodeEnrollmentToken("elastic", new SecureString("elastic".toCharArray())).getEncoded()); + externalEnrollmentTokenGenerator.createNodeEnrollmentToken("elastic", new SecureString("elastic".toCharArray())).getEncoded()); assertThat(ex.getMessage(), Matchers.containsString("Unexpected response code [400] from calling GET ")); } @@ -220,9 +222,9 @@ public void testFailedNoCaInKeystore() throws Exception { environment = new Environment(settings, tempDir); final CommandLineHttpClient client = mock(CommandLineHttpClient.class); when(client.getDefaultURL()).thenReturn("http://localhost:9200"); - final EnrollmentTokenGenerator enrollmentTokenGenerator = new EnrollmentTokenGenerator(environment, client); - final URL createAPIKeyURL = enrollmentTokenGenerator.createAPIKeyUrl(); - final URL getHttpInfoURL = enrollmentTokenGenerator.getHttpInfoUrl(); + final ExternalEnrollmentTokenGenerator externalEnrollmentTokenGenerator = new ExternalEnrollmentTokenGenerator(environment, client); + final URL createAPIKeyURL = externalEnrollmentTokenGenerator.createAPIKeyUrl(); + final URL getHttpInfoURL = externalEnrollmentTokenGenerator.getHttpInfoUrl(); final HttpResponse httpResponseOK = new HttpResponse(HttpURLConnection.HTTP_OK, new HashMap<>()); when(client.execute(anyString(), eq(createAPIKeyURL), anyString(), any(SecureString.class), anyCheckedSupplier(), @@ -247,7 +249,7 @@ public void testFailedNoCaInKeystore() throws Exception { anyCheckedFunction())).thenReturn(httpResponseNotOK); IllegalStateException ex = expectThrows(IllegalStateException.class, () -> - enrollmentTokenGenerator.createNodeEnrollmentToken("elastic", new SecureString("elastic".toCharArray())).getEncoded()); + externalEnrollmentTokenGenerator.createNodeEnrollmentToken("elastic", new SecureString("elastic".toCharArray())).getEncoded()); assertThat( ex.getMessage(), equalTo( @@ -278,9 +280,9 @@ public void testFailedManyCaInKeystore() throws Exception { environment = new Environment(settings, tempDir); final CommandLineHttpClient client = mock(CommandLineHttpClient.class); when(client.getDefaultURL()).thenReturn("http://localhost:9200"); - final EnrollmentTokenGenerator enrollmentTokenGenerator = new EnrollmentTokenGenerator(environment, client); - final URL createAPIKeyURL = enrollmentTokenGenerator.createAPIKeyUrl(); - final URL getHttpInfoURL = enrollmentTokenGenerator.getHttpInfoUrl(); + final ExternalEnrollmentTokenGenerator externalEnrollmentTokenGenerator = new ExternalEnrollmentTokenGenerator(environment, client); + final URL createAPIKeyURL = externalEnrollmentTokenGenerator.createAPIKeyUrl(); + final URL getHttpInfoURL = externalEnrollmentTokenGenerator.getHttpInfoUrl(); final HttpResponse httpResponseOK = new HttpResponse(HttpURLConnection.HTTP_OK, new HashMap<>()); when(client.execute(anyString(), eq(createAPIKeyURL), anyString(), any(SecureString.class), anyCheckedSupplier(), @@ -305,7 +307,7 @@ public void testFailedManyCaInKeystore() throws Exception { anyCheckedFunction())).thenReturn(httpResponseNotOK); IllegalStateException ex = expectThrows(IllegalStateException.class, () -> - enrollmentTokenGenerator.createNodeEnrollmentToken("elastic", new SecureString("elastic".toCharArray())).getEncoded()); + externalEnrollmentTokenGenerator.createNodeEnrollmentToken("elastic", new SecureString("elastic".toCharArray())).getEncoded()); assertThat(ex.getMessage(), equalTo("Unable to create an enrollment token. Elasticsearch node HTTP layer SSL " + "configuration Keystore contains multiple PrivateKey entries where the associated certificate is a CA certificate")); } @@ -320,10 +322,11 @@ public void testNoKeyStore() throws Exception { final Environment environment_no_keystore = new Environment(settings, tempDir); final CommandLineHttpClient client = mock(CommandLineHttpClient.class); when(client.getDefaultURL()).thenReturn("http://localhost:9200"); - final EnrollmentTokenGenerator enrollmentTokenGenerator = new EnrollmentTokenGenerator(environment_no_keystore, client); + final ExternalEnrollmentTokenGenerator + externalEnrollmentTokenGenerator = new ExternalEnrollmentTokenGenerator(environment_no_keystore, client); IllegalStateException ex = expectThrows(IllegalStateException.class, () -> - enrollmentTokenGenerator.createNodeEnrollmentToken("elastic", new SecureString("elastic".toCharArray())).getEncoded()); + externalEnrollmentTokenGenerator.createNodeEnrollmentToken("elastic", new SecureString("elastic".toCharArray())).getEncoded()); assertThat(ex.getMessage(), Matchers.containsString("Elasticsearch node HTTP layer SSL configuration is not configured " + "with a keystore")); } @@ -348,10 +351,11 @@ public void testEnrollmentNotEnabled() throws Exception { final Environment environment_not_enabled = new Environment(settings, tempDir); final CommandLineHttpClient client = mock(CommandLineHttpClient.class); when(client.getDefaultURL()).thenReturn("http://localhost:9200"); - final EnrollmentTokenGenerator enrollmentTokenGenerator = new EnrollmentTokenGenerator(environment_not_enabled, client); + final ExternalEnrollmentTokenGenerator + externalEnrollmentTokenGenerator = new ExternalEnrollmentTokenGenerator(environment_not_enabled, client); IllegalStateException ex = expectThrows(IllegalStateException.class, () -> - enrollmentTokenGenerator.createNodeEnrollmentToken("elastic", new SecureString("elastic".toCharArray())).getEncoded()); + externalEnrollmentTokenGenerator.createNodeEnrollmentToken("elastic", new SecureString("elastic".toCharArray())).getEncoded()); assertThat(ex.getMessage(), equalTo("[xpack.security.enrollment.enabled] must be set to `true` to " + "create an enrollment token")); } diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/enrollment/InternalEnrollmentTokenGeneratorTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/enrollment/InternalEnrollmentTokenGeneratorTests.java new file mode 100644 index 0000000000000..1d2566b86d787 --- /dev/null +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/enrollment/InternalEnrollmentTokenGeneratorTests.java @@ -0,0 +1,183 @@ +/* + * 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.security.enrollment; + +import org.elasticsearch.Version; +import org.elasticsearch.action.ActionListener; +import org.elasticsearch.action.admin.cluster.node.info.NodeInfo; +import org.elasticsearch.action.admin.cluster.node.info.NodesInfoAction; +import org.elasticsearch.action.admin.cluster.node.info.NodesInfoResponse; +import org.elasticsearch.action.support.PlainActionFuture; +import org.elasticsearch.client.Client; +import org.elasticsearch.cluster.ClusterName; +import org.elasticsearch.cluster.node.DiscoveryNode; +import org.elasticsearch.common.settings.MockSecureSettings; +import org.elasticsearch.common.settings.SecureString; +import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.common.transport.BoundTransportAddress; +import org.elasticsearch.common.transport.TransportAddress; +import org.elasticsearch.common.util.concurrent.ThreadContext; +import org.elasticsearch.env.Environment; +import org.elasticsearch.http.HttpInfo; +import org.elasticsearch.test.ESTestCase; +import org.elasticsearch.threadpool.ThreadPool; +import org.elasticsearch.xpack.core.security.EnrollmentToken; +import org.elasticsearch.xpack.core.security.action.CreateApiKeyAction; +import org.elasticsearch.xpack.core.security.action.CreateApiKeyRequest; +import org.elasticsearch.xpack.core.security.action.CreateApiKeyResponse; +import org.elasticsearch.xpack.core.ssl.SSLService; +import org.elasticsearch.xpack.core.ssl.TestsSSLService; +import org.junit.Before; +import org.junit.BeforeClass; + +import java.net.InetAddress; +import java.nio.file.Files; +import java.nio.file.Path; +import java.time.Duration; +import java.time.Instant; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import static org.elasticsearch.test.ActionListenerUtils.anyActionListener; +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.nullValue; +import static org.mockito.Matchers.any; +import static org.mockito.Matchers.eq; +import static org.mockito.Mockito.doAnswer; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +public class InternalEnrollmentTokenGeneratorTests extends ESTestCase { + + private Environment environment; + private Client client; + + @BeforeClass + public static void muteInFips() { + assumeFalse("Enrollment is not supported in FIPS 140-2 as we are using PKCS#12 keystores", inFipsJvm()); + } + + @Before + public void setup() throws Exception { + final Path tempDir = createTempDir(); + final Path httpCaPath = tempDir.resolve("httpCa.p12"); + Files.copy(getDataPath("/org/elasticsearch/xpack/security/action/enrollment/httpCa.p12"), httpCaPath); + final MockSecureSettings secureSettings = new MockSecureSettings(); + secureSettings.setString("xpack.security.http.ssl.keystore.secure_password", "password"); + secureSettings.setString("bootstrap.password", "password"); + final Settings settings = Settings.builder() + .put("xpack.security.http.ssl.enabled", true) + .put("xpack.security.http.ssl.keystore.path", httpCaPath) + .put("xpack.security.enrollment.enabled", "true") + .setSecureSettings(secureSettings) + .put("path.home", tempDir) + .build(); + environment = new Environment(settings, tempDir); + client = mock(Client.class); + final ThreadPool threadPool = mock(ThreadPool.class); + when(client.threadPool()).thenReturn(threadPool); + when(threadPool.getThreadContext()).thenReturn(new ThreadContext(settings)); + doAnswer(invocationOnMock -> { + CreateApiKeyRequest request = (CreateApiKeyRequest) invocationOnMock.getArguments()[1]; + @SuppressWarnings("unchecked") + ActionListener responseActionListener = (ActionListener) invocationOnMock + .getArguments()[2]; + responseActionListener.onResponse( + new CreateApiKeyResponse( + request.getName(), + "api-key-id", + new SecureString("api-key-secret".toCharArray()), + Instant.now().plus(Duration.ofMillis(request.getExpiration().getMillis())) + ) + ); + return null; + }).when(client).execute(eq(CreateApiKeyAction.INSTANCE), any(CreateApiKeyRequest.class), anyActionListener()); + doAnswer(invocationOnMock -> { + @SuppressWarnings("unchecked") + ActionListener responseActionListener = (ActionListener) invocationOnMock + .getArguments()[2]; + responseActionListener.onResponse( + new NodesInfoResponse( + new ClusterName("cluster_name"), + List.of( + new NodeInfo( + Version.CURRENT, + null, + new DiscoveryNode("node-name", "1", buildNewFakeTransportAddress(), Map.of(), Set.of(), Version.CURRENT), + null, + null, + null, + null, + null, + null, + new HttpInfo( + new BoundTransportAddress( + new TransportAddress[] { new TransportAddress(InetAddress.getByName("192.168.1.2"), 9200) }, + new TransportAddress(InetAddress.getByName("192.168.1.2"), 9200) + ), + 0L + ), + null, + null, + null, + null + ) + ), + List.of() + ) + ); + return null; + }).when(client).execute(eq(NodesInfoAction.INSTANCE), any(), any()); + } + + public void testCreationSuccess() { + final SSLService sslService = new TestsSSLService(environment); + final InternalEnrollmentTokenGenerator generator = new InternalEnrollmentTokenGenerator(environment, sslService, client); + PlainActionFuture future = new PlainActionFuture<>(); + generator.createKibanaEnrollmentToken(future); + EnrollmentToken token = future.actionGet(); + assertThat(token.getApiKey(), equalTo("api-key-id:api-key-secret")); + assertThat(token.getBoundAddress().size(), equalTo(1)); + assertThat(token.getBoundAddress().get(0), equalTo("192.168.1.2:9200")); + assertThat(token.getVersion(), equalTo(Version.CURRENT.toString())); + assertThat(token.getFingerprint(), equalTo("ce480d53728605674fcfd8ffb51000d8a33bf32de7c7f1e26b4d428f8a91362d")); + } + + public void testFailureToGenerateKey() { + doAnswer(invocationOnMock -> { + @SuppressWarnings("unchecked") + ActionListener responseActionListener = (ActionListener) invocationOnMock + .getArguments()[2]; + responseActionListener.onFailure(new Exception("an error")); + return null; + }).when(client).execute(eq(CreateApiKeyAction.INSTANCE), any(CreateApiKeyRequest.class), anyActionListener()); + final SSLService sslService = new TestsSSLService(environment); + final InternalEnrollmentTokenGenerator generator = new InternalEnrollmentTokenGenerator(environment, sslService, client); + PlainActionFuture future = new PlainActionFuture<>(); + generator.createKibanaEnrollmentToken(future); + EnrollmentToken token = future.actionGet(); + assertThat(token, nullValue()); + } + + public void testFailureToGetNodesInfo() { + doAnswer(invocationOnMock -> { + @SuppressWarnings("unchecked") + ActionListener responseActionListener = (ActionListener) invocationOnMock + .getArguments()[2]; + responseActionListener.onFailure(new Exception("error")); + return null; + }).when(client).execute(eq(NodesInfoAction.INSTANCE), any(), any()); + final SSLService sslService = new TestsSSLService(environment); + final InternalEnrollmentTokenGenerator generator = new InternalEnrollmentTokenGenerator(environment, sslService, client); + PlainActionFuture future = new PlainActionFuture<>(); + generator.createKibanaEnrollmentToken(future); + EnrollmentToken token = future.actionGet(); + assertThat(token, nullValue()); + } +} diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/enrollment/tool/BootstrapPasswordAndEnrollmentTokenForInitialNodeTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/enrollment/tool/BootstrapPasswordAndEnrollmentTokenForInitialNodeTests.java deleted file mode 100644 index fb8addc77738e..0000000000000 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/enrollment/tool/BootstrapPasswordAndEnrollmentTokenForInitialNodeTests.java +++ /dev/null @@ -1,198 +0,0 @@ -/* - * 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.security.enrollment.tool; - -import org.elasticsearch.cli.Command; -import org.elasticsearch.cli.CommandTestCase; -import org.elasticsearch.cli.ExitCodes; -import org.elasticsearch.cli.UserException; -import org.elasticsearch.common.settings.KeyStoreWrapper; -import org.elasticsearch.common.settings.MockSecureSettings; -import org.elasticsearch.common.settings.SecureString; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.env.Environment; -import org.elasticsearch.xpack.security.enrollment.EnrollmentTokenGenerator; -import org.elasticsearch.xpack.core.security.EnrollmentToken; -import org.elasticsearch.xpack.core.security.CommandLineHttpClient; -import org.elasticsearch.xpack.core.security.HttpResponse; -import org.junit.Before; -import org.junit.BeforeClass; - -import java.net.HttpURLConnection; -import java.net.URL; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.Arrays; -import java.util.Collections; -import java.util.Map; - -import static org.hamcrest.Matchers.containsString; -import static org.hamcrest.Matchers.is; -import static org.mockito.Matchers.any; -import static org.mockito.Matchers.anyInt; -import static org.mockito.Matchers.anyObject; -import static org.mockito.Matchers.anyString; -import static org.mockito.Matchers.eq; -import static org.mockito.Mockito.doCallRealMethod; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - -public class BootstrapPasswordAndEnrollmentTokenForInitialNodeTests extends CommandTestCase { - private CommandLineHttpClient client; - private KeyStoreWrapper keyStoreWrapper; - private EnrollmentTokenGenerator enrollmentTokenGenerator; - private URL checkClusterHealthUrl; - private URL setElasticUserPasswordUrl; - private Path confDir; - private Path tempDir; - private Settings settings; - - @Override - protected Command newCommand() { - return new BootstrapPasswordAndEnrollmentTokenForInitialNode(environment -> client, environment -> keyStoreWrapper, - environment -> enrollmentTokenGenerator) { - @Override - protected Environment readSecureSettings(Environment env, SecureString password) { - return new Environment(settings, tempDir); - } - @Override - protected Environment createEnv(Map settings) { - return new Environment(BootstrapPasswordAndEnrollmentTokenForInitialNodeTests.this.settings, confDir); - } - }; - } - - @BeforeClass - public static void muteInFips(){ - assumeFalse("Enrollment is not supported in FIPS 140-2 as we are using PKCS#12 keystores", inFipsJvm()); - } - - @Before - public void setup() throws Exception { - this.keyStoreWrapper = mock(KeyStoreWrapper.class); - when(keyStoreWrapper.isLoaded()).thenReturn(true); - this.client = mock(CommandLineHttpClient.class); - when(client.getDefaultURL()).thenReturn("https://localhost:9200"); - checkClusterHealthUrl = BootstrapPasswordAndEnrollmentTokenForInitialNode.checkClusterHealthUrl(client); - setElasticUserPasswordUrl = BootstrapPasswordAndEnrollmentTokenForInitialNode.setElasticUserPasswordUrl(client); - HttpResponse healthResponse = - new HttpResponse(HttpURLConnection.HTTP_OK, Map.of("status", randomFrom("yellow", "green"))); - when(client.execute(anyString(), eq(checkClusterHealthUrl), anyString(), any(SecureString.class), anyObject(), anyObject())) - .thenReturn(healthResponse); - HttpResponse setPasswordResponse = - new HttpResponse(HttpURLConnection.HTTP_OK, Collections.emptyMap()); - when(client.execute(anyString(), eq(setElasticUserPasswordUrl), anyString(), any(SecureString.class), anyObject(), anyObject())) - .thenReturn(setPasswordResponse); - this.enrollmentTokenGenerator = mock(EnrollmentTokenGenerator.class); - EnrollmentToken kibanaToken = new EnrollmentToken("DR6CzXkBDf8amV_48yYX:x3YqU_rqQwm-ESrkExcnOg", - "ce480d53728605674fcfd8ffb51000d8a33bf32de7c7f1e26b4d428f8a91362d", "8.0.0", - Arrays.asList("[192.168.0.1:9201, 172.16.254.1:9202")); - EnrollmentToken nodeToken = new EnrollmentToken("DR6CzXkBDf8amV_48yYX:4BhUk-mkFm-AwvRFg90KJ", - "ce480d53728605674fcfd8ffb51000d8a33bf32de7c7f1e26b4d428f8a91362d", "8.0.0", - Arrays.asList("[192.168.0.1:9201, 172.16.254.1:9202")); - when(enrollmentTokenGenerator.createKibanaEnrollmentToken(anyString(), any(SecureString.class))) - .thenReturn(kibanaToken); - when(enrollmentTokenGenerator.createNodeEnrollmentToken(anyString(), any(SecureString.class))) - .thenReturn(nodeToken); - tempDir = createTempDir(); - confDir = tempDir.resolve("config"); - final Path httpCaPath = tempDir.resolve("httpCa.p12"); - Files.copy(getDataPath("/org/elasticsearch/xpack/security/action/enrollment/httpCa.p12"), httpCaPath); - final MockSecureSettings secureSettings = new MockSecureSettings(); - secureSettings.setString("xpack.http.ssl.truststore.secure_password", "password"); - secureSettings.setString("xpack.security.http.ssl.keystore.secure_password", "password"); - secureSettings.setString("keystore.seed", "password"); - settings = Settings.builder() - .put("xpack.security.enabled", true) - .put("xpack.http.ssl.enabled", true) - .put("xpack.security.authc.api_key.enabled", true) - .put("xpack.http.ssl.truststore.path", "httpCa.p12") - .put("xpack.security.http.ssl.enabled", true) - .put("xpack.security.http.ssl.keystore.path", "httpCa.p12") - .put("xpack.security.enrollment.enabled", "true") - .setSecureSettings(secureSettings) - .put("path.home", tempDir) - .build(); - } - - public void testGenerateNewPasswordSuccess() throws Exception { - terminal.addSecretInput("password"); - String includeNodeEnrollmentToken = randomBoolean() ? "--include-node-enrollment-token" : ""; - String output = execute(includeNodeEnrollmentToken); - assertThat(output, containsString("elastic user password: ")); - assertThat(output, containsString("CA fingerprint: ce480d53728605674fcfd8ffb51000d8a33bf32de7c7f1e26b4d428" + - "f8a91362d")); - assertThat(output, containsString("Kibana enrollment token: eyJ2ZXIiOiI4LjAuMCIsImFkciI6WyJbMTkyLjE2OC4wL" + - "jE6OTIwMSwgMTcyLjE2LjI1NC4xOjkyMDIiXSwiZmdyIjoiY2U0ODBkNTM3Mjg2MDU2NzRmY2ZkOGZmYjUxMDAwZDhhMzNiZjMyZGU3YzdmMWUyN" + - "mI0ZDQyOGY4YTkxMzYyZCIsImtleSI6IkRSNkN6WGtCRGY4YW1WXzQ4eVlYOngzWXFVX3JxUXdtLUVTcmtFeGNuT2cifQ==")); - if (includeNodeEnrollmentToken.equals("--include-node-enrollment-token")) { - assertThat(output, containsString("Node enrollment token: eyJ2ZXIiOiI4LjAuMCIsImFkciI6WyJbMTkyLjE2OC4wLj" + - "E6OTIwMSwgMTcyLjE2LjI1NC4xOjkyMDIiXSwiZmdyIjoiY2U0ODBkNTM3Mjg2MDU2NzRmY2ZkOGZmYjUxMDAwZDhhMzNiZjMyZGU3YzdmMWUy" + - "NmI0ZDQyOGY4YTkxMzYyZCIsImtleSI6IkRSNkN6WGtCRGY4YW1WXzQ4eVlYOjRCaFVrLW1rRm0tQXd2UkZnOTBLSiJ9")); - } else { - assertFalse(output.contains("Node enrollment token: ")); - } - } - - public void testBootstrapPasswordSuccess() throws Exception { - final MockSecureSettings secureSettings = new MockSecureSettings(); - final Path tempDir = createTempDir(); - secureSettings.setString("bootstrap.password", "password"); - settings = Settings.builder() - .put("xpack.security.enabled", true) - .put("xpack.security.enrollment.enabled", "true") - .setSecureSettings(secureSettings) - .put("path.home", tempDir) - .build(); - terminal.addSecretInput("password"); - String includeNodeEnrollmentToken = randomBoolean() ? "--include-node-enrollment-token" : ""; - String output = execute(includeNodeEnrollmentToken); - assertFalse(terminal.getOutput().contains("elastic user password:")); - assertThat(terminal.getOutput(), containsString("CA fingerprint: ce480d53728605674fcfd8ffb51000d8a33bf32de7c7f1e26b4d428" + - "f8a91362d")); - assertThat(output, containsString("Kibana enrollment token: eyJ2ZXIiOiI4LjAuMCIsImFkciI6WyJbMTkyLjE2OC4wL" + - "jE6OTIwMSwgMTcyLjE2LjI1NC4xOjkyMDIiXSwiZmdyIjoiY2U0ODBkNTM3Mjg2MDU2NzRmY2ZkOGZmYjUxMDAwZDhhMzNiZjMyZGU3YzdmMWUy" + - "NmI0ZDQyOGY4YTkxMzYyZCIsImtleSI6IkRSNkN6WGtCRGY4YW1WXzQ4eVlYOngzWXFVX3JxUXdtLUVTcmtFeGNuT2cifQ==")); - if (includeNodeEnrollmentToken.equals("--include-node-enrollment-token")) { - assertThat(output, containsString("Node enrollment token: eyJ2ZXIiOiI4LjAuMCIsImFkciI6WyJbMTkyLjE2OC4wLj" + - "E6OTIwMSwgMTcyLjE2LjI1NC4xOjkyMDIiXSwiZmdyIjoiY2U0ODBkNTM3Mjg2MDU2NzRmY2ZkOGZmYjUxMDAwZDhhMzNiZjMyZGU3YzdmMWU" + - "yNmI0ZDQyOGY4YTkxMzYyZCIsImtleSI6IkRSNkN6WGtCRGY4YW1WXzQ4eVlYOjRCaFVrLW1rRm0tQXd2UkZnOTBLSiJ9")); - } else { - assertFalse(output.contains("Node enrollment token: ")); - } - } - - public void testClusterHealthIsRed() throws Exception { - HttpResponse healthResponse = - new HttpResponse(HttpURLConnection.HTTP_OK, Map.of("status", "red")); - when(client.execute(anyString(), eq(checkClusterHealthUrl), anyString(), any(SecureString.class), anyObject(), anyObject())) - .thenReturn(healthResponse); - doCallRealMethod().when(client).checkClusterHealthWithRetriesWaitingForCluster(anyString(), anyObject(), anyInt()); - terminal.addSecretInput("password"); - final UserException ex = expectThrows(UserException.class, () -> execute("")); - assertNull(ex.getMessage()); - assertThat(ex.exitCode, is(ExitCodes.UNAVAILABLE)); - } - - public void testFailedToSetPassword() throws Exception { - HttpResponse setPasswordResponse = - new HttpResponse(HttpURLConnection.HTTP_UNAUTHORIZED, Collections.emptyMap()); - when(client.execute(anyString(), eq(setElasticUserPasswordUrl), anyString(), any(SecureString.class), anyObject(), anyObject())) - .thenReturn(setPasswordResponse); - terminal.addSecretInput("password"); - final UserException ex = expectThrows(UserException.class, () -> execute("")); - assertNull(ex.getMessage()); - assertThat(ex.exitCode, is(ExitCodes.UNAVAILABLE)); - } - - public void testNoKeystorePassword() { - final UserException ex = expectThrows(UserException.class, () -> execute("")); - assertNull(ex.getMessage()); - assertThat(ex.exitCode, is(ExitCodes.USAGE)); - } -} diff --git a/x-pack/qa/security-tools-tests/src/test/java/org/elasticsearch/xpack/security/enrollment/tool/CreateEnrollmentTokenToolTests.java b/x-pack/qa/security-tools-tests/src/test/java/org/elasticsearch/xpack/security/enrollment/tool/CreateEnrollmentTokenToolTests.java index ac607ee1f21d9..de74a01d11bf1 100644 --- a/x-pack/qa/security-tools-tests/src/test/java/org/elasticsearch/xpack/security/enrollment/tool/CreateEnrollmentTokenToolTests.java +++ b/x-pack/qa/security-tools-tests/src/test/java/org/elasticsearch/xpack/security/enrollment/tool/CreateEnrollmentTokenToolTests.java @@ -24,7 +24,7 @@ import org.elasticsearch.env.Environment; import org.elasticsearch.xpack.core.XPackSettings; import org.elasticsearch.xpack.core.security.EnrollmentToken; -import org.elasticsearch.xpack.security.enrollment.EnrollmentTokenGenerator; +import org.elasticsearch.xpack.security.enrollment.ExternalEnrollmentTokenGenerator; import org.elasticsearch.xpack.core.security.CommandLineHttpClient; import org.elasticsearch.xpack.core.security.HttpResponse; import org.junit.AfterClass; @@ -62,12 +62,12 @@ public class CreateEnrollmentTokenToolTests extends CommandTestCase { private CommandLineHttpClient client; private KeyStoreWrapper keyStoreWrapper; - private EnrollmentTokenGenerator enrollmentTokenGenerator; + private ExternalEnrollmentTokenGenerator externalEnrollmentTokenGenerator; @Override protected Command newCommand() { return new CreateEnrollmentTokenTool(environment -> client, environment -> keyStoreWrapper, - environment -> enrollmentTokenGenerator) { + environment -> externalEnrollmentTokenGenerator) { @Override protected Environment createEnv(Map settings) { return new Environment(CreateEnrollmentTokenToolTests.this.settings, confDir); @@ -114,16 +114,16 @@ public void setup() throws Exception { when(client.execute(anyString(), eq(clusterHealthUrl(url)), anyString(), any(SecureString.class), any(CheckedSupplier.class), any(CheckedFunction.class))).thenReturn(healthResponse); - this.enrollmentTokenGenerator = mock(EnrollmentTokenGenerator.class); + this.externalEnrollmentTokenGenerator = mock(ExternalEnrollmentTokenGenerator.class); EnrollmentToken kibanaToken = new EnrollmentToken("DR6CzXkBDf8amV_48yYX:x3YqU_rqQwm-ESrkExcnOg", "ce480d53728605674fcfd8ffb51000d8a33bf32de7c7f1e26b4d428f8a91362d", "8.0.0", Arrays.asList("[192.168.0.1:9201, 172.16.254.1:9202")); EnrollmentToken nodeToken = new EnrollmentToken("DR6CzXkBDf8amV_48yYX:4BhUk-mkFm-AwvRFg90KJ", "ce480d53728605674fcfd8ffb51000d8a33bf32de7c7f1e26b4d428f8a91362d", "8.0.0", Arrays.asList("[192.168.0.1:9201, 172.16.254.1:9202")); - when(enrollmentTokenGenerator.createKibanaEnrollmentToken(anyString(), any(SecureString.class))) + when(externalEnrollmentTokenGenerator.createKibanaEnrollmentToken(anyString(), any(SecureString.class))) .thenReturn(kibanaToken); - when(enrollmentTokenGenerator.createNodeEnrollmentToken(anyString(), any(SecureString.class))) + when(externalEnrollmentTokenGenerator.createNodeEnrollmentToken(anyString(), any(SecureString.class))) .thenReturn(nodeToken); } @@ -196,10 +196,10 @@ public void testEnrollmentDisabled() { } public void testUnableToCreateToken() throws Exception { - this.enrollmentTokenGenerator = mock(EnrollmentTokenGenerator.class); - when(enrollmentTokenGenerator.createKibanaEnrollmentToken(anyString(), any(SecureString.class))) + this.externalEnrollmentTokenGenerator = mock(ExternalEnrollmentTokenGenerator.class); + when(externalEnrollmentTokenGenerator.createKibanaEnrollmentToken(anyString(), any(SecureString.class))) .thenThrow(new IllegalStateException("example exception message")); - when(enrollmentTokenGenerator.createNodeEnrollmentToken(anyString(), any(SecureString.class))) + when(externalEnrollmentTokenGenerator.createNodeEnrollmentToken(anyString(), any(SecureString.class))) .thenThrow(new IllegalStateException("example exception message")); String scope = randomBoolean() ? "node" : "kibana"; UserException e = expectThrows(UserException.class, () -> { From 64612bdb4e955b48eedf706b70e036b41c6b3a7d Mon Sep 17 00:00:00 2001 From: Dan Hermann Date: Thu, 30 Sep 2021 08:52:36 -0500 Subject: [PATCH 080/250] Adjust skip version after backport of #78463 (#78514) --- .../resources/rest-api-spec/test/data_stream/10_basic.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/10_basic.yml b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/10_basic.yml index 1032a13aa8104..7f243c057b01a 100644 --- a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/10_basic.yml +++ b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/10_basic.yml @@ -406,8 +406,8 @@ setup: --- "Delete data stream by wildcard": - skip: - version: " - 7.99.99" - reason: "change to [-7.8.99] and [data streams only supported in 7.9+] after backport" + version: " - 7.8.99" + reason: "data streams supported only in 7.9+" - do: indices.create_data_stream: From 3dac76c190d816c3ad4f329458a13cb40a19dd28 Mon Sep 17 00:00:00 2001 From: Yannick Welsch Date: Thu, 30 Sep 2021 16:08:00 +0200 Subject: [PATCH 081/250] Disk usage API does not support timeout parameters (#78503) Fixes the documentation that the disk usage API is not supporting timeout parameters. Closes #78356 --- docs/reference/indices/diskusage.asciidoc | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/reference/indices/diskusage.asciidoc b/docs/reference/indices/diskusage.asciidoc index c8a9f27fb3649..20a2e0e1baa2e 100644 --- a/docs/reference/indices/diskusage.asciidoc +++ b/docs/reference/indices/diskusage.asciidoc @@ -55,8 +55,6 @@ Defaults to `open`. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=index-ignore-unavailable] -include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=timeoutparms] - `run_expensive_tasks`:: (Required, Boolean) Analyzing field disk usage is resource-intensive. To use the API, this parameter must be set to `true`. Defaults to `false`. From c33e340a473a7044b6e48b093687b5e6d669a190 Mon Sep 17 00:00:00 2001 From: James Rodewig <40268737+jrodewig@users.noreply.github.com> Date: Thu, 30 Sep 2021 10:23:14 -0400 Subject: [PATCH 082/250] [DOCS] EQL: Document `runs` keyword (#78478) (#78518) Documents the `runs` keyword for running the same event criteria successively in a sequence query. Relates to #75082. # Conflicts: # docs/reference/release-notes/highlights.asciidoc --- docs/reference/eql/syntax.asciidoc | 40 ++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/docs/reference/eql/syntax.asciidoc b/docs/reference/eql/syntax.asciidoc index 66ed82308feb5..2d1b57fab7de4 100644 --- a/docs/reference/eql/syntax.asciidoc +++ b/docs/reference/eql/syntax.asciidoc @@ -694,6 +694,46 @@ until [ process where event.type == "stop" ] ---- ==== +[discrete] +[[eql-runs-keyword]] +=== `runs` keyword + +Use a `runs` statement to run the same event criteria successively within a +sequence query. For example: + +[source,eql] +---- +sequence + [ process where event.type == "creation" ] + [ library where process.name == "regsvr32.exe" ] [runs=3] + [ registry where true ] +---- + +is equivalent to: + +[source,eql] +---- +sequence + [ process where event.type == "creation" ] + [ library where process.name == "regsvr32.exe" ] + [ library where process.name == "regsvr32.exe" ] + [ library where process.name == "regsvr32.exe" ] + [ registry where true ] +---- + +A `runs` statement must be enclosed in square brackets (`[ ]`). The `runs` value +must be between `1` and `100` (inclusive). + +You can use a `runs` statement with the <>. For +example: + +[source,eql] +---- +sequence + [ process where event.type == "creation" ] by process.executable + [ library where process.name == "regsvr32.exe" ] by dll.path [runs=3] +---- + [discrete] [[eql-functions]] === Functions From 23b74b0e59fe9ab2273d55a0e21f9112e820bd91 Mon Sep 17 00:00:00 2001 From: Nikola Grcevski <6207777+grcevski@users.noreply.github.com> Date: Thu, 30 Sep 2021 10:59:58 -0400 Subject: [PATCH 083/250] [TEST] Use persistent settings in YML tests (#78480) Use persistent instead of transient settings for various REST YML tests, because we are deprecating the transient cluster settings. --- .../rest-api-spec/test/11_parent_child.yml | 6 +-- .../rest-api-spec/test/20_parent_join.yml | 6 +-- .../rest-api-spec/test/30_inner_hits.yml | 6 +-- .../test/reindex/25_no_auto_create.yml | 8 ++-- .../test/customsettings/10_settings.yml | 10 ++-- .../test/multi_cluster/10_basic.yml | 10 ++-- .../15_connection_mode_configuration.yml | 46 +++++++++---------- .../test/multi_cluster/20_info.yml | 38 +++++++-------- .../20_destructive_wildcard.yml | 4 +- .../test/scroll/20_keep_alive.yml | 4 +- .../search.aggregation/240_max_buckets.yml | 6 +-- .../test/search/320_disallow_queries.yml | 6 +-- .../rest-api-spec/test/ccr/auto_follow.yml | 16 +++---- .../test/ccr/follow_and_unfollow.yml | 4 +- .../rest-api-spec/test/ccr/follow_info.yml | 4 +- .../rest-api-spec/test/ccr/follow_stats.yml | 4 +- .../test/ccr/forget_follower.yml | 4 +- .../index_directly_into_follower_index.yml | 4 +- .../test/ml/data_frame_analytics_crud.yml | 8 ++-- .../rest-api-spec/test/ml/jobs_crud.yml | 16 +++---- .../test/ml/set_upgrade_mode.yml | 2 +- .../test/ml/start_stop_datafeed.yml | 8 ++-- .../put_watch/90_auto_create_index.yml | 4 +- .../rest-api-spec/test/stack/10_stack.yml | 2 +- .../build.gradle | 4 +- .../test/multi_cluster/10_basic.yml | 6 +-- .../test/multi_cluster/20_info.yml | 6 +-- .../70_connection_mode_configuration.yml | 46 +++++++++---------- 28 files changed, 144 insertions(+), 144 deletions(-) diff --git a/modules/parent-join/src/yamlRestTest/resources/rest-api-spec/test/11_parent_child.yml b/modules/parent-join/src/yamlRestTest/resources/rest-api-spec/test/11_parent_child.yml index 3fa7c1f0e22bc..a6a85fca47fdc 100644 --- a/modules/parent-join/src/yamlRestTest/resources/rest-api-spec/test/11_parent_child.yml +++ b/modules/parent-join/src/yamlRestTest/resources/rest-api-spec/test/11_parent_child.yml @@ -35,7 +35,7 @@ teardown: - do: cluster.put_settings: body: - transient: + persistent: search.allow_expensive_queries: null --- @@ -76,11 +76,11 @@ teardown: - do: cluster.put_settings: body: - transient: + persistent: search.allow_expensive_queries: "false" flat_settings: true - - match: {transient: {search.allow_expensive_queries: "false"}} + - match: {persistent: {search.allow_expensive_queries: "false"}} - do: catch: /\[joining\] queries cannot be executed when \'search.allow_expensive_queries\' is set to false./ diff --git a/modules/parent-join/src/yamlRestTest/resources/rest-api-spec/test/20_parent_join.yml b/modules/parent-join/src/yamlRestTest/resources/rest-api-spec/test/20_parent_join.yml index 22ded8254a4e3..d92bea5a3c9a8 100644 --- a/modules/parent-join/src/yamlRestTest/resources/rest-api-spec/test/20_parent_join.yml +++ b/modules/parent-join/src/yamlRestTest/resources/rest-api-spec/test/20_parent_join.yml @@ -37,7 +37,7 @@ teardown: - do: cluster.put_settings: body: - transient: + persistent: search.allow_expensive_queries: null --- @@ -129,11 +129,11 @@ teardown: - do: cluster.put_settings: body: - transient: + persistent: search.allow_expensive_queries: "false" flat_settings: true - - match: {transient: {search.allow_expensive_queries: "false"}} + - match: {persistent: {search.allow_expensive_queries: "false"}} - do: catch: /\[joining\] queries cannot be executed when \'search.allow_expensive_queries\' is set to false./ diff --git a/modules/parent-join/src/yamlRestTest/resources/rest-api-spec/test/30_inner_hits.yml b/modules/parent-join/src/yamlRestTest/resources/rest-api-spec/test/30_inner_hits.yml index e112a14ea3f59..21033baee3280 100644 --- a/modules/parent-join/src/yamlRestTest/resources/rest-api-spec/test/30_inner_hits.yml +++ b/modules/parent-join/src/yamlRestTest/resources/rest-api-spec/test/30_inner_hits.yml @@ -53,7 +53,7 @@ teardown: - do: cluster.put_settings: body: - transient: + persistent: search.allow_expensive_queries: null --- @@ -95,11 +95,11 @@ teardown: - do: cluster.put_settings: body: - transient: + persistent: search.allow_expensive_queries: "false" flat_settings: true - - match: {transient: {search.allow_expensive_queries: "false"}} + - match: {persistent: {search.allow_expensive_queries: "false"}} - do: catch: /\[joining\] queries cannot be executed when \'search.allow_expensive_queries\' is set to false./ diff --git a/modules/reindex/src/yamlRestTest/resources/rest-api-spec/test/reindex/25_no_auto_create.yml b/modules/reindex/src/yamlRestTest/resources/rest-api-spec/test/reindex/25_no_auto_create.yml index d7fb98549f88f..b64da0831621d 100644 --- a/modules/reindex/src/yamlRestTest/resources/rest-api-spec/test/reindex/25_no_auto_create.yml +++ b/modules/reindex/src/yamlRestTest/resources/rest-api-spec/test/reindex/25_no_auto_create.yml @@ -2,7 +2,7 @@ teardown: - do: cluster.put_settings: body: - transient: + persistent: action.auto_create_index: null --- @@ -15,7 +15,7 @@ teardown: - do: cluster.put_settings: body: - transient: + persistent: action.auto_create_index: false - do: catch: /no such index \[dest\] and \[action.auto_create_index\] is \[false\]/ @@ -31,7 +31,7 @@ teardown: - do: cluster.put_settings: body: - transient: + persistent: action.auto_create_index: test - do: index: @@ -52,7 +52,7 @@ teardown: - do: cluster.put_settings: body: - transient: + persistent: action.auto_create_index: test,-dest - do: index: diff --git a/plugins/examples/custom-settings/src/yamlRestTest/resources/rest-api-spec/test/customsettings/10_settings.yml b/plugins/examples/custom-settings/src/yamlRestTest/resources/rest-api-spec/test/customsettings/10_settings.yml index bf170f23b2744..60c7e01061ec1 100644 --- a/plugins/examples/custom-settings/src/yamlRestTest/resources/rest-api-spec/test/customsettings/10_settings.yml +++ b/plugins/examples/custom-settings/src/yamlRestTest/resources/rest-api-spec/test/customsettings/10_settings.yml @@ -23,7 +23,7 @@ - do: cluster.put_settings: body: - transient: + persistent: custom: bool: true validated: "updated" @@ -32,15 +32,15 @@ - do: cluster.get_settings: {} - - is_true: transient.custom.bool - - match: { transient.custom.validated: "updated" } + - is_true: persistent.custom.bool + - match: { persistent.custom.validated: "updated" } # Try to update the "validated" setting with a forbidden value - do: catch: bad_request cluster.put_settings: body: - transient: + persistent: custom: validated: "forbidden" @@ -48,7 +48,7 @@ - do: cluster.put_settings: body: - transient: + persistent: custom: bool: null validated: null diff --git a/qa/multi-cluster-search/src/test/resources/rest-api-spec/test/multi_cluster/10_basic.yml b/qa/multi-cluster-search/src/test/resources/rest-api-spec/test/multi_cluster/10_basic.yml index c9b8ab3397c6b..8bbbc7435ff5a 100644 --- a/qa/multi-cluster-search/src/test/resources/rest-api-spec/test/multi_cluster/10_basic.yml +++ b/qa/multi-cluster-search/src/test/resources/rest-api-spec/test/multi_cluster/10_basic.yml @@ -235,7 +235,7 @@ - match: { aggregations.cluster.buckets.1.animal_length.value: 15 } --- -"Add transient remote cluster based on the preset cluster": +"Add persistent remote cluster based on the preset cluster": - do: cluster.get_settings: include_defaults: true @@ -246,10 +246,10 @@ cluster.put_settings: flat_settings: true body: - transient: + persistent: cluster.remote.test_remote_cluster.seeds: $remote_ip - - match: {transient: {cluster.remote.test_remote_cluster.seeds: $remote_ip}} + - match: {persistent: {cluster.remote.test_remote_cluster.seeds: $remote_ip}} - do: search: @@ -276,10 +276,10 @@ cluster.put_settings: flat_settings: true body: - transient: + persistent: cluster.remote.test_remote_cluster.seeds: $remote_ip - - match: {transient: {cluster.remote.test_remote_cluster.seeds: $remote_ip}} + - match: {persistent: {cluster.remote.test_remote_cluster.seeds: $remote_ip}} - do: search: diff --git a/qa/multi-cluster-search/src/test/resources/rest-api-spec/test/multi_cluster/15_connection_mode_configuration.yml b/qa/multi-cluster-search/src/test/resources/rest-api-spec/test/multi_cluster/15_connection_mode_configuration.yml index 05185cb3e3328..41531e46b6c63 100644 --- a/qa/multi-cluster-search/src/test/resources/rest-api-spec/test/multi_cluster/15_connection_mode_configuration.yml +++ b/qa/multi-cluster-search/src/test/resources/rest-api-spec/test/multi_cluster/15_connection_mode_configuration.yml @@ -1,5 +1,5 @@ --- -"Add transient remote cluster in proxy mode with invalid sniff settings": +"Add persistent remote cluster in proxy mode with invalid sniff settings": - do: cluster.get_settings: include_defaults: true @@ -11,7 +11,7 @@ cluster.put_settings: flat_settings: true body: - transient: + persistent: cluster.remote.test_remote_cluster.mode: "proxy" cluster.remote.test_remote_cluster.node_connections: "5" cluster.remote.test_remote_cluster.proxy_address: $remote_ip @@ -26,7 +26,7 @@ cluster.put_settings: flat_settings: true body: - transient: + persistent: cluster.remote.test_remote_cluster.mode: "proxy" cluster.remote.test_remote_cluster.seeds: $remote_ip cluster.remote.test_remote_cluster.proxy_address: $remote_ip @@ -37,7 +37,7 @@ used with the configured \"cluster.remote.test_remote_cluster.mode\" [required=SNIFF, configured=PROXY]" } --- -"Add transient remote cluster in sniff mode with invalid proxy settings": +"Add persistent remote cluster in sniff mode with invalid proxy settings": - do: cluster.get_settings: include_defaults: true @@ -49,7 +49,7 @@ cluster.put_settings: flat_settings: true body: - transient: + persistent: cluster.remote.test_remote_cluster.proxy_socket_connections: "20" cluster.remote.test_remote_cluster.seeds: $remote_ip @@ -63,7 +63,7 @@ cluster.put_settings: flat_settings: true body: - transient: + persistent: cluster.remote.test_remote_cluster.proxy_address: $remote_ip cluster.remote.test_remote_cluster.seeds: $remote_ip @@ -73,7 +73,7 @@ used with the configured \"cluster.remote.test_remote_cluster.mode\" [required=PROXY, configured=SNIFF]" } --- -"Add transient remote cluster using proxy connection mode using valid settings": +"Add persistent remote cluster using proxy connection mode using valid settings": - do: cluster.get_settings: include_defaults: true @@ -84,14 +84,14 @@ cluster.put_settings: flat_settings: true body: - transient: + persistent: cluster.remote.test_remote_cluster.mode: "proxy" cluster.remote.test_remote_cluster.proxy_socket_connections: "3" cluster.remote.test_remote_cluster.proxy_address: $remote_ip - - match: {transient.cluster\.remote\.test_remote_cluster\.mode: "proxy"} - - match: {transient.cluster\.remote\.test_remote_cluster\.proxy_socket_connections: "3"} - - match: {transient.cluster\.remote\.test_remote_cluster\.proxy_address: $remote_ip} + - match: {persistent.cluster\.remote\.test_remote_cluster\.mode: "proxy"} + - match: {persistent.cluster\.remote\.test_remote_cluster\.proxy_socket_connections: "3"} + - match: {persistent.cluster\.remote\.test_remote_cluster\.proxy_address: $remote_ip} - do: search: @@ -107,7 +107,7 @@ - match: { hits.hits.0._index: "test_remote_cluster:test_index" } --- -"Add transient remote cluster using sniff connection mode using valid settings": +"Add persistent remote cluster using sniff connection mode using valid settings": - do: cluster.get_settings: include_defaults: true @@ -118,14 +118,14 @@ cluster.put_settings: flat_settings: true body: - transient: + persistent: cluster.remote.test_remote_cluster.mode: "sniff" cluster.remote.test_remote_cluster.node_connections: "3" cluster.remote.test_remote_cluster.seeds: $remote_ip - - match: {transient.cluster\.remote\.test_remote_cluster\.mode: "sniff"} - - match: {transient.cluster\.remote\.test_remote_cluster\.node_connections: "3"} - - match: {transient.cluster\.remote\.test_remote_cluster\.seeds: $remote_ip} + - match: {persistent.cluster\.remote\.test_remote_cluster\.mode: "sniff"} + - match: {persistent.cluster\.remote\.test_remote_cluster\.node_connections: "3"} + - match: {persistent.cluster\.remote\.test_remote_cluster\.seeds: $remote_ip} - do: search: @@ -152,12 +152,12 @@ cluster.put_settings: flat_settings: true body: - transient: + persistent: cluster.remote.test_remote_cluster.mode: "sniff" cluster.remote.test_remote_cluster.seeds: $remote_ip - - match: {transient.cluster\.remote\.test_remote_cluster\.mode: "sniff"} - - match: {transient.cluster\.remote\.test_remote_cluster\.seeds: $remote_ip} + - match: {persistent.cluster\.remote\.test_remote_cluster\.mode: "sniff"} + - match: {persistent.cluster\.remote\.test_remote_cluster\.seeds: $remote_ip} - do: search: @@ -177,7 +177,7 @@ cluster.put_settings: flat_settings: true body: - transient: + persistent: cluster.remote.test_remote_cluster.mode: "proxy" cluster.remote.test_remote_cluster.proxy_address: $remote_ip @@ -190,13 +190,13 @@ cluster.put_settings: flat_settings: true body: - transient: + persistent: cluster.remote.test_remote_cluster.mode: "proxy" cluster.remote.test_remote_cluster.seeds: null cluster.remote.test_remote_cluster.proxy_address: $remote_ip - - match: {transient.cluster\.remote\.test_remote_cluster\.mode: "proxy"} - - match: {transient.cluster\.remote\.test_remote_cluster\.proxy_address: $remote_ip} + - match: {persistent.cluster\.remote\.test_remote_cluster\.mode: "proxy"} + - match: {persistent.cluster\.remote\.test_remote_cluster\.proxy_address: $remote_ip} - do: search: diff --git a/qa/multi-cluster-search/src/test/resources/rest-api-spec/test/multi_cluster/20_info.yml b/qa/multi-cluster-search/src/test/resources/rest-api-spec/test/multi_cluster/20_info.yml index f8a31c5ec9214..144990163583b 100644 --- a/qa/multi-cluster-search/src/test/resources/rest-api-spec/test/multi_cluster/20_info.yml +++ b/qa/multi-cluster-search/src/test/resources/rest-api-spec/test/multi_cluster/20_info.yml @@ -10,7 +10,7 @@ - match: { my_remote_cluster.mode: "sniff" } --- -"Add transient remote cluster based on the preset cluster and check remote info": +"Add persistent remote cluster based on the preset cluster and check remote info": - do: cluster.get_settings: include_defaults: true @@ -21,14 +21,14 @@ cluster.put_settings: flat_settings: true body: - transient: + persistent: cluster.remote.test_remote_cluster.mode: "sniff" cluster.remote.test_remote_cluster.node_connections: "2" cluster.remote.test_remote_cluster.seeds: $remote_ip - - match: {transient.cluster\.remote\.test_remote_cluster\.mode: "sniff"} - - match: {transient.cluster\.remote\.test_remote_cluster\.node_connections: "2"} - - match: {transient.cluster\.remote\.test_remote_cluster\.seeds: $remote_ip} + - match: {persistent.cluster\.remote\.test_remote_cluster\.mode: "sniff"} + - match: {persistent.cluster\.remote\.test_remote_cluster\.node_connections: "2"} + - match: {persistent.cluster\.remote\.test_remote_cluster\.seeds: $remote_ip} # we do another search here since this will enforce the connection to be established # otherwise the cluster might not have been connected yet. @@ -65,16 +65,16 @@ cluster.put_settings: flat_settings: true body: - transient: + persistent: cluster.remote.test_remote_cluster.mode: "proxy" cluster.remote.test_remote_cluster.seeds: null cluster.remote.test_remote_cluster.node_connections: null cluster.remote.test_remote_cluster.proxy_socket_connections: "10" cluster.remote.test_remote_cluster.proxy_address: $remote_ip - - match: {transient.cluster\.remote\.test_remote_cluster\.mode: "proxy"} - - match: {transient.cluster\.remote\.test_remote_cluster\.proxy_socket_connections: "10"} - - match: {transient.cluster\.remote\.test_remote_cluster\.proxy_address: $remote_ip} + - match: {persistent.cluster\.remote\.test_remote_cluster\.mode: "proxy"} + - match: {persistent.cluster\.remote\.test_remote_cluster\.proxy_socket_connections: "10"} + - match: {persistent.cluster\.remote\.test_remote_cluster\.proxy_address: $remote_ip} - do: cluster.remote_info: {} @@ -89,7 +89,7 @@ - do: cluster.put_settings: body: - transient: + persistent: cluster.remote.test_remote_cluster.mode: null cluster.remote.test_remote_cluster.proxy_socket_connections: null cluster.remote.test_remote_cluster.proxy_address: null @@ -106,10 +106,10 @@ cluster.put_settings: flat_settings: true body: - transient: + persistent: cluster.remote.remote1.seeds: $remote_ip - - match: {transient: {cluster.remote.remote1.seeds: $remote_ip}} + - match: {persistent: {cluster.remote.remote1.seeds: $remote_ip}} - do: cluster.remote_info: {} @@ -118,10 +118,10 @@ - do: cluster.put_settings: body: - transient: + persistent: cluster.remote.remote1.skip_unavailable: true - - is_true: transient.cluster.remote.remote1.skip_unavailable + - is_true: persistent.cluster.remote.remote1.skip_unavailable - do: cluster.remote_info: {} @@ -131,10 +131,10 @@ - do: cluster.put_settings: body: - transient: + persistent: cluster.remote.remote1.skip_unavailable: false - - is_false: transient.cluster.remote.remote1.skip_unavailable + - is_false: persistent.cluster.remote.remote1.skip_unavailable - do: cluster.remote_info: {} @@ -144,10 +144,10 @@ - do: cluster.put_settings: body: - transient: + persistent: cluster.remote.remote1.skip_unavailable: null - - match: {transient: {}} + - match: {persistent: {}} - do: cluster.remote_info: {} @@ -157,6 +157,6 @@ - do: cluster.put_settings: body: - transient: + persistent: cluster.remote.remote1.seeds: null cluster.remote.remote1.skip_unavailable: null diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/indices.delete/20_destructive_wildcard.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/indices.delete/20_destructive_wildcard.yml index b1fb9b3b333be..f9f268a400d39 100644 --- a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/indices.delete/20_destructive_wildcard.yml +++ b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/indices.delete/20_destructive_wildcard.yml @@ -3,7 +3,7 @@ setup: - do: cluster.put_settings: body: - transient: + persistent: action.destructive_requires_name: "true" flat_settings: true --- @@ -11,7 +11,7 @@ teardown: - do: cluster.put_settings: body: - transient: + persistent: action.destructive_requires_name: "false" flat_settings: true --- diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/scroll/20_keep_alive.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/scroll/20_keep_alive.yml index ab117eebbf607..40c91128d1c76 100644 --- a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/scroll/20_keep_alive.yml +++ b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/scroll/20_keep_alive.yml @@ -4,7 +4,7 @@ - do: cluster.put_settings: body: - transient: + persistent: search.max_keep_alive: null search.default_keep_alive: null @@ -29,7 +29,7 @@ - do: cluster.put_settings: body: - transient: + persistent: search.default_keep_alive: "1m" search.max_keep_alive: "1m" diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/search.aggregation/240_max_buckets.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/search.aggregation/240_max_buckets.yml index 9adf6343fbf95..7f94aeac64de3 100644 --- a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/search.aggregation/240_max_buckets.yml +++ b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/search.aggregation/240_max_buckets.yml @@ -70,7 +70,7 @@ setup: - do: cluster.put_settings: body: - transient: + persistent: search.max_buckets: null --- @@ -79,7 +79,7 @@ setup: - do: cluster.put_settings: body: - transient: + persistent: search.max_buckets: 3 - do: @@ -97,7 +97,7 @@ setup: - do: cluster.put_settings: body: - transient: + persistent: search.max_buckets: 6 - do: diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/search/320_disallow_queries.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/search/320_disallow_queries.yml index 7135c8642736c..b301d64eb834f 100644 --- a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/search/320_disallow_queries.yml +++ b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/search/320_disallow_queries.yml @@ -41,7 +41,7 @@ teardown: - do: cluster.put_settings: body: - transient: + persistent: search.allow_expensive_queries: null --- @@ -61,11 +61,11 @@ teardown: - do: cluster.put_settings: body: - transient: + persistent: search.allow_expensive_queries: "false" flat_settings: true - - match: {transient: {search.allow_expensive_queries: "false"}} + - match: {persistent: {search.allow_expensive_queries: "false"}} ### Prefix - do: diff --git a/x-pack/plugin/ccr/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/ccr/auto_follow.yml b/x-pack/plugin/ccr/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/ccr/auto_follow.yml index fb094f1b9974b..5003ebfdc4d71 100644 --- a/x-pack/plugin/ccr/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/ccr/auto_follow.yml +++ b/x-pack/plugin/ccr/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/ccr/auto_follow.yml @@ -13,11 +13,11 @@ - do: cluster.put_settings: body: - transient: + persistent: cluster.remote.local.seeds: $local_ip flat_settings: true - - match: {transient: {cluster.remote.local.seeds: $local_ip}} + - match: {persistent: {cluster.remote.local.seeds: $local_ip}} - do: ccr.put_auto_follow_pattern: @@ -71,11 +71,11 @@ - do: cluster.put_settings: body: - transient: + persistent: cluster.remote.local.seeds: $local_ip flat_settings: true - - match: {transient: {cluster.remote.local.seeds: $local_ip}} + - match: {persistent: {cluster.remote.local.seeds: $local_ip}} - do: ccr.put_auto_follow_pattern: @@ -131,11 +131,11 @@ - do: cluster.put_settings: body: - transient: + persistent: cluster.remote.local.seeds: $local_ip flat_settings: true - - match: {transient: {cluster.remote.local.seeds: $local_ip}} + - match: {persistent: {cluster.remote.local.seeds: $local_ip}} - do: ccr.put_auto_follow_pattern: @@ -192,11 +192,11 @@ - do: cluster.put_settings: body: - transient: + persistent: cluster.remote.local.seeds: $local_ip flat_settings: true - - match: {transient: {cluster.remote.local.seeds: $local_ip}} + - match: {persistent: {cluster.remote.local.seeds: $local_ip}} - do: ccr.put_auto_follow_pattern: diff --git a/x-pack/plugin/ccr/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/ccr/follow_and_unfollow.yml b/x-pack/plugin/ccr/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/ccr/follow_and_unfollow.yml index bfd00e7b1f879..78a0e67f13419 100644 --- a/x-pack/plugin/ccr/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/ccr/follow_and_unfollow.yml +++ b/x-pack/plugin/ccr/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/ccr/follow_and_unfollow.yml @@ -16,11 +16,11 @@ - do: cluster.put_settings: body: - transient: + persistent: cluster.remote.local.seeds: $local_ip flat_settings: true - - match: {transient: {cluster.remote.local.seeds: $local_ip}} + - match: {persistent: {cluster.remote.local.seeds: $local_ip}} - do: indices.create: diff --git a/x-pack/plugin/ccr/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/ccr/follow_info.yml b/x-pack/plugin/ccr/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/ccr/follow_info.yml index 8383ecd4e6851..f3224482c274e 100644 --- a/x-pack/plugin/ccr/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/ccr/follow_info.yml +++ b/x-pack/plugin/ccr/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/ccr/follow_info.yml @@ -13,11 +13,11 @@ - do: cluster.put_settings: body: - transient: + persistent: cluster.remote.local.seeds: $local_ip flat_settings: true - - match: {transient: {cluster.remote.local.seeds: $local_ip}} + - match: {persistent: {cluster.remote.local.seeds: $local_ip}} - do: indices.create: diff --git a/x-pack/plugin/ccr/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/ccr/follow_stats.yml b/x-pack/plugin/ccr/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/ccr/follow_stats.yml index 8be035961e979..df74a608dbe84 100644 --- a/x-pack/plugin/ccr/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/ccr/follow_stats.yml +++ b/x-pack/plugin/ccr/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/ccr/follow_stats.yml @@ -13,11 +13,11 @@ - do: cluster.put_settings: body: - transient: + persistent: cluster.remote.local.seeds: $local_ip flat_settings: true - - match: {transient: {cluster.remote.local.seeds: $local_ip}} + - match: {persistent: {cluster.remote.local.seeds: $local_ip}} - do: indices.create: diff --git a/x-pack/plugin/ccr/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/ccr/forget_follower.yml b/x-pack/plugin/ccr/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/ccr/forget_follower.yml index 91ff7cf6aed91..b4ed59a355edc 100644 --- a/x-pack/plugin/ccr/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/ccr/forget_follower.yml +++ b/x-pack/plugin/ccr/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/ccr/forget_follower.yml @@ -16,11 +16,11 @@ - do: cluster.put_settings: body: - transient: + persistent: cluster.remote.remote_cluster.seeds: $local_ip flat_settings: true - - match: {transient: {cluster.remote.remote_cluster.seeds: $local_ip}} + - match: {persistent: {cluster.remote.remote_cluster.seeds: $local_ip}} - do: indices.create: diff --git a/x-pack/plugin/ccr/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/ccr/index_directly_into_follower_index.yml b/x-pack/plugin/ccr/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/ccr/index_directly_into_follower_index.yml index 406ffe092ac19..7beca43f02f8a 100644 --- a/x-pack/plugin/ccr/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/ccr/index_directly_into_follower_index.yml +++ b/x-pack/plugin/ccr/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/ccr/index_directly_into_follower_index.yml @@ -16,11 +16,11 @@ - do: cluster.put_settings: body: - transient: + persistent: cluster.remote.local.seeds: $local_ip flat_settings: true - - match: {transient: {cluster.remote.local.seeds: $local_ip}} + - match: {persistent: {cluster.remote.local.seeds: $local_ip}} - do: indices.create: diff --git a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/ml/data_frame_analytics_crud.yml b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/ml/data_frame_analytics_crud.yml index da0df533886fa..0cfe760946822 100644 --- a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/ml/data_frame_analytics_crud.yml +++ b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/ml/data_frame_analytics_crud.yml @@ -991,9 +991,9 @@ setup: Authorization: "Basic eF9wYWNrX3Jlc3RfdXNlcjp4LXBhY2stdGVzdC1wYXNzd29yZA==" # run as x_pack_rest_user, i.e. the test setup superuser cluster.put_settings: body: - transient: + persistent: xpack.ml.max_model_memory_limit: "20mb" - - match: {transient.xpack.ml.max_model_memory_limit: "20mb"} + - match: {persistent.xpack.ml.max_model_memory_limit: "20mb"} # Explicit request higher than limit is an error - do: @@ -1050,9 +1050,9 @@ setup: Authorization: "Basic eF9wYWNrX3Jlc3RfdXNlcjp4LXBhY2stdGVzdC1wYXNzd29yZA==" # run as x_pack_rest_user, i.e. the test setup superuser cluster.put_settings: body: - transient: + persistent: xpack.ml.max_model_memory_limit: null - - match: {transient: {}} + - match: {persistent: {}} --- "Test put outlier_detection given n_neighbors is negative": diff --git a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/ml/jobs_crud.yml b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/ml/jobs_crud.yml index 34850f8b22c62..d08b3f26060c2 100644 --- a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/ml/jobs_crud.yml +++ b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/ml/jobs_crud.yml @@ -1206,9 +1206,9 @@ Authorization: "Basic eF9wYWNrX3Jlc3RfdXNlcjp4LXBhY2stdGVzdC1wYXNzd29yZA==" # run as x_pack_rest_user, i.e. the test setup superuser cluster.put_settings: body: - transient: + persistent: xpack.ml.max_model_memory_limit: "9g" - - match: {transient.xpack.ml.max_model_memory_limit: "9g"} + - match: {persistent.xpack.ml.max_model_memory_limit: "9g"} - do: ml.put_job: @@ -1248,9 +1248,9 @@ Authorization: "Basic eF9wYWNrX3Jlc3RfdXNlcjp4LXBhY2stdGVzdC1wYXNzd29yZA==" # run as x_pack_rest_user, i.e. the test setup superuser cluster.put_settings: body: - transient: + persistent: xpack.ml.max_model_memory_limit: null - - match: {transient: {}} + - match: {persistent: {}} - do: ml.put_job: @@ -1426,9 +1426,9 @@ Authorization: "Basic eF9wYWNrX3Jlc3RfdXNlcjp4LXBhY2stdGVzdC1wYXNzd29yZA==" # run as x_pack_rest_user, i.e. the test setup superuser cluster.put_settings: body: - transient: + persistent: cluster.persistent_tasks.allocation.enable: "none" - - match: {transient.cluster.persistent_tasks.allocation.enable: "none"} + - match: {persistent.cluster.persistent_tasks.allocation.enable: "none"} - do: ml.put_job: @@ -1456,9 +1456,9 @@ Authorization: "Basic eF9wYWNrX3Jlc3RfdXNlcjp4LXBhY2stdGVzdC1wYXNzd29yZA==" # run as x_pack_rest_user, i.e. the test setup superuser cluster.put_settings: body: - transient: + persistent: cluster.persistent_tasks.allocation.enable: "all" - - match: {transient.cluster.persistent_tasks.allocation.enable: "all"} + - match: {persistent.cluster.persistent_tasks.allocation.enable: "all"} - do: ml.open_job: diff --git a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/ml/set_upgrade_mode.yml b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/ml/set_upgrade_mode.yml index 7a463549e17ee..4be85911e55fd 100644 --- a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/ml/set_upgrade_mode.yml +++ b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/ml/set_upgrade_mode.yml @@ -64,7 +64,7 @@ setup: cluster.put_settings: body: > { - "transient": { + "persistent": { "logger.org.elasticsearch.xpack.ml.action.TransportSetUpgradeModeAction": "TRACE", "logger.org.elasticsearch.xpack.ml.action.TransportCloseJobAction": "TRACE", "logger.org.elasticsearch.xpack.ml.job.process.autodetect.AutodetectProcessManager": "TRACE" diff --git a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/ml/start_stop_datafeed.yml b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/ml/start_stop_datafeed.yml index 996111bce527f..25d268098c82c 100644 --- a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/ml/start_stop_datafeed.yml +++ b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/ml/start_stop_datafeed.yml @@ -472,9 +472,9 @@ setup: Authorization: "Basic eF9wYWNrX3Jlc3RfdXNlcjp4LXBhY2stdGVzdC1wYXNzd29yZA==" # run as x_pack_rest_user, i.e. the test setup superuser cluster.put_settings: body: - transient: + persistent: cluster.persistent_tasks.allocation.enable: "none" - - match: {transient.cluster.persistent_tasks.allocation.enable: "none"} + - match: {persistent.cluster.persistent_tasks.allocation.enable: "none"} - do: catch: /no persistent task assignments are allowed due to cluster settings/ @@ -492,9 +492,9 @@ setup: Authorization: "Basic eF9wYWNrX3Jlc3RfdXNlcjp4LXBhY2stdGVzdC1wYXNzd29yZA==" # run as x_pack_rest_user, i.e. the test setup superuser cluster.put_settings: body: - transient: + persistent: cluster.persistent_tasks.allocation.enable: "all" - - match: {transient.cluster.persistent_tasks.allocation.enable: "all"} + - match: {persistent.cluster.persistent_tasks.allocation.enable: "all"} - do: ml.start_datafeed: diff --git a/x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/put_watch/90_auto_create_index.yml b/x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/put_watch/90_auto_create_index.yml index b9b9a39dab776..c247cf2dac1e5 100644 --- a/x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/put_watch/90_auto_create_index.yml +++ b/x-pack/plugin/watcher/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/watcher/put_watch/90_auto_create_index.yml @@ -6,7 +6,7 @@ setup: - do: cluster.put_settings: body: - transient: + persistent: action.auto_create_index: false --- @@ -18,7 +18,7 @@ teardown: - do: cluster.put_settings: body: - transient: + persistent: action.auto_create_index: null --- diff --git a/x-pack/qa/core-rest-tests-with-security/src/test/resources/rest-api-spec/test/stack/10_stack.yml b/x-pack/qa/core-rest-tests-with-security/src/test/resources/rest-api-spec/test/stack/10_stack.yml index 31f8cecdb1ce3..47913dd98edd0 100644 --- a/x-pack/qa/core-rest-tests-with-security/src/test/resources/rest-api-spec/test/stack/10_stack.yml +++ b/x-pack/qa/core-rest-tests-with-security/src/test/resources/rest-api-spec/test/stack/10_stack.yml @@ -2,7 +2,7 @@ - do: cluster.put_settings: body: - transient: + persistent: stack.templates.enabled: false - do: diff --git a/x-pack/qa/multi-cluster-search-security/build.gradle b/x-pack/qa/multi-cluster-search-security/build.gradle index 48da226f8efe2..569a0d5dbd0e4 100644 --- a/x-pack/qa/multi-cluster-search-security/build.gradle +++ b/x-pack/qa/multi-cluster-search-security/build.gradle @@ -63,8 +63,8 @@ tasks.register('mixed-cluster', RestIntegTestTask) { systemProperty 'tests.rest.suite', 'multi_cluster' if (proxyMode) { systemProperty 'tests.rest.blacklist', [ - 'multi_cluster/10_basic/Add transient remote cluster based on the preset cluster', - 'multi_cluster/20_info/Add transient remote cluster based on the preset cluster and check remote info', + 'multi_cluster/10_basic/Add persistent remote cluster based on the preset cluster', + 'multi_cluster/20_info/Add persistent remote cluster based on the preset cluster and check remote info', 'multi_cluster/20_info/Fetch remote cluster info for existing cluster', 'multi_cluster/70_connection_mode_configuration/*', ].join(",") diff --git a/x-pack/qa/multi-cluster-search-security/src/test/resources/rest-api-spec/test/multi_cluster/10_basic.yml b/x-pack/qa/multi-cluster-search-security/src/test/resources/rest-api-spec/test/multi_cluster/10_basic.yml index a90ed83c02425..c4bf53b0fa936 100644 --- a/x-pack/qa/multi-cluster-search-security/src/test/resources/rest-api-spec/test/multi_cluster/10_basic.yml +++ b/x-pack/qa/multi-cluster-search-security/src/test/resources/rest-api-spec/test/multi_cluster/10_basic.yml @@ -237,7 +237,7 @@ teardown: - match: { aggregations.cluster.buckets.0.doc_count: 5 } --- -"Add transient remote cluster based on the preset cluster": +"Add persistent remote cluster based on the preset cluster": - do: cluster.get_settings: include_defaults: true @@ -248,10 +248,10 @@ teardown: cluster.put_settings: flat_settings: true body: - transient: + persistent: cluster.remote.test_remote_cluster.seeds: $remote_ip - - match: {transient: {cluster.remote.test_remote_cluster.seeds: $remote_ip}} + - match: {persistent: {cluster.remote.test_remote_cluster.seeds: $remote_ip}} - do: headers: { Authorization: "Basic am9lOnMza3JpdC1wYXNzd29yZA==" } diff --git a/x-pack/qa/multi-cluster-search-security/src/test/resources/rest-api-spec/test/multi_cluster/20_info.yml b/x-pack/qa/multi-cluster-search-security/src/test/resources/rest-api-spec/test/multi_cluster/20_info.yml index 7ee92405b5fff..790eb95da23d7 100644 --- a/x-pack/qa/multi-cluster-search-security/src/test/resources/rest-api-spec/test/multi_cluster/20_info.yml +++ b/x-pack/qa/multi-cluster-search-security/src/test/resources/rest-api-spec/test/multi_cluster/20_info.yml @@ -43,7 +43,7 @@ teardown: - match: { my_remote_cluster.initial_connect_timeout: "30s" } --- -"Add transient remote cluster based on the preset cluster and check remote info": +"Add persistent remote cluster based on the preset cluster and check remote info": - do: cluster.get_settings: include_defaults: true @@ -54,10 +54,10 @@ teardown: cluster.put_settings: flat_settings: true body: - transient: + persistent: cluster.remote.test_remote_cluster.seeds: $remote_ip - - match: {transient: {cluster.remote.test_remote_cluster.seeds: $remote_ip}} + - match: {persistent: {cluster.remote.test_remote_cluster.seeds: $remote_ip}} # we do another search here since this will enforce the connection to be established # otherwise the cluster might not have been connected yet. diff --git a/x-pack/qa/multi-cluster-search-security/src/test/resources/rest-api-spec/test/multi_cluster/70_connection_mode_configuration.yml b/x-pack/qa/multi-cluster-search-security/src/test/resources/rest-api-spec/test/multi_cluster/70_connection_mode_configuration.yml index 05185cb3e3328..41531e46b6c63 100644 --- a/x-pack/qa/multi-cluster-search-security/src/test/resources/rest-api-spec/test/multi_cluster/70_connection_mode_configuration.yml +++ b/x-pack/qa/multi-cluster-search-security/src/test/resources/rest-api-spec/test/multi_cluster/70_connection_mode_configuration.yml @@ -1,5 +1,5 @@ --- -"Add transient remote cluster in proxy mode with invalid sniff settings": +"Add persistent remote cluster in proxy mode with invalid sniff settings": - do: cluster.get_settings: include_defaults: true @@ -11,7 +11,7 @@ cluster.put_settings: flat_settings: true body: - transient: + persistent: cluster.remote.test_remote_cluster.mode: "proxy" cluster.remote.test_remote_cluster.node_connections: "5" cluster.remote.test_remote_cluster.proxy_address: $remote_ip @@ -26,7 +26,7 @@ cluster.put_settings: flat_settings: true body: - transient: + persistent: cluster.remote.test_remote_cluster.mode: "proxy" cluster.remote.test_remote_cluster.seeds: $remote_ip cluster.remote.test_remote_cluster.proxy_address: $remote_ip @@ -37,7 +37,7 @@ used with the configured \"cluster.remote.test_remote_cluster.mode\" [required=SNIFF, configured=PROXY]" } --- -"Add transient remote cluster in sniff mode with invalid proxy settings": +"Add persistent remote cluster in sniff mode with invalid proxy settings": - do: cluster.get_settings: include_defaults: true @@ -49,7 +49,7 @@ cluster.put_settings: flat_settings: true body: - transient: + persistent: cluster.remote.test_remote_cluster.proxy_socket_connections: "20" cluster.remote.test_remote_cluster.seeds: $remote_ip @@ -63,7 +63,7 @@ cluster.put_settings: flat_settings: true body: - transient: + persistent: cluster.remote.test_remote_cluster.proxy_address: $remote_ip cluster.remote.test_remote_cluster.seeds: $remote_ip @@ -73,7 +73,7 @@ used with the configured \"cluster.remote.test_remote_cluster.mode\" [required=PROXY, configured=SNIFF]" } --- -"Add transient remote cluster using proxy connection mode using valid settings": +"Add persistent remote cluster using proxy connection mode using valid settings": - do: cluster.get_settings: include_defaults: true @@ -84,14 +84,14 @@ cluster.put_settings: flat_settings: true body: - transient: + persistent: cluster.remote.test_remote_cluster.mode: "proxy" cluster.remote.test_remote_cluster.proxy_socket_connections: "3" cluster.remote.test_remote_cluster.proxy_address: $remote_ip - - match: {transient.cluster\.remote\.test_remote_cluster\.mode: "proxy"} - - match: {transient.cluster\.remote\.test_remote_cluster\.proxy_socket_connections: "3"} - - match: {transient.cluster\.remote\.test_remote_cluster\.proxy_address: $remote_ip} + - match: {persistent.cluster\.remote\.test_remote_cluster\.mode: "proxy"} + - match: {persistent.cluster\.remote\.test_remote_cluster\.proxy_socket_connections: "3"} + - match: {persistent.cluster\.remote\.test_remote_cluster\.proxy_address: $remote_ip} - do: search: @@ -107,7 +107,7 @@ - match: { hits.hits.0._index: "test_remote_cluster:test_index" } --- -"Add transient remote cluster using sniff connection mode using valid settings": +"Add persistent remote cluster using sniff connection mode using valid settings": - do: cluster.get_settings: include_defaults: true @@ -118,14 +118,14 @@ cluster.put_settings: flat_settings: true body: - transient: + persistent: cluster.remote.test_remote_cluster.mode: "sniff" cluster.remote.test_remote_cluster.node_connections: "3" cluster.remote.test_remote_cluster.seeds: $remote_ip - - match: {transient.cluster\.remote\.test_remote_cluster\.mode: "sniff"} - - match: {transient.cluster\.remote\.test_remote_cluster\.node_connections: "3"} - - match: {transient.cluster\.remote\.test_remote_cluster\.seeds: $remote_ip} + - match: {persistent.cluster\.remote\.test_remote_cluster\.mode: "sniff"} + - match: {persistent.cluster\.remote\.test_remote_cluster\.node_connections: "3"} + - match: {persistent.cluster\.remote\.test_remote_cluster\.seeds: $remote_ip} - do: search: @@ -152,12 +152,12 @@ cluster.put_settings: flat_settings: true body: - transient: + persistent: cluster.remote.test_remote_cluster.mode: "sniff" cluster.remote.test_remote_cluster.seeds: $remote_ip - - match: {transient.cluster\.remote\.test_remote_cluster\.mode: "sniff"} - - match: {transient.cluster\.remote\.test_remote_cluster\.seeds: $remote_ip} + - match: {persistent.cluster\.remote\.test_remote_cluster\.mode: "sniff"} + - match: {persistent.cluster\.remote\.test_remote_cluster\.seeds: $remote_ip} - do: search: @@ -177,7 +177,7 @@ cluster.put_settings: flat_settings: true body: - transient: + persistent: cluster.remote.test_remote_cluster.mode: "proxy" cluster.remote.test_remote_cluster.proxy_address: $remote_ip @@ -190,13 +190,13 @@ cluster.put_settings: flat_settings: true body: - transient: + persistent: cluster.remote.test_remote_cluster.mode: "proxy" cluster.remote.test_remote_cluster.seeds: null cluster.remote.test_remote_cluster.proxy_address: $remote_ip - - match: {transient.cluster\.remote\.test_remote_cluster\.mode: "proxy"} - - match: {transient.cluster\.remote\.test_remote_cluster\.proxy_address: $remote_ip} + - match: {persistent.cluster\.remote\.test_remote_cluster\.mode: "proxy"} + - match: {persistent.cluster\.remote\.test_remote_cluster\.proxy_address: $remote_ip} - do: search: From 38ecd0baa103514e29d782c711b2a15bb3685dbe Mon Sep 17 00:00:00 2001 From: David Kyle Date: Thu, 30 Sep 2021 16:51:25 +0100 Subject: [PATCH 084/250] [ML] Add Inference time configuration overrides (#78441) Allow inference settings to be updated at the point of inference Updating the results_field is added for all task types, additionally fill_mask tasks can set the number of results (previously hard-coded to 5) and text_classification can set the classification labels (e.g. happy/sad) --- .../MlInferenceNamedXContentProvider.java | 36 ++- .../trainedmodel/ClassificationConfig.java | 1 + .../trainedmodel/FillMaskConfig.java | 97 ++++++-- .../trainedmodel/FillMaskConfigUpdate.java | 179 +++++++++++++++ .../trainedmodel/InferenceConfig.java | 2 + .../ml/inference/trainedmodel/NerConfig.java | 24 +- .../trainedmodel/NerConfigUpdate.java | 153 +++++++++++++ .../ml/inference/trainedmodel/NlpConfig.java | 3 + .../trainedmodel/NlpConfigUpdate.java | 4 - .../trainedmodel/NullInferenceConfig.java | 5 + .../trainedmodel/PassThroughConfig.java | 25 ++- .../trainedmodel/PassThroughConfigUpdate.java | 151 +++++++++++++ .../trainedmodel/RegressionConfig.java | 1 + .../TextClassificationConfig.java | 121 ++++++++-- .../TextClassificationConfigUpdate.java | 211 ++++++++++++++++++ .../trainedmodel/TextEmbeddingConfig.java | 24 +- .../TextEmbeddingConfigUpdate.java | 152 +++++++++++++ .../ZeroShotClassificationConfig.java | 24 +- .../ZeroShotClassificationConfigUpdate.java | 37 ++- .../trainedmodel/FillMaskConfigTests.java | 4 +- .../FillMaskConfigUpdateTests.java | 103 +++++++++ .../trainedmodel/NerConfigTests.java | 3 +- .../trainedmodel/NerConfigUpdateTests.java | 82 +++++++ .../trainedmodel/PassThroughConfigTests.java | 3 +- .../PassThroughConfigUpdateTests.java | 80 +++++++ .../TextClassificationConfigTests.java | 30 ++- .../TextClassificationConfigUpdateTests.java | 148 ++++++++++++ .../TextEmbeddingConfigTests.java | 3 +- .../TextEmbeddingConfigUpdateTests.java | 80 +++++++ .../ZeroShotClassificationConfigTests.java | 3 +- ...roShotClassificationConfigUpdateTests.java | 32 ++- .../xpack/ml/integration/AutoscalingIT.java | 2 +- .../ml/integration/TestFeatureResetIT.java | 3 +- .../ml/integration/TrainedModelCRUDIT.java | 3 +- .../inference/ingest/InferenceProcessor.java | 28 ++- .../ml/inference/nlp/FillMaskProcessor.java | 15 +- .../nlp/TextClassificationProcessor.java | 30 +-- .../inference/nlp/FillMaskProcessorTests.java | 17 +- .../ml/inference/nlp/NerProcessorTests.java | 4 +- .../nlp/TextClassificationProcessorTests.java | 38 +--- .../ZeroShotClassificationProcessorTests.java | 1 + 41 files changed, 1797 insertions(+), 165 deletions(-) create mode 100644 x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/FillMaskConfigUpdate.java create mode 100644 x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NerConfigUpdate.java create mode 100644 x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/PassThroughConfigUpdate.java create mode 100644 x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextClassificationConfigUpdate.java create mode 100644 x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextEmbeddingConfigUpdate.java create mode 100644 x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/FillMaskConfigUpdateTests.java create mode 100644 x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NerConfigUpdateTests.java create mode 100644 x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/PassThroughConfigUpdateTests.java create mode 100644 x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextClassificationConfigUpdateTests.java create mode 100644 x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextEmbeddingConfigUpdateTests.java diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/MlInferenceNamedXContentProvider.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/MlInferenceNamedXContentProvider.java index 8dc59193aef36..b1ba4e5256cc6 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/MlInferenceNamedXContentProvider.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/MlInferenceNamedXContentProvider.java @@ -28,12 +28,12 @@ import org.elasticsearch.xpack.core.ml.inference.results.TextClassificationResults; import org.elasticsearch.xpack.core.ml.inference.results.TextEmbeddingResults; import org.elasticsearch.xpack.core.ml.inference.results.WarningInferenceResults; -import org.elasticsearch.xpack.core.ml.inference.trainedmodel.PassThroughConfig; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.BertTokenization; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.ClassificationConfig; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.ClassificationConfigUpdate; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.EmptyConfigUpdate; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.FillMaskConfig; +import org.elasticsearch.xpack.core.ml.inference.trainedmodel.FillMaskConfigUpdate; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.IndexLocation; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.InferenceConfig; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.InferenceConfigUpdate; @@ -41,14 +41,19 @@ import org.elasticsearch.xpack.core.ml.inference.trainedmodel.LenientlyParsedTrainedModel; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.LenientlyParsedTrainedModelLocation; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.NerConfig; +import org.elasticsearch.xpack.core.ml.inference.trainedmodel.NerConfigUpdate; +import org.elasticsearch.xpack.core.ml.inference.trainedmodel.PassThroughConfig; +import org.elasticsearch.xpack.core.ml.inference.trainedmodel.PassThroughConfigUpdate; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.RegressionConfig; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.RegressionConfigUpdate; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.ResultsFieldUpdate; -import org.elasticsearch.xpack.core.ml.inference.trainedmodel.TextClassificationConfig; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.StrictlyParsedInferenceConfig; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.StrictlyParsedTrainedModel; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.StrictlyParsedTrainedModelLocation; +import org.elasticsearch.xpack.core.ml.inference.trainedmodel.TextClassificationConfig; +import org.elasticsearch.xpack.core.ml.inference.trainedmodel.TextClassificationConfigUpdate; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.TextEmbeddingConfig; +import org.elasticsearch.xpack.core.ml.inference.trainedmodel.TextEmbeddingConfigUpdate; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.Tokenization; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.TrainedModel; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.TrainedModelLocation; @@ -192,12 +197,22 @@ public List getNamedXContentParsers() { new ParseField(ZeroShotClassificationConfig.NAME), ZeroShotClassificationConfig::fromXContentStrict)); + // Inference Configs Update namedXContent.add(new NamedXContentRegistry.Entry(InferenceConfigUpdate.class, ClassificationConfigUpdate.NAME, ClassificationConfigUpdate::fromXContentStrict)); + namedXContent.add(new NamedXContentRegistry.Entry(InferenceConfigUpdate.class, new ParseField(FillMaskConfigUpdate.NAME), + FillMaskConfigUpdate::fromXContentStrict)); + namedXContent.add(new NamedXContentRegistry.Entry(InferenceConfigUpdate.class, new ParseField(NerConfigUpdate.NAME), + NerConfigUpdate::fromXContentStrict)); + namedXContent.add(new NamedXContentRegistry.Entry(InferenceConfigUpdate.class, new ParseField(PassThroughConfigUpdate.NAME), + PassThroughConfigUpdate::fromXContentStrict)); namedXContent.add(new NamedXContentRegistry.Entry(InferenceConfigUpdate.class, RegressionConfigUpdate.NAME, RegressionConfigUpdate::fromXContentStrict)); - namedXContent.add( - new NamedXContentRegistry.Entry( + namedXContent.add(new NamedXContentRegistry.Entry(InferenceConfigUpdate.class, new ParseField(TextClassificationConfig.NAME), + TextClassificationConfigUpdate::fromXContentStrict)); + namedXContent.add(new NamedXContentRegistry.Entry(InferenceConfigUpdate.class, new ParseField(TextEmbeddingConfigUpdate.NAME), + TextEmbeddingConfigUpdate::fromXContentStrict)); + namedXContent.add(new NamedXContentRegistry.Entry( InferenceConfigUpdate.class, new ParseField(ZeroShotClassificationConfigUpdate.NAME), ZeroShotClassificationConfigUpdate::fromXContentStrict @@ -305,14 +320,25 @@ public List getNamedWriteables() { namedWriteables.add(new NamedWriteableRegistry.Entry(InferenceConfig.class, ZeroShotClassificationConfig.NAME, ZeroShotClassificationConfig::new)); + // Inference Configs Updates namedWriteables.add(new NamedWriteableRegistry.Entry(InferenceConfigUpdate.class, ClassificationConfigUpdate.NAME.getPreferredName(), ClassificationConfigUpdate::new)); + namedWriteables.add(new NamedWriteableRegistry.Entry(InferenceConfigUpdate.class, + EmptyConfigUpdate.NAME, EmptyConfigUpdate::new)); + namedWriteables.add(new NamedWriteableRegistry.Entry(InferenceConfigUpdate.class, + FillMaskConfigUpdate.NAME, FillMaskConfigUpdate::new)); + namedWriteables.add(new NamedWriteableRegistry.Entry(InferenceConfigUpdate.class, + NerConfigUpdate.NAME, NerConfigUpdate::new)); + namedWriteables.add(new NamedWriteableRegistry.Entry(InferenceConfigUpdate.class, + PassThroughConfigUpdate.NAME, PassThroughConfigUpdate::new)); namedWriteables.add(new NamedWriteableRegistry.Entry(InferenceConfigUpdate.class, RegressionConfigUpdate.NAME.getPreferredName(), RegressionConfigUpdate::new)); namedWriteables.add(new NamedWriteableRegistry.Entry(InferenceConfigUpdate.class, ResultsFieldUpdate.NAME, ResultsFieldUpdate::new)); namedWriteables.add(new NamedWriteableRegistry.Entry(InferenceConfigUpdate.class, - EmptyConfigUpdate.NAME, EmptyConfigUpdate::new)); + TextClassificationConfigUpdate.NAME, TextClassificationConfigUpdate::new)); + namedWriteables.add(new NamedWriteableRegistry.Entry(InferenceConfigUpdate.class, + TextEmbeddingConfigUpdate.NAME, TextClassificationConfigUpdate::new)); namedWriteables.add(new NamedWriteableRegistry.Entry(InferenceConfigUpdate.class, ZeroShotClassificationConfigUpdate.NAME, ZeroShotClassificationConfigUpdate::new)); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ClassificationConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ClassificationConfig.java index 3b82053cfb151..bc6b3723a3fa1 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ClassificationConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ClassificationConfig.java @@ -110,6 +110,7 @@ public String getTopClassesResultsField() { return topClassesResultsField; } + @Override public String getResultsField() { return resultsField; } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/FillMaskConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/FillMaskConfig.java index 7dd5c855de36f..f5d71a7801afa 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/FillMaskConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/FillMaskConfig.java @@ -10,7 +10,7 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; +import org.elasticsearch.common.xcontent.ObjectParser; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.core.Nullable; @@ -25,23 +25,23 @@ public class FillMaskConfig implements NlpConfig { public static final String NAME = "fill_mask"; + public static final int DEFAULT_NUM_RESULTS = 5; public static FillMaskConfig fromXContentStrict(XContentParser parser) { - return STRICT_PARSER.apply(parser, null); + return STRICT_PARSER.apply(parser, null).build(); } public static FillMaskConfig fromXContentLenient(XContentParser parser) { - return LENIENT_PARSER.apply(parser, null); + return LENIENT_PARSER.apply(parser, null).build(); } - private static final ConstructingObjectParser STRICT_PARSER = createParser(false); - private static final ConstructingObjectParser LENIENT_PARSER = createParser(true); + private static final ObjectParser STRICT_PARSER = createParser(false); + private static final ObjectParser LENIENT_PARSER = createParser(true); - private static ConstructingObjectParser createParser(boolean ignoreUnknownFields) { - ConstructingObjectParser parser = new ConstructingObjectParser<>(NAME, ignoreUnknownFields, - a -> new FillMaskConfig((VocabularyConfig) a[0], (Tokenization) a[1])); + private static ObjectParser createParser(boolean ignoreUnknownFields) { + ObjectParser parser = new ObjectParser<>(NAME, ignoreUnknownFields, Builder::new); parser.declareObject( - ConstructingObjectParser.optionalConstructorArg(), + Builder::setVocabularyConfig, (p, c) -> { if (ignoreUnknownFields == false) { throw ExceptionsHelper.badRequestException( @@ -54,24 +54,35 @@ private static ConstructingObjectParser createParser(boole VOCABULARY ); parser.declareNamedObject( - ConstructingObjectParser.optionalConstructorArg(), (p, c, n) -> p.namedObject(Tokenization.class, n, ignoreUnknownFields), + Builder::setTokenization, (p, c, n) -> p.namedObject(Tokenization.class, n, ignoreUnknownFields), TOKENIZATION ); + parser.declareInt(Builder::setNumTopClasses, NUM_TOP_CLASSES); + parser.declareString(Builder::setResultsField, RESULTS_FIELD); return parser; } private final VocabularyConfig vocabularyConfig; private final Tokenization tokenization; + private final int numTopClasses; + private final String resultsField; - public FillMaskConfig(@Nullable VocabularyConfig vocabularyConfig, @Nullable Tokenization tokenization) { + public FillMaskConfig(@Nullable VocabularyConfig vocabularyConfig, + @Nullable Tokenization tokenization, + @Nullable Integer numTopClasses, + @Nullable String resultsField) { this.vocabularyConfig = Optional.ofNullable(vocabularyConfig) .orElse(new VocabularyConfig(InferenceIndexConstants.nativeDefinitionStore())); this.tokenization = tokenization == null ? Tokenization.createDefault() : tokenization; + this.numTopClasses = numTopClasses == null ? DEFAULT_NUM_RESULTS : numTopClasses; + this.resultsField = resultsField; } public FillMaskConfig(StreamInput in) throws IOException { vocabularyConfig = new VocabularyConfig(in); tokenization = in.readNamedWriteable(Tokenization.class); + numTopClasses = in.readInt(); + resultsField = in.readOptionalString(); } @Override @@ -79,6 +90,10 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws builder.startObject(); builder.field(VOCABULARY.getPreferredName(), vocabularyConfig, params); NamedXContentObjectHelper.writeNamedObject(builder, params, TOKENIZATION.getPreferredName(), tokenization); + builder.field(NUM_TOP_CLASSES.getPreferredName(), numTopClasses); + if (resultsField != null) { + builder.field(RESULTS_FIELD.getPreferredName(), resultsField); + } builder.endObject(); return builder; } @@ -92,6 +107,8 @@ public String getWriteableName() { public void writeTo(StreamOutput out) throws IOException { vocabularyConfig.writeTo(out); out.writeNamedWriteable(tokenization); + out.writeInt(numTopClasses); + out.writeOptionalString(resultsField); } @Override @@ -116,12 +133,14 @@ public boolean equals(Object o) { FillMaskConfig that = (FillMaskConfig) o; return Objects.equals(vocabularyConfig, that.vocabularyConfig) - && Objects.equals(tokenization, that.tokenization); + && Objects.equals(tokenization, that.tokenization) + && Objects.equals(resultsField, that.resultsField) + && numTopClasses == that.numTopClasses; } @Override public int hashCode() { - return Objects.hash(vocabularyConfig, tokenization); + return Objects.hash(vocabularyConfig, tokenization, numTopClasses, resultsField); } @Override @@ -134,8 +153,60 @@ public Tokenization getTokenization() { return tokenization; } + public int getNumTopClasses() { + return numTopClasses; + } + + @Override + public String getResultsField() { + return resultsField; + } + @Override public boolean isAllocateOnly() { return true; } + + public static class Builder { + private VocabularyConfig vocabularyConfig; + private Tokenization tokenization; + private int numTopClasses; + private String resultsField; + + Builder() {} + + Builder(FillMaskConfig config) { + this.vocabularyConfig = config.vocabularyConfig; + this.tokenization = config.tokenization; + this.numTopClasses = config.numTopClasses; + this.resultsField = config.resultsField; + } + + public FillMaskConfig.Builder setVocabularyConfig(VocabularyConfig vocabularyConfig) { + this.vocabularyConfig = vocabularyConfig; + return this; + } + + public FillMaskConfig.Builder setTokenization(Tokenization tokenization) { + this.tokenization = tokenization; + return this; + } + + public FillMaskConfig.Builder setNumTopClasses(Integer numTopClasses) { + this.numTopClasses = numTopClasses; + return this; + } + + public FillMaskConfig.Builder setResultsField(String resultsField) { + this.resultsField = resultsField; + return this; + } + + public FillMaskConfig build() { + return new FillMaskConfig(vocabularyConfig, + tokenization, + numTopClasses, + resultsField); + } + } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/FillMaskConfigUpdate.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/FillMaskConfigUpdate.java new file mode 100644 index 0000000000000..3d14f4561bea8 --- /dev/null +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/FillMaskConfigUpdate.java @@ -0,0 +1,179 @@ +/* + * 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.core.ml.inference.trainedmodel; + +import org.elasticsearch.common.io.stream.StreamInput; +import org.elasticsearch.common.io.stream.StreamOutput; +import org.elasticsearch.common.xcontent.ObjectParser; +import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; +import org.elasticsearch.xpack.core.ml.utils.NamedXContentObject; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +import static org.elasticsearch.xpack.core.ml.inference.trainedmodel.NlpConfig.NUM_TOP_CLASSES; +import static org.elasticsearch.xpack.core.ml.inference.trainedmodel.NlpConfig.RESULTS_FIELD; + +public class FillMaskConfigUpdate extends NlpConfigUpdate implements NamedXContentObject { + + public static final String NAME = FillMaskConfig.NAME; + + public static FillMaskConfigUpdate fromMap(Map map) { + Map options = new HashMap<>(map); + Integer numTopClasses = (Integer)options.remove(NUM_TOP_CLASSES.getPreferredName()); + String resultsField = (String)options.remove(RESULTS_FIELD.getPreferredName()); + + if (options.isEmpty() == false) { + throw ExceptionsHelper.badRequestException("Unrecognized fields {}.", options.keySet()); + } + return new FillMaskConfigUpdate(numTopClasses, resultsField); + } + + private static final ObjectParser STRICT_PARSER = createParser(false); + + private static ObjectParser createParser(boolean lenient) { + ObjectParser parser = new ObjectParser<>( + NAME, + lenient, + FillMaskConfigUpdate.Builder::new); + parser.declareString(FillMaskConfigUpdate.Builder::setResultsField, RESULTS_FIELD); + parser.declareInt(FillMaskConfigUpdate.Builder::setNumTopClasses, NUM_TOP_CLASSES); + return parser; + } + + public static FillMaskConfigUpdate fromXContentStrict(XContentParser parser) { + return STRICT_PARSER.apply(parser, null).build(); + } + + private final Integer numTopClasses; + private final String resultsField; + + public FillMaskConfigUpdate(Integer numTopClasses, String resultsField) { + this.numTopClasses = numTopClasses; + this.resultsField = resultsField; + } + + public FillMaskConfigUpdate(StreamInput in) throws IOException { + this.numTopClasses = in.readOptionalInt(); + this.resultsField = in.readOptionalString(); + } + + @Override + public void writeTo(StreamOutput out) throws IOException { + out.writeOptionalInt(numTopClasses); + out.writeOptionalString(resultsField); + } + + @Override + public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { + builder.startObject(); + if (numTopClasses != null) { + builder.field(NUM_TOP_CLASSES.getPreferredName(), numTopClasses); + } + if (resultsField != null) { + builder.field(RESULTS_FIELD.getPreferredName(), resultsField); + } + builder.endObject(); + return builder; + } + + @Override + public String getWriteableName() { + return NAME; + } + + @Override + public String getName() { + return NAME; + } + + @Override + public InferenceConfig apply(InferenceConfig originalConfig) { + if (originalConfig instanceof FillMaskConfig == false) { + throw ExceptionsHelper.badRequestException( + "Inference config of type [{}] can not be updated with a request of type [{}]", + originalConfig.getName(), + getName()); + } + + FillMaskConfig fillMaskConfig = (FillMaskConfig)originalConfig; + if (isNoop(fillMaskConfig)) { + return originalConfig; + } + + FillMaskConfig.Builder builder = new FillMaskConfig.Builder(fillMaskConfig); + if (numTopClasses != null) { + builder.setNumTopClasses(numTopClasses); + } + if (resultsField != null) { + builder.setResultsField(resultsField); + } + return builder.build(); + } + + boolean isNoop(FillMaskConfig originalConfig) { + return (this.numTopClasses == null || this.numTopClasses == originalConfig.getNumTopClasses()) && + (this.resultsField == null || this.resultsField.equals(originalConfig.getResultsField())); + } + + @Override + public boolean isSupported(InferenceConfig config) { + return config instanceof FillMaskConfig; + } + + @Override + public String getResultsField() { + return resultsField; + } + + @Override + public InferenceConfigUpdate.Builder, ? extends InferenceConfigUpdate> newBuilder() { + return new Builder() + .setNumTopClasses(numTopClasses) + .setResultsField(resultsField); + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + FillMaskConfigUpdate that = (FillMaskConfigUpdate) o; + return Objects.equals(numTopClasses, that.numTopClasses) && + Objects.equals(resultsField, that.resultsField); + } + + @Override + public int hashCode() { + return Objects.hash(numTopClasses, resultsField); + } + + public static class Builder + implements InferenceConfigUpdate.Builder { + private Integer numTopClasses; + private String resultsField; + + public FillMaskConfigUpdate.Builder setNumTopClasses(Integer numTopClasses) { + this.numTopClasses = numTopClasses; + return this; + } + + @Override + public FillMaskConfigUpdate.Builder setResultsField(String resultsField) { + this.resultsField = resultsField; + return this; + } + + public FillMaskConfigUpdate build() { + return new FillMaskConfigUpdate(this.numTopClasses, this.resultsField); + } + } +} diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/InferenceConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/InferenceConfig.java index b1f25b00dba7a..045f017c4a308 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/InferenceConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/InferenceConfig.java @@ -24,5 +24,7 @@ default boolean requestingImportance() { return false; } + String getResultsField(); + boolean isAllocateOnly(); } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NerConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NerConfig.java index de91500e9aa52..8d1b0884c095d 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NerConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NerConfig.java @@ -42,7 +42,7 @@ public static NerConfig fromXContentLenient(XContentParser parser) { @SuppressWarnings({ "unchecked"}) private static ConstructingObjectParser createParser(boolean ignoreUnknownFields) { ConstructingObjectParser parser = new ConstructingObjectParser<>(NAME, ignoreUnknownFields, - a -> new NerConfig((VocabularyConfig) a[0], (Tokenization) a[1], (List) a[2])); + a -> new NerConfig((VocabularyConfig) a[0], (Tokenization) a[1], (List) a[2], (String) a[3])); parser.declareObject( ConstructingObjectParser.optionalConstructorArg(), (p, c) -> { @@ -61,26 +61,32 @@ private static ConstructingObjectParser createParser(boolean ig TOKENIZATION ); parser.declareStringArray(ConstructingObjectParser.optionalConstructorArg(), CLASSIFICATION_LABELS); + parser.declareString(ConstructingObjectParser.optionalConstructorArg(), RESULTS_FIELD); + return parser; } private final VocabularyConfig vocabularyConfig; private final Tokenization tokenization; private final List classificationLabels; + private final String resultsField; public NerConfig(@Nullable VocabularyConfig vocabularyConfig, @Nullable Tokenization tokenization, - @Nullable List classificationLabels) { + @Nullable List classificationLabels, + @Nullable String resultsField) { this.vocabularyConfig = Optional.ofNullable(vocabularyConfig) .orElse(new VocabularyConfig(InferenceIndexConstants.nativeDefinitionStore())); this.tokenization = tokenization == null ? Tokenization.createDefault() : tokenization; this.classificationLabels = classificationLabels == null ? Collections.emptyList() : classificationLabels; + this.resultsField = resultsField; } public NerConfig(StreamInput in) throws IOException { vocabularyConfig = new VocabularyConfig(in); tokenization = in.readNamedWriteable(Tokenization.class); classificationLabels = in.readStringList(); + resultsField = in.readOptionalString(); } @Override @@ -88,6 +94,7 @@ public void writeTo(StreamOutput out) throws IOException { vocabularyConfig.writeTo(out); out.writeNamedWriteable(tokenization); out.writeStringCollection(classificationLabels); + out.writeOptionalString(resultsField); } @Override @@ -98,6 +105,9 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws if (classificationLabels.isEmpty() == false) { builder.field(CLASSIFICATION_LABELS.getPreferredName(), classificationLabels); } + if (resultsField != null) { + builder.field(RESULTS_FIELD.getPreferredName(), resultsField); + } builder.endObject(); return builder; } @@ -130,12 +140,13 @@ public boolean equals(Object o) { NerConfig that = (NerConfig) o; return Objects.equals(vocabularyConfig, that.vocabularyConfig) && Objects.equals(tokenization, that.tokenization) - && Objects.equals(classificationLabels, that.classificationLabels); + && Objects.equals(classificationLabels, that.classificationLabels) + && Objects.equals(resultsField, that.resultsField); } @Override public int hashCode() { - return Objects.hash(vocabularyConfig, tokenization, classificationLabels); + return Objects.hash(vocabularyConfig, tokenization, classificationLabels, resultsField); } @Override @@ -152,6 +163,11 @@ public List getClassificationLabels() { return classificationLabels; } + @Override + public String getResultsField() { + return resultsField; + } + @Override public boolean isAllocateOnly() { return true; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NerConfigUpdate.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NerConfigUpdate.java new file mode 100644 index 0000000000000..d2f84046f4c1f --- /dev/null +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NerConfigUpdate.java @@ -0,0 +1,153 @@ +/* + * 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.core.ml.inference.trainedmodel; + +import org.elasticsearch.common.io.stream.StreamInput; +import org.elasticsearch.common.io.stream.StreamOutput; +import org.elasticsearch.common.xcontent.ObjectParser; +import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; +import org.elasticsearch.xpack.core.ml.utils.NamedXContentObject; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +import static org.elasticsearch.xpack.core.ml.inference.trainedmodel.NlpConfig.RESULTS_FIELD; + +public class NerConfigUpdate extends NlpConfigUpdate implements NamedXContentObject { + public static final String NAME = NerConfig.NAME; + + public static NerConfigUpdate fromMap(Map map) { + Map options = new HashMap<>(map); + String resultsField = (String)options.remove(RESULTS_FIELD.getPreferredName()); + + if (options.isEmpty() == false) { + throw ExceptionsHelper.badRequestException("Unrecognized fields {}.", options.keySet()); + } + return new NerConfigUpdate(resultsField); + } + + private static final ObjectParser STRICT_PARSER = createParser(false); + + private static ObjectParser createParser(boolean lenient) { + ObjectParser parser = new ObjectParser<>( + NAME, + lenient, + NerConfigUpdate.Builder::new); + parser.declareString(NerConfigUpdate.Builder::setResultsField, RESULTS_FIELD); + return parser; + } + + public static NerConfigUpdate fromXContentStrict(XContentParser parser) { + return STRICT_PARSER.apply(parser, null).build(); + } + + private final String resultsField; + + public NerConfigUpdate(String resultsField) { + this.resultsField = resultsField; + } + + public NerConfigUpdate(StreamInput in) throws IOException { + this.resultsField = in.readOptionalString(); + } + + @Override + public void writeTo(StreamOutput out) throws IOException { + out.writeOptionalString(resultsField); + } + + @Override + public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { + builder.startObject(); + if (resultsField != null) { + builder.field(RESULTS_FIELD.getPreferredName(), resultsField); + } + builder.endObject(); + return builder; + } + + @Override + public String getWriteableName() { + return NAME; + } + + @Override + public String getName() { + return NAME; + } + + @Override + public InferenceConfig apply(InferenceConfig originalConfig) { + if (resultsField == null || resultsField.equals(originalConfig.getResultsField())) { + return originalConfig; + } + + if (originalConfig instanceof NerConfig == false) { + throw ExceptionsHelper.badRequestException( + "Inference config of type [{}] can not be updated with a inference request of type [{}]", + originalConfig.getName(), + getName()); + } + + NerConfig nerConfig = (NerConfig)originalConfig; + return new NerConfig( + nerConfig.getVocabularyConfig(), + nerConfig.getTokenization(), + nerConfig.getClassificationLabels(), + resultsField); + } + + @Override + public boolean isSupported(InferenceConfig config) { + return config instanceof NerConfig; + } + + @Override + public String getResultsField() { + return resultsField; + } + + @Override + public InferenceConfigUpdate.Builder, ? extends InferenceConfigUpdate> newBuilder() { + return new NerConfigUpdate.Builder() + .setResultsField(resultsField); + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + NerConfigUpdate that = (NerConfigUpdate) o; + return Objects.equals(resultsField, that.resultsField); + } + + @Override + public int hashCode() { + return Objects.hash(resultsField); + } + + public static class Builder + implements InferenceConfigUpdate.Builder { + private String resultsField; + + @Override + public NerConfigUpdate.Builder setResultsField(String resultsField) { + this.resultsField = resultsField; + return this; + } + + public NerConfigUpdate build() { + return new NerConfigUpdate(this.resultsField); + } + } +} + diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NlpConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NlpConfig.java index 5d9ac3df55f4e..a23a27ecf79f8 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NlpConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NlpConfig.java @@ -14,6 +14,9 @@ public interface NlpConfig extends LenientlyParsedInferenceConfig, StrictlyParse ParseField VOCABULARY = new ParseField("vocabulary"); ParseField TOKENIZATION = new ParseField("tokenization"); ParseField CLASSIFICATION_LABELS = new ParseField("classification_labels"); + ParseField RESULTS_FIELD = new ParseField("results_field"); + ParseField NUM_TOP_CLASSES = new ParseField("num_top_classes"); + /** * @return the vocabulary configuration that allows retrieving it diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NlpConfigUpdate.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NlpConfigUpdate.java index 27c4b1bfaf5ee..db3faf53c053b 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NlpConfigUpdate.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NlpConfigUpdate.java @@ -7,12 +7,8 @@ package org.elasticsearch.xpack.core.ml.inference.trainedmodel; -import org.elasticsearch.common.xcontent.ParseField; - public abstract class NlpConfigUpdate implements InferenceConfigUpdate { - static ParseField CLASSIFICATION_LABELS = new ParseField("classification_labels"); - @Override public InferenceConfig toConfig() { throw new UnsupportedOperationException("cannot serialize to nodes before 7.8"); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NullInferenceConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NullInferenceConfig.java index 8efa71cfc7489..0cd54c0ee3ee8 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NullInferenceConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NullInferenceConfig.java @@ -63,4 +63,9 @@ public boolean requestingImportance() { public boolean isAllocateOnly() { return false; } + + @Override + public String getResultsField() { + return null; + } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/PassThroughConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/PassThroughConfig.java index a0d205ca6c675..5ebc54e018276 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/PassThroughConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/PassThroughConfig.java @@ -39,7 +39,7 @@ public static PassThroughConfig fromXContentLenient(XContentParser parser) { private static ConstructingObjectParser createParser(boolean ignoreUnknownFields) { ConstructingObjectParser parser = new ConstructingObjectParser<>(NAME, ignoreUnknownFields, - a -> new PassThroughConfig((VocabularyConfig) a[0], (Tokenization) a[1])); + a -> new PassThroughConfig((VocabularyConfig) a[0], (Tokenization) a[1], (String) a[2])); parser.declareObject( ConstructingObjectParser.optionalConstructorArg(), (p, c) -> { @@ -57,21 +57,28 @@ private static ConstructingObjectParser createParser(bo ConstructingObjectParser.optionalConstructorArg(), (p, c, n) -> p.namedObject(Tokenization.class, n, ignoreUnknownFields), TOKENIZATION ); + parser.declareString(ConstructingObjectParser.optionalConstructorArg(), RESULTS_FIELD); return parser; } private final VocabularyConfig vocabularyConfig; private final Tokenization tokenization; + private final String resultsField; - public PassThroughConfig(@Nullable VocabularyConfig vocabularyConfig, @Nullable Tokenization tokenization) { + public PassThroughConfig(@Nullable VocabularyConfig vocabularyConfig, + @Nullable Tokenization tokenization, + @Nullable String resultsField + ) { this.vocabularyConfig = Optional.ofNullable(vocabularyConfig) .orElse(new VocabularyConfig(InferenceIndexConstants.nativeDefinitionStore())); this.tokenization = tokenization == null ? Tokenization.createDefault() : tokenization; + this.resultsField = resultsField; } public PassThroughConfig(StreamInput in) throws IOException { vocabularyConfig = new VocabularyConfig(in); tokenization = in.readNamedWriteable(Tokenization.class); + resultsField = in.readOptionalString(); } @Override @@ -79,6 +86,9 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws builder.startObject(); builder.field(VOCABULARY.getPreferredName(), vocabularyConfig, params); NamedXContentObjectHelper.writeNamedObject(builder, params, TOKENIZATION.getPreferredName(), tokenization); + if (resultsField != null) { + builder.field(RESULTS_FIELD.getPreferredName(), resultsField); + } builder.endObject(); return builder; } @@ -92,6 +102,7 @@ public String getWriteableName() { public void writeTo(StreamOutput out) throws IOException { vocabularyConfig.writeTo(out); out.writeNamedWriteable(tokenization); + out.writeOptionalString(resultsField); } @Override @@ -121,12 +132,13 @@ public boolean equals(Object o) { PassThroughConfig that = (PassThroughConfig) o; return Objects.equals(vocabularyConfig, that.vocabularyConfig) - && Objects.equals(tokenization, that.tokenization); + && Objects.equals(tokenization, that.tokenization) + && Objects.equals(resultsField, that.resultsField); } @Override public int hashCode() { - return Objects.hash(vocabularyConfig, tokenization); + return Objects.hash(vocabularyConfig, tokenization, resultsField); } @Override @@ -138,4 +150,9 @@ public VocabularyConfig getVocabularyConfig() { public Tokenization getTokenization() { return tokenization; } + + @Override + public String getResultsField() { + return resultsField; + } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/PassThroughConfigUpdate.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/PassThroughConfigUpdate.java new file mode 100644 index 0000000000000..2d259f773b1d1 --- /dev/null +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/PassThroughConfigUpdate.java @@ -0,0 +1,151 @@ +/* + * 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.core.ml.inference.trainedmodel; + +import org.elasticsearch.common.io.stream.StreamInput; +import org.elasticsearch.common.io.stream.StreamOutput; +import org.elasticsearch.common.xcontent.ObjectParser; +import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; +import org.elasticsearch.xpack.core.ml.utils.NamedXContentObject; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +import static org.elasticsearch.xpack.core.ml.inference.trainedmodel.NlpConfig.RESULTS_FIELD; + +public class PassThroughConfigUpdate extends NlpConfigUpdate implements NamedXContentObject { + public static final String NAME = PassThroughConfig.NAME; + + public static PassThroughConfigUpdate fromMap(Map map) { + Map options = new HashMap<>(map); + String resultsField = (String)options.remove(RESULTS_FIELD.getPreferredName()); + + if (options.isEmpty() == false) { + throw ExceptionsHelper.badRequestException("Unrecognized fields {}.", options.keySet()); + } + return new PassThroughConfigUpdate(resultsField); + } + + private static final ObjectParser STRICT_PARSER = createParser(false); + + private static ObjectParser createParser(boolean lenient) { + ObjectParser parser = new ObjectParser<>( + NAME, + lenient, + PassThroughConfigUpdate.Builder::new); + parser.declareString(PassThroughConfigUpdate.Builder::setResultsField, RESULTS_FIELD); + return parser; + } + + public static PassThroughConfigUpdate fromXContentStrict(XContentParser parser) { + return STRICT_PARSER.apply(parser, null).build(); + } + + private final String resultsField; + + public PassThroughConfigUpdate(String resultsField) { + this.resultsField = resultsField; + } + + public PassThroughConfigUpdate(StreamInput in) throws IOException { + this.resultsField = in.readOptionalString(); + } + + @Override + public void writeTo(StreamOutput out) throws IOException { + out.writeOptionalString(resultsField); + } + + @Override + public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { + builder.startObject(); + if (resultsField != null) { + builder.field(RESULTS_FIELD.getPreferredName(), resultsField); + } + builder.endObject(); + return builder; + } + + @Override + public String getWriteableName() { + return NAME; + } + + @Override + public String getName() { + return NAME; + } + + @Override + public InferenceConfig apply(InferenceConfig originalConfig) { + if (resultsField == null || resultsField.equals(originalConfig.getResultsField())) { + return originalConfig; + } + + if (originalConfig instanceof PassThroughConfig == false) { + throw ExceptionsHelper.badRequestException( + "Inference config of type [{}] can not be updated with a inference request of type [{}]", + originalConfig.getName(), + getName()); + } + + PassThroughConfig passThroughConfig = (PassThroughConfig)originalConfig; + return new PassThroughConfig( + passThroughConfig.getVocabularyConfig(), + passThroughConfig.getTokenization(), + resultsField); + } + + @Override + public boolean isSupported(InferenceConfig config) { + return config instanceof PassThroughConfig; + } + + @Override + public String getResultsField() { + return resultsField; + } + + @Override + public InferenceConfigUpdate.Builder, ? extends InferenceConfigUpdate> newBuilder() { + return new PassThroughConfigUpdate.Builder() + .setResultsField(resultsField); + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + PassThroughConfigUpdate that = (PassThroughConfigUpdate) o; + return Objects.equals(resultsField, that.resultsField); + } + + @Override + public int hashCode() { + return Objects.hash(resultsField); + } + + public static class Builder + implements InferenceConfigUpdate.Builder { + private String resultsField; + + @Override + public PassThroughConfigUpdate.Builder setResultsField(String resultsField) { + this.resultsField = resultsField; + return this; + } + + public PassThroughConfigUpdate build() { + return new PassThroughConfigUpdate(this.resultsField); + } + } +} diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/RegressionConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/RegressionConfig.java index d0e656d7edfc2..46aac4702ada2 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/RegressionConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/RegressionConfig.java @@ -73,6 +73,7 @@ public int getNumTopFeatureImportanceValues() { return numTopFeatureImportanceValues; } + @Override public String getResultsField() { return resultsField; } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextClassificationConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextClassificationConfig.java index 11763212d00cc..8ac1208914ffc 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextClassificationConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextClassificationConfig.java @@ -10,8 +10,7 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.common.xcontent.ObjectParser; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.core.Nullable; @@ -20,7 +19,6 @@ import org.elasticsearch.xpack.core.ml.utils.NamedXContentObjectHelper; import java.io.IOException; -import java.util.Collections; import java.util.List; import java.util.Objects; import java.util.Optional; @@ -28,25 +26,24 @@ public class TextClassificationConfig implements NlpConfig { public static final String NAME = "text_classification"; - public static final ParseField NUM_TOP_CLASSES = new ParseField("num_top_classes"); public static TextClassificationConfig fromXContentStrict(XContentParser parser) { - return STRICT_PARSER.apply(parser, null); + return STRICT_PARSER.apply(parser, null).build(); } public static TextClassificationConfig fromXContentLenient(XContentParser parser) { - return LENIENT_PARSER.apply(parser, null); + return LENIENT_PARSER.apply(parser, null).build(); } - private static final ConstructingObjectParser STRICT_PARSER = createParser(false); - private static final ConstructingObjectParser LENIENT_PARSER = createParser(true); + private static final ObjectParser STRICT_PARSER = createParser(false); + private static final ObjectParser LENIENT_PARSER = createParser(true); + + private static ObjectParser createParser(boolean ignoreUnknownFields) { + ObjectParser parser = + new ObjectParser<>(NAME, ignoreUnknownFields, Builder::new); - @SuppressWarnings({ "unchecked"}) - private static ConstructingObjectParser createParser(boolean ignoreUnknownFields) { - ConstructingObjectParser parser = new ConstructingObjectParser<>(NAME, ignoreUnknownFields, - a -> new TextClassificationConfig((VocabularyConfig) a[0], (Tokenization) a[1], (List) a[2], (Integer) a[3])); parser.declareObject( - ConstructingObjectParser.optionalConstructorArg(), + Builder::setVocabularyConfig, (p, c) -> { if (ignoreUnknownFields == false) { throw ExceptionsHelper.badRequestException( @@ -59,11 +56,12 @@ private static ConstructingObjectParser createPa VOCABULARY ); parser.declareNamedObject( - ConstructingObjectParser.optionalConstructorArg(), (p, c, n) -> p.namedObject(Tokenization.class, n, ignoreUnknownFields), + Builder::setTokenization, (p, c, n) -> p.namedObject(Tokenization.class, n, ignoreUnknownFields), TOKENIZATION ); - parser.declareStringArray(ConstructingObjectParser.optionalConstructorArg(), CLASSIFICATION_LABELS); - parser.declareInt(ConstructingObjectParser.optionalConstructorArg(), NUM_TOP_CLASSES); + parser.declareStringArray(Builder::setClassificationLabels, CLASSIFICATION_LABELS); + parser.declareInt(Builder::setNumTopClasses, NUM_TOP_CLASSES); + parser.declareString(Builder::setResultsField, RESULTS_FIELD); return parser; } @@ -71,16 +69,32 @@ private static ConstructingObjectParser createPa private final Tokenization tokenization; private final List classificationLabels; private final int numTopClasses; + private final String resultsField; public TextClassificationConfig(@Nullable VocabularyConfig vocabularyConfig, @Nullable Tokenization tokenization, - @Nullable List classificationLabels, - @Nullable Integer numTopClasses) { + List classificationLabels, + @Nullable Integer numTopClasses, + @Nullable String resultsField) { this.vocabularyConfig = Optional.ofNullable(vocabularyConfig) .orElse(new VocabularyConfig(InferenceIndexConstants.nativeDefinitionStore())); this.tokenization = tokenization == null ? Tokenization.createDefault() : tokenization; - this.classificationLabels = classificationLabels == null ? Collections.emptyList() : classificationLabels; + if (classificationLabels == null || classificationLabels.size() < 2) { + throw ExceptionsHelper.badRequestException("[{}] requires at least 2 [{}]; provided {}", + NAME, CLASSIFICATION_LABELS, classificationLabels); + } + this.classificationLabels = classificationLabels; this.numTopClasses = Optional.ofNullable(numTopClasses).orElse(-1); + if (this.numTopClasses == 0) { + throw ExceptionsHelper.badRequestException( + "[{}] requires at least 1 [{}]; provided [{}]", + NAME, + TextClassificationConfig.NUM_TOP_CLASSES, + numTopClasses + ); + } + this.resultsField = resultsField; + } public TextClassificationConfig(StreamInput in) throws IOException { @@ -88,6 +102,7 @@ public TextClassificationConfig(StreamInput in) throws IOException { tokenization = in.readNamedWriteable(Tokenization.class); classificationLabels = in.readStringList(); numTopClasses = in.readInt(); + resultsField = in.readOptionalString(); } @Override @@ -96,6 +111,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeNamedWriteable(tokenization); out.writeStringCollection(classificationLabels); out.writeInt(numTopClasses); + out.writeOptionalString(resultsField); } @Override @@ -103,10 +119,11 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws builder.startObject(); builder.field(VOCABULARY.getPreferredName(), vocabularyConfig, params); NamedXContentObjectHelper.writeNamedObject(builder, params, TOKENIZATION.getPreferredName(), tokenization); - if (classificationLabels.isEmpty() == false) { - builder.field(CLASSIFICATION_LABELS.getPreferredName(), classificationLabels); - } + builder.field(CLASSIFICATION_LABELS.getPreferredName(), classificationLabels); builder.field(NUM_TOP_CLASSES.getPreferredName(), numTopClasses); + if (resultsField != null) { + builder.field(RESULTS_FIELD.getPreferredName(), resultsField); + } builder.endObject(); return builder; } @@ -140,12 +157,13 @@ public boolean equals(Object o) { return Objects.equals(vocabularyConfig, that.vocabularyConfig) && Objects.equals(tokenization, that.tokenization) && Objects.equals(numTopClasses, that.numTopClasses) - && Objects.equals(classificationLabels, that.classificationLabels); + && Objects.equals(classificationLabels, that.classificationLabels) + && Objects.equals(resultsField, that.resultsField); } @Override public int hashCode() { - return Objects.hash(vocabularyConfig, tokenization, classificationLabels, numTopClasses); + return Objects.hash(vocabularyConfig, tokenization, classificationLabels, numTopClasses, resultsField); } @Override @@ -166,8 +184,63 @@ public int getNumTopClasses() { return numTopClasses; } + public String getResultsField() { + return resultsField; + } + @Override public boolean isAllocateOnly() { return true; } + + public static class Builder { + private VocabularyConfig vocabularyConfig; + private Tokenization tokenization; + private List classificationLabels; + private int numTopClasses; + private String resultsField; + + Builder() {} + + Builder(TextClassificationConfig config) { + this.vocabularyConfig = config.vocabularyConfig; + this.tokenization = config.tokenization; + this.classificationLabels = config.classificationLabels; + this.numTopClasses = config.numTopClasses; + this.resultsField = config.resultsField; + } + + public Builder setVocabularyConfig(VocabularyConfig vocabularyConfig) { + this.vocabularyConfig = vocabularyConfig; + return this; + } + + public Builder setTokenization(Tokenization tokenization) { + this.tokenization = tokenization; + return this; + } + + public Builder setClassificationLabels(List classificationLabels) { + this.classificationLabels = classificationLabels; + return this; + } + + public Builder setNumTopClasses(Integer numTopClasses) { + this.numTopClasses = numTopClasses; + return this; + } + + public Builder setResultsField(String resultsField) { + this.resultsField = resultsField; + return this; + } + + public TextClassificationConfig build() { + return new TextClassificationConfig(vocabularyConfig, + tokenization, + classificationLabels, + numTopClasses, + resultsField); + } + } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextClassificationConfigUpdate.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextClassificationConfigUpdate.java new file mode 100644 index 0000000000000..fcb85d4e9f968 --- /dev/null +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextClassificationConfigUpdate.java @@ -0,0 +1,211 @@ +/* + * 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.core.ml.inference.trainedmodel; + +import org.elasticsearch.common.io.stream.StreamInput; +import org.elasticsearch.common.io.stream.StreamOutput; +import org.elasticsearch.common.xcontent.ObjectParser; +import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; +import org.elasticsearch.xpack.core.ml.utils.NamedXContentObject; + +import java.io.IOException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +import static org.elasticsearch.xpack.core.ml.inference.trainedmodel.TextClassificationConfig.CLASSIFICATION_LABELS; +import static org.elasticsearch.xpack.core.ml.inference.trainedmodel.TextClassificationConfig.NUM_TOP_CLASSES; +import static org.elasticsearch.xpack.core.ml.inference.trainedmodel.TextClassificationConfig.RESULTS_FIELD; + +public class TextClassificationConfigUpdate extends NlpConfigUpdate implements NamedXContentObject { + + public static final String NAME = TextClassificationConfig.NAME; + + @SuppressWarnings("unchecked") + public static TextClassificationConfigUpdate fromMap(Map map) { + Map options = new HashMap<>(map); + Integer numTopClasses = (Integer)options.remove(NUM_TOP_CLASSES.getPreferredName()); + String resultsField = (String)options.remove(RESULTS_FIELD.getPreferredName()); + List classificationLabels = (List)options.remove(CLASSIFICATION_LABELS.getPreferredName()); + + if (options.isEmpty() == false) { + throw ExceptionsHelper.badRequestException("Unrecognized fields {}.", options.keySet()); + } + return new TextClassificationConfigUpdate(classificationLabels, numTopClasses, resultsField); + } + + private static final ObjectParser STRICT_PARSER = createParser(false); + + private static ObjectParser createParser(boolean lenient) { + ObjectParser parser = new ObjectParser<>( + NAME, + lenient, + TextClassificationConfigUpdate.Builder::new); + parser.declareStringArray(Builder::setClassificationLabels, CLASSIFICATION_LABELS); + parser.declareString(Builder::setResultsField, RESULTS_FIELD); + parser.declareInt(Builder::setNumTopClasses, NUM_TOP_CLASSES); + return parser; + } + + public static TextClassificationConfigUpdate fromXContentStrict(XContentParser parser) { + return STRICT_PARSER.apply(parser, null).build(); + } + + private final List classificationLabels; + private final Integer numTopClasses; + private final String resultsField; + + public TextClassificationConfigUpdate(List classificationLabels, Integer numTopClasses, String resultsField) { + this.classificationLabels = classificationLabels; + this.numTopClasses = numTopClasses; + this.resultsField = resultsField; + } + + public TextClassificationConfigUpdate(StreamInput in) throws IOException { + classificationLabels = in.readOptionalStringList(); + numTopClasses = in.readOptionalVInt(); + resultsField = in.readOptionalString(); + } + + @Override + public String getWriteableName() { + return NAME; + } + + @Override + public String getName() { + return NAME; + } + + @Override + public void writeTo(StreamOutput out) throws IOException { + out.writeOptionalStringCollection(classificationLabels); + out.writeOptionalVInt(numTopClasses); + out.writeOptionalString(resultsField); + } + + @Override + public InferenceConfig apply(InferenceConfig originalConfig) { + if (originalConfig instanceof TextClassificationConfig == false) { + throw ExceptionsHelper.badRequestException( + "Inference config of type [{}] can not be updated with a request of type [{}]", + originalConfig.getName(), + getName()); + } + + TextClassificationConfig classificationConfig = (TextClassificationConfig)originalConfig; + if (isNoop(classificationConfig)) { + return originalConfig; + } + + TextClassificationConfig.Builder builder = new TextClassificationConfig.Builder(classificationConfig); + if (numTopClasses != null) { + builder.setNumTopClasses(numTopClasses); + } + if (classificationLabels != null) { + if (classificationLabels.size() != classificationConfig.getClassificationLabels().size()) { + throw ExceptionsHelper.badRequestException( + "The number of [{}] the model is defined with [{}] does not match the number in the update [{}]", + CLASSIFICATION_LABELS, + classificationConfig.getClassificationLabels().size(), + classificationLabels.size() + ); + } + builder.setClassificationLabels(classificationLabels); + } + if (resultsField != null) { + builder.setResultsField(resultsField); + } + return builder.build(); + } + + boolean isNoop(TextClassificationConfig originalConfig) { + return (this.numTopClasses == null || this.numTopClasses == originalConfig.getNumTopClasses()) && + (this.classificationLabels == null) && + (this.resultsField == null || this.resultsField.equals(originalConfig.getResultsField())); + } + + @Override + public boolean isSupported(InferenceConfig config) { + return config instanceof TextClassificationConfig; + } + + @Override + public String getResultsField() { + return resultsField; + } + + @Override + public InferenceConfigUpdate.Builder, ? extends InferenceConfigUpdate> newBuilder() { + return new Builder() + .setClassificationLabels(classificationLabels) + .setNumTopClasses(numTopClasses) + .setResultsField(resultsField); + } + + @Override + public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { + builder.startObject(); + if (numTopClasses != null) { + builder.field(NUM_TOP_CLASSES.getPreferredName(), numTopClasses); + } + if (classificationLabels != null) { + builder.field(CLASSIFICATION_LABELS.getPreferredName(), classificationLabels); + } + if (resultsField != null) { + builder.field(RESULTS_FIELD.getPreferredName(), resultsField); + } + builder.endObject(); + return builder; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + TextClassificationConfigUpdate that = (TextClassificationConfigUpdate) o; + return Objects.equals(classificationLabels, that.classificationLabels) && + Objects.equals(numTopClasses, that.numTopClasses) && + Objects.equals(resultsField, that.resultsField); + } + + @Override + public int hashCode() { + return Objects.hash(classificationLabels, numTopClasses, resultsField); + } + + public static class Builder + implements InferenceConfigUpdate.Builder { + private List classificationLabels; + private Integer numTopClasses; + private String resultsField; + + public TextClassificationConfigUpdate.Builder setNumTopClasses(Integer numTopClasses) { + this.numTopClasses = numTopClasses; + return this; + } + + public TextClassificationConfigUpdate.Builder setClassificationLabels(List classificationLabels) { + this.classificationLabels = classificationLabels; + return this; + } + + @Override + public TextClassificationConfigUpdate.Builder setResultsField(String resultsField) { + this.resultsField = resultsField; + return this; + } + + public TextClassificationConfigUpdate build() { + return new TextClassificationConfigUpdate(this.classificationLabels, this.numTopClasses, this.resultsField); + } + } +} diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextEmbeddingConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextEmbeddingConfig.java index fb9b449563875..2939c8bd2e7f2 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextEmbeddingConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextEmbeddingConfig.java @@ -39,7 +39,7 @@ public static TextEmbeddingConfig fromXContentLenient(XContentParser parser) { private static ConstructingObjectParser createParser(boolean ignoreUnknownFields) { ConstructingObjectParser parser = new ConstructingObjectParser<>(NAME, ignoreUnknownFields, - a -> new TextEmbeddingConfig((VocabularyConfig) a[0], (Tokenization) a[1])); + a -> new TextEmbeddingConfig((VocabularyConfig) a[0], (Tokenization) a[1], (String) a[2])); parser.declareObject( ConstructingObjectParser.optionalConstructorArg(), (p, c) -> { @@ -57,21 +57,27 @@ private static ConstructingObjectParser createParser( ConstructingObjectParser.optionalConstructorArg(), (p, c, n) -> p.namedObject(Tokenization.class, n, ignoreUnknownFields), TOKENIZATION ); + parser.declareString(ConstructingObjectParser.optionalConstructorArg(), RESULTS_FIELD); return parser; } private final VocabularyConfig vocabularyConfig; private final Tokenization tokenization; + private final String resultsField; - public TextEmbeddingConfig(@Nullable VocabularyConfig vocabularyConfig, @Nullable Tokenization tokenization) { + public TextEmbeddingConfig(@Nullable VocabularyConfig vocabularyConfig, + @Nullable Tokenization tokenization, + @Nullable String resultsField) { this.vocabularyConfig = Optional.ofNullable(vocabularyConfig) .orElse(new VocabularyConfig(InferenceIndexConstants.nativeDefinitionStore())); this.tokenization = tokenization == null ? Tokenization.createDefault() : tokenization; + this.resultsField = resultsField; } public TextEmbeddingConfig(StreamInput in) throws IOException { vocabularyConfig = new VocabularyConfig(in); tokenization = in.readNamedWriteable(Tokenization.class); + resultsField = in.readOptionalString(); } @Override @@ -79,6 +85,9 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws builder.startObject(); builder.field(VOCABULARY.getPreferredName(), vocabularyConfig, params); NamedXContentObjectHelper.writeNamedObject(builder, params, TOKENIZATION.getPreferredName(), tokenization); + if (resultsField != null) { + builder.field(RESULTS_FIELD.getPreferredName(), resultsField); + } builder.endObject(); return builder; } @@ -92,6 +101,7 @@ public String getWriteableName() { public void writeTo(StreamOutput out) throws IOException { vocabularyConfig.writeTo(out); out.writeNamedWriteable(tokenization); + out.writeOptionalString(resultsField); } @Override @@ -121,12 +131,13 @@ public boolean equals(Object o) { TextEmbeddingConfig that = (TextEmbeddingConfig) o; return Objects.equals(vocabularyConfig, that.vocabularyConfig) - && Objects.equals(tokenization, that.tokenization); + && Objects.equals(tokenization, that.tokenization) + && Objects.equals(resultsField, that.resultsField); } @Override public int hashCode() { - return Objects.hash(vocabularyConfig, tokenization); + return Objects.hash(vocabularyConfig, tokenization, resultsField); } @Override @@ -138,4 +149,9 @@ public VocabularyConfig getVocabularyConfig() { public Tokenization getTokenization() { return tokenization; } + + @Override + public String getResultsField() { + return resultsField; + } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextEmbeddingConfigUpdate.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextEmbeddingConfigUpdate.java new file mode 100644 index 0000000000000..9bb196daaef6f --- /dev/null +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextEmbeddingConfigUpdate.java @@ -0,0 +1,152 @@ +/* + * 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.core.ml.inference.trainedmodel; + +import org.elasticsearch.common.io.stream.StreamInput; +import org.elasticsearch.common.io.stream.StreamOutput; +import org.elasticsearch.common.xcontent.ObjectParser; +import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; +import org.elasticsearch.xpack.core.ml.utils.NamedXContentObject; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +import static org.elasticsearch.xpack.core.ml.inference.trainedmodel.NlpConfig.RESULTS_FIELD; + +public class TextEmbeddingConfigUpdate extends NlpConfigUpdate implements NamedXContentObject { + + public static final String NAME = TextEmbeddingConfig.NAME; + + public static TextEmbeddingConfigUpdate fromMap(Map map) { + Map options = new HashMap<>(map); + String resultsField = (String)options.remove(RESULTS_FIELD.getPreferredName()); + + if (options.isEmpty() == false) { + throw ExceptionsHelper.badRequestException("Unrecognized fields {}.", options.keySet()); + } + return new TextEmbeddingConfigUpdate(resultsField); + } + + private static final ObjectParser STRICT_PARSER = createParser(false); + + private static ObjectParser createParser(boolean lenient) { + ObjectParser parser = new ObjectParser<>( + NAME, + lenient, + TextEmbeddingConfigUpdate.Builder::new); + parser.declareString(TextEmbeddingConfigUpdate.Builder::setResultsField, RESULTS_FIELD); + return parser; + } + + public static TextEmbeddingConfigUpdate fromXContentStrict(XContentParser parser) { + return STRICT_PARSER.apply(parser, null).build(); + } + + private final String resultsField; + + public TextEmbeddingConfigUpdate(String resultsField) { + this.resultsField = resultsField; + } + + public TextEmbeddingConfigUpdate(StreamInput in) throws IOException { + this.resultsField = in.readOptionalString(); + } + + @Override + public void writeTo(StreamOutput out) throws IOException { + out.writeOptionalString(resultsField); + } + + @Override + public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { + builder.startObject(); + if (resultsField != null) { + builder.field(RESULTS_FIELD.getPreferredName(), resultsField); + } + builder.endObject(); + return builder; + } + + @Override + public String getWriteableName() { + return NAME; + } + + @Override + public String getName() { + return NAME; + } + + @Override + public InferenceConfig apply(InferenceConfig originalConfig) { + if (resultsField == null || resultsField.equals(originalConfig.getResultsField())) { + return originalConfig; + } + + if (originalConfig instanceof TextEmbeddingConfig == false) { + throw ExceptionsHelper.badRequestException( + "Inference config of type [{}] can not be updated with a inference request of type [{}]", + originalConfig.getName(), + getName()); + } + + TextEmbeddingConfig embeddingConfig = (TextEmbeddingConfig)originalConfig; + return new TextEmbeddingConfig( + embeddingConfig.getVocabularyConfig(), + embeddingConfig.getTokenization(), + resultsField); + } + + @Override + public boolean isSupported(InferenceConfig config) { + return config instanceof TextEmbeddingConfig; + } + + @Override + public String getResultsField() { + return resultsField; + } + + @Override + public InferenceConfigUpdate.Builder, ? extends InferenceConfigUpdate> newBuilder() { + return new Builder() + .setResultsField(resultsField); + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + TextEmbeddingConfigUpdate that = (TextEmbeddingConfigUpdate) o; + return Objects.equals(resultsField, that.resultsField); + } + + @Override + public int hashCode() { + return Objects.hash(resultsField); + } + + public static class Builder + implements InferenceConfigUpdate.Builder { + private String resultsField; + + @Override + public Builder setResultsField(String resultsField) { + this.resultsField = resultsField; + return this; + } + + public TextEmbeddingConfigUpdate build() { + return new TextEmbeddingConfigUpdate(this.resultsField); + } + } +} diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ZeroShotClassificationConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ZeroShotClassificationConfig.java index 16cbdad586f76..1e9f34245e821 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ZeroShotClassificationConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ZeroShotClassificationConfig.java @@ -65,7 +65,8 @@ private static ConstructingObjectParser crea (Tokenization) a[2], (String) a[3], (Boolean) a[4], - (List) a[5] + (List) a[5], + (String) a[6] ) ); parser.declareStringArray(ConstructingObjectParser.constructorArg(), CLASSIFICATION_LABELS); @@ -89,6 +90,7 @@ private static ConstructingObjectParser crea parser.declareString(ConstructingObjectParser.optionalConstructorArg(), HYPOTHESIS_TEMPLATE); parser.declareBoolean(ConstructingObjectParser.optionalConstructorArg(), MULTI_LABEL); parser.declareStringArray(ConstructingObjectParser.optionalConstructorArg(), LABELS); + parser.declareString(ConstructingObjectParser.optionalConstructorArg(), RESULTS_FIELD); return parser; } @@ -98,6 +100,7 @@ private static ConstructingObjectParser crea private final List labels; private final boolean isMultiLabel; private final String hypothesisTemplate; + private final String resultsField; public ZeroShotClassificationConfig( List classificationLabels, @@ -105,7 +108,8 @@ public ZeroShotClassificationConfig( @Nullable Tokenization tokenization, @Nullable String hypothesisTemplate, @Nullable Boolean isMultiLabel, - @Nullable List labels + @Nullable List labels, + @Nullable String resultsField ) { this.classificationLabels = ExceptionsHelper.requireNonNull(classificationLabels, CLASSIFICATION_LABELS); if (this.classificationLabels.size() != 3) { @@ -136,6 +140,7 @@ public ZeroShotClassificationConfig( if (labels != null && labels.isEmpty()) { throw ExceptionsHelper.badRequestException("[{}] must not be empty", LABELS.getPreferredName()); } + this.resultsField = resultsField; } public ZeroShotClassificationConfig(StreamInput in) throws IOException { @@ -145,6 +150,7 @@ public ZeroShotClassificationConfig(StreamInput in) throws IOException { isMultiLabel = in.readBoolean(); hypothesisTemplate = in.readString(); labels = in.readOptionalStringList(); + resultsField = in.readOptionalString(); } @Override @@ -155,6 +161,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeBoolean(isMultiLabel); out.writeString(hypothesisTemplate); out.writeOptionalStringCollection(labels); + out.writeOptionalString(resultsField); } @Override @@ -168,6 +175,9 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws if (labels != null) { builder.field(LABELS.getPreferredName(), labels); } + if (resultsField != null) { + builder.field(RESULTS_FIELD.getPreferredName(), resultsField); + } builder.endObject(); return builder; } @@ -203,12 +213,13 @@ public boolean equals(Object o) { && Objects.equals(isMultiLabel, that.isMultiLabel) && Objects.equals(hypothesisTemplate, that.hypothesisTemplate) && Objects.equals(labels, that.labels) - && Objects.equals(classificationLabels, that.classificationLabels); + && Objects.equals(classificationLabels, that.classificationLabels) + && Objects.equals(resultsField, that.resultsField); } @Override public int hashCode() { - return Objects.hash(vocabularyConfig, tokenization, classificationLabels, hypothesisTemplate, isMultiLabel, labels); + return Objects.hash(vocabularyConfig, tokenization, classificationLabels, hypothesisTemplate, isMultiLabel, labels, resultsField); } @Override @@ -237,6 +248,11 @@ public List getLabels() { return Optional.ofNullable(labels).orElse(List.of()); } + @Override + public String getResultsField() { + return resultsField; + } + @Override public boolean isAllocateOnly() { return true; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ZeroShotClassificationConfigUpdate.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ZeroShotClassificationConfigUpdate.java index dea06726fe1ca..b9af0403ce6c0 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ZeroShotClassificationConfigUpdate.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ZeroShotClassificationConfigUpdate.java @@ -23,6 +23,7 @@ import java.util.Objects; import java.util.Optional; +import static org.elasticsearch.xpack.core.ml.inference.trainedmodel.NlpConfig.RESULTS_FIELD; import static org.elasticsearch.xpack.core.ml.inference.trainedmodel.ZeroShotClassificationConfig.LABELS; import static org.elasticsearch.xpack.core.ml.inference.trainedmodel.ZeroShotClassificationConfig.MULTI_LABEL; @@ -39,46 +40,53 @@ public static ZeroShotClassificationConfigUpdate fromMap(Map map Map options = new HashMap<>(map); Boolean isMultiLabel = (Boolean)options.remove(MULTI_LABEL.getPreferredName()); List labels = (List)options.remove(LABELS.getPreferredName()); + String resultsField = (String)options.remove(RESULTS_FIELD.getPreferredName()); if (options.isEmpty() == false) { throw ExceptionsHelper.badRequestException("Unrecognized fields {}.", map.keySet()); } - return new ZeroShotClassificationConfigUpdate(labels, isMultiLabel); + return new ZeroShotClassificationConfigUpdate(labels, isMultiLabel, resultsField); } @SuppressWarnings({ "unchecked"}) private static final ConstructingObjectParser STRICT_PARSER = new ConstructingObjectParser<>( NAME, - a -> new ZeroShotClassificationConfigUpdate((List)a[0], (Boolean) a[1]) + a -> new ZeroShotClassificationConfigUpdate((List)a[0], (Boolean) a[1], (String) a[2]) ); static { STRICT_PARSER.declareStringArray(ConstructingObjectParser.optionalConstructorArg(), LABELS); STRICT_PARSER.declareBoolean(ConstructingObjectParser.optionalConstructorArg(), MULTI_LABEL); + STRICT_PARSER.declareString(ConstructingObjectParser.optionalConstructorArg(), RESULTS_FIELD); } private final List labels; private final Boolean isMultiLabel; + private final String resultsField; public ZeroShotClassificationConfigUpdate( @Nullable List labels, - @Nullable Boolean isMultiLabel + @Nullable Boolean isMultiLabel, + @Nullable String resultsField ) { this.labels = labels; if (labels != null && labels.isEmpty()) { throw ExceptionsHelper.badRequestException("[{}] must not be empty", LABELS.getPreferredName()); } this.isMultiLabel = isMultiLabel; + this.resultsField = resultsField; } public ZeroShotClassificationConfigUpdate(StreamInput in) throws IOException { labels = in.readOptionalStringList(); isMultiLabel = in.readOptionalBoolean(); + resultsField = in.readOptionalString(); } @Override public void writeTo(StreamOutput out) throws IOException { out.writeOptionalStringCollection(labels); out.writeOptionalBoolean(isMultiLabel); + out.writeOptionalString(resultsField); } @Override @@ -90,6 +98,9 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws if (isMultiLabel != null) { builder.field(MULTI_LABEL.getPreferredName(), isMultiLabel); } + if (resultsField != null) { + builder.field(RESULTS_FIELD.getPreferredName(), resultsField); + } builder.endObject(); return builder; } @@ -125,13 +136,15 @@ public InferenceConfig apply(InferenceConfig originalConfig) { zeroShotConfig.getTokenization(), zeroShotConfig.getHypothesisTemplate(), Optional.ofNullable(isMultiLabel).orElse(zeroShotConfig.isMultiLabel()), - Optional.ofNullable(labels).orElse(zeroShotConfig.getLabels()) + Optional.ofNullable(labels).orElse(zeroShotConfig.getLabels()), + Optional.ofNullable(resultsField).orElse(zeroShotConfig.getResultsField()) ); } boolean isNoop(ZeroShotClassificationConfig originalConfig) { return (labels == null || labels.equals(originalConfig.getClassificationLabels())) - && (isMultiLabel == null || isMultiLabel.equals(originalConfig.isMultiLabel())); + && (isMultiLabel == null || isMultiLabel.equals(originalConfig.isMultiLabel())) + && (resultsField == null || resultsField.equals(originalConfig.getResultsField())); } @Override @@ -141,7 +154,7 @@ public boolean isSupported(InferenceConfig config) { @Override public String getResultsField() { - return null; + return resultsField; } @Override @@ -160,12 +173,14 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) return false; ZeroShotClassificationConfigUpdate that = (ZeroShotClassificationConfigUpdate) o; - return Objects.equals(isMultiLabel, that.isMultiLabel) && Objects.equals(labels, that.labels); + return Objects.equals(isMultiLabel, that.isMultiLabel) && + Objects.equals(labels, that.labels) && + Objects.equals(resultsField, that.resultsField); } @Override public int hashCode() { - return Objects.hash(labels, isMultiLabel); + return Objects.hash(labels, isMultiLabel, resultsField); } public List getLabels() { @@ -178,10 +193,12 @@ public static class Builder implements InferenceConfigUpdate.Builder< > { private List labels; private Boolean isMultiLabel; + private String resultsField; @Override public ZeroShotClassificationConfigUpdate.Builder setResultsField(String resultsField) { - throw new IllegalArgumentException(); + this.resultsField = resultsField; + return this; } public Builder setLabels(List labels) { @@ -195,7 +212,7 @@ public Builder setMultiLabel(Boolean multiLabel) { } public ZeroShotClassificationConfigUpdate build() { - return new ZeroShotClassificationConfigUpdate(labels, isMultiLabel); + return new ZeroShotClassificationConfigUpdate(labels, isMultiLabel, resultsField); } } } diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/FillMaskConfigTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/FillMaskConfigTests.java index 0fdb9f5c2ca6b..f0f42583c84d1 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/FillMaskConfigTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/FillMaskConfigTests.java @@ -50,7 +50,9 @@ protected FillMaskConfig mutateInstanceForVersion(FillMaskConfig instance, Versi public static FillMaskConfig createRandom() { return new FillMaskConfig( randomBoolean() ? null : VocabularyConfigTests.createRandom(), - randomBoolean() ? null : BertTokenizationTests.createRandom() + randomBoolean() ? null : BertTokenizationTests.createRandom(), + randomBoolean() ? null : randomInt(), + randomBoolean() ? null : randomAlphaOfLength(5) ); } } diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/FillMaskConfigUpdateTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/FillMaskConfigUpdateTests.java new file mode 100644 index 0000000000000..9c76d91e36ec8 --- /dev/null +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/FillMaskConfigUpdateTests.java @@ -0,0 +1,103 @@ +/* + * 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.core.ml.inference.trainedmodel; + +import org.elasticsearch.ElasticsearchException; +import org.elasticsearch.Version; +import org.elasticsearch.common.io.stream.Writeable; +import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xpack.core.ml.AbstractBWCSerializationTestCase; + +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; + +import static org.hamcrest.Matchers.equalTo; + +public class FillMaskConfigUpdateTests extends AbstractBWCSerializationTestCase { + + public void testFromMap() { + FillMaskConfigUpdate expected = new FillMaskConfigUpdate(3, "ml-results"); + Map config = new HashMap<>(){{ + put(NlpConfig.RESULTS_FIELD.getPreferredName(), "ml-results"); + put(NlpConfig.NUM_TOP_CLASSES.getPreferredName(), 3); + }}; + assertThat(FillMaskConfigUpdate.fromMap(config), equalTo(expected)); + } + + public void testFromMapWithUnknownField() { + ElasticsearchException ex = expectThrows(ElasticsearchException.class, + () -> FillMaskConfigUpdate.fromMap(Collections.singletonMap("some_key", 1))); + assertThat(ex.getMessage(), equalTo("Unrecognized fields [some_key].")); + } + + public void testIsNoop() { + assertTrue(new FillMaskConfigUpdate.Builder().build().isNoop(FillMaskConfigTests.createRandom())); + + assertFalse(new FillMaskConfigUpdate.Builder() + .setResultsField("foo") + .build() + .isNoop(new FillMaskConfig.Builder().setResultsField("bar").build())); + + assertTrue(new FillMaskConfigUpdate.Builder() + .setNumTopClasses(3) + .build() + .isNoop(new FillMaskConfig.Builder().setNumTopClasses(3).build())); + } + + public void testApply() { + FillMaskConfig originalConfig = FillMaskConfigTests.createRandom(); + + assertThat(originalConfig, equalTo(new FillMaskConfigUpdate.Builder().build().apply(originalConfig))); + + assertThat(new FillMaskConfig.Builder(originalConfig) + .setResultsField("ml-results") + .build(), + equalTo(new FillMaskConfigUpdate.Builder() + .setResultsField("ml-results") + .build() + .apply(originalConfig) + )); + assertThat(new FillMaskConfig.Builder(originalConfig) + .setNumTopClasses(originalConfig.getNumTopClasses() +1) + .build(), + equalTo(new FillMaskConfigUpdate.Builder() + .setNumTopClasses(originalConfig.getNumTopClasses() +1) + .build() + .apply(originalConfig) + )); + } + + @Override + protected FillMaskConfigUpdate doParseInstance(XContentParser parser) throws IOException { + return FillMaskConfigUpdate.fromXContentStrict(parser); + } + + @Override + protected Writeable.Reader instanceReader() { + return FillMaskConfigUpdate::new; + } + + @Override + protected FillMaskConfigUpdate createTestInstance() { + FillMaskConfigUpdate.Builder builder = new FillMaskConfigUpdate.Builder(); + if (randomBoolean()) { + builder.setNumTopClasses(randomIntBetween(1, 4)); + } + if (randomBoolean()) { + builder.setResultsField(randomAlphaOfLength(8)); + } + return builder.build(); + } + + @Override + protected FillMaskConfigUpdate mutateInstanceForVersion(FillMaskConfigUpdate instance, Version version) { + return instance; + } +} diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NerConfigTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NerConfigTests.java index 9f696251d4953..292b2fd1b8fc7 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NerConfigTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NerConfigTests.java @@ -51,7 +51,8 @@ public static NerConfig createRandom() { return new NerConfig( randomBoolean() ? null : VocabularyConfigTests.createRandom(), randomBoolean() ? null : BertTokenizationTests.createRandom(), - randomBoolean() ? null : randomList(5, () -> randomAlphaOfLength(10)) + randomBoolean() ? null : randomList(5, () -> randomAlphaOfLength(10)), + randomBoolean() ? null : randomAlphaOfLength(5) ); } } diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NerConfigUpdateTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NerConfigUpdateTests.java new file mode 100644 index 0000000000000..3ae354b5de464 --- /dev/null +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NerConfigUpdateTests.java @@ -0,0 +1,82 @@ +/* + * 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.core.ml.inference.trainedmodel; + +import org.elasticsearch.ElasticsearchException; +import org.elasticsearch.Version; +import org.elasticsearch.common.io.stream.Writeable; +import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xpack.core.ml.AbstractBWCSerializationTestCase; + +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; + +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.sameInstance; + +public class NerConfigUpdateTests extends AbstractBWCSerializationTestCase { + + public void testFromMap() { + NerConfigUpdate expected = new NerConfigUpdate("ml-results"); + Map config = new HashMap<>(){{ + put(NlpConfig.RESULTS_FIELD.getPreferredName(), "ml-results"); + }}; + assertThat(NerConfigUpdate.fromMap(config), equalTo(expected)); + } + + public void testFromMapWithUnknownField() { + ElasticsearchException ex = expectThrows(ElasticsearchException.class, + () -> NerConfigUpdate.fromMap(Collections.singletonMap("some_key", 1))); + assertThat(ex.getMessage(), equalTo("Unrecognized fields [some_key].")); + } + + + public void testApply() { + NerConfig originalConfig = NerConfigTests.createRandom(); + + assertThat(originalConfig, sameInstance(new NerConfigUpdate.Builder().build().apply(originalConfig))); + + assertThat(new NerConfig( + originalConfig.getVocabularyConfig(), + originalConfig.getTokenization(), + originalConfig.getClassificationLabels(), + "ml-results"), + equalTo(new NerConfigUpdate.Builder() + .setResultsField("ml-results") + .build() + .apply(originalConfig) + )); + } + + @Override + protected NerConfigUpdate doParseInstance(XContentParser parser) throws IOException { + return NerConfigUpdate.fromXContentStrict(parser); + } + + @Override + protected Writeable.Reader instanceReader() { + return NerConfigUpdate::new; + } + + @Override + protected NerConfigUpdate createTestInstance() { + NerConfigUpdate.Builder builder = new NerConfigUpdate.Builder(); + if (randomBoolean()) { + builder.setResultsField(randomAlphaOfLength(8)); + } + return builder.build(); + } + + @Override + protected NerConfigUpdate mutateInstanceForVersion(NerConfigUpdate instance, Version version) { + return instance; + } +} + diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/PassThroughConfigTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/PassThroughConfigTests.java index b7a2e6fb95ab5..77c81fe3b509f 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/PassThroughConfigTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/PassThroughConfigTests.java @@ -50,7 +50,8 @@ protected PassThroughConfig mutateInstanceForVersion(PassThroughConfig instance, public static PassThroughConfig createRandom() { return new PassThroughConfig( randomBoolean() ? null : VocabularyConfigTests.createRandom(), - randomBoolean() ? null : BertTokenizationTests.createRandom() + randomBoolean() ? null : BertTokenizationTests.createRandom(), + randomBoolean() ? null : randomAlphaOfLength(7) ); } } diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/PassThroughConfigUpdateTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/PassThroughConfigUpdateTests.java new file mode 100644 index 0000000000000..a292e07d29b59 --- /dev/null +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/PassThroughConfigUpdateTests.java @@ -0,0 +1,80 @@ +/* + * 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.core.ml.inference.trainedmodel; + +import org.elasticsearch.ElasticsearchException; +import org.elasticsearch.Version; +import org.elasticsearch.common.io.stream.Writeable; +import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xpack.core.ml.AbstractBWCSerializationTestCase; + +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; + +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.sameInstance; + +public class PassThroughConfigUpdateTests extends AbstractBWCSerializationTestCase { + + public void testFromMap() { + PassThroughConfigUpdate expected = new PassThroughConfigUpdate("ml-results"); + Map config = new HashMap<>(){{ + put(NlpConfig.RESULTS_FIELD.getPreferredName(), "ml-results"); + }}; + assertThat(PassThroughConfigUpdate.fromMap(config), equalTo(expected)); + } + + public void testFromMapWithUnknownField() { + ElasticsearchException ex = expectThrows(ElasticsearchException.class, + () -> PassThroughConfigUpdate.fromMap(Collections.singletonMap("some_key", 1))); + assertThat(ex.getMessage(), equalTo("Unrecognized fields [some_key].")); + } + + + public void testApply() { + PassThroughConfig originalConfig = PassThroughConfigTests.createRandom(); + + assertThat(originalConfig, sameInstance(new PassThroughConfigUpdate.Builder().build().apply(originalConfig))); + + assertThat(new PassThroughConfig( + originalConfig.getVocabularyConfig(), + originalConfig.getTokenization(), + "ml-results"), + equalTo(new PassThroughConfigUpdate.Builder() + .setResultsField("ml-results") + .build() + .apply(originalConfig) + )); + } + + @Override + protected PassThroughConfigUpdate doParseInstance(XContentParser parser) throws IOException { + return PassThroughConfigUpdate.fromXContentStrict(parser); + } + + @Override + protected Writeable.Reader instanceReader() { + return PassThroughConfigUpdate::new; + } + + @Override + protected PassThroughConfigUpdate createTestInstance() { + PassThroughConfigUpdate.Builder builder = new PassThroughConfigUpdate.Builder(); + if (randomBoolean()) { + builder.setResultsField(randomAlphaOfLength(8)); + } + return builder.build(); + } + + @Override + protected PassThroughConfigUpdate mutateInstanceForVersion(PassThroughConfigUpdate instance, Version version) { + return instance; + } +} diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextClassificationConfigTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextClassificationConfigTests.java index c211002a628ca..08482ac5df2f9 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextClassificationConfigTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextClassificationConfigTests.java @@ -7,14 +7,18 @@ package org.elasticsearch.xpack.core.ml.inference.trainedmodel; +import org.elasticsearch.ElasticsearchStatusException; import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.inference.InferenceConfigItemTestCase; import java.io.IOException; +import java.util.List; import java.util.function.Predicate; +import static org.hamcrest.Matchers.containsString; + public class TextClassificationConfigTests extends InferenceConfigItemTestCase { @Override @@ -47,12 +51,34 @@ protected TextClassificationConfig mutateInstanceForVersion(TextClassificationCo return instance; } + public void testInvalidClassificationLabels() { + ElasticsearchStatusException e = expectThrows(ElasticsearchStatusException.class, + () -> new TextClassificationConfig(null, null, null, null, null)); + + assertThat(e.getMessage(), + containsString("[text_classification] requires at least 2 [classification_labels]; provided null")); + + e = expectThrows(ElasticsearchStatusException.class, + () -> new TextClassificationConfig(null, null, List.of("too-few"), null, null)); + assertThat(e.getMessage(), + containsString("[text_classification] requires at least 2 [classification_labels]; provided [too-few]")); + } + + public void testInvalidNumClasses() { + ElasticsearchStatusException e = expectThrows(ElasticsearchStatusException.class, + () -> new TextClassificationConfig(null, null, List.of("one", "two"), 0, null)); + assertThat(e.getMessage(), + containsString("[text_classification] requires at least 1 [num_top_classes]; provided [0]")); + } + + public static TextClassificationConfig createRandom() { return new TextClassificationConfig( randomBoolean() ? null : VocabularyConfigTests.createRandom(), randomBoolean() ? null : BertTokenizationTests.createRandom(), - randomBoolean() ? null : randomList(5, () -> randomAlphaOfLength(10)), - randomBoolean() ? null : randomIntBetween(-1, 10) + randomList(2, 5, () -> randomAlphaOfLength(10)), + randomBoolean() ? null : randomBoolean() ? -1 : randomIntBetween(1, 10), + randomBoolean() ? null : randomAlphaOfLength(6) ); } } diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextClassificationConfigUpdateTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextClassificationConfigUpdateTests.java new file mode 100644 index 0000000000000..1343a91f504fe --- /dev/null +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextClassificationConfigUpdateTests.java @@ -0,0 +1,148 @@ +/* + * 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.core.ml.inference.trainedmodel; + +import org.elasticsearch.ElasticsearchException; +import org.elasticsearch.ElasticsearchStatusException; +import org.elasticsearch.Version; +import org.elasticsearch.common.io.stream.Writeable; +import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xpack.core.ml.AbstractBWCSerializationTestCase; + +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.equalTo; + +public class TextClassificationConfigUpdateTests extends AbstractBWCSerializationTestCase { + + public void testFromMap() { + TextClassificationConfigUpdate expected = new TextClassificationConfigUpdate(List.of("foo", "bar"), 3, "ml-results"); + Map config = new HashMap<>(){{ + put(NlpConfig.RESULTS_FIELD.getPreferredName(), "ml-results"); + put(NlpConfig.CLASSIFICATION_LABELS.getPreferredName(), List.of("foo", "bar")); + put(NlpConfig.NUM_TOP_CLASSES.getPreferredName(), 3); + }}; + assertThat(TextClassificationConfigUpdate.fromMap(config), equalTo(expected)); + } + + public void testFromMapWithUnknownField() { + ElasticsearchException ex = expectThrows(ElasticsearchException.class, + () -> TextClassificationConfigUpdate.fromMap(Collections.singletonMap("some_key", 1))); + assertThat(ex.getMessage(), equalTo("Unrecognized fields [some_key].")); + } + + public void testIsNoop() { + assertTrue(new TextClassificationConfigUpdate.Builder().build().isNoop(TextClassificationConfigTests.createRandom())); + + assertFalse(new TextClassificationConfigUpdate.Builder() + .setResultsField("foo") + .build() + .isNoop(new TextClassificationConfig.Builder() + .setClassificationLabels(List.of("a", "b")) + .setNumTopClasses(-1) + .setResultsField("bar").build())); + + assertTrue(new TextClassificationConfigUpdate.Builder() + .setNumTopClasses(3) + .build() + .isNoop(new TextClassificationConfig.Builder().setClassificationLabels(List.of("a", "b")).setNumTopClasses(3).build())); + assertFalse(new TextClassificationConfigUpdate.Builder() + .setClassificationLabels(List.of("a", "b")) + .build() + .isNoop(new TextClassificationConfig.Builder().setClassificationLabels(List.of("c", "d")).setNumTopClasses(3).build())); + } + + public void testApply() { + TextClassificationConfig originalConfig = new TextClassificationConfig( + VocabularyConfigTests.createRandom(), + BertTokenizationTests.createRandom(), + List.of("one", "two"), + randomIntBetween(-1, 10), + "foo-results" + ); + + assertThat(originalConfig, equalTo(new TextClassificationConfigUpdate.Builder().build().apply(originalConfig))); + + assertThat(new TextClassificationConfig.Builder(originalConfig) + .setClassificationLabels(List.of("foo", "bar")) + .build(), + equalTo(new TextClassificationConfigUpdate.Builder() + .setClassificationLabels(List.of("foo", "bar")) + .build() + .apply(originalConfig))); + assertThat(new TextClassificationConfig.Builder(originalConfig) + .setResultsField("ml-results") + .build(), + equalTo(new TextClassificationConfigUpdate.Builder() + .setResultsField("ml-results") + .build() + .apply(originalConfig) + )); + assertThat(new TextClassificationConfig.Builder(originalConfig) + .setNumTopClasses(originalConfig.getNumTopClasses() +1) + .build(), + equalTo(new TextClassificationConfigUpdate.Builder() + .setNumTopClasses(originalConfig.getNumTopClasses() +1) + .build() + .apply(originalConfig) + )); + } + + public void testApplyWithInvalidLabels() { + TextClassificationConfig originalConfig = TextClassificationConfigTests.createRandom(); + + int numberNewLabels = originalConfig.getClassificationLabels().size() +1; + List newLabels = randomList(numberNewLabels, numberNewLabels, () -> randomAlphaOfLength(6)); + + var update = new TextClassificationConfigUpdate.Builder() + .setClassificationLabels(newLabels) + .build(); + + ElasticsearchStatusException e = expectThrows(ElasticsearchStatusException.class, + () -> update.apply(originalConfig)); + assertThat(e.getMessage(), + containsString("The number of [classification_labels] the model is defined with [" + + originalConfig.getClassificationLabels().size() + + "] does not match the number in the update [" + numberNewLabels + "]")); + } + + @Override + protected TextClassificationConfigUpdate doParseInstance(XContentParser parser) throws IOException { + return TextClassificationConfigUpdate.fromXContentStrict(parser); + } + + @Override + protected Writeable.Reader instanceReader() { + return TextClassificationConfigUpdate::new; + } + + @Override + protected TextClassificationConfigUpdate createTestInstance() { + TextClassificationConfigUpdate.Builder builder = new TextClassificationConfigUpdate.Builder(); + if (randomBoolean()) { + builder.setNumTopClasses(randomIntBetween(1, 4)); + } + if (randomBoolean()) { + builder.setClassificationLabels(randomList(1, 3, () -> randomAlphaOfLength(4))); + } + if (randomBoolean()) { + builder.setResultsField(randomAlphaOfLength(8)); + } + return builder.build(); + } + + @Override + protected TextClassificationConfigUpdate mutateInstanceForVersion(TextClassificationConfigUpdate instance, Version version) { + return instance; + } +} diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextEmbeddingConfigTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextEmbeddingConfigTests.java index bedeea7e21dc4..a16bd03c577f4 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextEmbeddingConfigTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextEmbeddingConfigTests.java @@ -50,7 +50,8 @@ protected TextEmbeddingConfig mutateInstanceForVersion(TextEmbeddingConfig insta public static TextEmbeddingConfig createRandom() { return new TextEmbeddingConfig( randomBoolean() ? null : VocabularyConfigTests.createRandom(), - randomBoolean() ? null : BertTokenizationTests.createRandom() + randomBoolean() ? null : BertTokenizationTests.createRandom(), + randomBoolean() ? null : randomAlphaOfLength(7) ); } } diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextEmbeddingConfigUpdateTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextEmbeddingConfigUpdateTests.java new file mode 100644 index 0000000000000..579118ab8702f --- /dev/null +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextEmbeddingConfigUpdateTests.java @@ -0,0 +1,80 @@ +/* + * 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.core.ml.inference.trainedmodel; + +import org.elasticsearch.ElasticsearchException; +import org.elasticsearch.Version; +import org.elasticsearch.common.io.stream.Writeable; +import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xpack.core.ml.AbstractBWCSerializationTestCase; + +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; + +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.sameInstance; + +public class TextEmbeddingConfigUpdateTests extends AbstractBWCSerializationTestCase { + + public void testFromMap() { + TextEmbeddingConfigUpdate expected = new TextEmbeddingConfigUpdate("ml-results"); + Map config = new HashMap<>(){{ + put(NlpConfig.RESULTS_FIELD.getPreferredName(), "ml-results"); + }}; + assertThat(TextEmbeddingConfigUpdate.fromMap(config), equalTo(expected)); + } + + public void testFromMapWithUnknownField() { + ElasticsearchException ex = expectThrows(ElasticsearchException.class, + () -> TextEmbeddingConfigUpdate.fromMap(Collections.singletonMap("some_key", 1))); + assertThat(ex.getMessage(), equalTo("Unrecognized fields [some_key].")); + } + + + public void testApply() { + TextEmbeddingConfig originalConfig = TextEmbeddingConfigTests.createRandom(); + + assertThat(originalConfig, sameInstance(new TextEmbeddingConfigUpdate.Builder().build().apply(originalConfig))); + + assertThat(new TextEmbeddingConfig( + originalConfig.getVocabularyConfig(), + originalConfig.getTokenization(), + "ml-results"), + equalTo(new TextEmbeddingConfigUpdate.Builder() + .setResultsField("ml-results") + .build() + .apply(originalConfig) + )); + } + + @Override + protected TextEmbeddingConfigUpdate doParseInstance(XContentParser parser) throws IOException { + return TextEmbeddingConfigUpdate.fromXContentStrict(parser); + } + + @Override + protected Writeable.Reader instanceReader() { + return TextEmbeddingConfigUpdate::new; + } + + @Override + protected TextEmbeddingConfigUpdate createTestInstance() { + TextEmbeddingConfigUpdate.Builder builder = new TextEmbeddingConfigUpdate.Builder(); + if (randomBoolean()) { + builder.setResultsField(randomAlphaOfLength(8)); + } + return builder.build(); + } + + @Override + protected TextEmbeddingConfigUpdate mutateInstanceForVersion(TextEmbeddingConfigUpdate instance, Version version) { + return instance; + } +} diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ZeroShotClassificationConfigTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ZeroShotClassificationConfigTests.java index f292683ddc314..cac3e3a18cafc 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ZeroShotClassificationConfigTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ZeroShotClassificationConfigTests.java @@ -55,7 +55,8 @@ public static ZeroShotClassificationConfig createRandom() { randomBoolean() ? null : BertTokenizationTests.createRandom(), randomAlphaOfLength(10), randomBoolean(), - randomBoolean() ? null : randomList(1, 5, () -> randomAlphaOfLength(10)) + randomBoolean() ? null : randomList(1, 5, () -> randomAlphaOfLength(10)), + randomBoolean() ? null : randomAlphaOfLength(7) ); } } diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ZeroShotClassificationConfigUpdateTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ZeroShotClassificationConfigUpdateTests.java index ab63fb67861fd..ca1144de3d3be 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ZeroShotClassificationConfigUpdateTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ZeroShotClassificationConfigUpdateTests.java @@ -50,10 +50,11 @@ protected ZeroShotClassificationConfigUpdate mutateInstanceForVersion(ZeroShotCl } public void testFromMap() { - ZeroShotClassificationConfigUpdate expected = new ZeroShotClassificationConfigUpdate(List.of("foo", "bar"), false); + ZeroShotClassificationConfigUpdate expected = new ZeroShotClassificationConfigUpdate(List.of("foo", "bar"), false, "ml-results"); Map config = new HashMap<>(){{ put(ZeroShotClassificationConfig.LABELS.getPreferredName(), List.of("foo", "bar")); put(ZeroShotClassificationConfig.MULTI_LABEL.getPreferredName(), false); + put(ZeroShotClassificationConfig.RESULTS_FIELD.getPreferredName(), "ml-results"); }}; assertThat(ZeroShotClassificationConfigUpdate.fromMap(config), equalTo(expected)); } @@ -71,7 +72,8 @@ public void testApply() { randomBoolean() ? null : BertTokenizationTests.createRandom(), randomAlphaOfLength(10), randomBoolean(), - randomList(1, 5, () -> randomAlphaOfLength(10)) + randomList(1, 5, () -> randomAlphaOfLength(10)), + randomBoolean() ? null : randomAlphaOfLength(8) ); assertThat(originalConfig, equalTo(new ZeroShotClassificationConfigUpdate.Builder().build().apply(originalConfig))); @@ -83,7 +85,8 @@ public void testApply() { originalConfig.getTokenization(), originalConfig.getHypothesisTemplate(), originalConfig.isMultiLabel(), - List.of("foo", "bar") + List.of("foo", "bar"), + originalConfig.getResultsField() ), equalTo( new ZeroShotClassificationConfigUpdate.Builder() @@ -98,7 +101,8 @@ public void testApply() { originalConfig.getTokenization(), originalConfig.getHypothesisTemplate(), true, - originalConfig.getLabels() + originalConfig.getLabels(), + originalConfig.getResultsField() ), equalTo( new ZeroShotClassificationConfigUpdate.Builder() @@ -106,6 +110,22 @@ public void testApply() { .apply(originalConfig) ) ); + assertThat( + new ZeroShotClassificationConfig( + originalConfig.getClassificationLabels(), + originalConfig.getVocabularyConfig(), + originalConfig.getTokenization(), + originalConfig.getHypothesisTemplate(), + originalConfig.isMultiLabel(), + originalConfig.getLabels(), + "updated-field" + ), + equalTo( + new ZeroShotClassificationConfigUpdate.Builder() + .setResultsField("updated-field").build() + .apply(originalConfig) + ) + ); } public void testApplyWithEmptyLabelsInConfigAndUpdate() { @@ -115,6 +135,7 @@ public void testApplyWithEmptyLabelsInConfigAndUpdate() { randomBoolean() ? null : BertTokenizationTests.createRandom(), randomAlphaOfLength(10), randomBoolean(), + null, null ); @@ -128,7 +149,8 @@ public void testApplyWithEmptyLabelsInConfigAndUpdate() { public static ZeroShotClassificationConfigUpdate createRandom() { return new ZeroShotClassificationConfigUpdate( randomBoolean() ? null : randomList(1,5, () -> randomAlphaOfLength(10)), - randomBoolean() ? null : randomBoolean() + randomBoolean() ? null : randomBoolean(), + randomBoolean() ? null : randomAlphaOfLength(5) ); } } diff --git a/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/AutoscalingIT.java b/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/AutoscalingIT.java index 51300960519ef..a91dd0a339ad3 100644 --- a/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/AutoscalingIT.java +++ b/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/AutoscalingIT.java @@ -276,7 +276,7 @@ private void putAndStartModelDeployment(String modelId, long memoryUse, Allocati new PutTrainedModelAction.Request( TrainedModelConfig.builder() .setModelType(TrainedModelType.PYTORCH) - .setInferenceConfig(new PassThroughConfig(null, new BertTokenization(null, false, null))) + .setInferenceConfig(new PassThroughConfig(null, new BertTokenization(null, false, null), null)) .setModelId(modelId) .build(), false diff --git a/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/TestFeatureResetIT.java b/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/TestFeatureResetIT.java index a85222c1b14d9..70ad971869f23 100644 --- a/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/TestFeatureResetIT.java +++ b/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/TestFeatureResetIT.java @@ -200,7 +200,8 @@ void createModelDeployment() { .setInferenceConfig( new PassThroughConfig( null, - new BertTokenization(null, false, null) + new BertTokenization(null, false, null), + null ) ) .setModelId(TRAINED_MODEL_ID) diff --git a/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/TrainedModelCRUDIT.java b/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/TrainedModelCRUDIT.java index 28d136a78b143..329f3619d8588 100644 --- a/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/TrainedModelCRUDIT.java +++ b/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/TrainedModelCRUDIT.java @@ -72,7 +72,8 @@ public void testPutTrainedModelAndDefinition() { new VocabularyConfig( InferenceIndexConstants.nativeDefinitionStore() ), - new BertTokenization(null, false, null) + new BertTokenization(null, false, null), + null ) ) .setModelId(modelId) diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/ingest/InferenceProcessor.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/ingest/InferenceProcessor.java index 3ea64a9ba9b80..26e7958d1b436 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/ingest/InferenceProcessor.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/ingest/InferenceProcessor.java @@ -33,10 +33,20 @@ import org.elasticsearch.xpack.core.ml.inference.trainedmodel.ClassificationConfig; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.ClassificationConfigUpdate; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.EmptyConfigUpdate; +import org.elasticsearch.xpack.core.ml.inference.trainedmodel.FillMaskConfig; +import org.elasticsearch.xpack.core.ml.inference.trainedmodel.FillMaskConfigUpdate; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.InferenceConfig; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.InferenceConfigUpdate; +import org.elasticsearch.xpack.core.ml.inference.trainedmodel.NerConfig; +import org.elasticsearch.xpack.core.ml.inference.trainedmodel.NerConfigUpdate; +import org.elasticsearch.xpack.core.ml.inference.trainedmodel.PassThroughConfig; +import org.elasticsearch.xpack.core.ml.inference.trainedmodel.PassThroughConfigUpdate; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.RegressionConfig; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.RegressionConfigUpdate; +import org.elasticsearch.xpack.core.ml.inference.trainedmodel.TextClassificationConfig; +import org.elasticsearch.xpack.core.ml.inference.trainedmodel.TextClassificationConfigUpdate; +import org.elasticsearch.xpack.core.ml.inference.trainedmodel.TextEmbeddingConfig; +import org.elasticsearch.xpack.core.ml.inference.trainedmodel.TextEmbeddingConfigUpdate; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.ZeroShotClassificationConfig; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.ZeroShotClassificationConfigUpdate; import org.elasticsearch.xpack.core.ml.job.messages.Messages; @@ -357,13 +367,29 @@ InferenceConfigUpdate inferenceConfigUpdateFromMap(Map configMap if (configMap.containsKey(ClassificationConfig.NAME.getPreferredName())) { checkSupportedVersion(ClassificationConfig.EMPTY_PARAMS); return ClassificationConfigUpdate.fromMap(valueMap); + } else if (configMap.containsKey(FillMaskConfig.NAME)) { + checkSupportedVersion(new FillMaskConfig(null, null, null, null)); + return FillMaskConfigUpdate.fromMap(valueMap); + } else if (configMap.containsKey(NerConfig.NAME)) { + checkSupportedVersion(new NerConfig(null, null, null, null)); + return NerConfigUpdate.fromMap(valueMap); + } else if (configMap.containsKey(PassThroughConfig.NAME)) { + checkSupportedVersion(new PassThroughConfig(null, null, null)); + return PassThroughConfigUpdate.fromMap(valueMap); } else if (configMap.containsKey(RegressionConfig.NAME.getPreferredName())) { checkSupportedVersion(RegressionConfig.EMPTY_PARAMS); return RegressionConfigUpdate.fromMap(valueMap); + } else if (configMap.containsKey(TextClassificationConfig.NAME)) { + checkSupportedVersion(new TextClassificationConfig(null, null, List.of("meeting", "requirements"), null, null)); + return TextClassificationConfigUpdate.fromMap(valueMap); + } else if (configMap.containsKey(TextEmbeddingConfig.NAME)) { + checkSupportedVersion(new TextEmbeddingConfig(null, null, null)); + return TextEmbeddingConfigUpdate.fromMap(valueMap); } else if (configMap.containsKey(ZeroShotClassificationConfig.NAME)) { - checkSupportedVersion(new ZeroShotClassificationConfig(List.of("unused"), null, null, null, null, null)); + checkSupportedVersion(new ZeroShotClassificationConfig(List.of("unused"), null, null, null, null, null, null)); return ZeroShotClassificationConfigUpdate.fromMap(valueMap); } + // TODO missing update types else { throw ExceptionsHelper.badRequestException("unrecognized inference configuration type {}. Supported types {}", configMap.keySet(), diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/FillMaskProcessor.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/FillMaskProcessor.java index ed43da44a02bb..8cfef66b7c4a8 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/FillMaskProcessor.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/FillMaskProcessor.java @@ -23,8 +23,6 @@ public class FillMaskProcessor implements NlpTask.Processor { - private static final int NUM_RESULTS = 5; - private final NlpTask.RequestBuilder requestBuilder; FillMaskProcessor(NlpTokenizer tokenizer, FillMaskConfig config) { @@ -57,11 +55,14 @@ public NlpTask.RequestBuilder getRequestBuilder(NlpConfig config) { @Override public NlpTask.ResultProcessor getResultProcessor(NlpConfig config) { - return this::processResult; + if (config instanceof FillMaskConfig) { + return (tokenization, result) -> processResult(tokenization, result, ((FillMaskConfig)config).getNumTopClasses()); + } else { + return (tokenization, result) -> processResult(tokenization, result, FillMaskConfig.DEFAULT_NUM_RESULTS); + } } - InferenceResults processResult(TokenizationResult tokenization, PyTorchResult pyTorchResult) { - + InferenceResults processResult(TokenizationResult tokenization, PyTorchResult pyTorchResult, int numResults) { if (tokenization.getTokenizations().isEmpty() || tokenization.getTokenizations().get(0).getTokens().length == 0) { return new FillMaskResults(Collections.emptyList()); @@ -71,8 +72,8 @@ InferenceResults processResult(TokenizationResult tokenization, PyTorchResult py // TODO - process all results in the batch double[] normalizedScores = NlpHelpers.convertToProbabilitiesBySoftMax(pyTorchResult.getInferenceResult()[0][maskTokenIndex]); - NlpHelpers.ScoreAndIndex[] scoreAndIndices = NlpHelpers.topK(NUM_RESULTS, normalizedScores); - List results = new ArrayList<>(NUM_RESULTS); + NlpHelpers.ScoreAndIndex[] scoreAndIndices = NlpHelpers.topK(numResults, normalizedScores); + List results = new ArrayList<>(numResults); for (NlpHelpers.ScoreAndIndex scoreAndIndex : scoreAndIndices) { String predictedToken = tokenization.getFromVocab(scoreAndIndex.index); String sequence = tokenization.getTokenizations().get(0).getInput().replace(BertTokenizer.MASK_TOKEN, predictedToken); diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/TextClassificationProcessor.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/TextClassificationProcessor.java index d44cbbffd5182..a66f0d01a5c27 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/TextClassificationProcessor.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/TextClassificationProcessor.java @@ -7,8 +7,6 @@ package org.elasticsearch.xpack.ml.inference.nlp; -import org.elasticsearch.common.Strings; -import org.elasticsearch.common.ValidationException; import org.elasticsearch.xpack.core.ml.inference.results.InferenceResults; import org.elasticsearch.xpack.core.ml.inference.results.TextClassificationResults; import org.elasticsearch.xpack.core.ml.inference.results.TopClassEntry; @@ -21,7 +19,6 @@ import java.util.Comparator; import java.util.List; -import java.util.Locale; import java.util.stream.Collectors; import java.util.stream.IntStream; @@ -34,11 +31,7 @@ public class TextClassificationProcessor implements NlpTask.Processor { TextClassificationProcessor(NlpTokenizer tokenizer, TextClassificationConfig config) { this.requestBuilder = tokenizer.requestBuilder(); List classLabels = config.getClassificationLabels(); - if (classLabels == null || classLabels.isEmpty()) { - this.classLabels = new String[] {"negative", "positive"}; - } else { - this.classLabels = classLabels.toArray(String[]::new); - } + this.classLabels = classLabels.toArray(String[]::new); // negative values are a special case of asking for ALL classes. Since we require the output size to equal the classLabel size // This is a nice way of setting the value this.numTopClasses = config.getNumTopClasses() < 0 ? this.classLabels.length : config.getNumTopClasses(); @@ -46,26 +39,7 @@ public class TextClassificationProcessor implements NlpTask.Processor { } private void validate() { - if (classLabels.length < 2) { - throw new ValidationException().addValidationError( - String.format( - Locale.ROOT, - "Text classification requires at least 2 [%s]. Invalid labels [%s]", - TextClassificationConfig.CLASSIFICATION_LABELS, - Strings.arrayToCommaDelimitedString(classLabels) - ) - ); - } - if (numTopClasses == 0) { - throw new ValidationException().addValidationError( - String.format( - Locale.ROOT, - "Text classification requires at least 1 [%s]; provided [%d]", - TextClassificationConfig.NUM_TOP_CLASSES, - numTopClasses - ) - ); - } + // validation occurs in TextClassificationConfig } @Override diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/FillMaskProcessorTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/FillMaskProcessorTests.java index 3747954df85eb..a4df5070067a1 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/FillMaskProcessorTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/FillMaskProcessorTests.java @@ -24,7 +24,8 @@ import static org.hamcrest.Matchers.hasSize; import static org.mockito.Mockito.mock; -public class FillMaskProcessorTests extends ESTestCase { +public class +FillMaskProcessorTests extends ESTestCase { public void testProcessResults() { // only the scores of the MASK index array @@ -48,11 +49,11 @@ public void testProcessResults() { TokenizationResult tokenization = new TokenizationResult(vocab); tokenization.addTokenization(input, tokens, tokenIds, tokenMap); - FillMaskConfig config = new FillMaskConfig(new VocabularyConfig("test-index"), null); + FillMaskConfig config = new FillMaskConfig(new VocabularyConfig("test-index"), null, null, null); FillMaskProcessor processor = new FillMaskProcessor(mock(BertTokenizer.class), config); - FillMaskResults result = (FillMaskResults) processor.processResult(tokenization, new PyTorchResult("1", scores, 0L, null)); - assertThat(result.getPredictions(), hasSize(5)); + FillMaskResults result = (FillMaskResults) processor.processResult(tokenization, new PyTorchResult("1", scores, 0L, null), 4); + assertThat(result.getPredictions(), hasSize(4)); FillMaskResults.Prediction prediction = result.getPredictions().get(0); assertEquals("France", prediction.getToken()); assertEquals("The capital of France is Paris", prediction.getSequence()); @@ -70,10 +71,10 @@ public void testProcessResults_GivenMissingTokens() { TokenizationResult tokenization = new TokenizationResult(Collections.emptyList()); tokenization.addTokenization("", new String[]{}, new int[] {}, new int[] {}); - FillMaskConfig config = new FillMaskConfig(new VocabularyConfig("test-index"), null); + FillMaskConfig config = new FillMaskConfig(new VocabularyConfig("test-index"), null, null, null); FillMaskProcessor processor = new FillMaskProcessor(mock(BertTokenizer.class), config); PyTorchResult pyTorchResult = new PyTorchResult("1", new double[][][]{{{}}}, 0L, null); - FillMaskResults result = (FillMaskResults) processor.processResult(tokenization, pyTorchResult); + FillMaskResults result = (FillMaskResults) processor.processResult(tokenization, pyTorchResult, 5); assertThat(result.getPredictions(), empty()); } @@ -81,7 +82,7 @@ public void testProcessResults_GivenMissingTokens() { public void testValidate_GivenMissingMaskToken() { List input = List.of("The capital of France is Paris"); - FillMaskConfig config = new FillMaskConfig(new VocabularyConfig("test-index"), null); + FillMaskConfig config = new FillMaskConfig(new VocabularyConfig("test-index"), null, null, null); FillMaskProcessor processor = new FillMaskProcessor(mock(BertTokenizer.class), config); IllegalArgumentException e = expectThrows(IllegalArgumentException.class, @@ -93,7 +94,7 @@ public void testValidate_GivenMissingMaskToken() { public void testProcessResults_GivenMultipleMaskTokens() { List input = List.of("The capital of [MASK] is [MASK]"); - FillMaskConfig config = new FillMaskConfig(new VocabularyConfig("test-index"), null); + FillMaskConfig config = new FillMaskConfig(new VocabularyConfig("test-index"), null, null, null); FillMaskProcessor processor = new FillMaskProcessor(mock(BertTokenizer.class), config); IllegalArgumentException e = expectThrows(IllegalArgumentException.class, diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/NerProcessorTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/NerProcessorTests.java index a3837fe5c4e26..f135e6786356c 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/NerProcessorTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/NerProcessorTests.java @@ -64,7 +64,7 @@ public void testValidate_DuplicateLabels() { }; List classLabels = Arrays.stream(tags).map(NerProcessor.IobTag::toString).collect(Collectors.toList()); - NerConfig nerConfig = new NerConfig(new VocabularyConfig("test-index"), null, classLabels); + NerConfig nerConfig = new NerConfig(new VocabularyConfig("test-index"), null, classLabels, null); ValidationException ve = expectThrows(ValidationException.class, () -> new NerProcessor(mock(BertTokenizer.class), nerConfig)); assertThat(ve.getMessage(), @@ -73,7 +73,7 @@ public void testValidate_DuplicateLabels() { public void testValidate_NotAEntityLabel() { List classLabels = List.of("foo", NerProcessor.IobTag.B_MISC.toString()); - NerConfig nerConfig = new NerConfig(new VocabularyConfig("test-index"), null, classLabels); + NerConfig nerConfig = new NerConfig(new VocabularyConfig("test-index"), null, classLabels, null); ValidationException ve = expectThrows(ValidationException.class, () -> new NerProcessor(mock(BertTokenizer.class), nerConfig)); assertThat(ve.getMessage(), containsString("classification label [foo] is not an entity I-O-B tag")); diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/TextClassificationProcessorTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/TextClassificationProcessorTests.java index 5b0d99112faba..143de1fef34da 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/TextClassificationProcessorTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/TextClassificationProcessorTests.java @@ -7,7 +7,6 @@ package org.elasticsearch.xpack.ml.inference.nlp; -import org.elasticsearch.common.ValidationException; import org.elasticsearch.common.xcontent.XContentHelper; import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; @@ -25,7 +24,6 @@ import java.util.List; import java.util.Map; -import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.hasSize; import static org.hamcrest.Matchers.instanceOf; import static org.mockito.Mockito.mock; @@ -33,7 +31,9 @@ public class TextClassificationProcessorTests extends ESTestCase { public void testInvalidResult() { - TextClassificationConfig config = new TextClassificationConfig(new VocabularyConfig("test-index"), null, null, null); + TextClassificationConfig config = new TextClassificationConfig( + new VocabularyConfig("test-index"), null, List.of("a", "b"), null, null); + TextClassificationProcessor processor = new TextClassificationProcessor(mock(BertTokenizer.class), config); { PyTorchResult torchResult = new PyTorchResult("foo", new double[][][] {}, 0L, null); @@ -62,7 +62,9 @@ public void testBuildRequest() throws IOException { ), new BertTokenization(null, null, 512)); - TextClassificationConfig config = new TextClassificationConfig(new VocabularyConfig("test-index"), null, null, null); + TextClassificationConfig config = new TextClassificationConfig( + new VocabularyConfig("test-index"), null, List.of("a", "b"), null, null); + TextClassificationProcessor processor = new TextClassificationProcessor(tokenizer, config); NlpTask.Request request = processor.getRequestBuilder(config).buildRequest(List.of("Elasticsearch fun"), "request1"); @@ -74,32 +76,4 @@ public void testBuildRequest() throws IOException { assertEquals(Arrays.asList(3, 0, 1, 2, 4), ((List>)jsonDocAsMap.get("tokens")).get(0)); assertEquals(Arrays.asList(1, 1, 1, 1, 1), ((List>)jsonDocAsMap.get("arg_1")).get(0)); } - - public void testValidate() { - ValidationException validationException = expectThrows( - ValidationException.class, - () -> new TextClassificationProcessor( - mock(BertTokenizer.class), - new TextClassificationConfig(new VocabularyConfig("test-index"), null, List.of("too few"), null) - ) - ); - - assertThat( - validationException.getMessage(), - containsString("Text classification requires at least 2 [classification_labels]. Invalid labels [too few]") - ); - - validationException = expectThrows( - ValidationException.class, - () -> new TextClassificationProcessor( - mock(BertTokenizer.class), - new TextClassificationConfig(new VocabularyConfig("test-index"), null, List.of("class", "labels"), 0) - ) - ); - - assertThat( - validationException.getMessage(), - containsString("Text classification requires at least 1 [num_top_classes]; provided [0]") - ); - } } diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/ZeroShotClassificationProcessorTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/ZeroShotClassificationProcessorTests.java index bb57d038e7b3a..8c54ef4f6c2f9 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/ZeroShotClassificationProcessorTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/ZeroShotClassificationProcessorTests.java @@ -43,6 +43,7 @@ public void testBuildRequest() throws IOException { null, null, null, + null, null ); ZeroShotClassificationProcessor processor = new ZeroShotClassificationProcessor(tokenizer, config); From 2a423c8f67e866d0f780be6847a66865a661d0af Mon Sep 17 00:00:00 2001 From: Jake Landis Date: Thu, 30 Sep 2021 11:30:48 -0500 Subject: [PATCH 085/250] [Compatible REST Testing] Introduce skip test via transformation (#78398) Prior to this change, the only way to express that a compatible REST test should be skipped was via the blacklist of the ES test runner. While this works for ES, it requires any consumers of the compatible REST tests copy/paste the list of tests that should not be executed. This commit introduces 2 new transforms for the compatible REST tests. skipTest - adds a skip section to the named test with a given reason skipTestsByFilePattern - add a skip section to the global setup for any test file that matches the file pattern and includes the given reason. All uses of the blacklist have been replaced by the new skip transforms. --- .../YamlRestCompatTestPluginFuncTest.groovy | 4 + .../compat/RestCompatTestTransformTask.java | 143 +++++++++++++++--- .../test/rest/transform/skip/Skip.java | 117 ++++++++++++++ .../test/rest/transform/skip/SkipTests.java | 105 +++++++++++++ .../rest/transform/skip/per_test_original.yml | 18 +++ .../transform/skip/per_test_transformed.yml | 24 +++ .../transform/skip/with_features_original.yml | 13 ++ .../skip/with_features_transformed.yml | 15 ++ .../skip/with_setup_no_skip_original.yml | 13 ++ .../skip/with_setup_no_skip_transformed.yml | 16 ++ .../transform/skip/with_skip_original.yml | 13 ++ .../transform/skip/with_skip_transformed.yml | 13 ++ .../transform/skip/without_setup_original.yml | 7 + .../skip/without_setup_transformed.yml | 11 ++ modules/analysis-common/build.gradle | 15 +- modules/percolator/build.gradle | 4 +- modules/reindex/build.gradle | 15 +- plugins/analysis-icu/build.gradle | 9 +- rest-api-spec/build.gradle | 103 +++++-------- x-pack/plugin/build.gradle | 70 ++++----- x-pack/plugin/watcher/qa/rest/build.gradle | 16 +- 21 files changed, 582 insertions(+), 162 deletions(-) create mode 100644 build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/transform/skip/Skip.java create mode 100644 build-tools-internal/src/test/java/org/elasticsearch/gradle/internal/test/rest/transform/skip/SkipTests.java create mode 100644 build-tools-internal/src/test/resources/rest/transform/skip/per_test_original.yml create mode 100644 build-tools-internal/src/test/resources/rest/transform/skip/per_test_transformed.yml create mode 100644 build-tools-internal/src/test/resources/rest/transform/skip/with_features_original.yml create mode 100644 build-tools-internal/src/test/resources/rest/transform/skip/with_features_transformed.yml create mode 100644 build-tools-internal/src/test/resources/rest/transform/skip/with_setup_no_skip_original.yml create mode 100644 build-tools-internal/src/test/resources/rest/transform/skip/with_setup_no_skip_transformed.yml create mode 100644 build-tools-internal/src/test/resources/rest/transform/skip/with_skip_original.yml create mode 100644 build-tools-internal/src/test/resources/rest/transform/skip/with_skip_transformed.yml create mode 100644 build-tools-internal/src/test/resources/rest/transform/skip/without_setup_original.yml create mode 100644 build-tools-internal/src/test/resources/rest/transform/skip/without_setup_transformed.yml diff --git a/build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/internal/test/rest/YamlRestCompatTestPluginFuncTest.groovy b/build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/internal/test/rest/YamlRestCompatTestPluginFuncTest.groovy index e6a640b3a5ad1..b94f8c1f58e8e 100644 --- a/build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/internal/test/rest/YamlRestCompatTestPluginFuncTest.groovy +++ b/build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/internal/test/rest/YamlRestCompatTestPluginFuncTest.groovy @@ -196,6 +196,7 @@ class YamlRestCompatTestPluginFuncTest extends AbstractRestResourcesFuncTest { yamlRestTestImplementation "junit:junit:4.12" } tasks.named("yamlRestTestV${compatibleVersion}CompatTransform").configure({ task -> + task.skipTest("test/test/two", "This is a test to skip test two") task.replaceValueInMatch("_type", "_doc") task.replaceValueInMatch("_source.values", ["z", "x", "y"], "one") task.removeMatch("_source.blah") @@ -333,6 +334,9 @@ class YamlRestCompatTestPluginFuncTest extends AbstractRestResourcesFuncTest { --- two: + - skip: + version: "all" + reason: "This is a test to skip test two" - do: get: index: "test2" diff --git a/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/rest/compat/RestCompatTestTransformTask.java b/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/rest/compat/RestCompatTestTransformTask.java index 073f92b2d5226..cb5e7197f0e55 100644 --- a/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/rest/compat/RestCompatTestTransformTask.java +++ b/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/rest/compat/RestCompatTestTransformTask.java @@ -18,6 +18,8 @@ import com.fasterxml.jackson.databind.node.TextNode; import com.fasterxml.jackson.dataformat.yaml.YAMLFactory; import com.fasterxml.jackson.dataformat.yaml.YAMLParser; + +import org.apache.commons.lang3.tuple.Pair; import org.elasticsearch.gradle.Version; import org.elasticsearch.gradle.VersionProperties; import org.elasticsearch.gradle.internal.test.rest.transform.RestTestTransform; @@ -30,6 +32,7 @@ import org.elasticsearch.gradle.internal.test.rest.transform.match.RemoveMatch; import org.elasticsearch.gradle.internal.test.rest.transform.match.ReplaceKeyInMatch; import org.elasticsearch.gradle.internal.test.rest.transform.match.ReplaceValueInMatch; +import org.elasticsearch.gradle.internal.test.rest.transform.skip.Skip; import org.elasticsearch.gradle.internal.test.rest.transform.text.ReplaceIsFalse; import org.elasticsearch.gradle.internal.test.rest.transform.text.ReplaceIsTrue; import org.elasticsearch.gradle.internal.test.rest.transform.text.ReplaceTextual; @@ -41,6 +44,7 @@ import org.gradle.api.file.FileSystemOperations; import org.gradle.api.file.FileTree; import org.gradle.api.model.ObjectFactory; +import org.gradle.api.tasks.Input; import org.gradle.api.tasks.InputFiles; import org.gradle.api.tasks.Internal; import org.gradle.api.tasks.Nested; @@ -51,17 +55,20 @@ import org.gradle.api.tasks.util.PatternSet; import org.gradle.internal.Factory; -import javax.inject.Inject; import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Set; +import java.util.stream.Collectors; +import javax.inject.Inject; /** * A task to transform REST tests for use in REST API compatibility before they are executed. @@ -81,7 +88,12 @@ public class RestCompatTestTransformTask extends DefaultTask { private final DirectoryProperty sourceDirectory; private final DirectoryProperty outputDirectory; private final PatternFilterable testPatternSet; + private final Factory patternSetFactory; private final List> transformations = new ArrayList<>(); + // PatternFilterable -> reason why skipped. + private final Map skippedTestByFilePatternTransformations = new HashMap<>(); + // PatternFilterable -> list of full test names and reasons. Needed for 1 pattern may include many tests and reasons + private final Map>> skippedTestByTestNameTransformations = new HashMap<>(); @Inject public RestCompatTestTransformTask( @@ -89,6 +101,7 @@ public RestCompatTestTransformTask( Factory patternSetFactory, ObjectFactory objectFactory ) { + this.patternSetFactory = patternSetFactory; this.fileSystemOperations = fileSystemOperations; this.compatibleVersion = Version.fromString(VersionProperties.getVersions().get("elasticsearch")).getMajor() - 1; this.sourceDirectory = objectFactory.directoryProperty(); @@ -112,6 +125,37 @@ private static boolean doesNotHaveCatOperation(ObjectNode doNodeValue) { return true; } + public void skipTest(String fullTestName, String reason) { + //The tests are defined by 3 parts a/b/c where + // a = the folder name + // b = the file name without the .yml extension + // c = the test name inside the .yml + // For example: indices.get_mapping/20_missing_type/Non-existent type returns 404 + // However, the folder can be arbitrarily nest so, a == a1/a2/a3, and the test name can include forward slashes, so c == c1/c2/c3 + // So we also need to support a1/a2/a3/b/c1/c2/c3 + + String[] testParts = fullTestName.split("/"); + if(testParts.length < 3 ){ + throw new IllegalArgumentException("To skip tests, all 3 parts [folder/file/test name] must be defined. found [" + fullTestName + "]"); + } + + PatternSet skippedPatternSet = patternSetFactory.create(); + //create file patterns for all a1/a2/a3/b.yml possibilities. + for(int i = testParts.length - 1; i > 1; i-- ){ + final String lastPart = testParts[i]; + String filePattern = "**/" + Arrays.stream(testParts).takeWhile(x -> x.equals(lastPart) == false).collect(Collectors.joining("/")) + ".yml"; + skippedPatternSet.include(filePattern); + } + + skippedTestByTestNameTransformations.computeIfAbsent(skippedPatternSet, k -> new ArrayList<>()).add(Pair.of(fullTestName, reason)); + } + + public void skipTestsByFilePattern(String filePattern, String reason) { + PatternSet skippedPatternSet = patternSetFactory.create(); + skippedPatternSet.include(filePattern); + skippedTestByFilePatternTransformations.put(skippedPatternSet, reason); + } + /** * Replaces all the values of a match assertion for all project REST tests. * For example "match":{"_type": "foo"} to "match":{"_type": "bar"} @@ -136,10 +180,11 @@ public void replaceValueInMatch(String subKey, Object value, String testName) { /** * A transformation to replace the key in a do section. + * + * @param oldKeyName the key name directly under do to replace. + * @param newKeyName the new key name directly under do. + * @param testName the testName to apply replacement * @see ReplaceKeyInDo - * @param oldKeyName the key name directly under do to replace. - * @param newKeyName the new key name directly under do. - * @param testName the testName to apply replacement */ public void replaceKeyInDo(String oldKeyName, String newKeyName, String testName) { transformations.add(new ReplaceKeyInDo(oldKeyName, newKeyName, testName)); @@ -147,9 +192,10 @@ public void replaceKeyInDo(String oldKeyName, String newKeyName, String testName /** * A transformation to replace the key in a do section for given REST test. + * + * @param oldKeyName the key name directly under do to replace. + * @param newKeyName the new key name directly under do. * @see ReplaceKeyInDo - * @param oldKeyName the key name directly under do to replace. - * @param newKeyName the new key name directly under do. */ public void replaceKeyInDo(String oldKeyName, String newKeyName) { transformations.add(new ReplaceKeyInDo(oldKeyName, newKeyName, null)); @@ -157,9 +203,10 @@ public void replaceKeyInDo(String oldKeyName, String newKeyName) { /** * A transformation to replace the key in a length assertion. + * + * @param oldKeyName the key name directly under length to replace. + * @param newKeyName the new key name directly under length. * @see ReplaceKeyInLength - * @param oldKeyName the key name directly under length to replace. - * @param newKeyName the new key name directly under length. */ public void replaceKeyInLength(String oldKeyName, String newKeyName) { transformations.add(new ReplaceKeyInLength(oldKeyName, newKeyName, null)); @@ -179,6 +226,7 @@ public void replaceValueInLength(String subKey, int value) { /** * Replaces all the values of a length assertion for the given REST test. * For example "length":{"x": 1} to "length":{"x": 99} + * * @param subKey the key name directly under match to replace. For example "x" * @param value the value used in the replacement. For example 99 * @param testName the testName to apply replacement @@ -189,9 +237,10 @@ public void replaceValueInLength(String subKey, int value, String testName) { /** * A transformation to replace the key in a match assertion. + * + * @param oldKeyName the key name directly under match to replace. + * @param newKeyName the new key name directly under match. * @see ReplaceKeyInMatch - * @param oldKeyName the key name directly under match to replace. - * @param newKeyName the new key name directly under match. */ public void replaceKeyInMatch(String oldKeyName, String newKeyName) { transformations.add(new ReplaceKeyInMatch(oldKeyName, newKeyName, null)); @@ -202,7 +251,7 @@ public void replaceKeyInMatch(String oldKeyName, String newKeyName) { * For example "is_true": "value_to_replace" to "is_true": "value_replaced" * * @param oldValue the value that has to match and will be replaced - * @param newValue the value used in the replacement + * @param newValue the value used in the replacement */ public void replaceIsTrue(String oldValue, Object newValue) { transformations.add(new ReplaceIsTrue(oldValue, MAPPER.convertValue(newValue, TextNode.class))); @@ -213,7 +262,7 @@ public void replaceIsTrue(String oldValue, Object newValue) { * For example "is_false": "value_to_replace" to "is_false": "value_replaced" * * @param oldValue the value that has to match and will be replaced - * @param newValue the value used in the replacement + * @param newValue the value used in the replacement */ public void replaceIsFalse(String oldValue, Object newValue) { transformations.add(new ReplaceIsFalse(oldValue, MAPPER.convertValue(newValue, TextNode.class))); @@ -224,8 +273,8 @@ public void replaceIsFalse(String oldValue, Object newValue) { * For example "is_false": "value_to_replace" to "is_false": "value_replaced" * * @param oldValue the value that has to match and will be replaced - * @param newValue the value used in the replacement - @param testName the testName to apply replacement + * @param newValue the value used in the replacement + * @param testName the testName to apply replacement */ public void replaceIsFalse(String oldValue, Object newValue, String testName) { transformations.add(new ReplaceIsFalse(oldValue, MAPPER.convertValue(newValue, TextNode.class), testName)); @@ -235,9 +284,9 @@ public void replaceIsFalse(String oldValue, Object newValue, String testName) { * Replaces all the values of a given key/value pairs for all project REST tests. * For example "foo": "bar" can replaced as "foo": "baz" * - * @param key the key to find + * @param key the key to find * @param oldValue the value of that key to find - * @param newValue the value used in the replacement + * @param newValue the value used in the replacement */ public void replaceValueTextByKeyValue(String key, String oldValue, Object newValue) { transformations.add(new ReplaceTextual(key, oldValue, MAPPER.convertValue(newValue, TextNode.class))); @@ -247,9 +296,9 @@ public void replaceValueTextByKeyValue(String key, String oldValue, Object newVa * Replaces all the values of a given key/value pairs for given REST test. * For example "foo": "bar" can replaced as "foo": "baz" * - * @param key the key to find + * @param key the key to find * @param oldValue the value of that key to find - * @param newValue the value used in the replacement + * @param newValue the value used in the replacement * @param testName the testName to apply replacement */ public void replaceValueTextByKeyValue(String key, String oldValue, Object newValue, String testName) { @@ -293,6 +342,7 @@ public void addMatch(String subKey, Object value, String testName) { /** * Adds one or more warnings to the given test + * * @param testName the test name to add the warning * @param warnings the warning(s) to add */ @@ -302,7 +352,8 @@ public void addWarning(String testName, String... warnings) { /** * Adds one or more regex warnings to the given test - * @param testName the test name to add the regex warning + * + * @param testName the test name to add the regex warning * @param warningsRegex the regex warning(s) to add */ public void addWarningRegex(String testName, String... warningsRegex) { @@ -311,6 +362,7 @@ public void addWarningRegex(String testName, String... warningsRegex) { /** * Removes one or more warnings + * * @param warnings the warning(s) to remove */ public void removeWarning(String... warnings) { @@ -319,6 +371,7 @@ public void removeWarning(String... warnings) { /** * Removes one or more warnings + * * @param warnings the warning(s) to remove * @param testName the test name to remove the warning */ @@ -328,6 +381,7 @@ public void removeWarningForTest(String warnings, String testName) { /** * Adds one or more allowed warnings + * * @param allowedWarnings the warning(s) to add */ public void addAllowedWarning(String... allowedWarnings) { @@ -336,6 +390,7 @@ public void addAllowedWarning(String... allowedWarnings) { /** * Adds one or more allowed regular expression warnings + * * @param allowedWarningsRegex the regex warning(s) to add */ public void addAllowedWarningRegex(String... allowedWarningsRegex) { @@ -344,6 +399,7 @@ public void addAllowedWarningRegex(String... allowedWarningsRegex) { /** * Adds one or more allowed regular expression warnings + * * @param allowedWarningsRegex the regex warning(s) to add * @testName the test name to add a allowedWarningRegex */ @@ -367,12 +423,44 @@ public void transform() throws IOException { // clean the output directory to ensure no stale files persist fileSystemOperations.delete(d -> d.delete(outputDirectory)); + Map skippedFilesWithReason = new HashMap<>(); + skippedTestByFilePatternTransformations.forEach((filePattern, reason) -> { + //resolve file pattern to concrete files + for (File file : getTestFiles().matching(filePattern).getFiles()) { + skippedFilesWithReason.put(file, reason); + } + }); + + Map>> skippedFilesWithTestAndReason = new HashMap<>(); + skippedTestByTestNameTransformations.forEach((filePattern, testWithReason) -> { + //resolve file pattern to concrete files + for (File file : getTestFiles().matching(filePattern).getFiles()) { + skippedFilesWithTestAndReason.put(file, testWithReason); + } + }); + RestTestTransformer transformer = new RestTestTransformer(); // TODO: instead of flattening the FileTree here leverage FileTree.visit() so we can preserve folder hierarchy in a more robust way for (File file : getTestFiles().getFiles()) { YAMLParser yamlParser = YAML_FACTORY.createParser(file); List tests = READER.readValues(yamlParser).readAll(); - List transformRestTests = transformer.transformRestTests(new LinkedList<>(tests), transformations); + List transformRestTests; + if (skippedFilesWithReason.containsKey(file)) { + //skip all the tests in the file + transformRestTests = transformer.transformRestTests(new LinkedList<>(tests), + Collections.singletonList(new Skip(skippedFilesWithReason.get(file)))); + } else { + if (skippedFilesWithTestAndReason.containsKey(file)) { + //skip the named tests for this file + skippedFilesWithTestAndReason.get(file).forEach(fullTestNameAndReasonPair -> { + String prefix = file.getName().replace(".yml", "/"); + String singleTestName = fullTestNameAndReasonPair.getLeft().replaceAll(".*" + prefix, ""); + transformations.add(new Skip(singleTestName, fullTestNameAndReasonPair.getRight())); + }); + } + transformRestTests = transformer.transformRestTests(new LinkedList<>(tests), transformations); + } + // convert to url to ensure forward slashes String[] testFileParts = file.toURI().toURL().getPath().split(REST_TEST_PREFIX); if (testFileParts.length != 2) { @@ -397,4 +485,19 @@ public DirectoryProperty getSourceDirectory() { public List> getTransformations() { return transformations; } + + @Input + public String getSkippedTestByFilePatternTransformations() { + return skippedTestByFilePatternTransformations.keySet().stream() + .map(key -> String.join(",", key.getIncludes()) + skippedTestByFilePatternTransformations.get(key)) + .collect(Collectors.joining()); + } + + @Input + public String getSkippedTestByTestNameTransformations() { + + return skippedTestByTestNameTransformations.keySet().stream() + .map(key -> String.join(",", key.getIncludes()) + skippedTestByTestNameTransformations.get(key)) + .collect(Collectors.joining()); + } } diff --git a/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/transform/skip/Skip.java b/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/transform/skip/Skip.java new file mode 100644 index 0000000000000..8b8b021f7ecc4 --- /dev/null +++ b/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/transform/skip/Skip.java @@ -0,0 +1,117 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.gradle.internal.test.rest.transform.skip; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ArrayNode; +import com.fasterxml.jackson.databind.node.JsonNodeFactory; +import com.fasterxml.jackson.databind.node.ObjectNode; +import com.fasterxml.jackson.databind.node.TextNode; + +import org.elasticsearch.gradle.internal.test.rest.transform.RestTestTransform; +import org.elasticsearch.gradle.internal.test.rest.transform.RestTestTransformByParentObject; +import org.elasticsearch.gradle.internal.test.rest.transform.RestTestTransformGlobalSetup; +import org.elasticsearch.gradle.internal.test.rest.transform.feature.FeatureInjector; +import org.gradle.api.tasks.Input; +import org.gradle.api.tasks.Internal; +import org.jetbrains.annotations.Nullable; + +import java.util.Iterator; +import java.util.Map; +import java.util.Set; +import java.util.function.Function; + +/** + * A {@link RestTestTransform} that injects a skip into a REST test. + */ +public class Skip implements RestTestTransformGlobalSetup, RestTestTransformByParentObject { + + private static JsonNodeFactory jsonNodeFactory = JsonNodeFactory.withExactBigDecimals(false); + + private final String skipReason; + private final String testName; + + public Skip(String testName, String skipReason) { + this.skipReason = skipReason; + this.testName = testName; + } + + public Skip(String skipReason) { + this.skipReason = skipReason; + this.testName = ""; + } + + @Override + public ObjectNode transformSetup(@Nullable ObjectNode setupNodeParent) { + // only transform the global setup if there is no named test + if (testName.isBlank()) { + ArrayNode setupNode; + if (setupNodeParent == null) { + setupNodeParent = new ObjectNode(jsonNodeFactory); + setupNode = new ArrayNode(jsonNodeFactory); + setupNodeParent.set("setup", setupNode); + } + setupNode = (ArrayNode) setupNodeParent.get("setup"); + addSkip(setupNode); + } + return setupNodeParent; + } + + private void addSkip(ArrayNode skipParent) { + Iterator skipParentIt = skipParent.elements(); + boolean found = false; + while (skipParentIt.hasNext()) { + JsonNode arrayEntry = skipParentIt.next(); + if (arrayEntry.isObject()) { + ObjectNode skipCandidate = (ObjectNode) arrayEntry; + if (skipCandidate.get("skip") != null) { + ObjectNode skipNode = (ObjectNode) skipCandidate.get("skip"); + skipNode.replace("version", TextNode.valueOf("all")); + skipNode.replace("reason", TextNode.valueOf(skipReason)); + found = true; + break; + } + } + + } + + if (found == false) { + ObjectNode skipNode = new ObjectNode(jsonNodeFactory); + skipParent.insert(0, skipNode); + ObjectNode skipChild = new ObjectNode(jsonNodeFactory); + skipChild.set("version", TextNode.valueOf("all")); + skipChild.set("reason", TextNode.valueOf(skipReason)); + skipNode.set("skip", skipChild); + } + } + + + @Override + public void transformTest(ObjectNode parent) { + if (testName.isBlank() == false) { + assert parent.get(testName) instanceof ArrayNode; + addSkip((ArrayNode) parent.get(testName)); + } + } + + @Override + public String getKeyToFind() { + return testName; + } + + @Input + public String getSkipReason() { + return skipReason; + } + + @Input + public String getTestName() { + return testName; + } +} diff --git a/build-tools-internal/src/test/java/org/elasticsearch/gradle/internal/test/rest/transform/skip/SkipTests.java b/build-tools-internal/src/test/java/org/elasticsearch/gradle/internal/test/rest/transform/skip/SkipTests.java new file mode 100644 index 0000000000000..db01db056dffe --- /dev/null +++ b/build-tools-internal/src/test/java/org/elasticsearch/gradle/internal/test/rest/transform/skip/SkipTests.java @@ -0,0 +1,105 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.gradle.internal.test.rest.transform.skip; + +import com.fasterxml.jackson.databind.node.ObjectNode; + +import org.elasticsearch.gradle.internal.test.rest.transform.AssertObjectNodes; +import org.elasticsearch.gradle.internal.test.rest.transform.RestTestTransform; +import org.elasticsearch.gradle.internal.test.rest.transform.TransformTests; +import org.elasticsearch.gradle.internal.test.rest.transform.match.ReplaceKeyInMatch; +import org.junit.Test; + +import java.util.Collections; +import java.util.List; + +public class SkipTests extends TransformTests { + + + @Test + public void testAddGlobalSetup() throws Exception { + String test_original = "/rest/transform/skip/without_setup_original.yml"; + List tests = getTests(test_original); + + String test_transformed = "/rest/transform/skip/without_setup_transformed.yml"; + List expectedTransformation = getTests(test_transformed); + + List transformedTests = transformTests( + tests, + Collections.singletonList(new Skip("my reason")) + ); + + AssertObjectNodes.areEqual(transformedTests, expectedTransformation); + } + + @Test + public void testModifyGlobalSetupWithSkip() throws Exception { + String test_original = "/rest/transform/skip/without_setup_original.yml"; + List tests = getTests(test_original); + + String test_transformed = "/rest/transform/skip/without_setup_transformed.yml"; + List expectedTransformation = getTests(test_transformed); + + List transformedTests = transformTests( + tests, + Collections.singletonList(new Skip("my reason")) + ); + + AssertObjectNodes.areEqual(transformedTests, expectedTransformation); + } + + @Test + public void testModifyGlobalSetupWithoutSkip() throws Exception { + String test_original = "/rest/transform/skip/with_setup_no_skip_original.yml"; + List tests = getTests(test_original); + + String test_transformed = "/rest/transform/skip/with_setup_no_skip_transformed.yml"; + List expectedTransformation = getTests(test_transformed); + + List transformedTests = transformTests( + tests, + Collections.singletonList(new Skip("my reason")) + ); + + AssertObjectNodes.areEqual(transformedTests, expectedTransformation); + } + + @Test + public void testModifyGlobalSetupWithFeatures() throws Exception { + String test_original = "/rest/transform/skip/with_features_original.yml"; + List tests = getTests(test_original); + + String test_transformed = "/rest/transform/skip/with_features_transformed.yml"; + List expectedTransformation = getTests(test_transformed); + + List transformedTests = transformTests( + tests, + Collections.singletonList(new Skip("my reason")) + ); + + AssertObjectNodes.areEqual(transformedTests, expectedTransformation); + } + + @Test + public void testModifyPerTestSetup() throws Exception { + String test_original = "/rest/transform/skip/per_test_original.yml"; + List tests = getTests(test_original); + + String test_transformed = "/rest/transform/skip/per_test_transformed.yml"; + List expectedTransformation = getTests(test_transformed); + + List transformedTests = transformTests( + tests, + List.of(new Skip("Two Test", "my reason"), new Skip("Three Test", "another reason")) + ); + + AssertObjectNodes.areEqual(transformedTests, expectedTransformation); + } + +} diff --git a/build-tools-internal/src/test/resources/rest/transform/skip/per_test_original.yml b/build-tools-internal/src/test/resources/rest/transform/skip/per_test_original.yml new file mode 100644 index 0000000000000..083e72ec77024 --- /dev/null +++ b/build-tools-internal/src/test/resources/rest/transform/skip/per_test_original.yml @@ -0,0 +1,18 @@ +--- +"One Test": + - do: + something: + id: "something1" + - match: { acknowledged: true } +--- +"Two Test": + - do: + something: + id: "something2" + - match: { acknowledged: true } +--- +"Three Test": + - do: + something: + id: "something3" + - match: { acknowledged: true } diff --git a/build-tools-internal/src/test/resources/rest/transform/skip/per_test_transformed.yml b/build-tools-internal/src/test/resources/rest/transform/skip/per_test_transformed.yml new file mode 100644 index 0000000000000..5d78485004390 --- /dev/null +++ b/build-tools-internal/src/test/resources/rest/transform/skip/per_test_transformed.yml @@ -0,0 +1,24 @@ +--- +"One Test": + - do: + something: + id: "something1" + - match: { acknowledged: true } +--- +"Two Test": + - skip: + version: "all" + reason: "my reason" + - do: + something: + id: "something2" + - match: { acknowledged: true } +--- +"Three Test": + - skip: + version: "all" + reason: "another reason" + - do: + something: + id: "something3" + - match: { acknowledged: true } diff --git a/build-tools-internal/src/test/resources/rest/transform/skip/with_features_original.yml b/build-tools-internal/src/test/resources/rest/transform/skip/with_features_original.yml new file mode 100644 index 0000000000000..0d0ee965178e9 --- /dev/null +++ b/build-tools-internal/src/test/resources/rest/transform/skip/with_features_original.yml @@ -0,0 +1,13 @@ +--- +setup: + - skip: + features: + - pre_existing_feature1 + - pre_existing_feature2 +--- +"Test with multiple feature setup": + - do: + something: + id: "something" + - match: { acknowledged: true } + diff --git a/build-tools-internal/src/test/resources/rest/transform/skip/with_features_transformed.yml b/build-tools-internal/src/test/resources/rest/transform/skip/with_features_transformed.yml new file mode 100644 index 0000000000000..4aa1520aebb13 --- /dev/null +++ b/build-tools-internal/src/test/resources/rest/transform/skip/with_features_transformed.yml @@ -0,0 +1,15 @@ +--- +setup: + - skip: + features: + - pre_existing_feature1 + - pre_existing_feature2 + version: "all" + reason: "my reason" +--- +"Test with multiple feature setup": + - do: + something: + id: "something" + - match: { acknowledged: true } + diff --git a/build-tools-internal/src/test/resources/rest/transform/skip/with_setup_no_skip_original.yml b/build-tools-internal/src/test/resources/rest/transform/skip/with_setup_no_skip_original.yml new file mode 100644 index 0000000000000..8f196575cb56a --- /dev/null +++ b/build-tools-internal/src/test/resources/rest/transform/skip/with_setup_no_skip_original.yml @@ -0,0 +1,13 @@ +--- +setup: + - do: + some.setup: + index: blah +--- +"Test with setup but no skip (and by inference no features)": + - do: + something: + id: "something" + - match: { acknowledged: true } + + diff --git a/build-tools-internal/src/test/resources/rest/transform/skip/with_setup_no_skip_transformed.yml b/build-tools-internal/src/test/resources/rest/transform/skip/with_setup_no_skip_transformed.yml new file mode 100644 index 0000000000000..71f28c6693694 --- /dev/null +++ b/build-tools-internal/src/test/resources/rest/transform/skip/with_setup_no_skip_transformed.yml @@ -0,0 +1,16 @@ +--- +setup: + - skip: + version: "all" + reason: "my reason" + - do: + some.setup: + index: blah +--- +"Test with setup but no skip (and by inference no features)": + - do: + something: + id: "something" + - match: { acknowledged: true } + + diff --git a/build-tools-internal/src/test/resources/rest/transform/skip/with_skip_original.yml b/build-tools-internal/src/test/resources/rest/transform/skip/with_skip_original.yml new file mode 100644 index 0000000000000..f096848f2a659 --- /dev/null +++ b/build-tools-internal/src/test/resources/rest/transform/skip/with_skip_original.yml @@ -0,0 +1,13 @@ +--- +setup: + - skip: + version: " - 7.1.99" + reason: why not +--- +"Test with setup and skip but no feature": + - do: + something: + id: "something" + - match: { acknowledged: true } + + diff --git a/build-tools-internal/src/test/resources/rest/transform/skip/with_skip_transformed.yml b/build-tools-internal/src/test/resources/rest/transform/skip/with_skip_transformed.yml new file mode 100644 index 0000000000000..3427108591e0e --- /dev/null +++ b/build-tools-internal/src/test/resources/rest/transform/skip/with_skip_transformed.yml @@ -0,0 +1,13 @@ +--- +setup: + - skip: + version: "all" + reason: "my reason" +--- +"Test with setup and skip but no feature": + - do: + something: + id: "something" + - match: { acknowledged: true } + + diff --git a/build-tools-internal/src/test/resources/rest/transform/skip/without_setup_original.yml b/build-tools-internal/src/test/resources/rest/transform/skip/without_setup_original.yml new file mode 100644 index 0000000000000..4c414c847308f --- /dev/null +++ b/build-tools-internal/src/test/resources/rest/transform/skip/without_setup_original.yml @@ -0,0 +1,7 @@ +--- +"Test without a setup": + - do: + something: + id: "something" + - match: { acknowledged: true } + diff --git a/build-tools-internal/src/test/resources/rest/transform/skip/without_setup_transformed.yml b/build-tools-internal/src/test/resources/rest/transform/skip/without_setup_transformed.yml new file mode 100644 index 0000000000000..e75882adb37fc --- /dev/null +++ b/build-tools-internal/src/test/resources/rest/transform/skip/without_setup_transformed.yml @@ -0,0 +1,11 @@ +setup: + - skip: + version: "all" + reason: "my reason" +--- +"Test without a setup": + - do: + something: + id: "something" + - match: { acknowledged: true } + diff --git a/modules/analysis-common/build.gradle b/modules/analysis-common/build.gradle index 702f32ca8d199..dbb8ce0f1ab0e 100644 --- a/modules/analysis-common/build.gradle +++ b/modules/analysis-common/build.gradle @@ -25,12 +25,11 @@ dependencies { compileOnly project(':modules:lang-painless') } -tasks.named("yamlRestTestV7CompatTest").configure { - systemProperty 'tests.rest.blacklist', [ - //marked as not needing compatible api - 'indices.analyze/10_analyze/htmlStrip_deprecated', // Cleanup versioned deprecations in analysis #41560 - 'analysis-common/40_token_filters/delimited_payload_filter_error', //Remove preconfigured delimited_payload_filter #43686 - 'analysis-common/20_analyzers/standard_html_strip', // Cleanup versioned deprecations in analysis #41560 - 'search.query/50_queries_with_synonyms/Test common terms query with stacked tokens', // #42654 - `common` query throws an exception - ].join(',') + +tasks.named("yamlRestTestV7CompatTransform").configure { task -> + task.skipTest("indices.analyze/10_analyze/htmlStrip_deprecated", "Cleanup versioned deprecations in analysis #41560") + task.skipTest("analysis-common/40_token_filters/delimited_payload_filter_error", "Remove preconfigured delimited_payload_filter #43686") + task.skipTest("analysis-common/20_analyzers/standard_html_strip", "Cleanup versioned deprecations in analysis #41560") + task.skipTest("search.query/50_queries_with_synonyms/Test common terms query with stacked tokens", "#42654 - `common` query throws an exception") } + diff --git a/modules/percolator/build.gradle b/modules/percolator/build.gradle index 79155f5b0d5c4..785edc32c1437 100644 --- a/modules/percolator/build.gradle +++ b/modules/percolator/build.gradle @@ -24,6 +24,6 @@ restResources { } } -tasks.named("yamlRestTestV7CompatTransform").configure({ task -> +tasks.named("yamlRestTestV7CompatTransform").configure{ task -> task.addAllowedWarningRegex("\\[types removal\\].*") -}) +} diff --git a/modules/reindex/build.gradle b/modules/reindex/build.gradle index ee9945b6b2506..6eeba181cb8b9 100644 --- a/modules/reindex/build.gradle +++ b/modules/reindex/build.gradle @@ -155,13 +155,10 @@ if (Os.isFamily(Os.FAMILY_WINDOWS)) { } } } -tasks.named("yamlRestTestV7CompatTransform").configure({ task -> - task.addAllowedWarningRegex("\\[types removal\\].*") -}) - -tasks.named("yamlRestTestV7CompatTest").configure { - systemProperty 'tests.rest.blacklist', [ - 'reindex/20_validation/reindex without source gives useful error message', // exception with a type. Not much benefit adding _doc there. - 'update_by_query/20_validation/update_by_query without source gives useful error message' // exception with a type. Not much benefit adding _doc there. - ].join(',') + +tasks.named("yamlRestTestV7CompatTransform").configure { task -> + task.skipTest("reindex/20_validation/reindex without source gives useful error message", "exception with a type. Not much benefit adding _doc there.") + task.skipTest("update_by_query/20_validation/update_by_query without source gives useful error message", "exception with a type. Not much benefit adding _doc there.") + task.addAllowedWarningRegex("\\[types removal\\].*") } + diff --git a/plugins/analysis-icu/build.gradle b/plugins/analysis-icu/build.gradle index 46961cf7a0218..05a741fe51793 100644 --- a/plugins/analysis-icu/build.gradle +++ b/plugins/analysis-icu/build.gradle @@ -34,9 +34,8 @@ restResources { tasks.named("dependencyLicenses").configure { mapping from: /lucene-.*/, to: 'lucene' } -tasks.named("yamlRestTestV7CompatTest").configure { - systemProperty 'tests.rest.blacklist', [ - //marked as not needing compatible api - 'analysis_icu/10_basic/Normalization with deprecated unicodeSetFilter' // Cleanup versioned deprecations in analysis #41560 - ].join(',') + +tasks.named("yamlRestTestV7CompatTransform").configure { task -> + task.skipTest("analysis_icu/10_basic/Normalization with deprecated unicodeSetFilter", "Cleanup versioned deprecations in analysis #41560") } + diff --git a/rest-api-spec/build.gradle b/rest-api-spec/build.gradle index 93eb63e2ab758..48c87321e9aaa 100644 --- a/rest-api-spec/build.gradle +++ b/rest-api-spec/build.gradle @@ -42,71 +42,46 @@ testClusters.configureEach { tasks.named("test").configure { enabled = false } tasks.named("jarHell").configure { enabled = false } -tasks.named("yamlRestTestV7CompatTest").configure { - systemProperty 'tests.rest.blacklist', [ - // Cat API are meant to be consumed by humans, so will not be supported by Compatible REST API - 'cat*/*/*', - // type information about the type is removed and not passed down. The logic to check for this is also removed. - 'delete/70_mix_typeless_typeful/DELETE with typeless API on an index that has types', - // WILL NOT BE FIXED - failing due to not recognising missing type (the type path param is ignored) - 'get/100_mix_typeless_typeful/GET with typeless API on an index that has types', - // type information about the type is removed and not passed down. The logic to check for this is also removed. - 'indices.create/20_mix_typeless_typeful/Implicitly create a typed index while there is a typeless template', - 'indices.create/20_mix_typeless_typeful/Implicitly create a typeless index while there is a typed template', - // - // This test returns test_index.mappings:{} when {} was expected. difference between 20_missing_field and 21_missing_field_with_types? - 'indices.get_field_mapping/21_missing_field_with_types/Return empty object if field doesn\'t exist, but type and index do', - // The information about the type is not present in the index. hence it cannot know if the type exist or not. - 'indices.get_field_mapping/30_missing_type/Raise 404 when type doesn\'t exist', - // The information about the type is not present in the index. hence it cannot know if the type exist or not. - 'indices.get_mapping/20_missing_type/Existent and non-existent type returns 404 and the existing type', - 'indices.get_mapping/20_missing_type/Existent and non-existent types returns 404 and the existing type', - 'indices.get_mapping/20_missing_type/No type matching pattern returns 404', - 'indices.get_mapping/20_missing_type/Non-existent type returns 404', - 'indices.get_mapping/20_missing_type/Type missing when no types exist', - // - // The information about the type is not present in the index. hence it cannot know if the type was already used or not - 'indices.put_mapping/20_mix_typeless_typeful/PUT mapping with _doc on an index that has types', - 'indices.put_mapping/20_mix_typeless_typeful/PUT mapping with typeless API on an index that has types', - // there is a small distinction between empty mappings and no mappings at all. The code to implement this test was refactored #54003 - // field search on _type field- not implementing. The data for _type is considered incorrect in this search - 'search/160_exists_query/Test exists query on _type field', - //type information is not stored, hence the the index will be found - 'termvectors/50_mix_typeless_typeful/Term vectors with typeless API on an index that has types', - // mget - these use cases are no longer valid, because we always default to _doc. - // This mean test cases where there is assertion on not finging by type won't work - 'mget/11_default_index_type/Default index/type', - 'mget/16_basic_with_types/Basic multi-get', - // asserting about type not found won't work as we ignore the type information - 'explain/40_mix_typeless_typeful/Explain with typeless API on an index that has types', - // translog settings removal is not supported under compatible api - 'indices.stats/20_translog/Translog retention settings are deprecated', - 'indices.stats/20_translog/Translog retention without soft_deletes', - 'indices.stats/20_translog/Translog stats on closed indices without soft-deletes', - // field usage results will be different between lucene versions - 'indices.stats/60_field_usage/*', +tasks.named("yamlRestTestV7CompatTransform").configure { task -> + + task.skipTestsByFilePattern("**/cat*/*.yml", "Cat API are meant to be consumed by humans, so will not be supported by Compatible REST API") + task.skipTestsByFilePattern("**/indices.upgrade/*.yml", "upgrade api will only get a dummy endpoint returning an exception suggesting to use _reindex") + task.skipTestsByFilePattern("**/indices.stats/60_field_usage/*/*.yml", "field usage results will be different between lucene versions") + + task.skipTest("indices.create/20_mix_typeless_typeful/Implicitly create a typed index while there is a typeless template", "Type information about the type is removed and not passed down. The logic to check for this is also removed.") + task.skipTest("indices.create/20_mix_typeless_typeful/Implicitly create a typeless index while there is a typed template", "Type information about the type is removed and not passed down. The logic to check for this is also removed.") + task.skipTest("delete/70_mix_typeless_typeful/DELETE with typeless API on an index that has types", "Type information about the type is removed and not passed down. The logic to check for this is also removed."); + task.skipTest("get/100_mix_typeless_typeful/GET with typeless API on an index that has types", "Failing due to not recognising missing type (the type path param is ignored, will no be fixed"); + task.skipTest("indices.get_field_mapping/21_missing_field_with_types/Return empty object if field doesn't exist, but type and index do", "This test returns test_index.mappings:{} when {} was expected. difference between 20_missing_field and 21_missing_field_with_types?") + task.skipTest("indices.get_field_mapping/30_missing_type/Raise 404 when type doesn't exist", "The information about the type is not present in the index. hence it cannot know if the type exist or not.") + task.skipTest("indices.get_mapping/20_missing_type/Existent and non-existent type returns 404 and the existing type", " The information about the type is not present in the index. hence it cannot know if the type exist or not") + task.skipTest("indices.get_mapping/20_missing_type/Existent and non-existent types returns 404 and the existing type", "The information about the type is not present in the index. hence it cannot know if the type exist or not.") + task.skipTest("indices.get_mapping/20_missing_type/No type matching pattern returns 404", "The information about the type is not present in the index. hence it cannot know if the type exist or not.") + task.skipTest("indices.get_mapping/20_missing_type/Non-existent type returns 404", "The information about the type is not present in the index. hence it cannot know if the type exist or not.") + task.skipTest("indices.get_mapping/20_missing_type/Type missing when no types exist", "The information about the type is not present in the index. hence it cannot know if the type exist or not.") + task.skipTest("indices.put_mapping/20_mix_typeless_typeful/PUT mapping with _doc on an index that has types", "The information about the type is not present in the index. hence it cannot know if the type was already used or not") + task.skipTest("indices.put_mapping/20_mix_typeless_typeful/PUT mapping with typeless API on an index that has types", "The information about the type is not present in the index. hence it cannot know if the type was already used or not") + task.skipTest("search/160_exists_query/Test exists query on _type field", "There is a small distinction between empty mappings and no mappings at all. The code to implement this test was refactored #54003; field search on _type field- not implementing. The data for _type is considered incorrect in this search") + task.skipTest("termvectors/50_mix_typeless_typeful/Term vectors with typeless API on an index that has types", "type information is not stored, hence the the index will be found") + task.skipTest("mget/11_default_index_type/Default index/type", "mget - these use cases are no longer valid because we always default to _doc.; This mean test cases where there is assertion on not finding by type won't work") + task.skipTest("mget/16_basic_with_types/Basic multi-get", "mget - these use cases are no longer valid, because we always default to _doc.; This mean test cases where there is assertion on not finding by type won't work") + task.skipTest("explain/40_mix_typeless_typeful/Explain with typeless API on an index that has types", "asserting about type not found won't work as we ignore the type information") + task.skipTest("indices.stats/20_translog/Translog retention settings are deprecated", "translog settings removal is not supported under compatible api") + task.skipTest("indices.stats/20_translog/Translog retention without soft_deletes", "translog settings removal is not supported under compatible api") + task.skipTest("indices.stats/20_translog/Translog stats on closed indices without soft-deletes", "translog settings removal is not supported under compatible api") + task.skipTest("search.aggregation/370_doc_count_field/Test filters agg with doc_count", "Uses profiler for assertions which is not backwards compatible") + task.skipTest("indices.create/10_basic/Create index without soft deletes", "Make soft-deletes mandatory in 8.0 #51122 - settings changes are note supported in Rest Api compatibility") + task.skipTest("field_caps/30_filter/Field caps with index filter", "behaviour change after #63692 4digits dates are parsed as epoch and in quotes as year") + task.skipTest("indices.forcemerge/10_basic/Check deprecation warning when incompatible only_expunge_deletes and max_num_segments values are both set", "#44761 bug fix") + task.skipTest("search/340_type_query/type query", "#47207 type query throws exception in compatible mode") + task.skipTest("search.aggregation/200_top_hits_metric/top_hits aggregation with sequence numbers", "#42809 the use nested path and filter sort throws an exception") + task.skipTest("search/310_match_bool_prefix/multi_match multiple fields with cutoff_frequency throws exception", "#42654 cutoff_frequency, common terms are not supported. Throwing an exception") + task.skipTest("search.aggregation/20_terms/string profiler via global ordinals filters implementation", "The profiler results aren't backwards compatible.") + task.skipTest("search.aggregation/20_terms/string profiler via global ordinals native implementation", "The profiler results aren't backwards compatible.") + task.skipTest("search.aggregation/20_terms/string profiler via map", "The profiler results aren't backwards compatible.") + task.skipTest("search.aggregation/20_terms/numeric profiler", "The profiler results aren't backwards compatible.") - // upgrade api will only get a dummy endpoint returning an exception suggesting to use _reindex - 'indices.upgrade/*/*', - - - 'search.aggregation/20_terms/*profiler*', // The profiler results aren't backwards compatible. - 'search.aggregation/370_doc_count_field/Test filters agg with doc_count', // Uses profiler for assertions which is not backwards compatible - - 'indices.create/10_basic/Create index without soft deletes', //Make soft-deletes mandatory in 8.0 #51122 - settings changes are note supported in Rest Api compatibility - - 'field_caps/30_filter/Field caps with index filter', //behaviour change after #63692 4digits dates are parsed as epoch and in quotes as year - - 'indices.forcemerge/10_basic/Check deprecation warning when incompatible only_expunge_deletes and max_num_segments values are both set', //#44761 bug fix, - - 'search/340_type_query/type query', //#47207 type query throws exception in compatible mode - 'search.aggregation/200_top_hits_metric/top_hits aggregation with sequence numbers', // #42809 the use nested path and filter sort throws an exception - 'search/310_match_bool_prefix/multi_match multiple fields with cutoff_frequency throws exception', //#42654 cutoff_frequency, common terms are not supported. Throwing an exception - ].join(',') -} - -tasks.named("yamlRestTestV7CompatTransform").configure({ task -> task.replaceValueInMatch("_type", "_doc") task.addAllowedWarningRegex("\\[types removal\\].*") task.replaceValueInMatch("nodes.\$node_id.roles.8", "ml", "node_info role test") @@ -241,7 +216,7 @@ tasks.named("yamlRestTestV7CompatTransform").configure({ task -> // sync_id is no longer available in SegmentInfos.userData // "indices.flush/10_basic/Index synced flush rest test" task.replaceIsTrue("indices.testing.shards.0.0.commit.user_data.sync_id", "indices.testing.shards.0.0.commit.user_data") -}) +} tasks.register('enforceYamlTestConvention').configure { doLast { diff --git a/x-pack/plugin/build.gradle b/x-pack/plugin/build.gradle index 8c58b406cc37d..14cfadc6aa6e4 100644 --- a/x-pack/plugin/build.gradle +++ b/x-pack/plugin/build.gradle @@ -90,7 +90,32 @@ tasks.named("yamlRestTest").configure { dependsOn "copyExtraResources" } -tasks.named("yamlRestTestV7CompatTransform").configure({ task -> +tasks.named("yamlRestTestV7CompatTransform").configure{ task -> + task.skipTest("vectors/10_dense_vector_basic/Deprecated function signature", "to support it, it would require to almost revert back the #48725 and complicate the code" ) + task.skipTest("vectors/30_sparse_vector_basic/Cosine Similarity", "not supported for compatibility") + task.skipTest("vectors/30_sparse_vector_basic/Deprecated function signature", "not supported for compatibility") + task.skipTest("vectors/30_sparse_vector_basic/Dot Product", "not supported for compatibility") + task.skipTest("vectors/35_sparse_vector_l1l2/L1 norm", "not supported for compatibility") + task.skipTest("vectors/35_sparse_vector_l1l2/L2 norm", "not supported for compatibility") + task.skipTest("vectors/40_sparse_vector_special_cases/Dimensions can be sorted differently", "not supported for compatibility") + task.skipTest("vectors/40_sparse_vector_special_cases/Documents missing a vector field", "not supported for compatibility") + task.skipTest("vectors/40_sparse_vector_special_cases/Query vector has different dimensions from documents' vectors", "not supported for compatibility") + task.skipTest("vectors/40_sparse_vector_special_cases/Sparse vectors should error with dense vector functions", "not supported for compatibility") + task.skipTest("vectors/40_sparse_vector_special_cases/Vectors of different dimensions and data types", "not supported for compatibility") + task.skipTest("vectors/50_vector_stats/Usage stats on vector fields", "not supported for compatibility") + task.skipTest("roles/30_prohibited_role_query/Test use prohibited query inside role query", "put role request with a term lookup (deprecated) and type. Requires validation in REST layer") + task.skipTest("ml/jobs_crud/Test create job with delimited format", "removing undocumented functionality") + task.skipTest("ml/datafeeds_crud/Test update datafeed to point to missing job", "behaviour change #44752 - not allowing to update datafeed job_id") + task.skipTest("ml/datafeeds_crud/Test update datafeed to point to different job", "behaviour change #44752 - not allowing to update datafeed job_id") + task.skipTest("ml/datafeeds_crud/Test update datafeed to point to job already attached to another datafeed", "behaviour change #44752 - not allowing to update datafeed job_id") + task.skipTest("rollup/delete_job/Test basic delete_job", "rollup was an experimental feature, also see #41227") + task.skipTest("rollup/delete_job/Test delete job twice", "rollup was an experimental feature, also see #41227") + task.skipTest("rollup/delete_job/Test delete running job", "rollup was an experimental feature, also see #41227") + task.skipTest("rollup/get_jobs/Test basic get_jobs", "rollup was an experimental feature, also see #41227") + task.skipTest("rollup/put_job/Test basic put_job", "rollup was an experimental feature, also see #41227") + task.skipTest("rollup/start_job/Test start job twice", "rollup was an experimental feature, also see #41227") + task.skipTest("ml/trained_model_cat_apis/Test cat trained models", "A type field was added to cat.ml_trained_models #73660, this is a backwards compatible change. Still this is a cat api, and we don't support them with rest api compatibility. (the test would be very hard to transform too)") + task.replaceKeyInDo("license.delete", "xpack-license.delete") task.replaceKeyInDo("license.get", "xpack-license.get") task.replaceKeyInDo("license.get_basic_status", "xpack-license.get_basic_status") @@ -164,50 +189,9 @@ tasks.named("yamlRestTestV7CompatTransform").configure({ task -> task.replaceValueInMatch("_type", "_doc") task.addAllowedWarningRegex("\\[types removal\\].*") task.addAllowedWarningRegexForTest("Including \\[accept_enterprise\\] in get license.*", "Installing enterprise license") -}) -tasks.named("yamlRestTestV7CompatTest").configure { - systemProperty 'tests.rest.blacklist', [ - // to support it, it would require to almost revert back the #48725 and complicate the code - 'vectors/10_dense_vector_basic/Deprecated function signature', - // not going to be supported - 'vectors/30_sparse_vector_basic/Cosine Similarity', - 'vectors/30_sparse_vector_basic/Deprecated function signature', - 'vectors/30_sparse_vector_basic/Dot Product', - 'vectors/35_sparse_vector_l1l2/L1 norm', - 'vectors/35_sparse_vector_l1l2/L2 norm', - 'vectors/40_sparse_vector_special_cases/Dimensions can be sorted differently', - 'vectors/40_sparse_vector_special_cases/Documents missing a vector field', - 'vectors/40_sparse_vector_special_cases/Query vector has different dimensions from documents\' vectors', - 'vectors/40_sparse_vector_special_cases/Sparse vectors should error with dense vector functions', - 'vectors/40_sparse_vector_special_cases/Vectors of different dimensions and data types', - // the test uses sparse vector - not supported - 'vectors/50_vector_stats/Usage stats on vector fields', - - // put role request with a term lookup (deprecated) and type. Requires validation in REST layer - 'roles/30_prohibited_role_query/Test use prohibited query inside role query', - //removing undocumented functionality - 'ml/jobs_crud/Test create job with delimited format', - // behaviour change #44752 - not allowing to update datafeed job_id - 'ml/datafeeds_crud/Test update datafeed to point to missing job', - 'ml/datafeeds_crud/Test update datafeed to point to different job', - 'ml/datafeeds_crud/Test update datafeed to point to job already attached to another datafeed', - //rollup was an experimental feature - //https://github.com/elastic/elasticsearch/pull/41227. - 'rollup/delete_job/Test basic delete_job', - 'rollup/delete_job/Test delete job twice', - 'rollup/delete_job/Test delete running job', - 'rollup/get_jobs/Test basic get_jobs', - 'rollup/put_job/Test basic put_job', - //https://github.com/elastic/elasticsearch/pull/41502 - 'rollup/start_job/Test start job twice', - - // a type field was added to cat.ml_trained_models #73660, this is a backwards compatible change. - // still this is a cat api, and we don't support them with rest api compatibility. (the test would be very hard to transform too) - 'ml/trained_model_cat_apis/Test cat trained models' - ].join(',') - dependsOn "copyExtraResources" } + testClusters.configureEach { testDistribution = 'DEFAULT' // this is important since we use the reindex module in ML setting 'xpack.ml.enabled', 'true' diff --git a/x-pack/plugin/watcher/qa/rest/build.gradle b/x-pack/plugin/watcher/qa/rest/build.gradle index a4bbaa399fccc..007c11c1d4b69 100644 --- a/x-pack/plugin/watcher/qa/rest/build.gradle +++ b/x-pack/plugin/watcher/qa/rest/build.gradle @@ -35,16 +35,11 @@ if (BuildParams.inFipsJvm){ tasks.named("yamlRestTest").configure{enabled = false } } -tasks.named("yamlRestTestV7CompatTest").configure { - systemProperty 'tests.rest.blacklist', [ - // remove JodaCompatibleDateTime -- ZonedDateTime doesn't output millis/nanos if they're 0 (#78417) - 'mustache/30_search_input/Test search input mustache integration (using request body and rest_total_hits_as_int)', - 'mustache/30_search_input/Test search input mustache integration (using request body)', - 'mustache/40_search_transform/Test search transform mustache integration (using request body)' - ].join(',') -} -tasks.named("yamlRestTestV7CompatTransform").configure({ task -> +tasks.named("yamlRestTestV7CompatTransform").configure{ task -> + task.skipTest("mustache/30_search_input/Test search input mustache integration (using request body and rest_total_hits_as_int)", "remove JodaCompatibleDateTime -- ZonedDateTime doesn't output millis/nanos if they're 0 (#78417)") + task.skipTest("mustache/30_search_input/Test search input mustache integration (using request body)", "remove JodaCompatibleDateTime -- ZonedDateTime doesn't output millis/nanos if they're 0 (#78417)") + task.skipTest("mustache/40_search_transform/Test search transform mustache integration (using request body)", "remove JodaCompatibleDateTime -- ZonedDateTime doesn't output millis/nanos if they're 0 (#78417)") task.replaceKeyInDo("watcher.ack_watch", "xpack-watcher.ack_watch") task.replaceKeyInDo("watcher.activate_watch", "xpack-watcher.activate_watch") task.replaceKeyInDo("watcher.deactivate_watch", "xpack-watcher.deactivate_watch") @@ -60,5 +55,4 @@ tasks.named("yamlRestTestV7CompatTransform").configure({ task -> task.addAllowedWarningRegex("\\[types removal\\].*") task.replaceValueTextByKeyValue("path", "/my_index/my_type/{{ctx.watch_id}}", "/my_index/_doc/{{ctx.watch_id}}", "Test webhook action with mustache integration") - -}) +} From c2482e1c6830a16d3d72130d7d0365ada2e421ee Mon Sep 17 00:00:00 2001 From: Gordon Brown Date: Thu, 30 Sep 2021 10:30:56 -0600 Subject: [PATCH 086/250] Ensure sys. index patterns are transformed before use (#78492) Previously, the leading `.` at the start of system and associated index descriptor patterns was not properly replaced before being compiled as a regular expression, leading to any single-character prefix matching. This commit fixes the issue and adds tests to catch it. --- .../indices/AssociatedIndexDescriptor.java | 2 +- .../indices/SystemIndexDescriptor.java | 2 +- .../AssociatedIndexDescriptorTests.java | 21 +++++++++++++++++++ .../indices/SystemIndexDescriptorTests.java | 21 +++++++++++++++++++ 4 files changed, 44 insertions(+), 2 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/indices/AssociatedIndexDescriptor.java b/server/src/main/java/org/elasticsearch/indices/AssociatedIndexDescriptor.java index 43fc8bbd20185..a2f64f2f99d58 100644 --- a/server/src/main/java/org/elasticsearch/indices/AssociatedIndexDescriptor.java +++ b/server/src/main/java/org/elasticsearch/indices/AssociatedIndexDescriptor.java @@ -90,7 +90,7 @@ public String getDescription() { */ static Automaton buildAutomaton(String pattern) { String output = pattern; - output = output.replaceAll("\\.", "\\."); + output = output.replaceAll("\\.", "\\\\."); output = output.replaceAll("\\*", ".*"); return new RegExp(output).toAutomaton(); } diff --git a/server/src/main/java/org/elasticsearch/indices/SystemIndexDescriptor.java b/server/src/main/java/org/elasticsearch/indices/SystemIndexDescriptor.java index 930b4e7f5a0d3..f0576ce711dfc 100644 --- a/server/src/main/java/org/elasticsearch/indices/SystemIndexDescriptor.java +++ b/server/src/main/java/org/elasticsearch/indices/SystemIndexDescriptor.java @@ -683,7 +683,7 @@ static Automaton buildAutomaton(String pattern, String alias) { */ private static String patternToRegex(String input) { String output = input; - output = output.replaceAll("\\.", "\\."); + output = output.replaceAll("\\.", "\\\\."); output = output.replaceAll("\\*", ".*"); return output; } diff --git a/server/src/test/java/org/elasticsearch/indices/AssociatedIndexDescriptorTests.java b/server/src/test/java/org/elasticsearch/indices/AssociatedIndexDescriptorTests.java index fd084ef78270b..b641722c0ae21 100644 --- a/server/src/test/java/org/elasticsearch/indices/AssociatedIndexDescriptorTests.java +++ b/server/src/test/java/org/elasticsearch/indices/AssociatedIndexDescriptorTests.java @@ -8,6 +8,7 @@ package org.elasticsearch.indices; +import org.apache.lucene.util.automaton.CharacterRunAutomaton; import org.elasticsearch.test.ESTestCase; import static org.hamcrest.Matchers.containsString; @@ -55,4 +56,24 @@ public void testValidation() { assertThat(ex.getMessage(), containsString("must not start with the character sequence [.*] to prevent conflicts")); } } + + public void testSpecialCharactersAreReplacedWhenConvertingToAutomaton() { + CharacterRunAutomaton automaton = new CharacterRunAutomaton( + AssociatedIndexDescriptor.buildAutomaton(".associated-index*") + ); + + // None of these should match, ever. + assertFalse(automaton.run(".my-associated-index")); + assertFalse(automaton.run("my.associated-index")); + assertFalse(automaton.run("some-other-index")); + + // These should only fail if the trailing `*` doesn't get properly replaced with `.*` + assertTrue("if the trailing * isn't replaced, suffixes won't match properly", automaton.run(".associated-index-1")); + assertTrue("if the trailing * isn't replaced, suffixes won't match properly", automaton.run(".associated-index-asdf")); + + // These should only fail if the leading `.` doesn't get properly replaced with `\\.` + assertFalse("if the leading dot isn't replaced, it can match date math", automaton.run("")); + assertFalse("if the leading dot isn't replaced, it can match any single-char prefix", automaton.run("Oassociated-index")); + assertFalse("the leading dot got dropped", automaton.run("associated-index-1")); + } } diff --git a/server/src/test/java/org/elasticsearch/indices/SystemIndexDescriptorTests.java b/server/src/test/java/org/elasticsearch/indices/SystemIndexDescriptorTests.java index 8e203d4dbb29e..3fb93fda57ae0 100644 --- a/server/src/test/java/org/elasticsearch/indices/SystemIndexDescriptorTests.java +++ b/server/src/test/java/org/elasticsearch/indices/SystemIndexDescriptorTests.java @@ -8,6 +8,7 @@ package org.elasticsearch.indices; +import org.apache.lucene.util.automaton.CharacterRunAutomaton; import org.elasticsearch.Version; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.common.settings.Settings; @@ -256,6 +257,26 @@ public void testSystemIndicesCannotAlsoBeHidden() { assertThat(e.getMessage(), equalTo("System indices cannot have index.hidden set to true.")); } + public void testSpecialCharactersAreReplacedWhenConvertingToAutomaton() { + CharacterRunAutomaton automaton = new CharacterRunAutomaton( + SystemIndexDescriptor.buildAutomaton(".system-index*", ".system-alias") + ); + + // None of these should match, ever. + assertFalse(automaton.run(".my-system-index")); + assertFalse(automaton.run("my.system-index")); + assertFalse(automaton.run("some-other-index")); + + // These should only fail if the trailing `*` doesn't get properly replaced with `.*` + assertTrue("if the trailing * isn't replaced, suffixes won't match properly", automaton.run(".system-index-1")); + assertTrue("if the trailing * isn't replaced, suffixes won't match properly", automaton.run(".system-index-asdf")); + + // These should only fail if the leading `.` doesn't get properly replaced with `\\.` + assertFalse("if the leading dot isn't replaced, it can match date math", automaton.run("")); + assertFalse("if the leading dot isn't replaced, it can match any single-char prefix", automaton.run("Osystem-index")); + assertFalse("the leading dot got dropped", automaton.run("system-index-1")); + } + private SystemIndexDescriptor.Builder priorSystemIndexDescriptorBuilder() { return SystemIndexDescriptor.builder() .setIndexPattern(".system*") From f0ce638d1d93a3bcec648601317f437e220e3ea9 Mon Sep 17 00:00:00 2001 From: Benjamin Trent Date: Thu, 30 Sep 2021 13:06:41 -0400 Subject: [PATCH 087/250] [ML] adjust ML memory tracker to reduce logging impact (#78482) * [ML] adjust ML memory tracker to reduce logging impact * addressing PR comments Co-authored-by: Elastic Machine --- .../MlAutoscalingDeciderService.java | 6 --- .../xpack/ml/process/MlMemoryTracker.java | 46 +++++++++++++++++-- 2 files changed, 41 insertions(+), 11 deletions(-) diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/autoscaling/MlAutoscalingDeciderService.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/autoscaling/MlAutoscalingDeciderService.java index 4261808bd76a0..eeb5a08332812 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/autoscaling/MlAutoscalingDeciderService.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/autoscaling/MlAutoscalingDeciderService.java @@ -119,9 +119,6 @@ public MlAutoscalingDeciderService(MlMemoryTracker memoryTracker, Settings setti @Override public void afterStart() { running = true; - if (isMaster) { - mlMemoryTracker.asyncRefresh(); - } } @Override @@ -290,9 +287,6 @@ void setUseAuto(boolean useAuto) { @Override public void onMaster() { isMaster = true; - if (running) { - mlMemoryTracker.asyncRefresh(); - } } private void resetScaleDownCoolDown() { diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/process/MlMemoryTracker.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/process/MlMemoryTracker.java index b00e6771f9f58..aab5bd105c71f 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/process/MlMemoryTracker.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/process/MlMemoryTracker.java @@ -80,6 +80,7 @@ public class MlMemoryTracker implements LocalNodeMasterListener { private final Phaser stopPhaser; private volatile AtomicInteger phase = new AtomicInteger(0); private volatile boolean isMaster; + private volatile boolean stopped; private volatile Instant lastUpdateTime; private volatile Duration reassignmentRecheckInterval; @@ -166,6 +167,7 @@ private void clear() { * After returning, no new searches can be started. */ public void stop() { + stopped = true; logger.trace("ML memory tracker stop called"); // We never terminate the phaser assert stopPhaser.isTerminated() == false; @@ -288,7 +290,7 @@ public boolean asyncRefresh() { try { ActionListener listener = ActionListener.wrap( aVoid -> logger.trace("Job memory requirement refresh request completed successfully"), - e -> logger.warn("Failed to refresh job memory requirements", e) + e -> logIfNecessary(() -> logger.warn("Failed to refresh job memory requirements", e)) ); threadPool.executor(MachineLearning.UTILITY_THREAD_POOL_NAME).execute( () -> refresh(clusterService.state().getMetadata().custom(PersistentTasksCustomMetadata.TYPE), listener)); @@ -383,7 +385,7 @@ public void refresh(PersistentTasksCustomMetadata persistentTasks, ActionListene for (ActionListener listener : fullRefreshCompletionListeners) { listener.onFailure(e); } - logger.warn("ML memory tracker last update failed and listeners called", e); + logIfNecessary(() -> logger.warn("ML memory tracker last update failed and listeners called", e)); // It's critical that we empty out the current listener list on // error otherwise subsequent retries to refresh will be ignored fullRefreshCompletionListeners.clear(); @@ -493,12 +495,28 @@ public void refreshAnomalyDetectorJobMemory(String jobId, ActionListener l } }, e -> { - logger.error("[" + jobId + "] failed to calculate anomaly detector job established model memory requirement", e); + logIfNecessary( + () -> logger.error( + () -> new ParameterizedMessage( + "[{}] failed to calculate anomaly detector job established model memory requirement", + jobId + ), + e + ) + ); setAnomalyDetectorJobMemoryToLimit(jobId, phaserListener); } ); } catch (Exception e) { - logger.error("[" + jobId + "] failed to calculate anomaly detector job established model memory requirement", e); + logIfNecessary( + () -> logger.error( + () -> new ParameterizedMessage( + "[{}] failed to calculate anomaly detector job established model memory requirement", + jobId + ), + e + ) + ); setAnomalyDetectorJobMemoryToLimit(jobId, phaserListener); } } @@ -524,10 +542,28 @@ private void setAnomalyDetectorJobMemoryToLimit(String jobId, ActionListener logger.error( + () -> new ParameterizedMessage("[{}] failed to get anomaly detector job during ML memory update", jobId), + e + ) + ); + } memoryRequirementByAnomalyDetectorJob.remove(jobId); listener.onResponse(null); })); } + + /** + * To reduce spamming the log in an unstable environment, this method will only call the runnable if: + * - The current node is the master node (and thus valid for tracking memory) + * - The current node is NOT stopped (and thus not shutting down) + * @param log Runnable that writes the log message + */ + private void logIfNecessary(Runnable log) { + if (isMaster && (stopped == false)) { + log.run(); + } + } } From 7eaf6b99e6da93f584c2b0a402a566c0b701c92b Mon Sep 17 00:00:00 2001 From: Gordon Brown Date: Thu, 30 Sep 2021 12:37:52 -0600 Subject: [PATCH 088/250] Rename `Metadata#hasConcreteIndex` to `hasIndexAbstraction` (#78493) * Rename `Metadata#hasConcreteIndex` to `hasIndexAbstraction` The method `Metadata#hasConcreteIndex` does not, in fact, check if there is a concrete index by the given name - it checks whether there's an index abstraction (index OR alias OR data stream) with that name. This commit changes the name to match the behavior. * Add javadoc per review --- .../cluster/metadata/Metadata.java | 18 +++++++++++++++++- .../indices/SystemIndexManager.java | 2 +- .../MetadataIndexAliasesServiceTests.java | 2 +- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/Metadata.java b/server/src/main/java/org/elasticsearch/cluster/metadata/Metadata.java index 95e817d8e823b..30c3442d8c0c9 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/Metadata.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/Metadata.java @@ -633,16 +633,32 @@ private void rejectSingleIndexOperation(String aliasOrIndex, IndexAbstraction re Arrays.toString(indexNames) + "], can't execute a single index op"); } + /** + * Checks whether an index exists (as of this {@link Metadata} with the given name. Does not check aliases or data streams. + * @param index An index name that may or may not exist in the cluster. + * @return {@code true} if a concrete index with that name exists, {@code false} otherwise. + */ public boolean hasIndex(String index) { return indices.containsKey(index); } + /** + * Checks whether an index exists. Similar to {@link Metadata#hasIndex(String)}, but ensures that the index has the same UUID as + * the given {@link Index}. + * @param index An {@link Index} object that may or may not exist in the cluster. + * @return {@code true} if an index exists with the same name and UUID as the given index object, {@code false} otherwise. + */ public boolean hasIndex(Index index) { IndexMetadata metadata = index(index.getName()); return metadata != null && metadata.getIndexUUID().equals(index.getUUID()); } - public boolean hasConcreteIndex(String index) { + /** + * Checks whether an index abstraction (that is, index, alias, or data stream) exists (as of this {@link Metadata} with the given name. + * @param index An index name that may or may not exist in the cluster. + * @return {@code true} if an index abstraction with that name exists, {@code false} otherwise. + */ + public boolean hasIndexAbstraction(String index) { return getIndicesLookup().containsKey(index); } diff --git a/server/src/main/java/org/elasticsearch/indices/SystemIndexManager.java b/server/src/main/java/org/elasticsearch/indices/SystemIndexManager.java index b1dcc599f6362..b41dec0ad9b57 100644 --- a/server/src/main/java/org/elasticsearch/indices/SystemIndexManager.java +++ b/server/src/main/java/org/elasticsearch/indices/SystemIndexManager.java @@ -115,7 +115,7 @@ List getEligibleDescriptors(Metadata metadata) { return this.systemIndices.getSystemIndexDescriptors() .stream() .filter(SystemIndexDescriptor::isAutomaticallyManaged) - .filter(d -> metadata.hasConcreteIndex(d.getPrimaryIndex())) + .filter(d -> metadata.hasIndexAbstraction(d.getPrimaryIndex())) .collect(Collectors.toList()); } diff --git a/server/src/test/java/org/elasticsearch/cluster/metadata/MetadataIndexAliasesServiceTests.java b/server/src/test/java/org/elasticsearch/cluster/metadata/MetadataIndexAliasesServiceTests.java index 17b0c83e493e6..a111096b58365 100644 --- a/server/src/test/java/org/elasticsearch/cluster/metadata/MetadataIndexAliasesServiceTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/metadata/MetadataIndexAliasesServiceTests.java @@ -56,7 +56,7 @@ public MetadataIndexAliasesServiceTests() { Collection indices = (Collection) i.getArguments()[1]; Metadata.Builder meta = Metadata.builder(state.metadata()); for (Index index : indices) { - assertTrue("index now found", state.metadata().hasConcreteIndex(index.getName())); + assertTrue("index now found", state.metadata().hasIndexAbstraction(index.getName())); meta.remove(index.getName()); // We only think about metadata for this test. Not routing or any other fun stuff. } return ClusterState.builder(state).metadata(meta).build(); From eed2c816e4b95ff2ed8b64fd341f5b3161d3d533 Mon Sep 17 00:00:00 2001 From: Benjamin Trent Date: Thu, 30 Sep 2021 15:39:32 -0400 Subject: [PATCH 089/250] [ML] fixing flaky test for text classification config update (#78527) * [ML] fixing flaky test for text classification config update * fixing test --- .../trainedmodel/TextClassificationConfigUpdateTests.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextClassificationConfigUpdateTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextClassificationConfigUpdateTests.java index 1343a91f504fe..33ed909d9b9e5 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextClassificationConfigUpdateTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextClassificationConfigUpdateTests.java @@ -67,7 +67,7 @@ public void testApply() { VocabularyConfigTests.createRandom(), BertTokenizationTests.createRandom(), List.of("one", "two"), - randomIntBetween(-1, 10), + randomFrom(-1, randomIntBetween(1, 10)), "foo-results" ); @@ -89,10 +89,10 @@ public void testApply() { .apply(originalConfig) )); assertThat(new TextClassificationConfig.Builder(originalConfig) - .setNumTopClasses(originalConfig.getNumTopClasses() +1) + .setNumTopClasses(originalConfig.getNumTopClasses() + 2) .build(), equalTo(new TextClassificationConfigUpdate.Builder() - .setNumTopClasses(originalConfig.getNumTopClasses() +1) + .setNumTopClasses(originalConfig.getNumTopClasses() + 2) .build() .apply(originalConfig) )); @@ -101,7 +101,7 @@ public void testApply() { public void testApplyWithInvalidLabels() { TextClassificationConfig originalConfig = TextClassificationConfigTests.createRandom(); - int numberNewLabels = originalConfig.getClassificationLabels().size() +1; + int numberNewLabels = originalConfig.getClassificationLabels().size() + 2; List newLabels = randomList(numberNewLabels, numberNewLabels, () -> randomAlphaOfLength(6)); var update = new TextClassificationConfigUpdate.Builder() From f68aef6c5f713104cf613e9fe072743dca98bf06 Mon Sep 17 00:00:00 2001 From: Joe Gallo Date: Thu, 30 Sep 2021 17:02:18 -0400 Subject: [PATCH 090/250] Validate that snapshot repository exists for ILM policies during GenerateSnapshotNameStep (#77657) --- .../core/ilm/GenerateSnapshotNameStep.java | 51 ++++++---- .../ilm/GenerateSnapshotNameStepTests.java | 94 +++++++++++++++++-- 2 files changed, 118 insertions(+), 27 deletions(-) diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/GenerateSnapshotNameStep.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/GenerateSnapshotNameStep.java index 63686014ba354..249b56c9a2b93 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/GenerateSnapshotNameStep.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/GenerateSnapshotNameStep.java @@ -13,9 +13,10 @@ import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; import org.elasticsearch.cluster.metadata.Metadata; -import org.elasticsearch.core.Nullable; +import org.elasticsearch.cluster.metadata.RepositoriesMetadata; import org.elasticsearch.common.Strings; import org.elasticsearch.common.UUIDs; +import org.elasticsearch.core.Nullable; import org.elasticsearch.index.Index; import java.util.Collections; @@ -61,29 +62,39 @@ public ClusterState performAction(Index index, ClusterState clusterState) { return clusterState; } - ClusterState.Builder newClusterStateBuilder = ClusterState.builder(clusterState); - - LifecycleExecutionState lifecycleState = fromIndexMetadata(indexMetaData); - assert lifecycleState.getSnapshotName() == null : "index " + index.getName() + " should not have a snapshot generated by " + - "the ilm policy but has " + lifecycleState.getSnapshotName(); - LifecycleExecutionState.Builder newCustomData = LifecycleExecutionState.builder(lifecycleState); String policy = indexMetaData.getSettings().get(LifecycleSettings.LIFECYCLE_NAME); - String snapshotNamePrefix = ("<{now/d}-" + index.getName() + "-" + policy + ">").toLowerCase(Locale.ROOT); - String snapshotName = generateSnapshotName(snapshotNamePrefix); - ActionRequestValidationException validationException = validateGeneratedSnapshotName(snapshotNamePrefix, snapshotName); - if (validationException != null) { - logger.warn("unable to generate a snapshot name as part of policy [{}] for index [{}] due to [{}]", - policy, index.getName(), validationException.getMessage()); - throw validationException; + LifecycleExecutionState lifecycleState = fromIndexMetadata(indexMetaData); + + // validate that the snapshot repository exists -- because policies are refreshed on later retries, and because + // this fails prior to the snapshot repository being recorded in the ilm metadata, the policy can just be corrected + // and everything will pass on the subsequent retry + if (clusterState.metadata().custom(RepositoriesMetadata.TYPE, RepositoriesMetadata.EMPTY).repository(snapshotRepository) == null) { + throw new IllegalStateException("repository [" + snapshotRepository + "] is missing. [" + policy + "] policy for " + + "index [" + index.getName() + "] cannot continue until the repository is created or the policy is changed"); } - newCustomData.setSnapshotName(snapshotName); - newCustomData.setSnapshotRepository(snapshotRepository); + + LifecycleExecutionState.Builder newCustomData = LifecycleExecutionState.builder(lifecycleState); newCustomData.setSnapshotIndexName(index.getName()); + newCustomData.setSnapshotRepository(snapshotRepository); + if (lifecycleState.getSnapshotName() == null) { + // generate and validate the snapshotName + String snapshotNamePrefix = ("<{now/d}-" + index.getName() + "-" + policy + ">").toLowerCase(Locale.ROOT); + String snapshotName = generateSnapshotName(snapshotNamePrefix); + ActionRequestValidationException validationException = validateGeneratedSnapshotName(snapshotNamePrefix, snapshotName); + if (validationException != null) { + logger.warn("unable to generate a snapshot name as part of policy [{}] for index [{}] due to [{}]", + policy, index.getName(), validationException.getMessage()); + throw validationException; + } + + newCustomData.setSnapshotName(snapshotName); + } - IndexMetadata.Builder indexMetadataBuilder = IndexMetadata.builder(indexMetaData); - indexMetadataBuilder.putCustom(ILM_CUSTOM_METADATA_KEY, newCustomData.build().asMap()); - newClusterStateBuilder.metadata(Metadata.builder(clusterState.getMetadata()).put(indexMetadataBuilder)); - return newClusterStateBuilder.build(); + return ClusterState.builder(clusterState) + .metadata(Metadata.builder(clusterState.getMetadata()) + .put(IndexMetadata.builder(indexMetaData) + .putCustom(ILM_CUSTOM_METADATA_KEY, newCustomData.build().asMap()))) + .build(); } @Override diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/GenerateSnapshotNameStepTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/GenerateSnapshotNameStepTests.java index 069d0b5b06015..a93647ec5c312 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/GenerateSnapshotNameStepTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/GenerateSnapshotNameStepTests.java @@ -12,12 +12,17 @@ import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; import org.elasticsearch.cluster.metadata.Metadata; +import org.elasticsearch.cluster.metadata.RepositoriesMetadata; +import org.elasticsearch.cluster.metadata.RepositoryMetadata; import org.elasticsearch.common.Strings; +import org.elasticsearch.common.settings.Settings; +import java.util.Collections; import java.util.Locale; import static org.elasticsearch.xpack.core.ilm.GenerateSnapshotNameStep.generateSnapshotName; import static org.elasticsearch.xpack.core.ilm.GenerateSnapshotNameStep.validateGeneratedSnapshotName; +import static org.elasticsearch.xpack.core.ilm.LifecycleExecutionState.ILM_CUSTOM_METADATA_KEY; import static org.hamcrest.Matchers.containsInAnyOrder; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.greaterThan; @@ -63,23 +68,98 @@ protected GenerateSnapshotNameStep copyInstance(GenerateSnapshotNameStep instanc public void testPerformAction() { String indexName = randomAlphaOfLength(10); String policyName = "test-ilm-policy"; - IndexMetadata.Builder indexMetadataBuilder = - IndexMetadata.builder(indexName).settings(settings(Version.CURRENT).put(LifecycleSettings.LIFECYCLE_NAME, policyName)) - .numberOfShards(randomIntBetween(1, 5)).numberOfReplicas(randomIntBetween(0, 5)); + final IndexMetadata indexMetadata = IndexMetadata.builder(indexName) + .settings(settings(Version.CURRENT).put(LifecycleSettings.LIFECYCLE_NAME, policyName)) + .numberOfShards(randomIntBetween(1, 5)) + .numberOfReplicas(randomIntBetween(0, 5)) + .build(); + + GenerateSnapshotNameStep generateSnapshotNameStep = createRandomInstance(); + + // generate a snapshot repository with the expected name + RepositoryMetadata repo = new RepositoryMetadata(generateSnapshotNameStep.getSnapshotRepository(), "fs", Settings.EMPTY); - final IndexMetadata indexMetadata = indexMetadataBuilder.build(); ClusterState clusterState = ClusterState.builder(emptyClusterState()) - .metadata(Metadata.builder().put(indexMetadata, false).build()).build(); + .metadata(Metadata.builder() + .put(indexMetadata, false) + .putCustom(RepositoriesMetadata.TYPE, new RepositoriesMetadata(Collections.singletonList(repo))) + .build()).build(); - GenerateSnapshotNameStep generateSnapshotNameStep = createRandomInstance(); - ClusterState newClusterState = generateSnapshotNameStep.performAction(indexMetadata.getIndex(), clusterState); + ClusterState newClusterState; + // the snapshot index name, snapshot repository, and snapshot name are generated as expected + newClusterState = generateSnapshotNameStep.performAction(indexMetadata.getIndex(), clusterState); LifecycleExecutionState executionState = LifecycleExecutionState.fromIndexMetadata(newClusterState.metadata().index(indexName)); + assertThat(executionState.getSnapshotIndexName(), is(indexName)); assertThat("the " + GenerateSnapshotNameStep.NAME + " step must generate a snapshot name", executionState.getSnapshotName(), notNullValue()); assertThat(executionState.getSnapshotRepository(), is(generateSnapshotNameStep.getSnapshotRepository())); assertThat(executionState.getSnapshotName(), containsString(indexName.toLowerCase(Locale.ROOT))); assertThat(executionState.getSnapshotName(), containsString(policyName.toLowerCase(Locale.ROOT))); + + // re-running this step results in no change to the important outputs + newClusterState = generateSnapshotNameStep.performAction(indexMetadata.getIndex(), newClusterState); + LifecycleExecutionState repeatedState = LifecycleExecutionState.fromIndexMetadata(newClusterState.metadata().index(indexName)); + assertThat(repeatedState.getSnapshotIndexName(), is(executionState.getSnapshotIndexName())); + assertThat(repeatedState.getSnapshotRepository(), is(executionState.getSnapshotRepository())); + assertThat(repeatedState.getSnapshotName(), is(executionState.getSnapshotName())); + } + + public void testPerformActionRejectsNonexistentRepository() { + String indexName = randomAlphaOfLength(10); + String policyName = "test-ilm-policy"; + final IndexMetadata indexMetadata = IndexMetadata.builder(indexName) + .settings(settings(Version.CURRENT).put(LifecycleSettings.LIFECYCLE_NAME, policyName)) + .numberOfShards(randomIntBetween(1, 5)) + .numberOfReplicas(randomIntBetween(0, 5)) + .build(); + + GenerateSnapshotNameStep generateSnapshotNameStep = createRandomInstance(); + + ClusterState clusterState = ClusterState.builder(emptyClusterState()) + .metadata(Metadata.builder() + .put(indexMetadata, false) + .putCustom(RepositoriesMetadata.TYPE, RepositoriesMetadata.EMPTY) + .build()).build(); + + IllegalStateException illegalStateException = expectThrows(IllegalStateException.class, + () -> generateSnapshotNameStep.performAction(indexMetadata.getIndex(), clusterState)); + assertThat(illegalStateException.getMessage(), is("repository [" + generateSnapshotNameStep.getSnapshotRepository() + "] " + + "is missing. [test-ilm-policy] policy for index [" + indexName + "] cannot continue until the repository " + + "is created or the policy is changed")); + } + + public void testPerformActionWillOverwriteCachedRepository() { + String indexName = randomAlphaOfLength(10); + String policyName = "test-ilm-policy"; + + LifecycleExecutionState.Builder newCustomData = LifecycleExecutionState.builder(); + newCustomData.setSnapshotName("snapshot-name-is-not-touched"); + newCustomData.setSnapshotRepository("snapshot-repository-will-be-reset"); + + final IndexMetadata indexMetadata = IndexMetadata.builder(indexName) + .settings(settings(Version.CURRENT).put(LifecycleSettings.LIFECYCLE_NAME, policyName)) + .numberOfShards(randomIntBetween(1, 5)) + .numberOfReplicas(randomIntBetween(0, 5)) + .putCustom(ILM_CUSTOM_METADATA_KEY, newCustomData.build().asMap()) + .build(); + + GenerateSnapshotNameStep generateSnapshotNameStep = createRandomInstance(); + + // generate a snapshot repository with the expected name + RepositoryMetadata repo = new RepositoryMetadata(generateSnapshotNameStep.getSnapshotRepository(), "fs", Settings.EMPTY); + + ClusterState clusterState = ClusterState.builder(emptyClusterState()) + .metadata(Metadata.builder() + .put(indexMetadata, false) + .putCustom(RepositoriesMetadata.TYPE, new RepositoriesMetadata(Collections.singletonList(repo))) + .build()).build(); + + ClusterState newClusterState = generateSnapshotNameStep.performAction(indexMetadata.getIndex(), clusterState); + + LifecycleExecutionState executionState = LifecycleExecutionState.fromIndexMetadata(newClusterState.metadata().index(indexName)); + assertThat(executionState.getSnapshotName(), is("snapshot-name-is-not-touched")); + assertThat(executionState.getSnapshotRepository(), is(generateSnapshotNameStep.getSnapshotRepository())); } public void testNameGeneration() { From 329d5969efc73f4684a60ddebb4299be9af67112 Mon Sep 17 00:00:00 2001 From: Gordon Brown Date: Thu, 30 Sep 2021 15:36:13 -0600 Subject: [PATCH 091/250] Require System Index Descriptors to allow a specific suffix (#78355) Previously, the leading `.` at the start of system and associated index descriptor patterns was not properly replaced before being compiled as a regular expression, leading to any single-character prefix matching. This commit fixes the issue and adds tests to catch it. --- .../ingest/geoip/GeoIpDownloader.java | 1 + .../ingest/geoip/IngestGeoIpPlugin.java | 3 +- .../elasticsearch/kibana/KibanaPlugin.java | 4 +- .../kibana/KibanaPluginTests.java | 2 +- .../cluster/ClusterInfoServiceIT.java | 2 +- .../snapshots/SystemIndicesSnapshotIT.java | 4 +- .../indices/SystemIndexDescriptor.java | 23 ++++- .../elasticsearch/indices/SystemIndices.java | 32 +++++++ .../get/TransportGetAliasesActionTests.java | 4 +- .../TransportUpdateSettingsActionTests.java | 2 +- .../action/bulk/TransportBulkActionTests.java | 2 +- .../action/support/AutoCreateIndexTests.java | 8 +- .../IndexNameExpressionResolverTests.java | 10 +- .../MetadataCreateIndexServiceTests.java | 8 +- .../indices/ExecutorSelectorTests.java | 2 +- .../indices/SystemIndexManagerTests.java | 2 +- .../indices/SystemIndicesTests.java | 91 ++++++++++++++++--- .../elasticsearch/xpack/ccr/AutoFollowIT.java | 2 +- .../security/test/TestRestrictedIndices.java | 16 ++-- .../xpack/logstash/Logstash.java | 3 +- .../xpack/logstash/LogstashPluginTests.java | 2 +- ...hableSnapshotsSystemIndicesIntegTests.java | 2 +- .../SearchableSnapshots.java | 3 +- .../xpack/security/Security.java | 4 +- 24 files changed, 176 insertions(+), 56 deletions(-) diff --git a/modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/GeoIpDownloader.java b/modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/GeoIpDownloader.java index 21513c3433a04..9ba7961069975 100644 --- a/modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/GeoIpDownloader.java +++ b/modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/GeoIpDownloader.java @@ -64,6 +64,7 @@ public class GeoIpDownloader extends AllocatedPersistentTask { public static final String GEOIP_DOWNLOADER = "geoip-downloader"; static final String DATABASES_INDEX = ".geoip_databases"; + static final String DATABASES_INDEX_PATTERN = DATABASES_INDEX + "*"; static final int MAX_CHUNK_SIZE = 1024 * 1024; private final Client client; diff --git a/modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/IngestGeoIpPlugin.java b/modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/IngestGeoIpPlugin.java index f26c7820c8c61..0cd5deac94c92 100644 --- a/modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/IngestGeoIpPlugin.java +++ b/modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/IngestGeoIpPlugin.java @@ -66,6 +66,7 @@ import static org.elasticsearch.index.mapper.MapperService.SINGLE_MAPPING_NAME; import static org.elasticsearch.ingest.IngestService.INGEST_ORIGIN; import static org.elasticsearch.ingest.geoip.GeoIpDownloader.DATABASES_INDEX; +import static org.elasticsearch.ingest.geoip.GeoIpDownloader.DATABASES_INDEX_PATTERN; import static org.elasticsearch.ingest.geoip.GeoIpDownloader.GEOIP_DOWNLOADER; public class IngestGeoIpPlugin extends Plugin implements IngestPlugin, SystemIndexPlugin, Closeable, PersistentTaskPlugin, ActionPlugin { @@ -160,7 +161,7 @@ public List getNamedWriteables() { @Override public Collection getSystemIndexDescriptors(Settings settings) { SystemIndexDescriptor geoipDatabasesIndex = SystemIndexDescriptor.builder() - .setIndexPattern(DATABASES_INDEX) + .setIndexPattern(DATABASES_INDEX_PATTERN) .setDescription("GeoIP databases") .setMappings(mappings()) .setSettings(Settings.builder() diff --git a/modules/kibana/src/main/java/org/elasticsearch/kibana/KibanaPlugin.java b/modules/kibana/src/main/java/org/elasticsearch/kibana/KibanaPlugin.java index 4956b5148dc1c..011dbb602e01e 100644 --- a/modules/kibana/src/main/java/org/elasticsearch/kibana/KibanaPlugin.java +++ b/modules/kibana/src/main/java/org/elasticsearch/kibana/KibanaPlugin.java @@ -37,14 +37,14 @@ public class KibanaPlugin extends Plugin implements SystemIndexPlugin { .build(); public static final SystemIndexDescriptor APM_AGENT_CONFIG_INDEX_DESCRIPTOR = SystemIndexDescriptor.builder() - .setIndexPattern(".apm-agent-configuration") + .setIndexPattern(".apm-agent-configuration*") .setDescription("system index for APM agent configuration") .setType(Type.EXTERNAL_UNMANAGED) .setAllowedElasticProductOrigins(KIBANA_PRODUCT_ORIGIN) .build(); public static final SystemIndexDescriptor APM_CUSTOM_LINK_INDEX_DESCRIPTOR = SystemIndexDescriptor.builder() - .setIndexPattern(".apm-custom-link") + .setIndexPattern(".apm-custom-link*") .setDescription("system index for APM custom links") .setType(Type.EXTERNAL_UNMANAGED) .setAllowedElasticProductOrigins(KIBANA_PRODUCT_ORIGIN) diff --git a/modules/kibana/src/test/java/org/elasticsearch/kibana/KibanaPluginTests.java b/modules/kibana/src/test/java/org/elasticsearch/kibana/KibanaPluginTests.java index 0f8b9ba7071cc..cd9f9de3a6447 100644 --- a/modules/kibana/src/test/java/org/elasticsearch/kibana/KibanaPluginTests.java +++ b/modules/kibana/src/test/java/org/elasticsearch/kibana/KibanaPluginTests.java @@ -24,7 +24,7 @@ public void testKibanaIndexNames() { .stream() .map(SystemIndexDescriptor::getIndexPattern) .collect(Collectors.toUnmodifiableList()), - contains(".kibana_*", ".reporting-*", ".apm-agent-configuration", ".apm-custom-link") + contains(".kibana_*", ".reporting-*", ".apm-agent-configuration*", ".apm-custom-link*") ); } } diff --git a/server/src/internalClusterTest/java/org/elasticsearch/cluster/ClusterInfoServiceIT.java b/server/src/internalClusterTest/java/org/elasticsearch/cluster/ClusterInfoServiceIT.java index 34130fa6ba548..1b67e47f5f1f5 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/cluster/ClusterInfoServiceIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/cluster/ClusterInfoServiceIT.java @@ -84,7 +84,7 @@ public List getActionFilters() { @Override public Collection getSystemIndexDescriptors(Settings settings) { - return List.of(new SystemIndexDescriptor(TEST_SYSTEM_INDEX_NAME, "Test system index")); + return List.of(new SystemIndexDescriptor(TEST_SYSTEM_INDEX_NAME + "*", "Test system index")); } @Override diff --git a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/SystemIndicesSnapshotIT.java b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/SystemIndicesSnapshotIT.java index b01cc4f463d6b..189a412cf91e1 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/SystemIndicesSnapshotIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/SystemIndicesSnapshotIT.java @@ -960,7 +960,7 @@ public static class AnotherSystemIndexTestPlugin extends Plugin implements Syste @Override public Collection getSystemIndexDescriptors(Settings settings) { - return Collections.singletonList(new SystemIndexDescriptor(SYSTEM_INDEX_NAME, "System indices for tests")); + return Collections.singletonList(new SystemIndexDescriptor(SYSTEM_INDEX_NAME + "*", "System indices for tests")); } @Override @@ -981,7 +981,7 @@ public static class AssociatedIndicesTestPlugin extends Plugin implements System @Override public Collection getSystemIndexDescriptors(Settings settings) { - return Collections.singletonList(new SystemIndexDescriptor(SYSTEM_INDEX_NAME, "System & associated indices for tests")); + return Collections.singletonList(new SystemIndexDescriptor(SYSTEM_INDEX_NAME + "*", "System & associated indices for tests")); } @Override diff --git a/server/src/main/java/org/elasticsearch/indices/SystemIndexDescriptor.java b/server/src/main/java/org/elasticsearch/indices/SystemIndexDescriptor.java index f0576ce711dfc..7a05834667797 100644 --- a/server/src/main/java/org/elasticsearch/indices/SystemIndexDescriptor.java +++ b/server/src/main/java/org/elasticsearch/indices/SystemIndexDescriptor.java @@ -40,7 +40,12 @@ * creating the system index, upgrading its mappings, and creating an alias. */ public class SystemIndexDescriptor implements IndexPatternMatcher, Comparable { - /** A pattern, either with a wildcard or simple regex. Indices that match one of these patterns are considered system indices. */ + /** + * A pattern, either with a wildcard or simple regex. Indices that match one of these patterns are considered system indices. + * Note that this pattern must not overlap with any other {@link SystemIndexDescriptor}s and must allow an alphanumeric suffix + * (see {@link SystemIndices#UPGRADED_INDEX_SUFFIX} for the specific suffix that's checked) to ensure that there's a name within the + * pattern we can use to create a new index when upgrading. + * */ private final String indexPattern; /** @@ -107,7 +112,9 @@ public class SystemIndexDescriptor implements IndexPatternMatcher, Comparable pluginAndModulesDescriptors) { featureDescriptors = buildSystemIndexDescriptorMap(pluginAndModulesDescriptors); checkForOverlappingPatterns(featureDescriptors); + ensurePatternsAllowSuffix(featureDescriptors); checkForDuplicateAliases(this.getSystemIndexDescriptors()); Automaton systemIndexAutomata = buildIndexAutomaton(featureDescriptors); this.systemIndexRunAutomaton = new CharacterRunAutomaton(systemIndexAutomata); @@ -99,6 +102,35 @@ public SystemIndices(Map pluginAndModulesDescriptors) { this.systemNameRunAutomaton = new CharacterRunAutomaton(systemNameAutomaton); } + static void ensurePatternsAllowSuffix(Map features) { + String suffixPattern = "*" + UPGRADED_INDEX_SUFFIX; + final List descriptorsWithNoRoomForSuffix = features.entrySet() + .stream() + .flatMap( + feature -> feature.getValue().getIndexDescriptors() + .stream() + // The below filter & map are inside the enclosing flapMap so we have access to both the feature and the descriptor + .filter(descriptor -> overlaps(descriptor.getIndexPattern(), suffixPattern) == false) + .map( + descriptor -> new ParameterizedMessage( + "pattern [{}] from feature [{}]", + descriptor.getIndexPattern(), + feature.getKey() + ).getFormattedMessage() + ) + ) + .collect(Collectors.toList()); + if (descriptorsWithNoRoomForSuffix.isEmpty() == false) { + throw new IllegalStateException( + new ParameterizedMessage( + "the following system index patterns do not allow suffix [{}] required to allow upgrades: [{}]", + UPGRADED_INDEX_SUFFIX, + descriptorsWithNoRoomForSuffix + ).getFormattedMessage() + ); + } + } + private static void checkForDuplicateAliases(Collection descriptors) { final Map aliasCounts = new HashMap<>(); diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/alias/get/TransportGetAliasesActionTests.java b/server/src/test/java/org/elasticsearch/action/admin/indices/alias/get/TransportGetAliasesActionTests.java index c6c093bfa82eb..d68b3fa4a8d90 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/alias/get/TransportGetAliasesActionTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/indices/alias/get/TransportGetAliasesActionTests.java @@ -176,7 +176,7 @@ public void testDeprecationWarningEmittedWhenRequestingNonExistingAliasInSystemP SystemIndices systemIndices = new SystemIndices(Collections.singletonMap( this.getTestName(), new SystemIndices.Feature(this.getTestName(), "test feature", - Collections.singletonList(new SystemIndexDescriptor(".y", "an index that doesn't exist"))))); + Collections.singletonList(new SystemIndexDescriptor(".y*", "an index that doesn't exist"))))); GetAliasesRequest request = new GetAliasesRequest(".y"); ImmutableOpenMap> aliases = ImmutableOpenMap.>builder() @@ -229,7 +229,7 @@ public void testNetNewSystemIndicesDontErrorWhenNotRequested() { String[] concreteIndices; SystemIndexDescriptor netNewDescriptor = SystemIndexDescriptor.builder() - .setIndexPattern(".b") + .setIndexPattern(".b*") .setAliasName(".y") .setPrimaryIndex(".b") .setDescription(this.getTestName()) diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/settings/put/TransportUpdateSettingsActionTests.java b/server/src/test/java/org/elasticsearch/action/admin/indices/settings/put/TransportUpdateSettingsActionTests.java index 6f96c2cd9f857..fe8a8f4fd7596 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/settings/put/TransportUpdateSettingsActionTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/indices/settings/put/TransportUpdateSettingsActionTests.java @@ -58,7 +58,7 @@ public class TransportUpdateSettingsActionTests extends ESTestCase { Map.of("test-feature", new SystemIndices.Feature( "test-feature", "a test feature", - List.of(new SystemIndexDescriptor(SYSTEM_INDEX_NAME, "test")) + List.of(new SystemIndexDescriptor(SYSTEM_INDEX_NAME + "*", "test")) )) ); diff --git a/server/src/test/java/org/elasticsearch/action/bulk/TransportBulkActionTests.java b/server/src/test/java/org/elasticsearch/action/bulk/TransportBulkActionTests.java index 8e8b318475188..61dc6a7fb9ee8 100644 --- a/server/src/test/java/org/elasticsearch/action/bulk/TransportBulkActionTests.java +++ b/server/src/test/java/org/elasticsearch/action/bulk/TransportBulkActionTests.java @@ -245,7 +245,7 @@ public void testOnlySystem() { indicesLookup.put(".bar", new Index(IndexMetadata.builder(".bar").settings(settings).system(true).numberOfShards(1).numberOfReplicas(0).build())); SystemIndices systemIndices = new SystemIndices( - Map.of("plugin", new SystemIndices.Feature("plugin", "test feature", List.of(new SystemIndexDescriptor(".test", ""))))); + Map.of("plugin", new SystemIndices.Feature("plugin", "test feature", List.of(new SystemIndexDescriptor(".test*", ""))))); List onlySystem = List.of(".foo", ".bar"); assertTrue(bulkAction.isOnlySystem(buildBulkRequest(onlySystem), indicesLookup, systemIndices)); diff --git a/server/src/test/java/org/elasticsearch/action/support/AutoCreateIndexTests.java b/server/src/test/java/org/elasticsearch/action/support/AutoCreateIndexTests.java index 741b63ca6a217..ce607a60711ad 100644 --- a/server/src/test/java/org/elasticsearch/action/support/AutoCreateIndexTests.java +++ b/server/src/test/java/org/elasticsearch/action/support/AutoCreateIndexTests.java @@ -301,8 +301,12 @@ private static ClusterState buildClusterState(String... indices) { } private AutoCreateIndex newAutoCreateIndex(Settings settings) { - SystemIndices systemIndices = new SystemIndices(Map.of( - "plugin", new SystemIndices.Feature("plugin", "test feature", List.of(new SystemIndexDescriptor(TEST_SYSTEM_INDEX_NAME, ""))))); + SystemIndices systemIndices = new SystemIndices( + Map.of( + "plugin", + new SystemIndices.Feature("plugin", "test feature", List.of(new SystemIndexDescriptor(TEST_SYSTEM_INDEX_NAME + "*", ""))) + ) + ); return new AutoCreateIndex(settings, new ClusterSettings(settings, ClusterSettings.BUILT_IN_CLUSTER_SETTINGS), TestIndexNameExpressionResolver.newInstance(systemIndices), systemIndices); } diff --git a/server/src/test/java/org/elasticsearch/cluster/metadata/IndexNameExpressionResolverTests.java b/server/src/test/java/org/elasticsearch/cluster/metadata/IndexNameExpressionResolverTests.java index f0d3816218789..7b0e78ed86c49 100644 --- a/server/src/test/java/org/elasticsearch/cluster/metadata/IndexNameExpressionResolverTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/metadata/IndexNameExpressionResolverTests.java @@ -1981,16 +1981,16 @@ public void testExternalSystemIndexAccess() { new Feature( "ml", "ml indices", - List.of(new SystemIndexDescriptor(".ml-meta", "ml meta"), new SystemIndexDescriptor(".ml-stuff", "other ml")) + List.of(new SystemIndexDescriptor(".ml-meta*", "ml meta"), new SystemIndexDescriptor(".ml-stuff*", "other ml")) ), "watcher", - new Feature("watcher", "watcher indices", List.of(new SystemIndexDescriptor(".watches", "watches index"))), + new Feature("watcher", "watcher indices", List.of(new SystemIndexDescriptor(".watches*", "watches index"))), "stack-component", new Feature("stack-component", "stack component", List.of( new SystemIndexDescriptor( - ".external-sys-idx", + ".external-sys-idx*", "external", Type.EXTERNAL_UNMANAGED, List.of("stack-component", "other") @@ -2481,10 +2481,10 @@ private ClusterState systemIndexTestClusterState() { SystemIndices systemIndices = new SystemIndices( Map.of("ml", new Feature("ml", "ml indices", - List.of(new SystemIndexDescriptor(".ml-meta", "ml meta"), new SystemIndexDescriptor(".ml-stuff", "other ml")) + List.of(new SystemIndexDescriptor(".ml-meta*", "ml meta"), new SystemIndexDescriptor(".ml-stuff*", "other ml")) ), "watcher", - new Feature("watcher", "watcher indices", List.of(new SystemIndexDescriptor(".watches", "watches index"))) + new Feature("watcher", "watcher indices", List.of(new SystemIndexDescriptor(".watches*", "watches index"))) ) ); indexNameExpressionResolver = new IndexNameExpressionResolver(threadContext, systemIndices); diff --git a/server/src/test/java/org/elasticsearch/cluster/metadata/MetadataCreateIndexServiceTests.java b/server/src/test/java/org/elasticsearch/cluster/metadata/MetadataCreateIndexServiceTests.java index 19c6d0af06755..68f82f9435547 100644 --- a/server/src/test/java/org/elasticsearch/cluster/metadata/MetadataCreateIndexServiceTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/metadata/MetadataCreateIndexServiceTests.java @@ -508,8 +508,8 @@ public void testCalculateNumRoutingShards() { public void testValidateDotIndex() { List systemIndexDescriptors = new ArrayList<>(); - systemIndexDescriptors.add(new SystemIndexDescriptor(".test", "test")); - systemIndexDescriptors.add(new SystemIndexDescriptor(".test3", "test")); + systemIndexDescriptors.add(new SystemIndexDescriptor(".test-one*", "test")); + systemIndexDescriptors.add(new SystemIndexDescriptor(".test-~(one*)", "test")); systemIndexDescriptors.add(new SystemIndexDescriptor(".pattern-test*", "test-1")); withTemporaryClusterService(((clusterService, threadPool) -> { @@ -536,8 +536,8 @@ public void testValidateDotIndex() { assertFalse(checkerService.validateDotIndex(".test2", true)); // Check NO deprecation warnings if we give the index name - assertTrue(checkerService.validateDotIndex(".test", false)); - assertTrue(checkerService.validateDotIndex(".test3", false)); + assertTrue(checkerService.validateDotIndex(".test-one", false)); + assertTrue(checkerService.validateDotIndex(".test-3", false)); // Check that patterns with wildcards work assertTrue(checkerService.validateDotIndex(".pattern-test", false)); diff --git a/server/src/test/java/org/elasticsearch/indices/ExecutorSelectorTests.java b/server/src/test/java/org/elasticsearch/indices/ExecutorSelectorTests.java index 0413927564d20..9da703137a770 100644 --- a/server/src/test/java/org/elasticsearch/indices/ExecutorSelectorTests.java +++ b/server/src/test/java/org/elasticsearch/indices/ExecutorSelectorTests.java @@ -26,7 +26,7 @@ public void testNonCriticalSystemIndexThreadPools() { Map.of( "normal system index", new SystemIndices.Feature( "normal", "normal system index", - Collections.singletonList(new SystemIndexDescriptor( ".non-critical-system-index", "test index")) + Collections.singletonList(new SystemIndexDescriptor( ".non-critical-system-index*", "test index")) ) ) )); diff --git a/server/src/test/java/org/elasticsearch/indices/SystemIndexManagerTests.java b/server/src/test/java/org/elasticsearch/indices/SystemIndexManagerTests.java index 7cfa6fdffb81b..245af61d50436 100644 --- a/server/src/test/java/org/elasticsearch/indices/SystemIndexManagerTests.java +++ b/server/src/test/java/org/elasticsearch/indices/SystemIndexManagerTests.java @@ -89,7 +89,7 @@ public void setUpManager() { * Check that the manager skips over descriptors whose indices cannot be managed. */ public void testManagerSkipsDescriptorsThatAreNotManaged() { - SystemIndexDescriptor d1 = new SystemIndexDescriptor(".foo-1", ""); + SystemIndexDescriptor d1 = new SystemIndexDescriptor(".foo-1*", ""); SystemIndexDescriptor d2 = SystemIndexDescriptor.builder() .setIndexPattern(".bar-*") .setPrimaryIndex(".bar-1") diff --git a/server/src/test/java/org/elasticsearch/indices/SystemIndicesTests.java b/server/src/test/java/org/elasticsearch/indices/SystemIndicesTests.java index 999f09b9d1f60..db80e47747edc 100644 --- a/server/src/test/java/org/elasticsearch/indices/SystemIndicesTests.java +++ b/server/src/test/java/org/elasticsearch/indices/SystemIndicesTests.java @@ -10,23 +10,26 @@ import org.elasticsearch.test.ESTestCase; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import static org.elasticsearch.tasks.TaskResultsService.TASKS_FEATURE_NAME; import static org.elasticsearch.tasks.TaskResultsService.TASK_INDEX; +import static org.hamcrest.Matchers.allOf; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.not; public class SystemIndicesTests extends ESTestCase { + private static final String OPTIONAL_UPGRADE_SUFFIX_REGEX = "(" + SystemIndices.UPGRADED_INDEX_SUFFIX + ")?"; public void testBasicOverlappingPatterns() { SystemIndexDescriptor broadPattern = new SystemIndexDescriptor(".a*c*", "test"); SystemIndexDescriptor notOverlapping = new SystemIndexDescriptor(".bbbddd*", "test"); SystemIndexDescriptor overlapping1 = new SystemIndexDescriptor(".ac*", "test"); - SystemIndexDescriptor overlapping2 = new SystemIndexDescriptor(".aaaabbbccc", "test"); + SystemIndexDescriptor overlapping2 = new SystemIndexDescriptor(".aaaabbbccc*", "test"); SystemIndexDescriptor overlapping3 = new SystemIndexDescriptor(".aaabb*cccddd*", "test"); // These sources have fixed prefixes to make sure they sort in the same order, so that the error message is consistent @@ -84,8 +87,12 @@ public void testBuiltInSystemIndices() { public void testPluginCannotOverrideBuiltInSystemIndex() { Map pluginMap = Map.of( - TASKS_FEATURE_NAME, new SystemIndices.Feature(TASKS_FEATURE_NAME, "test", List.of(new SystemIndexDescriptor(TASK_INDEX, "Task" + - " Result Index"))) + TASKS_FEATURE_NAME, + new SystemIndices.Feature( + TASKS_FEATURE_NAME, + "test", + List.of(new SystemIndexDescriptor(TASK_INDEX + "*", "Task" + " Result Index")) + ) ); IllegalArgumentException e = expectThrows(IllegalArgumentException.class, () -> new SystemIndices(pluginMap)); assertThat(e.getMessage(), containsString("plugin or module attempted to define the same source")); @@ -93,9 +100,16 @@ public void testPluginCannotOverrideBuiltInSystemIndex() { public void testPatternWithSimpleRange() { - final SystemIndices systemIndices = new SystemIndices(Map.of( - "test", new SystemIndices.Feature("test", "test feature", List.of(new SystemIndexDescriptor(".test-[abc]", ""))) - )); + final SystemIndices systemIndices = new SystemIndices( + Map.of( + "test", + new SystemIndices.Feature( + "test", + "test feature", + List.of(new SystemIndexDescriptor(".test-[abc]" + OPTIONAL_UPGRADE_SUFFIX_REGEX, "")) + ) + ) + ); assertThat(systemIndices.isSystemIndex(".test-a"), equalTo(true)); assertThat(systemIndices.isSystemIndex(".test-b"), equalTo(true)); @@ -108,9 +122,16 @@ public void testPatternWithSimpleRange() { } public void testPatternWithSimpleRangeAndRepeatOperator() { - final SystemIndices systemIndices = new SystemIndices(Map.of( - "test", new SystemIndices.Feature("test", "test feature", List.of(new SystemIndexDescriptor(".test-[a]+", ""))) - )); + final SystemIndices systemIndices = new SystemIndices( + Map.of( + "test", + new SystemIndices.Feature( + "test", + "test feature", + List.of(new SystemIndexDescriptor(".test-[a]+" + OPTIONAL_UPGRADE_SUFFIX_REGEX, "")) + ) + ) + ); assertThat(systemIndices.isSystemIndex(".test-a"), equalTo(true)); assertThat(systemIndices.isSystemIndex(".test-aa"), equalTo(true)); @@ -120,9 +141,16 @@ public void testPatternWithSimpleRangeAndRepeatOperator() { } public void testPatternWithComplexRange() { - final SystemIndices systemIndices = new SystemIndices(Map.of( - "test", new SystemIndices.Feature("test", "test feature", List.of(new SystemIndexDescriptor(".test-[a-c]", ""))) - )); + final SystemIndices systemIndices = new SystemIndices( + Map.of( + "test", + new SystemIndices.Feature( + "test", + "test feature", + List.of(new SystemIndexDescriptor(".test-[a-c]" + OPTIONAL_UPGRADE_SUFFIX_REGEX, "")) + ) + ) + ); assertThat(systemIndices.isSystemIndex(".test-a"), equalTo(true)); assertThat(systemIndices.isSystemIndex(".test-b"), equalTo(true)); @@ -153,4 +181,43 @@ public void testOverlappingDescriptorsWithRanges() { assertThat(exception.getMessage(), containsString(pattern2.toString() + " from [" + source2 + "]")); } + + public void testPatternsWithNoRoomForUpgradeSuffix() { + final SystemIndexDescriptor endsWithNumbersOnly = new SystemIndexDescriptor(".desc[0-9]+", "can only end with numbers"); + final SystemIndexDescriptor concreteIndex = new SystemIndexDescriptor(".concrete", "concrete index"); + final SystemIndexDescriptor okayDescriptor = new SystemIndexDescriptor(".okay*", "concrete index"); + final SystemIndexDescriptor endsWithNumbersThenWildcard = new SystemIndexDescriptor(".desc[0-9]+*", "concrete index"); + + final Map features = new HashMap<>(); + final String firstFeature = "first"; + features.put( + firstFeature, + new SystemIndices.Feature( + firstFeature, + this.getTestName() + " - " + firstFeature, + Collections.singletonList(endsWithNumbersOnly) + ) + ); + final String secondFeature = "second"; + features.put( + secondFeature, + new SystemIndices.Feature(secondFeature, this.getTestName() + " - " + secondFeature, List.of(concreteIndex, okayDescriptor)) + ); + final String thirdFeature = "third"; + features.put( + thirdFeature, + new SystemIndices.Feature(thirdFeature, this.getTestName() + " - " + thirdFeature, List.of(endsWithNumbersThenWildcard)) + ); + + IllegalStateException ex = expectThrows(IllegalStateException.class, () -> SystemIndices.ensurePatternsAllowSuffix(features)); + assertThat( + ex.getMessage(), + allOf( + containsString(endsWithNumbersOnly.getIndexPattern()), + containsString(secondFeature), + containsString(concreteIndex.getIndexPattern()), + containsString(firstFeature) + ) + ); + } } diff --git a/x-pack/plugin/ccr/src/internalClusterTest/java/org/elasticsearch/xpack/ccr/AutoFollowIT.java b/x-pack/plugin/ccr/src/internalClusterTest/java/org/elasticsearch/xpack/ccr/AutoFollowIT.java index 18409ae61795f..29e062883277c 100644 --- a/x-pack/plugin/ccr/src/internalClusterTest/java/org/elasticsearch/xpack/ccr/AutoFollowIT.java +++ b/x-pack/plugin/ccr/src/internalClusterTest/java/org/elasticsearch/xpack/ccr/AutoFollowIT.java @@ -76,7 +76,7 @@ public static class FakeSystemIndex extends Plugin implements SystemIndexPlugin @Override public Collection getSystemIndexDescriptors(Settings settings) { - return Collections.singletonList(new SystemIndexDescriptor(SYSTEM_INDEX_NAME, "test index")); + return Collections.singletonList(new SystemIndexDescriptor(SYSTEM_INDEX_NAME + "*", "test index")); } @Override diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/test/TestRestrictedIndices.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/test/TestRestrictedIndices.java index bc81538a9fdbb..ad85f7a9857f4 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/test/TestRestrictedIndices.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/test/TestRestrictedIndices.java @@ -65,16 +65,16 @@ public class TestRestrictedIndices { new SystemIndexDescriptor(".fleet-actions~(-results*)", "fleet actions"), new SystemIndexDescriptor(".fleet-agents*", "fleet agents"), new SystemIndexDescriptor(".fleet-enrollment-api-keys*", "fleet enrollment"), - new SystemIndexDescriptor(".fleet-policies-[0-9]+", "fleet policies"), + new SystemIndexDescriptor(".fleet-policies-[0-9]+*", "fleet policies"), new SystemIndexDescriptor(".fleet-policies-leader*", "fleet policies leader"), new SystemIndexDescriptor(".fleet-servers*", "fleet servers"), new SystemIndexDescriptor(".fleet-artifacts*", "fleet artifacts")))); featureMap.put("ingest-geoip-mock", new Feature("ingest-geoip-mock", "fake geoip for restricted indices tests", List.of( - new SystemIndexDescriptor(".geoip_databases", "geoip databases")))); + new SystemIndexDescriptor(".geoip_databases*", "geoip databases")))); featureMap.put("logstash-mock", new Feature("logstash-mock", "fake logstash for restricted indices tests", List.of( - new SystemIndexDescriptor(".logstash", "logstash")))); + new SystemIndexDescriptor(".logstash*", "logstash")))); featureMap.put("machine-learning-mock", new Feature("machine-learning-mock", "fake machine learning for restricted indices tests", List.of( new SystemIndexDescriptor(".ml-meta*", "machine learning meta"), @@ -82,7 +82,7 @@ public class TestRestrictedIndices { new SystemIndexDescriptor(".ml-inference*", "machine learning inference")))); featureMap.put("searchable-snapshots-mock", new Feature("searchable-snapshots-mock", "fake searchable snapshots for restricted indices tests", List.of( - new SystemIndexDescriptor(".snapshot-blob-cache", "snapshot blob cache")))); + new SystemIndexDescriptor(".snapshot-blob-cache*", "snapshot blob cache")))); featureMap.put("transform-mock", new Feature("transform-mock", "fake transform for restricted indices tests", List.of( new SystemIndexDescriptor(".transform-internal-*", "transform internal")))); @@ -106,7 +106,7 @@ private static SystemIndexDescriptor.Builder getInitializedDescriptorBuilder() { private static SystemIndexDescriptor getMainSecurityDescriptor() { return getInitializedDescriptorBuilder() // This can't just be `.security-*` because that would overlap with the tokens index pattern - .setIndexPattern(".security-[0-9]+") + .setIndexPattern(".security-[0-9]+*") .setPrimaryIndex(RestrictedIndicesNames.INTERNAL_SECURITY_MAIN_INDEX_7) .setDescription("Contains Security configuration") .setAliasName(SECURITY_MAIN_ALIAS) @@ -118,7 +118,7 @@ private static SystemIndexDescriptor getMainSecurityDescriptor() { private static SystemIndexDescriptor getSecurityTokensDescriptor() { return getInitializedDescriptorBuilder() - .setIndexPattern(".security-tokens-[0-9]+") + .setIndexPattern(".security-tokens-[0-9]+*") .setPrimaryIndex(RestrictedIndicesNames.INTERNAL_SECURITY_TOKENS_INDEX_7) .setDescription("Contains auth token data") .setAliasName(SECURITY_TOKENS_ALIAS) @@ -158,7 +158,7 @@ private static SystemIndexDescriptor getReportingIndexDescriptor() { private static SystemIndexDescriptor getApmAgentConfigDescriptor() { return SystemIndexDescriptor.builder() - .setIndexPattern(".apm-agent-configuration") + .setIndexPattern(".apm-agent-configuration*") .setDescription("system index for APM agent configuration") .setType(SystemIndexDescriptor.Type.EXTERNAL_UNMANAGED) .setAllowedElasticProductOrigins(List.of("kibana")) @@ -167,7 +167,7 @@ private static SystemIndexDescriptor getApmAgentConfigDescriptor() { private static SystemIndexDescriptor getApmCustomLinkDescriptor() { return SystemIndexDescriptor.builder() - .setIndexPattern(".apm-custom-link") + .setIndexPattern(".apm-custom-link*") .setDescription("system index for APM custom links") .setType(SystemIndexDescriptor.Type.EXTERNAL_UNMANAGED) .setAllowedElasticProductOrigins(List.of("kibana")) diff --git a/x-pack/plugin/logstash/src/main/java/org/elasticsearch/xpack/logstash/Logstash.java b/x-pack/plugin/logstash/src/main/java/org/elasticsearch/xpack/logstash/Logstash.java index f7b9b90467f20..619b81d3c9546 100644 --- a/x-pack/plugin/logstash/src/main/java/org/elasticsearch/xpack/logstash/Logstash.java +++ b/x-pack/plugin/logstash/src/main/java/org/elasticsearch/xpack/logstash/Logstash.java @@ -52,6 +52,7 @@ public class Logstash extends Plugin implements SystemIndexPlugin { public static final String LOGSTASH_CONCRETE_INDEX_NAME = ".logstash"; + public static final String LOGSTASH_INDEX_NAME_PATTERN = LOGSTASH_CONCRETE_INDEX_NAME + "*"; public Logstash() {} @@ -83,7 +84,7 @@ public List getRestHandlers( public Collection getSystemIndexDescriptors(Settings settings) { return List.of( SystemIndexDescriptor.builder() - .setIndexPattern(LOGSTASH_CONCRETE_INDEX_NAME) + .setIndexPattern(LOGSTASH_INDEX_NAME_PATTERN) .setPrimaryIndex(LOGSTASH_CONCRETE_INDEX_NAME) .setDescription("Contains data for Logstash Central Management") .setMappings(getIndexMappings()) diff --git a/x-pack/plugin/logstash/src/test/java/org/elasticsearch/xpack/logstash/LogstashPluginTests.java b/x-pack/plugin/logstash/src/test/java/org/elasticsearch/xpack/logstash/LogstashPluginTests.java index 2141c665b4ab1..0f71b08baf0df 100644 --- a/x-pack/plugin/logstash/src/test/java/org/elasticsearch/xpack/logstash/LogstashPluginTests.java +++ b/x-pack/plugin/logstash/src/test/java/org/elasticsearch/xpack/logstash/LogstashPluginTests.java @@ -23,7 +23,7 @@ public void testSystemIndices() { .stream() .map(SystemIndexDescriptor::getIndexPattern) .collect(Collectors.toUnmodifiableList()), - contains(".logstash") + contains(".logstash*") ); } } diff --git a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsSystemIndicesIntegTests.java b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsSystemIndicesIntegTests.java index 0027b39d1af95..45aba303e1e25 100644 --- a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsSystemIndicesIntegTests.java +++ b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsSystemIndicesIntegTests.java @@ -89,7 +89,7 @@ public static class TestSystemIndexPlugin extends Plugin implements SystemIndexP @Override public Collection getSystemIndexDescriptors(Settings settings) { - return List.of(new SystemIndexDescriptor(INDEX_NAME, "System index for [" + getTestClass().getName() + ']')); + return List.of(new SystemIndexDescriptor(INDEX_NAME + "*", "System index for [" + getTestClass().getName() + ']')); } @Override diff --git a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshots.java b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshots.java index c61a9103383b8..5f51e0bf98b9c 100644 --- a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshots.java +++ b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshots.java @@ -209,6 +209,7 @@ public class SearchableSnapshots extends Plugin implements IndexStorePlugin, Eng ); public static final String SNAPSHOT_BLOB_CACHE_INDEX = ".snapshot-blob-cache"; + public static final String SNAPSHOT_BLOB_CACHE_INDEX_PATTERN = SNAPSHOT_BLOB_CACHE_INDEX + "*"; public static final String SNAPSHOT_BLOB_CACHE_METADATA_FILES_MAX_LENGTH = "index.store.snapshot.blob_cache.metadata_files.max_length"; public static final Setting SNAPSHOT_BLOB_CACHE_METADATA_FILES_MAX_LENGTH_SETTING = new Setting<>( new Setting.SimpleKey(SNAPSHOT_BLOB_CACHE_METADATA_FILES_MAX_LENGTH), @@ -401,7 +402,7 @@ public List getIndexFoldersDeletionListeners() { public Collection getSystemIndexDescriptors(Settings settings) { return List.of( SystemIndexDescriptor.builder() - .setIndexPattern(SNAPSHOT_BLOB_CACHE_INDEX) + .setIndexPattern(SNAPSHOT_BLOB_CACHE_INDEX_PATTERN) .setDescription("Contains cached data of blob store repositories") .setPrimaryIndex(SNAPSHOT_BLOB_CACHE_INDEX) .setMappings(getIndexMappings()) diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/Security.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/Security.java index 0432a2d1b84a4..6802d5d128c56 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/Security.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/Security.java @@ -1292,7 +1292,7 @@ private synchronized SharedGroupFactory getNettySharedGroupFactory(Settings sett private static SystemIndexDescriptor getSecurityMainIndexDescriptor() { return SystemIndexDescriptor.builder() // This can't just be `.security-*` because that would overlap with the tokens index pattern - .setIndexPattern(".security-[0-9]+") + .setIndexPattern(".security-[0-9]+*") .setPrimaryIndex(RestrictedIndicesNames.INTERNAL_SECURITY_MAIN_INDEX_7) .setDescription("Contains Security configuration") .setMappings(getIndexMappings()) @@ -1307,7 +1307,7 @@ private static SystemIndexDescriptor getSecurityMainIndexDescriptor() { private static SystemIndexDescriptor getSecurityTokenIndexDescriptor() { return SystemIndexDescriptor.builder() - .setIndexPattern(".security-tokens-[0-9]+") + .setIndexPattern(".security-tokens-[0-9]+*") .setPrimaryIndex(RestrictedIndicesNames.INTERNAL_SECURITY_TOKENS_INDEX_7) .setDescription("Contains auth token data") .setMappings(getTokenIndexMappings()) From f59e5cd4ef79f1a8a20d0057ed0e68b945cc3de5 Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Thu, 30 Sep 2021 14:44:16 -0700 Subject: [PATCH 092/250] Simplify XPackLicenseState tests (#78484) Tests for the license state historically test each feature at random license levels. But this is unnecessary because what really matters are the combinations of current license state and license level of a feature. This commit removes the dozens of feature specific tests in favor of simple tests for a feature of each license level, asserting whether that feature is allowed or not. --- .../license/XPackLicenseStateTests.java | 277 ++++-------------- 1 file changed, 50 insertions(+), 227 deletions(-) diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/license/XPackLicenseStateTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/license/XPackLicenseStateTests.java index 8f7896ed1d196..2bc10a21ce564 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/license/XPackLicenseStateTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/license/XPackLicenseStateTests.java @@ -21,7 +21,6 @@ import static org.elasticsearch.license.License.OperationMode.BASIC; import static org.elasticsearch.license.License.OperationMode.ENTERPRISE; import static org.elasticsearch.license.License.OperationMode.GOLD; -import static org.elasticsearch.license.License.OperationMode.MISSING; import static org.elasticsearch.license.License.OperationMode.PLATINUM; import static org.elasticsearch.license.License.OperationMode.STANDARD; import static org.elasticsearch.license.License.OperationMode.TRIAL; @@ -201,171 +200,6 @@ public void testMonitoringAckNotBasicToBasic() { assertAckMessages(XPackField.MONITORING, from, BASIC, 2); } - public void testMonitoringUpdateRetention() { - assertAllowed(STANDARD, true, s -> s.checkFeature(Feature.MONITORING_UPDATE_RETENTION), true); - assertAllowed(GOLD, true, s -> s.checkFeature(Feature.MONITORING_UPDATE_RETENTION), true); - assertAllowed(PLATINUM, true, s -> s.checkFeature(Feature.MONITORING_UPDATE_RETENTION), true); - assertAllowed(TRIAL, true, s -> s.checkFeature(Feature.MONITORING_UPDATE_RETENTION), true); - assertAllowed(BASIC, true, s -> s.checkFeature(Feature.MONITORING_UPDATE_RETENTION), false); - assertAllowed(MISSING, false, s -> s.checkFeature(Feature.MONITORING_UPDATE_RETENTION), false); - } - - public void testWatcherPlatinumGoldTrialStandard() throws Exception { - assertAllowed(TRIAL, true, s -> s.checkFeature(Feature.WATCHER), true); - assertAllowed(GOLD, true, s -> s.checkFeature(Feature.WATCHER), true); - assertAllowed(PLATINUM, true, s -> s.checkFeature(Feature.WATCHER), true); - assertAllowed(STANDARD, true, s -> s.checkFeature(Feature.WATCHER), true); - } - - public void testWatcherBasicLicense() throws Exception { - assertAllowed(BASIC, true, s -> s.checkFeature(Feature.WATCHER), false); - } - - public void testWatcherInactive() { - assertAllowed(BASIC, false, s -> s.checkFeature(Feature.WATCHER), false); - } - - public void testWatcherInactivePlatinumGoldTrial() throws Exception { - assertAllowed(TRIAL, false, s -> s.checkFeature(Feature.WATCHER), false); - assertAllowed(GOLD, false, s -> s.checkFeature(Feature.WATCHER), false); - assertAllowed(PLATINUM, false, s -> s.checkFeature(Feature.WATCHER), false); - assertAllowed(STANDARD, false, s -> s.checkFeature(Feature.WATCHER), false); - } - - public void testEncryptedSnapshotsWithInactiveLicense() { - assertAllowed(BASIC, false, s -> s.checkFeature(Feature.ENCRYPTED_SNAPSHOT), false); - assertAllowed(TRIAL, false, s -> s.checkFeature(Feature.ENCRYPTED_SNAPSHOT), false); - assertAllowed(GOLD, false, s -> s.checkFeature(Feature.ENCRYPTED_SNAPSHOT), false); - assertAllowed(PLATINUM, false, s -> s.checkFeature(Feature.ENCRYPTED_SNAPSHOT), false); - assertAllowed(ENTERPRISE, false, s -> s.checkFeature(Feature.ENCRYPTED_SNAPSHOT), false); - assertAllowed(STANDARD, false, s -> s.checkFeature(Feature.ENCRYPTED_SNAPSHOT), false); - } - - public void testEncryptedSnapshotsWithActiveLicense() { - assertAllowed(BASIC, true, s -> s.checkFeature(Feature.ENCRYPTED_SNAPSHOT), false); - assertAllowed(TRIAL, true, s -> s.checkFeature(Feature.ENCRYPTED_SNAPSHOT), true); - assertAllowed(GOLD, true, s -> s.checkFeature(Feature.ENCRYPTED_SNAPSHOT), false); - assertAllowed(PLATINUM, true, s -> s.checkFeature(Feature.ENCRYPTED_SNAPSHOT), true); - assertAllowed(ENTERPRISE, true, s -> s.checkFeature(Feature.ENCRYPTED_SNAPSHOT), true); - assertAllowed(STANDARD, true, s -> s.checkFeature(Feature.ENCRYPTED_SNAPSHOT), false); - } - - public void testGraphPlatinumTrial() throws Exception { - assertAllowed(TRIAL, true, s -> s.checkFeature(Feature.GRAPH), true); - assertAllowed(PLATINUM, true, s -> s.checkFeature(Feature.GRAPH), true); - } - - public void testGraphBasic() throws Exception { - assertAllowed(BASIC, true, s -> s.checkFeature(Feature.GRAPH), false); - } - - public void testGraphStandard() throws Exception { - assertAllowed(STANDARD, true, s -> s.checkFeature(Feature.GRAPH), false); - } - - public void testGraphInactiveBasic() { - assertAllowed(BASIC, false, s -> s.checkFeature(Feature.GRAPH), false); - } - - public void testGraphInactivePlatinumTrial() throws Exception { - assertAllowed(TRIAL, false, s -> s.checkFeature(Feature.MACHINE_LEARNING), false); - assertAllowed(PLATINUM, false, s -> s.checkFeature(Feature.MACHINE_LEARNING), false); - } - - public void testMachineLearningPlatinumTrial() throws Exception { - assertAllowed(TRIAL, true, s -> s.checkFeature(Feature.MACHINE_LEARNING), true); - assertAllowed(PLATINUM, true, s -> s.checkFeature(Feature.MACHINE_LEARNING), true); - } - - public void testMachineLearningBasic() throws Exception { - assertAllowed(BASIC, true, s -> s.checkFeature(Feature.MACHINE_LEARNING), false); - } - - public void testMachineLearningStandard() throws Exception { - assertAllowed(STANDARD, true, s -> s.checkFeature(Feature.MACHINE_LEARNING), false); - } - - public void testMachineLearningInactiveBasic() { - assertAllowed(BASIC, false, s -> s.checkFeature(Feature.MACHINE_LEARNING), false); - } - - public void testMachineLearningInactivePlatinumTrial() throws Exception { - assertAllowed(TRIAL, false, s -> s.checkFeature(Feature.MACHINE_LEARNING), false); - assertAllowed(PLATINUM, false, s -> s.checkFeature(Feature.MACHINE_LEARNING), false); - } - - public void testLogstashPlatinumGoldTrialStandard() throws Exception { - assertAllowed(TRIAL, true, s -> s.checkFeature(Feature.LOGSTASH), true); - assertAllowed(GOLD, true, s -> s.checkFeature(Feature.LOGSTASH), true); - assertAllowed(PLATINUM, true, s -> s.checkFeature(Feature.LOGSTASH), true); - assertAllowed(STANDARD, true, s -> s.checkFeature(Feature.LOGSTASH), true); - } - - public void testLogstashBasicLicense() throws Exception { - assertAllowed(BASIC, true, s -> s.checkFeature(Feature.LOGSTASH), false); - } - - public void testLogstashInactive() { - assertAllowed(BASIC, false, s -> s.checkFeature(Feature.LOGSTASH), false); - assertAllowed(TRIAL, false, s -> s.checkFeature(Feature.LOGSTASH), false); - assertAllowed(GOLD, false, s -> s.checkFeature(Feature.LOGSTASH), false); - assertAllowed(PLATINUM, false, s -> s.checkFeature(Feature.LOGSTASH), false); - assertAllowed(STANDARD, false, s -> s.checkFeature(Feature.LOGSTASH), false); - } - - public void testJdbcDefaults() { - XPackLicenseState licenseState = TestUtils.newTestLicenseState(); - assertThat(licenseState.checkFeature(XPackLicenseState.Feature.JDBC), is(true)); - } - - public void testJdbcBasic() { - XPackLicenseState licenseState = TestUtils.newTestLicenseState(); - licenseState.update(BASIC, true, null); - assertThat(licenseState.checkFeature(XPackLicenseState.Feature.JDBC), is(false)); - } - - public void testJdbcStandard() { - XPackLicenseState licenseState = TestUtils.newTestLicenseState(); - licenseState.update(STANDARD, true, null); - - assertThat(licenseState.checkFeature(XPackLicenseState.Feature.JDBC), is(false)); - } - - public void testJdbcStandardExpired() { - XPackLicenseState licenseState = TestUtils.newTestLicenseState(); - licenseState.update(STANDARD, false, null); - - assertThat(licenseState.checkFeature(XPackLicenseState.Feature.JDBC), is(false)); - } - - public void testJdbcGold() { - XPackLicenseState licenseState = TestUtils.newTestLicenseState(); - licenseState.update(GOLD, true, null); - - assertThat(licenseState.checkFeature(XPackLicenseState.Feature.JDBC), is(false)); - } - - public void testJdbcGoldExpired() { - XPackLicenseState licenseState = TestUtils.newTestLicenseState(); - licenseState.update(GOLD, false, null); - - assertThat(licenseState.checkFeature(XPackLicenseState.Feature.JDBC), is(false)); - } - - public void testJdbcPlatinum() { - XPackLicenseState licenseState = TestUtils.newTestLicenseState(); - licenseState.update(PLATINUM, true, null); - - assertThat(licenseState.checkFeature(XPackLicenseState.Feature.JDBC), is(true)); - } - - public void testJdbcPlatinumExpired() { - XPackLicenseState licenseState = TestUtils.newTestLicenseState(); - licenseState.update(PLATINUM, false, null); - - assertThat(licenseState.checkFeature(XPackLicenseState.Feature.JDBC), is(false)); - } - public void testSqlAckAnyToTrialOrPlatinum() { assertAckMessages(XPackField.SQL, randomMode(), randomTrialOrPlatinumMode(), 0); } @@ -374,67 +208,6 @@ public void testSqlAckTrialOrPlatinumToNotTrialOrPlatinum() { assertAckMessages(XPackField.SQL, randomTrialOrPlatinumMode(), randomBasicStandardOrGold(), 1); } - public void testCcrDefaults() { - final XPackLicenseState state = TestUtils.newTestLicenseState(); - assertTrue(state.checkFeature(XPackLicenseState.Feature.CCR)); - } - - public void testCcrBasic() { - final XPackLicenseState state = TestUtils.newTestLicenseState(); - state.update(BASIC, true, null); - - assertThat(state.checkFeature(XPackLicenseState.Feature.CCR), is(false)); - } - - public void testCcrBasicExpired() { - final XPackLicenseState state = TestUtils.newTestLicenseState(); - state.update(BASIC, false, null); - - assertThat(state.checkFeature(XPackLicenseState.Feature.CCR), is(false)); - } - - public void testCcrStandard() { - final XPackLicenseState state = TestUtils.newTestLicenseState(); - state.update(STANDARD, true, null); - - assertThat(state.checkFeature(XPackLicenseState.Feature.CCR), is(false)); - } - - public void testCcrStandardExpired() { - final XPackLicenseState state = TestUtils.newTestLicenseState(); - state.update(STANDARD, false, null); - - assertThat(state.checkFeature(XPackLicenseState.Feature.CCR), is(false)); - } - - public void testCcrGold() { - final XPackLicenseState state = TestUtils.newTestLicenseState(); - state.update(GOLD, true, null); - - assertThat(state.checkFeature(XPackLicenseState.Feature.CCR), is(false)); - } - - public void testCcrGoldExpired() { - final XPackLicenseState state = TestUtils.newTestLicenseState(); - state.update(GOLD, false, null); - - assertThat(state.checkFeature(XPackLicenseState.Feature.CCR), is(false)); - } - - public void testCcrPlatinum() { - final XPackLicenseState state = TestUtils.newTestLicenseState(); - state.update(PLATINUM, true, null); - - assertTrue(state.checkFeature(XPackLicenseState.Feature.CCR)); - } - - public void testCcrPlatinumExpired() { - final XPackLicenseState state = TestUtils.newTestLicenseState(); - state.update(PLATINUM, false, null); - - assertFalse(state.checkFeature(XPackLicenseState.Feature.CCR)); - } - public void testCcrAckAnyToTrialOrPlatinum() { assertAckMessages(XPackField.CCR, randomMode(), randomTrialOrPlatinumMode(), 0); } @@ -443,6 +216,56 @@ public void testCcrAckTrialOrPlatinumToNotTrialOrPlatinum() { assertAckMessages(XPackField.CCR, randomTrialOrPlatinumMode(), randomBasicStandardOrGold(), 1); } + public void testExpiredLicense() { + // use standard feature which would normally be allowed at all license levels + LicensedFeature feature = LicensedFeature.momentary("family", "enterpriseFeature", STANDARD); + assertAllowed(STANDARD, false, s -> s.isAllowed(feature), false); + assertAllowed(GOLD, false, s -> s.isAllowed(feature), false); + assertAllowed(PLATINUM, false, s -> s.isAllowed(feature), false); + assertAllowed(ENTERPRISE, false, s -> s.isAllowed(feature), false); + assertAllowed(TRIAL, false, s -> s.isAllowed(feature), false); + } + + public void testStandardFeature() { + LicensedFeature feature = LicensedFeature.momentary("family", "standardFeature", STANDARD); + assertAllowed(BASIC, true, s -> s.isAllowed(feature), false); + assertAllowed(STANDARD, true, s -> s.isAllowed(feature), true); + assertAllowed(GOLD, true, s -> s.isAllowed(feature), true); + assertAllowed(PLATINUM, true, s -> s.isAllowed(feature), true); + assertAllowed(ENTERPRISE, true, s -> s.isAllowed(feature), true); + assertAllowed(TRIAL, true, s -> s.isAllowed(feature), true); + } + + public void testGoldFeature() { + LicensedFeature feature = LicensedFeature.momentary("family", "goldFeature", GOLD); + assertAllowed(BASIC, true, s -> s.isAllowed(feature), false); + assertAllowed(STANDARD, true, s -> s.isAllowed(feature), false); + assertAllowed(GOLD, true, s -> s.isAllowed(feature), true); + assertAllowed(PLATINUM, true, s -> s.isAllowed(feature), true); + assertAllowed(ENTERPRISE, true, s -> s.isAllowed(feature), true); + assertAllowed(TRIAL, true, s -> s.isAllowed(feature), true); + } + + public void testPlatinumFeature() { + LicensedFeature feature = LicensedFeature.momentary("family", "platinumFeature", PLATINUM); + assertAllowed(BASIC, true, s -> s.isAllowed(feature), false); + assertAllowed(STANDARD, true, s -> s.isAllowed(feature), false); + assertAllowed(GOLD, true, s -> s.isAllowed(feature), false); + assertAllowed(PLATINUM, true, s -> s.isAllowed(feature), true); + assertAllowed(ENTERPRISE, true, s -> s.isAllowed(feature), true); + assertAllowed(TRIAL, true, s -> s.isAllowed(feature), true); + } + + public void testEnterpriseFeature() { + LicensedFeature feature = LicensedFeature.momentary("family", "enterpriseFeature", ENTERPRISE); + assertAllowed(BASIC, true, s -> s.isAllowed(feature), false); + assertAllowed(STANDARD, true, s -> s.isAllowed(feature), false); + assertAllowed(GOLD, true, s -> s.isAllowed(feature), false); + assertAllowed(PLATINUM, true, s -> s.isAllowed(feature), false); + assertAllowed(ENTERPRISE, true, s -> s.isAllowed(feature), true); + assertAllowed(TRIAL, true, s -> s.isAllowed(feature), true); + } + public void testLastUsedMomentaryFeature() { LicensedFeature.Momentary goldFeature = LicensedFeature.momentary("family", "goldFeature", GOLD); AtomicInteger currentTime = new AtomicInteger(100); // non zero start time From e4cde37111849b0093123a358a4176b131970300 Mon Sep 17 00:00:00 2001 From: Ignacio Vera Date: Fri, 1 Oct 2021 06:56:13 +0200 Subject: [PATCH 093/250] Add centroid grid type in mvt request (#78305) For this grid type, the features on the aggregation layer are represented by a point that is computed from the centroid of the data inside the cell Co-authored-by: James Rodewig <40268737+jrodewig@users.noreply.github.com> --- .../search/search-vector-tile-api.asciidoc | 8 +++ .../rest-api-spec/api/search_mvt.json | 3 +- .../xpack/vectortile/VectorTileRestIT.java | 38 +++++++++++++ .../vectortile/rest/RestVectorTileAction.java | 54 +++++++++++++++---- .../vectortile/rest/VectorTileRequest.java | 5 +- .../resources/rest-api-spec/test/10_basic.yml | 13 +++++ 6 files changed, 110 insertions(+), 11 deletions(-) diff --git a/docs/reference/search/search-vector-tile-api.asciidoc b/docs/reference/search/search-vector-tile-api.asciidoc index de17e8378cafd..0e539c49ca44b 100644 --- a/docs/reference/search/search-vector-tile-api.asciidoc +++ b/docs/reference/search/search-vector-tile-api.asciidoc @@ -227,6 +227,11 @@ Each feature is a `Polygon` of the cell's bounding box. `point`::: Each feature is a `Point` that's the centroid of the cell. + +`centroid`::: +Each feature is a `Point` that's the centroid of the data within the cell. For +complex geometries, the actual centroid may be outside the cell. In these cases, +the feature is set to the closest point to the centroid inside the cell. // end::grid-type[] // tag::size[] @@ -259,6 +264,9 @@ aggregation types: * <> * <> * <> ++ +The aggregation names can't start with `_mvt_`. The `_mvt_` prefix is reserved +for internal aggregations. include::search-vector-tile-api.asciidoc[tag=exact-bounds] diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/search_mvt.json b/rest-api-spec/src/main/resources/rest-api-spec/api/search_mvt.json index abd89fdef76f2..18d30eafb5baa 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/search_mvt.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/search_mvt.json @@ -67,7 +67,8 @@ "type":"enum", "options":[ "grid", - "point" + "point", + "centroid" ], "description":"Determines the geometry type for features in the aggs layer.", "default":"grid" diff --git a/x-pack/plugin/vector-tile/src/javaRestTest/java/org/elasticsearch/xpack/vectortile/VectorTileRestIT.java b/x-pack/plugin/vector-tile/src/javaRestTest/java/org/elasticsearch/xpack/vectortile/VectorTileRestIT.java index 6872847083cd5..84c4f3b4912c3 100644 --- a/x-pack/plugin/vector-tile/src/javaRestTest/java/org/elasticsearch/xpack/vectortile/VectorTileRestIT.java +++ b/x-pack/plugin/vector-tile/src/javaRestTest/java/org/elasticsearch/xpack/vectortile/VectorTileRestIT.java @@ -372,6 +372,16 @@ public void testGridType() throws Exception { assertLayer(tile, META_LAYER, 4096, 1, 13); assertFeatureType(tile, AGGS_LAYER, VectorTile.Tile.GeomType.POLYGON); } + { + final Request mvtRequest = new Request(getHttpMethod(), INDEX_POINTS + "/_mvt/location/" + z + "/" + x + "/" + y); + mvtRequest.setJsonEntity("{\"size\" : 100, \"grid_type\": \"centroid\" }"); + final VectorTile.Tile tile = execute(mvtRequest); + assertThat(tile.getLayersCount(), Matchers.equalTo(3)); + assertLayer(tile, HITS_LAYER, 4096, 33, 2); + assertLayer(tile, AGGS_LAYER, 4096, 1, 1); + assertLayer(tile, META_LAYER, 4096, 1, 13); + assertFeatureType(tile, AGGS_LAYER, VectorTile.Tile.GeomType.POINT); + } { final Request mvtRequest = new Request(getHttpMethod(), INDEX_POINTS + "/_mvt/location/" + z + "/" + x + "/" + y); mvtRequest.setJsonEntity("{\"grid_type\": \"invalid_type\" }"); @@ -380,6 +390,34 @@ public void testGridType() throws Exception { } } + public void testInvalidAggName() { + final Request mvtRequest = new Request(getHttpMethod(), INDEX_POINTS + "/_mvt/location/" + z + "/" + x + "/" + y); + mvtRequest.setJsonEntity( + "{\"size\" : 0," + + " \"aggs\": {\n" + + " \"_mvt_name\": {\n" + + " \"min\": {\n" + + " \"field\": \"value1\"\n" + + " }\n" + + " }\n" + + " }\n" + + "}" + ); + ResponseException ex = expectThrows(ResponseException.class, () -> execute(mvtRequest)); + // the prefix '_mvt_' is reserved for internal aggregations + assertThat(ex.getMessage(), Matchers.containsString("Invalid aggregation name [_mvt_name]")); + } + + public void testCentroidGridTypeOnPolygon() throws Exception { + final Request mvtRequest = new Request(getHttpMethod(), INDEX_POLYGON + "/_mvt/location/" + (z + 2) + "/" + 4 * x + "/" + 4 * y); + mvtRequest.setJsonEntity("{\"size\" : 0, \"grid_type\": \"centroid\", \"grid_precision\": 2}"); + final VectorTile.Tile tile = execute(mvtRequest); + assertThat(tile.getLayersCount(), Matchers.equalTo(2)); + assertLayer(tile, AGGS_LAYER, 4096, 4 * 4, 1); + assertLayer(tile, META_LAYER, 4096, 1, 13); + assertFeatureType(tile, AGGS_LAYER, VectorTile.Tile.GeomType.POINT); + } + public void testTrackTotalHitsAsBoolean() throws Exception { { final Request mvtRequest = new Request( diff --git a/x-pack/plugin/vector-tile/src/main/java/org/elasticsearch/xpack/vectortile/rest/RestVectorTileAction.java b/x-pack/plugin/vector-tile/src/main/java/org/elasticsearch/xpack/vectortile/rest/RestVectorTileAction.java index a501924711d67..bf7fdb5dfb50c 100644 --- a/x-pack/plugin/vector-tile/src/main/java/org/elasticsearch/xpack/vectortile/rest/RestVectorTileAction.java +++ b/x-pack/plugin/vector-tile/src/main/java/org/elasticsearch/xpack/vectortile/rest/RestVectorTileAction.java @@ -42,7 +42,9 @@ import org.elasticsearch.search.aggregations.bucket.geogrid.InternalGeoGridBucket; import org.elasticsearch.search.aggregations.bucket.geogrid.InternalGeoTileGrid; import org.elasticsearch.search.aggregations.metrics.GeoBoundsAggregationBuilder; +import org.elasticsearch.search.aggregations.metrics.GeoCentroidAggregationBuilder; import org.elasticsearch.search.aggregations.metrics.InternalGeoBounds; +import org.elasticsearch.search.aggregations.metrics.InternalGeoCentroid; import org.elasticsearch.search.aggregations.pipeline.StatsBucketPipelineAggregationBuilder; import org.elasticsearch.search.fetch.subphase.FieldAndFormat; import org.elasticsearch.search.profile.SearchProfileResults; @@ -74,6 +76,10 @@ public class RestVectorTileAction extends BaseRestHandler { // mime type as defined by the mapbox vector tile specification private static final String MIME_TYPE = "application/vnd.mapbox-vector-tile"; + // prefox for internal aggregations. User aggregations cannot start with this prefix + private static final String INTERNAL_AGG_PREFIX = "_mvt_"; + // internal centroid aggregation name + private static final String CENTROID_AGG_NAME = INTERNAL_AGG_PREFIX + "centroid"; public RestVectorTileAction() {} @@ -202,11 +208,25 @@ private static SearchRequestBuilder searchRequestBuilder(RestCancellableNodeClie .size(extent * extent); searchRequestBuilder.addAggregation(tileAggBuilder); searchRequestBuilder.addAggregation(new StatsBucketPipelineAggregationBuilder(COUNT_TAG, GRID_FIELD + "." + COUNT_TAG)); + if (request.getGridType() == VectorTileRequest.GRID_TYPE.CENTROID) { + GeoCentroidAggregationBuilder centroidAggregationBuilder = new GeoCentroidAggregationBuilder(CENTROID_AGG_NAME); + centroidAggregationBuilder.field(request.getField()); + tileAggBuilder.subAggregation(centroidAggregationBuilder); + } final AggregatorFactories.Builder otherAggBuilder = request.getAggBuilder(); if (otherAggBuilder != null) { - tileAggBuilder.subAggregations(request.getAggBuilder()); final Collection aggregations = otherAggBuilder.getAggregatorFactories(); for (AggregationBuilder aggregation : aggregations) { + if (aggregation.getName().startsWith(INTERNAL_AGG_PREFIX)) { + throw new IllegalArgumentException( + "Invalid aggregation name [" + + aggregation.getName() + + "]. Aggregation names cannot start with prefix '" + + INTERNAL_AGG_PREFIX + + "'" + ); + } + tileAggBuilder.subAggregation(aggregation); // we add the metric (.value) to the path in order to support aggregation names with '.' final String bucketPath = GRID_FIELD + ">" + aggregation.getName() + ".value"; searchRequestBuilder.addAggregation(new StatsBucketPipelineAggregationBuilder(aggregation.getName(), bucketPath)); @@ -266,18 +286,34 @@ private static VectorTile.Tile.Layer.Builder buildAggsLayer( for (InternalGeoGridBucket bucket : grid.getBuckets()) { featureBuilder.clear(); // Add geometry - if (request.getGridType() == VectorTileRequest.GRID_TYPE.GRID) { - final Rectangle r = GeoTileUtils.toBoundingBox(bucket.getKeyAsString()); - featureBuilder.mergeFrom(geomBuilder.box(r.getMinLon(), r.getMaxLon(), r.getMinLat(), r.getMaxLat())); - } else { - // TODO: it should be the centroid of the data? - final GeoPoint point = (GeoPoint) bucket.getKey(); - featureBuilder.mergeFrom(geomBuilder.point(point.lon(), point.lat())); + switch (request.getGridType()) { + case GRID: { + final Rectangle r = GeoTileUtils.toBoundingBox(bucket.getKeyAsString()); + featureBuilder.mergeFrom(geomBuilder.box(r.getMinLon(), r.getMaxLon(), r.getMinLat(), r.getMaxLat())); + break; + } + case POINT: { + final GeoPoint point = (GeoPoint) bucket.getKey(); + featureBuilder.mergeFrom(geomBuilder.point(point.lon(), point.lat())); + break; + } + case CENTROID: { + final Rectangle r = GeoTileUtils.toBoundingBox(bucket.getKeyAsString()); + final InternalGeoCentroid centroid = bucket.getAggregations().get(CENTROID_AGG_NAME); + final double featureLon = Math.min(Math.max(centroid.centroid().lon(), r.getMinLon()), r.getMaxLon()); + final double featureLat = Math.min(Math.max(centroid.centroid().lat(), r.getMinLat()), r.getMaxLat()); + featureBuilder.mergeFrom(geomBuilder.point(featureLon, featureLat)); + break; + } + default: + throw new IllegalArgumentException("unsupported grid type + [" + request.getGridType() + "]"); } // Add count as key value pair VectorTileUtils.addPropertyToFeature(featureBuilder, layerProps, COUNT_TAG, bucket.getDocCount()); for (Aggregation aggregation : bucket.getAggregations()) { - VectorTileUtils.addToXContentToFeature(featureBuilder, layerProps, aggregation); + if (aggregation.getName().startsWith(INTERNAL_AGG_PREFIX) == false) { + VectorTileUtils.addToXContentToFeature(featureBuilder, layerProps, aggregation); + } } aggLayerBuilder.addFeatures(featureBuilder); } diff --git a/x-pack/plugin/vector-tile/src/main/java/org/elasticsearch/xpack/vectortile/rest/VectorTileRequest.java b/x-pack/plugin/vector-tile/src/main/java/org/elasticsearch/xpack/vectortile/rest/VectorTileRequest.java index 7fe9ec03ee6b0..2662b97562ac4 100644 --- a/x-pack/plugin/vector-tile/src/main/java/org/elasticsearch/xpack/vectortile/rest/VectorTileRequest.java +++ b/x-pack/plugin/vector-tile/src/main/java/org/elasticsearch/xpack/vectortile/rest/VectorTileRequest.java @@ -63,7 +63,8 @@ class VectorTileRequest { protected enum GRID_TYPE { GRID, - POINT; + POINT, + CENTROID; private static GRID_TYPE fromString(String type) { switch (type.toLowerCase(Locale.ROOT)) { @@ -71,6 +72,8 @@ private static GRID_TYPE fromString(String type) { return GRID; case "point": return POINT; + case "centroid": + return CENTROID; default: throw new IllegalArgumentException("Invalid grid type [" + type + "]"); } diff --git a/x-pack/plugin/vector-tile/src/yamlRestTest/resources/rest-api-spec/test/10_basic.yml b/x-pack/plugin/vector-tile/src/yamlRestTest/resources/rest-api-spec/test/10_basic.yml index b2b9b480a84f4..48498141412f9 100644 --- a/x-pack/plugin/vector-tile/src/yamlRestTest/resources/rest-api-spec/test/10_basic.yml +++ b/x-pack/plugin/vector-tile/src/yamlRestTest/resources/rest-api-spec/test/10_basic.yml @@ -99,6 +99,19 @@ setup: zoom: 0 body: grid_type: grid + +--- +"grid type centroid": + - do: + search_mvt: + index: locations + field: location + x: 0 + y: 0 + zoom: 0 + body: + grid_type: centroid + --- "field field": - do: From d2de1afa742f8c197d0c5c074285f52754e83c47 Mon Sep 17 00:00:00 2001 From: Przemyslaw Gomulka Date: Fri, 1 Oct 2021 11:43:15 +0200 Subject: [PATCH 094/250] Rest api to reset deprecation indexing cache (#78392) Deprecation indexing is using RateLimitingFilter to throttle duplicated deprecations. This commit adds REST API and transport actions to reset the LRU cache in this filter. This will not affect the log4j filter used for thottling file appenders. closes #78134 --- .../xpack/deprecation/DeprecationHttpIT.java | 84 ++++++++++- .../xpack/deprecation/Deprecation.java | 17 ++- .../logging/DeprecationCacheResetAction.java | 137 ++++++++++++++++++ .../logging/DeprecationIndexingComponent.java | 12 +- .../RestDeprecationCacheResetAction.java | 37 +++++ .../TransportDeprecationCacheResetAction.java | 74 ++++++++++ .../xpack/security/operator/Constants.java | 1 + 7 files changed, 347 insertions(+), 15 deletions(-) create mode 100644 x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/logging/DeprecationCacheResetAction.java create mode 100644 x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/logging/RestDeprecationCacheResetAction.java create mode 100644 x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/logging/TransportDeprecationCacheResetAction.java diff --git a/x-pack/plugin/deprecation/qa/rest/src/javaRestTest/java/org/elasticsearch/xpack/deprecation/DeprecationHttpIT.java b/x-pack/plugin/deprecation/qa/rest/src/javaRestTest/java/org/elasticsearch/xpack/deprecation/DeprecationHttpIT.java index 2bde98f39001c..bd126d0787ee3 100644 --- a/x-pack/plugin/deprecation/qa/rest/src/javaRestTest/java/org/elasticsearch/xpack/deprecation/DeprecationHttpIT.java +++ b/x-pack/plugin/deprecation/qa/rest/src/javaRestTest/java/org/elasticsearch/xpack/deprecation/DeprecationHttpIT.java @@ -49,7 +49,6 @@ import static org.hamcrest.Matchers.greaterThan; import static org.hamcrest.Matchers.hasEntry; import static org.hamcrest.Matchers.hasItem; -import static org.hamcrest.Matchers.hasItems; import static org.hamcrest.Matchers.hasKey; import static org.hamcrest.Matchers.hasSize; @@ -279,7 +278,7 @@ public void testDeprecationRouteThrottling() throws Exception { assertThat( documents, - hasItems( + containsInAnyOrder( allOf( hasEntry(KEY_FIELD_NAME, "deprecated_route_POST_/_test_cluster/deprecated_settings"), hasEntry("message", "[/_test_cluster/deprecated_settings] exists for deprecated tests") @@ -367,7 +366,7 @@ public void testDeprecationMessagesCanBeIndexed() throws Exception { assertThat( documents, - hasItems( + containsInAnyOrder( allOf( hasKey("@timestamp"), hasKey("elasticsearch.cluster.name"), @@ -466,7 +465,7 @@ public void testDeprecationWarnMessagesCanBeIndexed() throws Exception { assertThat( documents, - hasItems( + containsInAnyOrder( allOf( hasKey("@timestamp"), hasKey("elasticsearch.cluster.name"), @@ -583,7 +582,7 @@ public void testCompatibleMessagesCanBeIndexed() throws Exception { assertThat( documents, - hasItems( + containsInAnyOrder( allOf( hasKey("@timestamp"), hasKey("elasticsearch.cluster.name"), @@ -629,6 +628,81 @@ public void testCompatibleMessagesCanBeIndexed() throws Exception { } } + /** + * Check that deprecation messages can be recorded to an index + */ + public void testDeprecationIndexingCacheReset() throws Exception { + try { + configureWriteDeprecationLogsToIndex(true); + + final Request getRequest = createTestRequest("GET"); + assertOK(client().performRequest(getRequest)); + + client().performRequest(new Request("DELETE", "/_logging/deprecation_cache")); + + assertOK(client().performRequest(getRequest)); + + assertBusy(() -> { + Response response; + try { + client().performRequest(new Request("POST", "/" + DATA_STREAM_NAME + "/_refresh?ignore_unavailable=true")); + response = client().performRequest(new Request("GET", "/" + DATA_STREAM_NAME + "/_search")); + } catch (Exception e) { + // It can take a moment for the index to be created. If it doesn't exist then the client + // throws an exception. Translate it into an assertion error so that assertBusy() will + // continue trying. + throw new AssertionError(e); + } + assertOK(response); + + ObjectMapper mapper = new ObjectMapper(); + final JsonNode jsonNode = mapper.readTree(response.getEntity().getContent()); + + final int hits = jsonNode.at("/hits/total/value").intValue(); + assertThat(hits, greaterThan(0)); + + List> documents = new ArrayList<>(); + + for (int i = 0; i < hits; i++) { + final JsonNode hit = jsonNode.at("/hits/hits/" + i + "/_source"); + + final Map document = new HashMap<>(); + hit.fields().forEachRemaining(entry -> document.put(entry.getKey(), entry.getValue().textValue())); + + documents.add(document); + } + + logger.warn(documents); + assertThat(documents, hasSize(4)); + + assertThat( + documents, + containsInAnyOrder( + allOf( + hasEntry(KEY_FIELD_NAME, "deprecated_route_GET_/_test_cluster/deprecated_settings"), + hasEntry("message", "[/_test_cluster/deprecated_settings] exists for deprecated tests") + ), + allOf( + hasEntry(KEY_FIELD_NAME, "deprecated_route_GET_/_test_cluster/deprecated_settings"), + hasEntry("message", "[/_test_cluster/deprecated_settings] exists for deprecated tests") + ), + allOf( + hasEntry(KEY_FIELD_NAME, "deprecated_settings"), + hasEntry("message", "[deprecated_settings] usage is deprecated. use [settings] instead") + ), + allOf( + hasEntry(KEY_FIELD_NAME, "deprecated_settings"), + hasEntry("message", "[deprecated_settings] usage is deprecated. use [settings] instead") + ) + ) + ); + }, 30, TimeUnit.SECONDS); + } finally { + configureWriteDeprecationLogsToIndex(null); + client().performRequest(new Request("DELETE", "_data_stream/" + DATA_STREAM_NAME)); + } + } + private void configureWriteDeprecationLogsToIndex(Boolean value) throws IOException { final Request request = new Request("PUT", "_cluster/settings"); request.setJsonEntity("{ \"transient\": { \"cluster.deprecation_indexing.enabled\": " + value + " } }"); diff --git a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/Deprecation.java b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/Deprecation.java index da02e271935fe..61ac7808113f6 100644 --- a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/Deprecation.java +++ b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/Deprecation.java @@ -13,6 +13,7 @@ import org.elasticsearch.cluster.node.DiscoveryNodes; import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; +import org.elasticsearch.common.logging.RateLimitingFilter; import org.elasticsearch.common.settings.ClusterSettings; import org.elasticsearch.common.settings.IndexScopedSettings; import org.elasticsearch.common.settings.Setting; @@ -29,11 +30,13 @@ import org.elasticsearch.script.ScriptService; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.watcher.ResourceWatcherService; +import org.elasticsearch.xpack.deprecation.logging.DeprecationCacheResetAction; import org.elasticsearch.xpack.deprecation.logging.DeprecationIndexingComponent; import org.elasticsearch.xpack.deprecation.logging.DeprecationIndexingTemplateRegistry; +import org.elasticsearch.xpack.deprecation.logging.RestDeprecationCacheResetAction; +import org.elasticsearch.xpack.deprecation.logging.TransportDeprecationCacheResetAction; import java.util.Collection; -import java.util.Collections; import java.util.List; import java.util.function.Supplier; @@ -48,7 +51,8 @@ public class Deprecation extends Plugin implements ActionPlugin { public List> getActions() { return List.of( new ActionHandler<>(DeprecationInfoAction.INSTANCE, TransportDeprecationInfoAction.class), - new ActionHandler<>(NodesDeprecationCheckAction.INSTANCE, TransportNodeDeprecationCheckAction.class)); + new ActionHandler<>(NodesDeprecationCheckAction.INSTANCE, TransportNodeDeprecationCheckAction.class), + new ActionHandler<>(DeprecationCacheResetAction.INSTANCE, TransportDeprecationCacheResetAction.class)); } @Override @@ -58,7 +62,7 @@ public List getRestHandlers(Settings settings, RestController restC Supplier nodesInCluster) { - return Collections.singletonList(new RestDeprecationInfoAction()); + return List.of(new RestDeprecationInfoAction(), new RestDeprecationCacheResetAction()); } @Override @@ -79,10 +83,13 @@ public Collection createComponents( new DeprecationIndexingTemplateRegistry(environment.settings(), clusterService, threadPool, client, xContentRegistry); templateRegistry.initialize(); - final DeprecationIndexingComponent component = new DeprecationIndexingComponent(client, environment.settings()); + final RateLimitingFilter rateLimitingFilterForIndexing = new RateLimitingFilter(); + + final DeprecationIndexingComponent component = new DeprecationIndexingComponent(client, environment.settings(), + rateLimitingFilterForIndexing); clusterService.addListener(component); - return List.of(component); + return List.of(component, rateLimitingFilterForIndexing); } @Override diff --git a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/logging/DeprecationCacheResetAction.java b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/logging/DeprecationCacheResetAction.java new file mode 100644 index 0000000000000..1a88b04ac04d4 --- /dev/null +++ b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/logging/DeprecationCacheResetAction.java @@ -0,0 +1,137 @@ +/* + * 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.deprecation.logging; + +import org.elasticsearch.action.ActionType; +import org.elasticsearch.action.FailedNodeException; +import org.elasticsearch.action.support.nodes.BaseNodeResponse; +import org.elasticsearch.action.support.nodes.BaseNodesRequest; +import org.elasticsearch.action.support.nodes.BaseNodesResponse; +import org.elasticsearch.cluster.ClusterName; +import org.elasticsearch.cluster.node.DiscoveryNode; +import org.elasticsearch.common.io.stream.StreamInput; +import org.elasticsearch.common.io.stream.StreamOutput; +import org.elasticsearch.common.io.stream.Writeable; +import org.elasticsearch.common.xcontent.ToXContentObject; +import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.transport.TransportRequest; + +import java.io.IOException; +import java.util.List; +import java.util.Objects; + +/** + Resets deprecation indexing rate limiting cache on each node. + */ +public class DeprecationCacheResetAction extends ActionType { + public static final DeprecationCacheResetAction INSTANCE = new DeprecationCacheResetAction(); + public static final String NAME = "cluster:admin/deprecation/cache/reset"; + + private DeprecationCacheResetAction() { + super(NAME, Response::new); + } + + public static class Request extends BaseNodesRequest implements ToXContentObject { + public Request() { + super((String[]) null); + } + + public Request(StreamInput in) throws IOException { + super(in); + } + + @Override + public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { + builder.startObject(); + builder.endObject(); + return builder; + } + + @Override + public int hashCode() { + // Nothing to hash atm, so just use the action name + return Objects.hashCode(NAME); + } + + @Override + public boolean equals(Object obj) { + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + return true; + } + } + + public static class Response extends BaseNodesResponse implements Writeable, ToXContentObject { + public Response(StreamInput in) throws IOException { + super(in); + } + + public Response(ClusterName clusterName, List nodes, List failures) { + super(clusterName, nodes, failures); + } + + @Override + protected List readNodesFrom(StreamInput in) throws IOException { + return in.readList(NodeResponse::new); + } + + @Override + protected void writeNodesTo(StreamOutput out, List nodes) throws IOException { + out.writeList(nodes); + } + + @Override + public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { + return builder; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + Response that = (Response) o; + return Objects.equals(getNodes(), that.getNodes()) && Objects.equals(failures(), that.failures()); + } + + @Override + public int hashCode() { + return Objects.hash(getNodes(), failures()); + } + } + + public static class NodeRequest extends TransportRequest { + public NodeRequest(StreamInput in) throws IOException { + super(in); + } + + public NodeRequest(Request request) { + } + } + + public static class NodeResponse extends BaseNodeResponse { + + + protected NodeResponse(StreamInput in) throws IOException { + super(in); + } + + protected NodeResponse(DiscoveryNode node ) { + super(node); + + } + + @Override + public void writeTo(StreamOutput out) throws IOException { + super.writeTo(out); + } + } +} diff --git a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/logging/DeprecationIndexingComponent.java b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/logging/DeprecationIndexingComponent.java index 84ec52651b30d..96aac9115fc08 100644 --- a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/logging/DeprecationIndexingComponent.java +++ b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/logging/DeprecationIndexingComponent.java @@ -56,9 +56,11 @@ public class DeprecationIndexingComponent extends AbstractLifecycleComponent imp private final DeprecationIndexingAppender appender; private final BulkProcessor processor; - private final RateLimitingFilter filter; + private final RateLimitingFilter rateLimitingFilterForIndexing; + + public DeprecationIndexingComponent(Client client, Settings settings, RateLimitingFilter rateLimitingFilterForIndexing) { + this.rateLimitingFilterForIndexing = rateLimitingFilterForIndexing; - public DeprecationIndexingComponent(Client client, Settings settings) { this.processor = getBulkProcessor(new OriginSettingClient(client, ClientHelper.DEPRECATION_ORIGIN), settings); final Consumer consumer = this.processor::add; @@ -70,8 +72,8 @@ public DeprecationIndexingComponent(Client client, Settings settings) { .setConfiguration(configuration) .build(); - this.filter = new RateLimitingFilter(); - this.appender = new DeprecationIndexingAppender("deprecation_indexing_appender", filter, ecsLayout, consumer); + this.appender = new DeprecationIndexingAppender("deprecation_indexing_appender", + rateLimitingFilterForIndexing, ecsLayout, consumer); } @Override @@ -106,7 +108,7 @@ public void clusterChanged(ClusterChangedEvent event) { // We've flipped from disabled to enabled. Make sure we start with a clean cache of // previously-seen keys, otherwise we won't index anything. if (newEnabled) { - this.filter.reset(); + this.rateLimitingFilterForIndexing.reset(); } appender.setEnabled(newEnabled); } diff --git a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/logging/RestDeprecationCacheResetAction.java b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/logging/RestDeprecationCacheResetAction.java new file mode 100644 index 0000000000000..0515ac614c45b --- /dev/null +++ b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/logging/RestDeprecationCacheResetAction.java @@ -0,0 +1,37 @@ +/* + * 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.deprecation.logging; + +import org.elasticsearch.client.node.NodeClient; +import org.elasticsearch.rest.BaseRestHandler; +import org.elasticsearch.rest.RestRequest; +import org.elasticsearch.rest.action.RestToXContentListener; + +import java.io.IOException; +import java.util.List; + +import static org.elasticsearch.rest.RestRequest.Method.DELETE; + +public class RestDeprecationCacheResetAction extends BaseRestHandler { + + @Override + public List routes() { + return List.of(new Route(DELETE, "/_logging/deprecation_cache")); + } + + @Override + public String getName() { + return "reset_deprecation_cache"; + } + + @Override + public RestChannelConsumer prepareRequest(RestRequest request, NodeClient client) throws IOException { + DeprecationCacheResetAction.Request resetRequest = new DeprecationCacheResetAction.Request(); + return channel -> client.execute(DeprecationCacheResetAction.INSTANCE, resetRequest, new RestToXContentListener<>(channel)); + } +} diff --git a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/logging/TransportDeprecationCacheResetAction.java b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/logging/TransportDeprecationCacheResetAction.java new file mode 100644 index 0000000000000..6bb68bf262008 --- /dev/null +++ b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/logging/TransportDeprecationCacheResetAction.java @@ -0,0 +1,74 @@ +/* + * 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.deprecation.logging; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.elasticsearch.action.FailedNodeException; +import org.elasticsearch.action.support.ActionFilters; +import org.elasticsearch.action.support.nodes.TransportNodesAction; +import org.elasticsearch.cluster.node.DiscoveryNode; +import org.elasticsearch.cluster.service.ClusterService; +import org.elasticsearch.common.inject.Inject; +import org.elasticsearch.common.io.stream.StreamInput; +import org.elasticsearch.common.logging.RateLimitingFilter; +import org.elasticsearch.tasks.Task; +import org.elasticsearch.threadpool.ThreadPool; +import org.elasticsearch.transport.TransportService; + +import java.io.IOException; +import java.util.List; + +public class TransportDeprecationCacheResetAction + extends TransportNodesAction { + + private static final Logger logger = LogManager.getLogger(TransportDeprecationCacheResetAction.class); + + private final RateLimitingFilter rateLimitingFilterForIndexing; + + @Inject + public TransportDeprecationCacheResetAction(ThreadPool threadPool, + ClusterService clusterService, + TransportService transportService, + ActionFilters actionFilters, + RateLimitingFilter rateLimitingFilterForIndexing) { + super(DeprecationCacheResetAction.NAME, threadPool, clusterService, transportService, actionFilters, + DeprecationCacheResetAction.Request::new, + DeprecationCacheResetAction.NodeRequest::new, + ThreadPool.Names.MANAGEMENT, + DeprecationCacheResetAction.NodeResponse.class); + this.rateLimitingFilterForIndexing = rateLimitingFilterForIndexing; + } + + @Override + protected DeprecationCacheResetAction.Response newResponse(DeprecationCacheResetAction.Request request, + List nodeResponses, + List failures) { + return new DeprecationCacheResetAction.Response(clusterService.getClusterName(), nodeResponses, failures); + } + + @Override + protected DeprecationCacheResetAction.NodeRequest newNodeRequest(DeprecationCacheResetAction.Request request) { + return new DeprecationCacheResetAction.NodeRequest(request); + } + + @Override + protected DeprecationCacheResetAction.NodeResponse newNodeResponse(StreamInput in, DiscoveryNode node) throws IOException { + return new DeprecationCacheResetAction.NodeResponse(in); + } + + @Override + protected DeprecationCacheResetAction.NodeResponse nodeOperation(DeprecationCacheResetAction.NodeRequest request, Task task) { + rateLimitingFilterForIndexing.reset(); + logger.debug( "Deprecation cache was reset"); + return new DeprecationCacheResetAction.NodeResponse(transportService.getLocalNode()); + } +} diff --git a/x-pack/plugin/security/qa/operator-privileges-tests/src/javaRestTest/java/org/elasticsearch/xpack/security/operator/Constants.java b/x-pack/plugin/security/qa/operator-privileges-tests/src/javaRestTest/java/org/elasticsearch/xpack/security/operator/Constants.java index 1d854704df4d8..6f7754a65a9a2 100644 --- a/x-pack/plugin/security/qa/operator-privileges-tests/src/javaRestTest/java/org/elasticsearch/xpack/security/operator/Constants.java +++ b/x-pack/plugin/security/qa/operator-privileges-tests/src/javaRestTest/java/org/elasticsearch/xpack/security/operator/Constants.java @@ -25,6 +25,7 @@ public class Constants { "cluster:admin/data_frame/start", "cluster:admin/data_frame/stop", "cluster:admin/data_frame/update", + "cluster:admin/deprecation/cache/reset", "cluster:admin/ilm/_move/post", "cluster:admin/ilm/delete", "cluster:admin/ilm/get", From ea7d3f929d955c7e19cf0ae38f26ec472e6fbc8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Fern=C3=A1ndez=20Casta=C3=B1o?= Date: Fri, 1 Oct 2021 12:00:29 +0200 Subject: [PATCH 095/250] Check for global blocks after IndexNotFoundException in TransportMasterNodeAction (#78128) Today we try to resolve index patterns to check cluster blocks in certain TransportMasterNodeActions, in some scenarios where a master node is recovering we could end up throwing a false IndexNotFoundException. This commit adds an extra check for global blocks when a IndexNotFoundException is thrown to ensure that we cover that case. Closes #70572 --- .../master/TransportMasterNodeAction.java | 23 ++++- .../TransportMasterNodeActionTests.java | 99 ++++++++++++++++++- 2 files changed, 118 insertions(+), 4 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/action/support/master/TransportMasterNodeAction.java b/server/src/main/java/org/elasticsearch/action/support/master/TransportMasterNodeAction.java index c0fb80cd8830a..b227a5616cd28 100644 --- a/server/src/main/java/org/elasticsearch/action/support/master/TransportMasterNodeAction.java +++ b/server/src/main/java/org/elasticsearch/action/support/master/TransportMasterNodeAction.java @@ -21,7 +21,9 @@ import org.elasticsearch.cluster.ClusterStateObserver; import org.elasticsearch.cluster.MasterNodeChangePredicate; import org.elasticsearch.cluster.NotMasterException; +import org.elasticsearch.cluster.block.ClusterBlock; import org.elasticsearch.cluster.block.ClusterBlockException; +import org.elasticsearch.cluster.block.ClusterBlockLevel; import org.elasticsearch.cluster.coordination.FailedToCommitClusterStateException; import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; import org.elasticsearch.cluster.node.DiscoveryNode; @@ -30,6 +32,8 @@ import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.TimeValue; import org.elasticsearch.discovery.MasterNotDiscoveredException; +import org.elasticsearch.gateway.GatewayService; +import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.node.NodeClosedException; import org.elasticsearch.tasks.CancellableTask; import org.elasticsearch.tasks.Task; @@ -99,6 +103,21 @@ protected boolean localExecute(Request request) { protected abstract ClusterBlockException checkBlock(Request request, ClusterState state); + private ClusterBlockException checkBlockIfStateRecovered(Request request, ClusterState state) { + try { + return checkBlock(request, state); + } catch (IndexNotFoundException e) { + if (state.blocks().hasGlobalBlock(GatewayService.STATE_NOT_RECOVERED_BLOCK)) { + // no index metadata is exposed yet, but checkBlock depends on an index, so keep trying until the cluster forms + assert GatewayService.STATE_NOT_RECOVERED_BLOCK.contains(ClusterBlockLevel.METADATA_READ); + assert state.blocks().global(ClusterBlockLevel.METADATA_READ).stream().allMatch(ClusterBlock::retryable); + return state.blocks().globalBlockedException(ClusterBlockLevel.METADATA_READ); + } else { + throw e; + } + } + } + @Override protected void doExecute(Task task, final Request request, ActionListener listener) { ClusterState state = clusterService.state(); @@ -133,7 +152,7 @@ protected void doStart(ClusterState clusterState) { final DiscoveryNodes nodes = clusterState.nodes(); if (nodes.isLocalNodeElectedMaster() || localExecute(request)) { // check for block, if blocked, retry, else, execute locally - final ClusterBlockException blockException = checkBlock(request, clusterState); + final ClusterBlockException blockException = checkBlockIfStateRecovered(request, clusterState); if (blockException != null) { if (blockException.retryable() == false) { logger.trace("can't execute due to a non-retryable cluster block", blockException); @@ -142,7 +161,7 @@ protected void doStart(ClusterState clusterState) { logger.debug("can't execute due to a cluster block, retrying", blockException); retry(clusterState, blockException, newState -> { try { - ClusterBlockException newException = checkBlock(request, newState); + ClusterBlockException newException = checkBlockIfStateRecovered(request, newState); return (newException == null || newException.retryable() == false); } catch (Exception e) { // accept state as block will be rechecked by doStart() and listener.onFailure() then called diff --git a/server/src/test/java/org/elasticsearch/action/support/master/TransportMasterNodeActionTests.java b/server/src/test/java/org/elasticsearch/action/support/master/TransportMasterNodeActionTests.java index 957e068a43a71..fe926d20299b3 100644 --- a/server/src/test/java/org/elasticsearch/action/support/master/TransportMasterNodeActionTests.java +++ b/server/src/test/java/org/elasticsearch/action/support/master/TransportMasterNodeActionTests.java @@ -13,8 +13,10 @@ import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionResponse; +import org.elasticsearch.action.IndicesRequest; import org.elasticsearch.action.support.ActionFilters; import org.elasticsearch.action.support.ActionTestUtils; +import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.PlainActionFuture; import org.elasticsearch.action.support.ThreadedActionListener; import org.elasticsearch.action.support.replication.ClusterStateCreationUtils; @@ -25,15 +27,19 @@ import org.elasticsearch.cluster.block.ClusterBlockLevel; import org.elasticsearch.cluster.block.ClusterBlocks; import org.elasticsearch.cluster.coordination.FailedToCommitClusterStateException; +import org.elasticsearch.cluster.metadata.IndexMetadata; +import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; +import org.elasticsearch.cluster.metadata.Metadata; import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.node.DiscoveryNodeRole; import org.elasticsearch.cluster.node.DiscoveryNodes; import org.elasticsearch.cluster.service.ClusterService; +import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor; +import org.elasticsearch.core.TimeValue; import org.elasticsearch.discovery.MasterNotDiscoveredException; import org.elasticsearch.indices.TestIndexNameExpressionResolver; import org.elasticsearch.node.NodeClosedException; @@ -65,6 +71,7 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; +import static org.elasticsearch.gateway.GatewayService.STATE_NOT_RECOVERED_BLOCK; import static org.elasticsearch.test.ClusterServiceUtils.createClusterService; import static org.elasticsearch.test.ClusterServiceUtils.setState; import static org.hamcrest.Matchers.equalTo; @@ -124,7 +131,9 @@ void assertListenerThrows(String msg, ActionFuture listener, Class klass) } } - public static class Request extends MasterNodeRequest { + public static class Request extends MasterNodeRequest implements IndicesRequest.Replaceable { + private String[] indices = Strings.EMPTY_ARRAY; + Request() {} Request(StreamInput in) throws IOException { @@ -140,6 +149,22 @@ public ActionRequestValidationException validate() { public Task createTask(long id, String type, String action, TaskId parentTaskId, Map headers) { return new CancellableTask(id, type, action, "", parentTaskId, headers); } + + @Override + public String[] indices() { + return indices; + } + + @Override + public IndicesOptions indicesOptions() { + return IndicesOptions.strictExpandOpen(); + } + + @Override + public IndicesRequest indices(String... indices) { + this.indices = indices; + return this; + } } class Response extends ActionResponse { @@ -568,6 +593,76 @@ public void testTaskCancellationOnceActionItIsDispatchedToMaster() throws Except expectThrows(CancellationException.class, listener::actionGet); } + public void testGlobalBlocksAreCheckedAfterIndexNotFoundException() throws Exception { + Request request = new Request().masterNodeTimeout(TimeValue.timeValueSeconds(60)); + String indexRequestName = "my-index"; + request.indices(indexRequestName); + + ClusterState stateWithBlockWithoutIndexMetadata = + ClusterState.builder(ClusterStateCreationUtils.state(localNode, localNode, allNodes)) + .blocks(ClusterBlocks.builder().addGlobalBlock(STATE_NOT_RECOVERED_BLOCK)) + .build(); + setState(clusterService, stateWithBlockWithoutIndexMetadata); + + Action action = new Action("internal:testAction", transportService, clusterService, threadPool, ThreadPool.Names.SAME) { + final IndexNameExpressionResolver indexNameExpressionResolver = TestIndexNameExpressionResolver.newInstance(); + + @Override + protected ClusterBlockException checkBlock(Request request, ClusterState state) { + return state.blocks().indicesBlockedException(ClusterBlockLevel.METADATA_READ, + indexNameExpressionResolver.concreteIndexNamesWithSystemIndexAccess(state, request)); + } + + }; + + PlainActionFuture listener = new PlainActionFuture<>(); + ActionTestUtils.execute(action, null, request, listener); + + assertFalse(listener.isDone()); + IndexMetadata.Builder indexMetadataBuilder = + IndexMetadata.builder(indexRequestName) + .settings(settings(Version.CURRENT)) + .numberOfShards(1) + .numberOfReplicas(0); + ClusterState clusterStateWithoutBlocks = ClusterState.builder(ClusterStateCreationUtils.state(localNode, localNode, allNodes)) + .metadata(Metadata.builder().put(indexMetadataBuilder).build()) + .blocks(ClusterBlocks.EMPTY_CLUSTER_BLOCK) + .build(); + setState(clusterService, clusterStateWithoutBlocks); + assertTrue(listener.isDone()); + listener.get(); + } + + public void testGlobalBlocksAreCheckedAfterIndexNotFoundExceptionTimesOutIfIndexIsNotFound() { + Request request = new Request().masterNodeTimeout(TimeValue.timeValueMillis(50)); + String indexRequestName = "my-index"; + request.indices(indexRequestName); + + ClusterState stateWithBlockWithoutIndexMetadata = + ClusterState.builder(ClusterStateCreationUtils.state(localNode, localNode, allNodes)) + .blocks(ClusterBlocks.builder().addGlobalBlock(STATE_NOT_RECOVERED_BLOCK)) + .build(); + setState(clusterService, stateWithBlockWithoutIndexMetadata); + + Action action = new Action("internal:testAction", transportService, clusterService, threadPool, ThreadPool.Names.SAME) { + final IndexNameExpressionResolver indexNameExpressionResolver = TestIndexNameExpressionResolver.newInstance(); + + @Override + protected ClusterBlockException checkBlock(Request request, ClusterState state) { + return state.blocks().indicesBlockedException(ClusterBlockLevel.METADATA_READ, + indexNameExpressionResolver.concreteIndexNamesWithSystemIndexAccess(state, request)); + } + + }; + + PlainActionFuture listener = new PlainActionFuture<>(); + ActionTestUtils.execute(action, null, request, listener); + + ExecutionException ex = expectThrows(ExecutionException.class, listener::get); + assertThat(ex.getCause(), instanceOf(MasterNotDiscoveredException.class)); + assertThat(ex.getCause().getCause(), instanceOf(ClusterBlockException.class)); + } + private Runnable blockAllThreads(String executorName) throws Exception { final int numberOfThreads = threadPool.info(executorName).getMax(); final EsThreadPoolExecutor executor = (EsThreadPoolExecutor) threadPool.executor(executorName); From 92db6a62c0b7f827e25cb992da5bac9cfdf43f34 Mon Sep 17 00:00:00 2001 From: Alan Woodward Date: Fri, 1 Oct 2021 12:07:42 +0100 Subject: [PATCH 096/250] Update to new lucene snapshot (#78548) Includes the following changes: - Updates to prevent package splits in ES: LUCENE-10118, LUCENE-10132 - Speedups in writing doc values: LUCENE-10127, LUCENE-10123, LUCENE-10125 - Speedups in writing primitives: LUCENE-10125 - Sort-after bugfixes: LUCENE-10126 --- build-tools-internal/version.properties | 2 +- .../lucene-expressions-9.0.0-snapshot-94c6e261274.jar.sha1 | 1 - .../lucene-expressions-9.0.0-snapshot-cb366d04d4a.jar.sha1 | 1 + .../lucene-analysis-icu-9.0.0-snapshot-94c6e261274.jar.sha1 | 1 - .../lucene-analysis-icu-9.0.0-snapshot-cb366d04d4a.jar.sha1 | 1 + ...lucene-analysis-kuromoji-9.0.0-snapshot-94c6e261274.jar.sha1 | 1 - ...lucene-analysis-kuromoji-9.0.0-snapshot-cb366d04d4a.jar.sha1 | 1 + .../lucene-analysis-nori-9.0.0-snapshot-94c6e261274.jar.sha1 | 1 - .../lucene-analysis-nori-9.0.0-snapshot-cb366d04d4a.jar.sha1 | 1 + ...lucene-analysis-phonetic-9.0.0-snapshot-94c6e261274.jar.sha1 | 1 - ...lucene-analysis-phonetic-9.0.0-snapshot-cb366d04d4a.jar.sha1 | 1 + .../lucene-analysis-smartcn-9.0.0-snapshot-94c6e261274.jar.sha1 | 1 - .../lucene-analysis-smartcn-9.0.0-snapshot-cb366d04d4a.jar.sha1 | 1 + .../lucene-analysis-stempel-9.0.0-snapshot-94c6e261274.jar.sha1 | 1 - .../lucene-analysis-stempel-9.0.0-snapshot-cb366d04d4a.jar.sha1 | 1 + ...cene-analysis-morfologik-9.0.0-snapshot-94c6e261274.jar.sha1 | 1 - ...cene-analysis-morfologik-9.0.0-snapshot-cb366d04d4a.jar.sha1 | 1 + .../lucene-analysis-common-9.0.0-snapshot-94c6e261274.jar.sha1 | 1 - .../lucene-analysis-common-9.0.0-snapshot-cb366d04d4a.jar.sha1 | 1 + .../lucene-backward-codecs-9.0.0-snapshot-94c6e261274.jar.sha1 | 1 - .../lucene-backward-codecs-9.0.0-snapshot-cb366d04d4a.jar.sha1 | 1 + server/licenses/lucene-core-9.0.0-snapshot-94c6e261274.jar.sha1 | 1 - server/licenses/lucene-core-9.0.0-snapshot-cb366d04d4a.jar.sha1 | 1 + .../lucene-grouping-9.0.0-snapshot-94c6e261274.jar.sha1 | 1 - .../lucene-grouping-9.0.0-snapshot-cb366d04d4a.jar.sha1 | 1 + .../lucene-highlighter-9.0.0-snapshot-94c6e261274.jar.sha1 | 1 - .../lucene-highlighter-9.0.0-snapshot-cb366d04d4a.jar.sha1 | 1 + server/licenses/lucene-join-9.0.0-snapshot-94c6e261274.jar.sha1 | 1 - server/licenses/lucene-join-9.0.0-snapshot-cb366d04d4a.jar.sha1 | 1 + .../licenses/lucene-memory-9.0.0-snapshot-94c6e261274.jar.sha1 | 1 - .../licenses/lucene-memory-9.0.0-snapshot-cb366d04d4a.jar.sha1 | 1 + server/licenses/lucene-misc-9.0.0-snapshot-94c6e261274.jar.sha1 | 1 - server/licenses/lucene-misc-9.0.0-snapshot-cb366d04d4a.jar.sha1 | 1 + .../licenses/lucene-queries-9.0.0-snapshot-94c6e261274.jar.sha1 | 1 - .../licenses/lucene-queries-9.0.0-snapshot-cb366d04d4a.jar.sha1 | 1 + .../lucene-queryparser-9.0.0-snapshot-94c6e261274.jar.sha1 | 1 - .../lucene-queryparser-9.0.0-snapshot-cb366d04d4a.jar.sha1 | 1 + .../licenses/lucene-sandbox-9.0.0-snapshot-94c6e261274.jar.sha1 | 1 - .../licenses/lucene-sandbox-9.0.0-snapshot-cb366d04d4a.jar.sha1 | 1 + .../lucene-spatial-extras-9.0.0-snapshot-94c6e261274.jar.sha1 | 1 - .../lucene-spatial-extras-9.0.0-snapshot-cb366d04d4a.jar.sha1 | 1 + .../lucene-spatial3d-9.0.0-snapshot-94c6e261274.jar.sha1 | 1 - .../lucene-spatial3d-9.0.0-snapshot-cb366d04d4a.jar.sha1 | 1 + .../licenses/lucene-suggest-9.0.0-snapshot-94c6e261274.jar.sha1 | 1 - .../licenses/lucene-suggest-9.0.0-snapshot-cb366d04d4a.jar.sha1 | 1 + .../licenses/lucene-core-9.0.0-snapshot-94c6e261274.jar.sha1 | 1 - .../licenses/lucene-core-9.0.0-snapshot-cb366d04d4a.jar.sha1 | 1 + 47 files changed, 24 insertions(+), 24 deletions(-) delete mode 100644 modules/lang-expression/licenses/lucene-expressions-9.0.0-snapshot-94c6e261274.jar.sha1 create mode 100644 modules/lang-expression/licenses/lucene-expressions-9.0.0-snapshot-cb366d04d4a.jar.sha1 delete mode 100644 plugins/analysis-icu/licenses/lucene-analysis-icu-9.0.0-snapshot-94c6e261274.jar.sha1 create mode 100644 plugins/analysis-icu/licenses/lucene-analysis-icu-9.0.0-snapshot-cb366d04d4a.jar.sha1 delete mode 100644 plugins/analysis-kuromoji/licenses/lucene-analysis-kuromoji-9.0.0-snapshot-94c6e261274.jar.sha1 create mode 100644 plugins/analysis-kuromoji/licenses/lucene-analysis-kuromoji-9.0.0-snapshot-cb366d04d4a.jar.sha1 delete mode 100644 plugins/analysis-nori/licenses/lucene-analysis-nori-9.0.0-snapshot-94c6e261274.jar.sha1 create mode 100644 plugins/analysis-nori/licenses/lucene-analysis-nori-9.0.0-snapshot-cb366d04d4a.jar.sha1 delete mode 100644 plugins/analysis-phonetic/licenses/lucene-analysis-phonetic-9.0.0-snapshot-94c6e261274.jar.sha1 create mode 100644 plugins/analysis-phonetic/licenses/lucene-analysis-phonetic-9.0.0-snapshot-cb366d04d4a.jar.sha1 delete mode 100644 plugins/analysis-smartcn/licenses/lucene-analysis-smartcn-9.0.0-snapshot-94c6e261274.jar.sha1 create mode 100644 plugins/analysis-smartcn/licenses/lucene-analysis-smartcn-9.0.0-snapshot-cb366d04d4a.jar.sha1 delete mode 100644 plugins/analysis-stempel/licenses/lucene-analysis-stempel-9.0.0-snapshot-94c6e261274.jar.sha1 create mode 100644 plugins/analysis-stempel/licenses/lucene-analysis-stempel-9.0.0-snapshot-cb366d04d4a.jar.sha1 delete mode 100644 plugins/analysis-ukrainian/licenses/lucene-analysis-morfologik-9.0.0-snapshot-94c6e261274.jar.sha1 create mode 100644 plugins/analysis-ukrainian/licenses/lucene-analysis-morfologik-9.0.0-snapshot-cb366d04d4a.jar.sha1 delete mode 100644 server/licenses/lucene-analysis-common-9.0.0-snapshot-94c6e261274.jar.sha1 create mode 100644 server/licenses/lucene-analysis-common-9.0.0-snapshot-cb366d04d4a.jar.sha1 delete mode 100644 server/licenses/lucene-backward-codecs-9.0.0-snapshot-94c6e261274.jar.sha1 create mode 100644 server/licenses/lucene-backward-codecs-9.0.0-snapshot-cb366d04d4a.jar.sha1 delete mode 100644 server/licenses/lucene-core-9.0.0-snapshot-94c6e261274.jar.sha1 create mode 100644 server/licenses/lucene-core-9.0.0-snapshot-cb366d04d4a.jar.sha1 delete mode 100644 server/licenses/lucene-grouping-9.0.0-snapshot-94c6e261274.jar.sha1 create mode 100644 server/licenses/lucene-grouping-9.0.0-snapshot-cb366d04d4a.jar.sha1 delete mode 100644 server/licenses/lucene-highlighter-9.0.0-snapshot-94c6e261274.jar.sha1 create mode 100644 server/licenses/lucene-highlighter-9.0.0-snapshot-cb366d04d4a.jar.sha1 delete mode 100644 server/licenses/lucene-join-9.0.0-snapshot-94c6e261274.jar.sha1 create mode 100644 server/licenses/lucene-join-9.0.0-snapshot-cb366d04d4a.jar.sha1 delete mode 100644 server/licenses/lucene-memory-9.0.0-snapshot-94c6e261274.jar.sha1 create mode 100644 server/licenses/lucene-memory-9.0.0-snapshot-cb366d04d4a.jar.sha1 delete mode 100644 server/licenses/lucene-misc-9.0.0-snapshot-94c6e261274.jar.sha1 create mode 100644 server/licenses/lucene-misc-9.0.0-snapshot-cb366d04d4a.jar.sha1 delete mode 100644 server/licenses/lucene-queries-9.0.0-snapshot-94c6e261274.jar.sha1 create mode 100644 server/licenses/lucene-queries-9.0.0-snapshot-cb366d04d4a.jar.sha1 delete mode 100644 server/licenses/lucene-queryparser-9.0.0-snapshot-94c6e261274.jar.sha1 create mode 100644 server/licenses/lucene-queryparser-9.0.0-snapshot-cb366d04d4a.jar.sha1 delete mode 100644 server/licenses/lucene-sandbox-9.0.0-snapshot-94c6e261274.jar.sha1 create mode 100644 server/licenses/lucene-sandbox-9.0.0-snapshot-cb366d04d4a.jar.sha1 delete mode 100644 server/licenses/lucene-spatial-extras-9.0.0-snapshot-94c6e261274.jar.sha1 create mode 100644 server/licenses/lucene-spatial-extras-9.0.0-snapshot-cb366d04d4a.jar.sha1 delete mode 100644 server/licenses/lucene-spatial3d-9.0.0-snapshot-94c6e261274.jar.sha1 create mode 100644 server/licenses/lucene-spatial3d-9.0.0-snapshot-cb366d04d4a.jar.sha1 delete mode 100644 server/licenses/lucene-suggest-9.0.0-snapshot-94c6e261274.jar.sha1 create mode 100644 server/licenses/lucene-suggest-9.0.0-snapshot-cb366d04d4a.jar.sha1 delete mode 100644 x-pack/plugin/sql/sql-action/licenses/lucene-core-9.0.0-snapshot-94c6e261274.jar.sha1 create mode 100644 x-pack/plugin/sql/sql-action/licenses/lucene-core-9.0.0-snapshot-cb366d04d4a.jar.sha1 diff --git a/build-tools-internal/version.properties b/build-tools-internal/version.properties index 97d4304babf32..ed298c2d05826 100644 --- a/build-tools-internal/version.properties +++ b/build-tools-internal/version.properties @@ -1,5 +1,5 @@ elasticsearch = 8.0.0 -lucene = 9.0.0-snapshot-94c6e261274 +lucene = 9.0.0-snapshot-cb366d04d4a bundled_jdk_vendor = adoptium bundled_jdk = 17+35 diff --git a/modules/lang-expression/licenses/lucene-expressions-9.0.0-snapshot-94c6e261274.jar.sha1 b/modules/lang-expression/licenses/lucene-expressions-9.0.0-snapshot-94c6e261274.jar.sha1 deleted file mode 100644 index e9476d5cd1f0a..0000000000000 --- a/modules/lang-expression/licenses/lucene-expressions-9.0.0-snapshot-94c6e261274.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -0174a3ab0be10b5dc00752c61f26a8a5800bed36 \ No newline at end of file diff --git a/modules/lang-expression/licenses/lucene-expressions-9.0.0-snapshot-cb366d04d4a.jar.sha1 b/modules/lang-expression/licenses/lucene-expressions-9.0.0-snapshot-cb366d04d4a.jar.sha1 new file mode 100644 index 0000000000000..63d75948fbf93 --- /dev/null +++ b/modules/lang-expression/licenses/lucene-expressions-9.0.0-snapshot-cb366d04d4a.jar.sha1 @@ -0,0 +1 @@ +dbc1dfff091ee7e26ea702b2ce3000874f47498f \ No newline at end of file diff --git a/plugins/analysis-icu/licenses/lucene-analysis-icu-9.0.0-snapshot-94c6e261274.jar.sha1 b/plugins/analysis-icu/licenses/lucene-analysis-icu-9.0.0-snapshot-94c6e261274.jar.sha1 deleted file mode 100644 index f0340828b0340..0000000000000 --- a/plugins/analysis-icu/licenses/lucene-analysis-icu-9.0.0-snapshot-94c6e261274.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -da7d355727b519c880b0ff9a05b659c7f9438200 \ No newline at end of file diff --git a/plugins/analysis-icu/licenses/lucene-analysis-icu-9.0.0-snapshot-cb366d04d4a.jar.sha1 b/plugins/analysis-icu/licenses/lucene-analysis-icu-9.0.0-snapshot-cb366d04d4a.jar.sha1 new file mode 100644 index 0000000000000..8bcd9c616ef0d --- /dev/null +++ b/plugins/analysis-icu/licenses/lucene-analysis-icu-9.0.0-snapshot-cb366d04d4a.jar.sha1 @@ -0,0 +1 @@ +e1904eff8c61f665ba58bf8d62b2bb2dacbb3382 \ No newline at end of file diff --git a/plugins/analysis-kuromoji/licenses/lucene-analysis-kuromoji-9.0.0-snapshot-94c6e261274.jar.sha1 b/plugins/analysis-kuromoji/licenses/lucene-analysis-kuromoji-9.0.0-snapshot-94c6e261274.jar.sha1 deleted file mode 100644 index ab09b6118ca04..0000000000000 --- a/plugins/analysis-kuromoji/licenses/lucene-analysis-kuromoji-9.0.0-snapshot-94c6e261274.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -a0fa5ee2807dbea77129931b774a29965c8f30f5 \ No newline at end of file diff --git a/plugins/analysis-kuromoji/licenses/lucene-analysis-kuromoji-9.0.0-snapshot-cb366d04d4a.jar.sha1 b/plugins/analysis-kuromoji/licenses/lucene-analysis-kuromoji-9.0.0-snapshot-cb366d04d4a.jar.sha1 new file mode 100644 index 0000000000000..2b96563efe218 --- /dev/null +++ b/plugins/analysis-kuromoji/licenses/lucene-analysis-kuromoji-9.0.0-snapshot-cb366d04d4a.jar.sha1 @@ -0,0 +1 @@ +24ed585c98f61ccaec11116c2ce3ca0cf5ae66d6 \ No newline at end of file diff --git a/plugins/analysis-nori/licenses/lucene-analysis-nori-9.0.0-snapshot-94c6e261274.jar.sha1 b/plugins/analysis-nori/licenses/lucene-analysis-nori-9.0.0-snapshot-94c6e261274.jar.sha1 deleted file mode 100644 index 17d9bf4332c5d..0000000000000 --- a/plugins/analysis-nori/licenses/lucene-analysis-nori-9.0.0-snapshot-94c6e261274.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -e7c4b513803d0a410adfbefa4dbc3f9299d9d12f \ No newline at end of file diff --git a/plugins/analysis-nori/licenses/lucene-analysis-nori-9.0.0-snapshot-cb366d04d4a.jar.sha1 b/plugins/analysis-nori/licenses/lucene-analysis-nori-9.0.0-snapshot-cb366d04d4a.jar.sha1 new file mode 100644 index 0000000000000..28300f0d1d035 --- /dev/null +++ b/plugins/analysis-nori/licenses/lucene-analysis-nori-9.0.0-snapshot-cb366d04d4a.jar.sha1 @@ -0,0 +1 @@ +0189fe890f93d36623cd4006ab080a3b324dcb84 \ No newline at end of file diff --git a/plugins/analysis-phonetic/licenses/lucene-analysis-phonetic-9.0.0-snapshot-94c6e261274.jar.sha1 b/plugins/analysis-phonetic/licenses/lucene-analysis-phonetic-9.0.0-snapshot-94c6e261274.jar.sha1 deleted file mode 100644 index 350094537bcd1..0000000000000 --- a/plugins/analysis-phonetic/licenses/lucene-analysis-phonetic-9.0.0-snapshot-94c6e261274.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -bbde91b5cf72da16deb24e4bfc824df19beb50dc \ No newline at end of file diff --git a/plugins/analysis-phonetic/licenses/lucene-analysis-phonetic-9.0.0-snapshot-cb366d04d4a.jar.sha1 b/plugins/analysis-phonetic/licenses/lucene-analysis-phonetic-9.0.0-snapshot-cb366d04d4a.jar.sha1 new file mode 100644 index 0000000000000..3fc095c5c03d2 --- /dev/null +++ b/plugins/analysis-phonetic/licenses/lucene-analysis-phonetic-9.0.0-snapshot-cb366d04d4a.jar.sha1 @@ -0,0 +1 @@ +88121f7c81bd5107b685ef16912435777739d17e \ No newline at end of file diff --git a/plugins/analysis-smartcn/licenses/lucene-analysis-smartcn-9.0.0-snapshot-94c6e261274.jar.sha1 b/plugins/analysis-smartcn/licenses/lucene-analysis-smartcn-9.0.0-snapshot-94c6e261274.jar.sha1 deleted file mode 100644 index 7c9a8c5a611a1..0000000000000 --- a/plugins/analysis-smartcn/licenses/lucene-analysis-smartcn-9.0.0-snapshot-94c6e261274.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -90541e897c5e1e00ba01f009c89fc7613c152a12 \ No newline at end of file diff --git a/plugins/analysis-smartcn/licenses/lucene-analysis-smartcn-9.0.0-snapshot-cb366d04d4a.jar.sha1 b/plugins/analysis-smartcn/licenses/lucene-analysis-smartcn-9.0.0-snapshot-cb366d04d4a.jar.sha1 new file mode 100644 index 0000000000000..3f42a4ca4bcc1 --- /dev/null +++ b/plugins/analysis-smartcn/licenses/lucene-analysis-smartcn-9.0.0-snapshot-cb366d04d4a.jar.sha1 @@ -0,0 +1 @@ +6b774f3606fc70d7f8c01c60932a0e4718294f01 \ No newline at end of file diff --git a/plugins/analysis-stempel/licenses/lucene-analysis-stempel-9.0.0-snapshot-94c6e261274.jar.sha1 b/plugins/analysis-stempel/licenses/lucene-analysis-stempel-9.0.0-snapshot-94c6e261274.jar.sha1 deleted file mode 100644 index 22db0be9ea94d..0000000000000 --- a/plugins/analysis-stempel/licenses/lucene-analysis-stempel-9.0.0-snapshot-94c6e261274.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -9c716aad22d8a0d874ac13de21fb7f3c40d17560 \ No newline at end of file diff --git a/plugins/analysis-stempel/licenses/lucene-analysis-stempel-9.0.0-snapshot-cb366d04d4a.jar.sha1 b/plugins/analysis-stempel/licenses/lucene-analysis-stempel-9.0.0-snapshot-cb366d04d4a.jar.sha1 new file mode 100644 index 0000000000000..b6f642f7cf161 --- /dev/null +++ b/plugins/analysis-stempel/licenses/lucene-analysis-stempel-9.0.0-snapshot-cb366d04d4a.jar.sha1 @@ -0,0 +1 @@ +0fc0ab42b9c90d90c9cd7148fc6a6969bc517117 \ No newline at end of file diff --git a/plugins/analysis-ukrainian/licenses/lucene-analysis-morfologik-9.0.0-snapshot-94c6e261274.jar.sha1 b/plugins/analysis-ukrainian/licenses/lucene-analysis-morfologik-9.0.0-snapshot-94c6e261274.jar.sha1 deleted file mode 100644 index 180f9a0e915af..0000000000000 --- a/plugins/analysis-ukrainian/licenses/lucene-analysis-morfologik-9.0.0-snapshot-94c6e261274.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -c4e216f07d96d5b4f8dbc552b0271ed220de7e81 \ No newline at end of file diff --git a/plugins/analysis-ukrainian/licenses/lucene-analysis-morfologik-9.0.0-snapshot-cb366d04d4a.jar.sha1 b/plugins/analysis-ukrainian/licenses/lucene-analysis-morfologik-9.0.0-snapshot-cb366d04d4a.jar.sha1 new file mode 100644 index 0000000000000..d21e08e4f74fa --- /dev/null +++ b/plugins/analysis-ukrainian/licenses/lucene-analysis-morfologik-9.0.0-snapshot-cb366d04d4a.jar.sha1 @@ -0,0 +1 @@ +a1389ea87cd83283c5cb41ac90a799b6456e5bac \ No newline at end of file diff --git a/server/licenses/lucene-analysis-common-9.0.0-snapshot-94c6e261274.jar.sha1 b/server/licenses/lucene-analysis-common-9.0.0-snapshot-94c6e261274.jar.sha1 deleted file mode 100644 index 06ab399ee79ca..0000000000000 --- a/server/licenses/lucene-analysis-common-9.0.0-snapshot-94c6e261274.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -3d4117b1cf25330059eab930e1888c3df29f5b2c \ No newline at end of file diff --git a/server/licenses/lucene-analysis-common-9.0.0-snapshot-cb366d04d4a.jar.sha1 b/server/licenses/lucene-analysis-common-9.0.0-snapshot-cb366d04d4a.jar.sha1 new file mode 100644 index 0000000000000..3e86bfc735d35 --- /dev/null +++ b/server/licenses/lucene-analysis-common-9.0.0-snapshot-cb366d04d4a.jar.sha1 @@ -0,0 +1 @@ +f129302f69d5099200be36f9c8c728f0a218da0b \ No newline at end of file diff --git a/server/licenses/lucene-backward-codecs-9.0.0-snapshot-94c6e261274.jar.sha1 b/server/licenses/lucene-backward-codecs-9.0.0-snapshot-94c6e261274.jar.sha1 deleted file mode 100644 index 752fdeee8987a..0000000000000 --- a/server/licenses/lucene-backward-codecs-9.0.0-snapshot-94c6e261274.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -754afba74db4df3d7b6a986f31929093438bab35 \ No newline at end of file diff --git a/server/licenses/lucene-backward-codecs-9.0.0-snapshot-cb366d04d4a.jar.sha1 b/server/licenses/lucene-backward-codecs-9.0.0-snapshot-cb366d04d4a.jar.sha1 new file mode 100644 index 0000000000000..ba6d94fdf4c6f --- /dev/null +++ b/server/licenses/lucene-backward-codecs-9.0.0-snapshot-cb366d04d4a.jar.sha1 @@ -0,0 +1 @@ +abc08a2bcd04337d7bcd622b589c952012052af7 \ No newline at end of file diff --git a/server/licenses/lucene-core-9.0.0-snapshot-94c6e261274.jar.sha1 b/server/licenses/lucene-core-9.0.0-snapshot-94c6e261274.jar.sha1 deleted file mode 100644 index 56d2a28023c0f..0000000000000 --- a/server/licenses/lucene-core-9.0.0-snapshot-94c6e261274.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -e4c67a66f67d1ead9a1a7d4769cc0404eaab39bd \ No newline at end of file diff --git a/server/licenses/lucene-core-9.0.0-snapshot-cb366d04d4a.jar.sha1 b/server/licenses/lucene-core-9.0.0-snapshot-cb366d04d4a.jar.sha1 new file mode 100644 index 0000000000000..92d6556255420 --- /dev/null +++ b/server/licenses/lucene-core-9.0.0-snapshot-cb366d04d4a.jar.sha1 @@ -0,0 +1 @@ +0868575623351649afa11057defd5cf3191479e1 \ No newline at end of file diff --git a/server/licenses/lucene-grouping-9.0.0-snapshot-94c6e261274.jar.sha1 b/server/licenses/lucene-grouping-9.0.0-snapshot-94c6e261274.jar.sha1 deleted file mode 100644 index 9416f2328c0a7..0000000000000 --- a/server/licenses/lucene-grouping-9.0.0-snapshot-94c6e261274.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -430124109b7caf4c26057388c365bcb19277d59d \ No newline at end of file diff --git a/server/licenses/lucene-grouping-9.0.0-snapshot-cb366d04d4a.jar.sha1 b/server/licenses/lucene-grouping-9.0.0-snapshot-cb366d04d4a.jar.sha1 new file mode 100644 index 0000000000000..96cbfcf2d8d95 --- /dev/null +++ b/server/licenses/lucene-grouping-9.0.0-snapshot-cb366d04d4a.jar.sha1 @@ -0,0 +1 @@ +9302bd9d16186bfd0c1d33841885e041570bdaba \ No newline at end of file diff --git a/server/licenses/lucene-highlighter-9.0.0-snapshot-94c6e261274.jar.sha1 b/server/licenses/lucene-highlighter-9.0.0-snapshot-94c6e261274.jar.sha1 deleted file mode 100644 index 19cb8de311dad..0000000000000 --- a/server/licenses/lucene-highlighter-9.0.0-snapshot-94c6e261274.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -842129e6a31b58ee5d18a9c30e77fd8aa5200894 \ No newline at end of file diff --git a/server/licenses/lucene-highlighter-9.0.0-snapshot-cb366d04d4a.jar.sha1 b/server/licenses/lucene-highlighter-9.0.0-snapshot-cb366d04d4a.jar.sha1 new file mode 100644 index 0000000000000..92172f281e25b --- /dev/null +++ b/server/licenses/lucene-highlighter-9.0.0-snapshot-cb366d04d4a.jar.sha1 @@ -0,0 +1 @@ +cc8ec53edb2cd14bfa0522a0e800979ef6eea6c9 \ No newline at end of file diff --git a/server/licenses/lucene-join-9.0.0-snapshot-94c6e261274.jar.sha1 b/server/licenses/lucene-join-9.0.0-snapshot-94c6e261274.jar.sha1 deleted file mode 100644 index 6217560cd88a0..0000000000000 --- a/server/licenses/lucene-join-9.0.0-snapshot-94c6e261274.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -b12468bc9d50950cbfde683051c1e29708fa4950 \ No newline at end of file diff --git a/server/licenses/lucene-join-9.0.0-snapshot-cb366d04d4a.jar.sha1 b/server/licenses/lucene-join-9.0.0-snapshot-cb366d04d4a.jar.sha1 new file mode 100644 index 0000000000000..cf8a33ec2a263 --- /dev/null +++ b/server/licenses/lucene-join-9.0.0-snapshot-cb366d04d4a.jar.sha1 @@ -0,0 +1 @@ +bf67e849438661b23fb8839b429f743cd77779d8 \ No newline at end of file diff --git a/server/licenses/lucene-memory-9.0.0-snapshot-94c6e261274.jar.sha1 b/server/licenses/lucene-memory-9.0.0-snapshot-94c6e261274.jar.sha1 deleted file mode 100644 index 4a01781d4a860..0000000000000 --- a/server/licenses/lucene-memory-9.0.0-snapshot-94c6e261274.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -da90ec1d0f408f3f0bb13246bb4f27c2fd9febb6 \ No newline at end of file diff --git a/server/licenses/lucene-memory-9.0.0-snapshot-cb366d04d4a.jar.sha1 b/server/licenses/lucene-memory-9.0.0-snapshot-cb366d04d4a.jar.sha1 new file mode 100644 index 0000000000000..f0e348637f895 --- /dev/null +++ b/server/licenses/lucene-memory-9.0.0-snapshot-cb366d04d4a.jar.sha1 @@ -0,0 +1 @@ +1325e5c28afa578dde285d207818a6d551f34516 \ No newline at end of file diff --git a/server/licenses/lucene-misc-9.0.0-snapshot-94c6e261274.jar.sha1 b/server/licenses/lucene-misc-9.0.0-snapshot-94c6e261274.jar.sha1 deleted file mode 100644 index 5e30841a04935..0000000000000 --- a/server/licenses/lucene-misc-9.0.0-snapshot-94c6e261274.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -a41bfc1fbd4096f8e0194c89a02df5f2ceea4b04 \ No newline at end of file diff --git a/server/licenses/lucene-misc-9.0.0-snapshot-cb366d04d4a.jar.sha1 b/server/licenses/lucene-misc-9.0.0-snapshot-cb366d04d4a.jar.sha1 new file mode 100644 index 0000000000000..e89c66969e4da --- /dev/null +++ b/server/licenses/lucene-misc-9.0.0-snapshot-cb366d04d4a.jar.sha1 @@ -0,0 +1 @@ +0f1b4983414859d9c938f4173732073b0937ede2 \ No newline at end of file diff --git a/server/licenses/lucene-queries-9.0.0-snapshot-94c6e261274.jar.sha1 b/server/licenses/lucene-queries-9.0.0-snapshot-94c6e261274.jar.sha1 deleted file mode 100644 index 64af605c6a624..0000000000000 --- a/server/licenses/lucene-queries-9.0.0-snapshot-94c6e261274.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -13811ca2c9d867222d4f1c0fe7ac8d3f5a61957a \ No newline at end of file diff --git a/server/licenses/lucene-queries-9.0.0-snapshot-cb366d04d4a.jar.sha1 b/server/licenses/lucene-queries-9.0.0-snapshot-cb366d04d4a.jar.sha1 new file mode 100644 index 0000000000000..7e935d7da3f45 --- /dev/null +++ b/server/licenses/lucene-queries-9.0.0-snapshot-cb366d04d4a.jar.sha1 @@ -0,0 +1 @@ +7fbc4b1510fe5c5ee146bf7678cb387c517cf08c \ No newline at end of file diff --git a/server/licenses/lucene-queryparser-9.0.0-snapshot-94c6e261274.jar.sha1 b/server/licenses/lucene-queryparser-9.0.0-snapshot-94c6e261274.jar.sha1 deleted file mode 100644 index 9addaa7576eb8..0000000000000 --- a/server/licenses/lucene-queryparser-9.0.0-snapshot-94c6e261274.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -796382d63fcd6c5736684620816422b6f8f2accc \ No newline at end of file diff --git a/server/licenses/lucene-queryparser-9.0.0-snapshot-cb366d04d4a.jar.sha1 b/server/licenses/lucene-queryparser-9.0.0-snapshot-cb366d04d4a.jar.sha1 new file mode 100644 index 0000000000000..e40c9d1533133 --- /dev/null +++ b/server/licenses/lucene-queryparser-9.0.0-snapshot-cb366d04d4a.jar.sha1 @@ -0,0 +1 @@ +99bdac7808c8cd25b27e7f50cc6ee39dbaea5a84 \ No newline at end of file diff --git a/server/licenses/lucene-sandbox-9.0.0-snapshot-94c6e261274.jar.sha1 b/server/licenses/lucene-sandbox-9.0.0-snapshot-94c6e261274.jar.sha1 deleted file mode 100644 index 696b4fe18c71d..0000000000000 --- a/server/licenses/lucene-sandbox-9.0.0-snapshot-94c6e261274.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -766c362dde2ff859f6860ca006cc62c78760edf3 \ No newline at end of file diff --git a/server/licenses/lucene-sandbox-9.0.0-snapshot-cb366d04d4a.jar.sha1 b/server/licenses/lucene-sandbox-9.0.0-snapshot-cb366d04d4a.jar.sha1 new file mode 100644 index 0000000000000..77de9e9436399 --- /dev/null +++ b/server/licenses/lucene-sandbox-9.0.0-snapshot-cb366d04d4a.jar.sha1 @@ -0,0 +1 @@ +134d43a780e49ed23141a0dc1ae4c839d6af07d5 \ No newline at end of file diff --git a/server/licenses/lucene-spatial-extras-9.0.0-snapshot-94c6e261274.jar.sha1 b/server/licenses/lucene-spatial-extras-9.0.0-snapshot-94c6e261274.jar.sha1 deleted file mode 100644 index 5fbb181e14cdb..0000000000000 --- a/server/licenses/lucene-spatial-extras-9.0.0-snapshot-94c6e261274.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -11fbf2d74fc0baee0e9d96334f9fc8682b5dd02c \ No newline at end of file diff --git a/server/licenses/lucene-spatial-extras-9.0.0-snapshot-cb366d04d4a.jar.sha1 b/server/licenses/lucene-spatial-extras-9.0.0-snapshot-cb366d04d4a.jar.sha1 new file mode 100644 index 0000000000000..7f34200a94427 --- /dev/null +++ b/server/licenses/lucene-spatial-extras-9.0.0-snapshot-cb366d04d4a.jar.sha1 @@ -0,0 +1 @@ +0759098be3af1bf770cbc14673e14688262f4e11 \ No newline at end of file diff --git a/server/licenses/lucene-spatial3d-9.0.0-snapshot-94c6e261274.jar.sha1 b/server/licenses/lucene-spatial3d-9.0.0-snapshot-94c6e261274.jar.sha1 deleted file mode 100644 index 8d27958512891..0000000000000 --- a/server/licenses/lucene-spatial3d-9.0.0-snapshot-94c6e261274.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -729a046cff27ae01995505fa8e5e2d3e47aab72f \ No newline at end of file diff --git a/server/licenses/lucene-spatial3d-9.0.0-snapshot-cb366d04d4a.jar.sha1 b/server/licenses/lucene-spatial3d-9.0.0-snapshot-cb366d04d4a.jar.sha1 new file mode 100644 index 0000000000000..bb121bb1c5e06 --- /dev/null +++ b/server/licenses/lucene-spatial3d-9.0.0-snapshot-cb366d04d4a.jar.sha1 @@ -0,0 +1 @@ +746c85a294596b2f40b1833196478277099cc1e4 \ No newline at end of file diff --git a/server/licenses/lucene-suggest-9.0.0-snapshot-94c6e261274.jar.sha1 b/server/licenses/lucene-suggest-9.0.0-snapshot-94c6e261274.jar.sha1 deleted file mode 100644 index c13b03ef77996..0000000000000 --- a/server/licenses/lucene-suggest-9.0.0-snapshot-94c6e261274.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -ee30af9c6f6601131bcd2e79194289e78671f75d \ No newline at end of file diff --git a/server/licenses/lucene-suggest-9.0.0-snapshot-cb366d04d4a.jar.sha1 b/server/licenses/lucene-suggest-9.0.0-snapshot-cb366d04d4a.jar.sha1 new file mode 100644 index 0000000000000..f408f635bc2de --- /dev/null +++ b/server/licenses/lucene-suggest-9.0.0-snapshot-cb366d04d4a.jar.sha1 @@ -0,0 +1 @@ +1221d3489409516b0b22921b4135532bae65b06a \ No newline at end of file diff --git a/x-pack/plugin/sql/sql-action/licenses/lucene-core-9.0.0-snapshot-94c6e261274.jar.sha1 b/x-pack/plugin/sql/sql-action/licenses/lucene-core-9.0.0-snapshot-94c6e261274.jar.sha1 deleted file mode 100644 index 56d2a28023c0f..0000000000000 --- a/x-pack/plugin/sql/sql-action/licenses/lucene-core-9.0.0-snapshot-94c6e261274.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -e4c67a66f67d1ead9a1a7d4769cc0404eaab39bd \ No newline at end of file diff --git a/x-pack/plugin/sql/sql-action/licenses/lucene-core-9.0.0-snapshot-cb366d04d4a.jar.sha1 b/x-pack/plugin/sql/sql-action/licenses/lucene-core-9.0.0-snapshot-cb366d04d4a.jar.sha1 new file mode 100644 index 0000000000000..92d6556255420 --- /dev/null +++ b/x-pack/plugin/sql/sql-action/licenses/lucene-core-9.0.0-snapshot-cb366d04d4a.jar.sha1 @@ -0,0 +1 @@ +0868575623351649afa11057defd5cf3191479e1 \ No newline at end of file From 9e0299f551252723bc3dbec1316989b860137fb0 Mon Sep 17 00:00:00 2001 From: James Rodewig <40268737+jrodewig@users.noreply.github.com> Date: Fri, 1 Oct 2021 08:32:53 -0400 Subject: [PATCH 097/250] [DOCS] Troubleshoot the flood-stage watermark error (#78519) Adds troubleshooting steps for the flood-stage watermark error. Closes #77906. --- .../how-to/fix-common-cluster-issues.asciidoc | 87 ++++++++++++++++++- 1 file changed, 86 insertions(+), 1 deletion(-) diff --git a/docs/reference/how-to/fix-common-cluster-issues.asciidoc b/docs/reference/how-to/fix-common-cluster-issues.asciidoc index f5e58d1adc234..1c255380fd63e 100644 --- a/docs/reference/how-to/fix-common-cluster-issues.asciidoc +++ b/docs/reference/how-to/fix-common-cluster-issues.asciidoc @@ -1,7 +1,92 @@ [[fix-common-cluster-issues]] == Fix common cluster issues -This guide describes how to fix common problems with {es} clusters. +This guide describes how to fix common errors and problems with {es} clusters. + +[discrete] +=== Error: disk usage exceeded flood-stage watermark, index has read-only-allow-delete block + +This error indicates a data node is critically low on disk space and has reached +the <>. To prevent +a full disk, when a node reaches this watermark, {es} blocks writes to any index +with a shard on the node. If the block affects related system indices, {kib} and +other {stack} features may become unavailable. + +{es} will automatically remove the write block when the affected node's disk +usage goes below the <>. To +achieve this, {es} automatically moves some of the affected node's shards to +other nodes in the same data tier. + +To verify that shards are moving off the affected node, use the <>. + +[source,console] +---- +GET _cat/shards?v=true +---- + +If shards remain on the node, use the <> to get an explanation for their allocation status. + +[source,console] +---- +GET _cluster/allocation/explain +{ + "index": "my-index", + "shard": 0, + "primary": false, + "current_node": "my-node" +} +---- +// TEST[s/^/PUT my-index\n/] +// TEST[s/"primary": false,/"primary": false/] +// TEST[s/"current_node": "my-node"//] + +To immediately restore write operations, you can temporarily increase the disk +watermarks and remove the write block. + +[source,console] +---- +PUT _cluster/settings +{ + "transient": { + "cluster.routing.allocation.disk.watermark.low": "90%", + "cluster.routing.allocation.disk.watermark.high": "95%", + "cluster.routing.allocation.disk.watermark.flood_stage": "97%" + } +} + +PUT */_settings?expand_wildcards=all +{ + "index.blocks.read_only_allow_delete": null +} +---- +// TEST[s/^/PUT my-index\n/] + +As a long-term solution, we recommend you add nodes to the affected data tiers +or upgrade existing nodes to increase disk space. To free up additional disk +space, you can delete unneeded indices using the <>. + +[source,console] +---- +DELETE my-index +---- +// TEST[s/^/PUT my-index\n/] + +When a long-term solution is in place, reset or reconfigure the disk watermarks. + +[source,console] +---- +PUT _cluster/settings +{ + "transient": { + "cluster.routing.allocation.disk.watermark.low": null, + "cluster.routing.allocation.disk.watermark.high": null, + "cluster.routing.allocation.disk.watermark.flood_stage": null + } +} +---- [discrete] [[circuit-breaker-errors]] From 5725bb3b2225e7957969de95d0e7e5b5c71b46f4 Mon Sep 17 00:00:00 2001 From: Benjamin Trent Date: Fri, 1 Oct 2021 09:01:21 -0400 Subject: [PATCH 098/250] [ML] unifying NLP task output with existing inference outputs (#78530) This unifies our current inference results and configuration options with our existing inference responses and configuration. Now results_field is configurable and updatable for all our inference configs. The following responses now resemble our classification response. text_classification zero_shot_classification (does not support "num_top_classes", as labels are fully configurable) mask_fill. This inference response also has _sequence for the predicted value in the sequence. pass_through and text_embedding now write their results to the results_field parameter. For all, if results_field is not provided, the default is predicted_value. NER is not really unified yet, its a unique situation as its multiple token multi-class. --- .../MlInferenceNamedXContentProvider.java | 4 - .../ClassificationInferenceResults.java | 38 ++++- .../ml/inference/results/FillMaskResults.java | 158 +++++------------- .../inference/results/InferenceResults.java | 1 + .../core/ml/inference/results/NerResults.java | 4 +- .../results/PyTorchPassThroughResults.java | 21 +-- .../results/TextClassificationResults.java | 76 --------- .../results/TextEmbeddingResults.java | 20 +-- .../trainedmodel/ClassificationConfig.java | 3 - .../trainedmodel/InferenceConfig.java | 3 + .../trainedmodel/RegressionConfig.java | 1 - .../TextClassificationConfig.java | 9 - .../results/FillMaskResultsTests.java | 41 +++-- .../ml/inference/results/NerResultsTests.java | 3 +- .../PyTorchPassThroughResultsTests.java | 5 +- .../TextClassificationResultsTests.java | 46 ----- .../results/TextEmbeddingResultsTests.java | 5 +- .../TextClassificationConfigTests.java | 8 - .../xpack/ml/integration/PyTorchModelIT.java | 23 ++- .../ml/inference/nlp/FillMaskProcessor.java | 56 +++++-- .../inference/nlp/PassThroughProcessor.java | 14 +- .../nlp/TextClassificationProcessor.java | 65 +++++-- .../inference/nlp/TextEmbeddingProcessor.java | 12 +- .../nlp/ZeroShotClassificationProcessor.java | 43 +++-- .../inference/nlp/FillMaskProcessorTests.java | 47 +++--- .../nlp/TextClassificationProcessorTests.java | 21 ++- 26 files changed, 355 insertions(+), 372 deletions(-) delete mode 100644 x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/TextClassificationResults.java delete mode 100644 x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/TextClassificationResultsTests.java diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/MlInferenceNamedXContentProvider.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/MlInferenceNamedXContentProvider.java index b1ba4e5256cc6..f709ba44928ea 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/MlInferenceNamedXContentProvider.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/MlInferenceNamedXContentProvider.java @@ -25,7 +25,6 @@ import org.elasticsearch.xpack.core.ml.inference.results.NerResults; import org.elasticsearch.xpack.core.ml.inference.results.PyTorchPassThroughResults; import org.elasticsearch.xpack.core.ml.inference.results.RegressionInferenceResults; -import org.elasticsearch.xpack.core.ml.inference.results.TextClassificationResults; import org.elasticsearch.xpack.core.ml.inference.results.TextEmbeddingResults; import org.elasticsearch.xpack.core.ml.inference.results.WarningInferenceResults; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.BertTokenization; @@ -295,9 +294,6 @@ public List getNamedWriteables() { namedWriteables.add(new NamedWriteableRegistry.Entry(InferenceResults.class, PyTorchPassThroughResults.NAME, PyTorchPassThroughResults::new)); - namedWriteables.add(new NamedWriteableRegistry.Entry(InferenceResults.class, - TextClassificationResults.NAME, - TextClassificationResults::new)); namedWriteables.add(new NamedWriteableRegistry.Entry(InferenceResults.class, TextEmbeddingResults.NAME, TextEmbeddingResults::new)); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/ClassificationInferenceResults.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/ClassificationInferenceResults.java index 3f2e26d7eedc8..fa98f62daed7a 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/ClassificationInferenceResults.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/ClassificationInferenceResults.java @@ -25,11 +25,11 @@ public class ClassificationInferenceResults extends SingleValueInferenceResults public static final String NAME = "classification"; - public static final String PREDICTION_PROBABILITY = "prediction_probability"; public static final String PREDICTION_SCORE = "prediction_score"; private final String topNumClassesField; - private final String resultsField; + // Accessed in sub-classes + protected final String resultsField; private final String classificationLabel; private final Double predictionProbability; private final Double predictionScore; @@ -60,15 +60,41 @@ private ClassificationInferenceResults(double value, ClassificationConfig classificationConfig, Double predictionProbability, Double predictionScore) { + this( + value, + classificationLabel, + topClasses, + featureImportance, + classificationConfig.getTopClassesResultsField(), + classificationConfig.getResultsField(), + classificationConfig.getPredictionFieldType(), + classificationConfig.getNumTopFeatureImportanceValues(), + predictionProbability, + predictionScore + ); + } + + public ClassificationInferenceResults( + double value, + String classificationLabel, + List topClasses, + List featureImportance, + String topNumClassesField, + String resultsField, + PredictionFieldType predictionFieldType, + int numTopFeatureImportanceValues, + Double predictionProbability, + Double predictionScore + ) { super(value); this.classificationLabel = classificationLabel; this.topClasses = topClasses == null ? Collections.emptyList() : Collections.unmodifiableList(topClasses); - this.topNumClassesField = classificationConfig.getTopClassesResultsField(); - this.resultsField = classificationConfig.getResultsField(); - this.predictionFieldType = classificationConfig.getPredictionFieldType(); + this.topNumClassesField = topNumClassesField; + this.resultsField = resultsField; + this.predictionFieldType = predictionFieldType; this.predictionProbability = predictionProbability; this.predictionScore = predictionScore; - this.featureImportance = takeTopFeatureImportances(featureImportance, classificationConfig.getNumTopFeatureImportanceValues()); + this.featureImportance = takeTopFeatureImportances(featureImportance, numTopFeatureImportanceValues); } static List takeTopFeatureImportances(List featureImportances, diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/FillMaskResults.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/FillMaskResults.java index 407b18191f742..253f7b7779676 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/FillMaskResults.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/FillMaskResults.java @@ -7,159 +7,91 @@ package org.elasticsearch.xpack.core.ml.inference.results; -import org.elasticsearch.common.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentObject; import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xpack.core.ml.inference.trainedmodel.PredictionFieldType; import java.io.IOException; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.stream.Collectors; -public class FillMaskResults implements InferenceResults { +public class FillMaskResults extends ClassificationInferenceResults { public static final String NAME = "fill_mask_result"; - public static final String DEFAULT_RESULTS_FIELD = "results"; - private final List predictions; - - public FillMaskResults(List predictions) { - this.predictions = predictions; + private final String predictedSequence; + + public FillMaskResults( + double value, + String classificationLabel, + String predictedSequence, + List topClasses, + String topNumClassesField, + String resultsField, + Double predictionProbability + ) { + super( + value, + classificationLabel, + topClasses, + List.of(), + topNumClassesField, + resultsField, + PredictionFieldType.STRING, + 0, + predictionProbability, + null + ); + this.predictedSequence = predictedSequence; } public FillMaskResults(StreamInput in) throws IOException { - this.predictions = in.readList(Prediction::new); - } - - public List getPredictions() { - return predictions; - } - - @Override - public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { - builder.startArray(DEFAULT_RESULTS_FIELD); - for (Prediction prediction : predictions) { - prediction.toXContent(builder, params); - } - builder.endArray(); - return builder; + super(in); + this.predictedSequence = in.readString(); } @Override - public String getWriteableName() { - return NAME; + public void writeTo(StreamOutput out) throws IOException { + super.writeTo(out); + out.writeString(predictedSequence); } - @Override - public void writeTo(StreamOutput out) throws IOException { - out.writeList(predictions); + public String getPredictedSequence() { + return predictedSequence; } @Override public Map asMap() { Map map = new LinkedHashMap<>(); - map.put(DEFAULT_RESULTS_FIELD, predictions.stream().map(Prediction::toMap).collect(Collectors.toList())); + map.put(resultsField + "_sequence", predictedSequence); + map.putAll(super.asMap()); return map; } @Override - public Object predictedValue() { - if (predictions.isEmpty()) { - return null; - } - return predictions.get(0).token; + public String getWriteableName() { + return NAME; + } + + @Override + public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { + return super.toXContent(builder, params).field(resultsField + "_sequence", predictedSequence); } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; + if (super.equals(o) == false) return false; FillMaskResults that = (FillMaskResults) o; - return Objects.equals(predictions, that.predictions); + return Objects.equals(predictedSequence, that.predictedSequence); } @Override public int hashCode() { - return Objects.hash(predictions); - } - - public static class Prediction implements ToXContentObject, Writeable { - - private static final ParseField TOKEN = new ParseField("token"); - private static final ParseField SCORE = new ParseField("score"); - private static final ParseField SEQUENCE = new ParseField("sequence"); - - private final String token; - private final double score; - private final String sequence; - - public Prediction(String token, double score, String sequence) { - this.token = Objects.requireNonNull(token); - this.score = score; - this.sequence = Objects.requireNonNull(sequence); - } - - public Prediction(StreamInput in) throws IOException { - token = in.readString(); - score = in.readDouble(); - sequence = in.readString(); - } - - public double getScore() { - return score; - } - - public String getSequence() { - return sequence; - } - - public String getToken() { - return token; - } - - public Map toMap() { - Map map = new LinkedHashMap<>(); - map.put(TOKEN.getPreferredName(), token); - map.put(SCORE.getPreferredName(), score); - map.put(SEQUENCE.getPreferredName(), sequence); - return map; - } - - @Override - public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { - builder.startObject(); - builder.field(TOKEN.getPreferredName(), token); - builder.field(SCORE.getPreferredName(), score); - builder.field(SEQUENCE.getPreferredName(), sequence); - builder.endObject(); - return builder; - } - - @Override - public void writeTo(StreamOutput out) throws IOException { - out.writeString(token); - out.writeDouble(score); - out.writeString(sequence); - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - Prediction result = (Prediction) o; - return Double.compare(result.score, score) == 0 && - Objects.equals(token, result.token) && - Objects.equals(sequence, result.sequence); - } - - @Override - public int hashCode() { - return Objects.hash(token, score, sequence); - } + return Objects.hash(super.hashCode(), predictedSequence); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/InferenceResults.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/InferenceResults.java index b0dad4a107dbc..0f34c4b7f7b88 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/InferenceResults.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/InferenceResults.java @@ -14,6 +14,7 @@ import java.util.Map; public interface InferenceResults extends NamedWriteable, ToXContentFragment { + String PREDICTION_PROBABILITY = "prediction_probability"; String MODEL_ID_RESULTS_FIELD = "model_id"; static void writeResult(InferenceResults results, IngestDocument ingestDocument, String resultField, String modelId) { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/NerResults.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/NerResults.java index 936d0ef8fd876..8d7a70774a8b2 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/NerResults.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/NerResults.java @@ -21,6 +21,8 @@ import java.util.Objects; import java.util.stream.Collectors; +import static org.elasticsearch.xpack.core.ml.inference.trainedmodel.InferenceConfig.DEFAULT_RESULTS_FIELD; + public class NerResults implements InferenceResults { public static final String NAME = "ner_result"; @@ -58,7 +60,7 @@ public void writeTo(StreamOutput out) throws IOException { @Override public Map asMap() { Map map = new LinkedHashMap<>(); - map.put(FillMaskResults.DEFAULT_RESULTS_FIELD, entityGroups.stream().map(EntityGroup::toMap).collect(Collectors.toList())); + map.put(DEFAULT_RESULTS_FIELD, entityGroups.stream().map(EntityGroup::toMap).collect(Collectors.toList())); return map; } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/PyTorchPassThroughResults.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/PyTorchPassThroughResults.java index 12eebea49a186..36985ce7f7301 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/PyTorchPassThroughResults.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/PyTorchPassThroughResults.java @@ -7,7 +7,6 @@ package org.elasticsearch.xpack.core.ml.inference.results; -import org.elasticsearch.common.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.xcontent.XContentBuilder; @@ -16,22 +15,23 @@ import java.util.Arrays; import java.util.LinkedHashMap; import java.util.Map; +import java.util.Objects; public class PyTorchPassThroughResults implements InferenceResults { public static final String NAME = "pass_through_result"; - static final String DEFAULT_RESULTS_FIELD = "results"; - - private static final ParseField INFERENCE = new ParseField("inference"); private final double[][] inference; + private final String resultsField; - public PyTorchPassThroughResults(double[][] inference) { + public PyTorchPassThroughResults(String resultsField, double[][] inference) { this.inference = inference; + this.resultsField = resultsField; } public PyTorchPassThroughResults(StreamInput in) throws IOException { - inference = in.readArray(StreamInput::readDoubleArray, length -> new double[length][]); + inference = in.readArray(StreamInput::readDoubleArray, double[][]::new); + resultsField = in.readString(); } public double[][] getInference() { @@ -40,7 +40,7 @@ public double[][] getInference() { @Override public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { - builder.field(INFERENCE.getPreferredName(), inference); + builder.field(resultsField, inference); return builder; } @@ -52,12 +52,13 @@ public String getWriteableName() { @Override public void writeTo(StreamOutput out) throws IOException { out.writeArray(StreamOutput::writeDoubleArray, inference); + out.writeString(resultsField); } @Override public Map asMap() { Map map = new LinkedHashMap<>(); - map.put(DEFAULT_RESULTS_FIELD, inference); + map.put(resultsField, inference); return map; } @@ -71,11 +72,11 @@ public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; PyTorchPassThroughResults that = (PyTorchPassThroughResults) o; - return Arrays.deepEquals(inference, that.inference); + return Arrays.deepEquals(inference, that.inference) && Objects.equals(resultsField, that.resultsField); } @Override public int hashCode() { - return Arrays.deepHashCode(inference); + return Objects.hash(Arrays.deepHashCode(inference), resultsField); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/TextClassificationResults.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/TextClassificationResults.java deleted file mode 100644 index c9bb405e298ba..0000000000000 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/TextClassificationResults.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * 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.core.ml.inference.results; - -import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; - -import java.io.IOException; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -public class TextClassificationResults implements InferenceResults { - - public static final String NAME = "text_classification_result"; - - private final List entryList; - - public TextClassificationResults(List entryList) { - this.entryList = entryList; - } - - public TextClassificationResults(StreamInput in) throws IOException { - entryList = in.readList(TopClassEntry::new); - } - - @Override - public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { - builder.mapContents(asMap()); - return builder; - } - - @Override - public String getWriteableName() { - return NAME; - } - - @Override - public void writeTo(StreamOutput out) throws IOException { - out.writeList(entryList); - } - - @Override - public Map asMap() { - Map map = new LinkedHashMap<>(); - for (TopClassEntry entry : entryList) { - map.put(entry.getClassification().toString(), entry.getScore()); - } - return map; - } - - @Override - public Object predictedValue() { - return entryList.get(0).getScore(); - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - TextClassificationResults that = (TextClassificationResults) o; - return Objects.equals(that.entryList, entryList); - } - - @Override - public int hashCode() { - return Objects.hash(entryList); - } -} diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/TextEmbeddingResults.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/TextEmbeddingResults.java index 25291504603ea..fc65980c22c53 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/TextEmbeddingResults.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/TextEmbeddingResults.java @@ -9,29 +9,29 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ParseField; import org.elasticsearch.common.xcontent.XContentBuilder; import java.io.IOException; import java.util.Arrays; import java.util.Collections; import java.util.Map; +import java.util.Objects; public class TextEmbeddingResults implements InferenceResults { public static final String NAME = "text_embedding_result"; - static final String DEFAULT_RESULTS_FIELD = "results"; - - private static final ParseField INFERENCE = new ParseField("inference"); + private final String resultsField; private final double[] inference; - public TextEmbeddingResults(double[] inference) { + public TextEmbeddingResults(String resultsField, double[] inference) { this.inference = inference; + this.resultsField = resultsField; } public TextEmbeddingResults(StreamInput in) throws IOException { inference = in.readDoubleArray(); + resultsField = in.readString(); } public double[] getInference() { @@ -40,8 +40,7 @@ public double[] getInference() { @Override public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { - builder.field(INFERENCE.getPreferredName(), inference); - return builder; + return builder.field(resultsField, inference); } @Override @@ -52,11 +51,12 @@ public String getWriteableName() { @Override public void writeTo(StreamOutput out) throws IOException { out.writeDoubleArray(inference); + out.writeString(resultsField); } @Override public Map asMap() { - return Collections.singletonMap(DEFAULT_RESULTS_FIELD, inference); + return Collections.singletonMap(resultsField, inference); } @Override @@ -69,11 +69,11 @@ public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; TextEmbeddingResults that = (TextEmbeddingResults) o; - return Arrays.equals(inference, that.inference); + return Arrays.equals(inference, that.inference) && Objects.equals(resultsField, that.resultsField); } @Override public int hashCode() { - return Arrays.hashCode(inference); + return Objects.hash(Arrays.hashCode(inference), resultsField); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ClassificationConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ClassificationConfig.java index bc6b3723a3fa1..ec8957b3e5557 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ClassificationConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ClassificationConfig.java @@ -21,9 +21,6 @@ public class ClassificationConfig implements LenientlyParsedInferenceConfig, Str public static final ParseField NAME = new ParseField("classification"); - public static final String DEFAULT_TOP_CLASSES_RESULTS_FIELD = "top_classes"; - public static final String DEFAULT_RESULTS_FIELD = "predicted_value"; - public static final ParseField RESULTS_FIELD = new ParseField("results_field"); public static final ParseField NUM_TOP_CLASSES = new ParseField("num_top_classes"); public static final ParseField TOP_CLASSES_RESULTS_FIELD = new ParseField("top_classes_results_field"); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/InferenceConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/InferenceConfig.java index 045f017c4a308..942c39ad414f8 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/InferenceConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/InferenceConfig.java @@ -13,6 +13,9 @@ public interface InferenceConfig extends NamedXContentObject, NamedWriteable { + String DEFAULT_TOP_CLASSES_RESULTS_FIELD = "top_classes"; + String DEFAULT_RESULTS_FIELD = "predicted_value"; + boolean isTargetTypeSupported(TargetType targetType); /** diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/RegressionConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/RegressionConfig.java index 46aac4702ada2..c52fdc302f8a3 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/RegressionConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/RegressionConfig.java @@ -23,7 +23,6 @@ public class RegressionConfig implements LenientlyParsedInferenceConfig, Strictl private static final Version MIN_SUPPORTED_VERSION = Version.V_7_6_0; public static final ParseField RESULTS_FIELD = new ParseField("results_field"); public static final ParseField NUM_TOP_FEATURE_IMPORTANCE_VALUES = new ParseField("num_top_feature_importance_values"); - public static final String DEFAULT_RESULTS_FIELD = "predicted_value"; public static RegressionConfig EMPTY_PARAMS = new RegressionConfig(DEFAULT_RESULTS_FIELD, null); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextClassificationConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextClassificationConfig.java index 8ac1208914ffc..1eb5348aeb814 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextClassificationConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextClassificationConfig.java @@ -85,16 +85,7 @@ public TextClassificationConfig(@Nullable VocabularyConfig vocabularyConfig, } this.classificationLabels = classificationLabels; this.numTopClasses = Optional.ofNullable(numTopClasses).orElse(-1); - if (this.numTopClasses == 0) { - throw ExceptionsHelper.badRequestException( - "[{}] requires at least 1 [{}]; provided [{}]", - NAME, - TextClassificationConfig.NUM_TOP_CLASSES, - numTopClasses - ); - } this.resultsField = resultsField; - } public TextClassificationConfig(StreamInput in) throws IOException { diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/FillMaskResultsTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/FillMaskResultsTests.java index 57867b6091d0f..d976072ada224 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/FillMaskResultsTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/FillMaskResultsTests.java @@ -14,8 +14,13 @@ import java.util.List; import java.util.Map; +import static org.elasticsearch.xpack.core.ml.inference.results.InferenceResults.PREDICTION_PROBABILITY; +import static org.elasticsearch.xpack.core.ml.inference.trainedmodel.InferenceConfig.DEFAULT_RESULTS_FIELD; +import static org.elasticsearch.xpack.core.ml.inference.trainedmodel.InferenceConfig.DEFAULT_TOP_CLASSES_RESULTS_FIELD; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasSize; +import static org.hamcrest.Matchers.is; +import static org.hamcrest.Matchers.nullValue; public class FillMaskResultsTests extends AbstractWireSerializingTestCase { @Override @@ -26,25 +31,39 @@ protected Writeable.Reader instanceReader() { @Override protected FillMaskResults createTestInstance() { int numResults = randomIntBetween(0, 3); - List resultList = new ArrayList<>(); + List resultList = new ArrayList<>(); for (int i=0; i asMap = testInstance.asMap(); - List> resultList = (List>)asMap.get("results"); - assertThat(resultList, hasSize(testInstance.getPredictions().size())); - for (int i = 0; i map = resultList.get(i); - assertThat(map.get("score"), equalTo(result.getScore())); - assertThat(map.get("token"), equalTo(result.getToken())); - assertThat(map.get("sequence"), equalTo(result.getSequence())); + assertThat(asMap.get(DEFAULT_RESULTS_FIELD), equalTo(testInstance.predictedValue())); + assertThat(asMap.get(PREDICTION_PROBABILITY), equalTo(testInstance.getPredictionProbability())); + assertThat(asMap.get(DEFAULT_RESULTS_FIELD + "_sequence"), equalTo(testInstance.getPredictedSequence())); + List> resultList = (List>)asMap.get(DEFAULT_TOP_CLASSES_RESULTS_FIELD); + if (testInstance.getTopClasses().size() == 0) { + assertThat(resultList, is(nullValue())); + } else { + assertThat(resultList, hasSize(testInstance.getTopClasses().size())); + for (int i = 0; i map = resultList.get(i); + assertThat(map.get("class_score"), equalTo(result.getScore())); + assertThat(map.get("class_name"), equalTo(result.getClassification())); + } } } } diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/NerResultsTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/NerResultsTests.java index e2764583c53b6..24141a8b3cf2f 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/NerResultsTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/NerResultsTests.java @@ -14,6 +14,7 @@ import java.util.List; import java.util.Map; +import static org.elasticsearch.xpack.core.ml.inference.trainedmodel.InferenceConfig.DEFAULT_RESULTS_FIELD; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasSize; @@ -37,7 +38,7 @@ protected NerResults createTestInstance() { public void testAsMap() { NerResults testInstance = createTestInstance(); Map asMap = testInstance.asMap(); - List> resultList = (List>)asMap.get("results"); + List> resultList = (List>)asMap.get(DEFAULT_RESULTS_FIELD); assertThat(resultList, hasSize(testInstance.getEntityGroups().size())); for (int i=0; i { @@ -31,13 +32,13 @@ protected PyTorchPassThroughResults createTestInstance() { } } - return new PyTorchPassThroughResults(arr); + return new PyTorchPassThroughResults(DEFAULT_RESULTS_FIELD, arr); } public void testAsMap() { PyTorchPassThroughResults testInstance = createTestInstance(); Map asMap = testInstance.asMap(); assertThat(asMap.keySet(), hasSize(1)); - assertArrayEquals(testInstance.getInference(), (double[][]) asMap.get(PyTorchPassThroughResults.DEFAULT_RESULTS_FIELD)); + assertArrayEquals(testInstance.getInference(), (double[][]) asMap.get(DEFAULT_RESULTS_FIELD)); } } diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/TextClassificationResultsTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/TextClassificationResultsTests.java deleted file mode 100644 index 8941070932088..0000000000000 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/TextClassificationResultsTests.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * 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.core.ml.inference.results; - -import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.test.AbstractWireSerializingTestCase; - -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import static org.hamcrest.Matchers.closeTo; -import static org.hamcrest.Matchers.hasSize; - -public class TextClassificationResultsTests extends AbstractWireSerializingTestCase { - @Override - protected Writeable.Reader instanceReader() { - return TextClassificationResults::new; - } - - @Override - protected TextClassificationResults createTestInstance() { - return new TextClassificationResults( - Stream.generate(TopClassEntryTests::createRandomTopClassEntry).limit(randomIntBetween(2, 5)).collect(Collectors.toList()) - ); - } - - public void testAsMap() { - TextClassificationResults testInstance = new TextClassificationResults( - List.of( - new TopClassEntry("foo", 1.0), - new TopClassEntry("bar", 0.0) - ) - ); - Map asMap = testInstance.asMap(); - assertThat(asMap.keySet(), hasSize(2)); - assertThat(1.0, closeTo((Double)asMap.get("foo"), 0.0001)); - assertThat(0.0, closeTo((Double)asMap.get("bar"), 0.0001)); - } -} diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/TextEmbeddingResultsTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/TextEmbeddingResultsTests.java index eab4be1ecf35b..fc0608df28359 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/TextEmbeddingResultsTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/TextEmbeddingResultsTests.java @@ -12,6 +12,7 @@ import java.util.Map; +import static org.elasticsearch.xpack.core.ml.inference.trainedmodel.InferenceConfig.DEFAULT_RESULTS_FIELD; import static org.hamcrest.Matchers.hasSize; public class TextEmbeddingResultsTests extends AbstractWireSerializingTestCase { @@ -28,13 +29,13 @@ protected TextEmbeddingResults createTestInstance() { arr[i] = randomDouble(); } - return new TextEmbeddingResults(arr); + return new TextEmbeddingResults(DEFAULT_RESULTS_FIELD, arr); } public void testAsMap() { TextEmbeddingResults testInstance = createTestInstance(); Map asMap = testInstance.asMap(); assertThat(asMap.keySet(), hasSize(1)); - assertArrayEquals(testInstance.getInference(), (double[]) asMap.get(TextEmbeddingResults.DEFAULT_RESULTS_FIELD), 1e-10); + assertArrayEquals(testInstance.getInference(), (double[]) asMap.get(DEFAULT_RESULTS_FIELD), 1e-10); } } diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextClassificationConfigTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextClassificationConfigTests.java index 08482ac5df2f9..29e8400bc40af 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextClassificationConfigTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextClassificationConfigTests.java @@ -64,14 +64,6 @@ public void testInvalidClassificationLabels() { containsString("[text_classification] requires at least 2 [classification_labels]; provided [too-few]")); } - public void testInvalidNumClasses() { - ElasticsearchStatusException e = expectThrows(ElasticsearchStatusException.class, - () -> new TextClassificationConfig(null, null, List.of("one", "two"), 0, null)); - assertThat(e.getMessage(), - containsString("[text_classification] requires at least 1 [num_top_classes]; provided [0]")); - } - - public static TextClassificationConfig createRandom() { return new TextClassificationConfig( randomBoolean() ? null : VocabularyConfigTests.createRandom(), diff --git a/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/PyTorchModelIT.java b/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/PyTorchModelIT.java index eb05e651e98d5..ba92fc414f148 100644 --- a/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/PyTorchModelIT.java +++ b/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/PyTorchModelIT.java @@ -156,7 +156,7 @@ public void testEvaluate() throws IOException, InterruptedException { executorService.execute(() -> { try { Response inference = infer("my words", modelId); - assertThat(EntityUtils.toString(inference.getEntity()), equalTo("{\"inference\":[[1.0,1.0]]}")); + assertThat(EntityUtils.toString(inference.getEntity()), equalTo("{\"predicted_value\":[[1.0,1.0]]}")); } catch (IOException ex) { failures.add(ex.getMessage()); } finally { @@ -173,6 +173,18 @@ public void testEvaluate() throws IOException, InterruptedException { } } + public void testEvaluateWithResultFieldOverride() throws IOException { + String modelId = "test_evaluate"; + createTrainedModel(modelId); + putModelDefinition(modelId); + putVocabulary(List.of("these", "are", "my", "words"), modelId); + startDeployment(modelId); + String resultsField = randomAlphaOfLength(10); + Response inference = infer("my words", modelId, resultsField); + assertThat(EntityUtils.toString(inference.getEntity()), equalTo("{\"" + resultsField + "\":[[1.0,1.0]]}")); + stopDeployment(modelId); + } + public void testDeleteFailureDueToDeployment() throws IOException { String modelId = "test_deployed_model_delete"; createTrainedModel(modelId); @@ -444,4 +456,13 @@ private Response infer(String input, String modelId) throws IOException { return client().performRequest(request); } + private Response infer(String input, String modelId, String resultsField) throws IOException { + Request request = new Request("POST", "/_ml/trained_models/" + modelId + "/deployment/_infer"); + request.setJsonEntity("{ " + + "\"docs\": [{\"input\":\"" + input + "\"}],\n" + + "\"inference_config\": {\"pass_through\":{\"results_field\": \"" + resultsField + "\"}}\n" + + "}"); + return client().performRequest(request); + } + } diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/FillMaskProcessor.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/FillMaskProcessor.java index 8cfef66b7c4a8..3cc96fc165985 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/FillMaskProcessor.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/FillMaskProcessor.java @@ -9,6 +9,8 @@ import org.elasticsearch.xpack.core.ml.inference.results.FillMaskResults; import org.elasticsearch.xpack.core.ml.inference.results.InferenceResults; +import org.elasticsearch.xpack.core.ml.inference.results.TopClassEntry; +import org.elasticsearch.xpack.core.ml.inference.results.WarningInferenceResults; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.FillMaskConfig; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.NlpConfig; import org.elasticsearch.xpack.ml.inference.deployment.PyTorchResult; @@ -18,8 +20,11 @@ import java.util.ArrayList; import java.util.Arrays; -import java.util.Collections; import java.util.List; +import java.util.Optional; + +import static org.elasticsearch.xpack.core.ml.inference.trainedmodel.InferenceConfig.DEFAULT_RESULTS_FIELD; +import static org.elasticsearch.xpack.core.ml.inference.trainedmodel.InferenceConfig.DEFAULT_TOP_CLASSES_RESULTS_FIELD; public class FillMaskProcessor implements NlpTask.Processor { @@ -56,29 +61,56 @@ public NlpTask.RequestBuilder getRequestBuilder(NlpConfig config) { @Override public NlpTask.ResultProcessor getResultProcessor(NlpConfig config) { if (config instanceof FillMaskConfig) { - return (tokenization, result) -> processResult(tokenization, result, ((FillMaskConfig)config).getNumTopClasses()); + FillMaskConfig fillMaskConfig = (FillMaskConfig) config; + return (tokenization, result) -> processResult( + tokenization, + result, + fillMaskConfig.getNumTopClasses(), + fillMaskConfig.getResultsField() + ); } else { - return (tokenization, result) -> processResult(tokenization, result, FillMaskConfig.DEFAULT_NUM_RESULTS); + return (tokenization, result) -> processResult(tokenization, result, FillMaskConfig.DEFAULT_NUM_RESULTS, DEFAULT_RESULTS_FIELD); } } - InferenceResults processResult(TokenizationResult tokenization, PyTorchResult pyTorchResult, int numResults) { + static InferenceResults processResult( + TokenizationResult tokenization, + PyTorchResult pyTorchResult, + int numResults, + String resultsField + ) { if (tokenization.getTokenizations().isEmpty() || tokenization.getTokenizations().get(0).getTokens().length == 0) { - return new FillMaskResults(Collections.emptyList()); + return new WarningInferenceResults("No valid tokens for inference"); } int maskTokenIndex = Arrays.asList(tokenization.getTokenizations().get(0).getTokens()).indexOf(BertTokenizer.MASK_TOKEN); // TODO - process all results in the batch double[] normalizedScores = NlpHelpers.convertToProbabilitiesBySoftMax(pyTorchResult.getInferenceResult()[0][maskTokenIndex]); - NlpHelpers.ScoreAndIndex[] scoreAndIndices = NlpHelpers.topK(numResults, normalizedScores); - List results = new ArrayList<>(numResults); - for (NlpHelpers.ScoreAndIndex scoreAndIndex : scoreAndIndices) { - String predictedToken = tokenization.getFromVocab(scoreAndIndex.index); - String sequence = tokenization.getTokenizations().get(0).getInput().replace(BertTokenizer.MASK_TOKEN, predictedToken); - results.add(new FillMaskResults.Prediction(predictedToken, scoreAndIndex.score, sequence)); + NlpHelpers.ScoreAndIndex[] scoreAndIndices = NlpHelpers.topK( + // We need at least one to record the result + numResults == -1 ? Integer.MAX_VALUE : Math.max(numResults, 1), + normalizedScores + ); + List results = new ArrayList<>(scoreAndIndices.length); + if (numResults != 0) { + for (NlpHelpers.ScoreAndIndex scoreAndIndex : scoreAndIndices) { + String predictedToken = tokenization.getFromVocab(scoreAndIndex.index); + results.add(new TopClassEntry(predictedToken, scoreAndIndex.score, scoreAndIndex.score)); + } } - return new FillMaskResults(results); + return new FillMaskResults( + scoreAndIndices[0].index, + tokenization.getFromVocab(scoreAndIndices[0].index), + tokenization.getTokenizations().get(0).getInput().replace( + BertTokenizer.MASK_TOKEN, + tokenization.getFromVocab(scoreAndIndices[0].index) + ), + results, + DEFAULT_TOP_CLASSES_RESULTS_FIELD, + Optional.ofNullable(resultsField).orElse(DEFAULT_RESULTS_FIELD), + scoreAndIndices[0].score + ); } } diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/PassThroughProcessor.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/PassThroughProcessor.java index c577aaaa87b69..61c8a4838433e 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/PassThroughProcessor.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/PassThroughProcessor.java @@ -16,6 +16,9 @@ import org.elasticsearch.xpack.ml.inference.nlp.tokenizers.TokenizationResult; import java.util.List; +import java.util.Optional; + +import static org.elasticsearch.xpack.core.ml.inference.trainedmodel.InferenceConfig.DEFAULT_RESULTS_FIELD; /** * A NLP processor that directly returns the PyTorch result @@ -24,9 +27,11 @@ public class PassThroughProcessor implements NlpTask.Processor { private final NlpTask.RequestBuilder requestBuilder; + private final String resultsField; PassThroughProcessor(NlpTokenizer tokenizer, PassThroughConfig config) { this.requestBuilder = tokenizer.requestBuilder(); + this.resultsField = config.getResultsField(); } @Override @@ -41,11 +46,14 @@ public NlpTask.RequestBuilder getRequestBuilder(NlpConfig config) { @Override public NlpTask.ResultProcessor getResultProcessor(NlpConfig config) { - return PassThroughProcessor::processResult; + return (tokenization, pyTorchResult) -> processResult(tokenization, pyTorchResult, config.getResultsField()); } - private static InferenceResults processResult(TokenizationResult tokenization, PyTorchResult pyTorchResult) { + private static InferenceResults processResult(TokenizationResult tokenization, PyTorchResult pyTorchResult, String resultsField) { // TODO - process all results in the batch - return new PyTorchPassThroughResults(pyTorchResult.getInferenceResult()[0]); + return new PyTorchPassThroughResults( + Optional.ofNullable(resultsField).orElse(DEFAULT_RESULTS_FIELD), + pyTorchResult.getInferenceResult()[0] + ); } } diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/TextClassificationProcessor.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/TextClassificationProcessor.java index a66f0d01a5c27..5e233f64cdbc5 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/TextClassificationProcessor.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/TextClassificationProcessor.java @@ -7,21 +7,27 @@ package org.elasticsearch.xpack.ml.inference.nlp; +import org.elasticsearch.xpack.core.ml.inference.results.ClassificationInferenceResults; import org.elasticsearch.xpack.core.ml.inference.results.InferenceResults; -import org.elasticsearch.xpack.core.ml.inference.results.TextClassificationResults; import org.elasticsearch.xpack.core.ml.inference.results.TopClassEntry; import org.elasticsearch.xpack.core.ml.inference.results.WarningInferenceResults; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.NlpConfig; +import org.elasticsearch.xpack.core.ml.inference.trainedmodel.PredictionFieldType; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.TextClassificationConfig; import org.elasticsearch.xpack.ml.inference.deployment.PyTorchResult; import org.elasticsearch.xpack.ml.inference.nlp.tokenizers.NlpTokenizer; import org.elasticsearch.xpack.ml.inference.nlp.tokenizers.TokenizationResult; +import java.util.Arrays; import java.util.Comparator; import java.util.List; +import java.util.Optional; import java.util.stream.Collectors; import java.util.stream.IntStream; +import static org.elasticsearch.xpack.core.ml.inference.trainedmodel.InferenceConfig.DEFAULT_RESULTS_FIELD; +import static org.elasticsearch.xpack.core.ml.inference.trainedmodel.InferenceConfig.DEFAULT_TOP_CLASSES_RESULTS_FIELD; + public class TextClassificationProcessor implements NlpTask.Processor { private final NlpTask.RequestBuilder requestBuilder; @@ -54,32 +60,69 @@ public NlpTask.RequestBuilder getRequestBuilder(NlpConfig config) { @Override public NlpTask.ResultProcessor getResultProcessor(NlpConfig config) { - return this::processResult; + if (config instanceof TextClassificationConfig) { + TextClassificationConfig textClassificationConfig = (TextClassificationConfig) config; + return (tokenization, pytorchResult) -> processResult( + tokenization, + pytorchResult, + textClassificationConfig.getNumTopClasses() < 0 ? + textClassificationConfig.getClassificationLabels().size() : + textClassificationConfig.getNumTopClasses(), + textClassificationConfig.getClassificationLabels(), + textClassificationConfig.getResultsField() + ); + } + return (tokenization, pytorchResult) -> processResult( + tokenization, + pytorchResult, + numTopClasses, + Arrays.asList(classLabels), + DEFAULT_RESULTS_FIELD + ); } - InferenceResults processResult(TokenizationResult tokenization, PyTorchResult pyTorchResult) { + static InferenceResults processResult( + TokenizationResult tokenization, + PyTorchResult pyTorchResult, + int numTopClasses, + List labels, + String resultsField + ) { if (pyTorchResult.getInferenceResult().length < 1) { return new WarningInferenceResults("Text classification result has no data"); } // TODO only the first entry in the batch result is verified and // checked. Implement for all in batch - if (pyTorchResult.getInferenceResult()[0][0].length != classLabels.length) { + if (pyTorchResult.getInferenceResult()[0][0].length != labels.size()) { return new WarningInferenceResults( "Expected exactly [{}] values in text classification result; got [{}]", - classLabels.length, + labels.size(), pyTorchResult.getInferenceResult()[0][0].length ); } double[] normalizedScores = NlpHelpers.convertToProbabilitiesBySoftMax(pyTorchResult.getInferenceResult()[0][0]); - return new TextClassificationResults( - IntStream.range(0, normalizedScores.length) - .mapToObj(i -> new TopClassEntry(classLabels[i], normalizedScores[i])) - // Put the highest scoring class first - .sorted(Comparator.comparing(TopClassEntry::getProbability).reversed()) + int[] sortedIndices = IntStream.range(0, normalizedScores.length) + .boxed() + .sorted(Comparator.comparing(i -> normalizedScores[(Integer) i]).reversed()) + .mapToInt(i -> i) + .toArray(); + + return new ClassificationInferenceResults( + sortedIndices[0], + labels.get(sortedIndices[0]), + Arrays.stream(sortedIndices) + .mapToObj(i -> new TopClassEntry(labels.get(i), normalizedScores[i])) .limit(numTopClasses) - .collect(Collectors.toList()) + .collect(Collectors.toList()), + List.of(), + DEFAULT_TOP_CLASSES_RESULTS_FIELD, + Optional.ofNullable(resultsField).orElse(DEFAULT_RESULTS_FIELD), + PredictionFieldType.STRING, + 0, + normalizedScores[sortedIndices[0]], + null ); } } diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/TextEmbeddingProcessor.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/TextEmbeddingProcessor.java index 29886094d7e0e..b5b576b441497 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/TextEmbeddingProcessor.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/TextEmbeddingProcessor.java @@ -16,6 +16,9 @@ import org.elasticsearch.xpack.ml.inference.nlp.tokenizers.TokenizationResult; import java.util.List; +import java.util.Optional; + +import static org.elasticsearch.xpack.core.ml.inference.trainedmodel.InferenceConfig.DEFAULT_RESULTS_FIELD; /** * A NLP processor that returns a single double[] output from the model. Assumes that only one tensor is returned via inference @@ -40,11 +43,14 @@ public NlpTask.RequestBuilder getRequestBuilder(NlpConfig config) { @Override public NlpTask.ResultProcessor getResultProcessor(NlpConfig config) { - return TextEmbeddingProcessor::processResult; + return (tokenization, pyTorchResult) -> processResult(tokenization, pyTorchResult, config.getResultsField()); } - private static InferenceResults processResult(TokenizationResult tokenization, PyTorchResult pyTorchResult) { + private static InferenceResults processResult(TokenizationResult tokenization, PyTorchResult pyTorchResult, String resultsField) { // TODO - process all results in the batch - return new TextEmbeddingResults(pyTorchResult.getInferenceResult()[0][0]); + return new TextEmbeddingResults( + Optional.ofNullable(resultsField).orElse(DEFAULT_RESULTS_FIELD), + pyTorchResult.getInferenceResult()[0][0] + ); } } diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/ZeroShotClassificationProcessor.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/ZeroShotClassificationProcessor.java index b9a4c53ea428d..accaabd2d5eee 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/ZeroShotClassificationProcessor.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/ZeroShotClassificationProcessor.java @@ -8,11 +8,12 @@ package org.elasticsearch.xpack.ml.inference.nlp; import org.elasticsearch.common.logging.LoggerMessageFormat; +import org.elasticsearch.xpack.core.ml.inference.results.ClassificationInferenceResults; import org.elasticsearch.xpack.core.ml.inference.results.InferenceResults; -import org.elasticsearch.xpack.core.ml.inference.results.TextClassificationResults; import org.elasticsearch.xpack.core.ml.inference.results.TopClassEntry; import org.elasticsearch.xpack.core.ml.inference.results.WarningInferenceResults; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.NlpConfig; +import org.elasticsearch.xpack.core.ml.inference.trainedmodel.PredictionFieldType; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.ZeroShotClassificationConfig; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; import org.elasticsearch.xpack.ml.inference.deployment.PyTorchResult; @@ -21,6 +22,7 @@ import java.io.IOException; import java.util.ArrayList; +import java.util.Arrays; import java.util.Comparator; import java.util.List; import java.util.Locale; @@ -28,6 +30,9 @@ import java.util.stream.Collectors; import java.util.stream.IntStream; +import static org.elasticsearch.xpack.core.ml.inference.trainedmodel.InferenceConfig.DEFAULT_RESULTS_FIELD; +import static org.elasticsearch.xpack.core.ml.inference.trainedmodel.InferenceConfig.DEFAULT_TOP_CLASSES_RESULTS_FIELD; + public class ZeroShotClassificationProcessor implements NlpTask.Processor { private final NlpTokenizer tokenizer; @@ -36,6 +41,7 @@ public class ZeroShotClassificationProcessor implements NlpTask.Processor { private final String[] labels; private final String hypothesisTemplate; private final boolean isMultiLabel; + private final String resultsField; ZeroShotClassificationProcessor(NlpTokenizer tokenizer, ZeroShotClassificationConfig config) { this.tokenizer = tokenizer; @@ -53,6 +59,7 @@ public class ZeroShotClassificationProcessor implements NlpTask.Processor { this.labels = Optional.ofNullable(config.getLabels()).orElse(List.of()).toArray(String[]::new); this.hypothesisTemplate = config.getHypothesisTemplate(); this.isMultiLabel = config.isMultiLabel(); + this.resultsField = config.getResultsField(); } @Override @@ -79,15 +86,18 @@ public NlpTask.RequestBuilder getRequestBuilder(NlpConfig nlpConfig) { public NlpTask.ResultProcessor getResultProcessor(NlpConfig nlpConfig) { final String[] labels; final boolean isMultiLabel; + final String resultsField; if (nlpConfig instanceof ZeroShotClassificationConfig) { ZeroShotClassificationConfig zeroShotConfig = (ZeroShotClassificationConfig) nlpConfig; labels = zeroShotConfig.getLabels().toArray(new String[0]); isMultiLabel = zeroShotConfig.isMultiLabel(); + resultsField = zeroShotConfig.getResultsField(); } else { labels = this.labels; isMultiLabel = this.isMultiLabel; + resultsField = this.resultsField; } - return new ResultProcessor(entailmentPos, contraPos, labels, isMultiLabel); + return new ResultProcessor(entailmentPos, contraPos, labels, isMultiLabel, resultsField); } static class RequestBuilder implements NlpTask.RequestBuilder { @@ -126,12 +136,14 @@ static class ResultProcessor implements NlpTask.ResultProcessor { private final int contraPos; private final String[] labels; private final boolean isMultiLabel; + private final String resultsField; - ResultProcessor(int entailmentPos, int contraPos, String[] labels, boolean isMultiLabel) { + ResultProcessor(int entailmentPos, int contraPos, String[] labels, boolean isMultiLabel, String resultsField) { this.entailmentPos = entailmentPos; this.contraPos = contraPos; this.labels = labels; this.isMultiLabel = isMultiLabel; + this.resultsField = resultsField; } @Override @@ -180,14 +192,25 @@ public InferenceResults processResult(TokenizationResult tokenization, PyTorchRe } normalizedScores = NlpHelpers.convertToProbabilitiesBySoftMax(entailmentScores); } - - return new TextClassificationResults( - IntStream.range(0, normalizedScores.length) + int[] sortedIndices = IntStream.range(0, normalizedScores.length) + .boxed() + .sorted(Comparator.comparing(i -> normalizedScores[(Integer)i]).reversed()) + .mapToInt(i -> i) + .toArray(); + + return new ClassificationInferenceResults( + sortedIndices[0], + labels[sortedIndices[0]], + Arrays.stream(sortedIndices) .mapToObj(i -> new TopClassEntry(labels[i], normalizedScores[i])) - // Put the highest scoring class first - .sorted(Comparator.comparing(TopClassEntry::getProbability).reversed()) - .limit(labels.length) - .collect(Collectors.toList()) + .collect(Collectors.toList()), + List.of(), + DEFAULT_TOP_CLASSES_RESULTS_FIELD, + Optional.ofNullable(resultsField).orElse(DEFAULT_RESULTS_FIELD), + PredictionFieldType.STRING, + 0, + normalizedScores[sortedIndices[0]], + null ); } } diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/FillMaskProcessorTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/FillMaskProcessorTests.java index a4df5070067a1..e71d1c89e903f 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/FillMaskProcessorTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/FillMaskProcessorTests.java @@ -9,6 +9,8 @@ import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.ml.inference.results.FillMaskResults; +import org.elasticsearch.xpack.core.ml.inference.results.TopClassEntry; +import org.elasticsearch.xpack.core.ml.inference.results.WarningInferenceResults; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.FillMaskConfig; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.VocabularyConfig; import org.elasticsearch.xpack.ml.inference.deployment.PyTorchResult; @@ -20,8 +22,9 @@ import java.util.List; import static org.hamcrest.Matchers.containsString; -import static org.hamcrest.Matchers.empty; +import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasSize; +import static org.hamcrest.Matchers.instanceOf; import static org.mockito.Mockito.mock; public class @@ -49,34 +52,34 @@ public void testProcessResults() { TokenizationResult tokenization = new TokenizationResult(vocab); tokenization.addTokenization(input, tokens, tokenIds, tokenMap); - FillMaskConfig config = new FillMaskConfig(new VocabularyConfig("test-index"), null, null, null); - - FillMaskProcessor processor = new FillMaskProcessor(mock(BertTokenizer.class), config); - FillMaskResults result = (FillMaskResults) processor.processResult(tokenization, new PyTorchResult("1", scores, 0L, null), 4); - assertThat(result.getPredictions(), hasSize(4)); - FillMaskResults.Prediction prediction = result.getPredictions().get(0); - assertEquals("France", prediction.getToken()); - assertEquals("The capital of France is Paris", prediction.getSequence()); - - prediction = result.getPredictions().get(1); - assertEquals("of", prediction.getToken()); - assertEquals("The capital of of is Paris", prediction.getSequence()); - - prediction = result.getPredictions().get(2); - assertEquals("Paris", prediction.getToken()); - assertEquals("The capital of Paris is Paris", prediction.getSequence()); + String resultsField = randomAlphaOfLength(10); + FillMaskResults result = (FillMaskResults) FillMaskProcessor.processResult( + tokenization, + new PyTorchResult("1", scores, 0L, null), + 4, + resultsField + ); + assertThat(result.asMap().get(resultsField), equalTo("France")); + assertThat(result.getTopClasses(), hasSize(4)); + assertEquals("France", result.getClassificationLabel()); + assertEquals("The capital of France is Paris", result.getPredictedSequence()); + + TopClassEntry prediction = result.getTopClasses().get(1); + assertEquals("of", prediction.getClassification()); + + prediction = result.getTopClasses().get(2); + assertEquals("Paris", prediction.getClassification()); } public void testProcessResults_GivenMissingTokens() { TokenizationResult tokenization = new TokenizationResult(Collections.emptyList()); tokenization.addTokenization("", new String[]{}, new int[] {}, new int[] {}); - FillMaskConfig config = new FillMaskConfig(new VocabularyConfig("test-index"), null, null, null); - FillMaskProcessor processor = new FillMaskProcessor(mock(BertTokenizer.class), config); PyTorchResult pyTorchResult = new PyTorchResult("1", new double[][][]{{{}}}, 0L, null); - FillMaskResults result = (FillMaskResults) processor.processResult(tokenization, pyTorchResult, 5); - - assertThat(result.getPredictions(), empty()); + assertThat( + FillMaskProcessor.processResult(tokenization, pyTorchResult, 5, randomAlphaOfLength(10)), + instanceOf(WarningInferenceResults.class) + ); } public void testValidate_GivenMissingMaskToken() { diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/TextClassificationProcessorTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/TextClassificationProcessorTests.java index 143de1fef34da..eff3194fcd0b8 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/TextClassificationProcessorTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/TextClassificationProcessorTests.java @@ -26,24 +26,31 @@ import static org.hamcrest.Matchers.hasSize; import static org.hamcrest.Matchers.instanceOf; -import static org.mockito.Mockito.mock; public class TextClassificationProcessorTests extends ESTestCase { public void testInvalidResult() { - TextClassificationConfig config = new TextClassificationConfig( - new VocabularyConfig("test-index"), null, List.of("a", "b"), null, null); - - TextClassificationProcessor processor = new TextClassificationProcessor(mock(BertTokenizer.class), config); { PyTorchResult torchResult = new PyTorchResult("foo", new double[][][] {}, 0L, null); - InferenceResults inferenceResults = processor.processResult(null, torchResult); + InferenceResults inferenceResults = TextClassificationProcessor.processResult( + null, + torchResult, + randomInt(), + List.of("a", "b"), + randomAlphaOfLength(10) + ); assertThat(inferenceResults, instanceOf(WarningInferenceResults.class)); assertEquals("Text classification result has no data", ((WarningInferenceResults) inferenceResults).getWarning()); } { PyTorchResult torchResult = new PyTorchResult("foo", new double[][][] { { { 1.0 } } }, 0L, null); - InferenceResults inferenceResults = processor.processResult(null, torchResult); + InferenceResults inferenceResults = TextClassificationProcessor.processResult( + null, + torchResult, + randomInt(), + List.of("a", "b"), + randomAlphaOfLength(10) + ); assertThat(inferenceResults, instanceOf(WarningInferenceResults.class)); assertEquals( "Expected exactly [2] values in text classification result; got [1]", From 84b5e351207ab233a262834939f5e171894aab0c Mon Sep 17 00:00:00 2001 From: Ioannis Kakavas Date: Fri, 1 Oct 2021 17:39:27 +0300 Subject: [PATCH 099/250] Mute offending flaky tests (#78560) relates: #77261, #78557 --- .../packaging/test/ArchiveGenerateInitialCredentialsTests.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qa/os/src/test/java/org/elasticsearch/packaging/test/ArchiveGenerateInitialCredentialsTests.java b/qa/os/src/test/java/org/elasticsearch/packaging/test/ArchiveGenerateInitialCredentialsTests.java index 80f0f901b8046..5747bd6c41647 100644 --- a/qa/os/src/test/java/org/elasticsearch/packaging/test/ArchiveGenerateInitialCredentialsTests.java +++ b/qa/os/src/test/java/org/elasticsearch/packaging/test/ArchiveGenerateInitialCredentialsTests.java @@ -78,6 +78,7 @@ public void test30NoAutogenerationWhenDaemonized() throws Exception { assertThat(logfile, not(containsString("Enrollment token for kibana (valid for the next 30 minutes) :"))); } + @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/77621") public void test40VerifyAutogeneratedCredentials() throws Exception { /* Windows issue awaits fix: https://github.com/elastic/elasticsearch/issues/49340 */ assumeTrue("expect command isn't on Windows", distribution.platform != Distribution.Platform.WINDOWS); @@ -96,6 +97,7 @@ public void test40VerifyAutogeneratedCredentials() throws Exception { assertThat(response, containsString("You Know, for Search")); } + @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/77621") public void test50CredentialAutogenerationOnlyOnce() throws Exception { /* Windows issue awaits fix: https://github.com/elastic/elasticsearch/issues/49340 */ assumeTrue("expect command isn't on Windows", distribution.platform != Distribution.Platform.WINDOWS); From ec8603a357769b441673fda303c9f96d02fab8fd Mon Sep 17 00:00:00 2001 From: Armin Braun Date: Fri, 1 Oct 2021 17:47:46 +0200 Subject: [PATCH 100/250] Simple ILM Task Batching Implementation (#78547) A simple implementation for ILM task batching that resolves the issue of ILM creating endless queues of tasks at `NORMAL` priority in most cases. A follow-up to this should make this more efficient by not using outright cluster state updates as batching tasks to avoid creating a series of concrete cluster states for each task which can become somewhat expensive if a larger number of tasks is batched together. --- .../ClusterStateWaitThresholdBreachTests.java | 18 +++++++-- .../xpack/ilm/ExecuteStepsUpdateTask.java | 34 ++++++++--------- .../IndexLifecycleClusterStateUpdateTask.java | 30 ++++++++++++--- .../xpack/ilm/IndexLifecycleRunner.java | 21 +++++++++- .../xpack/ilm/MoveToNextStepUpdateTask.java | 6 +-- .../xpack/ilm/SetStepInfoUpdateTask.java | 2 +- .../ilm/ExecuteStepsUpdateTaskTests.java | 16 ++++---- .../xpack/ilm/IndexLifecycleRunnerTests.java | 38 +++++++++++++------ .../xpack/ilm/IndexLifecycleServiceTests.java | 2 +- .../ilm/MoveToNextStepUpdateTaskTests.java | 8 ++-- .../xpack/ilm/SetStepInfoUpdateTaskTests.java | 8 ++-- 11 files changed, 121 insertions(+), 62 deletions(-) diff --git a/x-pack/plugin/ilm/src/internalClusterTest/java/org/elasticsearch/xpack/ilm/ClusterStateWaitThresholdBreachTests.java b/x-pack/plugin/ilm/src/internalClusterTest/java/org/elasticsearch/xpack/ilm/ClusterStateWaitThresholdBreachTests.java index c7debff3c9354..0b297a283c727 100644 --- a/x-pack/plugin/ilm/src/internalClusterTest/java/org/elasticsearch/xpack/ilm/ClusterStateWaitThresholdBreachTests.java +++ b/x-pack/plugin/ilm/src/internalClusterTest/java/org/elasticsearch/xpack/ilm/ClusterStateWaitThresholdBreachTests.java @@ -8,6 +8,8 @@ package org.elasticsearch.xpack.ilm; import org.elasticsearch.action.admin.indices.create.CreateIndexResponse; +import org.elasticsearch.cluster.ClusterState; +import org.elasticsearch.cluster.ClusterStateUpdateTask; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.settings.Settings; @@ -139,9 +141,19 @@ public void testWaitInShrunkShardsAllocatedExceedsThreshold() throws Exception { // shrink cycle is started LongSupplier nowWayBackInThePastSupplier = () -> 1234L; clusterService.submitStateUpdateTask("testing-move-to-step-to-manipulate-step-time", - new MoveToNextStepUpdateTask(managedIndexMetadata.getIndex(), policy, currentStepKey, currentStepKey, - nowWayBackInThePastSupplier, indexLifecycleService.getPolicyRegistry(), state -> { - })); + new ClusterStateUpdateTask() { + @Override + public ClusterState execute(ClusterState currentState) throws Exception { + return new MoveToNextStepUpdateTask(managedIndexMetadata.getIndex(), policy, currentStepKey, currentStepKey, + nowWayBackInThePastSupplier, indexLifecycleService.getPolicyRegistry(), state -> { + }).execute(currentState); + } + + @Override + public void onFailure(String source, Exception e) { + throw new AssertionError(e); + } + }); String[] secondCycleShrinkIndexName = new String[1]; assertBusy(() -> { diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/ExecuteStepsUpdateTask.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/ExecuteStepsUpdateTask.java index 033015b48c5ea..0bce9dd212bad 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/ExecuteStepsUpdateTask.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/ExecuteStepsUpdateTask.java @@ -70,7 +70,7 @@ Step.StepKey getNextStepKey() { * @throws IOException if any exceptions occur */ @Override - public ClusterState execute(final ClusterState currentState) throws IOException { + public ClusterState doExecute(final ClusterState currentState) throws IOException { Step currentStep = startStep; IndexMetadata indexMetadata = currentState.metadata().index(index); if (indexMetadata == null) { @@ -172,25 +172,23 @@ public ClusterState execute(final ClusterState currentState) throws IOException @Override public void onClusterStateProcessed(String source, ClusterState oldState, ClusterState newState) { - if (oldState.equals(newState) == false) { - IndexMetadata indexMetadata = newState.metadata().index(index); - if (indexMetadata != null) { - - LifecycleExecutionState exState = LifecycleExecutionState.fromIndexMetadata(indexMetadata); - if (ErrorStep.NAME.equals(exState.getStep()) && this.failure != null) { - lifecycleRunner.registerFailedOperation(indexMetadata, failure); - } else { - lifecycleRunner.registerSuccessfulOperation(indexMetadata); - } + IndexMetadata indexMetadata = newState.metadata().index(index); + if (indexMetadata != null) { + + LifecycleExecutionState exState = LifecycleExecutionState.fromIndexMetadata(indexMetadata); + if (ErrorStep.NAME.equals(exState.getStep()) && this.failure != null) { + lifecycleRunner.registerFailedOperation(indexMetadata, failure); + } else { + lifecycleRunner.registerSuccessfulOperation(indexMetadata); + } - if (nextStepKey != null && nextStepKey != TerminalPolicyStep.KEY) { - logger.trace("[{}] step sequence starting with {} has completed, running next step {} if it is an async action", + if (nextStepKey != null && nextStepKey != TerminalPolicyStep.KEY) { + logger.trace("[{}] step sequence starting with {} has completed, running next step {} if it is an async action", index.getName(), startStep.getKey(), nextStepKey); - // After the cluster state has been processed and we have moved - // to a new step, we need to conditionally execute the step iff - // it is an `AsyncAction` so that it is executed exactly once. - lifecycleRunner.maybeRunAsyncAction(newState, indexMetadata, policy, nextStepKey); - } + // After the cluster state has been processed and we have moved + // to a new step, we need to conditionally execute the step iff + // it is an `AsyncAction` so that it is executed exactly once. + lifecycleRunner.maybeRunAsyncAction(newState, indexMetadata, policy, nextStepKey); } } } diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycleClusterStateUpdateTask.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycleClusterStateUpdateTask.java index 419b76f58727a..98e66b4706344 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycleClusterStateUpdateTask.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycleClusterStateUpdateTask.java @@ -9,7 +9,7 @@ import org.elasticsearch.action.ActionListener; import org.elasticsearch.cluster.ClusterState; -import org.elasticsearch.cluster.ClusterStateUpdateTask; +import org.elasticsearch.cluster.ClusterStateTaskListener; import org.elasticsearch.common.util.concurrent.ListenableFuture; import org.elasticsearch.index.Index; import org.elasticsearch.xpack.core.ilm.Step; @@ -18,7 +18,7 @@ * Base class for index lifecycle cluster state update tasks that requires implementing {@code equals} and {@code hashCode} to allow * for these tasks to be deduplicated by {@link IndexLifecycleRunner}. */ -public abstract class IndexLifecycleClusterStateUpdateTask extends ClusterStateUpdateTask { +public abstract class IndexLifecycleClusterStateUpdateTask implements ClusterStateTaskListener { private final ListenableFuture listener = new ListenableFuture<>(); @@ -39,10 +39,25 @@ final Step.StepKey getCurrentStepKey() { return currentStepKey; } + private boolean executed; + + public final ClusterState execute(ClusterState currentState) throws Exception { + assert executed == false; + final ClusterState updatedState = doExecute(currentState); + if (currentState != updatedState) { + executed = true; + } + return updatedState; + } + + protected abstract ClusterState doExecute(ClusterState currentState) throws Exception; + @Override public final void clusterStateProcessed(String source, ClusterState oldState, ClusterState newState) { listener.onResponse(null); - onClusterStateProcessed(source, oldState, newState); + if (executed) { + onClusterStateProcessed(source, oldState, newState); + } } @Override @@ -61,8 +76,11 @@ public final void addListener(ActionListener listener) { } /** - * This method is functionally the same as {@link ClusterStateUpdateTask#clusterStateProcessed(String, ClusterState, ClusterState)} + * This method is functionally the same as {@link ClusterStateTaskListener#clusterStateProcessed(String, ClusterState, ClusterState)} * and implementations can override it as they would override {@code ClusterStateUpdateTask#clusterStateProcessed}. + * The only difference to {@code ClusterStateUpdateTask#clusterStateProcessed} is that if the {@link #execute(ClusterState)} + * implementation was a noop and returned the input cluster state, then this method will not be invoked. It is therefore guaranteed + * that {@code oldState} is always different from {@code newState}. */ protected void onClusterStateProcessed(String source, ClusterState oldState, ClusterState newState) { } @@ -74,8 +92,8 @@ protected void onClusterStateProcessed(String source, ClusterState oldState, Clu public abstract int hashCode(); /** - * This method is functionally the same as {@link ClusterStateUpdateTask#onFailure(String, Exception)} and implementations can override - * it as they would override {@code ClusterStateUpdateTask#onFailure}. + * This method is functionally the same as {@link ClusterStateTaskListener#onFailure(String, Exception)} and implementations can + * override it as they would override {@code ClusterStateUpdateTask#onFailure}. */ protected abstract void handleFailure(String source, Exception e); } diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycleRunner.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycleRunner.java index f1cf2f0c0df1d..cb6f4a45faef3 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycleRunner.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycleRunner.java @@ -13,10 +13,12 @@ import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.ClusterStateObserver; import org.elasticsearch.cluster.ClusterStateTaskConfig; +import org.elasticsearch.cluster.ClusterStateTaskExecutor; import org.elasticsearch.cluster.ClusterStateUpdateTask; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.cluster.metadata.Metadata; import org.elasticsearch.cluster.service.ClusterService; +import org.elasticsearch.common.Priority; import org.elasticsearch.common.xcontent.ToXContentObject; import org.elasticsearch.core.Nullable; import org.elasticsearch.core.TimeValue; @@ -53,6 +55,21 @@ class IndexLifecycleRunner { private final ILMHistoryStore ilmHistoryStore; private final LongSupplier nowSupplier; + private static final ClusterStateTaskExecutor ILM_TASK_EXECUTOR = (currentState, tasks) -> { + ClusterStateTaskExecutor.ClusterTasksResult.Builder builder = + ClusterStateTaskExecutor.ClusterTasksResult.builder(); + ClusterState state = currentState; + for (IndexLifecycleClusterStateUpdateTask task : tasks) { + try { + state = task.execute(state); + builder.success(task); + } catch (Exception e) { + builder.failure(task, e); + } + } + return builder.build(state); + }; + IndexLifecycleRunner(PolicyStepsRegistry stepRegistry, ILMHistoryStore ilmHistoryStore, ClusterService clusterService, ThreadPool threadPool, LongSupplier nowSupplier) { this.stepRegistry = stepRegistry; @@ -522,6 +539,8 @@ void registerFailedOperation(IndexMetadata indexMetadata, Exception failure) { */ private final Set> busyIndices = Collections.synchronizedSet(new HashSet<>()); + static final ClusterStateTaskConfig ILM_TASK_CONFIG = ClusterStateTaskConfig.build(Priority.NORMAL); + /** * Tracks already executing {@link IndexLifecycleClusterStateUpdateTask} tasks in {@link #executingTasks} to prevent queueing up * duplicate cluster state updates. @@ -541,7 +560,7 @@ private void submitUnlessAlreadyQueued(String source, IndexLifecycleClusterState busyIndices.remove(dedupKey); assert removed : "tried to unregister unknown task [" + task + "]"; })); - clusterService.submitStateUpdateTask(source, task); + clusterService.submitStateUpdateTask(source, task, ILM_TASK_CONFIG, ILM_TASK_EXECUTOR, task); } else { logger.trace("skipped redundant execution of [{}]", source); } diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/MoveToNextStepUpdateTask.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/MoveToNextStepUpdateTask.java index 0fe21a683648c..f3953c4f4008f 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/MoveToNextStepUpdateTask.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/MoveToNextStepUpdateTask.java @@ -42,7 +42,7 @@ public MoveToNextStepUpdateTask(Index index, String policy, Step.StepKey current } @Override - public ClusterState execute(ClusterState currentState) { + public ClusterState doExecute(ClusterState currentState) { IndexMetadata indexMetadata = currentState.getMetadata().index(index); if (indexMetadata == null) { // Index must have been since deleted, ignore it @@ -64,9 +64,7 @@ public ClusterState execute(ClusterState currentState) { @Override public void onClusterStateProcessed(String source, ClusterState oldState, ClusterState newState) { - if (oldState.equals(newState) == false) { - stateChangeConsumer.accept(newState); - } + stateChangeConsumer.accept(newState); } @Override diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/SetStepInfoUpdateTask.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/SetStepInfoUpdateTask.java index 1de4cbc39e9a1..60b0a40c57c39 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/SetStepInfoUpdateTask.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/SetStepInfoUpdateTask.java @@ -46,7 +46,7 @@ ToXContentObject getStepInfo() { } @Override - public ClusterState execute(ClusterState currentState) throws IOException { + protected ClusterState doExecute(ClusterState currentState) throws IOException { IndexMetadata idxMeta = currentState.getMetadata().index(index); if (idxMeta == null) { // Index must have been since deleted, ignore it diff --git a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/ExecuteStepsUpdateTaskTests.java b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/ExecuteStepsUpdateTaskTests.java index a43e0458f6f0e..c38164acc6e01 100644 --- a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/ExecuteStepsUpdateTaskTests.java +++ b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/ExecuteStepsUpdateTaskTests.java @@ -143,7 +143,7 @@ private IndexMetadata setupIndexPolicy(String policyName) { return indexMetadata; } - public void testNeverExecuteNonClusterStateStep() throws IOException { + public void testNeverExecuteNonClusterStateStep() throws Exception { setStateToKey(thirdStepKey); Step startStep = policyStepsRegistry.getStep(indexMetadata, thirdStepKey); long now = randomNonNegativeLong(); @@ -151,7 +151,7 @@ public void testNeverExecuteNonClusterStateStep() throws IOException { assertThat(task.execute(clusterState), sameInstance(clusterState)); } - public void testSuccessThenFailureUnsetNextKey() throws IOException { + public void testSuccessThenFailureUnsetNextKey() throws Exception { secondStep.setWillComplete(false); setStateToKey(firstStepKey); Step startStep = policyStepsRegistry.getStep(indexMetadata, firstStepKey); @@ -169,7 +169,7 @@ public void testSuccessThenFailureUnsetNextKey() throws IOException { assertThat(lifecycleState.getStepInfo(), nullValue()); } - public void testExecuteUntilFirstNonClusterStateStep() throws IOException { + public void testExecuteUntilFirstNonClusterStateStep() throws Exception { setStateToKey(secondStepKey); Step startStep = policyStepsRegistry.getStep(indexMetadata, secondStepKey); long now = randomNonNegativeLong(); @@ -185,7 +185,7 @@ public void testExecuteUntilFirstNonClusterStateStep() throws IOException { assertThat(lifecycleState.getStepInfo(), nullValue()); } - public void testExecuteInvalidStartStep() throws IOException { + public void testExecuteInvalidStartStep() throws Exception { // Unset the index's phase/action/step to simulate starting from scratch LifecycleExecutionState.Builder lifecycleState = LifecycleExecutionState.builder( LifecycleExecutionState.fromIndexMetadata(clusterState.getMetadata().index(index))); @@ -207,7 +207,7 @@ public void testExecuteInvalidStartStep() throws IOException { assertSame(newState, clusterState); } - public void testExecuteIncompleteWaitStepNoInfo() throws IOException { + public void testExecuteIncompleteWaitStepNoInfo() throws Exception { secondStep.setWillComplete(false); setStateToKey(secondStepKey); Step startStep = policyStepsRegistry.getStep(indexMetadata, secondStepKey); @@ -224,7 +224,7 @@ public void testExecuteIncompleteWaitStepNoInfo() throws IOException { assertThat(lifecycleState.getStepInfo(), nullValue()); } - public void testExecuteIncompleteWaitStepWithInfo() throws IOException { + public void testExecuteIncompleteWaitStepWithInfo() throws Exception { secondStep.setWillComplete(false); RandomStepInfo stepInfo = new RandomStepInfo(() -> randomAlphaOfLength(10)); secondStep.expectedInfo(stepInfo); @@ -252,7 +252,7 @@ public void testOnFailure() throws IOException { task.onFailure(randomAlphaOfLength(10), expectedException); } - public void testClusterActionStepThrowsException() throws IOException { + public void testClusterActionStepThrowsException() throws Exception { RuntimeException thrownException = new RuntimeException("error"); firstStep.setException(thrownException); setStateToKey(firstStepKey); @@ -272,7 +272,7 @@ public void testClusterActionStepThrowsException() throws IOException { containsString("{\"type\":\"runtime_exception\",\"reason\":\"error\",\"stack_trace\":\"")); } - public void testClusterWaitStepThrowsException() throws IOException { + public void testClusterWaitStepThrowsException() throws Exception { RuntimeException thrownException = new RuntimeException("error"); secondStep.setException(thrownException); setStateToKey(firstStepKey); diff --git a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/IndexLifecycleRunnerTests.java b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/IndexLifecycleRunnerTests.java index 0ad5e2d29992f..16b99a7a94478 100644 --- a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/IndexLifecycleRunnerTests.java +++ b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/IndexLifecycleRunnerTests.java @@ -91,6 +91,8 @@ import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; import static org.mockito.Matchers.any; +import static org.mockito.Matchers.anyString; +import static org.mockito.Matchers.eq; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; import static org.mockito.Mockito.when; @@ -164,7 +166,7 @@ public void testRunPolicyPhaseCompleteWithMoreStepsPolicyStep() { runner.runPolicyAfterStateChange(policyName, indexMetadata); runner.runPeriodicStep(policyName, Metadata.builder().put(indexMetadata, true).build(), indexMetadata); - Mockito.verify(clusterService, times(1)).submitStateUpdateTask(any(), any()); + Mockito.verify(clusterService, times(1)).submitStateUpdateTask(anyString(), any(), any(), any(), any()); } public void testRunPolicyErrorStep() { @@ -626,10 +628,15 @@ public void testRunPolicyClusterStateActionStep() { runner.runPolicyAfterStateChange(policyName, indexMetadata); + final ExecuteStepsUpdateTaskMatcher taskMatcher = + new ExecuteStepsUpdateTaskMatcher(indexMetadata.getIndex(), policyName, step); Mockito.verify(clusterService, Mockito.times(1)).submitStateUpdateTask( Mockito.eq("ilm-execute-cluster-state-steps [{\"phase\":\"phase\",\"action\":\"action\"," + "\"name\":\"cluster_state_action_step\"} => null]"), - Mockito.argThat(new ExecuteStepsUpdateTaskMatcher(indexMetadata.getIndex(), policyName, step)) + Mockito.argThat(taskMatcher), + eq(IndexLifecycleRunner.ILM_TASK_CONFIG), + any(), + Mockito.argThat(taskMatcher) ); Mockito.verifyNoMoreInteractions(clusterService); } @@ -646,10 +653,15 @@ public void testRunPolicyClusterStateWaitStep() { runner.runPolicyAfterStateChange(policyName, indexMetadata); + final ExecuteStepsUpdateTaskMatcher taskMatcher = + new ExecuteStepsUpdateTaskMatcher(indexMetadata.getIndex(), policyName, step); Mockito.verify(clusterService, Mockito.times(1)).submitStateUpdateTask( Mockito.eq("ilm-execute-cluster-state-steps [{\"phase\":\"phase\",\"action\":\"action\"," + "\"name\":\"cluster_state_action_step\"} => null]"), - Mockito.argThat(new ExecuteStepsUpdateTaskMatcher(indexMetadata.getIndex(), policyName, step)) + Mockito.argThat(taskMatcher), + eq(IndexLifecycleRunner.ILM_TASK_CONFIG), + any(), + Mockito.argThat(taskMatcher) ); Mockito.verifyNoMoreInteractions(clusterService); } @@ -699,16 +711,20 @@ public void testRunPolicyThatDoesntExist() { .numberOfShards(randomIntBetween(1, 5)).numberOfReplicas(randomIntBetween(0, 5)).build(); // verify that no exception is thrown runner.runPolicyAfterStateChange(policyName, indexMetadata); + final SetStepInfoUpdateTaskMatcher taskMatcher = new SetStepInfoUpdateTaskMatcher(indexMetadata.getIndex(), policyName, null, + (builder, params) -> { + builder.startObject(); + builder.field("reason", "policy [does_not_exist] does not exist"); + builder.field("type", "illegal_argument_exception"); + builder.endObject(); + return builder; + }); Mockito.verify(clusterService, Mockito.times(1)).submitStateUpdateTask( Mockito.eq("ilm-set-step-info {policy [cluster_state_action_policy], index [my_index], currentStep [null]}"), - Mockito.argThat(new SetStepInfoUpdateTaskMatcher(indexMetadata.getIndex(), policyName, null, - (builder, params) -> { - builder.startObject(); - builder.field("reason", "policy [does_not_exist] does not exist"); - builder.field("type", "illegal_argument_exception"); - builder.endObject(); - return builder; - })) + Mockito.argThat(taskMatcher), + eq(IndexLifecycleRunner.ILM_TASK_CONFIG), + any(), + Mockito.argThat(taskMatcher) ); Mockito.verifyNoMoreInteractions(clusterService); } diff --git a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/IndexLifecycleServiceTests.java b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/IndexLifecycleServiceTests.java index e0a1e2a36e939..7d3f498e906dd 100644 --- a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/IndexLifecycleServiceTests.java +++ b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/IndexLifecycleServiceTests.java @@ -304,7 +304,7 @@ public void testRequestedStopOnSafeAction() { doAnswer(invocationOnMock -> { ranPolicy.set(true); throw new AssertionError("invalid invocation"); - }).when(clusterService).submitStateUpdateTask(anyString(), any(ExecuteStepsUpdateTask.class)); + }).when(clusterService).submitStateUpdateTask(anyString(), any(), eq(IndexLifecycleRunner.ILM_TASK_CONFIG), any(), any()); doAnswer(invocationOnMock -> { OperationModeUpdateTask task = (OperationModeUpdateTask) invocationOnMock.getArguments()[1]; diff --git a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/MoveToNextStepUpdateTaskTests.java b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/MoveToNextStepUpdateTaskTests.java index 098bf4902499a..ef93516e65171 100644 --- a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/MoveToNextStepUpdateTaskTests.java +++ b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/MoveToNextStepUpdateTaskTests.java @@ -62,7 +62,7 @@ public void setupClusterState() { clusterState = ClusterState.builder(ClusterName.DEFAULT).metadata(metadata).build(); } - public void testExecuteSuccessfullyMoved() { + public void testExecuteSuccessfullyMoved() throws Exception { long now = randomNonNegativeLong(); List steps = lifecyclePolicy.toSteps(null, null); StepKey currentStepKey = steps.get(0).getKey(); @@ -84,7 +84,7 @@ public void testExecuteSuccessfullyMoved() { assertTrue(changed.get()); } - public void testExecuteDifferentCurrentStep() { + public void testExecuteDifferentCurrentStep() throws Exception { StepKey currentStepKey = new StepKey("current-phase", "current-action", "current-name"); StepKey notCurrentStepKey = new StepKey("not-current", "not-current", "not-current"); long now = randomNonNegativeLong(); @@ -95,7 +95,7 @@ public void testExecuteDifferentCurrentStep() { assertSame(newState, clusterState); } - public void testExecuteDifferentPolicy() { + public void testExecuteDifferentPolicy() throws Exception { StepKey currentStepKey = new StepKey("current-phase", "current-action", "current-name"); long now = randomNonNegativeLong(); setStateToKey(currentStepKey, now); @@ -106,7 +106,7 @@ public void testExecuteDifferentPolicy() { assertSame(newState, clusterState); } - public void testExecuteSuccessfulMoveWithInvalidNextStep() { + public void testExecuteSuccessfulMoveWithInvalidNextStep() throws Exception { long now = randomNonNegativeLong(); List steps = lifecyclePolicy.toSteps(null, null); StepKey currentStepKey = steps.get(0).getKey(); diff --git a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/SetStepInfoUpdateTaskTests.java b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/SetStepInfoUpdateTaskTests.java index 1f757acb68ac0..6cdd3b7bd3c02 100644 --- a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/SetStepInfoUpdateTaskTests.java +++ b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/SetStepInfoUpdateTaskTests.java @@ -31,8 +31,6 @@ import org.elasticsearch.xpack.core.ilm.Step.StepKey; import org.junit.Before; -import java.io.IOException; - import static org.elasticsearch.xpack.core.ilm.LifecycleExecutionState.ILM_CUSTOM_METADATA_KEY; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.nullValue; @@ -59,7 +57,7 @@ public void setupClusterState() { clusterState = ClusterState.builder(ClusterName.DEFAULT).metadata(metadata).build(); } - public void testExecuteSuccessfullySet() throws IOException { + public void testExecuteSuccessfullySet() throws Exception { StepKey currentStepKey = new StepKey("current-phase", "current-action", "current-name"); ToXContentObject stepInfo = getRandomStepInfo(); setStateToKey(currentStepKey); @@ -90,7 +88,7 @@ private ToXContentObject getRandomStepInfo() { }; } - public void testExecuteNoopDifferentStep() throws IOException { + public void testExecuteNoopDifferentStep() throws Exception { StepKey currentStepKey = new StepKey("current-phase", "current-action", "current-name"); StepKey notCurrentStepKey = new StepKey("not-current", "not-current", "not-current"); ToXContentObject stepInfo = getRandomStepInfo(); @@ -100,7 +98,7 @@ public void testExecuteNoopDifferentStep() throws IOException { assertThat(newState, sameInstance(clusterState)); } - public void testExecuteNoopDifferentPolicy() throws IOException { + public void testExecuteNoopDifferentPolicy() throws Exception { StepKey currentStepKey = new StepKey("current-phase", "current-action", "current-name"); ToXContentObject stepInfo = getRandomStepInfo(); setStateToKey(currentStepKey); From 5c3f92bf0612c840e5c9e286f22c5c6a2b0cf346 Mon Sep 17 00:00:00 2001 From: Benjamin Trent Date: Fri, 1 Oct 2021 12:48:34 -0400 Subject: [PATCH 101/250] [ML] add trained model APIs to upgrade mode filters (#78566) There are some new APIs that create + write to internal ML indices: - Put trained model definition part - Put trained model vocab These should not be allowed during upgrade mode. Additionally, for safety, new deployments are not allowed during upgrade mode. As for reset model exemptions, no new ones are required as `DeleteTrainedModel` deletes ALL related documents. --- .../xpack/ml/MlUpgradeModeActionFilter.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/MlUpgradeModeActionFilter.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/MlUpgradeModeActionFilter.java index 94106a800e2dd..a6dae69b6ece2 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/MlUpgradeModeActionFilter.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/MlUpgradeModeActionFilter.java @@ -43,9 +43,12 @@ import org.elasticsearch.xpack.core.ml.action.PutJobAction; import org.elasticsearch.xpack.core.ml.action.PutTrainedModelAction; import org.elasticsearch.xpack.core.ml.action.PutTrainedModelAliasAction; +import org.elasticsearch.xpack.core.ml.action.PutTrainedModelDefinitionPartAction; +import org.elasticsearch.xpack.core.ml.action.PutTrainedModelVocabularyAction; import org.elasticsearch.xpack.core.ml.action.RevertModelSnapshotAction; import org.elasticsearch.xpack.core.ml.action.StartDataFrameAnalyticsAction; import org.elasticsearch.xpack.core.ml.action.StartDatafeedAction; +import org.elasticsearch.xpack.core.ml.action.StartTrainedModelDeploymentAction; import org.elasticsearch.xpack.core.ml.action.StopDataFrameAnalyticsAction; import org.elasticsearch.xpack.core.ml.action.StopDatafeedAction; import org.elasticsearch.xpack.core.ml.action.UpdateCalendarJobAction; @@ -123,6 +126,11 @@ class MlUpgradeModeActionFilter extends ActionFilter.Simple { PutTrainedModelAliasAction.NAME, PutTrainedModelAction.NAME, + PutTrainedModelDefinitionPartAction.NAME, + PutTrainedModelVocabularyAction.NAME, + // NOTE: StopTrainedModelDeploymentAction doesn't mutate internal indices, and technically neither does this action. + // But, preventing new deployments from being created while upgrading is for safety. + StartTrainedModelDeploymentAction.NAME, DeleteTrainedModelAction.NAME, DeleteTrainedModelAliasAction.NAME )); @@ -140,6 +148,7 @@ class MlUpgradeModeActionFilter extends ActionFilter.Simple { DeleteDataFrameAnalyticsAction.NAME, StopDataFrameAnalyticsAction.NAME, + // No other trained model APIs need to be exempted as `StopTrainedModelDeploymentAction` isn't filtered during upgrade mode DeleteTrainedModelAction.NAME )); From ec40e08f90b19a941b25b2028795dfaeb94a2d8b Mon Sep 17 00:00:00 2001 From: danielwhsu Date: Sat, 2 Oct 2021 01:22:40 +0800 Subject: [PATCH 102/250] Interrupt aggregation reduce phase if the search task is cancelled (#71714) This change raises a TaskCancelledException to stop the search query if it is detected that the SearchTask has been cancelled during the reduce phase. Issue: #71021 Co-authored-by: Daniel Hsu Co-authored-by: Igor Motov --- .../aggregations/TermsReduceBenchmark.java | 38 +++-- .../stats/InternalMatrixStatsTests.java | 3 +- .../search/SearchCancellationIT.java | 152 +++++++++++++++--- .../search/QueryPhaseResultConsumer.java | 4 +- .../action/search/SearchPhaseController.java | 18 ++- .../TransportOpenPointInTimeAction.java | 2 +- .../action/search/TransportSearchAction.java | 12 +- .../elasticsearch/search/SearchService.java | 9 +- .../aggregations/InternalAggregation.java | 24 ++- .../action/search/DfsQueryPhaseTests.java | 8 +- .../action/search/FetchSearchPhaseTests.java | 25 ++- .../search/QueryPhaseResultConsumerTests.java | 8 +- .../search/SearchPhaseControllerTests.java | 28 ++-- .../SearchQueryThenFetchAsyncActionTests.java | 20 ++- .../search/SearchServiceTests.java | 2 +- .../bucket/filter/FiltersAggregatorTests.java | 3 +- .../DateHistogramAggregatorTests.java | 8 +- .../InternalVariableWidthHistogramTests.java | 15 +- .../bucket/terms/TermsAggregatorTests.java | 6 +- .../metrics/InternalScriptedMetricTests.java | 2 +- .../aggregations/AggregatorTestCase.java | 8 +- .../test/InternalAggregationTestCase.java | 10 +- ...nternalMultiBucketAggregationTestCase.java | 5 +- .../multiterms/InternalMultiTermsTests.java | 3 +- .../xpack/search/AsyncSearchTask.java | 8 +- .../TransportSubmitAsyncSearchAction.java | 12 +- .../xpack/search/AsyncSearchTaskTests.java | 6 +- .../rollup/RollupResponseTranslator.java | 3 +- .../action/TransportRollupSearchAction.java | 4 +- .../RollupResponseTranslationTests.java | 32 ++-- 30 files changed, 324 insertions(+), 154 deletions(-) diff --git a/benchmarks/src/main/java/org/elasticsearch/benchmark/search/aggregations/TermsReduceBenchmark.java b/benchmarks/src/main/java/org/elasticsearch/benchmark/search/aggregations/TermsReduceBenchmark.java index 56ea700792c82..64ad19a9a96e1 100644 --- a/benchmarks/src/main/java/org/elasticsearch/benchmark/search/aggregations/TermsReduceBenchmark.java +++ b/benchmarks/src/main/java/org/elasticsearch/benchmark/search/aggregations/TermsReduceBenchmark.java @@ -56,6 +56,7 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; @Warmup(iterations = 5) @Measurement(iterations = 7) @@ -64,21 +65,30 @@ @State(Scope.Thread) @Fork(value = 1) public class TermsReduceBenchmark { - private final SearchPhaseController controller = new SearchPhaseController(req -> new InternalAggregation.ReduceContextBuilder() { - @Override - public InternalAggregation.ReduceContext forPartialReduction() { - return InternalAggregation.ReduceContext.forPartialReduction(null, null, () -> PipelineAggregator.PipelineTree.EMPTY); - } - @Override - public InternalAggregation.ReduceContext forFinalReduction() { - final MultiBucketConsumerService.MultiBucketConsumer bucketConsumer = new MultiBucketConsumerService.MultiBucketConsumer( - Integer.MAX_VALUE, - new NoneCircuitBreakerService().getBreaker(CircuitBreaker.REQUEST) - ); - return InternalAggregation.ReduceContext.forFinalReduction(null, null, bucketConsumer, PipelineAggregator.PipelineTree.EMPTY); + private final SearchPhaseController controller = new SearchPhaseController( + (task, req) -> new InternalAggregation.ReduceContextBuilder() { + @Override + public InternalAggregation.ReduceContext forPartialReduction() { + return InternalAggregation.ReduceContext.forPartialReduction(null, null, () -> PipelineAggregator.PipelineTree.EMPTY, task); + } + + @Override + public InternalAggregation.ReduceContext forFinalReduction() { + final MultiBucketConsumerService.MultiBucketConsumer bucketConsumer = new MultiBucketConsumerService.MultiBucketConsumer( + Integer.MAX_VALUE, + new NoneCircuitBreakerService().getBreaker(CircuitBreaker.REQUEST) + ); + return InternalAggregation.ReduceContext.forFinalReduction( + null, + null, + bucketConsumer, + PipelineAggregator.PipelineTree.EMPTY, + task + ); + } } - }); + ); @State(Scope.Benchmark) public static class TermsList extends AbstractList { @@ -182,11 +192,13 @@ public SearchPhaseController.ReducedQueryPhase reduceAggs(TermsList candidateLis request.source(new SearchSourceBuilder().size(0).aggregation(AggregationBuilders.terms("test"))); request.setBatchedReduceSize(bufferSize); ExecutorService executor = Executors.newFixedThreadPool(1); + AtomicBoolean isCanceled = new AtomicBoolean(); QueryPhaseResultConsumer consumer = new QueryPhaseResultConsumer( request, executor, new NoopCircuitBreaker(CircuitBreaker.REQUEST), controller, + isCanceled::get, SearchProgressListener.NOOP, shards.size(), exc -> {} diff --git a/modules/aggs-matrix-stats/src/test/java/org/elasticsearch/search/aggregations/matrix/stats/InternalMatrixStatsTests.java b/modules/aggs-matrix-stats/src/test/java/org/elasticsearch/search/aggregations/matrix/stats/InternalMatrixStatsTests.java index c8055253b9aef..c7b5a6bf654c6 100644 --- a/modules/aggs-matrix-stats/src/test/java/org/elasticsearch/search/aggregations/matrix/stats/InternalMatrixStatsTests.java +++ b/modules/aggs-matrix-stats/src/test/java/org/elasticsearch/search/aggregations/matrix/stats/InternalMatrixStatsTests.java @@ -157,7 +157,8 @@ public void testReduceRandom() { bigArrays, mockScriptService, b -> {}, - PipelineTree.EMPTY + PipelineTree.EMPTY, + () -> false ); InternalMatrixStats reduced = (InternalMatrixStats) shardResults.get(0).reduce(shardResults, context); multiPassStats.assertNearlyEqual(reduced.getResults()); diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/SearchCancellationIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/SearchCancellationIT.java index d4b5f11dc5807..ba4f9249affd3 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/SearchCancellationIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/SearchCancellationIT.java @@ -34,6 +34,8 @@ import org.elasticsearch.script.MockScriptPlugin; import org.elasticsearch.script.Script; import org.elasticsearch.script.ScriptType; +import org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder; +import org.elasticsearch.search.aggregations.metrics.ScriptedMetricAggregationBuilder; import org.elasticsearch.search.lookup.LeafStoredFieldsLookup; import org.elasticsearch.tasks.Task; import org.elasticsearch.tasks.TaskCancelledException; @@ -53,8 +55,9 @@ import java.util.concurrent.atomic.AtomicReference; import java.util.function.Function; +import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery; import static org.elasticsearch.index.query.QueryBuilders.scriptQuery; -import static org.elasticsearch.search.SearchCancellationIT.ScriptedBlockPlugin.SCRIPT_NAME; +import static org.elasticsearch.search.SearchCancellationIT.ScriptedBlockPlugin.SEARCH_BLOCK_SCRIPT_NAME; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertFailures; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures; import static org.hamcrest.Matchers.containsString; @@ -94,7 +97,7 @@ private void indexTestData() { private List initBlockFactory() { List plugins = new ArrayList<>(); - for (PluginsService pluginsService : internalCluster().getDataNodeInstances(PluginsService.class)) { + for (PluginsService pluginsService : internalCluster().getInstances(PluginsService.class)) { plugins.addAll(pluginsService.filterPlugins(ScriptedBlockPlugin.class)); } for (ScriptedBlockPlugin plugin : plugins) { @@ -159,7 +162,7 @@ public void testCancellationDuringQueryPhase() throws Exception { logger.info("Executing search"); ActionFuture searchResponse = client().prepareSearch("test").setQuery( scriptQuery(new Script( - ScriptType.INLINE, "mockscript", SCRIPT_NAME, Collections.emptyMap()))) + ScriptType.INLINE, "mockscript", SEARCH_BLOCK_SCRIPT_NAME, Collections.emptyMap()))) .execute(); awaitForBlock(plugins); @@ -177,7 +180,7 @@ public void testCancellationDuringFetchPhase() throws Exception { logger.info("Executing search"); ActionFuture searchResponse = client().prepareSearch("test") .addScriptField("test_field", - new Script(ScriptType.INLINE, "mockscript", SCRIPT_NAME, Collections.emptyMap()) + new Script(ScriptType.INLINE, "mockscript", SEARCH_BLOCK_SCRIPT_NAME, Collections.emptyMap()) ).execute(); awaitForBlock(plugins); @@ -187,6 +190,71 @@ public void testCancellationDuringFetchPhase() throws Exception { ensureSearchWasCancelled(searchResponse); } + public void testCancellationDuringAggregation() throws Exception { + List plugins = initBlockFactory(); + indexTestData(); + + logger.info("Executing search"); + TermsAggregationBuilder termsAggregationBuilder = new TermsAggregationBuilder("test_agg"); + if (randomBoolean()) { + termsAggregationBuilder.script(new Script( + ScriptType.INLINE, + "mockscript", + ScriptedBlockPlugin.TERM_SCRIPT_NAME, + Collections.emptyMap() + )); + } else { + termsAggregationBuilder.field("field.keyword"); + } + + ActionFuture searchResponse = client() + .prepareSearch("test") + .setQuery(matchAllQuery()) + .addAggregation( + termsAggregationBuilder + .subAggregation( + new ScriptedMetricAggregationBuilder("sub_agg") + .initScript( + new Script( + ScriptType.INLINE, + "mockscript", + ScriptedBlockPlugin.INIT_SCRIPT_NAME, + Collections.emptyMap() + ) + ) + .mapScript( + new Script( + ScriptType.INLINE, + "mockscript", + ScriptedBlockPlugin.MAP_SCRIPT_NAME, + Collections.emptyMap() + ) + ) + .combineScript( + new Script( + ScriptType.INLINE, + "mockscript", + ScriptedBlockPlugin.COMBINE_SCRIPT_NAME, + Collections.emptyMap() + ) + ) + .reduceScript( + new Script( + ScriptType.INLINE, + "mockscript", + ScriptedBlockPlugin.REDUCE_SCRIPT_NAME, + Collections.emptyMap() + ) + ) + ) + ) + .execute(); + awaitForBlock(plugins); + cancelSearch(SearchAction.NAME); + disableBlocks(plugins); + ensureSearchWasCancelled(searchResponse); + } + public void testCancellationOfScrollSearches() throws Exception { List plugins = initBlockFactory(); @@ -198,7 +266,7 @@ public void testCancellationOfScrollSearches() throws Exception { .setSize(5) .setQuery( scriptQuery(new Script( - ScriptType.INLINE, "mockscript", SCRIPT_NAME, Collections.emptyMap()))) + ScriptType.INLINE, "mockscript", SEARCH_BLOCK_SCRIPT_NAME, Collections.emptyMap()))) .execute(); awaitForBlock(plugins); @@ -228,7 +296,7 @@ public void testCancellationOfScrollSearchesOnFollowupRequests() throws Exceptio .setSize(2) .setQuery( scriptQuery(new Script( - ScriptType.INLINE, "mockscript", SCRIPT_NAME, Collections.emptyMap()))) + ScriptType.INLINE, "mockscript", SEARCH_BLOCK_SCRIPT_NAME, Collections.emptyMap()))) .get(); assertNotNull(searchResponse.getScrollId()); @@ -261,7 +329,7 @@ public void testCancelMultiSearch() throws Exception { List plugins = initBlockFactory(); indexTestData(); ActionFuture msearchResponse = client().prepareMultiSearch().add(client().prepareSearch("test") - .addScriptField("test_field", new Script(ScriptType.INLINE, "mockscript", SCRIPT_NAME, Collections.emptyMap()))) + .addScriptField("test_field", new Script(ScriptType.INLINE, "mockscript", SEARCH_BLOCK_SCRIPT_NAME, Collections.emptyMap()))) .execute(); awaitForBlock(plugins); cancelSearch(MultiSearchAction.NAME); @@ -311,7 +379,7 @@ public void testCancelFailedSearchWhenPartialResultDisallowed() throws Exception SearchPhaseExecutionException e = expectThrows(SearchPhaseExecutionException.class, () -> client().prepareSearch("test") .setSearchType(SearchType.QUERY_THEN_FETCH) - .setQuery(scriptQuery(new Script(ScriptType.INLINE, "mockscript", SCRIPT_NAME, Collections.emptyMap()))) + .setQuery(scriptQuery(new Script(ScriptType.INLINE, "mockscript", SEARCH_BLOCK_SCRIPT_NAME, Collections.emptyMap()))) .setAllowPartialSearchResults(false).setSize(1000).get()); assertThat(e.getMessage(), containsString("Partial shards failure")); }); @@ -351,7 +419,12 @@ List getSearchTasks() { } public static class ScriptedBlockPlugin extends MockScriptPlugin { - static final String SCRIPT_NAME = "search_block"; + static final String SEARCH_BLOCK_SCRIPT_NAME = "search_block"; + static final String INIT_SCRIPT_NAME = "init"; + static final String MAP_SCRIPT_NAME = "map"; + static final String COMBINE_SCRIPT_NAME = "combine"; + static final String REDUCE_SCRIPT_NAME = "reduce"; + static final String TERM_SCRIPT_NAME = "term"; private final AtomicInteger hits = new AtomicInteger(); @@ -377,21 +450,52 @@ public void setBeforeExecution(Runnable runnable) { @Override public Map, Object>> pluginScripts() { - return Collections.singletonMap(SCRIPT_NAME, params -> { - final Runnable runnable = beforeExecution.get(); - if (runnable != null) { - runnable.run(); - } - LeafStoredFieldsLookup fieldsLookup = (LeafStoredFieldsLookup) params.get("_fields"); - LogManager.getLogger(SearchCancellationIT.class).info("Blocking on the document {}", fieldsLookup.get("_id")); - hits.incrementAndGet(); - try { - assertBusy(() -> assertFalse(shouldBlock.get())); - } catch (Exception e) { - throw new RuntimeException(e); - } - return true; - }); + return Map.of( + SEARCH_BLOCK_SCRIPT_NAME, this::searchBlockScript, + INIT_SCRIPT_NAME, this::nullScript, + MAP_SCRIPT_NAME, this::nullScript, + COMBINE_SCRIPT_NAME, this::nullScript, + REDUCE_SCRIPT_NAME, this::blockScript, + TERM_SCRIPT_NAME, this::termScript); + } + + private Object searchBlockScript(Map params) { + final Runnable runnable = beforeExecution.get(); + if (runnable != null) { + runnable.run(); + } + LeafStoredFieldsLookup fieldsLookup = (LeafStoredFieldsLookup) params.get("_fields"); + LogManager.getLogger(SearchCancellationIT.class).info("Blocking on the document {}", fieldsLookup.get("_id")); + hits.incrementAndGet(); + try { + assertBusy(() -> assertFalse(shouldBlock.get())); + } catch (Exception e) { + throw new RuntimeException(e); + } + return true; + } + + private Object nullScript(Map params) { + return null; + } + + private Object blockScript(Map params) { + final Runnable runnable = beforeExecution.get(); + if (runnable != null) { + runnable.run(); + } + LogManager.getLogger(SearchCancellationIT.class).info("Blocking in reduce"); + hits.incrementAndGet(); + try { + assertBusy(() -> assertFalse(shouldBlock.get())); + } catch (Exception e) { + throw new RuntimeException(e); + } + return 42; + } + + private Object termScript(Map params) { + return 1; } } } diff --git a/server/src/main/java/org/elasticsearch/action/search/QueryPhaseResultConsumer.java b/server/src/main/java/org/elasticsearch/action/search/QueryPhaseResultConsumer.java index d2d02fcab1a2f..fd04f60b335a4 100644 --- a/server/src/main/java/org/elasticsearch/action/search/QueryPhaseResultConsumer.java +++ b/server/src/main/java/org/elasticsearch/action/search/QueryPhaseResultConsumer.java @@ -35,6 +35,7 @@ import java.util.concurrent.Executor; import java.util.concurrent.atomic.AtomicReference; import java.util.function.Consumer; +import java.util.function.Supplier; import static org.elasticsearch.action.search.SearchPhaseController.getTopDocsSize; import static org.elasticsearch.action.search.SearchPhaseController.mergeTopDocs; @@ -73,6 +74,7 @@ public QueryPhaseResultConsumer(SearchRequest request, Executor executor, CircuitBreaker circuitBreaker, SearchPhaseController controller, + Supplier isCanceled, SearchProgressListener progressListener, int expectedResultSize, Consumer onPartialMergeFailure) { @@ -81,7 +83,7 @@ public QueryPhaseResultConsumer(SearchRequest request, this.circuitBreaker = circuitBreaker; this.controller = controller; this.progressListener = progressListener; - this.aggReduceContextBuilder = controller.getReduceContext(request); + this.aggReduceContextBuilder = controller.getReduceContext(isCanceled, request); this.topNSize = getTopDocsSize(request); this.performFinalReduce = request.isFinalReduce(); this.onPartialMergeFailure = onPartialMergeFailure; diff --git a/server/src/main/java/org/elasticsearch/action/search/SearchPhaseController.java b/server/src/main/java/org/elasticsearch/action/search/SearchPhaseController.java index b6ad9f2ee57b3..142593edfe384 100644 --- a/server/src/main/java/org/elasticsearch/action/search/SearchPhaseController.java +++ b/server/src/main/java/org/elasticsearch/action/search/SearchPhaseController.java @@ -10,7 +10,6 @@ import com.carrotsearch.hppc.IntArrayList; import com.carrotsearch.hppc.ObjectObjectHashMap; - import org.apache.lucene.index.Term; import org.apache.lucene.search.CollectionStatistics; import org.apache.lucene.search.FieldDoc; @@ -55,17 +54,20 @@ import java.util.List; import java.util.Map; import java.util.concurrent.Executor; +import java.util.function.BiFunction; import java.util.function.Consumer; -import java.util.function.Function; import java.util.function.IntFunction; +import java.util.function.Supplier; import java.util.stream.Collectors; public final class SearchPhaseController { private static final ScoreDoc[] EMPTY_DOCS = new ScoreDoc[0]; - private final Function requestToAggReduceContextBuilder; + private final BiFunction, SearchRequest, InternalAggregation.ReduceContextBuilder> requestToAggReduceContextBuilder; - public SearchPhaseController(Function requestToAggReduceContextBuilder) { + public SearchPhaseController( + BiFunction, SearchRequest, InternalAggregation.ReduceContextBuilder> requestToAggReduceContextBuilder + ) { this.requestToAggReduceContextBuilder = requestToAggReduceContextBuilder; } @@ -630,8 +632,8 @@ private SearchProfileResults buildSearchProfileResults(Collection isCanceled, SearchRequest request) { + return requestToAggReduceContextBuilder.apply(isCanceled, request); } /** @@ -639,11 +641,13 @@ InternalAggregation.ReduceContextBuilder getReduceContext(SearchRequest request) */ QueryPhaseResultConsumer newSearchPhaseResults(Executor executor, CircuitBreaker circuitBreaker, + Supplier isCanceled, SearchProgressListener listener, SearchRequest request, int numShards, Consumer onPartialMergeFailure) { - return new QueryPhaseResultConsumer(request, executor, circuitBreaker, this, listener, numShards, onPartialMergeFailure); + return new QueryPhaseResultConsumer(request, executor, circuitBreaker, + this, isCanceled, listener, numShards, onPartialMergeFailure); } static final class TopDocsStats { diff --git a/server/src/main/java/org/elasticsearch/action/search/TransportOpenPointInTimeAction.java b/server/src/main/java/org/elasticsearch/action/search/TransportOpenPointInTimeAction.java index c954debf85184..29b74b4096d61 100644 --- a/server/src/main/java/org/elasticsearch/action/search/TransportOpenPointInTimeAction.java +++ b/server/src/main/java/org/elasticsearch/action/search/TransportOpenPointInTimeAction.java @@ -75,7 +75,7 @@ protected void doExecute(Task task, OpenPointInTimeRequest request, ActionListen .allowPartialSearchResults(false); searchRequest.setCcsMinimizeRoundtrips(false); transportSearchAction.executeRequest( - task, + (SearchTask) task, searchRequest, "open_search_context", true, diff --git a/server/src/main/java/org/elasticsearch/action/search/TransportSearchAction.java b/server/src/main/java/org/elasticsearch/action/search/TransportSearchAction.java index e3c9608c808f9..847be29fa4ddc 100644 --- a/server/src/main/java/org/elasticsearch/action/search/TransportSearchAction.java +++ b/server/src/main/java/org/elasticsearch/action/search/TransportSearchAction.java @@ -221,7 +221,7 @@ long buildTookInMillis() { @Override protected void doExecute(Task task, SearchRequest searchRequest, ActionListener listener) { - executeRequest(task, searchRequest, this::searchAsyncAction, listener); + executeRequest((SearchTask) task, searchRequest, this::searchAsyncAction, listener); } public interface SinglePhaseSearchAction { @@ -229,7 +229,7 @@ void executeOnShardTarget(SearchTask searchTask, SearchShardTarget target, Trans ActionListener listener); } - public void executeRequest(Task task, SearchRequest searchRequest, String actionName, + public void executeRequest(SearchTask task, SearchRequest searchRequest, String actionName, boolean includeSearchContext, SinglePhaseSearchAction phaseSearchAction, ActionListener listener) { executeRequest(task, searchRequest, new SearchAsyncActionProvider() { @@ -271,7 +271,7 @@ boolean buildPointInTimeFromSearchResults() { }, listener); } - private void executeRequest(Task task, + private void executeRequest(SearchTask task, SearchRequest original, SearchAsyncActionProvider searchAsyncActionProvider, ActionListener listener) { @@ -297,7 +297,7 @@ private void executeRequest(Task task, if (shouldMinimizeRoundtrips(rewritten)) { final TaskId parentTaskId = task.taskInfo(clusterService.localNode().getId(), false).getTaskId(); ccsRemoteReduce(parentTaskId, rewritten, localIndices, remoteClusterIndices, timeProvider, - searchService.aggReduceContextBuilder(rewritten), + searchService.aggReduceContextBuilder(task::isCancelled, rewritten), remoteClusterService, threadPool, listener, (r, l) -> executeLocalSearch( task, timeProvider, r, localIndices, clusterState, l, searchContext, searchAsyncActionProvider)); @@ -323,7 +323,7 @@ private void executeRequest(Task task, int localClusters = localIndices == null ? 0 : 1; int totalClusters = remoteClusterIndices.size() + localClusters; int successfulClusters = searchShardsResponses.size() + localClusters; - executeSearch((SearchTask) task, timeProvider, rewritten, localIndices, remoteShardIterators, + executeSearch(task, timeProvider, rewritten, localIndices, remoteShardIterators, clusterNodeLookup, clusterState, remoteAliasFilters, listener, new SearchResponse.Clusters(totalClusters, successfulClusters, skippedClusters.get()), searchContext, searchAsyncActionProvider); @@ -816,7 +816,7 @@ public void run() { }, clusters, searchService.getCoordinatorRewriteContextProvider(timeProvider::getAbsoluteStartMillis)); } else { final QueryPhaseResultConsumer queryResultConsumer = searchPhaseController.newSearchPhaseResults(executor, - circuitBreaker, task.getProgressListener(), searchRequest, shardIterators.size(), + circuitBreaker, task::isCancelled, task.getProgressListener(), searchRequest, shardIterators.size(), exc -> searchTransportService.cancelSearchTask(task, "failed to merge result [" + exc.getMessage() + "]")); AbstractSearchAsyncAction searchAsyncAction; switch (searchRequest.searchType()) { diff --git a/server/src/main/java/org/elasticsearch/search/SearchService.java b/server/src/main/java/org/elasticsearch/search/SearchService.java index 6b3c456ef18bc..01f00e1a00721 100644 --- a/server/src/main/java/org/elasticsearch/search/SearchService.java +++ b/server/src/main/java/org/elasticsearch/search/SearchService.java @@ -131,6 +131,7 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; import java.util.function.LongSupplier; +import java.util.function.Supplier; import static org.elasticsearch.core.TimeValue.timeValueHours; import static org.elasticsearch.core.TimeValue.timeValueMillis; @@ -1350,19 +1351,19 @@ public IndicesService getIndicesService() { * Returns a builder for {@link InternalAggregation.ReduceContext}. This * builder retains a reference to the provided {@link SearchRequest}. */ - public InternalAggregation.ReduceContextBuilder aggReduceContextBuilder(SearchRequest request) { + public InternalAggregation.ReduceContextBuilder aggReduceContextBuilder(Supplier isCanceled, SearchRequest request) { return new InternalAggregation.ReduceContextBuilder() { @Override public InternalAggregation.ReduceContext forPartialReduction() { - return InternalAggregation.ReduceContext.forPartialReduction(bigArrays, scriptService, - () -> requestToPipelineTree(request)); + return InternalAggregation.ReduceContext.forPartialReduction(bigArrays, scriptService, + () -> requestToPipelineTree(request), isCanceled); } @Override public ReduceContext forFinalReduction() { PipelineTree pipelineTree = requestToPipelineTree(request); return InternalAggregation.ReduceContext.forFinalReduction( - bigArrays, scriptService, multiBucketConsumerService.create(), pipelineTree); + bigArrays, scriptService, multiBucketConsumerService.create(), pipelineTree, isCanceled); } }; } diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/InternalAggregation.java b/server/src/main/java/org/elasticsearch/search/aggregations/InternalAggregation.java index 5724fae9dbf70..36c6128803f8d 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/InternalAggregation.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/InternalAggregation.java @@ -18,6 +18,7 @@ import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator; import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator.PipelineTree; import org.elasticsearch.search.aggregations.support.AggregationPath; +import org.elasticsearch.tasks.TaskCancelledException; import java.io.IOException; import java.util.Iterator; @@ -55,6 +56,7 @@ public static class ReduceContext { private final ScriptService scriptService; private final IntConsumer multiBucketConsumer; private final PipelineTree pipelineTreeRoot; + private final Supplier isCanceled; /** * Supplies the pipelines when the result of the reduce is serialized * to node versions that need pipeline aggregators to be serialized @@ -68,9 +70,10 @@ public static class ReduceContext { public static ReduceContext forPartialReduction( BigArrays bigArrays, ScriptService scriptService, - Supplier pipelineTreeForBwcSerialization + Supplier pipelineTreeForBwcSerialization, + Supplier isCanceled ) { - return new ReduceContext(bigArrays, scriptService, (s) -> {}, null, pipelineTreeForBwcSerialization); + return new ReduceContext(bigArrays, scriptService, (s) -> {}, null, pipelineTreeForBwcSerialization, isCanceled); } /** @@ -81,14 +84,16 @@ public static ReduceContext forFinalReduction( BigArrays bigArrays, ScriptService scriptService, IntConsumer multiBucketConsumer, - PipelineTree pipelineTreeRoot + PipelineTree pipelineTreeRoot, + Supplier isCanceled ) { return new ReduceContext( bigArrays, scriptService, multiBucketConsumer, requireNonNull(pipelineTreeRoot, "prefer EMPTY to null"), - () -> pipelineTreeRoot + () -> pipelineTreeRoot, + isCanceled ); } @@ -97,13 +102,15 @@ private ReduceContext( ScriptService scriptService, IntConsumer multiBucketConsumer, PipelineTree pipelineTreeRoot, - Supplier pipelineTreeForBwcSerialization + Supplier pipelineTreeForBwcSerialization, + Supplier isCanceled ) { this.bigArrays = bigArrays; this.scriptService = scriptService; this.multiBucketConsumer = multiBucketConsumer; this.pipelineTreeRoot = pipelineTreeRoot; this.pipelineTreeForBwcSerialization = pipelineTreeForBwcSerialization; + this.isCanceled = isCanceled; } /** @@ -144,9 +151,16 @@ public Supplier pipelineTreeForBwcSerialization() { * the maximum number of buckets allowed in a response */ public void consumeBucketsAndMaybeBreak(int size) { + // This is a volatile read. + if (isCanceled.get()) { + throw new TaskCancelledException("Cancelled"); + } multiBucketConsumer.accept(size); } + public Supplier isCanceled() { + return isCanceled; + } } protected final String name; diff --git a/server/src/test/java/org/elasticsearch/action/search/DfsQueryPhaseTests.java b/server/src/test/java/org/elasticsearch/action/search/DfsQueryPhaseTests.java index a1eac48701d2a..fd5e8a424b273 100644 --- a/server/src/test/java/org/elasticsearch/action/search/DfsQueryPhaseTests.java +++ b/server/src/test/java/org/elasticsearch/action/search/DfsQueryPhaseTests.java @@ -82,7 +82,7 @@ public void sendExecuteQuery(Transport.Connection connection, QuerySearchRequest MockSearchPhaseContext mockSearchPhaseContext = new MockSearchPhaseContext(2); mockSearchPhaseContext.searchTransport = searchTransportService; QueryPhaseResultConsumer consumer = searchPhaseController.newSearchPhaseResults(EsExecutors.DIRECT_EXECUTOR_SERVICE, - new NoopCircuitBreaker(CircuitBreaker.REQUEST), SearchProgressListener.NOOP, mockSearchPhaseContext.searchRequest, + new NoopCircuitBreaker(CircuitBreaker.REQUEST), () -> false, SearchProgressListener.NOOP, mockSearchPhaseContext.searchRequest, results.length(), exc -> {}); DfsQueryPhase phase = new DfsQueryPhase(results.asList(), null, consumer, (response) -> new SearchPhase("test") { @@ -141,7 +141,7 @@ public void sendExecuteQuery(Transport.Connection connection, QuerySearchRequest MockSearchPhaseContext mockSearchPhaseContext = new MockSearchPhaseContext(2); mockSearchPhaseContext.searchTransport = searchTransportService; QueryPhaseResultConsumer consumer = searchPhaseController.newSearchPhaseResults(EsExecutors.DIRECT_EXECUTOR_SERVICE, - new NoopCircuitBreaker(CircuitBreaker.REQUEST), SearchProgressListener.NOOP, mockSearchPhaseContext.searchRequest, + new NoopCircuitBreaker(CircuitBreaker.REQUEST), () -> false, SearchProgressListener.NOOP, mockSearchPhaseContext.searchRequest, results.length(), exc -> {}); DfsQueryPhase phase = new DfsQueryPhase(results.asList(), null, consumer, (response) -> new SearchPhase("test") { @@ -202,7 +202,7 @@ public void sendExecuteQuery(Transport.Connection connection, QuerySearchRequest MockSearchPhaseContext mockSearchPhaseContext = new MockSearchPhaseContext(2); mockSearchPhaseContext.searchTransport = searchTransportService; QueryPhaseResultConsumer consumer = searchPhaseController.newSearchPhaseResults(EsExecutors.DIRECT_EXECUTOR_SERVICE, - new NoopCircuitBreaker(CircuitBreaker.REQUEST), SearchProgressListener.NOOP, mockSearchPhaseContext.searchRequest, + new NoopCircuitBreaker(CircuitBreaker.REQUEST), () -> false, SearchProgressListener.NOOP, mockSearchPhaseContext.searchRequest, results.length(), exc -> {}); DfsQueryPhase phase = new DfsQueryPhase(results.asList(), null, consumer, (response) -> new SearchPhase("test") { @@ -217,6 +217,6 @@ public void run() throws IOException { } private SearchPhaseController searchPhaseController() { - return new SearchPhaseController(request -> InternalAggregationTestCase.emptyReduceContextBuilder()); + return new SearchPhaseController((task, request) -> InternalAggregationTestCase.emptyReduceContextBuilder()); } } diff --git a/server/src/test/java/org/elasticsearch/action/search/FetchSearchPhaseTests.java b/server/src/test/java/org/elasticsearch/action/search/FetchSearchPhaseTests.java index 6a7326bc071db..4b215fc2a1183 100644 --- a/server/src/test/java/org/elasticsearch/action/search/FetchSearchPhaseTests.java +++ b/server/src/test/java/org/elasticsearch/action/search/FetchSearchPhaseTests.java @@ -46,10 +46,10 @@ public class FetchSearchPhaseTests extends ESTestCase { private static final long FETCH_PROFILE_TIME = 555; public void testShortcutQueryAndFetchOptimization() { - SearchPhaseController controller = new SearchPhaseController(s -> InternalAggregationTestCase.emptyReduceContextBuilder()); + SearchPhaseController controller = new SearchPhaseController((t, s) -> InternalAggregationTestCase.emptyReduceContextBuilder()); MockSearchPhaseContext mockSearchPhaseContext = new MockSearchPhaseContext(1); QueryPhaseResultConsumer results = controller.newSearchPhaseResults(EsExecutors.DIRECT_EXECUTOR_SERVICE, - new NoopCircuitBreaker(CircuitBreaker.REQUEST), SearchProgressListener.NOOP, + new NoopCircuitBreaker(CircuitBreaker.REQUEST), () -> false, SearchProgressListener.NOOP, mockSearchPhaseContext.getRequest(), 1, exc -> {}); boolean hasHits = randomBoolean(); boolean profiled = hasHits && randomBoolean(); @@ -107,9 +107,9 @@ private void assertProfiles(boolean profiled, int totalShards, SearchResponse se public void testFetchTwoDocument() { MockSearchPhaseContext mockSearchPhaseContext = new MockSearchPhaseContext(2); - SearchPhaseController controller = new SearchPhaseController(s -> InternalAggregationTestCase.emptyReduceContextBuilder()); + SearchPhaseController controller = new SearchPhaseController((t, s) -> InternalAggregationTestCase.emptyReduceContextBuilder()); QueryPhaseResultConsumer results = controller.newSearchPhaseResults(EsExecutors.DIRECT_EXECUTOR_SERVICE, - new NoopCircuitBreaker(CircuitBreaker.REQUEST), SearchProgressListener.NOOP, + new NoopCircuitBreaker(CircuitBreaker.REQUEST), () -> false, SearchProgressListener.NOOP, mockSearchPhaseContext.getRequest(), 2, exc -> {}); int resultSetSize = randomIntBetween(2, 10); boolean profiled = randomBoolean(); @@ -175,9 +175,9 @@ public void run() { public void testFailFetchOneDoc() { MockSearchPhaseContext mockSearchPhaseContext = new MockSearchPhaseContext(2); - SearchPhaseController controller = new SearchPhaseController(s -> InternalAggregationTestCase.emptyReduceContextBuilder()); + SearchPhaseController controller = new SearchPhaseController((t, s) -> InternalAggregationTestCase.emptyReduceContextBuilder()); QueryPhaseResultConsumer results = controller.newSearchPhaseResults(EsExecutors.DIRECT_EXECUTOR_SERVICE, - new NoopCircuitBreaker(CircuitBreaker.REQUEST), SearchProgressListener.NOOP, + new NoopCircuitBreaker(CircuitBreaker.REQUEST), () -> false, SearchProgressListener.NOOP, mockSearchPhaseContext.getRequest(), 2, exc -> {}); int resultSetSize = randomIntBetween(2, 10); boolean profiled = randomBoolean(); @@ -262,11 +262,10 @@ public void testFetchDocsConcurrently() throws InterruptedException { // we use at least 2 hits otherwise this is subject to single shard optimization and we trip an assert... int numHits = randomIntBetween(2, 100); // also numshards --> 1 hit per shard boolean profiled = randomBoolean(); - - SearchPhaseController controller = new SearchPhaseController(s -> InternalAggregationTestCase.emptyReduceContextBuilder()); + SearchPhaseController controller = new SearchPhaseController((t, s) -> InternalAggregationTestCase.emptyReduceContextBuilder()); MockSearchPhaseContext mockSearchPhaseContext = new MockSearchPhaseContext(numHits); QueryPhaseResultConsumer results = controller.newSearchPhaseResults(EsExecutors.DIRECT_EXECUTOR_SERVICE, - new NoopCircuitBreaker(CircuitBreaker.REQUEST), SearchProgressListener.NOOP, + new NoopCircuitBreaker(CircuitBreaker.REQUEST), () -> false, SearchProgressListener.NOOP, mockSearchPhaseContext.getRequest(), numHits, exc -> {}); SearchShardTarget[] shardTargets = new SearchShardTarget[numHits]; for (int i = 0; i < numHits; i++) { @@ -341,10 +340,10 @@ public void run() { public void testExceptionFailsPhase() { MockSearchPhaseContext mockSearchPhaseContext = new MockSearchPhaseContext(2); - SearchPhaseController controller = new SearchPhaseController(s -> InternalAggregationTestCase.emptyReduceContextBuilder()); + SearchPhaseController controller = new SearchPhaseController((t, s) -> InternalAggregationTestCase.emptyReduceContextBuilder()); QueryPhaseResultConsumer results = controller.newSearchPhaseResults(EsExecutors.DIRECT_EXECUTOR_SERVICE, - new NoopCircuitBreaker(CircuitBreaker.REQUEST), SearchProgressListener.NOOP, + new NoopCircuitBreaker(CircuitBreaker.REQUEST), () -> false, SearchProgressListener.NOOP, mockSearchPhaseContext.getRequest(), 2, exc -> {}); int resultSetSize = randomIntBetween(2, 10); boolean profiled = randomBoolean(); @@ -406,9 +405,9 @@ public void run() { public void testCleanupIrrelevantContexts() { // contexts that are not fetched should be cleaned up MockSearchPhaseContext mockSearchPhaseContext = new MockSearchPhaseContext(2); - SearchPhaseController controller = new SearchPhaseController(s -> InternalAggregationTestCase.emptyReduceContextBuilder()); + SearchPhaseController controller = new SearchPhaseController((t, s) -> InternalAggregationTestCase.emptyReduceContextBuilder()); QueryPhaseResultConsumer results = controller.newSearchPhaseResults(EsExecutors.DIRECT_EXECUTOR_SERVICE, - new NoopCircuitBreaker(CircuitBreaker.REQUEST), SearchProgressListener.NOOP, + new NoopCircuitBreaker(CircuitBreaker.REQUEST), () -> false, SearchProgressListener.NOOP, mockSearchPhaseContext.getRequest(), 2, exc -> {}); int resultSetSize = 1; boolean profiled = randomBoolean(); diff --git a/server/src/test/java/org/elasticsearch/action/search/QueryPhaseResultConsumerTests.java b/server/src/test/java/org/elasticsearch/action/search/QueryPhaseResultConsumerTests.java index 2e67b17e0c835..2440a3cb437c1 100644 --- a/server/src/test/java/org/elasticsearch/action/search/QueryPhaseResultConsumerTests.java +++ b/server/src/test/java/org/elasticsearch/action/search/QueryPhaseResultConsumerTests.java @@ -48,16 +48,16 @@ public class QueryPhaseResultConsumerTests extends ESTestCase { @Before public void setup() { searchPhaseController = new SearchPhaseController( - s -> new InternalAggregation.ReduceContextBuilder() { + (t, s) -> new InternalAggregation.ReduceContextBuilder() { @Override public InternalAggregation.ReduceContext forPartialReduction() { return InternalAggregation.ReduceContext.forPartialReduction( - BigArrays.NON_RECYCLING_INSTANCE, null, () -> PipelineAggregator.PipelineTree.EMPTY); + BigArrays.NON_RECYCLING_INSTANCE, null, () -> PipelineAggregator.PipelineTree.EMPTY, t); } public InternalAggregation.ReduceContext forFinalReduction() { return InternalAggregation.ReduceContext.forFinalReduction( - BigArrays.NON_RECYCLING_INSTANCE, null, b -> {}, PipelineAggregator.PipelineTree.EMPTY); + BigArrays.NON_RECYCLING_INSTANCE, null, b -> {}, PipelineAggregator.PipelineTree.EMPTY, t); }; }); threadPool = new TestThreadPool(SearchPhaseControllerTests.class.getName()); @@ -85,7 +85,7 @@ public void testProgressListenerExceptionsAreCaught() throws Exception { searchRequest.setBatchedReduceSize(2); AtomicReference onPartialMergeFailure = new AtomicReference<>(); QueryPhaseResultConsumer queryPhaseResultConsumer = new QueryPhaseResultConsumer(searchRequest, executor, - new NoopCircuitBreaker(CircuitBreaker.REQUEST), searchPhaseController, searchProgressListener, + new NoopCircuitBreaker(CircuitBreaker.REQUEST), searchPhaseController, () -> false, searchProgressListener, 10, e -> onPartialMergeFailure.accumulateAndGet(e, (prev, curr) -> { curr.addSuppressed(prev); return curr; diff --git a/server/src/test/java/org/elasticsearch/action/search/SearchPhaseControllerTests.java b/server/src/test/java/org/elasticsearch/action/search/SearchPhaseControllerTests.java index 1c9d40ea7a4d3..f140ee1d29b6d 100644 --- a/server/src/test/java/org/elasticsearch/action/search/SearchPhaseControllerTests.java +++ b/server/src/test/java/org/elasticsearch/action/search/SearchPhaseControllerTests.java @@ -113,18 +113,18 @@ protected NamedWriteableRegistry writableRegistry() { @Before public void setup() { reductions = new CopyOnWriteArrayList<>(); - searchPhaseController = new SearchPhaseController(s -> new InternalAggregation.ReduceContextBuilder() { + searchPhaseController = new SearchPhaseController((t, s) -> new InternalAggregation.ReduceContextBuilder() { @Override public ReduceContext forPartialReduction() { reductions.add(false); return InternalAggregation.ReduceContext.forPartialReduction( - BigArrays.NON_RECYCLING_INSTANCE, null, () -> PipelineTree.EMPTY); + BigArrays.NON_RECYCLING_INSTANCE, null, () -> PipelineTree.EMPTY, t); } public ReduceContext forFinalReduction() { reductions.add(true); return InternalAggregation.ReduceContext.forFinalReduction( - BigArrays.NON_RECYCLING_INSTANCE, null, b -> {}, PipelineTree.EMPTY); + BigArrays.NON_RECYCLING_INSTANCE, null, b -> {}, PipelineTree.EMPTY, t); }; }); threadPool = new TestThreadPool(SearchPhaseControllerTests.class.getName()); @@ -456,7 +456,7 @@ private void consumerTestCase(int numEmptyResponses) throws Exception { request.source(new SearchSourceBuilder().aggregation(AggregationBuilders.avg("foo"))); request.setBatchedReduceSize(bufferSize); ArraySearchPhaseResults consumer = searchPhaseController.newSearchPhaseResults(fixedExecutor, - new NoopCircuitBreaker(CircuitBreaker.REQUEST), SearchProgressListener.NOOP, + new NoopCircuitBreaker(CircuitBreaker.REQUEST), () -> false, SearchProgressListener.NOOP, request, 3+numEmptyResponses, exc -> {}); if (numEmptyResponses == 0) { assertEquals(0, reductions.size()); @@ -544,7 +544,7 @@ public void testConsumerConcurrently() throws Exception { request.source(new SearchSourceBuilder().aggregation(AggregationBuilders.avg("foo"))); request.setBatchedReduceSize(bufferSize); ArraySearchPhaseResults consumer = searchPhaseController.newSearchPhaseResults(fixedExecutor, - new NoopCircuitBreaker(CircuitBreaker.REQUEST), SearchProgressListener.NOOP, + new NoopCircuitBreaker(CircuitBreaker.REQUEST), () -> false, SearchProgressListener.NOOP, request, expectedNumResults, exc -> {}); AtomicInteger max = new AtomicInteger(); Thread[] threads = new Thread[expectedNumResults]; @@ -595,7 +595,7 @@ public void testConsumerOnlyAggs() throws Exception { request.source(new SearchSourceBuilder().aggregation(AggregationBuilders.avg("foo")).size(0)); request.setBatchedReduceSize(bufferSize); QueryPhaseResultConsumer consumer = searchPhaseController.newSearchPhaseResults(fixedExecutor, - new NoopCircuitBreaker(CircuitBreaker.REQUEST), SearchProgressListener.NOOP, + new NoopCircuitBreaker(CircuitBreaker.REQUEST), () -> false, SearchProgressListener.NOOP, request, expectedNumResults, exc -> {}); AtomicInteger max = new AtomicInteger(); CountDownLatch latch = new CountDownLatch(expectedNumResults); @@ -637,7 +637,7 @@ public void testConsumerOnlyHits() throws Exception { } request.setBatchedReduceSize(bufferSize); QueryPhaseResultConsumer consumer = searchPhaseController.newSearchPhaseResults(fixedExecutor, - new NoopCircuitBreaker(CircuitBreaker.REQUEST), SearchProgressListener.NOOP, + new NoopCircuitBreaker(CircuitBreaker.REQUEST), () -> false, SearchProgressListener.NOOP, request, expectedNumResults, exc -> {}); AtomicInteger max = new AtomicInteger(); CountDownLatch latch = new CountDownLatch(expectedNumResults); @@ -681,7 +681,7 @@ public void testReduceTopNWithFromOffset() throws Exception { request.source(new SearchSourceBuilder().size(5).from(5)); request.setBatchedReduceSize(randomIntBetween(2, 4)); QueryPhaseResultConsumer consumer = searchPhaseController.newSearchPhaseResults(fixedExecutor, - new NoopCircuitBreaker(CircuitBreaker.REQUEST), SearchProgressListener.NOOP + new NoopCircuitBreaker(CircuitBreaker.REQUEST), () -> false, SearchProgressListener.NOOP , request, 4, exc -> {}); int score = 100; CountDownLatch latch = new CountDownLatch(4); @@ -720,7 +720,7 @@ public void testConsumerSortByField() throws Exception { int size = randomIntBetween(1, 10); request.setBatchedReduceSize(bufferSize); QueryPhaseResultConsumer consumer = searchPhaseController.newSearchPhaseResults(fixedExecutor, - new NoopCircuitBreaker(CircuitBreaker.REQUEST), SearchProgressListener.NOOP, + new NoopCircuitBreaker(CircuitBreaker.REQUEST), () -> false, SearchProgressListener.NOOP, request, expectedNumResults, exc -> {}); AtomicInteger max = new AtomicInteger(); SortField[] sortFields = {new SortField("field", SortField.Type.INT, true)}; @@ -759,7 +759,7 @@ public void testConsumerFieldCollapsing() throws Exception { int size = randomIntBetween(5, 10); request.setBatchedReduceSize(bufferSize); QueryPhaseResultConsumer consumer = searchPhaseController.newSearchPhaseResults(fixedExecutor, - new NoopCircuitBreaker(CircuitBreaker.REQUEST), SearchProgressListener.NOOP, + new NoopCircuitBreaker(CircuitBreaker.REQUEST), () -> false, SearchProgressListener.NOOP, request, expectedNumResults, exc -> {}); SortField[] sortFields = {new SortField("field", SortField.Type.STRING)}; BytesRef a = new BytesRef("a"); @@ -801,7 +801,7 @@ public void testConsumerSuggestions() throws Exception { SearchRequest request = randomSearchRequest(); request.setBatchedReduceSize(bufferSize); QueryPhaseResultConsumer consumer = searchPhaseController.newSearchPhaseResults(fixedExecutor, - new NoopCircuitBreaker(CircuitBreaker.REQUEST), SearchProgressListener.NOOP, + new NoopCircuitBreaker(CircuitBreaker.REQUEST), () -> false, SearchProgressListener.NOOP, request, expectedNumResults, exc -> {}); int maxScoreTerm = -1; int maxScorePhrase = -1; @@ -928,7 +928,7 @@ public void onFinalReduce(List shards, TotalHits totalHits, Interna } }; QueryPhaseResultConsumer consumer = searchPhaseController.newSearchPhaseResults(fixedExecutor, - new NoopCircuitBreaker(CircuitBreaker.REQUEST), progressListener, request, expectedNumResults, exc -> {}); + new NoopCircuitBreaker(CircuitBreaker.REQUEST), () -> false, progressListener, request, expectedNumResults, exc -> {}); AtomicInteger max = new AtomicInteger(); Thread[] threads = new Thread[expectedNumResults]; CountDownLatch latch = new CountDownLatch(expectedNumResults); @@ -996,7 +996,7 @@ private void testReduceCase(int numShards, int bufferSize, boolean shouldFail) t circuitBreaker.shouldBreak.set(true); } QueryPhaseResultConsumer consumer = searchPhaseController.newSearchPhaseResults(fixedExecutor, - circuitBreaker, SearchProgressListener.NOOP, + circuitBreaker, () -> false, SearchProgressListener.NOOP, request, numShards, exc -> hasConsumedFailure.set(true)); CountDownLatch latch = new CountDownLatch(numShards); Thread[] threads = new Thread[numShards]; @@ -1049,7 +1049,7 @@ public void testFailConsumeAggs() throws Exception { request.setBatchedReduceSize(bufferSize); AtomicBoolean hasConsumedFailure = new AtomicBoolean(); try (QueryPhaseResultConsumer consumer = searchPhaseController.newSearchPhaseResults(fixedExecutor, - new NoopCircuitBreaker(CircuitBreaker.REQUEST), SearchProgressListener.NOOP, + new NoopCircuitBreaker(CircuitBreaker.REQUEST), () -> false, SearchProgressListener.NOOP, request, expectedNumResults, exc -> hasConsumedFailure.set(true))) { for (int i = 0; i < expectedNumResults; i++) { final int index = i; diff --git a/server/src/test/java/org/elasticsearch/action/search/SearchQueryThenFetchAsyncActionTests.java b/server/src/test/java/org/elasticsearch/action/search/SearchQueryThenFetchAsyncActionTests.java index 870a60150db7d..d449fbb977d56 100644 --- a/server/src/test/java/org/elasticsearch/action/search/SearchQueryThenFetchAsyncActionTests.java +++ b/server/src/test/java/org/elasticsearch/action/search/SearchQueryThenFetchAsyncActionTests.java @@ -145,10 +145,11 @@ public void sendExecuteQuery(Transport.Connection connection, ShardSearchRequest searchRequest.source().collapse(new CollapseBuilder("collapse_field")); } searchRequest.allowPartialSearchResults(false); - SearchPhaseController controller = new SearchPhaseController(r -> InternalAggregationTestCase.emptyReduceContextBuilder()); + SearchPhaseController controller = new SearchPhaseController((t, r) -> InternalAggregationTestCase.emptyReduceContextBuilder()); SearchTask task = new SearchTask(0, "n/a", "n/a", () -> "test", null, Collections.emptyMap()); QueryPhaseResultConsumer resultConsumer = new QueryPhaseResultConsumer(searchRequest, EsExecutors.DIRECT_EXECUTOR_SERVICE, - new NoopCircuitBreaker(CircuitBreaker.REQUEST), controller, task.getProgressListener(), shardsIter.size(), exc -> {}); + new NoopCircuitBreaker(CircuitBreaker.REQUEST), controller, task::isCancelled, task.getProgressListener(), shardsIter.size(), + exc -> {}); SearchQueryThenFetchAsyncAction action = new SearchQueryThenFetchAsyncAction(logger, searchTransportService, (clusterAlias, node) -> lookup.get(node), Collections.singletonMap("_na_", new AliasFilter(null, Strings.EMPTY_ARRAY)), @@ -241,10 +242,11 @@ private void testMixedVersionsShardsSearch(Version oldVersion, Version newVersio searchRequest.allowPartialSearchResults(false); SearchTransportService searchTransportService = new SearchTransportService(null, null, null); - SearchPhaseController controller = new SearchPhaseController(r -> InternalAggregationTestCase.emptyReduceContextBuilder()); + SearchPhaseController controller = new SearchPhaseController((t, r) -> InternalAggregationTestCase.emptyReduceContextBuilder()); SearchTask task = new SearchTask(0, "n/a", "n/a", () -> "test", null, Collections.emptyMap()); QueryPhaseResultConsumer resultConsumer = new QueryPhaseResultConsumer(searchRequest, EsExecutors.DIRECT_EXECUTOR_SERVICE, - new NoopCircuitBreaker(CircuitBreaker.REQUEST), controller, task.getProgressListener(), shardsIter.size(), exc -> {}); + new NoopCircuitBreaker(CircuitBreaker.REQUEST), controller, task::isCancelled, task.getProgressListener(), shardsIter.size(), + exc -> {}); final List responses = new ArrayList<>(); SearchQueryThenFetchAsyncAction newSearchAsyncAction = new SearchQueryThenFetchAsyncAction(logger, searchTransportService, (clusterAlias, node) -> lookup.get(node), @@ -334,10 +336,11 @@ public void sendExecuteQuery(Transport.Connection connection, ShardSearchRequest new Thread(() -> listener.onResponse(queryResult)).start(); } }; - SearchPhaseController controller = new SearchPhaseController(r -> InternalAggregationTestCase.emptyReduceContextBuilder()); + SearchPhaseController controller = new SearchPhaseController((t, r) -> InternalAggregationTestCase.emptyReduceContextBuilder()); SearchTask task = new SearchTask(0, "n/a", "n/a", () -> "test", null, Collections.emptyMap()); QueryPhaseResultConsumer resultConsumer = new QueryPhaseResultConsumer(searchRequest, EsExecutors.DIRECT_EXECUTOR_SERVICE, - new NoopCircuitBreaker(CircuitBreaker.REQUEST), controller, task.getProgressListener(), shardsIter.size(), exc -> {}); + new NoopCircuitBreaker(CircuitBreaker.REQUEST), controller, task::isCancelled, task.getProgressListener(), shardsIter.size(), + exc -> {}); CountDownLatch latch = new CountDownLatch(1); SearchQueryThenFetchAsyncAction action = new SearchQueryThenFetchAsyncAction(logger, searchTransportService, (clusterAlias, node) -> lookup.get(node), @@ -432,10 +435,11 @@ public void sendExecuteQuery(Transport.Connection connection, ShardSearchRequest new Thread(() -> listener.onResponse(queryResult)).start(); } }; - SearchPhaseController controller = new SearchPhaseController(r -> InternalAggregationTestCase.emptyReduceContextBuilder()); + SearchPhaseController controller = new SearchPhaseController((t, r) -> InternalAggregationTestCase.emptyReduceContextBuilder()); SearchTask task = new SearchTask(0, "n/a", "n/a", () -> "test", null, Collections.emptyMap()); QueryPhaseResultConsumer resultConsumer = new QueryPhaseResultConsumer(searchRequest, EsExecutors.DIRECT_EXECUTOR_SERVICE, - new NoopCircuitBreaker(CircuitBreaker.REQUEST), controller, task.getProgressListener(), shardsIter.size(), exc -> {}); + new NoopCircuitBreaker(CircuitBreaker.REQUEST), controller, task::isCancelled, task.getProgressListener(), shardsIter.size(), + exc -> {}); CountDownLatch latch = new CountDownLatch(1); SearchQueryThenFetchAsyncAction action = new SearchQueryThenFetchAsyncAction(logger, searchTransportService, (clusterAlias, node) -> lookup.get(node), diff --git a/server/src/test/java/org/elasticsearch/search/SearchServiceTests.java b/server/src/test/java/org/elasticsearch/search/SearchServiceTests.java index ca403ddfd1829..1ecdcc956669b 100644 --- a/server/src/test/java/org/elasticsearch/search/SearchServiceTests.java +++ b/server/src/test/java/org/elasticsearch/search/SearchServiceTests.java @@ -934,7 +934,7 @@ public void testExpandSearchFrozen() { public void testCreateReduceContext() { SearchService service = getInstanceFromNode(SearchService.class); - InternalAggregation.ReduceContextBuilder reduceContextBuilder = service.aggReduceContextBuilder(new SearchRequest()); + InternalAggregation.ReduceContextBuilder reduceContextBuilder = service.aggReduceContextBuilder(() -> false, new SearchRequest()); { InternalAggregation.ReduceContext reduceContext = reduceContextBuilder.forFinalReduction(); expectThrows(MultiBucketConsumerService.TooManyBucketsException.class, diff --git a/server/src/test/java/org/elasticsearch/search/aggregations/bucket/filter/FiltersAggregatorTests.java b/server/src/test/java/org/elasticsearch/search/aggregations/bucket/filter/FiltersAggregatorTests.java index 6a810e3dae2cb..e07362123dca2 100644 --- a/server/src/test/java/org/elasticsearch/search/aggregations/bucket/filter/FiltersAggregatorTests.java +++ b/server/src/test/java/org/elasticsearch/search/aggregations/bucket/filter/FiltersAggregatorTests.java @@ -544,7 +544,8 @@ public void onCache(ShardId shardId, Accountable accountable) {} context.bigArrays(), getMockScriptService(), b -> {}, - PipelineTree.EMPTY + PipelineTree.EMPTY, + () -> false ) ); InternalFilters filters = (InternalFilters) result; diff --git a/server/src/test/java/org/elasticsearch/search/aggregations/bucket/histogram/DateHistogramAggregatorTests.java b/server/src/test/java/org/elasticsearch/search/aggregations/bucket/histogram/DateHistogramAggregatorTests.java index f1e96913618e6..e065dbdd1a125 100644 --- a/server/src/test/java/org/elasticsearch/search/aggregations/bucket/histogram/DateHistogramAggregatorTests.java +++ b/server/src/test/java/org/elasticsearch/search/aggregations/bucket/histogram/DateHistogramAggregatorTests.java @@ -925,7 +925,13 @@ private void aggregationImplementationChoiceTestCase( InternalDateHistogram result = (InternalDateHistogram) agg.buildTopLevel(); result = (InternalDateHistogram) result.reduce( List.of(result), - ReduceContext.forFinalReduction(context.bigArrays(), null, context.multiBucketConsumer(), PipelineTree.EMPTY) + ReduceContext.forFinalReduction( + context.bigArrays(), + null, + context.multiBucketConsumer(), + PipelineTree.EMPTY, + () -> false + ) ); assertThat( result.getBuckets().stream().map(InternalDateHistogram.Bucket::getKeyAsString).collect(toList()), diff --git a/server/src/test/java/org/elasticsearch/search/aggregations/bucket/histogram/InternalVariableWidthHistogramTests.java b/server/src/test/java/org/elasticsearch/search/aggregations/bucket/histogram/InternalVariableWidthHistogramTests.java index 35eb7eead10a0..c8418b06c930b 100644 --- a/server/src/test/java/org/elasticsearch/search/aggregations/bucket/histogram/InternalVariableWidthHistogramTests.java +++ b/server/src/test/java/org/elasticsearch/search/aggregations/bucket/histogram/InternalVariableWidthHistogramTests.java @@ -157,7 +157,8 @@ public void testSingleShardReduceLong() { bigArrays, mockScriptService, bucketConsumer, - PipelineAggregator.PipelineTree.EMPTY + PipelineAggregator.PipelineTree.EMPTY, + () -> false ); ArrayList aggs = new ArrayList<>(); @@ -210,7 +211,8 @@ public void testSingleShardReduceDouble() { bigArrays, mockScriptService, bucketConsumer, - PipelineAggregator.PipelineTree.EMPTY + PipelineAggregator.PipelineTree.EMPTY, + () -> false ); ArrayList aggs = new ArrayList<>(); @@ -299,7 +301,8 @@ public void testMultipleShardsReduce() { bigArrays, mockScriptService, bucketConsumer, - PipelineAggregator.PipelineTree.EMPTY + PipelineAggregator.PipelineTree.EMPTY, + () -> false ); ArrayList aggs = new ArrayList<>(); @@ -354,7 +357,8 @@ public void testOverlappingReduceResult() { bigArrays, mockScriptService, bucketConsumer, - PipelineAggregator.PipelineTree.EMPTY + PipelineAggregator.PipelineTree.EMPTY, + () -> false ); ArrayList aggs = new ArrayList<>(); @@ -414,7 +418,8 @@ public void testSameMinMerge() { bigArrays, mockScriptService, bucketConsumer, - PipelineAggregator.PipelineTree.EMPTY + PipelineAggregator.PipelineTree.EMPTY, + () -> false ); ArrayList aggs = new ArrayList<>(); diff --git a/server/src/test/java/org/elasticsearch/search/aggregations/bucket/terms/TermsAggregatorTests.java b/server/src/test/java/org/elasticsearch/search/aggregations/bucket/terms/TermsAggregatorTests.java index 8b6c8028c43bb..b5bb03405d957 100644 --- a/server/src/test/java/org/elasticsearch/search/aggregations/bucket/terms/TermsAggregatorTests.java +++ b/server/src/test/java/org/elasticsearch/search/aggregations/bucket/terms/TermsAggregatorTests.java @@ -1272,7 +1272,8 @@ public void testMixLongAndDouble() throws Exception { new MockBigArrays(new MockPageCacheRecycler(Settings.EMPTY), new NoneCircuitBreakerService()), null, b -> {}, - PipelineTree.EMPTY + PipelineTree.EMPTY, + () -> false ); for (InternalAggregation internalAgg : aggs) { InternalAggregation mergedAggs = internalAgg.reduce(aggs, ctx); @@ -2200,7 +2201,8 @@ private T reduce(Aggregator agg, BigArrays bigAr bigArrays, getMockScriptService(), reduceBucketConsumer, - PipelineTree.EMPTY + PipelineTree.EMPTY, + () -> false ); @SuppressWarnings("unchecked") diff --git a/server/src/test/java/org/elasticsearch/search/aggregations/metrics/InternalScriptedMetricTests.java b/server/src/test/java/org/elasticsearch/search/aggregations/metrics/InternalScriptedMetricTests.java index 558ee1285308e..ec91f60b63d0c 100644 --- a/server/src/test/java/org/elasticsearch/search/aggregations/metrics/InternalScriptedMetricTests.java +++ b/server/src/test/java/org/elasticsearch/search/aggregations/metrics/InternalScriptedMetricTests.java @@ -163,7 +163,7 @@ public InternalScriptedMetric createTestInstanceForXContent() { InternalScriptedMetric aggregation = createTestInstance(); return (InternalScriptedMetric) aggregation.reduce( singletonList(aggregation), - ReduceContext.forFinalReduction(null, mockScriptService(), null, PipelineTree.EMPTY) + ReduceContext.forFinalReduction(null, mockScriptService(), null, PipelineTree.EMPTY, () -> false) ); } diff --git a/test/framework/src/main/java/org/elasticsearch/search/aggregations/AggregatorTestCase.java b/test/framework/src/main/java/org/elasticsearch/search/aggregations/AggregatorTestCase.java index 9c8e472ad7bb8..595a1cac8852f 100644 --- a/test/framework/src/main/java/org/elasticsearch/search/aggregations/AggregatorTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/search/aggregations/AggregatorTestCase.java @@ -482,7 +482,6 @@ protected A searchAndReduc root.postCollection(); aggs.add(root.buildTopLevel()); } - if (randomBoolean() && aggs.size() > 1) { // sometimes do an incremental reduce int toReduceSize = aggs.size(); @@ -490,7 +489,7 @@ protected A searchAndReduc int r = randomIntBetween(1, toReduceSize); List toReduce = aggs.subList(0, r); InternalAggregation.ReduceContext reduceContext = InternalAggregation.ReduceContext.forPartialReduction( - context.bigArrays(), getMockScriptService(), () -> PipelineAggregator.PipelineTree.EMPTY); + context.bigArrays(), getMockScriptService(), () -> PipelineAggregator.PipelineTree.EMPTY, () -> false); A reduced = (A) aggs.get(0).reduce(toReduce, reduceContext); aggs = new ArrayList<>(aggs.subList(r, toReduceSize)); aggs.add(reduced); @@ -500,7 +499,7 @@ protected A searchAndReduc MultiBucketConsumer reduceBucketConsumer = new MultiBucketConsumer(maxBucket, new NoneCircuitBreakerService().getBreaker(CircuitBreaker.REQUEST)); InternalAggregation.ReduceContext reduceContext = InternalAggregation.ReduceContext.forFinalReduction( - context.bigArrays(), getMockScriptService(), reduceBucketConsumer, pipelines); + context.bigArrays(), getMockScriptService(), reduceBucketConsumer, pipelines, () -> false); @SuppressWarnings("unchecked") A internalAgg = (A) aggs.get(0).reduce(aggs, reduceContext); @@ -626,7 +625,8 @@ protected void debugTestCase( context.bigArrays(), getMockScriptService(), context.multiBucketConsumer(), - builder.buildPipelineTree() + builder.buildPipelineTree(), + () -> false ) ); @SuppressWarnings("unchecked") // We'll get a cast error in the test if we're wrong here and that is ok diff --git a/test/framework/src/main/java/org/elasticsearch/test/InternalAggregationTestCase.java b/test/framework/src/main/java/org/elasticsearch/test/InternalAggregationTestCase.java index da00ac50e4eb7..111825ef44732 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/InternalAggregationTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/test/InternalAggregationTestCase.java @@ -182,12 +182,14 @@ public static InternalAggregation.ReduceContextBuilder emptyReduceContextBuilder return new InternalAggregation.ReduceContextBuilder() { @Override public InternalAggregation.ReduceContext forPartialReduction() { - return InternalAggregation.ReduceContext.forPartialReduction(BigArrays.NON_RECYCLING_INSTANCE, null, () -> pipelineTree); + return InternalAggregation.ReduceContext.forPartialReduction( + BigArrays.NON_RECYCLING_INSTANCE, null, () -> pipelineTree, () -> false); } @Override public ReduceContext forFinalReduction() { - return InternalAggregation.ReduceContext.forFinalReduction(BigArrays.NON_RECYCLING_INSTANCE, null, b -> {}, pipelineTree); + return InternalAggregation.ReduceContext.forFinalReduction( + BigArrays.NON_RECYCLING_INSTANCE, null, b -> {}, pipelineTree, () -> false); } }; } @@ -361,7 +363,7 @@ public void testReduceRandom() throws IOException { // Sort aggs so that unmapped come last. This mimicks the behavior of InternalAggregations.reduce() toPartialReduce.sort(INTERNAL_AGG_COMPARATOR); InternalAggregation.ReduceContext context = InternalAggregation.ReduceContext.forPartialReduction( - bigArrays, mockScriptService, () -> PipelineAggregator.PipelineTree.EMPTY); + bigArrays, mockScriptService, () -> PipelineAggregator.PipelineTree.EMPTY, () -> false); @SuppressWarnings("unchecked") T reduced = (T) toPartialReduce.get(0).reduce(toPartialReduce, context); int initialBucketCount = 0; @@ -385,7 +387,7 @@ public void testReduceRandom() throws IOException { MultiBucketConsumer bucketConsumer = new MultiBucketConsumer(DEFAULT_MAX_BUCKETS, new NoneCircuitBreakerService().getBreaker(CircuitBreaker.REQUEST)); InternalAggregation.ReduceContext context = InternalAggregation.ReduceContext.forFinalReduction( - bigArrays, mockScriptService, bucketConsumer, PipelineTree.EMPTY); + bigArrays, mockScriptService, bucketConsumer, PipelineTree.EMPTY, () -> false); @SuppressWarnings("unchecked") T reduced = (T) inputs.get(0).reduce(toReduce, context); doAssertReducedMultiBucketConsumer(reduced, bucketConsumer); diff --git a/test/framework/src/main/java/org/elasticsearch/test/InternalMultiBucketAggregationTestCase.java b/test/framework/src/main/java/org/elasticsearch/test/InternalMultiBucketAggregationTestCase.java index b37503322119b..98ceb6bb6b510 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/InternalMultiBucketAggregationTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/test/InternalMultiBucketAggregationTestCase.java @@ -191,7 +191,7 @@ public void doAssertReducedMultiBucketConsumer(Aggregation agg, MultiBucketConsu } /** - * Build a reuce + * Build a reuce */ protected static void expectReduceUsesTooManyBuckets(InternalAggregation agg, int bucketLimit) { InternalAggregation.ReduceContext reduceContext = InternalAggregation.ReduceContext.forFinalReduction( @@ -208,7 +208,8 @@ public void accept(int value) { } } }, - PipelineTree.EMPTY + PipelineTree.EMPTY, + () -> false ); Exception e = expectThrows(IllegalArgumentException.class, () -> agg.reduce(List.of(agg), reduceContext)); assertThat(e.getMessage(), equalTo("too big!")); diff --git a/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/multiterms/InternalMultiTermsTests.java b/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/multiterms/InternalMultiTermsTests.java index 26ce55da4c41b..5bf553811a493 100644 --- a/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/multiterms/InternalMultiTermsTests.java +++ b/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/multiterms/InternalMultiTermsTests.java @@ -313,7 +313,8 @@ public void testReduceWithDoublePromotion() { InternalAggregation.ReduceContext context = InternalAggregation.ReduceContext.forPartialReduction( bigArrays, mockScriptService, - () -> PipelineAggregator.PipelineTree.EMPTY + () -> PipelineAggregator.PipelineTree.EMPTY, + () -> false ); InternalMultiTerms result = (InternalMultiTerms) terms1.reduce(List.of(terms1, terms2), context); diff --git a/x-pack/plugin/async-search/src/main/java/org/elasticsearch/xpack/search/AsyncSearchTask.java b/x-pack/plugin/async-search/src/main/java/org/elasticsearch/xpack/search/AsyncSearchTask.java index b56918963a0ae..cac11085e7bd7 100644 --- a/x-pack/plugin/async-search/src/main/java/org/elasticsearch/xpack/search/AsyncSearchTask.java +++ b/x-pack/plugin/async-search/src/main/java/org/elasticsearch/xpack/search/AsyncSearchTask.java @@ -41,6 +41,7 @@ import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicReference; import java.util.function.Consumer; +import java.util.function.Function; import java.util.function.Supplier; import static java.util.Collections.singletonList; @@ -79,7 +80,8 @@ final class AsyncSearchTask extends SearchTask implements AsyncTask { * @param taskHeaders The filtered request headers for the task. * @param searchId The {@link AsyncExecutionId} of the task. * @param threadPool The threadPool to schedule runnable. - * @param aggReduceContextSupplier A supplier to create final reduce contexts. + * @param aggReduceContextSupplierFactory A factory that creates as supplier to create final reduce contexts, we need a factory in + * order to inject the task itself to the reduce context. */ AsyncSearchTask(long id, String type, @@ -92,14 +94,14 @@ final class AsyncSearchTask extends SearchTask implements AsyncTask { AsyncExecutionId searchId, Client client, ThreadPool threadPool, - Supplier aggReduceContextSupplier) { + Function, Supplier> aggReduceContextSupplierFactory) { super(id, type, action, () -> "async_search{" + descriptionSupplier.get() + "}", parentTaskId, taskHeaders); this.expirationTimeMillis = getStartTime() + keepAlive.getMillis(); this.originHeaders = originHeaders; this.searchId = searchId; this.client = client; this.threadPool = threadPool; - this.aggReduceContextSupplier = aggReduceContextSupplier; + this.aggReduceContextSupplier = aggReduceContextSupplierFactory.apply(this::isCancelled); this.progressListener = new Listener(); setProgressListener(progressListener); } diff --git a/x-pack/plugin/async-search/src/main/java/org/elasticsearch/xpack/search/TransportSubmitAsyncSearchAction.java b/x-pack/plugin/async-search/src/main/java/org/elasticsearch/xpack/search/TransportSubmitAsyncSearchAction.java index 949421bf4e775..8efef493a73b3 100644 --- a/x-pack/plugin/async-search/src/main/java/org/elasticsearch/xpack/search/TransportSubmitAsyncSearchAction.java +++ b/x-pack/plugin/async-search/src/main/java/org/elasticsearch/xpack/search/TransportSubmitAsyncSearchAction.java @@ -36,6 +36,7 @@ import org.elasticsearch.xpack.core.search.action.SubmitAsyncSearchRequest; import java.util.Map; +import java.util.function.BiFunction; import java.util.function.Function; import java.util.function.Supplier; @@ -43,7 +44,7 @@ public class TransportSubmitAsyncSearchAction extends HandledTransportAction { private final NodeClient nodeClient; - private final Function requestToAggReduceContextBuilder; + private final BiFunction, SearchRequest, InternalAggregation.ReduceContext> requestToAggReduceContextBuilder; private final TransportSearchAction searchAction; private final ThreadContext threadContext; private final AsyncTaskIndexService store; @@ -60,7 +61,7 @@ public TransportSubmitAsyncSearchAction(ClusterService clusterService, BigArrays bigArrays) { super(SubmitAsyncSearchAction.NAME, transportService, actionFilters, SubmitAsyncSearchRequest::new); this.nodeClient = nodeClient; - this.requestToAggReduceContextBuilder = request -> searchService.aggReduceContextBuilder(request).forFinalReduction(); + this.requestToAggReduceContextBuilder = (task, request) -> searchService.aggReduceContextBuilder(task, request).forFinalReduction(); this.searchAction = searchAction; this.threadContext = transportService.getThreadPool().getThreadContext(); this.store = new AsyncTaskIndexService<>(XPackPlugin.ASYNC_RESULTS_INDEX, clusterService, threadContext, client, @@ -136,10 +137,11 @@ private SearchRequest createSearchRequest(SubmitAsyncSearchRequest request, Task @Override public AsyncSearchTask createTask(long id, String type, String action, TaskId parentTaskId, Map taskHeaders) { AsyncExecutionId searchId = new AsyncExecutionId(docID, new TaskId(nodeClient.getLocalNodeId(), id)); - Supplier aggReduceContextSupplier = - () -> requestToAggReduceContextBuilder.apply(request.getSearchRequest()); + Function, Supplier> aggReduceContextSupplierFactory = + (isCancelled) -> () -> requestToAggReduceContextBuilder.apply(isCancelled, request.getSearchRequest()); return new AsyncSearchTask(id, type, action, parentTaskId, this::buildDescription, keepAlive, - originHeaders, taskHeaders, searchId, store.getClientWithOrigin(), nodeClient.threadPool(), aggReduceContextSupplier); + originHeaders, taskHeaders, searchId, store.getClientWithOrigin(), nodeClient.threadPool(), + aggReduceContextSupplierFactory); } }; searchRequest.setParentTask(new TaskId(nodeClient.getLocalNodeId(), submitTask.getId())); diff --git a/x-pack/plugin/async-search/src/test/java/org/elasticsearch/xpack/search/AsyncSearchTaskTests.java b/x-pack/plugin/async-search/src/test/java/org/elasticsearch/xpack/search/AsyncSearchTaskTests.java index 3ee38242eef98..f4269492cd4d9 100644 --- a/x-pack/plugin/async-search/src/test/java/org/elasticsearch/xpack/search/AsyncSearchTaskTests.java +++ b/x-pack/plugin/async-search/src/test/java/org/elasticsearch/xpack/search/AsyncSearchTaskTests.java @@ -74,7 +74,7 @@ public void afterTest() { private AsyncSearchTask createAsyncSearchTask() { return new AsyncSearchTask(0L, "", "", new TaskId("node1", 0), () -> null, TimeValue.timeValueHours(1), Collections.emptyMap(), Collections.emptyMap(), new AsyncExecutionId("0", new TaskId("node1", 1)), - new NoOpClient(threadPool), threadPool, null); + new NoOpClient(threadPool), threadPool, (t) -> () -> null); } public void testTaskDescription() { @@ -82,7 +82,7 @@ public void testTaskDescription() { new SearchSourceBuilder().query(QueryBuilders.termQuery("field", "value"))); AsyncSearchTask asyncSearchTask = new AsyncSearchTask(0L, "", "", new TaskId("node1", 0), searchRequest::buildDescription, TimeValue.timeValueHours(1), Collections.emptyMap(), Collections.emptyMap(), new AsyncExecutionId("0", new TaskId("node1", 1)), - new NoOpClient(threadPool), threadPool, null); + new NoOpClient(threadPool), threadPool, (t) -> () -> null); assertEquals("async_search{indices[index1,index2], search_type[QUERY_THEN_FETCH], " + "source[{\"query\":{\"term\":{\"field\":{\"value\":\"value\",\"boost\":1.0}}}}]}", asyncSearchTask.getDescription()); } @@ -90,7 +90,7 @@ public void testTaskDescription() { public void testWaitForInit() throws InterruptedException { AsyncSearchTask task = new AsyncSearchTask(0L, "", "", new TaskId("node1", 0), () -> null, TimeValue.timeValueHours(1), Collections.emptyMap(), Collections.emptyMap(), new AsyncExecutionId("0", new TaskId("node1", 1)), - new NoOpClient(threadPool), threadPool, null); + new NoOpClient(threadPool), threadPool, (t) -> () -> null); int numShards = randomIntBetween(0, 10); List shards = new ArrayList<>(); for (int i = 0; i < numShards; i++) { diff --git a/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/RollupResponseTranslator.java b/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/RollupResponseTranslator.java index 98796ea064403..5567755083f07 100644 --- a/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/RollupResponseTranslator.java +++ b/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/RollupResponseTranslator.java @@ -287,7 +287,8 @@ private static SearchResponse doCombineResponse( reduceContext.bigArrays(), reduceContext.scriptService(), b -> {}, - PipelineTree.EMPTY + PipelineTree.EMPTY, + reduceContext.isCanceled() ); for (SearchResponse rolledResponse : rolledResponses) { List unrolledAggs = new ArrayList<>(rolledResponse.getAggregations().asList().size()); diff --git a/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/action/TransportRollupSearchAction.java b/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/action/TransportRollupSearchAction.java index 7af3eb7c8881a..99e5550a3782e 100644 --- a/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/action/TransportRollupSearchAction.java +++ b/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/action/TransportRollupSearchAction.java @@ -50,6 +50,7 @@ import org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder; import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator; import org.elasticsearch.search.builder.SearchSourceBuilder; +import org.elasticsearch.tasks.CancellableTask; import org.elasticsearch.tasks.Task; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.TransportChannel; @@ -123,7 +124,8 @@ protected void doExecute(Task task, SearchRequest request, ActionListener PipelineAggregator.PipelineTree.EMPTY + () -> PipelineAggregator.PipelineTree.EMPTY, + ((CancellableTask) task)::isCancelled ); listener.onResponse(processResponses(rollupSearchContext, msearchResponse, context)); }, listener::onFailure)); diff --git a/x-pack/plugin/rollup/src/test/java/org/elasticsearch/xpack/rollup/RollupResponseTranslationTests.java b/x-pack/plugin/rollup/src/test/java/org/elasticsearch/xpack/rollup/RollupResponseTranslationTests.java index 5e68cf490bdc2..fb69f675426cd 100644 --- a/x-pack/plugin/rollup/src/test/java/org/elasticsearch/xpack/rollup/RollupResponseTranslationTests.java +++ b/x-pack/plugin/rollup/src/test/java/org/elasticsearch/xpack/rollup/RollupResponseTranslationTests.java @@ -100,7 +100,7 @@ public void testLiveFailure() { RuntimeException.class, () -> RollupResponseTranslator.combineResponses( failure, - InternalAggregation.ReduceContext.forFinalReduction(bigArrays, scriptService, b -> {}, PipelineTree.EMPTY) + InternalAggregation.ReduceContext.forFinalReduction(bigArrays, scriptService, b -> {}, PipelineTree.EMPTY, () -> false) ) ); assertThat(e.getMessage(), equalTo("foo")); @@ -109,7 +109,7 @@ public void testLiveFailure() { RuntimeException.class, () -> RollupResponseTranslator.translateResponse( failure, - InternalAggregation.ReduceContext.forFinalReduction(bigArrays, scriptService, b -> {}, PipelineTree.EMPTY) + InternalAggregation.ReduceContext.forFinalReduction(bigArrays, scriptService, b -> {}, PipelineTree.EMPTY, () -> false) ) ); assertThat(e.getMessage(), equalTo("foo")); @@ -129,7 +129,7 @@ public void testRollupFailure() { RuntimeException.class, () -> RollupResponseTranslator.translateResponse( failure, - InternalAggregation.ReduceContext.forFinalReduction(bigArrays, scriptService, b -> {}, PipelineTree.EMPTY) + InternalAggregation.ReduceContext.forFinalReduction(bigArrays, scriptService, b -> {}, PipelineTree.EMPTY, () -> false) ) ); assertThat(e.getMessage(), equalTo("rollup failure")); @@ -147,7 +147,7 @@ public void testLiveMissingRollupMissing() { ResourceNotFoundException.class, () -> RollupResponseTranslator.combineResponses( failure, - InternalAggregation.ReduceContext.forFinalReduction(bigArrays, scriptService, b -> {}, PipelineTree.EMPTY) + InternalAggregation.ReduceContext.forFinalReduction(bigArrays, scriptService, b -> {}, PipelineTree.EMPTY, () -> false) ) ); assertThat( @@ -202,7 +202,7 @@ public void testMissingLiveIndex() throws Exception { ResourceNotFoundException.class, () -> RollupResponseTranslator.combineResponses( msearch, - InternalAggregation.ReduceContext.forFinalReduction(bigArrays, scriptService, b -> {}, PipelineTree.EMPTY) + InternalAggregation.ReduceContext.forFinalReduction(bigArrays, scriptService, b -> {}, PipelineTree.EMPTY, () -> false) ) ); assertThat( @@ -227,7 +227,7 @@ public void testRolledMissingAggs() throws Exception { SearchResponse response = RollupResponseTranslator.translateResponse( msearch, - InternalAggregation.ReduceContext.forFinalReduction(bigArrays, scriptService, b -> {}, PipelineTree.EMPTY) + InternalAggregation.ReduceContext.forFinalReduction(bigArrays, scriptService, b -> {}, PipelineTree.EMPTY, () -> false) ); assertNotNull(response); Aggregations responseAggs = response.getAggregations(); @@ -248,7 +248,7 @@ public void testMissingRolledIndex() { ResourceNotFoundException.class, () -> RollupResponseTranslator.combineResponses( msearch, - InternalAggregation.ReduceContext.forFinalReduction(bigArrays, scriptService, b -> {}, PipelineTree.EMPTY) + InternalAggregation.ReduceContext.forFinalReduction(bigArrays, scriptService, b -> {}, PipelineTree.EMPTY, () -> false) ) ); assertThat( @@ -313,7 +313,8 @@ public void testTranslateRollup() throws Exception { bigArrays, scriptService, b -> {}, - PipelineTree.EMPTY + PipelineTree.EMPTY, + () -> false ); SearchResponse finalResponse = RollupResponseTranslator.translateResponse(new MultiSearchResponse.Item[] { item }, context); @@ -332,7 +333,8 @@ public void testTranslateMissingRollup() { bigArrays, scriptService, b -> {}, - PipelineTree.EMPTY + PipelineTree.EMPTY, + () -> false ); ResourceNotFoundException e = expectThrows( @@ -376,7 +378,7 @@ public void testMissingFilter() { RuntimeException.class, () -> RollupResponseTranslator.combineResponses( msearch, - InternalAggregation.ReduceContext.forFinalReduction(bigArrays, scriptService, b -> {}, PipelineTree.EMPTY) + InternalAggregation.ReduceContext.forFinalReduction(bigArrays, scriptService, b -> {}, PipelineTree.EMPTY, () -> false) ) ); assertThat(e.getMessage(), containsString("Expected [bizzbuzz] to be a FilterAggregation")); @@ -409,7 +411,7 @@ public void testMatchingNameNotFilter() { RuntimeException.class, () -> RollupResponseTranslator.combineResponses( msearch, - InternalAggregation.ReduceContext.forFinalReduction(bigArrays, scriptService, b -> {}, PipelineTree.EMPTY) + InternalAggregation.ReduceContext.forFinalReduction(bigArrays, scriptService, b -> {}, PipelineTree.EMPTY, () -> false) ) ); assertThat(e.getMessage(), equalTo("Expected [filter_foo] to be a FilterAggregation, but was [InternalMax]")); @@ -464,7 +466,7 @@ public void testSimpleReduction() throws Exception { SearchResponse response = RollupResponseTranslator.combineResponses( msearch, - InternalAggregation.ReduceContext.forFinalReduction(bigArrays, scriptService, b -> {}, PipelineTree.EMPTY) + InternalAggregation.ReduceContext.forFinalReduction(bigArrays, scriptService, b -> {}, PipelineTree.EMPTY, () -> false) ); assertNotNull(response); Aggregations responseAggs = response.getAggregations(); @@ -599,7 +601,8 @@ public void testMismatch() throws IOException { bigArrays, scriptService, b -> {}, - PipelineTree.EMPTY + PipelineTree.EMPTY, + () -> false ); ClassCastException e = expectThrows( ClassCastException.class, @@ -685,7 +688,8 @@ public void testDateHistoWithGap() throws IOException { bigArrays, scriptService, b -> {}, - PipelineTree.EMPTY + PipelineTree.EMPTY, + () -> false ); InternalAggregation reduced = ((InternalDateHistogram) unrolled).reduce(Collections.singletonList(unrolled), context); From 81f65dfcf9bfcbc71bce80154761cdf304edd343 Mon Sep 17 00:00:00 2001 From: Nik Everett Date: Fri, 1 Oct 2021 15:46:20 -0400 Subject: [PATCH 103/250] TSDB: CCR tests (#78034) Adds two tests for CCR against indices in time_series mode. --- .../xpack/ccr/FollowIndexIT.java | 138 ++++++++++++++++++ 1 file changed, 138 insertions(+) diff --git a/x-pack/plugin/ccr/qa/multi-cluster/src/test/java/org/elasticsearch/xpack/ccr/FollowIndexIT.java b/x-pack/plugin/ccr/qa/multi-cluster/src/test/java/org/elasticsearch/xpack/ccr/FollowIndexIT.java index e0ff2a02fc6bf..0fee6e7c82dc5 100644 --- a/x-pack/plugin/ccr/qa/multi-cluster/src/test/java/org/elasticsearch/xpack/ccr/FollowIndexIT.java +++ b/x-pack/plugin/ccr/qa/multi-cluster/src/test/java/org/elasticsearch/xpack/ccr/FollowIndexIT.java @@ -15,6 +15,8 @@ import org.elasticsearch.common.settings.SecureString; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; +import org.elasticsearch.index.IndexSettings; +import org.elasticsearch.index.mapper.DateFieldMapper; import org.elasticsearch.repositories.fs.FsRepository; import org.elasticsearch.rest.RestStatus; @@ -23,6 +25,8 @@ import java.util.Map; import java.util.concurrent.TimeUnit; +import static io.github.nik9000.mapmatcher.MapMatcher.assertMap; +import static io.github.nik9000.mapmatcher.MapMatcher.matchesMap; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.emptyOrNullString; import static org.hamcrest.Matchers.equalTo; @@ -235,6 +239,140 @@ public void testFollowSearchableSnapshotsFails() throws Exception { } } + public void testFollowTsdbIndex() throws Exception { + final int numDocs = 128; + final String leaderIndexName = "tsdb_leader"; + long basetime = DateFieldMapper.DEFAULT_DATE_TIME_FORMATTER.parseMillis("2021-01-01T00:00:00Z"); + if ("leader".equals(targetCluster)) { + logger.info("Running against leader cluster"); + createIndex( + leaderIndexName, + Settings.builder().put(IndexSettings.MODE.getKey(), "time_series").build(), + "\"properties\": {\"@timestamp\": {\"type\": \"date\"}, \"dim\": {\"type\": \"keyword\", \"time_series_dimension\": true}}" + ); + for (int i = 0; i < numDocs; i++) { + logger.info("Indexing doc [{}]", i); + index( + client(), + leaderIndexName, + Integer.toString(i), + "@timestamp", + basetime + TimeUnit.SECONDS.toMillis(i * 10), + "dim", + "foobar" + ); + } + refresh(leaderIndexName); + verifyDocuments(client(), leaderIndexName, numDocs); + } else if ("follow".equals(targetCluster)) { + logger.info("Running against follow cluster"); + final String followIndexName = "tsdb_follower"; + final boolean overrideNumberOfReplicas = randomBoolean(); + if (overrideNumberOfReplicas) { + followIndex( + client(), + "leader_cluster", + leaderIndexName, + followIndexName, + Settings.builder().put("index.number_of_replicas", 0).build() + ); + } else { + followIndex(leaderIndexName, followIndexName); + } + assertBusy(() -> { + verifyDocuments(client(), followIndexName, numDocs); + if (overrideNumberOfReplicas) { + assertMap( + getIndexSettingsAsMap(followIndexName), + matchesMap().extraOk().entry("index.mode", "time_series").entry("index.number_of_replicas", "0") + ); + } else { + assertMap( + getIndexSettingsAsMap(followIndexName), + matchesMap().extraOk().entry("index.mode", "time_series").entry("index.number_of_replicas", "1") + ); + } + }); + // unfollow and then follow and then index a few docs in leader index: + pauseFollow(followIndexName); + resumeFollow(followIndexName); + try (RestClient leaderClient = buildLeaderClient()) { + int id = numDocs; + index( + leaderClient, + leaderIndexName, + Integer.toString(id), + "@timestamp", + basetime + TimeUnit.SECONDS.toMillis(id * 10), + "dim", + "foobar" + ); + index( + leaderClient, + leaderIndexName, + Integer.toString(id + 1), + "@timestamp", + basetime + TimeUnit.SECONDS.toMillis(id * 10 + 10), + "dim", + "foobar" + ); + index( + leaderClient, + leaderIndexName, + Integer.toString(id + 2), + "@timestamp", + basetime + TimeUnit.SECONDS.toMillis(id * 10 + 20), + "dim", + "foobar" + ); + } + assertBusy(() -> verifyDocuments(client(), followIndexName, numDocs + 3)); + assertBusy(() -> verifyCcrMonitoring(leaderIndexName, followIndexName), 30, TimeUnit.SECONDS); + + pauseFollow(followIndexName); + closeIndex(followIndexName); + assertOK(client().performRequest(new Request("POST", "/" + followIndexName + "/_ccr/unfollow"))); + Exception e = expectThrows(ResponseException.class, () -> resumeFollow(followIndexName)); + assertThat(e.getMessage(), containsString("follow index [" + followIndexName + "] does not have ccr metadata")); + } + } + + public void testFollowTsdbIndexCanNotOverrideMode() throws Exception { + if (false == "follow".equals(targetCluster)) { + return; + } + logger.info("Running against follow cluster"); + Exception e = expectThrows(ResponseException.class, () -> followIndex( + client(), + "leader_cluster", + "tsdb_leader", + "tsdb_follower_bad", + Settings.builder().put("index.mode", "standard").build() + )); + assertThat( + e.getMessage(), + containsString("can not put follower index that could override leader settings {\\\"index.mode\\\":\\\"standard\\\"}") + ); + } + + public void testFollowStandardIndexCanNotOverrideMode() throws Exception { + if (false == "follow".equals(targetCluster)) { + return; + } + logger.info("Running against follow cluster"); + Exception e = expectThrows(ResponseException.class, () -> followIndex( + client(), + "leader_cluster", + "test_index1", + "tsdb_follower_bad", + Settings.builder().put("index.mode", "time_series").build() + )); + assertThat( + e.getMessage(), + containsString("can not put follower index that could override leader settings {\\\"index.mode\\\":\\\"time_series\\\"}") + ); + } + @Override protected Settings restClientSettings() { String token = basicAuthHeaderValue("admin", new SecureString("admin-password".toCharArray())); From 9dda44728e6fddfb698b5e8a9d90f59bcd0ddc74 Mon Sep 17 00:00:00 2001 From: Nik Everett Date: Fri, 1 Oct 2021 16:14:56 -0400 Subject: [PATCH 104/250] TSDB: snapshot/restore test (#78022) Adds a basic test for tsdb with snapshot/restore. --- .../rest-api-spec/test/tsdb/30_snapshot.yml | 142 ++++++++++++++++++ 1 file changed, 142 insertions(+) create mode 100644 rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/tsdb/30_snapshot.yml diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/tsdb/30_snapshot.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/tsdb/30_snapshot.yml new file mode 100644 index 0000000000000..6213311944e5e --- /dev/null +++ b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/tsdb/30_snapshot.yml @@ -0,0 +1,142 @@ +--- +setup: + - do: + snapshot.create_repository: + repository: test_repo + body: + type: fs + settings: + location: test_repo + +--- +teardown: + - do: + snapshot.delete_repository: + repository: test_repo + +--- +"Create a snapshot and then restore it": + - skip: + version: " - 7.99.99" + reason: introduced in 8.0.0 + features: ["allowed_warnings"] + + # Create index + - do: + indices.create: + index: test_index + body: + settings: + index: + mode: time_series + number_of_replicas: 0 + number_of_shards: 2 + mappings: + properties: + "@timestamp": + type: date + metricset: + type: keyword + time_series_dimension: true + k8s: + properties: + pod: + properties: + uid: + type: keyword + time_series_dimension: true + name: + type: keyword + ip: + type: ip + network: + properties: + tx: + type: long + rx: + type: long + - do: + bulk: + refresh: true + index: test_index + body: + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:50:04.467Z", "metricset": "pod", "k8s": {"pod": {"name": "cat", "uid":"947e4ced-1786-4e53-9e0c-5c447e959507", "ip": "10.10.55.1", "network": {"tx": 2001818691, "rx": 802133794}}}}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:50:24.467Z", "metricset": "pod", "k8s": {"pod": {"name": "cat", "uid":"947e4ced-1786-4e53-9e0c-5c447e959507", "ip": "10.10.55.1", "network": {"tx": 2005177954, "rx": 801479970}}}}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:50:44.467Z", "metricset": "pod", "k8s": {"pod": {"name": "cat", "uid":"947e4ced-1786-4e53-9e0c-5c447e959507", "ip": "10.10.55.1", "network": {"tx": 2006223737, "rx": 802337279}}}}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:51:04.467Z", "metricset": "pod", "k8s": {"pod": {"name": "cat", "uid":"947e4ced-1786-4e53-9e0c-5c447e959507", "ip": "10.10.55.2", "network": {"tx": 2012916202, "rx": 803685721}}}}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:50:03.142Z", "metricset": "pod", "k8s": {"pod": {"name": "dog", "uid":"df3145b3-0563-4d3b-a0f7-897eb2876ea9", "ip": "10.10.55.3", "network": {"tx": 1434521831, "rx": 530575198}}}}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:50:23.142Z", "metricset": "pod", "k8s": {"pod": {"name": "dog", "uid":"df3145b3-0563-4d3b-a0f7-897eb2876ea9", "ip": "10.10.55.3", "network": {"tx": 1434577921, "rx": 530600088}}}}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:50:53.142Z", "metricset": "pod", "k8s": {"pod": {"name": "dog", "uid":"df3145b3-0563-4d3b-a0f7-897eb2876ea9", "ip": "10.10.55.3", "network": {"tx": 1434587694, "rx": 530604797}}}}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:51:03.142Z", "metricset": "pod", "k8s": {"pod": {"name": "dog", "uid":"df3145b3-0563-4d3b-a0f7-897eb2876ea9", "ip": "10.10.55.3", "network": {"tx": 1434595272, "rx": 530605511}}}}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:50:03.142Z", "metricset": "pod", "k8s": {"pod": {"name": "cow", "uid":"1c4fc7b8-93b7-4ba8-b609-2a48af2f8e39", "ip": "10.10.55.4", "network": {"tx": 1434521831, "rx": 530575198}}}}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:50:23.142Z", "metricset": "pod", "k8s": {"pod": {"name": "cow", "uid":"1c4fc7b8-93b7-4ba8-b609-2a48af2f8e39", "ip": "10.10.55.4", "network": {"tx": 1434577921, "rx": 530600088}}}}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:50:53.142Z", "metricset": "pod", "k8s": {"pod": {"name": "cow", "uid":"1c4fc7b8-93b7-4ba8-b609-2a48af2f8e39", "ip": "10.10.55.4", "network": {"tx": 1434587694, "rx": 530604797}}}}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:51:03.142Z", "metricset": "pod", "k8s": {"pod": {"name": "cow", "uid":"1c4fc7b8-93b7-4ba8-b609-2a48af2f8e39", "ip": "10.10.55.4", "network": {"tx": 1434595272, "rx": 530605511}}}}' + + + # Wait for green + - do: + cluster.health: + wait_for_status: green + + # Take snapshot + - do: + snapshot.create: + repository: test_repo + snapshot: test_restore_tsdb + wait_for_completion: true + + - match: { snapshot.snapshot: test_restore_tsdb } + - match: { snapshot.state : SUCCESS } + - match: { snapshot.shards.successful: 2 } + - match: { snapshot.shards.failed : 0 } + - is_true: snapshot.version + - gt: { snapshot.version_id: 0} + + # Close index + - do: + indices.close: + index : test_index + allowed_warnings: + - "the default value for the ?wait_for_active_shards parameter will change from '0' to 'index-setting' in version 8; specify '?wait_for_active_shards=index-setting' to adopt the future default behaviour, or '?wait_for_active_shards=0' to preserve today's behaviour" + + # Restore index + - do: + snapshot.restore: + repository: test_repo + snapshot: test_restore_tsdb + wait_for_completion: true + + # Check recovery stats + - do: + indices.recovery: + index: test_index + + - match: { test_index.shards.0.type: SNAPSHOT } + - match: { test_index.shards.0.stage: DONE } + - match: { test_index.shards.0.index.files.recovered: 1} + - gt: { test_index.shards.0.index.size.recovered_in_bytes: 0} + + - do: + search: + index: test_index + body: + query: + query_string: + query: '+@timestamp:"2021-04-28T18:51:04.467Z" +k8s.pod.name:cat' + + - match: {hits.total.value: 1} + - match: {hits.hits.0._source.k8s.pod.uid: 947e4ced-1786-4e53-9e0c-5c447e959507} + # TODO assert the _tsid once we generate it From 37a23d7ca48a2036317279232224bb8843178d0f Mon Sep 17 00:00:00 2001 From: Nik Everett Date: Fri, 1 Oct 2021 16:17:12 -0400 Subject: [PATCH 105/250] TSDB: Basic rolling upgrade test (#78028) Adds an index in time_series mode to the rolling upgrade tests. --- .../elasticsearch/upgrades/IndexingIT.java | 146 +++++++++++++++++- 1 file changed, 144 insertions(+), 2 deletions(-) diff --git a/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/IndexingIT.java b/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/IndexingIT.java index ea09cb95f7d62..065e3d02c9034 100644 --- a/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/IndexingIT.java +++ b/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/IndexingIT.java @@ -7,23 +7,33 @@ */ package org.elasticsearch.upgrades; +import io.github.nik9000.mapmatcher.ListMatcher; + import org.apache.http.util.EntityUtils; import org.elasticsearch.Version; import org.elasticsearch.client.Request; import org.elasticsearch.client.Response; import org.elasticsearch.client.ResponseException; -import org.elasticsearch.core.Booleans; import org.elasticsearch.common.Strings; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.common.xcontent.support.XContentMapValues; +import org.elasticsearch.core.Booleans; +import org.elasticsearch.index.mapper.DateFieldMapper; +import org.hamcrest.Matcher; import java.io.IOException; import java.nio.charset.StandardCharsets; import java.util.List; import java.util.Map; +import java.util.concurrent.TimeUnit; +import static io.github.nik9000.mapmatcher.ListMatcher.matchesList; +import static io.github.nik9000.mapmatcher.MapMatcher.assertMap; +import static io.github.nik9000.mapmatcher.MapMatcher.matchesMap; import static org.elasticsearch.rest.action.search.RestSearchAction.TOTAL_HITS_AS_INT_PARAM; +import static org.hamcrest.Matchers.closeTo; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.either; import static org.hamcrest.Matchers.equalTo; @@ -228,12 +238,144 @@ private void bulk(String index, String valueSuffix, int count) throws IOExceptio b.append("{\"index\": {\"_index\": \"").append(index).append("\"}}\n"); b.append("{\"f1\": \"v").append(i).append(valueSuffix).append("\", \"f2\": ").append(i).append("}\n"); } + bulk(index, b.toString()); + } + + private static final List TSDB_DIMS = List.of("6a841a21", "947e4ced", "a4c385a1", "b47a2f4e", "df3145b3"); + private static final long[] TSDB_TIMES; + static { + String[] times = new String[] { + "2021-01-01T00:00:00Z", + "2021-01-02T00:00:00Z", + "2021-01-02T00:10:00Z", + "2021-01-02T00:20:00Z", + "2021-01-02T00:30:00Z" }; + TSDB_TIMES = new long[times.length]; + for (int i = 0; i < times.length; i++) { + TSDB_TIMES[i] = DateFieldMapper.DEFAULT_DATE_TIME_FORMATTER.parseMillis(times[i]); + } + } + + public void testTsdb() throws IOException { + assumeTrue("tsdb added in 8.0.0", UPGRADE_FROM_VERSION.onOrAfter(Version.V_8_0_0)); + + StringBuilder bulk = new StringBuilder(); + switch (CLUSTER_TYPE) { + case OLD: + createTsdbIndex(); + tsdbBulk(bulk, TSDB_DIMS.get(0), TSDB_TIMES[0], TSDB_TIMES[1], 0.1); + tsdbBulk(bulk, TSDB_DIMS.get(1), TSDB_TIMES[0], TSDB_TIMES[1], -0.1); + bulk("tsdb", bulk.toString()); + assertTsdbAgg(closeTo(215.95, 0.005), closeTo(-215.95, 0.005)); + return; + case MIXED: + if (FIRST_MIXED_ROUND) { + tsdbBulk(bulk, TSDB_DIMS.get(0), TSDB_TIMES[1], TSDB_TIMES[2], 0.1); + tsdbBulk(bulk, TSDB_DIMS.get(1), TSDB_TIMES[1], TSDB_TIMES[2], -0.1); + tsdbBulk(bulk, TSDB_DIMS.get(2), TSDB_TIMES[0], TSDB_TIMES[2], 1.1); + bulk("tsdb", bulk.toString()); + assertTsdbAgg(closeTo(217.45, 0.005), closeTo(-217.45, 0.005), closeTo(2391.95, 0.005)); + return; + } + tsdbBulk(bulk, TSDB_DIMS.get(0), TSDB_TIMES[2], TSDB_TIMES[3], 0.1); + tsdbBulk(bulk, TSDB_DIMS.get(1), TSDB_TIMES[2], TSDB_TIMES[3], -0.1); + tsdbBulk(bulk, TSDB_DIMS.get(2), TSDB_TIMES[2], TSDB_TIMES[3], 1.1); + tsdbBulk(bulk, TSDB_DIMS.get(3), TSDB_TIMES[0], TSDB_TIMES[3], 10); + bulk("tsdb", bulk.toString()); + assertTsdbAgg(closeTo(218.95, 0.005), closeTo(-218.95, 0.005), closeTo(2408.45, 0.005), closeTo(21895, 0.5)); + return; + case UPGRADED: + tsdbBulk(bulk, TSDB_DIMS.get(0), TSDB_TIMES[3], TSDB_TIMES[4], 0.1); + tsdbBulk(bulk, TSDB_DIMS.get(1), TSDB_TIMES[3], TSDB_TIMES[4], -0.1); + tsdbBulk(bulk, TSDB_DIMS.get(2), TSDB_TIMES[3], TSDB_TIMES[4], 1.1); + tsdbBulk(bulk, TSDB_DIMS.get(3), TSDB_TIMES[3], TSDB_TIMES[4], 10); + tsdbBulk(bulk, TSDB_DIMS.get(4), TSDB_TIMES[0], TSDB_TIMES[4], -5); + bulk("tsdb", bulk.toString()); + assertTsdbAgg( + closeTo(220.45, 0.005), + closeTo(-220.45, 0.005), + closeTo(2424.95, 0.005), + closeTo(22045, 0.5), + closeTo(-11022.5, 0.5) + ); + return; + } + } + + private void bulk(String index, String entity) throws IOException { Request bulk = new Request("POST", "/_bulk"); bulk.addParameter("refresh", "true"); - bulk.setJsonEntity(b.toString()); + bulk.setJsonEntity(entity.toString()); client().performRequest(bulk); } + private void createTsdbIndex() throws IOException { + Request createIndex = new Request("PUT", "/tsdb"); + XContentBuilder indexSpec = XContentBuilder.builder(XContentType.JSON.xContent()).startObject(); + indexSpec.startObject("mappings").startObject("properties"); + { + indexSpec.startObject("@timestamp").field("type", "date").endObject(); + indexSpec.startObject("dim").field("type", "keyword").field("time_series_dimension", true).endObject(); + } + indexSpec.endObject().endObject(); + indexSpec.startObject("settings").field("mode", "time_series").endObject(); + createIndex.setJsonEntity(Strings.toString(indexSpec.endObject())); + client().performRequest(createIndex); + } + + private void tsdbBulk(StringBuilder bulk, String dim, long timeStart, long timeEnd, double rate) throws IOException { + long delta = TimeUnit.SECONDS.toMillis(20); + double value = (timeStart - TSDB_TIMES[0]) / TimeUnit.SECONDS.toMillis(20) * rate; + for (long t = timeStart; t < timeEnd; t += delta) { + bulk.append("{\"index\": {\"_index\": \"tsdb\"}}\n"); + bulk.append("{\"@timestamp\": ").append(t); + bulk.append(", \"dim\": \"").append(dim).append("\""); + bulk.append(", \"value\": ").append(value).append("}\n"); + value += rate; + } + } + + private void assertTsdbAgg(Matcher... expected) throws IOException { + Request request = new Request("POST", "/tsdb/_search"); + request.addParameter("size", "0"); + XContentBuilder body = JsonXContent.contentBuilder().startObject(); + // TODO replace tsid runtime field with real tsid + body.startObject("runtime_mappings"); + { + body.startObject("tsid"); + { + body.field("type", "keyword"); + body.field("script", "emit('dim:' + doc['dim'].value)"); + } + body.endObject(); + } + body.endObject(); + body.startObject("aggs").startObject("tsids"); + { + body.startObject("terms").field("field", "tsid").endObject(); + body.startObject("aggs").startObject("avg"); + { + body.startObject("avg").field("field", "value").endObject(); + } + body.endObject().endObject(); + } + body.endObject().endObject(); + request.setJsonEntity(Strings.toString(body.endObject())); + ListMatcher tsidsExpected = matchesList(); + for (int d = 0; d < expected.length; d++) { +// Object key = Map.of("dim", TSDB_DIMS.get(d)); TODO use this once tsid is real + Object key = "dim:" + TSDB_DIMS.get(d); + tsidsExpected = tsidsExpected.item( + matchesMap().extraOk().entry("key", key).entry("avg", Map.of("value", expected[d])) + ); + } + assertMap( + entityAsMap(client().performRequest(request)), + matchesMap().extraOk() + .entry("aggregations", matchesMap().entry("tsids", matchesMap().extraOk().entry("buckets", tsidsExpected))) + ); + } + private void assertCount(String index, int count) throws IOException { Request searchTestIndexRequest = new Request("POST", "/" + index + "/_search"); searchTestIndexRequest.addParameter(TOTAL_HITS_AS_INT_PARAM, "true"); From 8ce0d1e55503de619c44c28f7f37c713c2a11efb Mon Sep 17 00:00:00 2001 From: Nik Everett Date: Fri, 1 Oct 2021 16:44:59 -0400 Subject: [PATCH 106/250] TSDB: Tests for data_stream (#78038) Adds a test for creating a data stream in time_series mode. --- .../test/data_stream/150_tsdb.yml | 137 ++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/150_tsdb.yml diff --git a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/150_tsdb.yml b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/150_tsdb.yml new file mode 100644 index 0000000000000..6acc35392a53d --- /dev/null +++ b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/150_tsdb.yml @@ -0,0 +1,137 @@ +setup: + - skip: + version: " - 7.99.99" + reason: introduced in 8.0.0 + features: allowed_warnings + + - do: + allowed_warnings: + - "index template [tsdbds-template1] has index patterns [simple-data-stream1] matching patterns from existing older templates [global] with patterns (global => [*]); this template [my-template1] will take precedence during new index creation" + indices.put_index_template: + name: my-template1 + body: + index_patterns: [k8s*] + data_stream: {} + template: + settings: + index: + number_of_replicas: 0 + number_of_shards: 2 + mode: time_series + mappings: + properties: + "@timestamp": + type: date + metricset: + type: keyword + time_series_dimension: true + k8s: + properties: + pod: + properties: + uid: + type: keyword + time_series_dimension: true + name: + type: keyword + ip: + type: ip + network: + properties: + tx: + type: long + rx: + type: long + + - do: + bulk: + refresh: true + index: k8s + body: + - '{"create": {}}' + - '{"@timestamp": "2021-04-28T18:50:04.467Z", "metricset": "pod", "k8s": {"pod": {"name": "cat", "uid":"947e4ced-1786-4e53-9e0c-5c447e959507", "ip": "10.10.55.1", "network": {"tx": 2001818691, "rx": 802133794}}}}' + - '{"create": {}}' + - '{"@timestamp": "2021-04-28T18:50:24.467Z", "metricset": "pod", "k8s": {"pod": {"name": "cat", "uid":"947e4ced-1786-4e53-9e0c-5c447e959507", "ip": "10.10.55.1", "network": {"tx": 2005177954, "rx": 801479970}}}}' + - '{"create": {}}' + - '{"@timestamp": "2021-04-28T18:50:44.467Z", "metricset": "pod", "k8s": {"pod": {"name": "cat", "uid":"947e4ced-1786-4e53-9e0c-5c447e959507", "ip": "10.10.55.1", "network": {"tx": 2006223737, "rx": 802337279}}}}' + - '{"create": {}}' + - '{"@timestamp": "2021-04-28T18:51:04.467Z", "metricset": "pod", "k8s": {"pod": {"name": "cat", "uid":"947e4ced-1786-4e53-9e0c-5c447e959507", "ip": "10.10.55.2", "network": {"tx": 2012916202, "rx": 803685721}}}}' + - '{"create": {}}' + - '{"@timestamp": "2021-04-28T18:50:03.142Z", "metricset": "pod", "k8s": {"pod": {"name": "dog", "uid":"df3145b3-0563-4d3b-a0f7-897eb2876ea9", "ip": "10.10.55.3", "network": {"tx": 1434521831, "rx": 530575198}}}}' + - '{"create": {}}' + - '{"@timestamp": "2021-04-28T18:50:23.142Z", "metricset": "pod", "k8s": {"pod": {"name": "dog", "uid":"df3145b3-0563-4d3b-a0f7-897eb2876ea9", "ip": "10.10.55.3", "network": {"tx": 1434577921, "rx": 530600088}}}}' + - '{"create": {}}' + - '{"@timestamp": "2021-04-28T18:50:53.142Z", "metricset": "pod", "k8s": {"pod": {"name": "dog", "uid":"df3145b3-0563-4d3b-a0f7-897eb2876ea9", "ip": "10.10.55.3", "network": {"tx": 1434587694, "rx": 530604797}}}}' + - '{"create": {}}' + - '{"@timestamp": "2021-04-28T18:51:03.142Z", "metricset": "pod", "k8s": {"pod": {"name": "dog", "uid":"df3145b3-0563-4d3b-a0f7-897eb2876ea9", "ip": "10.10.55.3", "network": {"tx": 1434595272, "rx": 530605511}}}}' + +--- +created the data stream: + - skip: + version: " - 7.99.99" + reason: introduced in 8.0.0 + + - do: + indices.get_data_stream: + name: '*' + - length: { data_streams: 1 } + - match: { data_streams.0.name: 'k8s' } + - match: { data_streams.0.timestamp_field.name: '@timestamp' } + - match: { data_streams.0.generation: 1 } + - length: { data_streams.0.indices: 1 } + - match: { data_streams.0.indices.0.index_name: '/\.ds-k8s-\d{4}\.\d{2}\.\d{2}-000001/' } + - match: { data_streams.0.status: 'GREEN' } + - match: { data_streams.0.template: 'my-template1' } + - match: { data_streams.0.hidden: false } + - match: { data_streams.0.system: false } + +--- +fetch the tsid: + - skip: + version: " - 7.99.99" + reason: introduced in 8.0.0 + + - do: + search: + index: k8s + body: + runtime_mappings: # TODO replace this with tsid once it is generated + tsid: + type: keyword + script: emit('k8s.pod.uid:' + doc['k8s.pod.uid'].value + ',metricset:' + doc['metricset'].value) + fields: + - field: tsid + query: + query_string: + query: '+@timestamp:"2021-04-28T18:51:04.467Z" +k8s.pod.name:cat' + + - match: {hits.total.value: 1} + - match: {hits.hits.0.fields.tsid: ['k8s.pod.uid:947e4ced-1786-4e53-9e0c-5c447e959507,metricset:pod']} + +--- +"aggregate the tsid": + - skip: + version: " - 7.99.99" + reason: introduced in 8.0.0 + + - do: + search: + index: k8s + body: + size: 0 + runtime_mappings: # TODO replace this with tsid once it is generated + tsid: + type: keyword + script: emit('k8s.pod.uid:' + doc['k8s.pod.uid'].value + ',metricset:' + doc['metricset'].value) + aggs: + tsids: + terms: + field: tsid + order: + _key: asc + + - match: {hits.total.value: 8} + - match: {aggregations.tsids.buckets.0.key: 'k8s.pod.uid:947e4ced-1786-4e53-9e0c-5c447e959507,metricset:pod'} + - match: {aggregations.tsids.buckets.0.doc_count: 4} + - match: {aggregations.tsids.buckets.1.key: 'k8s.pod.uid:df3145b3-0563-4d3b-a0f7-897eb2876ea9,metricset:pod'} + - match: {aggregations.tsids.buckets.1.doc_count: 4} From 50f3784a1e88ee1ed2fe3154968ab3b98b09af4f Mon Sep 17 00:00:00 2001 From: Nik Everett Date: Fri, 1 Oct 2021 16:45:19 -0400 Subject: [PATCH 107/250] TSDB: CCS Tests (#78042) Add some tests for cross cluster search for time_series mode indices. --- .../test/multi_cluster/100_tsdb.yml | 95 +++++++++++++++++++ .../test/remote_cluster/10_basic.yml | 64 ++++++++++++- 2 files changed, 158 insertions(+), 1 deletion(-) create mode 100644 qa/multi-cluster-search/src/test/resources/rest-api-spec/test/multi_cluster/100_tsdb.yml diff --git a/qa/multi-cluster-search/src/test/resources/rest-api-spec/test/multi_cluster/100_tsdb.yml b/qa/multi-cluster-search/src/test/resources/rest-api-spec/test/multi_cluster/100_tsdb.yml new file mode 100644 index 0000000000000..1c7d4aeee8a82 --- /dev/null +++ b/qa/multi-cluster-search/src/test/resources/rest-api-spec/test/multi_cluster/100_tsdb.yml @@ -0,0 +1,95 @@ +--- +setup: + # Create a local tsdb index with a tsid the doesn't overlap with the remote cluster. + - skip: + version: " - 7.99.99" + reason: introduced in 8.0.0 + + - do: + indices.create: + index: tsdb + body: + settings: + index: + mode: time_series + number_of_replicas: 0 + number_of_shards: 2 + mappings: + properties: + "@timestamp": + type: date + metricset: + type: keyword + time_series_dimension: true + k8s: + properties: + pod: + properties: + uid: + type: keyword + time_series_dimension: true + name: + type: keyword + ip: + type: ip + network: + properties: + tx: + type: long + rx: + type: long + + - do: + bulk: + refresh: true + index: tsdb + body: + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:50:03.142Z", "metricset": "pod", "k8s": {"pod": {"name": "cow", "uid":"1c4fc7b8-93b7-4ba8-b609-2a48af2f8e39", "ip": "10.10.55.4", "network": {"tx": 1434521831, "rx": 530575198}}}}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:50:23.142Z", "metricset": "pod", "k8s": {"pod": {"name": "cow", "uid":"1c4fc7b8-93b7-4ba8-b609-2a48af2f8e39", "ip": "10.10.55.4", "network": {"tx": 1434577921, "rx": 530600088}}}}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:50:53.142Z", "metricset": "pod", "k8s": {"pod": {"name": "cow", "uid":"1c4fc7b8-93b7-4ba8-b609-2a48af2f8e39", "ip": "10.10.55.4", "network": {"tx": 1434587694, "rx": 530604797}}}}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:51:03.142Z", "metricset": "pod", "k8s": {"pod": {"name": "cow", "uid":"1c4fc7b8-93b7-4ba8-b609-2a48af2f8e39", "ip": "10.10.55.4", "network": {"tx": 1434595272, "rx": 530605511}}}}' + +--- +teardown: + - skip: + version: " - 7.99.99" + reason: introduced in 8.0.0 + + - do: + indices.delete: + index: tsdb + ignore_unavailable: true + +--- +aggregate tsid: + - skip: + version: " - 7.99.99" + reason: introduced in 8.0.0 + + - do: + search: + index: tsdb,my_remote_cluster:tsdb + body: + size: 0 + runtime_mappings: # TODO replace this with tsid once it is generated + tsid: + type: keyword + script: emit('k8s.pod.uid:' + doc['k8s.pod.uid'].value + ',metricset:' + doc['metricset'].value) + aggs: + tsids: + terms: + field: tsid + order: + _key: asc + + - match: {hits.total.value: 12} + - match: {aggregations.tsids.buckets.0.key: 'k8s.pod.uid:1c4fc7b8-93b7-4ba8-b609-2a48af2f8e39,metricset:pod'} + - match: {aggregations.tsids.buckets.0.doc_count: 4} + - match: {aggregations.tsids.buckets.1.key: 'k8s.pod.uid:947e4ced-1786-4e53-9e0c-5c447e959507,metricset:pod'} + - match: {aggregations.tsids.buckets.1.doc_count: 4} + - match: {aggregations.tsids.buckets.2.key: 'k8s.pod.uid:df3145b3-0563-4d3b-a0f7-897eb2876ea9,metricset:pod'} + - match: {aggregations.tsids.buckets.2.doc_count: 4} diff --git a/qa/multi-cluster-search/src/test/resources/rest-api-spec/test/remote_cluster/10_basic.yml b/qa/multi-cluster-search/src/test/resources/rest-api-spec/test/remote_cluster/10_basic.yml index 8f9b0ce1545b3..5aa5bd659a1c2 100644 --- a/qa/multi-cluster-search/src/test/resources/rest-api-spec/test/remote_cluster/10_basic.yml +++ b/qa/multi-cluster-search/src/test/resources/rest-api-spec/test/remote_cluster/10_basic.yml @@ -1,5 +1,5 @@ --- -"Index data and search on the old cluster": +"Index data and search on the remote cluster": - skip: features: allowed_warnings @@ -152,3 +152,65 @@ - match: { hits.total: 2 } - match: { hits.hits.0._source.filter_field: 1 } - match: { hits.hits.0._index: "test_index" } + +--- +tsdb: + - skip: + version: " - 7.99.99" + reason: introduced in 8.0.0 + + - do: + indices.create: + index: tsdb + body: + settings: + index: + mode: time_series + number_of_replicas: 0 + number_of_shards: 2 + mappings: + properties: + "@timestamp": + type: date + metricset: + type: keyword + time_series_dimension: true + k8s: + properties: + pod: + properties: + uid: + type: keyword + time_series_dimension: true + name: + type: keyword + ip: + type: ip + network: + properties: + tx: + type: long + rx: + type: long + + - do: + bulk: + refresh: true + index: tsdb + body: + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:50:04.467Z", "metricset": "pod", "k8s": {"pod": {"name": "cat", "uid":"947e4ced-1786-4e53-9e0c-5c447e959507", "ip": "10.10.55.1", "network": {"tx": 2001818691, "rx": 802133794}}}}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:50:24.467Z", "metricset": "pod", "k8s": {"pod": {"name": "cat", "uid":"947e4ced-1786-4e53-9e0c-5c447e959507", "ip": "10.10.55.1", "network": {"tx": 2005177954, "rx": 801479970}}}}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:50:44.467Z", "metricset": "pod", "k8s": {"pod": {"name": "cat", "uid":"947e4ced-1786-4e53-9e0c-5c447e959507", "ip": "10.10.55.1", "network": {"tx": 2006223737, "rx": 802337279}}}}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:51:04.467Z", "metricset": "pod", "k8s": {"pod": {"name": "cat", "uid":"947e4ced-1786-4e53-9e0c-5c447e959507", "ip": "10.10.55.2", "network": {"tx": 2012916202, "rx": 803685721}}}}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:50:03.142Z", "metricset": "pod", "k8s": {"pod": {"name": "dog", "uid":"df3145b3-0563-4d3b-a0f7-897eb2876ea9", "ip": "10.10.55.3", "network": {"tx": 1434521831, "rx": 530575198}}}}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:50:23.142Z", "metricset": "pod", "k8s": {"pod": {"name": "dog", "uid":"df3145b3-0563-4d3b-a0f7-897eb2876ea9", "ip": "10.10.55.3", "network": {"tx": 1434577921, "rx": 530600088}}}}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:50:53.142Z", "metricset": "pod", "k8s": {"pod": {"name": "dog", "uid":"df3145b3-0563-4d3b-a0f7-897eb2876ea9", "ip": "10.10.55.3", "network": {"tx": 1434587694, "rx": 530604797}}}}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:51:03.142Z", "metricset": "pod", "k8s": {"pod": {"name": "dog", "uid":"df3145b3-0563-4d3b-a0f7-897eb2876ea9", "ip": "10.10.55.3", "network": {"tx": 1434595272, "rx": 530605511}}}}' From a9e0577e8630db860da77d595ec7af187c6c7503 Mon Sep 17 00:00:00 2001 From: Dimitris Athanasiou Date: Sat, 2 Oct 2021 02:49:19 +0300 Subject: [PATCH 108/250] [ML] Theading parameters for trained model deployments (#78553) * [ML] Theading parameters for trained model deployments This adds two parameters that allow use of multiple threads for inference performed by trained model deployments. The parameters can be set when the start deployment API is called. - inference_threads: each inference request is processed in parallel. Using more threads during inference may decrease latency. - model_threads: the model executes inference requests parallelly. Running inference on multiple requests in parallel may increase throughput. * Explicitly set defaults * Update x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/StartTrainedModelDeploymentAction.java Co-authored-by: Benjamin Trent * Remove unused import Co-authored-by: Benjamin Trent Co-authored-by: Elastic Machine --- .../ml/action/GetDeploymentStatsAction.java | 48 ++++++- .../StartTrainedModelDeploymentAction.java | 128 +++++++++++++++--- ...inedModelAllocationActionRequestTests.java | 4 +- ...GetDeploymentStatsActionResponseTests.java | 6 + ...artTrainedModelDeploymentRequestTests.java | 98 ++++++++++++++ ...TrainedModelDeploymentTaskParamsTests.java | 42 ++++++ .../TrainedModelAllocationTests.java | 4 +- .../ml/job/groups/GroupOrJobLookupTests.java | 3 +- .../xpack/ml/integration/PyTorchModelIT.java | 3 +- .../xpack/ml/MachineLearning.java | 2 +- .../TransportGetDeploymentStatsAction.java | 10 +- ...portStartTrainedModelDeploymentAction.java | 7 +- .../deployment/DeploymentManager.java | 45 +++--- .../ml/inference/deployment/ModelStats.java | 11 +- .../TrainedModelDeploymentTask.java | 4 + .../process/NativePyTorchProcessFactory.java | 29 ++-- .../pytorch/process/PyTorchBuilder.java | 21 +-- .../process/PyTorchProcessFactory.java | 4 +- .../pytorch/process/PyTorchStateStreamer.java | 10 -- ...RestStartTrainedModelDeploymentAction.java | 30 ++-- ...nedModelAllocationClusterServiceTests.java | 2 +- .../TrainedModelAllocationMetadataTests.java | 7 +- ...rainedModelAllocationNodeServiceTests.java | 2 +- .../pytorch/process/PyTorchBuilderTests.java | 59 ++++++++ .../xpack/ml/job/NodeLoadDetectorTests.java | 2 +- 25 files changed, 466 insertions(+), 115 deletions(-) create mode 100644 x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/StartTrainedModelDeploymentRequestTests.java create mode 100644 x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/StartTrainedModelDeploymentTaskParamsTests.java create mode 100644 x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/pytorch/process/PyTorchBuilderTests.java diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetDeploymentStatsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetDeploymentStatsAction.java index 5af44cde8c282..87de2a1338971 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetDeploymentStatsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetDeploymentStatsAction.java @@ -21,6 +21,7 @@ import org.elasticsearch.common.xcontent.ParseField; import org.elasticsearch.common.xcontent.ToXContentObject; import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.core.Nullable; import org.elasticsearch.tasks.Task; import org.elasticsearch.xpack.core.action.util.QueryPage; import org.elasticsearch.xpack.core.ml.inference.allocation.AllocationStatus; @@ -229,16 +230,22 @@ public int hashCode() { private AllocationState state; private AllocationStatus allocationStatus; private String reason; - private final ByteSizeValue modelSize; + @Nullable private final ByteSizeValue modelSize; + @Nullable private final Integer inferenceThreads; + @Nullable private final Integer modelThreads; private final List nodeStats; public AllocationStats( String modelId, - ByteSizeValue modelSize, + @Nullable ByteSizeValue modelSize, + @Nullable Integer inferenceThreads, + @Nullable Integer modelThreads, List nodeStats ) { this.modelId = modelId; this.modelSize = modelSize; + this.inferenceThreads = inferenceThreads; + this.modelThreads = modelThreads; this.nodeStats = nodeStats; this.state = null; this.reason = null; @@ -247,6 +254,8 @@ public AllocationStats( public AllocationStats(StreamInput in) throws IOException { modelId = in.readString(); modelSize = in.readOptionalWriteable(ByteSizeValue::new); + inferenceThreads = in.readOptionalVInt(); + modelThreads = in.readOptionalVInt(); nodeStats = in.readList(NodeStats::new); state = in.readOptionalEnum(AllocationState.class); reason = in.readOptionalString(); @@ -261,6 +270,16 @@ public ByteSizeValue getModelSize() { return modelSize; } + @Nullable + public Integer getInferenceThreads() { + return inferenceThreads; + } + + @Nullable + public Integer getModelThreads() { + return modelThreads; + } + public List getNodeStats() { return nodeStats; } @@ -295,6 +314,12 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws if (modelSize != null) { builder.field("model_size", modelSize); } + if (inferenceThreads != null) { + builder.field(StartTrainedModelDeploymentAction.TaskParams.INFERENCE_THREADS.getPreferredName(), inferenceThreads); + } + if (modelThreads != null) { + builder.field(StartTrainedModelDeploymentAction.TaskParams.MODEL_THREADS.getPreferredName(), modelThreads); + } if (state != null) { builder.field("state", state); } @@ -317,6 +342,8 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws public void writeTo(StreamOutput out) throws IOException { out.writeString(modelId); out.writeOptionalWriteable(modelSize); + out.writeOptionalVInt(inferenceThreads); + out.writeOptionalVInt(modelThreads); out.writeList(nodeStats); out.writeOptionalEnum(state); out.writeOptionalString(reason); @@ -330,6 +357,8 @@ public boolean equals(Object o) { AllocationStats that = (AllocationStats) o; return Objects.equals(modelId, that.modelId) && Objects.equals(modelSize, that.modelSize) && + Objects.equals(inferenceThreads, that.inferenceThreads) && + Objects.equals(modelThreads, that.modelThreads) && Objects.equals(state, that.state) && Objects.equals(reason, that.reason) && Objects.equals(allocationStatus, that.allocationStatus) && @@ -338,7 +367,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(modelId, modelSize, nodeStats, state, reason, allocationStatus); + return Objects.hash(modelId, modelSize, inferenceThreads, modelThreads, nodeStats, state, reason, allocationStatus); } } @@ -448,7 +477,14 @@ public static GetDeploymentStatsAction.Response addFailedRoutes( updatedNodeStats.sort(Comparator.comparing(n -> n.getNode().getId())); updatedAllocationStats.add( - new GetDeploymentStatsAction.Response.AllocationStats(stat.getModelId(), stat.getModelSize(), updatedNodeStats)); + new GetDeploymentStatsAction.Response.AllocationStats( + stat.getModelId(), + stat.getModelSize(), + stat.getInferenceThreads(), + stat.getModelThreads(), + updatedNodeStats + ) + ); } else { updatedAllocationStats.add(stat); } @@ -473,7 +509,9 @@ public static GetDeploymentStatsAction.Response addFailedRoutes( nodeStats.sort(Comparator.comparing(n -> n.getNode().getId())); - updatedAllocationStats.add(new GetDeploymentStatsAction.Response.AllocationStats(modelId, null, nodeStats)); + updatedAllocationStats.add(new GetDeploymentStatsAction.Response.AllocationStats( + modelId, null, null, null, nodeStats) + ); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/StartTrainedModelDeploymentAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/StartTrainedModelDeploymentAction.java index 294d51043ac3b..e3d8d37cbb4ea 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/StartTrainedModelDeploymentAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/StartTrainedModelDeploymentAction.java @@ -19,6 +19,7 @@ import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.common.xcontent.ConstructingObjectParser; +import org.elasticsearch.common.xcontent.ObjectParser; import org.elasticsearch.common.xcontent.ParseField; import org.elasticsearch.common.xcontent.ToXContentObject; import org.elasticsearch.common.xcontent.XContentBuilder; @@ -27,6 +28,7 @@ import org.elasticsearch.tasks.Task; import org.elasticsearch.xpack.core.ml.inference.TrainedModelConfig; import org.elasticsearch.xpack.core.ml.inference.allocation.AllocationStatus; +import org.elasticsearch.xpack.core.ml.job.messages.Messages; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; import org.elasticsearch.xpack.core.ml.utils.MlTaskParams; @@ -56,10 +58,37 @@ public static class Request extends MasterNodeRequest implements ToXCon public static final ParseField MODEL_ID = new ParseField("model_id"); public static final ParseField TIMEOUT = new ParseField("timeout"); public static final ParseField WAIT_FOR = new ParseField("wait_for"); + public static final ParseField INFERENCE_THREADS = TaskParams.INFERENCE_THREADS; + public static final ParseField MODEL_THREADS = TaskParams.MODEL_THREADS; + + public static final ObjectParser PARSER = new ObjectParser<>(NAME, Request::new); + + static { + PARSER.declareString(Request::setModelId, MODEL_ID); + PARSER.declareString((request, val) -> request.setTimeout(TimeValue.parseTimeValue(val, TIMEOUT.getPreferredName())), TIMEOUT); + PARSER.declareString((request, waitFor) -> request.setWaitForState(AllocationStatus.State.fromString(waitFor)), WAIT_FOR); + PARSER.declareInt(Request::setInferenceThreads, INFERENCE_THREADS); + PARSER.declareInt(Request::setModelThreads, MODEL_THREADS); + } + + public static Request parseRequest(String modelId, XContentParser parser) { + Request request = PARSER.apply(parser, null); + if (request.getModelId() == null) { + request.setModelId(modelId); + } else if (Strings.isNullOrEmpty(modelId) == false && modelId.equals(request.getModelId()) == false) { + throw ExceptionsHelper.badRequestException( + Messages.getMessage(Messages.INCONSISTENT_ID, MODEL_ID, request.getModelId(), modelId)); + } + return request; + } private String modelId; private TimeValue timeout = DEFAULT_TIMEOUT; private AllocationStatus.State waitForState = AllocationStatus.State.STARTED; + private int modelThreads = 1; + private int inferenceThreads = 1; + + private Request() {} public Request(String modelId) { setModelId(modelId); @@ -70,6 +99,8 @@ public Request(StreamInput in) throws IOException { modelId = in.readString(); timeout = in.readTimeValue(); waitForState = in.readEnum(AllocationStatus.State.class); + modelThreads = in.readVInt(); + inferenceThreads = in.readVInt(); } public final void setModelId(String modelId) { @@ -97,40 +128,67 @@ public Request setWaitForState(AllocationStatus.State waitForState) { return this; } + public int getModelThreads() { + return modelThreads; + } + + public void setModelThreads(int modelThreads) { + this.modelThreads = modelThreads; + } + + public int getInferenceThreads() { + return inferenceThreads; + } + + public void setInferenceThreads(int inferenceThreads) { + this.inferenceThreads = inferenceThreads; + } + @Override public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); out.writeString(modelId); out.writeTimeValue(timeout); out.writeEnum(waitForState); + out.writeVInt(modelThreads); + out.writeVInt(inferenceThreads); } @Override public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { + builder.startObject(); builder.field(MODEL_ID.getPreferredName(), modelId); builder.field(TIMEOUT.getPreferredName(), timeout.getStringRep()); builder.field(WAIT_FOR.getPreferredName(), waitForState); + builder.field(MODEL_THREADS.getPreferredName(), modelThreads); + builder.field(INFERENCE_THREADS.getPreferredName(), inferenceThreads); + builder.endObject(); return builder; } @Override public ActionRequestValidationException validate() { - if (waitForState.isAnyOf(VALID_WAIT_STATES)) { - return null; - } ActionRequestValidationException validationException = new ActionRequestValidationException(); - validationException.addValidationError( - "invalid [wait_for] state [" - + waitForState - + "]; must be one of [" - + Strings.arrayToCommaDelimitedString(VALID_WAIT_STATES) - ); - return validationException; + if (waitForState.isAnyOf(VALID_WAIT_STATES) == false) { + validationException.addValidationError( + "invalid [wait_for] state [" + + waitForState + + "]; must be one of [" + + Strings.arrayToCommaDelimitedString(VALID_WAIT_STATES) + ); + } + if (modelThreads < 1) { + validationException.addValidationError("[" + MODEL_THREADS + "] must be a positive integer"); + } + if (inferenceThreads < 1) { + validationException.addValidationError("[" + INFERENCE_THREADS + "] must be a positive integer"); + } + return validationException.validationErrors().isEmpty() ? null : validationException; } @Override public int hashCode() { - return Objects.hash(modelId, timeout); + return Objects.hash(modelId, timeout, waitForState, modelThreads, inferenceThreads); } @Override @@ -142,7 +200,11 @@ public boolean equals(Object obj) { return false; } Request other = (Request) obj; - return Objects.equals(modelId, other.modelId) && Objects.equals(timeout, other.timeout); + return Objects.equals(modelId, other.modelId) + && Objects.equals(timeout, other.timeout) + && Objects.equals(waitForState, other.waitForState) + && modelThreads == other.modelThreads + && inferenceThreads == other.inferenceThreads; } @Override @@ -162,14 +224,18 @@ public static boolean mayAllocateToNode(DiscoveryNode node) { public static final Version VERSION_INTRODUCED = Version.V_8_0_0; private static final ParseField MODEL_BYTES = new ParseField("model_bytes"); + public static final ParseField MODEL_THREADS = new ParseField("model_threads"); + public static final ParseField INFERENCE_THREADS = new ParseField("inference_threads"); private static final ConstructingObjectParser PARSER = new ConstructingObjectParser<>( "trained_model_deployment_params", true, - a -> new TaskParams((String)a[0], (Long)a[1]) + a -> new TaskParams((String)a[0], (Long)a[1], (int) a[2], (int) a[3]) ); static { PARSER.declareString(ConstructingObjectParser.constructorArg(), TrainedModelConfig.MODEL_ID); PARSER.declareLong(ConstructingObjectParser.constructorArg(), MODEL_BYTES); + PARSER.declareInt(ConstructingObjectParser.constructorArg(), INFERENCE_THREADS); + PARSER.declareInt(ConstructingObjectParser.constructorArg(), MODEL_THREADS); } public static TaskParams fromXContent(XContentParser parser) { @@ -185,18 +251,30 @@ public static TaskParams fromXContent(XContentParser parser) { private final String modelId; private final long modelBytes; + private final int inferenceThreads; + private final int modelThreads; - public TaskParams(String modelId, long modelBytes) { + public TaskParams(String modelId, long modelBytes, int inferenceThreads, int modelThreads) { this.modelId = Objects.requireNonNull(modelId); this.modelBytes = modelBytes; if (modelBytes < 0) { throw new IllegalArgumentException("modelBytes must be non-negative"); } + this.inferenceThreads = inferenceThreads; + if (inferenceThreads < 1) { + throw new IllegalArgumentException(INFERENCE_THREADS + " must be positive"); + } + this.modelThreads = modelThreads; + if (modelThreads < 1) { + throw new IllegalArgumentException(MODEL_THREADS + " must be positive"); + } } public TaskParams(StreamInput in) throws IOException { this.modelId = in.readString(); this.modelBytes = in.readVLong(); + this.inferenceThreads = in.readVInt(); + this.modelThreads = in.readVInt(); } public String getModelId() { @@ -216,6 +294,8 @@ public Version getMinimalSupportedVersion() { public void writeTo(StreamOutput out) throws IOException { out.writeString(modelId); out.writeVLong(modelBytes); + out.writeVInt(inferenceThreads); + out.writeVInt(modelThreads); } @Override @@ -223,13 +303,15 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws builder.startObject(); builder.field(TrainedModelConfig.MODEL_ID.getPreferredName(), modelId); builder.field(MODEL_BYTES.getPreferredName(), modelBytes); + builder.field(INFERENCE_THREADS.getPreferredName(), inferenceThreads); + builder.field(MODEL_THREADS.getPreferredName(), modelThreads); builder.endObject(); return builder; } @Override public int hashCode() { - return Objects.hash(modelId, modelBytes); + return Objects.hash(modelId, modelBytes, inferenceThreads, modelThreads); } @Override @@ -239,13 +321,27 @@ public boolean equals(Object o) { TaskParams other = (TaskParams) o; return Objects.equals(modelId, other.modelId) - && modelBytes == other.modelBytes; + && modelBytes == other.modelBytes + && inferenceThreads == other.inferenceThreads + && modelThreads == other.modelThreads; } @Override public String getMlId() { return modelId; } + + public long getModelBytes() { + return modelBytes; + } + + public int getInferenceThreads() { + return inferenceThreads; + } + + public int getModelThreads() { + return modelThreads; + } } public interface TaskMatcher { diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/CreateTrainedModelAllocationActionRequestTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/CreateTrainedModelAllocationActionRequestTests.java index 332b0f47816b1..6a6fa0453ff7e 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/CreateTrainedModelAllocationActionRequestTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/CreateTrainedModelAllocationActionRequestTests.java @@ -17,7 +17,9 @@ protected Request createTestInstance() { return new Request( new StartTrainedModelDeploymentAction.TaskParams( randomAlphaOfLength(10), - randomNonNegativeLong() + randomNonNegativeLong(), + randomIntBetween(1, 8), + randomIntBetween(1, 8) ) ); } diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetDeploymentStatsActionResponseTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetDeploymentStatsActionResponseTests.java index da669a320f6d3..a346a55c13b7a 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetDeploymentStatsActionResponseTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetDeploymentStatsActionResponseTests.java @@ -99,6 +99,8 @@ public void testAddFailedRoutes_GivenMixedResponses() throws UnknownHostExceptio var model1 = new GetDeploymentStatsAction.Response.AllocationStats( "model1", ByteSizeValue.ofBytes(randomNonNegativeLong()), + randomBoolean() ? null : randomIntBetween(1, 8), + randomBoolean() ? null : randomIntBetween(1, 8), nodeStatsList); Map> badRoutes = new HashMap<>(); @@ -141,6 +143,8 @@ public void testAddFailedRoutes_TaskResultIsOverwritten() throws UnknownHostExce var model1 = new GetDeploymentStatsAction.Response.AllocationStats( "model1", ByteSizeValue.ofBytes(randomNonNegativeLong()), + randomBoolean() ? null : randomIntBetween(1, 8), + randomBoolean() ? null : randomIntBetween(1, 8), nodeStatsList); var response = new GetDeploymentStatsAction.Response(Collections.emptyList(), Collections.emptyList(), List.of(model1), 1); @@ -196,6 +200,8 @@ node, randomFrom(RoutingState.values()), randomBoolean() ? null : "a good reason return new GetDeploymentStatsAction.Response.AllocationStats( randomAlphaOfLength(5), ByteSizeValue.ofBytes(randomNonNegativeLong()), + randomBoolean() ? null : randomIntBetween(1, 8), + randomBoolean() ? null : randomIntBetween(1, 8), nodeStatsList); } } diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/StartTrainedModelDeploymentRequestTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/StartTrainedModelDeploymentRequestTests.java new file mode 100644 index 0000000000000..545d242d3d69b --- /dev/null +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/StartTrainedModelDeploymentRequestTests.java @@ -0,0 +1,98 @@ +/* + * 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.core.ml.action; + +import org.elasticsearch.action.ActionRequestValidationException; +import org.elasticsearch.common.io.stream.Writeable; +import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.core.TimeValue; +import org.elasticsearch.test.AbstractSerializingTestCase; +import org.elasticsearch.xpack.core.ml.action.StartTrainedModelDeploymentAction.Request; +import org.elasticsearch.xpack.core.ml.inference.allocation.AllocationStatus; + +import java.io.IOException; + +import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.is; +import static org.hamcrest.Matchers.not; +import static org.hamcrest.Matchers.nullValue; + +public class StartTrainedModelDeploymentRequestTests extends AbstractSerializingTestCase { + + @Override + protected Request doParseInstance(XContentParser parser) throws IOException { + return Request.parseRequest(null, parser); + } + + @Override + protected Writeable.Reader instanceReader() { + return Request::new; + } + + @Override + protected Request createTestInstance() { + return createRandom(); + } + + public static Request createRandom() { + Request request = new Request(randomAlphaOfLength(10)); + if (randomBoolean()) { + request.setTimeout(TimeValue.parseTimeValue(randomTimeValue(), Request.TIMEOUT.getPreferredName())); + } + if (randomBoolean()) { + request.setWaitForState(randomFrom(AllocationStatus.State.values())); + } + if (randomBoolean()) { + request.setInferenceThreads(randomIntBetween(1, 8)); + } + if (randomBoolean()) { + request.setModelThreads(randomIntBetween(1, 8)); + } + return request; + } + + public void testValidate_GivenInferenceThreadsIsZero() { + Request request = createRandom(); + request.setInferenceThreads(0); + + ActionRequestValidationException e = request.validate(); + + assertThat(e, is(not(nullValue()))); + assertThat(e.getMessage(), containsString("[inference_threads] must be a positive integer")); + } + + public void testValidate_GivenInferenceThreadsIsNegative() { + Request request = createRandom(); + request.setInferenceThreads(randomIntBetween(-100, -1)); + + ActionRequestValidationException e = request.validate(); + + assertThat(e, is(not(nullValue()))); + assertThat(e.getMessage(), containsString("[inference_threads] must be a positive integer")); + } + + public void testValidate_GivenModelThreadsIsZero() { + Request request = createRandom(); + request.setModelThreads(0); + + ActionRequestValidationException e = request.validate(); + + assertThat(e, is(not(nullValue()))); + assertThat(e.getMessage(), containsString("[model_threads] must be a positive integer")); + } + + public void testValidate_GivenModelThreadsIsNegative() { + Request request = createRandom(); + request.setModelThreads(randomIntBetween(-100, -1)); + + ActionRequestValidationException e = request.validate(); + + assertThat(e, is(not(nullValue()))); + assertThat(e.getMessage(), containsString("[model_threads] must be a positive integer")); + } +} diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/StartTrainedModelDeploymentTaskParamsTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/StartTrainedModelDeploymentTaskParamsTests.java new file mode 100644 index 0000000000000..6781ce5ab23a6 --- /dev/null +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/StartTrainedModelDeploymentTaskParamsTests.java @@ -0,0 +1,42 @@ +/* + * 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.core.ml.action; + +import org.elasticsearch.common.io.stream.Writeable; +import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.test.AbstractSerializingTestCase; +import org.elasticsearch.xpack.core.ml.action.StartTrainedModelDeploymentAction.TaskParams; + +import java.io.IOException; + +public class StartTrainedModelDeploymentTaskParamsTests extends AbstractSerializingTestCase { + + @Override + protected TaskParams doParseInstance(XContentParser parser) throws IOException { + return TaskParams.fromXContent(parser); + } + + @Override + protected Writeable.Reader instanceReader() { + return TaskParams::new; + } + + @Override + protected TaskParams createTestInstance() { + return createRandom(); + } + + public static StartTrainedModelDeploymentAction.TaskParams createRandom() { + return new TaskParams( + randomAlphaOfLength(10), + randomNonNegativeLong(), + randomIntBetween(1, 8), + randomIntBetween(1, 8) + ); + } +} diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/allocation/TrainedModelAllocationTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/allocation/TrainedModelAllocationTests.java index f572b03472108..2b559d7d512f4 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/allocation/TrainedModelAllocationTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/allocation/TrainedModelAllocationTests.java @@ -32,7 +32,7 @@ public class TrainedModelAllocationTests extends AbstractSerializingTestCase nodes = Stream.generate(() -> randomAlphaOfLength(10)).limit(randomInt(5)).collect(Collectors.toList()); for (String node : nodes) { @@ -249,7 +249,7 @@ private static DiscoveryNode buildNode() { } private static StartTrainedModelDeploymentAction.TaskParams randomParams() { - return new StartTrainedModelDeploymentAction.TaskParams(randomAlphaOfLength(10), randomNonNegativeLong()); + return new StartTrainedModelDeploymentAction.TaskParams(randomAlphaOfLength(10), randomNonNegativeLong(), 1, 1); } private static void assertUnchanged( diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/groups/GroupOrJobLookupTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/groups/GroupOrJobLookupTests.java index f329fe041466a..37f0805d81d08 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/groups/GroupOrJobLookupTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/groups/GroupOrJobLookupTests.java @@ -10,16 +10,15 @@ import org.elasticsearch.ResourceNotFoundException; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.ml.job.config.Job; -import org.elasticsearch.xpack.core.ml.job.groups.GroupOrJobLookup; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; +import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.contains; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/PyTorchModelIT.java b/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/PyTorchModelIT.java index ba92fc414f148..dcef48a4b3745 100644 --- a/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/PyTorchModelIT.java +++ b/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/PyTorchModelIT.java @@ -430,7 +430,8 @@ private Response startDeployment(String modelId) throws IOException { } private Response startDeployment(String modelId, String waitForState) throws IOException { - Request request = new Request("POST", "/_ml/trained_models/" + modelId + "/deployment/_start?timeout=40s&wait_for=" + waitForState); + Request request = new Request("POST", "/_ml/trained_models/" + modelId + + "/deployment/_start?timeout=40s&wait_for=" + waitForState + "&inference_threads=1&model_threads=1"); return client().performRequest(request); } diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/MachineLearning.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/MachineLearning.java index 65fb6c6d60041..fa36eb5a3b425 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/MachineLearning.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/MachineLearning.java @@ -826,7 +826,7 @@ public Collection createComponents(Client client, ClusterService cluster normalizerProcessFactory = (jobId, quantilesState, bucketSpan, executorService) -> new MultiplyingNormalizerProcess(1.0); analyticsProcessFactory = (jobId, analyticsProcessConfig, hasState, executorService, onProcessCrash) -> null; memoryEstimationProcessFactory = (jobId, analyticsProcessConfig, hasState, executorService, onProcessCrash) -> null; - pyTorchProcessFactory = (jobId, executorService, onProcessCrash) -> null; + pyTorchProcessFactory = (task, executorService, onProcessCrash) -> null; } NormalizerFactory normalizerFactory = new NormalizerFactory(normalizerProcessFactory, threadPool.executor(MachineLearning.UTILITY_THREAD_POOL_NAME)); diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportGetDeploymentStatsAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportGetDeploymentStatsAction.java index e65cacd0a563e..d267ed8082e49 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportGetDeploymentStatsAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportGetDeploymentStatsAction.java @@ -17,6 +17,7 @@ import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.Strings; import org.elasticsearch.common.inject.Inject; +import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.tasks.Task; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.TransportService; @@ -179,7 +180,12 @@ protected void taskOperation(GetDeploymentStatsAction.Request request, TrainedMo RoutingState.STOPPED, "")); } - var modelSize = stats.map(ModelStats::getModelSize).orElse(null); - listener.onResponse(new GetDeploymentStatsAction.Response.AllocationStats(task.getModelId(), modelSize, nodeStats)); + listener.onResponse(new GetDeploymentStatsAction.Response.AllocationStats( + task.getModelId(), + ByteSizeValue.ofBytes(task.getParams().getModelBytes()), + task.getParams().getInferenceThreads(), + task.getParams().getModelThreads(), + nodeStats) + ); } } diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportStartTrainedModelDeploymentAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportStartTrainedModelDeploymentAction.java index d437169a076e2..de0bcf8c6f9f0 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportStartTrainedModelDeploymentAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportStartTrainedModelDeploymentAction.java @@ -156,7 +156,12 @@ protected void masterOperation(Task task, StartTrainedModelDeploymentAction.Requ getModelBytes(trainedModelConfig, ActionListener.wrap( modelBytes -> { - TaskParams taskParams = new TaskParams(trainedModelConfig.getModelId(), modelBytes); + TaskParams taskParams = new TaskParams( + trainedModelConfig.getModelId(), + modelBytes, + request.getInferenceThreads(), + request.getModelThreads() + ); PersistentTasksCustomMetadata persistentTasks = clusterService.state().getMetadata().custom( PersistentTasksCustomMetadata.TYPE); memoryTracker.refresh(persistentTasks, ActionListener.wrap( diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/deployment/DeploymentManager.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/deployment/DeploymentManager.java index f05e134434ea2..5cd6906464984 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/deployment/DeploymentManager.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/deployment/DeploymentManager.java @@ -93,15 +93,14 @@ public Optional getStats(TrainedModelDeploymentTask task) { return Optional.ofNullable(processContextByAllocation.get(task.getId())) .map(processContext -> new ModelStats(processContext.resultProcessor.getTimingStats(), - processContext.resultProcessor.getLastUsed(), - (long)processContext.getModelSizeBytes()) + processContext.resultProcessor.getLastUsed()) ); } private void doStartDeployment(TrainedModelDeploymentTask task, ActionListener finalListener) { logger.debug("[{}] Starting model deployment", task.getModelId()); - ProcessContext processContext = new ProcessContext(task.getModelId(), executorServiceForProcess, task.getId()); + ProcessContext processContext = new ProcessContext(task, executorServiceForProcess); if (processContextByAllocation.putIfAbsent(task.getId(), processContext) != null) { finalListener.onFailure(ExceptionsHelper.serverError("[{}] Could not create process as one already exists", task.getModelId())); @@ -259,7 +258,7 @@ protected void doRun() { listener ); } catch (IOException e) { - logger.error(new ParameterizedMessage("[{}] error writing to process", processContext.modelId), e); + logger.error(new ParameterizedMessage("[{}] error writing to process", processContext.task.getModelId()), e); onFailure(ExceptionsHelper.serverError("error writing to process", e)); } catch (Exception e) { onFailure(e); @@ -296,9 +295,11 @@ private void waitForResult(ProcessContext processContext, return; } - logger.debug(() -> new ParameterizedMessage("[{}] retrieved result for request [{}]", processContext.modelId, requestId)); + logger.debug(() -> new ParameterizedMessage( + "[{}] retrieved result for request [{}]", processContext.task.getModelId(), requestId)); InferenceResults results = inferenceResultsProcessor.processResult(tokenization, pyTorchResult); - logger.debug(() -> new ParameterizedMessage("[{}] processed result for request [{}]", processContext.modelId, requestId)); + logger.debug(() -> new ParameterizedMessage( + "[{}] processed result for request [{}]", processContext.task.getModelId(), requestId)); listener.onResponse(results); } catch (InterruptedException e) { listener.onFailure(e); @@ -307,33 +308,21 @@ private void waitForResult(ProcessContext processContext, class ProcessContext { - private final String modelId; - private final long taskId; + private final TrainedModelDeploymentTask task; private final SetOnce process = new SetOnce<>(); private final SetOnce nlpTaskProcessor = new SetOnce<>(); private final SetOnce modelInput = new SetOnce<>(); private final PyTorchResultProcessor resultProcessor; private final PyTorchStateStreamer stateStreamer; - ProcessContext(String modelId, ExecutorService executorService, long taskId) { - this.modelId = Objects.requireNonNull(modelId); - resultProcessor = new PyTorchResultProcessor(modelId); + ProcessContext(TrainedModelDeploymentTask task, ExecutorService executorService) { + this.task = Objects.requireNonNull(task); + resultProcessor = new PyTorchResultProcessor(task.getModelId()); this.stateStreamer = new PyTorchStateStreamer(client, executorService, xContentRegistry); - this.taskId = taskId; - } - - /** - * A value of -1 means the size is unknown. Most likely - * because the model has not been loaded yet or the load - * failed. - * @return size in bytes or -1 - */ - int getModelSizeBytes() { - return stateStreamer.getModelSize(); } synchronized void startProcess() { - process.set(pyTorchProcessFactory.createProcess(modelId, executorServiceForProcess, onProcessCrash())); + process.set(pyTorchProcessFactory.createProcess(task, executorServiceForProcess, onProcessCrash())); } synchronized void stopProcess() { @@ -344,22 +333,22 @@ synchronized void stopProcess() { try { stateStreamer.cancel(); process.get().kill(true); - processContextByAllocation.remove(taskId); + processContextByAllocation.remove(task.getId()); } catch (IOException e) { - logger.error(new ParameterizedMessage("[{}] Failed to kill process", modelId), e); + logger.error(new ParameterizedMessage("[{}] Failed to kill process", task.getModelId()), e); } } private Consumer onProcessCrash() { return reason -> { - logger.error("[{}] process crashed due to reason [{}]", modelId, reason); - processContextByAllocation.remove(taskId); + logger.error("[{}] process crashed due to reason [{}]", task.getModelId(), reason); + processContextByAllocation.remove(task.getId()); }; } void loadModel(TrainedModelLocation modelLocation, ActionListener listener) { if (modelLocation instanceof IndexLocation) { - process.get().loadModel(modelId, ((IndexLocation) modelLocation).getIndexName(), stateStreamer, listener); + process.get().loadModel(task.getModelId(), ((IndexLocation) modelLocation).getIndexName(), stateStreamer, listener); } else { throw new IllegalStateException("unsupported trained model location [" + modelLocation.getClass().getSimpleName() + "]"); } diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/deployment/ModelStats.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/deployment/ModelStats.java index 0a349727ddace..4cc43d5afc50e 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/deployment/ModelStats.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/deployment/ModelStats.java @@ -7,9 +7,6 @@ package org.elasticsearch.xpack.ml.inference.deployment; -import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.core.Nullable; - import java.time.Instant; import java.util.LongSummaryStatistics; @@ -17,12 +14,10 @@ public class ModelStats { private final LongSummaryStatistics timingStats; private final Instant lastUsed; - private final ByteSizeValue modelSize; - ModelStats(LongSummaryStatistics timingStats, Instant lastUsed, @Nullable Long modelSizeBytes) { + ModelStats(LongSummaryStatistics timingStats, Instant lastUsed) { this.timingStats = timingStats; this.lastUsed = lastUsed; - this.modelSize = modelSizeBytes == null ? null : ByteSizeValue.ofBytes(modelSizeBytes); } public LongSummaryStatistics getTimingStats() { @@ -32,8 +27,4 @@ public LongSummaryStatistics getTimingStats() { public Instant getLastUsed() { return lastUsed; } - - public ByteSizeValue getModelSize() { - return modelSize; - } } diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/deployment/TrainedModelDeploymentTask.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/deployment/TrainedModelDeploymentTask.java index 60cde1bb204cf..2ebbacfbbda88 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/deployment/TrainedModelDeploymentTask.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/deployment/TrainedModelDeploymentTask.java @@ -65,6 +65,10 @@ public long estimateMemoryUsageBytes() { return params.estimateMemoryUsageBytes(); } + public TaskParams getParams() { + return params; + } + public void stop(String reason) { logger.debug("[{}] Stopping due to reason [{}]", getModelId(), reason); stopped = true; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/pytorch/process/NativePyTorchProcessFactory.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/pytorch/process/NativePyTorchProcessFactory.java index ec5c1887822f2..fb99cbe53a0dc 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/pytorch/process/NativePyTorchProcessFactory.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/pytorch/process/NativePyTorchProcessFactory.java @@ -10,21 +10,20 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.elasticsearch.cluster.service.ClusterService; -import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.concurrent.EsRejectedExecutionException; +import org.elasticsearch.core.TimeValue; import org.elasticsearch.core.internal.io.IOUtils; import org.elasticsearch.env.Environment; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; import org.elasticsearch.xpack.ml.MachineLearning; +import org.elasticsearch.xpack.ml.inference.deployment.TrainedModelDeploymentTask; import org.elasticsearch.xpack.ml.process.NativeController; import org.elasticsearch.xpack.ml.process.ProcessPipes; import org.elasticsearch.xpack.ml.utils.NamedPipeHelper; import java.io.IOException; -import java.nio.file.Path; import java.time.Duration; -import java.util.ArrayList; -import java.util.List; +import java.util.Collections; import java.util.Objects; import java.util.concurrent.ExecutorService; import java.util.function.Consumer; @@ -56,14 +55,14 @@ void setProcessConnectTimeout(TimeValue processConnectTimeout) { } @Override - public NativePyTorchProcess createProcess(String modelId, ExecutorService executorService, Consumer onProcessCrash) { - List filesToDelete = new ArrayList<>(); + public NativePyTorchProcess createProcess(TrainedModelDeploymentTask task, ExecutorService executorService, + Consumer onProcessCrash) { ProcessPipes processPipes = new ProcessPipes( env, NAMED_PIPE_HELPER, processConnectTimeout, PyTorchBuilder.PROCESS_NAME, - modelId, + task.getModelId(), null, false, true, @@ -72,14 +71,15 @@ public NativePyTorchProcess createProcess(String modelId, ExecutorService execut false ); - executeProcess(processPipes, filesToDelete); + executeProcess(processPipes, task); - NativePyTorchProcess process = new NativePyTorchProcess(modelId, nativeController, processPipes, 0, filesToDelete, onProcessCrash); + NativePyTorchProcess process = new NativePyTorchProcess(task.getModelId(), nativeController, processPipes, 0, + Collections.emptyList(), onProcessCrash); try { process.start(executorService); } catch(IOException | EsRejectedExecutionException e) { - String msg = "Failed to connect to pytorch process for job " + modelId; + String msg = "Failed to connect to pytorch process for job " + task.getModelId(); logger.error(msg); try { IOUtils.close(process); @@ -91,8 +91,13 @@ public NativePyTorchProcess createProcess(String modelId, ExecutorService execut return process; } - private void executeProcess(ProcessPipes processPipes, List filesToDelete) { - PyTorchBuilder pyTorchBuilder = new PyTorchBuilder(env::tmpFile, nativeController, processPipes, filesToDelete); + private void executeProcess(ProcessPipes processPipes, TrainedModelDeploymentTask task) { + PyTorchBuilder pyTorchBuilder = new PyTorchBuilder( + nativeController, + processPipes, + task.getParams().getInferenceThreads(), + task.getParams().getModelThreads() + ); try { pyTorchBuilder.build(); } catch (InterruptedException e) { diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/pytorch/process/PyTorchBuilder.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/pytorch/process/PyTorchBuilder.java index 418ebc44dd1a8..4bf4926116d76 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/pytorch/process/PyTorchBuilder.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/pytorch/process/PyTorchBuilder.java @@ -11,11 +11,9 @@ import org.elasticsearch.xpack.ml.process.ProcessPipes; import java.io.IOException; -import java.nio.file.Path; import java.util.ArrayList; import java.util.List; import java.util.Objects; -import java.util.function.Supplier; public class PyTorchBuilder { @@ -23,18 +21,22 @@ public class PyTorchBuilder { private static final String PROCESS_PATH = "./" + PROCESS_NAME; private static final String LICENSE_KEY_VALIDATED_ARG = "--validElasticLicenseKeyConfirmed="; + private static final String INFERENCE_THREADS_ARG = "--inferenceThreads="; + private static final String MODEL_THREADS_ARG = "--modelThreads="; - private final Supplier tempDirPathSupplier; private final NativeController nativeController; private final ProcessPipes processPipes; - private final List filesToDelete; + private final int inferenceThreads; + private final int modelThreads; - public PyTorchBuilder(Supplier tempDirPathSupplier, NativeController nativeController, ProcessPipes processPipes, - List filesToDelete) { - this.tempDirPathSupplier = Objects.requireNonNull(tempDirPathSupplier); + public PyTorchBuilder(NativeController nativeController, + ProcessPipes processPipes, + int inferenceThreads, + int modelThreads) { this.nativeController = Objects.requireNonNull(nativeController); this.processPipes = Objects.requireNonNull(processPipes); - this.filesToDelete = Objects.requireNonNull(filesToDelete); + this.inferenceThreads = inferenceThreads; + this.modelThreads = modelThreads; } public void build() throws IOException, InterruptedException { @@ -50,6 +52,9 @@ private List buildCommand() { // License was validated when the trained model was started command.add(LICENSE_KEY_VALIDATED_ARG + true); + command.add(INFERENCE_THREADS_ARG + inferenceThreads); + command.add(MODEL_THREADS_ARG + modelThreads); + return command; } } diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/pytorch/process/PyTorchProcessFactory.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/pytorch/process/PyTorchProcessFactory.java index 0bf9b206be103..9cc2bb8e3100d 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/pytorch/process/PyTorchProcessFactory.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/pytorch/process/PyTorchProcessFactory.java @@ -7,10 +7,12 @@ package org.elasticsearch.xpack.ml.inference.pytorch.process; +import org.elasticsearch.xpack.ml.inference.deployment.TrainedModelDeploymentTask; + import java.util.concurrent.ExecutorService; import java.util.function.Consumer; public interface PyTorchProcessFactory { - NativePyTorchProcess createProcess(String modelId, ExecutorService executorService, Consumer onProcessCrash); + NativePyTorchProcess createProcess(TrainedModelDeploymentTask task, ExecutorService executorService, Consumer onProcessCrash); } diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/pytorch/process/PyTorchStateStreamer.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/pytorch/process/PyTorchStateStreamer.java index 3328b423dea30..70632d75ad8fd 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/pytorch/process/PyTorchStateStreamer.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/pytorch/process/PyTorchStateStreamer.java @@ -55,16 +55,6 @@ public void cancel() { isCancelled = true; } - /** - * The size of the streamed model in bytes. - * A return value of -1 means the model has not been streamed yet - * and the size is unknown. - * @return The model size in bytes or -1 if not known yet. - */ - public int getModelSize() { - return modelSize; - } - /** * First writes the size of the model so the native process can * allocated memory then writes the chunks of binary state. diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/inference/RestStartTrainedModelDeploymentAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/inference/RestStartTrainedModelDeploymentAction.java index b9b1352c27d22..6fa6405b461b0 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/inference/RestStartTrainedModelDeploymentAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/inference/RestStartTrainedModelDeploymentAction.java @@ -21,6 +21,10 @@ import java.util.List; import static org.elasticsearch.rest.RestRequest.Method.POST; +import static org.elasticsearch.xpack.core.ml.action.StartTrainedModelDeploymentAction.Request.INFERENCE_THREADS; +import static org.elasticsearch.xpack.core.ml.action.StartTrainedModelDeploymentAction.Request.MODEL_THREADS; +import static org.elasticsearch.xpack.core.ml.action.StartTrainedModelDeploymentAction.Request.TIMEOUT; +import static org.elasticsearch.xpack.core.ml.action.StartTrainedModelDeploymentAction.Request.WAIT_FOR; public class RestStartTrainedModelDeploymentAction extends BaseRestHandler { @@ -40,18 +44,22 @@ public List routes() { @Override protected RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient client) throws IOException { String modelId = restRequest.param(StartTrainedModelDeploymentAction.Request.MODEL_ID.getPreferredName()); - StartTrainedModelDeploymentAction.Request request = new StartTrainedModelDeploymentAction.Request(modelId); - if (restRequest.hasParam(StartTrainedModelDeploymentAction.Request.TIMEOUT.getPreferredName())) { - TimeValue openTimeout = restRequest.paramAsTime(StartTrainedModelDeploymentAction.Request.TIMEOUT.getPreferredName(), - StartTrainedModelDeploymentAction.DEFAULT_TIMEOUT); - request.setTimeout(openTimeout); + StartTrainedModelDeploymentAction.Request request; + if (restRequest.hasContentOrSourceParam()) { + request = StartTrainedModelDeploymentAction.Request.parseRequest(modelId, restRequest.contentOrSourceParamParser()); + } else { + request = new StartTrainedModelDeploymentAction.Request(modelId); + if (restRequest.hasParam(TIMEOUT.getPreferredName())) { + TimeValue openTimeout = restRequest.paramAsTime(TIMEOUT.getPreferredName(), + StartTrainedModelDeploymentAction.DEFAULT_TIMEOUT); + request.setTimeout(openTimeout); + } + request.setWaitForState(AllocationStatus.State.fromString( + restRequest.param(WAIT_FOR.getPreferredName(), AllocationStatus.State.STARTED.toString()) + )); + request.setInferenceThreads(restRequest.paramAsInt(INFERENCE_THREADS.getPreferredName(), request.getInferenceThreads())); + request.setModelThreads(restRequest.paramAsInt(MODEL_THREADS.getPreferredName(), request.getModelThreads())); } - request.setWaitForState(AllocationStatus.State.fromString( - restRequest.param( - StartTrainedModelDeploymentAction.Request.WAIT_FOR.getPreferredName(), - AllocationStatus.State.STARTED.toString() - ) - )); return channel -> client.execute(StartTrainedModelDeploymentAction.INSTANCE, request, new RestToXContentListener<>(channel)); } diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/allocation/TrainedModelAllocationClusterServiceTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/allocation/TrainedModelAllocationClusterServiceTests.java index e332b3bcb6b71..3ab9bd58140d8 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/allocation/TrainedModelAllocationClusterServiceTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/allocation/TrainedModelAllocationClusterServiceTests.java @@ -883,7 +883,7 @@ private static DiscoveryNode buildOldNode(String name, boolean isML, long native } private static StartTrainedModelDeploymentAction.TaskParams newParams(String modelId, long modelSize) { - return new StartTrainedModelDeploymentAction.TaskParams(modelId, modelSize); + return new StartTrainedModelDeploymentAction.TaskParams(modelId, modelSize, 1, 1); } private static void assertNodeState(TrainedModelAllocationMetadata metadata, String modelId, String nodeId, RoutingState routingState) { diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/allocation/TrainedModelAllocationMetadataTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/allocation/TrainedModelAllocationMetadataTests.java index 671f79e408588..3b6bbc0a4fbdd 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/allocation/TrainedModelAllocationMetadataTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/allocation/TrainedModelAllocationMetadataTests.java @@ -95,7 +95,12 @@ private static TrainedModelAllocationMetadata.Builder assertUnchanged( } private static StartTrainedModelDeploymentAction.TaskParams randomParams(String modelId) { - return new StartTrainedModelDeploymentAction.TaskParams(modelId, randomNonNegativeLong()); + return new StartTrainedModelDeploymentAction.TaskParams( + modelId, + randomNonNegativeLong(), + randomIntBetween(1, 8), + randomIntBetween(1, 8) + ); } } diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/allocation/TrainedModelAllocationNodeServiceTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/allocation/TrainedModelAllocationNodeServiceTests.java index e3b0aa848184e..d95198bbcd824 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/allocation/TrainedModelAllocationNodeServiceTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/allocation/TrainedModelAllocationNodeServiceTests.java @@ -426,7 +426,7 @@ private void withLoadFailure(String modelId) { } private static StartTrainedModelDeploymentAction.TaskParams newParams(String modelId) { - return new StartTrainedModelDeploymentAction.TaskParams(modelId, randomNonNegativeLong()); + return new StartTrainedModelDeploymentAction.TaskParams(modelId, randomNonNegativeLong(), 1, 1); } private TrainedModelAllocationNodeService createService() { diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/pytorch/process/PyTorchBuilderTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/pytorch/process/PyTorchBuilderTests.java new file mode 100644 index 0000000000000..a36437d097329 --- /dev/null +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/pytorch/process/PyTorchBuilderTests.java @@ -0,0 +1,59 @@ +/* + * 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.ml.inference.pytorch.process; + +import org.elasticsearch.test.ESTestCase; +import org.elasticsearch.xpack.ml.process.NativeController; +import org.elasticsearch.xpack.ml.process.ProcessPipes; +import org.junit.Before; +import org.mockito.ArgumentCaptor; + +import java.io.IOException; +import java.util.List; + +import static org.hamcrest.Matchers.contains; +import static org.mockito.Matchers.any; +import static org.mockito.Mockito.doAnswer; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; + +public class PyTorchBuilderTests extends ESTestCase { + + private static final String PROCESS_PIPES_ARG = "--process_pipes_test_arg"; + + private NativeController nativeController; + private ProcessPipes processPipes; + private ArgumentCaptor> commandCaptor; + + @SuppressWarnings("unchecked") + @Before + public void setUpMocks() { + nativeController = mock(NativeController.class); + processPipes = mock(ProcessPipes.class); + commandCaptor = ArgumentCaptor.forClass((Class) List.class); + doAnswer(invocationOnMock -> { + List command = (List) invocationOnMock.getArguments()[0]; + command.add(PROCESS_PIPES_ARG); + return null; + }).when(processPipes).addArgs(any()); + } + + public void testBuild() throws IOException, InterruptedException { + new PyTorchBuilder(nativeController, processPipes, 2, 4).build(); + + verify(nativeController).startProcess(commandCaptor.capture()); + + assertThat(commandCaptor.getValue(), contains( + "./pytorch_inference", + "--validElasticLicenseKeyConfirmed=true", + "--inferenceThreads=2", + "--modelThreads=4", + PROCESS_PIPES_ARG) + ); + } +} diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/NodeLoadDetectorTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/NodeLoadDetectorTests.java index fb6f0d0120c42..14918f96aee2a 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/NodeLoadDetectorTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/NodeLoadDetectorTests.java @@ -91,7 +91,7 @@ public void testNodeLoadDetection() { .addNewAllocation( "model1", TrainedModelAllocation.Builder - .empty(new StartTrainedModelDeploymentAction.TaskParams("model1", MODEL_MEMORY_REQUIREMENT)) + .empty(new StartTrainedModelDeploymentAction.TaskParams("model1", MODEL_MEMORY_REQUIREMENT, 1, 1)) .addNewRoutingEntry("_node_id4") .addNewFailedRoutingEntry("_node_id2", "test") .addNewRoutingEntry("_node_id1") From e18e4b8bd0a64e6b0531fd00c44237550ff4eb9b Mon Sep 17 00:00:00 2001 From: Igor Motov Date: Fri, 1 Oct 2021 18:03:23 -1000 Subject: [PATCH 109/250] Fixes testCancellationDuringAggregation test (#78585) The SearchCancellationIT#testCancellationDuringAggregation only works when real reduce takes place and therefore needs at least 2 shards to be present. Relates to #71021 --- .../java/org/elasticsearch/search/SearchCancellationIT.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/SearchCancellationIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/SearchCancellationIT.java index ba4f9249affd3..30f74d71099dd 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/SearchCancellationIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/SearchCancellationIT.java @@ -192,6 +192,12 @@ public void testCancellationDuringFetchPhase() throws Exception { public void testCancellationDuringAggregation() throws Exception { List plugins = initBlockFactory(); + // This test is only meaningful with at least 2 shards to trigger reduce + int numberOfShards = between(2, 5); + createIndex("test", Settings.builder() + .put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, numberOfShards) + .put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0) + .build()); indexTestData(); logger.info("Executing search"); From 5d6739e9b3aa8bb155cb702cd1a9062b760efe1d Mon Sep 17 00:00:00 2001 From: Armin Braun Date: Sun, 3 Oct 2021 14:01:51 +0200 Subject: [PATCH 110/250] Fix Snapshot Getting Stuck if Snapshot Queued after Delete has Shard in State MISSING (#78587) It's in the title. If we reassign a shard to `MISSING` then we must keep assigning tasks for that shard in the case of clones and/or keep marking those shards `MISSING` on subsequent snapshots as well. --- .../snapshots/ConcurrentSnapshotsIT.java | 114 ++++++++++++++++++ .../snapshots/SnapshotsService.java | 4 +- 2 files changed, 117 insertions(+), 1 deletion(-) diff --git a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/ConcurrentSnapshotsIT.java b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/ConcurrentSnapshotsIT.java index 0f53857357834..ed570d8764b85 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/ConcurrentSnapshotsIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/ConcurrentSnapshotsIT.java @@ -1833,6 +1833,120 @@ public void testOutOfOrderFinalizationManySnapshots() throws Exception { ); } + public void testCloneQueuedAfterMissingShard() throws Exception { + final String master = internalCluster().startMasterOnlyNode(); + final List dataNodes = internalCluster().startDataOnlyNodes(2); + final String index1 = "index-1"; + final String index2 = "index-2"; + createIndexWithContent(index1, dataNodes.get(0), dataNodes.get(1)); + createIndexWithContent(index2, dataNodes.get(1), dataNodes.get(0)); + + final String repository = "test-repo"; + createRepository(repository, "mock"); + final String snapshotToDelete = "snapshot-to-delete"; + createFullSnapshot(repository, snapshotToDelete); + final String cloneSource = "source-snapshot"; + createFullSnapshot(repository, cloneSource); + + internalCluster().stopNode(dataNodes.get(0)); + + blockMasterOnWriteIndexFile(repository); + final ActionFuture deleteFuture = clusterAdmin().prepareDeleteSnapshot(repository, snapshotToDelete) + .execute(); + awaitNDeletionsInProgress(1); + + final ActionFuture snapshot1 = startFullSnapshot(repository, "snapshot-1", true); + awaitNumberOfSnapshotsInProgress(1); + + final ActionFuture cloneFuture = clusterAdmin().prepareCloneSnapshot( + repository, + cloneSource, + "target-snapshot" + ).setIndices(index1).execute(); + awaitNumberOfSnapshotsInProgress(2); + + unblockNode(repository, master); + assertAcked(deleteFuture.get()); + assertAcked(cloneFuture.get()); + awaitNoMoreRunningOperations(); + assertThat(snapshot1.get().getSnapshotInfo().state(), is(SnapshotState.PARTIAL)); + } + + public void testSnapshotQueuedAfterMissingShard() throws Exception { + final String master = internalCluster().startMasterOnlyNode(); + final List dataNodes = internalCluster().startDataOnlyNodes(2); + final String index1 = "index-1"; + final String index2 = "index-2"; + createIndexWithContent(index1, dataNodes.get(0), dataNodes.get(1)); + createIndexWithContent(index2, dataNodes.get(1), dataNodes.get(0)); + + final String repository = "test-repo"; + createRepository(repository, "mock"); + final String snapshotToDelete = "snapshot-to-delete"; + createFullSnapshot(repository, snapshotToDelete); + + internalCluster().stopNode(dataNodes.get(0)); + + blockMasterOnWriteIndexFile(repository); + final ActionFuture deleteFuture = startDeleteSnapshot(repository, snapshotToDelete); + awaitNDeletionsInProgress(1); + + final ActionFuture snapshot1 = startFullSnapshot(repository, "snapshot-1", true); + awaitNumberOfSnapshotsInProgress(1); + + final ActionFuture snapshot2 = startFullSnapshot(repository, "snapshot-2", true); + awaitNumberOfSnapshotsInProgress(2); + + unblockNode(repository, master); + assertAcked(deleteFuture.get()); + awaitNoMoreRunningOperations(); + assertThat(snapshot1.get().getSnapshotInfo().state(), is(SnapshotState.PARTIAL)); + assertThat(snapshot2.get().getSnapshotInfo().state(), is(SnapshotState.PARTIAL)); + } + + public void testSnapshotAndCloneQueuedAfterMissingShard() throws Exception { + final String master = internalCluster().startMasterOnlyNode(); + final List dataNodes = internalCluster().startDataOnlyNodes(2); + final String index1 = "index-1"; + final String index2 = "index-2"; + createIndexWithContent(index1, dataNodes.get(0), dataNodes.get(1)); + createIndexWithContent(index2, dataNodes.get(1), dataNodes.get(0)); + + final String repository = "test-repo"; + createRepository(repository, "mock"); + final String snapshotToDelete = "snapshot-to-delete"; + createFullSnapshot(repository, snapshotToDelete); + final String cloneSource = "source-snapshot"; + createFullSnapshot(repository, cloneSource); + + internalCluster().stopNode(dataNodes.get(0)); + + blockMasterOnWriteIndexFile(repository); + final ActionFuture deleteFuture = clusterAdmin().prepareDeleteSnapshot(repository, snapshotToDelete) + .execute(); + awaitNDeletionsInProgress(1); + + final ActionFuture snapshot1 = startFullSnapshot(repository, "snapshot-1", true); + awaitNumberOfSnapshotsInProgress(1); + + final ActionFuture snapshot2 = startFullSnapshot(repository, "snapshot-2", true); + awaitNumberOfSnapshotsInProgress(2); + + final ActionFuture cloneFuture = clusterAdmin().prepareCloneSnapshot( + repository, + cloneSource, + "target-snapshot" + ).setIndices(index1).execute(); + awaitNumberOfSnapshotsInProgress(3); + + unblockNode(repository, master); + assertAcked(deleteFuture.get()); + assertAcked(cloneFuture.get()); + awaitNoMoreRunningOperations(); + assertThat(snapshot1.get().getSnapshotInfo().state(), is(SnapshotState.PARTIAL)); + assertThat(snapshot2.get().getSnapshotInfo().state(), is(SnapshotState.PARTIAL)); + } + private static void assertSnapshotStatusCountOnRepo(String otherBlockedRepoName, int count) { final SnapshotsStatusResponse snapshotsStatusResponse = client().admin() .cluster() diff --git a/server/src/main/java/org/elasticsearch/snapshots/SnapshotsService.java b/server/src/main/java/org/elasticsearch/snapshots/SnapshotsService.java index db23fea8428db..8aaa879c63bd0 100644 --- a/server/src/main/java/org/elasticsearch/snapshots/SnapshotsService.java +++ b/server/src/main/java/org/elasticsearch/snapshots/SnapshotsService.java @@ -2707,7 +2707,9 @@ private SnapshotsInProgress updatedSnapshotsInProgress(ClusterState currentState : "Missing assignment for [" + sid + "]"; updatedAssignmentsBuilder.put(sid, ShardSnapshotStatus.MISSING); } else { - markShardReassigned(shardId, reassignedShardIds); + if (updated.isActive()) { + markShardReassigned(shardId, reassignedShardIds); + } updatedAssignmentsBuilder.put(sid, updated); } } From cdc1cc30c3a5a12f580fbf14d59bb3452b7a2971 Mon Sep 17 00:00:00 2001 From: Ignacio Vera Date: Mon, 4 Oct 2021 07:30:02 +0200 Subject: [PATCH 111/250] Add MetricAggregationBuilder abstraction (#78511) This abstraction adds a method that returns the name of the metrics this aggregation is going to produce and can be accessed via InternalAggregation#getProperty. --- ...AbstractPercentilesAggregationBuilder.java | 9 +++- .../metrics/AvgAggregationBuilder.java | 4 +- .../CardinalityAggregationBuilder.java | 2 +- .../ExtendedStatsAggregationBuilder.java | 8 +++- .../metrics/InternalExtendedStats.java | 2 +- .../metrics/MaxAggregationBuilder.java | 4 +- ...anAbsoluteDeviationAggregationBuilder.java | 6 ++- .../metrics/MinAggregationBuilder.java | 4 +- .../metrics/StatsAggregationBuilder.java | 9 +++- .../metrics/SumAggregationBuilder.java | 4 +- .../metrics/ValueCountAggregationBuilder.java | 4 +- .../ValuesSourceAggregationBuilder.java | 43 +++++++++++++++++++ .../aggregations/AggregatorTestCase.java | 16 +++++++ .../boxplot/BoxplotAggregationBuilder.java | 9 +++- .../rate/RateAggregationBuilder.java | 4 +- 15 files changed, 114 insertions(+), 14 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/AbstractPercentilesAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/AbstractPercentilesAggregationBuilder.java index d66ea0d8d713e..9ec9b52c89939 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/AbstractPercentilesAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/AbstractPercentilesAggregationBuilder.java @@ -25,7 +25,9 @@ import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.Set; import java.util.function.Supplier; +import java.util.stream.Collectors; /** * This provides a base class for aggregations that are building percentiles or percentiles-like functionality (e.g. percentile ranks). @@ -33,7 +35,7 @@ * as well as algorithm-specific settings via a {@link PercentilesConfig} object */ public abstract class AbstractPercentilesAggregationBuilder> extends - ValuesSourceAggregationBuilder.LeafOnly { + ValuesSourceAggregationBuilder.MetricsAggregationBuilder { public static final ParseField KEYED_FIELD = new ParseField("keyed"); private final ParseField valuesField; @@ -364,4 +366,9 @@ public boolean equals(Object obj) { public int hashCode() { return Objects.hash(super.hashCode(), Arrays.hashCode(values), keyed, configOrDefault()); } + + @Override + public Set metricNames() { + return Arrays.stream(values).mapToObj(String::valueOf).collect(Collectors.toSet()); + } } diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/AvgAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/AvgAggregationBuilder.java index 7b578298eacb4..8b7f17d31f33c 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/AvgAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/AvgAggregationBuilder.java @@ -26,7 +26,9 @@ import java.io.IOException; import java.util.Map; -public class AvgAggregationBuilder extends ValuesSourceAggregationBuilder.LeafOnly { +public class AvgAggregationBuilder extends ValuesSourceAggregationBuilder.SingleMetricAggregationBuilder< + ValuesSource.Numeric, + AvgAggregationBuilder> { public static final String NAME = "avg"; public static final ValuesSourceRegistry.RegistryKey REGISTRY_KEY = new ValuesSourceRegistry.RegistryKey<>( NAME, diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/CardinalityAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/CardinalityAggregationBuilder.java index c492ed5f43930..937ce90a8bb14 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/CardinalityAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/CardinalityAggregationBuilder.java @@ -29,7 +29,7 @@ import java.util.Map; import java.util.Objects; -public final class CardinalityAggregationBuilder extends ValuesSourceAggregationBuilder.LeafOnly< +public final class CardinalityAggregationBuilder extends ValuesSourceAggregationBuilder.SingleMetricAggregationBuilder< ValuesSource, CardinalityAggregationBuilder> { diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ExtendedStatsAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ExtendedStatsAggregationBuilder.java index e2730b8192b1c..0a1c5ab957517 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ExtendedStatsAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ExtendedStatsAggregationBuilder.java @@ -26,8 +26,9 @@ import java.io.IOException; import java.util.Map; import java.util.Objects; +import java.util.Set; -public class ExtendedStatsAggregationBuilder extends ValuesSourceAggregationBuilder.LeafOnly< +public class ExtendedStatsAggregationBuilder extends ValuesSourceAggregationBuilder.MetricsAggregationBuilder< ValuesSource.Numeric, ExtendedStatsAggregationBuilder> { public static final String NAME = "extended_stats"; @@ -75,6 +76,11 @@ public ExtendedStatsAggregationBuilder(StreamInput in) throws IOException { sigma = in.readDouble(); } + @Override + public Set metricNames() { + return InternalExtendedStats.METRIC_NAMES; + } + @Override protected ValuesSourceType defaultValueSourceType() { return CoreValuesSourceType.NUMERIC; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalExtendedStats.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalExtendedStats.java index f839df8e29055..5fe9fdd94ee8f 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalExtendedStats.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalExtendedStats.java @@ -49,7 +49,7 @@ public static Metrics resolve(String name) { } } - private static final Set METRIC_NAMES = Collections.unmodifiableSet( + static final Set METRIC_NAMES = Collections.unmodifiableSet( Stream.of(Metrics.values()).map(Metrics::name).collect(Collectors.toSet()) ); diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/MaxAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/MaxAggregationBuilder.java index 39f7d29386cb7..99182829d32f0 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/MaxAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/MaxAggregationBuilder.java @@ -26,7 +26,9 @@ import java.io.IOException; import java.util.Map; -public class MaxAggregationBuilder extends ValuesSourceAggregationBuilder.LeafOnly { +public class MaxAggregationBuilder extends ValuesSourceAggregationBuilder.SingleMetricAggregationBuilder< + ValuesSource.Numeric, + MaxAggregationBuilder> { public static final String NAME = "max"; public static final ValuesSourceRegistry.RegistryKey REGISTRY_KEY = new ValuesSourceRegistry.RegistryKey<>( NAME, diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/MedianAbsoluteDeviationAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/MedianAbsoluteDeviationAggregationBuilder.java index e5fb1b6491d9d..6a2dbf55f6eac 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/MedianAbsoluteDeviationAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/MedianAbsoluteDeviationAggregationBuilder.java @@ -20,7 +20,7 @@ import org.elasticsearch.search.aggregations.support.CoreValuesSourceType; import org.elasticsearch.search.aggregations.support.ValuesSource; import org.elasticsearch.search.aggregations.support.ValuesSourceAggregationBuilder; -import org.elasticsearch.search.aggregations.support.ValuesSourceAggregationBuilder.LeafOnly; +import org.elasticsearch.search.aggregations.support.ValuesSourceAggregationBuilder.SingleMetricAggregationBuilder; import org.elasticsearch.search.aggregations.support.ValuesSourceAggregatorFactory; import org.elasticsearch.search.aggregations.support.ValuesSourceConfig; import org.elasticsearch.search.aggregations.support.ValuesSourceRegistry; @@ -30,7 +30,9 @@ import java.util.Map; import java.util.Objects; -public class MedianAbsoluteDeviationAggregationBuilder extends LeafOnly { +public class MedianAbsoluteDeviationAggregationBuilder extends SingleMetricAggregationBuilder< + ValuesSource.Numeric, + MedianAbsoluteDeviationAggregationBuilder> { public static final String NAME = "median_absolute_deviation"; public static final ValuesSourceRegistry.RegistryKey REGISTRY_KEY = diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/MinAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/MinAggregationBuilder.java index e3a48c9592f84..b50904545476c 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/MinAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/MinAggregationBuilder.java @@ -26,7 +26,9 @@ import java.io.IOException; import java.util.Map; -public class MinAggregationBuilder extends ValuesSourceAggregationBuilder.LeafOnly { +public class MinAggregationBuilder extends ValuesSourceAggregationBuilder.SingleMetricAggregationBuilder< + ValuesSource.Numeric, + MinAggregationBuilder> { public static final String NAME = "min"; public static final ValuesSourceRegistry.RegistryKey REGISTRY_KEY = new ValuesSourceRegistry.RegistryKey<>( NAME, diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/StatsAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/StatsAggregationBuilder.java index 73a526c4ab81e..de6af088a28dd 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/StatsAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/StatsAggregationBuilder.java @@ -28,7 +28,9 @@ import java.util.Optional; import java.util.Set; -public class StatsAggregationBuilder extends ValuesSourceAggregationBuilder.LeafOnly { +public class StatsAggregationBuilder extends ValuesSourceAggregationBuilder.MetricsAggregationBuilder< + ValuesSource.Numeric, + StatsAggregationBuilder> { public static final String NAME = "stats"; public static final ValuesSourceRegistry.RegistryKey REGISTRY_KEY = new ValuesSourceRegistry.RegistryKey<>( NAME, @@ -68,6 +70,11 @@ public StatsAggregationBuilder(StreamInput in) throws IOException { super(in); } + @Override + public Set metricNames() { + return InternalStats.METRIC_NAMES; + } + @Override protected ValuesSourceType defaultValueSourceType() { return CoreValuesSourceType.NUMERIC; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/SumAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/SumAggregationBuilder.java index 3c0c171bad3e5..0cfc96ab1051f 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/SumAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/SumAggregationBuilder.java @@ -26,7 +26,9 @@ import java.io.IOException; import java.util.Map; -public class SumAggregationBuilder extends ValuesSourceAggregationBuilder.LeafOnly { +public class SumAggregationBuilder extends ValuesSourceAggregationBuilder.SingleMetricAggregationBuilder< + ValuesSource.Numeric, + SumAggregationBuilder> { public static final String NAME = "sum"; public static final ValuesSourceRegistry.RegistryKey REGISTRY_KEY = new ValuesSourceRegistry.RegistryKey<>( NAME, diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ValueCountAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ValueCountAggregationBuilder.java index 42f6949c2988c..2d8864cb71168 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ValueCountAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ValueCountAggregationBuilder.java @@ -27,7 +27,9 @@ import java.io.IOException; import java.util.Map; -public class ValueCountAggregationBuilder extends ValuesSourceAggregationBuilder.LeafOnly { +public class ValueCountAggregationBuilder extends ValuesSourceAggregationBuilder.SingleMetricAggregationBuilder< + ValuesSource, + ValueCountAggregationBuilder> { public static final String NAME = "value_count"; public static final ValuesSourceRegistry.RegistryKey REGISTRY_KEY = new ValuesSourceRegistry.RegistryKey<>( NAME, diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/support/ValuesSourceAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/support/ValuesSourceAggregationBuilder.java index 5315ee6a76607..fd681bbc9232a 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/support/ValuesSourceAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/support/ValuesSourceAggregationBuilder.java @@ -26,6 +26,7 @@ import java.time.ZoneOffset; import java.util.Map; import java.util.Objects; +import java.util.Set; public abstract class ValuesSourceAggregationBuilder> extends AbstractAggregationBuilder { @@ -144,6 +145,48 @@ public final BucketCardinality bucketCardinality() { } } + public abstract static class MetricsAggregationBuilder> extends + LeafOnly { + + protected MetricsAggregationBuilder(String name) { + super(name); + } + + protected MetricsAggregationBuilder(LeafOnly clone, Builder factoriesBuilder, Map metadata) { + super(clone, factoriesBuilder, metadata); + } + + protected MetricsAggregationBuilder(StreamInput in) throws IOException { + super(in); + } + + /** Generated metrics from this aggregation that can be accessed via + * {@link org.elasticsearch.search.aggregations.InternalAggregation#getProperty(String)}*/ + public abstract Set metricNames(); + } + + public abstract static class SingleMetricAggregationBuilder> + extends MetricsAggregationBuilder { + + private static final Set METRIC_NAME = Set.of("value"); + + protected SingleMetricAggregationBuilder(String name) { + super(name); + } + + protected SingleMetricAggregationBuilder(LeafOnly clone, Builder factoriesBuilder, Map metadata) { + super(clone, factoriesBuilder, metadata); + } + + protected SingleMetricAggregationBuilder(StreamInput in) throws IOException { + super(in); + } + + public Set metricNames() { + return METRIC_NAME; + } + } + private String field = null; private Script script = null; private ValueType userValueTypeHint = null; diff --git a/test/framework/src/main/java/org/elasticsearch/search/aggregations/AggregatorTestCase.java b/test/framework/src/main/java/org/elasticsearch/search/aggregations/AggregatorTestCase.java index 595a1cac8852f..577598b467792 100644 --- a/test/framework/src/main/java/org/elasticsearch/search/aggregations/AggregatorTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/search/aggregations/AggregatorTestCase.java @@ -113,6 +113,7 @@ import org.elasticsearch.search.aggregations.support.AggregationContext; import org.elasticsearch.search.aggregations.support.AggregationContext.ProductionAggregationContext; import org.elasticsearch.search.aggregations.support.CoreValuesSourceType; +import org.elasticsearch.search.aggregations.support.ValuesSourceAggregationBuilder; import org.elasticsearch.search.aggregations.support.ValuesSourceRegistry; import org.elasticsearch.search.aggregations.support.ValuesSourceType; import org.elasticsearch.search.fetch.FetchPhase; @@ -512,6 +513,9 @@ protected A searchAndReduc internalAgg = (A) pipelineAggregator.reduce(internalAgg, reduceContext); } doAssertReducedMultiBucketConsumer(internalAgg, reduceBucketConsumer); + if (builder instanceof ValuesSourceAggregationBuilder.MetricsAggregationBuilder) { + verifyMetricNames((ValuesSourceAggregationBuilder.MetricsAggregationBuilder) builder, internalAgg); + } return internalAgg; } @@ -669,6 +673,18 @@ protected void withAggregator( } } + private void verifyMetricNames( + ValuesSourceAggregationBuilder.MetricsAggregationBuilder aggregationBuilder, + InternalAggregation agg) + { + for (String metric : aggregationBuilder.metricNames()) { + try { + agg.getProperty(List.of(metric)); + } catch (IllegalArgumentException ex) { + fail("Cannot access metric [" + metric + "]"); + } + } + } protected void verifyOutputFieldNames(T aggregationBuilder, V agg) throws IOException { diff --git a/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/boxplot/BoxplotAggregationBuilder.java b/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/boxplot/BoxplotAggregationBuilder.java index a0a34ead60bdf..98a18f1bafc10 100644 --- a/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/boxplot/BoxplotAggregationBuilder.java +++ b/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/boxplot/BoxplotAggregationBuilder.java @@ -31,7 +31,9 @@ import static org.elasticsearch.search.aggregations.metrics.PercentilesMethod.COMPRESSION_FIELD; -public class BoxplotAggregationBuilder extends ValuesSourceAggregationBuilder.LeafOnly { +public class BoxplotAggregationBuilder extends ValuesSourceAggregationBuilder.MetricsAggregationBuilder< + ValuesSource, + BoxplotAggregationBuilder> { public static final String NAME = "boxplot"; public static final ValuesSourceRegistry.RegistryKey REGISTRY_KEY = new ValuesSourceRegistry.RegistryKey<>( NAME, @@ -79,6 +81,11 @@ public BoxplotAggregationBuilder(StreamInput in) throws IOException { compression = in.readDouble(); } + @Override + public Set metricNames() { + return InternalBoxplot.METRIC_NAMES; + } + @Override protected void innerWriteTo(StreamOutput out) throws IOException { out.writeDouble(compression); diff --git a/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/rate/RateAggregationBuilder.java b/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/rate/RateAggregationBuilder.java index a2a34ddb1d72b..dde74f4b9e440 100644 --- a/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/rate/RateAggregationBuilder.java +++ b/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/rate/RateAggregationBuilder.java @@ -30,7 +30,9 @@ import java.util.Map; import java.util.Objects; -public class RateAggregationBuilder extends ValuesSourceAggregationBuilder.LeafOnly { +public class RateAggregationBuilder extends ValuesSourceAggregationBuilder.SingleMetricAggregationBuilder< + ValuesSource, + RateAggregationBuilder> { public static final String NAME = "rate"; public static final ParseField UNIT_FIELD = new ParseField("unit"); public static final ParseField MODE_FIELD = new ParseField("mode"); From aa1107b44a357e06c029644398843cd6caa9e091 Mon Sep 17 00:00:00 2001 From: Armin Braun Date: Mon, 4 Oct 2021 09:57:46 +0200 Subject: [PATCH 112/250] Refactor SnapshotsInProgress to Track Snapshots By Repository (#77984) First step in making `SnapshotsInProgress` easier to work with by tracking snapshots per repository. This allows simplifying the concurrency logic in a couple of places and sets up a follow-up that would invert the current list of maps for snapshots that is very hard to reason about in the concurrency logic into a map of lists that maps repo-shard to snapshots to make the logic more obviously correct. --- .../cluster/ClusterStateDiffIT.java | 4 +- .../discovery/SnapshotDisruptionIT.java | 9 +- .../snapshots/CloneSnapshotIT.java | 6 +- .../snapshots/ConcurrentSnapshotsIT.java | 23 +- .../DedicatedClusterSnapshotRestoreIT.java | 2 +- .../TransportCleanupRepositoryAction.java | 2 +- .../cluster/SnapshotsInProgress.java | 148 ++- .../SnapshotInProgressAllocationDecider.java | 12 +- .../repositories/FinalizeSnapshotContext.java | 2 +- .../repositories/RepositoriesService.java | 6 +- .../blobstore/BlobStoreRepository.java | 9 +- .../InFlightShardSnapshotStates.java | 17 +- .../snapshots/SnapshotShardsService.java | 28 +- .../snapshots/SnapshotsService.java | 847 ++++++++---------- .../MetadataDeleteIndexServiceTests.java | 4 +- .../MetadataIndexStateServiceTests.java | 3 +- .../snapshots/SnapshotResiliencyTests.java | 36 +- ...SnapshotsInProgressSerializationTests.java | 127 +-- .../snapshots/SnapshotsServiceTests.java | 71 +- .../AbstractSnapshotIntegTestCase.java | 8 +- .../AsyncRetryDuringSnapshotActionStep.java | 14 +- .../DeleteDataStreamTransportActionTests.java | 5 +- .../TransportGetSnapshotLifecycleAction.java | 20 +- .../EncryptedRepositorySecretIntegTests.java | 4 +- .../ClusterPrivilegeIntegrationTests.java | 3 +- .../SecurityFeatureStateIntegTests.java | 3 +- 26 files changed, 728 insertions(+), 685 deletions(-) diff --git a/server/src/internalClusterTest/java/org/elasticsearch/cluster/ClusterStateDiffIT.java b/server/src/internalClusterTest/java/org/elasticsearch/cluster/ClusterStateDiffIT.java index 600770ea5f163..684bbac674df4 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/cluster/ClusterStateDiffIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/cluster/ClusterStateDiffIT.java @@ -703,7 +703,7 @@ public ClusterState.Builder remove(ClusterState.Builder builder, String name) { public ClusterState.Custom randomCreate(String name) { switch (randomIntBetween(0, 1)) { case 0: - return SnapshotsInProgress.of(List.of(new SnapshotsInProgress.Entry( + return SnapshotsInProgress.EMPTY.withAddedEntry(new SnapshotsInProgress.Entry( new Snapshot(randomName("repo"), new SnapshotId(randomName("snap"), UUIDs.randomBase64UUID())), randomBoolean(), randomBoolean(), @@ -715,7 +715,7 @@ public ClusterState.Custom randomCreate(String name) { ImmutableOpenMap.of(), null, SnapshotInfoTestUtils.randomUserMetadata(), - randomVersion(random())))); + randomVersion(random()))); case 1: return new RestoreInProgress.Builder().add( new RestoreInProgress.Entry( diff --git a/server/src/internalClusterTest/java/org/elasticsearch/discovery/SnapshotDisruptionIT.java b/server/src/internalClusterTest/java/org/elasticsearch/discovery/SnapshotDisruptionIT.java index fabbb90eeada3..9c7285d4eea2a 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/discovery/SnapshotDisruptionIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/discovery/SnapshotDisruptionIT.java @@ -69,7 +69,8 @@ public void testDisruptionAfterFinalization() throws Exception { createRandomIndex(idxName); - createRepository("test-repo", "fs"); + final String repoName = "test-repo"; + createRepository(repoName, "fs"); final String masterNode1 = internalCluster().getMasterName(); @@ -82,12 +83,12 @@ public void testDisruptionAfterFinalization() throws Exception { @Override public void clusterChanged(ClusterChangedEvent event) { SnapshotsInProgress snapshots = event.state().custom(SnapshotsInProgress.TYPE); - if (snapshots != null && snapshots.entries().size() > 0) { - final SnapshotsInProgress.Entry snapshotEntry = snapshots.entries().get(0); + if (snapshots != null && snapshots.isEmpty() == false) { + final SnapshotsInProgress.Entry snapshotEntry = snapshots.forRepo(repoName).get(0); if (snapshotEntry.state() == SnapshotsInProgress.State.SUCCESS) { final RepositoriesMetadata repoMeta = event.state().metadata().custom(RepositoriesMetadata.TYPE); - final RepositoryMetadata metadata = repoMeta.repository("test-repo"); + final RepositoryMetadata metadata = repoMeta.repository(repoName); if (metadata.pendingGeneration() > snapshotEntry.repositoryStateId()) { logger.info("--> starting disruption"); networkDisruption.startDisrupting(); diff --git a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/CloneSnapshotIT.java b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/CloneSnapshotIT.java index 3f0e055994eda..257ea05e236ca 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/CloneSnapshotIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/CloneSnapshotIT.java @@ -644,7 +644,7 @@ public void testStartCloneWithSuccessfulShardSnapshotPendingFinalization() throw try { awaitClusterState(clusterState -> { final List entries = clusterState.custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY) - .entries(); + .forRepo(repoName); return entries.size() == 2 && entries.get(1).shardsByRepoShardId().isEmpty() == false; }); assertFalse(blockedSnapshot.isDone()); @@ -681,7 +681,7 @@ public void testStartCloneDuringRunningDelete() throws Exception { final ActionFuture cloneFuture = startClone(repoName, sourceSnapshot, "target-snapshot", indexName); logger.info("--> waiting for snapshot clone to be fully initialized"); awaitClusterState(state -> { - for (SnapshotsInProgress.Entry entry : state.custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY).entries()) { + for (SnapshotsInProgress.Entry entry : state.custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY).forRepo(repoName)) { if (entry.shardsByRepoShardId().isEmpty() == false) { assertEquals(sourceSnapshot, entry.source().getName()); for (ObjectCursor value : entry.shardsByRepoShardId().values()) { @@ -724,7 +724,7 @@ public void testManyConcurrentClonesStartOutOfOrder() throws Exception { awaitNumberOfSnapshotsInProgress(2); awaitClusterState( state -> state.custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY) - .entries() + .forRepo(repoName) .stream() .anyMatch(entry -> entry.state().completed()) ); diff --git a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/ConcurrentSnapshotsIT.java b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/ConcurrentSnapshotsIT.java index ed570d8764b85..2b945950feaf8 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/ConcurrentSnapshotsIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/ConcurrentSnapshotsIT.java @@ -320,7 +320,7 @@ public void testAbortOneOfMultipleSnapshots() throws Exception { logger.info("--> wait for snapshot on second data node to finish"); awaitClusterState(state -> { final SnapshotsInProgress snapshotsInProgress = state.custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY); - return snapshotsInProgress.entries().size() == 2 && snapshotHasCompletedShard(secondSnapshot, snapshotsInProgress); + return snapshotsInProgress.count() == 2 && snapshotHasCompletedShard(repoName, secondSnapshot, snapshotsInProgress); }); final ActionFuture deleteSnapshotsResponse = startDeleteSnapshot(repoName, firstSnapshot); @@ -378,7 +378,7 @@ public void testCascadedAborts() throws Exception { logger.info("--> wait for snapshot on second data node to finish"); awaitClusterState(state -> { final SnapshotsInProgress snapshotsInProgress = state.custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY); - return snapshotsInProgress.entries().size() == 2 && snapshotHasCompletedShard(secondSnapshot, snapshotsInProgress); + return snapshotsInProgress.count() == 2 && snapshotHasCompletedShard(repoName, secondSnapshot, snapshotsInProgress); }); final ActionFuture deleteSnapshotsResponse = startDeleteSnapshot(repoName, firstSnapshot); @@ -398,7 +398,7 @@ public void testCascadedAborts() throws Exception { assertBusy(() -> { assertThat(currentSnapshots(repoName), hasSize(1)); final SnapshotsInProgress snapshotsInProgress = clusterService().state().custom(SnapshotsInProgress.TYPE); - assertThat(snapshotsInProgress.entries().get(0).state(), is(SnapshotsInProgress.State.ABORTED)); + assertThat(snapshotsInProgress.forRepo(repoName).get(0).state(), is(SnapshotsInProgress.State.ABORTED)); }, 30L, TimeUnit.SECONDS); unblockNode(repoName, dataNode); @@ -441,7 +441,7 @@ public void testMasterFailOverWithQueuedDeletes() throws Exception { logger.info("--> wait for snapshot on second data node to finish"); awaitClusterState(state -> { final SnapshotsInProgress snapshotsInProgress = state.custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY); - return snapshotsInProgress.entries().size() == 2 && snapshotHasCompletedShard(secondSnapshot, snapshotsInProgress); + return snapshotsInProgress.count() == 2 && snapshotHasCompletedShard(repoName, secondSnapshot, snapshotsInProgress); }); final ActionFuture firstDeleteFuture = startDeleteFromNonMasterClient(repoName, firstSnapshot); @@ -469,7 +469,7 @@ public void testMasterFailOverWithQueuedDeletes() throws Exception { assertThat(currentSnapshots(repoName), hasSize(2)); for (SnapshotsInProgress.Entry entry : clusterService().state() .custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY) - .entries()) { + .forRepo(repoName)) { assertThat(entry.state(), is(SnapshotsInProgress.State.ABORTED)); assertThat(entry.snapshot().getSnapshotId().getName(), not(secondSnapshot)); } @@ -1503,12 +1503,15 @@ public void testOutOfOrderAndConcurrentFinalization() throws Exception { .execute(); awaitClusterState(state -> { - final SnapshotsInProgress snapshotsInProgress = state.custom(SnapshotsInProgress.TYPE); - return snapshotsInProgress.entries().size() == 2 && snapshotsInProgress.entries().get(1).state().completed(); + final List snapshotsInProgress = state.custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY) + .forRepo(repository); + return snapshotsInProgress.size() == 2 && snapshotsInProgress.get(1).state().completed(); }); unblockAllDataNodes(repository); - awaitClusterState(state -> state.custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY).entries().get(0).state().completed()); + awaitClusterState( + state -> state.custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY).forRepo(repository).get(0).state().completed() + ); unblockNode(repository, master); assertSuccessful(snapshot2); @@ -1990,8 +1993,8 @@ private void createIndexWithContent(String indexName, String nodeInclude, String ); } - private static boolean snapshotHasCompletedShard(String snapshot, SnapshotsInProgress snapshotsInProgress) { - for (SnapshotsInProgress.Entry entry : snapshotsInProgress.entries()) { + private static boolean snapshotHasCompletedShard(String repoName, String snapshot, SnapshotsInProgress snapshotsInProgress) { + for (SnapshotsInProgress.Entry entry : snapshotsInProgress.forRepo(repoName)) { if (entry.snapshot().getSnapshotId().getName().equals(snapshot)) { for (ObjectCursor shard : entry.shards().values()) { if (shard.value.state().completed()) { diff --git a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/DedicatedClusterSnapshotRestoreIT.java b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/DedicatedClusterSnapshotRestoreIT.java index 742ce2fa5130e..7f7eb35b1ef84 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/DedicatedClusterSnapshotRestoreIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/DedicatedClusterSnapshotRestoreIT.java @@ -1066,7 +1066,7 @@ public void onRequestSent( logger, otherDataNode, state -> state.custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY) - .entries() + .forRepo(repoName) .stream() .anyMatch(entry -> entry.state() == SnapshotsInProgress.State.ABORTED) ); diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/cleanup/TransportCleanupRepositoryAction.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/cleanup/TransportCleanupRepositoryAction.java index 20e49fad5f372..9cb6e03cddd47 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/cleanup/TransportCleanupRepositoryAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/cleanup/TransportCleanupRepositoryAction.java @@ -201,7 +201,7 @@ public ClusterState execute(ClusterState currentState) { ); } SnapshotsInProgress snapshots = currentState.custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY); - if (snapshots.entries().isEmpty() == false) { + if (snapshots.isEmpty() == false) { throw new IllegalStateException( "Cannot cleanup [" + repositoryName + "] - a snapshot is currently running in [" + snapshots + "]" ); diff --git a/server/src/main/java/org/elasticsearch/cluster/SnapshotsInProgress.java b/server/src/main/java/org/elasticsearch/cluster/SnapshotsInProgress.java index 5459b13ed499b..4974e3ee7d735 100644 --- a/server/src/main/java/org/elasticsearch/cluster/SnapshotsInProgress.java +++ b/server/src/main/java/org/elasticsearch/cluster/SnapshotsInProgress.java @@ -35,49 +35,105 @@ import org.elasticsearch.snapshots.SnapshotId; import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; +import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Set; +import java.util.stream.Stream; /** * Meta data about snapshots that are currently executing */ public class SnapshotsInProgress extends AbstractNamedDiffable implements Custom { - public static final SnapshotsInProgress EMPTY = new SnapshotsInProgress(List.of()); + public static final SnapshotsInProgress EMPTY = new SnapshotsInProgress(Map.of()); public static final String TYPE = "snapshots"; public static final String ABORTED_FAILURE_TEXT = "Snapshot was aborted by deletion"; - private final List entries; + // keyed by repository name + private final Map> entries; - public static SnapshotsInProgress of(List entries) { - if (entries.isEmpty()) { - return EMPTY; + public SnapshotsInProgress(StreamInput in) throws IOException { + this(collectByRepo(in)); + } + + private static Map> collectByRepo(StreamInput in) throws IOException { + final int count = in.readVInt(); + if (count == 0) { + return Map.of(); } - return new SnapshotsInProgress(Collections.unmodifiableList(entries)); + final Map> entriesByRepo = new HashMap<>(); + for (int i = 0; i < count; i++) { + final Entry entry = Entry.readFrom(in); + entriesByRepo.computeIfAbsent(entry.repository(), repo -> new ArrayList<>()).add(entry); + } + for (Map.Entry> entryForRepo : entriesByRepo.entrySet()) { + entryForRepo.setValue(List.copyOf(entryForRepo.getValue())); + } + return entriesByRepo; } - public SnapshotsInProgress(StreamInput in) throws IOException { - this(in.readList(SnapshotsInProgress.Entry::readFrom)); + private SnapshotsInProgress(Map> entries) { + this.entries = Map.copyOf(entries); + assert assertConsistentEntries(this.entries); } - private SnapshotsInProgress(List entries) { - this.entries = entries; - assert assertConsistentEntries(entries); + public SnapshotsInProgress withUpdatedEntriesForRepo(String repository, List updatedEntries) { + if (updatedEntries.equals(forRepo(repository))) { + return this; + } + final Map> copy = new HashMap<>(this.entries); + if (updatedEntries.isEmpty()) { + copy.remove(repository); + if (copy.isEmpty()) { + return EMPTY; + } + } else { + copy.put(repository, List.copyOf(updatedEntries)); + } + return new SnapshotsInProgress(copy); } - public List entries() { - return this.entries; + public SnapshotsInProgress withAddedEntry(Entry entry) { + final List forRepo = new ArrayList<>(entries.getOrDefault(entry.repository(), List.of())); + forRepo.add(entry); + return withUpdatedEntriesForRepo(entry.repository(), forRepo); + } + + public List forRepo(String repository) { + return entries.getOrDefault(repository, List.of()); + } + + public boolean isEmpty() { + return entries.isEmpty(); + } + + public int count() { + int count = 0; + for (List list : entries.values()) { + count += list.size(); + } + return count; + } + + public Collection> entriesByRepo() { + return entries.values(); + } + + public Stream asStream() { + return entries.values().stream().flatMap(Collection::stream); } public Entry snapshot(final Snapshot snapshot) { - for (Entry entry : entries) { + for (Entry entry : forRepo(snapshot.getRepository())) { final Snapshot curr = entry.snapshot(); if (curr.equals(snapshot)) { return entry; @@ -91,9 +147,9 @@ public Entry snapshot(final Snapshot snapshot) { * deleted from the repository as the cluster state moved from the given {@code old} value of {@link SnapshotsInProgress} to this * instance. */ - public Map> obsoleteGenerations(SnapshotsInProgress old) { + public Map> obsoleteGenerations(String repository, SnapshotsInProgress old) { final Map> obsoleteGenerations = new HashMap<>(); - for (Entry entry : old.entries()) { + for (Entry entry : old.forRepo(repository)) { final Entry updatedEntry = snapshot(entry.snapshot()); if (updatedEntry == null) { continue; @@ -134,14 +190,19 @@ public static NamedDiff readDiffFrom(StreamInput in) throws IOException @Override public void writeTo(StreamOutput out) throws IOException { - out.writeList(entries); + out.writeVInt(count()); + final Iterator iterator = asStream().iterator(); + while (iterator.hasNext()) { + iterator.next().writeTo(out); + } } @Override public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException { builder.startArray("snapshots"); - for (Entry entry : entries) { - entry.toXContent(builder, params); + final Iterator iterator = asStream().iterator(); + while (iterator.hasNext()) { + iterator.next().toXContent(builder, params); } builder.endArray(); return builder; @@ -162,11 +223,14 @@ public int hashCode() { @Override public String toString() { StringBuilder builder = new StringBuilder("SnapshotsInProgress["); - for (int i = 0; i < entries.size(); i++) { - builder.append(entries.get(i).snapshot().getSnapshotId().getName()); - if (i + 1 < entries.size()) { + final Iterator entryList = asStream().iterator(); + boolean firstEntry = true; + while (entryList.hasNext()) { + if (firstEntry == false) { builder.append(","); } + builder.append(entryList.next().snapshot().getSnapshotId().getName()); + firstEntry = false; } return builder.append("]").toString(); } @@ -226,34 +290,38 @@ private static boolean hasFailures(ImmutableOpenMap entries) { - final Map>> assignedShardsByRepo = new HashMap<>(); - final Map>> queuedShardsByRepo = new HashMap<>(); - for (Entry entry : entries) { - for (ObjectObjectCursor shard : entry.shardsByRepoShardId()) { - final RepositoryShardId sid = shard.key; - assert assertShardStateConsistent(entries, assignedShardsByRepo, queuedShardsByRepo, entry, sid.indexName(), sid.shardId(), - shard.value); + private static boolean assertConsistentEntries(Map> entries) { + for (Map.Entry> repoEntries : entries.entrySet()) { + final Set> assignedShards = new HashSet<>(); + final Set> queuedShards = new HashSet<>(); + final List entriesForRepository = repoEntries.getValue(); + final String repository = repoEntries.getKey(); + assert entriesForRepository.isEmpty() == false + : "found empty list of snapshots for " + repository + " in " + entries; + for (Entry entry : entriesForRepository) { + assert entry.repository().equals(repository) : "mismatched repository " + entry + " tracked under " + repository; + for (ObjectObjectCursor shard : entry.shardsByRepoShardId()) { + final RepositoryShardId sid = shard.key; + assert assertShardStateConsistent(entriesForRepository, + assignedShards, queuedShards, sid.indexName(), sid.shardId(), shard.value); + } } - } - for (String repoName : assignedShardsByRepo.keySet()) { // make sure in-flight-shard-states can be built cleanly for the entries without tripping assertions - InFlightShardSnapshotStates.forRepo(repoName, entries); + InFlightShardSnapshotStates.forEntries(entriesForRepository); } return true; } - private static boolean assertShardStateConsistent(List entries, Map>> assignedShardsByRepo, - Map>> queuedShardsByRepo, Entry entry, + private static boolean assertShardStateConsistent(List entries, Set> assignedShards, + Set> queuedShards, String indexName, int shardId, ShardSnapshotStatus shardSnapshotStatus) { if (shardSnapshotStatus.isActive()) { Tuple plainShardId = Tuple.tuple(indexName, shardId); - assert assignedShardsByRepo.computeIfAbsent(entry.repository(), k -> new HashSet<>()) - .add(plainShardId) : "Found duplicate shard assignments in " + entries; - assert queuedShardsByRepo.getOrDefault(entry.repository(), Collections.emptySet()).contains(plainShardId) == false - : "Found active shard assignments after queued shard assignments in " + entries; + assert assignedShards.add(plainShardId) : plainShardId + " is assigned twice in " + entries; + assert queuedShards.contains(plainShardId) == false: + plainShardId + " is queued then assigned in " + entries; } else if (shardSnapshotStatus.state() == ShardState.QUEUED) { - queuedShardsByRepo.computeIfAbsent(entry.repository(), k -> new HashSet<>()).add(Tuple.tuple(indexName, shardId)); + queuedShards.add(Tuple.tuple(indexName, shardId)); } return true; } diff --git a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/SnapshotInProgressAllocationDecider.java b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/SnapshotInProgressAllocationDecider.java index 9bb4b98985002..9561f7cb8ed19 100644 --- a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/SnapshotInProgressAllocationDecider.java +++ b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/SnapshotInProgressAllocationDecider.java @@ -15,6 +15,8 @@ import org.elasticsearch.cluster.routing.ShardRouting; import org.elasticsearch.cluster.routing.allocation.RoutingAllocation; +import java.util.Iterator; + /** * This {@link org.elasticsearch.cluster.routing.allocation.decider.AllocationDecider} prevents shards that * are currently been snapshotted to be moved to other nodes. @@ -49,12 +51,14 @@ private Decision canMove(ShardRouting shardRouting, RoutingAllocation allocation // Only primary shards are snapshotted SnapshotsInProgress snapshotsInProgress = allocation.custom(SnapshotsInProgress.TYPE); - if (snapshotsInProgress == null || snapshotsInProgress.entries().isEmpty()) { + if (snapshotsInProgress == null || snapshotsInProgress.isEmpty()) { // Snapshots are not running return allocation.decision(Decision.YES, NAME, "no snapshots are currently running"); } - for (SnapshotsInProgress.Entry snapshot : snapshotsInProgress.entries()) { + final Iterator entryIterator = snapshotsInProgress.asStream().iterator(); + while (entryIterator.hasNext()) { + final SnapshotsInProgress.Entry snapshot = entryIterator.next(); if (snapshot.isClone()) { continue; } @@ -66,8 +70,8 @@ private Decision canMove(ShardRouting shardRouting, RoutingAllocation allocation shardRouting.shardId(), shardSnapshotStatus.nodeId()); } return allocation.decision(Decision.THROTTLE, NAME, - "waiting for snapshotting of shard [%s] to complete on this node [%s]", - shardRouting.shardId(), shardSnapshotStatus.nodeId()); + "waiting for snapshotting of shard [%s] to complete on this node [%s]", + shardRouting.shardId(), shardSnapshotStatus.nodeId()); } } } diff --git a/server/src/main/java/org/elasticsearch/repositories/FinalizeSnapshotContext.java b/server/src/main/java/org/elasticsearch/repositories/FinalizeSnapshotContext.java index ad10b2b915794..8dd5dbb8d845a 100644 --- a/server/src/main/java/org/elasticsearch/repositories/FinalizeSnapshotContext.java +++ b/server/src/main/java/org/elasticsearch/repositories/FinalizeSnapshotContext.java @@ -98,7 +98,7 @@ public ClusterState updatedClusterState(ClusterState state) { final ClusterState updatedState = SnapshotsService.stateWithoutSnapshot(state, snapshotInfo.snapshot()); obsoleteGenerations.set( updatedState.custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY) - .obsoleteGenerations(state.custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY)) + .obsoleteGenerations(snapshotInfo.repository(), state.custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY)) ); return updatedState; } diff --git a/server/src/main/java/org/elasticsearch/repositories/RepositoriesService.java b/server/src/main/java/org/elasticsearch/repositories/RepositoriesService.java index da874835513f0..f87cdf9c50a59 100644 --- a/server/src/main/java/org/elasticsearch/repositories/RepositoriesService.java +++ b/server/src/main/java/org/elasticsearch/repositories/RepositoriesService.java @@ -682,10 +682,8 @@ private static void validate(final String repositoryName) { private static void ensureRepositoryNotInUse(ClusterState clusterState, String repository) { final SnapshotsInProgress snapshots = clusterState.custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY); - for (SnapshotsInProgress.Entry snapshot : snapshots.entries()) { - if (repository.equals(snapshot.snapshot().getRepository())) { - throw newRepositoryInUseException(repository, "snapshot is in progress"); - } + if (snapshots.forRepo(repository).isEmpty() == false) { + throw newRepositoryInUseException(repository, "snapshot is in progress"); } for (SnapshotDeletionsInProgress.Entry entry : clusterState.custom( SnapshotDeletionsInProgress.TYPE, diff --git a/server/src/main/java/org/elasticsearch/repositories/blobstore/BlobStoreRepository.java b/server/src/main/java/org/elasticsearch/repositories/blobstore/BlobStoreRepository.java index a4ea5a316dc3e..e9dbf5944eb8e 100644 --- a/server/src/main/java/org/elasticsearch/repositories/blobstore/BlobStoreRepository.java +++ b/server/src/main/java/org/elasticsearch/repositories/blobstore/BlobStoreRepository.java @@ -643,7 +643,7 @@ public void updateState(ClusterState state) { } if (bestEffortConsistency) { final SnapshotsInProgress snapshotsInProgress = state.custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY); - long bestGenerationFromCS = bestGeneration(snapshotsInProgress.entries()); + long bestGenerationFromCS = bestGeneration(snapshotsInProgress.forRepo(this.metadata.name())); // Don't use generation from the delete task if we already found a generation for an in progress snapshot. // In this case, the generation points at the generation the repo will be in after the snapshot finishes so it may not yet // exist @@ -2482,15 +2482,16 @@ private ClusterState updateRepositoryGenerationsIfNecessary(ClusterState state, final SnapshotsInProgress updatedSnapshotsInProgress; boolean changedSnapshots = false; final List snapshotEntries = new ArrayList<>(); - for (SnapshotsInProgress.Entry entry : state.custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY).entries()) { - if (entry.repository().equals(repoName) && entry.repositoryStateId() == oldGen) { + final SnapshotsInProgress snapshotsInProgress = state.custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY); + for (SnapshotsInProgress.Entry entry : state.custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY).forRepo(repoName)) { + if (entry.repositoryStateId() == oldGen) { snapshotEntries.add(entry.withRepoGen(newGen)); changedSnapshots = true; } else { snapshotEntries.add(entry); } } - updatedSnapshotsInProgress = changedSnapshots ? SnapshotsInProgress.of(snapshotEntries) : null; + updatedSnapshotsInProgress = changedSnapshots ? snapshotsInProgress.withUpdatedEntriesForRepo(repoName, snapshotEntries) : null; final SnapshotDeletionsInProgress updatedDeletionsInProgress; boolean changedDeletions = false; final List deletionEntries = new ArrayList<>(); diff --git a/server/src/main/java/org/elasticsearch/snapshots/InFlightShardSnapshotStates.java b/server/src/main/java/org/elasticsearch/snapshots/InFlightShardSnapshotStates.java index 12a20b64ca43a..ed6d5e08fde34 100644 --- a/server/src/main/java/org/elasticsearch/snapshots/InFlightShardSnapshotStates.java +++ b/server/src/main/java/org/elasticsearch/snapshots/InFlightShardSnapshotStates.java @@ -33,20 +33,23 @@ */ public final class InFlightShardSnapshotStates { + private static final InFlightShardSnapshotStates EMPTY = new InFlightShardSnapshotStates(Map.of(), Map.of()); + /** * Compute information about all shard ids that currently have in-flight state for the given repository. * - * @param repoName repository name - * @param snapshots snapshots in progress - * @return in flight shard states for all snapshot operation running for the given repository name + * @param snapshots snapshots in progress for a single repository + * @return in flight shard states for all snapshot operations */ - public static InFlightShardSnapshotStates forRepo(String repoName, List snapshots) { + public static InFlightShardSnapshotStates forEntries(List snapshots) { + if (snapshots.isEmpty()) { + return EMPTY; + } final Map> generations = new HashMap<>(); final Map> busyIds = new HashMap<>(); + assert snapshots.stream().map(SnapshotsInProgress.Entry::repository).distinct().count() == 1 + : "snapshots must either be an empty list or all belong to the same repository but saw " + snapshots; for (SnapshotsInProgress.Entry runningSnapshot : snapshots) { - if (runningSnapshot.repository().equals(repoName) == false) { - continue; - } for (ObjectObjectCursor shard : runningSnapshot .shardsByRepoShardId()) { final RepositoryShardId sid = shard.key; diff --git a/server/src/main/java/org/elasticsearch/snapshots/SnapshotShardsService.java b/server/src/main/java/org/elasticsearch/snapshots/SnapshotShardsService.java index a5051b84da681..7257060dd3d83 100644 --- a/server/src/main/java/org/elasticsearch/snapshots/SnapshotShardsService.java +++ b/server/src/main/java/org/elasticsearch/snapshots/SnapshotShardsService.java @@ -58,6 +58,7 @@ import java.io.IOException; import java.util.HashMap; import java.util.Iterator; +import java.util.List; import java.util.Map; import static java.util.Collections.emptyMap; @@ -123,14 +124,21 @@ public void clusterChanged(ClusterChangedEvent event) { if (previousSnapshots.equals(currentSnapshots) == false) { synchronized (shardSnapshots) { cancelRemoved(currentSnapshots); - startNewSnapshots(currentSnapshots); + for (List snapshots : currentSnapshots.entriesByRepo()) { + startNewSnapshots(snapshots); + } } } String previousMasterNodeId = event.previousState().nodes().getMasterNodeId(); String currentMasterNodeId = event.state().nodes().getMasterNodeId(); if (currentMasterNodeId != null && currentMasterNodeId.equals(previousMasterNodeId) == false) { - syncShardStatsOnNewMaster(event); + // Clear request deduplicator since we need to send all requests that were potentially not handled by the previous + // master again + remoteFailedRequestDeduplicator.clear(); + for (List snapshots : currentSnapshots.entriesByRepo()) { + syncShardStatsOnNewMaster(snapshots); + } } } catch (Exception e) { @@ -192,9 +200,9 @@ private void cancelRemoved(SnapshotsInProgress snapshotsInProgress) { } } - private void startNewSnapshots(SnapshotsInProgress snapshotsInProgress) { + private void startNewSnapshots(List snapshotsInProgress) { final String localNodeId = clusterService.localNode().getId(); - for (SnapshotsInProgress.Entry entry : snapshotsInProgress.entries()) { + for (SnapshotsInProgress.Entry entry : snapshotsInProgress) { final State entryState = entry.state(); if (entry.isClone()) { // This is a snapshot clone, it will be executed on the current master @@ -405,16 +413,8 @@ private static String getShardStateId(IndexShard indexShard, IndexCommit snapsho /** * Checks if any shards were processed that the new master doesn't know about */ - private void syncShardStatsOnNewMaster(ClusterChangedEvent event) { - SnapshotsInProgress snapshotsInProgress = event.state().custom(SnapshotsInProgress.TYPE); - if (snapshotsInProgress == null) { - return; - } - - // Clear request deduplicator since we need to send all requests that were potentially not handled by the previous - // master again - remoteFailedRequestDeduplicator.clear(); - for (SnapshotsInProgress.Entry snapshot : snapshotsInProgress.entries()) { + private void syncShardStatsOnNewMaster(List entries) { + for (SnapshotsInProgress.Entry snapshot : entries) { if (snapshot.state() == State.STARTED || snapshot.state() == State.ABORTED) { Map localShards = currentSnapshotShards(snapshot.snapshot()); if (localShards != null) { diff --git a/server/src/main/java/org/elasticsearch/snapshots/SnapshotsService.java b/server/src/main/java/org/elasticsearch/snapshots/SnapshotsService.java index 8aaa879c63bd0..c7eb8351f58f5 100644 --- a/server/src/main/java/org/elasticsearch/snapshots/SnapshotsService.java +++ b/server/src/main/java/org/elasticsearch/snapshots/SnapshotsService.java @@ -65,7 +65,6 @@ import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.util.CollectionUtils; import org.elasticsearch.core.Nullable; import org.elasticsearch.core.Tuple; import org.elasticsearch.index.Index; @@ -113,7 +112,6 @@ import java.util.stream.Collectors; import java.util.stream.Stream; -import static java.util.Collections.emptySet; import static java.util.Collections.unmodifiableList; import static org.elasticsearch.cluster.SnapshotsInProgress.completed; @@ -175,8 +173,8 @@ public class SnapshotsService extends AbstractLifecycleComponent implements Clus /** * Setting that specifies the maximum number of allowed concurrent snapshot create and delete operations in the - * cluster state. The number of concurrent operations in a cluster state is defined as the sum of the sizes of - * {@link SnapshotsInProgress#entries()} and {@link SnapshotDeletionsInProgress#getEntries()}. + * cluster state. The number of concurrent operations in a cluster state is defined as the sum of + * {@link SnapshotsInProgress#count()} and the size of {@link SnapshotDeletionsInProgress#getEntries()}. */ public static final Setting MAX_CONCURRENT_SNAPSHOT_OPERATIONS_SETTING = Setting.intSetting( "snapshot.max_concurrent_operations", @@ -298,8 +296,7 @@ public ClusterState execute(ClusterState currentState) { ensureRepositoryExists(repositoryName, currentState); ensureSnapshotNameAvailableInRepo(repositoryData, snapshotName, repository); final SnapshotsInProgress snapshots = currentState.custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY); - final List runningSnapshots = snapshots.entries(); - ensureSnapshotNameNotRunning(runningSnapshots, repositoryName, snapshotName); + ensureSnapshotNameNotRunning(snapshots, repositoryName, snapshotName); validate(repositoryName, snapshotName, currentState); final SnapshotDeletionsInProgress deletionsInProgress = currentState.custom( SnapshotDeletionsInProgress.TYPE, @@ -359,10 +356,11 @@ public ClusterState execute(ClusterState currentState) { logger.trace("[{}][{}] creating snapshot for indices [{}]", repositoryName, snapshotName, indices); - final Map indexIds = repositoryData.resolveNewIndices( - indices, - getInFlightIndexIds(runningSnapshots, repositoryName) - ); + final Map allIndices = new HashMap<>(); + for (SnapshotsInProgress.Entry runningSnapshot : snapshots.forRepo(repositoryName)) { + allIndices.putAll(runningSnapshot.indices()); + } + final Map indexIds = repositoryData.resolveNewIndices(indices, allIndices); final Version version = minCompatibleVersion(currentState.nodes().getMinNodeVersion(), repositoryData, null); ImmutableOpenMap shards = shards( snapshots, @@ -400,9 +398,7 @@ public ClusterState execute(ClusterState currentState) { version, List.copyOf(featureStates) ); - return ClusterState.builder(currentState) - .putCustom(SnapshotsInProgress.TYPE, SnapshotsInProgress.of(CollectionUtils.appendToCopy(runningSnapshots, newEntry))) - .build(); + return ClusterState.builder(currentState).putCustom(SnapshotsInProgress.TYPE, snapshots.withAddedEntry(newEntry)).build(); } @Override @@ -425,29 +421,12 @@ public void clusterStateProcessed(String source, ClusterState oldState, final Cl }, "create_snapshot [" + snapshotName + ']', listener::onFailure); } - private static void ensureSnapshotNameNotRunning( - List runningSnapshots, - String repositoryName, - String snapshotName - ) { - if (runningSnapshots.stream().anyMatch(s -> { - final Snapshot running = s.snapshot(); - return running.getRepository().equals(repositoryName) && running.getSnapshotId().getName().equals(snapshotName); - })) { + private static void ensureSnapshotNameNotRunning(SnapshotsInProgress runningSnapshots, String repositoryName, String snapshotName) { + if (runningSnapshots.forRepo(repositoryName).stream().anyMatch(s -> s.snapshot().getSnapshotId().getName().equals(snapshotName))) { throw new InvalidSnapshotNameException(repositoryName, snapshotName, "snapshot with the same name is already in-progress"); } } - private static Map getInFlightIndexIds(List runningSnapshots, String repositoryName) { - final Map allIndices = new HashMap<>(); - for (SnapshotsInProgress.Entry runningSnapshot : runningSnapshots) { - if (runningSnapshot.repository().equals(repositoryName)) { - allIndices.putAll(runningSnapshot.indices()); - } - } - return Collections.unmodifiableMap(allIndices); - } - // TODO: It is worth revisiting the design choice of creating a placeholder entry in snapshots-in-progress here once we have a cache // for repository metadata and loading it has predictable performance public void cloneSnapshot(CloneSnapshotRequest request, ActionListener listener) { @@ -474,8 +453,7 @@ public ClusterState execute(ClusterState currentState) { ensureSnapshotNameAvailableInRepo(repositoryData, snapshotName, repository); ensureNoCleanupInProgress(currentState, repositoryName, snapshotName, "clone snapshot"); final SnapshotsInProgress snapshots = currentState.custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY); - final List runningSnapshots = snapshots.entries(); - ensureSnapshotNameNotRunning(runningSnapshots, repositoryName, snapshotName); + ensureSnapshotNameNotRunning(snapshots, repositoryName, snapshotName); validate(repositoryName, snapshotName, currentState); final SnapshotId sourceSnapshotId = repositoryData.getSnapshotIds() @@ -524,9 +502,7 @@ public ClusterState execute(ClusterState currentState) { repositoryData.getGenId(), minCompatibleVersion(currentState.nodes().getMinNodeVersion(), repositoryData, null) ); - return ClusterState.builder(currentState) - .putCustom(SnapshotsInProgress.TYPE, SnapshotsInProgress.of(CollectionUtils.appendToCopy(runningSnapshots, newEntry))) - .build(); + return ClusterState.builder(currentState).putCustom(SnapshotsInProgress.TYPE, snapshots.withAddedEntry(newEntry)).build(); } @Override @@ -639,18 +615,13 @@ private void startCloning(Repository repository, SnapshotsInProgress.Entry clone @Override public ClusterState execute(ClusterState currentState) { final SnapshotsInProgress snapshotsInProgress = currentState.custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY); - final List updatedEntries = new ArrayList<>(snapshotsInProgress.entries()); - boolean changed = false; - final String localNodeId = currentState.nodes().getLocalNodeId(); final String repoName = cloneEntry.repository(); + final List existingEntries = snapshotsInProgress.forRepo(repoName); + final List updatedEntries = new ArrayList<>(existingEntries.size()); + final String localNodeId = currentState.nodes().getLocalNodeId(); final ShardGenerations shardGenerations = repoData.shardGenerations(); - for (int i = 0; i < updatedEntries.size(); i++) { - final SnapshotsInProgress.Entry entry = updatedEntries.get(i); - if (cloneEntry.repository().equals(entry.repository()) == false) { - // different repo => just continue without modification - continue; - } - if (cloneEntry.snapshot().getSnapshotId().equals(entry.snapshot().getSnapshotId())) { + for (SnapshotsInProgress.Entry existing : existingEntries) { + if (cloneEntry.snapshot().getSnapshotId().equals(existing.snapshot().getSnapshotId())) { final ImmutableOpenMap.Builder clonesBuilder = ImmutableOpenMap.builder(); final boolean readyToExecute = currentState.custom( SnapshotDeletionsInProgress.TYPE, @@ -658,7 +629,7 @@ public ClusterState execute(ClusterState currentState) { ).hasExecutingDeletion(repoName) == false; final InFlightShardSnapshotStates inFlightShardStates; if (readyToExecute) { - inFlightShardStates = InFlightShardSnapshotStates.forRepo(repoName, snapshotsInProgress.entries()); + inFlightShardStates = InFlightShardSnapshotStates.forEntries(snapshotsInProgress.forRepo(repoName)); } else { // no need to compute these, we'll mark all shards as queued anyway because we wait for the delete inFlightShardStates = null; @@ -681,16 +652,18 @@ public ClusterState execute(ClusterState currentState) { } } updatedEntry = cloneEntry.withClones(clonesBuilder.build()); - // Move the now ready to execute clone operation to the back of the snapshot operations order because its - // shard snapshot state was based on all previous existing operations in progress - // TODO: If we could eventually drop the snapshot clone init phase we don't need this any longer - updatedEntries.remove(i); - updatedEntries.add(updatedEntry); - changed = true; - break; + } else { + updatedEntries.add(existing); } } - return updateWithSnapshots(currentState, changed ? SnapshotsInProgress.of(updatedEntries) : null, null); + if (updatedEntry != null) { + // Move the now ready to execute clone operation to the back of the snapshot operations order because its + // shard snapshot state was based on all previous existing operations in progress + // TODO: If we could eventually drop the snapshot clone init phase we don't need this any longer + updatedEntries.add(updatedEntry); + return updateWithSnapshots(currentState, snapshotsInProgress.withUpdatedEntriesForRepo(repoName, updatedEntries), null); + } + return currentState; } @Override @@ -797,7 +770,7 @@ private void ensureBelowConcurrencyLimit( SnapshotsInProgress snapshotsInProgress, SnapshotDeletionsInProgress deletionsInProgress ) { - final int inProgressOperations = snapshotsInProgress.entries().size() + deletionsInProgress.getEntries().size(); + final int inProgressOperations = snapshotsInProgress.count() + deletionsInProgress.getEntries().size(); final int maxOps = maxConcurrentOperations; if (inProgressOperations >= maxOps) { throw new ConcurrentSnapshotExecutionException( @@ -941,44 +914,22 @@ public static List currentSnapshots( String repository, List snapshots ) { - if (snapshotsInProgress == null || snapshotsInProgress.entries().isEmpty()) { + if (snapshotsInProgress == null || snapshotsInProgress.isEmpty()) { return Collections.emptyList(); } if ("_all".equals(repository)) { - return snapshotsInProgress.entries(); - } - if (snapshotsInProgress.entries().size() == 1) { - // Most likely scenario - one snapshot is currently running - // Check this snapshot against the query - SnapshotsInProgress.Entry entry = snapshotsInProgress.entries().get(0); - if (entry.snapshot().getRepository().equals(repository) == false) { - return Collections.emptyList(); - } - if (snapshots.isEmpty() == false) { - for (String snapshot : snapshots) { - if (entry.snapshot().getSnapshotId().getName().equals(snapshot)) { - return snapshotsInProgress.entries(); - } - } - return Collections.emptyList(); - } else { - return snapshotsInProgress.entries(); - } + return snapshotsInProgress.asStream().collect(Collectors.toUnmodifiableList()); + } + if (snapshots.isEmpty()) { + return snapshotsInProgress.forRepo(repository); } List builder = new ArrayList<>(); - for (SnapshotsInProgress.Entry entry : snapshotsInProgress.entries()) { - if (entry.snapshot().getRepository().equals(repository) == false) { - continue; - } - if (snapshots.isEmpty() == false) { - for (String snapshot : snapshots) { - if (entry.snapshot().getSnapshotId().getName().equals(snapshot)) { - builder.add(entry); - break; - } + for (SnapshotsInProgress.Entry entry : snapshotsInProgress.forRepo(repository)) { + for (String snapshot : snapshots) { + if (entry.snapshot().getSnapshotId().getName().equals(snapshot)) { + builder.add(entry); + break; } - } else { - builder.add(entry); } } return unmodifiableList(builder); @@ -1015,10 +966,10 @@ public void applyClusterState(ClusterChangedEvent event) { private boolean assertConsistentWithClusterState(ClusterState state) { final SnapshotsInProgress snapshotsInProgress = state.custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY); - if (snapshotsInProgress.entries().isEmpty() == false) { + if (snapshotsInProgress.isEmpty() == false) { synchronized (endingSnapshots) { final Set runningSnapshots = Stream.concat( - snapshotsInProgress.entries().stream().map(SnapshotsInProgress.Entry::snapshot), + snapshotsInProgress.asStream().map(SnapshotsInProgress.Entry::snapshot), endingSnapshots.stream() ).collect(Collectors.toSet()); final Set snapshotListenerKeys = snapshotCompletionListeners.keySet(); @@ -1060,21 +1011,19 @@ private static boolean assertNoDanglingSnapshots(ClusterState state) { .filter(entry -> entry.state() == SnapshotDeletionsInProgress.State.STARTED) .map(SnapshotDeletionsInProgress.Entry::repository) .collect(Collectors.toSet()); - final Set reposSeen = new HashSet<>(); - for (SnapshotsInProgress.Entry entry : snapshotsInProgress.entries()) { - if (reposSeen.add(entry.repository())) { - for (ObjectCursor value : entry.shardsByRepoShardId().values()) { - if (value.value.equals(ShardSnapshotStatus.UNASSIGNED_QUEUED)) { - assert reposWithRunningDelete.contains(entry.repository()) - : "Found shard snapshot waiting to be assigned in [" + entry + "] but it is not blocked by any running delete"; - } else if (value.value.isActive()) { - assert reposWithRunningDelete.contains(entry.repository()) == false - : "Found shard snapshot actively executing in [" - + entry - + "] when it should be blocked by a running delete [" - + Strings.toString(snapshotDeletionsInProgress) - + "]"; - } + for (List repoEntry : snapshotsInProgress.entriesByRepo()) { + final SnapshotsInProgress.Entry entry = repoEntry.get(0); + for (ObjectCursor value : entry.shardsByRepoShardId().values()) { + if (value.value.equals(ShardSnapshotStatus.UNASSIGNED_QUEUED)) { + assert reposWithRunningDelete.contains(entry.repository()) + : "Found shard snapshot waiting to be assigned in [" + entry + "] but it is not blocked by any running delete"; + } else if (value.value.isActive()) { + assert reposWithRunningDelete.contains(entry.repository()) == false + : "Found shard snapshot actively executing in [" + + entry + + "] when it should be blocked by a running delete [" + + Strings.toString(snapshotDeletionsInProgress) + + "]"; } } } @@ -1112,7 +1061,6 @@ public ClusterState execute(ClusterState currentState) { SnapshotDeletionsInProgress.EMPTY ); DiscoveryNodes nodes = currentState.nodes(); - boolean changed = false; final EnumSet statesToUpdate; // If we are reacting to a change in the cluster node configuration we have to update the shard states of both started // and @@ -1124,7 +1072,6 @@ public ClusterState execute(ClusterState currentState) { // snapshots statesToUpdate = EnumSet.of(State.STARTED); } - ArrayList updatedSnapshotEntries = new ArrayList<>(); // We keep a cache of shards that failed in this map. If we fail a shardId for a given repository because of // a node leaving or shard becoming unassigned for one snapshot, we will also fail it for all subsequent enqueued @@ -1132,106 +1079,110 @@ public ClusterState execute(ClusterState currentState) { // TODO: the code in this state update duplicates large chunks of the logic in #SHARD_STATE_EXECUTOR. // We should refactor it to ideally also go through #SHARD_STATE_EXECUTOR by hand-crafting shard state updates // that encapsulate nodes leaving or indices having been deleted and passing them to the executor instead. - final Map> knownFailures = new HashMap<>(); - for (final SnapshotsInProgress.Entry snapshot : snapshots.entries()) { - if (statesToUpdate.contains(snapshot.state())) { - if (snapshot.isClone()) { - if (snapshot.shardsByRepoShardId().isEmpty()) { - // Currently initializing clone - if (initializingClones.contains(snapshot.snapshot())) { - updatedSnapshotEntries.add(snapshot); + SnapshotsInProgress updated = snapshots; + for (final List snapshotsInRepo : snapshots.entriesByRepo()) { + boolean changed = false; + final List updatedEntriesForRepo = new ArrayList<>(); + final Map knownFailures = new HashMap<>(); + final String repository = snapshotsInRepo.get(0).repository(); + for (SnapshotsInProgress.Entry snapshot : snapshotsInRepo) { + if (statesToUpdate.contains(snapshot.state())) { + if (snapshot.isClone()) { + if (snapshot.shardsByRepoShardId().isEmpty()) { + // Currently initializing clone + if (initializingClones.contains(snapshot.snapshot())) { + updatedEntriesForRepo.add(snapshot); + } else { + logger.debug("removing not yet start clone operation [{}]", snapshot); + changed = true; + } } else { - logger.debug("removing not yet start clone operation [{}]", snapshot); - changed = true; - } - } else { - // see if any clones may have had a shard become available for execution because of failures - if (deletes.hasExecutingDeletion(snapshot.repository())) { - // Currently executing a delete for this repo, no need to try and update any clone operations. - // The logic for finishing the delete will update running clones with the latest changes. - updatedSnapshotEntries.add(snapshot); - continue; - } - ImmutableOpenMap.Builder clones = null; - InFlightShardSnapshotStates inFlightShardSnapshotStates = null; - for (Map.Entry failureEntry : knownFailures.getOrDefault( - snapshot.repository(), - Collections.emptyMap() - ).entrySet()) { - final RepositoryShardId repositoryShardId = failureEntry.getKey(); - final ShardSnapshotStatus existingStatus = snapshot.shardsByRepoShardId().get(repositoryShardId); - if (ShardSnapshotStatus.UNASSIGNED_QUEUED.equals(existingStatus)) { - if (inFlightShardSnapshotStates == null) { - inFlightShardSnapshotStates = InFlightShardSnapshotStates.forRepo( - snapshot.repository(), - updatedSnapshotEntries + // see if any clones may have had a shard become available for execution because of failures + if (deletes.hasExecutingDeletion(repository)) { + // Currently executing a delete for this repo, no need to try and update any clone operations. + // The logic for finishing the delete will update running clones with the latest changes. + updatedEntriesForRepo.add(snapshot); + continue; + } + ImmutableOpenMap.Builder clones = null; + InFlightShardSnapshotStates inFlightShardSnapshotStates = null; + for (Map.Entry failureEntry : knownFailures.entrySet()) { + final RepositoryShardId repositoryShardId = failureEntry.getKey(); + final ShardSnapshotStatus existingStatus = snapshot.shardsByRepoShardId() + .get(repositoryShardId); + if (ShardSnapshotStatus.UNASSIGNED_QUEUED.equals(existingStatus)) { + if (inFlightShardSnapshotStates == null) { + inFlightShardSnapshotStates = InFlightShardSnapshotStates.forEntries( + updatedEntriesForRepo + ); + } + if (inFlightShardSnapshotStates.isActive( + repositoryShardId.indexName(), + repositoryShardId.shardId() + )) { + // we already have this shard assigned to another task + continue; + } + if (clones == null) { + clones = ImmutableOpenMap.builder(snapshot.shardsByRepoShardId()); + } + // We can use the generation from the shard failure to start the clone operation here + // because #processWaitingShardsAndRemovedNodes adds generations to failure statuses that + // allow us to start another clone. + // The usual route via InFlightShardSnapshotStates is not viable here because it would + // require a consistent view of the RepositoryData which we don't have here because this + // state update runs over all repositories at once. + clones.put( + repositoryShardId, + new ShardSnapshotStatus(nodes.getLocalNodeId(), failureEntry.getValue().generation()) ); } - if (inFlightShardSnapshotStates.isActive( - repositoryShardId.indexName(), - repositoryShardId.shardId() - )) { - // we already have this shard assigned to another task - continue; - } - if (clones == null) { - clones = ImmutableOpenMap.builder(snapshot.shardsByRepoShardId()); - } - // We can use the generation from the shard failure to start the clone operation here - // because #processWaitingShardsAndRemovedNodes adds generations to failure statuses that allow - // us to start another clone. - // The usual route via InFlightShardSnapshotStates is not viable here because it would require - // a consistent view of the RepositoryData which we don't have here because this state update - // runs over all repositories at once. - clones.put( - repositoryShardId, - new ShardSnapshotStatus(nodes.getLocalNodeId(), failureEntry.getValue().generation()) - ); + } + if (clones != null) { + changed = true; + updatedEntriesForRepo.add(snapshot.withClones(clones.build())); + } else { + updatedEntriesForRepo.add(snapshot); } } - if (clones != null) { + } else { + ImmutableOpenMap shards = processWaitingShardsAndRemovedNodes( + snapshot, + routingTable, + nodes, + knownFailures + ); + if (shards != null) { + final SnapshotsInProgress.Entry updatedSnapshot = snapshot.withShardStates(shards); changed = true; - updatedSnapshotEntries.add(snapshot.withClones(clones.build())); + if (updatedSnapshot.state().completed()) { + finishedSnapshots.add(updatedSnapshot); + } + updatedEntriesForRepo.add(updatedSnapshot); } else { - updatedSnapshotEntries.add(snapshot); + updatedEntriesForRepo.add(snapshot); } } + } else if (snapshot.repositoryStateId() == RepositoryData.UNKNOWN_REPO_GEN) { + // BwC path, older versions could create entries with unknown repo GEN in INIT or ABORTED state that did not + // yet write anything to the repository physically. This means we can simply remove these from the cluster + // state without having to do any additional cleanup. + changed = true; + logger.debug("[{}] was found in dangling INIT or ABORTED state", snapshot); } else { - ImmutableOpenMap shards = processWaitingShardsAndRemovedNodes( - snapshot, - routingTable, - nodes, - knownFailures.computeIfAbsent(snapshot.repository(), k -> new HashMap<>()) - ); - if (shards != null) { - final SnapshotsInProgress.Entry updatedSnapshot = snapshot.withShardStates(shards); - changed = true; - if (updatedSnapshot.state().completed()) { - finishedSnapshots.add(updatedSnapshot); - } - updatedSnapshotEntries.add(updatedSnapshot); - } else { - updatedSnapshotEntries.add(snapshot); + if (snapshot.state().completed() || completed(snapshot.shardsByRepoShardId().values())) { + finishedSnapshots.add(snapshot); } + updatedEntriesForRepo.add(snapshot); } - } else if (snapshot.repositoryStateId() == RepositoryData.UNKNOWN_REPO_GEN) { - // BwC path, older versions could create entries with unknown repo GEN in INIT or ABORTED state that did not yet - // write anything to the repository physically. This means we can simply remove these from the cluster state - // without having to do any additional cleanup. - changed = true; - logger.debug("[{}] was found in dangling INIT or ABORTED state", snapshot); - } else { - if (snapshot.state().completed() || completed(snapshot.shardsByRepoShardId().values())) { - finishedSnapshots.add(snapshot); - } - updatedSnapshotEntries.add(snapshot); + } + if (changed) { + updated = updated.withUpdatedEntriesForRepo(repository, updatedEntriesForRepo); } } final ClusterState res = readyDeletions( - changed - ? ClusterState.builder(currentState) - .putCustom(SnapshotsInProgress.TYPE, SnapshotsInProgress.of(updatedSnapshotEntries)) - .build() + updated != snapshots + ? ClusterState.builder(currentState).putCustom(SnapshotsInProgress.TYPE, updated).build() : currentState ).v1(); for (SnapshotDeletionsInProgress.Entry delete : res.custom( @@ -1386,25 +1337,27 @@ private static ImmutableOpenMap processWaitingShar } private static boolean waitingShardsStartedOrUnassigned(SnapshotsInProgress snapshotsInProgress, ClusterChangedEvent event) { - for (SnapshotsInProgress.Entry entry : snapshotsInProgress.entries()) { - if (entry.state() == State.STARTED && entry.isClone() == false) { - for (ObjectObjectCursor shardStatus : entry.shardsByRepoShardId()) { - final ShardState state = shardStatus.value.state(); - if (state != ShardState.WAITING && state != ShardState.QUEUED) { - continue; - } - final RepositoryShardId shardId = shardStatus.key; - if (event.indexRoutingTableChanged(shardId.indexName())) { - IndexRoutingTable indexShardRoutingTable = event.state() - .getRoutingTable() - .index(entry.indexByName(shardId.indexName())); - if (indexShardRoutingTable == null) { - // index got removed concurrently and we have to fail WAITING or QUEUED state shards - return true; + for (List entries : snapshotsInProgress.entriesByRepo()) { + for (SnapshotsInProgress.Entry entry : entries) { + if (entry.state() == State.STARTED && entry.isClone() == false) { + for (ObjectObjectCursor shardStatus : entry.shardsByRepoShardId()) { + final ShardState state = shardStatus.value.state(); + if (state != ShardState.WAITING && state != ShardState.QUEUED) { + continue; } - ShardRouting shardRouting = indexShardRoutingTable.shard(shardId.shardId()).primaryShard(); - if (shardRouting != null && (shardRouting.started() || shardRouting.unassigned())) { - return true; + final RepositoryShardId shardId = shardStatus.key; + if (event.indexRoutingTableChanged(shardId.indexName())) { + IndexRoutingTable indexShardRoutingTable = event.state() + .getRoutingTable() + .index(entry.indexByName(shardId.indexName())); + if (indexShardRoutingTable == null) { + // index got removed concurrently and we have to fail WAITING or QUEUED state shards + return true; + } + ShardRouting shardRouting = indexShardRoutingTable.shard(shardId.shardId()).primaryShard(); + if (shardRouting != null && (shardRouting.started() || shardRouting.unassigned())) { + return true; + } } } } @@ -1419,7 +1372,7 @@ private static boolean removedNodesCleanupNeeded(SnapshotsInProgress snapshotsIn return false; } final Set removedNodeIds = removedNodes.stream().map(DiscoveryNode::getId).collect(Collectors.toSet()); - return snapshotsInProgress.entries().stream().anyMatch(snapshot -> { + return snapshotsInProgress.asStream().anyMatch(snapshot -> { if (snapshot.state().completed() || snapshot.isClone()) { // nothing to do for already completed snapshots or clones that run on master anyways return false; @@ -1786,10 +1739,7 @@ private static Tuple> read final String repo = entry.repository(); if (repositoriesSeen.add(entry.repository()) && entry.state() == SnapshotDeletionsInProgress.State.WAITING - && snapshotsInProgress.entries() - .stream() - .filter(se -> se.repository().equals(repo)) - .noneMatch(SnapshotsService::isWritingToRepository)) { + && snapshotsInProgress.forRepo(repo).stream().noneMatch(SnapshotsService::isWritingToRepository)) { changed = true; final SnapshotDeletionsInProgress.Entry newEntry = entry.started(); readyDeletions.add(newEntry); @@ -1818,10 +1768,10 @@ private static Tuple> read * @return updated cluster state */ public static ClusterState stateWithoutSnapshot(ClusterState state, Snapshot snapshot) { - SnapshotsInProgress snapshots = state.custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY); + final SnapshotsInProgress snapshots = state.custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY); ClusterState result = state; int indexOfEntry = -1; - final List entryList = snapshots.entries(); + final List entryList = snapshots.forRepo(snapshot.getRepository()); for (int i = 0; i < entryList.size(); i++) { SnapshotsInProgress.Entry entry = entryList.get(i); if (entry.snapshot().equals(snapshot)) { @@ -1834,88 +1784,86 @@ public static ClusterState stateWithoutSnapshot(ClusterState state, Snapshot sna final SnapshotsInProgress.Entry removedEntry = entryList.get(indexOfEntry); for (int i = 0; i < indexOfEntry; i++) { final SnapshotsInProgress.Entry previousEntry = entryList.get(i); - if (previousEntry.repository().equals(removedEntry.repository())) { - if (removedEntry.isClone()) { - if (previousEntry.isClone()) { - ImmutableOpenMap.Builder updatedShardAssignments = null; - for (ObjectObjectCursor finishedShardEntry : removedEntry - .shardsByRepoShardId()) { - final ShardSnapshotStatus shardState = finishedShardEntry.value; - if (shardState.state() == ShardState.SUCCESS) { - updatedShardAssignments = maybeAddUpdatedAssignment( - updatedShardAssignments, - shardState, - finishedShardEntry.key, - previousEntry.shardsByRepoShardId() - ); - } - } - addCloneEntry(entries, previousEntry, updatedShardAssignments); - } else { - ImmutableOpenMap.Builder updatedShardAssignments = null; - for (ObjectObjectCursor finishedShardEntry : removedEntry - .shardsByRepoShardId()) { - final ShardSnapshotStatus shardState = finishedShardEntry.value; - final RepositoryShardId repositoryShardId = finishedShardEntry.key; - if (shardState.state() != ShardState.SUCCESS - || previousEntry.shardsByRepoShardId().containsKey(repositoryShardId) == false) { - continue; - } + if (removedEntry.isClone()) { + if (previousEntry.isClone()) { + ImmutableOpenMap.Builder updatedShardAssignments = null; + for (ObjectObjectCursor finishedShardEntry : removedEntry + .shardsByRepoShardId()) { + final ShardSnapshotStatus shardState = finishedShardEntry.value; + if (shardState.state() == ShardState.SUCCESS) { updatedShardAssignments = maybeAddUpdatedAssignment( updatedShardAssignments, shardState, - previousEntry.shardId(repositoryShardId), - previousEntry.shards() + finishedShardEntry.key, + previousEntry.shardsByRepoShardId() ); + } + } + addCloneEntry(entries, previousEntry, updatedShardAssignments); + } else { + ImmutableOpenMap.Builder updatedShardAssignments = null; + for (ObjectObjectCursor finishedShardEntry : removedEntry + .shardsByRepoShardId()) { + final ShardSnapshotStatus shardState = finishedShardEntry.value; + final RepositoryShardId repositoryShardId = finishedShardEntry.key; + if (shardState.state() != ShardState.SUCCESS + || previousEntry.shardsByRepoShardId().containsKey(repositoryShardId) == false) { + continue; + } + updatedShardAssignments = maybeAddUpdatedAssignment( + updatedShardAssignments, + shardState, + previousEntry.shardId(repositoryShardId), + previousEntry.shards() + ); + } + addSnapshotEntry(entries, previousEntry, updatedShardAssignments); + } + } else { + if (previousEntry.isClone()) { + ImmutableOpenMap.Builder updatedShardAssignments = null; + for (ObjectObjectCursor finishedShardEntry : removedEntry + .shardsByRepoShardId()) { + final ShardSnapshotStatus shardState = finishedShardEntry.value; + final RepositoryShardId repositoryShardId = finishedShardEntry.key; + if (shardState.state() != ShardState.SUCCESS + || previousEntry.shardsByRepoShardId().containsKey(repositoryShardId) == false) { + continue; } - addSnapshotEntry(entries, previousEntry, updatedShardAssignments); + updatedShardAssignments = maybeAddUpdatedAssignment( + updatedShardAssignments, + shardState, + repositoryShardId, + previousEntry.shardsByRepoShardId() + ); } + addCloneEntry(entries, previousEntry, updatedShardAssignments); } else { - if (previousEntry.isClone()) { - ImmutableOpenMap.Builder updatedShardAssignments = null; - for (ObjectObjectCursor finishedShardEntry : removedEntry - .shardsByRepoShardId()) { - final ShardSnapshotStatus shardState = finishedShardEntry.value; - final RepositoryShardId repositoryShardId = finishedShardEntry.key; - if (shardState.state() != ShardState.SUCCESS - || previousEntry.shardsByRepoShardId().containsKey(repositoryShardId) == false) { - continue; - } + ImmutableOpenMap.Builder updatedShardAssignments = null; + for (ObjectObjectCursor finishedShardEntry : removedEntry + .shardsByRepoShardId()) { + final ShardSnapshotStatus shardState = finishedShardEntry.value; + if (shardState.state() == ShardState.SUCCESS + && previousEntry.shardsByRepoShardId().containsKey(finishedShardEntry.key)) { updatedShardAssignments = maybeAddUpdatedAssignment( updatedShardAssignments, shardState, - repositoryShardId, - previousEntry.shardsByRepoShardId() + previousEntry.shardId(finishedShardEntry.key), + previousEntry.shards() ); } - addCloneEntry(entries, previousEntry, updatedShardAssignments); - } else { - ImmutableOpenMap.Builder updatedShardAssignments = null; - for (ObjectObjectCursor finishedShardEntry : removedEntry - .shardsByRepoShardId()) { - final ShardSnapshotStatus shardState = finishedShardEntry.value; - if (shardState.state() == ShardState.SUCCESS - && previousEntry.shardsByRepoShardId().containsKey(finishedShardEntry.key)) { - updatedShardAssignments = maybeAddUpdatedAssignment( - updatedShardAssignments, - shardState, - previousEntry.shardId(finishedShardEntry.key), - previousEntry.shards() - ); - } - } - addSnapshotEntry(entries, previousEntry, updatedShardAssignments); } + addSnapshotEntry(entries, previousEntry, updatedShardAssignments); } - } else { - entries.add(previousEntry); } } for (int i = indexOfEntry + 1; i < entryList.size(); i++) { entries.add(entryList.get(i)); } - result = ClusterState.builder(state).putCustom(SnapshotsInProgress.TYPE, SnapshotsInProgress.of(entries)).build(); + result = ClusterState.builder(state) + .putCustom(SnapshotsInProgress.TYPE, snapshots.withUpdatedEntriesForRepo(snapshot.getRepository(), entries)) + .build(); } return readyDeletions(result).v1(); } @@ -2105,9 +2053,9 @@ public ClusterState execute(ClusterState currentState) { // find in-progress snapshots to delete in cluster state final SnapshotsInProgress snapshotsInProgress = currentState.custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY); - for (SnapshotsInProgress.Entry entry : snapshotsInProgress.entries()) { + for (SnapshotsInProgress.Entry entry : snapshotsInProgress.forRepo(repositoryName)) { final SnapshotId snapshotId = entry.snapshot().getSnapshotId(); - if (entry.repository().equals(repositoryName) && Regex.simpleMatch(snapshotNames, snapshotId.getName())) { + if (Regex.simpleMatch(snapshotNames, snapshotId.getName())) { snapshotIds.add(snapshotId); } } @@ -2139,8 +2087,7 @@ public ClusterState execute(ClusterState currentState) { return currentState; } - final Set activeCloneSources = snapshotsInProgress.entries() - .stream() + final Set activeCloneSources = snapshotsInProgress.asStream() .filter(SnapshotsInProgress.Entry::isClone) .map(SnapshotsInProgress.Entry::source) .collect(Collectors.toSet()); @@ -2180,26 +2127,30 @@ public ClusterState execute(ClusterState currentState) { } // Snapshot ids that will have to be physically deleted from the repository final Set snapshotIdsRequiringCleanup = new HashSet<>(snapshotIds); - final SnapshotsInProgress updatedSnapshots = SnapshotsInProgress.of(snapshotsInProgress.entries().stream().map(existing -> { - if (existing.state() == State.STARTED && snapshotIdsRequiringCleanup.contains(existing.snapshot().getSnapshotId())) { - // snapshot is started - mark every non completed shard as aborted - final SnapshotsInProgress.Entry abortedEntry = existing.abort(); - if (abortedEntry == null) { - // No work has been done for this snapshot yet so we remove it from the cluster state directly - final Snapshot existingNotYetStartedSnapshot = existing.snapshot(); - // Adding the snapshot to #endingSnapshots since we still have to resolve its listeners to not trip - // any leaked listener assertions - if (endingSnapshots.add(existingNotYetStartedSnapshot)) { - completedNoCleanup.add(existingNotYetStartedSnapshot); + final SnapshotsInProgress updatedSnapshots = snapshotsInProgress.withUpdatedEntriesForRepo( + repositoryName, + snapshotsInProgress.forRepo(repositoryName).stream().map(existing -> { + if (existing.state() == State.STARTED + && snapshotIdsRequiringCleanup.contains(existing.snapshot().getSnapshotId())) { + // snapshot is started - mark every non completed shard as aborted + final SnapshotsInProgress.Entry abortedEntry = existing.abort(); + if (abortedEntry == null) { + // No work has been done for this snapshot yet so we remove it from the cluster state directly + final Snapshot existingNotYetStartedSnapshot = existing.snapshot(); + // Adding the snapshot to #endingSnapshots since we still have to resolve its listeners to not trip + // any leaked listener assertions + if (endingSnapshots.add(existingNotYetStartedSnapshot)) { + completedNoCleanup.add(existingNotYetStartedSnapshot); + } + snapshotIdsRequiringCleanup.remove(existingNotYetStartedSnapshot.getSnapshotId()); + } else if (abortedEntry.state().completed()) { + completedWithCleanup.add(abortedEntry); } - snapshotIdsRequiringCleanup.remove(existingNotYetStartedSnapshot.getSnapshotId()); - } else if (abortedEntry.state().completed()) { - completedWithCleanup.add(abortedEntry); + return abortedEntry; } - return abortedEntry; - } - return existing; - }).filter(Objects::nonNull).collect(Collectors.toUnmodifiableList())); + return existing; + }).filter(Objects::nonNull).collect(Collectors.toUnmodifiableList()) + ); if (snapshotIdsRequiringCleanup.isEmpty()) { // We only saw snapshots that could be removed from the cluster state right away, no need to update the deletions return updateWithSnapshots(currentState, updatedSnapshots, null); @@ -2230,10 +2181,7 @@ public ClusterState execute(ClusterState currentState) { repositoryName, threadPool.absoluteTimeInMillis(), repositoryData.getGenId(), - updatedSnapshots.entries() - .stream() - .filter(entry -> repositoryName.equals(entry.repository())) - .noneMatch(SnapshotsService::isWritingToRepository) + updatedSnapshots.forRepo(repositoryName).stream().noneMatch(SnapshotsService::isWritingToRepository) && deletionsInProgress.hasExecutingDeletion(repositoryName) == false ? SnapshotDeletionsInProgress.State.STARTED : SnapshotDeletionsInProgress.State.WAITING @@ -2630,109 +2578,104 @@ private SnapshotsInProgress updatedSnapshotsInProgress(ClusterState currentState final String localNodeId = currentState.nodes().getLocalNodeId(); final String repoName = deleteEntry.repository(); InFlightShardSnapshotStates inFlightShardStates = null; - for (SnapshotsInProgress.Entry entry : snapshotsInProgress.entries()) { - if (entry.repository().equals(repoName)) { - if (entry.state().completed() == false) { - // TODO: dry up redundant computation and code between clone and non-clone case, in particular reuse - // `inFlightShardStates` across both clone and standard snapshot code - if (entry.isClone()) { - // Collect waiting shards from that entry that we can assign now that we are done with the deletion - final List canBeUpdated = new ArrayList<>(); - for (ObjectObjectCursor value : entry.shardsByRepoShardId()) { - if (value.value.equals(ShardSnapshotStatus.UNASSIGNED_QUEUED) - && reassignedShardIds.contains(value.key) == false) { - canBeUpdated.add(value.key); - } + for (SnapshotsInProgress.Entry entry : snapshotsInProgress.forRepo(repoName)) { + if (entry.state().completed() == false) { + // TODO: dry up redundant computation and code between clone and non-clone case, in particular reuse + // `inFlightShardStates` across both clone and standard snapshot code + if (entry.isClone()) { + // Collect waiting shards from that entry that we can assign now that we are done with the deletion + final List canBeUpdated = new ArrayList<>(); + for (ObjectObjectCursor value : entry.shardsByRepoShardId()) { + if (value.value.equals(ShardSnapshotStatus.UNASSIGNED_QUEUED) + && reassignedShardIds.contains(value.key) == false) { + canBeUpdated.add(value.key); } - // TODO: the below logic is very similar to that in #startCloning and both could be dried up against each other - // also the code for standard snapshots could make use of this breakout as well - if (canBeUpdated.isEmpty() || updatedDeletions.hasExecutingDeletion(repoName)) { - // No shards can be updated in this snapshot so we just add it as is again - snapshotEntries.add(entry); - } else { - if (inFlightShardStates == null) { - inFlightShardStates = InFlightShardSnapshotStates.forRepo(repoName, snapshotsInProgress.entries()); - } - final ImmutableOpenMap.Builder updatedAssignmentsBuilder = - ImmutableOpenMap.builder(entry.shardsByRepoShardId()); - for (RepositoryShardId shardId : canBeUpdated) { - if (inFlightShardStates.isActive(shardId.indexName(), shardId.shardId()) == false) { - markShardReassigned(shardId, reassignedShardIds); - updatedAssignmentsBuilder.put( - shardId, - new ShardSnapshotStatus( - localNodeId, - inFlightShardStates.generationForShard( - shardId.index(), - shardId.shardId(), - repositoryData.shardGenerations() - ) + } + // TODO: the below logic is very similar to that in #startCloning and both could be dried up against each other + // also the code for standard snapshots could make use of this breakout as well + if (canBeUpdated.isEmpty() || updatedDeletions.hasExecutingDeletion(repoName)) { + // No shards can be updated in this snapshot so we just add it as is again + snapshotEntries.add(entry); + } else { + if (inFlightShardStates == null) { + inFlightShardStates = InFlightShardSnapshotStates.forEntries(snapshotsInProgress.forRepo(repoName)); + } + final ImmutableOpenMap.Builder updatedAssignmentsBuilder = + ImmutableOpenMap.builder(entry.shardsByRepoShardId()); + for (RepositoryShardId shardId : canBeUpdated) { + if (inFlightShardStates.isActive(shardId.indexName(), shardId.shardId()) == false) { + markShardReassigned(shardId, reassignedShardIds); + updatedAssignmentsBuilder.put( + shardId, + new ShardSnapshotStatus( + localNodeId, + inFlightShardStates.generationForShard( + shardId.index(), + shardId.shardId(), + repositoryData.shardGenerations() ) - ); - } + ) + ); } - snapshotEntries.add(entry.withClones(updatedAssignmentsBuilder.build())); - changed = true; } - } else { - // Collect waiting shards that in entry that we can assign now that we are done with the deletion - final List canBeUpdated = new ArrayList<>(); - for (ObjectObjectCursor value : entry.shardsByRepoShardId()) { - if (value.value.equals(ShardSnapshotStatus.UNASSIGNED_QUEUED) - && reassignedShardIds.contains(value.key) == false) { - canBeUpdated.add(value.key); - } + snapshotEntries.add(entry.withClones(updatedAssignmentsBuilder.build())); + changed = true; + } + } else { + // Collect waiting shards that in entry that we can assign now that we are done with the deletion + final List canBeUpdated = new ArrayList<>(); + for (ObjectObjectCursor value : entry.shardsByRepoShardId()) { + if (value.value.equals(ShardSnapshotStatus.UNASSIGNED_QUEUED) + && reassignedShardIds.contains(value.key) == false) { + canBeUpdated.add(value.key); } - if (canBeUpdated.isEmpty()) { - // No shards can be updated in this snapshot so we just add it as is again - snapshotEntries.add(entry); - } else { - final ImmutableOpenMap shardAssignments = shards( - snapshotsInProgress, - updatedDeletions, - currentState, - entry.indices().values(), - entry.version().onOrAfter(SHARD_GEN_IN_REPO_DATA_VERSION), - repositoryData, - repoName - ); - final ImmutableOpenMap.Builder updatedAssignmentsBuilder = ImmutableOpenMap - .builder(entry.shards()); - for (RepositoryShardId shardId : canBeUpdated) { - final ShardId sid = entry.shardId(shardId); - final ShardSnapshotStatus updated = shardAssignments.get(sid); - if (updated == null) { - // We don't have a new assignment for this shard because its index was concurrently deleted - assert currentState.routingTable().hasIndex(sid.getIndex()) == false - : "Missing assignment for [" + sid + "]"; - updatedAssignmentsBuilder.put(sid, ShardSnapshotStatus.MISSING); - } else { - if (updated.isActive()) { - markShardReassigned(shardId, reassignedShardIds); - } - updatedAssignmentsBuilder.put(sid, updated); + } + if (canBeUpdated.isEmpty()) { + // No shards can be updated in this snapshot so we just add it as is again + snapshotEntries.add(entry); + } else { + final ImmutableOpenMap shardAssignments = shards( + snapshotsInProgress, + updatedDeletions, + currentState, + entry.indices().values(), + entry.version().onOrAfter(SHARD_GEN_IN_REPO_DATA_VERSION), + repositoryData, + repoName + ); + final ImmutableOpenMap.Builder updatedAssignmentsBuilder = ImmutableOpenMap + .builder(entry.shards()); + for (RepositoryShardId shardId : canBeUpdated) { + final ShardId sid = entry.shardId(shardId); + final ShardSnapshotStatus updated = shardAssignments.get(sid); + if (updated == null) { + // We don't have a new assignment for this shard because its index was concurrently deleted + assert currentState.routingTable().hasIndex(sid.getIndex()) == false + : "Missing assignment for [" + sid + "]"; + updatedAssignmentsBuilder.put(sid, ShardSnapshotStatus.MISSING); + } else { + if (updated.isActive()) { + markShardReassigned(shardId, reassignedShardIds); } - } - final SnapshotsInProgress.Entry updatedEntry = entry.withShardStates(updatedAssignmentsBuilder.build()); - snapshotEntries.add(updatedEntry); - changed = true; - if (updatedEntry.state().completed()) { - newFinalizations.add(entry); + updatedAssignmentsBuilder.put(sid, updated); } } + final SnapshotsInProgress.Entry updatedEntry = entry.withShardStates(updatedAssignmentsBuilder.build()); + snapshotEntries.add(updatedEntry); + changed = true; + if (updatedEntry.state().completed()) { + newFinalizations.add(entry); + } } - } else { - // Entry is already completed so we will finalize it now that the delete doesn't block us after - // this CS update finishes - newFinalizations.add(entry); - snapshotEntries.add(entry); } } else { - // Entry is for another repository we just keep it as is + // Entry is already completed so we will finalize it now that the delete doesn't block us after + // this CS update finishes + newFinalizations.add(entry); snapshotEntries.add(entry); } } - return changed ? SnapshotsInProgress.of(snapshotEntries) : null; + return changed ? snapshotsInProgress.withUpdatedEntriesForRepo(repoName, snapshotEntries) : null; } private void markShardReassigned(RepositoryShardId shardId, Set reassignments) { @@ -2809,9 +2752,8 @@ private static ImmutableOpenMap builder = ImmutableOpenMap.builder(); final ShardGenerations shardGenerations = repositoryData.shardGenerations(); - final InFlightShardSnapshotStates inFlightShardStates = InFlightShardSnapshotStates.forRepo( - repoName, - snapshotsInProgress.entries() + final InFlightShardSnapshotStates inFlightShardStates = InFlightShardSnapshotStates.forEntries( + snapshotsInProgress.forRepo(repoName) ); final boolean readyToExecute = deletionsInProgress.hasExecutingDeletion(repoName) == false; for (IndexId index : indices) { @@ -2888,14 +2830,9 @@ private static ShardSnapshotStatus initShardSnapshotStatus(ShardGeneration shard * indices-to-check set. */ public static Set snapshottingDataStreams(final ClusterState currentState, final Set dataStreamsToCheck) { - final SnapshotsInProgress snapshots = currentState.custom(SnapshotsInProgress.TYPE); - if (snapshots == null) { - return emptySet(); - } - Map dataStreams = currentState.metadata().dataStreams(); - return snapshots.entries() - .stream() + return currentState.custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY) + .asStream() .filter(e -> e.partial() == false) .flatMap(e -> e.dataStreams().stream()) .filter(ds -> dataStreams.containsKey(ds) && dataStreamsToCheck.contains(ds)) @@ -2906,18 +2843,16 @@ public static Set snapshottingDataStreams(final ClusterState currentStat * Returns the indices that are currently being snapshotted (with partial == false) and that are contained in the indices-to-check set. */ public static Set snapshottingIndices(final ClusterState currentState, final Set indicesToCheck) { - final SnapshotsInProgress snapshots = currentState.custom(SnapshotsInProgress.TYPE); - if (snapshots == null) { - return emptySet(); - } - final Set indices = new HashSet<>(); - for (final SnapshotsInProgress.Entry entry : snapshots.entries()) { - if (entry.partial() == false && entry.isClone() == false) { - for (String indexName : entry.indices().keySet()) { - IndexMetadata indexMetadata = currentState.metadata().index(indexName); - if (indexMetadata != null && indicesToCheck.contains(indexMetadata.getIndex())) { - indices.add(indexMetadata.getIndex()); + for (List snapshotsInRepo : currentState.custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY) + .entriesByRepo()) { + for (final SnapshotsInProgress.Entry entry : snapshotsInRepo) { + if (entry.partial() == false && entry.isClone() == false) { + for (String indexName : entry.indices().keySet()) { + IndexMetadata indexMetadata = currentState.metadata().index(indexName); + if (indexMetadata != null && indicesToCheck.contains(indexMetadata.getIndex())) { + indices.add(indexMetadata.getIndex()); + } } } } @@ -3035,22 +2970,33 @@ private static final class SnapshotShardsUpdateContext { private final ClusterState currentState; // updates outstanding to be applied to existing snapshot entries - private final List unconsumedUpdates; + private final Map> updatesByRepo; // updates that were used to update an existing in-progress shard snapshot private final Set executedUpdates = new HashSet<>(); SnapshotShardsUpdateContext(ClusterState currentState, List updates) { this.currentState = currentState; - unconsumedUpdates = new ArrayList<>(updates); + updatesByRepo = new HashMap<>(); + for (ShardSnapshotUpdate update : updates) { + updatesByRepo.computeIfAbsent(update.snapshot.getRepository(), r -> new ArrayList<>()).add(update); + } } ClusterState computeUpdatedState() { - final List oldEntries = currentState.custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY) - .entries(); - final List newEntries = new ArrayList<>(oldEntries.size()); - for (SnapshotsInProgress.Entry entry : oldEntries) { - newEntries.add(applyToEntry(entry)); + final SnapshotsInProgress existing = currentState.custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY); + SnapshotsInProgress updated = existing; + for (Map.Entry> updates : updatesByRepo.entrySet()) { + final String repoName = updates.getKey(); + final List oldEntries = existing.forRepo(repoName); + if (oldEntries.isEmpty()) { + continue; + } + final List newEntries = new ArrayList<>(oldEntries.size()); + for (SnapshotsInProgress.Entry entry : oldEntries) { + newEntries.add(applyToEntry(entry, updates.getValue())); + } + updated = updated.withUpdatedEntriesForRepo(repoName, newEntries); } if (changedCount > 0) { @@ -3059,18 +3005,18 @@ ClusterState computeUpdatedState() { changedCount, startedCount ); - return ClusterState.builder(currentState).putCustom(SnapshotsInProgress.TYPE, SnapshotsInProgress.of(newEntries)).build(); + return ClusterState.builder(currentState).putCustom(SnapshotsInProgress.TYPE, updated).build(); } return currentState; } - private SnapshotsInProgress.Entry applyToEntry(SnapshotsInProgress.Entry entry) { + private SnapshotsInProgress.Entry applyToEntry(SnapshotsInProgress.Entry entry, List updates) { // Completed snapshots do not require any updates so we just add them to the output list and keep going. // Also we short circuit if there are no more unconsumed updates to apply. - if (entry.state().completed() || unconsumedUpdates.isEmpty()) { + if (entry.state().completed() || updates.isEmpty()) { return entry; } - return new EntryContext(entry).computeUpdatedEntry(); + return new EntryContext(entry, updates).computeUpdatedEntry(); } // Per snapshot entry state @@ -3087,9 +3033,9 @@ private final class EntryContext { // builder for updated shard clone status mappings if any could be computed private ImmutableOpenMap.Builder clonesBuilder = null; - EntryContext(SnapshotsInProgress.Entry entry) { + EntryContext(SnapshotsInProgress.Entry entry, List updates) { this.entry = entry; - this.iterator = unconsumedUpdates.iterator(); + this.iterator = updates.iterator(); } SnapshotsInProgress.Entry computeUpdatedEntry() { @@ -3098,12 +3044,7 @@ SnapshotsInProgress.Entry computeUpdatedEntry() { // loop over all the shard updates that are potentially applicable to the current snapshot entry while (iterator.hasNext()) { final ShardSnapshotUpdate update = iterator.next(); - final Snapshot updatedSnapshot = update.snapshot; - if (entry.repository().equals(updatedSnapshot.getRepository()) == false) { - // the update applies to a different repository so it is irrelevant here - continue; - } - if (entry.snapshot().getSnapshotId().equals(updatedSnapshot.getSnapshotId())) { + if (entry.snapshot().getSnapshotId().equals(update.snapshot.getSnapshotId())) { // update a currently running shard level operation if (update.isClone()) { executeShardSnapshotUpdate(entry.shardsByRepoShardId(), this::clonesBuilder, update, update.repoShardId); @@ -3411,8 +3352,18 @@ public void clusterStateProcessed(String source, ClusterState oldState, ClusterS } private void startExecutableClones(SnapshotsInProgress snapshotsInProgress, @Nullable String repoName) { - for (SnapshotsInProgress.Entry entry : snapshotsInProgress.entries()) { - if (entry.isClone() && entry.state() == State.STARTED && (repoName == null || entry.repository().equals(repoName))) { + if (repoName == null) { + for (List entries : snapshotsInProgress.entriesByRepo()) { + startExecutableClones(entries); + } + } else { + startExecutableClones(snapshotsInProgress.forRepo(repoName)); + } + } + + private void startExecutableClones(List entries) { + for (SnapshotsInProgress.Entry entry : entries) { + if (entry.isClone() && entry.state() == State.STARTED) { // this is a clone, see if new work is ready for (ObjectObjectCursor clone : entry.shardsByRepoShardId()) { if (clone.value.state() == ShardState.INIT) { @@ -3514,20 +3465,16 @@ public ClusterState execute(ClusterState currentState) { } final SnapshotDeletionsInProgress updatedDeletions = changed ? SnapshotDeletionsInProgress.of(updatedEntries) : null; final SnapshotsInProgress snapshotsInProgress = currentState.custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY); - final List snapshotEntries = new ArrayList<>(); boolean changedSnapshots = false; - for (SnapshotsInProgress.Entry entry : snapshotsInProgress.entries()) { - if (entry.repository().equals(repository)) { - // We failed to read repository data for this delete, it is not the job of SnapshotsService to - // retry these kinds of issues so we fail all the pending snapshots - snapshotsToFail.add(entry.snapshot()); - changedSnapshots = true; - } else { - // Entry is for another repository we just keep it as is - snapshotEntries.add(entry); - } - } - final SnapshotsInProgress updatedSnapshotsInProgress = changedSnapshots ? SnapshotsInProgress.of(snapshotEntries) : null; + for (SnapshotsInProgress.Entry entry : snapshotsInProgress.forRepo(repository)) { + // We failed to read repository data for this delete, it is not the job of SnapshotsService to + // retry these kinds of issues so we fail all the pending snapshots + snapshotsToFail.add(entry.snapshot()); + changedSnapshots = true; + } + final SnapshotsInProgress updatedSnapshotsInProgress = changedSnapshots + ? snapshotsInProgress.withUpdatedEntriesForRepo(repository, List.of()) + : null; return updateWithSnapshots(currentState, updatedSnapshotsInProgress, updatedDeletions); } diff --git a/server/src/test/java/org/elasticsearch/cluster/metadata/MetadataDeleteIndexServiceTests.java b/server/src/test/java/org/elasticsearch/cluster/metadata/MetadataDeleteIndexServiceTests.java index d241862569e9b..1795f460f6067 100644 --- a/server/src/test/java/org/elasticsearch/cluster/metadata/MetadataDeleteIndexServiceTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/metadata/MetadataDeleteIndexServiceTests.java @@ -70,10 +70,10 @@ public void testDeleteMissing() { public void testDeleteSnapshotting() { String index = randomAlphaOfLength(5); Snapshot snapshot = new Snapshot("doesn't matter", new SnapshotId("snapshot name", "snapshot uuid")); - SnapshotsInProgress snaps = SnapshotsInProgress.of(List.of(new SnapshotsInProgress.Entry(snapshot, true, false, + SnapshotsInProgress snaps = SnapshotsInProgress.EMPTY.withAddedEntry(new SnapshotsInProgress.Entry(snapshot, true, false, SnapshotsInProgress.State.INIT, singletonMap(index, new IndexId(index, "doesn't matter")), Collections.emptyList(), Collections.emptyList(), System.currentTimeMillis(), (long) randomIntBetween(0, 1000), - ImmutableOpenMap.of(), null, SnapshotInfoTestUtils.randomUserMetadata(), VersionUtils.randomVersion(random())))); + ImmutableOpenMap.of(), null, SnapshotInfoTestUtils.randomUserMetadata(), VersionUtils.randomVersion(random()))); ClusterState state = ClusterState.builder(clusterState(index)) .putCustom(SnapshotsInProgress.TYPE, snaps) .build(); diff --git a/server/src/test/java/org/elasticsearch/cluster/metadata/MetadataIndexStateServiceTests.java b/server/src/test/java/org/elasticsearch/cluster/metadata/MetadataIndexStateServiceTests.java index 7316d63a41b21..d5162162ad11f 100644 --- a/server/src/test/java/org/elasticsearch/cluster/metadata/MetadataIndexStateServiceTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/metadata/MetadataIndexStateServiceTests.java @@ -42,7 +42,6 @@ import java.util.Collections; import java.util.HashMap; import java.util.HashSet; -import java.util.List; import java.util.Map; import java.util.Set; import java.util.stream.Collectors; @@ -354,7 +353,7 @@ private static ClusterState addSnapshotIndex(final String index, final int numSh randomNonNegativeLong(), randomLong(), shardsBuilder.build(), null, SnapshotInfoTestUtils.randomUserMetadata(), VersionUtils.randomVersion(random()) ); - return ClusterState.builder(newState).putCustom(SnapshotsInProgress.TYPE, SnapshotsInProgress.of(List.of(entry))).build(); + return ClusterState.builder(newState).putCustom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY.withAddedEntry(entry)).build(); } private static ClusterState addIndex(final ClusterState currentState, diff --git a/server/src/test/java/org/elasticsearch/snapshots/SnapshotResiliencyTests.java b/server/src/test/java/org/elasticsearch/snapshots/SnapshotResiliencyTests.java index e314f62a02dce..b013bb7a5af5a 100644 --- a/server/src/test/java/org/elasticsearch/snapshots/SnapshotResiliencyTests.java +++ b/server/src/test/java/org/elasticsearch/snapshots/SnapshotResiliencyTests.java @@ -345,8 +345,7 @@ public void testSuccessfulSnapshotAndRestore() { assertNotNull(createSnapshotResponseListener.result()); assertNotNull(restoreSnapshotResponseListener.result()); assertTrue(documentCountVerified.get()); - SnapshotsInProgress finalSnapshotsInProgress = masterNode.clusterService.state().custom(SnapshotsInProgress.TYPE); - assertFalse(finalSnapshotsInProgress.entries().stream().anyMatch(entry -> entry.state().completed() == false)); + assertTrue(masterNode.clusterService.state().custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY).isEmpty()); final Repository repository = masterNode.repositoriesService.repository(repoName); Collection snapshotIds = getRepositoryData(repository).getSnapshotIds(); assertThat(snapshotIds, hasSize(1)); @@ -424,7 +423,7 @@ public void testSnapshotWithNodeDisconnects() { return true; } final SnapshotsInProgress snapshotsInProgress = master.clusterService.state().custom(SnapshotsInProgress.TYPE); - return snapshotsInProgress != null && snapshotsInProgress.entries().isEmpty(); + return snapshotsInProgress != null && snapshotsInProgress.isEmpty(); }).orElse(false), TimeUnit.MINUTES.toMillis(1L)); clearDisruptionsAndAwaitSync(); @@ -433,7 +432,7 @@ public void testSnapshotWithNodeDisconnects() { .orElseThrow(() -> new AssertionError("expected to find at least one active master node")); SnapshotsInProgress finalSnapshotsInProgress = randomMaster.clusterService.state() .custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY); - assertThat(finalSnapshotsInProgress.entries(), empty()); + assertTrue(finalSnapshotsInProgress.isEmpty()); final Repository repository = randomMaster.repositoriesService.repository(repoName); Collection snapshotIds = getRepositoryData(repository).getSnapshotIds(); if (snapshotNeverStarted.get()) { @@ -491,7 +490,7 @@ public void testSnapshotDeleteWithMasterFailover() { final TestClusterNodes.TestClusterNode randomMaster = testClusterNodes.randomMasterNode() .orElseThrow(() -> new AssertionError("expected to find at least one active master node")); SnapshotsInProgress finalSnapshotsInProgress = randomMaster.clusterService.state().custom(SnapshotsInProgress.TYPE); - assertThat(finalSnapshotsInProgress.entries(), empty()); + assertTrue(finalSnapshotsInProgress.isEmpty()); final Repository repository = randomMaster.repositoriesService.repository(repoName); Collection snapshotIds = getRepositoryData(repository).getSnapshotIds(); assertThat(snapshotIds, hasSize(0)); @@ -524,7 +523,7 @@ public void testConcurrentSnapshotCreateAndDelete() { masterNode.clusterService.addListener(new ClusterStateListener() { @Override public void clusterChanged(ClusterChangedEvent event) { - if (event.state().custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY).entries().isEmpty() == false) { + if (event.state().custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY).isEmpty() == false) { client().admin().cluster().prepareDeleteSnapshot(repoName, snapshotName).execute(deleteSnapshotStepListener); masterNode.clusterService.removeListener(this); } @@ -550,8 +549,7 @@ public void clusterChanged(ClusterChangedEvent event) { assertNotNull(createSnapshotResponseStepListener.result()); assertNotNull(createAnotherSnapshotResponseStepListener.result()); - SnapshotsInProgress finalSnapshotsInProgress = masterNode.clusterService.state().custom(SnapshotsInProgress.TYPE); - assertFalse(finalSnapshotsInProgress.entries().stream().anyMatch(entry -> entry.state().completed() == false)); + assertTrue(masterNode.clusterService.state().custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY).isEmpty()); final Repository repository = masterNode.repositoriesService.repository(repoName); Collection snapshotIds = getRepositoryData(repository).getSnapshotIds(); assertThat(snapshotIds, hasSize(1)); @@ -622,8 +620,7 @@ public void testConcurrentSnapshotCreateAndDeleteOther() { deterministicTaskQueue.runAllRunnableTasks(); - SnapshotsInProgress finalSnapshotsInProgress = masterNode.clusterService.state().custom(SnapshotsInProgress.TYPE); - assertFalse(finalSnapshotsInProgress.entries().stream().anyMatch(entry -> entry.state().completed() == false)); + assertTrue(masterNode.clusterService.state().custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY).isEmpty()); final Repository repository = masterNode.repositoriesService.repository(repoName); Collection snapshotIds = getRepositoryData(repository).getSnapshotIds(); // We end up with two snapshots no matter if the delete worked out or not @@ -685,8 +682,7 @@ public void testBulkSnapshotDeleteWithAbort() { deterministicTaskQueue.runAllRunnableTasks(); - SnapshotsInProgress finalSnapshotsInProgress = masterNode.clusterService.state().custom(SnapshotsInProgress.TYPE); - assertFalse(finalSnapshotsInProgress.entries().stream().anyMatch(entry -> entry.state().completed() == false)); + assertTrue(masterNode.clusterService.state().custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY).isEmpty()); final Repository repository = masterNode.repositoriesService.repository(repoName); Collection snapshotIds = getRepositoryData(repository).getSnapshotIds(); // No snapshots should be left in the repository @@ -868,8 +864,7 @@ public void onFailure(Exception e) { deterministicTaskQueue.runAllRunnableTasks(); - SnapshotsInProgress finalSnapshotsInProgress = masterNode.clusterService.state().custom(SnapshotsInProgress.TYPE); - assertFalse(finalSnapshotsInProgress.entries().stream().anyMatch(entry -> entry.state().completed() == false)); + assertTrue(masterNode.clusterService.state().custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY).isEmpty()); final Repository repository = masterNode.repositoriesService.repository(repoName); final RepositoryData repositoryData = getRepositoryData(repository); Collection snapshotIds = repositoryData.getSnapshotIds(); @@ -1045,17 +1040,16 @@ public void run() { if (createdSnapshot.get() == false) { return false; } - return master.clusterService.state().custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY).entries().isEmpty(); + return master.clusterService.state().custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY).isEmpty(); }).orElse(false), TimeUnit.MINUTES.toMillis(1L)); clearDisruptionsAndAwaitSync(); assertTrue(createdSnapshot.get()); - assertThat( + assertTrue( testClusterNodes.randomDataNodeSafe().clusterService.state() .custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY) - .entries(), - empty() + .isEmpty() ); final Repository repository = testClusterNodes.randomMasterNodeSafe().repositoriesService.repository(repoName); Collection snapshotIds = getRepositoryData(repository).getSnapshotIds(); @@ -1147,8 +1141,7 @@ public void testSuccessfulSnapshotWithConcurrentDynamicMappingUpdates() { assertNotNull(createSnapshotResponseStepListener.result()); assertNotNull(restoreSnapshotResponseStepListener.result()); - SnapshotsInProgress finalSnapshotsInProgress = masterNode.clusterService.state().custom(SnapshotsInProgress.TYPE); - assertFalse(finalSnapshotsInProgress.entries().stream().anyMatch(entry -> entry.state().completed() == false)); + assertTrue(masterNode.clusterService.state().custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY).isEmpty()); final Repository repository = masterNode.repositoriesService.repository(repoName); Collection snapshotIds = getRepositoryData(repository).getSnapshotIds(); assertThat(snapshotIds, hasSize(1)); @@ -1214,8 +1207,7 @@ public void testRunConcurrentSnapshots() { }); runUntil(() -> doneIndexing.get() && doneSnapshotting.get(), TimeUnit.MINUTES.toMillis(5L)); - SnapshotsInProgress finalSnapshotsInProgress = masterNode.clusterService.state().custom(SnapshotsInProgress.TYPE); - assertFalse(finalSnapshotsInProgress.entries().stream().anyMatch(entry -> entry.state().completed() == false)); + assertTrue(masterNode.clusterService.state().custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY).isEmpty()); final Repository repository = masterNode.repositoriesService.repository(repoName); Collection snapshotIds = getRepositoryData(repository).getSnapshotIds(); assertThat(snapshotIds, hasSize(snapshotNames.size())); diff --git a/server/src/test/java/org/elasticsearch/snapshots/SnapshotsInProgressSerializationTests.java b/server/src/test/java/org/elasticsearch/snapshots/SnapshotsInProgressSerializationTests.java index 798858673a3c7..33a3997de2bc4 100644 --- a/server/src/test/java/org/elasticsearch/snapshots/SnapshotsInProgressSerializationTests.java +++ b/server/src/test/java/org/elasticsearch/snapshots/SnapshotsInProgressSerializationTests.java @@ -51,11 +51,11 @@ public class SnapshotsInProgressSerializationTests extends AbstractDiffableWireS @Override protected Custom createTestInstance() { int numberOfSnapshots = randomInt(10); - List entries = new ArrayList<>(); + SnapshotsInProgress snapshotsInProgress = SnapshotsInProgress.EMPTY; for (int i = 0; i < numberOfSnapshots; i++) { - entries.add(randomSnapshot()); + snapshotsInProgress.withAddedEntry(randomSnapshot()); } - return SnapshotsInProgress.of(entries); + return snapshotsInProgress; } private Entry randomSnapshot() { @@ -121,30 +121,43 @@ protected Writeable.Reader instanceReader() { @Override protected Custom makeTestChanges(Custom testInstance) { - SnapshotsInProgress snapshots = (SnapshotsInProgress) testInstance; - List entries = new ArrayList<>(snapshots.entries()); - if (randomBoolean() && entries.size() > 1) { + final SnapshotsInProgress snapshots = (SnapshotsInProgress) testInstance; + SnapshotsInProgress updatedInstance = SnapshotsInProgress.EMPTY; + if (randomBoolean() && snapshots.count() > 1) { // remove some elements - int leaveElements = randomIntBetween(0, entries.size() - 1); - entries = randomSubsetOf(leaveElements, entries.toArray(new Entry[leaveElements])); + int leaveElements = randomIntBetween(0, snapshots.count() - 1); + for (List entriesForRepo : snapshots.entriesByRepo()) { + for (Entry entry : entriesForRepo) { + if (updatedInstance.count() == leaveElements) { + break; + } + if (randomBoolean()) { + updatedInstance = updatedInstance.withAddedEntry(entry); + } + } + } } if (randomBoolean()) { // add some elements int addElements = randomInt(10); for (int i = 0; i < addElements; i++) { - entries.add(randomSnapshot()); + updatedInstance = updatedInstance.withAddedEntry(randomSnapshot()); } } if (randomBoolean()) { // modify some elements - for (int i = 0; i < entries.size(); i++) { - if (randomBoolean()) { - final Entry entry = entries.get(i); - entries.set(i, mutateEntry(entry)); + for (List perRepoEntries : updatedInstance.entriesByRepo()) { + final List entries = new ArrayList<>(perRepoEntries); + for (int i = 0; i < entries.size(); i++) { + if (randomBoolean()) { + final Entry entry = entries.get(i); + entries.set(i, mutateEntry(entry)); + } } + updatedInstance = updatedInstance.withUpdatedEntriesForRepo(perRepoEntries.get(0).repository(), entries); } } - return SnapshotsInProgress.of(entries); + return updatedInstance; } @Override @@ -159,22 +172,22 @@ protected NamedWriteableRegistry getNamedWriteableRegistry() { @Override protected Custom mutateInstance(Custom instance) { - List entries = new ArrayList<>(((SnapshotsInProgress) instance).entries()); - if (false || entries.isEmpty()) { + final SnapshotsInProgress snapshotsInProgress = (SnapshotsInProgress) instance; + if (snapshotsInProgress.isEmpty()) { // add or remove an entry - boolean addEntry = entries.isEmpty() ? true : randomBoolean(); - if (addEntry) { - entries.add(randomSnapshot()); - } else { - entries.remove(randomIntBetween(0, entries.size() - 1)); - } + return snapshotsInProgress.withAddedEntry(randomSnapshot()); } else { // mutate an entry - int index = randomIntBetween(0, entries.size() - 1); - Entry entry = entries.get(index); - entries.set(index, mutateEntry(entry)); + final String repo = randomFrom( + snapshotsInProgress.asStream().map(SnapshotsInProgress.Entry::repository).collect(Collectors.toSet()) + ); + final List forRepo = snapshotsInProgress.forRepo(repo); + int index = randomIntBetween(0, forRepo.size() - 1); + Entry entry = forRepo.get(index); + final List updatedEntries = new ArrayList<>(forRepo); + updatedEntries.set(index, mutateEntry(entry)); + return snapshotsInProgress.withUpdatedEntriesForRepo(repo, updatedEntries); } - return SnapshotsInProgress.of(entries); } private Entry mutateEntry(Entry entry) { @@ -360,40 +373,38 @@ private Entry mutateEntry(Entry entry) { public void testXContent() throws IOException { final IndexId indexId = new IndexId("index", "uuid"); - SnapshotsInProgress sip = SnapshotsInProgress.of( - Collections.singletonList( - new Entry( - new Snapshot("repo", new SnapshotId("name", "uuid")), - true, - true, - State.SUCCESS, - Collections.singletonMap(indexId.getName(), indexId), - Collections.emptyList(), - Collections.emptyList(), - 1234567, - 0, - ImmutableOpenMap.builder() - .fPut( - new ShardId("index", "uuid", 0), - SnapshotsInProgress.ShardSnapshotStatus.success( - "nodeId", - new ShardSnapshotResult(new ShardGeneration("shardgen"), new ByteSizeValue(1L), 1) - ) + SnapshotsInProgress sip = SnapshotsInProgress.EMPTY.withAddedEntry( + new Entry( + new Snapshot("repo", new SnapshotId("name", "uuid")), + true, + true, + State.SUCCESS, + Collections.singletonMap(indexId.getName(), indexId), + Collections.emptyList(), + Collections.emptyList(), + 1234567, + 0, + ImmutableOpenMap.builder() + .fPut( + new ShardId("index", "uuid", 0), + SnapshotsInProgress.ShardSnapshotStatus.success( + "nodeId", + new ShardSnapshotResult(new ShardGeneration("shardgen"), new ByteSizeValue(1L), 1) ) - .fPut( - new ShardId("index", "uuid", 1), - new SnapshotsInProgress.ShardSnapshotStatus( - "nodeId", - ShardState.FAILED, - "failure-reason", - new ShardGeneration("fail-gen") - ) + ) + .fPut( + new ShardId("index", "uuid", 1), + new SnapshotsInProgress.ShardSnapshotStatus( + "nodeId", + ShardState.FAILED, + "failure-reason", + new ShardGeneration("fail-gen") ) - .build(), - null, - null, - Version.CURRENT - ) + ) + .build(), + null, + null, + Version.CURRENT ) ); diff --git a/server/src/test/java/org/elasticsearch/snapshots/SnapshotsServiceTests.java b/server/src/test/java/org/elasticsearch/snapshots/SnapshotsServiceTests.java index 7330792bd8602..85ee5f07be38d 100644 --- a/server/src/test/java/org/elasticsearch/snapshots/SnapshotsServiceTests.java +++ b/server/src/test/java/org/elasticsearch/snapshots/SnapshotsServiceTests.java @@ -53,7 +53,7 @@ public void testNoopShardStateUpdates() throws Exception { final String indexName1 = "index-1"; final ShardId shardId1 = new ShardId(index(indexName1), 0); { - final ClusterState state = stateWithSnapshots(snapshotNoShards); + final ClusterState state = stateWithSnapshots(repoName, snapshotNoShards); final SnapshotsService.ShardSnapshotUpdate shardCompletion = new SnapshotsService.ShardSnapshotUpdate( snapshot, shardId1, @@ -64,6 +64,7 @@ public void testNoopShardStateUpdates() throws Exception { { final IndexId indexId = indexId(indexName1); final ClusterState state = stateWithSnapshots( + repoName, snapshotEntry(snapshot, Collections.singletonMap(indexId.getName(), indexId), shardsMap(shardId1, initShardStatus(uuid()))) ); final SnapshotsService.ShardSnapshotUpdate shardCompletion = new SnapshotsService.ShardSnapshotUpdate( @@ -91,9 +92,9 @@ public void testUpdateSnapshotToSuccess() throws Exception { assertThat(snapshotSingleShard.state(), is(SnapshotsInProgress.State.STARTED)); final SnapshotsService.ShardSnapshotUpdate completeShard = successUpdate(sn1, shardId1, dataNodeId); - final ClusterState updatedClusterState = applyUpdates(stateWithSnapshots(snapshotSingleShard), completeShard); + final ClusterState updatedClusterState = applyUpdates(stateWithSnapshots(repoName, snapshotSingleShard), completeShard); final SnapshotsInProgress snapshotsInProgress = updatedClusterState.custom(SnapshotsInProgress.TYPE); - final SnapshotsInProgress.Entry updatedSnapshot1 = snapshotsInProgress.entries().get(0); + final SnapshotsInProgress.Entry updatedSnapshot1 = snapshotsInProgress.forRepo(repoName).get(0); assertThat(updatedSnapshot1.state(), is(SnapshotsInProgress.State.SUCCESS)); assertIsNoop(updatedClusterState, completeShard); } @@ -117,9 +118,9 @@ public void testUpdateSnapshotMultipleShards() throws Exception { assertThat(snapshotSingleShard.state(), is(SnapshotsInProgress.State.STARTED)); final SnapshotsService.ShardSnapshotUpdate completeShard = successUpdate(sn1, shardId1, dataNodeId); - final ClusterState updatedClusterState = applyUpdates(stateWithSnapshots(snapshotSingleShard), completeShard); + final ClusterState updatedClusterState = applyUpdates(stateWithSnapshots(repoName, snapshotSingleShard), completeShard); final SnapshotsInProgress snapshotsInProgress = updatedClusterState.custom(SnapshotsInProgress.TYPE); - final SnapshotsInProgress.Entry updatedSnapshot1 = snapshotsInProgress.entries().get(0); + final SnapshotsInProgress.Entry updatedSnapshot1 = snapshotsInProgress.forRepo(repoName).get(0); assertThat(updatedSnapshot1.state(), is(SnapshotsInProgress.State.STARTED)); assertIsNoop(updatedClusterState, completeShard); } @@ -141,9 +142,9 @@ public void testUpdateCloneToSuccess() throws Exception { assertThat(cloneSingleShard.state(), is(SnapshotsInProgress.State.STARTED)); final SnapshotsService.ShardSnapshotUpdate completeShard = successUpdate(targetSnapshot, shardId1, dataNodeId); - final ClusterState updatedClusterState = applyUpdates(stateWithSnapshots(cloneSingleShard), completeShard); + final ClusterState updatedClusterState = applyUpdates(stateWithSnapshots(repoName, cloneSingleShard), completeShard); final SnapshotsInProgress snapshotsInProgress = updatedClusterState.custom(SnapshotsInProgress.TYPE); - final SnapshotsInProgress.Entry updatedSnapshot1 = snapshotsInProgress.entries().get(0); + final SnapshotsInProgress.Entry updatedSnapshot1 = snapshotsInProgress.forRepo(repoName).get(0); assertThat(updatedSnapshot1.state(), is(SnapshotsInProgress.State.SUCCESS)); assertIsNoop(updatedClusterState, completeShard); } @@ -167,9 +168,9 @@ public void testUpdateCloneMultipleShards() throws Exception { assertThat(cloneMultipleShards.state(), is(SnapshotsInProgress.State.STARTED)); final SnapshotsService.ShardSnapshotUpdate completeShard = successUpdate(targetSnapshot, shardId1, dataNodeId); - final ClusterState updatedClusterState = applyUpdates(stateWithSnapshots(cloneMultipleShards), completeShard); + final ClusterState updatedClusterState = applyUpdates(stateWithSnapshots(repoName, cloneMultipleShards), completeShard); final SnapshotsInProgress snapshotsInProgress = updatedClusterState.custom(SnapshotsInProgress.TYPE); - final SnapshotsInProgress.Entry updatedSnapshot1 = snapshotsInProgress.entries().get(0); + final SnapshotsInProgress.Entry updatedSnapshot1 = snapshotsInProgress.forRepo(repoName).get(0); assertThat(updatedSnapshot1.state(), is(SnapshotsInProgress.State.STARTED)); assertIsNoop(updatedClusterState, completeShard); } @@ -201,14 +202,19 @@ public void testCompletedCloneStartsSnapshot() throws Exception { assertThat(cloneSingleShard.state(), is(SnapshotsInProgress.State.STARTED)); // 1. case: shard that just finished cloning is unassigned -> shard snapshot should go to MISSING state - final ClusterState stateWithUnassignedRoutingShard = stateWithSnapshots(stateWithIndex, cloneSingleShard, snapshotSingleShard); + final ClusterState stateWithUnassignedRoutingShard = stateWithSnapshots( + stateWithIndex, + repoName, + cloneSingleShard, + snapshotSingleShard + ); final SnapshotsService.ShardSnapshotUpdate completeShardClone = successUpdate(targetSnapshot, shardId1, uuid()); { final ClusterState updatedClusterState = applyUpdates(stateWithUnassignedRoutingShard, completeShardClone); final SnapshotsInProgress snapshotsInProgress = updatedClusterState.custom(SnapshotsInProgress.TYPE); - final SnapshotsInProgress.Entry completedClone = snapshotsInProgress.entries().get(0); + final SnapshotsInProgress.Entry completedClone = snapshotsInProgress.forRepo(repoName).get(0); assertThat(completedClone.state(), is(SnapshotsInProgress.State.SUCCESS)); - final SnapshotsInProgress.Entry startedSnapshot = snapshotsInProgress.entries().get(1); + final SnapshotsInProgress.Entry startedSnapshot = snapshotsInProgress.forRepo(repoName).get(1); assertThat(startedSnapshot.state(), is(SnapshotsInProgress.State.SUCCESS)); assertThat(startedSnapshot.shards().get(routingShardId1).state(), is(SnapshotsInProgress.ShardState.MISSING)); assertIsNoop(updatedClusterState, completeShardClone); @@ -232,9 +238,9 @@ public void testCompletedCloneStartsSnapshot() throws Exception { { final ClusterState updatedClusterState = applyUpdates(stateWithAssignedRoutingShard, completeShardClone); final SnapshotsInProgress snapshotsInProgress = updatedClusterState.custom(SnapshotsInProgress.TYPE); - final SnapshotsInProgress.Entry completedClone = snapshotsInProgress.entries().get(0); + final SnapshotsInProgress.Entry completedClone = snapshotsInProgress.forRepo(repoName).get(0); assertThat(completedClone.state(), is(SnapshotsInProgress.State.SUCCESS)); - final SnapshotsInProgress.Entry startedSnapshot = snapshotsInProgress.entries().get(1); + final SnapshotsInProgress.Entry startedSnapshot = snapshotsInProgress.forRepo(repoName).get(1); assertThat(startedSnapshot.state(), is(SnapshotsInProgress.State.STARTED)); final SnapshotsInProgress.ShardSnapshotStatus shardSnapshotStatus = startedSnapshot.shards().get(routingShardId1); assertThat(shardSnapshotStatus.state(), is(SnapshotsInProgress.ShardState.INIT)); @@ -260,9 +266,9 @@ public void testCompletedCloneStartsSnapshot() throws Exception { { final ClusterState updatedClusterState = applyUpdates(stateWithInitializingRoutingShard, completeShardClone); final SnapshotsInProgress snapshotsInProgress = updatedClusterState.custom(SnapshotsInProgress.TYPE); - final SnapshotsInProgress.Entry completedClone = snapshotsInProgress.entries().get(0); + final SnapshotsInProgress.Entry completedClone = snapshotsInProgress.forRepo(repoName).get(0); assertThat(completedClone.state(), is(SnapshotsInProgress.State.SUCCESS)); - final SnapshotsInProgress.Entry startedSnapshot = snapshotsInProgress.entries().get(1); + final SnapshotsInProgress.Entry startedSnapshot = snapshotsInProgress.forRepo(repoName).get(1); assertThat(startedSnapshot.state(), is(SnapshotsInProgress.State.STARTED)); assertThat(startedSnapshot.shards().get(routingShardId1).state(), is(SnapshotsInProgress.ShardState.WAITING)); assertIsNoop(updatedClusterState, completeShardClone); @@ -296,11 +302,14 @@ public void testCompletedSnapshotStartsClone() throws Exception { final SnapshotsService.ShardSnapshotUpdate completeShard = successUpdate(plainSnapshot, routingShardId, dataNodeId); - final ClusterState updatedClusterState = applyUpdates(stateWithSnapshots(snapshotSingleShard, cloneSingleShard), completeShard); + final ClusterState updatedClusterState = applyUpdates( + stateWithSnapshots(repoName, snapshotSingleShard, cloneSingleShard), + completeShard + ); final SnapshotsInProgress snapshotsInProgress = updatedClusterState.custom(SnapshotsInProgress.TYPE); - final SnapshotsInProgress.Entry completedClone = snapshotsInProgress.entries().get(0); + final SnapshotsInProgress.Entry completedClone = snapshotsInProgress.forRepo(repoName).get(0); assertThat(completedClone.state(), is(SnapshotsInProgress.State.SUCCESS)); - final SnapshotsInProgress.Entry startedSnapshot = snapshotsInProgress.entries().get(1); + final SnapshotsInProgress.Entry startedSnapshot = snapshotsInProgress.forRepo(repoName).get(1); assertThat(startedSnapshot.state(), is(SnapshotsInProgress.State.STARTED)); final SnapshotsInProgress.ShardSnapshotStatus shardCloneStatus = startedSnapshot.shardsByRepoShardId().get(repositoryShardId); assertThat(shardCloneStatus.state(), is(SnapshotsInProgress.ShardState.INIT)); @@ -333,13 +342,13 @@ public void testCompletedSnapshotStartsNextSnapshot() throws Exception { final SnapshotsService.ShardSnapshotUpdate completeShard = successUpdate(plainSnapshot, routingShardId, dataNodeId); final ClusterState updatedClusterState = applyUpdates( - stateWithSnapshots(snapshotSingleShard, queuedSnapshotSingleShard), + stateWithSnapshots(repoName, snapshotSingleShard, queuedSnapshotSingleShard), completeShard ); final SnapshotsInProgress snapshotsInProgress = updatedClusterState.custom(SnapshotsInProgress.TYPE); - final SnapshotsInProgress.Entry completedSnapshot = snapshotsInProgress.entries().get(0); + final SnapshotsInProgress.Entry completedSnapshot = snapshotsInProgress.forRepo(repoName).get(0); assertThat(completedSnapshot.state(), is(SnapshotsInProgress.State.SUCCESS)); - final SnapshotsInProgress.Entry startedSnapshot = snapshotsInProgress.entries().get(1); + final SnapshotsInProgress.Entry startedSnapshot = snapshotsInProgress.forRepo(repoName).get(1); assertThat(startedSnapshot.state(), is(SnapshotsInProgress.State.STARTED)); final SnapshotsInProgress.ShardSnapshotStatus shardSnapshotStatus = startedSnapshot.shards().get(routingShardId); assertThat(shardSnapshotStatus.state(), is(SnapshotsInProgress.ShardState.INIT)); @@ -372,6 +381,7 @@ public void testCompletedCloneStartsNextClone() throws Exception { final ClusterState stateWithUnassignedRoutingShard = stateWithSnapshots( ClusterState.builder(ClusterState.EMPTY_STATE).nodes(discoveryNodes(masterNodeId)).build(), + repoName, cloneSingleShard, queuedClone ); @@ -379,9 +389,9 @@ public void testCompletedCloneStartsNextClone() throws Exception { final ClusterState updatedClusterState = applyUpdates(stateWithUnassignedRoutingShard, completeShardClone); final SnapshotsInProgress snapshotsInProgress = updatedClusterState.custom(SnapshotsInProgress.TYPE); - final SnapshotsInProgress.Entry completedClone = snapshotsInProgress.entries().get(0); + final SnapshotsInProgress.Entry completedClone = snapshotsInProgress.forRepo(repoName).get(0); assertThat(completedClone.state(), is(SnapshotsInProgress.State.SUCCESS)); - final SnapshotsInProgress.Entry startedSnapshot = snapshotsInProgress.entries().get(1); + final SnapshotsInProgress.Entry startedSnapshot = snapshotsInProgress.forRepo(repoName).get(1); assertThat(startedSnapshot.state(), is(SnapshotsInProgress.State.STARTED)); assertThat(startedSnapshot.shardsByRepoShardId().get(shardId1).state(), is(SnapshotsInProgress.ShardState.INIT)); assertIsNoop(updatedClusterState, completeShardClone); @@ -392,6 +402,7 @@ public void testSnapshottingIndicesExcludesClones() { final String indexName = "index"; final ClusterState clusterState = stateWithSnapshots( stateWithUnassignedIndices(indexName), + repoName, cloneEntry( snapshot(repoName, "target-snapshot"), snapshot(repoName, "source-snapshot").getSnapshotId(), @@ -451,15 +462,19 @@ private static ClusterState stateWithUnassignedIndices(String... indexNames) { return ClusterState.builder(ClusterState.EMPTY_STATE).metadata(metaBuilder).routingTable(routingTable.build()).build(); } - private static ClusterState stateWithSnapshots(ClusterState state, SnapshotsInProgress.Entry... entries) { + private static ClusterState stateWithSnapshots(ClusterState state, String repository, SnapshotsInProgress.Entry... entries) { return ClusterState.builder(state) .version(state.version() + 1L) - .putCustom(SnapshotsInProgress.TYPE, SnapshotsInProgress.of(Arrays.asList(entries))) + .putCustom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY.withUpdatedEntriesForRepo(repository, Arrays.asList(entries))) .build(); } - private static ClusterState stateWithSnapshots(SnapshotsInProgress.Entry... entries) { - return stateWithSnapshots(ClusterState.builder(ClusterState.EMPTY_STATE).nodes(discoveryNodes(uuid())).build(), entries); + private static ClusterState stateWithSnapshots(String repository, SnapshotsInProgress.Entry... entries) { + return stateWithSnapshots( + ClusterState.builder(ClusterState.EMPTY_STATE).nodes(discoveryNodes(uuid())).build(), + repository, + entries + ); } private static void assertIsNoop(ClusterState state, SnapshotsService.ShardSnapshotUpdate shardCompletion) throws Exception { diff --git a/test/framework/src/main/java/org/elasticsearch/snapshots/AbstractSnapshotIntegTestCase.java b/test/framework/src/main/java/org/elasticsearch/snapshots/AbstractSnapshotIntegTestCase.java index da47b230e47c5..1893e9fcccdbb 100644 --- a/test/framework/src/main/java/org/elasticsearch/snapshots/AbstractSnapshotIntegTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/snapshots/AbstractSnapshotIntegTestCase.java @@ -518,7 +518,7 @@ protected void awaitNoMoreRunningOperations(String viaNode) throws Exception { awaitClusterState( logger, viaNode, - state -> state.custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY).entries().isEmpty() + state -> state.custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY).isEmpty() && state.custom(SnapshotDeletionsInProgress.TYPE, SnapshotDeletionsInProgress.EMPTY) .hasDeletionsInProgress() == false ); @@ -563,14 +563,12 @@ public static ActionFuture startFullSnapshot(Logger logg protected void awaitNumberOfSnapshotsInProgress(int count) throws Exception { logger.info("--> wait for [{}] snapshots to show up in the cluster state", count); - awaitClusterState(state -> - state.custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY).entries().size() == count); + awaitClusterState(state -> state.custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY).count() == count); } public static void awaitNumberOfSnapshotsInProgress(Logger logger, int count) throws Exception { logger.info("--> wait for [{}] snapshots to show up in the cluster state", count); - awaitClusterState(logger, state -> - state.custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY).entries().size() == count); + awaitClusterState(logger, state -> state.custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY).count() == count); } protected SnapshotInfo assertSuccessful(ActionFuture future) throws Exception { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/AsyncRetryDuringSnapshotActionStep.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/AsyncRetryDuringSnapshotActionStep.java index 5a45993eb8ac9..a6e8b51b6d0a1 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/AsyncRetryDuringSnapshotActionStep.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/AsyncRetryDuringSnapshotActionStep.java @@ -22,6 +22,8 @@ import org.elasticsearch.node.NodeClosedException; import org.elasticsearch.snapshots.SnapshotInProgressException; +import java.util.List; + /** * This is an abstract AsyncActionStep that wraps the performed action listener, checking to see * if the action fails due to a snapshot being in progress. If a snapshot is in progress, it @@ -124,11 +126,13 @@ public void onTimeout(TimeValue timeout) { // The index has since been deleted, mission accomplished! return true; } - for (SnapshotsInProgress.Entry snapshot : - state.custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY).entries()) { - if (snapshot.indices().containsKey(indexName)) { - // There is a snapshot running with this index name - return false; + for (List snapshots : + state.custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY).entriesByRepo()) { + for (SnapshotsInProgress.Entry snapshot : snapshots) { + if (snapshot.indices().containsKey(indexName)) { + // There is a snapshot running with this index name + return false; + } } } // There are no snapshots for this index, so it's okay to proceed with this state diff --git a/x-pack/plugin/data-streams/src/test/java/org/elasticsearch/xpack/datastreams/action/DeleteDataStreamTransportActionTests.java b/x-pack/plugin/data-streams/src/test/java/org/elasticsearch/xpack/datastreams/action/DeleteDataStreamTransportActionTests.java index f802e094fd727..4f34aa33cc131 100644 --- a/x-pack/plugin/data-streams/src/test/java/org/elasticsearch/xpack/datastreams/action/DeleteDataStreamTransportActionTests.java +++ b/x-pack/plugin/data-streams/src/test/java/org/elasticsearch/xpack/datastreams/action/DeleteDataStreamTransportActionTests.java @@ -93,9 +93,8 @@ public void testDeleteSnapshottingDataStream() { List.of(new Tuple<>(dataStreamName, 2), new Tuple<>(dataStreamName2, 2)), otherIndices ); - SnapshotsInProgress snapshotsInProgress = SnapshotsInProgress.of( - List.of(createEntry(dataStreamName, "repo1", false), createEntry(dataStreamName2, "repo2", true)) - ); + SnapshotsInProgress snapshotsInProgress = SnapshotsInProgress.EMPTY.withAddedEntry(createEntry(dataStreamName, "repo1", false)) + .withAddedEntry(createEntry(dataStreamName2, "repo2", true)); ClusterState snapshotCs = ClusterState.builder(cs).putCustom(SnapshotsInProgress.TYPE, snapshotsInProgress).build(); DeleteDataStreamAction.Request req = new DeleteDataStreamAction.Request(new String[] { dataStreamName }); diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/slm/action/TransportGetSnapshotLifecycleAction.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/slm/action/TransportGetSnapshotLifecycleAction.java index ff67407d6c367..45ddca0c84817 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/slm/action/TransportGetSnapshotLifecycleAction.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/slm/action/TransportGetSnapshotLifecycleAction.java @@ -67,16 +67,18 @@ protected void masterOperation(final Task task, final GetSnapshotLifecycleAction inProgress = Collections.emptyMap(); } else { inProgress = new HashMap<>(); - for (SnapshotsInProgress.Entry entry : sip.entries()) { - Map meta = entry.userMetadata(); - if (meta == null || - meta.get(SnapshotsService.POLICY_ID_METADATA_FIELD) == null || - (meta.get(SnapshotsService.POLICY_ID_METADATA_FIELD) instanceof String == false)) { - continue; - } + for (List entriesForRepo : sip.entriesByRepo()) { + for (SnapshotsInProgress.Entry entry : entriesForRepo) { + Map meta = entry.userMetadata(); + if (meta == null || + meta.get(SnapshotsService.POLICY_ID_METADATA_FIELD) == null || + (meta.get(SnapshotsService.POLICY_ID_METADATA_FIELD) instanceof String == false)) { + continue; + } - String policyId = (String) meta.get(SnapshotsService.POLICY_ID_METADATA_FIELD); - inProgress.put(policyId, SnapshotLifecyclePolicyItem.SnapshotInProgress.fromEntry(entry)); + String policyId = (String) meta.get(SnapshotsService.POLICY_ID_METADATA_FIELD); + inProgress.put(policyId, SnapshotLifecyclePolicyItem.SnapshotInProgress.fromEntry(entry)); + } } } diff --git a/x-pack/plugin/repository-encrypted/src/internalClusterTest/java/org/elasticsearch/repositories/encrypted/EncryptedRepositorySecretIntegTests.java b/x-pack/plugin/repository-encrypted/src/internalClusterTest/java/org/elasticsearch/repositories/encrypted/EncryptedRepositorySecretIntegTests.java index dd85c619d580c..9d92c6b3967c7 100644 --- a/x-pack/plugin/repository-encrypted/src/internalClusterTest/java/org/elasticsearch/repositories/encrypted/EncryptedRepositorySecretIntegTests.java +++ b/x-pack/plugin/repository-encrypted/src/internalClusterTest/java/org/elasticsearch/repositories/encrypted/EncryptedRepositorySecretIntegTests.java @@ -773,9 +773,9 @@ public SnapshotInfo waitForCompletion(String repository, String snapshotName, Ti return snapshotInfos.get(0); } else { boolean found = false; - for (SnapshotsInProgress.Entry entry : snapshotsInProgress.entries()) { + for (SnapshotsInProgress.Entry entry : snapshotsInProgress.forRepo(repository)) { final Snapshot curr = entry.snapshot(); - if (curr.getRepository().equals(repository) && curr.getSnapshotId().getName().equals(snapshotName)) { + if (curr.getSnapshotId().getName().equals(snapshotName)) { found = true; break; } diff --git a/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/ClusterPrivilegeIntegrationTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/ClusterPrivilegeIntegrationTests.java index aa84feddcce92..07b694ee7d94d 100644 --- a/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/ClusterPrivilegeIntegrationTests.java +++ b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/ClusterPrivilegeIntegrationTests.java @@ -14,7 +14,6 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.test.SecuritySettingsSourceField; import org.elasticsearch.xpack.core.security.authc.support.Hasher; -import org.hamcrest.Matchers; import org.junit.AfterClass; import org.junit.BeforeClass; @@ -236,7 +235,7 @@ private void waitForSnapshotToFinish(String repo, String snapshot) throws Except // it to disappear from the cluster state as well SnapshotsInProgress snapshotsInProgress = client().admin().cluster().state(new ClusterStateRequest()).get().getState().custom(SnapshotsInProgress.TYPE); - assertThat(snapshotsInProgress.entries(), Matchers.empty()); + assertTrue(snapshotsInProgress.isEmpty()); }); } } diff --git a/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/SecurityFeatureStateIntegTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/SecurityFeatureStateIntegTests.java index c3967c799c224..67dc91bce3c48 100644 --- a/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/SecurityFeatureStateIntegTests.java +++ b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/SecurityFeatureStateIntegTests.java @@ -19,7 +19,6 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.test.SecuritySettingsSourceField; import org.elasticsearch.xpack.core.security.authc.support.UsernamePasswordToken; -import org.hamcrest.Matchers; import org.junit.AfterClass; import org.junit.BeforeClass; @@ -168,7 +167,7 @@ private void waitForSnapshotToFinish(String repo, String snapshot) throws Except // it to disappear from the cluster state as well SnapshotsInProgress snapshotsInProgress = client().admin().cluster().state(new ClusterStateRequest()).get().getState().custom(SnapshotsInProgress.TYPE); - assertThat(snapshotsInProgress.entries(), Matchers.empty()); + assertTrue(snapshotsInProgress.isEmpty()); }); } } From abdf8fe248542ee34008bfb35893badb51e7a517 Mon Sep 17 00:00:00 2001 From: Valeriy Khakhutskyy <1292899+valeriy42@users.noreply.github.com> Date: Mon, 4 Oct 2021 11:17:27 +0200 Subject: [PATCH 113/250] Mute "tsdb" yaml test (#78599) See #78598 --- .../resources/rest-api-spec/test/remote_cluster/10_basic.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qa/multi-cluster-search/src/test/resources/rest-api-spec/test/remote_cluster/10_basic.yml b/qa/multi-cluster-search/src/test/resources/rest-api-spec/test/remote_cluster/10_basic.yml index 5aa5bd659a1c2..4f61a09ef5414 100644 --- a/qa/multi-cluster-search/src/test/resources/rest-api-spec/test/remote_cluster/10_basic.yml +++ b/qa/multi-cluster-search/src/test/resources/rest-api-spec/test/remote_cluster/10_basic.yml @@ -156,8 +156,8 @@ --- tsdb: - skip: - version: " - 7.99.99" - reason: introduced in 8.0.0 + version: "all" + reason: "AwaitsFix https://github.com/elastic/elasticsearch/issues/78598" - do: indices.create: From 80792a1a820cb83eb68ff7a4f1921afcc3a7d042 Mon Sep 17 00:00:00 2001 From: Henning Andersen <33268011+henningandersen@users.noreply.github.com> Date: Mon, 4 Oct 2021 11:36:45 +0200 Subject: [PATCH 114/250] Fix aggregation memory leak for CCS (#78404) When a CCS search is proxied, the memory for the aggregations on the proxy node would not be freed. Now only use the non-copying byte referencing version on the coordinating node, which itself ensures that memory is freed by calling `consumeAggs`. --- .../search/ccs/CrossClusterSearchLeakIT.java | 146 ++++++++++++++++++ .../action/search/SearchTransportService.java | 2 +- .../common/io/stream/DelayableWriteable.java | 28 +++- .../search/query/QuerySearchResult.java | 24 ++- .../io/stream/DelayableWriteableTests.java | 12 +- .../search/query/QuerySearchResultTests.java | 8 +- .../test/AbstractMultiClustersTestCase.java | 2 + 7 files changed, 205 insertions(+), 17 deletions(-) create mode 100644 server/src/internalClusterTest/java/org/elasticsearch/search/ccs/CrossClusterSearchLeakIT.java diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/ccs/CrossClusterSearchLeakIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/ccs/CrossClusterSearchLeakIT.java new file mode 100644 index 0000000000000..4ff0089cdbb71 --- /dev/null +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/ccs/CrossClusterSearchLeakIT.java @@ -0,0 +1,146 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.search.ccs; + +import org.elasticsearch.action.ActionFuture; +import org.elasticsearch.action.search.ClearScrollRequest; +import org.elasticsearch.action.search.SearchRequest; +import org.elasticsearch.action.search.SearchResponse; +import org.elasticsearch.client.Client; +import org.elasticsearch.cluster.metadata.IndexMetadata; +import org.elasticsearch.cluster.node.DiscoveryNode; +import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.core.TimeValue; +import org.elasticsearch.index.query.MatchAllQueryBuilder; +import org.elasticsearch.search.aggregations.bucket.terms.Terms; +import org.elasticsearch.search.builder.SearchSourceBuilder; +import org.elasticsearch.test.AbstractMultiClustersTestCase; +import org.elasticsearch.test.InternalTestCluster; +import org.elasticsearch.transport.TransportService; +import org.hamcrest.Matchers; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.StreamSupport; + +import static org.elasticsearch.search.aggregations.AggregationBuilders.terms; +import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; +import static org.hamcrest.Matchers.equalTo; + +public class CrossClusterSearchLeakIT extends AbstractMultiClustersTestCase { + + @Override + protected Collection remoteClusterAlias() { + return List.of("cluster_a"); + } + + @Override + protected boolean reuseClusters() { + return false; + } + + private int indexDocs(Client client, String field, String index) { + int numDocs = between(1, 200); + for (int i = 0; i < numDocs; i++) { + client.prepareIndex(index).setSource(field, "v" + i).get(); + } + client.admin().indices().prepareRefresh(index).get(); + return numDocs; + } + + /** + * This test validates that we do not leak any memory when running CCS in various modes, actual validation is done by test framework + * (leak detection) + *
    + *
  • proxy vs non-proxy
  • + *
  • single-phase query-fetch or multi-phase
  • + *
  • minimize roundtrip vs not
  • + *
  • scroll vs no scroll
  • + *
+ */ + public void testSearch() throws Exception { + assertAcked(client(LOCAL_CLUSTER).admin().indices().prepareCreate("demo") + .setMapping("f", "type=keyword") + .setSettings(Settings.builder().put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, between(1, 3)))); + indexDocs(client(LOCAL_CLUSTER), "ignored", "demo"); + final InternalTestCluster remoteCluster = cluster("cluster_a"); + int minRemotes = between(2, 5); + remoteCluster.ensureAtLeastNumDataNodes(minRemotes); + List remoteDataNodes = StreamSupport.stream(remoteCluster.clusterService().state().nodes().spliterator(), false) + .filter(DiscoveryNode::canContainData) + .map(DiscoveryNode::getName) + .collect(Collectors.toList()); + assertThat(remoteDataNodes.size(), Matchers.greaterThanOrEqualTo(minRemotes)); + List seedNodes = randomSubsetOf(between(1, remoteDataNodes.size() - 1), remoteDataNodes); + disconnectFromRemoteClusters(); + configureRemoteCluster("cluster_a", seedNodes); + final Settings.Builder allocationFilter = Settings.builder(); + if (rarely()) { + allocationFilter.put("index.routing.allocation.include._name", String.join(",", seedNodes)); + } else { + // Provoke using proxy connections + allocationFilter.put("index.routing.allocation.exclude._name", String.join(",", seedNodes)); + } + assertAcked(client("cluster_a").admin().indices().prepareCreate("prod") + .setMapping("f", "type=keyword") + .setSettings(Settings.builder().put(allocationFilter.build()) + .put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0).put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, between(1, 3)))); + assertFalse(client("cluster_a").admin().cluster().prepareHealth("prod") + .setWaitForYellowStatus().setTimeout(TimeValue.timeValueSeconds(10)).get().isTimedOut()); + int docs = indexDocs(client("cluster_a"), "f", "prod"); + + List> futures = new ArrayList<>(); + for (int i = 0; i < 10; ++i) { + String[] indices = randomBoolean() ? new String[] { "demo", "cluster_a:prod" } : new String[] { "cluster_a:prod" }; + final SearchRequest searchRequest = new SearchRequest(indices); + searchRequest.allowPartialSearchResults(false); + boolean scroll = randomBoolean(); + searchRequest.source(new SearchSourceBuilder().query(new MatchAllQueryBuilder()) + .aggregation(terms("f").field("f").size(docs + between(scroll ? 1 : 0, 10))).size(between(0, 1000))); + if (scroll) { + searchRequest.scroll("30s"); + } + searchRequest.setCcsMinimizeRoundtrips(rarely()); + futures.add(client(LOCAL_CLUSTER).search(searchRequest)); + } + + for (ActionFuture future : futures) { + SearchResponse searchResponse = future.get(); + if (searchResponse.getScrollId() != null) { + ClearScrollRequest clearScrollRequest = new ClearScrollRequest(); + clearScrollRequest.scrollIds(List.of(searchResponse.getScrollId())); + client(LOCAL_CLUSTER).clearScroll(clearScrollRequest).get(); + } + + Terms terms = searchResponse.getAggregations().get("f"); + assertThat(terms.getBuckets().size(), equalTo(docs)); + for (Terms.Bucket bucket : terms.getBuckets()) { + assertThat(bucket.getDocCount(), equalTo(1L)); + } + } + } + + @Override + protected void configureRemoteCluster(String clusterAlias, Collection seedNodes) throws Exception { + if (rarely()) { + super.configureRemoteCluster(clusterAlias, seedNodes); + } else { + final Settings.Builder settings = Settings.builder(); + final String seedNode = randomFrom(seedNodes); + final TransportService transportService = cluster(clusterAlias).getInstance(TransportService.class, seedNode); + final String seedAddress = transportService.boundAddress().publishAddress().toString(); + + settings.put("cluster.remote." + clusterAlias + ".mode", "proxy"); + settings.put("cluster.remote." + clusterAlias + ".proxy_address", seedAddress); + client().admin().cluster().prepareUpdateSettings().setPersistentSettings(settings).get(); + } + } +} diff --git a/server/src/main/java/org/elasticsearch/action/search/SearchTransportService.java b/server/src/main/java/org/elasticsearch/action/search/SearchTransportService.java index abc400734d368..41860c52174d4 100644 --- a/server/src/main/java/org/elasticsearch/action/search/SearchTransportService.java +++ b/server/src/main/java/org/elasticsearch/action/search/SearchTransportService.java @@ -138,7 +138,7 @@ public void sendExecuteQuery(Transport.Connection connection, final ShardSearchR // we optimize this and expect a QueryFetchSearchResult if we only have a single shard in the search request // this used to be the QUERY_AND_FETCH which doesn't exist anymore. final boolean fetchDocuments = request.numberOfShards() == 1; - Writeable.Reader reader = fetchDocuments ? QueryFetchSearchResult::new : QuerySearchResult::new; + Writeable.Reader reader = fetchDocuments ? QueryFetchSearchResult::new : in -> new QuerySearchResult(in, true); final ActionListener handler = responseWrapper.apply(connection, listener); transportService.sendChildRequest(connection, QUERY_ACTION_NAME, request, task, diff --git a/server/src/main/java/org/elasticsearch/common/io/stream/DelayableWriteable.java b/server/src/main/java/org/elasticsearch/common/io/stream/DelayableWriteable.java index d0e725651b16d..f103a4c11d5d6 100644 --- a/server/src/main/java/org/elasticsearch/common/io/stream/DelayableWriteable.java +++ b/server/src/main/java/org/elasticsearch/common/io/stream/DelayableWriteable.java @@ -9,6 +9,7 @@ package org.elasticsearch.common.io.stream; import org.elasticsearch.Version; +import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.bytes.ReleasableBytesReference; import org.elasticsearch.core.Releasable; @@ -50,6 +51,12 @@ public static DelayableWriteable delayed(Writeable.Read return new Serialized<>(reader, in.getVersion(), in.namedWriteableRegistry(), in.readReleasableBytesReference()); } + public static DelayableWriteable referencing(Writeable.Reader reader, StreamInput in) throws IOException { + try (ReleasableBytesReference serialized = in.readReleasableBytesReference()) { + return new Referencing<>(deserialize(reader, in.getVersion(), in.namedWriteableRegistry(), serialized)); + } + } + private DelayableWriteable() {} /** @@ -67,7 +74,7 @@ private DelayableWriteable() {} * {@code true} if the {@linkplain Writeable} is being stored in * serialized form, {@code false} otherwise. */ - abstract boolean isSerialized(); + public abstract boolean isSerialized(); /** * Returns the serialized size of the inner {@link Writeable}. @@ -104,7 +111,7 @@ public Serialized asSerialized(Reader reader, NamedWriteableRegistry regis } @Override - boolean isSerialized() { + public boolean isSerialized() { return false; } @@ -169,11 +176,7 @@ public void writeTo(StreamOutput out) throws IOException { @Override public T expand() { try { - try (StreamInput in = registry == null ? - serialized.streamInput() : new NamedWriteableAwareStreamInput(serialized.streamInput(), registry)) { - in.setVersion(serializedAtVersion); - return reader.read(in); - } + return deserialize(reader, serializedAtVersion, registry, serialized); } catch (IOException e) { throw new RuntimeException("unexpected error expanding serialized delayed writeable", e); } @@ -185,7 +188,7 @@ public Serialized asSerialized(Reader reader, NamedWriteableRegistry regis } @Override - boolean isSerialized() { + public boolean isSerialized() { return true; } @@ -214,6 +217,15 @@ public static long getSerializedSize(Writeable ref) { } } + private static T deserialize(Reader reader, Version serializedAtVersion, NamedWriteableRegistry registry, + BytesReference serialized) throws IOException { + try (StreamInput in = + registry == null ? serialized.streamInput() : new NamedWriteableAwareStreamInput(serialized.streamInput(), registry)) { + in.setVersion(serializedAtVersion); + return reader.read(in); + } + } + private static class CountingStreamOutput extends StreamOutput { long size = 0; diff --git a/server/src/main/java/org/elasticsearch/search/query/QuerySearchResult.java b/server/src/main/java/org/elasticsearch/search/query/QuerySearchResult.java index f35cb57314dba..2f594abfe7d9a 100644 --- a/server/src/main/java/org/elasticsearch/search/query/QuerySearchResult.java +++ b/server/src/main/java/org/elasticsearch/search/query/QuerySearchResult.java @@ -33,7 +33,6 @@ import static org.elasticsearch.common.lucene.Lucene.writeTopDocs; public final class QuerySearchResult extends SearchPhaseResult { - private int from; private int size; private TopDocsAndMaxScore topDocsAndMaxScore; @@ -65,6 +64,15 @@ public QuerySearchResult() { } public QuerySearchResult(StreamInput in) throws IOException { + this(in, false); + } + + /** + * Read the object, but using a delayed aggregations field when delayedAggregations=true. Using this, the caller must ensure that + * either `consumeAggs` or `releaseAggs` is called if `hasAggs() == true`. + * @param delayedAggregations whether to use delayed aggregations or not + */ + public QuerySearchResult(StreamInput in, boolean delayedAggregations) throws IOException { super(in); if (in.getVersion().onOrAfter(Version.V_7_7_0)) { isNull = in.readBoolean(); @@ -73,7 +81,7 @@ public QuerySearchResult(StreamInput in) throws IOException { } if (isNull == false) { ShardSearchContextId id = new ShardSearchContextId(in); - readFromWithId(id, in); + readFromWithId(id, in, delayedAggregations); } } @@ -316,6 +324,10 @@ public boolean hasSearchContext() { } public void readFromWithId(ShardSearchContextId id, StreamInput in) throws IOException { + readFromWithId(id, in, false); + } + + private void readFromWithId(ShardSearchContextId id, StreamInput in, boolean delayedAggregations) throws IOException { this.contextId = id; from = in.readVInt(); size = in.readVInt(); @@ -333,7 +345,11 @@ public void readFromWithId(ShardSearchContextId id, StreamInput in) throws IOExc boolean success = false; try { if (hasAggs) { - aggregations = DelayableWriteable.delayed(InternalAggregations::readFrom, in); + if (delayedAggregations) { + aggregations = DelayableWriteable.delayed(InternalAggregations::readFrom, in); + } else { + aggregations = DelayableWriteable.referencing(InternalAggregations::readFrom, in); + } } if (in.readBoolean()) { suggest = new Suggest(in); @@ -359,6 +375,8 @@ public void readFromWithId(ShardSearchContextId id, StreamInput in) throws IOExc @Override public void writeTo(StreamOutput out) throws IOException { + // we do not know that it is being sent over transport, but this at least protects all writes from happening, including sending. + assert aggregations == null || aggregations.isSerialized() == false : "cannot send serialized version since it will leak"; if (out.getVersion().onOrAfter(Version.V_7_7_0)) { out.writeBoolean(isNull); } diff --git a/server/src/test/java/org/elasticsearch/common/io/stream/DelayableWriteableTests.java b/server/src/test/java/org/elasticsearch/common/io/stream/DelayableWriteableTests.java index b6d57e2997ce0..d18e9976e0968 100644 --- a/server/src/test/java/org/elasticsearch/common/io/stream/DelayableWriteableTests.java +++ b/server/src/test/java/org/elasticsearch/common/io/stream/DelayableWriteableTests.java @@ -134,14 +134,12 @@ public void testRoundTripFromDelayedWithNamedWriteable() throws IOException { public void testRoundTripFromDelayedFromOldVersion() throws IOException { Example e = new Example(randomAlphaOfLength(5)); DelayableWriteable original = roundTrip(DelayableWriteable.referencing(e), Example::new, randomOldVersion()); - assertTrue(original.isSerialized()); roundTripTestCase(original, Example::new); } public void testRoundTripFromDelayedFromOldVersionWithNamedWriteable() throws IOException { NamedHolder n = new NamedHolder(new Example(randomAlphaOfLength(5))); DelayableWriteable original = roundTrip(DelayableWriteable.referencing(n), NamedHolder::new, randomOldVersion()); - assertTrue(original.isSerialized()); roundTripTestCase(original, NamedHolder::new); } @@ -160,14 +158,20 @@ public void testAsSerializedIsNoopOnSerialized() throws IOException { private void roundTripTestCase(DelayableWriteable original, Writeable.Reader reader) throws IOException { DelayableWriteable roundTripped = roundTrip(original, reader, Version.CURRENT); - assertTrue(roundTripped.isSerialized()); assertThat(roundTripped.expand(), equalTo(original.expand())); } private DelayableWriteable roundTrip(DelayableWriteable original, Writeable.Reader reader, Version version) throws IOException { - return copyInstance(original, writableRegistry(), (out, d) -> d.writeTo(out), + DelayableWriteable delayed = copyInstance(original, writableRegistry(), (out, d) -> d.writeTo(out), in -> DelayableWriteable.delayed(reader, in), version); + assertTrue(delayed.isSerialized()); + + DelayableWriteable referencing = copyInstance(original, writableRegistry(), (out, d) -> d.writeTo(out), + in -> DelayableWriteable.referencing(reader, in), version); + assertFalse(referencing.isSerialized()); + + return randomFrom(delayed, referencing); } @Override diff --git a/server/src/test/java/org/elasticsearch/search/query/QuerySearchResultTests.java b/server/src/test/java/org/elasticsearch/search/query/QuerySearchResultTests.java index bf645d137cda9..2e77f6bff064c 100644 --- a/server/src/test/java/org/elasticsearch/search/query/QuerySearchResultTests.java +++ b/server/src/test/java/org/elasticsearch/search/query/QuerySearchResultTests.java @@ -33,6 +33,8 @@ import org.elasticsearch.test.ESTestCase; import static java.util.Collections.emptyList; +import static org.hamcrest.Matchers.is; +import static org.hamcrest.Matchers.nullValue; public class QuerySearchResultTests extends ESTestCase { @@ -68,8 +70,10 @@ private static QuerySearchResult createTestInstance() throws Exception { public void testSerialization() throws Exception { QuerySearchResult querySearchResult = createTestInstance(); + boolean delayed = randomBoolean(); QuerySearchResult deserialized = copyWriteable(querySearchResult, namedWriteableRegistry, - QuerySearchResult::new, Version.CURRENT); + delayed ? in -> new QuerySearchResult(in, true) : QuerySearchResult::new, + Version.CURRENT); assertEquals(querySearchResult.getContextId().getId(), deserialized.getContextId().getId()); assertNull(deserialized.getSearchShardTarget()); assertEquals(querySearchResult.topDocs().maxScore, deserialized.topDocs().maxScore, 0f); @@ -78,9 +82,11 @@ public void testSerialization() throws Exception { assertEquals(querySearchResult.size(), deserialized.size()); assertEquals(querySearchResult.hasAggs(), deserialized.hasAggs()); if (deserialized.hasAggs()) { + assertThat(deserialized.aggregations().isSerialized(), is(delayed)); Aggregations aggs = querySearchResult.consumeAggs(); Aggregations deserializedAggs = deserialized.consumeAggs(); assertEquals(aggs.asList(), deserializedAggs.asList()); + assertThat(deserialized.aggregations(), is(nullValue())); } assertEquals(querySearchResult.terminatedEarly(), deserialized.terminatedEarly()); } diff --git a/test/framework/src/main/java/org/elasticsearch/test/AbstractMultiClustersTestCase.java b/test/framework/src/main/java/org/elasticsearch/test/AbstractMultiClustersTestCase.java index 138d330884d83..95d4766a91687 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/AbstractMultiClustersTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/test/AbstractMultiClustersTestCase.java @@ -134,6 +134,8 @@ protected void disconnectFromRemoteClusters() throws Exception { for (String clusterAlias : clusterAliases) { if (clusterAlias.equals(LOCAL_CLUSTER) == false) { settings.putNull("cluster.remote." + clusterAlias + ".seeds"); + settings.putNull("cluster.remote." + clusterAlias + ".mode"); + settings.putNull("cluster.remote." + clusterAlias + ".proxy_address"); } } client().admin().cluster().prepareUpdateSettings().setPersistentSettings(settings).get(); From bfdd7b4cf90eece5208b065d008945fc2fceb3c0 Mon Sep 17 00:00:00 2001 From: Valeriy Khakhutskyy <1292899+valeriy42@users.noreply.github.com> Date: Mon, 4 Oct 2021 12:45:03 +0200 Subject: [PATCH 115/250] Revert "Mute "tsdb" yaml test (#78599)" (#78603) This reverts commit abdf8fe248542ee34008bfb35893badb51e7a517. --- .../resources/rest-api-spec/test/remote_cluster/10_basic.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qa/multi-cluster-search/src/test/resources/rest-api-spec/test/remote_cluster/10_basic.yml b/qa/multi-cluster-search/src/test/resources/rest-api-spec/test/remote_cluster/10_basic.yml index 4f61a09ef5414..5aa5bd659a1c2 100644 --- a/qa/multi-cluster-search/src/test/resources/rest-api-spec/test/remote_cluster/10_basic.yml +++ b/qa/multi-cluster-search/src/test/resources/rest-api-spec/test/remote_cluster/10_basic.yml @@ -156,8 +156,8 @@ --- tsdb: - skip: - version: "all" - reason: "AwaitsFix https://github.com/elastic/elasticsearch/issues/78598" + version: " - 7.99.99" + reason: introduced in 8.0.0 - do: indices.create: From 63d663e2205234996ce823eab45a456ef3f95e57 Mon Sep 17 00:00:00 2001 From: Tanguy Leroux Date: Mon, 4 Oct 2021 13:15:56 +0200 Subject: [PATCH 116/250] Add periodic maintenance task to clean up unused blob store cache docs (#78438) In #77686 we added a service to clean up blob store cache docs after a searchable snapshot is no more used. We noticed some situations where some cache docs could still remain in the system index: when the system index is not available when the searchable snapshot index is deleted; when the system index is restored from a backup or when the searchable snapshot index was deleted on a version before #77686. This commit introduces a maintenance task that periodically scans and cleans up unused blob cache docs. This task is scheduled to run every hour on the data node that contain the blob store cache primary shard. The periodic task works by using a point in time context with search_after. --- .../searchable-snapshots/index.asciidoc | 28 + ...tsBlobStoreCacheMaintenanceIntegTests.java | 312 ++++++++--- .../SearchableSnapshots.java | 13 +- .../BlobStoreCacheMaintenanceService.java | 530 ++++++++++++++++-- .../cache/blob/BlobStoreCacheService.java | 8 +- .../cache/blob/CachedBlob.java | 13 +- .../store/SearchableSnapshotDirectory.java | 12 +- .../blob/BlobStoreCacheServiceTests.java | 12 +- .../cache/common/TestUtils.java | 4 +- 9 files changed, 815 insertions(+), 117 deletions(-) diff --git a/docs/reference/searchable-snapshots/index.asciidoc b/docs/reference/searchable-snapshots/index.asciidoc index d615bb5dbfd96..e9a6d9a5f89fb 100644 --- a/docs/reference/searchable-snapshots/index.asciidoc +++ b/docs/reference/searchable-snapshots/index.asciidoc @@ -198,6 +198,34 @@ IMPORTANT: You can only configure these settings on nodes with the <> role. Additionally, nodes with a shared cache can only have a single <>. +{es} also uses a dedicated system index named `.snapshot-blob-cache` to speed +up the recoveries of {search-snap} shards. This index is used as an additional +caching layer on top of the partially or fully mounted data and contains the +minimal required data to start the {search-snap} shards. {es} automatically +deletes the documents that are no longer used in this index. This periodic +clean up can be tuned using the following settings: + +`searchable_snapshots.blob_cache.periodic_cleanup.interval`:: +(<>) +The interval at which the periodic cleanup of the `.snapshot-blob-cache` +index is scheduled. Defaults to every hour (`1h`). + +`searchable_snapshots.blob_cache.periodic_cleanup.retention_period`:: +(<>) +The retention period to keep obsolete documents in the `.snapshot-blob-cache` +index. Defaults to every hour (`1h`). + +`searchable_snapshots.blob_cache.periodic_cleanup.batch_size`:: +(<>) +The number of documents that are searched for and bulk-deleted at once during +the periodic cleanup of the `.snapshot-blob-cache` index. Defaults to `100`. + +`searchable_snapshots.blob_cache.periodic_cleanup.pit_keep_alive`:: +(<>) +The value used for the > +requests executed during the periodic cleanup of the `.snapshot-blob-cache` +index. Defaults to `10m`. + [discrete] [[searchable-snapshots-costs]] === Reduce costs with {search-snaps} diff --git a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/cache/blob/SearchableSnapshotsBlobStoreCacheMaintenanceIntegTests.java b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/cache/blob/SearchableSnapshotsBlobStoreCacheMaintenanceIntegTests.java index 17a5245d4e266..93bea63fccf85 100644 --- a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/cache/blob/SearchableSnapshotsBlobStoreCacheMaintenanceIntegTests.java +++ b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/cache/blob/SearchableSnapshotsBlobStoreCacheMaintenanceIntegTests.java @@ -7,29 +7,49 @@ package org.elasticsearch.xpack.searchablesnapshots.cache.blob; +import org.elasticsearch.action.ActionListener; +import org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotResponse; import org.elasticsearch.action.admin.indices.refresh.RefreshRequest; import org.elasticsearch.action.admin.indices.refresh.RefreshResponse; import org.elasticsearch.action.index.IndexRequestBuilder; import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.client.Client; import org.elasticsearch.client.OriginSettingClient; +import org.elasticsearch.cluster.metadata.IndexMetadata; +import org.elasticsearch.common.UUIDs; +import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.core.TimeValue; +import org.elasticsearch.core.Tuple; import org.elasticsearch.index.IndexNotFoundException; +import org.elasticsearch.index.shard.ShardId; +import org.elasticsearch.index.store.LuceneFilesExtensions; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.reindex.ReindexPlugin; +import org.elasticsearch.repositories.IndexId; import org.elasticsearch.repositories.fs.FsRepository; +import org.elasticsearch.snapshots.SnapshotId; import org.elasticsearch.xpack.core.ClientHelper; import org.elasticsearch.xpack.core.searchablesnapshots.MountSearchableSnapshotRequest.Storage; import org.elasticsearch.xpack.searchablesnapshots.BaseFrozenSearchableSnapshotsIntegTestCase; import org.elasticsearch.xpack.searchablesnapshots.SearchableSnapshots; +import org.elasticsearch.xpack.searchablesnapshots.cache.common.ByteRange; +import java.time.Duration; +import java.time.Instant; import java.util.ArrayList; import java.util.Collection; +import java.util.Collections; import java.util.HashMap; +import java.util.HashSet; import java.util.List; +import java.util.Locale; import java.util.Map; import java.util.Set; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; import java.util.function.Predicate; import java.util.stream.Collectors; @@ -57,71 +77,17 @@ protected Collection> nodePlugins() { /** * Test that snapshot blob cache entries are deleted from the system index after the corresponding searchable snapshot index is deleted */ - public void testMaintenance() throws Exception { + public void testCleanUpAfterIndicesAreDeleted() throws Exception { final String repositoryName = "repository"; createRepository(repositoryName, FsRepository.TYPE); - final int nbIndices = randomIntBetween(3, 10); - - logger.info("--> generating [{}] indices with cached entries in system index...", nbIndices); - final Map mountedIndices = new HashMap<>(); - final Map mountedIndicesSettings = new HashMap<>(); - - int i = 0; - long previousNumberOfCachedEntries = 0; - while (mountedIndices.size() < nbIndices) { - final String indexName = "index-" + i; - createIndex(indexName); - - final List indexRequestBuilders = new ArrayList<>(); - for (int n = 100; n > 0; n--) { - indexRequestBuilders.add( - client().prepareIndex(indexName) - .setSource( - XContentFactory.smileBuilder() - .startObject() - .field("text", randomRealisticUnicodeOfCodepointLength(10)) - .endObject() - ) - ); - } - indexRandom(true, indexRequestBuilders); - - createSnapshot(repositoryName, "snapshot-" + i, List.of(indexName)); - assertAcked(client().admin().indices().prepareDelete(indexName)); - - final String mountedIndex = "mounted-index-" + i; - mountSnapshot(repositoryName, "snapshot-" + i, "index-" + i, mountedIndex, Settings.EMPTY, randomFrom(Storage.values())); - - ensureGreen(mountedIndex); - assertExecutorIsIdle(SearchableSnapshots.CACHE_FETCH_ASYNC_THREAD_POOL_NAME); - assertExecutorIsIdle(SearchableSnapshots.CACHE_PREWARMING_THREAD_POOL_NAME); - waitForBlobCacheFillsToComplete(); - - refreshSystemIndex(false); - - final long numberOfEntriesInCache = numberOfEntriesInCache(); - if (numberOfEntriesInCache > previousNumberOfCachedEntries) { - final long nbEntries = numberOfEntriesInCache - previousNumberOfCachedEntries; - logger.info("--> mounted index [{}] has [{}] entries in cache", mountedIndex, nbEntries); - mountedIndices.put(mountedIndex, nbEntries); - mountedIndicesSettings.put(mountedIndex, getIndexSettings(mountedIndex)); - - } else { - logger.info("--> mounted index [{}] did not generate any entry in cache, skipping", mountedIndex); - assertAcked(client().admin().indices().prepareDelete(mountedIndex)); - } - - previousNumberOfCachedEntries = numberOfEntriesInCache; - i += 1; - } - + final Map> mountedIndices = mountRandomIndicesWithCache(repositoryName, 3, 10); ensureYellow(SNAPSHOT_BLOB_CACHE_INDEX); refreshSystemIndex(true); final long numberOfEntriesInCache = numberOfEntriesInCache(); logger.info("--> found [{}] entries in snapshot blob cache", numberOfEntriesInCache); - assertThat(numberOfEntriesInCache, equalTo(mountedIndices.values().stream().mapToLong(l -> l).sum())); + assertThat(numberOfEntriesInCache, equalTo(mountedIndices.values().stream().mapToLong(Tuple::v2).sum())); final List indicesToDelete = randomSubsetOf(randomIntBetween(1, mountedIndices.size()), mountedIndices.keySet()); assertAcked(client().admin().indices().prepareDelete(indicesToDelete.toArray(String[]::new))); @@ -129,7 +95,7 @@ public void testMaintenance() throws Exception { final long expectedDeletedEntriesInCache = mountedIndices.entrySet() .stream() .filter(e -> indicesToDelete.contains(e.getKey())) - .mapToLong(Map.Entry::getValue) + .mapToLong(entry -> entry.getValue().v2()) .sum(); logger.info("--> deleting indices [{}] with [{}] entries in snapshot blob cache", indicesToDelete, expectedDeletedEntriesInCache); @@ -138,7 +104,7 @@ public void testMaintenance() throws Exception { assertThat(numberOfEntriesInCache(), equalTo(numberOfEntriesInCache - expectedDeletedEntriesInCache)); for (String mountedIndex : mountedIndices.keySet()) { - final Settings indexSettings = mountedIndicesSettings.get(mountedIndex); + final Settings indexSettings = mountedIndices.get(mountedIndex).v1(); assertHitCount( systemClient().prepareSearch(SNAPSHOT_BLOB_CACHE_INDEX) .setQuery( @@ -150,7 +116,7 @@ public void testMaintenance() throws Exception { ) .setSize(0) .get(), - indicesToDelete.contains(mountedIndex) ? 0L : mountedIndices.get(mountedIndex) + indicesToDelete.contains(mountedIndex) ? 0L : mountedIndices.get(mountedIndex).v2() ); } }); @@ -178,13 +144,12 @@ public void testMaintenance() throws Exception { Settings.EMPTY, randomFrom(Storage.values()) ); - ensureGreen(remainingMountedIndex); - mountedIndicesSettings.put(remainingMountedIndex, getIndexSettings(remainingMountedIndex)); assertExecutorIsIdle(SearchableSnapshots.CACHE_FETCH_ASYNC_THREAD_POOL_NAME); assertExecutorIsIdle(SearchableSnapshots.CACHE_PREWARMING_THREAD_POOL_NAME); waitForBlobCacheFillsToComplete(); + ensureClusterStateConsistency(); logger.info( "--> deleting more mounted indices [{}] with snapshot [{}/{}] of index [{}] is still mounted as index [{}]", @@ -200,7 +165,7 @@ public void testMaintenance() throws Exception { refreshSystemIndex(true); for (String mountedIndex : mountedIndices.keySet()) { - final Settings indexSettings = mountedIndicesSettings.get(mountedIndex); + final Settings indexSettings = mountedIndices.get(mountedIndex).v1(); final long remainingEntriesInCache = systemClient().prepareSearch(SNAPSHOT_BLOB_CACHE_INDEX) .setQuery( @@ -218,11 +183,11 @@ public void testMaintenance() throws Exception { if (indicesToDelete.contains(mountedIndex)) { assertThat(remainingEntriesInCache, equalTo(0L)); } else if (snapshotId.equals(SNAPSHOT_SNAPSHOT_ID_SETTING.get(indexSettings))) { - assertThat(remainingEntriesInCache, greaterThanOrEqualTo(mountedIndices.get(randomMountedIndex))); + assertThat(remainingEntriesInCache, greaterThanOrEqualTo(mountedIndices.get(randomMountedIndex).v2())); } else if (moreIndicesToDelete.contains(mountedIndex)) { assertThat(remainingEntriesInCache, equalTo(0L)); } else { - assertThat(remainingEntriesInCache, equalTo(mountedIndices.get(mountedIndex))); + assertThat(remainingEntriesInCache, equalTo(mountedIndices.get(mountedIndex).v2())); } } }); @@ -236,6 +201,130 @@ public void testMaintenance() throws Exception { }); } + /** + * Test that obsolete blob cache entries are deleted from the system index by the periodic maintenance task. + */ + public void testPeriodicMaintenance() throws Exception { + ensureStableCluster(internalCluster().getNodeNames().length, TimeValue.timeValueSeconds(60L)); + + createRepository("repo", FsRepository.TYPE); + Map> mountedIndices = mountRandomIndicesWithCache("repo", 1, 3); + ensureYellow(SNAPSHOT_BLOB_CACHE_INDEX); + + final long nbEntriesInCacheForMountedIndices = mountedIndices.values().stream().mapToLong(Tuple::v2).sum(); + refreshSystemIndex(true); + assertThat(numberOfEntriesInCache(), equalTo(nbEntriesInCacheForMountedIndices)); + + createRepository("other", FsRepository.TYPE); + Map> otherMountedIndices = mountRandomIndicesWithCache("other", 1, 3); + + final long nbEntriesInCacheForOtherIndices = otherMountedIndices.values().stream().mapToLong(Tuple::v2).sum(); + refreshSystemIndex(true); + assertThat(numberOfEntriesInCache(), equalTo(nbEntriesInCacheForMountedIndices + nbEntriesInCacheForOtherIndices)); + + if (randomBoolean()) { + final int oldDocsInCache = indexRandomDocsInCache(1, 50, Instant.now().minus(Duration.ofDays(7L)).toEpochMilli()); + refreshSystemIndex(true); + assertThat( + numberOfEntriesInCache(), + equalTo(nbEntriesInCacheForMountedIndices + nbEntriesInCacheForOtherIndices + oldDocsInCache) + ); + } + + // creates a backup of the system index cache to be restored later + createRepository("backup", FsRepository.TYPE); + createSnapshot("backup", "backup", List.of(SNAPSHOT_BLOB_CACHE_INDEX)); + + final Set indicesToDelete = new HashSet<>(mountedIndices.keySet()); + indicesToDelete.add(randomFrom(otherMountedIndices.keySet())); + + assertAcked(systemClient().admin().indices().prepareDelete(SNAPSHOT_BLOB_CACHE_INDEX)); + assertAcked(client().admin().indices().prepareDelete(indicesToDelete.toArray(String[]::new))); + assertAcked(client().admin().cluster().prepareDeleteRepository("repo")); + ensureClusterStateConsistency(); + + assertThat(numberOfEntriesInCache(), equalTo(0L)); + + assertAcked( + client().admin() + .cluster() + .prepareUpdateSettings() + .setTransientSettings( + Settings.builder() + .put( + BlobStoreCacheMaintenanceService.SNAPSHOT_SNAPSHOT_CLEANUP_INTERVAL_SETTING.getKey(), + TimeValue.timeValueSeconds(1L) + ) + ) + ); + try { + // restores the .snapshot-blob-cache index with - now obsolete - documents + final RestoreSnapshotResponse restoreResponse = client().admin() + .cluster() + .prepareRestoreSnapshot("backup", "backup") + .setIndices(SNAPSHOT_BLOB_CACHE_INDEX) + .setWaitForCompletion(true) + .get(); + assertThat(restoreResponse.getRestoreInfo().successfulShards(), equalTo(1)); + assertThat(restoreResponse.getRestoreInfo().failedShards(), equalTo(0)); + + final int recentDocsInCache; + if (randomBoolean()) { + // recent as in the future, actually + recentDocsInCache = indexRandomDocsInCache(1, 50, Instant.now().plus(Duration.ofDays(10L)).toEpochMilli()); + } else { + recentDocsInCache = 0; + } + + // only very old docs should have been deleted + assertBusy(() -> { + refreshSystemIndex(true); + assertThat( + numberOfEntriesInCache(), + equalTo(nbEntriesInCacheForMountedIndices + nbEntriesInCacheForOtherIndices + recentDocsInCache) + ); + }, 30L, TimeUnit.SECONDS); + + // updating the retention period from 1H to immediate + assertAcked( + client().admin() + .cluster() + .prepareUpdateSettings() + .setTransientSettings( + Settings.builder() + .put( + BlobStoreCacheMaintenanceService.SNAPSHOT_SNAPSHOT_CLEANUP_RETENTION_PERIOD.getKey(), + TimeValue.timeValueSeconds(0L) + ) + ) + ); + + // only used documents should remain + final long expectNumberOfRemainingCacheEntries = otherMountedIndices.entrySet() + .stream() + .filter(e -> indicesToDelete.contains(e.getKey()) == false) + .mapToLong(e -> e.getValue().v2()) + .sum(); + + assertBusy(() -> { + refreshSystemIndex(true); + assertThat(numberOfEntriesInCache(), equalTo(expectNumberOfRemainingCacheEntries + recentDocsInCache)); + }, 30L, TimeUnit.SECONDS); + + } finally { + assertAcked( + client().admin() + .cluster() + .prepareUpdateSettings() + .setTransientSettings( + Settings.builder() + .putNull(BlobStoreCacheMaintenanceService.SNAPSHOT_SNAPSHOT_CLEANUP_INTERVAL_SETTING.getKey()) + .putNull(BlobStoreCacheMaintenanceService.SNAPSHOT_SNAPSHOT_CLEANUP_RETENTION_PERIOD.getKey()) + ) + ); + } + } + /** * @return a {@link Client} that can be used to query the blob store cache system index */ @@ -270,4 +359,97 @@ private void refreshSystemIndex(boolean failIfNotExist) { private Settings getIndexSettings(String indexName) { return client().admin().indices().prepareGetSettings(indexName).get().getIndexToSettings().get(indexName); } + + private Map> mountRandomIndicesWithCache(String repositoryName, int min, int max) throws Exception { + refreshSystemIndex(false); + long previousNumberOfCachedEntries = numberOfEntriesInCache(); + + final int nbIndices = randomIntBetween(min, max); + logger.info("--> generating [{}] indices with cached entries in system index...", nbIndices); + final Map> mountedIndices = new HashMap<>(); + + int i = 0; + while (mountedIndices.size() < nbIndices) { + final String indexName = "index-" + i; + createIndex(indexName, Settings.builder().put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0).build()); + + while (true) { + final List indexRequestBuilders = new ArrayList<>(); + for (int n = 500; n > 0; n--) { + final XContentBuilder builder = XContentFactory.jsonBuilder(); + builder.startObject(); + for (int j = 0; j < 10; j++) { + builder.field("text_" + j, randomRealisticUnicodeOfCodepointLength(10)); + builder.field("int_" + j, randomInt()); + } + builder.endObject(); + indexRequestBuilders.add(client().prepareIndex(indexName).setSource(builder)); + } + indexRandom(true, indexRequestBuilders); + + final String snapshot = "snapshot-" + i; + createSnapshot(repositoryName, snapshot, List.of(indexName)); + + final String mountedIndex = "mounted-" + indexName + "-in-" + repositoryName; + mountSnapshot(repositoryName, snapshot, indexName, mountedIndex, Settings.EMPTY, randomFrom(Storage.values())); + + ensureGreen(mountedIndex); + assertExecutorIsIdle(SearchableSnapshots.CACHE_FETCH_ASYNC_THREAD_POOL_NAME); + assertExecutorIsIdle(SearchableSnapshots.CACHE_PREWARMING_THREAD_POOL_NAME); + waitForBlobCacheFillsToComplete(); + + refreshSystemIndex(false); + final long numberOfEntriesInCache = numberOfEntriesInCache(); + if (numberOfEntriesInCache > previousNumberOfCachedEntries) { + final long nbEntries = numberOfEntriesInCache - previousNumberOfCachedEntries; + logger.info("--> mounted index [{}] has [{}] entries in cache", mountedIndex, nbEntries); + mountedIndices.put(mountedIndex, Tuple.tuple(getIndexSettings(mountedIndex), nbEntries)); + previousNumberOfCachedEntries = numberOfEntriesInCache; + break; + + } else { + logger.info("--> mounted index [{}] did not generate any entry in cache", mountedIndex); + assertAcked(client().admin().cluster().prepareDeleteSnapshot(repositoryName, snapshot).get()); + assertAcked(client().admin().indices().prepareDelete(mountedIndex)); + } + } + assertAcked(client().admin().indices().prepareDelete(indexName)); + i += 1; + } + return Collections.unmodifiableMap(mountedIndices); + } + + private int indexRandomDocsInCache(final int minDocs, final int maxDocs, final long creationTimeInEpochMillis) { + final int nbDocs = randomIntBetween(minDocs, maxDocs); + final CountDownLatch latch = new CountDownLatch(nbDocs); + + String repository = randomAlphaOfLength(5).toLowerCase(Locale.ROOT); + SnapshotId snapshotId = new SnapshotId("snap", UUIDs.randomBase64UUID()); + IndexId indexId = new IndexId("index", UUIDs.randomBase64UUID()); + ShardId shardId = new ShardId("index", UUIDs.randomBase64UUID(), randomInt(5)); + String fileName = randomAlphaOfLength(5).toLowerCase(Locale.ROOT) + '.' + randomFrom(LuceneFilesExtensions.values()).getExtension(); + byte[] bytes = randomByteArrayOfLength(randomIntBetween(1, 64)); + + final BlobStoreCacheService blobStoreCacheService = internalCluster().getDataNodeInstance(BlobStoreCacheService.class); + for (int i = 0; i < nbDocs; i++) { + int length = randomIntBetween(1, Math.max(1, bytes.length - 1)); + blobStoreCacheService.putAsync( + repository, + snapshotId, + indexId, + shardId, + fileName, + ByteRange.of(i, i + length), + new BytesArray(bytes, 0, length), + creationTimeInEpochMillis, + ActionListener.wrap(latch::countDown) + ); + } + try { + latch.await(); + } catch (InterruptedException e) { + throw new AssertionError(e); + } + return nbDocs; + } } diff --git a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshots.java b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshots.java index 5f51e0bf98b9c..a16f95d4d9766 100644 --- a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshots.java +++ b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshots.java @@ -314,7 +314,11 @@ public List> getSettings() { FrozenCacheService.FROZEN_CACHE_RECOVERY_RANGE_SIZE_SETTING, FrozenCacheService.SNAPSHOT_CACHE_MAX_FREQ_SETTING, FrozenCacheService.SNAPSHOT_CACHE_DECAY_INTERVAL_SETTING, - FrozenCacheService.SNAPSHOT_CACHE_MIN_TIME_DELTA_SETTING + FrozenCacheService.SNAPSHOT_CACHE_MIN_TIME_DELTA_SETTING, + BlobStoreCacheMaintenanceService.SNAPSHOT_SNAPSHOT_CLEANUP_INTERVAL_SETTING, + BlobStoreCacheMaintenanceService.SNAPSHOT_SNAPSHOT_CLEANUP_KEEP_ALIVE_SETTING, + BlobStoreCacheMaintenanceService.SNAPSHOT_SNAPSHOT_CLEANUP_BATCH_SIZE_SETTING, + BlobStoreCacheMaintenanceService.SNAPSHOT_SNAPSHOT_CLEANUP_RETENTION_PERIOD ); } @@ -345,11 +349,12 @@ public Collection createComponents( final BlobStoreCacheService blobStoreCacheService = new BlobStoreCacheService( clusterService, client, - SNAPSHOT_BLOB_CACHE_INDEX, - threadPool::absoluteTimeInMillis + SNAPSHOT_BLOB_CACHE_INDEX ); this.blobStoreCacheService.set(blobStoreCacheService); - clusterService.addListener(new BlobStoreCacheMaintenanceService(threadPool, client, SNAPSHOT_BLOB_CACHE_INDEX)); + clusterService.addListener( + new BlobStoreCacheMaintenanceService(settings, clusterService, threadPool, client, SNAPSHOT_BLOB_CACHE_INDEX) + ); components.add(blobStoreCacheService); } else { PersistentCache.cleanUp(settings, nodeEnvironment); diff --git a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/cache/blob/BlobStoreCacheMaintenanceService.java b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/cache/blob/BlobStoreCacheMaintenanceService.java index e9bed4a79f91c..d24265dfd5979 100644 --- a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/cache/blob/BlobStoreCacheMaintenanceService.java +++ b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/cache/blob/BlobStoreCacheMaintenanceService.java @@ -11,17 +11,44 @@ import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.message.ParameterizedMessage; import org.elasticsearch.action.ActionListener; +import org.elasticsearch.action.bulk.BulkAction; +import org.elasticsearch.action.bulk.BulkItemResponse; +import org.elasticsearch.action.bulk.BulkRequest; +import org.elasticsearch.action.bulk.BulkResponse; +import org.elasticsearch.action.delete.DeleteRequest; +import org.elasticsearch.action.delete.DeleteResponse; +import org.elasticsearch.action.search.ClosePointInTimeAction; +import org.elasticsearch.action.search.ClosePointInTimeRequest; +import org.elasticsearch.action.search.ClosePointInTimeResponse; +import org.elasticsearch.action.search.OpenPointInTimeAction; +import org.elasticsearch.action.search.OpenPointInTimeRequest; +import org.elasticsearch.action.search.OpenPointInTimeResponse; +import org.elasticsearch.action.search.SearchAction; +import org.elasticsearch.action.search.SearchRequest; +import org.elasticsearch.action.search.SearchResponse; +import org.elasticsearch.action.support.TransportActions; import org.elasticsearch.client.Client; import org.elasticsearch.client.OriginSettingClient; import org.elasticsearch.cluster.ClusterChangedEvent; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.ClusterStateListener; import org.elasticsearch.cluster.metadata.IndexMetadata; +import org.elasticsearch.cluster.metadata.RepositoriesMetadata; +import org.elasticsearch.cluster.metadata.RepositoryMetadata; import org.elasticsearch.cluster.routing.IndexRoutingTable; import org.elasticsearch.cluster.routing.ShardRouting; +import org.elasticsearch.cluster.service.ClusterService; +import org.elasticsearch.common.Strings; +import org.elasticsearch.common.document.DocumentField; +import org.elasticsearch.common.settings.ClusterSettings; +import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.AbstractRunnable; +import org.elasticsearch.common.util.concurrent.EsRejectedExecutionException; import org.elasticsearch.core.Nullable; +import org.elasticsearch.core.Releasable; +import org.elasticsearch.core.Releasables; +import org.elasticsearch.core.TimeValue; import org.elasticsearch.core.Tuple; import org.elasticsearch.index.Index; import org.elasticsearch.index.query.QueryBuilder; @@ -29,24 +56,36 @@ import org.elasticsearch.index.reindex.BulkByScrollResponse; import org.elasticsearch.index.reindex.DeleteByQueryAction; import org.elasticsearch.index.reindex.DeleteByQueryRequest; -import org.elasticsearch.repositories.IndexId; +import org.elasticsearch.search.SearchHit; +import org.elasticsearch.search.builder.PointInTimeBuilder; +import org.elasticsearch.search.builder.SearchSourceBuilder; +import org.elasticsearch.search.fetch.subphase.FieldAndFormat; +import org.elasticsearch.search.sort.ShardDocSortField; import org.elasticsearch.snapshots.SearchableSnapshotsSettings; -import org.elasticsearch.snapshots.SnapshotId; +import org.elasticsearch.threadpool.Scheduler; import org.elasticsearch.threadpool.ThreadPool; +import java.time.Instant; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; import java.util.LinkedList; +import java.util.Map; import java.util.Objects; import java.util.Queue; import java.util.Set; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicLong; +import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; import java.util.stream.IntStream; import static org.elasticsearch.gateway.GatewayService.STATE_NOT_RECOVERED_BLOCK; import static org.elasticsearch.xpack.core.ClientHelper.SEARCHABLE_SNAPSHOTS_ORIGIN; +import static org.elasticsearch.xpack.searchablesnapshots.SearchableSnapshots.SNAPSHOT_BLOB_CACHE_INDEX; import static org.elasticsearch.xpack.searchablesnapshots.SearchableSnapshots.SNAPSHOT_INDEX_ID_SETTING; -import static org.elasticsearch.xpack.searchablesnapshots.SearchableSnapshots.SNAPSHOT_INDEX_NAME_SETTING; import static org.elasticsearch.xpack.searchablesnapshots.SearchableSnapshots.SNAPSHOT_SNAPSHOT_ID_SETTING; -import static org.elasticsearch.xpack.searchablesnapshots.SearchableSnapshots.SNAPSHOT_SNAPSHOT_NAME_SETTING; /** * A service that delete documents in the snapshot blob cache index when they are not required anymore. @@ -60,14 +99,80 @@ public class BlobStoreCacheMaintenanceService implements ClusterStateListener { private static final Logger logger = LogManager.getLogger(BlobStoreCacheMaintenanceService.class); + /** + * The interval at which the periodic cleanup of the blob store cache index is scheduled. + */ + public static final Setting SNAPSHOT_SNAPSHOT_CLEANUP_INTERVAL_SETTING = Setting.timeSetting( + "searchable_snapshots.blob_cache.periodic_cleanup.interval", + TimeValue.timeValueHours(1), + TimeValue.ZERO, + Setting.Property.NodeScope, + Setting.Property.Dynamic + ); + /** + * The keep alive value for the internal point-in-time requests executed during the periodic cleanup. + */ + public static final Setting SNAPSHOT_SNAPSHOT_CLEANUP_KEEP_ALIVE_SETTING = Setting.timeSetting( + "searchable_snapshots.blob_cache.periodic_cleanup.pit_keep_alive", + TimeValue.timeValueMinutes(10L), + TimeValue.timeValueSeconds(30L), + Setting.Property.NodeScope, + Setting.Property.Dynamic + ); + /** + * The number of documents that are searched for and bulk-deleted at once during the periodic cleanup. + */ + public static final Setting SNAPSHOT_SNAPSHOT_CLEANUP_BATCH_SIZE_SETTING = Setting.intSetting( + "searchable_snapshots.blob_cache.periodic_cleanup.batch_size", + 100, + Setting.Property.NodeScope, + Setting.Property.Dynamic + ); + + /** + * The retention period to keep obsolete documents in the blob store cache index. This duration is used during the periodic cleanup in + * order to avoid deleting documents belonging to concurrently mounted searchable snapshots. Defaults to 1h. + */ + public static final Setting SNAPSHOT_SNAPSHOT_CLEANUP_RETENTION_PERIOD = Setting.timeSetting( + "searchable_snapshots.blob_cache.periodic_cleanup.retention_period", + TimeValue.timeValueHours(1L), + TimeValue.ZERO, + Setting.Property.NodeScope, + Setting.Property.Dynamic + ); + + private final ClusterService clusterService; private final Client clientWithOrigin; private final String systemIndexName; private final ThreadPool threadPool; - public BlobStoreCacheMaintenanceService(ThreadPool threadPool, Client client, String systemIndexName) { + private volatile Scheduler.Cancellable periodicTask; + private volatile TimeValue periodicTaskInterval; + private volatile TimeValue periodicTaskKeepAlive; + private volatile TimeValue periodicTaskRetention; + private volatile int periodicTaskBatchSize; + private volatile boolean schedulePeriodic; + + public BlobStoreCacheMaintenanceService( + Settings settings, + ClusterService clusterService, + ThreadPool threadPool, + Client client, + String systemIndexName + ) { this.clientWithOrigin = new OriginSettingClient(Objects.requireNonNull(client), SEARCHABLE_SNAPSHOTS_ORIGIN); this.systemIndexName = Objects.requireNonNull(systemIndexName); + this.clusterService = Objects.requireNonNull(clusterService); this.threadPool = Objects.requireNonNull(threadPool); + this.periodicTaskInterval = SNAPSHOT_SNAPSHOT_CLEANUP_INTERVAL_SETTING.get(settings); + this.periodicTaskKeepAlive = SNAPSHOT_SNAPSHOT_CLEANUP_KEEP_ALIVE_SETTING.get(settings); + this.periodicTaskBatchSize = SNAPSHOT_SNAPSHOT_CLEANUP_BATCH_SIZE_SETTING.get(settings); + this.periodicTaskRetention = SNAPSHOT_SNAPSHOT_CLEANUP_RETENTION_PERIOD.get(settings); + final ClusterSettings clusterSettings = clusterService.getClusterSettings(); + clusterSettings.addSettingsUpdateConsumer(SNAPSHOT_SNAPSHOT_CLEANUP_INTERVAL_SETTING, this::setPeriodicTaskInterval); + clusterSettings.addSettingsUpdateConsumer(SNAPSHOT_SNAPSHOT_CLEANUP_KEEP_ALIVE_SETTING, this::setPeriodicTaskKeepAlive); + clusterSettings.addSettingsUpdateConsumer(SNAPSHOT_SNAPSHOT_CLEANUP_BATCH_SIZE_SETTING, this::setPeriodicTaskBatchSize); + clusterSettings.addSettingsUpdateConsumer(SNAPSHOT_SNAPSHOT_CLEANUP_RETENTION_PERIOD, this::setPeriodicTaskRetention); } @Override @@ -77,11 +182,63 @@ public void clusterChanged(ClusterChangedEvent event) { return; // state not fully recovered } final ShardRouting primary = systemIndexPrimaryShard(state); - if (primary == null || Objects.equals(state.nodes().getLocalNodeId(), primary.currentNodeId()) == false) { - return; // system index primary shard does not exist or is not assigned to this data node + if (primary == null + || primary.active() == false + || Objects.equals(state.nodes().getLocalNodeId(), primary.currentNodeId()) == false) { + // system index primary shard does not exist or is not assigned to this data node + stopPeriodicTask(); + return; } if (event.indicesDeleted().isEmpty() == false) { - threadPool.generic().execute(new MaintenanceTask(event)); + threadPool.generic().execute(new DeletedIndicesMaintenanceTask(event)); + } + if (periodicTask == null || periodicTask.isCancelled()) { + schedulePeriodic = true; + startPeriodicTask(); + } + } + + private synchronized void setPeriodicTaskInterval(TimeValue interval) { + this.periodicTaskInterval = interval; + } + + private void setPeriodicTaskKeepAlive(TimeValue keepAlive) { + this.periodicTaskKeepAlive = keepAlive; + } + + public void setPeriodicTaskRetention(TimeValue retention) { + this.periodicTaskRetention = retention; + } + + public void setPeriodicTaskBatchSize(int batchSize) { + this.periodicTaskBatchSize = batchSize; + } + + private synchronized void startPeriodicTask() { + if (schedulePeriodic) { + try { + final TimeValue delay = periodicTaskInterval; + if (delay.getMillis() > 0L) { + final PeriodicMaintenanceTask task = new PeriodicMaintenanceTask(periodicTaskKeepAlive, periodicTaskBatchSize); + periodicTask = threadPool.schedule(task, delay, ThreadPool.Names.GENERIC); + } else { + periodicTask = null; + } + } catch (EsRejectedExecutionException e) { + if (e.isExecutorShutdown()) { + logger.debug("failed to schedule next periodic maintenance task for blob store cache, node is shutting down", e); + } else { + throw e; + } + } + } + } + + private synchronized void stopPeriodicTask() { + schedulePeriodic = false; + if (periodicTask != null && periodicTask.isCancelled() == false) { + periodicTask.cancel(); + periodicTask = null; } } @@ -97,28 +254,34 @@ private ShardRouting systemIndexPrimaryShard(final ClusterState state) { return null; } - private static boolean hasSearchableSnapshotWith(final ClusterState state, final SnapshotId snapshotId, final IndexId indexId) { + private static boolean hasSearchableSnapshotWith(final ClusterState state, final String snapshotId, final String indexId) { for (IndexMetadata indexMetadata : state.metadata()) { final Settings indexSettings = indexMetadata.getSettings(); if (SearchableSnapshotsSettings.isSearchableSnapshotStore(indexSettings)) { - final SnapshotId otherSnapshotId = new SnapshotId( - SNAPSHOT_SNAPSHOT_NAME_SETTING.get(indexSettings), - SNAPSHOT_SNAPSHOT_ID_SETTING.get(indexSettings) - ); - if (Objects.equals(snapshotId, otherSnapshotId)) { - final IndexId otherIndexId = new IndexId( - SNAPSHOT_INDEX_NAME_SETTING.get(indexSettings), - SNAPSHOT_INDEX_ID_SETTING.get(indexSettings) - ); - if (Objects.equals(indexId, otherIndexId)) { - return true; - } + if (Objects.equals(snapshotId, SNAPSHOT_SNAPSHOT_ID_SETTING.get(indexSettings)) + && Objects.equals(indexId, SNAPSHOT_INDEX_ID_SETTING.get(indexSettings))) { + return true; } } } return false; } + private static Map> listSearchableSnapshots(final ClusterState state) { + Map> snapshots = null; + for (IndexMetadata indexMetadata : state.metadata()) { + final Settings indexSettings = indexMetadata.getSettings(); + if (SearchableSnapshotsSettings.isSearchableSnapshotStore(indexSettings)) { + if (snapshots == null) { + snapshots = new HashMap<>(); + } + snapshots.computeIfAbsent(SNAPSHOT_SNAPSHOT_ID_SETTING.get(indexSettings), s -> new HashSet<>()) + .add(SNAPSHOT_INDEX_ID_SETTING.get(indexSettings)); + } + } + return snapshots != null ? Collections.unmodifiableMap(snapshots) : Collections.emptyMap(); + } + static QueryBuilder buildDeleteByQuery(int numberOfShards, String snapshotUuid, String indexUuid) { final Set paths = IntStream.range(0, numberOfShards) .mapToObj(shard -> String.join("/", snapshotUuid, indexUuid, String.valueOf(shard))) @@ -127,11 +290,14 @@ static QueryBuilder buildDeleteByQuery(int numberOfShards, String snapshotUuid, return QueryBuilders.termsQuery("blob.path", paths); } - private class MaintenanceTask extends AbstractRunnable { + /** + * A maintenance task that cleans up the blob store cache index after searchable snapshot indices are deleted + */ + private class DeletedIndicesMaintenanceTask extends AbstractRunnable { private final ClusterChangedEvent event; - MaintenanceTask(ClusterChangedEvent event) { + DeletedIndicesMaintenanceTask(ClusterChangedEvent event) { assert event.indicesDeleted().isEmpty() == false; this.event = Objects.requireNonNull(event); } @@ -150,14 +316,8 @@ protected void doRun() { if (SearchableSnapshotsSettings.isSearchableSnapshotStore(indexSetting)) { assert state.metadata().hasIndex(deletedIndex) == false; - final SnapshotId snapshotId = new SnapshotId( - SNAPSHOT_SNAPSHOT_NAME_SETTING.get(indexSetting), - SNAPSHOT_SNAPSHOT_ID_SETTING.get(indexSetting) - ); - final IndexId indexId = new IndexId( - SNAPSHOT_INDEX_NAME_SETTING.get(indexSetting), - SNAPSHOT_INDEX_ID_SETTING.get(indexSetting) - ); + final String snapshotId = SNAPSHOT_SNAPSHOT_ID_SETTING.get(indexSetting); + final String indexId = SNAPSHOT_INDEX_ID_SETTING.get(indexSetting); // we should do nothing if the current cluster state contains another // searchable snapshot index that uses the same index snapshot @@ -171,7 +331,7 @@ protected void doRun() { } final DeleteByQueryRequest request = new DeleteByQueryRequest(systemIndexName); - request.setQuery(buildDeleteByQuery(indexMetadata.getNumberOfShards(), snapshotId.getUUID(), indexId.getId())); + request.setQuery(buildDeleteByQuery(indexMetadata.getNumberOfShards(), snapshotId, indexId)); request.setRefresh(queue.isEmpty()); queue.add(Tuple.tuple(request, new ActionListener<>() { @@ -237,4 +397,310 @@ public void onFailure(Exception e) { ); } } + + /** + * A maintenance task that periodically cleans up unused cache entries from the blob store cache index. + * + * This task first opens a point-in-time context on the blob store cache system index and uses it to search all documents. For each + * document found the task verifies if it belongs to an existing searchable snapshot index. If the doc does not belong to any + * index then it is deleted as part of a bulk request. Once the bulk is executed the next batch of documents is searched for. Once + * all documents from the PIT have been verified the task closes the PIT and completes itself. + * + * The task executes every step (PIT opening, searches, bulk deletes, PIT closing) using the generic thread pool. + * The same task instance is used for all the steps and makes sure that a closed instance is not executed again. + */ + private class PeriodicMaintenanceTask implements Runnable, Releasable { + + private final TimeValue keepAlive; + private final int batchSize; + + private final AtomicReference error = new AtomicReference<>(); + private final AtomicBoolean closed = new AtomicBoolean(); + private final AtomicLong deletes = new AtomicLong(); + private final AtomicLong total = new AtomicLong(); + + private volatile Map> existingSnapshots; + private volatile Set existingRepositories; + private volatile SearchResponse searchResponse; + private volatile Instant expirationTime; + private volatile String pointIntTimeId; + private volatile Object[] searchAfter; + + PeriodicMaintenanceTask(TimeValue keepAlive, int batchSize) { + this.keepAlive = keepAlive; + this.batchSize = batchSize; + } + + @Override + public void run() { + assert assertGenericThread(); + try { + ensureOpen(); + if (pointIntTimeId == null) { + final OpenPointInTimeRequest openRequest = new OpenPointInTimeRequest(SNAPSHOT_BLOB_CACHE_INDEX); + openRequest.keepAlive(keepAlive); + clientWithOrigin.execute(OpenPointInTimeAction.INSTANCE, openRequest, new ActionListener<>() { + @Override + public void onResponse(OpenPointInTimeResponse response) { + logger.trace("periodic maintenance task initialized with point-in-time id [{}]", response.getPointInTimeId()); + PeriodicMaintenanceTask.this.pointIntTimeId = response.getPointInTimeId(); + executeNext(PeriodicMaintenanceTask.this); + } + + @Override + public void onFailure(Exception e) { + if (TransportActions.isShardNotAvailableException(e)) { + complete(null); + } else { + complete(e); + } + } + }); + return; + } + + final String pitId = pointIntTimeId; + assert Strings.hasLength(pitId); + + if (searchResponse == null) { + final SearchSourceBuilder searchSource = new SearchSourceBuilder(); + searchSource.fetchField(new FieldAndFormat(CachedBlob.CREATION_TIME_FIELD, "epoch_millis")); + searchSource.fetchSource(false); + searchSource.trackScores(false); + searchSource.sort(ShardDocSortField.NAME); + searchSource.size(batchSize); + if (searchAfter != null) { + searchSource.searchAfter(searchAfter); + searchSource.trackTotalHits(false); + } else { + searchSource.trackTotalHits(true); + } + final PointInTimeBuilder pointInTime = new PointInTimeBuilder(pitId); + pointInTime.setKeepAlive(keepAlive); + searchSource.pointInTimeBuilder(pointInTime); + final SearchRequest searchRequest = new SearchRequest(); + searchRequest.source(searchSource); + clientWithOrigin.execute(SearchAction.INSTANCE, searchRequest, new ActionListener<>() { + @Override + public void onResponse(SearchResponse response) { + if (searchAfter == null) { + assert PeriodicMaintenanceTask.this.total.get() == 0L; + PeriodicMaintenanceTask.this.total.set(response.getHits().getTotalHits().value); + } + PeriodicMaintenanceTask.this.searchResponse = response; + PeriodicMaintenanceTask.this.searchAfter = null; + executeNext(PeriodicMaintenanceTask.this); + } + + @Override + public void onFailure(Exception e) { + complete(e); + } + }); + return; + } + + final SearchHit[] searchHits = searchResponse.getHits().getHits(); + if (searchHits != null && searchHits.length > 0) { + if (expirationTime == null) { + final TimeValue retention = periodicTaskRetention; + expirationTime = Instant.ofEpochMilli(threadPool.absoluteTimeInMillis()) + .minus(retention.duration(), retention.timeUnit().toChronoUnit()); + + final ClusterState state = clusterService.state(); + // compute the list of existing searchable snapshots and repositories once + existingSnapshots = listSearchableSnapshots(state); + existingRepositories = state.metadata() + .custom(RepositoriesMetadata.TYPE, RepositoriesMetadata.EMPTY) + .repositories() + .stream() + .map(RepositoryMetadata::name) + .collect(Collectors.toSet()); + } + + final BulkRequest bulkRequest = new BulkRequest(); + final Map> knownSnapshots = existingSnapshots; + assert knownSnapshots != null; + final Set knownRepositories = existingRepositories; + assert knownRepositories != null; + final Instant expirationTime = this.expirationTime; + assert expirationTime != null; + + Object[] lastSortValues = null; + for (SearchHit searchHit : searchHits) { + lastSortValues = searchHit.getSortValues(); + assert searchHit.getId() != null; + try { + boolean delete = false; + + // See {@link BlobStoreCacheService#generateId} + // doc id = {repository name}/{snapshot id}/{snapshot index id}/{shard id}/{file name}/@{file offset} + final String[] parts = Objects.requireNonNull(searchHit.getId()).split("/"); + assert parts.length == 6 : Arrays.toString(parts) + " vs " + searchHit.getId(); + + final String repositoryName = parts[0]; + if (knownRepositories.contains(repositoryName) == false) { + logger.trace("deleting blob store cache entry with id [{}]: repository does not exist", searchHit.getId()); + delete = true; + } else { + final Set knownIndexIds = knownSnapshots.get(parts[1]); + if (knownIndexIds == null || knownIndexIds.contains(parts[2]) == false) { + logger.trace("deleting blob store cache entry with id [{}]: not used", searchHit.getId()); + delete = true; + } + } + if (delete) { + final Instant creationTime = getCreationTime(searchHit); + if (creationTime.isAfter(expirationTime)) { + logger.trace( + "blob store cache entry with id [{}] was created recently, skipping deletion", + searchHit.getId() + ); + continue; + } + bulkRequest.add(new DeleteRequest().index(searchHit.getIndex()).id(searchHit.getId())); + } + } catch (Exception e) { + logger.warn( + () -> new ParameterizedMessage( + "exception when parsing blob store cache entry with id [{}], skipping", + searchHit.getId() + ), + e + ); + } + } + + assert lastSortValues != null; + if (bulkRequest.numberOfActions() == 0) { + this.searchResponse = null; + this.searchAfter = lastSortValues; + executeNext(this); + return; + } + + final Object[] finalSearchAfter = lastSortValues; + clientWithOrigin.execute(BulkAction.INSTANCE, bulkRequest, new ActionListener<>() { + @Override + public void onResponse(BulkResponse response) { + for (BulkItemResponse itemResponse : response.getItems()) { + if (itemResponse.isFailed() == false) { + assert itemResponse.getResponse() instanceof DeleteResponse; + PeriodicMaintenanceTask.this.deletes.incrementAndGet(); + } + } + PeriodicMaintenanceTask.this.searchResponse = null; + PeriodicMaintenanceTask.this.searchAfter = finalSearchAfter; + executeNext(PeriodicMaintenanceTask.this); + } + + @Override + public void onFailure(Exception e) { + complete(e); + } + }); + return; + } + // we're done, complete the task + complete(null); + } catch (Exception e) { + complete(e); + } + } + + public boolean isClosed() { + return closed.get(); + } + + private void ensureOpen() { + if (isClosed()) { + assert false : "should not use periodic task after close"; + throw new IllegalStateException("Periodic maintenance task is closed"); + } + } + + @Override + public void close() { + if (closed.compareAndSet(false, true)) { + final Exception e = error.get(); + if (e != null) { + logger.warn( + () -> new ParameterizedMessage( + "periodic maintenance task completed with failure ({} deleted documents out of a total of {})", + deletes.get(), + total.get() + ), + e + ); + } else { + logger.info( + () -> new ParameterizedMessage( + "periodic maintenance task completed ({} deleted documents out of a total of {})", + deletes.get(), + total.get() + ) + ); + } + } + } + + private void complete(@Nullable Exception failure) { + assert isClosed() == false; + final Releasable releasable = () -> { + try { + final Exception previous = error.getAndSet(failure); + assert previous == null : "periodic maintenance task already failed: " + previous; + close(); + } finally { + startPeriodicTask(); + } + }; + boolean waitForRelease = false; + try { + final String pitId = pointIntTimeId; + if (Strings.hasLength(pitId)) { + final ClosePointInTimeRequest closeRequest = new ClosePointInTimeRequest(pitId); + clientWithOrigin.execute(ClosePointInTimeAction.INSTANCE, closeRequest, ActionListener.runAfter(new ActionListener<>() { + @Override + public void onResponse(ClosePointInTimeResponse response) { + if (response.isSucceeded()) { + logger.debug("periodic maintenance task successfully closed point-in-time id [{}]", pitId); + } else { + logger.debug("point-in-time id [{}] not found", pitId); + } + } + + @Override + public void onFailure(Exception e) { + logger.warn(() -> new ParameterizedMessage("failed to close point-in-time id [{}]", pitId), e); + } + }, () -> Releasables.close(releasable))); + waitForRelease = true; + } + } finally { + if (waitForRelease == false) { + Releasables.close(releasable); + } + } + } + } + + private void executeNext(PeriodicMaintenanceTask maintenanceTask) { + threadPool.generic().execute(maintenanceTask); + } + + private static boolean assertGenericThread() { + final String threadName = Thread.currentThread().getName(); + assert threadName.contains(ThreadPool.Names.GENERIC) : threadName; + return true; + } + + private static Instant getCreationTime(SearchHit searchHit) { + final DocumentField creationTimeField = searchHit.field(CachedBlob.CREATION_TIME_FIELD); + assert creationTimeField != null; + final Object creationTimeValue = creationTimeField.getValue(); + assert creationTimeValue != null; + assert creationTimeValue instanceof String : "expect a java.lang.String but got " + creationTimeValue.getClass(); + return Instant.ofEpochMilli(Long.parseLong(creationTimeField.getValue())); + } } diff --git a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/cache/blob/BlobStoreCacheService.java b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/cache/blob/BlobStoreCacheService.java index 36a8b2468aef9..e4c7ba7d250ab 100644 --- a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/cache/blob/BlobStoreCacheService.java +++ b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/cache/blob/BlobStoreCacheService.java @@ -49,7 +49,6 @@ import java.util.concurrent.Semaphore; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; -import java.util.function.Supplier; import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.xpack.core.ClientHelper.SEARCHABLE_SNAPSHOTS_ORIGIN; @@ -72,17 +71,15 @@ public class BlobStoreCacheService extends AbstractLifecycleComponent { private final ClusterService clusterService; private final Semaphore inFlightCacheFills; - private final Supplier timeSupplier; private final AtomicBoolean closed; private final Client client; private final String index; - public BlobStoreCacheService(ClusterService clusterService, Client client, String index, Supplier timeSupplier) { + public BlobStoreCacheService(ClusterService clusterService, Client client, String index) { this.client = new OriginSettingClient(client, SEARCHABLE_SNAPSHOTS_ORIGIN); this.inFlightCacheFills = new Semaphore(MAX_IN_FLIGHT_CACHE_FILLS); this.closed = new AtomicBoolean(false); this.clusterService = clusterService; - this.timeSupplier = timeSupplier; this.index = index; } @@ -242,12 +239,13 @@ public final void putAsync( final String name, final ByteRange range, final BytesReference bytes, + final long timeInEpochMillis, final ActionListener listener ) { final String id = generateId(repository, snapshotId, indexId, shardId, name, range); try { final CachedBlob cachedBlob = new CachedBlob( - Instant.ofEpochMilli(timeSupplier.get()), + Instant.ofEpochMilli(timeInEpochMillis), Version.CURRENT, repository, name, diff --git a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/cache/blob/CachedBlob.java b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/cache/blob/CachedBlob.java index ba0d2b21b659f..8bb08554829a9 100644 --- a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/cache/blob/CachedBlob.java +++ b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/cache/blob/CachedBlob.java @@ -31,6 +31,7 @@ public class CachedBlob implements ToXContent { public static final CachedBlob CACHE_MISS = new CachedBlob(null, null, null, "CACHE_MISS", null, BytesArray.EMPTY, 0L, 0L); private static final String TYPE = "blob"; + public static final String CREATION_TIME_FIELD = "creation_time"; private final Instant creationTime; private final Version version; @@ -80,7 +81,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws builder.startObject(); { builder.field("type", TYPE); - builder.field("creation_time", creationTime.toEpochMilli()); + builder.field(CREATION_TIME_FIELD, creationTime.toEpochMilli()); builder.field("version", version.id); builder.field("repository", repository); builder.startObject("blob"); @@ -117,9 +118,17 @@ public BytesReference bytes() { return bytes; } + public Version version() { + return version; + } + + public Instant creationTime() { + return creationTime; + } + @SuppressWarnings("unchecked") public static CachedBlob fromSource(final Map source) { - final Long creationTimeEpochMillis = (Long) source.get("creation_time"); + final Long creationTimeEpochMillis = (Long) source.get(CREATION_TIME_FIELD); if (creationTimeEpochMillis == null) { throw new IllegalStateException("cached blob document does not have the [creation_time] field"); } diff --git a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/store/SearchableSnapshotDirectory.java b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/store/SearchableSnapshotDirectory.java index cd403bcb00e44..d1c3c65e78b83 100644 --- a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/store/SearchableSnapshotDirectory.java +++ b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/store/SearchableSnapshotDirectory.java @@ -704,7 +704,17 @@ public CachedBlob getCachedBlob(String name, ByteRange range) { } public void putCachedBlob(String name, ByteRange range, BytesReference content, ActionListener listener) { - blobStoreCacheService.putAsync(repository, snapshotId, indexId, shardId, name, range, content, listener); + blobStoreCacheService.putAsync( + repository, + snapshotId, + indexId, + shardId, + name, + range, + content, + threadPool.absoluteTimeInMillis(), + listener + ); } public FrozenCacheFile getFrozenCacheFile(String fileName, long length) { diff --git a/x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/cache/blob/BlobStoreCacheServiceTests.java b/x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/cache/blob/BlobStoreCacheServiceTests.java index 88aad96b1680a..51db7d04337e5 100644 --- a/x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/cache/blob/BlobStoreCacheServiceTests.java +++ b/x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/cache/blob/BlobStoreCacheServiceTests.java @@ -100,7 +100,7 @@ public void testGetWhenServiceNotStarted() { return null; }).when(mockClient).execute(eq(GetAction.INSTANCE), any(GetRequest.class), any(ActionListener.class)); - BlobStoreCacheService blobCacheService = new BlobStoreCacheService(null, mockClient, SNAPSHOT_BLOB_CACHE_INDEX, () -> 0L); + BlobStoreCacheService blobCacheService = new BlobStoreCacheService(null, mockClient, SNAPSHOT_BLOB_CACHE_INDEX); blobCacheService.start(); PlainActionFuture future = PlainActionFuture.newFuture(); @@ -132,17 +132,17 @@ public void testPutWhenServiceNotStarted() { return null; }).when(mockClient).execute(eq(IndexAction.INSTANCE), any(IndexRequest.class), any(ActionListener.class)); - BlobStoreCacheService blobCacheService = new BlobStoreCacheService(null, mockClient, SNAPSHOT_BLOB_CACHE_INDEX, () -> 0L); + BlobStoreCacheService blobCacheService = new BlobStoreCacheService(null, mockClient, SNAPSHOT_BLOB_CACHE_INDEX); blobCacheService.start(); PlainActionFuture future = PlainActionFuture.newFuture(); - blobCacheService.putAsync(repository, snapshotId, indexId, shardId, fileName, range, BytesArray.EMPTY, future); + blobCacheService.putAsync(repository, snapshotId, indexId, shardId, fileName, range, BytesArray.EMPTY, 0L, future); assertThat(future.actionGet(), nullValue()); blobCacheService.stop(); future = PlainActionFuture.newFuture(); - blobCacheService.putAsync(repository, snapshotId, indexId, shardId, fileName, range, BytesArray.EMPTY, future); + blobCacheService.putAsync(repository, snapshotId, indexId, shardId, fileName, range, BytesArray.EMPTY, 0L, future); IllegalStateException exception = expectThrows(IllegalStateException.class, future::actionGet); assertThat(exception.getMessage(), containsString("Blob cache service is closed")); } @@ -170,7 +170,7 @@ public void testWaitForInFlightCacheFillsToComplete() throws Exception { return null; }).when(mockClient).execute(eq(IndexAction.INSTANCE), any(IndexRequest.class), any(ActionListener.class)); - final BlobStoreCacheService blobCacheService = new BlobStoreCacheService(null, mockClient, SNAPSHOT_BLOB_CACHE_INDEX, () -> 0L); + final BlobStoreCacheService blobCacheService = new BlobStoreCacheService(null, mockClient, SNAPSHOT_BLOB_CACHE_INDEX); blobCacheService.start(); assertThat(blobCacheService.getInFlightCacheFills(), equalTo(0)); @@ -180,7 +180,7 @@ public void testWaitForInFlightCacheFillsToComplete() throws Exception { final PlainActionFuture future = PlainActionFuture.newFuture(); threadPool.generic() .execute( - () -> blobCacheService.putAsync(repository, snapshotId, indexId, shardId, fileName, range, BytesArray.EMPTY, future) + () -> blobCacheService.putAsync(repository, snapshotId, indexId, shardId, fileName, range, BytesArray.EMPTY, 0L, future) ); futures.add(future); } diff --git a/x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/cache/common/TestUtils.java b/x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/cache/common/TestUtils.java index e3f9306a6f145..8196d983768fe 100644 --- a/x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/cache/common/TestUtils.java +++ b/x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/cache/common/TestUtils.java @@ -316,7 +316,7 @@ private UnsupportedOperationException unsupportedException() { public static class NoopBlobStoreCacheService extends BlobStoreCacheService { public NoopBlobStoreCacheService() { - super(null, mock(Client.class), SNAPSHOT_BLOB_CACHE_INDEX, () -> 0L); + super(null, mock(Client.class), SNAPSHOT_BLOB_CACHE_INDEX); } @Override @@ -345,7 +345,7 @@ public static class SimpleBlobStoreCacheService extends BlobStoreCacheService { private final ConcurrentHashMap blobs = new ConcurrentHashMap<>(); public SimpleBlobStoreCacheService() { - super(null, mock(Client.class), SNAPSHOT_BLOB_CACHE_INDEX, System::currentTimeMillis); + super(null, mock(Client.class), SNAPSHOT_BLOB_CACHE_INDEX); } @Override From bfb5218cb408f7e42ee21026079ea48b3fcb2e8e Mon Sep 17 00:00:00 2001 From: David Turner Date: Mon, 4 Oct 2021 13:05:53 +0100 Subject: [PATCH 117/250] Add snapshot stress tests (#78596) * Add snapshot stress tests Adds `SnapshotStressTestsIT`, a test that performs a wide variety of concurrent snapshot-related operations to explore the corners of the snapshot state machine in a randomized fashion: - indexing docs, deleting and re-creating the indices - restarting nodes - removing and adding repositores - taking snapshots (sometimes partial), cloning them, and deleting them It ensures that these operations should succeed via a system of shared/exclusive locks. None of the operations block. If the necessary locks aren't all available then the operation just releases the ones it has acquired and tries again later. The test completes after completing a certain number of snapshots or after a certain time has elapsed. * Fix tracked shard count on restore * Fix variable name typos * Stream directly * randomSubsetOf --- .../snapshots/SnapshotStressTestsIT.java | 1568 +++++++++++++++++ 1 file changed, 1568 insertions(+) create mode 100644 server/src/internalClusterTest/java/org/elasticsearch/snapshots/SnapshotStressTestsIT.java diff --git a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/SnapshotStressTestsIT.java b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/SnapshotStressTestsIT.java new file mode 100644 index 0000000000000..1cfe670f38bda --- /dev/null +++ b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/SnapshotStressTestsIT.java @@ -0,0 +1,1568 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.snapshots; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.apache.lucene.util.LuceneTestCase; +import org.elasticsearch.ExceptionsHelper; +import org.elasticsearch.action.ActionListener; +import org.elasticsearch.action.ShardOperationFailedException; +import org.elasticsearch.action.StepListener; +import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse; +import org.elasticsearch.action.admin.cluster.node.hotthreads.NodeHotThreads; +import org.elasticsearch.action.admin.cluster.snapshots.create.CreateSnapshotRequestBuilder; +import org.elasticsearch.action.admin.cluster.snapshots.delete.DeleteSnapshotRequestBuilder; +import org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotRequestBuilder; +import org.elasticsearch.action.bulk.BulkItemResponse; +import org.elasticsearch.action.bulk.BulkRequestBuilder; +import org.elasticsearch.action.bulk.BulkResponse; +import org.elasticsearch.action.index.IndexRequest; +import org.elasticsearch.action.support.ListenableActionFuture; +import org.elasticsearch.action.support.master.AcknowledgedResponse; +import org.elasticsearch.client.Client; +import org.elasticsearch.cluster.metadata.IndexMetadata; +import org.elasticsearch.cluster.node.DiscoveryNode; +import org.elasticsearch.cluster.node.DiscoveryNodes; +import org.elasticsearch.cluster.service.ClusterService; +import org.elasticsearch.common.Priority; +import org.elasticsearch.common.Randomness; +import org.elasticsearch.common.Strings; +import org.elasticsearch.common.collect.ImmutableOpenMap; +import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.common.util.concurrent.AbstractRunnable; +import org.elasticsearch.common.util.concurrent.ConcurrentCollections; +import org.elasticsearch.core.CheckedConsumer; +import org.elasticsearch.core.CheckedRunnable; +import org.elasticsearch.core.Nullable; +import org.elasticsearch.core.Releasable; +import org.elasticsearch.core.Releasables; +import org.elasticsearch.core.TimeValue; +import org.elasticsearch.core.Tuple; +import org.elasticsearch.repositories.RepositoryCleanupResult; +import org.elasticsearch.repositories.fs.FsRepository; +import org.elasticsearch.test.InternalTestCluster; +import org.elasticsearch.threadpool.ScalingExecutorBuilder; +import org.elasticsearch.threadpool.TestThreadPool; +import org.elasticsearch.threadpool.ThreadPool; + +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.Semaphore; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicReference; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.repositories.blobstore.ChecksumBlobStoreFormat.SNAPSHOT_ONLY_FORMAT_PARAMS; +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.hasSize; +import static org.hamcrest.Matchers.notNullValue; + +@LuceneTestCase.SuppressFileSystems(value = "HandleLimitFS") // we sometimes have >2048 open files +public class SnapshotStressTestsIT extends AbstractSnapshotIntegTestCase { + + public void testRandomActivities() throws InterruptedException { + final DiscoveryNodes discoveryNodes = client().admin().cluster().prepareState().clear().setNodes(true).get().getState().nodes(); + new TrackedCluster(internalCluster(), nodeNames(discoveryNodes.getMasterNodes()), nodeNames(discoveryNodes.getDataNodes())).run(); + disableRepoConsistencyCheck("have not necessarily written to all repositories"); + } + + private static Set nodeNames(ImmutableOpenMap nodesMap) { + return nodesMap.stream().map(c -> c.getValue().getName()).collect(Collectors.toSet()); + } + + /** + * Encapsulates a common pattern of trying to acquire a bunch of resources and then transferring ownership elsewhere on success, + * but releasing them on failure. + */ + private static class TransferableReleasables implements Releasable { + + private boolean transferred = false; + private final List releasables = new ArrayList<>(); + + T add(T releasable) { + assert transferred == false : "already transferred"; + releasables.add(releasable); + return releasable; + } + + Releasable transfer() { + assert transferred == false : "already transferred"; + transferred = true; + Collections.reverse(releasables); + return () -> Releasables.close(releasables); + } + + @Override + public void close() { + if (transferred == false) { + Releasables.close(releasables); + } + } + } + + @Nullable // if no permit was acquired + private static Releasable tryAcquirePermit(Semaphore permits) { + if (permits.tryAcquire()) { + return Releasables.releaseOnce(permits::release); + } else { + return null; + } + } + + @Nullable // if not all permits were acquired + private static Releasable tryAcquireAllPermits(Semaphore permits) { + if (permits.tryAcquire(Integer.MAX_VALUE)) { + return Releasables.releaseOnce(() -> permits.release(Integer.MAX_VALUE)); + } else { + return null; + } + } + + private static AbstractRunnable mustSucceed(CheckedRunnable runnable) { + return new AbstractRunnable() { + @Override + public void onFailure(Exception e) { + logAndFailTest(e); + } + + @Override + protected void doRun() throws Exception { + runnable.run(); + } + + @Override + public void onRejection(Exception e) { + // ok, shutting down + } + }; + } + + private static ActionListener mustSucceed(CheckedConsumer consumer) { + return new ActionListener<>() { + @Override + public void onResponse(T t) { + try { + consumer.accept(t); + } catch (Exception e) { + logAndFailTest(e); + } + } + + @Override + public void onFailure(Exception e) { + logAndFailTest(e); + } + }; + } + + private static void logAndFailTest(Exception e) { + final AssertionError assertionError = new AssertionError("unexpected", e); + TrackedCluster.logger.error("test failed", assertionError); + throw assertionError; + } + + /** + * Test harness for snapshot stress tests. + * + * The test performs random operations on the cluster, as if from an external client: + * + * - indexing docs, deleting and re-creating the indices + * - restarting nodes + * - removing and adding repositories + * - taking snapshots (sometimes partial), cloning them, and deleting them + * + * It ensures that these operations should succeed via a system of shared/exclusive locks implemented via permits: acquiring a single + * permit is a shared lock, whereas acquiring all the permits is an exclusive lock. So for instance taking a snapshot acquires a shared + * lock on the repository (permitting other concurrent snapshots/clones/deletes) whereas deleting and recreating the repository requires + * an exclusive lock (ensuring that there are no ongoing operations on the repository, and preventing any new such operations from + * starting). + * + * None of the operations block. If the necessary locks aren't all available then the operation just releases the ones it has acquired + * and tries again later. + * + * The test completes after completing a certain number of snapshots (see {@link #completedSnapshotLatch}) or after a certain time has + * elapsed. + */ + private static class TrackedCluster { + + static final Logger logger = LogManager.getLogger(TrackedCluster.class); + static final String CLIENT = "client"; + + private final ThreadPool threadPool = new TestThreadPool( + "TrackedCluster", + // a single thread for "client" activities, to limit the number of activities all starting at once + new ScalingExecutorBuilder(CLIENT, 1, 1, TimeValue.ZERO, CLIENT) + ); + + private final AtomicBoolean shouldStop = new AtomicBoolean(); + private final InternalTestCluster cluster; + private final Map nodes = ConcurrentCollections.newConcurrentMap(); + private final Map repositories = ConcurrentCollections.newConcurrentMap(); + private final Map indices = ConcurrentCollections.newConcurrentMap(); + private final Map snapshots = ConcurrentCollections.newConcurrentMap(); + + /** + * If we acquire permits on nodes in a completely random order then we tend to block all possible restarts. Instead we always try + * the nodes in the same order, held in this field, so that nodes nearer the end of the list are more likely to be restartable. + * The elected master node is usually last in this list. + */ + private volatile List shuffledNodes; + + private final AtomicInteger snapshotCounter = new AtomicInteger(); + private final CountDownLatch completedSnapshotLatch = new CountDownLatch(30); + + TrackedCluster(InternalTestCluster cluster, Set masterNodeNames, Set dataNodeNames) { + this.cluster = cluster; + for (String nodeName : cluster.getNodeNames()) { + nodes.put(nodeName, new TrackedNode(nodeName, masterNodeNames.contains(nodeName), dataNodeNames.contains(nodeName))); + } + + final int repoCount = between(1, 3); + for (int i = 0; i < repoCount; i++) { + final String repositoryName = "repo-" + i; + repositories.put(repositoryName, new TrackedRepository(repositoryName, randomRepoPath())); + } + + final int indexCount = between(1, 10); + for (int i = 0; i < indexCount; i++) { + final String indexName = "index-" + i; + indices.put(indexName, new TrackedIndex(indexName)); + } + } + + void shuffleNodes() { + final List newNodes = new ArrayList<>(nodes.values()); + Randomness.shuffle(newNodes); + final String masterNodeName = Optional.ofNullable(cluster.getInstance(ClusterService.class).state().nodes().getMasterNode()) + .map(DiscoveryNode::getName) + .orElse(null); + newNodes.sort(Comparator.comparing(tn -> tn.nodeName.equals(masterNodeName))); + shuffledNodes = newNodes; + } + + public void run() throws InterruptedException { + shuffleNodes(); + + for (TrackedIndex trackedIndex : indices.values()) { + trackedIndex.start(); + } + + for (TrackedRepository trackedRepository : repositories.values()) { + trackedRepository.start(); + } + + final int nodeRestarterCount = between(1, 2); + for (int i = 0; i < nodeRestarterCount; i++) { + startNodeRestarter(); + } + + final int snapshotterCount = between(1, 5); + for (int i = 0; i < snapshotterCount; i++) { + startSnapshotter(); + } + + final int partialSnapshotterCount = between(1, 5); + for (int i = 0; i < partialSnapshotterCount; i++) { + startPartialSnapshotter(); + } + + final int clonerCount = between(0, 5); + for (int i = 0; i < clonerCount; i++) { + startCloner(); + } + + final int deleterCount = between(0, 3); + for (int i = 0; i < deleterCount; i++) { + startSnapshotDeleter(); + } + + final int restorerCount = between(0, 3); + for (int i = 0; i < restorerCount; i++) { + startRestorer(); + } + + final int cleanerCount = between(0, 2); + for (int i = 0; i < cleanerCount; i++) { + startCleaner(); + } + + if (completedSnapshotLatch.await(30, TimeUnit.SECONDS)) { + logger.info("--> completed target snapshot count, finishing test"); + } else { + logger.info("--> did not complete target snapshot count in 30s, giving up"); + } + + assertTrue(shouldStop.compareAndSet(false, true)); + final long permitDeadlineMillis = threadPool.relativeTimeInMillis() + TimeUnit.SECONDS.toMillis(30); + + final List failedPermitAcquisitions = new ArrayList<>(); + acquirePermitsAtEnd( + repositories.values().stream().map(n -> Tuple.tuple(n.repositoryName, n.permits)), + failedPermitAcquisitions, + permitDeadlineMillis + ); + acquirePermitsAtEnd( + snapshots.values().stream().map(n -> Tuple.tuple(n.snapshotName, n.permits)), + failedPermitAcquisitions, + permitDeadlineMillis + ); + acquirePermitsAtEnd( + indices.values().stream().map(n -> Tuple.tuple(n.indexName, n.permits)), + failedPermitAcquisitions, + permitDeadlineMillis + ); + acquirePermitsAtEnd( + nodes.values().stream().map(n -> Tuple.tuple(n.nodeName, n.permits)), + failedPermitAcquisitions, + permitDeadlineMillis + ); + + if (failedPermitAcquisitions.isEmpty() == false) { + logger.warn("--> failed to acquire all permits: {}", failedPermitAcquisitions); + logger.info( + "--> current cluster state:\n{}", + Strings.toString(client().admin().cluster().prepareState().get().getState(), true, true) + ); + fail("failed to acquire all permits: " + failedPermitAcquisitions); + } + logger.info("--> acquired all permits"); + + if (ThreadPool.terminate(threadPool, 30, TimeUnit.SECONDS) == false) { + logger.warn("--> threadpool termination timed out"); + logger.info( + "--> current cluster state:\n{}", + Strings.toString(client().admin().cluster().prepareState().get().getState(), true, true) + ); + } + } + + private void acquirePermitsAtEnd( + Stream> labelledPermits, + List failedPermitAcquisitions, + long permitDeadlineMillis + ) { + labelledPermits.forEach(labelledPermit -> { + final long remainingMillis = Math.max(1L, permitDeadlineMillis - threadPool.relativeTimeInMillis()); + final String label = labelledPermit.v1(); + logger.info("--> acquiring permit [{}] with timeout of [{}ms]", label, remainingMillis); + try { + if (labelledPermit.v2().tryAcquire(Integer.MAX_VALUE, remainingMillis, TimeUnit.MILLISECONDS)) { + logger.info("--> acquired permit [{}]", label); + } else { + logger.warn("--> failed to acquire permit [{}]", label); + logger.info( + "--> current cluster state:\n{}", + Strings.toString(client().admin().cluster().prepareState().get().getState(), true, true) + ); + logger.info( + "--> hot threads:\n{}", + client().admin() + .cluster() + .prepareNodesHotThreads() + .setThreads(99999) + .setIgnoreIdleThreads(false) + .get() + .getNodes() + .stream() + .map(NodeHotThreads::getHotThreads) + .collect(Collectors.joining("\n")) + ); + failedPermitAcquisitions.add(label); + } + } catch (InterruptedException e) { + logger.warn("--> interrupted while acquiring permit [{}]", label); + Thread.currentThread().interrupt(); + logAndFailTest(e); + } + }); + } + + private void enqueueAction(final CheckedRunnable action) { + if (shouldStop.get()) { + return; + } + + threadPool.scheduleUnlessShuttingDown(TimeValue.timeValueMillis(between(1, 500)), CLIENT, mustSucceed(action)); + } + + private void startRestorer() { + enqueueAction(() -> { + boolean startedRestore = false; + try (TransferableReleasables localReleasables = new TransferableReleasables()) { + + final List trackedSnapshots = new ArrayList<>(snapshots.values()); + if (trackedSnapshots.isEmpty()) { + return; + } + + if (localReleasables.add(blockNodeRestarts()) == null) { + return; + } + + final TrackedSnapshot trackedSnapshot = randomFrom(trackedSnapshots); + if (localReleasables.add(trackedSnapshot.tryAcquirePermit()) == null) { + return; + } + + if (snapshots.get(trackedSnapshot.snapshotName) != trackedSnapshot) { + // concurrently removed + return; + } + + final Releasable releaseAll = localReleasables.transfer(); + + logger.info( + "--> listing indices in [{}:{}] in preparation for restoring", + trackedSnapshot.trackedRepository.repositoryName, + trackedSnapshot.snapshotName + ); + + trackedSnapshot.getSnapshotInfo(client(), mustSucceed(snapshotInfo -> restoreSnapshot(snapshotInfo, releaseAll))); + + startedRestore = true; + } finally { + if (startedRestore == false) { + startRestorer(); + } + } + }); + } + + private void restoreSnapshot(SnapshotInfo snapshotInfo, Releasable releasePreviousStep) { + boolean startedRestore = false; + try (TransferableReleasables localReleasables = new TransferableReleasables()) { + localReleasables.add(releasePreviousStep); + + if (shouldStop.get()) { + return; + } + + boolean restoreSpecificIndicesTmp = randomBoolean(); + final List indicesToRestoreList = new ArrayList<>(snapshotInfo.indices().size()); + final List indicesToCloseList = new ArrayList<>(snapshotInfo.indices().size()); + final List indicesToDeleteList = new ArrayList<>(snapshotInfo.indices().size()); + for (String indexName : snapshotInfo.indices()) { + if (snapshotInfo.shardFailures() + .stream() + .anyMatch(snapshotShardFailure -> snapshotShardFailure.getShardId().getIndexName().equals(indexName))) { + + restoreSpecificIndicesTmp = true; + continue; + } + if (randomBoolean() && localReleasables.add(tryAcquireAllPermits(indices.get(indexName).permits)) != null) { + + indicesToRestoreList.add(indexName); + + final int snapshotShardCount = snapshotInfo.indexSnapshotDetails().get(indexName).getShardCount(); + final int indexShardCount = indices.get(indexName).shardCount; + if (snapshotShardCount == indexShardCount && randomBoolean()) { + indicesToCloseList.add(indexName); + } else { + indicesToDeleteList.add(indexName); + indices.get(indexName).shardCount = snapshotShardCount; + } + } else { + restoreSpecificIndicesTmp = true; + } + } + final boolean restoreSpecificIndices = restoreSpecificIndicesTmp; + + if (indicesToRestoreList.isEmpty()) { + logger.info( + "--> could not obtain exclusive lock on any indices in [{}:{}] for restore", + snapshotInfo.repository(), + snapshotInfo.snapshotId().getName() + ); + + return; + } + + final Releasable releaseAll = localReleasables.transfer(); + + final String[] indicesToRestore = indicesToRestoreList.toArray(new String[0]); + final String[] indicesToClose = indicesToCloseList.toArray(new String[0]); + final String[] indicesToDelete = indicesToDeleteList.toArray(new String[0]); + + final StepListener closeIndicesStep = new StepListener<>(); + final StepListener deleteIndicesStep = new StepListener<>(); + + if (indicesToClose.length > 0) { + logger.info( + "--> closing indices {} in preparation for restoring from [{}:{}]", + indicesToRestoreList, + snapshotInfo.repository(), + snapshotInfo.snapshotId().getName() + ); + client().admin().indices().prepareClose(indicesToClose).execute(mustSucceed(closeIndexResponse -> { + logger.info( + "--> finished closing indices {} in preparation for restoring from [{}:{}]", + indicesToRestoreList, + snapshotInfo.repository(), + snapshotInfo.snapshotId().getName() + ); + assertTrue(closeIndexResponse.isAcknowledged()); + assertTrue(closeIndexResponse.isShardsAcknowledged()); + closeIndicesStep.onResponse(null); + })); + } else { + closeIndicesStep.onResponse(null); + } + + if (indicesToDelete.length > 0) { + logger.info( + "--> deleting indices {} in preparation for restoring from [{}:{}]", + indicesToRestoreList, + snapshotInfo.repository(), + snapshotInfo.snapshotId().getName() + ); + client().admin().indices().prepareDelete(indicesToDelete).execute(mustSucceed(deleteIndicesResponse -> { + logger.info( + "--> finished deleting indices {} in preparation for restoring from [{}:{}]", + indicesToRestoreList, + snapshotInfo.repository(), + snapshotInfo.snapshotId().getName() + ); + assertTrue(deleteIndicesResponse.isAcknowledged()); + deleteIndicesStep.onResponse(null); + })); + } else { + deleteIndicesStep.onResponse(null); + } + + closeIndicesStep.addListener(mustSucceed(ignored1 -> deleteIndicesStep.addListener(mustSucceed(ignored2 -> { + + final RestoreSnapshotRequestBuilder restoreSnapshotRequestBuilder = client().admin() + .cluster() + .prepareRestoreSnapshot(snapshotInfo.repository(), snapshotInfo.snapshotId().getName()); + + if (restoreSpecificIndices) { + restoreSnapshotRequestBuilder.setIndices(indicesToRestore); + } + + logger.info( + "--> restoring indices {}{} from [{}:{}]", + restoreSpecificIndices ? "" : "*=", + indicesToRestoreList, + snapshotInfo.repository(), + snapshotInfo.snapshotId().getName() + ); + + restoreSnapshotRequestBuilder.execute(mustSucceed(restoreSnapshotResponse -> { + logger.info( + "--> triggered restore of indices {} from [{}:{}], waiting for green health", + indicesToRestoreList, + snapshotInfo.repository(), + snapshotInfo.snapshotId().getName() + ); + + client().admin() + .cluster() + .prepareHealth(indicesToRestore) + .setWaitForEvents(Priority.LANGUID) + .setWaitForGreenStatus() + .setWaitForNoInitializingShards(true) + .setWaitForNodes(Integer.toString(internalCluster().getNodeNames().length)) + .execute(mustSucceed(clusterHealthResponse -> { + + logger.info( + "--> indices {} successfully restored from [{}:{}]", + indicesToRestoreList, + snapshotInfo.repository(), + snapshotInfo.snapshotId().getName() + ); + + Releasables.close(releaseAll); + assertFalse(clusterHealthResponse.isTimedOut()); + startRestorer(); + })); + })); + })))); + + startedRestore = true; + } finally { + if (startedRestore == false) { + startRestorer(); + } + } + } + + private void startCloner() { + enqueueAction(() -> { + boolean startedClone = false; + try (TransferableReleasables localReleasables = new TransferableReleasables()) { + + final List trackedSnapshots = new ArrayList<>(snapshots.values()); + if (trackedSnapshots.isEmpty()) { + return; + } + + if (localReleasables.add(blockFullClusterRestart()) == null) { + return; + } + + final Client client = localReleasables.add(acquireClient()).getClient(); + + final TrackedSnapshot trackedSnapshot = randomFrom(trackedSnapshots); + if (localReleasables.add(trackedSnapshot.tryAcquirePermit()) == null) { + return; + } + + if (snapshots.get(trackedSnapshot.snapshotName) != trackedSnapshot) { + // concurrently removed + return; + } + + final Releasable releaseAll = localReleasables.transfer(); + + final StepListener> getIndicesStep = new StepListener<>(); + + logger.info( + "--> listing indices in [{}:{}] in preparation for cloning", + trackedSnapshot.trackedRepository.repositoryName, + trackedSnapshot.snapshotName + ); + + trackedSnapshot.getSnapshotInfo(client, mustSucceed(snapshotInfo -> { + final Set failedShardIndices = snapshotInfo.shardFailures() + .stream() + .map(ShardOperationFailedException::index) + .collect(Collectors.toSet()); + final Set cloneableIndices = new HashSet<>(snapshotInfo.indices()); + cloneableIndices.removeAll(failedShardIndices); + + if (cloneableIndices.isEmpty()) { + getIndicesStep.onResponse(Collections.emptyList()); + return; + } + + if (failedShardIndices.isEmpty() && randomBoolean()) { + getIndicesStep.onResponse(Collections.singletonList("*")); + return; + } + + getIndicesStep.onResponse(randomSubsetOf(between(1, cloneableIndices.size()), cloneableIndices)); + })); + + getIndicesStep.addListener(mustSucceed(indexNames -> { + + if (indexNames.isEmpty()) { + logger.info( + "--> no successful indices in [{}:{}], skipping clone", + trackedSnapshot.trackedRepository.repositoryName, + trackedSnapshot.snapshotName + ); + Releasables.close(releaseAll); + startCloner(); + return; + } + + final String cloneName = "snapshot-clone-" + snapshotCounter.incrementAndGet(); + + logger.info( + "--> starting clone of [{}:{}] as [{}:{}] with indices {}", + trackedSnapshot.trackedRepository.repositoryName, + trackedSnapshot.snapshotName, + trackedSnapshot.trackedRepository.repositoryName, + cloneName, + indexNames + ); + + client.admin() + .cluster() + .prepareCloneSnapshot(trackedSnapshot.trackedRepository.repositoryName, trackedSnapshot.snapshotName, cloneName) + .setIndices(indexNames.toArray(new String[0])) + .execute(mustSucceed(acknowledgedResponse -> { + Releasables.close(releaseAll); + assertTrue(acknowledgedResponse.isAcknowledged()); + completedSnapshotLatch.countDown(); + logger.info( + "--> completed clone of [{}:{}] as [{}:{}]", + trackedSnapshot.trackedRepository.repositoryName, + trackedSnapshot.snapshotName, + trackedSnapshot.trackedRepository.repositoryName, + cloneName + ); + startCloner(); + })); + })); + + startedClone = true; + } finally { + if (startedClone == false) { + startCloner(); + } + } + }); + } + + private void startSnapshotDeleter() { + enqueueAction(() -> { + + boolean startedDeletion = false; + try (TransferableReleasables localReleasables = new TransferableReleasables()) { + + if (localReleasables.add(blockFullClusterRestart()) == null) { + return; + } + + final Client client = localReleasables.add(acquireClient()).getClient(); + + final List snapshotNames = new ArrayList<>(); + final TrackedRepository targetRepository = blockSnapshotsFromOneRepository(localReleasables, snapshotNames); + if (targetRepository == null) return; + + logger.info("--> starting deletion of [{}:{}]", targetRepository.repositoryName, snapshotNames); + + final Releasable releaseAll = localReleasables.transfer(); + + client.admin() + .cluster() + .prepareDeleteSnapshot(targetRepository.repositoryName, snapshotNames.toArray(new String[0])) + .execute(mustSucceed(acknowledgedResponse -> { + assertTrue(acknowledgedResponse.isAcknowledged()); + for (String snapshotName : snapshotNames) { + assertThat(snapshots.remove(snapshotName), notNullValue()); + } + Releasables.close(releaseAll); // must only release snapshot after removing it from snapshots map + logger.info("--> completed deletion of [{}:{}]", targetRepository.repositoryName, snapshotNames); + startSnapshotDeleter(); + })); + + startedDeletion = true; + + } finally { + if (startedDeletion == false) { + startSnapshotDeleter(); + } + } + }); + } + + @Nullable // if no blocks could be acquired + private TrackedRepository blockSnapshotsFromOneRepository(TransferableReleasables localReleasables, List snapshotNames) { + final List trackedSnapshots = new ArrayList<>(snapshots.values()); + TrackedRepository targetRepository = null; + Randomness.shuffle(trackedSnapshots); + for (TrackedSnapshot trackedSnapshot : trackedSnapshots) { + if ((targetRepository == null || trackedSnapshot.trackedRepository == targetRepository) + && (snapshotNames.isEmpty() || randomBoolean()) + && localReleasables.add(trackedSnapshot.tryAcquireAllPermits()) != null + && snapshots.get(trackedSnapshot.snapshotName) == trackedSnapshot) { + + targetRepository = trackedSnapshot.trackedRepository; + snapshotNames.add(trackedSnapshot.snapshotName); + } + } + + if (targetRepository != null) { + assertFalse(targetRepository.repositoryName, snapshotNames.isEmpty()); + } + return targetRepository; + } + + private void startCleaner() { + enqueueAction(() -> { + + boolean startedCleanup = false; + try (TransferableReleasables localReleasables = new TransferableReleasables()) { + + if (localReleasables.add(blockFullClusterRestart()) == null) { + return; + } + + final Client client = localReleasables.add(acquireClient()).getClient(); + + for (TrackedRepository trackedRepository : repositories.values()) { + // cleanup forbids all concurrent snapshot activity + if (localReleasables.add(tryAcquireAllPermits(trackedRepository.permits)) == null) { + return; + } + } + + final TrackedRepository trackedRepository = randomFrom(repositories.values()); + + final Releasable releaseAll = localReleasables.transfer(); + + logger.info("--> starting cleanup of [{}]", trackedRepository.repositoryName); + client.admin() + .cluster() + .prepareCleanupRepository(trackedRepository.repositoryName) + .execute(mustSucceed(cleanupRepositoryResponse -> { + Releasables.close(releaseAll); + logger.info("--> completed cleanup of [{}]", trackedRepository.repositoryName); + final RepositoryCleanupResult result = cleanupRepositoryResponse.result(); + assertThat(Strings.toString(result), result.blobs(), equalTo(0L)); + assertThat(Strings.toString(result), result.bytes(), equalTo(0L)); + startCleaner(); + })); + + startedCleanup = true; + } finally { + if (startedCleanup == false) { + startCleaner(); + } + } + }); + } + + private void startSnapshotter() { + enqueueAction(() -> { + + boolean startedSnapshot = false; + try (TransferableReleasables localReleasables = new TransferableReleasables()) { + + // separate TransferableReleasables for blocking node restarts & index deletion so we can release these blocks and + // permit data node restarts and index deletions as soon as the snapshot starts + final TransferableReleasables releasableAfterStart = new TransferableReleasables(); + localReleasables.add(releasableAfterStart); + + if (releasableAfterStart.add(blockNodeRestarts()) == null) { + return; + } + assertNotNull(localReleasables.add(blockFullClusterRestart())); + final Client client = localReleasables.add(acquireClient()).getClient(); + + final TrackedRepository trackedRepository = randomFrom(repositories.values()); + if (localReleasables.add(tryAcquirePermit(trackedRepository.permits)) == null) { + return; + } + + boolean snapshotSpecificIndicesTmp = randomBoolean(); + final List targetIndexNames = new ArrayList<>(indices.size()); + for (TrackedIndex trackedIndex : indices.values()) { + if (usually() && localReleasables.add(tryAcquirePermit(trackedIndex.permits)) != null) { + targetIndexNames.add(trackedIndex.indexName); + } else { + snapshotSpecificIndicesTmp = true; + } + } + final boolean snapshotSpecificIndices = snapshotSpecificIndicesTmp; + + if (snapshotSpecificIndices && targetIndexNames.isEmpty()) { + return; + } + + final Releasable releaseAll = localReleasables.transfer(); + + final StepListener ensureYellowStep = new StepListener<>(); + + final String snapshotName = "snapshot-" + snapshotCounter.incrementAndGet(); + + logger.info( + "--> waiting for yellow health of [{}] before creating snapshot [{}:{}]", + targetIndexNames, + trackedRepository.repositoryName, + snapshotName + ); + + client().admin() + .cluster() + .prepareHealth(targetIndexNames.toArray(new String[0])) + .setWaitForEvents(Priority.LANGUID) + .setWaitForYellowStatus() + .setWaitForNodes(Integer.toString(internalCluster().getNodeNames().length)) + .execute(ensureYellowStep); + + ensureYellowStep.addListener(mustSucceed(clusterHealthResponse -> { + assertFalse("timed out waiting for yellow state of " + targetIndexNames, clusterHealthResponse.isTimedOut()); + + logger.info( + "--> take snapshot [{}:{}] with indices [{}{}]", + trackedRepository.repositoryName, + snapshotName, + snapshotSpecificIndices ? "" : "*=", + targetIndexNames + ); + + final CreateSnapshotRequestBuilder createSnapshotRequestBuilder = client().admin() + .cluster() + .prepareCreateSnapshot(trackedRepository.repositoryName, snapshotName); + + if (snapshotSpecificIndices) { + createSnapshotRequestBuilder.setIndices(targetIndexNames.toArray(new String[0])); + } + + if (randomBoolean()) { + createSnapshotRequestBuilder.setWaitForCompletion(true); + createSnapshotRequestBuilder.execute(mustSucceed(createSnapshotResponse -> { + logger.info("--> completed snapshot [{}:{}]", trackedRepository.repositoryName, snapshotName); + final SnapshotInfo snapshotInfo = createSnapshotResponse.getSnapshotInfo(); + assertThat(stringFromSnapshotInfo(snapshotInfo), snapshotInfo.state(), equalTo(SnapshotState.SUCCESS)); + Releasables.close(releaseAll); + completedSnapshotLatch.countDown(); + startSnapshotter(); + })); + } else { + createSnapshotRequestBuilder.execute(mustSucceed(createSnapshotResponse -> { + logger.info("--> started snapshot [{}:{}]", trackedRepository.repositoryName, snapshotName); + Releasables.close(releasableAfterStart.transfer()); + pollForSnapshotCompletion(client, trackedRepository.repositoryName, snapshotName, releaseAll, () -> { + snapshots.put(snapshotName, new TrackedSnapshot(trackedRepository, snapshotName)); + completedSnapshotLatch.countDown(); + startSnapshotter(); + }); + })); + } + + })); + + startedSnapshot = true; + } finally { + if (startedSnapshot == false) { + startSnapshotter(); + } + } + }); + } + + private void startPartialSnapshotter() { + enqueueAction(() -> { + + boolean startedSnapshot = false; + try (TransferableReleasables localReleasables = new TransferableReleasables()) { + + // separate TransferableReleasables for blocking node restarts & index deletion so we can release these blocks and + // permit data node restarts and index deletions as soon as the snapshot starts + final TransferableReleasables releasableAfterStart = new TransferableReleasables(); + localReleasables.add(releasableAfterStart); + + if (releasableAfterStart.add(blockNodeRestarts()) == null) { + return; + } + assertNotNull(localReleasables.add(blockFullClusterRestart())); + final Client client = localReleasables.add(acquireClient()).getClient(); + + final TrackedRepository trackedRepository = randomFrom(repositories.values()); + if (localReleasables.add(tryAcquirePermit(trackedRepository.permits)) == null) { + return; + } + + boolean snapshotSpecificIndicesTmp = randomBoolean(); + final List targetIndexNames = new ArrayList<>(indices.size()); + for (TrackedIndex trackedIndex : indices.values()) { + if (usually() && releasableAfterStart.add(tryAcquirePermit(trackedIndex.permits)) != null) { + targetIndexNames.add(trackedIndex.indexName); + } else { + snapshotSpecificIndicesTmp = true; + } + } + final boolean snapshotSpecificIndices = snapshotSpecificIndicesTmp; + + if (snapshotSpecificIndices && targetIndexNames.isEmpty()) { + return; + } + + final Releasable releaseAll = localReleasables.transfer(); + + final String snapshotName = "snapshot-partial-" + snapshotCounter.incrementAndGet(); + + logger.info( + "--> take partial snapshot [{}:{}] with indices [{}{}]", + trackedRepository.repositoryName, + snapshotName, + snapshotSpecificIndices ? "" : "*=", + targetIndexNames + ); + + final CreateSnapshotRequestBuilder createSnapshotRequestBuilder = client().admin() + .cluster() + .prepareCreateSnapshot(trackedRepository.repositoryName, snapshotName) + .setPartial(true); + + if (snapshotSpecificIndices) { + createSnapshotRequestBuilder.setIndices(targetIndexNames.toArray(new String[0])); + } + + final boolean abortSnapshot = randomBoolean(); + final Runnable abortRunnable; + if (abortSnapshot) { + try (TransferableReleasables abortReleasables = new TransferableReleasables()) { + + assertNotNull(abortReleasables.add(blockFullClusterRestart())); + final Client abortClient = abortReleasables.add(acquireClient()).getClient(); + + assertNotNull(abortReleasables.add(tryAcquirePermit(trackedRepository.permits))); + + final DeleteSnapshotRequestBuilder deleteSnapshotRequestBuilder = abortClient.admin() + .cluster() + .prepareDeleteSnapshot(trackedRepository.repositoryName, snapshotName); + + final Releasable abortReleasable = abortReleasables.transfer(); + + abortRunnable = mustSucceed(() -> { + logger.info("--> aborting/deleting snapshot [{}:{}]", trackedRepository.repositoryName, snapshotName); + deleteSnapshotRequestBuilder.execute(new ActionListener<>() { + @Override + public void onResponse(AcknowledgedResponse acknowledgedResponse) { + logger.info("--> aborted/deleted snapshot [{}:{}]", trackedRepository.repositoryName, snapshotName); + Releasables.close(abortReleasable); + assertTrue(acknowledgedResponse.isAcknowledged()); + } + + @Override + public void onFailure(Exception e) { + Releasables.close(abortReleasable); + if (ExceptionsHelper.unwrapCause(e) instanceof SnapshotMissingException) { + // processed before the snapshot even started + logger.info( + "--> abort/delete of [{}:{}] got snapshot missing", + trackedRepository.repositoryName, + snapshotName + ); + } else { + logAndFailTest(e); + } + } + }); + }); + } + } else { + abortRunnable = () -> {}; + } + + createSnapshotRequestBuilder.execute(mustSucceed(createSnapshotResponse -> { + logger.info("--> started partial snapshot [{}:{}]", trackedRepository.repositoryName, snapshotName); + Releasables.close(releasableAfterStart.transfer()); + pollForSnapshotCompletion(client, trackedRepository.repositoryName, snapshotName, releaseAll, () -> { + if (abortSnapshot == false) { + snapshots.put(snapshotName, new TrackedSnapshot(trackedRepository, snapshotName)); + completedSnapshotLatch.countDown(); + } + startPartialSnapshotter(); + }); + })); + + abortRunnable.run(); + + startedSnapshot = true; + } finally { + if (startedSnapshot == false) { + startPartialSnapshotter(); + } + } + }); + } + + private void pollForSnapshotCompletion( + Client client, + String repositoryName, + String snapshotName, + Releasable onCompletion, + Runnable onSuccess + ) { + threadPool.executor(CLIENT) + .execute( + mustSucceed( + () -> client.admin() + .cluster() + .prepareGetSnapshots(repositoryName) + .setCurrentSnapshot() + .execute(mustSucceed(getSnapshotsResponse -> { + if (getSnapshotsResponse.getSnapshots() + .stream() + .noneMatch(snapshotInfo -> snapshotInfo.snapshotId().getName().equals(snapshotName))) { + + logger.info("--> snapshot [{}:{}] no longer running", repositoryName, snapshotName); + Releasables.close(onCompletion); + onSuccess.run(); + } else { + pollForSnapshotCompletion(client, repositoryName, snapshotName, onCompletion, onSuccess); + } + })) + ) + ); + } + + private void startNodeRestarter() { + enqueueAction(() -> { + boolean restarting = false; + try (TransferableReleasables localReleasables = new TransferableReleasables()) { + + if (usually()) { + return; + } + + final ArrayList trackedNodes = new ArrayList<>(shuffledNodes); + Collections.reverse(trackedNodes); + + for (TrackedNode trackedNode : trackedNodes) { + if (localReleasables.add(tryAcquireAllPermits(trackedNode.permits)) != null) { + + final String nodeName = trackedNode.nodeName; + final Releasable releaseAll = localReleasables.transfer(); + + threadPool.generic().execute(mustSucceed(() -> { + logger.info("--> restarting [{}]", nodeName); + cluster.restartNode(nodeName); + logger.info("--> finished restarting [{}]", nodeName); + shuffleNodes(); + Releasables.close(releaseAll); + startNodeRestarter(); + })); + + restarting = true; + return; + } + } + + } finally { + if (restarting == false) { + startNodeRestarter(); + } + } + }); + } + + @Nullable // if we couldn't block node restarts + private Releasable blockNodeRestarts() { + try (TransferableReleasables localReleasables = new TransferableReleasables()) { + for (TrackedNode trackedNode : nodes.values()) { + if (localReleasables.add(tryAcquirePermit(trackedNode.getPermits())) == null) { + return null; + } + } + return localReleasables.transfer(); + } + } + + /** + * Try and block the restart of a majority of the master nodes, which therefore prevents a full-cluster restart from occurring. + */ + @Nullable // if we couldn't block enough master node restarts + private Releasable blockFullClusterRestart() { + // Today we block all master failovers to avoid things like TransportMasterNodeAction-led retries which might fail e.g. because + // the snapshot already exists). + + // TODO generalise this so that it succeeds as soon as it's acquired a permit on >1/2 of the master-eligible nodes + final List masterNodes = shuffledNodes.stream().filter(TrackedNode::isMasterNode).collect(Collectors.toList()); + try (TransferableReleasables localReleasables = new TransferableReleasables()) { + for (TrackedNode trackedNode : masterNodes) { + if (localReleasables.add(tryAcquirePermit(trackedNode.getPermits())) == null) { + return null; + } + } + return localReleasables.transfer(); + } + } + + /** + * Acquire a client (i.e. block the client node from restarting) in a situation where we know that such a block can be obtained, + * since previous acquisitions mean that at least one node is already blocked from restarting. + */ + private ReleasableClient acquireClient() { + for (TrackedNode trackedNode : shuffledNodes) { + final Releasable permit = tryAcquirePermit(trackedNode.getPermits()); + if (permit != null) { + return new ReleasableClient(permit, client(trackedNode.nodeName)); + } + } + + final AssertionError assertionError = new AssertionError("could not acquire client"); + logger.error("acquireClient", assertionError); + throw assertionError; + } + + /** + * Tracks a repository in the cluster, and occasionally removes it and adds it back if no other activity holds any of its permits. + */ + private class TrackedRepository { + + private final Semaphore permits = new Semaphore(Integer.MAX_VALUE); + private final String repositoryName; + private final Path location; + + private TrackedRepository(String repositoryName, Path location) { + this.repositoryName = repositoryName; + this.location = location; + } + + @Override + public String toString() { + return "TrackedRepository[" + repositoryName + "]"; + } + + public void start() { + try (TransferableReleasables localReleasables = new TransferableReleasables()) { + assertNotNull(localReleasables.add(blockNodeRestarts())); + assertNotNull(localReleasables.add(tryAcquireAllPermits(permits))); + final Client client = localReleasables.add(acquireClient()).getClient(); + putRepositoryAndContinue(client, localReleasables.transfer()); + } + } + + private void putRepositoryAndContinue(Client client, Releasable releasable) { + logger.info("--> put repo [{}]", repositoryName); + client.admin() + .cluster() + .preparePutRepository(repositoryName) + .setType(FsRepository.TYPE) + .setSettings(Settings.builder().put(FsRepository.LOCATION_SETTING.getKey(), location)) + .execute(mustSucceed(acknowledgedResponse -> { + assertTrue(acknowledgedResponse.isAcknowledged()); + logger.info("--> finished put repo [{}]", repositoryName); + Releasables.close(releasable); + scheduleRemoveAndAdd(); + })); + } + + private void scheduleRemoveAndAdd() { + enqueueAction(() -> { + + boolean replacingRepo = false; + try (TransferableReleasables localReleasables = new TransferableReleasables()) { + + if (usually()) { + return; + } + + if (localReleasables.add(tryAcquireAllPermits(permits)) == null) { + return; + } + + if (localReleasables.add(blockFullClusterRestart()) == null) { + return; + } + + final Client client = localReleasables.add(acquireClient()).getClient(); + + final Releasable releaseAll = localReleasables.transfer(); + + logger.info("--> delete repo [{}]", repositoryName); + client().admin().cluster().prepareDeleteRepository(repositoryName).execute(mustSucceed(acknowledgedResponse -> { + assertTrue(acknowledgedResponse.isAcknowledged()); + logger.info("--> finished delete repo [{}]", repositoryName); + putRepositoryAndContinue(client, releaseAll); + })); + + replacingRepo = true; + } finally { + if (replacingRepo == false) { + scheduleRemoveAndAdd(); + } + } + }); + } + + } + + private class TrackedIndex { + + private final Semaphore permits = new Semaphore(Integer.MAX_VALUE); + private final String indexName; + + // these fields are only changed when all permits held by the delete/recreate process: + private int shardCount; + private Semaphore docPermits; + + private TrackedIndex(String indexName) { + this.indexName = indexName; + } + + @Override + public String toString() { + return "TrackedIndex[" + indexName + "]"; + } + + public void start() { + try (TransferableReleasables localReleasables = new TransferableReleasables()) { + assertNotNull(localReleasables.add(blockNodeRestarts())); + assertNotNull(localReleasables.add(tryAcquireAllPermits(permits))); + createIndexAndContinue(localReleasables.transfer()); + } + } + + private void createIndexAndContinue(Releasable releasable) { + shardCount = between(1, 5); + docPermits = new Semaphore(between(1000, 3000)); + logger.info("--> create index [{}] with max [{}] docs", indexName, docPermits.availablePermits()); + client().admin() + .indices() + .prepareCreate(indexName) + .setSettings( + Settings.builder() + .put(IndexMetadata.INDEX_NUMBER_OF_SHARDS_SETTING.getKey(), shardCount) + .put(IndexMetadata.INDEX_NUMBER_OF_REPLICAS_SETTING.getKey(), between(0, cluster.numDataNodes() - 1)) + ) + .execute(mustSucceed(response -> { + assertTrue(response.isAcknowledged()); + logger.info("--> finished create index [{}]", indexName); + Releasables.close(releasable); + scheduleIndexingAndPossibleDelete(); + })); + } + + private void scheduleIndexingAndPossibleDelete() { + enqueueAction(() -> { + + boolean forked = false; + try (TransferableReleasables localReleasables = new TransferableReleasables()) { + + if (localReleasables.add(blockNodeRestarts()) == null) { + return; + } + + if (usually()) { + // index some more docs + + if (localReleasables.add(tryAcquirePermit(permits)) == null) { + return; + } + + final int maxDocCount = docPermits.drainPermits(); + assert maxDocCount >= 0 : maxDocCount; + if (maxDocCount == 0) { + return; + } + final int docCount = between(1, Math.min(maxDocCount, 200)); + docPermits.release(maxDocCount - docCount); + + final Releasable releaseAll = localReleasables.transfer(); + + final StepListener ensureYellowStep = new StepListener<>(); + + logger.info("--> waiting for yellow health of [{}] prior to indexing [{}] docs", indexName, docCount); + + client().admin() + .cluster() + .prepareHealth(indexName) + .setWaitForEvents(Priority.LANGUID) + .setWaitForYellowStatus() + .setWaitForNodes(Integer.toString(internalCluster().getNodeNames().length)) + .execute(ensureYellowStep); + + final StepListener bulkStep = new StepListener<>(); + + ensureYellowStep.addListener(mustSucceed(clusterHealthResponse -> { + + assertFalse( + "timed out waiting for yellow state of [" + indexName + "]", + clusterHealthResponse.isTimedOut() + ); + + final BulkRequestBuilder bulkRequestBuilder = client().prepareBulk(indexName); + + logger.info("--> indexing [{}] docs into [{}]", docCount, indexName); + + for (int i = 0; i < docCount; i++) { + bulkRequestBuilder.add( + new IndexRequest().source( + jsonBuilder().startObject().field("field-" + between(1, 5), randomAlphaOfLength(10)).endObject() + ) + ); + } + + bulkRequestBuilder.execute(bulkStep); + })); + + bulkStep.addListener(mustSucceed(bulkItemResponses -> { + for (BulkItemResponse bulkItemResponse : bulkItemResponses.getItems()) { + assertNull(bulkItemResponse.getFailure()); + } + + logger.info("--> indexing into [{}] finished", indexName); + + Releasables.close(releaseAll); + scheduleIndexingAndPossibleDelete(); + + })); + + forked = true; + + } else if (localReleasables.add(tryAcquireAllPermits(permits)) != null) { + // delete the index and create a new one + + final Releasable releaseAll = localReleasables.transfer(); + + logger.info("--> deleting index [{}]", indexName); + + client().admin().indices().prepareDelete(indexName).execute(mustSucceed(acknowledgedResponse -> { + logger.info("--> deleting index [{}] finished", indexName); + assertTrue(acknowledgedResponse.isAcknowledged()); + createIndexAndContinue(releaseAll); + })); + + forked = true; + } + } finally { + if (forked == false) { + scheduleIndexingAndPossibleDelete(); + } + } + }); + } + + } + + } + + private static String stringFromSnapshotInfo(SnapshotInfo snapshotInfo) { + return Strings.toString((b, p) -> snapshotInfo.toXContent(b, SNAPSHOT_ONLY_FORMAT_PARAMS), true, false); + } + + /** + * A client to a node that is blocked from restarting; close this {@link Releasable} to release the block. + */ + private static class ReleasableClient implements Releasable { + private final Releasable releasable; + private final Client client; + + ReleasableClient(Releasable releasable, Client client) { + this.releasable = releasable; + this.client = client; + } + + @Override + public void close() { + releasable.close(); + } + + Client getClient() { + return client; + } + } + + /** + * Tracks a snapshot taken by the cluster. + */ + private static class TrackedSnapshot { + + private final TrackedCluster.TrackedRepository trackedRepository; + private final String snapshotName; + private final Semaphore permits = new Semaphore(Integer.MAX_VALUE); + private final AtomicReference> snapshotInfoFutureRef = new AtomicReference<>(); + + TrackedSnapshot(TrackedCluster.TrackedRepository trackedRepository, String snapshotName) { + this.trackedRepository = trackedRepository; + this.snapshotName = snapshotName; + } + + /* + * Try and acquire a permit on this snapshot and the underlying repository + */ + Releasable tryAcquirePermit() { + try (TransferableReleasables localReleasables = new TransferableReleasables()) { + if (localReleasables.add(SnapshotStressTestsIT.tryAcquirePermit(trackedRepository.permits)) == null) { + return null; + } + + if (localReleasables.add(SnapshotStressTestsIT.tryAcquirePermit(permits)) == null) { + return null; + } + + return localReleasables.transfer(); + } + } + + Releasable tryAcquireAllPermits() { + try (TransferableReleasables localReleasables = new TransferableReleasables()) { + if (localReleasables.add(SnapshotStressTestsIT.tryAcquirePermit(trackedRepository.permits)) == null) { + return null; + } + + if (localReleasables.add(SnapshotStressTestsIT.tryAcquireAllPermits(permits)) == null) { + return null; + } + + return localReleasables.transfer(); + } + } + + void getSnapshotInfo(Client client, ActionListener listener) { + final ListenableActionFuture newFuture = new ListenableActionFuture<>(); + + final boolean firstRunner = snapshotInfoFutureRef.compareAndSet(null, newFuture); + + if (firstRunner == false) { + if (usually()) { + snapshotInfoFutureRef.get().addListener(listener); + return; + } + // else (rarely) get it again, expecting it to be the same + + snapshotInfoFutureRef.get() + .addListener( + mustSucceed( + snapshotInfo1 -> newFuture.addListener( + mustSucceed(snapshotInfo2 -> assertThat(snapshotInfo1, equalTo(snapshotInfo2))) + ) + ) + ); + } + + newFuture.addListener(listener); + + TrackedCluster.logger.info( + "--> getting snapshot info{} for [{}:{}]", + firstRunner ? "" : " again", + trackedRepository.repositoryName, + snapshotName + ); + client.admin() + .cluster() + .prepareGetSnapshots(trackedRepository.repositoryName) + .setSnapshots(snapshotName) + .execute(mustSucceed(getSnapshotsResponse -> { + assertThat(getSnapshotsResponse.getSnapshots(), hasSize(1)); + final SnapshotInfo snapshotInfo = getSnapshotsResponse.getSnapshots().get(0); + assertThat(snapshotInfo.snapshotId().getName(), equalTo(snapshotName)); + TrackedCluster.logger.info( + "--> got snapshot info for [{}:{}]{}", + trackedRepository.repositoryName, + snapshotName, + firstRunner ? ":\n" + stringFromSnapshotInfo(snapshotInfo) : " again" + ); + newFuture.onResponse(snapshotInfo); + })); + } + } + + /** + * Tracks a node in the cluster. + */ + private static class TrackedNode { + + private final Semaphore permits = new Semaphore(Integer.MAX_VALUE); + private final String nodeName; + private final boolean isMasterNode; + private final boolean isDataNode; + + TrackedNode(String nodeName, boolean isMasterNode, boolean isDataNode) { + this.nodeName = nodeName; + this.isMasterNode = isMasterNode; + this.isDataNode = isDataNode; + } + + Semaphore getPermits() { + return permits; + } + + boolean isMasterNode() { + return isMasterNode; + } + + @Override + public String toString() { + return "TrackedNode{" + nodeName + "}{" + (isMasterNode ? "m" : "") + (isDataNode ? "d" : "") + "}"; + } + } + +} From bff56e147ff21f21587c1b376624f73268bfe457 Mon Sep 17 00:00:00 2001 From: Nik Everett Date: Mon, 4 Oct 2021 09:00:38 -0400 Subject: [PATCH 118/250] TSDB: More tests (#78208) This adds more tests copied from the our original TSDB prototype in PR #75638 that are still applicable time series mode indices. There are a bunch of disabled assertions because we are not yet generating `_tsid` but the non-disabled assertions are useful. And we will soon be generating the `_tsid` so we can re-enable those assertions. --- .../rest-api-spec/test/tsdb/40_search.yml | 261 ++++++++++++++++++ .../rest-api-spec/test/tsdb/50_alias.yml | 87 ++++++ .../test/tsdb/60_add_dimensions.yml | 231 ++++++++++++++++ .../test/tsdb/70_dimension_types.yml | 137 +++++++++ .../test/tsdb/80_index_resize.yml | 162 +++++++++++ 5 files changed, 878 insertions(+) create mode 100644 rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/tsdb/40_search.yml create mode 100644 rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/tsdb/50_alias.yml create mode 100644 rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/tsdb/60_add_dimensions.yml create mode 100644 rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/tsdb/70_dimension_types.yml create mode 100644 rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/tsdb/80_index_resize.yml diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/tsdb/40_search.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/tsdb/40_search.yml new file mode 100644 index 0000000000000..5227377249e66 --- /dev/null +++ b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/tsdb/40_search.yml @@ -0,0 +1,261 @@ +setup: + - skip: + version: " - 7.99.99" + reason: introduced in 8.0.0 + + - do: + indices.create: + index: test + body: + settings: + index: + mode: time_series + mappings: + properties: + "@timestamp": + type: date + metricset: + type: keyword + time_series_dimension: true + k8s: + properties: + pod: + properties: + uid: + type: keyword + time_series_dimension: true + name: + type: keyword + ip: + type: ip + network: + properties: + tx: + type: long + rx: + type: long + - do: + bulk: + refresh: true + index: test + body: + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:50:04.467Z", "metricset": "pod", "k8s": {"pod": {"name": "cat", "uid":"947e4ced-1786-4e53-9e0c-5c447e959507", "ip": "10.10.55.1", "network": {"tx": 2001818691, "rx": 802133794}}}}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:50:24.467Z", "metricset": "pod", "k8s": {"pod": {"name": "cat", "uid":"947e4ced-1786-4e53-9e0c-5c447e959507", "ip": "10.10.55.1", "network": {"tx": 2005177954, "rx": 801479970}}}}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:50:44.467Z", "metricset": "pod", "k8s": {"pod": {"name": "cat", "uid":"947e4ced-1786-4e53-9e0c-5c447e959507", "ip": "10.10.55.1", "network": {"tx": 2006223737, "rx": 802337279}}}}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:51:04.467Z", "metricset": "pod", "k8s": {"pod": {"name": "cat", "uid":"947e4ced-1786-4e53-9e0c-5c447e959507", "ip": "10.10.55.2", "network": {"tx": 2012916202, "rx": 803685721}}}}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:50:03.142Z", "metricset": "pod", "k8s": {"pod": {"name": "dog", "uid":"df3145b3-0563-4d3b-a0f7-897eb2876ea9", "ip": "10.10.55.3", "network": {"tx": 1434521831, "rx": 530575198}}}}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:50:23.142Z", "metricset": "pod", "k8s": {"pod": {"name": "dog", "uid":"df3145b3-0563-4d3b-a0f7-897eb2876ea9", "ip": "10.10.55.3", "network": {"tx": 1434577921, "rx": 530600088}}}}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:50:53.142Z", "metricset": "pod", "k8s": {"pod": {"name": "dog", "uid":"df3145b3-0563-4d3b-a0f7-897eb2876ea9", "ip": "10.10.55.3", "network": {"tx": 1434587694, "rx": 530604797}}}}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:51:03.142Z", "metricset": "pod", "k8s": {"pod": {"name": "dog", "uid":"df3145b3-0563-4d3b-a0f7-897eb2876ea9", "ip": "10.10.55.3", "network": {"tx": 1434595272, "rx": 530605511}}}}' + +--- +query a dimension: + - skip: + version: " - 7.99.99" + reason: introduced in 8.0.0 + + - do: + search: + index: test + body: + query: + match: + k8s.pod.uid: 947e4ced-1786-4e53-9e0c-5c447e959507 + + - match: {hits.total.value: 4} + +--- +query a metric: + - skip: + version: " - 7.99.99" + reason: introduced in 8.0.0 + + - do: + search: + index: test + body: + query: + range: + k8s.pod.network.tx: + gt: 2006223737 + + - match: {hits.total.value: 1} + +# TODO add test showing that quering _tsid fails + +--- +fetch a dimension: + - skip: + version: " - 7.99.99" + reason: introduced in 8.0.0 + + - do: + search: + index: test + body: + fields: + - field: k8s.pod.uid + query: + query_string: + query: '+@timestamp:"2021-04-28T18:51:04.467Z" +k8s.pod.name:cat' + + - match: {hits.total.value: 1} + - match: {hits.hits.0.fields.k8s\.pod\.uid: [947e4ced-1786-4e53-9e0c-5c447e959507]} + +--- +fetch a metric: + - skip: + version: " - 7.99.99" + reason: introduced in 8.0.0 + + - do: + search: + index: test + body: + fields: + - field: k8s.pod.network.tx + query: + query_string: + query: '+@timestamp:"2021-04-28T18:51:04.467Z" +k8s.pod.name:cat' + + - match: {hits.total.value: 1} + - match: {hits.hits.0.fields.k8s\.pod\.network\.tx: [2012916202]} + - is_false: hits.hits.0.fields._tsid # tsid isn't fetched by default + +--- +fetch a tag: + - skip: + version: " - 7.99.99" + reason: introduced in 8.0.0 + + - do: + search: + index: test + body: + fields: + - field: k8s.pod.ip + query: + query_string: + query: '+@timestamp:"2021-04-28T18:51:04.467Z" +k8s.pod.name:cat' + + - match: {hits.total.value: 1} + - match: {hits.hits.0.fields.k8s\.pod\.ip: ['10.10.55.2']} + - is_false: hits.hits.0.fields._tsid # tsid isn't fetched by default + +# TODO add test to fetch the tsid + +--- +aggregate a dimension: + - skip: + version: " - 7.99.99" + reason: introduced in 8.0.0 + + - do: + search: + index: test + body: + size: 0 + aggs: + uids: + terms: + field: k8s.pod.uid + + - match: {hits.total.value: 8} + - match: {aggregations.uids.buckets.0.key: 947e4ced-1786-4e53-9e0c-5c447e959507} + - match: {aggregations.uids.buckets.0.doc_count: 4} + - match: {aggregations.uids.buckets.1.key: df3145b3-0563-4d3b-a0f7-897eb2876ea9} + - match: {aggregations.uids.buckets.1.doc_count: 4} + +--- +aggregate a metric: + - skip: + version: " - 7.99.99" + reason: introduced in 8.0.0 + + - do: + search: + index: test + body: + size: 0 + aggs: + uids: + terms: + field: k8s.pod.uid + aggs: + max_rx: + max: + field: k8s.pod.network.rx + + - match: {hits.total.value: 8} + - match: {aggregations.uids.buckets.0.key: 947e4ced-1786-4e53-9e0c-5c447e959507} + - match: {aggregations.uids.buckets.0.doc_count: 4} + - match: {aggregations.uids.buckets.0.max_rx.value: 803685721} + - match: {aggregations.uids.buckets.1.key: df3145b3-0563-4d3b-a0f7-897eb2876ea9} + - match: {aggregations.uids.buckets.1.doc_count: 4} + - match: {aggregations.uids.buckets.1.max_rx.value: 530605511} + +--- +aggregate a tag: + - skip: + version: " - 7.99.99" + reason: introduced in 8.0.0 + + - do: + search: + index: test + body: + size: 0 + aggs: + ips: + terms: + field: k8s.pod.ip + order: + _key: asc + + - match: {hits.total.value: 8} + - match: {aggregations.ips.buckets.0.key: 10.10.55.1} + - match: {aggregations.ips.buckets.0.doc_count: 3} + - match: {aggregations.ips.buckets.1.key: 10.10.55.2} + - match: {aggregations.ips.buckets.1.doc_count: 1} + - match: {aggregations.ips.buckets.2.key: 10.10.55.3} + - match: {aggregations.ips.buckets.2.doc_count: 4} + + +# TODO add a test aggregating the _tsid + +--- +field capabilities: + - skip: + version: " - 7.99.99" + reason: introduced in 8.0.0 + + - do: + field_caps: + index: test + fields: [k8s.pod.uid, k8s.pod.network.rx, k8s.pod.ip, _tsid] + + # TODO assert time_series_metric and time_series_dimension + - match: {fields.k8s\.pod\.uid.keyword.searchable: true} + - match: {fields.k8s\.pod\.uid.keyword.aggregatable: true} + - is_false: fields.k8s\.pod\.uid.keyword.indices + - is_false: fields.k8s\.pod\.uid.keyword.non_searchable_indices + - is_false: fields.k8s\.pod\.uid.keyword.non_aggregatable_indices + - match: {fields.k8s\.pod\.network\.rx.long.searchable: true} + - match: {fields.k8s\.pod\.network\.rx.long.aggregatable: true} + - is_false: fields.k8s\.pod\.network\.rx.long.indices + - is_false: fields.k8s\.pod\.network\.rx.long.non_searchable_indices + - is_false: fields.k8s\.pod\.network\.rx.long.non_aggregatable_indices + - match: {fields.k8s\.pod\.ip.ip.searchable: true} + - match: {fields.k8s\.pod\.ip.ip.aggregatable: true} + - is_false: fields.k8s\.pod\.ip.ip.indices + - is_false: fields.k8s\.pod\.ip.ip.non_searchable_indices + - is_false: fields.k8s\.pod\.ip.ip.non_aggregatable_indices + # TODO assert tsid once we build it: diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/tsdb/50_alias.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/tsdb/50_alias.yml new file mode 100644 index 0000000000000..21ddeb55b13c3 --- /dev/null +++ b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/tsdb/50_alias.yml @@ -0,0 +1,87 @@ +setup: + - skip: + version: " - 7.99.99" + reason: introduced in 8.0.0 + + - do: + indices.create: + index: test + body: + settings: + index: + mode: time_series + mappings: + properties: + "@timestamp": + type: date + metricset: + type: keyword + time_series_dimension: true + k8s: + properties: + pod: + properties: + uid: + type: keyword + time_series_dimension: true + name: + type: keyword + ip: + type: ip + network: + properties: + tx: + type: long + rx: + type: long + - do: + bulk: + refresh: true + index: test + body: + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:50:04.467Z", "metricset": "pod", "k8s": {"pod": {"name": "cat", "uid":"947e4ced-1786-4e53-9e0c-5c447e959507", "ip": "10.10.55.1", "network": {"tx": 2001818691, "rx": 802133794}}}}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:50:24.467Z", "metricset": "pod", "k8s": {"pod": {"name": "cat", "uid":"947e4ced-1786-4e53-9e0c-5c447e959507", "ip": "10.10.55.1", "network": {"tx": 2005177954, "rx": 801479970}}}}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:50:44.467Z", "metricset": "pod", "k8s": {"pod": {"name": "cat", "uid":"947e4ced-1786-4e53-9e0c-5c447e959507", "ip": "10.10.55.1", "network": {"tx": 2006223737, "rx": 802337279}}}}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:51:04.467Z", "metricset": "pod", "k8s": {"pod": {"name": "cat", "uid":"947e4ced-1786-4e53-9e0c-5c447e959507", "ip": "10.10.55.2", "network": {"tx": 2012916202, "rx": 803685721}}}}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:50:03.142Z", "metricset": "pod", "k8s": {"pod": {"name": "dog", "uid":"df3145b3-0563-4d3b-a0f7-897eb2876ea9", "ip": "10.10.55.3", "network": {"tx": 1434521831, "rx": 530575198}}}}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:50:23.142Z", "metricset": "pod", "k8s": {"pod": {"name": "dog", "uid":"df3145b3-0563-4d3b-a0f7-897eb2876ea9", "ip": "10.10.55.3", "network": {"tx": 1434577921, "rx": 530600088}}}}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:50:53.142Z", "metricset": "pod", "k8s": {"pod": {"name": "dog", "uid":"df3145b3-0563-4d3b-a0f7-897eb2876ea9", "ip": "10.10.55.3", "network": {"tx": 1434587694, "rx": 530604797}}}}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:51:03.142Z", "metricset": "pod", "k8s": {"pod": {"name": "dog", "uid":"df3145b3-0563-4d3b-a0f7-897eb2876ea9", "ip": "10.10.55.3", "network": {"tx": 1434595272, "rx": 530605511}}}}' + +# TODO search on _tsid in an alias + +--- +index into alias: + - skip: + version: " - 7.99.99" + reason: introduced in 8.0.0 + + - do: + indices.put_alias: + index: test + name: test_alias + + - do: + bulk: + refresh: true + index: test_alias + body: + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:50:03.142Z", "metricset": "pod", "k8s": {"pod": {"name": "cow", "uid":"1c4fc7b8-93b7-4ba8-b609-2a48af2f8e39", "ip": "10.10.55.4", "network": {"tx": 1434521831, "rx": 530575198}}}}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:50:23.142Z", "metricset": "pod", "k8s": {"pod": {"name": "cow", "uid":"1c4fc7b8-93b7-4ba8-b609-2a48af2f8e39", "ip": "10.10.55.4", "network": {"tx": 1434577921, "rx": 530600088}}}}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:50:53.142Z", "metricset": "pod", "k8s": {"pod": {"name": "cow", "uid":"1c4fc7b8-93b7-4ba8-b609-2a48af2f8e39", "ip": "10.10.55.4", "network": {"tx": 1434587694, "rx": 530604797}}}}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:51:03.142Z", "metricset": "pod", "k8s": {"pod": {"name": "cow", "uid":"1c4fc7b8-93b7-4ba8-b609-2a48af2f8e39", "ip": "10.10.55.4", "network": {"tx": 1434595272, "rx": 530605511}}}}' + - match: {errors: false} + + # TODO search on tsid once we generate it diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/tsdb/60_add_dimensions.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/tsdb/60_add_dimensions.yml new file mode 100644 index 0000000000000..f593f554824cb --- /dev/null +++ b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/tsdb/60_add_dimensions.yml @@ -0,0 +1,231 @@ +--- +add dimensions with put_mapping: + - skip: + version: " - 7.99.99" + reason: introduced in 8.0.0 + + - do: + indices.create: + index: test + body: + settings: + index: + mode: time_series + mappings: + properties: + "@timestamp": + type: date + + # TODO verify its an error to index without an declared dimensions #77731 + + - do: + indices.put_mapping: + index: test + body: + properties: + metricset: + type: keyword + time_series_dimension: true + + - do: + index: + index: test + refresh: true + body: + "@timestamp": "2021-04-28T18:35:24.467Z" + metricset: cat + + - do: + search: + index: test + body: + fields: + # TODO fetch the tsid + - field: "@timestamp" + + - match: {hits.total.value: 1} + # TODO Fetch the tsid + - match: {hits.hits.0.fields.@timestamp: ["2021-04-28T18:35:24.467Z"]} + +--- +add dimensions to no dims with dynamic_template over index: + - skip: + version: " - 7.99.99" + reason: introduced in 8.0.0 + + - do: + indices.create: + index: test + body: + settings: + index: + mode: time_series + mappings: + dynamic_templates: + - keywords: + match_mapping_type: string + mapping: + type: keyword + time_series_dimension: true + properties: + "@timestamp": + type: date + + - do: + index: + index: test + refresh: true + body: + "@timestamp": "2021-04-28T18:35:24.467Z" + metricset: cat + - match: {result: created} + + - do: + search: + index: test + body: + fields: + # TODO fetch the tsid + - field: "@timestamp" + - match: {hits.total.value: 1} + # TODO fetch the tsid + - match: {hits.hits.0.fields.@timestamp: ["2021-04-28T18:35:24.467Z"]} + +--- +add dimensions to no dims with dynamic_template over bulk: + - skip: + version: " - 7.99.99" + reason: introduced in 8.0.0 + + - do: + indices.create: + index: test + body: + settings: + index: + mode: time_series + mappings: + dynamic_templates: + - keywords: + match_mapping_type: string + mapping: + type: keyword + time_series_dimension: true + properties: + "@timestamp": + type: date + + - do: + bulk: + index: test + refresh: true + body: + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:35:24.467Z", "metricset": "cat"}' + - is_false: errors + + - do: + search: + index: test + body: + fields: + # TODO fetch tsid + - field: "@timestamp" + - match: {hits.total.value: 1} + # TODO fetch tsid + - match: {hits.hits.0.fields.@timestamp: ["2021-04-28T18:35:24.467Z"]} + +--- +add dimensions to some dims with dynamic_template over index: + - skip: + version: " - 7.99.99" + reason: introduced in 8.0.0 + + - do: + indices.create: + index: test + body: + settings: + index: + mode: time_series + mappings: + dynamic_templates: + - keywords: + match_mapping_type: string + mapping: + type: keyword + time_series_dimension: true + properties: + "@timestamp": + type: date + metricset: + type: keyword + time_series_dimension: true + + - do: + index: + index: test + refresh: true + body: + "@timestamp": "2021-04-28T18:35:24.467Z" + metricset: cat + other_dim: cat + - match: {result: created} + + - do: + search: + index: test + body: + fields: + # TODO fetch tsid + - field: "@timestamp" + - match: {hits.total.value: 1} + # TODO fetch tsid + - match: {hits.hits.0.fields.@timestamp: ["2021-04-28T18:35:24.467Z"]} + +--- +add dimensions to some dims with dynamic_template over bulk: + - skip: + version: " - 7.99.99" + reason: introduced in 8.0.0 + + - do: + indices.create: + index: test + body: + settings: + index: + mode: time_series + mappings: + dynamic_templates: + - keywords: + match_mapping_type: string + mapping: + type: keyword + time_series_dimension: true + properties: + "@timestamp": + type: date + metricset: + type: keyword + time_series_dimension: true + + - do: + bulk: + index: test + refresh: true + body: + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:35:24.467Z", "metricset": "cat", "other_dim": "cat"}' + - is_false: errors + + - do: + search: + index: test + body: + fields: + # TODO fetch tsid + - field: "@timestamp" + - match: {hits.total.value: 1} + # TODO fetch tsid + - match: {hits.hits.0.fields.@timestamp: ["2021-04-28T18:35:24.467Z"]} diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/tsdb/70_dimension_types.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/tsdb/70_dimension_types.yml new file mode 100644 index 0000000000000..80d049a7e43d2 --- /dev/null +++ b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/tsdb/70_dimension_types.yml @@ -0,0 +1,137 @@ +keyword dimension: + - skip: + features: close_to + version: " - 7.99.99" + reason: introduced in 8.0.0 + + - do: + indices.create: + index: test + body: + settings: + index: + mode: time_series + mappings: + properties: + "@timestamp": + type: date + uid: + type: keyword + time_series_dimension: true + + - do: + bulk: + refresh: true + index: test + body: + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:35:24.467Z", "uid": "947e4ced-1786-4e53-9e0c-5c447e959507", "voltage": 7.2}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:35:34.467Z", "uid": "947e4ced-1786-4e53-9e0c-5c447e959507", "voltage": 7.6}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:35:44.467Z", "uid": "947e4ced-1786-4e53-9e0c-5c447e959507", "voltage": 7.1}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:35:54.467Z", "uid": "947e4ced-1786-4e53-9e0c-5c447e959507", "voltage": 7.3}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:35:24.467Z", "uid": "df3145b3-0563-4d3b-a0f7-897eb2876ea9", "voltage": 3.2}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:35:34.467Z", "uid": "df3145b3-0563-4d3b-a0f7-897eb2876ea9", "voltage": 3.6}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:35:44.467Z", "uid": "df3145b3-0563-4d3b-a0f7-897eb2876ea9", "voltage": 3.1}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:35:54.467Z", "uid": "df3145b3-0563-4d3b-a0f7-897eb2876ea9", "voltage": 3.3}' + - is_false: errors + + # TODO aggregate on tsid + +--- +long dimension: + - skip: + features: close_to + version: " - 7.99.99" + reason: introduced in 8.0.0 + + - do: + indices.create: + index: test + body: + settings: + index: + mode: time_series + mappings: + properties: + "@timestamp": + type: date + id: + type: long + time_series_dimension: true + + - do: + bulk: + refresh: true + index: test + body: + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:35:24.467Z", "id": 1, "voltage": 7.2}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:35:34.467Z", "id": "1", "voltage": 7.6}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:35:44.467Z", "id": 1.0, "voltage": 7.1}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:35:54.467Z", "id": "001", "voltage": 7.3}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:35:24.467Z", "id": 2, "voltage": 3.2}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:35:34.467Z", "id": 2, "voltage": 3.6}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:35:44.467Z", "id": 2, "voltage": 3.1}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:35:54.467Z", "id": 2, "voltage": 3.3}' + + # TODO aggregate on tsid + +--- +ip dimension: + - skip: + features: close_to + version: " - 7.99.99" + reason: introduced in 8.0.0 + + - do: + indices.create: + index: test + body: + settings: + index: + mode: time_series + mappings: + properties: + "@timestamp": + type: date + ip: + type: ip + time_series_dimension: true + + - do: + bulk: + refresh: true + index: test + body: + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:35:24.467Z", "ip": "10.10.1.1", "voltage": 7.2}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:35:34.467Z", "ip": "10.10.1.1", "voltage": 7.6}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:35:44.467Z", "ip": "10.10.1.1", "voltage": 7.1}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:35:54.467Z", "ip": "::ffff:10.10.1.1", "voltage": 7.3}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:35:24.467Z", "ip": "2001:0db8:85a3:0000:0000:8a2e:0370:7334", "voltage": 3.2}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:35:34.467Z", "ip": "2001:0db8:85a3:0:0:8a2e:0370:7334", "voltage": 3.6}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:35:44.467Z", "ip": "2001:0db8:85a3::8a2e:0370:7334", "voltage": 3.1}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:35:54.467Z", "ip": "2001:0db8:85a3::8a2e:0370:7334", "voltage": 3.3}' + + # TODO aggregate on tsid diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/tsdb/80_index_resize.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/tsdb/80_index_resize.yml new file mode 100644 index 0000000000000..b91b5e55150c5 --- /dev/null +++ b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/tsdb/80_index_resize.yml @@ -0,0 +1,162 @@ +setup: + - skip: + version: " - 7.99.99" + reason: introduced in 8.0.0 + + - do: + indices.create: + index: test + body: + settings: + index: + mode: time_series + number_of_shards: 3 + number_of_replicas: 0 + mappings: + properties: + "@timestamp": + type: date + metricset: + type: keyword + time_series_dimension: true + k8s: + properties: + pod: + properties: + uid: + type: keyword + time_series_dimension: true + name: + type: keyword + ip: + type: ip + network: + properties: + tx: + type: long + rx: + type: long + - do: + bulk: + refresh: true + index: test + body: + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:50:04.467Z", "metricset": "pod", "k8s": {"pod": {"name": "cat", "uid":"947e4ced-1786-4e53-9e0c-5c447e959507", "ip": "10.10.55.1", "network": {"tx": 2001818691, "rx": 802133794}}}}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:50:24.467Z", "metricset": "pod", "k8s": {"pod": {"name": "cat", "uid":"947e4ced-1786-4e53-9e0c-5c447e959507", "ip": "10.10.55.1", "network": {"tx": 2005177954, "rx": 801479970}}}}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:50:44.467Z", "metricset": "pod", "k8s": {"pod": {"name": "cat", "uid":"947e4ced-1786-4e53-9e0c-5c447e959507", "ip": "10.10.55.1", "network": {"tx": 2006223737, "rx": 802337279}}}}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:51:04.467Z", "metricset": "pod", "k8s": {"pod": {"name": "cat", "uid":"947e4ced-1786-4e53-9e0c-5c447e959507", "ip": "10.10.55.2", "network": {"tx": 2012916202, "rx": 803685721}}}}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:50:03.142Z", "metricset": "pod", "k8s": {"pod": {"name": "dog", "uid":"df3145b3-0563-4d3b-a0f7-897eb2876ea9", "ip": "10.10.55.3", "network": {"tx": 1434521831, "rx": 530575198}}}}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:50:23.142Z", "metricset": "pod", "k8s": {"pod": {"name": "dog", "uid":"df3145b3-0563-4d3b-a0f7-897eb2876ea9", "ip": "10.10.55.3", "network": {"tx": 1434577921, "rx": 530600088}}}}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:50:53.142Z", "metricset": "pod", "k8s": {"pod": {"name": "dog", "uid":"df3145b3-0563-4d3b-a0f7-897eb2876ea9", "ip": "10.10.55.3", "network": {"tx": 1434587694, "rx": 530604797}}}}' + - '{"index": {}}' + - '{"@timestamp": "2021-04-28T18:51:03.142Z", "metricset": "pod", "k8s": {"pod": {"name": "dog", "uid":"df3145b3-0563-4d3b-a0f7-897eb2876ea9", "ip": "10.10.55.3", "network": {"tx": 1434595272, "rx": 530605511}}}}' + + - do: + indices.put_settings: + index: test + body: + index.blocks.write: true + +--- +split: + - skip: + version: all + reason: shard splitting doesn't work yet + features: "arbitrary_key" + + - do: + indices.split: + index: test + target: test_split + body: + settings: + index.number_of_replicas: 0 + index.number_of_shards: 6 + + - do: + search: + index: test_split + body: + fields: + # TODO fetch tsid + query: + query_string: + query: '+@timestamp:"2021-04-28T18:51:04.467Z" +k8s.pod.name:cat' + + - match: {hits.total.value: 1} + # TODO test fetching tsid + +--- +shrink: + - skip: + version: " - 7.99.99" + reason: introduced in 8.0.0 + features: "arbitrary_key" + + - do: + nodes.info: + node_id: data:true + - set: + nodes._arbitrary_key_: node_id + + - do: + indices.put_settings: + index: test + body: + index.routing.allocation.include._id: $node_id + + - do: + cluster.health: + wait_for_status: green + wait_for_no_relocating_shards: true + index: test + + - do: + indices.shrink: + index: test + target: test_shrink + body: + settings: + index.number_of_shards: 1 + + - do: + search: + index: test_shrink + body: + # TODO test fetching tsid + query: + query_string: + query: '+@timestamp:"2021-04-28T18:51:04.467Z" +k8s.pod.name:cat' + + - match: {hits.total.value: 1} + # TODO test fetching tsid + +--- +clone: + - skip: + version: " - 7.99.99" + reason: introduced in 8.0.0 + + - do: + indices.clone: + index: test + target: test_clone + + - do: + search: + index: test_clone + body: + # TODO test fetching tsid + query: + query_string: + query: '+@timestamp:"2021-04-28T18:51:04.467Z" +k8s.pod.name:cat' + + - match: {hits.total.value: 1} + # TODO test fetching tsid From 608ff36b8f98615536988abbea532fda0191ffde Mon Sep 17 00:00:00 2001 From: Michael Bischoff Date: Mon, 4 Oct 2021 15:05:15 +0200 Subject: [PATCH 119/250] Improving cache lookup to reduce recomputing / searches (#77259) Improved the cache logic to avoid duplicate searches when multiple requests target the same, not-yet-cached, value. --- .../xpack/enrich/EnrichCache.java | 76 +++++++++++++++---- .../xpack/enrich/EnrichProcessorFactory.java | 18 ++--- .../xpack/enrich/EnrichCacheTests.java | 60 +++++++++++++-- 3 files changed, 119 insertions(+), 35 deletions(-) diff --git a/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/EnrichCache.java b/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/EnrichCache.java index 35cf69fe8dd52..0b2459834b326 100644 --- a/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/EnrichCache.java +++ b/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/EnrichCache.java @@ -7,6 +7,7 @@ package org.elasticsearch.xpack.enrich; +import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.search.SearchRequest; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.cluster.metadata.IndexAbstraction; @@ -16,6 +17,11 @@ import org.elasticsearch.xpack.core.enrich.action.EnrichStatsAction; import java.util.Objects; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import java.util.function.BiConsumer; + +import static org.elasticsearch.action.ActionListener.wrap; /** * A simple cache for enrich that uses {@link Cache}. There is one instance of this cache and @@ -35,29 +41,26 @@ * current enrich index the enrich alias of an policy refers to. It would require checking * all cached entries on each cluster state update) */ -public final class EnrichCache { +public class EnrichCache { - private final Cache cache; + protected final Cache> cache; private volatile Metadata metadata; EnrichCache(long maxSize) { - this.cache = CacheBuilder.builder().setMaximumWeight(maxSize).build(); + this.cache = CacheBuilder.>builder().setMaximumWeight(maxSize).build(); } - SearchResponse get(SearchRequest searchRequest) { - String enrichIndex = getEnrichIndexKey(searchRequest); - CacheKey cacheKey = new CacheKey(enrichIndex, searchRequest); - + /** + * Get the value from the cache if present. Returns immediately. + * See {@link #resolveOrDispatchSearch(SearchRequest, BiConsumer, BiConsumer)} to implement a read-through, possibly async interaction. + * @param searchRequest the key + * @return the cached value or null + */ + CompletableFuture get(SearchRequest searchRequest) { + CacheKey cacheKey = toKey(searchRequest); return cache.get(cacheKey); } - void put(SearchRequest searchRequest, SearchResponse searchResponse) { - String enrichIndex = getEnrichIndexKey(searchRequest); - CacheKey cacheKey = new CacheKey(enrichIndex, searchRequest); - - cache.put(cacheKey, searchResponse); - } - void setMetadata(Metadata metadata) { this.metadata = metadata; } @@ -73,6 +76,51 @@ public EnrichStatsAction.Response.CacheStats getStats(String localNodeId) { ); } + /** + * resolves the entry from the cache and provides reports the result to the `callBack` This method does not dispatch any logic + * to another thread. Under contention the searchDispatcher is only called once when the value is not in the cache. The + * searchDispatcher should schedule the search / callback _asynchronously_ because if the searchDispatcher blocks, then this + * method will block. The callback is call on the thread calling this method or under cache miss and contention, the thread running + * the part of the searchDispatcher that calls the callback. + * @param searchRequest the cache key and input for the search dispatcher + * @param searchDispatcher the logical block to be called on cache miss + * @param callBack the callback which gets the value asynchronously, which could be a searchResponse or exception (negative lookup) + */ + public void resolveOrDispatchSearch( + SearchRequest searchRequest, + BiConsumer> searchDispatcher, + BiConsumer callBack + ) { + CacheKey cacheKey = toKey(searchRequest); + try { + CompletableFuture cacheEntry = cache.computeIfAbsent(cacheKey, request -> { + CompletableFuture completableFuture = new CompletableFuture<>(); + searchDispatcher.accept(searchRequest, wrap(completableFuture::complete, completableFuture::completeExceptionally)); + return completableFuture; + }); + cacheEntry.whenComplete((response, throwable) -> { + if (throwable != null) { + // Don't cache failures + cache.invalidate(cacheKey, cacheEntry); + if (throwable instanceof Exception) { + callBack.accept(response, (Exception) throwable); + return; + } + // Let ElasticsearchUncaughtExceptionHandler handle this, which should halt Elasticsearch + throw (Error) throwable; + } + callBack.accept(response, null); + }); + } catch (ExecutionException e) { + callBack.accept(null, e); + } + } + + protected CacheKey toKey(SearchRequest searchRequest) { + String enrichIndex = getEnrichIndexKey(searchRequest); + return new CacheKey(enrichIndex, searchRequest); + } + private String getEnrichIndexKey(SearchRequest searchRequest) { String alias = searchRequest.indices()[0]; IndexAbstraction ia = metadata.getIndicesLookup().get(alias); diff --git a/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/EnrichProcessorFactory.java b/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/EnrichProcessorFactory.java index 2b7a426f74ce9..9f0fae534eced 100644 --- a/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/EnrichProcessorFactory.java +++ b/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/EnrichProcessorFactory.java @@ -6,7 +6,6 @@ */ package org.elasticsearch.xpack.enrich; -import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.search.SearchRequest; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.client.Client; @@ -129,17 +128,10 @@ private static BiConsumer> EnrichCache enrichCache ) { Client originClient = new OriginSettingClient(client, ENRICH_ORIGIN); - return (req, handler) -> { - // intentionally non-locking for simplicity...it's OK if we re-put the same key/value in the cache during a race condition. - SearchResponse response = enrichCache.get(req); - if (response != null) { - handler.accept(response, null); - } else { - originClient.execute(EnrichCoordinatorProxyAction.INSTANCE, req, ActionListener.wrap(resp -> { - enrichCache.put(req, resp); - handler.accept(resp, null); - }, e -> { handler.accept(null, e); })); - } - }; + return (req, handler) -> enrichCache.resolveOrDispatchSearch( + req, + (searchRequest, listener) -> originClient.execute(EnrichCoordinatorProxyAction.INSTANCE, searchRequest, listener), + handler + ); } } diff --git a/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/EnrichCacheTests.java b/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/EnrichCacheTests.java index 07893d8d59c7e..999142b99532e 100644 --- a/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/EnrichCacheTests.java +++ b/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/EnrichCacheTests.java @@ -26,6 +26,12 @@ import org.elasticsearch.xpack.core.enrich.EnrichPolicy; import java.util.Collections; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.notNullValue; @@ -87,11 +93,15 @@ public void testCaching() { SearchResponse.Clusters.EMPTY ); - var enrichCache = new EnrichCache(3); + var enrichCache = new EnrichCache(3) { + void warmCache(SearchRequest searchRequest, SearchResponse entry) { + this.cache.put(toKey(searchRequest), CompletableFuture.completedFuture(entry)); + } + }; enrichCache.setMetadata(metadata); - enrichCache.put(searchRequest1, searchResponse); - enrichCache.put(searchRequest2, searchResponse); - enrichCache.put(searchRequest3, searchResponse); + enrichCache.warmCache(searchRequest1, searchResponse); + enrichCache.warmCache(searchRequest2, searchResponse); + enrichCache.warmCache(searchRequest3, searchResponse); var cacheStats = enrichCache.getStats("_id"); assertThat(cacheStats.getCount(), equalTo(3L)); assertThat(cacheStats.getHits(), equalTo(0L)); @@ -108,7 +118,7 @@ public void testCaching() { assertThat(cacheStats.getMisses(), equalTo(1L)); assertThat(cacheStats.getEvictions(), equalTo(0L)); - enrichCache.put(searchRequest4, searchResponse); + enrichCache.warmCache(searchRequest4, searchResponse); cacheStats = enrichCache.getStats("_id"); assertThat(cacheStats.getCount(), equalTo(3L)); assertThat(cacheStats.getHits(), equalTo(3L)); @@ -141,9 +151,9 @@ public void testCaching() { assertThat(enrichCache.get(searchRequest4), nullValue()); // Add new entries using new enrich index name as key - enrichCache.put(searchRequest1, searchResponse); - enrichCache.put(searchRequest2, searchResponse); - enrichCache.put(searchRequest3, searchResponse); + enrichCache.warmCache(searchRequest1, searchResponse); + enrichCache.warmCache(searchRequest2, searchResponse); + enrichCache.warmCache(searchRequest3, searchResponse); // Entries can now be served: assertThat(enrichCache.get(searchRequest1), notNullValue()); @@ -157,4 +167,38 @@ public void testCaching() { assertThat(cacheStats.getEvictions(), equalTo(4L)); } + public void testNonblocking() throws ExecutionException { + var enrichCache = new EnrichCache(3); + var metadata = Metadata.builder() + .put( + IndexMetadata.builder(EnrichPolicy.getBaseName("policy1") + "-1") + .settings(settings(Version.CURRENT)) + .numberOfShards(1) + .numberOfReplicas(0) + .putAlias(AliasMetadata.builder(EnrichPolicy.getBaseName("policy1")).build()) + ) + .build(); + enrichCache.setMetadata(metadata); + + var key = new SearchRequest(EnrichPolicy.getBaseName("policy1")).source( + new SearchSourceBuilder().query(new MatchQueryBuilder("match_field", "1")) + ); + + CompletableFuture check = new CompletableFuture<>(); + ExecutorService executor = Executors.newSingleThreadExecutor(); + executor.submit(() -> { + enrichCache.resolveOrDispatchSearch(key, (req, handler) -> {/* take forever to compute */}, (value, exception) -> {}); + check.complete(true); + }); + + try { + check.get(1, TimeUnit.SECONDS); + } catch (InterruptedException e) { + fail("interrupted"); + } catch (TimeoutException e) { + fail("method blocked for a second"); + } + + executor.shutdownNow(); + } } From 45a41494012fd0e74995af1372268531acadd54d Mon Sep 17 00:00:00 2001 From: Dimitris Athanasiou Date: Mon, 4 Oct 2021 16:11:40 +0300 Subject: [PATCH 120/250] [ML] Handle multiple punctuation chars adjacent to never-split token (#78607) This commit fixes a problem when tokenizing text that contains tokens that should never be split followed by multiple punctuation characters. --- .../nlp/tokenizers/BasicTokenizer.java | 25 ++++++++++++++----- .../nlp/tokenizers/BasicTokenizerTests.java | 6 +++++ 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/tokenizers/BasicTokenizer.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/tokenizers/BasicTokenizer.java index e6bb49e41be53..3217373bf6f18 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/tokenizers/BasicTokenizer.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/tokenizers/BasicTokenizer.java @@ -101,12 +101,14 @@ public List tokenize(String text) { // At this point text has been tokenized by whitespace // but one of the special never split tokens could be adjacent - // to a punctuation character. - if (isCommonPunctuation(token.codePointAt(token.length() -1)) && - neverSplit.contains(token.substring(0, token.length() -1))) { - processedTokens.add(token.substring(0, token.length() -1)); - processedTokens.add(token.substring(token.length() -1)); - continue; + // to one or more punctuation characters. + if (isCommonPunctuation(token.codePointAt(token.length() -1))) { + int lastNonPunctuationIndex = findLastNonPunctuationIndex(token); + if (lastNonPunctuationIndex >= 0 && neverSplit.contains(token.substring(0, lastNonPunctuationIndex + 1))) { + processedTokens.add(token.substring(0, lastNonPunctuationIndex + 1)); + processedTokens.addAll(splitOnPunctuation(token.substring(lastNonPunctuationIndex + 1))); + continue; + } } if (isLowerCase) { @@ -121,6 +123,17 @@ public List tokenize(String text) { return processedTokens; } + private int findLastNonPunctuationIndex(String token) { + int i = token.length() - 1; + while (i >= 0) { + if (isCommonPunctuation(token.codePointAt(i)) == false) { + break; + } + i--; + } + return i; + } + public boolean isLowerCase() { return isLowerCase; } diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/tokenizers/BasicTokenizerTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/tokenizers/BasicTokenizerTests.java index b06f7cf84839c..78808dc93704f 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/tokenizers/BasicTokenizerTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/tokenizers/BasicTokenizerTests.java @@ -69,6 +69,9 @@ public void testNeverSplit() { tokens = tokenizer.tokenize("Hello [UNK]?"); assertThat(tokens, contains("Hello", "[UNK]", "?")); + + tokens = tokenizer.tokenize("Hello [UNK]!!"); + assertThat(tokens, contains("Hello", "[UNK]", "!", "!")); } public void testSplitOnPunctuation() { @@ -92,6 +95,9 @@ public void testSplitOnPunctuation() { tokens = BasicTokenizer.splitOnPunctuation("hi."); assertThat(tokens, contains("hi", ".")); + + tokens = BasicTokenizer.splitOnPunctuation("!!"); + assertThat(tokens, contains("!", "!")); } public void testStripAccents() { From 311f0466edb0a9bb7eb730ec1a568cec35fee81d Mon Sep 17 00:00:00 2001 From: Nik Everett Date: Mon, 4 Oct 2021 09:15:10 -0400 Subject: [PATCH 121/250] TSDB: Mark tests as 8.0.0 only (#78572) We're not going to have a useful release of tsdb in 7.16 so we've backed out the tiny amount of work that we've landed into that branch. `time_series` mode will be a 8.0+ thing. Thsis updates the tests to reflect that. --- ...imension_and_metric_in_non_tsdb_index.yml} | 0 .../rest-api-spec/test/tsdb/10_settings.yml | 12 ++--- .../rest-api-spec/test/tsdb/20_mapping.yml | 50 +++++++++++++++++++ 3 files changed, 56 insertions(+), 6 deletions(-) rename rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/tsdb/{20_mappings.yml => 05_dimension_and_metric_in_non_tsdb_index.yml} (100%) create mode 100644 rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/tsdb/20_mapping.yml diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/tsdb/20_mappings.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/tsdb/05_dimension_and_metric_in_non_tsdb_index.yml similarity index 100% rename from rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/tsdb/20_mappings.yml rename to rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/tsdb/05_dimension_and_metric_in_non_tsdb_index.yml diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/tsdb/10_settings.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/tsdb/10_settings.yml index d9dd72dfc4a2f..a2f8dae6b652a 100644 --- a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/tsdb/10_settings.yml +++ b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/tsdb/10_settings.yml @@ -1,7 +1,7 @@ enable: - skip: version: " - 7.99.99" - reason: introduced in 8.0.0 to be backported to 7.16.0 + reason: introduced in 8.0.0 - do: indices.create: @@ -41,7 +41,7 @@ enable: no sort field: - skip: version: " - 7.99.99" - reason: introduced in 8.0.0 to be backported to 7.16.0 + reason: introduced in 8.0.0 - do: catch: /\[index.mode=time_series\] is incompatible with \[index.sort.field\]/ @@ -57,7 +57,7 @@ no sort field: no sort order: - skip: version: " - 7.99.99" - reason: introduced in 8.0.0 to be backported to 7.16.0 + reason: introduced in 8.0.0 - do: catch: /\[index.mode=time_series\] is incompatible with \[index.sort.order\]/ @@ -73,7 +73,7 @@ no sort order: no sort mode: - skip: version: " - 7.99.99" - reason: introduced in 8.0.0 to be backported to 7.16.0 + reason: introduced in 8.0.0 - do: catch: /\[index.mode=time_series\] is incompatible with \[index.sort.mode\]/ @@ -89,7 +89,7 @@ no sort mode: no sort missing: - skip: version: " - 7.99.99" - reason: introduced in 8.0.0 to be backported to 7.16.0 + reason: introduced in 8.0.0 - do: catch: /\[index.mode=time_series\] is incompatible with \[index.sort.missing\]/ @@ -105,7 +105,7 @@ no sort missing: no partitioning: - skip: version: " - 7.99.99" - reason: introduced in 8.0.0 to be backported to 7.16.0 + reason: introduced in 8.0.0 - do: catch: /\[index.mode=time_series\] is incompatible with \[index.routing_partition_size\]/ diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/tsdb/20_mapping.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/tsdb/20_mapping.yml new file mode 100644 index 0000000000000..ae26ec917f031 --- /dev/null +++ b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/tsdb/20_mapping.yml @@ -0,0 +1,50 @@ +add time series mappings: + - skip: + version: " - 7.99.99" + reason: introduced in 8.0.0 + + - do: + indices.create: + index: tsdb_index + body: + settings: + index: + mode: time_series + number_of_replicas: 0 + number_of_shards: 2 + mappings: + properties: + "@timestamp": + type: date + metricset: + type: keyword + time_series_dimension: true + k8s: + properties: + pod: + properties: + availability_zone: + type: short + time_series_dimension: true + uid: + type: keyword + time_series_dimension: true + name: + type: keyword + ip: + type: ip + time_series_dimension: true + network: + properties: + tx: + type: long + time_series_metric: counter + rx: + type: integer + time_series_metric: gauge + packets_dropped: + type: long + time_series_metric: gauge + latency: + type: double + time_series_metric: gauge From ed8d79f5e1770a5adeee7fe37a66dac5a2bcca20 Mon Sep 17 00:00:00 2001 From: Dan Hermann Date: Mon, 4 Oct 2021 08:22:32 -0500 Subject: [PATCH 122/250] Data streams service to handle modification requests (#78033) --- .../cluster/metadata/DataStream.java | 15 +- .../cluster/metadata/DataStreamAction.java | 81 ++++ .../metadata/MetadataDataStreamsService.java | 170 +++++++++ .../MetadataMigrateToDataStreamService.java | 19 +- .../MetadataDataStreamsServiceTests.java | 361 ++++++++++++++++++ ...tadataMigrateToDataStreamServiceTests.java | 4 - .../metadata/DataStreamTestHelper.java | 14 +- 7 files changed, 642 insertions(+), 22 deletions(-) create mode 100644 server/src/main/java/org/elasticsearch/cluster/metadata/DataStreamAction.java create mode 100644 server/src/main/java/org/elasticsearch/cluster/metadata/MetadataDataStreamsService.java create mode 100644 server/src/test/java/org/elasticsearch/cluster/metadata/MetadataDataStreamsServiceTests.java diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/DataStream.java b/server/src/main/java/org/elasticsearch/cluster/metadata/DataStream.java index b0d81bad9d984..de446504f1a40 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/DataStream.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/DataStream.java @@ -186,12 +186,19 @@ public DataStream removeBackingIndex(Index index) { int backingIndexPosition = indices.indexOf(index); if (backingIndexPosition == -1) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "index [%s] is not part of data stream [%s]", - index.getName(), name)); + throw new IllegalArgumentException(String.format( + Locale.ROOT, + "index [%s] is not part of data stream [%s]", + index.getName(), name + )); } if (generation == (backingIndexPosition + 1)) { - throw new IllegalArgumentException(String.format(Locale.ROOT, "cannot remove backing index [%s] of data stream [%s] because " + - "it is the write index", index.getName(), name)); + throw new IllegalArgumentException(String.format( + Locale.ROOT, + "cannot remove backing index [%s] of data stream [%s] because it is the write index", + index.getName(), + name + )); } List backingIndices = new ArrayList<>(indices); diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/DataStreamAction.java b/server/src/main/java/org/elasticsearch/cluster/metadata/DataStreamAction.java new file mode 100644 index 0000000000000..63e9d0e10ed0b --- /dev/null +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/DataStreamAction.java @@ -0,0 +1,81 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.cluster.metadata; + +import org.elasticsearch.common.Strings; + +/** + * Operations on data streams + */ +public abstract class DataStreamAction { + private final String dataStream; + + public static DataStreamAction addBackingIndex(String dataStream, String index) { + return new DataStreamAction.AddBackingIndex(dataStream, index); + } + + public static DataStreamAction removeBackingIndex(String dataStream, String index) { + return new DataStreamAction.RemoveBackingIndex(dataStream, index); + } + + private DataStreamAction(String dataStream) { + if (false == Strings.hasText(dataStream)) { + throw new IllegalArgumentException("[data_stream] is required"); + } + this.dataStream = dataStream; + } + + /** + * Data stream on which the operation should act + */ + public String getDataStream() { + return dataStream; + } + + public static class AddBackingIndex extends DataStreamAction { + + private final String index; + + private AddBackingIndex(String dataStream, String index) { + super(dataStream); + + if (false == Strings.hasText(index)) { + throw new IllegalArgumentException("[index] is required"); + } + + this.index = index; + } + + public String getIndex() { + return index; + } + + } + + public static class RemoveBackingIndex extends DataStreamAction { + + private final String index; + + private RemoveBackingIndex(String dataStream, String index) { + super(dataStream); + + if (false == Strings.hasText(index)) { + throw new IllegalArgumentException("[index] is required"); + } + + this.index = index; + } + + public String getIndex() { + return index; + } + + } + +} diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/MetadataDataStreamsService.java b/server/src/main/java/org/elasticsearch/cluster/metadata/MetadataDataStreamsService.java new file mode 100644 index 0000000000000..4b446fd761628 --- /dev/null +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/MetadataDataStreamsService.java @@ -0,0 +1,170 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.cluster.metadata; + +import org.elasticsearch.action.ActionListener; +import org.elasticsearch.action.support.master.AcknowledgedResponse; +import org.elasticsearch.cluster.AckedClusterStateUpdateTask; +import org.elasticsearch.cluster.ClusterState; +import org.elasticsearch.cluster.ack.ClusterStateUpdateRequest; +import org.elasticsearch.cluster.service.ClusterService; +import org.elasticsearch.common.Priority; +import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.index.mapper.MapperService; +import org.elasticsearch.indices.IndicesService; + +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.function.Function; + +/** + * Handles data stream modification requests. + */ +public class MetadataDataStreamsService { + + private final ClusterService clusterService; + private final IndicesService indicesService; + + public MetadataDataStreamsService(ClusterService clusterService, IndicesService indicesService) { + this.clusterService = clusterService; + this.indicesService = indicesService; + } + + public void updateBackingIndices(final ModifyDataStreamRequest request, + final ActionListener listener) { + if (request.actions().size() == 0) { + listener.onResponse(AcknowledgedResponse.TRUE); + } else { + clusterService.submitStateUpdateTask("update-backing-indices", + new AckedClusterStateUpdateTask(Priority.URGENT, request, listener) { + @Override + public ClusterState execute(ClusterState currentState) { + return modifyDataStream( + currentState, + request.actions(), + indexMetadata -> { + try { + return indicesService.createIndexMapperService(indexMetadata); + } catch (IOException e) { + throw new IllegalStateException(e); + } + } + ); + } + }); + } + } + + /** + * Computes the resulting cluster state after applying all requested data stream modifications in order. + * + * @param currentState current cluster state + * @param actions ordered list of modifications to perform + * @return resulting cluster state after all modifications have been performed + */ + static ClusterState modifyDataStream( + ClusterState currentState, + Iterable actions, + Function mapperSupplier + ) { + Metadata updatedMetadata = currentState.metadata(); + + for (var action : actions) { + Metadata.Builder builder = Metadata.builder(updatedMetadata); + if (action instanceof DataStreamAction.AddBackingIndex) { + addBackingIndex( + updatedMetadata, + builder, + mapperSupplier, + action.getDataStream(), + ((DataStreamAction.AddBackingIndex) action).getIndex() + ); + } else if (action instanceof DataStreamAction.RemoveBackingIndex) { + removeBackingIndex( + updatedMetadata, + builder, + action.getDataStream(), + ((DataStreamAction.RemoveBackingIndex) action).getIndex() + ); + } else { + throw new IllegalStateException("unsupported data stream action type [" + action.getClass().getName() + "]"); + } + updatedMetadata = builder.build(); + } + + return ClusterState.builder(currentState).metadata(updatedMetadata).build(); + } + + private static void addBackingIndex( + Metadata metadata, + Metadata.Builder builder, + Function mapperSupplier, + String dataStreamName, + String indexName + ) { + var dataStream = validateDataStream(metadata, dataStreamName); + var index = validateIndex(metadata, indexName); + + try { + MetadataMigrateToDataStreamService.prepareBackingIndex( + builder, + index.getWriteIndex(), + dataStreamName, + mapperSupplier, + false); + } catch (IOException e) { + throw new IllegalArgumentException("unable to prepare backing index", e); + } + + // add index to data stream + builder.put(dataStream.getDataStream().addBackingIndex(metadata, index.getWriteIndex().getIndex())); + } + + private static void removeBackingIndex(Metadata metadata, Metadata.Builder builder, String dataStreamName, String indexName) { + var dataStream = validateDataStream(metadata, dataStreamName); + var index = validateIndex(metadata, indexName); + builder.put(dataStream.getDataStream().removeBackingIndex(index.getWriteIndex().getIndex())); + + // un-hide index + builder.put(IndexMetadata.builder(index.getWriteIndex()) + .settings(Settings.builder().put(index.getWriteIndex().getSettings()).put("index.hidden", "false").build()) + .settingsVersion(index.getWriteIndex().getSettingsVersion() + 1)); + } + + private static IndexAbstraction.DataStream validateDataStream(Metadata metadata, String dataStreamName) { + IndexAbstraction dataStream = metadata.getIndicesLookup().get(dataStreamName); + if (dataStream == null || dataStream.getType() != IndexAbstraction.Type.DATA_STREAM) { + throw new IllegalArgumentException("data stream [" + dataStreamName + "] not found"); + } + return (IndexAbstraction.DataStream) dataStream; + } + + private static IndexAbstraction.Index validateIndex(Metadata metadata, String indexName) { + IndexAbstraction index = metadata.getIndicesLookup().get(indexName); + if (index == null || index.getType() != IndexAbstraction.Type.CONCRETE_INDEX) { + throw new IllegalArgumentException("index [" + indexName + "] not found"); + } + return (IndexAbstraction.Index) index; + } + + public static final class ModifyDataStreamRequest extends ClusterStateUpdateRequest { + + private final List actions; + + public ModifyDataStreamRequest(List actions) { + this.actions = Collections.unmodifiableList(actions); + } + + public List actions() { + return actions; + } + } + +} diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/MetadataMigrateToDataStreamService.java b/server/src/main/java/org/elasticsearch/cluster/metadata/MetadataMigrateToDataStreamService.java index d1ed7a5a07bd3..89c28871cce0a 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/MetadataMigrateToDataStreamService.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/MetadataMigrateToDataStreamService.java @@ -100,7 +100,6 @@ public ClusterState execute(ClusterState currentState) throws Exception { } }, request, - threadContext, metadataCreateIndexService); writeIndexRef.set(clusterState.metadata().dataStreams().get(request.aliasName).getWriteIndex().getName()); return clusterState; @@ -111,7 +110,6 @@ public ClusterState execute(ClusterState currentState) throws Exception { static ClusterState migrateToDataStream(ClusterState currentState, Function mapperSupplier, MigrateToDataStreamClusterStateUpdateRequest request, - ThreadContext threadContext, MetadataCreateIndexService metadataCreateIndexService) throws Exception { validateRequest(currentState, request); IndexAbstraction.Alias alias = (IndexAbstraction.Alias) currentState.metadata().getIndicesLookup().get(request.aliasName); @@ -119,7 +117,7 @@ static ClusterState migrateToDataStream(ClusterState currentState, validateBackingIndices(currentState, request.aliasName); Metadata.Builder mb = Metadata.builder(currentState.metadata()); for (IndexMetadata im : alias.getIndices()) { - prepareBackingIndex(mb, im, request.aliasName, mapperSupplier); + prepareBackingIndex(mb, im, request.aliasName, mapperSupplier, true); } currentState = ClusterState.builder(currentState).metadata(mb).build(); @@ -153,12 +151,13 @@ static void validateRequest(ClusterState currentState, MigrateToDataStreamCluste } } - private static void prepareBackingIndex( + // hides the index, optionally removes the alias, and adds data stream timestamp field mapper + static void prepareBackingIndex( Metadata.Builder b, IndexMetadata im, String dataStreamName, - Function mapperSupplier) throws IOException { - // hides the index, removes the original alias, and adds data stream timestamp field mapper + Function mapperSupplier, + boolean removeAlias) throws IOException { MappingMetadata mm = im.mapping(); if (mm == null) { throw new IllegalArgumentException("backing index [" + im.getIndex().getName() + "] must have mappings for a timestamp field"); @@ -170,8 +169,12 @@ private static void prepareBackingIndex( MapperService.MergeReason.MAPPING_UPDATE); DocumentMapper mapper = mapperService.documentMapper(); - b.put(IndexMetadata.builder(im) - .removeAlias(dataStreamName) + var imb = IndexMetadata.builder(im); + if (removeAlias) { + imb.removeAlias(dataStreamName); + } + + b.put(imb .settings(Settings.builder().put(im.getSettings()).put("index.hidden", "true").build()) .settingsVersion(im.getSettingsVersion() + 1) .mappingVersion(im.getMappingVersion() + 1) diff --git a/server/src/test/java/org/elasticsearch/cluster/metadata/MetadataDataStreamsServiceTests.java b/server/src/test/java/org/elasticsearch/cluster/metadata/MetadataDataStreamsServiceTests.java new file mode 100644 index 0000000000000..ea667af6941b7 --- /dev/null +++ b/server/src/test/java/org/elasticsearch/cluster/metadata/MetadataDataStreamsServiceTests.java @@ -0,0 +1,361 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.cluster.metadata; + +import org.elasticsearch.Version; +import org.elasticsearch.cluster.ClusterName; +import org.elasticsearch.cluster.ClusterState; +import org.elasticsearch.common.Strings; +import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.index.Index; +import org.elasticsearch.index.mapper.MapperService; +import org.elasticsearch.index.mapper.MapperServiceTestCase; +import org.elasticsearch.plugins.Plugin; + +import java.io.IOException; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.stream.Collectors; + +import static org.elasticsearch.cluster.metadata.DataStreamTestHelper.createTimestampField; +import static org.elasticsearch.cluster.metadata.DataStreamTestHelper.generateMapping; +import static org.hamcrest.Matchers.containsInAnyOrder; +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.notNullValue; + +public class MetadataDataStreamsServiceTests extends MapperServiceTestCase { + + public void testAddBackingIndex() { + final long epochMillis = System.currentTimeMillis(); + final int numBackingIndices = randomIntBetween(1, 4); + final String dataStreamName = randomAlphaOfLength(5); + IndexMetadata[] backingIndices = new IndexMetadata[numBackingIndices]; + Metadata.Builder mb = Metadata.builder(); + for (int k = 0; k < numBackingIndices; k++) { + backingIndices[k] = + IndexMetadata.builder(DataStream.getDefaultBackingIndexName(dataStreamName, k + 1, epochMillis)) + .settings(Settings.builder().put(IndexMetadata.SETTING_VERSION_CREATED, Version.CURRENT)) + .numberOfShards(1) + .numberOfReplicas(0) + .putMapping(generateMapping("@timestamp")) + .build(); + mb.put(backingIndices[k], false); + } + + mb.put(new DataStream( + dataStreamName, + createTimestampField("@timestamp"), + Arrays.stream(backingIndices).map(IndexMetadata::getIndex).collect(Collectors.toList()) + ) + ); + + final IndexMetadata indexToAdd = IndexMetadata.builder(randomAlphaOfLength(5)) + .settings(Settings.builder().put(IndexMetadata.SETTING_VERSION_CREATED, Version.CURRENT)) + .numberOfShards(1) + .numberOfReplicas(0) + .putMapping(generateMapping("@timestamp")) + .build(); + mb.put(indexToAdd, false); + + ClusterState originalState = ClusterState.builder(new ClusterName("dummy")).metadata(mb.build()).build(); + ClusterState newState = MetadataDataStreamsService.modifyDataStream( + originalState, + List.of(DataStreamAction.addBackingIndex(dataStreamName, indexToAdd.getIndex().getName())), + this::getMapperService + ); + + IndexAbstraction ds = newState.metadata().getIndicesLookup().get(dataStreamName); + assertThat(ds, notNullValue()); + assertThat(ds.getType(), equalTo(IndexAbstraction.Type.DATA_STREAM)); + assertThat(ds.getIndices().size(), equalTo(numBackingIndices + 1)); + List backingIndexNames = ds.getIndices() + .stream() + .filter(x -> x.getIndex().getName().startsWith(".ds-")) + .map(x -> x.getIndex().getName()) + .collect(Collectors.toList()); + assertThat(backingIndexNames, containsInAnyOrder( + Arrays.stream(backingIndices) + .map(IndexMetadata::getIndex) + .map(Index::getName) + .collect(Collectors.toList()) + .toArray(Strings.EMPTY_ARRAY) + ) + ); + IndexMetadata zeroIndex = ds.getIndices().get(0); + assertThat(zeroIndex.getIndex(), equalTo(indexToAdd.getIndex())); + assertThat(zeroIndex.getSettings().get("index.hidden"), equalTo("true")); + assertThat(zeroIndex.getAliases().size(), equalTo(0)); + } + + public void testRemoveBackingIndex() { + final long epochMillis = System.currentTimeMillis(); + final int numBackingIndices = randomIntBetween(2, 4); + final String dataStreamName = randomAlphaOfLength(5); + IndexMetadata[] backingIndices = new IndexMetadata[numBackingIndices]; + Metadata.Builder mb = Metadata.builder(); + for (int k = 0; k < numBackingIndices; k++) { + backingIndices[k] = + IndexMetadata.builder(DataStream.getDefaultBackingIndexName(dataStreamName, k + 1, epochMillis)) + .settings(Settings.builder().put(IndexMetadata.SETTING_VERSION_CREATED, Version.CURRENT)) + .numberOfShards(1) + .numberOfReplicas(0) + .putMapping(generateMapping("@timestamp")) + .build(); + mb.put(backingIndices[k], false); + } + + mb.put(new DataStream( + dataStreamName, + createTimestampField("@timestamp"), + Arrays.stream(backingIndices).map(IndexMetadata::getIndex).collect(Collectors.toList()) + ) + ); + + final IndexMetadata indexToRemove = backingIndices[randomIntBetween(0, numBackingIndices - 2)]; + ClusterState originalState = ClusterState.builder(new ClusterName("dummy")).metadata(mb.build()).build(); + ClusterState newState = MetadataDataStreamsService.modifyDataStream( + originalState, + List.of(DataStreamAction.removeBackingIndex(dataStreamName, indexToRemove.getIndex().getName())), + this::getMapperService + ); + + IndexAbstraction ds = newState.metadata().getIndicesLookup().get(dataStreamName); + assertThat(ds, notNullValue()); + assertThat(ds.getType(), equalTo(IndexAbstraction.Type.DATA_STREAM)); + assertThat(ds.getIndices().size(), equalTo(numBackingIndices - 1)); + + List expectedBackingIndices = ds.getIndices() + .stream() + .map(IndexMetadata::getIndex) + .filter(x -> x.getName().equals(indexToRemove.getIndex().getName()) == false) + .collect(Collectors.toList()); + assertThat(expectedBackingIndices, containsInAnyOrder(ds.getIndices().stream().map(IndexMetadata::getIndex).toArray())); + + IndexMetadata removedIndex = newState.metadata().getIndices().get(indexToRemove.getIndex().getName()); + assertThat(removedIndex, notNullValue()); + assertThat(removedIndex.getSettings().get("index.hidden"), equalTo("false")); + assertNull(newState.metadata().getIndicesLookup().get(indexToRemove.getIndex().getName()).getParentDataStream()); + } + + public void testAddRemoveAddRoundtripInSingleRequest() { + final long epochMillis = System.currentTimeMillis(); + final int numBackingIndices = randomIntBetween(1, 4); + final String dataStreamName = randomAlphaOfLength(5); + IndexMetadata[] backingIndices = new IndexMetadata[numBackingIndices]; + Metadata.Builder mb = Metadata.builder(); + for (int k = 0; k < numBackingIndices; k++) { + backingIndices[k] = + IndexMetadata.builder(DataStream.getDefaultBackingIndexName(dataStreamName, k + 1, epochMillis)) + .settings(Settings.builder().put(IndexMetadata.SETTING_VERSION_CREATED, Version.CURRENT)) + .numberOfShards(1) + .numberOfReplicas(0) + .putMapping(generateMapping("@timestamp")) + .build(); + mb.put(backingIndices[k], false); + } + + mb.put(new DataStream( + dataStreamName, + createTimestampField("@timestamp"), + Arrays.stream(backingIndices).map(IndexMetadata::getIndex).collect(Collectors.toList()) + ) + ); + + final IndexMetadata indexToAdd = IndexMetadata.builder(randomAlphaOfLength(5)) + .settings(Settings.builder().put(IndexMetadata.SETTING_VERSION_CREATED, Version.CURRENT)) + .numberOfShards(1) + .numberOfReplicas(0) + .putMapping(generateMapping("@timestamp")) + .build(); + mb.put(indexToAdd, false); + + ClusterState originalState = ClusterState.builder(new ClusterName("dummy")).metadata(mb.build()).build(); + ClusterState newState = MetadataDataStreamsService.modifyDataStream( + originalState, + List.of( + DataStreamAction.addBackingIndex(dataStreamName, indexToAdd.getIndex().getName()), + DataStreamAction.removeBackingIndex(dataStreamName, indexToAdd.getIndex().getName()), + DataStreamAction.addBackingIndex(dataStreamName, indexToAdd.getIndex().getName()) + ), + this::getMapperService + ); + + IndexAbstraction ds = newState.metadata().getIndicesLookup().get(dataStreamName); + assertThat(ds, notNullValue()); + assertThat(ds.getType(), equalTo(IndexAbstraction.Type.DATA_STREAM)); + assertThat(ds.getIndices().size(), equalTo(numBackingIndices + 1)); + List backingIndexNames = ds.getIndices() + .stream() + .filter(x -> x.getIndex().getName().startsWith(".ds-")) + .map(x -> x.getIndex().getName()) + .collect(Collectors.toList()); + assertThat(backingIndexNames, containsInAnyOrder( + Arrays.stream(backingIndices) + .map(IndexMetadata::getIndex) + .map(Index::getName) + .collect(Collectors.toList()) + .toArray(Strings.EMPTY_ARRAY) + ) + ); + IndexMetadata zeroIndex = ds.getIndices().get(0); + assertThat(zeroIndex.getIndex(), equalTo(indexToAdd.getIndex())); + assertThat(zeroIndex.getSettings().get("index.hidden"), equalTo("true")); + assertThat(zeroIndex.getAliases().size(), equalTo(0)); + } + + public void testAddRemoveAddRoundtripInSeparateRequests() { + final long epochMillis = System.currentTimeMillis(); + final int numBackingIndices = randomIntBetween(1, 4); + final String dataStreamName = randomAlphaOfLength(5); + IndexMetadata[] backingIndices = new IndexMetadata[numBackingIndices]; + Metadata.Builder mb = Metadata.builder(); + for (int k = 0; k < numBackingIndices; k++) { + backingIndices[k] = + IndexMetadata.builder(DataStream.getDefaultBackingIndexName(dataStreamName, k + 1, epochMillis)) + .settings(Settings.builder().put(IndexMetadata.SETTING_VERSION_CREATED, Version.CURRENT)) + .numberOfShards(1) + .numberOfReplicas(0) + .putMapping(generateMapping("@timestamp")) + .build(); + mb.put(backingIndices[k], false); + } + + mb.put(new DataStream( + dataStreamName, + createTimestampField("@timestamp"), + Arrays.stream(backingIndices).map(IndexMetadata::getIndex).collect(Collectors.toList()) + ) + ); + + final IndexMetadata indexToAdd = IndexMetadata.builder(randomAlphaOfLength(5)) + .settings(Settings.builder().put(IndexMetadata.SETTING_VERSION_CREATED, Version.CURRENT)) + .numberOfShards(1) + .numberOfReplicas(0) + .putMapping(generateMapping("@timestamp")) + .build(); + mb.put(indexToAdd, false); + + ClusterState originalState = ClusterState.builder(new ClusterName("dummy")).metadata(mb.build()).build(); + ClusterState newState = MetadataDataStreamsService.modifyDataStream( + originalState, + List.of(DataStreamAction.addBackingIndex(dataStreamName, indexToAdd.getIndex().getName())), + this::getMapperService + ); + newState = MetadataDataStreamsService.modifyDataStream( + newState, + List.of(DataStreamAction.removeBackingIndex(dataStreamName, indexToAdd.getIndex().getName())), + this::getMapperService + ); + newState = MetadataDataStreamsService.modifyDataStream( + newState, + List.of(DataStreamAction.addBackingIndex(dataStreamName, indexToAdd.getIndex().getName())), + this::getMapperService + ); + + IndexAbstraction ds = newState.metadata().getIndicesLookup().get(dataStreamName); + assertThat(ds, notNullValue()); + assertThat(ds.getType(), equalTo(IndexAbstraction.Type.DATA_STREAM)); + assertThat(ds.getIndices().size(), equalTo(numBackingIndices + 1)); + List backingIndexNames = ds.getIndices() + .stream() + .filter(x -> x.getIndex().getName().startsWith(".ds-")) + .map(x -> x.getIndex().getName()) + .collect(Collectors.toList()); + assertThat(backingIndexNames, containsInAnyOrder( + Arrays.stream(backingIndices) + .map(IndexMetadata::getIndex) + .map(Index::getName) + .collect(Collectors.toList()) + .toArray(Strings.EMPTY_ARRAY) + ) + ); + IndexMetadata zeroIndex = ds.getIndices().get(0); + assertThat(zeroIndex.getIndex(), equalTo(indexToAdd.getIndex())); + assertThat(zeroIndex.getSettings().get("index.hidden"), equalTo("true")); + assertThat(zeroIndex.getAliases().size(), equalTo(0)); + } + + public void testMissingDataStream() { + Metadata.Builder mb = Metadata.builder(); + final IndexMetadata indexToAdd = IndexMetadata.builder(randomAlphaOfLength(5)) + .settings(Settings.builder().put(IndexMetadata.SETTING_VERSION_CREATED, Version.CURRENT)) + .numberOfShards(1) + .numberOfReplicas(0) + .putMapping(generateMapping("@timestamp")) + .build(); + mb.put(indexToAdd, false); + final String missingDataStream = randomAlphaOfLength(5); + + ClusterState originalState = ClusterState.builder(new ClusterName("dummy")).metadata(mb.build()).build(); + + IllegalArgumentException e = expectThrows( + IllegalArgumentException.class, + () -> MetadataDataStreamsService.modifyDataStream( + originalState, + List.of(DataStreamAction.addBackingIndex(missingDataStream, indexToAdd.getIndex().getName())), + this::getMapperService + ) + ); + + assertThat(e.getMessage(), equalTo("data stream [" + missingDataStream + "] not found")); + } + + public void testMissingIndex() { + final long epochMillis = System.currentTimeMillis(); + final int numBackingIndices = randomIntBetween(1, 4); + final String dataStreamName = randomAlphaOfLength(5); + IndexMetadata[] backingIndices = new IndexMetadata[numBackingIndices]; + Metadata.Builder mb = Metadata.builder(); + for (int k = 0; k < numBackingIndices; k++) { + backingIndices[k] = + IndexMetadata.builder(DataStream.getDefaultBackingIndexName(dataStreamName, k + 1, epochMillis)) + .settings(Settings.builder().put(IndexMetadata.SETTING_VERSION_CREATED, Version.CURRENT)) + .numberOfShards(1) + .numberOfReplicas(0) + .putMapping(generateMapping("@timestamp")) + .build(); + mb.put(backingIndices[k], false); + } + + mb.put(new DataStream( + dataStreamName, + createTimestampField("@timestamp"), + Arrays.stream(backingIndices).map(IndexMetadata::getIndex).collect(Collectors.toList()) + ) + ); + + final String missingIndex = randomAlphaOfLength(5); + ClusterState originalState = ClusterState.builder(new ClusterName("dummy")).metadata(mb.build()).build(); + IllegalArgumentException e = expectThrows( + IllegalArgumentException.class, + () -> MetadataDataStreamsService.modifyDataStream( + originalState, + List.of(DataStreamAction.addBackingIndex(dataStreamName, missingIndex)), + this::getMapperService + ) + ); + + assertThat(e.getMessage(), equalTo("index [" + missingIndex + "] not found")); + } + + private MapperService getMapperService(IndexMetadata im) { + try { + String mapping = im.mapping().source().toString(); + return createMapperService(mapping); + } catch (IOException e) { + throw new IllegalStateException(e); + } + } + + @Override + protected Collection getPlugins() { + return List.of(new MetadataIndexTemplateServiceTests.DummyPlugin()); + } +} diff --git a/server/src/test/java/org/elasticsearch/cluster/metadata/MetadataMigrateToDataStreamServiceTests.java b/server/src/test/java/org/elasticsearch/cluster/metadata/MetadataMigrateToDataStreamServiceTests.java index 7af8a89b442b4..6fb1be62bb63c 100644 --- a/server/src/test/java/org/elasticsearch/cluster/metadata/MetadataMigrateToDataStreamServiceTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/metadata/MetadataMigrateToDataStreamServiceTests.java @@ -14,7 +14,6 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.util.concurrent.ThreadContext; import org.elasticsearch.index.mapper.MapperService; import org.elasticsearch.index.mapper.MapperServiceTestCase; import org.elasticsearch.indices.EmptySystemIndices; @@ -212,7 +211,6 @@ public void testCreateDataStreamWithSuppliedWriteIndex() throws Exception { new MetadataMigrateToDataStreamService.MigrateToDataStreamClusterStateUpdateRequest(dataStreamName, TimeValue.ZERO, TimeValue.ZERO), - new ThreadContext(Settings.EMPTY), getMetadataCreateIndexService() ); IndexAbstraction ds = newState.metadata().getIndicesLookup().get(dataStreamName); @@ -257,7 +255,6 @@ public void testCreateDataStreamHidesBackingIndicesAndRemovesAlias() throws Exce new MetadataMigrateToDataStreamService.MigrateToDataStreamClusterStateUpdateRequest(dataStreamName, TimeValue.ZERO, TimeValue.ZERO), - new ThreadContext(Settings.EMPTY), getMetadataCreateIndexService() ); IndexAbstraction ds = newState.metadata().getIndicesLookup().get(dataStreamName); @@ -309,7 +306,6 @@ public void testCreateDataStreamWithoutSuppliedWriteIndex() throws Exception { new MetadataMigrateToDataStreamService.MigrateToDataStreamClusterStateUpdateRequest(dataStreamName, TimeValue.ZERO, TimeValue.ZERO), - new ThreadContext(Settings.EMPTY), getMetadataCreateIndexService())); assertThat(e.getMessage(), containsString("alias [" + dataStreamName + "] must specify a write index")); } diff --git a/test/framework/src/main/java/org/elasticsearch/cluster/metadata/DataStreamTestHelper.java b/test/framework/src/main/java/org/elasticsearch/cluster/metadata/DataStreamTestHelper.java index fcca76dc7d57a..8da51346a7f19 100644 --- a/test/framework/src/main/java/org/elasticsearch/cluster/metadata/DataStreamTestHelper.java +++ b/test/framework/src/main/java/org/elasticsearch/cluster/metadata/DataStreamTestHelper.java @@ -95,13 +95,15 @@ public static DataStream.TimestampField createTimestampField(String fieldName) { } public static String generateMapping(String timestampFieldName) { - return "{\n" + - " \"properties\": {\n" + - " \"" + timestampFieldName + "\": {\n" + - " \"type\": \"date\"\n" + - " }\n" + + return "{" + + " \"_doc\":{\n" + + " \"properties\": {\n" + + " \"" + timestampFieldName + "\": {\n" + + " \"type\": \"date\"\n" + + " }\n" + " }\n" + - " }"; + " }" + + "}"; } public static String generateMapping(String timestampFieldName, String type) { From 6089669d8725b1eac1a526bc3d925af74d458a2f Mon Sep 17 00:00:00 2001 From: Armin Braun Date: Mon, 4 Oct 2021 15:23:28 +0200 Subject: [PATCH 123/250] Speed up Routing Nodes Priority Comparator (#78609) This one shows up very hot if sorting a long list of shards because of the cost of looking up the settings over and over. --- .../cluster/metadata/IndexMetadata.java | 28 +++++++++++++------ .../cluster/routing/RoutingNodes.java | 4 --- .../gateway/PriorityComparator.java | 25 +++++------------ 3 files changed, 27 insertions(+), 30 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/IndexMetadata.java b/server/src/main/java/org/elasticsearch/cluster/metadata/IndexMetadata.java index b06a0a7c27841..d4f3b919a2b22 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/IndexMetadata.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/IndexMetadata.java @@ -392,6 +392,10 @@ public static APIBlock readFrom(StreamInput input) throws IOException { private final IndexLongFieldRange timestampRange; + private final int priority; + + private final long creationDate; + private IndexMetadata( final Index index, final long version, @@ -417,7 +421,9 @@ private IndexMetadata( final ActiveShardCount waitForActiveShards, final ImmutableOpenMap rolloverInfos, final boolean isSystem, - final IndexLongFieldRange timestampRange) { + final IndexLongFieldRange timestampRange, + final int priority, + final long creationDate) { this.index = index; this.version = version; @@ -450,6 +456,8 @@ private IndexMetadata( this.rolloverInfos = rolloverInfos; this.isSystem = isSystem; this.timestampRange = timestampRange; + this.priority = priority; + this.creationDate = creationDate; assert numberOfShards * routingFactor == routingNumShards : routingNumShards + " must be a multiple of " + numberOfShards; } @@ -509,7 +517,7 @@ public Version getCreationVersion() { } public long getCreationDate() { - return settings.getAsLong(SETTING_CREATION_DATE, -1L); + return creationDate; } public State getState() { @@ -930,6 +938,10 @@ public boolean isSystem() { return isSystem; } + public int priority() { + return priority; + } + public static Builder builder(String index) { return new Builder(index); } @@ -1206,9 +1218,6 @@ public IndexLongFieldRange getTimestampRange() { } public IndexMetadata build() { - ImmutableOpenMap.Builder tmpAliases = aliases; - Settings tmpSettings = settings; - /* * We expect that the metadata has been properly built to set the number of shards and the number of replicas, and do not rely * on the default values here. Those must have been set upstream. @@ -1294,9 +1303,9 @@ public IndexMetadata build() { state, numberOfShards, numberOfReplicas, - tmpSettings, + settings, mappings.build(), - tmpAliases.build(), + aliases.build(), customMetadata.build(), filledInSyncAllocationIds.build(), requireFilters, @@ -1309,7 +1318,10 @@ public IndexMetadata build() { waitForActiveShards, rolloverInfos.build(), isSystem, - timestampRange); + timestampRange, + IndexMetadata.INDEX_PRIORITY_SETTING.get(settings), + settings.getAsLong(SETTING_CREATION_DATE, -1L) + ); } @SuppressWarnings("unchecked") diff --git a/server/src/main/java/org/elasticsearch/cluster/routing/RoutingNodes.java b/server/src/main/java/org/elasticsearch/cluster/routing/RoutingNodes.java index eb8d296365bd9..56b405aea8c8e 100644 --- a/server/src/main/java/org/elasticsearch/cluster/routing/RoutingNodes.java +++ b/server/src/main/java/org/elasticsearch/cluster/routing/RoutingNodes.java @@ -16,7 +16,6 @@ import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.cluster.metadata.Metadata; -import org.elasticsearch.cluster.metadata.SingleNodeShutdownMetadata; import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.routing.UnassignedInfo.AllocationStatus; import org.elasticsearch.cluster.routing.allocation.ExistingShardsAllocator; @@ -67,8 +66,6 @@ public class RoutingNodes implements Iterable { private final Map> assignedShards = new HashMap<>(); - private final Map nodeShutdowns; - private final boolean readOnly; private int inactivePrimaryCount = 0; @@ -87,7 +84,6 @@ public RoutingNodes(ClusterState clusterState) { public RoutingNodes(ClusterState clusterState, boolean readOnly) { this.readOnly = readOnly; final RoutingTable routingTable = clusterState.routingTable(); - nodeShutdowns = clusterState.metadata().nodeShutdowns(); Map> nodesToShards = new HashMap<>(); // fill in the nodeToShards with the "live" nodes diff --git a/server/src/main/java/org/elasticsearch/gateway/PriorityComparator.java b/server/src/main/java/org/elasticsearch/gateway/PriorityComparator.java index dd6ddb9cff86f..864bc118c00b8 100644 --- a/server/src/main/java/org/elasticsearch/gateway/PriorityComparator.java +++ b/server/src/main/java/org/elasticsearch/gateway/PriorityComparator.java @@ -11,7 +11,6 @@ import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.cluster.routing.ShardRouting; import org.elasticsearch.cluster.routing.allocation.RoutingAllocation; -import org.elasticsearch.common.settings.Settings; import org.elasticsearch.index.Index; import java.util.Comparator; @@ -32,23 +31,21 @@ public abstract class PriorityComparator implements Comparator { @Override public final int compare(ShardRouting o1, ShardRouting o2) { - final String o1Index = o1.getIndexName(); - final String o2Index = o2.getIndexName(); + final Index o1Index = o1.index(); + final Index o2Index = o2.index(); int cmp = 0; if (o1Index.equals(o2Index) == false) { - final IndexMetadata metadata01 = getMetadata(o1.index()); - final IndexMetadata metadata02 = getMetadata(o2.index()); + final IndexMetadata metadata01 = getMetadata(o1Index); + final IndexMetadata metadata02 = getMetadata(o2Index); cmp = Boolean.compare(metadata02.isSystem(), metadata01.isSystem()); if (cmp == 0) { - final Settings settingsO1 = metadata01.getSettings(); - final Settings settingsO2 = metadata02.getSettings(); - cmp = Long.compare(priority(settingsO2), priority(settingsO1)); + cmp = Long.compare(metadata02.priority(), metadata01.priority()); if (cmp == 0) { - cmp = Long.compare(timeCreated(settingsO2), timeCreated(settingsO1)); + cmp = Long.compare(metadata02.getCreationDate(), metadata01.getCreationDate()); if (cmp == 0) { - cmp = o2Index.compareTo(o1Index); + cmp = o2Index.getName().compareTo(o1Index.getName()); } } } @@ -56,14 +53,6 @@ public final int compare(ShardRouting o1, ShardRouting o2) { return cmp; } - private static int priority(Settings settings) { - return IndexMetadata.INDEX_PRIORITY_SETTING.get(settings); - } - - private static long timeCreated(Settings settings) { - return settings.getAsLong(IndexMetadata.SETTING_CREATION_DATE, -1L); - } - protected abstract IndexMetadata getMetadata(Index index); /** From e0cb0beb73dac1d2d10524c7c1f52e861de99c0b Mon Sep 17 00:00:00 2001 From: Stef Nestor Date: Mon, 4 Oct 2021 07:41:17 -0600 Subject: [PATCH 124/250] [DOCS] Fix SLM status response (#78584) The get SLM status API will only return one of three statuses: `RUNNING`, `STOPPING`, or `STOPPED`. This corrects the docs to remove the `STARTED` status and document the `RUNNING` status. Co-authored-by: James Rodewig <40268737+jrodewig@users.noreply.github.com> --- docs/reference/slm/apis/slm-get-status.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference/slm/apis/slm-get-status.asciidoc b/docs/reference/slm/apis/slm-get-status.asciidoc index 42a269d27cb28..920733e7fb67e 100644 --- a/docs/reference/slm/apis/slm-get-status.asciidoc +++ b/docs/reference/slm/apis/slm-get-status.asciidoc @@ -20,7 +20,7 @@ Retrieves the status of {slm} ({slm-init}). Returns the status of the {slm-init} plugin. The `operation_mode` field in the response shows one of three states: -`STARTED`, `STOPPING`, or `STOPPED`. +`RUNNING`, `STOPPING`, or `STOPPED`. You halt and restart the {slm-init} plugin with the <> and <> APIs. From abdffdaf404ee1bee5c90341bd86b716fd9cdd15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20Zolt=C3=A1n=20Szab=C3=B3?= Date: Mon, 4 Oct 2021 16:25:47 +0200 Subject: [PATCH 125/250] [DOCS] Redirects link in client integration docs. (#78613) --- x-pack/docs/en/security/ccs-clients-integrations/http.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/docs/en/security/ccs-clients-integrations/http.asciidoc b/x-pack/docs/en/security/ccs-clients-integrations/http.asciidoc index 1fbc89227fc17..e75753a6dc035 100644 --- a/x-pack/docs/en/security/ccs-clients-integrations/http.asciidoc +++ b/x-pack/docs/en/security/ccs-clients-integrations/http.asciidoc @@ -83,7 +83,7 @@ es-secondary-authorization: ApiKey <1> For more information about using {security-features} with the language specific clients, refer to: -* {java-rest}/_basic_authentication.html[Java] +* {java-api-client}/_basic_authentication.html[Java] * {jsclient-current}/auth-reference.html[JavaScript] * https://www.elastic.co/guide/en/elasticsearch/client/net-api/master/configuration-options.html[.NET] * https://metacpan.org/pod/Search::Elasticsearch::Cxn::HTTPTiny#CONFIGURATION[Perl] From 9aef3315b2e2d5e9de25e4b98f528eb01befd84c Mon Sep 17 00:00:00 2001 From: David Turner Date: Mon, 4 Oct 2021 15:27:21 +0100 Subject: [PATCH 126/250] Cache index.hidden setting (#78612) We look up the value for `index.hidden` for every index every time we build a new `Metadata`, which involves map lookups and string parsing and so on and takes nontrivial time. This commit moves the value to a field so the lookups are only needed if the index metadata changes. Closes #77974 --- .../cluster/metadata/IndexMetadata.java | 9 ++++++++ .../cluster/metadata/Metadata.java | 2 +- .../snapshots/RestoreService.java | 2 +- .../cluster/metadata/IndexMetadataTests.java | 22 +++++++++++++++++++ 4 files changed, 33 insertions(+), 2 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/IndexMetadata.java b/server/src/main/java/org/elasticsearch/cluster/metadata/IndexMetadata.java index d4f3b919a2b22..3daef056f551f 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/IndexMetadata.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/IndexMetadata.java @@ -389,6 +389,7 @@ public static APIBlock readFrom(StreamInput input) throws IOException { private final ActiveShardCount waitForActiveShards; private final ImmutableOpenMap rolloverInfos; private final boolean isSystem; + private final boolean isHidden; private final IndexLongFieldRange timestampRange; @@ -421,6 +422,7 @@ private IndexMetadata( final ActiveShardCount waitForActiveShards, final ImmutableOpenMap rolloverInfos, final boolean isSystem, + final boolean isHidden, final IndexLongFieldRange timestampRange, final int priority, final long creationDate) { @@ -455,6 +457,8 @@ private IndexMetadata( this.waitForActiveShards = waitForActiveShards; this.rolloverInfos = rolloverInfos; this.isSystem = isSystem; + assert isHidden == INDEX_HIDDEN_SETTING.get(settings); + this.isHidden = isHidden; this.timestampRange = timestampRange; this.priority = priority; this.creationDate = creationDate; @@ -938,6 +942,10 @@ public boolean isSystem() { return isSystem; } + public boolean isHidden() { + return isHidden; + } + public int priority() { return priority; } @@ -1318,6 +1326,7 @@ public IndexMetadata build() { waitForActiveShards, rolloverInfos.build(), isSystem, + INDEX_HIDDEN_SETTING.get(settings), timestampRange, IndexMetadata.INDEX_PRIORITY_SETTING.get(settings), settings.getAsLong(SETTING_CREATION_DATE, -1L) diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/Metadata.java b/server/src/main/java/org/elasticsearch/cluster/metadata/Metadata.java index 30c3442d8c0c9..cce12421ee6e0 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/Metadata.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/Metadata.java @@ -1450,7 +1450,7 @@ public Metadata build() { final String name = indexMetadata.getIndex().getName(); boolean added = allIndices.add(name); assert added : "double index named [" + name + "]"; - final boolean visible = IndexMetadata.INDEX_HIDDEN_SETTING.get(indexMetadata.getSettings()) == false; + final boolean visible = indexMetadata.isHidden() == false; if (visible) { visibleIndices.add(name); } diff --git a/server/src/main/java/org/elasticsearch/snapshots/RestoreService.java b/server/src/main/java/org/elasticsearch/snapshots/RestoreService.java index be817c71885ed..f8514a50bdd74 100644 --- a/server/src/main/java/org/elasticsearch/snapshots/RestoreService.java +++ b/server/src/main/java/org/elasticsearch/snapshots/RestoreService.java @@ -1545,7 +1545,7 @@ private static IndexMetadata.Builder restoreOverClosedIndex(IndexMetadata snapsh } private void ensureValidIndexName(ClusterState currentState, IndexMetadata snapshotIndexMetadata, String renamedIndexName) { - final boolean isHidden = IndexMetadata.INDEX_HIDDEN_SETTING.get(snapshotIndexMetadata.getSettings()); + final boolean isHidden = snapshotIndexMetadata.isHidden(); createIndexService.validateIndexName(renamedIndexName, currentState); createIndexService.validateDotIndex(renamedIndexName, isHidden); createIndexService.validateIndexSettings(renamedIndexName, snapshotIndexMetadata.getSettings(), false); diff --git a/server/src/test/java/org/elasticsearch/cluster/metadata/IndexMetadataTests.java b/server/src/test/java/org/elasticsearch/cluster/metadata/IndexMetadataTests.java index 727b43e4cbdce..10c679224b875 100644 --- a/server/src/test/java/org/elasticsearch/cluster/metadata/IndexMetadataTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/metadata/IndexMetadataTests.java @@ -8,6 +8,7 @@ package org.elasticsearch.cluster.metadata; +import org.elasticsearch.Version; import org.elasticsearch.action.admin.indices.rollover.MaxAgeCondition; import org.elasticsearch.action.admin.indices.rollover.MaxDocsCondition; import org.elasticsearch.action.admin.indices.rollover.MaxPrimaryShardSizeCondition; @@ -40,6 +41,7 @@ import java.util.Map; import java.util.Set; +import static org.elasticsearch.cluster.metadata.IndexMetadata.INDEX_HIDDEN_SETTING; import static org.elasticsearch.cluster.metadata.IndexMetadata.parseIndexNameCounter; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; @@ -366,4 +368,24 @@ public void testParseIndexNameCannotFormatNumber() { } } + public void testIsHidden() { + Settings.Builder settings = Settings.builder() + .put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, randomIntBetween(1, 8)) + .put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0) + .put(IndexMetadata.SETTING_VERSION_CREATED, Version.CURRENT); + IndexMetadata indexMetadata = IndexMetadata.builder("test").settings(settings).build(); + assertFalse(indexMetadata.isHidden()); + + settings.put(INDEX_HIDDEN_SETTING.getKey(), "false"); + indexMetadata = IndexMetadata.builder(indexMetadata).settings(settings).build(); + assertFalse(indexMetadata.isHidden()); + + settings.put(INDEX_HIDDEN_SETTING.getKey(), "true"); + indexMetadata = IndexMetadata.builder(indexMetadata).settings(settings).build(); + assertTrue(indexMetadata.isHidden()); + + indexMetadata = IndexMetadata.builder(indexMetadata).build(); + assertTrue(indexMetadata.isHidden()); // preserved if settings unchanged + } + } From 5de59aa98809e63314e98a35969cf5e98cdc0e59 Mon Sep 17 00:00:00 2001 From: Nik Everett Date: Mon, 4 Oct 2021 10:56:23 -0400 Subject: [PATCH 127/250] TSDB: Add feature flag to more builds (#78619) When we run the build in non-snapshot mode we don't enable feature flags by default. This would cause the tests for tsdb to fail. So we enable the tsdb feature flag in every build that needs it. There were a few builds that needed it that didn't have it. This adds it to those builds. Closes #78443 Closes #78598 --- qa/multi-cluster-search/build.gradle | 7 +++++++ qa/rolling-upgrade/build.gradle | 6 ++++++ x-pack/plugin/build.gradle | 4 ++++ x-pack/plugin/ccr/qa/multi-cluster/build.gradle | 8 ++++++++ .../resources/rest-api-spec/test/analytics/histogram.yml | 4 ++-- 5 files changed, 27 insertions(+), 2 deletions(-) diff --git a/qa/multi-cluster-search/build.gradle b/qa/multi-cluster-search/build.gradle index 622c01bef74d3..818cd917c594a 100644 --- a/qa/multi-cluster-search/build.gradle +++ b/qa/multi-cluster-search/build.gradle @@ -6,6 +6,7 @@ * Side Public License, v 1. */ +import org.elasticsearch.gradle.internal.info.BuildParams import org.elasticsearch.gradle.internal.test.RestIntegTestTask apply plugin: 'elasticsearch.internal-testclusters' @@ -24,6 +25,12 @@ tasks.register('remote-cluster', RestIntegTestTask) { systemProperty 'tests.rest.suite', 'remote_cluster' } +testClusters.configureEach { + if (BuildParams.isSnapshotBuild() == false) { + systemProperty 'es.index_mode_feature_flag_registered', 'true' + } +} + testClusters.matching{ it.name == 'remote-cluster' }.configureEach { numberOfNodes = 2 setting 'node.roles', '[data,ingest,master]' diff --git a/qa/rolling-upgrade/build.gradle b/qa/rolling-upgrade/build.gradle index 9fd784bcec74b..bd32819ffa8a6 100644 --- a/qa/rolling-upgrade/build.gradle +++ b/qa/rolling-upgrade/build.gradle @@ -99,3 +99,9 @@ for (Version bwcVersion : BuildParams.bwcVersions.wireCompatible) { dependsOn tasks.named("${baseName}#upgradedClusterTest") } } + +testClusters.configureEach { + if (BuildParams.isSnapshotBuild() == false) { + systemProperty 'es.index_mode_feature_flag_registered', 'true' + } +} diff --git a/x-pack/plugin/build.gradle b/x-pack/plugin/build.gradle index 14cfadc6aa6e4..9de02eb58edba 100644 --- a/x-pack/plugin/build.gradle +++ b/x-pack/plugin/build.gradle @@ -218,6 +218,10 @@ testClusters.configureEach { extraConfigFile nodeKey.name, nodeKey extraConfigFile nodeCert.name, nodeCert extraConfigFile serviceTokens.name, serviceTokens + + if (BuildParams.isSnapshotBuild() == false) { + systemProperty 'es.index_mode_feature_flag_registered', 'true' + } } tasks.register('enforceApiSpecsConvention').configure { diff --git a/x-pack/plugin/ccr/qa/multi-cluster/build.gradle b/x-pack/plugin/ccr/qa/multi-cluster/build.gradle index 835e66386ec14..bc0e0d80edc7e 100644 --- a/x-pack/plugin/ccr/qa/multi-cluster/build.gradle +++ b/x-pack/plugin/ccr/qa/multi-cluster/build.gradle @@ -1,3 +1,4 @@ +import org.elasticsearch.gradle.internal.info.BuildParams import org.elasticsearch.gradle.internal.test.RestIntegTestTask apply plugin: 'elasticsearch.internal-testclusters' @@ -63,4 +64,11 @@ testClusters.matching {it.name == "follow-cluster" }.configureEach { { "\"${middleCluster.get().getAllTransportPortURI().join(",")}\"" } } + +testClusters.configureEach { + if (BuildParams.isSnapshotBuild() == false) { + systemProperty 'es.index_mode_feature_flag_registered', 'true' + } +} + tasks.named("check").configure { dependsOn "follow-cluster" } diff --git a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/analytics/histogram.yml b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/analytics/histogram.yml index 87c40a1ad771a..d9a4eb706075c 100644 --- a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/analytics/histogram.yml +++ b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/analytics/histogram.yml @@ -175,8 +175,8 @@ setup: --- histogram with time series mappings: - skip: - version: "all" - reason: "AwaitsFix https://github.com/elastic/elasticsearch/issues/78443" + version: " - 7.99.99" + reason: time series mode added in 8.0.0 - do: From 7a7fffcb5a852561a473a022861ce5faec2725ee Mon Sep 17 00:00:00 2001 From: Benjamin Trent Date: Mon, 4 Oct 2021 11:49:16 -0400 Subject: [PATCH 128/250] [ML] Text/Log categorization multi-bucket aggregation (#71752) This commit adds a new multi-bucket aggregation: `categorize_text` The aggregation follows a similar design to significant text in that it reads from `_source` and re-analyzes the the text as it is read. Key difference is that it does not use the indexed field's analyzer, but instead relies on the `ml_standard` tokenizer with specialized ML token filters. The tokenizer + filters are the same that machine learning categorization anomaly jobs utilize. The high level logical flow is as follows: - at each shard, read in the text field with a custom analyzer using `ml_standard` tokenizer - Read in the particular tokens from the analyzer - Feed these tokens to a token tree algorithm (an adaptation of the drain categorization algorithm) - Gather the individual log categories (the leaf nodes), sort them by doc_count, ship those buckets to be merged - Merge all buckets that have the EXACT same key - Once all buckets are merged, pass those keys + counts to a new token tree for additional merging - That tree builds the final buckets and that is returned to the user Algorithm explanation: - Each log is parsed with the ml-standard tokenizer - each token is passed into a token tree - For `max_match_token` each token is stored in the tree and at `max_match_token+1` (or `len(tokens)`) a log group is created - If another log group exists at that leaf, merge it if they have `similarity_threshold` percentage of tokens in common - merging simply replaces tokens that are different in the group with `*` - If a layer in the tree has `max_unique_tokens` we add a `*` child and any new tokens are passed through there. Catch here is that on the final merge, we first attempt to merge together subtrees with the smallest number of documents. Especially if the new sub tree has more documents counted. ## Aggregation configuration. Here is an example on some openstack logs ```js POST openstack/_search?size=0 { "aggs": { "categories": { "categorize_text": { "field": "message", // The field to categorize "similarity_threshold": 20, // merge log groups if they are this similar "max_unique_tokens": 20, // Max Number of children per token position "max_match_token": 4, // Maximum tokens to build prefix trees "size": 1 } } } } ``` This will return buckets like ```json "aggregations" : { "categories" : { "buckets" : [ { "doc_count" : 806, "key" : "nova-api.log.1.2017-05-16_13 INFO nova.osapi_compute.wsgi.server * HTTP/1.1 status len time" } ] } } ``` --- .../AggConstructionContentionBenchmark.java | 17 + docs/build.gradle | 33 ++ docs/reference/aggregations/bucket.asciidoc | 2 + .../categorize-text-aggregation.asciidoc | 469 ++++++++++++++++++ .../elasticsearch/search/SearchService.java | 1 + .../ParsedMultiBucketAggregation.java | 2 +- .../support/AggregationContext.java | 45 ++ .../index/mapper/MapperServiceTestCase.java | 17 + .../aggregations/AggregatorTestCase.java | 17 + .../test/AbstractBuilderTestCase.java | 14 +- .../core/ml/job/config/AnalysisConfig.java | 2 +- .../config/CategorizationAnalyzerConfig.java | 6 +- .../ml/qa/ml-with-security/build.gradle | 3 + .../CategorizationAggregationIT.java | 160 ++++++ .../xpack/ml/MachineLearning.java | 15 + .../CategorizationBytesRefHash.java | 83 ++++ .../CategorizationTokenTree.java | 143 ++++++ .../CategorizeTextAggregationBuilder.java | 349 +++++++++++++ .../CategorizeTextAggregator.java | 239 +++++++++ .../CategorizeTextAggregatorFactory.java | 112 +++++ .../InternalCategorizationAggregation.java | 453 +++++++++++++++++ .../categorization/TextCategorization.java | 117 +++++ .../ml/aggs/categorization/TreeNode.java | 406 +++++++++++++++ .../UnmappedCategorizationAggregation.java | 71 +++ .../CategorizationAnalyzer.java | 14 +- .../xpack/ml/LocalStateMachineLearning.java | 18 + ...CategorizeTextAggregationBuilderTests.java | 60 +++ .../CategorizeTextAggregatorTests.java | 342 +++++++++++++ .../categorization/InnerTreeNodeTests.java | 123 +++++ ...nternalCategorizationAggregationTests.java | 117 +++++ .../categorization/LeafTreeNodeTests.java | 88 ++++ .../categorization/ParsedCategorization.java | 113 +++++ .../TextCategorizationTests.java | 75 +++ .../test/ml/categorization_agg.yml | 153 ++++++ 34 files changed, 3871 insertions(+), 8 deletions(-) create mode 100644 docs/reference/aggregations/bucket/categorize-text-aggregation.asciidoc create mode 100644 x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/CategorizationAggregationIT.java create mode 100644 x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/categorization/CategorizationBytesRefHash.java create mode 100644 x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/categorization/CategorizationTokenTree.java create mode 100644 x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/categorization/CategorizeTextAggregationBuilder.java create mode 100644 x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/categorization/CategorizeTextAggregator.java create mode 100644 x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/categorization/CategorizeTextAggregatorFactory.java create mode 100644 x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/categorization/InternalCategorizationAggregation.java create mode 100644 x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/categorization/TextCategorization.java create mode 100644 x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/categorization/TreeNode.java create mode 100644 x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/categorization/UnmappedCategorizationAggregation.java create mode 100644 x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/categorization/CategorizeTextAggregationBuilderTests.java create mode 100644 x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/categorization/CategorizeTextAggregatorTests.java create mode 100644 x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/categorization/InnerTreeNodeTests.java create mode 100644 x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/categorization/InternalCategorizationAggregationTests.java create mode 100644 x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/categorization/LeafTreeNodeTests.java create mode 100644 x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/categorization/ParsedCategorization.java create mode 100644 x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/categorization/TextCategorizationTests.java create mode 100644 x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/ml/categorization_agg.yml diff --git a/benchmarks/src/main/java/org/elasticsearch/benchmark/search/aggregations/AggConstructionContentionBenchmark.java b/benchmarks/src/main/java/org/elasticsearch/benchmark/search/aggregations/AggConstructionContentionBenchmark.java index f496608e1c273..43a2d1930d0e8 100644 --- a/benchmarks/src/main/java/org/elasticsearch/benchmark/search/aggregations/AggConstructionContentionBenchmark.java +++ b/benchmarks/src/main/java/org/elasticsearch/benchmark/search/aggregations/AggConstructionContentionBenchmark.java @@ -22,6 +22,7 @@ import org.elasticsearch.core.Releasables; import org.elasticsearch.index.Index; import org.elasticsearch.index.IndexSettings; +import org.elasticsearch.index.analysis.NameOrDefinition; import org.elasticsearch.index.analysis.NamedAnalyzer; import org.elasticsearch.index.cache.bitset.BitsetFilterCache; import org.elasticsearch.index.fielddata.IndexFieldData; @@ -197,6 +198,22 @@ public long nowInMillis() { return 0; } + @Override + public Analyzer getNamedAnalyzer(String analyzer) { + return null; + } + + @Override + public Analyzer buildCustomAnalyzer( + IndexSettings indexSettings, + boolean normalizer, + NameOrDefinition tokenizer, + List charFilters, + List tokenFilters + ) { + return null; + } + @Override protected IndexFieldData buildFieldData(MappedFieldType ft) { IndexFieldDataCache indexFieldDataCache = indicesFieldDataCache.buildIndexFieldDataCache(new IndexFieldDataCache.Listener() { diff --git a/docs/build.gradle b/docs/build.gradle index f84bc91cf7489..5ecaf7dc6faff 100644 --- a/docs/build.gradle +++ b/docs/build.gradle @@ -1071,6 +1071,39 @@ buildRestTests.setups['farequote_datafeed'] = buildRestTests.setups['farequote_j "indexes":"farequote" } ''' +buildRestTests.setups['categorize_text'] = ''' + - do: + indices.create: + index: log-messages + body: + settings: + number_of_shards: 1 + number_of_replicas: 0 + mappings: + properties: + time: + type: date + message: + type: text + + - do: + bulk: + index: log-messages + refresh: true + body: | + {"index": {"_id":"1"}} + {"time":"2016-02-07T00:01:00+0000", "message": "2016-02-07T00:00:00+0000 Node 3 shutting down"} + {"index": {"_id":"2"}} + {"time":"2016-02-07T00:02:00+0000", "message": "2016-02-07T00:00:00+0000 Node 5 starting up"} + {"index": {"_id":"3"}} + {"time":"2016-02-07T00:03:00+0000", "message": "2016-02-07T00:00:00+0000 Node 4 shutting down"} + {"index": {"_id":"4"}} + {"time":"2016-02-08T00:01:00+0000", "message": "2016-02-08T00:00:00+0000 Node 5 shutting down"} + {"index": {"_id":"5"}} + {"time":"2016-02-08T00:02:00+0000", "message": "2016-02-08T00:00:00+0000 User foo_325 logging on"} + {"index": {"_id":"6"}} + {"time":"2016-02-08T00:04:00+0000", "message": "2016-02-08T00:00:00+0000 User foo_864 logged off"} +''' buildRestTests.setups['server_metrics_index'] = ''' - do: indices.create: diff --git a/docs/reference/aggregations/bucket.asciidoc b/docs/reference/aggregations/bucket.asciidoc index 302e196caf3ce..dfdaca18e6cfb 100644 --- a/docs/reference/aggregations/bucket.asciidoc +++ b/docs/reference/aggregations/bucket.asciidoc @@ -20,6 +20,8 @@ include::bucket/adjacency-matrix-aggregation.asciidoc[] include::bucket/autodatehistogram-aggregation.asciidoc[] +include::bucket/categorize-text-aggregation.asciidoc[] + include::bucket/children-aggregation.asciidoc[] include::bucket/composite-aggregation.asciidoc[] diff --git a/docs/reference/aggregations/bucket/categorize-text-aggregation.asciidoc b/docs/reference/aggregations/bucket/categorize-text-aggregation.asciidoc new file mode 100644 index 0000000000000..cc0a0e787f844 --- /dev/null +++ b/docs/reference/aggregations/bucket/categorize-text-aggregation.asciidoc @@ -0,0 +1,469 @@ +[[search-aggregations-bucket-categorize-text-aggregation]] +=== Categorize text aggregation +++++ +Categorize text +++++ + +experimental::[] + +A multi-bucket aggregation that groups semi-structured text into buckets. Each `text` field is re-analyzed +using a custom analyzer. The resulting tokens are then categorized creating buckets of similarly formatted +text values. This aggregation works best with machine generated text like system logs. + +NOTE: If you have considerable memory allocated to your JVM but are receiving circuit breaker exceptions from this + aggregation, you may be attempting to categorize text that is poorly formatted for categorization. Consider + adding `categorization_filters` or running under <> or + <> to explore the created categories. + +[[bucket-categorize-text-agg-syntax]] +==== Parameters + +`field`:: +(Required, string) +The semi-structured text field to categorize. + +`max_unique_tokens`:: +(Optional, integer, default: `50`) +The maximum number of unique tokens at any position up to `max_matched_tokens`. +Must be larger than 1. Smaller values use less memory and create fewer categories. +Larger values will use more memory and create narrower categories. + +`max_matched_tokens`:: +(Optional, integer, default: `5`) +The maximum number of token positions to match on before attempting to merge categories. +Larger values will use more memory and create narrower categories. + +Example: +`max_matched_tokens` of 2 would disallow merging of the categories +[`foo` `bar` `baz`] +[`foo` `baz` `bozo`] +As the first 2 tokens are required to match for the category. + +NOTE: Once `max_unique_tokens` is reached at a given position, a new `*` token is +added and all new tokens at that position are matched by the `*` token. + +`similarity_threshold`:: +(Optional, integer, default: `50`) +The minimum percentage of tokens that must match for text to be added to the +category bucket. +Must be between 1 and 100. The larger the value the narrower the categories. +Larger values will increase memory usage and create narrower categories. + +`categorization_filters`:: +(Optional, array of strings) +This property expects an array of regular expressions. The expressions +are used to filter out matching sequences from the categorization field values. +You can use this functionality to fine tune the categorization by excluding +sequences from consideration when categories are defined. For example, you can +exclude SQL statements that appear in your log files. This +property cannot be used at the same time as `categorization_analyzer`. If you +only want to define simple regular expression filters that are applied prior to +tokenization, setting this property is the easiest method. If you also want to +customize the tokenizer or post-tokenization filtering, use the +`categorization_analyzer` property instead and include the filters as +`pattern_replace` character filters. + +`categorization_analyzer`:: +(Optional, object or string) +The categorization analyzer specifies how the text is analyzed and tokenized before +being categorized. The syntax is very similar to that used to define the `analyzer` in the +<>. This +property cannot be used at the same time as `categorization_filters`. ++ +The `categorization_analyzer` field can be specified either as a string or as an +object. If it is a string it must refer to a +<> or one added by another plugin. If it +is an object it has the following properties: ++ +.Properties of `categorization_analyzer` +[%collapsible%open] +===== +`char_filter`:::: +(array of strings or objects) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=char-filter] + +`tokenizer`:::: +(string or object) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=tokenizer] + +`filter`:::: +(array of strings or objects) +include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=filter] +===== +end::categorization-analyzer[] + +`shard_size`:: +(Optional, integer) +The number of categorization buckets to return from each shard before merging +all the results. + +`size`:: +(Optional, integer, default: `10`) +The number of buckets to return. + +`min_doc_count`:: +(Optional, integer) +The minimum number of documents for a bucket to be returned to the results. + +`shard_min_doc_count`:: +(Optional, integer) +The minimum number of documents for a bucket to be returned from the shard before +merging. + +==== Basic use + + +WARNING: Re-analyzing _large_ result sets will require a lot of time and memory. This aggregation should be + used in conjunction with <>. Additionally, you may consider + using the aggregation as a child of either the <> or + <> aggregation. + This will typically improve speed and memory use. + +Example: + +[source,console] +-------------------------------------------------- +POST log-messages/_search?filter_path=aggregations +{ + "aggs": { + "categories": { + "categorize_text": { + "field": "message" + } + } + } +} +-------------------------------------------------- +// TEST[setup:categorize_text] + +Response: + +[source,console-result] +-------------------------------------------------- +{ + "aggregations" : { + "categories" : { + "buckets" : [ + { + "doc_count" : 3, + "key" : "Node shutting down" + }, + { + "doc_count" : 1, + "key" : "Node starting up" + }, + { + "doc_count" : 1, + "key" : "User foo_325 logging on" + }, + { + "doc_count" : 1, + "key" : "User foo_864 logged off" + } + ] + } + } +} +-------------------------------------------------- + + +Here is an example using `categorization_filters` + +[source,console] +-------------------------------------------------- +POST log-messages/_search?filter_path=aggregations +{ + "aggs": { + "categories": { + "categorize_text": { + "field": "message", + "categorization_filters": ["\\w+\\_\\d{3}"] <1> + } + } + } +} +-------------------------------------------------- +// TEST[setup:categorize_text] + +<1> The filters to apply to the analyzed tokens. It filters + out tokens like `bar_123`. + +Note how the `foo_` tokens are not part of the +category results + +[source,console-result] +-------------------------------------------------- +{ + "aggregations" : { + "categories" : { + "buckets" : [ + { + "doc_count" : 3, + "key" : "Node shutting down" + }, + { + "doc_count" : 1, + "key" : "Node starting up" + }, + { + "doc_count" : 1, + "key" : "User logged off" + }, + { + "doc_count" : 1, + "key" : "User logging on" + } + ] + } + } +} +-------------------------------------------------- + +Here is an example using `categorization_filters`. +The default analyzer is a whitespace analyzer with a custom token filter +which filters out tokens that start with any number. +But, it may be that a token is a known highly-variable token (formatted usernames, emails, etc.). In that case, it is good to supply +custom `categorization_filters` to filter out those tokens for better categories. These filters will also reduce memory usage as fewer +tokens are held in memory for the categories. + +[source,console] +-------------------------------------------------- +POST log-messages/_search?filter_path=aggregations +{ + "aggs": { + "categories": { + "categorize_text": { + "field": "message", + "categorization_filters": ["\\w+\\_\\d{3}"], <1> + "max_matched_tokens": 2, <2> + "similarity_threshold": 30 <3> + } + } + } +} +-------------------------------------------------- +// TEST[setup:categorize_text] +<1> The filters to apply to the analyzed tokens. It filters +out tokens like `bar_123`. +<2> Require at least 2 tokens before the log categories attempt to merge together +<3> Require 30% of the tokens to match before expanding a log categories + to add a new log entry + +The resulting categories are now broad, matching the first token +and merging the log groups. + +[source,console-result] +-------------------------------------------------- +{ + "aggregations" : { + "categories" : { + "buckets" : [ + { + "doc_count" : 4, + "key" : "Node *" + }, + { + "doc_count" : 2, + "key" : "User *" + } + ] + } + } +} +-------------------------------------------------- + +This aggregation can have both sub-aggregations and itself be a sub-aggregation. This allows gathering the top daily categories and the +top sample doc as below. + +[source,console] +-------------------------------------------------- +POST log-messages/_search?filter_path=aggregations +{ + "aggs": { + "daily": { + "date_histogram": { + "field": "time", + "fixed_interval": "1d" + }, + "aggs": { + "categories": { + "categorize_text": { + "field": "message", + "categorization_filters": ["\\w+\\_\\d{3}"] + }, + "aggs": { + "hit": { + "top_hits": { + "size": 1, + "sort": ["time"], + "_source": "message" + } + } + } + } + } + } + } +} +-------------------------------------------------- +// TEST[setup:categorize_text] + +[source,console-result] +-------------------------------------------------- +{ + "aggregations" : { + "daily" : { + "buckets" : [ + { + "key_as_string" : "2016-02-07T00:00:00.000Z", + "key" : 1454803200000, + "doc_count" : 3, + "categories" : { + "buckets" : [ + { + "doc_count" : 2, + "key" : "Node shutting down", + "hit" : { + "hits" : { + "total" : { + "value" : 2, + "relation" : "eq" + }, + "max_score" : null, + "hits" : [ + { + "_index" : "log-messages", + "_id" : "1", + "_score" : null, + "_source" : { + "message" : "2016-02-07T00:00:00+0000 Node 3 shutting down" + }, + "sort" : [ + 1454803260000 + ] + } + ] + } + } + }, + { + "doc_count" : 1, + "key" : "Node starting up", + "hit" : { + "hits" : { + "total" : { + "value" : 1, + "relation" : "eq" + }, + "max_score" : null, + "hits" : [ + { + "_index" : "log-messages", + "_id" : "2", + "_score" : null, + "_source" : { + "message" : "2016-02-07T00:00:00+0000 Node 5 starting up" + }, + "sort" : [ + 1454803320000 + ] + } + ] + } + } + } + ] + } + }, + { + "key_as_string" : "2016-02-08T00:00:00.000Z", + "key" : 1454889600000, + "doc_count" : 3, + "categories" : { + "buckets" : [ + { + "doc_count" : 1, + "key" : "Node shutting down", + "hit" : { + "hits" : { + "total" : { + "value" : 1, + "relation" : "eq" + }, + "max_score" : null, + "hits" : [ + { + "_index" : "log-messages", + "_id" : "4", + "_score" : null, + "_source" : { + "message" : "2016-02-08T00:00:00+0000 Node 5 shutting down" + }, + "sort" : [ + 1454889660000 + ] + } + ] + } + } + }, + { + "doc_count" : 1, + "key" : "User logged off", + "hit" : { + "hits" : { + "total" : { + "value" : 1, + "relation" : "eq" + }, + "max_score" : null, + "hits" : [ + { + "_index" : "log-messages", + "_id" : "6", + "_score" : null, + "_source" : { + "message" : "2016-02-08T00:00:00+0000 User foo_864 logged off" + }, + "sort" : [ + 1454889840000 + ] + } + ] + } + } + }, + { + "doc_count" : 1, + "key" : "User logging on", + "hit" : { + "hits" : { + "total" : { + "value" : 1, + "relation" : "eq" + }, + "max_score" : null, + "hits" : [ + { + "_index" : "log-messages", + "_id" : "5", + "_score" : null, + "_source" : { + "message" : "2016-02-08T00:00:00+0000 User foo_325 logging on" + }, + "sort" : [ + 1454889720000 + ] + } + ] + } + } + } + ] + } + } + ] + } + } +} +-------------------------------------------------- diff --git a/server/src/main/java/org/elasticsearch/search/SearchService.java b/server/src/main/java/org/elasticsearch/search/SearchService.java index 01f00e1a00721..175f028435ed6 100644 --- a/server/src/main/java/org/elasticsearch/search/SearchService.java +++ b/server/src/main/java/org/elasticsearch/search/SearchService.java @@ -986,6 +986,7 @@ private void parseSource(DefaultSearchContext context, SearchSourceBuilder sourc context.terminateAfter(source.terminateAfter()); if (source.aggregations() != null && includeAggregations) { AggregationContext aggContext = new ProductionAggregationContext( + indicesService.getAnalysis(), context.getSearchExecutionContext(), bigArrays, source.aggregations().bytesToPreallocate(), diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/ParsedMultiBucketAggregation.java b/server/src/main/java/org/elasticsearch/search/aggregations/ParsedMultiBucketAggregation.java index 76ca0a917fb5d..48bd678ce5f80 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/ParsedMultiBucketAggregation.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/ParsedMultiBucketAggregation.java @@ -48,7 +48,7 @@ protected XContentBuilder doXContentBody(XContentBuilder builder, Params params) return builder; } - protected static , T extends ParsedBucket> void declareMultiBucketAggregationFields( + public static , T extends ParsedBucket> void declareMultiBucketAggregationFields( final ObjectParser objectParser, final CheckedFunction bucketParser, final CheckedFunction keyedBucketParser diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/support/AggregationContext.java b/server/src/main/java/org/elasticsearch/search/aggregations/support/AggregationContext.java index 5008fbe08eac4..8ce69009f09e0 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/support/AggregationContext.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/support/AggregationContext.java @@ -18,6 +18,8 @@ import org.elasticsearch.core.Releasable; import org.elasticsearch.core.Releasables; import org.elasticsearch.index.IndexSettings; +import org.elasticsearch.index.analysis.AnalysisRegistry; +import org.elasticsearch.index.analysis.NameOrDefinition; import org.elasticsearch.index.analysis.NamedAnalyzer; import org.elasticsearch.index.cache.bitset.BitsetFilterCache; import org.elasticsearch.index.fielddata.IndexFieldData; @@ -95,6 +97,30 @@ public final FieldContext buildFieldContext(String field) { return new FieldContext(field, buildFieldData(ft), ft); } + /** + * Returns an existing registered analyzer that should NOT be closed when finished being used. + * @param analyzer The custom analyzer name + * @return The existing named analyzer. + */ + public abstract Analyzer getNamedAnalyzer(String analyzer) throws IOException; + + /** + * Creates a new custom analyzer that should be closed when finished being used. + * @param indexSettings The current index settings or null + * @param normalizer Is a normalizer + * @param tokenizer The tokenizer name or definition to use + * @param charFilters The char filter name or definition to use + * @param tokenFilters The token filter name or definition to use + * @return A new custom analyzer + */ + public abstract Analyzer buildCustomAnalyzer( + IndexSettings indexSettings, + boolean normalizer, + NameOrDefinition tokenizer, + List charFilters, + List tokenFilters + ) throws IOException; + /** * Lookup the context for an already resolved field type. */ @@ -277,10 +303,12 @@ public static class ProductionAggregationContext extends AggregationContext { private final Supplier isCancelled; private final Function filterQuery; private final boolean enableRewriteToFilterByFilter; + private final AnalysisRegistry analysisRegistry; private final List releaseMe = new ArrayList<>(); public ProductionAggregationContext( + AnalysisRegistry analysisRegistry, SearchExecutionContext context, BigArrays bigArrays, long bytesToPreallocate, @@ -295,6 +323,7 @@ public ProductionAggregationContext( Function filterQuery, boolean enableRewriteToFilterByFilter ) { + this.analysisRegistry = analysisRegistry; this.context = context; if (bytesToPreallocate == 0) { /* @@ -350,6 +379,22 @@ public long nowInMillis() { return context.nowInMillis(); } + @Override + public Analyzer getNamedAnalyzer(String analyzer) throws IOException { + return analysisRegistry.getAnalyzer(analyzer); + } + + @Override + public Analyzer buildCustomAnalyzer( + IndexSettings indexSettings, + boolean normalizer, + NameOrDefinition tokenizer, + List charFilters, + List tokenFilters + ) throws IOException { + return analysisRegistry.buildCustomAnalyzer(indexSettings, normalizer, tokenizer, charFilters, tokenFilters); + } + @Override protected IndexFieldData buildFieldData(MappedFieldType ft) { return context.getForField(ft); diff --git a/test/framework/src/main/java/org/elasticsearch/index/mapper/MapperServiceTestCase.java b/test/framework/src/main/java/org/elasticsearch/index/mapper/MapperServiceTestCase.java index f341ae905ce0b..c9d1529e45430 100644 --- a/test/framework/src/main/java/org/elasticsearch/index/mapper/MapperServiceTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/index/mapper/MapperServiceTestCase.java @@ -37,6 +37,7 @@ import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.analysis.AnalyzerScope; import org.elasticsearch.index.analysis.IndexAnalyzers; +import org.elasticsearch.index.analysis.NameOrDefinition; import org.elasticsearch.index.analysis.NamedAnalyzer; import org.elasticsearch.index.cache.bitset.BitsetFilterCache; import org.elasticsearch.index.fielddata.IndexFieldData; @@ -352,6 +353,22 @@ public long nowInMillis() { return 0; } + @Override + public Analyzer getNamedAnalyzer(String analyzer) { + return null; + } + + @Override + public Analyzer buildCustomAnalyzer( + IndexSettings indexSettings, + boolean normalizer, + NameOrDefinition tokenizer, + List charFilters, + List tokenFilters + ) { + return null; + } + @Override public boolean isFieldMapped(String field) { throw new UnsupportedOperationException(); diff --git a/test/framework/src/main/java/org/elasticsearch/search/aggregations/AggregatorTestCase.java b/test/framework/src/main/java/org/elasticsearch/search/aggregations/AggregatorTestCase.java index 577598b467792..ac684f99e97c7 100644 --- a/test/framework/src/main/java/org/elasticsearch/search/aggregations/AggregatorTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/search/aggregations/AggregatorTestCase.java @@ -94,6 +94,7 @@ import org.elasticsearch.index.shard.IndexShard; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.indices.IndicesModule; +import org.elasticsearch.indices.analysis.AnalysisModule; import org.elasticsearch.indices.breaker.CircuitBreakerService; import org.elasticsearch.indices.breaker.NoneCircuitBreakerService; import org.elasticsearch.plugins.SearchPlugin; @@ -137,6 +138,7 @@ import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Optional; import java.util.Set; import java.util.function.Consumer; import java.util.function.Supplier; @@ -160,6 +162,7 @@ public abstract class AggregatorTestCase extends ESTestCase { private List releasables = new ArrayList<>(); protected ValuesSourceRegistry valuesSourceRegistry; + private AnalysisModule analysisModule; // A list of field types that should not be tested, or are not currently supported private static final List TYPE_TEST_BLACKLIST = List.of( @@ -179,6 +182,19 @@ public void initValuesSourceRegistry() { valuesSourceRegistry = searchModule.getValuesSourceRegistry(); } + @Before + public void initAnalysisRegistry() throws Exception { + analysisModule = createAnalysisModule(); + } + + /** + * @return a new analysis module. Tests that require a fully constructed analysis module (used to create an analysis registry) + * should override this method + */ + protected AnalysisModule createAnalysisModule() throws Exception { + return null; + } + /** * Test cases should override this if they have plugins that need to be loaded, e.g. the plugins their aggregators are in. */ @@ -284,6 +300,7 @@ public void onCache(ShardId shardId, Accountable accountable) {} MultiBucketConsumer consumer = new MultiBucketConsumer(maxBucket, breakerService.getBreaker(CircuitBreaker.REQUEST)); AggregationContext context = new ProductionAggregationContext( + Optional.ofNullable(analysisModule).map(AnalysisModule::getAnalysisRegistry).orElse(null), searchExecutionContext, new MockBigArrays(new MockPageCacheRecycler(Settings.EMPTY), breakerService), bytesToPreallocate, diff --git a/test/framework/src/main/java/org/elasticsearch/test/AbstractBuilderTestCase.java b/test/framework/src/main/java/org/elasticsearch/test/AbstractBuilderTestCase.java index 30bcfd62a8e99..73eef9442246e 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/AbstractBuilderTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/test/AbstractBuilderTestCase.java @@ -142,6 +142,14 @@ protected Collection> getPlugins() { return Collections.singletonList(TestGeoShapeFieldMapperPlugin.class); } + /** + * Allows additional plugins other than the required `TestGeoShapeFieldMapperPlugin` + * Could probably be removed when dependencies against geo_shape is decoupled + */ + protected Collection> getExtraPlugins() { + return Collections.emptyList(); + } + protected void initializeAdditionalMappings(MapperService mapperService) throws IOException { } @@ -208,9 +216,11 @@ public void beforeTest() throws Exception { // this setup long masterSeed = SeedUtils.parseSeed(RandomizedTest.getContext().getRunnerSeedAsString()); RandomizedTest.getContext().runWithPrivateRandomness(masterSeed, (Callable) () -> { - serviceHolder = new ServiceHolder(nodeSettings, createTestIndexSettings(), getPlugins(), nowInMillis, + Collection> plugins = new ArrayList<>(getPlugins()); + plugins.addAll(getExtraPlugins()); + serviceHolder = new ServiceHolder(nodeSettings, createTestIndexSettings(), plugins, nowInMillis, AbstractBuilderTestCase.this, true); - serviceHolderWithNoType = new ServiceHolder(nodeSettings, createTestIndexSettings(), getPlugins(), nowInMillis, + serviceHolderWithNoType = new ServiceHolder(nodeSettings, createTestIndexSettings(), plugins, nowInMillis, AbstractBuilderTestCase.this, false); return null; }); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/AnalysisConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/AnalysisConfig.java index a27aa10215ef9..6e8cb3845de63 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/AnalysisConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/AnalysisConfig.java @@ -736,7 +736,7 @@ private void verifyCategorizationFiltersAreValidRegex() { } } - private static boolean isValidRegex(String exp) { + public static boolean isValidRegex(String exp) { try { Pattern.compile(exp); return true; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/CategorizationAnalyzerConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/CategorizationAnalyzerConfig.java index d9430762df5d7..cedc046b26674 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/CategorizationAnalyzerConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/CategorizationAnalyzerConfig.java @@ -86,8 +86,10 @@ public static CategorizationAnalyzerConfig buildFromXContentObject(XContentParse * * The parser is strict when parsing config and lenient when parsing cluster state. */ - static CategorizationAnalyzerConfig buildFromXContentFragment(XContentParser parser, boolean ignoreUnknownFields) throws IOException { - + public static CategorizationAnalyzerConfig buildFromXContentFragment( + XContentParser parser, + boolean ignoreUnknownFields + ) throws IOException { CategorizationAnalyzerConfig.Builder builder = new CategorizationAnalyzerConfig.Builder(); XContentParser.Token token = parser.currentToken(); diff --git a/x-pack/plugin/ml/qa/ml-with-security/build.gradle b/x-pack/plugin/ml/qa/ml-with-security/build.gradle index 9c53ed96f3724..448fc8b1fc39b 100644 --- a/x-pack/plugin/ml/qa/ml-with-security/build.gradle +++ b/x-pack/plugin/ml/qa/ml-with-security/build.gradle @@ -35,6 +35,9 @@ tasks.named("yamlRestTest").configure { 'ml/calendar_crud/Test put calendar given id contains invalid chars', 'ml/calendar_crud/Test delete event from non existing calendar', 'ml/calendar_crud/Test delete job from non existing calendar', + // These are searching tests with aggregations, and do not call any ML endpoints + 'ml/categorization_agg/Test categorization agg simple', + 'ml/categorization_agg/Test categorization aggregation with poor settings', 'ml/custom_all_field/Test querying custom all field', 'ml/datafeeds_crud/Test delete datafeed with missing id', 'ml/datafeeds_crud/Test put datafeed referring to missing job_id', diff --git a/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/CategorizationAggregationIT.java b/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/CategorizationAggregationIT.java new file mode 100644 index 0000000000000..bd85984b3619f --- /dev/null +++ b/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/CategorizationAggregationIT.java @@ -0,0 +1,160 @@ +/* + * 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.ml.integration; + +import org.elasticsearch.action.bulk.BulkRequestBuilder; +import org.elasticsearch.action.bulk.BulkResponse; +import org.elasticsearch.action.index.IndexRequest; +import org.elasticsearch.action.search.SearchResponse; +import org.elasticsearch.action.support.WriteRequest; +import org.elasticsearch.core.TimeValue; +import org.elasticsearch.search.aggregations.AggregationBuilders; +import org.elasticsearch.search.aggregations.metrics.Max; +import org.elasticsearch.search.aggregations.metrics.Min; +import org.elasticsearch.xpack.ml.aggs.categorization.CategorizeTextAggregationBuilder; +import org.elasticsearch.xpack.ml.aggs.categorization.InternalCategorizationAggregation; +import org.elasticsearch.xpack.ml.support.BaseMlIntegTestCase; +import org.junit.Before; + +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.hasSize; +import static org.hamcrest.Matchers.is; +import static org.hamcrest.Matchers.not; +import static org.hamcrest.Matchers.notANumber; + +public class CategorizationAggregationIT extends BaseMlIntegTestCase { + + private static final String DATA_INDEX = "categorization-agg-data"; + + @Before + public void setupCluster() { + internalCluster().ensureAtLeastNumDataNodes(3); + ensureStableCluster(); + createSourceData(); + } + + public void testAggregation() { + SearchResponse response = client().prepareSearch(DATA_INDEX) + .setSize(0) + .setTrackTotalHits(false) + .addAggregation( + new CategorizeTextAggregationBuilder("categorize", "msg") + .subAggregation(AggregationBuilders.max("max").field("time")) + .subAggregation(AggregationBuilders.min("min").field("time")) + ).get(); + + InternalCategorizationAggregation agg = response.getAggregations().get("categorize"); + assertThat(agg.getBuckets(), hasSize(3)); + + assertCategorizationBucket(agg.getBuckets().get(0), "Node started", 3); + assertCategorizationBucket( + agg.getBuckets().get(1), + "Failed to shutdown error org.aaaa.bbbb.Cccc line caused by foo exception", + 2 + ); + assertCategorizationBucket(agg.getBuckets().get(2), "Node stopped", 1); + } + + public void testAggregationWithOnlyOneBucket() { + SearchResponse response = client().prepareSearch(DATA_INDEX) + .setSize(0) + .setTrackTotalHits(false) + .addAggregation( + new CategorizeTextAggregationBuilder("categorize", "msg") + .size(1) + .subAggregation(AggregationBuilders.max("max").field("time")) + .subAggregation(AggregationBuilders.min("min").field("time")) + ).get(); + InternalCategorizationAggregation agg = response.getAggregations().get("categorize"); + assertThat(agg.getBuckets(), hasSize(1)); + + assertCategorizationBucket(agg.getBuckets().get(0), "Node started", 3); + } + + public void testAggregationWithBroadCategories() { + SearchResponse response = client().prepareSearch(DATA_INDEX) + .setSize(0) + .setTrackTotalHits(false) + .addAggregation( + new CategorizeTextAggregationBuilder("categorize", "msg") + .setSimilarityThreshold(11) + .setMaxUniqueTokens(2) + .setMaxMatchedTokens(1) + .subAggregation(AggregationBuilders.max("max").field("time")) + .subAggregation(AggregationBuilders.min("min").field("time")) + ).get(); + InternalCategorizationAggregation agg = response.getAggregations().get("categorize"); + assertThat(agg.getBuckets(), hasSize(2)); + + assertCategorizationBucket(agg.getBuckets().get(0), "Node *", 4); + assertCategorizationBucket( + agg.getBuckets().get(1), + "Failed to shutdown error org.aaaa.bbbb.Cccc line caused by foo exception", + 2 + ); + } + + private void assertCategorizationBucket(InternalCategorizationAggregation.Bucket bucket, String key, long docCount) { + assertThat(bucket.getKeyAsString(), equalTo(key)); + assertThat(bucket.getDocCount(), equalTo(docCount)); + assertThat(((Max)bucket.getAggregations().get("max")).getValue(), not(notANumber())); + assertThat(((Min)bucket.getAggregations().get("min")).getValue(), not(notANumber())); + } + + private void ensureStableCluster() { + ensureStableCluster(internalCluster().getNodeNames().length, TimeValue.timeValueSeconds(60)); + } + + private void createSourceData() { + client().admin().indices().prepareCreate(DATA_INDEX) + .setMapping("time", "type=date,format=epoch_millis", + "msg", "type=text") + .get(); + + long nowMillis = System.currentTimeMillis(); + + BulkRequestBuilder bulkRequestBuilder = client().prepareBulk(); + IndexRequest indexRequest = new IndexRequest(DATA_INDEX); + indexRequest.source("time", nowMillis - TimeValue.timeValueHours(2).millis(), + "msg", "Node 1 started", + "part", "nodes"); + bulkRequestBuilder.add(indexRequest); + indexRequest = new IndexRequest(DATA_INDEX); + indexRequest.source("time", nowMillis - TimeValue.timeValueHours(2).millis() + 1, + "msg", "Failed to shutdown [error org.aaaa.bbbb.Cccc line 54 caused by foo exception]", + "part", "shutdowns"); + bulkRequestBuilder.add(indexRequest); + indexRequest = new IndexRequest(DATA_INDEX); + indexRequest.source("time", nowMillis - TimeValue.timeValueHours(2).millis() + 1, + "msg", "Failed to shutdown [error org.aaaa.bbbb.Cccc line 55 caused by foo exception]", + "part", "shutdowns"); + bulkRequestBuilder.add(indexRequest); + indexRequest = new IndexRequest(DATA_INDEX); + indexRequest.source("time", nowMillis - TimeValue.timeValueHours(1).millis(), + "msg", "Node 2 started", + "part", "nodes"); + bulkRequestBuilder.add(indexRequest); + indexRequest = new IndexRequest(DATA_INDEX); + indexRequest.source("time", nowMillis, + "msg", "Node 3 started", + "part", "nodes"); + bulkRequestBuilder.add(indexRequest); + + indexRequest = new IndexRequest(DATA_INDEX); + indexRequest.source("time", nowMillis, + "msg", "Node 3 stopped", + "part", "nodes"); + bulkRequestBuilder.add(indexRequest); + + BulkResponse bulkResponse = bulkRequestBuilder + .setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE) + .get(); + assertThat(bulkResponse.hasFailures(), is(false)); + } + +} diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/MachineLearning.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/MachineLearning.java index fa36eb5a3b425..970f856ce5142 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/MachineLearning.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/MachineLearning.java @@ -264,6 +264,8 @@ import org.elasticsearch.xpack.ml.action.TransportUpgradeJobModelSnapshotAction; import org.elasticsearch.xpack.ml.action.TransportValidateDetectorAction; import org.elasticsearch.xpack.ml.action.TransportValidateJobConfigAction; +import org.elasticsearch.xpack.ml.aggs.categorization.CategorizeTextAggregationBuilder; +import org.elasticsearch.xpack.ml.aggs.categorization.InternalCategorizationAggregation; import org.elasticsearch.xpack.ml.aggs.correlation.BucketCorrelationAggregationBuilder; import org.elasticsearch.xpack.ml.aggs.correlation.CorrelationNamedContentProvider; import org.elasticsearch.xpack.ml.aggs.heuristic.PValueScore; @@ -1220,6 +1222,7 @@ public List> getExecutorBuilders(Settings settings) { return Arrays.asList(jobComms, utility, datafeed); } + @Override public Map> getCharFilters() { return MapBuilder.>newMapBuilder() .put(FirstNonBlankLineCharFilter.NAME, FirstNonBlankLineCharFilterFactory::new) @@ -1249,6 +1252,18 @@ public List> getSignificanceHeuristics() { ); } + @Override + public List getAggregations() { + return Arrays.asList( + new AggregationSpec( + CategorizeTextAggregationBuilder.NAME, + CategorizeTextAggregationBuilder::new, + CategorizeTextAggregationBuilder.PARSER + ).addResultReader(InternalCategorizationAggregation::new) + .setAggregatorRegistrar(s -> s.registerUsage(CategorizeTextAggregationBuilder.NAME)) + ); + } + @Override public UnaryOperator> getIndexTemplateMetadataUpgrader() { return UnaryOperator.identity(); diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/categorization/CategorizationBytesRefHash.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/categorization/CategorizationBytesRefHash.java new file mode 100644 index 0000000000000..6246683ddfe6e --- /dev/null +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/categorization/CategorizationBytesRefHash.java @@ -0,0 +1,83 @@ +/* + * 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.ml.aggs.categorization; + +import org.apache.lucene.util.BytesRef; +import org.elasticsearch.common.logging.LoggerMessageFormat; +import org.elasticsearch.common.util.BytesRefHash; +import org.elasticsearch.core.Releasable; +import org.elasticsearch.search.aggregations.AggregationExecutionException; + +class CategorizationBytesRefHash implements Releasable { + + /** + * Our special wild card value. + */ + static final BytesRef WILD_CARD_REF = new BytesRef("*"); + /** + * For all WILD_CARD references, the token ID is always -1 + */ + static final int WILD_CARD_ID = -1; + private final BytesRefHash bytesRefHash; + + CategorizationBytesRefHash(BytesRefHash bytesRefHash) { + this.bytesRefHash = bytesRefHash; + } + + int[] getIds(BytesRef[] tokens) { + int[] ids = new int[tokens.length]; + for (int i = 0; i < tokens.length; i++) { + ids[i] = put(tokens[i]); + } + return ids; + } + + BytesRef[] getDeeps(int[] ids) { + BytesRef[] tokens = new BytesRef[ids.length]; + for (int i = 0; i < tokens.length; i++) { + tokens[i] = getDeep(ids[i]); + } + return tokens; + } + + BytesRef getDeep(long id) { + if (id == WILD_CARD_ID) { + return WILD_CARD_REF; + } + BytesRef shallow = bytesRefHash.get(id, new BytesRef()); + return BytesRef.deepCopyOf(shallow); + } + + int put(BytesRef bytesRef) { + if (WILD_CARD_REF.equals(bytesRef)) { + return WILD_CARD_ID; + } + long hash = bytesRefHash.add(bytesRef); + if (hash < 0) { + return (int) (-1L - hash); + } else { + if (hash > Integer.MAX_VALUE) { + throw new AggregationExecutionException( + LoggerMessageFormat.format( + "more than [{}] unique terms encountered. " + + "Consider restricting the documents queried or adding [{}] in the {} configuration", + Integer.MAX_VALUE, + CategorizeTextAggregationBuilder.CATEGORIZATION_FILTERS.getPreferredName(), + CategorizeTextAggregationBuilder.NAME + ) + ); + } + return (int) hash; + } + } + + @Override + public void close() { + bytesRefHash.close(); + } +} diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/categorization/CategorizationTokenTree.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/categorization/CategorizationTokenTree.java new file mode 100644 index 0000000000000..f5b5e6daea956 --- /dev/null +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/categorization/CategorizationTokenTree.java @@ -0,0 +1,143 @@ +/* + * 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.ml.aggs.categorization; + +import org.apache.lucene.util.Accountable; +import org.apache.lucene.util.BytesRef; +import org.apache.lucene.util.RamUsageEstimator; +import org.elasticsearch.search.aggregations.InternalAggregations; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.stream.Collectors; + + +/** + * Categorized semi-structured text utilizing the drain algorithm: https://arxiv.org/pdf/1806.04356.pdf + * With the following key differences + * - This structure keeps track of the "smallest" sub-tree. So, instead of naively adding a new "*" node, the smallest sub-tree + * is transformed if the incoming token has a higher doc_count. + * - Additionally, similarities are weighted, which allows for nicer merging of existing categories + * - An optional tree reduction step is available to collapse together tiny sub-trees + * + * + * The main implementation is a fixed-sized prefix tree. + * Consequently, this assumes that splits that give us more information come earlier in the text. + * + * Examples: + * + * Given token values: + * + * Node is online + * Node is offline + * + * With a fixed tree depth of 2 we would get the following splits + * 3 // initial root is the number of tokens + * | + * "Node" // first prefix node of value "Node" + * | + * "is" + * / \ + * [Node is online] [Node is offline] //the individual categories for this simple case + * + * If the similarityThreshold was less than 0.6, the result would be a single category [Node is *] + * + */ +public class CategorizationTokenTree implements Accountable { + + private static final long SHALLOW_SIZE = RamUsageEstimator.shallowSizeOfInstance(CategorizationTokenTree.class); + private final int maxMatchTokens; + private final int maxUniqueTokens; + private final int similarityThreshold; + private long idGenerator; + private final Map root = new HashMap<>(); + private long sizeInBytes; + + public CategorizationTokenTree(int maxUniqueTokens, int maxMatchTokens, int similarityThreshold) { + assert maxUniqueTokens > 0 && maxMatchTokens >= 0; + this.maxUniqueTokens = maxUniqueTokens; + this.maxMatchTokens = maxMatchTokens; + this.similarityThreshold = similarityThreshold; + this.sizeInBytes = SHALLOW_SIZE; + } + + public List toIntermediateBuckets(CategorizationBytesRefHash hash) { + return root.values().stream().flatMap(c -> c.getAllChildrenTextCategorizations().stream()).map(lg -> { + int[] categoryTokenIds = lg.getCategorization(); + BytesRef[] bytesRefs = new BytesRef[categoryTokenIds.length]; + for (int i = 0; i < categoryTokenIds.length; i++) { + bytesRefs[i] = hash.getDeep(categoryTokenIds[i]); + } + InternalCategorizationAggregation.Bucket bucket = new InternalCategorizationAggregation.Bucket( + new InternalCategorizationAggregation.BucketKey(bytesRefs), + lg.getCount(), + InternalAggregations.EMPTY + ); + bucket.bucketOrd = lg.bucketOrd; + return bucket; + }).collect(Collectors.toList()); + } + + void mergeSmallestChildren() { + root.values().forEach(TreeNode::collapseTinyChildren); + } + + /** + * This method does not mutate the underlying structure. Meaning, if a matching categories isn't found, it may return empty. + * + * @param tokenIds The tokens to categorize + * @return The category or `Optional.empty()` if one doesn't exist + */ + public Optional parseTokensConst(final int[] tokenIds) { + TreeNode currentNode = this.root.get(tokenIds.length); + if (currentNode == null) { // we are missing an entire sub tree. New token length found + return Optional.empty(); + } + return Optional.ofNullable(currentNode.getCategorization(tokenIds)); + } + + /** + * This categorizes the passed tokens, potentially mutating the structure by expanding an existing category or adding a new one. + * @param tokenIds The tokens to categorize + * @param docCount The count of docs for the given tokens + * @return An existing categorization or a newly created one + */ + public TextCategorization parseTokens(final int[] tokenIds, long docCount) { + TreeNode currentNode = this.root.get(tokenIds.length); + if (currentNode == null) { // we are missing an entire sub tree. New token length found + currentNode = newNode(docCount, 0, tokenIds); + incSize(currentNode.ramBytesUsed() + RamUsageEstimator.HASHTABLE_RAM_BYTES_PER_ENTRY + RamUsageEstimator.NUM_BYTES_OBJECT_REF); + this.root.put(tokenIds.length, currentNode); + } else { + currentNode.incCount(docCount); + } + return currentNode.addText(tokenIds, docCount, this); + } + + TreeNode newNode(long docCount, int tokenPos, int[] tokenIds) { + return tokenPos < maxMatchTokens - 1 && tokenPos < tokenIds.length + ? new TreeNode.InnerTreeNode(docCount, tokenPos, maxUniqueTokens) + : new TreeNode.LeafTreeNode(docCount, similarityThreshold); + } + + TextCategorization newCategorization(long docCount, int[] tokenIds) { + return new TextCategorization(tokenIds, docCount, idGenerator++); + } + + void incSize(long size) { + sizeInBytes += size; + } + + @Override + public long ramBytesUsed() { + return sizeInBytes; + } + +} diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/categorization/CategorizeTextAggregationBuilder.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/categorization/CategorizeTextAggregationBuilder.java new file mode 100644 index 0000000000000..e84167fd1d0a9 --- /dev/null +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/categorization/CategorizeTextAggregationBuilder.java @@ -0,0 +1,349 @@ +/* + * 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.ml.aggs.categorization; + +import org.elasticsearch.common.io.stream.StreamInput; +import org.elasticsearch.common.io.stream.StreamOutput; +import org.elasticsearch.common.xcontent.ObjectParser; +import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.search.aggregations.AbstractAggregationBuilder; +import org.elasticsearch.search.aggregations.AggregationBuilder; +import org.elasticsearch.search.aggregations.AggregatorFactories; +import org.elasticsearch.search.aggregations.AggregatorFactory; +import org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder; +import org.elasticsearch.search.aggregations.bucket.terms.TermsAggregator; +import org.elasticsearch.search.aggregations.support.AggregationContext; +import org.elasticsearch.xpack.core.ml.job.config.CategorizationAnalyzerConfig; +import org.elasticsearch.xpack.core.ml.job.messages.Messages; +import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; + +import java.io.IOException; +import java.util.List; +import java.util.Map; + +import static org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder.MIN_DOC_COUNT_FIELD_NAME; +import static org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder.REQUIRED_SIZE_FIELD_NAME; +import static org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder.SHARD_MIN_DOC_COUNT_FIELD_NAME; +import static org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder.SHARD_SIZE_FIELD_NAME; +import static org.elasticsearch.xpack.core.ml.job.config.AnalysisConfig.Builder.isValidRegex; + +public class CategorizeTextAggregationBuilder extends AbstractAggregationBuilder { + + static final TermsAggregator.BucketCountThresholds DEFAULT_BUCKET_COUNT_THRESHOLDS = new TermsAggregator.BucketCountThresholds( + 1, + 0, + 10, + -1 + ); + + static final int MAX_MAX_UNIQUE_TOKENS = 100; + static final int MAX_MAX_MATCHED_TOKENS = 100; + public static final String NAME = "categorize_text"; + + static final ParseField FIELD_NAME = new ParseField("field"); + static final ParseField MAX_UNIQUE_TOKENS = new ParseField("max_unique_tokens"); + static final ParseField SIMILARITY_THRESHOLD = new ParseField("similarity_threshold"); + static final ParseField MAX_MATCHED_TOKENS = new ParseField("max_matched_tokens"); + static final ParseField CATEGORIZATION_FILTERS = new ParseField("categorization_filters"); + static final ParseField CATEGORIZATION_ANALYZER = new ParseField("categorization_analyzer"); + + public static final ObjectParser PARSER = ObjectParser.fromBuilder( + CategorizeTextAggregationBuilder.NAME, + CategorizeTextAggregationBuilder::new + ); + static { + PARSER.declareString(CategorizeTextAggregationBuilder::setFieldName, FIELD_NAME); + PARSER.declareInt(CategorizeTextAggregationBuilder::setMaxUniqueTokens, MAX_UNIQUE_TOKENS); + PARSER.declareInt(CategorizeTextAggregationBuilder::setMaxMatchedTokens, MAX_MATCHED_TOKENS); + PARSER.declareInt(CategorizeTextAggregationBuilder::setSimilarityThreshold, SIMILARITY_THRESHOLD); + PARSER.declareField( + CategorizeTextAggregationBuilder::setCategorizationAnalyzerConfig, + (p, c) -> CategorizationAnalyzerConfig.buildFromXContentFragment(p, false), + CATEGORIZATION_ANALYZER, + ObjectParser.ValueType.OBJECT_OR_STRING + ); + PARSER.declareStringArray(CategorizeTextAggregationBuilder::setCategorizationFilters, CATEGORIZATION_FILTERS); + PARSER.declareInt(CategorizeTextAggregationBuilder::shardSize, TermsAggregationBuilder.SHARD_SIZE_FIELD_NAME); + PARSER.declareLong(CategorizeTextAggregationBuilder::minDocCount, TermsAggregationBuilder.MIN_DOC_COUNT_FIELD_NAME); + PARSER.declareLong(CategorizeTextAggregationBuilder::shardMinDocCount, TermsAggregationBuilder.SHARD_MIN_DOC_COUNT_FIELD_NAME); + PARSER.declareInt(CategorizeTextAggregationBuilder::size, REQUIRED_SIZE_FIELD_NAME); + } + + public static CategorizeTextAggregationBuilder parse(String aggregationName, XContentParser parser) throws IOException { + return PARSER.parse(parser, new CategorizeTextAggregationBuilder(aggregationName), null); + } + + private TermsAggregator.BucketCountThresholds bucketCountThresholds = new TermsAggregator.BucketCountThresholds( + DEFAULT_BUCKET_COUNT_THRESHOLDS + ); + private CategorizationAnalyzerConfig categorizationAnalyzerConfig; + private String fieldName; + private int maxUniqueTokens = 50; + private int similarityThreshold = 50; + private int maxMatchedTokens = 5; + + private CategorizeTextAggregationBuilder(String name) { + super(name); + } + + public CategorizeTextAggregationBuilder(String name, String fieldName) { + super(name); + this.fieldName = ExceptionsHelper.requireNonNull(fieldName, FIELD_NAME); + } + + public String getFieldName() { + return fieldName; + } + + public CategorizeTextAggregationBuilder setFieldName(String fieldName) { + this.fieldName = ExceptionsHelper.requireNonNull(fieldName, FIELD_NAME); + return this; + } + + public CategorizeTextAggregationBuilder(StreamInput in) throws IOException { + super(in); + this.bucketCountThresholds = new TermsAggregator.BucketCountThresholds(in); + this.fieldName = in.readString(); + this.maxUniqueTokens = in.readVInt(); + this.maxMatchedTokens = in.readVInt(); + this.similarityThreshold = in.readVInt(); + this.categorizationAnalyzerConfig = in.readOptionalWriteable(CategorizationAnalyzerConfig::new); + } + + public int getMaxUniqueTokens() { + return maxUniqueTokens; + } + + public CategorizeTextAggregationBuilder setMaxUniqueTokens(int maxUniqueTokens) { + this.maxUniqueTokens = maxUniqueTokens; + if (maxUniqueTokens <= 0) { + throw ExceptionsHelper.badRequestException( + "[{}] must be greater than 0 and less than [{}]. Found [{}] in [{}]", + MAX_UNIQUE_TOKENS.getPreferredName(), + MAX_MAX_UNIQUE_TOKENS, + maxUniqueTokens, + name + ); + } + return this; + } + + public double getSimilarityThreshold() { + return similarityThreshold; + } + + public CategorizeTextAggregationBuilder setSimilarityThreshold(int similarityThreshold) { + this.similarityThreshold = similarityThreshold; + if (similarityThreshold < 1 || similarityThreshold > 100) { + throw ExceptionsHelper.badRequestException( + "[{}] must be in the range [1, 100]. Found [{}] in [{}]", + SIMILARITY_THRESHOLD.getPreferredName(), + similarityThreshold, + name + ); + } + return this; + } + + public CategorizeTextAggregationBuilder setCategorizationAnalyzerConfig(CategorizationAnalyzerConfig categorizationAnalyzerConfig) { + this.categorizationAnalyzerConfig = categorizationAnalyzerConfig; + return this; + } + + public CategorizeTextAggregationBuilder setCategorizationFilters(List categorizationFilters) { + if (categorizationFilters == null || categorizationFilters.isEmpty()) { + return this; + } + if (categorizationAnalyzerConfig != null) { + throw ExceptionsHelper.badRequestException( + "[{}] cannot be used with [{}] - instead specify them as pattern_replace char_filters in the analyzer", + CATEGORIZATION_FILTERS.getPreferredName(), + CATEGORIZATION_ANALYZER.getPreferredName() + ); + } + if (categorizationFilters.stream().distinct().count() != categorizationFilters.size()) { + throw ExceptionsHelper.badRequestException(Messages.JOB_CONFIG_CATEGORIZATION_FILTERS_CONTAINS_DUPLICATES); + } + if (categorizationFilters.stream().anyMatch(String::isEmpty)) { + throw ExceptionsHelper.badRequestException(Messages.getMessage(Messages.JOB_CONFIG_CATEGORIZATION_FILTERS_CONTAINS_EMPTY)); + } + for (String filter : categorizationFilters) { + if (isValidRegex(filter) == false) { + throw ExceptionsHelper.badRequestException( + Messages.getMessage(Messages.JOB_CONFIG_CATEGORIZATION_FILTERS_CONTAINS_INVALID_REGEX, filter) + ); + } + } + this.categorizationAnalyzerConfig = CategorizationAnalyzerConfig.buildStandardCategorizationAnalyzer(categorizationFilters); + return this; + } + + public int getMaxMatchedTokens() { + return maxMatchedTokens; + } + + public CategorizeTextAggregationBuilder setMaxMatchedTokens(int maxMatchedTokens) { + this.maxMatchedTokens = maxMatchedTokens; + if (maxMatchedTokens <= 0) { + throw ExceptionsHelper.badRequestException( + "[{}] must be greater than 0 and less than [{}]. Found [{}] in [{}]", + MAX_MATCHED_TOKENS.getPreferredName(), + MAX_MAX_MATCHED_TOKENS, + maxMatchedTokens, + name + ); + } + return this; + } + + /** + * @param size indicating how many buckets should be returned + */ + public CategorizeTextAggregationBuilder size(int size) { + if (size <= 0) { + throw ExceptionsHelper.badRequestException( + "[{}] must be greater than 0. Found [{}] in [{}]", + REQUIRED_SIZE_FIELD_NAME.getPreferredName(), + size, + name + ); + } + bucketCountThresholds.setRequiredSize(size); + return this; + } + + /** + * @param shardSize - indicating the number of buckets each shard + * will return to the coordinating node (the node that coordinates the + * search execution). The higher the shard size is, the more accurate the + * results are. + */ + public CategorizeTextAggregationBuilder shardSize(int shardSize) { + if (shardSize <= 0) { + throw ExceptionsHelper.badRequestException( + "[{}] must be greater than 0. Found [{}] in [{}]", + SHARD_SIZE_FIELD_NAME.getPreferredName(), + shardSize, + name + ); + } + bucketCountThresholds.setShardSize(shardSize); + return this; + } + + /** + * @param minDocCount the minimum document count a text category should have in order to appear in + * the response. + */ + public CategorizeTextAggregationBuilder minDocCount(long minDocCount) { + if (minDocCount < 0) { + throw ExceptionsHelper.badRequestException( + "[{}] must be greater than or equal to 0. Found [{}] in [{}]", + MIN_DOC_COUNT_FIELD_NAME.getPreferredName(), + minDocCount, + name + ); + } + bucketCountThresholds.setMinDocCount(minDocCount); + return this; + } + + /** + * @param shardMinDocCount the minimum document count a text category should have on the shard in order to + * appear in the response. + */ + public CategorizeTextAggregationBuilder shardMinDocCount(long shardMinDocCount) { + if (shardMinDocCount < 0) { + throw ExceptionsHelper.badRequestException( + "[{}] must be greater than or equal to 0. Found [{}] in [{}]", + SHARD_MIN_DOC_COUNT_FIELD_NAME.getPreferredName(), + shardMinDocCount, + name + ); + } + bucketCountThresholds.setShardMinDocCount(shardMinDocCount); + return this; + } + + protected CategorizeTextAggregationBuilder( + CategorizeTextAggregationBuilder clone, + AggregatorFactories.Builder factoriesBuilder, + Map metadata + ) { + super(clone, factoriesBuilder, metadata); + this.bucketCountThresholds = new TermsAggregator.BucketCountThresholds(clone.bucketCountThresholds); + this.fieldName = clone.fieldName; + this.maxUniqueTokens = clone.maxUniqueTokens; + this.maxMatchedTokens = clone.maxMatchedTokens; + this.similarityThreshold = clone.similarityThreshold; + this.categorizationAnalyzerConfig = clone.categorizationAnalyzerConfig; + } + + @Override + protected void doWriteTo(StreamOutput out) throws IOException { + bucketCountThresholds.writeTo(out); + out.writeString(fieldName); + out.writeVInt(maxUniqueTokens); + out.writeVInt(maxMatchedTokens); + out.writeVInt(similarityThreshold); + out.writeOptionalWriteable(categorizationAnalyzerConfig); + } + + @Override + protected AggregatorFactory doBuild( + AggregationContext context, + AggregatorFactory parent, + AggregatorFactories.Builder subfactoriesBuilder + ) throws IOException { + return new CategorizeTextAggregatorFactory( + name, + fieldName, + maxUniqueTokens, + maxMatchedTokens, + similarityThreshold, + bucketCountThresholds, + categorizationAnalyzerConfig, + context, + parent, + subfactoriesBuilder, + metadata + ); + } + + @Override + protected XContentBuilder internalXContent(XContentBuilder builder, Params params) throws IOException { + builder.startObject(); + bucketCountThresholds.toXContent(builder, params); + builder.field(FIELD_NAME.getPreferredName(), fieldName); + builder.field(MAX_UNIQUE_TOKENS.getPreferredName(), maxUniqueTokens); + builder.field(MAX_MATCHED_TOKENS.getPreferredName(), maxMatchedTokens); + builder.field(SIMILARITY_THRESHOLD.getPreferredName(), similarityThreshold); + if (categorizationAnalyzerConfig != null) { + categorizationAnalyzerConfig.toXContent(builder, params); + } + builder.endObject(); + return null; + } + + @Override + protected AggregationBuilder shallowCopy(AggregatorFactories.Builder factoriesBuilder, Map metadata) { + return new CategorizeTextAggregationBuilder(this, factoriesBuilder, metadata); + } + + @Override + public BucketCardinality bucketCardinality() { + return BucketCardinality.MANY; + } + + @Override + public String getType() { + return NAME; + } +} diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/categorization/CategorizeTextAggregator.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/categorization/CategorizeTextAggregator.java new file mode 100644 index 0000000000000..16058fbdae4f2 --- /dev/null +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/categorization/CategorizeTextAggregator.java @@ -0,0 +1,239 @@ +/* + * 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.ml.aggs.categorization; + +import org.apache.lucene.analysis.Analyzer; +import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; +import org.apache.lucene.index.LeafReaderContext; +import org.apache.lucene.util.BytesRef; +import org.apache.lucene.util.PriorityQueue; +import org.elasticsearch.common.util.BytesRefHash; +import org.elasticsearch.common.util.ObjectArray; +import org.elasticsearch.core.Releasables; +import org.elasticsearch.index.mapper.MappedFieldType; +import org.elasticsearch.search.aggregations.Aggregator; +import org.elasticsearch.search.aggregations.AggregatorFactories; +import org.elasticsearch.search.aggregations.CardinalityUpperBound; +import org.elasticsearch.search.aggregations.InternalAggregation; +import org.elasticsearch.search.aggregations.LeafBucketCollector; +import org.elasticsearch.search.aggregations.LeafBucketCollectorBase; +import org.elasticsearch.search.aggregations.bucket.DeferableBucketAggregator; +import org.elasticsearch.search.aggregations.bucket.terms.LongKeyedBucketOrds; +import org.elasticsearch.search.aggregations.bucket.terms.TermsAggregator; +import org.elasticsearch.search.aggregations.support.AggregationContext; +import org.elasticsearch.search.lookup.SourceLookup; +import org.elasticsearch.xpack.core.ml.job.config.CategorizationAnalyzerConfig; +import org.elasticsearch.xpack.ml.job.categorization.CategorizationAnalyzer; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Comparator; +import java.util.Iterator; +import java.util.Map; +import java.util.Optional; + +public class CategorizeTextAggregator extends DeferableBucketAggregator { + + private final TermsAggregator.BucketCountThresholds bucketCountThresholds; + private final SourceLookup sourceLookup; + private final MappedFieldType fieldType; + private final CategorizationAnalyzer analyzer; + private final String sourceFieldName; + private ObjectArray categorizers; + private final int maxUniqueTokens; + private final int maxMatchTokens; + private final int similarityThreshold; + private final LongKeyedBucketOrds bucketOrds; + private final CategorizationBytesRefHash bytesRefHash; + + protected CategorizeTextAggregator( + String name, + AggregatorFactories factories, + AggregationContext context, + Aggregator parent, + String sourceFieldName, + MappedFieldType fieldType, + TermsAggregator.BucketCountThresholds bucketCountThresholds, + int maxUniqueTokens, + int maxMatchTokens, + int similarityThreshold, + CategorizationAnalyzerConfig categorizationAnalyzerConfig, + Map metadata + ) throws IOException { + super(name, factories, context, parent, metadata); + this.sourceLookup = context.lookup().source(); + this.sourceFieldName = sourceFieldName; + this.fieldType = fieldType; + CategorizationAnalyzerConfig analyzerConfig = Optional.ofNullable(categorizationAnalyzerConfig) + .orElse(CategorizationAnalyzerConfig.buildStandardCategorizationAnalyzer(Collections.emptyList())); + final String analyzerName = analyzerConfig.getAnalyzer(); + if (analyzerName != null) { + Analyzer globalAnalyzer = context.getNamedAnalyzer(analyzerName); + if (globalAnalyzer == null) { + throw new IllegalArgumentException("Failed to find global analyzer [" + analyzerName + "]"); + } + this.analyzer = new CategorizationAnalyzer(globalAnalyzer, false); + } else { + this.analyzer = new CategorizationAnalyzer( + context.buildCustomAnalyzer( + context.getIndexSettings(), + false, + analyzerConfig.getTokenizer(), + analyzerConfig.getCharFilters(), + analyzerConfig.getTokenFilters() + ), + true + ); + } + this.categorizers = bigArrays().newObjectArray(1); + this.maxUniqueTokens = maxUniqueTokens; + this.maxMatchTokens = maxMatchTokens; + this.similarityThreshold = similarityThreshold; + this.bucketOrds = LongKeyedBucketOrds.build(bigArrays(), CardinalityUpperBound.MANY); + this.bucketCountThresholds = bucketCountThresholds; + this.bytesRefHash = new CategorizationBytesRefHash(new BytesRefHash(2048, bigArrays())); + } + + @Override + protected void doClose() { + super.doClose(); + Releasables.close(this.analyzer, this.bytesRefHash); + } + + @Override + public InternalAggregation[] buildAggregations(long[] ordsToCollect) throws IOException { + InternalCategorizationAggregation.Bucket[][] topBucketsPerOrd = + new InternalCategorizationAggregation.Bucket[ordsToCollect.length][]; + for (int ordIdx = 0; ordIdx < ordsToCollect.length; ordIdx++) { + final CategorizationTokenTree categorizationTokenTree = categorizers.get(ordsToCollect[ordIdx]); + if (categorizationTokenTree == null) { + topBucketsPerOrd[ordIdx] = new InternalCategorizationAggregation.Bucket[0]; + continue; + } + int size = (int) Math.min(bucketOrds.bucketsInOrd(ordIdx), bucketCountThresholds.getShardSize()); + PriorityQueue ordered = + new InternalCategorizationAggregation.BucketCountPriorityQueue(size); + for (InternalCategorizationAggregation.Bucket bucket : categorizationTokenTree.toIntermediateBuckets(bytesRefHash)) { + if (bucket.docCount < bucketCountThresholds.getShardMinDocCount()) { + continue; + } + ordered.insertWithOverflow(bucket); + } + topBucketsPerOrd[ordIdx] = new InternalCategorizationAggregation.Bucket[ordered.size()]; + for (int i = ordered.size() - 1; i >= 0; --i) { + topBucketsPerOrd[ordIdx][i] = ordered.pop(); + } + } + buildSubAggsForAllBuckets(topBucketsPerOrd, b -> b.bucketOrd, (b, a) -> b.aggregations = a); + InternalAggregation[] results = new InternalAggregation[ordsToCollect.length]; + for (int ordIdx = 0; ordIdx < ordsToCollect.length; ordIdx++) { + InternalCategorizationAggregation.Bucket[] bucketArray = topBucketsPerOrd[ordIdx]; + Arrays.sort(bucketArray, Comparator.naturalOrder()); + results[ordIdx] = new InternalCategorizationAggregation( + name, + bucketCountThresholds.getRequiredSize(), + bucketCountThresholds.getMinDocCount(), + maxUniqueTokens, + maxMatchTokens, + similarityThreshold, + metadata(), + Arrays.asList(bucketArray) + ); + } + return results; + } + + @Override + public InternalAggregation buildEmptyAggregation() { + return new InternalCategorizationAggregation( + name, + bucketCountThresholds.getRequiredSize(), + bucketCountThresholds.getMinDocCount(), + maxUniqueTokens, + maxMatchTokens, + similarityThreshold, + metadata() + ); + } + + @Override + protected LeafBucketCollector getLeafCollector(LeafReaderContext ctx, LeafBucketCollector sub) throws IOException { + return new LeafBucketCollectorBase(sub, null) { + @Override + public void collect(int doc, long owningBucketOrd) throws IOException { + categorizers = bigArrays().grow(categorizers, owningBucketOrd + 1); + CategorizationTokenTree categorizer = categorizers.get(owningBucketOrd); + if (categorizer == null) { + categorizer = new CategorizationTokenTree(maxUniqueTokens, maxMatchTokens, similarityThreshold); + addRequestCircuitBreakerBytes(categorizer.ramBytesUsed()); + categorizers.set(owningBucketOrd, categorizer); + } + collectFromSource(doc, owningBucketOrd, categorizer); + } + + private void collectFromSource(int doc, long owningBucketOrd, CategorizationTokenTree categorizer) throws IOException { + sourceLookup.setSegmentAndDocument(ctx, doc); + Iterator itr = sourceLookup.extractRawValues(sourceFieldName).stream().map(obj -> { + if (obj == null) { + return null; + } + if (obj instanceof BytesRef) { + return fieldType.valueForDisplay(obj).toString(); + } + return obj.toString(); + }).iterator(); + while (itr.hasNext()) { + TokenStream ts = analyzer.tokenStream(fieldType.name(), itr.next()); + processTokenStream(owningBucketOrd, ts, doc, categorizer); + } + } + + private void processTokenStream( + long owningBucketOrd, + TokenStream ts, + int doc, + CategorizationTokenTree categorizer + ) throws IOException { + ArrayList tokens = new ArrayList<>(); + try { + CharTermAttribute termAtt = ts.addAttribute(CharTermAttribute.class); + ts.reset(); + while (ts.incrementToken()) { + tokens.add(bytesRefHash.put(new BytesRef(termAtt))); + } + if (tokens.isEmpty()) { + return; + } + } finally { + ts.close(); + } + long previousSize = categorizer.ramBytesUsed(); + TextCategorization lg = categorizer.parseTokens( + tokens.stream().mapToInt(Integer::valueOf).toArray(), + docCountProvider.getDocCount(doc) + ); + long newSize = categorizer.ramBytesUsed(); + if (newSize - previousSize > 0) { + addRequestCircuitBreakerBytes(newSize - previousSize); + } + + long bucketOrd = bucketOrds.add(owningBucketOrd, lg.getId()); + if (bucketOrd < 0) { // already seen + bucketOrd = -1 - bucketOrd; + collectExistingBucket(sub, doc, bucketOrd); + } else { + lg.bucketOrd = bucketOrd; + collectBucket(sub, doc, bucketOrd); + } + } + }; + } +} diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/categorization/CategorizeTextAggregatorFactory.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/categorization/CategorizeTextAggregatorFactory.java new file mode 100644 index 0000000000000..f63b4ba1f802b --- /dev/null +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/categorization/CategorizeTextAggregatorFactory.java @@ -0,0 +1,112 @@ +/* + * 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.ml.aggs.categorization; + +import org.elasticsearch.index.mapper.MappedFieldType; +import org.elasticsearch.search.aggregations.Aggregator; +import org.elasticsearch.search.aggregations.AggregatorFactories; +import org.elasticsearch.search.aggregations.AggregatorFactory; +import org.elasticsearch.search.aggregations.CardinalityUpperBound; +import org.elasticsearch.search.aggregations.InternalAggregation; +import org.elasticsearch.search.aggregations.NonCollectingAggregator; +import org.elasticsearch.search.aggregations.bucket.BucketUtils; +import org.elasticsearch.search.aggregations.bucket.terms.TermsAggregator; +import org.elasticsearch.search.aggregations.support.AggregationContext; +import org.elasticsearch.xpack.core.ml.job.config.CategorizationAnalyzerConfig; + +import java.io.IOException; +import java.util.Map; + +public class CategorizeTextAggregatorFactory extends AggregatorFactory { + + private final MappedFieldType fieldType; + private final String indexedFieldName; + private final int maxUniqueTokens; + private final int maxMatchTokens; + private final int similarityThreshold; + private final CategorizationAnalyzerConfig categorizationAnalyzerConfig; + private final TermsAggregator.BucketCountThresholds bucketCountThresholds; + + public CategorizeTextAggregatorFactory( + String name, + String fieldName, + int maxUniqueTokens, + int maxMatchTokens, + int similarityThreshold, + TermsAggregator.BucketCountThresholds bucketCountThresholds, + CategorizationAnalyzerConfig categorizationAnalyzerConfig, + AggregationContext context, + AggregatorFactory parent, + AggregatorFactories.Builder subFactoriesBuilder, + Map metadata + ) throws IOException { + super(name, context, parent, subFactoriesBuilder, metadata); + this.fieldType = context.getFieldType(fieldName); + if (fieldType != null) { + this.indexedFieldName = fieldType.name(); + } else { + this.indexedFieldName = null; + } + this.maxUniqueTokens = maxUniqueTokens; + this.maxMatchTokens = maxMatchTokens; + this.similarityThreshold = similarityThreshold; + this.categorizationAnalyzerConfig = categorizationAnalyzerConfig; + this.bucketCountThresholds = bucketCountThresholds; + } + + protected Aggregator createUnmapped(Aggregator parent, Map metadata) throws IOException { + final InternalAggregation aggregation = new UnmappedCategorizationAggregation( + name, + bucketCountThresholds.getRequiredSize(), + bucketCountThresholds.getMinDocCount(), + maxUniqueTokens, + maxMatchTokens, + similarityThreshold, + metadata + ); + return new NonCollectingAggregator(name, context, parent, factories, metadata) { + @Override + public InternalAggregation buildEmptyAggregation() { + return aggregation; + } + }; + } + + @Override + protected Aggregator createInternal(Aggregator parent, CardinalityUpperBound cardinality, Map metadata) + throws IOException { + if (fieldType == null) { + return createUnmapped(parent, metadata); + } + TermsAggregator.BucketCountThresholds bucketCountThresholds = new TermsAggregator.BucketCountThresholds(this.bucketCountThresholds); + if (bucketCountThresholds.getShardSize() == CategorizeTextAggregationBuilder.DEFAULT_BUCKET_COUNT_THRESHOLDS.getShardSize()) { + // The user has not made a shardSize selection. Use default + // heuristic to avoid any wrong-ranking caused by distributed + // counting + // TODO significant text does a 2x here, should we as well? + bucketCountThresholds.setShardSize(BucketUtils.suggestShardSideQueueSize(bucketCountThresholds.getRequiredSize())); + } + bucketCountThresholds.ensureValidity(); + + return new CategorizeTextAggregator( + name, + factories, + context, + parent, + indexedFieldName, + fieldType, + bucketCountThresholds, + maxUniqueTokens, + maxMatchTokens, + similarityThreshold, + categorizationAnalyzerConfig, + metadata + ); + } + +} diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/categorization/InternalCategorizationAggregation.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/categorization/InternalCategorizationAggregation.java new file mode 100644 index 0000000000000..92c51b8d75b4c --- /dev/null +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/categorization/InternalCategorizationAggregation.java @@ -0,0 +1,453 @@ +/* + * 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.ml.aggs.categorization; + +import org.apache.lucene.util.BytesRef; +import org.apache.lucene.util.PriorityQueue; +import org.elasticsearch.common.io.stream.StreamInput; +import org.elasticsearch.common.io.stream.StreamOutput; +import org.elasticsearch.common.io.stream.Writeable; +import org.elasticsearch.common.util.BytesRefHash; +import org.elasticsearch.common.xcontent.ToXContentFragment; +import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.search.aggregations.AggregationExecutionException; +import org.elasticsearch.search.aggregations.Aggregations; +import org.elasticsearch.search.aggregations.InternalAggregation; +import org.elasticsearch.search.aggregations.InternalAggregations; +import org.elasticsearch.search.aggregations.InternalMultiBucketAggregation; +import org.elasticsearch.search.aggregations.bucket.MultiBucketsAggregation; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Comparator; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static org.elasticsearch.xpack.ml.aggs.categorization.CategorizationBytesRefHash.WILD_CARD_REF; + + +public class InternalCategorizationAggregation extends InternalMultiBucketAggregation< + InternalCategorizationAggregation, + InternalCategorizationAggregation.Bucket> { + + // Carries state allowing for delayed reduction of the bucket + // This allows us to keep from accidentally calling "reduce" on the sub-aggs more than once + private static class DelayedCategorizationBucket { + private final BucketKey key; + private long docCount; + private final List toReduce; + + DelayedCategorizationBucket(BucketKey key, List toReduce, long docCount) { + this.key = key; + this.toReduce = new ArrayList<>(toReduce); + this.docCount = docCount; + } + + public long getDocCount() { + return docCount; + } + + public Bucket reduce(BucketKey key, ReduceContext reduceContext) { + List innerAggs = new ArrayList<>(toReduce.size()); + long docCount = 0; + for (Bucket bucket : toReduce) { + innerAggs.add(bucket.aggregations); + docCount += bucket.docCount; + } + return new Bucket(key, docCount, InternalAggregations.reduce(innerAggs, reduceContext)); + } + + public DelayedCategorizationBucket add(Bucket bucket) { + this.docCount += bucket.docCount; + this.toReduce.add(bucket); + return this; + } + + public DelayedCategorizationBucket add(DelayedCategorizationBucket bucket) { + this.docCount += bucket.docCount; + this.toReduce.addAll(bucket.toReduce); + return this; + } + } + + static class BucketCountPriorityQueue extends PriorityQueue { + BucketCountPriorityQueue(int size) { + super(size); + } + + @Override + protected boolean lessThan(Bucket a, Bucket b) { + return a.docCount < b.docCount; + } + } + + static class BucketKey implements ToXContentFragment, Writeable, Comparable { + + private final BytesRef[] key; + + static BucketKey withCollapsedWildcards(BytesRef[] key) { + if (key.length <= 1) { + return new BucketKey(key); + } + List collapsedWildCards = new ArrayList<>(); + boolean previousTokenWildCard = false; + for (BytesRef token : key) { + if (token.equals(WILD_CARD_REF)) { + if (previousTokenWildCard == false) { + previousTokenWildCard = true; + collapsedWildCards.add(WILD_CARD_REF); + } + } else { + previousTokenWildCard = false; + collapsedWildCards.add(token); + } + } + if (collapsedWildCards.size() == key.length) { + return new BucketKey(key); + } + return new BucketKey(collapsedWildCards.toArray(BytesRef[]::new)); + } + + BucketKey(BytesRef[] key) { + this.key = key; + } + + BucketKey(StreamInput in) throws IOException { + key = in.readArray(StreamInput::readBytesRef, BytesRef[]::new); + } + + @Override + public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { + return builder.value(asString()); + } + + @Override + public void writeTo(StreamOutput out) throws IOException { + out.writeArray(StreamOutput::writeBytesRef, key); + } + + public String asString() { + StringBuilder builder = new StringBuilder(); + for (int i = 0; i < key.length - 1; i++) { + builder.append(key[i].utf8ToString()).append(" "); + } + builder.append(key[key.length - 1].utf8ToString()); + return builder.toString(); + } + + @Override + public String toString() { + return asString(); + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + BucketKey bucketKey = (BucketKey) o; + return Arrays.equals(key, bucketKey.key); + } + + @Override + public int hashCode() { + return Arrays.hashCode(key); + } + + public BytesRef[] keyAsTokens() { + return key; + } + + @Override + public int compareTo(BucketKey o) { + return Arrays.compare(key, o.key); + } + + } + + public static class Bucket extends InternalBucket implements MultiBucketsAggregation.Bucket, Comparable { + // Used on the shard level to keep track of sub aggregations + long bucketOrd; + + final BucketKey key; + final long docCount; + InternalAggregations aggregations; + + public Bucket(BucketKey key, long docCount, InternalAggregations aggregations) { + this.key = key; + this.docCount = docCount; + this.aggregations = aggregations; + } + + public Bucket(StreamInput in) throws IOException { + key = new BucketKey(in); + docCount = in.readVLong(); + aggregations = InternalAggregations.readFrom(in); + } + + @Override + public void writeTo(StreamOutput out) throws IOException { + key.writeTo(out); + out.writeVLong(getDocCount()); + aggregations.writeTo(out); + } + + @Override + public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { + builder.startObject(); + builder.field(CommonFields.DOC_COUNT.getPreferredName(), docCount); + builder.field(CommonFields.KEY.getPreferredName()); + key.toXContent(builder, params); + aggregations.toXContentInternal(builder, params); + builder.endObject(); + return builder; + } + + BucketKey getRawKey() { + return key; + } + + @Override + public Object getKey() { + return key; + } + + @Override + public String getKeyAsString() { + return key.asString(); + } + + @Override + public long getDocCount() { + return docCount; + } + + @Override + public Aggregations getAggregations() { + return aggregations; + } + + @Override + public String toString() { + return "Bucket{" + "key=" + getKeyAsString() + ", docCount=" + docCount + ", aggregations=" + aggregations.asMap() + "}\n"; + } + + @Override + public int compareTo(Bucket o) { + return key.compareTo(o.key); + } + + } + + private final List buckets; + private final int maxUniqueTokens; + private final int similarityThreshold; + private final int maxMatchTokens; + private final int requiredSize; + private final long minDocCount; + + protected InternalCategorizationAggregation( + String name, + int requiredSize, + long minDocCount, + int maxUniqueTokens, + int maxMatchTokens, + int similarityThreshold, + Map metadata + ) { + this(name, requiredSize, minDocCount, maxUniqueTokens, maxMatchTokens, similarityThreshold, metadata, new ArrayList<>()); + } + + protected InternalCategorizationAggregation( + String name, + int requiredSize, + long minDocCount, + int maxUniqueTokens, + int maxMatchTokens, + int similarityThreshold, + Map metadata, + List buckets + ) { + super(name, metadata); + this.buckets = buckets; + this.maxUniqueTokens = maxUniqueTokens; + this.maxMatchTokens = maxMatchTokens; + this.similarityThreshold = similarityThreshold; + this.minDocCount = minDocCount; + this.requiredSize = requiredSize; + } + + public InternalCategorizationAggregation(StreamInput in) throws IOException { + super(in); + this.maxUniqueTokens = in.readVInt(); + this.maxMatchTokens = in.readVInt(); + this.similarityThreshold = in.readVInt(); + this.buckets = in.readList(Bucket::new); + this.requiredSize = readSize(in); + this.minDocCount = in.readVLong(); + } + + @Override + protected void doWriteTo(StreamOutput out) throws IOException { + out.writeVInt(maxUniqueTokens); + out.writeVInt(maxMatchTokens); + out.writeVInt(similarityThreshold); + out.writeList(buckets); + writeSize(requiredSize, out); + out.writeVLong(minDocCount); + } + + @Override + public XContentBuilder doXContentBody(XContentBuilder builder, Params params) throws IOException { + builder.startArray(CommonFields.BUCKETS.getPreferredName()); + for (Bucket bucket : buckets) { + bucket.toXContent(builder, params); + } + builder.endArray(); + return builder; + } + + @Override + public InternalCategorizationAggregation create(List buckets) { + return new InternalCategorizationAggregation( + name, + requiredSize, + minDocCount, + maxUniqueTokens, + maxMatchTokens, + similarityThreshold, + super.metadata, + buckets + ); + } + + @Override + public Bucket createBucket(InternalAggregations aggregations, Bucket prototype) { + return new Bucket(prototype.key, prototype.docCount, aggregations); + } + + @Override + protected Bucket reduceBucket(List buckets, ReduceContext context) { + throw new IllegalArgumentException("For optimization purposes, typical bucket path is not supported"); + } + + @Override + public List getBuckets() { + return buckets; + } + + @Override + public String getWriteableName() { + return CategorizeTextAggregationBuilder.NAME; + } + + @Override + public InternalAggregation reduce(List aggregations, ReduceContext reduceContext) { + try (CategorizationBytesRefHash hash = new CategorizationBytesRefHash(new BytesRefHash(1L, reduceContext.bigArrays()))) { + CategorizationTokenTree categorizationTokenTree = new CategorizationTokenTree( + maxUniqueTokens, + maxMatchTokens, + similarityThreshold + ); + // TODO: Could we do a merge sort similar to terms? + // It would require us returning partial reductions sorted by key, not by doc_count + // First, make sure we have all the counts for equal categorizations + Map reduced = new HashMap<>(); + for (InternalAggregation aggregation : aggregations) { + InternalCategorizationAggregation categorizationAggregation = (InternalCategorizationAggregation) aggregation; + for (Bucket bucket : categorizationAggregation.buckets) { + reduced.computeIfAbsent(bucket.key, key -> new DelayedCategorizationBucket(key, new ArrayList<>(1), 0L)).add(bucket); + } + } + + reduced.values() + .stream() + .sorted(Comparator.comparing(DelayedCategorizationBucket::getDocCount).reversed()) + .forEach(bucket -> + // Parse tokens takes document count into account and merging on smallest groups + categorizationTokenTree.parseTokens(hash.getIds(bucket.key.keyAsTokens()), bucket.docCount) + ); + categorizationTokenTree.mergeSmallestChildren(); + Map mergedBuckets = new HashMap<>(); + for (DelayedCategorizationBucket delayedBucket : reduced.values()) { + TextCategorization group = categorizationTokenTree.parseTokensConst(hash.getIds(delayedBucket.key.keyAsTokens())) + .orElseThrow( + () -> new AggregationExecutionException( + "Unexpected null categorization group for bucket [" + delayedBucket.key.asString() + "]" + ) + ); + BytesRef[] categoryTokens = hash.getDeeps(group.getCategorization()); + + BucketKey key = reduceContext.isFinalReduce() ? + BucketKey.withCollapsedWildcards(categoryTokens) : + new BucketKey(categoryTokens); + mergedBuckets.computeIfAbsent( + key, + k -> new DelayedCategorizationBucket(k, new ArrayList<>(delayedBucket.toReduce.size()), 0L) + ).add(delayedBucket); + } + + final int size = reduceContext.isFinalReduce() == false ? mergedBuckets.size() : Math.min(requiredSize, mergedBuckets.size()); + final PriorityQueue pq = new BucketCountPriorityQueue(size); + for (Map.Entry keyAndBuckets : mergedBuckets.entrySet()) { + final BucketKey key = keyAndBuckets.getKey(); + DelayedCategorizationBucket bucket = keyAndBuckets.getValue(); + Bucket newBucket = bucket.reduce(key, reduceContext); + if ((newBucket.docCount >= minDocCount) || reduceContext.isFinalReduce() == false) { + Bucket removed = pq.insertWithOverflow(newBucket); + if (removed == null) { + reduceContext.consumeBucketsAndMaybeBreak(1); + } else { + reduceContext.consumeBucketsAndMaybeBreak(-countInnerBucket(removed)); + } + } else { + reduceContext.consumeBucketsAndMaybeBreak(-countInnerBucket(newBucket)); + } + } + Bucket[] bucketList = new Bucket[pq.size()]; + for (int i = pq.size() - 1; i >= 0; i--) { + bucketList[i] = pq.pop(); + } + // Keep the top categories top, but then sort by the key for those with duplicate counts + if (reduceContext.isFinalReduce()) { + Arrays.sort(bucketList, Comparator.comparing(Bucket::getDocCount).reversed().thenComparing(Bucket::getRawKey)); + } + return new InternalCategorizationAggregation( + name, + requiredSize, + minDocCount, + maxUniqueTokens, + maxMatchTokens, + similarityThreshold, + metadata, + Arrays.asList(bucketList) + ); + } + } + + public int getMaxUniqueTokens() { + return maxUniqueTokens; + } + + public int getSimilarityThreshold() { + return similarityThreshold; + } + + public int getMaxMatchTokens() { + return maxMatchTokens; + } + + public int getRequiredSize() { + return requiredSize; + } + + public long getMinDocCount() { + return minDocCount; + } +} diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/categorization/TextCategorization.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/categorization/TextCategorization.java new file mode 100644 index 0000000000000..7ea72f489ae2d --- /dev/null +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/categorization/TextCategorization.java @@ -0,0 +1,117 @@ +/* + * 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.ml.aggs.categorization; + +import org.apache.lucene.util.Accountable; +import org.apache.lucene.util.RamUsageEstimator; + +import java.util.Arrays; + +import static org.elasticsearch.xpack.ml.aggs.categorization.CategorizationBytesRefHash.WILD_CARD_ID; + +/** + * A text categorization group that provides methods for: + * - calculating similarity between it and a new text + * - expanding the existing categorization by adding a new array of tokens + */ +class TextCategorization implements Accountable { + + private static final long SHALLOW_SIZE = RamUsageEstimator.shallowSizeOfInstance(TextCategorization.class); + private final long id; + private final int[] categorization; + private final long[] tokenCounts; + private long count; + + // Used at the shard level for tracking the bucket ordinal for collecting sub aggregations + long bucketOrd; + + TextCategorization(int[] tokenIds, long count, long id) { + this.id = id; + this.categorization = tokenIds; + this.count = count; + this.tokenCounts = new long[tokenIds.length]; + Arrays.fill(this.tokenCounts, count); + } + + public long getId() { + return id; + } + + int[] getCategorization() { + return categorization; + } + + public long getCount() { + return count; + } + + Similarity calculateSimilarity(int[] tokenIds) { + assert tokenIds.length == this.categorization.length; + int eqParams = 0; + long tokenCount = 0; + long tokensKept = 0; + for (int i = 0; i < tokenIds.length; i++) { + if (tokenIds[i] == this.categorization[i]) { + tokensKept += tokenCounts[i]; + tokenCount += tokenCounts[i]; + } else if (this.categorization[i] == WILD_CARD_ID) { + eqParams++; + } else { + tokenCount += tokenCounts[i]; + } + } + return new Similarity((double) tokensKept / tokenCount, eqParams); + } + + void addTokens(int[] tokenIds, long docCount) { + assert tokenIds.length == this.categorization.length; + for (int i = 0; i < tokenIds.length; i++) { + if (tokenIds[i] != this.categorization[i]) { + this.categorization[i] = WILD_CARD_ID; + } else { + tokenCounts[i] += docCount; + } + } + this.count += docCount; + } + + @Override + public long ramBytesUsed() { + return SHALLOW_SIZE + + RamUsageEstimator.sizeOf(categorization) // categorization token Ids + + RamUsageEstimator.sizeOf(tokenCounts); // tokenCounts + } + + static class Similarity implements Comparable { + private final double similarity; + private final int wildCardCount; + + private Similarity(double similarity, int wildCardCount) { + this.similarity = similarity; + this.wildCardCount = wildCardCount; + } + + @Override + public int compareTo(Similarity o) { + int d = Double.compare(similarity, o.similarity); + if (d != 0) { + return d; + } + return Integer.compare(wildCardCount, o.wildCardCount); + } + + public double getSimilarity() { + return similarity; + } + + public int getWildCardCount() { + return wildCardCount; + } + } + +} diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/categorization/TreeNode.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/categorization/TreeNode.java new file mode 100644 index 0000000000000..7b13e93d8f1ea --- /dev/null +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/categorization/TreeNode.java @@ -0,0 +1,406 @@ +/* + * 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.ml.aggs.categorization; + +import org.apache.lucene.util.Accountable; +import org.apache.lucene.util.RamUsageEstimator; +import org.elasticsearch.core.Tuple; +import org.elasticsearch.search.aggregations.AggregationExecutionException; + +import java.util.ArrayList; +import java.util.Comparator; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import java.util.PriorityQueue; +import java.util.stream.Collectors; + +import static org.apache.lucene.util.RamUsageEstimator.NUM_BYTES_OBJECT_REF; +import static org.apache.lucene.util.RamUsageEstimator.sizeOfCollection; +import static org.apache.lucene.util.RamUsageEstimator.sizeOfMap; +import static org.elasticsearch.xpack.ml.aggs.categorization.CategorizationBytesRefHash.WILD_CARD_ID; + +/** + * Tree node classes for the categorization token tree. + * + * Two major node types exist: + * - Inner: which are nodes that have children token nodes + * - Leaf: Which collection multiple {@link TextCategorization} based on similarity restrictions + */ +abstract class TreeNode implements Accountable { + + private long count; + + TreeNode(long count) { + this.count = count; + } + + abstract void mergeWith(TreeNode otherNode); + + abstract boolean isLeaf(); + + final void incCount(long count) { + this.count += count; + } + + final long getCount() { + return count; + } + + // TODO add option for calculating the cost of adding the new group + abstract TextCategorization addText(int[] tokenIds, long docCount, CategorizationTokenTree treeNodeFactory); + + abstract TextCategorization getCategorization(int[] tokenIds); + + abstract List getAllChildrenTextCategorizations(); + + abstract void collapseTinyChildren(); + + static class LeafTreeNode extends TreeNode { + private final List textCategorizations; + private final int similarityThreshold; + + LeafTreeNode(long count, int similarityThreshold) { + super(count); + this.textCategorizations = new ArrayList<>(); + this.similarityThreshold = similarityThreshold; + if (similarityThreshold < 1 || similarityThreshold > 100) { + throw new IllegalArgumentException("similarityThreshold must be between 1 and 100"); + } + } + + @Override + public boolean isLeaf() { + return true; + } + + @Override + void mergeWith(TreeNode treeNode) { + if (treeNode == null) { + return; + } + if (treeNode.isLeaf() == false) { + throw new UnsupportedOperationException( + "cannot merge leaf node with non-leaf node in categorization tree \n[" + this + "]\n[" + treeNode + "]" + ); + } + incCount(treeNode.getCount()); + LeafTreeNode otherLeaf = (LeafTreeNode) treeNode; + for (TextCategorization group : otherLeaf.textCategorizations) { + if (getAndUpdateTextCategorization(group.getCategorization(), group.getCount()).isPresent() == false) { + putNewTextCategorization(group); + } + } + } + + @Override + public long ramBytesUsed() { + return Long.BYTES // count + + NUM_BYTES_OBJECT_REF // list reference + + Integer.BYTES // similarityThreshold + + sizeOfCollection(textCategorizations); + } + + @Override + public TextCategorization addText(int[] tokenIds, long docCount, CategorizationTokenTree treeNodeFactory) { + return getAndUpdateTextCategorization(tokenIds, docCount).orElseGet(() -> { + // Need to update the tree if possible + TextCategorization categorization = putNewTextCategorization(treeNodeFactory.newCategorization(docCount, tokenIds)); + // Get the regular size bytes from the TextCategorization and how much it costs to reference it + treeNodeFactory.incSize(categorization.ramBytesUsed() + RamUsageEstimator.NUM_BYTES_OBJECT_REF); + return categorization; + }); + } + + @Override + List getAllChildrenTextCategorizations() { + return textCategorizations; + } + + @Override + void collapseTinyChildren() {} + + private Optional getAndUpdateTextCategorization(int[] tokenIds, long docCount) { + return getBestCategorization(tokenIds).map(bestGroupAndSimilarity -> { + if ((bestGroupAndSimilarity.v2() * 100) >= similarityThreshold) { + bestGroupAndSimilarity.v1().addTokens(tokenIds, docCount); + return bestGroupAndSimilarity.v1(); + } + return null; + }); + } + + TextCategorization putNewTextCategorization(TextCategorization categorization) { + textCategorizations.add(categorization); + return categorization; + } + + private Optional> getBestCategorization(int[] tokenIds) { + if (textCategorizations.isEmpty()) { + return Optional.empty(); + } + if (textCategorizations.size() == 1) { + return Optional.of( + new Tuple<>(textCategorizations.get(0), textCategorizations.get(0).calculateSimilarity( tokenIds).getSimilarity()) + ); + } + TextCategorization.Similarity maxSimilarity = null; + TextCategorization bestGroup = null; + for (TextCategorization textCategorization : this.textCategorizations) { + TextCategorization.Similarity groupSimilarity = textCategorization.calculateSimilarity( tokenIds); + if (maxSimilarity == null || groupSimilarity.compareTo(maxSimilarity) > 0) { + maxSimilarity = groupSimilarity; + bestGroup = textCategorization; + } + } + return Optional.of(new Tuple<>(bestGroup, maxSimilarity.getSimilarity())); + } + + @Override + public TextCategorization getCategorization(final int[] tokenIds) { + return getBestCategorization(tokenIds).map(Tuple::v1).orElse(null); + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + LeafTreeNode that = (LeafTreeNode) o; + return that.similarityThreshold == similarityThreshold + && Objects.equals(textCategorizations, that.textCategorizations); + } + + @Override + public int hashCode() { + return Objects.hash(textCategorizations, similarityThreshold); + } + } + + static class InnerTreeNode extends TreeNode { + + // TODO: Change to LongObjectMap? + private final Map children; + private final int childrenTokenPos; + private final int maxChildren; + private final PriorityQueue smallestChild; + + InnerTreeNode(long count, int childrenTokenPos, int maxChildren) { + super(count); + children = new HashMap<>(); + this.childrenTokenPos = childrenTokenPos; + this.maxChildren = maxChildren; + this.smallestChild = new PriorityQueue<>(maxChildren, Comparator.comparing(NativeIntLongPair::count)); + } + + @Override + boolean isLeaf() { + return false; + } + + @Override + public TextCategorization getCategorization(final int[] tokenIds) { + return getChild(tokenIds[childrenTokenPos]).or(() -> getChild(WILD_CARD_ID)) + .map(node -> node.getCategorization(tokenIds)) + .orElse(null); + } + + @Override + public long ramBytesUsed() { + return Long.BYTES // count + + NUM_BYTES_OBJECT_REF // children reference + + Integer.BYTES // childrenTokenPos + + Integer.BYTES // maxChildren + + NUM_BYTES_OBJECT_REF // smallestChildReference + + sizeOfMap(children, NUM_BYTES_OBJECT_REF) // children, + // Number of items in the queue, reference to tuple, and then the tuple references + + (long) smallestChild.size() * (NUM_BYTES_OBJECT_REF + Integer.BYTES + Long.BYTES); + } + + @Override + public TextCategorization addText(final int[] tokenIds, final long docCount, final CategorizationTokenTree treeNodeFactory) { + final int currentToken = tokenIds[childrenTokenPos]; + TreeNode child = getChild(currentToken).map(node -> { + node.incCount(docCount); + if (smallestChild.isEmpty() == false && smallestChild.peek().tokenId == currentToken) { + smallestChild.add(smallestChild.poll()); + } + return node; + }).orElseGet(() -> { + TreeNode newNode = treeNodeFactory.newNode(docCount, childrenTokenPos + 1, tokenIds); + // The size of the node + entry (since it is a map entry) + extra reference for priority queue + treeNodeFactory.incSize( + newNode.ramBytesUsed() + RamUsageEstimator.HASHTABLE_RAM_BYTES_PER_ENTRY + RamUsageEstimator.NUM_BYTES_OBJECT_REF + ); + return addChild(currentToken, newNode); + }); + return child.addText(tokenIds, docCount, treeNodeFactory); + } + + @Override + void collapseTinyChildren() { + if (this.isLeaf()) { + return; + } + if (children.size() <= 1) { + return; + } + Optional maybeWildChild = getChild(WILD_CARD_ID).or(() -> { + if ((double) smallestChild.peek().count / this.getCount() <= 1.0 / maxChildren) { + TreeNode tinyChild = children.remove(smallestChild.poll().tokenId); + return Optional.of(addChild(WILD_CARD_ID, tinyChild)); + } + return Optional.empty(); + }); + if (maybeWildChild.isPresent()) { + TreeNode wildChild = maybeWildChild.get(); + NativeIntLongPair tinyNode; + while ((tinyNode = smallestChild.poll()) != null) { + // If we have no more tiny nodes, stop iterating over them + if ((double) tinyNode.count / this.getCount() > 1.0 / maxChildren) { + smallestChild.add(tinyNode); + break; + } else { + wildChild.mergeWith(children.remove(tinyNode.count)); + } + } + } + children.values().forEach(TreeNode::collapseTinyChildren); + } + + @Override + void mergeWith(TreeNode treeNode) { + if (treeNode == null) { + return; + } + incCount(treeNode.count); + if (treeNode.isLeaf()) { + throw new UnsupportedOperationException( + "cannot merge non-leaf node with leaf node in categorization tree \n[" + this + "]\n[" + treeNode + "]" + ); + } + InnerTreeNode innerTreeNode = (InnerTreeNode) treeNode; + TreeNode siblingWildChild = innerTreeNode.children.remove(WILD_CARD_ID); + addChild(WILD_CARD_ID, siblingWildChild); + NativeIntLongPair siblingChild; + while ((siblingChild = innerTreeNode.smallestChild.poll()) != null) { + TreeNode nephewNode = innerTreeNode.children.remove(siblingChild.tokenId); + addChild(siblingChild.tokenId, nephewNode); + } + } + + private TreeNode addChild(int tokenId, TreeNode node) { + if (node == null) { + return null; + } + Optional existingChild = getChild(tokenId).map(existingNode -> { + existingNode.mergeWith(node); + if (smallestChild.isEmpty() == false && smallestChild.peek().tokenId == tokenId) { + smallestChild.poll(); + smallestChild.add(NativeIntLongPair.of(tokenId, existingNode.getCount())); + } + return existingNode; + }); + if (existingChild.isPresent()) { + return existingChild.get(); + } + if (children.size() == maxChildren) { + return getChild(WILD_CARD_ID).map(wildChild -> { + final TreeNode toMerge; + final TreeNode toReturn; + if (smallestChild.isEmpty() == false && node.getCount() > smallestChild.peek().count) { + toMerge = children.remove(smallestChild.poll().tokenId); + addChildAndUpdateSmallest(tokenId, node); + toReturn = node; + } else { + toMerge = node; + toReturn = wildChild; + } + wildChild.mergeWith(toMerge); + return toReturn; + }).orElseThrow(() -> new AggregationExecutionException("Missing wild_card child even though maximum children reached")); + } + // we are about to hit the limit, add a wild card if we need to and then add the new child as appropriate + if (children.size() == maxChildren - 1) { + // If we already have a wild token, simply adding the new token is acceptable as we won't breach our limit + if (children.containsKey(WILD_CARD_ID)) { + addChildAndUpdateSmallest(tokenId, node); + } else { // if we don't have a wild card child, we need to add one now + if (tokenId == WILD_CARD_ID) { + addChildAndUpdateSmallest(tokenId, node); + } else { + if (smallestChild.isEmpty() == false && node.count > smallestChild.peek().count) { + addChildAndUpdateSmallest(WILD_CARD_ID, children.remove(smallestChild.poll().tokenId)); + addChildAndUpdateSmallest(tokenId, node); + } else { + addChildAndUpdateSmallest(WILD_CARD_ID, node); + } + } + } + } else { + addChildAndUpdateSmallest(tokenId, node); + } + return node; + } + + private void addChildAndUpdateSmallest(int tokenId, TreeNode node) { + children.put(tokenId, node); + if (tokenId != WILD_CARD_ID) { + smallestChild.add(NativeIntLongPair.of(tokenId, node.count)); + } + } + + private Optional getChild(int tokenId) { + return Optional.ofNullable(children.get(tokenId)); + } + + public List getAllChildrenTextCategorizations() { + return children.values().stream().flatMap(c -> c.getAllChildrenTextCategorizations().stream()).collect(Collectors.toList()); + } + + boolean hasChild(int tokenId) { + return children.containsKey(tokenId); + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + InnerTreeNode treeNode = (InnerTreeNode) o; + return childrenTokenPos == treeNode.childrenTokenPos + && getCount() == treeNode.getCount() + && Objects.equals(children, treeNode.children) + && Objects.equals(smallestChild, treeNode.smallestChild); + } + + @Override + public int hashCode() { + return Objects.hash(children, childrenTokenPos, smallestChild, getCount()); + } + } + + private static class NativeIntLongPair { + private final int tokenId; + private final long count; + + static NativeIntLongPair of(int tokenId, long count) { + return new NativeIntLongPair(tokenId, count); + } + + NativeIntLongPair(int tokenId, long count) { + this.tokenId = tokenId; + this.count = count; + } + + public long count() { + return count; + } + } + +} diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/categorization/UnmappedCategorizationAggregation.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/categorization/UnmappedCategorizationAggregation.java new file mode 100644 index 0000000000000..ae1081f66d09f --- /dev/null +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/categorization/UnmappedCategorizationAggregation.java @@ -0,0 +1,71 @@ +/* + * 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.ml.aggs.categorization; + +import org.elasticsearch.search.aggregations.InternalAggregation; +import org.elasticsearch.search.aggregations.InternalAggregations; + +import java.util.List; +import java.util.Map; + + +class UnmappedCategorizationAggregation extends InternalCategorizationAggregation { + protected UnmappedCategorizationAggregation( + String name, + int requiredSize, + long minDocCount, + int maxChildren, + int maxDepth, + int similarityThreshold, + Map metadata + ) { + super(name, requiredSize, minDocCount, maxChildren, maxDepth, similarityThreshold, metadata); + } + + @Override + public InternalCategorizationAggregation create(List buckets) { + return new UnmappedCategorizationAggregation( + name, + getRequiredSize(), + getMinDocCount(), + getMaxUniqueTokens(), + getMaxMatchTokens(), + getSimilarityThreshold(), + super.metadata + ); + } + + @Override + public Bucket createBucket(InternalAggregations aggregations, Bucket prototype) { + throw new UnsupportedOperationException("not supported for UnmappedCategorizationAggregation"); + } + + @Override + public InternalAggregation reduce(List aggregations, ReduceContext reduceContext) { + return new UnmappedCategorizationAggregation( + name, + getRequiredSize(), + getMinDocCount(), + getMaxUniqueTokens(), + getMaxMatchTokens(), + getSimilarityThreshold(), + super.metadata + ); + } + + @Override + public boolean isMapped() { + return false; + } + + @Override + public List getBuckets() { + return List.of(); + } + +} diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/categorization/CategorizationAnalyzer.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/categorization/CategorizationAnalyzer.java index 4fc99e1502851..6147bc0256ca5 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/categorization/CategorizationAnalyzer.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/categorization/CategorizationAnalyzer.java @@ -10,11 +10,11 @@ import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; import org.elasticsearch.ElasticsearchException; +import org.elasticsearch.core.Releasable; import org.elasticsearch.core.Tuple; import org.elasticsearch.index.analysis.AnalysisRegistry; import org.elasticsearch.xpack.core.ml.job.config.CategorizationAnalyzerConfig; -import java.io.Closeable; import java.io.IOException; import java.util.ArrayList; import java.util.List; @@ -25,7 +25,7 @@ * Converts messages to lists of tokens that will be fed to the ML categorization algorithm. * */ -public class CategorizationAnalyzer implements Closeable { +public class CategorizationAnalyzer implements Releasable { private final Analyzer analyzer; private final boolean closeAnalyzer; @@ -38,6 +38,16 @@ public CategorizationAnalyzer(AnalysisRegistry analysisRegistry, closeAnalyzer = tuple.v2(); } + public CategorizationAnalyzer(Analyzer analyzer, boolean closeAnalyzer) { + this.analyzer = analyzer; + this.closeAnalyzer = closeAnalyzer; + } + + public final TokenStream tokenStream(final String fieldName, + final String text) { + return analyzer.tokenStream(fieldName, text); + } + /** * Release resources held by the analyzer (unless it's global). */ diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/LocalStateMachineLearning.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/LocalStateMachineLearning.java index 750f36863a141..d6f147f831df7 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/LocalStateMachineLearning.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/LocalStateMachineLearning.java @@ -17,6 +17,9 @@ import org.elasticsearch.common.breaker.NoopCircuitBreaker; import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.index.analysis.CharFilterFactory; +import org.elasticsearch.index.analysis.TokenizerFactory; +import org.elasticsearch.indices.analysis.AnalysisModule; import org.elasticsearch.license.LicenseService; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.plugins.ActionPlugin; @@ -33,6 +36,7 @@ import java.util.Collections; import java.util.HashSet; import java.util.List; +import java.util.Map; import static org.elasticsearch.xpack.ml.MachineLearning.TRAINED_MODEL_CIRCUIT_BREAKER_NAME; @@ -84,6 +88,20 @@ public void cleanUpFeature( mlPlugin.cleanUpFeature(clusterService, client, finalListener); } + @Override + public List getAggregations() { + return mlPlugin.getAggregations(); + } + + @Override + public Map> getCharFilters() { + return mlPlugin.getCharFilters(); + } + + @Override + public Map> getTokenizers() { + return mlPlugin.getTokenizers(); + } /** * This is only required as we now have to have the GetRollupIndexCapsAction as a valid action in our node. diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/categorization/CategorizeTextAggregationBuilderTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/categorization/CategorizeTextAggregationBuilderTests.java new file mode 100644 index 0000000000000..7b907ea3ecd29 --- /dev/null +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/categorization/CategorizeTextAggregationBuilderTests.java @@ -0,0 +1,60 @@ +/* + * 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.ml.aggs.categorization; + +import org.elasticsearch.plugins.Plugin; +import org.elasticsearch.search.aggregations.BaseAggregationTestCase; +import org.elasticsearch.xpack.ml.MachineLearning; +import org.elasticsearch.xpack.ml.job.config.CategorizationAnalyzerConfigTests; + +import java.util.Collection; +import java.util.Collections; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +public class CategorizeTextAggregationBuilderTests extends BaseAggregationTestCase { + + @Override + protected Collection> getExtraPlugins() { + return Collections.singletonList(MachineLearning.class); + } + + @Override + protected CategorizeTextAggregationBuilder createTestAggregatorBuilder() { + CategorizeTextAggregationBuilder builder = new CategorizeTextAggregationBuilder(randomAlphaOfLength(10), randomAlphaOfLength(10)); + final boolean setFilters = randomBoolean(); + if (setFilters) { + builder.setCategorizationFilters(Stream.generate(() -> randomAlphaOfLength(10)).limit(5).collect(Collectors.toList())); + } + if (setFilters == false) { + builder.setCategorizationAnalyzerConfig(CategorizationAnalyzerConfigTests.createRandomized().build()); + } + if (randomBoolean()) { + builder.setMaxUniqueTokens(randomIntBetween(1, 500)); + } + if (randomBoolean()) { + builder.setMaxMatchedTokens(randomIntBetween(1, 10)); + } + if (randomBoolean()) { + builder.setSimilarityThreshold(randomIntBetween(1, 100)); + } + if (randomBoolean()) { + builder.minDocCount(randomLongBetween(1, 100)); + } + if (randomBoolean()) { + builder.shardMinDocCount(randomLongBetween(1, 100)); + } + if (randomBoolean()) { + builder.size(randomIntBetween(1, 100)); + } + if (randomBoolean()) { + builder.shardSize(randomIntBetween(1, 100)); + } + return builder; + } +} diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/categorization/CategorizeTextAggregatorTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/categorization/CategorizeTextAggregatorTests.java new file mode 100644 index 0000000000000..95cfdcb0f8f8f --- /dev/null +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/categorization/CategorizeTextAggregatorTests.java @@ -0,0 +1,342 @@ +/* + * 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.ml.aggs.categorization; + +import org.apache.lucene.document.SortedNumericDocValuesField; +import org.apache.lucene.document.StoredField; +import org.apache.lucene.index.RandomIndexWriter; +import org.apache.lucene.search.MatchAllDocsQuery; +import org.apache.lucene.util.BytesRef; +import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.env.Environment; +import org.elasticsearch.env.TestEnvironment; +import org.elasticsearch.index.mapper.TextFieldMapper; +import org.elasticsearch.indices.analysis.AnalysisModule; +import org.elasticsearch.plugins.SearchPlugin; +import org.elasticsearch.search.aggregations.AggregatorTestCase; +import org.elasticsearch.search.aggregations.bucket.histogram.Histogram; +import org.elasticsearch.search.aggregations.bucket.histogram.HistogramAggregationBuilder; +import org.elasticsearch.search.aggregations.bucket.histogram.InternalHistogram; +import org.elasticsearch.search.aggregations.metrics.Avg; +import org.elasticsearch.search.aggregations.metrics.AvgAggregationBuilder; +import org.elasticsearch.search.aggregations.metrics.Max; +import org.elasticsearch.search.aggregations.metrics.MaxAggregationBuilder; +import org.elasticsearch.search.aggregations.metrics.Min; +import org.elasticsearch.search.aggregations.metrics.MinAggregationBuilder; +import org.elasticsearch.xpack.ml.MachineLearning; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; + +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.hasSize; + +public class CategorizeTextAggregatorTests extends AggregatorTestCase { + + @Override + protected AnalysisModule createAnalysisModule() throws Exception { + return new AnalysisModule( + TestEnvironment.newEnvironment( + Settings.builder().put(Environment.PATH_HOME_SETTING.getKey(), createTempDir().toString()).build() + ), + List.of(new MachineLearning(Settings.EMPTY, null)) + ); + } + + @Override + protected List getSearchPlugins() { + return List.of(new MachineLearning(Settings.EMPTY, null)); + } + + private static final String TEXT_FIELD_NAME = "text"; + private static final String NUMERIC_FIELD_NAME = "value"; + + public void testCategorizationWithoutSubAggs() throws Exception { + testCase( + new CategorizeTextAggregationBuilder("my_agg", TEXT_FIELD_NAME), + new MatchAllDocsQuery(), + CategorizeTextAggregatorTests::writeTestDocs, + (InternalCategorizationAggregation result) -> { + assertThat(result.getBuckets(), hasSize(2)); + assertThat(result.getBuckets().get(0).docCount, equalTo(6L)); + assertThat(result.getBuckets().get(0).getKeyAsString(), equalTo("Node started")); + assertThat(result.getBuckets().get(1).docCount, equalTo(2L)); + assertThat( + result.getBuckets().get(1).getKeyAsString(), + equalTo("Failed to shutdown error org.aaaa.bbbb.Cccc line caused by foo exception") + ); + }, + new TextFieldMapper.TextFieldType(TEXT_FIELD_NAME), + longField(NUMERIC_FIELD_NAME) + ); + } + + public void testCategorizationWithSubAggs() throws Exception { + CategorizeTextAggregationBuilder aggBuilder = new CategorizeTextAggregationBuilder("my_agg", TEXT_FIELD_NAME).subAggregation( + new MaxAggregationBuilder("max").field(NUMERIC_FIELD_NAME) + ) + .subAggregation(new AvgAggregationBuilder("avg").field(NUMERIC_FIELD_NAME)) + .subAggregation(new MinAggregationBuilder("min").field(NUMERIC_FIELD_NAME)); + testCase( + aggBuilder, + new MatchAllDocsQuery(), + CategorizeTextAggregatorTests::writeTestDocs, + (InternalCategorizationAggregation result) -> { + assertThat(result.getBuckets(), hasSize(2)); + assertThat(result.getBuckets().get(0).docCount, equalTo(6L)); + assertThat(result.getBuckets().get(0).getKeyAsString(), equalTo("Node started")); + assertThat(((Max) result.getBuckets().get(0).aggregations.get("max")).getValue(), equalTo(5.0)); + assertThat(((Min) result.getBuckets().get(0).aggregations.get("min")).getValue(), equalTo(0.0)); + assertThat(((Avg) result.getBuckets().get(0).aggregations.get("avg")).getValue(), equalTo(2.5)); + + assertThat(result.getBuckets().get(1).docCount, equalTo(2L)); + assertThat( + result.getBuckets().get(1).getKeyAsString(), + equalTo("Failed to shutdown error org.aaaa.bbbb.Cccc line caused by foo exception") + ); + assertThat(((Max) result.getBuckets().get(1).aggregations.get("max")).getValue(), equalTo(4.0)); + assertThat(((Min) result.getBuckets().get(1).aggregations.get("min")).getValue(), equalTo(0.0)); + assertThat(((Avg) result.getBuckets().get(1).aggregations.get("avg")).getValue(), equalTo(2.0)); + }, + new TextFieldMapper.TextFieldType(TEXT_FIELD_NAME), + longField(NUMERIC_FIELD_NAME) + ); + } + + public void testCategorizationWithMultiBucketSubAggs() throws Exception { + CategorizeTextAggregationBuilder aggBuilder = new CategorizeTextAggregationBuilder("my_agg", TEXT_FIELD_NAME).subAggregation( + new HistogramAggregationBuilder("histo").field(NUMERIC_FIELD_NAME) + .interval(2) + .subAggregation(new MaxAggregationBuilder("max").field(NUMERIC_FIELD_NAME)) + .subAggregation(new AvgAggregationBuilder("avg").field(NUMERIC_FIELD_NAME)) + .subAggregation(new MinAggregationBuilder("min").field(NUMERIC_FIELD_NAME)) + ); + testCase( + aggBuilder, + new MatchAllDocsQuery(), + CategorizeTextAggregatorTests::writeTestDocs, + (InternalCategorizationAggregation result) -> { + assertThat(result.getBuckets(), hasSize(2)); + assertThat(result.getBuckets().get(0).docCount, equalTo(6L)); + assertThat(result.getBuckets().get(0).getKeyAsString(), equalTo("Node started")); + Histogram histo = result.getBuckets().get(0).aggregations.get("histo"); + assertThat(histo.getBuckets(), hasSize(3)); + for (Histogram.Bucket bucket : histo.getBuckets()) { + assertThat(bucket.getDocCount(), equalTo(2L)); + } + assertThat(((Max) histo.getBuckets().get(0).getAggregations().get("max")).getValue(), equalTo(1.0)); + assertThat(((Min) histo.getBuckets().get(0).getAggregations().get("min")).getValue(), equalTo(0.0)); + assertThat(((Avg) histo.getBuckets().get(0).getAggregations().get("avg")).getValue(), equalTo(0.5)); + assertThat(((Max) histo.getBuckets().get(1).getAggregations().get("max")).getValue(), equalTo(3.0)); + assertThat(((Min) histo.getBuckets().get(1).getAggregations().get("min")).getValue(), equalTo(2.0)); + assertThat(((Avg) histo.getBuckets().get(1).getAggregations().get("avg")).getValue(), equalTo(2.5)); + assertThat(((Max) histo.getBuckets().get(2).getAggregations().get("max")).getValue(), equalTo(5.0)); + assertThat(((Min) histo.getBuckets().get(2).getAggregations().get("min")).getValue(), equalTo(4.0)); + assertThat(((Avg) histo.getBuckets().get(2).getAggregations().get("avg")).getValue(), equalTo(4.5)); + + assertThat(result.getBuckets().get(1).docCount, equalTo(2L)); + assertThat( + result.getBuckets().get(1).getKeyAsString(), + equalTo("Failed to shutdown error org.aaaa.bbbb.Cccc line caused by foo exception") + ); + histo = result.getBuckets().get(1).aggregations.get("histo"); + assertThat(histo.getBuckets(), hasSize(3)); + assertThat(histo.getBuckets().get(0).getDocCount(), equalTo(1L)); + assertThat(histo.getBuckets().get(1).getDocCount(), equalTo(0L)); + assertThat(histo.getBuckets().get(2).getDocCount(), equalTo(1L)); + assertThat(((Avg) histo.getBuckets().get(0).getAggregations().get("avg")).getValue(), equalTo(0.0)); + assertThat(((Avg) histo.getBuckets().get(2).getAggregations().get("avg")).getValue(), equalTo(4.0)); + }, + new TextFieldMapper.TextFieldType(TEXT_FIELD_NAME), + longField(NUMERIC_FIELD_NAME) + ); + } + + public void testCategorizationAsSubAgg() throws Exception { + HistogramAggregationBuilder aggBuilder = new HistogramAggregationBuilder("histo").field(NUMERIC_FIELD_NAME) + .interval(2) + .subAggregation( + new CategorizeTextAggregationBuilder("my_agg", TEXT_FIELD_NAME).subAggregation( + new MaxAggregationBuilder("max").field(NUMERIC_FIELD_NAME) + ) + .subAggregation(new AvgAggregationBuilder("avg").field(NUMERIC_FIELD_NAME)) + .subAggregation(new MinAggregationBuilder("min").field(NUMERIC_FIELD_NAME)) + ); + testCase( + aggBuilder, + new MatchAllDocsQuery(), + CategorizeTextAggregatorTests::writeTestDocs, + (InternalHistogram result) -> { + assertThat(result.getBuckets(), hasSize(3)); + + // First histo bucket + assertThat(result.getBuckets().get(0).getDocCount(), equalTo(3L)); + InternalCategorizationAggregation categorizationAggregation = result.getBuckets().get(0).getAggregations().get("my_agg"); + assertThat(categorizationAggregation.getBuckets(), hasSize(2)); + assertThat(categorizationAggregation.getBuckets().get(0).docCount, equalTo(2L)); + assertThat(categorizationAggregation.getBuckets().get(0).getKeyAsString(), equalTo("Node started")); + assertThat(((Max) categorizationAggregation.getBuckets().get(0).aggregations.get("max")).getValue(), equalTo(1.0)); + assertThat(((Min) categorizationAggregation.getBuckets().get(0).aggregations.get("min")).getValue(), equalTo(0.0)); + assertThat(((Avg) categorizationAggregation.getBuckets().get(0).aggregations.get("avg")).getValue(), equalTo(0.5)); + + assertThat(categorizationAggregation.getBuckets().get(1).docCount, equalTo(1L)); + assertThat( + categorizationAggregation.getBuckets().get(1).getKeyAsString(), + equalTo("Failed to shutdown error org.aaaa.bbbb.Cccc line caused by foo exception") + ); + assertThat(((Max) categorizationAggregation.getBuckets().get(1).aggregations.get("max")).getValue(), equalTo(0.0)); + assertThat(((Min) categorizationAggregation.getBuckets().get(1).aggregations.get("min")).getValue(), equalTo(0.0)); + assertThat(((Avg) categorizationAggregation.getBuckets().get(1).aggregations.get("avg")).getValue(), equalTo(0.0)); + + // Second histo bucket + assertThat(result.getBuckets().get(1).getDocCount(), equalTo(2L)); + categorizationAggregation = result.getBuckets().get(1).getAggregations().get("my_agg"); + assertThat(categorizationAggregation.getBuckets(), hasSize(1)); + assertThat(categorizationAggregation.getBuckets().get(0).docCount, equalTo(2L)); + assertThat(categorizationAggregation.getBuckets().get(0).getKeyAsString(), equalTo("Node started")); + assertThat(((Max) categorizationAggregation.getBuckets().get(0).aggregations.get("max")).getValue(), equalTo(3.0)); + assertThat(((Min) categorizationAggregation.getBuckets().get(0).aggregations.get("min")).getValue(), equalTo(2.0)); + assertThat(((Avg) categorizationAggregation.getBuckets().get(0).aggregations.get("avg")).getValue(), equalTo(2.5)); + + // Third histo bucket + assertThat(result.getBuckets().get(2).getDocCount(), equalTo(3L)); + categorizationAggregation = result.getBuckets().get(2).getAggregations().get("my_agg"); + assertThat(categorizationAggregation.getBuckets(), hasSize(2)); + assertThat(categorizationAggregation.getBuckets().get(0).docCount, equalTo(2L)); + assertThat(categorizationAggregation.getBuckets().get(0).getKeyAsString(), equalTo("Node started")); + assertThat(((Max) categorizationAggregation.getBuckets().get(0).aggregations.get("max")).getValue(), equalTo(5.0)); + assertThat(((Min) categorizationAggregation.getBuckets().get(0).aggregations.get("min")).getValue(), equalTo(4.0)); + assertThat(((Avg) categorizationAggregation.getBuckets().get(0).aggregations.get("avg")).getValue(), equalTo(4.5)); + + assertThat(categorizationAggregation.getBuckets().get(1).docCount, equalTo(1L)); + assertThat( + categorizationAggregation.getBuckets().get(1).getKeyAsString(), + equalTo("Failed to shutdown error org.aaaa.bbbb.Cccc line caused by foo exception") + ); + assertThat(((Max) categorizationAggregation.getBuckets().get(1).aggregations.get("max")).getValue(), equalTo(4.0)); + assertThat(((Min) categorizationAggregation.getBuckets().get(1).aggregations.get("min")).getValue(), equalTo(4.0)); + assertThat(((Avg) categorizationAggregation.getBuckets().get(1).aggregations.get("avg")).getValue(), equalTo(4.0)); + }, + new TextFieldMapper.TextFieldType(TEXT_FIELD_NAME), + longField(NUMERIC_FIELD_NAME) + ); + } + + public void testCategorizationWithSubAggsManyDocs() throws Exception { + CategorizeTextAggregationBuilder aggBuilder = new CategorizeTextAggregationBuilder("my_agg", TEXT_FIELD_NAME).subAggregation( + new HistogramAggregationBuilder("histo").field(NUMERIC_FIELD_NAME) + .interval(2) + .subAggregation(new MaxAggregationBuilder("max").field(NUMERIC_FIELD_NAME)) + .subAggregation(new AvgAggregationBuilder("avg").field(NUMERIC_FIELD_NAME)) + .subAggregation(new MinAggregationBuilder("min").field(NUMERIC_FIELD_NAME)) + ); + testCase( + aggBuilder, + new MatchAllDocsQuery(), + CategorizeTextAggregatorTests::writeManyTestDocs, + (InternalCategorizationAggregation result) -> { + assertThat(result.getBuckets(), hasSize(2)); + assertThat(result.getBuckets().get(0).docCount, equalTo(30_000L)); + assertThat(result.getBuckets().get(0).getKeyAsString(), equalTo("Node started")); + Histogram histo = result.getBuckets().get(0).aggregations.get("histo"); + assertThat(histo.getBuckets(), hasSize(3)); + for (Histogram.Bucket bucket : histo.getBuckets()) { + assertThat(bucket.getDocCount(), equalTo(10_000L)); + } + assertThat(((Max) histo.getBuckets().get(0).getAggregations().get("max")).getValue(), equalTo(1.0)); + assertThat(((Min) histo.getBuckets().get(0).getAggregations().get("min")).getValue(), equalTo(0.0)); + assertThat(((Avg) histo.getBuckets().get(0).getAggregations().get("avg")).getValue(), equalTo(0.5)); + assertThat(((Max) histo.getBuckets().get(1).getAggregations().get("max")).getValue(), equalTo(3.0)); + assertThat(((Min) histo.getBuckets().get(1).getAggregations().get("min")).getValue(), equalTo(2.0)); + assertThat(((Avg) histo.getBuckets().get(1).getAggregations().get("avg")).getValue(), equalTo(2.5)); + assertThat(((Max) histo.getBuckets().get(2).getAggregations().get("max")).getValue(), equalTo(5.0)); + assertThat(((Min) histo.getBuckets().get(2).getAggregations().get("min")).getValue(), equalTo(4.0)); + assertThat(((Avg) histo.getBuckets().get(2).getAggregations().get("avg")).getValue(), equalTo(4.5)); + + assertThat(result.getBuckets().get(1).docCount, equalTo(10_000L)); + assertThat( + result.getBuckets().get(1).getKeyAsString(), + equalTo("Failed to shutdown error org.aaaa.bbbb.Cccc line caused by foo exception") + ); + histo = result.getBuckets().get(1).aggregations.get("histo"); + assertThat(histo.getBuckets(), hasSize(3)); + assertThat(histo.getBuckets().get(0).getDocCount(), equalTo(5_000L)); + assertThat(histo.getBuckets().get(1).getDocCount(), equalTo(0L)); + assertThat(histo.getBuckets().get(2).getDocCount(), equalTo(5_000L)); + assertThat(((Avg) histo.getBuckets().get(0).getAggregations().get("avg")).getValue(), equalTo(0.0)); + assertThat(((Avg) histo.getBuckets().get(2).getAggregations().get("avg")).getValue(), equalTo(4.0)); + }, + new TextFieldMapper.TextFieldType(TEXT_FIELD_NAME), + longField(NUMERIC_FIELD_NAME) + ); + } + + private static void writeTestDocs(RandomIndexWriter w) throws IOException { + w.addDocument( + Arrays.asList( + new StoredField("_source", new BytesRef("{\"text\":\"Node 1 started\"}")), + new SortedNumericDocValuesField(NUMERIC_FIELD_NAME, 0) + ) + ); + w.addDocument( + Arrays.asList( + new StoredField("_source", new BytesRef("{\"text\":\"Node 1 started\"}")), + new SortedNumericDocValuesField(NUMERIC_FIELD_NAME, 1) + ) + ); + w.addDocument( + Arrays.asList( + new StoredField( + "_source", + new BytesRef("{\"text\":\"Failed to shutdown [error org.aaaa.bbbb.Cccc line 54 caused by foo exception]\"}") + ), + new SortedNumericDocValuesField(NUMERIC_FIELD_NAME, 0) + ) + ); + w.addDocument( + Arrays.asList( + new StoredField( + "_source", + new BytesRef("{\"text\":\"Failed to shutdown [error org.aaaa.bbbb.Cccc line 54 caused by foo exception]\"}") + ), + new SortedNumericDocValuesField(NUMERIC_FIELD_NAME, 4) + ) + ); + w.addDocument( + Arrays.asList( + new StoredField("_source", new BytesRef("{\"text\":\"Node 2 started\"}")), + new SortedNumericDocValuesField(NUMERIC_FIELD_NAME, 2) + ) + ); + w.addDocument( + Arrays.asList( + new StoredField("_source", new BytesRef("{\"text\":\"Node 2 started\"}")), + new SortedNumericDocValuesField(NUMERIC_FIELD_NAME, 3) + ) + ); + w.addDocument( + Arrays.asList( + new StoredField("_source", new BytesRef("{\"text\":\"Node 3 started\"}")), + new SortedNumericDocValuesField(NUMERIC_FIELD_NAME, 4) + ) + ); + w.addDocument( + Arrays.asList( + new StoredField("_source", new BytesRef("{\"text\":\"Node 3 started\"}")), + new SortedNumericDocValuesField(NUMERIC_FIELD_NAME, 5) + ) + ); + } + + private static void writeManyTestDocs(RandomIndexWriter w) throws IOException { + for (int i = 0; i < 5_000; i++) { + writeTestDocs(w); + } + } +} diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/categorization/InnerTreeNodeTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/categorization/InnerTreeNodeTests.java new file mode 100644 index 0000000000000..e7f78a01d0130 --- /dev/null +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/categorization/InnerTreeNodeTests.java @@ -0,0 +1,123 @@ +/* + * 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.ml.aggs.categorization; + +import org.apache.lucene.util.BytesRef; +import org.elasticsearch.common.util.BytesRefHash; +import org.elasticsearch.test.ESTestCase; +import org.junit.After; +import org.junit.Before; + +import static org.elasticsearch.xpack.ml.aggs.categorization.CategorizationBytesRefHash.WILD_CARD_ID; +import static org.elasticsearch.xpack.ml.aggs.categorization.TextCategorizationTests.getTokens; +import static org.elasticsearch.xpack.ml.aggs.categorization.TextCategorizationTests.mockBigArrays; +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.is; + +public class InnerTreeNodeTests extends ESTestCase { + + private final CategorizationTokenTree factory = new CategorizationTokenTree(3, 4, 60); + private CategorizationBytesRefHash bytesRefHash; + + @Before + public void createRefHash() { + bytesRefHash = new CategorizationBytesRefHash(new BytesRefHash(1L, mockBigArrays())); + } + + @After + public void closeRefHash() { + bytesRefHash.close(); + } + + public void testAddText() { + TreeNode.InnerTreeNode innerTreeNode = new TreeNode.InnerTreeNode(1, 0, 3); + TextCategorization group = innerTreeNode.addText(getTokens(bytesRefHash, "foo", "bar", "baz", "biz"), 1, factory); + assertArrayEquals(group.getCategorization(), getTokens(bytesRefHash, "foo", "bar", "baz", "biz")); + + assertArrayEquals( + innerTreeNode.addText(getTokens(bytesRefHash, "foo2", "bar", "baz", "biz"), 1, factory).getCategorization(), + getTokens(bytesRefHash, "foo2", "bar", "baz", "biz") + ); + assertArrayEquals( + innerTreeNode.addText(getTokens(bytesRefHash, "foo3", "bar", "baz", "biz"), 1, factory).getCategorization(), + getTokens(bytesRefHash, "foo3", "bar", "baz", "biz") + ); + assertArrayEquals( + innerTreeNode.addText(getTokens(bytesRefHash, "foo4", "bar", "baz", "biz"), 1, factory).getCategorization(), + getTokens(bytesRefHash, "*", "bar", "baz", "biz") + ); + assertArrayEquals( + innerTreeNode.addText(getTokens(bytesRefHash, "foo", "bar", "baz", "bizzy"), 1, factory).getCategorization(), + getTokens(bytesRefHash, "foo", "bar", "baz", "*") + ); + } + + public void testAddTokensWithLargerIncoming() { + TreeNode.InnerTreeNode innerTreeNode = new TreeNode.InnerTreeNode(1, 0, 3); + TextCategorization group = innerTreeNode.addText(getTokens(bytesRefHash, "foo", "bar", "baz", "biz"), 100, factory); + assertArrayEquals(group.getCategorization(), getTokens(bytesRefHash, "foo", "bar", "baz", "biz")); + + assertArrayEquals( + innerTreeNode.addText(getTokens(bytesRefHash, "foo2", "bar", "baz", "biz"), 100, factory).getCategorization(), + getTokens(bytesRefHash, "foo2", "bar", "baz", "biz") + ); + assertArrayEquals( + innerTreeNode.addText(getTokens(bytesRefHash, "foosmall", "bar", "baz", "biz"), 1, factory).getCategorization(), + getTokens(bytesRefHash, "foosmall", "bar", "baz", "biz") + ); + assertArrayEquals( + innerTreeNode.addText(getTokens(bytesRefHash, "foobigun", "bar", "baz", "biz"), 1000, factory).getCategorization(), + getTokens(bytesRefHash, "foobigun", "bar", "baz", "biz") + ); + assertThat( + innerTreeNode.getCategorization(getTokens(bytesRefHash, "foosmall", "bar", "baz", "biz")).getCategorization(), + equalTo(getTokens(bytesRefHash, "*", "bar", "baz", "biz")) + ); + } + + public void testCollapseTinyChildren() { + TreeNode.InnerTreeNode innerTreeNode = new TreeNode.InnerTreeNode(1000, 0, 4); + TextCategorization group = innerTreeNode.addText(getTokens(bytesRefHash, "foo", "bar", "baz", "biz"), 1000, factory); + assertArrayEquals(group.getCategorization(), getTokens(bytesRefHash, "foo", "bar", "baz", "biz")); + + assertArrayEquals( + innerTreeNode.addText(getTokens(bytesRefHash, "foo2", "bar", "baz", "biz"), 1000, factory).getCategorization(), + getTokens(bytesRefHash, "foo2", "bar", "baz", "biz") + ); + innerTreeNode.incCount(1000); + assertArrayEquals( + innerTreeNode.addText(getTokens(bytesRefHash, "foosmall", "bar", "baz", "biz"), 1, factory).getCategorization(), + getTokens(bytesRefHash, "foosmall", "bar", "baz", "biz") + ); + innerTreeNode.incCount(1); + innerTreeNode.collapseTinyChildren(); + assertThat(innerTreeNode.hasChild(bytesRefHash.put(new BytesRef("foosmall"))), is(false)); + assertThat(innerTreeNode.hasChild(WILD_CARD_ID), is(true)); + } + + public void testMergeWith() { + TreeNode.InnerTreeNode innerTreeNode = new TreeNode.InnerTreeNode(1000, 0, 3); + innerTreeNode.addText(getTokens(bytesRefHash, "foo", "bar", "baz", "biz"), 1000, factory); + innerTreeNode.incCount(1000); + innerTreeNode.addText(getTokens(bytesRefHash, "foo2", "bar", "baz", "biz"), 1000, factory); + + expectThrows(UnsupportedOperationException.class, () -> innerTreeNode.mergeWith(new TreeNode.LeafTreeNode(1, 60))); + + TreeNode.InnerTreeNode mergeWith = new TreeNode.InnerTreeNode(1, 0, 3); + innerTreeNode.addText(getTokens(bytesRefHash, "foosmall", "bar", "baz", "biz"), 1, factory); + innerTreeNode.incCount(1); + innerTreeNode.addText(getTokens(bytesRefHash, "footiny", "bar", "baz", "biz"), 1, factory); + + innerTreeNode.mergeWith(mergeWith); + assertThat(innerTreeNode.hasChild(WILD_CARD_ID), is(true)); + assertArrayEquals( + innerTreeNode.getCategorization(getTokens(bytesRefHash, "footiny", "bar", "baz", "biz")).getCategorization(), + getTokens(bytesRefHash, "*", "bar", "baz", "biz") + ); + } +} diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/categorization/InternalCategorizationAggregationTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/categorization/InternalCategorizationAggregationTests.java new file mode 100644 index 0000000000000..749863b336fa2 --- /dev/null +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/categorization/InternalCategorizationAggregationTests.java @@ -0,0 +1,117 @@ +/* + * 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.ml.aggs.categorization; + +import org.apache.lucene.util.BytesRef; +import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.common.util.CollectionUtils; +import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.plugins.SearchPlugin; +import org.elasticsearch.search.aggregations.Aggregation; +import org.elasticsearch.search.aggregations.InternalAggregations; +import org.elasticsearch.search.aggregations.ParsedMultiBucketAggregation; +import org.elasticsearch.test.InternalMultiBucketAggregationTestCase; +import org.elasticsearch.xpack.ml.MachineLearning; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.function.Predicate; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +public class InternalCategorizationAggregationTests extends InternalMultiBucketAggregationTestCase { + + @Override + protected SearchPlugin registerPlugin() { + return new MachineLearning(Settings.EMPTY, null); + } + + @Override + protected List getNamedXContents() { + return CollectionUtils.appendToCopy( + super.getNamedXContents(), + new NamedXContentRegistry.Entry( + Aggregation.class, + new ParseField(CategorizeTextAggregationBuilder.NAME), + (p, c) -> ParsedCategorization.fromXContent(p, (String) c) + ) + ); + } + + @Override + protected void assertReduced(InternalCategorizationAggregation reduced, List inputs) { + Map reducedCounts = toCounts(reduced.getBuckets().stream()); + Map totalCounts = toCounts(inputs.stream().map(InternalCategorizationAggregation::getBuckets).flatMap(List::stream)); + + Map expectedReducedCounts = new HashMap<>(totalCounts); + expectedReducedCounts.keySet().retainAll(reducedCounts.keySet()); + assertEquals(expectedReducedCounts, reducedCounts); + } + + @Override + protected Predicate excludePathsFromXContentInsertion() { + return p -> p.contains("key"); + } + + static InternalCategorizationAggregation.BucketKey randomKey() { + int numVals = randomIntBetween(1, 50); + return new InternalCategorizationAggregation.BucketKey( + Stream.generate(() -> randomAlphaOfLength(10)).limit(numVals).map(BytesRef::new).toArray(BytesRef[]::new) + ); + } + + @Override + protected InternalCategorizationAggregation createTestInstance( + String name, + Map metadata, + InternalAggregations aggregations + ) { + List buckets = new ArrayList<>(); + final int numBuckets = randomNumberOfBuckets(); + HashSet keys = new HashSet<>(); + for (int i = 0; i < numBuckets; ++i) { + InternalCategorizationAggregation.BucketKey key = randomValueOtherThanMany( + l -> keys.add(l) == false, + InternalCategorizationAggregationTests::randomKey + ); + int docCount = randomIntBetween(1, 100); + buckets.add(new InternalCategorizationAggregation.Bucket(key, docCount, aggregations)); + } + Collections.sort(buckets); + return new InternalCategorizationAggregation( + name, + randomIntBetween(10, 100), + randomLongBetween(1, 10), + randomIntBetween(1, 500), + randomIntBetween(1, 10), + randomIntBetween(1, 100), + metadata, + buckets + ); + } + + @Override + protected Class> implementationClass() { + return ParsedCategorization.class; + } + + private static Map toCounts(Stream buckets) { + return buckets.collect( + Collectors.toMap( + InternalCategorizationAggregation.Bucket::getKey, + InternalCategorizationAggregation.Bucket::getDocCount, + Long::sum + ) + ); + } +} diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/categorization/LeafTreeNodeTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/categorization/LeafTreeNodeTests.java new file mode 100644 index 0000000000000..2bef18993e019 --- /dev/null +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/categorization/LeafTreeNodeTests.java @@ -0,0 +1,88 @@ +/* + * 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.ml.aggs.categorization; + +import org.elasticsearch.common.util.BytesRefHash; +import org.elasticsearch.test.ESTestCase; +import org.junit.After; +import org.junit.Before; + +import static org.elasticsearch.xpack.ml.aggs.categorization.TextCategorizationTests.getTokens; +import static org.elasticsearch.xpack.ml.aggs.categorization.TextCategorizationTests.mockBigArrays; +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.greaterThan; +import static org.hamcrest.Matchers.hasSize; + +public class LeafTreeNodeTests extends ESTestCase { + + private final CategorizationTokenTree factory = new CategorizationTokenTree(10, 10, 60); + + private CategorizationBytesRefHash bytesRefHash; + + @Before + public void createRefHash() { + bytesRefHash = new CategorizationBytesRefHash(new BytesRefHash(1L, mockBigArrays())); + } + + @After + public void closeRefHash() { + bytesRefHash.close(); + } + + public void testAddGroup() { + TreeNode.LeafTreeNode leafTreeNode = new TreeNode.LeafTreeNode(0, 60); + TextCategorization group = leafTreeNode.addText(getTokens(bytesRefHash, "foo", "bar", "baz", "biz"), 1, factory); + + assertArrayEquals(group.getCategorization(), getTokens(bytesRefHash, "foo", "bar", "baz", "biz")); + assertThat(group.getCount(), equalTo(1L)); + assertThat(leafTreeNode.getAllChildrenTextCategorizations(), hasSize(1)); + long previousBytesUsed = leafTreeNode.ramBytesUsed(); + + group = leafTreeNode.addText(getTokens(bytesRefHash, "foo", "bar", "bozo", "bizzy"), 1, factory); + assertArrayEquals(group.getCategorization(), getTokens(bytesRefHash, "foo", "bar", "bozo", "bizzy")); + assertThat(group.getCount(), equalTo(1L)); + assertThat(leafTreeNode.getAllChildrenTextCategorizations(), hasSize(2)); + assertThat(leafTreeNode.ramBytesUsed(), greaterThan(previousBytesUsed)); + previousBytesUsed = leafTreeNode.ramBytesUsed(); + + group = leafTreeNode.addText(getTokens(bytesRefHash, "foo", "bar", "baz", "different"), 3, factory); + assertArrayEquals(group.getCategorization(), getTokens(bytesRefHash, "foo", "bar", "baz", "*")); + assertThat(group.getCount(), equalTo(4L)); + assertThat(leafTreeNode.getAllChildrenTextCategorizations(), hasSize(2)); + assertThat(previousBytesUsed, equalTo(leafTreeNode.ramBytesUsed())); + } + + public void testMergeWith() { + TreeNode.LeafTreeNode leafTreeNode = new TreeNode.LeafTreeNode(0, 60); + leafTreeNode.mergeWith(null); + assertThat(leafTreeNode, equalTo(new TreeNode.LeafTreeNode(0, 60))); + + expectThrows(UnsupportedOperationException.class, () -> leafTreeNode.mergeWith(new TreeNode.InnerTreeNode(1, 2, 3))); + + leafTreeNode.incCount(5); + leafTreeNode.addText(getTokens(bytesRefHash, "foo", "bar", "baz", "biz"), 5, factory); + + TreeNode.LeafTreeNode toMerge = new TreeNode.LeafTreeNode(0, 60); + leafTreeNode.incCount(1); + toMerge.addText(getTokens(bytesRefHash, "foo", "bar", "baz", "bizzy"), 1, factory); + leafTreeNode.incCount(1); + toMerge.addText(getTokens(bytesRefHash, "foo", "bart", "bat", "built"), 1, factory); + leafTreeNode.mergeWith(toMerge); + + assertThat(leafTreeNode.getAllChildrenTextCategorizations(), hasSize(2)); + assertThat(leafTreeNode.getCount(), equalTo(7L)); + assertArrayEquals( + leafTreeNode.getAllChildrenTextCategorizations().get(0).getCategorization(), + getTokens(bytesRefHash, "foo", "bar", "baz", "*") + ); + assertArrayEquals( + leafTreeNode.getAllChildrenTextCategorizations().get(1).getCategorization(), + getTokens(bytesRefHash, "foo", "bart", "bat", "built") + ); + } +} diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/categorization/ParsedCategorization.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/categorization/ParsedCategorization.java new file mode 100644 index 0000000000000..b554f9cfc43e1 --- /dev/null +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/categorization/ParsedCategorization.java @@ -0,0 +1,113 @@ +/* + * 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.ml.aggs.categorization; + +import org.apache.lucene.util.BytesRef; +import org.elasticsearch.common.Strings; +import org.elasticsearch.common.xcontent.ObjectParser; +import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.common.xcontent.XContentParserUtils; +import org.elasticsearch.search.aggregations.ParsedMultiBucketAggregation; +import org.elasticsearch.search.aggregations.bucket.MultiBucketsAggregation; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; + +class ParsedCategorization extends ParsedMultiBucketAggregation { + + @Override + public String getType() { + return CategorizeTextAggregationBuilder.NAME; + } + + private static final ObjectParser PARSER = new ObjectParser<>( + ParsedCategorization.class.getSimpleName(), + true, + ParsedCategorization::new + ); + static { + declareMultiBucketAggregationFields(PARSER, ParsedBucket::fromXContent, ParsedBucket::fromXContent); + } + + public static ParsedCategorization fromXContent(XContentParser parser, String name) throws IOException { + ParsedCategorization aggregation = PARSER.parse(parser, null); + aggregation.setName(name); + return aggregation; + } + + @Override + public List getBuckets() { + return buckets; + } + + public static class ParsedBucket extends ParsedMultiBucketAggregation.ParsedBucket implements MultiBucketsAggregation.Bucket { + + private InternalCategorizationAggregation.BucketKey key; + + protected void setKeyAsString(String keyAsString) { + if (keyAsString == null) { + key = null; + return; + } + if (keyAsString.isEmpty()) { + key = new InternalCategorizationAggregation.BucketKey(new BytesRef[0]); + return; + } + String[] split = Strings.tokenizeToStringArray(keyAsString, " "); + key = new InternalCategorizationAggregation.BucketKey( + split == null + ? new BytesRef[] { new BytesRef(keyAsString) } + : Arrays.stream(split).map(BytesRef::new).toArray(BytesRef[]::new) + ); + } + + @Override + public Object getKey() { + return key; + } + + @Override + public String getKeyAsString() { + return key.asString(); + } + + @Override + protected XContentBuilder keyToXContent(XContentBuilder builder) throws IOException { + return builder.field(CommonFields.KEY.getPreferredName(), getKey()); + } + + static InternalCategorizationAggregation.BucketKey parsedKey(final XContentParser parser) throws IOException { + if (parser.currentToken() == XContentParser.Token.VALUE_STRING) { + String toSplit = parser.text(); + String[] split = Strings.tokenizeToStringArray(toSplit, " "); + return new InternalCategorizationAggregation.BucketKey( + split == null + ? new BytesRef[] { new BytesRef(toSplit) } + : Arrays.stream(split).map(BytesRef::new).toArray(BytesRef[]::new) + ); + } else { + return new InternalCategorizationAggregation.BucketKey( + XContentParserUtils.parseList(parser, p -> new BytesRef(p.binaryValue())).toArray(BytesRef[]::new) + ); + } + } + + static ParsedBucket fromXContent(final XContentParser parser) throws IOException { + return ParsedMultiBucketAggregation.ParsedBucket.parseXContent( + parser, + false, + ParsedBucket::new, + (p, bucket) -> bucket.key = parsedKey(p) + ); + } + + } + +} diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/categorization/TextCategorizationTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/categorization/TextCategorizationTests.java new file mode 100644 index 0000000000000..59129f8801937 --- /dev/null +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/categorization/TextCategorizationTests.java @@ -0,0 +1,75 @@ +/* + * 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.ml.aggs.categorization; + +import org.apache.lucene.util.BytesRef; +import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.common.util.BigArrays; +import org.elasticsearch.common.util.BytesRefHash; +import org.elasticsearch.common.util.MockBigArrays; +import org.elasticsearch.common.util.MockPageCacheRecycler; +import org.elasticsearch.indices.breaker.NoneCircuitBreakerService; +import org.elasticsearch.test.ESTestCase; +import org.junit.After; +import org.junit.Before; + +import java.io.IOException; + +import static org.hamcrest.Matchers.closeTo; +import static org.hamcrest.Matchers.equalTo; + +public class TextCategorizationTests extends ESTestCase { + + static BigArrays mockBigArrays() { + return new MockBigArrays(new MockPageCacheRecycler(Settings.EMPTY), new NoneCircuitBreakerService()); + } + + private CategorizationBytesRefHash bytesRefHash; + + @Before + public void createRefHash() { + bytesRefHash = new CategorizationBytesRefHash(new BytesRefHash(1L, mockBigArrays())); + } + + @After + public void closeRefHash() throws IOException { + bytesRefHash.close(); + } + + public void testSimilarity() { + TextCategorization lg = new TextCategorization(getTokens(bytesRefHash, "foo", "bar", "baz", "biz"), 1, 1); + TextCategorization.Similarity sims = lg.calculateSimilarity(getTokens(bytesRefHash, "not", "matching", "anything", "nope")); + assertThat(sims.getSimilarity(), equalTo(0.0)); + assertThat(sims.getWildCardCount(), equalTo(0)); + + sims = lg.calculateSimilarity(getTokens(bytesRefHash, "foo", "bar", "baz", "biz")); + assertThat(sims.getSimilarity(), equalTo(1.0)); + assertThat(sims.getWildCardCount(), equalTo(0)); + + sims = lg.calculateSimilarity(getTokens(bytesRefHash, "foo", "fooagain", "notbar", "biz")); + assertThat(sims.getSimilarity(), closeTo(0.5, 0.0001)); + assertThat(sims.getWildCardCount(), equalTo(0)); + } + + public void testAddTokens() { + TextCategorization lg = new TextCategorization(getTokens(bytesRefHash, "foo", "bar", "baz", "biz"), 1, 1); + lg.addTokens(getTokens(bytesRefHash, "foo", "bar", "baz", "bozo"), 2); + assertThat(lg.getCount(), equalTo(3L)); + assertArrayEquals(lg.getCategorization(), getTokens(bytesRefHash, "foo", "bar", "baz", "*")); + } + + static int[] getTokens(CategorizationBytesRefHash bytesRefHash, String... tokens) { + BytesRef[] refs = new BytesRef[tokens.length]; + int i = 0; + for (String token : tokens) { + refs[i++] = new BytesRef(token); + } + return bytesRefHash.getIds(refs); + } + +} diff --git a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/ml/categorization_agg.yml b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/ml/categorization_agg.yml new file mode 100644 index 0000000000000..c2d5e0dbf09f1 --- /dev/null +++ b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/ml/categorization_agg.yml @@ -0,0 +1,153 @@ +setup: + - skip: + features: headers + - do: + headers: + Authorization: "Basic eF9wYWNrX3Jlc3RfdXNlcjp4LXBhY2stdGVzdC1wYXNzd29yZA==" # run as x_pack_rest_user, i.e. the test setup superuser + indices.create: + index: to_categorize + body: + mappings: + properties: + kind: + type: keyword + text: + type: text + + - do: + headers: + Authorization: "Basic eF9wYWNrX3Jlc3RfdXNlcjp4LXBhY2stdGVzdC1wYXNzd29yZA==" # run as x_pack_rest_user, i.e. the test setup superuser + Content-Type: application/json + bulk: + index: to_categorize + refresh: true + body: | + {"index": {}} + {"product": "server","text": "Node 2 stopping"} + {"index": {}} + {"product": "server", "text": "Node 2 starting"} + {"index": {}} + {"product": "server", "text": "Node 4 stopping"} + {"index": {}} + {"product": "server", "text": "Node 5 stopping"} + {"index": {}} + {"product": "user", "text": "User Foo logging on"} + {"index": {}} + {"product": "user", "text": "User Foo logging on"} + {"index": {}} + {"product": "user", "text": "User Foo logging off"} + +--- +"Test categorization agg simple": + + - do: + search: + index: to_categorize + body: > + { + "size": 0, + "aggs": { + "categories": { + "categorize_text": { + "field": "text" + } + } + } + } + - length: { aggregations.categories.buckets: 4} + - match: {aggregations.categories.buckets.0.doc_count: 3} + - match: {aggregations.categories.buckets.0.key: "Node stopping" } + + - do: + search: + index: to_categorize + body: > + { + "size": 0, + "aggs": { + "categories": { + "categorize_text": { + "field": "text", + "size": 10, + "max_unique_tokens": 2, + "max_matched_tokens": 1, + "similarity_threshold": 11 + } + } + } + } + + - length: { aggregations.categories.buckets: 2 } + - match: { aggregations.categories.buckets.0.doc_count: 4 } + - match: { aggregations.categories.buckets.0.key: "Node *" } + - match: { aggregations.categories.buckets.1.doc_count: 3 } + - match: { aggregations.categories.buckets.1.key: "User Foo logging *" } +--- +"Test categorization aggregation with poor settings": + + - do: + catch: /\[max_unique_tokens\] must be greater than 0 and less than \[100\]/ + search: + index: to_categorize + body: > + { + "size": 0, + "aggs": { + "categories": { + "categorize_text": { + "field": "text", + "max_unique_tokens": -2 + } + } + } + } + - do: + catch: /\[max_matched_tokens\] must be greater than 0 and less than \[100\]/ + search: + index: to_categorize + body: > + { + "size": 0, + "aggs": { + "categories": { + "categorize_text": { + "field": "text", + "max_matched_tokens": -2 + } + } + } + } + - do: + catch: /\[similarity_threshold\] must be in the range \[1, 100\]/ + search: + index: to_categorize + body: > + { + "size": 0, + "aggs": { + "categories": { + "categorize_text": { + "field": "text", + "similarity_threshold": 0 + } + } + } + } + + - do: + catch: /\[categorization_filters\] cannot be used with \[categorization_analyzer\]/ + search: + index: to_categorize + body: > + { + "size": 0, + "aggs": { + "categories": { + "categorize_text": { + "field": "text", + "categorization_filters": ["foo"], + "categorization_analyzer": "english" + } + } + } + } From 2a02940cea37622db88155dbf574271827e03de5 Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Mon, 4 Oct 2021 09:16:35 -0700 Subject: [PATCH 129/250] Convert Autoscaling license object to use LicensedFeature (#78540) This commit moves the autoscaling license check to use the new LicensedFeature class. --- .../org/elasticsearch/xpack/autoscaling/Autoscaling.java | 8 ++++++++ .../xpack/autoscaling/AutoscalingLicenseChecker.java | 7 +++---- .../java/org/elasticsearch/license/XPackLicenseState.java | 4 +--- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/Autoscaling.java b/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/Autoscaling.java index 7473feb0d6f2c..8e7a66fac6bcf 100644 --- a/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/Autoscaling.java +++ b/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/Autoscaling.java @@ -27,6 +27,8 @@ import org.elasticsearch.common.xcontent.ParseField; import org.elasticsearch.env.Environment; import org.elasticsearch.env.NodeEnvironment; +import org.elasticsearch.license.License; +import org.elasticsearch.license.LicensedFeature; import org.elasticsearch.plugins.ActionPlugin; import org.elasticsearch.plugins.ExtensiblePlugin; import org.elasticsearch.plugins.Plugin; @@ -79,6 +81,12 @@ public class Autoscaling extends Plugin implements ActionPlugin, ExtensiblePlugi } } + static final LicensedFeature.Momentary AUTOSCALING_FEATURE = LicensedFeature.momentary( + null, + "autoscaling", + License.OperationMode.ENTERPRISE + ); + private final List autoscalingExtensions; private final SetOnce clusterService = new SetOnce<>(); private final SetOnce allocationDeciders = new SetOnce<>(); diff --git a/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/AutoscalingLicenseChecker.java b/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/AutoscalingLicenseChecker.java index 09d87883fa968..1bc192b6ebb16 100644 --- a/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/AutoscalingLicenseChecker.java +++ b/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/AutoscalingLicenseChecker.java @@ -7,12 +7,11 @@ package org.elasticsearch.xpack.autoscaling; -import org.elasticsearch.license.XPackLicenseState; -import org.elasticsearch.xpack.core.XPackPlugin; - import java.util.Objects; import java.util.function.BooleanSupplier; +import static org.elasticsearch.xpack.core.XPackPlugin.getSharedLicenseState; + /** * Encapsulates license checking for autoscaling. */ @@ -24,7 +23,7 @@ public class AutoscalingLicenseChecker { * Constructs an autoscaling license checker with the default rule based on the license state for checking if autoscaling is allowed. */ AutoscalingLicenseChecker() { - this(() -> XPackPlugin.getSharedLicenseState().checkFeature(XPackLicenseState.Feature.AUTOSCALING)); + this(() -> Autoscaling.AUTOSCALING_FEATURE.check(getSharedLicenseState())); } /** diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/XPackLicenseState.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/XPackLicenseState.java index 3a27e0cbe8dcc..2375f637f067d 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/XPackLicenseState.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/XPackLicenseState.java @@ -74,9 +74,7 @@ public enum Feature { SPATIAL_GEO_LINE(OperationMode.GOLD, true), - OPERATOR_PRIVILEGES(OperationMode.ENTERPRISE, true), - - AUTOSCALING(OperationMode.ENTERPRISE, true); + OPERATOR_PRIVILEGES(OperationMode.ENTERPRISE, true); // NOTE: this is temporary. The Feature enum will go away in favor of LicensedFeature. // Embedding the feature instance here is a stopgap to allow smaller initial PR, From a019d415532b8c9b15405015e57680a20b1f0b77 Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Mon, 4 Oct 2021 09:17:01 -0700 Subject: [PATCH 130/250] Convert sql license objects to LicensedFeature (#78539) This commit moves the license checks for sql jdbc and odbc functionality to use the new LicensedFeature class. --- .../org/elasticsearch/license/XPackLicenseState.java | 4 ---- .../org/elasticsearch/xpack/sql/plugin/SqlPlugin.java | 9 +++++++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/XPackLicenseState.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/XPackLicenseState.java index 2375f637f067d..28701c7bfc491 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/XPackLicenseState.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/XPackLicenseState.java @@ -64,10 +64,6 @@ public enum Feature { LOGSTASH(OperationMode.STANDARD, true), - JDBC(OperationMode.PLATINUM, true), - - ODBC(OperationMode.PLATINUM, true), - SPATIAL_GEO_CENTROID(OperationMode.GOLD, true), SPATIAL_GEO_GRID(OperationMode.GOLD, true), diff --git a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlPlugin.java b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlPlugin.java index ab519eb241245..d254416aeb42e 100644 --- a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlPlugin.java +++ b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlPlugin.java @@ -20,7 +20,9 @@ import org.elasticsearch.common.xcontent.NamedXContentRegistry; import org.elasticsearch.env.Environment; import org.elasticsearch.env.NodeEnvironment; +import org.elasticsearch.license.License; import org.elasticsearch.license.LicenseUtils; +import org.elasticsearch.license.LicensedFeature; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.plugins.ActionPlugin; import org.elasticsearch.plugins.Plugin; @@ -49,17 +51,20 @@ public class SqlPlugin extends Plugin implements ActionPlugin { + private final LicensedFeature.Momentary JDBC_FEATURE = LicensedFeature.momentary("sql", "jdbc", License.OperationMode.PLATINUM); + private final LicensedFeature.Momentary ODBC_FEATURE = LicensedFeature.momentary("sql", "odbc", License.OperationMode.PLATINUM); + private final SqlLicenseChecker sqlLicenseChecker = new SqlLicenseChecker( (mode) -> { XPackLicenseState licenseState = getLicenseState(); switch (mode) { case JDBC: - if (licenseState.checkFeature(XPackLicenseState.Feature.JDBC) == false) { + if (JDBC_FEATURE.check(licenseState) == false) { throw LicenseUtils.newComplianceException("jdbc"); } break; case ODBC: - if (licenseState.checkFeature(XPackLicenseState.Feature.ODBC) == false) { + if (ODBC_FEATURE.check(licenseState) == false) { throw LicenseUtils.newComplianceException("odbc"); } break; From f6fbeb8b5686009dee014ca2e53391321ed02f4f Mon Sep 17 00:00:00 2001 From: Jack Conradson Date: Mon, 4 Oct 2021 10:07:59 -0700 Subject: [PATCH 131/250] Add dynamic (duck) type resolution to Painless static types (#78575) This change adds dynamic (duck) type resolution to Painless static types using an annotation ( at dynamic_type ) to control which static types are allowed to be dynamically invoked. This annotation does not chain so any sub classes that also require dynamic type resolution must be annotated as well. --- .../spi/annotation/DynamicTypeAnnotation.java | 20 ++ .../DynamicTypeAnnotationParser.java | 29 +++ .../annotation/WhitelistAnnotationParser.java | 3 +- .../painless/lookup/PainlessClass.java | 8 +- .../painless/lookup/PainlessClassBuilder.java | 9 +- .../lookup/PainlessLookupBuilder.java | 13 +- .../phase/DefaultSemanticAnalysisPhase.java | 79 ++++---- .../phase/DefaultUserTreeToIRTreePhase.java | 3 +- .../painless/symbol/Decorations.java | 4 + .../painless/DynamicTypeTests.java | 172 ++++++++++++++++++ .../org.elasticsearch.painless.dynamic | 34 ++++ 11 files changed, 331 insertions(+), 43 deletions(-) create mode 100644 modules/lang-painless/spi/src/main/java/org/elasticsearch/painless/spi/annotation/DynamicTypeAnnotation.java create mode 100644 modules/lang-painless/spi/src/main/java/org/elasticsearch/painless/spi/annotation/DynamicTypeAnnotationParser.java create mode 100644 modules/lang-painless/src/test/java/org/elasticsearch/painless/DynamicTypeTests.java create mode 100644 modules/lang-painless/src/test/resources/org/elasticsearch/painless/org.elasticsearch.painless.dynamic diff --git a/modules/lang-painless/spi/src/main/java/org/elasticsearch/painless/spi/annotation/DynamicTypeAnnotation.java b/modules/lang-painless/spi/src/main/java/org/elasticsearch/painless/spi/annotation/DynamicTypeAnnotation.java new file mode 100644 index 0000000000000..4ae75df2f9496 --- /dev/null +++ b/modules/lang-painless/spi/src/main/java/org/elasticsearch/painless/spi/annotation/DynamicTypeAnnotation.java @@ -0,0 +1,20 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.painless.spi.annotation; + +public class DynamicTypeAnnotation { + + public static final String NAME = "dynamic_type"; + + public static final DynamicTypeAnnotation INSTANCE = new DynamicTypeAnnotation(); + + private DynamicTypeAnnotation() { + + } +} diff --git a/modules/lang-painless/spi/src/main/java/org/elasticsearch/painless/spi/annotation/DynamicTypeAnnotationParser.java b/modules/lang-painless/spi/src/main/java/org/elasticsearch/painless/spi/annotation/DynamicTypeAnnotationParser.java new file mode 100644 index 0000000000000..acd585a61426a --- /dev/null +++ b/modules/lang-painless/spi/src/main/java/org/elasticsearch/painless/spi/annotation/DynamicTypeAnnotationParser.java @@ -0,0 +1,29 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.painless.spi.annotation; + +import java.util.Map; + +public class DynamicTypeAnnotationParser implements WhitelistAnnotationParser { + + public static final DynamicTypeAnnotationParser INSTANCE = new DynamicTypeAnnotationParser(); + + private DynamicTypeAnnotationParser() {} + + @Override + public Object parse(Map arguments) { + if (arguments.isEmpty() == false) { + throw new IllegalArgumentException( + "unexpected parameters for [@" + DynamicTypeAnnotation.NAME + "] annotation, found " + arguments + ); + } + + return DynamicTypeAnnotation.INSTANCE; + } +} diff --git a/modules/lang-painless/spi/src/main/java/org/elasticsearch/painless/spi/annotation/WhitelistAnnotationParser.java b/modules/lang-painless/spi/src/main/java/org/elasticsearch/painless/spi/annotation/WhitelistAnnotationParser.java index 93d1165a05f6d..ab3a19ffff29d 100644 --- a/modules/lang-painless/spi/src/main/java/org/elasticsearch/painless/spi/annotation/WhitelistAnnotationParser.java +++ b/modules/lang-painless/spi/src/main/java/org/elasticsearch/painless/spi/annotation/WhitelistAnnotationParser.java @@ -27,7 +27,8 @@ public interface WhitelistAnnotationParser { new AbstractMap.SimpleEntry<>(NonDeterministicAnnotation.NAME, NonDeterministicAnnotationParser.INSTANCE), new AbstractMap.SimpleEntry<>(InjectConstantAnnotation.NAME, InjectConstantAnnotationParser.INSTANCE), new AbstractMap.SimpleEntry<>(CompileTimeOnlyAnnotation.NAME, CompileTimeOnlyAnnotationParser.INSTANCE), - new AbstractMap.SimpleEntry<>(AugmentedAnnotation.NAME, AugmentedAnnotationParser.INSTANCE) + new AbstractMap.SimpleEntry<>(AugmentedAnnotation.NAME, AugmentedAnnotationParser.INSTANCE), + new AbstractMap.SimpleEntry<>(DynamicTypeAnnotation.NAME, DynamicTypeAnnotationParser.INSTANCE) ).collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)) ); diff --git a/modules/lang-painless/src/main/java/org/elasticsearch/painless/lookup/PainlessClass.java b/modules/lang-painless/src/main/java/org/elasticsearch/painless/lookup/PainlessClass.java index 1511eb135e6b0..4a8a7b7f15901 100644 --- a/modules/lang-painless/src/main/java/org/elasticsearch/painless/lookup/PainlessClass.java +++ b/modules/lang-painless/src/main/java/org/elasticsearch/painless/lookup/PainlessClass.java @@ -20,6 +20,7 @@ public final class PainlessClass { public final Map staticFields; public final Map fields; public final PainlessMethod functionalInterfaceMethod; + public final Map, Object> annotations; public final Map runtimeMethods; public final Map getterMethodHandles; @@ -29,6 +30,7 @@ public final class PainlessClass { Map staticMethods, Map methods, Map staticFields, Map fields, PainlessMethod functionalInterfaceMethod, + Map, Object> annotations, Map runtimeMethods, Map getterMethodHandles, Map setterMethodHandles) { @@ -38,6 +40,7 @@ public final class PainlessClass { this.staticFields = Map.copyOf(staticFields); this.fields = Map.copyOf(fields); this.functionalInterfaceMethod = functionalInterfaceMethod; + this.annotations = annotations; this.getterMethodHandles = Map.copyOf(getterMethodHandles); this.setterMethodHandles = Map.copyOf(setterMethodHandles); @@ -61,11 +64,12 @@ public boolean equals(Object object) { Objects.equals(methods, that.methods) && Objects.equals(staticFields, that.staticFields) && Objects.equals(fields, that.fields) && - Objects.equals(functionalInterfaceMethod, that.functionalInterfaceMethod); + Objects.equals(functionalInterfaceMethod, that.functionalInterfaceMethod) && + Objects.equals(annotations, that.annotations); } @Override public int hashCode() { - return Objects.hash(constructors, staticMethods, methods, staticFields, fields, functionalInterfaceMethod); + return Objects.hash(constructors, staticMethods, methods, staticFields, fields, functionalInterfaceMethod, annotations); } } diff --git a/modules/lang-painless/src/main/java/org/elasticsearch/painless/lookup/PainlessClassBuilder.java b/modules/lang-painless/src/main/java/org/elasticsearch/painless/lookup/PainlessClassBuilder.java index d5830cc61e8c1..6f614ce12dca2 100644 --- a/modules/lang-painless/src/main/java/org/elasticsearch/painless/lookup/PainlessClassBuilder.java +++ b/modules/lang-painless/src/main/java/org/elasticsearch/painless/lookup/PainlessClassBuilder.java @@ -21,6 +21,7 @@ final class PainlessClassBuilder { final Map staticFields; final Map fields; PainlessMethod functionalInterfaceMethod; + final Map, Object> annotations; final Map runtimeMethods; final Map getterMethodHandles; @@ -33,6 +34,7 @@ final class PainlessClassBuilder { staticFields = new HashMap<>(); fields = new HashMap<>(); functionalInterfaceMethod = null; + annotations = new HashMap<>(); runtimeMethods = new HashMap<>(); getterMethodHandles = new HashMap<>(); @@ -40,7 +42,7 @@ final class PainlessClassBuilder { } PainlessClass build() { - return new PainlessClass(constructors, staticMethods, methods, staticFields, fields, functionalInterfaceMethod, + return new PainlessClass(constructors, staticMethods, methods, staticFields, fields, functionalInterfaceMethod, annotations, runtimeMethods, getterMethodHandles, setterMethodHandles); } @@ -61,11 +63,12 @@ public boolean equals(Object object) { Objects.equals(methods, that.methods) && Objects.equals(staticFields, that.staticFields) && Objects.equals(fields, that.fields) && - Objects.equals(functionalInterfaceMethod, that.functionalInterfaceMethod); + Objects.equals(functionalInterfaceMethod, that.functionalInterfaceMethod) && + Objects.equals(annotations, that.annotations); } @Override public int hashCode() { - return Objects.hash(constructors, staticMethods, methods, staticFields, fields, functionalInterfaceMethod); + return Objects.hash(constructors, staticMethods, methods, staticFields, fields, functionalInterfaceMethod, annotations); } } diff --git a/modules/lang-painless/src/main/java/org/elasticsearch/painless/lookup/PainlessLookupBuilder.java b/modules/lang-painless/src/main/java/org/elasticsearch/painless/lookup/PainlessLookupBuilder.java index b819b1e134048..02cac53146262 100644 --- a/modules/lang-painless/src/main/java/org/elasticsearch/painless/lookup/PainlessLookupBuilder.java +++ b/modules/lang-painless/src/main/java/org/elasticsearch/painless/lookup/PainlessLookupBuilder.java @@ -118,7 +118,7 @@ public static PainlessLookup buildFromWhitelists(List whitelists) { origin = whitelistClass.origin; painlessLookupBuilder.addPainlessClass( whitelist.classLoader, whitelistClass.javaClassName, - whitelistClass.painlessAnnotations.containsKey(NoImportAnnotation.class) == false); + whitelistClass.painlessAnnotations); } } @@ -236,7 +236,8 @@ private Class loadClass(ClassLoader classLoader, String javaClassName, Suppli } } - public void addPainlessClass(ClassLoader classLoader, String javaClassName, boolean importClassName) { + public void addPainlessClass(ClassLoader classLoader, String javaClassName, Map, Object> annotations) { + Objects.requireNonNull(classLoader); Objects.requireNonNull(javaClassName); @@ -255,12 +256,12 @@ public void addPainlessClass(ClassLoader classLoader, String javaClassName, bool clazz = loadClass(classLoader, javaClassName, () -> "class [" + javaClassName + "] not found"); } - addPainlessClass(clazz, importClassName); + addPainlessClass(clazz, annotations); } - public void addPainlessClass(Class clazz, boolean importClassName) { + public void addPainlessClass(Class clazz, Map, Object> annotations) { Objects.requireNonNull(clazz); - //Matcher m = new Matcher(); + Objects.requireNonNull(annotations); if (clazz == def.class) { throw new IllegalArgumentException("cannot add reserved class [" + DEF_CLASS_NAME + "]"); @@ -296,6 +297,7 @@ public void addPainlessClass(Class clazz, boolean importClassName) { if (existingPainlessClassBuilder == null) { PainlessClassBuilder painlessClassBuilder = new PainlessClassBuilder(); + painlessClassBuilder.annotations.putAll(annotations); canonicalClassNamesToClasses.put(canonicalClassName.intern(), clazz); classesToPainlessClassBuilders.put(clazz, painlessClassBuilder); @@ -303,6 +305,7 @@ public void addPainlessClass(Class clazz, boolean importClassName) { String javaClassName = clazz.getName(); String importedCanonicalClassName = javaClassName.substring(javaClassName.lastIndexOf('.') + 1).replace('$', '.'); + boolean importClassName = annotations.containsKey(NoImportAnnotation.class) == false; if (canonicalClassName.equals(importedCanonicalClassName)) { if (importClassName) { diff --git a/modules/lang-painless/src/main/java/org/elasticsearch/painless/phase/DefaultSemanticAnalysisPhase.java b/modules/lang-painless/src/main/java/org/elasticsearch/painless/phase/DefaultSemanticAnalysisPhase.java index 61934ee741f35..bb17fccc36cd6 100644 --- a/modules/lang-painless/src/main/java/org/elasticsearch/painless/phase/DefaultSemanticAnalysisPhase.java +++ b/modules/lang-painless/src/main/java/org/elasticsearch/painless/phase/DefaultSemanticAnalysisPhase.java @@ -18,6 +18,7 @@ import org.elasticsearch.painless.lookup.PainlessConstructor; import org.elasticsearch.painless.lookup.PainlessField; import org.elasticsearch.painless.lookup.PainlessInstanceBinding; +import org.elasticsearch.painless.lookup.PainlessLookup; import org.elasticsearch.painless.lookup.PainlessLookupUtility; import org.elasticsearch.painless.lookup.PainlessMethod; import org.elasticsearch.painless.lookup.def; @@ -69,6 +70,7 @@ import org.elasticsearch.painless.node.SThrow; import org.elasticsearch.painless.node.STry; import org.elasticsearch.painless.node.SWhile; +import org.elasticsearch.painless.spi.annotation.DynamicTypeAnnotation; import org.elasticsearch.painless.spi.annotation.NonDeterministicAnnotation; import org.elasticsearch.painless.symbol.Decorations; import org.elasticsearch.painless.symbol.Decorations.AllEscape; @@ -83,6 +85,7 @@ import org.elasticsearch.painless.symbol.Decorations.ContinuousLoop; import org.elasticsearch.painless.symbol.Decorations.DefOptimized; import org.elasticsearch.painless.symbol.Decorations.DowncastPainlessCast; +import org.elasticsearch.painless.symbol.Decorations.DynamicInvocation; import org.elasticsearch.painless.symbol.Decorations.EncodingDecoration; import org.elasticsearch.painless.symbol.Decorations.Explicit; import org.elasticsearch.painless.symbol.Decorations.ExpressionPainlessCast; @@ -140,6 +143,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.regex.Pattern; import java.util.regex.PatternSyntaxException; @@ -2525,9 +2529,8 @@ public void visitDot(EDot userDotNode, SemanticScope semanticScope) { } } else if (prefixValueType != null && prefixValueType.getValueType() == def.class) { TargetType targetType = userDotNode.isNullSafe() ? null : semanticScope.getDecoration(userDotNode, TargetType.class); - // TODO: remove ZonedDateTime exception when JodaCompatibleDateTime is removed - valueType = targetType == null || targetType.getTargetType() == ZonedDateTime.class || - semanticScope.getCondition(userDotNode, Explicit.class) ? def.class : targetType.getTargetType(); + valueType = targetType == null || semanticScope.getCondition(userDotNode, Explicit.class) ? + def.class : targetType.getTargetType(); if (write) { semanticScope.setCondition(userDotNode, DefOptimized.class); @@ -2888,9 +2891,45 @@ public void visitCall(ECall userCallNode, SemanticScope semanticScope) { "[" + semanticScope.getDecoration(userPrefixNode, PartialCanonicalTypeName.class).getPartialCanonicalTypeName() + "]")); } + boolean dynamic = false; + PainlessMethod method = null; + + if (prefixValueType != null) { + Class type = prefixValueType.getValueType(); + PainlessLookup lookup = semanticScope.getScriptScope().getPainlessLookup(); + + if (prefixValueType.getValueType() == def.class) { + dynamic = true; + } else { + method = lookup.lookupPainlessMethod(type, false, methodName, userArgumentsSize); + + if (method == null) { + dynamic = lookup.lookupPainlessClass(type).annotations.containsKey(DynamicTypeAnnotation.class) && + lookup.lookupPainlessSubClassesMethod(type, methodName, userArgumentsSize) != null; + + if (dynamic == false) { + throw userCallNode.createError(new IllegalArgumentException("member method " + + "[" + prefixValueType.getValueCanonicalTypeName() + ", " + methodName + "/" + userArgumentsSize + "] " + + "not found")); + } + } + } + } else if (prefixStaticType != null) { + method = semanticScope.getScriptScope().getPainlessLookup().lookupPainlessMethod( + prefixStaticType.getStaticType(), true, methodName, userArgumentsSize); + + if (method == null) { + throw userCallNode.createError(new IllegalArgumentException("static method " + + "[" + prefixStaticType.getStaticCanonicalTypeName() + ", " + methodName + "/" + userArgumentsSize + "] " + + "not found")); + } + } else { + throw userCallNode.createError(new IllegalStateException("value required: instead found no value")); + } + Class valueType; - if (prefixValueType != null && prefixValueType.getValueType() == def.class) { + if (dynamic) { for (AExpression userArgumentNode : userArgumentNodes) { semanticScope.setCondition(userArgumentNode, Read.class); semanticScope.setCondition(userArgumentNode, Internal.class); @@ -2904,34 +2943,12 @@ public void visitCall(ECall userCallNode, SemanticScope semanticScope) { } TargetType targetType = userCallNode.isNullSafe() ? null : semanticScope.getDecoration(userCallNode, TargetType.class); - // TODO: remove ZonedDateTime exception when JodaCompatibleDateTime is removed - valueType = targetType == null || targetType.getTargetType() == ZonedDateTime.class || - semanticScope.getCondition(userCallNode, Explicit.class) ? def.class : targetType.getTargetType(); - } else { - PainlessMethod method; - - if (prefixValueType != null) { - method = semanticScope.getScriptScope().getPainlessLookup().lookupPainlessMethod( - prefixValueType.getValueType(), false, methodName, userArgumentsSize); - - if (method == null) { - throw userCallNode.createError(new IllegalArgumentException("member method " + - "[" + prefixValueType.getValueCanonicalTypeName() + ", " + methodName + "/" + userArgumentsSize + "] " + - "not found")); - } - } else if (prefixStaticType != null) { - method = semanticScope.getScriptScope().getPainlessLookup().lookupPainlessMethod( - prefixStaticType.getStaticType(), true, methodName, userArgumentsSize); - - if (method == null) { - throw userCallNode.createError(new IllegalArgumentException("static method " + - "[" + prefixStaticType.getStaticCanonicalTypeName() + ", " + methodName + "/" + userArgumentsSize + "] " + - "not found")); - } - } else { - throw userCallNode.createError(new IllegalStateException("value required: instead found no value")); - } + valueType = targetType == null || semanticScope.getCondition(userCallNode, Explicit.class) ? + def.class : targetType.getTargetType(); + semanticScope.setCondition(userCallNode, DynamicInvocation.class); + } else { + Objects.requireNonNull(method); semanticScope.getScriptScope().markNonDeterministic(method.annotations.containsKey(NonDeterministicAnnotation.class)); for (int argument = 0; argument < userArgumentsSize; ++argument) { diff --git a/modules/lang-painless/src/main/java/org/elasticsearch/painless/phase/DefaultUserTreeToIRTreePhase.java b/modules/lang-painless/src/main/java/org/elasticsearch/painless/phase/DefaultUserTreeToIRTreePhase.java index d67cc59b95045..f0ea582e4643b 100644 --- a/modules/lang-painless/src/main/java/org/elasticsearch/painless/phase/DefaultUserTreeToIRTreePhase.java +++ b/modules/lang-painless/src/main/java/org/elasticsearch/painless/phase/DefaultUserTreeToIRTreePhase.java @@ -154,6 +154,7 @@ import org.elasticsearch.painless.symbol.Decorations.CompoundType; import org.elasticsearch.painless.symbol.Decorations.ContinuousLoop; import org.elasticsearch.painless.symbol.Decorations.DowncastPainlessCast; +import org.elasticsearch.painless.symbol.Decorations.DynamicInvocation; import org.elasticsearch.painless.symbol.Decorations.EncodingDecoration; import org.elasticsearch.painless.symbol.Decorations.Explicit; import org.elasticsearch.painless.symbol.Decorations.ExpressionPainlessCast; @@ -1802,7 +1803,7 @@ public void visitCall(ECall userCallNode, ScriptScope scriptScope) { ValueType prefixValueType = scriptScope.getDecoration(userCallNode.getPrefixNode(), ValueType.class); Class valueType = scriptScope.getDecoration(userCallNode, ValueType.class).getValueType(); - if (prefixValueType != null && prefixValueType.getValueType() == def.class) { + if (scriptScope.getCondition(userCallNode, DynamicInvocation.class)) { InvokeCallDefNode irCallSubDefNode = new InvokeCallDefNode(userCallNode.getLocation()); for (AExpression userArgumentNode : userCallNode.getArgumentNodes()) { diff --git a/modules/lang-painless/src/main/java/org/elasticsearch/painless/symbol/Decorations.java b/modules/lang-painless/src/main/java/org/elasticsearch/painless/symbol/Decorations.java index de6f748928870..38a9d7f2f8b95 100644 --- a/modules/lang-painless/src/main/java/org/elasticsearch/painless/symbol/Decorations.java +++ b/modules/lang-painless/src/main/java/org/elasticsearch/painless/symbol/Decorations.java @@ -365,6 +365,10 @@ public PainlessMethod getStandardPainlessMethod() { } } + public interface DynamicInvocation extends Condition { + + } + public static class GetterPainlessMethod implements Decoration { private final PainlessMethod getterPainlessMethod; diff --git a/modules/lang-painless/src/test/java/org/elasticsearch/painless/DynamicTypeTests.java b/modules/lang-painless/src/test/java/org/elasticsearch/painless/DynamicTypeTests.java new file mode 100644 index 0000000000000..6e46ebb3469d7 --- /dev/null +++ b/modules/lang-painless/src/test/java/org/elasticsearch/painless/DynamicTypeTests.java @@ -0,0 +1,172 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.painless; + +import org.elasticsearch.painless.action.PainlessExecuteAction.PainlessTestScript; +import org.elasticsearch.painless.spi.Whitelist; +import org.elasticsearch.painless.spi.WhitelistLoader; +import org.elasticsearch.script.ScriptContext; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class DynamicTypeTests extends ScriptTestCase { + + @Override + protected Map, List> scriptContexts() { + Map, List> contexts = new HashMap<>(); + List whitelists = new ArrayList<>(PainlessPlugin.BASE_WHITELISTS); + whitelists.add(WhitelistLoader.loadFromResourceFiles(PainlessPlugin.class, "org.elasticsearch.painless.test")); + whitelists.add(WhitelistLoader.loadFromResourceFiles(PainlessPlugin.class, "org.elasticsearch.painless.dynamic")); + contexts.put(PainlessTestScript.CONTEXT, whitelists); + return contexts; + } + + public interface DynI { + + } + + public static class DynA { + } + + public static class DynB extends DynA implements DynI { + } + + public static class DynC extends DynB { + } + + public static class DynD extends DynB { + public char letter() { + return 'D'; + } + } + + public static class DynE extends DynC { + public char letter() { + return 'E'; + } + } + + public static class DynF extends DynE { + } + + public static class DynG extends DynF { + public char letter() { + return 'G'; + } + + public int value() { + return 1; + } + } + + public void testDynamicTypeResolution() { + assertEquals('D', exec("DynamicTypeTests.DynI i = new DynamicTypeTests.DynD(); return i.letter()")); + assertEquals('E', exec("DynamicTypeTests.DynI i = new DynamicTypeTests.DynE(); return i.letter()")); + assertEquals('E', exec("DynamicTypeTests.DynI i = new DynamicTypeTests.DynF(); return i.letter()")); + assertEquals('G', exec("DynamicTypeTests.DynI i = new DynamicTypeTests.DynG(); return i.letter()")); + IllegalArgumentException iae = expectScriptThrows(IllegalArgumentException.class, + () -> exec("DynamicTypeTests.DynI i = new DynamicTypeTests.DynD(); return i.value()")); + assertTrue(iae.getMessage().contains("dynamic method") && iae.getMessage().contains("not found")); + iae = expectScriptThrows(IllegalArgumentException.class, + () -> exec("DynamicTypeTests.DynI i = new DynamicTypeTests.DynE(); return i.value()")); + assertTrue(iae.getMessage().contains("dynamic method") && iae.getMessage().contains("not found")); + iae = expectScriptThrows(IllegalArgumentException.class, + () -> exec("DynamicTypeTests.DynI i = new DynamicTypeTests.DynF(); return i.value()")); + assertTrue(iae.getMessage().contains("dynamic method") && iae.getMessage().contains("not found")); + assertEquals(1, exec("DynamicTypeTests.DynI i = new DynamicTypeTests.DynG(); return i.value()")); + + iae = expectScriptThrows(IllegalArgumentException.class, + () -> exec("DynamicTypeTests.DynA a = new DynamicTypeTests.DynD(); return a.letter()")); + assertTrue(iae.getMessage().contains("member method") && iae.getMessage().contains("not found")); + iae = expectScriptThrows(IllegalArgumentException.class, + () -> exec("DynamicTypeTests.DynA a = new DynamicTypeTests.DynE(); return a.letter()")); + assertTrue(iae.getMessage().contains("member method") && iae.getMessage().contains("not found")); + iae = expectScriptThrows(IllegalArgumentException.class, + () -> exec("DynamicTypeTests.DynA a = new DynamicTypeTests.DynF(); return a.letter()")); + assertTrue(iae.getMessage().contains("member method") && iae.getMessage().contains("not found")); + iae = expectScriptThrows(IllegalArgumentException.class, + () -> exec("DynamicTypeTests.DynA a = new DynamicTypeTests.DynG(); return a.letter()")); + assertTrue(iae.getMessage().contains("member method") && iae.getMessage().contains("not found")); + iae = expectScriptThrows(IllegalArgumentException.class, + () -> exec("DynamicTypeTests.DynA a = new DynamicTypeTests.DynD(); return a.value()")); + assertTrue(iae.getMessage().contains("member method") && iae.getMessage().contains("not found")); + iae = expectScriptThrows(IllegalArgumentException.class, + () -> exec("DynamicTypeTests.DynA a = new DynamicTypeTests.DynE(); return a.value()")); + assertTrue(iae.getMessage().contains("member method") && iae.getMessage().contains("not found")); + iae = expectScriptThrows(IllegalArgumentException.class, + () -> exec("DynamicTypeTests.DynA a = new DynamicTypeTests.DynF(); return a.value()")); + assertTrue(iae.getMessage().contains("member method") && iae.getMessage().contains("not found")); + iae = expectScriptThrows(IllegalArgumentException.class, + () -> exec("DynamicTypeTests.DynA a = new DynamicTypeTests.DynG(); return a.value()")); + assertTrue(iae.getMessage().contains("member method") && iae.getMessage().contains("not found")); + + assertEquals('D', exec("DynamicTypeTests.DynB b = new DynamicTypeTests.DynD(); return b.letter()")); + assertEquals('E', exec("DynamicTypeTests.DynB b = new DynamicTypeTests.DynE(); return b.letter()")); + assertEquals('E', exec("DynamicTypeTests.DynB b = new DynamicTypeTests.DynF(); return b.letter()")); + assertEquals('G', exec("DynamicTypeTests.DynB b = new DynamicTypeTests.DynG(); return b.letter()")); + iae = expectScriptThrows(IllegalArgumentException.class, + () -> exec("DynamicTypeTests.DynB b = new DynamicTypeTests.DynD(); return b.value()")); + assertTrue(iae.getMessage().contains("dynamic method") && iae.getMessage().contains("not found")); + iae = expectScriptThrows(IllegalArgumentException.class, + () -> exec("DynamicTypeTests.DynB b = new DynamicTypeTests.DynE(); return b.value()")); + assertTrue(iae.getMessage().contains("dynamic method") && iae.getMessage().contains("not found")); + iae = expectScriptThrows(IllegalArgumentException.class, + () -> exec("DynamicTypeTests.DynB b = new DynamicTypeTests.DynF(); return b.value()")); + assertTrue(iae.getMessage().contains("dynamic method") && iae.getMessage().contains("not found")); + assertEquals(1, exec("DynamicTypeTests.DynB b = new DynamicTypeTests.DynG(); return b.value()")); + + iae = expectScriptThrows(IllegalArgumentException.class, + () -> exec("DynamicTypeTests.DynC c = new DynamicTypeTests.DynE(); return c.letter()")); + assertTrue(iae.getMessage().contains("member method") && iae.getMessage().contains("not found")); + iae = expectScriptThrows(IllegalArgumentException.class, + () -> exec("DynamicTypeTests.DynC c = new DynamicTypeTests.DynF(); return c.letter()")); + assertTrue(iae.getMessage().contains("member method") && iae.getMessage().contains("not found")); + iae = expectScriptThrows(IllegalArgumentException.class, + () -> exec("DynamicTypeTests.DynC c = new DynamicTypeTests.DynG(); return c.letter()")); + assertTrue(iae.getMessage().contains("member method") && iae.getMessage().contains("not found")); + iae = expectScriptThrows(IllegalArgumentException.class, + () -> exec("DynamicTypeTests.DynC c = new DynamicTypeTests.DynE(); return c.value()")); + assertTrue(iae.getMessage().contains("member method") && iae.getMessage().contains("not found")); + iae = expectScriptThrows(IllegalArgumentException.class, + () -> exec("DynamicTypeTests.DynC c = new DynamicTypeTests.DynF(); return c.value()")); + assertTrue(iae.getMessage().contains("member method") && iae.getMessage().contains("not found")); + iae = expectScriptThrows(IllegalArgumentException.class, + () -> exec("DynamicTypeTests.DynC c = new DynamicTypeTests.DynG(); return c.value()")); + assertTrue(iae.getMessage().contains("member method") && iae.getMessage().contains("not found")); + + assertEquals('D', exec("DynamicTypeTests.DynD d = new DynamicTypeTests.DynD(); return d.letter()")); + iae = expectScriptThrows(IllegalArgumentException.class, + () -> exec("DynamicTypeTests.DynD d = new DynamicTypeTests.DynD(); return d.value()")); + assertTrue(iae.getMessage().contains("member method") && iae.getMessage().contains("not found")); + + assertEquals('E', exec("DynamicTypeTests.DynE e = new DynamicTypeTests.DynE(); return e.letter()")); + assertEquals('E', exec("DynamicTypeTests.DynE e = new DynamicTypeTests.DynF(); return e.letter()")); + assertEquals('G', exec("DynamicTypeTests.DynE e = new DynamicTypeTests.DynG(); return e.letter()")); + iae = expectScriptThrows(IllegalArgumentException.class, + () -> exec("DynamicTypeTests.DynE e = new DynamicTypeTests.DynE(); return e.value()")); + assertTrue(iae.getMessage().contains("dynamic method") && iae.getMessage().contains("not found")); + iae = expectScriptThrows(IllegalArgumentException.class, + () -> exec("DynamicTypeTests.DynE e = new DynamicTypeTests.DynF(); return e.value()")); + assertTrue(iae.getMessage().contains("dynamic method") && iae.getMessage().contains("not found")); + assertEquals(1, exec("DynamicTypeTests.DynE e = new DynamicTypeTests.DynG(); return e.value()")); + + assertEquals('E', exec("DynamicTypeTests.DynF f = new DynamicTypeTests.DynF(); return f.letter()")); + assertEquals('G', exec("DynamicTypeTests.DynF f = new DynamicTypeTests.DynG(); return f.letter()")); + iae = expectScriptThrows(IllegalArgumentException.class, + () -> exec("DynamicTypeTests.DynF f = new DynamicTypeTests.DynF(); return f.value()")); + assertTrue(iae.getMessage().contains("dynamic method") && iae.getMessage().contains("not found")); + assertEquals(1, exec("DynamicTypeTests.DynF f = new DynamicTypeTests.DynG(); return f.value()")); + + assertEquals('G', exec("DynamicTypeTests.DynG g = new DynamicTypeTests.DynG(); return g.letter()")); + assertEquals(1, exec("DynamicTypeTests.DynG g = new DynamicTypeTests.DynG(); return g.value()")); + } +} diff --git a/modules/lang-painless/src/test/resources/org/elasticsearch/painless/org.elasticsearch.painless.dynamic b/modules/lang-painless/src/test/resources/org/elasticsearch/painless/org.elasticsearch.painless.dynamic new file mode 100644 index 0000000000000..ec857f7cb53aa --- /dev/null +++ b/modules/lang-painless/src/test/resources/org/elasticsearch/painless/org.elasticsearch.painless.dynamic @@ -0,0 +1,34 @@ +class org.elasticsearch.painless.DynamicTypeTests$DynI @dynamic_type { +} + +class org.elasticsearch.painless.DynamicTypeTests$DynA { + () +} + +class org.elasticsearch.painless.DynamicTypeTests$DynB @dynamic_type { + () +} + +class org.elasticsearch.painless.DynamicTypeTests$DynC { + () +} + +class org.elasticsearch.painless.DynamicTypeTests$DynD @dynamic_type { + () + char letter() +} + +class org.elasticsearch.painless.DynamicTypeTests$DynE @dynamic_type { + () + char letter() +} + +class org.elasticsearch.painless.DynamicTypeTests$DynF @dynamic_type { + () +} + +class org.elasticsearch.painless.DynamicTypeTests$DynG @dynamic_type { + () + char letter() + int value() +} \ No newline at end of file From 81aa483345a50884e266749c4ed1945ac3bf2612 Mon Sep 17 00:00:00 2001 From: Benjamin Trent Date: Mon, 4 Oct 2021 13:29:14 -0400 Subject: [PATCH 132/250] [ML] fixing minor text categorization aggregation bug (#78629) --- .../elasticsearch/xpack/ml/aggs/categorization/TreeNode.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/categorization/TreeNode.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/categorization/TreeNode.java index 7b13e93d8f1ea..e74dbe8fe76ce 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/categorization/TreeNode.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/categorization/TreeNode.java @@ -252,7 +252,7 @@ void collapseTinyChildren() { return; } Optional maybeWildChild = getChild(WILD_CARD_ID).or(() -> { - if ((double) smallestChild.peek().count / this.getCount() <= 1.0 / maxChildren) { + if (smallestChild.size() > 0 && (double) smallestChild.peek().count / this.getCount() <= 1.0 / maxChildren) { TreeNode tinyChild = children.remove(smallestChild.poll().tokenId); return Optional.of(addChild(WILD_CARD_ID, tinyChild)); } @@ -267,7 +267,7 @@ void collapseTinyChildren() { smallestChild.add(tinyNode); break; } else { - wildChild.mergeWith(children.remove(tinyNode.count)); + wildChild.mergeWith(children.remove(tinyNode.tokenId)); } } } From 02b7b170a51d7c822040f12cd0d2970864b94940 Mon Sep 17 00:00:00 2001 From: David Turner Date: Mon, 4 Oct 2021 19:29:12 +0100 Subject: [PATCH 133/250] Prevent downgrades from 8.x to 7.x (#78586) Users sometimes attempt to downgrade a node in place, but downgrades are totally untested and unsupported and generally don't work. We protect against this by recording the node version in the metadata and refusing to start if we encounter metadata written by a future version. However in 8.0 (#42489) we changed the directory layout so that a 7.x node won't find the upgraded metadata, or indeed any other data, and will proceed as if it's a fresh node. That's almost certainly not what the user wants, so with this commit we create a file at `${path.data}/nodes` at each startup, preventing an older node from starting. Closes #52414 --- .../elasticsearch/env/NodeEnvironmentIT.java | 13 ++++---- .../elasticsearch/env/NodeEnvironment.java | 28 +++++++++++------ .../env/NodeEnvironmentTests.java | 30 ++++++++++++------- .../cluster/DiskUsageIntegTestCase.java | 5 ++++ 4 files changed, 51 insertions(+), 25 deletions(-) diff --git a/server/src/internalClusterTest/java/org/elasticsearch/env/NodeEnvironmentIT.java b/server/src/internalClusterTest/java/org/elasticsearch/env/NodeEnvironmentIT.java index 0fc7a9a03d942..967aaed752851 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/env/NodeEnvironmentIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/env/NodeEnvironmentIT.java @@ -10,10 +10,10 @@ import org.elasticsearch.Version; import org.elasticsearch.cluster.node.DiscoveryNodeRole; -import org.elasticsearch.core.CheckedConsumer; -import org.elasticsearch.core.PathUtils; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.core.CheckedConsumer; +import org.elasticsearch.core.PathUtils; import org.elasticsearch.gateway.PersistedClusterStateService; import org.elasticsearch.indices.IndicesService; import org.elasticsearch.test.ESIntegTestCase; @@ -138,8 +138,11 @@ public void testUpgradeDataFolder() throws IOException, InterruptedException { // simulate older data path layout by moving data under "nodes/0" folder final List dataPaths = List.of(PathUtils.get(Environment.PATH_DATA_SETTING.get(dataPathSettings))); dataPaths.forEach(path -> { - final Path targetPath = path.resolve("nodes").resolve("0"); + final Path nodesPath = path.resolve("nodes"); + final Path targetPath = nodesPath.resolve("0"); try { + assertTrue(Files.isRegularFile(nodesPath)); + Files.delete(nodesPath); Files.createDirectories(targetPath); try (DirectoryStream stream = Files.newDirectoryStream(path)) { @@ -192,9 +195,9 @@ public void testUpgradeDataFolder() throws IOException, InterruptedException { } // check that upgrade works - dataPaths.forEach(path -> assertTrue(Files.exists(path.resolve("nodes")))); + dataPaths.forEach(path -> assertTrue(Files.isDirectory(path.resolve("nodes")))); internalCluster().startNode(dataPathSettings); - dataPaths.forEach(path -> assertFalse(Files.exists(path.resolve("nodes")))); + dataPaths.forEach(path -> assertTrue(Files.isRegularFile(path.resolve("nodes")))); assertEquals(nodeId, client().admin().cluster().prepareState().get().getState().nodes().getMasterNodeId()); assertTrue(indexExists("test")); ensureYellow("test"); diff --git a/server/src/main/java/org/elasticsearch/env/NodeEnvironment.java b/server/src/main/java/org/elasticsearch/env/NodeEnvironment.java index 9bfe598dc0566..1c229299aa22a 100644 --- a/server/src/main/java/org/elasticsearch/env/NodeEnvironment.java +++ b/server/src/main/java/org/elasticsearch/env/NodeEnvironment.java @@ -25,21 +25,21 @@ import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.node.DiscoveryNodeRole; -import org.elasticsearch.core.CheckedFunction; -import org.elasticsearch.core.CheckedRunnable; import org.elasticsearch.common.Randomness; -import org.elasticsearch.core.SuppressForbidden; import org.elasticsearch.common.UUIDs; -import org.elasticsearch.core.Tuple; import org.elasticsearch.common.io.FileSystemUtils; -import org.elasticsearch.core.Releasable; import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Setting.Property; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.set.Sets; import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.core.CheckedFunction; +import org.elasticsearch.core.CheckedRunnable; +import org.elasticsearch.core.Releasable; +import org.elasticsearch.core.SuppressForbidden; +import org.elasticsearch.core.TimeValue; +import org.elasticsearch.core.Tuple; import org.elasticsearch.core.internal.io.IOUtils; import org.elasticsearch.gateway.MetadataStateFormat; import org.elasticsearch.gateway.PersistedClusterStateService; @@ -55,6 +55,7 @@ import java.io.Closeable; import java.io.IOException; import java.io.UncheckedIOException; +import java.nio.charset.StandardCharsets; import java.nio.file.AtomicMoveNotSupportedException; import java.nio.file.DirectoryStream; import java.nio.file.FileStore; @@ -269,6 +270,16 @@ public NodeEnvironment(Settings settings, Environment environment) throws IOExce assertCanWrite(); } + // versions 7.x and earlier put their data under ${path.data}/nodes/; leave a file at that location to prevent downgrades + final Path legacyNodesPath = environment.dataFile().resolve("nodes"); + if (Files.isRegularFile(legacyNodesPath) == false) { + final String content = "written by Elasticsearch v" + Version.CURRENT + + " to prevent a downgrade to a version prior to v8.0.0 which would result in data loss"; + Files.write(legacyNodesPath, content.getBytes(StandardCharsets.UTF_8)); + IOUtils.fsync(legacyNodesPath, false); + IOUtils.fsync(environment.dataFile(), true); + } + if (DiscoveryNode.canContainData(settings) == false) { if (DiscoveryNode.isMasterNode(settings) == false) { ensureNoIndexMetadata(nodePath); @@ -408,12 +419,11 @@ private static boolean upgradeLegacyNodeFolders(Logger logger, Settings settings IOUtils.fsync(nodePath.path, true); }); - // now do the actual upgrade. start by upgrading the node metadata file before moving anything, since a downgrade in an - // intermediate state would be pretty disastrous - loadNodeMetadata(settings, logger, legacyNodeLock.getNodePath()); + // now do the actual upgrade for (CheckedRunnable upgradeAction : upgradeActions) { upgradeAction.run(); } + } finally { legacyNodeLock.close(); } diff --git a/server/src/test/java/org/elasticsearch/env/NodeEnvironmentTests.java b/server/src/test/java/org/elasticsearch/env/NodeEnvironmentTests.java index 5cf9c24aa2529..016329eca28c9 100644 --- a/server/src/test/java/org/elasticsearch/env/NodeEnvironmentTests.java +++ b/server/src/test/java/org/elasticsearch/env/NodeEnvironmentTests.java @@ -26,6 +26,7 @@ import org.elasticsearch.test.NodeRoles; import java.io.IOException; +import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; import java.util.ArrayList; @@ -41,6 +42,7 @@ import static org.elasticsearch.test.NodeRoles.nonDataNode; import static org.elasticsearch.test.NodeRoles.nonMasterNode; import static org.hamcrest.CoreMatchers.equalTo; +import static org.hamcrest.Matchers.allOf; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.empty; import static org.hamcrest.Matchers.startsWith; @@ -439,6 +441,23 @@ public void testEnsureNoShardDataOrIndexMetadata() throws IOException { verifyFailsOnShardData(noDataNoMasterSettings, indexPath, shardDataDirName); } + public void testBlocksDowngradeToVersionWithMultipleNodesInDataPath() throws IOException { + final Settings settings = buildEnvSettings(Settings.EMPTY); + for (int i = 0; i < 2; i++) { // ensure the file gets created again if missing + try (NodeEnvironment env = newNodeEnvironment(settings)) { + final Path nodesPath = env.nodeDataPath().resolve("nodes"); + assertTrue(Files.isRegularFile(nodesPath)); + assertThat( + Files.readString(nodesPath, StandardCharsets.UTF_8), + allOf( + containsString("written by Elasticsearch"), + containsString("prevent a downgrade"), + containsString("data loss"))); + Files.delete(nodesPath); + } + } + } + private void verifyFailsOnShardData(Settings settings, Path indexPath, String shardDataDirName) { IllegalStateException ex = expectThrows(IllegalStateException.class, "Must fail creating NodeEnvironment on a data path that has shard data if node does not have data role", @@ -459,17 +478,6 @@ private void verifyFailsOnMetadata(Settings settings, Path indexPath) { assertThat(ex.getMessage(), startsWith("node does not have the data and master roles but has index metadata")); } - /** - * Converts an array of Strings to an array of Paths, adding an additional child if specified - */ - private Path[] stringsToPaths(String[] strings, String additional) { - Path[] locations = new Path[strings.length]; - for (int i = 0; i < strings.length; i++) { - locations[i] = PathUtils.get(strings[i], additional); - } - return locations; - } - @Override public NodeEnvironment newNodeEnvironment() throws IOException { return newNodeEnvironment(Settings.EMPTY); diff --git a/test/framework/src/main/java/org/elasticsearch/cluster/DiskUsageIntegTestCase.java b/test/framework/src/main/java/org/elasticsearch/cluster/DiskUsageIntegTestCase.java index 96bf7f8e5eb34..2bca8d4ddccb2 100644 --- a/test/framework/src/main/java/org/elasticsearch/cluster/DiskUsageIntegTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/cluster/DiskUsageIntegTestCase.java @@ -26,6 +26,7 @@ import java.io.FileNotFoundException; import java.io.IOException; +import java.nio.charset.StandardCharsets; import java.nio.file.DirectoryStream; import java.nio.file.FileStore; import java.nio.file.FileSystem; @@ -148,6 +149,10 @@ public long getUnallocatedSpace() throws IOException { private static long getTotalFileSize(Path path) throws IOException { if (Files.isRegularFile(path)) { + if (path.getFileName().toString().equals("nodes") + && Files.readString(path, StandardCharsets.UTF_8).contains("prevent a downgrade")) { + return 0; + } try { return Files.size(path); } catch (NoSuchFileException | FileNotFoundException e) { From 7bf0dcb6a43d7506870e0764601191104f043f4e Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Mon, 4 Oct 2021 11:38:03 -0700 Subject: [PATCH 134/250] Fix searchable snapshots license level (#78627) Searchable snapshots are an enterprise feature, but in #77395 it was accidentally changed to platinum. This commit restores the license level to enterprise. closes #78573 --- .../core/searchablesnapshots/SearchableSnapshotsConstants.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/searchablesnapshots/SearchableSnapshotsConstants.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/searchablesnapshots/SearchableSnapshotsConstants.java index 57afca8e5a774..4b166216060da 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/searchablesnapshots/SearchableSnapshotsConstants.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/searchablesnapshots/SearchableSnapshotsConstants.java @@ -22,7 +22,7 @@ public class SearchableSnapshotsConstants { // to short-circuit if not allowed. We should consider making the coupling looser, // perhaps through SPI. public static final LicensedFeature.Momentary SEARCHABLE_SNAPSHOT_FEATURE = - LicensedFeature.momentary(null, "searchable-snapshots", License.OperationMode.PLATINUM); + LicensedFeature.momentary(null, "searchable-snapshots", License.OperationMode.ENTERPRISE); public static final Setting SNAPSHOT_PARTIAL_SETTING = Setting.boolSetting( SEARCHABLE_SNAPSHOT_PARTIAL_SETTING_KEY, From 2861ee48627c8092885b5b49234d46f0297ed3bc Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Mon, 4 Oct 2021 11:38:31 -0700 Subject: [PATCH 135/250] Convert geo agg license objects to LicensedFeature (#78538) This commit moves the license checks for geo aggs to use the new LicenseFeature class. --- .../license/XPackLicenseState.java | 6 ----- .../xpack/spatial/SpatialPlugin.java | 25 +++++++++++++------ 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/XPackLicenseState.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/XPackLicenseState.java index 28701c7bfc491..be4843b8e9280 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/XPackLicenseState.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/XPackLicenseState.java @@ -64,12 +64,6 @@ public enum Feature { LOGSTASH(OperationMode.STANDARD, true), - SPATIAL_GEO_CENTROID(OperationMode.GOLD, true), - - SPATIAL_GEO_GRID(OperationMode.GOLD, true), - - SPATIAL_GEO_LINE(OperationMode.GOLD, true), - OPERATOR_PRIVILEGES(OperationMode.ENTERPRISE, true); // NOTE: this is temporary. The Feature enum will go away in favor of LicensedFeature. diff --git a/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/SpatialPlugin.java b/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/SpatialPlugin.java index 1bb6ec95c74bc..e87cda71ce500 100644 --- a/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/SpatialPlugin.java +++ b/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/SpatialPlugin.java @@ -14,7 +14,9 @@ import org.elasticsearch.geometry.Geometry; import org.elasticsearch.index.mapper.Mapper; import org.elasticsearch.ingest.Processor; +import org.elasticsearch.license.License; import org.elasticsearch.license.LicenseUtils; +import org.elasticsearch.license.LicensedFeature; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.plugins.ActionPlugin; import org.elasticsearch.plugins.ExtensiblePlugin; @@ -67,7 +69,14 @@ import static java.util.Collections.singletonList; public class SpatialPlugin extends Plugin implements ActionPlugin, MapperPlugin, SearchPlugin, IngestPlugin, ExtensiblePlugin { - private final SpatialUsage usage = new SpatialUsage(); + private final SpatialUsage usage = new SpatialUsage(); + + private final LicensedFeature.Momentary GEO_CENTROID_AGG_FEATURE = + LicensedFeature.momentary("spatial", "geo-centroid-agg", License.OperationMode.GOLD); + private final LicensedFeature.Momentary GEO_GRID_AGG_FEATURE = + LicensedFeature.momentary("spatial", "geo-grid-agg", License.OperationMode.GOLD); + private final LicensedFeature.Momentary GEO_LINE_AGG_FEATURE = + LicensedFeature.momentary("spatial", "geo-line-agg", License.OperationMode.GOLD); // to be overriden by tests protected XPackLicenseState getLicenseState() { @@ -116,7 +125,7 @@ public List getAggregations() { GeoLineAggregationBuilder.NAME, GeoLineAggregationBuilder::new, usage.track(SpatialStatsAction.Item.GEOLINE, - checkLicense(GeoLineAggregationBuilder.PARSER, XPackLicenseState.Feature.SPATIAL_GEO_LINE))) + checkLicense(GeoLineAggregationBuilder.PARSER, GEO_LINE_AGG_FEATURE))) .addResultReader(InternalGeoLine::new) .setAggregatorRegistrar(GeoLineAggregationBuilder::registerUsage)); } @@ -139,7 +148,7 @@ private void registerGeoShapeCentroidAggregator(ValuesSourceRegistry.Builder bui builder.register(GeoCentroidAggregationBuilder.REGISTRY_KEY, GeoShapeValuesSourceType.instance(), (name, valuesSourceConfig, context, parent, metadata) -> { - if (getLicenseState().checkFeature(XPackLicenseState.Feature.SPATIAL_GEO_CENTROID)) { + if (GEO_CENTROID_AGG_FEATURE.check(getLicenseState())) { return new GeoShapeCentroidAggregator(name, context, parent, valuesSourceConfig, metadata); } throw LicenseUtils.newComplianceException("geo_centroid aggregation on geo_shape fields"); @@ -152,7 +161,7 @@ private void registerGeoShapeGridAggregators(ValuesSourceRegistry.Builder builde builder.register(GeoHashGridAggregationBuilder.REGISTRY_KEY, GeoShapeValuesSourceType.instance(), (name, factories, valuesSource, precision, geoBoundingBox, requiredSize, shardSize, aggregationContext, parent, collectsFromSingleBucket, metadata) -> { - if (getLicenseState().checkFeature(XPackLicenseState.Feature.SPATIAL_GEO_GRID)) { + if (GEO_GRID_AGG_FEATURE.check(getLicenseState())) { final GeoGridTiler tiler; if (geoBoundingBox.isUnbounded()) { tiler = new UnboundedGeoHashGridTiler(precision); @@ -174,7 +183,7 @@ private void registerGeoShapeGridAggregators(ValuesSourceRegistry.Builder builde builder.register(GeoTileGridAggregationBuilder.REGISTRY_KEY, GeoShapeValuesSourceType.instance(), (name, factories, valuesSource, precision, geoBoundingBox, requiredSize, shardSize, context, parent, collectsFromSingleBucket, metadata) -> { - if (getLicenseState().checkFeature(XPackLicenseState.Feature.SPATIAL_GEO_GRID)) { + if (GEO_GRID_AGG_FEATURE.check(getLicenseState())) { final GeoGridTiler tiler; if (geoBoundingBox.isUnbounded()) { tiler = new UnboundedGeoTileGridTiler(precision); @@ -202,10 +211,10 @@ private static void registerCardinalityAggregator(ValuesSourceRegistry.Builder b builder.register(CardinalityAggregationBuilder.REGISTRY_KEY, GeoShapeValuesSourceType.instance(), CardinalityAggregator::new, true); } - private ContextParser checkLicense(ContextParser realParser, XPackLicenseState.Feature feature) { + private ContextParser checkLicense(ContextParser realParser, LicensedFeature.Momentary feature) { return (parser, name) -> { - if (getLicenseState().checkFeature(feature) == false) { - throw LicenseUtils.newComplianceException(feature.name()); + if (feature.check(getLicenseState()) == false) { + throw LicenseUtils.newComplianceException(feature.getName()); } return realParser.parse(parser, name); }; From 1aa54547e226bfad165da0582797b9916e01368a Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Mon, 4 Oct 2021 11:39:09 -0700 Subject: [PATCH 136/250] Revert "Remove MDP from PersistedClusterStateService (#72278)" (#78495) This reverts commit 2dfaf7a9e03407cde6f01f685d32c71f50b299e4. The revert was not clean, it required merging with a few changes to loadOnDiskState since the initial removal of MDP support. relates #71205 --- .../UnsafeBootstrapAndDetachCommandIT.java | 6 +- .../RemoveCorruptedShardDataCommandIT.java | 3 +- .../ElasticsearchNodeCommand.java | 4 +- .../coordination/RemoveSettingsCommand.java | 1 + .../env/NodeRepurposeCommand.java | 2 +- .../gateway/GatewayMetaState.java | 38 ++-- .../gateway/PersistedClusterStateService.java | 203 +++++++++++------- .../env/NodeRepurposeCommandTests.java | 5 +- .../env/OverrideNodeVersionCommandTests.java | 6 +- .../GatewayMetaStatePersistedStateTests.java | 12 +- .../PersistedClusterStateServiceTests.java | 16 +- .../RemoveCorruptedShardDataCommandTests.java | 2 +- 12 files changed, 180 insertions(+), 118 deletions(-) diff --git a/server/src/internalClusterTest/java/org/elasticsearch/cluster/coordination/UnsafeBootstrapAndDetachCommandIT.java b/server/src/internalClusterTest/java/org/elasticsearch/cluster/coordination/UnsafeBootstrapAndDetachCommandIT.java index 90a71853f1357..d4e505f9c6166 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/cluster/coordination/UnsafeBootstrapAndDetachCommandIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/cluster/coordination/UnsafeBootstrapAndDetachCommandIT.java @@ -156,7 +156,7 @@ public void testBootstrapNoClusterState() throws IOException { internalCluster().stopRandomDataNode(); Environment environment = TestEnvironment.newEnvironment( Settings.builder().put(internalCluster().getDefaultSettings()).put(dataPathSettings).build()); - PersistedClusterStateService.delete(nodeEnvironment.nodeDataPath()); + PersistedClusterStateService.deleteAll(nodeEnvironment.nodeDataPath()); expectThrows(() -> unsafeBootstrap(environment), ElasticsearchNodeCommand.NO_NODE_METADATA_FOUND_MSG); } @@ -170,7 +170,7 @@ public void testDetachNoClusterState() throws IOException { internalCluster().stopRandomDataNode(); Environment environment = TestEnvironment.newEnvironment( Settings.builder().put(internalCluster().getDefaultSettings()).put(dataPathSettings).build()); - PersistedClusterStateService.delete(nodeEnvironment.nodeDataPath()); + PersistedClusterStateService.deleteAll(nodeEnvironment.nodeDataPath()); expectThrows(() -> detachCluster(environment), ElasticsearchNodeCommand.NO_NODE_METADATA_FOUND_MSG); } @@ -253,7 +253,7 @@ public void test3MasterNodes2Failed() throws Exception { logger.info("--> unsafely-bootstrap 1st master-eligible node"); MockTerminal terminal = unsafeBootstrap(environmentMaster1); Metadata metadata = ElasticsearchNodeCommand.createPersistedClusterStateService(Settings.EMPTY, nodeEnvironment.nodeDataPath()) - .loadOnDiskState().metadata; + .loadBestOnDiskState().metadata; assertThat(terminal.getOutput(), containsString( String.format(Locale.ROOT, UnsafeBootstrapMasterCommand.CLUSTER_STATE_TERM_VERSION_MSG_FORMAT, metadata.coordinationMetadata().term(), metadata.version()))); diff --git a/server/src/internalClusterTest/java/org/elasticsearch/index/shard/RemoveCorruptedShardDataCommandIT.java b/server/src/internalClusterTest/java/org/elasticsearch/index/shard/RemoveCorruptedShardDataCommandIT.java index b9945f7ba62f7..c58cf04155e0f 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/index/shard/RemoveCorruptedShardDataCommandIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/index/shard/RemoveCorruptedShardDataCommandIT.java @@ -567,7 +567,8 @@ public void testResolvePath() throws Exception { for (String nodeName : nodeNames) { final Path indexPath = indexPathByNodeName.get(nodeName); final OptionSet options = parser.parse("--dir", indexPath.toAbsolutePath().toString()); - command.findAndProcessShardPath(options, environmentByNodeName.get(nodeName), environmentByNodeName.get(nodeName).dataFile(), + command.findAndProcessShardPath(options, environmentByNodeName.get(nodeName), + environmentByNodeName.get(nodeName).dataFile(), state, shardPath -> assertThat(shardPath.resolveIndex(), equalTo(indexPath))); } } diff --git a/server/src/main/java/org/elasticsearch/cluster/coordination/ElasticsearchNodeCommand.java b/server/src/main/java/org/elasticsearch/cluster/coordination/ElasticsearchNodeCommand.java index cd5f7506ca838..9c18fa447cebc 100644 --- a/server/src/main/java/org/elasticsearch/cluster/coordination/ElasticsearchNodeCommand.java +++ b/server/src/main/java/org/elasticsearch/cluster/coordination/ElasticsearchNodeCommand.java @@ -106,7 +106,7 @@ public static PersistedClusterStateService createPersistedClusterStateService(Se } String nodeId = nodeMetadata.nodeId(); - return new PersistedClusterStateService(dataPath, nodeId, namedXContentRegistry, BigArrays.NON_RECYCLING_INSTANCE, + return new PersistedClusterStateService(new Path[] { dataPath }, nodeId, namedXContentRegistry, BigArrays.NON_RECYCLING_INSTANCE, new ClusterSettings(settings, ClusterSettings.BUILT_IN_CLUSTER_SETTINGS), () -> 0L); } @@ -119,7 +119,7 @@ public static ClusterState clusterState(Environment environment, PersistedCluste public static Tuple loadTermAndClusterState(PersistedClusterStateService psf, Environment env) throws IOException { - final PersistedClusterStateService.OnDiskState bestOnDiskState = psf.loadOnDiskState(); + final PersistedClusterStateService.OnDiskState bestOnDiskState = psf.loadBestOnDiskState(); if (bestOnDiskState.empty()) { throw new ElasticsearchException(CS_MISSING_MSG); } diff --git a/server/src/main/java/org/elasticsearch/cluster/coordination/RemoveSettingsCommand.java b/server/src/main/java/org/elasticsearch/cluster/coordination/RemoveSettingsCommand.java index fdea057aad28a..b32769814aee0 100644 --- a/server/src/main/java/org/elasticsearch/cluster/coordination/RemoveSettingsCommand.java +++ b/server/src/main/java/org/elasticsearch/cluster/coordination/RemoveSettingsCommand.java @@ -52,6 +52,7 @@ protected void processNodePaths(Terminal terminal, Path dataPath, OptionSet opti } final PersistedClusterStateService persistedClusterStateService = createPersistedClusterStateService(env.settings(), dataPath); + terminal.println(Terminal.Verbosity.VERBOSE, "Loading cluster state"); final Tuple termAndClusterState = loadTermAndClusterState(persistedClusterStateService, env); final ClusterState oldClusterState = termAndClusterState.v2(); diff --git a/server/src/main/java/org/elasticsearch/env/NodeRepurposeCommand.java b/server/src/main/java/org/elasticsearch/env/NodeRepurposeCommand.java index 1bfa297cd51af..f331f287715c6 100644 --- a/server/src/main/java/org/elasticsearch/env/NodeRepurposeCommand.java +++ b/server/src/main/java/org/elasticsearch/env/NodeRepurposeCommand.java @@ -143,7 +143,7 @@ private void processMasterNoDataNode(Terminal terminal, Path dataPath, Environme private ClusterState loadClusterState(Terminal terminal, Environment env, PersistedClusterStateService psf) throws IOException { terminal.println(Terminal.Verbosity.VERBOSE, "Loading cluster state"); - return clusterState(env, psf.loadOnDiskState()); + return clusterState(env, psf.loadBestOnDiskState()); } private void outputVerboseInformation(Terminal terminal, Collection pathsToCleanup, Set indexUUIDs, Metadata metadata) { diff --git a/server/src/main/java/org/elasticsearch/gateway/GatewayMetaState.java b/server/src/main/java/org/elasticsearch/gateway/GatewayMetaState.java index a0415ae79db11..a9c0eeaea7d29 100644 --- a/server/src/main/java/org/elasticsearch/gateway/GatewayMetaState.java +++ b/server/src/main/java/org/elasticsearch/gateway/GatewayMetaState.java @@ -22,10 +22,10 @@ import org.elasticsearch.cluster.coordination.CoordinationState.PersistedState; import org.elasticsearch.cluster.coordination.InMemoryPersistedState; import org.elasticsearch.cluster.metadata.IndexMetadata; -import org.elasticsearch.cluster.metadata.IndexMetadataVerifier; import org.elasticsearch.cluster.metadata.IndexTemplateMetadata; import org.elasticsearch.cluster.metadata.Manifest; import org.elasticsearch.cluster.metadata.Metadata; +import org.elasticsearch.cluster.metadata.IndexMetadataVerifier; import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.collect.ImmutableOpenMap; @@ -94,7 +94,7 @@ public void start(Settings settings, TransportService transportService, ClusterS if (DiscoveryNode.isMasterNode(settings) || DiscoveryNode.canContainData(settings)) { try { - final PersistedClusterStateService.OnDiskState onDiskState = persistedClusterStateService.loadOnDiskState(); + final PersistedClusterStateService.OnDiskState onDiskState = persistedClusterStateService.loadBestOnDiskState(); Metadata metadata = onDiskState.metadata; long lastAcceptedVersion = onDiskState.lastAcceptedVersion; @@ -132,7 +132,7 @@ public void start(Settings settings, TransportService transportService, ClusterS } // write legacy node metadata to prevent accidental downgrades from spawning empty cluster state NodeMetadata.FORMAT.writeAndCleanup(new NodeMetadata(persistedClusterStateService.getNodeId(), Version.CURRENT), - persistedClusterStateService.getDataPath()); + persistedClusterStateService.getDataPaths()); success = true; } finally { if (success == false) { @@ -148,21 +148,23 @@ public void start(Settings settings, TransportService transportService, ClusterS final long currentTerm = 0L; final ClusterState clusterState = prepareInitialClusterState(transportService, clusterService, ClusterState.builder(ClusterName.CLUSTER_NAME_SETTING.get(settings)).build()); - // write empty cluster state just so that we have a persistent node id. There is no need to write out global metadata with - // cluster uuid as coordinating-only nodes do not snap into a cluster as they carry no state - try (PersistedClusterStateService.Writer persistenceWriter = persistedClusterStateService.createWriter()) { - persistenceWriter.writeFullStateAndCommit(currentTerm, clusterState); - } catch (IOException e) { - throw new ElasticsearchException("failed to load metadata", e); - } - try { - // delete legacy cluster state files - metaStateService.deleteAll(); - // write legacy node metadata to prevent downgrades from spawning empty cluster state - NodeMetadata.FORMAT.writeAndCleanup(new NodeMetadata(persistedClusterStateService.getNodeId(), Version.CURRENT), - persistedClusterStateService.getDataPath()); - } catch (IOException e) { - throw new UncheckedIOException(e); + if (persistedClusterStateService.getDataPaths().length > 0) { + // write empty cluster state just so that we have a persistent node id. There is no need to write out global metadata with + // cluster uuid as coordinating-only nodes do not snap into a cluster as they carry no state + try (PersistedClusterStateService.Writer persistenceWriter = persistedClusterStateService.createWriter()) { + persistenceWriter.writeFullStateAndCommit(currentTerm, clusterState); + } catch (IOException e) { + throw new ElasticsearchException("failed to load metadata", e); + } + try { + // delete legacy cluster state files + metaStateService.deleteAll(); + // write legacy node metadata to prevent downgrades from spawning empty cluster state + NodeMetadata.FORMAT.writeAndCleanup(new NodeMetadata(persistedClusterStateService.getNodeId(), Version.CURRENT), + persistedClusterStateService.getDataPaths()); + } catch (IOException e) { + throw new UncheckedIOException(e); + } } persistedState.set(new InMemoryPersistedState(currentTerm, clusterState)); } diff --git a/server/src/main/java/org/elasticsearch/gateway/PersistedClusterStateService.java b/server/src/main/java/org/elasticsearch/gateway/PersistedClusterStateService.java index cd1eff196c7b1..1b19151c57546 100644 --- a/server/src/main/java/org/elasticsearch/gateway/PersistedClusterStateService.java +++ b/server/src/main/java/org/elasticsearch/gateway/PersistedClusterStateService.java @@ -8,6 +8,7 @@ package org.elasticsearch.gateway; import com.carrotsearch.hppc.cursors.ObjectCursor; + import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.message.ParameterizedMessage; @@ -42,19 +43,14 @@ import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.cluster.metadata.Metadata; -import org.elasticsearch.core.CheckedConsumer; -import org.elasticsearch.core.Nullable; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.bytes.RecyclingBytesStreamOutput; import org.elasticsearch.common.io.Streams; import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.core.Releasable; -import org.elasticsearch.core.Releasables; import org.elasticsearch.common.logging.Loggers; import org.elasticsearch.common.lucene.Lucene; import org.elasticsearch.common.settings.ClusterSettings; import org.elasticsearch.common.settings.Setting; -import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.BigArrays; import org.elasticsearch.common.util.ByteArray; import org.elasticsearch.common.util.PageCacheRecycler; @@ -64,6 +60,11 @@ import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.core.CheckedConsumer; +import org.elasticsearch.core.Nullable; +import org.elasticsearch.core.Releasable; +import org.elasticsearch.core.Releasables; +import org.elasticsearch.core.TimeValue; import org.elasticsearch.core.internal.io.IOUtils; import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.env.NodeMetadata; @@ -130,7 +131,7 @@ public class PersistedClusterStateService { public static final Setting SLOW_WRITE_LOGGING_THRESHOLD = Setting.timeSetting("gateway.slow_write_logging_threshold", TimeValue.timeValueSeconds(10), TimeValue.ZERO, Setting.Property.NodeScope, Setting.Property.Dynamic); - private final Path dataPath; + private final Path[] dataPaths; private final String nodeId; private final NamedXContentRegistry namedXContentRegistry; private final BigArrays bigArrays; @@ -140,13 +141,13 @@ public class PersistedClusterStateService { public PersistedClusterStateService(NodeEnvironment nodeEnvironment, NamedXContentRegistry namedXContentRegistry, BigArrays bigArrays, ClusterSettings clusterSettings, LongSupplier relativeTimeMillisSupplier) { - this(nodeEnvironment.nodeDataPath(), nodeEnvironment.nodeId(), namedXContentRegistry, bigArrays, clusterSettings, + this(new Path[] { nodeEnvironment.nodeDataPath() }, nodeEnvironment.nodeId(), namedXContentRegistry, bigArrays, clusterSettings, relativeTimeMillisSupplier); } - public PersistedClusterStateService(Path dataPath, String nodeId, NamedXContentRegistry namedXContentRegistry, BigArrays bigArrays, + public PersistedClusterStateService(Path[] dataPaths, String nodeId, NamedXContentRegistry namedXContentRegistry, BigArrays bigArrays, ClusterSettings clusterSettings, LongSupplier relativeTimeMillisSupplier) { - this.dataPath = dataPath; + this.dataPaths = dataPaths; this.nodeId = nodeId; this.namedXContentRegistry = namedXContentRegistry; this.bigArrays = bigArrays; @@ -171,12 +172,14 @@ public Writer createWriter() throws IOException { final List closeables = new ArrayList<>(); boolean success = false; try { - final Directory directory = createDirectory(dataPath.resolve(METADATA_DIRECTORY_NAME)); - closeables.add(directory); + for (final Path path : dataPaths) { + final Directory directory = createDirectory(path.resolve(METADATA_DIRECTORY_NAME)); + closeables.add(directory); - final IndexWriter indexWriter = createIndexWriter(directory, false); - closeables.add(indexWriter); - metadataIndexWriters.add(new MetadataIndexWriter(directory, indexWriter)); + final IndexWriter indexWriter = createIndexWriter(directory, false); + closeables.add(indexWriter); + metadataIndexWriters.add(new MetadataIndexWriter(directory, indexWriter)); + } success = true; } finally { if (success == false) { @@ -201,11 +204,13 @@ private static IndexWriter createIndexWriter(Directory directory, boolean openEx } /** - * Remove all persisted cluster states from the given data path, for use in tests. Should only be called when there is no open - * {@link Writer} on this path. + * Remove all persisted cluster states from the given data paths, for use in tests. Should only be called when there is no open + * {@link Writer} on these paths. */ - public static void delete(Path dataPath) throws IOException { - Lucene.cleanLuceneIndex(new NIOFSDirectory(dataPath.resolve(METADATA_DIRECTORY_NAME))); + public static void deleteAll(Path... dataPaths) throws IOException { + for (Path dataPath : dataPaths) { + Lucene.cleanLuceneIndex(new NIOFSDirectory(dataPath.resolve(METADATA_DIRECTORY_NAME))); + } } // exposed for tests @@ -215,8 +220,8 @@ Directory createDirectory(Path path) throws IOException { return new NIOFSDirectory(path); } - public Path getDataPath() { - return dataPath; + public Path[] getDataPaths() { + return dataPaths; } public static class OnDiskState { @@ -242,27 +247,38 @@ public boolean empty() { } /** - * Returns the node metadata for the given data path, and checks if the node ids are unique - * @param dataPath the data path to scan + * Returns the node metadata for the given data paths, and checks if the node ids are unique + * @param dataPaths the data paths to scan */ @Nullable - public static NodeMetadata nodeMetadata(Path dataPath) throws IOException { - final Path indexPath = dataPath.resolve(METADATA_DIRECTORY_NAME); - if (Files.exists(indexPath)) { - try (DirectoryReader reader = DirectoryReader.open(new NIOFSDirectory(dataPath.resolve(METADATA_DIRECTORY_NAME)))) { - final Map userData = reader.getIndexCommit().getUserData(); - assert userData.get(NODE_VERSION_KEY) != null; - - final String nodeId = userData.get(NODE_ID_KEY); - assert nodeId != null; - final Version version = Version.fromId(Integer.parseInt(userData.get(NODE_VERSION_KEY))); - return new NodeMetadata(nodeId, version); - - } catch (IndexNotFoundException e) { - logger.debug(new ParameterizedMessage("no on-disk state at {}", indexPath), e); + public static NodeMetadata nodeMetadata(Path... dataPaths) throws IOException { + String nodeId = null; + Version version = null; + for (final Path dataPath : dataPaths) { + final Path indexPath = dataPath.resolve(METADATA_DIRECTORY_NAME); + if (Files.exists(indexPath)) { + try (DirectoryReader reader = DirectoryReader.open(new NIOFSDirectory(dataPath.resolve(METADATA_DIRECTORY_NAME)))) { + final Map userData = reader.getIndexCommit().getUserData(); + assert userData.get(NODE_VERSION_KEY) != null; + + final String thisNodeId = userData.get(NODE_ID_KEY); + assert thisNodeId != null; + if (nodeId != null && nodeId.equals(thisNodeId) == false) { + throw new IllegalStateException("unexpected node ID in metadata, found [" + thisNodeId + + "] in [" + dataPath + "] but expected [" + nodeId + "]"); + } else if (nodeId == null) { + nodeId = thisNodeId; + version = Version.fromId(Integer.parseInt(userData.get(NODE_VERSION_KEY))); + } + } catch (IndexNotFoundException e) { + logger.debug(new ParameterizedMessage("no on-disk state at {}", indexPath), e); + } } } - return null; + if (nodeId == null) { + return null; + } + return new NodeMetadata(nodeId, version); } /** @@ -291,60 +307,100 @@ public static void overrideVersion(Version newVersion, Path... dataPaths) throws } /** - * Loads the available on-disk cluster state. Returns {@link OnDiskState#NO_ON_DISK_STATE} if no such state was found. + * Loads the best available on-disk cluster state. Returns {@link OnDiskState#NO_ON_DISK_STATE} if no such state was found. */ - public OnDiskState loadOnDiskState() throws IOException { - return loadOnDiskState(true); + public OnDiskState loadBestOnDiskState() throws IOException { + return loadBestOnDiskState(true); } /** * Loads the available on-disk cluster state. Returns {@link OnDiskState#NO_ON_DISK_STATE} if no such state was found. * @param checkClean whether to check the index for corruption before loading, only for tests */ - OnDiskState loadOnDiskState(boolean checkClean) throws IOException { - OnDiskState onDiskState = OnDiskState.NO_ON_DISK_STATE; - - final Path indexPath = dataPath.resolve(METADATA_DIRECTORY_NAME); - if (Files.exists(indexPath)) { - try (Directory directory = createDirectory(indexPath)) { - if (checkClean) { - try (BytesStreamOutput outputStream = new BytesStreamOutput()) { - final boolean isClean; - try (PrintStream printStream = new PrintStream(outputStream, true, StandardCharsets.UTF_8); - CheckIndex checkIndex = new CheckIndex(directory)) { - checkIndex.setInfoStream(printStream); - checkIndex.setChecksumsOnly(true); - isClean = checkIndex.checkIndex().clean; - } + OnDiskState loadBestOnDiskState(boolean checkClean) throws IOException { + String committedClusterUuid = null; + Path committedClusterUuidPath = null; + OnDiskState bestOnDiskState = OnDiskState.NO_ON_DISK_STATE; + OnDiskState maxCurrentTermOnDiskState = bestOnDiskState; + + // We use a write-all-read-one strategy: metadata is written to every data path when accepting it, which means it is mostly + // sufficient to read _any_ copy. "Mostly" sufficient because the user can change the set of data paths when restarting, and may + // add a data path containing a stale copy of the metadata. We deal with this by using the freshest copy we can find. + for (final Path dataPath : dataPaths) { + final Path indexPath = dataPath.resolve(METADATA_DIRECTORY_NAME); + if (Files.exists(indexPath)) { + try (Directory directory = createDirectory(indexPath)) { + if (checkClean) { + try (BytesStreamOutput outputStream = new BytesStreamOutput()) { + final boolean isClean; + try (PrintStream printStream = new PrintStream(outputStream, true, StandardCharsets.UTF_8); + CheckIndex checkIndex = new CheckIndex(directory)) { + checkIndex.setInfoStream(printStream); + checkIndex.setChecksumsOnly(true); + isClean = checkIndex.checkIndex().clean; + } - if (isClean == false) { - if (logger.isErrorEnabled()) { - outputStream.bytes().utf8ToString().lines().forEach(l -> logger.error("checkIndex: {}", l)); + if (isClean == false) { + if (logger.isErrorEnabled()) { + outputStream.bytes().utf8ToString().lines().forEach(l -> logger.error("checkIndex: {}", l)); + } + throw new IllegalStateException( + "the index containing the cluster metadata under the data path [" + + dataPath + + "] has been changed by an external force after it was last written by Elasticsearch and is " + + "now unreadable" + ); } - throw new IllegalStateException( - "the index containing the cluster metadata under the data path [" - + dataPath - + "] has been changed by an external force after it was last written by Elasticsearch and is " - + "now unreadable" - ); } } - } - try (DirectoryReader directoryReader = DirectoryReader.open(directory)) { - onDiskState = loadOnDiskState(dataPath, directoryReader); + try (DirectoryReader directoryReader = DirectoryReader.open(directory)) { + final OnDiskState onDiskState = loadOnDiskState(dataPath, directoryReader); + + if (nodeId.equals(onDiskState.nodeId) == false) { + throw new IllegalStateException("the index containing the cluster metadata under the data path [" + dataPath + + "] belongs to a node with ID [" + onDiskState.nodeId + "] but this node's ID is [" + nodeId + "]"); + } + + if (onDiskState.metadata.clusterUUIDCommitted()) { + if (committedClusterUuid == null) { + committedClusterUuid = onDiskState.metadata.clusterUUID(); + committedClusterUuidPath = dataPath; + } else if (committedClusterUuid.equals(onDiskState.metadata.clusterUUID()) == false) { + throw new IllegalStateException("mismatched cluster UUIDs in metadata, found [" + committedClusterUuid + + "] in [" + committedClusterUuidPath + "] and [" + onDiskState.metadata.clusterUUID() + "] in [" + + dataPath + "]"); + } + } + + if (maxCurrentTermOnDiskState.empty() || maxCurrentTermOnDiskState.currentTerm < onDiskState.currentTerm) { + maxCurrentTermOnDiskState = onDiskState; + } - if (nodeId.equals(onDiskState.nodeId) == false) { - throw new IllegalStateException("the index containing the cluster metadata under the data path [" + dataPath + - "] belongs to a node with ID [" + onDiskState.nodeId + "] but this node's ID is [" + nodeId + "]"); + long acceptedTerm = onDiskState.metadata.coordinationMetadata().term(); + long maxAcceptedTerm = bestOnDiskState.metadata.coordinationMetadata().term(); + if (bestOnDiskState.empty() + || acceptedTerm > maxAcceptedTerm + || (acceptedTerm == maxAcceptedTerm + && (onDiskState.lastAcceptedVersion > bestOnDiskState.lastAcceptedVersion + || (onDiskState.lastAcceptedVersion == bestOnDiskState.lastAcceptedVersion) + && onDiskState.currentTerm > bestOnDiskState.currentTerm))) { + bestOnDiskState = onDiskState; + } } + } catch (IndexNotFoundException e) { + logger.debug(new ParameterizedMessage("no on-disk state at {}", indexPath), e); } - } catch (IndexNotFoundException e) { - logger.debug(new ParameterizedMessage("no on-disk state at {}", indexPath), e); } } - return onDiskState; + if (bestOnDiskState.currentTerm != maxCurrentTermOnDiskState.currentTerm) { + throw new IllegalStateException("inconsistent terms found: best state is from [" + bestOnDiskState.dataPath + + "] in term [" + bestOnDiskState.currentTerm + "] but there is a stale state in [" + maxCurrentTermOnDiskState.dataPath + + "] with greater term [" + maxCurrentTermOnDiskState.currentTerm + "]"); + } + + return bestOnDiskState; } private OnDiskState loadOnDiskState(Path dataPath, DirectoryReader reader) throws IOException { @@ -369,6 +425,7 @@ private OnDiskState loadOnDiskState(Path dataPath, DirectoryReader reader) throw } logger.trace("got global metadata, now reading index metadata"); + final Set indexUUIDs = new HashSet<>(); consumeFromType(searcher, INDEX_TYPE_NAME, bytes -> { diff --git a/server/src/test/java/org/elasticsearch/env/NodeRepurposeCommandTests.java b/server/src/test/java/org/elasticsearch/env/NodeRepurposeCommandTests.java index fd9857422d7fc..f276aacacde58 100644 --- a/server/src/test/java/org/elasticsearch/env/NodeRepurposeCommandTests.java +++ b/server/src/test/java/org/elasticsearch/env/NodeRepurposeCommandTests.java @@ -51,6 +51,7 @@ public class NodeRepurposeCommandTests extends ESTestCase { private static final Index INDEX = new Index("testIndex", "testUUID"); private Settings dataMasterSettings; private Environment environment; + private Path[] nodePaths; private Settings dataNoMasterSettings; private Settings noDataNoMasterSettings; private Settings noDataMasterSettings; @@ -60,9 +61,9 @@ public void createNodePaths() throws IOException { dataMasterSettings = buildEnvSettings(Settings.EMPTY); environment = TestEnvironment.newEnvironment(dataMasterSettings); try (NodeEnvironment nodeEnvironment = new NodeEnvironment(dataMasterSettings, environment)) { - Path nodePath = nodeEnvironment.nodeDataPath(); + nodePaths = new Path[] { nodeEnvironment.nodeDataPath() }; final String nodeId = randomAlphaOfLength(10); - try (PersistedClusterStateService.Writer writer = new PersistedClusterStateService(nodePath, nodeId, + try (PersistedClusterStateService.Writer writer = new PersistedClusterStateService(nodePaths, nodeId, xContentRegistry(), BigArrays.NON_RECYCLING_INSTANCE, new ClusterSettings(dataMasterSettings, ClusterSettings.BUILT_IN_CLUSTER_SETTINGS), () -> 0L).createWriter()) { writer.writeFullStateAndCommit(1L, ClusterState.EMPTY_STATE); diff --git a/server/src/test/java/org/elasticsearch/env/OverrideNodeVersionCommandTests.java b/server/src/test/java/org/elasticsearch/env/OverrideNodeVersionCommandTests.java index 33c0a197263d7..9d9ee6debaf39 100644 --- a/server/src/test/java/org/elasticsearch/env/OverrideNodeVersionCommandTests.java +++ b/server/src/test/java/org/elasticsearch/env/OverrideNodeVersionCommandTests.java @@ -45,7 +45,7 @@ public void createNodePaths() throws IOException { nodePath = nodeEnvironment.nodeDataPath(); nodeId = nodeEnvironment.nodeId(); - try (PersistedClusterStateService.Writer writer = new PersistedClusterStateService(nodePath, nodeId, + try (PersistedClusterStateService.Writer writer = new PersistedClusterStateService(new Path[] { nodePath }, nodeId, xContentRegistry(), BigArrays.NON_RECYCLING_INSTANCE, new ClusterSettings(settings, ClusterSettings.BUILT_IN_CLUSTER_SETTINGS), () -> 0L).createWriter()) { writer.writeFullStateAndCommit(1L, ClusterState.builder(ClusterName.DEFAULT).metadata(Metadata.builder() @@ -57,10 +57,10 @@ public void createNodePaths() throws IOException { @After public void checkClusterStateIntact() throws IOException { - assertTrue(Metadata.SETTING_READ_ONLY_SETTING.get(new PersistedClusterStateService(nodePath, nodeId, + assertTrue(Metadata.SETTING_READ_ONLY_SETTING.get(new PersistedClusterStateService(new Path[] { nodePath }, nodeId, xContentRegistry(), BigArrays.NON_RECYCLING_INSTANCE, new ClusterSettings(Settings.EMPTY, ClusterSettings.BUILT_IN_CLUSTER_SETTINGS), () -> 0L) - .loadOnDiskState().metadata.persistentSettings())); + .loadBestOnDiskState().metadata.persistentSettings())); } public void testFailsOnEmptyPath() { diff --git a/server/src/test/java/org/elasticsearch/gateway/GatewayMetaStatePersistedStateTests.java b/server/src/test/java/org/elasticsearch/gateway/GatewayMetaStatePersistedStateTests.java index e030d5d1f6dee..f5500bc710110 100644 --- a/server/src/test/java/org/elasticsearch/gateway/GatewayMetaStatePersistedStateTests.java +++ b/server/src/test/java/org/elasticsearch/gateway/GatewayMetaStatePersistedStateTests.java @@ -316,7 +316,7 @@ public void testStatePersistedOnLoad() throws IOException { final PersistedClusterStateService newPersistedClusterStateService = new PersistedClusterStateService(nodeEnvironment, xContentRegistry(), getBigArrays(), new ClusterSettings(settings, ClusterSettings.BUILT_IN_CLUSTER_SETTINGS), () -> 0L); - final PersistedClusterStateService.OnDiskState onDiskState = newPersistedClusterStateService.loadOnDiskState(); + final PersistedClusterStateService.OnDiskState onDiskState = newPersistedClusterStateService.loadBestOnDiskState(); assertFalse(onDiskState.empty()); assertThat(onDiskState.currentTerm, equalTo(42L)); assertClusterStateEqual(state, @@ -370,7 +370,7 @@ public void testDataOnlyNodePersistence() throws Exception { assertThat(persistedState.getLastAcceptedState().getLastAcceptedConfiguration(), not(equalTo(persistedState.getLastAcceptedState().getLastCommittedConfiguration()))); CoordinationMetadata persistedCoordinationMetadata = - persistedClusterStateService.loadOnDiskState(false).metadata.coordinationMetadata(); + persistedClusterStateService.loadBestOnDiskState(false).metadata.coordinationMetadata(); assertThat(persistedCoordinationMetadata.getLastAcceptedConfiguration(), equalTo(GatewayMetaState.AsyncPersistedState.staleStateConfiguration)); assertThat(persistedCoordinationMetadata.getLastCommittedConfiguration(), @@ -386,12 +386,12 @@ public void testDataOnlyNodePersistence() throws Exception { .clusterUUID(state.metadata().clusterUUID()).clusterUUIDCommitted(true).build()).build(); assertClusterStateEqual(expectedClusterState, persistedState.getLastAcceptedState()); - persistedCoordinationMetadata = persistedClusterStateService.loadOnDiskState(false).metadata.coordinationMetadata(); + persistedCoordinationMetadata = persistedClusterStateService.loadBestOnDiskState(false).metadata.coordinationMetadata(); assertThat(persistedCoordinationMetadata.getLastAcceptedConfiguration(), equalTo(GatewayMetaState.AsyncPersistedState.staleStateConfiguration)); assertThat(persistedCoordinationMetadata.getLastCommittedConfiguration(), equalTo(GatewayMetaState.AsyncPersistedState.staleStateConfiguration)); - assertTrue(persistedClusterStateService.loadOnDiskState(false).metadata.clusterUUIDCommitted()); + assertTrue(persistedClusterStateService.loadBestOnDiskState(false).metadata.clusterUUIDCommitted()); // generate a series of updates and check if batching works final String indexName = randomAlphaOfLength(10); @@ -513,7 +513,7 @@ Directory createDirectory(Path path) { final PersistedClusterStateService newPersistedClusterStateService = new PersistedClusterStateService(nodeEnvironment, xContentRegistry(), getBigArrays(), new ClusterSettings(settings, ClusterSettings.BUILT_IN_CLUSTER_SETTINGS), () -> 0L); - final PersistedClusterStateService.OnDiskState onDiskState = newPersistedClusterStateService.loadOnDiskState(); + final PersistedClusterStateService.OnDiskState onDiskState = newPersistedClusterStateService.loadBestOnDiskState(); assertFalse(onDiskState.empty()); assertThat(onDiskState.currentTerm, equalTo(currentTerm)); assertClusterStateEqual(state, @@ -585,7 +585,7 @@ public void testStatePersistenceWithFatalError() throws IOException { final PersistedClusterStateService newPersistedClusterStateService = new PersistedClusterStateService(nodeEnvironment, xContentRegistry(), getBigArrays(), new ClusterSettings(settings, ClusterSettings.BUILT_IN_CLUSTER_SETTINGS), () -> 0L); - final PersistedClusterStateService.OnDiskState onDiskState = newPersistedClusterStateService.loadOnDiskState(); + final PersistedClusterStateService.OnDiskState onDiskState = newPersistedClusterStateService.loadBestOnDiskState(); assertFalse(onDiskState.empty()); assertThat(onDiskState.currentTerm, equalTo(currentTerm)); assertClusterStateEqual(state, diff --git a/server/src/test/java/org/elasticsearch/gateway/PersistedClusterStateServiceTests.java b/server/src/test/java/org/elasticsearch/gateway/PersistedClusterStateServiceTests.java index e14cfb21224d9..669a7dc920090 100644 --- a/server/src/test/java/org/elasticsearch/gateway/PersistedClusterStateServiceTests.java +++ b/server/src/test/java/org/elasticsearch/gateway/PersistedClusterStateServiceTests.java @@ -78,13 +78,13 @@ public void testPersistsAndReloadsTerm() throws IOException { final PersistedClusterStateService persistedClusterStateService = newPersistedClusterStateService(nodeEnvironment); final long newTerm = randomNonNegativeLong(); - assertThat(persistedClusterStateService.loadOnDiskState().currentTerm, equalTo(0L)); + assertThat(persistedClusterStateService.loadBestOnDiskState().currentTerm, equalTo(0L)); try (Writer writer = persistedClusterStateService.createWriter()) { writer.writeFullStateAndCommit(newTerm, ClusterState.EMPTY_STATE); - assertThat(persistedClusterStateService.loadOnDiskState(false).currentTerm, equalTo(newTerm)); + assertThat(persistedClusterStateService.loadBestOnDiskState(false).currentTerm, equalTo(newTerm)); } - assertThat(persistedClusterStateService.loadOnDiskState().currentTerm, equalTo(newTerm)); + assertThat(persistedClusterStateService.loadBestOnDiskState().currentTerm, equalTo(newTerm)); } } @@ -286,7 +286,7 @@ public void testFailsIfGlobalMetadataIsMissing() throws IOException { } final String message = expectThrows(IllegalStateException.class, - () -> newPersistedClusterStateService(nodeEnvironment).loadOnDiskState()).getMessage(); + () -> newPersistedClusterStateService(nodeEnvironment).loadBestOnDiskState()).getMessage(); assertThat(message, allOf(containsString("no global metadata found"), containsString(brokenPath.toString()))); } } @@ -318,7 +318,7 @@ public void testFailsIfGlobalMetadataIsDuplicated() throws IOException { } final String message = expectThrows(IllegalStateException.class, - () -> newPersistedClusterStateService(nodeEnvironment1).loadOnDiskState()).getMessage(); + () -> newPersistedClusterStateService(nodeEnvironment1).loadBestOnDiskState()).getMessage(); assertThat(message, allOf(containsString("duplicate global metadata found"), containsString(brokenPath.toString()))); } } @@ -364,7 +364,7 @@ public void testFailsIfIndexMetadataIsDuplicated() throws IOException { } final String message = expectThrows(IllegalStateException.class, - () -> newPersistedClusterStateService(nodeEnvironment1).loadOnDiskState()).getMessage(); + () -> newPersistedClusterStateService(nodeEnvironment1).loadBestOnDiskState()).getMessage(); assertThat(message, allOf( containsString("duplicate metadata found"), containsString(brokenPath.toString()), @@ -664,7 +664,7 @@ public void testFailsIfCorrupt() throws IOException { .collect(Collectors.toList()))); } - assertThat(expectThrows(IllegalStateException.class, persistedClusterStateService::loadOnDiskState).getMessage(), allOf( + assertThat(expectThrows(IllegalStateException.class, persistedClusterStateService::loadBestOnDiskState).getMessage(), allOf( startsWith("the index containing the cluster metadata under the data path ["), endsWith("] has been changed by an external force after it was last written by Elasticsearch and is now unreadable"))); } @@ -707,7 +707,7 @@ private NodeEnvironment newNodeEnvironment(Path dataPath) throws IOException { } private static ClusterState loadPersistedClusterState(PersistedClusterStateService persistedClusterStateService) throws IOException { - final PersistedClusterStateService.OnDiskState onDiskState = persistedClusterStateService.loadOnDiskState(false); + final PersistedClusterStateService.OnDiskState onDiskState = persistedClusterStateService.loadBestOnDiskState(false); return clusterStateFromMetadata(onDiskState.lastAcceptedVersion, onDiskState.metadata); } diff --git a/server/src/test/java/org/elasticsearch/index/shard/RemoveCorruptedShardDataCommandTests.java b/server/src/test/java/org/elasticsearch/index/shard/RemoveCorruptedShardDataCommandTests.java index 1bcff5dbe05c2..6d7a293f73c66 100644 --- a/server/src/test/java/org/elasticsearch/index/shard/RemoveCorruptedShardDataCommandTests.java +++ b/server/src/test/java/org/elasticsearch/index/shard/RemoveCorruptedShardDataCommandTests.java @@ -131,7 +131,7 @@ public void setup() throws IOException { try (NodeEnvironment.NodeLock lock = new NodeEnvironment.NodeLock(logger, environment, Files::exists)) { final NodeEnvironment.NodePath dataPath = lock.getNodePath(); - try (PersistedClusterStateService.Writer writer = new PersistedClusterStateService(dataPath.path, nodeId, + try (PersistedClusterStateService.Writer writer = new PersistedClusterStateService(new Path[] { dataPath.path }, nodeId, xContentRegistry(), BigArrays.NON_RECYCLING_INSTANCE, new ClusterSettings(settings, ClusterSettings.BUILT_IN_CLUSTER_SETTINGS), () -> 0L).createWriter()) { writer.writeFullStateAndCommit(1L, clusterState); From 4f0d137c5fc19aa879a3afe2d73c1d31c9bf55a7 Mon Sep 17 00:00:00 2001 From: David Turner Date: Mon, 4 Oct 2021 19:43:01 +0100 Subject: [PATCH 137/250] Revert "Prevent downgrades from 8.x to 7.x (#78586)" This reverts commit 02b7b170a51d7c822040f12cd0d2970864b94940. --- .../elasticsearch/env/NodeEnvironmentIT.java | 13 ++++---- .../elasticsearch/env/NodeEnvironment.java | 28 ++++++----------- .../env/NodeEnvironmentTests.java | 30 +++++++------------ .../cluster/DiskUsageIntegTestCase.java | 5 ---- 4 files changed, 25 insertions(+), 51 deletions(-) diff --git a/server/src/internalClusterTest/java/org/elasticsearch/env/NodeEnvironmentIT.java b/server/src/internalClusterTest/java/org/elasticsearch/env/NodeEnvironmentIT.java index 967aaed752851..0fc7a9a03d942 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/env/NodeEnvironmentIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/env/NodeEnvironmentIT.java @@ -10,10 +10,10 @@ import org.elasticsearch.Version; import org.elasticsearch.cluster.node.DiscoveryNodeRole; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.core.CheckedConsumer; import org.elasticsearch.core.PathUtils; +import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.gateway.PersistedClusterStateService; import org.elasticsearch.indices.IndicesService; import org.elasticsearch.test.ESIntegTestCase; @@ -138,11 +138,8 @@ public void testUpgradeDataFolder() throws IOException, InterruptedException { // simulate older data path layout by moving data under "nodes/0" folder final List dataPaths = List.of(PathUtils.get(Environment.PATH_DATA_SETTING.get(dataPathSettings))); dataPaths.forEach(path -> { - final Path nodesPath = path.resolve("nodes"); - final Path targetPath = nodesPath.resolve("0"); + final Path targetPath = path.resolve("nodes").resolve("0"); try { - assertTrue(Files.isRegularFile(nodesPath)); - Files.delete(nodesPath); Files.createDirectories(targetPath); try (DirectoryStream stream = Files.newDirectoryStream(path)) { @@ -195,9 +192,9 @@ public void testUpgradeDataFolder() throws IOException, InterruptedException { } // check that upgrade works - dataPaths.forEach(path -> assertTrue(Files.isDirectory(path.resolve("nodes")))); + dataPaths.forEach(path -> assertTrue(Files.exists(path.resolve("nodes")))); internalCluster().startNode(dataPathSettings); - dataPaths.forEach(path -> assertTrue(Files.isRegularFile(path.resolve("nodes")))); + dataPaths.forEach(path -> assertFalse(Files.exists(path.resolve("nodes")))); assertEquals(nodeId, client().admin().cluster().prepareState().get().getState().nodes().getMasterNodeId()); assertTrue(indexExists("test")); ensureYellow("test"); diff --git a/server/src/main/java/org/elasticsearch/env/NodeEnvironment.java b/server/src/main/java/org/elasticsearch/env/NodeEnvironment.java index 1c229299aa22a..9bfe598dc0566 100644 --- a/server/src/main/java/org/elasticsearch/env/NodeEnvironment.java +++ b/server/src/main/java/org/elasticsearch/env/NodeEnvironment.java @@ -25,21 +25,21 @@ import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.node.DiscoveryNodeRole; +import org.elasticsearch.core.CheckedFunction; +import org.elasticsearch.core.CheckedRunnable; import org.elasticsearch.common.Randomness; +import org.elasticsearch.core.SuppressForbidden; import org.elasticsearch.common.UUIDs; +import org.elasticsearch.core.Tuple; import org.elasticsearch.common.io.FileSystemUtils; +import org.elasticsearch.core.Releasable; import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Setting.Property; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.ByteSizeValue; +import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.set.Sets; import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.core.CheckedFunction; -import org.elasticsearch.core.CheckedRunnable; -import org.elasticsearch.core.Releasable; -import org.elasticsearch.core.SuppressForbidden; -import org.elasticsearch.core.TimeValue; -import org.elasticsearch.core.Tuple; import org.elasticsearch.core.internal.io.IOUtils; import org.elasticsearch.gateway.MetadataStateFormat; import org.elasticsearch.gateway.PersistedClusterStateService; @@ -55,7 +55,6 @@ import java.io.Closeable; import java.io.IOException; import java.io.UncheckedIOException; -import java.nio.charset.StandardCharsets; import java.nio.file.AtomicMoveNotSupportedException; import java.nio.file.DirectoryStream; import java.nio.file.FileStore; @@ -270,16 +269,6 @@ public NodeEnvironment(Settings settings, Environment environment) throws IOExce assertCanWrite(); } - // versions 7.x and earlier put their data under ${path.data}/nodes/; leave a file at that location to prevent downgrades - final Path legacyNodesPath = environment.dataFile().resolve("nodes"); - if (Files.isRegularFile(legacyNodesPath) == false) { - final String content = "written by Elasticsearch v" + Version.CURRENT + - " to prevent a downgrade to a version prior to v8.0.0 which would result in data loss"; - Files.write(legacyNodesPath, content.getBytes(StandardCharsets.UTF_8)); - IOUtils.fsync(legacyNodesPath, false); - IOUtils.fsync(environment.dataFile(), true); - } - if (DiscoveryNode.canContainData(settings) == false) { if (DiscoveryNode.isMasterNode(settings) == false) { ensureNoIndexMetadata(nodePath); @@ -419,11 +408,12 @@ private static boolean upgradeLegacyNodeFolders(Logger logger, Settings settings IOUtils.fsync(nodePath.path, true); }); - // now do the actual upgrade + // now do the actual upgrade. start by upgrading the node metadata file before moving anything, since a downgrade in an + // intermediate state would be pretty disastrous + loadNodeMetadata(settings, logger, legacyNodeLock.getNodePath()); for (CheckedRunnable upgradeAction : upgradeActions) { upgradeAction.run(); } - } finally { legacyNodeLock.close(); } diff --git a/server/src/test/java/org/elasticsearch/env/NodeEnvironmentTests.java b/server/src/test/java/org/elasticsearch/env/NodeEnvironmentTests.java index 016329eca28c9..5cf9c24aa2529 100644 --- a/server/src/test/java/org/elasticsearch/env/NodeEnvironmentTests.java +++ b/server/src/test/java/org/elasticsearch/env/NodeEnvironmentTests.java @@ -26,7 +26,6 @@ import org.elasticsearch.test.NodeRoles; import java.io.IOException; -import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; import java.util.ArrayList; @@ -42,7 +41,6 @@ import static org.elasticsearch.test.NodeRoles.nonDataNode; import static org.elasticsearch.test.NodeRoles.nonMasterNode; import static org.hamcrest.CoreMatchers.equalTo; -import static org.hamcrest.Matchers.allOf; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.empty; import static org.hamcrest.Matchers.startsWith; @@ -441,23 +439,6 @@ public void testEnsureNoShardDataOrIndexMetadata() throws IOException { verifyFailsOnShardData(noDataNoMasterSettings, indexPath, shardDataDirName); } - public void testBlocksDowngradeToVersionWithMultipleNodesInDataPath() throws IOException { - final Settings settings = buildEnvSettings(Settings.EMPTY); - for (int i = 0; i < 2; i++) { // ensure the file gets created again if missing - try (NodeEnvironment env = newNodeEnvironment(settings)) { - final Path nodesPath = env.nodeDataPath().resolve("nodes"); - assertTrue(Files.isRegularFile(nodesPath)); - assertThat( - Files.readString(nodesPath, StandardCharsets.UTF_8), - allOf( - containsString("written by Elasticsearch"), - containsString("prevent a downgrade"), - containsString("data loss"))); - Files.delete(nodesPath); - } - } - } - private void verifyFailsOnShardData(Settings settings, Path indexPath, String shardDataDirName) { IllegalStateException ex = expectThrows(IllegalStateException.class, "Must fail creating NodeEnvironment on a data path that has shard data if node does not have data role", @@ -478,6 +459,17 @@ private void verifyFailsOnMetadata(Settings settings, Path indexPath) { assertThat(ex.getMessage(), startsWith("node does not have the data and master roles but has index metadata")); } + /** + * Converts an array of Strings to an array of Paths, adding an additional child if specified + */ + private Path[] stringsToPaths(String[] strings, String additional) { + Path[] locations = new Path[strings.length]; + for (int i = 0; i < strings.length; i++) { + locations[i] = PathUtils.get(strings[i], additional); + } + return locations; + } + @Override public NodeEnvironment newNodeEnvironment() throws IOException { return newNodeEnvironment(Settings.EMPTY); diff --git a/test/framework/src/main/java/org/elasticsearch/cluster/DiskUsageIntegTestCase.java b/test/framework/src/main/java/org/elasticsearch/cluster/DiskUsageIntegTestCase.java index 2bca8d4ddccb2..96bf7f8e5eb34 100644 --- a/test/framework/src/main/java/org/elasticsearch/cluster/DiskUsageIntegTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/cluster/DiskUsageIntegTestCase.java @@ -26,7 +26,6 @@ import java.io.FileNotFoundException; import java.io.IOException; -import java.nio.charset.StandardCharsets; import java.nio.file.DirectoryStream; import java.nio.file.FileStore; import java.nio.file.FileSystem; @@ -149,10 +148,6 @@ public long getUnallocatedSpace() throws IOException { private static long getTotalFileSize(Path path) throws IOException { if (Files.isRegularFile(path)) { - if (path.getFileName().toString().equals("nodes") - && Files.readString(path, StandardCharsets.UTF_8).contains("prevent a downgrade")) { - return 0; - } try { return Files.size(path); } catch (NoSuchFileException | FileNotFoundException e) { From 4a14f2f6f975e970ac0e85716d4506e81e043903 Mon Sep 17 00:00:00 2001 From: Joe Gallo Date: Mon, 4 Oct 2021 15:19:10 -0400 Subject: [PATCH 138/250] Validate that snapshot repository exists for ILM policies at creation/update time (#78468) --- .../client/ilm/SearchableSnapshotAction.java | 4 + .../client/ilm/WaitForSnapshotAction.java | 4 + .../client/IndexLifecycleIT.java | 78 +++++++++- .../set-up-a-data-stream.asciidoc | 14 ++ .../actions/ilm-searchable-snapshot.asciidoc | 13 ++ .../actions/ilm-wait-for-snapshot.asciidoc | 23 ++- .../migration/migrate_8_0/ilm.asciidoc | 14 ++ docs/reference/tab-widgets/ilm.asciidoc | 14 ++ .../xpack/core/ilm/WaitForSnapshotAction.java | 4 + .../ilm/TimeSeriesLifecycleActionsIT.java | 70 ++++++--- .../action/TransportPutLifecycleAction.java | 133 ++++++++++++------ ...ansportExecuteSnapshotLifecycleAction.java | 7 +- 12 files changed, 298 insertions(+), 80 deletions(-) diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/SearchableSnapshotAction.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/SearchableSnapshotAction.java index da3c660d673b2..551c77fbb3aa8 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/SearchableSnapshotAction.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/SearchableSnapshotAction.java @@ -59,6 +59,10 @@ boolean isForceMergeIndex() { return forceMergeIndex; } + public String getSnapshotRepository() { + return snapshotRepository; + } + @Override public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException { builder.startObject(); diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/WaitForSnapshotAction.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/WaitForSnapshotAction.java index 52ad7c8c9c872..a9cb0efd1d87b 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/WaitForSnapshotAction.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/WaitForSnapshotAction.java @@ -47,6 +47,10 @@ public WaitForSnapshotAction(String policy) { this.policy = policy; } + public String getPolicy() { + return policy; + } + @Override public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException { builder.startObject(); diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/IndexLifecycleIT.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/IndexLifecycleIT.java index 9df499ca7884f..2ac88eec77261 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/IndexLifecycleIT.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/IndexLifecycleIT.java @@ -9,6 +9,7 @@ package org.elasticsearch.client; import org.elasticsearch.ElasticsearchStatusException; +import org.elasticsearch.action.admin.cluster.repositories.put.PutRepositoryRequest; import org.elasticsearch.action.admin.indices.settings.get.GetSettingsRequest; import org.elasticsearch.action.admin.indices.settings.get.GetSettingsResponse; import org.elasticsearch.client.core.AcknowledgedResponse; @@ -40,6 +41,8 @@ import org.elasticsearch.client.ilm.StopILMRequest; import org.elasticsearch.client.ilm.UnfollowAction; import org.elasticsearch.client.ilm.WaitForSnapshotAction; +import org.elasticsearch.client.slm.PutSnapshotLifecyclePolicyRequest; +import org.elasticsearch.client.slm.SnapshotLifecyclePolicy; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; import org.hamcrest.Matchers; @@ -50,7 +53,10 @@ import java.util.Collections; import java.util.HashMap; import java.util.List; +import java.util.Locale; import java.util.Map; +import java.util.Objects; +import java.util.Set; import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; @@ -65,9 +71,10 @@ public class IndexLifecycleIT extends ESRestHighLevelClientTestCase { public void testRemoveIndexLifecyclePolicy() throws Exception { String policyName = randomAlphaOfLength(10); LifecyclePolicy policy = createRandomPolicy(policyName); + ensurePrerequisites(policy); PutLifecyclePolicyRequest putRequest = new PutLifecyclePolicyRequest(policy); assertAcked(execute(putRequest, highLevelClient().indexLifecycle()::putLifecyclePolicy, - highLevelClient().indexLifecycle()::putLifecyclePolicyAsync)); + highLevelClient().indexLifecycle()::putLifecyclePolicyAsync)); createIndex("foo", Settings.builder().put("index.lifecycle.name", policyName).build()); createIndex("baz", Settings.builder().put("index.lifecycle.name", policyName).build()); @@ -84,7 +91,7 @@ public void testRemoveIndexLifecyclePolicy() throws Exception { indices.add("rbh"); RemoveIndexLifecyclePolicyRequest removeReq = new RemoveIndexLifecyclePolicyRequest(indices); RemoveIndexLifecyclePolicyResponse removeResp = execute(removeReq, highLevelClient().indexLifecycle()::removeIndexLifecyclePolicy, - highLevelClient().indexLifecycle()::removeIndexLifecyclePolicyAsync); + highLevelClient().indexLifecycle()::removeIndexLifecyclePolicyAsync); assertThat(removeResp.hasFailures(), is(false)); assertThat(removeResp.getFailedIndexes().isEmpty(), is(true)); @@ -98,6 +105,7 @@ public void testRemoveIndexLifecyclePolicy() throws Exception { public void testStartStopILM() throws Exception { String policyName = randomAlphaOfLength(10); LifecyclePolicy policy = createRandomPolicy(policyName); + ensurePrerequisites(policy); PutLifecyclePolicyRequest putRequest = new PutLifecyclePolicyRequest(policy); assertAcked(execute(putRequest, highLevelClient().indexLifecycle()::putLifecyclePolicy, highLevelClient().indexLifecycle()::putLifecyclePolicyAsync)); @@ -115,19 +123,19 @@ public void testStartStopILM() throws Exception { StopILMRequest stopReq = new StopILMRequest(); AcknowledgedResponse stopResponse = execute(stopReq, highLevelClient().indexLifecycle()::stopILM, - highLevelClient().indexLifecycle()::stopILMAsync); + highLevelClient().indexLifecycle()::stopILMAsync); assertTrue(stopResponse.isAcknowledged()); statusResponse = execute(statusRequest, highLevelClient().indexLifecycle()::lifecycleManagementStatus, highLevelClient().indexLifecycle()::lifecycleManagementStatusAsync); assertThat(statusResponse.getOperationMode(), - Matchers.anyOf(equalTo(OperationMode.STOPPING), - equalTo(OperationMode.STOPPED))); + Matchers.anyOf(equalTo(OperationMode.STOPPING), + equalTo(OperationMode.STOPPED))); StartILMRequest startReq = new StartILMRequest(); AcknowledgedResponse startResponse = execute(startReq, highLevelClient().indexLifecycle()::startILM, - highLevelClient().indexLifecycle()::startILMAsync); + highLevelClient().indexLifecycle()::startILMAsync); assertTrue(startResponse.isAcknowledged()); statusResponse = execute(statusRequest, highLevelClient().indexLifecycle()::lifecycleManagementStatus, @@ -161,6 +169,7 @@ public void testExplainLifecycle() throws Exception { lifecyclePhases.put("delete", new Phase("delete", TimeValue.timeValueSeconds(3000), deleteActions)); LifecyclePolicy policy = new LifecyclePolicy(randomAlphaOfLength(10), lifecyclePhases); + ensurePrerequisites(policy); PutLifecyclePolicyRequest putRequest = new PutLifecyclePolicyRequest(policy); AcknowledgedResponse putResponse = execute(putRequest, highLevelClient().indexLifecycle()::putLifecyclePolicy, highLevelClient().indexLifecycle()::putLifecyclePolicyAsync); @@ -215,6 +224,7 @@ public void testExplainLifecycle() throws Exception { public void testDeleteLifecycle() throws IOException { String policyName = randomAlphaOfLength(10); LifecyclePolicy policy = createRandomPolicy(policyName); + ensurePrerequisites(policy); PutLifecyclePolicyRequest putRequest = new PutLifecyclePolicyRequest(policy); assertAcked(execute(putRequest, highLevelClient().indexLifecycle()::putLifecyclePolicy, highLevelClient().indexLifecycle()::putLifecyclePolicyAsync)); @@ -233,6 +243,7 @@ public void testDeleteLifecycle() throws IOException { public void testPutLifecycle() throws IOException { String name = randomAlphaOfLengthBetween(5, 20); LifecyclePolicy policy = createRandomPolicy(name); + ensurePrerequisites(policy); PutLifecyclePolicyRequest putRequest = new PutLifecyclePolicyRequest(policy); assertAcked(execute(putRequest, highLevelClient().indexLifecycle()::putLifecyclePolicy, @@ -251,6 +262,7 @@ public void testGetMultipleLifecyclePolicies() throws IOException { for (int i = 0; i < numPolicies; i++) { policyNames[i] = "policy-" + randomAlphaOfLengthBetween(5, 10); policies[i] = createRandomPolicy(policyNames[i]); + ensurePrerequisites(policies[i]); PutLifecyclePolicyRequest putRequest = new PutLifecyclePolicyRequest(policies[i]); assertAcked(execute(putRequest, highLevelClient().indexLifecycle()::putLifecyclePolicy, highLevelClient().indexLifecycle()::putLifecyclePolicyAsync)); @@ -267,6 +279,7 @@ public void testGetMultipleLifecyclePolicies() throws IOException { public void testRetryLifecycleStep() throws IOException { String policyName = randomAlphaOfLength(10); LifecyclePolicy policy = createRandomPolicy(policyName); + ensurePrerequisites(policy); PutLifecyclePolicyRequest putRequest = new PutLifecyclePolicyRequest(policy); assertAcked(execute(putRequest, highLevelClient().indexLifecycle()::putLifecyclePolicy, highLevelClient().indexLifecycle()::putLifecyclePolicyAsync)); @@ -285,4 +298,57 @@ retryRequest, highLevelClient().indexLifecycle()::retryLifecyclePolicy, ex.getRootCause().getMessage() ); } + + public void ensurePrerequisites(LifecyclePolicy policy) throws IOException { + Set repositories = policy.getPhases().values().stream() + .map(phase -> (SearchableSnapshotAction) phase.getActions().get(SearchableSnapshotAction.NAME)) + .filter(Objects::nonNull) + .map(action -> action.getSnapshotRepository()) + .collect(Collectors.toSet()); + + if (repositories.isEmpty()) { + repositories = Set.of("repo"); + } + + // create any referenced snapshot repositories, or a 'repo' repository if no repositories are otherwise referenced + for (String repository : repositories) { + createSnapshotRepo(repository, randomBoolean()); + } + + Set slmPolicies = policy.getPhases().values().stream() + .map(phase -> (WaitForSnapshotAction) phase.getActions().get(WaitForSnapshotAction.NAME)) + .filter(Objects::nonNull) + .map(action -> action.getPolicy()) + .collect(Collectors.toSet()); + + // create any slm policies, using one of the snapshot repositories previously created + for (String slmPolicy : slmPolicies) { + createSlmPolicy(slmPolicy, randomFrom(repositories)); + } + } + + public static void createSnapshotRepo(String repoName, boolean compress) throws IOException { + PutRepositoryRequest request = new PutRepositoryRequest(repoName) + .type("fs") + .settings(Settings.builder() + .put("compress", compress) + .put("location", System.getProperty("tests.path.repo") + "/" + randomAlphaOfLengthBetween(4, 10)) + .put("max_snapshot_bytes_per_sec", "100m")); + assertTrue(highLevelClient().snapshot() + .createRepository(request, RequestOptions.DEFAULT) + .isAcknowledged()); + } + + private void createSlmPolicy(String slmPolicy, String repo) throws IOException { + PutSnapshotLifecyclePolicyRequest request = new PutSnapshotLifecyclePolicyRequest(new SnapshotLifecyclePolicy( + slmPolicy, + "snap" + randomAlphaOfLengthBetween(5, 10).toLowerCase(Locale.ROOT), + "59 59 23 31 12 ? 2099", + repo, + null, + null)); + assertTrue(highLevelClient().indexLifecycle(). + putSnapshotLifecyclePolicy(request, RequestOptions.DEFAULT) + .isAcknowledged()); + } } diff --git a/docs/reference/data-streams/set-up-a-data-stream.asciidoc b/docs/reference/data-streams/set-up-a-data-stream.asciidoc index fa064b73210d6..ade63e2ea43d9 100644 --- a/docs/reference/data-streams/set-up-a-data-stream.asciidoc +++ b/docs/reference/data-streams/set-up-a-data-stream.asciidoc @@ -29,6 +29,20 @@ To create an index lifecycle policy in {kib}, open the main menu and go to You can also use the <>. +//// +[source,console] +-------------------------------------------------- +PUT /_snapshot/found-snapshots +{ + "type": "fs", + "settings": { + "location": "my_backup_location" + } +} +-------------------------------------------------- +// TESTSETUP +//// + // tag::ilm-policy-api-ex[] [source,console] ---- diff --git a/docs/reference/ilm/actions/ilm-searchable-snapshot.asciidoc b/docs/reference/ilm/actions/ilm-searchable-snapshot.asciidoc index d4417f9e8a1d8..428d071c1e36a 100644 --- a/docs/reference/ilm/actions/ilm-searchable-snapshot.asciidoc +++ b/docs/reference/ilm/actions/ilm-searchable-snapshot.asciidoc @@ -61,6 +61,19 @@ are force merged. [[ilm-searchable-snapshot-ex]] ==== Examples +//// +[source,console] +-------------------------------------------------- +PUT /_snapshot/backing_repo +{ + "type": "fs", + "settings": { + "location": "my_backup_location" + } +} +-------------------------------------------------- +// TESTSETUP +//// [source,console] -------------------------------------------------- PUT _ilm/policy/my_policy diff --git a/docs/reference/ilm/actions/ilm-wait-for-snapshot.asciidoc b/docs/reference/ilm/actions/ilm-wait-for-snapshot.asciidoc index 5a953417a64c4..625351599d187 100644 --- a/docs/reference/ilm/actions/ilm-wait-for-snapshot.asciidoc +++ b/docs/reference/ilm/actions/ilm-wait-for-snapshot.asciidoc @@ -5,7 +5,7 @@ Phases allowed: delete. Waits for the specified {slm-init} policy to be executed before removing the index. -This ensures that a snapshot of the deleted index is available. +This ensures that a snapshot of the deleted index is available. [[ilm-wait-for-snapshot-options]] ==== Options @@ -16,7 +16,26 @@ Name of the {slm-init} policy that the delete action should wait for. [[ilm-wait-for-snapshot-ex]] ==== Example +//// +[source,console] +-------------------------------------------------- +PUT /_snapshot/backing_repo +{ + "type": "fs", + "settings": { + "location": "my_backup_location" + } +} +PUT /_slm/policy/slm-policy-name +{ + "schedule": "0 30 1 * * ?", + "name": "", + "repository": "backing_repo" +} +-------------------------------------------------- +// TESTSETUP +//// [source,console] -------------------------------------------------- PUT _ilm/policy/my_policy @@ -33,4 +52,4 @@ PUT _ilm/policy/my_policy } } } --------------------------------------------------- \ No newline at end of file +-------------------------------------------------- diff --git a/docs/reference/migration/migrate_8_0/ilm.asciidoc b/docs/reference/migration/migrate_8_0/ilm.asciidoc index 7c89db92965bd..fa5042c33a0fc 100644 --- a/docs/reference/migration/migrate_8_0/ilm.asciidoc +++ b/docs/reference/migration/migrate_8_0/ilm.asciidoc @@ -50,4 +50,18 @@ has been removed in 8.0. *Impact* + Update your ILM policies to remove the `freeze` action from the `cold` phase. ==== + +[[ilm-policy-validation]] +.Additional validation for ILM policies. +[%collapsible] +==== +*Details* + +Creating or updating an ILM policy now requires that any referenced snapshot repositories and SLM +policies exist. + +*Impact* + +Update your code or configuration management to ensure that repositories and SLM policies are created +before any policies that reference them. +==== + // end::notable-breaking-changes[] diff --git a/docs/reference/tab-widgets/ilm.asciidoc b/docs/reference/tab-widgets/ilm.asciidoc index 46a03be802a6d..60a92135d7733 100644 --- a/docs/reference/tab-widgets/ilm.asciidoc +++ b/docs/reference/tab-widgets/ilm.asciidoc @@ -13,6 +13,20 @@ Index Lifecycle Policies**. Click the policy you'd like to edit. You can also use the <>. +//// +[source,console] +-------------------------------------------------- +PUT /_snapshot/found-snapshots +{ + "type": "fs", + "settings": { + "location": "my_backup_location" + } +} +-------------------------------------------------- +// TESTSETUP +//// + [source,console] ---- PUT _ilm/policy/logs diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/WaitForSnapshotAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/WaitForSnapshotAction.java index 3f11a144f6fa0..1196c0ef7dc0f 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/WaitForSnapshotAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/WaitForSnapshotAction.java @@ -53,6 +53,10 @@ public WaitForSnapshotAction(StreamInput in) throws IOException { this(in.readString()); } + public String getPolicy() { + return policy; + } + @Override public List toSteps(Client client, String phase, StepKey nextStepKey) { StepKey waitForSnapshotKey = new StepKey(phase, NAME, WaitForSnapshotStep.NAME); diff --git a/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ilm/TimeSeriesLifecycleActionsIT.java b/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ilm/TimeSeriesLifecycleActionsIT.java index 3df014888e136..1688de951fe3c 100644 --- a/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ilm/TimeSeriesLifecycleActionsIT.java +++ b/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ilm/TimeSeriesLifecycleActionsIT.java @@ -190,8 +190,13 @@ public void testWaitForSnapshot() throws Exception { createIndexWithSettings(client(), index, alias, Settings.builder().put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1) .put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0)); String slmPolicy = randomAlphaOfLengthBetween(4, 10); + String snapshotRepo = randomAlphaOfLengthBetween(4, 10); + createSnapshotRepo(client(), snapshotRepo, randomBoolean()); + createSlmPolicy(slmPolicy, snapshotRepo); + final String phaseName = "delete"; createNewSingletonPolicy(client(), policy, phaseName, new WaitForSnapshotAction(slmPolicy)); + deleteSlmPolicy(slmPolicy); // delete the slm policy out from underneath ilm updatePolicy(client(), index, policy); waitForPhaseTime(phaseName); assertBusy(() -> { @@ -199,9 +204,7 @@ public void testWaitForSnapshot() throws Exception { assertThat(indexILMState.get("action"), is("wait_for_snapshot")); assertThat(indexILMState.get("failed_step"), is("wait-for-snapshot")); }, slmPolicy); - String snapshotRepo = randomAlphaOfLengthBetween(4, 10); - createSnapshotRepo(client(), snapshotRepo, randomBoolean()); - createSlmPolicy(slmPolicy, snapshotRepo); + createSlmPolicy(slmPolicy, snapshotRepo); // put the slm policy back assertBusy(() -> { Map indexILMState = explainIndex(client(), index); //wait for step to notice that the slm policy is created and to get out of error @@ -228,10 +231,11 @@ public void testWaitForSnapshotFast() throws Exception { createIndexWithSettings(client(), index, alias, Settings.builder().put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1) .put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0)); String slmPolicy = randomAlphaOfLengthBetween(4, 10); - final String phaseName = "delete"; String snapshotRepo = randomAlphaOfLengthBetween(4, 10); createSnapshotRepo(client(), snapshotRepo, randomBoolean()); createSlmPolicy(slmPolicy, snapshotRepo); + + final String phaseName = "delete"; createNewSingletonPolicy(client(), policy, phaseName, new WaitForSnapshotAction(slmPolicy)); updatePolicy(client(), index, policy); waitForPhaseTime(phaseName); @@ -249,13 +253,13 @@ public void testWaitForSnapshotSlmExecutedBefore() throws Exception { createIndexWithSettings(client(), index, alias, Settings.builder().put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1) .put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0)); String slmPolicy = randomAlphaOfLengthBetween(4, 10); - final String phaseName = "delete"; - createNewSingletonPolicy(client(), policy, phaseName, new WaitForSnapshotAction(slmPolicy)); - String snapshotRepo = randomAlphaOfLengthBetween(4, 10); createSnapshotRepo(client(), snapshotRepo, randomBoolean()); createSlmPolicy(slmPolicy, snapshotRepo); + final String phaseName = "delete"; + createNewSingletonPolicy(client(), policy, phaseName, new WaitForSnapshotAction(slmPolicy)); + Request request = new Request("PUT", "/_slm/policy/" + slmPolicy + "/_execute"); assertOK(client().performRequest(request)); @@ -435,7 +439,7 @@ public void testSetNullPriority() throws Exception { @SuppressWarnings("unchecked") public void testNonexistentPolicy() throws Exception { - String indexPrefix = randomAlphaOfLengthBetween(5,15).toLowerCase(Locale.ROOT); + String indexPrefix = randomAlphaOfLengthBetween(5, 15).toLowerCase(Locale.ROOT); final StringEntity template = new StringEntity("{\n" + " \"index_patterns\": \"" + indexPrefix + "*\",\n" + " \"settings\": {\n" + @@ -452,7 +456,7 @@ public void testNonexistentPolicy() throws Exception { templateRequest.setOptions(expectWarnings(RestPutIndexTemplateAction.DEPRECATION_WARNING)); client().performRequest(templateRequest); - policy = randomAlphaOfLengthBetween(5,20); + policy = randomAlphaOfLengthBetween(5, 20); createNewSingletonPolicy(client(), policy, "hot", new RolloverAction(null, null, null, 1L)); index = indexPrefix + "-000001"; @@ -476,7 +480,7 @@ public void testNonexistentPolicy() throws Exception { responseMap = XContentHelper.convertToMap(XContentType.JSON.xContent(), is, true); } logger.info(responseMap); - Map indexStatus = (Map)((Map) responseMap.get("indices")).get(index); + Map indexStatus = (Map) ((Map) responseMap.get("indices")).get(index); assertNull(indexStatus.get("phase")); assertNull(indexStatus.get("action")); assertNull(indexStatus.get("step")); @@ -490,11 +494,11 @@ public void testNonexistentPolicy() throws Exception { public void testInvalidPolicyNames() { ResponseException ex; - policy = randomAlphaOfLengthBetween(0,10) + "," + randomAlphaOfLengthBetween(0,10); + policy = randomAlphaOfLengthBetween(0, 10) + "," + randomAlphaOfLengthBetween(0, 10); ex = expectThrows(ResponseException.class, () -> createNewSingletonPolicy(client(), policy, "delete", new DeleteAction())); assertThat(ex.getMessage(), containsString("invalid policy name")); - policy = randomAlphaOfLengthBetween(0,10) + "%20" + randomAlphaOfLengthBetween(0,10); + policy = randomAlphaOfLengthBetween(0, 10) + "%20" + randomAlphaOfLengthBetween(0, 10); ex = expectThrows(ResponseException.class, () -> createNewSingletonPolicy(client(), policy, "delete", new DeleteAction())); assertThat(ex.getMessage(), containsString("invalid policy name")); @@ -585,7 +589,7 @@ public void testRemoveAndReaddPolicy() throws Exception { public void testCanStopILMWithPolicyUsingNonexistentPolicy() throws Exception { createIndexWithSettings(client(), index, alias, Settings.builder().put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1) .put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0) - .put(LifecycleSettings.LIFECYCLE_NAME_SETTING.getKey(), randomAlphaOfLengthBetween(5,15))); + .put(LifecycleSettings.LIFECYCLE_NAME_SETTING.getKey(), randomAlphaOfLengthBetween(5, 15))); Request stopILMRequest = new Request("POST", "_ilm/stop"); assertOK(client().performRequest(stopILMRequest)); @@ -618,7 +622,7 @@ public void testWaitForActiveShardsStep() throws Exception { updatePolicy(client(), originalIndex, policy); Request createIndexTemplate = new Request("PUT", "_template/rolling_indexes"); createIndexTemplate.setJsonEntity("{" + - "\"index_patterns\": [\""+ index + "-*\"], \n" + + "\"index_patterns\": [\"" + index + "-*\"], \n" + " \"settings\": {\n" + " \"number_of_shards\": 1,\n" + " \"number_of_replicas\": 142,\n" + @@ -644,11 +648,11 @@ public void testHistoryIsWrittenWithSuccess() throws Exception { createNewSingletonPolicy(client(), policy, "hot", new RolloverAction(null, null, null, 1L)); Request createIndexTemplate = new Request("PUT", "_template/rolling_indexes"); createIndexTemplate.setJsonEntity("{" + - "\"index_patterns\": [\""+ index + "-*\"], \n" + + "\"index_patterns\": [\"" + index + "-*\"], \n" + " \"settings\": {\n" + " \"number_of_shards\": 1,\n" + " \"number_of_replicas\": 0,\n" + - " \"index.lifecycle.name\": \"" + policy+ "\",\n" + + " \"index.lifecycle.name\": \"" + policy + "\",\n" + " \"index.lifecycle.rollover_alias\": \"" + alias + "\"\n" + " }\n" + "}"); @@ -748,11 +752,11 @@ public void testRefreshablePhaseJson() throws Exception { createNewSingletonPolicy(client(), policy, "hot", new RolloverAction(null, null, null, 100L)); Request createIndexTemplate = new Request("PUT", "_template/rolling_indexes"); createIndexTemplate.setJsonEntity("{" + - "\"index_patterns\": [\""+ index + "-*\"], \n" + + "\"index_patterns\": [\"" + index + "-*\"], \n" + " \"settings\": {\n" + " \"number_of_shards\": 1,\n" + " \"number_of_replicas\": 0,\n" + - " \"index.lifecycle.name\": \"" + policy+ "\",\n" + + " \"index.lifecycle.name\": \"" + policy + "\",\n" + " \"index.lifecycle.rollover_alias\": \"" + alias + "\"\n" + " }\n" + "}"); @@ -883,8 +887,8 @@ public void testDeleteActionDoesntDeleteSearchableSnapshot() throws Exception { for (Object snapshot : snapshots) { Map snapshotInfoMap = (Map) snapshot; if (snapshotInfoMap.get("snapshot").equals(snapshotName[0]) && - // wait for the snapshot to be completed (successfully or not) otherwise the teardown might fail - SnapshotState.valueOf((String) snapshotInfoMap.get("state")).completed()) { + // wait for the snapshot to be completed (successfully or not) otherwise the teardown might fail + SnapshotState.valueOf((String) snapshotInfoMap.get("state")).completed()) { return true; } } @@ -896,6 +900,26 @@ public void testDeleteActionDoesntDeleteSearchableSnapshot() throws Exception { }, 30, TimeUnit.SECONDS)); } + public void testSearchableSnapshotRequiresSnapshotRepoToExist() throws IOException { + String repo = randomAlphaOfLengthBetween(4, 10); + final String phaseName = "cold"; + ResponseException ex = expectThrows(ResponseException.class, () -> + createNewSingletonPolicy(client(), policy, phaseName, new SearchableSnapshotAction(repo))); + assertThat(ex.getMessage(), containsString("no such repository")); + assertThat(ex.getMessage(), containsString("the snapshot repository referenced by the [searchable_snapshot] action " + + "in the [cold] phase must exist before it can be referenced by an ILM policy")); + } + + public void testWaitForSnapshotRequiresSLMPolicyToExist() throws IOException { + String slmPolicy = randomAlphaOfLengthBetween(4, 10); + final String phaseName = "delete"; + ResponseException ex = expectThrows(ResponseException.class, () -> + createNewSingletonPolicy(client(), policy, phaseName, new WaitForSnapshotAction(slmPolicy))); + assertThat(ex.getMessage(), containsString("no such snapshot lifecycle policy")); + assertThat(ex.getMessage(), containsString("the snapshot lifecycle policy referenced by the [wait_for_snapshot] action " + + "in the [delete] phase must exist before it can be referenced by an ILM policy")); + } + // This method should be called inside an assertBusy, it has no retry logic of its own private void assertHistoryIsPresent(String policyName, String indexName, boolean success, String stepName) throws IOException { assertHistoryIsPresent(policyName, indexName, success, null, null, stepName); @@ -946,7 +970,7 @@ private void assertHistoryIsPresent(String policyName, String indexName, boolean historyResponseMap = XContentHelper.convertToMap(XContentType.JSON.xContent(), is, true); } logger.info("--> history response: {}", historyResponseMap); - int hits = (int)((Map) ((Map) historyResponseMap.get("hits")).get("total")).get("value"); + int hits = (int) ((Map) ((Map) historyResponseMap.get("hits")).get("total")).get("value"); // For a failure, print out whatever history we *do* have for the index if (hits == 0) { @@ -1007,6 +1031,10 @@ private void createSlmPolicy(String smlPolicy, String repo) throws IOException { assertOK(client().performRequest(request)); } + private void deleteSlmPolicy(String smlPolicy) throws IOException { + assertOK(client().performRequest(new Request("DELETE", "/_slm/policy/" + smlPolicy))); + } + //adds debug information for waitForSnapshot tests private void assertBusy(CheckedRunnable runnable, String slmPolicy) throws Exception { assertBusy(() -> { diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/TransportPutLifecycleAction.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/TransportPutLifecycleAction.java index 81a3aff155bfe..1daf13aa9a26b 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/TransportPutLifecycleAction.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/TransportPutLifecycleAction.java @@ -21,6 +21,7 @@ import org.elasticsearch.cluster.block.ClusterBlockLevel; import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; import org.elasticsearch.cluster.metadata.Metadata; +import org.elasticsearch.cluster.metadata.RepositoriesMetadata; import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.xcontent.NamedXContentRegistry; @@ -34,8 +35,10 @@ import org.elasticsearch.xpack.core.ilm.LifecyclePolicyMetadata; import org.elasticsearch.xpack.core.ilm.Phase; import org.elasticsearch.xpack.core.ilm.SearchableSnapshotAction; +import org.elasticsearch.xpack.core.ilm.WaitForSnapshotAction; import org.elasticsearch.xpack.core.ilm.action.PutLifecycleAction; import org.elasticsearch.xpack.core.ilm.action.PutLifecycleAction.Request; +import org.elasticsearch.xpack.core.slm.SnapshotLifecycleMetadata; import java.time.Instant; import java.util.List; @@ -76,56 +79,96 @@ protected void masterOperation(Task task, Request request, ClusterState state, A // cluster state thread in the ClusterStateUpdateTask below since that thread does not share the // same context, and therefore does not have access to the appropriate security headers. Map filteredHeaders = ClientHelper.filterSecurityHeaders(threadPool.getThreadContext().getHeaders()); + LifecyclePolicy.validatePolicyName(request.getPolicy().getName()); - List phasesDefiningSearchableSnapshot = request.getPolicy().getPhases().values().stream() - .filter(phase -> phase.getActions().containsKey(SearchableSnapshotAction.NAME)) - .collect(Collectors.toList()); - if (phasesDefiningSearchableSnapshot.isEmpty() == false) { - if (SEARCHABLE_SNAPSHOT_FEATURE.checkWithoutTracking(licenseState) == false) { - throw new IllegalArgumentException("policy [" + request.getPolicy().getName() + "] defines the [" + - SearchableSnapshotAction.NAME + "] action but the current license is non-compliant for [searchable-snapshots]"); - } - } + clusterService.submitStateUpdateTask("put-lifecycle-" + request.getPolicy().getName(), - new AckedClusterStateUpdateTask(request, listener) { - @Override - public ClusterState execute(ClusterState currentState) throws Exception { - ClusterState.Builder stateBuilder = ClusterState.builder(currentState); - IndexLifecycleMetadata currentMetadata = currentState.metadata().custom(IndexLifecycleMetadata.TYPE); - if (currentMetadata == null) { // first time using index-lifecycle feature, bootstrap metadata - currentMetadata = IndexLifecycleMetadata.EMPTY; - } - LifecyclePolicyMetadata existingPolicyMetadata = currentMetadata.getPolicyMetadatas() - .get(request.getPolicy().getName()); - long nextVersion = (existingPolicyMetadata == null) ? 1L : existingPolicyMetadata.getVersion() + 1L; - SortedMap newPolicies = new TreeMap<>(currentMetadata.getPolicyMetadatas()); - LifecyclePolicyMetadata lifecyclePolicyMetadata = new LifecyclePolicyMetadata(request.getPolicy(), filteredHeaders, - nextVersion, Instant.now().toEpochMilli()); - LifecyclePolicyMetadata oldPolicy = newPolicies.put(lifecyclePolicyMetadata.getName(), lifecyclePolicyMetadata); - if (oldPolicy == null) { - logger.info("adding index lifecycle policy [{}]", request.getPolicy().getName()); - } else { - logger.info("updating index lifecycle policy [{}]", request.getPolicy().getName()); - } - IndexLifecycleMetadata newMetadata = new IndexLifecycleMetadata(newPolicies, currentMetadata.getOperationMode()); - stateBuilder.metadata(Metadata.builder(currentState.getMetadata()) - .putCustom(IndexLifecycleMetadata.TYPE, newMetadata).build()); - ClusterState nonRefreshedState = stateBuilder.build(); - if (oldPolicy == null) { + new AckedClusterStateUpdateTask(request, listener) { + @Override + public ClusterState execute(ClusterState currentState) throws Exception { + validatePrerequisites(request.getPolicy(), currentState); + + ClusterState.Builder stateBuilder = ClusterState.builder(currentState); + IndexLifecycleMetadata currentMetadata = currentState.metadata().custom(IndexLifecycleMetadata.TYPE); + if (currentMetadata == null) { // first time using index-lifecycle feature, bootstrap metadata + currentMetadata = IndexLifecycleMetadata.EMPTY; + } + LifecyclePolicyMetadata existingPolicyMetadata = currentMetadata.getPolicyMetadatas() + .get(request.getPolicy().getName()); + long nextVersion = (existingPolicyMetadata == null) ? 1L : existingPolicyMetadata.getVersion() + 1L; + SortedMap newPolicies = new TreeMap<>(currentMetadata.getPolicyMetadatas()); + LifecyclePolicyMetadata lifecyclePolicyMetadata = new LifecyclePolicyMetadata(request.getPolicy(), filteredHeaders, + nextVersion, Instant.now().toEpochMilli()); + LifecyclePolicyMetadata oldPolicy = newPolicies.put(lifecyclePolicyMetadata.getName(), lifecyclePolicyMetadata); + if (oldPolicy == null) { + logger.info("adding index lifecycle policy [{}]", request.getPolicy().getName()); + } else { + logger.info("updating index lifecycle policy [{}]", request.getPolicy().getName()); + } + IndexLifecycleMetadata newMetadata = new IndexLifecycleMetadata(newPolicies, currentMetadata.getOperationMode()); + stateBuilder.metadata(Metadata.builder(currentState.getMetadata()) + .putCustom(IndexLifecycleMetadata.TYPE, newMetadata).build()); + ClusterState nonRefreshedState = stateBuilder.build(); + if (oldPolicy == null) { + return nonRefreshedState; + } else { + try { + return updateIndicesForPolicy(nonRefreshedState, xContentRegistry, client, + oldPolicy.getPolicy(), lifecyclePolicyMetadata, licenseState); + } catch (Exception e) { + logger.warn(new ParameterizedMessage("unable to refresh indices phase JSON for updated policy [{}]", + oldPolicy.getName()), e); + // Revert to the non-refreshed state return nonRefreshedState; - } else { - try { - return updateIndicesForPolicy(nonRefreshedState, xContentRegistry, client, - oldPolicy.getPolicy(), lifecyclePolicyMetadata, licenseState); - } catch (Exception e) { - logger.warn(new ParameterizedMessage("unable to refresh indices phase JSON for updated policy [{}]", - oldPolicy.getName()), e); - // Revert to the non-refreshed state - return nonRefreshedState; - } } } - }); + } + }); + } + + /** + * Validate that the license level is compliant for searchable-snapshots, that any referenced snapshot + * repositories exist, and that any referenced SLM policies exist. + * + * @param policy The lifecycle policy + * @param state The cluster state + */ + private void validatePrerequisites(LifecyclePolicy policy, ClusterState state) { + List phasesWithSearchableSnapshotActions = policy.getPhases().values().stream() + .filter(phase -> phase.getActions().containsKey(SearchableSnapshotAction.NAME)) + .collect(Collectors.toList()); + // check license level for searchable snapshots + if (phasesWithSearchableSnapshotActions.isEmpty() == false && + SEARCHABLE_SNAPSHOT_FEATURE.checkWithoutTracking(licenseState) == false) { + throw new IllegalArgumentException("policy [" + policy.getName() + "] defines the [" + + SearchableSnapshotAction.NAME + "] action but the current license is non-compliant for [searchable-snapshots]"); + } + // make sure any referenced snapshot repositories exist + for (Phase phase : phasesWithSearchableSnapshotActions) { + SearchableSnapshotAction action = (SearchableSnapshotAction) phase.getActions().get(SearchableSnapshotAction.NAME); + String repository = action.getSnapshotRepository(); + if (state.metadata().custom(RepositoriesMetadata.TYPE, RepositoriesMetadata.EMPTY) + .repository(repository) == null) { + throw new IllegalArgumentException("no such repository [" + repository + "], the snapshot repository " + + "referenced by the [" + SearchableSnapshotAction.NAME + "] action in the [" + phase.getName() + "] phase " + + "must exist before it can be referenced by an ILM policy"); + } + } + + List phasesWithWaitForSnapshotActions = policy.getPhases().values().stream() + .filter(phase -> phase.getActions().containsKey(WaitForSnapshotAction.NAME)) + .collect(Collectors.toList()); + // make sure any referenced snapshot lifecycle policies exist + for (Phase phase : phasesWithWaitForSnapshotActions) { + WaitForSnapshotAction action = (WaitForSnapshotAction) phase.getActions().get(WaitForSnapshotAction.NAME); + String slmPolicy = action.getPolicy(); + if (state.metadata().custom(SnapshotLifecycleMetadata.TYPE, SnapshotLifecycleMetadata.EMPTY) + .getSnapshotConfigurations().get(slmPolicy) == null) { + throw new IllegalArgumentException("no such snapshot lifecycle policy [" + slmPolicy + "], the snapshot lifecycle policy " + + "referenced by the [" + WaitForSnapshotAction.NAME + "] action in the [" + phase.getName() + "] phase " + + "must exist before it can be referenced by an ILM policy"); + } + } } @Override diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/slm/action/TransportExecuteSnapshotLifecycleAction.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/slm/action/TransportExecuteSnapshotLifecycleAction.java index 2a6d2a87b2bbd..3acb4ddf60650 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/slm/action/TransportExecuteSnapshotLifecycleAction.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/slm/action/TransportExecuteSnapshotLifecycleAction.java @@ -53,12 +53,7 @@ protected void masterOperation(final Task task, final ExecuteSnapshotLifecycleAc final ActionListener listener) { try { final String policyId = request.getLifecycleId(); - SnapshotLifecycleMetadata snapMeta = state.metadata().custom(SnapshotLifecycleMetadata.TYPE); - if (snapMeta == null) { - listener.onFailure(new IllegalArgumentException("no such snapshot lifecycle policy [" + policyId + "]")); - return; - } - + SnapshotLifecycleMetadata snapMeta = state.metadata().custom(SnapshotLifecycleMetadata.TYPE, SnapshotLifecycleMetadata.EMPTY); SnapshotLifecyclePolicyMetadata policyMetadata = snapMeta.getSnapshotConfigurations().get(policyId); if (policyMetadata == null) { listener.onFailure(new IllegalArgumentException("no such snapshot lifecycle policy [" + policyId + "]")); From cfcc1873694719cd1996298efdc092d8a46ede79 Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Mon, 4 Oct 2021 12:38:52 -0700 Subject: [PATCH 139/250] Revert "Remove multiple paths from elasticsearch-node tool (#72351)" (#78636) This reverts commit 619a011782cce1fadbfabf45b0f0dce75c8a155f. relates #78525 relates #71205 --- .../RemoveCorruptedShardDataCommandIT.java | 2 +- .../coordination/DetachClusterCommand.java | 4 +- .../ElasticsearchNodeCommand.java | 19 ++++++---- .../coordination/RemoveCustomsCommand.java | 4 +- .../coordination/RemoveSettingsCommand.java | 4 +- .../UnsafeBootstrapMasterCommand.java | 4 +- .../env/NodeRepurposeCommand.java | 29 +++++++------- .../env/OverrideNodeVersionCommand.java | 9 +++-- .../RemoveCorruptedShardDataCommand.java | 29 +++++++------- .../env/OverrideNodeVersionCommandTests.java | 38 +++++++++---------- .../RemoveCorruptedShardDataCommandTests.java | 17 +++++---- 11 files changed, 85 insertions(+), 74 deletions(-) diff --git a/server/src/internalClusterTest/java/org/elasticsearch/index/shard/RemoveCorruptedShardDataCommandIT.java b/server/src/internalClusterTest/java/org/elasticsearch/index/shard/RemoveCorruptedShardDataCommandIT.java index c58cf04155e0f..47b08712a7118 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/index/shard/RemoveCorruptedShardDataCommandIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/index/shard/RemoveCorruptedShardDataCommandIT.java @@ -568,7 +568,7 @@ public void testResolvePath() throws Exception { final Path indexPath = indexPathByNodeName.get(nodeName); final OptionSet options = parser.parse("--dir", indexPath.toAbsolutePath().toString()); command.findAndProcessShardPath(options, environmentByNodeName.get(nodeName), - environmentByNodeName.get(nodeName).dataFile(), + new Path[] { environmentByNodeName.get(nodeName).dataFile() }, state, shardPath -> assertThat(shardPath.resolveIndex(), equalTo(indexPath))); } } diff --git a/server/src/main/java/org/elasticsearch/cluster/coordination/DetachClusterCommand.java b/server/src/main/java/org/elasticsearch/cluster/coordination/DetachClusterCommand.java index c03773703169e..035d41b8d1042 100644 --- a/server/src/main/java/org/elasticsearch/cluster/coordination/DetachClusterCommand.java +++ b/server/src/main/java/org/elasticsearch/cluster/coordination/DetachClusterCommand.java @@ -38,8 +38,8 @@ public DetachClusterCommand() { @Override - protected void processNodePaths(Terminal terminal, Path dataPath, OptionSet options, Environment env) throws IOException { - final PersistedClusterStateService persistedClusterStateService = createPersistedClusterStateService(env.settings(), dataPath); + protected void processNodePaths(Terminal terminal, Path[] dataPaths, OptionSet options, Environment env) throws IOException { + final PersistedClusterStateService persistedClusterStateService = createPersistedClusterStateService(env.settings(), dataPaths); terminal.println(Terminal.Verbosity.VERBOSE, "Loading cluster state"); final ClusterState oldClusterState = loadTermAndClusterState(persistedClusterStateService, env).v2(); diff --git a/server/src/main/java/org/elasticsearch/cluster/coordination/ElasticsearchNodeCommand.java b/server/src/main/java/org/elasticsearch/cluster/coordination/ElasticsearchNodeCommand.java index 9c18fa447cebc..90bca9bc230b6 100644 --- a/server/src/main/java/org/elasticsearch/cluster/coordination/ElasticsearchNodeCommand.java +++ b/server/src/main/java/org/elasticsearch/cluster/coordination/ElasticsearchNodeCommand.java @@ -40,6 +40,7 @@ import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; +import java.util.Arrays; import java.util.EnumSet; import java.util.Map; @@ -99,14 +100,14 @@ public ElasticsearchNodeCommand(String description) { super(description); } - public static PersistedClusterStateService createPersistedClusterStateService(Settings settings, Path dataPath) throws IOException { - final NodeMetadata nodeMetadata = PersistedClusterStateService.nodeMetadata(dataPath); + public static PersistedClusterStateService createPersistedClusterStateService(Settings settings, Path... dataPaths) throws IOException { + final NodeMetadata nodeMetadata = PersistedClusterStateService.nodeMetadata(dataPaths); if (nodeMetadata == null) { throw new ElasticsearchException(NO_NODE_METADATA_FOUND_MSG); } String nodeId = nodeMetadata.nodeId(); - return new PersistedClusterStateService(new Path[] { dataPath }, nodeId, namedXContentRegistry, BigArrays.NON_RECYCLING_INSTANCE, + return new PersistedClusterStateService(dataPaths, nodeId, namedXContentRegistry, BigArrays.NON_RECYCLING_INSTANCE, new ClusterSettings(settings, ClusterSettings.BUILT_IN_CLUSTER_SETTINGS), () -> 0L); } @@ -133,7 +134,7 @@ protected void processNodePaths(Terminal terminal, OptionSet options, Environmen if (dataPath == null) { throw new ElasticsearchException(NO_NODE_FOLDER_FOUND_MSG); } - processNodePaths(terminal, dataPath.path, options, env); + processNodePaths(terminal, new Path[] { dataPath.path }, options, env); } catch (LockObtainFailedException e) { throw new ElasticsearchException(FAILED_TO_OBTAIN_NODE_LOCK_MSG, e); } @@ -169,14 +170,18 @@ protected boolean validateBeforeLock(Terminal terminal, Environment env) { /** * Process the paths. Locks for the paths is held during this method invocation. * @param terminal the terminal to use for messages - * @param dataPath the path of the node to process + * @param dataPaths the paths of the node to process * @param options the command line options * @param env the env of the node to process */ - protected abstract void processNodePaths(Terminal terminal, Path dataPath, OptionSet options, Environment env) + protected abstract void processNodePaths(Terminal terminal, Path[] dataPaths, OptionSet options, Environment env) throws IOException, UserException; - protected static NodeEnvironment.NodePath createNodePath(Path path) { + protected NodeEnvironment.NodePath[] toNodePaths(Path[] dataPaths) { + return Arrays.stream(dataPaths).map(ElasticsearchNodeCommand::createNodePath).toArray(NodeEnvironment.NodePath[]::new); + } + + private static NodeEnvironment.NodePath createNodePath(Path path) { try { return new NodeEnvironment.NodePath(path); } catch (IOException e) { diff --git a/server/src/main/java/org/elasticsearch/cluster/coordination/RemoveCustomsCommand.java b/server/src/main/java/org/elasticsearch/cluster/coordination/RemoveCustomsCommand.java index bd82b0e85aaa0..814838143d0cf 100644 --- a/server/src/main/java/org/elasticsearch/cluster/coordination/RemoveCustomsCommand.java +++ b/server/src/main/java/org/elasticsearch/cluster/coordination/RemoveCustomsCommand.java @@ -44,14 +44,14 @@ public RemoveCustomsCommand() { } @Override - protected void processNodePaths(Terminal terminal, Path dataPath, OptionSet options, Environment env) + protected void processNodePaths(Terminal terminal, Path[] dataPaths, OptionSet options, Environment env) throws IOException, UserException { final List customsToRemove = arguments.values(options); if (customsToRemove.isEmpty()) { throw new UserException(ExitCodes.USAGE, "Must supply at least one custom metadata name to remove"); } - final PersistedClusterStateService persistedClusterStateService = createPersistedClusterStateService(env.settings(), dataPath); + final PersistedClusterStateService persistedClusterStateService = createPersistedClusterStateService(env.settings(), dataPaths); terminal.println(Terminal.Verbosity.VERBOSE, "Loading cluster state"); final Tuple termAndClusterState = loadTermAndClusterState(persistedClusterStateService, env); diff --git a/server/src/main/java/org/elasticsearch/cluster/coordination/RemoveSettingsCommand.java b/server/src/main/java/org/elasticsearch/cluster/coordination/RemoveSettingsCommand.java index b32769814aee0..297b75d2adc19 100644 --- a/server/src/main/java/org/elasticsearch/cluster/coordination/RemoveSettingsCommand.java +++ b/server/src/main/java/org/elasticsearch/cluster/coordination/RemoveSettingsCommand.java @@ -44,14 +44,14 @@ public RemoveSettingsCommand() { } @Override - protected void processNodePaths(Terminal terminal, Path dataPath, OptionSet options, Environment env) + protected void processNodePaths(Terminal terminal, Path[] dataPaths, OptionSet options, Environment env) throws IOException, UserException { final List settingsToRemove = arguments.values(options); if (settingsToRemove.isEmpty()) { throw new UserException(ExitCodes.USAGE, "Must supply at least one setting to remove"); } - final PersistedClusterStateService persistedClusterStateService = createPersistedClusterStateService(env.settings(), dataPath); + final PersistedClusterStateService persistedClusterStateService = createPersistedClusterStateService(env.settings(), dataPaths); terminal.println(Terminal.Verbosity.VERBOSE, "Loading cluster state"); final Tuple termAndClusterState = loadTermAndClusterState(persistedClusterStateService, env); diff --git a/server/src/main/java/org/elasticsearch/cluster/coordination/UnsafeBootstrapMasterCommand.java b/server/src/main/java/org/elasticsearch/cluster/coordination/UnsafeBootstrapMasterCommand.java index eb1b1c5f04118..c1a50aa75ff7b 100644 --- a/server/src/main/java/org/elasticsearch/cluster/coordination/UnsafeBootstrapMasterCommand.java +++ b/server/src/main/java/org/elasticsearch/cluster/coordination/UnsafeBootstrapMasterCommand.java @@ -69,8 +69,8 @@ protected boolean validateBeforeLock(Terminal terminal, Environment env) { return true; } - protected void processNodePaths(Terminal terminal, Path dataPath, OptionSet options, Environment env) throws IOException { - final PersistedClusterStateService persistedClusterStateService = createPersistedClusterStateService(env.settings(), dataPath); + protected void processNodePaths(Terminal terminal, Path[] dataPaths, OptionSet options, Environment env) throws IOException { + final PersistedClusterStateService persistedClusterStateService = createPersistedClusterStateService(env.settings(), dataPaths); final Tuple state = loadTermAndClusterState(persistedClusterStateService, env); final ClusterState oldClusterState = state.v2(); diff --git a/server/src/main/java/org/elasticsearch/env/NodeRepurposeCommand.java b/server/src/main/java/org/elasticsearch/env/NodeRepurposeCommand.java index f331f287715c6..9b92638a440f8 100644 --- a/server/src/main/java/org/elasticsearch/env/NodeRepurposeCommand.java +++ b/server/src/main/java/org/elasticsearch/env/NodeRepurposeCommand.java @@ -30,6 +30,7 @@ import java.util.List; import java.util.Set; import java.util.stream.Collectors; +import java.util.stream.Stream; import java.util.stream.StreamSupport; import static org.elasticsearch.env.NodeEnvironment.INDICES_FOLDER; @@ -62,28 +63,28 @@ protected boolean validateBeforeLock(Terminal terminal, Environment env) { } @Override - protected void processNodePaths(Terminal terminal, Path dataPath, OptionSet options, Environment env) throws IOException { + protected void processNodePaths(Terminal terminal, Path[] dataPaths, OptionSet options, Environment env) throws IOException { assert DiscoveryNode.canContainData(env.settings()) == false; if (DiscoveryNode.isMasterNode(env.settings()) == false) { - processNoMasterNoDataNode(terminal, dataPath, env); + processNoMasterNoDataNode(terminal, dataPaths, env); } else { - processMasterNoDataNode(terminal, dataPath, env); + processMasterNoDataNode(terminal, dataPaths, env); } } - private void processNoMasterNoDataNode(Terminal terminal, Path dataPath, Environment env) throws IOException { - NodeEnvironment.NodePath nodePath = createNodePath(dataPath); + private void processNoMasterNoDataNode(Terminal terminal, Path[] dataPaths, Environment env) throws IOException { + NodeEnvironment.NodePath[] nodePaths = toNodePaths(dataPaths); terminal.println(Terminal.Verbosity.VERBOSE, "Collecting shard data paths"); - List shardDataPaths = NodeEnvironment.collectShardDataPaths(nodePath); + List shardDataPaths = NodeEnvironment.collectShardDataPaths(nodePaths[0]); terminal.println(Terminal.Verbosity.VERBOSE, "Collecting index metadata paths"); - List indexMetadataPaths = NodeEnvironment.collectIndexMetadataPaths(nodePath); + List indexMetadataPaths = NodeEnvironment.collectIndexMetadataPaths(nodePaths[0]); Set indexPaths = uniqueParentPaths(shardDataPaths, indexMetadataPaths); - final PersistedClusterStateService persistedClusterStateService = createPersistedClusterStateService(env.settings(), dataPath); + final PersistedClusterStateService persistedClusterStateService = createPersistedClusterStateService(env.settings(), dataPaths); final Metadata metadata = loadClusterState(terminal, env, persistedClusterStateService).metadata(); if (indexPaths.isEmpty() && metadata.indices().isEmpty()) { @@ -105,23 +106,23 @@ private void processNoMasterNoDataNode(Terminal terminal, Path dataPath, Environ removePaths(terminal, indexPaths); // clean-up shard dirs // clean-up all metadata dirs - MetadataStateFormat.deleteMetaState(dataPath); - IOUtils.rm(dataPath.resolve(INDICES_FOLDER)); + MetadataStateFormat.deleteMetaState(dataPaths); + IOUtils.rm(Stream.of(dataPaths).map(path -> path.resolve(INDICES_FOLDER)).toArray(Path[]::new)); terminal.println("Node successfully repurposed to no-master and no-data."); } - private void processMasterNoDataNode(Terminal terminal, Path dataPath, Environment env) throws IOException { - NodeEnvironment.NodePath nodePath = createNodePath(dataPath); + private void processMasterNoDataNode(Terminal terminal, Path[] dataPaths, Environment env) throws IOException { + NodeEnvironment.NodePath[] nodePaths = toNodePaths(dataPaths); terminal.println(Terminal.Verbosity.VERBOSE, "Collecting shard data paths"); - List shardDataPaths = NodeEnvironment.collectShardDataPaths(nodePath); + List shardDataPaths = NodeEnvironment.collectShardDataPaths(nodePaths[0]); if (shardDataPaths.isEmpty()) { terminal.println(NO_SHARD_DATA_TO_CLEAN_UP_FOUND); return; } - final PersistedClusterStateService persistedClusterStateService = createPersistedClusterStateService(env.settings(), dataPath); + final PersistedClusterStateService persistedClusterStateService = createPersistedClusterStateService(env.settings(), dataPaths); final Metadata metadata = loadClusterState(terminal, env, persistedClusterStateService).metadata(); diff --git a/server/src/main/java/org/elasticsearch/env/OverrideNodeVersionCommand.java b/server/src/main/java/org/elasticsearch/env/OverrideNodeVersionCommand.java index 886a2b6add8b7..ce108367d4c9d 100644 --- a/server/src/main/java/org/elasticsearch/env/OverrideNodeVersionCommand.java +++ b/server/src/main/java/org/elasticsearch/env/OverrideNodeVersionCommand.java @@ -17,6 +17,7 @@ import java.io.IOException; import java.nio.file.Path; +import java.util.Arrays; public class OverrideNodeVersionCommand extends ElasticsearchNodeCommand { private static final String TOO_NEW_MESSAGE = @@ -57,9 +58,9 @@ public OverrideNodeVersionCommand() { } @Override - protected void processNodePaths(Terminal terminal, Path dataPath, OptionSet options, Environment env) throws IOException { - final Path nodePath = createNodePath(dataPath).path; - final NodeMetadata nodeMetadata = PersistedClusterStateService.nodeMetadata(nodePath); + protected void processNodePaths(Terminal terminal, Path[] dataPaths, OptionSet options, Environment env) throws IOException { + final Path[] nodePaths = Arrays.stream(toNodePaths(dataPaths)).map(p -> p.path).toArray(Path[]::new); + final NodeMetadata nodeMetadata = PersistedClusterStateService.nodeMetadata(nodePaths); if (nodeMetadata == null) { throw new ElasticsearchException(NO_METADATA_MESSAGE); } @@ -77,7 +78,7 @@ protected void processNodePaths(Terminal terminal, Path dataPath, OptionSet opti .replace("V_NEW", nodeMetadata.nodeVersion().toString()) .replace("V_CUR", Version.CURRENT.toString())); - PersistedClusterStateService.overrideVersion(Version.CURRENT, dataPath); + PersistedClusterStateService.overrideVersion(Version.CURRENT, dataPaths); terminal.println(SUCCESS_MESSAGE); } diff --git a/server/src/main/java/org/elasticsearch/index/shard/RemoveCorruptedShardDataCommand.java b/server/src/main/java/org/elasticsearch/index/shard/RemoveCorruptedShardDataCommand.java index 929e301fd9d5f..b3e537cb34e08 100644 --- a/server/src/main/java/org/elasticsearch/index/shard/RemoveCorruptedShardDataCommand.java +++ b/server/src/main/java/org/elasticsearch/index/shard/RemoveCorruptedShardDataCommand.java @@ -108,7 +108,7 @@ protected Path getPath(String dirValue) { return PathUtils.get(dirValue, "", ""); } - protected void findAndProcessShardPath(OptionSet options, Environment environment, Path dataPath, ClusterState clusterState, + protected void findAndProcessShardPath(OptionSet options, Environment environment, Path[] dataPaths, ClusterState clusterState, CheckedConsumer consumer) throws IOException { final Settings settings = environment.settings(); @@ -154,15 +154,18 @@ protected void findAndProcessShardPath(OptionSet options, Environment environmen final Index index = indexMetadata.getIndex(); final ShardId shId = new ShardId(index, shardId); - final Path shardPathLocation = dataPath - .resolve(NodeEnvironment.INDICES_FOLDER) - .resolve(index.getUUID()) - .resolve(Integer.toString(shId.id())); - if (Files.exists(shardPathLocation)) { - final ShardPath shardPath = ShardPath.loadShardPath(logger, shId, indexSettings.customDataPath(), - new Path[]{shardPathLocation}, dataPath); - if (shardPath != null) { - consumer.accept(shardPath); + for (Path dataPath : dataPaths) { + final Path shardPathLocation = dataPath + .resolve(NodeEnvironment.INDICES_FOLDER) + .resolve(index.getUUID()) + .resolve(Integer.toString(shId.id())); + if (Files.exists(shardPathLocation)) { + final ShardPath shardPath = ShardPath.loadShardPath(logger, shId, indexSettings.customDataPath(), + new Path[]{shardPathLocation}, dataPath); + if (shardPath != null) { + consumer.accept(shardPath); + return; + } } } } @@ -225,13 +228,13 @@ private void warnAboutIndexBackup(Terminal terminal) { // Visible for testing @Override - public void processNodePaths(Terminal terminal, Path dataPath, OptionSet options, Environment environment) throws IOException { + public void processNodePaths(Terminal terminal, Path[] dataPaths, OptionSet options, Environment environment) throws IOException { warnAboutIndexBackup(terminal); final ClusterState clusterState = - loadTermAndClusterState(createPersistedClusterStateService(environment.settings(), dataPath), environment).v2(); + loadTermAndClusterState(createPersistedClusterStateService(environment.settings(), dataPaths), environment).v2(); - findAndProcessShardPath(options, environment, dataPath, clusterState, shardPath -> { + findAndProcessShardPath(options, environment, dataPaths, clusterState, shardPath -> { final Path indexPath = shardPath.resolveIndex(); final Path translogPath = shardPath.resolveTranslog(); if (Files.exists(translogPath) == false || Files.isDirectory(translogPath) == false) { diff --git a/server/src/test/java/org/elasticsearch/env/OverrideNodeVersionCommandTests.java b/server/src/test/java/org/elasticsearch/env/OverrideNodeVersionCommandTests.java index 9d9ee6debaf39..7bc3e81ae522c 100644 --- a/server/src/test/java/org/elasticsearch/env/OverrideNodeVersionCommandTests.java +++ b/server/src/test/java/org/elasticsearch/env/OverrideNodeVersionCommandTests.java @@ -33,7 +33,7 @@ public class OverrideNodeVersionCommandTests extends ESTestCase { private Environment environment; - private Path nodePath; + private Path[] nodePaths; private String nodeId; private final OptionSet noOptions = new OptionParser().parse(); @@ -42,10 +42,10 @@ public void createNodePaths() throws IOException { final Settings settings = buildEnvSettings(Settings.EMPTY); environment = TestEnvironment.newEnvironment(settings); try (NodeEnvironment nodeEnvironment = new NodeEnvironment(settings, environment)) { - nodePath = nodeEnvironment.nodeDataPath(); + nodePaths = new Path[] { nodeEnvironment.nodeDataPath() }; nodeId = nodeEnvironment.nodeId(); - try (PersistedClusterStateService.Writer writer = new PersistedClusterStateService(new Path[] { nodePath }, nodeId, + try (PersistedClusterStateService.Writer writer = new PersistedClusterStateService(nodePaths, nodeId, xContentRegistry(), BigArrays.NON_RECYCLING_INSTANCE, new ClusterSettings(settings, ClusterSettings.BUILT_IN_CLUSTER_SETTINGS), () -> 0L).createWriter()) { writer.writeFullStateAndCommit(1L, ClusterState.builder(ClusterName.DEFAULT).metadata(Metadata.builder() @@ -57,7 +57,7 @@ public void createNodePaths() throws IOException { @After public void checkClusterStateIntact() throws IOException { - assertTrue(Metadata.SETTING_READ_ONLY_SETTING.get(new PersistedClusterStateService(new Path[] { nodePath }, nodeId, + assertTrue(Metadata.SETTING_READ_ONLY_SETTING.get(new PersistedClusterStateService(nodePaths, nodeId, xContentRegistry(), BigArrays.NON_RECYCLING_INSTANCE, new ClusterSettings(Settings.EMPTY, ClusterSettings.BUILT_IN_CLUSTER_SETTINGS), () -> 0L) .loadBestOnDiskState().metadata.persistentSettings())); @@ -67,17 +67,17 @@ public void testFailsOnEmptyPath() { final Path emptyPath = createTempDir(); final MockTerminal mockTerminal = new MockTerminal(); final ElasticsearchException elasticsearchException = expectThrows(ElasticsearchException.class, () -> - new OverrideNodeVersionCommand().processNodePaths(mockTerminal, emptyPath, noOptions, environment)); + new OverrideNodeVersionCommand().processNodePaths(mockTerminal, new Path[]{emptyPath}, noOptions, environment)); assertThat(elasticsearchException.getMessage(), equalTo(OverrideNodeVersionCommand.NO_METADATA_MESSAGE)); expectThrows(IllegalStateException.class, () -> mockTerminal.readText("")); } public void testFailsIfUnnecessary() throws IOException { final Version nodeVersion = Version.fromId(between(Version.CURRENT.minimumIndexCompatibilityVersion().id, Version.CURRENT.id)); - PersistedClusterStateService.overrideVersion(nodeVersion, nodePath); + PersistedClusterStateService.overrideVersion(nodeVersion, nodePaths); final MockTerminal mockTerminal = new MockTerminal(); final ElasticsearchException elasticsearchException = expectThrows(ElasticsearchException.class, () -> - new OverrideNodeVersionCommand().processNodePaths(mockTerminal, nodePath, noOptions, environment)); + new OverrideNodeVersionCommand().processNodePaths(mockTerminal, nodePaths, noOptions, environment)); assertThat(elasticsearchException.getMessage(), allOf( containsString("compatible with current version"), containsString(Version.CURRENT.toString()), @@ -87,11 +87,11 @@ public void testFailsIfUnnecessary() throws IOException { public void testWarnsIfTooOld() throws Exception { final Version nodeVersion = NodeMetadataTests.tooOldVersion(); - PersistedClusterStateService.overrideVersion(nodeVersion, nodePath); + PersistedClusterStateService.overrideVersion(nodeVersion, nodePaths); final MockTerminal mockTerminal = new MockTerminal(); mockTerminal.addTextInput("n\n"); final ElasticsearchException elasticsearchException = expectThrows(ElasticsearchException.class, () -> - new OverrideNodeVersionCommand().processNodePaths(mockTerminal, nodePath, noOptions, environment)); + new OverrideNodeVersionCommand().processNodePaths(mockTerminal, nodePaths, noOptions, environment)); assertThat(elasticsearchException.getMessage(), equalTo("aborted by user")); assertThat(mockTerminal.getOutput(), allOf( containsString("too old"), @@ -101,17 +101,17 @@ public void testWarnsIfTooOld() throws Exception { containsString(nodeVersion.toString()))); expectThrows(IllegalStateException.class, () -> mockTerminal.readText("")); - final NodeMetadata nodeMetadata = PersistedClusterStateService.nodeMetadata(nodePath); + final NodeMetadata nodeMetadata = PersistedClusterStateService.nodeMetadata(nodePaths); assertThat(nodeMetadata.nodeVersion(), equalTo(nodeVersion)); } public void testWarnsIfTooNew() throws Exception { final Version nodeVersion = NodeMetadataTests.tooNewVersion(); - PersistedClusterStateService.overrideVersion(nodeVersion, nodePath); + PersistedClusterStateService.overrideVersion(nodeVersion, nodePaths); final MockTerminal mockTerminal = new MockTerminal(); mockTerminal.addTextInput(randomFrom("yy", "Yy", "n", "yes", "true", "N", "no")); final ElasticsearchException elasticsearchException = expectThrows(ElasticsearchException.class, () -> - new OverrideNodeVersionCommand().processNodePaths(mockTerminal, nodePath, noOptions, environment)); + new OverrideNodeVersionCommand().processNodePaths(mockTerminal, nodePaths, noOptions, environment)); assertThat(elasticsearchException.getMessage(), equalTo("aborted by user")); assertThat(mockTerminal.getOutput(), allOf( containsString("data loss"), @@ -120,16 +120,16 @@ public void testWarnsIfTooNew() throws Exception { containsString(nodeVersion.toString()))); expectThrows(IllegalStateException.class, () -> mockTerminal.readText("")); - final NodeMetadata nodeMetadata = PersistedClusterStateService.nodeMetadata(nodePath); + final NodeMetadata nodeMetadata = PersistedClusterStateService.nodeMetadata(nodePaths); assertThat(nodeMetadata.nodeVersion(), equalTo(nodeVersion)); } public void testOverwritesIfTooOld() throws Exception { final Version nodeVersion = NodeMetadataTests.tooOldVersion(); - PersistedClusterStateService.overrideVersion(nodeVersion, nodePath); + PersistedClusterStateService.overrideVersion(nodeVersion, nodePaths); final MockTerminal mockTerminal = new MockTerminal(); mockTerminal.addTextInput(randomFrom("y", "Y")); - new OverrideNodeVersionCommand().processNodePaths(mockTerminal, nodePath, noOptions, environment); + new OverrideNodeVersionCommand().processNodePaths(mockTerminal, nodePaths, noOptions, environment); assertThat(mockTerminal.getOutput(), allOf( containsString("too old"), containsString("data loss"), @@ -139,16 +139,16 @@ public void testOverwritesIfTooOld() throws Exception { containsString(OverrideNodeVersionCommand.SUCCESS_MESSAGE))); expectThrows(IllegalStateException.class, () -> mockTerminal.readText("")); - final NodeMetadata nodeMetadata = PersistedClusterStateService.nodeMetadata(nodePath); + final NodeMetadata nodeMetadata = PersistedClusterStateService.nodeMetadata(nodePaths); assertThat(nodeMetadata.nodeVersion(), equalTo(Version.CURRENT)); } public void testOverwritesIfTooNew() throws Exception { final Version nodeVersion = NodeMetadataTests.tooNewVersion(); - PersistedClusterStateService.overrideVersion(nodeVersion, nodePath); + PersistedClusterStateService.overrideVersion(nodeVersion, nodePaths); final MockTerminal mockTerminal = new MockTerminal(); mockTerminal.addTextInput(randomFrom("y", "Y")); - new OverrideNodeVersionCommand().processNodePaths(mockTerminal, nodePath, noOptions, environment); + new OverrideNodeVersionCommand().processNodePaths(mockTerminal, nodePaths, noOptions, environment); assertThat(mockTerminal.getOutput(), allOf( containsString("data loss"), containsString("You should not use this tool"), @@ -157,7 +157,7 @@ public void testOverwritesIfTooNew() throws Exception { containsString(OverrideNodeVersionCommand.SUCCESS_MESSAGE))); expectThrows(IllegalStateException.class, () -> mockTerminal.readText("")); - final NodeMetadata nodeMetadata = PersistedClusterStateService.nodeMetadata(nodePath); + final NodeMetadata nodeMetadata = PersistedClusterStateService.nodeMetadata(nodePaths); assertThat(nodeMetadata.nodeVersion(), equalTo(Version.CURRENT)); } } diff --git a/server/src/test/java/org/elasticsearch/index/shard/RemoveCorruptedShardDataCommandTests.java b/server/src/test/java/org/elasticsearch/index/shard/RemoveCorruptedShardDataCommandTests.java index 6d7a293f73c66..d926da8fc44dc 100644 --- a/server/src/test/java/org/elasticsearch/index/shard/RemoveCorruptedShardDataCommandTests.java +++ b/server/src/test/java/org/elasticsearch/index/shard/RemoveCorruptedShardDataCommandTests.java @@ -78,7 +78,7 @@ public class RemoveCorruptedShardDataCommandTests extends IndexShardTestCase { private IndexMetadata indexMetadata; private ClusterState clusterState; private IndexShard indexShard; - private Path dataPath; + private Path[] dataPaths; private Path translogPath; private Path indexPath; @@ -92,15 +92,16 @@ public void setup() throws IOException { routing = TestShardRouting.newShardRouting(shardId, nodeId, true, ShardRoutingState.INITIALIZING, RecoverySource.EmptyStoreRecoverySource.INSTANCE); - dataPath = createTempDir(); + final Path dataDir = createTempDir(); environment = TestEnvironment.newEnvironment(Settings.builder() - .put(Environment.PATH_HOME_SETTING.getKey(), dataPath) - .put(Environment.PATH_DATA_SETTING.getKey(), dataPath.toAbsolutePath().toString()).build()); + .put(Environment.PATH_HOME_SETTING.getKey(), dataDir) + .put(Environment.PATH_DATA_SETTING.getKey(), dataDir.toAbsolutePath().toString()).build()); // create same directory structure as prod does - Files.createDirectories(dataPath); + Files.createDirectories(dataDir); + dataPaths = new Path[] {dataDir}; final Settings settings = Settings.builder() .put(IndexMetadata.SETTING_VERSION_CREATED, Version.CURRENT) .put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1) @@ -109,7 +110,7 @@ public void setup() throws IOException { .put(IndexMetadata.SETTING_INDEX_UUID, shardId.getIndex().getUUID()) .build(); - final NodeEnvironment.NodePath nodePath = new NodeEnvironment.NodePath(dataPath); + final NodeEnvironment.NodePath nodePath = new NodeEnvironment.NodePath(dataDir); shardPath = new ShardPath(false, nodePath.resolve(shardId), nodePath.resolve(shardId), shardId); // Adding rollover info to IndexMetadata to check that NamedXContentRegistry is properly configured @@ -369,11 +370,11 @@ public void testResolveIndexDirectory() throws Exception { final OptionSet options = parser.parse("--index", shardId.getIndex().getName(), "--shard-id", Integer.toString(shardId.id())); - command.findAndProcessShardPath(options, environment, dataPath, clusterState, + command.findAndProcessShardPath(options, environment, dataPaths, clusterState, shardPath -> assertThat(shardPath.resolveIndex(), equalTo(indexPath))); final OptionSet options2 = parser.parse("--dir", indexPath.toAbsolutePath().toString()); - command.findAndProcessShardPath(options2, environment, dataPath, clusterState, + command.findAndProcessShardPath(options2, environment, dataPaths, clusterState, shardPath -> assertThat(shardPath.resolveIndex(), equalTo(indexPath))); } From 7e7cfe3a551bf6d4c5b4e4b2c432ded48d04a520 Mon Sep 17 00:00:00 2001 From: Nik Everett Date: Mon, 4 Oct 2021 15:39:05 -0400 Subject: [PATCH 140/250] A few more tests for parent and child aggs (#78264) In our effort to get comprehensive rest tests for aggs (#26220) I've added a few more tests for the `parent` and `child` aggs. The aggs themselves don't have a ton of configuration, but I added a few examples of running them inside of other aggs. --- .../rest-api-spec/test/40_aggregations.yml | 83 ++++++++++++++++++- 1 file changed, 80 insertions(+), 3 deletions(-) diff --git a/modules/parent-join/src/yamlRestTest/resources/rest-api-spec/test/40_aggregations.yml b/modules/parent-join/src/yamlRestTest/resources/rest-api-spec/test/40_aggregations.yml index fd93dfb4ceb1b..253830beb44b8 100644 --- a/modules/parent-join/src/yamlRestTest/resources/rest-api-spec/test/40_aggregations.yml +++ b/modules/parent-join/src/yamlRestTest/resources/rest-api-spec/test/40_aggregations.yml @@ -7,8 +7,13 @@ setup: number_of_shards: 2 #Two shards proves that we route properly mappings: properties: - join_field: { "type": "join", "relations": { "parent": "child", "child": "grand_child" } } - id: { "type": "keyword" } + join_field: + type: join + relations: + parent: child + child: grand_child + id: + type: keyword - do: bulk: @@ -29,7 +34,7 @@ setup: - '{ "join_field": { "name": "grand_child", "parent": "5" } }' --- -unconfigured: +unconfigured children: - do: index: index: test_unconfigured @@ -53,6 +58,31 @@ unconfigured: - match: { hits.total.value: 1 } - match: { aggregations.to-answers.doc_count: 0 } +--- +unconfigured parent: + - do: + index: + index: test_unconfigured + refresh: true + body: + join: + name: question + body:

I have Windows 2003 server and i bought a new Windows 2008 server..., + title: Whats the best way to file transfer my site from server to a newer one?, + tags: [windows-server-2003, windows-server-2008, file-transfer] + + - do: + search: + index: test_unconfigured + body: + size: 0 + aggs: + to-answers: + parent: + type: answer + - match: { hits.total.value: 1 } + - match: { aggregations.to-answers.doc_count: 0 } + --- children: - do: @@ -173,3 +203,50 @@ parent terms terms: - match: { aggregations.parent.tag.buckets.0.subject.buckets.0.key: surprises } - match: { aggregations.parent.tag.buckets.1.key: jumble } - match: { aggregations.parent.tag.buckets.1.subject.buckets.0.key: critters } + +--- +term children: + - do: + search: + index: test + body: + size: 0 + aggs: + subject: + terms: + field: subject.keyword + aggs: + children: + children: + type: child + - match: { hits.total.value: 6 } + - match: { aggregations.subject.buckets.0.key: critters } + - match: { aggregations.subject.buckets.0.doc_count: 1 } + - match: { aggregations.subject.buckets.0.children.doc_count: 1 } + - match: { aggregations.subject.buckets.1.key: surprises } + - match: { aggregations.subject.buckets.1.doc_count: 1 } + - match: { aggregations.subject.buckets.1.children.doc_count: 2 } + +--- +term parent: + - do: + search: + index: test + body: + size: 0 + aggs: + animal: + terms: + field: animal.keyword + aggs: + parent: + parent: + type: child + - match: { hits.total.value: 6 } + - match: { aggregations.animal.buckets.0.key: dog } + - match: { aggregations.animal.buckets.0.doc_count: 2 } + - match: { aggregations.animal.buckets.0.parent.doc_count: 2 } + - match: { aggregations.animal.buckets.1.key: cat } + - match: { aggregations.animal.buckets.1.doc_count: 1 } + - match: { aggregations.animal.buckets.1.parent.doc_count: 1 } + From e684d5ef6347705f94ea5c5f71ae9cd89d912207 Mon Sep 17 00:00:00 2001 From: Rene Groeschke Date: Mon, 4 Oct 2021 21:43:02 +0200 Subject: [PATCH 141/250] Introduce DSL for configuring BWC tests (#78597) this makes configuring bwc Tests less errorprone due to strange groovy behaviour --- .../gradle/internal/BwcVersions.java | 18 +++ .../build.gradle | 11 +- qa/full-cluster-restart/build.gradle | 10 +- qa/mixed-cluster/build.gradle | 76 +++++----- qa/repository-multi-version/build.gradle | 4 +- qa/rolling-upgrade/build.gradle | 8 +- qa/verify-version-constants/build.gradle | 8 +- x-pack/plugin/eql/qa/mixed-node/build.gradle | 82 +++++------ x-pack/plugin/sql/qa/jdbc/build.gradle | 3 +- x-pack/plugin/sql/qa/mixed-node/build.gradle | 12 +- x-pack/qa/full-cluster-restart/build.gradle | 131 +++++++++--------- x-pack/qa/mixed-tier-cluster/build.gradle | 13 +- x-pack/qa/rolling-upgrade-basic/build.gradle | 10 +- .../build.gradle | 9 +- x-pack/qa/rolling-upgrade/build.gradle | 11 +- 15 files changed, 183 insertions(+), 223 deletions(-) diff --git a/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/BwcVersions.java b/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/BwcVersions.java index 5b704786c3cc1..da0a09e5fca9e 100644 --- a/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/BwcVersions.java +++ b/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/BwcVersions.java @@ -21,7 +21,9 @@ import java.util.Set; import java.util.SortedSet; import java.util.TreeSet; +import java.util.function.BiConsumer; import java.util.function.Consumer; +import java.util.function.Predicate; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; @@ -340,6 +342,14 @@ public List getIndexCompatible() { return unmodifiableList(filterSupportedVersions(indexCompatibles)); } + public void withIndexCompatiple(BiConsumer versionAction) { + getIndexCompatible().forEach(v -> versionAction.accept(v, "v"+v.toString())); + } + + public void withIndexCompatiple(Predicate filter, BiConsumer versionAction) { + getIndexCompatible().stream().filter(filter).forEach(v -> versionAction.accept(v, "v"+v.toString())); + } + public List getWireCompatible() { List wireCompat = new ArrayList<>(); List prevMajors = groupByMajor.get(currentVersion.getMajor() - 1); @@ -353,6 +363,14 @@ public List getWireCompatible() { return unmodifiableList(filterSupportedVersions(wireCompat)); } + public void withWireCompatiple(BiConsumer versionAction) { + getWireCompatible().forEach(v -> versionAction.accept(v, "v"+v.toString())); + } + + public void withWireCompatiple(Predicate filter, BiConsumer versionAction) { + getWireCompatible().stream().filter(filter).forEach(v -> versionAction.accept(v, "v"+v.toString())); + } + private List filterSupportedVersions(List wireCompat) { return Architecture.current() == Architecture.AARCH64 ? wireCompat.stream().filter(version -> version.onOrAfter("7.12.0")).collect(Collectors.toList()) diff --git a/qa/ccs-rolling-upgrade-remote-cluster/build.gradle b/qa/ccs-rolling-upgrade-remote-cluster/build.gradle index 2f1b21275da26..c975065f1bcd0 100644 --- a/qa/ccs-rolling-upgrade-remote-cluster/build.gradle +++ b/qa/ccs-rolling-upgrade-remote-cluster/build.gradle @@ -6,7 +6,6 @@ * Side Public License, v 1. */ -import org.elasticsearch.gradle.Version import org.elasticsearch.gradle.internal.info.BuildParams import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask @@ -19,9 +18,7 @@ dependencies { testImplementation project(':client:rest-high-level') } -for (Version bwcVersion : BuildParams.bwcVersions.wireCompatible) { - String bwcVersionStr = bwcVersion.toString() - String baseName = "v" + bwcVersionStr +BuildParams.bwcVersions.withWireCompatiple { bwcVersion, baseName -> /** * We execute tests 3 times. @@ -32,13 +29,13 @@ for (Version bwcVersion : BuildParams.bwcVersions.wireCompatible) { */ def localCluster = testClusters.register("${baseName}-local") { numberOfNodes = 2 - versions = [bwcVersionStr, project.version] + versions = [bwcVersion.toString(), project.version] setting 'cluster.remote.node.attr', 'gateway' setting 'xpack.security.enabled', 'false' } def remoteCluster = testClusters.register("${baseName}-remote") { numberOfNodes = 3 - versions = [bwcVersionStr, project.version] + versions = [bwcVersion.toString(), project.version] firstNode.setting 'node.attr.gateway', 'true' lastNode.setting 'node.attr.gateway', 'true' setting 'xpack.security.enabled', 'false' @@ -48,7 +45,7 @@ for (Version bwcVersion : BuildParams.bwcVersions.wireCompatible) { tasks.withType(StandaloneRestIntegTestTask).matching { it.name.startsWith("${baseName}#") }.configureEach { useCluster localCluster useCluster remoteCluster - systemProperty 'tests.upgrade_from_version', bwcVersionStr.replace('-SNAPSHOT', '') + systemProperty 'tests.upgrade_from_version', bwcVersion.toString().replace('-SNAPSHOT', '') doFirst { nonInputProperties.systemProperty('tests.rest.cluster', localCluster.map(c -> c.allHttpSocketURI.join(","))) diff --git a/qa/full-cluster-restart/build.gradle b/qa/full-cluster-restart/build.gradle index bad6b16111f03..6ae77b9ba4ac5 100644 --- a/qa/full-cluster-restart/build.gradle +++ b/qa/full-cluster-restart/build.gradle @@ -7,7 +7,6 @@ */ -import org.elasticsearch.gradle.Version import org.elasticsearch.gradle.internal.info.BuildParams import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask @@ -16,12 +15,9 @@ apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.internal-test-artifact' apply plugin: 'elasticsearch.bwc-test' -for (Version bwcVersion : BuildParams.bwcVersions.indexCompatible) { - def bwcVersionString = bwcVersion.toString(); - String baseName = "v" + bwcVersionString - +BuildParams.bwcVersions.withIndexCompatiple { bwcVersion, baseName -> def baseCluster = testClusters.register(baseName) { - versions = [bwcVersionString, project.version] + versions = [bwcVersion.toString(), project.version] numberOfNodes = 2 // some tests rely on the translog not being flushed setting 'indices.memory.shard_inactive_time', '60m' @@ -48,7 +44,7 @@ for (Version bwcVersion : BuildParams.bwcVersions.indexCompatible) { systemProperty 'tests.is_old_cluster', 'false' } - String oldVersion = bwcVersionString.minus("-SNAPSHOT") + String oldVersion = bwcVersion.toString().minus("-SNAPSHOT") tasks.matching { it.name.startsWith(baseName) && it.name.endsWith("ClusterTest") }.configureEach { it.systemProperty 'tests.old_cluster_version', oldVersion it.systemProperty 'tests.path.repo', "${buildDir}/cluster/shared/repo/${baseName}" diff --git a/qa/mixed-cluster/build.gradle b/qa/mixed-cluster/build.gradle index 5ff6943f6f0a6..19ac2adfaf985 100644 --- a/qa/mixed-cluster/build.gradle +++ b/qa/mixed-cluster/build.gradle @@ -6,7 +6,6 @@ * Side Public License, v 1. */ -import org.elasticsearch.gradle.Version import org.elasticsearch.gradle.VersionProperties import org.elasticsearch.gradle.internal.info.BuildParams import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask @@ -22,51 +21,46 @@ restResources { } } -for (Version bwcVersion : BuildParams.bwcVersions.wireCompatible) { - if (bwcVersion == VersionProperties.getElasticsearchVersion()) { - // Not really a mixed cluster - continue; - } - - String bwcVersionString = bwcVersion.toString() - String baseName = "v" + bwcVersionString +BuildParams.bwcVersions.withWireCompatiple { bwcVersion, baseName -> - /* This project runs the core REST tests against a 4 node cluster where two of + if (bwcVersion != VersionProperties.getElasticsearchVersion()) { + /* This project runs the core REST tests against a 4 node cluster where two of the nodes has a different minor. */ - def baseCluster = testClusters.register(baseName) { - versions = [bwcVersionString, project.version] - numberOfNodes = 4 - setting 'path.repo', "${buildDir}/cluster/shared/repo/${baseName}" - setting 'xpack.security.enabled', 'false' - } + def baseCluster = testClusters.register(baseName) { + versions = [bwcVersion.toString(), project.version] + numberOfNodes = 4 + setting 'path.repo', "${buildDir}/cluster/shared/repo/${baseName}" + setting 'xpack.security.enabled', 'false' + } - tasks.register("${baseName}#mixedClusterTest", StandaloneRestIntegTestTask) { - useCluster baseCluster - mustRunAfter("precommit") - doFirst { - delete("${buildDir}/cluster/shared/repo/${baseName}") - // Getting the endpoints causes a wait for the cluster - println "Test cluster endpoints are: ${-> baseCluster.get().allHttpSocketURI.join(",")}" - println "Upgrading one node to create a mixed cluster" - if (BuildParams.isSnapshotBuild() == false) { - baseCluster.get().nodes."${baseName}-0".systemProperty 'es.index_mode_feature_flag_registered', 'true' + tasks.register("${baseName}#mixedClusterTest", StandaloneRestIntegTestTask) { + useCluster baseCluster + mustRunAfter("precommit") + doFirst { + delete("${buildDir}/cluster/shared/repo/${baseName}") + // Getting the endpoints causes a wait for the cluster + println "Test cluster endpoints are: ${-> baseCluster.get().allHttpSocketURI.join(",")}" + println "Upgrading one node to create a mixed cluster" + if (BuildParams.isSnapshotBuild() == false) { + baseCluster.get().nodes."${baseName}-0".systemProperty 'es.index_mode_feature_flag_registered', 'true' + } + baseCluster.get().nextNodeToNextVersion() + // Getting the endpoints causes a wait for the cluster + println "Upgrade complete, endpoints are: ${-> baseCluster.get().allHttpSocketURI.join(",")}" + println "Upgrading another node to create a mixed cluster" + if (BuildParams.isSnapshotBuild() == false) { + baseCluster.get().nodes."${baseName}-1".systemProperty 'es.index_mode_feature_flag_registered', 'true' + } + baseCluster.get().nextNodeToNextVersion() + nonInputProperties.systemProperty('tests.rest.cluster', baseCluster.map(c -> c.allHttpSocketURI.join(","))) + nonInputProperties.systemProperty('tests.clustername', baseName) } - baseCluster.get().nextNodeToNextVersion() - // Getting the endpoints causes a wait for the cluster - println "Upgrade complete, endpoints are: ${-> baseCluster.get().allHttpSocketURI.join(",")}" - println "Upgrading another node to create a mixed cluster" - if (BuildParams.isSnapshotBuild() == false) { - baseCluster.get().nodes."${baseName}-1".systemProperty 'es.index_mode_feature_flag_registered', 'true' - } - baseCluster.get().nextNodeToNextVersion() - nonInputProperties.systemProperty('tests.rest.cluster', baseCluster.map(c -> c.allHttpSocketURI.join(","))) - nonInputProperties.systemProperty('tests.clustername', baseName) + systemProperty 'tests.path.repo', "${buildDir}/cluster/shared/repo/${baseName}" + onlyIf { project.bwc_tests_enabled } } - systemProperty 'tests.path.repo', "${buildDir}/cluster/shared/repo/${baseName}" - onlyIf { project.bwc_tests_enabled } - } - tasks.register(bwcTaskName(bwcVersion)) { - dependsOn "${baseName}#mixedClusterTest" + tasks.register(bwcTaskName(bwcVersion)) { + dependsOn "${baseName}#mixedClusterTest" + } } } diff --git a/qa/repository-multi-version/build.gradle b/qa/repository-multi-version/build.gradle index ca2b6cdf83e06..c626a7573b6b8 100644 --- a/qa/repository-multi-version/build.gradle +++ b/qa/repository-multi-version/build.gradle @@ -6,7 +6,6 @@ * Side Public License, v 1. */ -import org.elasticsearch.gradle.Version import org.elasticsearch.gradle.internal.info.BuildParams import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask @@ -20,8 +19,7 @@ dependencies { testImplementation project(':client:rest-high-level') } -for (Version bwcVersion : BuildParams.bwcVersions.indexCompatible) { - String baseName = "v${bwcVersion}" +BuildParams.bwcVersions.withIndexCompatiple { bwcVersion, baseName -> String oldClusterName = "${baseName}-old" String newClusterName = "${baseName}-new" diff --git a/qa/rolling-upgrade/build.gradle b/qa/rolling-upgrade/build.gradle index bd32819ffa8a6..3ba62aa51733f 100644 --- a/qa/rolling-upgrade/build.gradle +++ b/qa/rolling-upgrade/build.gradle @@ -6,7 +6,6 @@ * Side Public License, v 1. */ -import org.elasticsearch.gradle.Version import org.elasticsearch.gradle.internal.info.BuildParams import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask @@ -15,7 +14,7 @@ apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.bwc-test' apply plugin: 'elasticsearch.rest-resources' -for (Version bwcVersion : BuildParams.bwcVersions.wireCompatible) { +BuildParams.bwcVersions.withWireCompatiple { bwcVersion, baseName -> /* * The goal here is to: *

    @@ -30,11 +29,8 @@ for (Version bwcVersion : BuildParams.bwcVersions.wireCompatible) { *
*/ - String bwcVersionString = bwcVersion.toString() - String baseName = "v" + bwcVersionString - def baseCluster = testClusters.register(baseName) { - versions = [bwcVersionString, project.version] + versions = [bwcVersion.toString(), project.version] numberOfNodes = 3 setting 'repositories.url.allowed_urls', 'http://snapshot.test*' diff --git a/qa/verify-version-constants/build.gradle b/qa/verify-version-constants/build.gradle index 4fc67424a8cc5..ab6b81e6f5fd6 100644 --- a/qa/verify-version-constants/build.gradle +++ b/qa/verify-version-constants/build.gradle @@ -6,7 +6,6 @@ * Side Public License, v 1. */ -import org.elasticsearch.gradle.Version import org.elasticsearch.gradle.VersionProperties import org.elasticsearch.gradle.internal.info.BuildParams import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask @@ -15,12 +14,9 @@ apply plugin: 'elasticsearch.internal-testclusters' apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.bwc-test' -for (Version bwcVersion : BuildParams.bwcVersions.indexCompatible) { - String bwcVersionString = bwcVersion.toString() - String baseName = "v${bwcVersionString}" - +BuildParams.bwcVersions.withIndexCompatiple { bwcVersion, baseName -> def baseCluster = testClusters.register(baseName) { - version = bwcVersionString + version = bwcVersion.toString() setting 'xpack.security.enabled', 'true' user username: 'admin', password: 'admin-password', role: 'superuser' } diff --git a/x-pack/plugin/eql/qa/mixed-node/build.gradle b/x-pack/plugin/eql/qa/mixed-node/build.gradle index bbd25aab06e73..a8189f82f9580 100644 --- a/x-pack/plugin/eql/qa/mixed-node/build.gradle +++ b/x-pack/plugin/eql/qa/mixed-node/build.gradle @@ -3,58 +3,50 @@ apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.bwc-test' apply plugin: 'elasticsearch.rest-test' -import org.elasticsearch.gradle.Version import org.elasticsearch.gradle.VersionProperties import org.elasticsearch.gradle.internal.info.BuildParams import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask dependencies { - testImplementation project(':x-pack:qa') - testImplementation(project(xpackModule('ql:test-fixtures'))) - testImplementation project(path: xpackModule('eql'), configuration: 'default') + testImplementation project(':x-pack:qa') + testImplementation(project(xpackModule('ql:test-fixtures'))) + testImplementation project(path: xpackModule('eql'), configuration: 'default') } -tasks.named("integTest").configure{ enabled = false} - -for (Version bwcVersion : BuildParams.bwcVersions.wireCompatible.findAll { it.onOrAfter('7.10.0') }) { - if (bwcVersion == VersionProperties.getElasticsearchVersion()) { - // Not really a mixed cluster - continue; - } - - String bwcVersionString = bwcVersion.toString() - String baseName = "v" + bwcVersion - - def cluster = testClusters.register(baseName) { - versions = [bwcVersionString, project.version] - numberOfNodes = 3 - testDistribution = 'DEFAULT' - setting 'xpack.security.enabled', 'false' - setting 'xpack.watcher.enabled', 'false' - setting 'xpack.ml.enabled', 'false' - setting 'xpack.eql.enabled', 'true' - setting 'xpack.license.self_generated.type', 'trial' - // for debugging purposes - // setting 'logger.org.elasticsearch.xpack.eql.plugin.TransportEqlSearchAction', 'TRACE' - } - - tasks.register("${baseName}#mixedClusterTest", StandaloneRestIntegTestTask) { - useCluster cluster - mustRunAfter("precommit") - doFirst { - // Getting the endpoints causes a wait for the cluster - println "Endpoints are: ${-> testClusters."${baseName}".allHttpSocketURI.join(",")}" - println "Upgrading one node to create a mixed cluster" - cluster.get().nextNodeToNextVersion() +tasks.named("integTest").configure { enabled = false } + +BuildParams.bwcVersions.withWireCompatiple(v -> v.onOrAfter("7.10.0") && + v != VersionProperties.getElasticsearchVersion()) { bwcVersion, baseName -> + def cluster = testClusters.register(baseName) { + versions = [bwcVersion.toString(), project.version] + numberOfNodes = 3 + testDistribution = 'DEFAULT' + setting 'xpack.security.enabled', 'false' + setting 'xpack.watcher.enabled', 'false' + setting 'xpack.ml.enabled', 'false' + setting 'xpack.eql.enabled', 'true' + setting 'xpack.license.self_generated.type', 'trial' + // for debugging purposes + // setting 'logger.org.elasticsearch.xpack.eql.plugin.TransportEqlSearchAction', 'TRACE' + } - println "Upgrade complete, endpoints are: ${-> testClusters.named(baseName).get().allHttpSocketURI.join(",")}" - nonInputProperties.systemProperty('tests.rest.cluster', cluster.map(c->c.allHttpSocketURI.join(","))) - nonInputProperties.systemProperty('tests.clustername', baseName) + tasks.register("${baseName}#mixedClusterTest", StandaloneRestIntegTestTask) { + useCluster cluster + mustRunAfter("precommit") + doFirst { + // Getting the endpoints causes a wait for the cluster + println "Endpoints are: ${-> testClusters."${baseName}".allHttpSocketURI.join(",")}" + println "Upgrading one node to create a mixed cluster" + cluster.get().nextNodeToNextVersion() + + println "Upgrade complete, endpoints are: ${-> testClusters.named(baseName).get().allHttpSocketURI.join(",")}" + nonInputProperties.systemProperty('tests.rest.cluster', cluster.map(c -> c.allHttpSocketURI.join(","))) + nonInputProperties.systemProperty('tests.clustername', baseName) + } + onlyIf { project.bwc_tests_enabled } } - onlyIf { project.bwc_tests_enabled } - } - tasks.register(bwcTaskName(bwcVersion)) { - dependsOn "${baseName}#mixedClusterTest" - } -} + tasks.register(bwcTaskName(bwcVersion)) { + dependsOn "${baseName}#mixedClusterTest" + } +} \ No newline at end of file diff --git a/x-pack/plugin/sql/qa/jdbc/build.gradle b/x-pack/plugin/sql/qa/jdbc/build.gradle index 52562ff18ad97..3d327306d8e03 100644 --- a/x-pack/plugin/sql/qa/jdbc/build.gradle +++ b/x-pack/plugin/sql/qa/jdbc/build.gradle @@ -71,10 +71,9 @@ subprojects { } // Configure compatibility testing tasks - for (Version bwcVersion : BuildParams.bwcVersions.indexCompatible) { + BuildParams.bwcVersions.withIndexCompatiple { bwcVersion, baseName -> // Compatibility testing for JDBC driver started with version 7.9.0 if (bwcVersion.onOrAfter(Version.fromString("7.9.0")) && (bwcVersion.equals(VersionProperties.elasticsearchVersion) == false)) { - String baseName = "v${bwcVersion}" UnreleasedVersionInfo unreleasedVersion = BuildParams.bwcVersions.unreleasedInfo(bwcVersion) Configuration driverConfiguration = configurations.create("jdbcDriver${baseName}") { // TODO: Temporary workaround for https://github.com/elastic/elasticsearch/issues/73433 diff --git a/x-pack/plugin/sql/qa/mixed-node/build.gradle b/x-pack/plugin/sql/qa/mixed-node/build.gradle index 3dca86cc81a9c..2c3a20edcf4a0 100644 --- a/x-pack/plugin/sql/qa/mixed-node/build.gradle +++ b/x-pack/plugin/sql/qa/mixed-node/build.gradle @@ -3,7 +3,6 @@ apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.bwc-test' apply plugin: 'elasticsearch.rest-test' -import org.elasticsearch.gradle.Version import org.elasticsearch.gradle.VersionProperties import org.elasticsearch.gradle.internal.info.BuildParams import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask @@ -22,17 +21,12 @@ testClusters.configureEach { tasks.named("integTest").configure{ enabled = false} // A bug (https://github.com/elastic/elasticsearch/issues/68439) limits us to perform tests with versions from 7.10.3 onwards -for (Version bwcVersion : BuildParams.bwcVersions.wireCompatible.findAll { it.onOrAfter('7.10.0') }) { - if (bwcVersion == VersionProperties.getElasticsearchVersion()) { - // Not really a mixed cluster - continue; - } - String bwcVersionString = bwcVersion.toString() - String baseName = "v" + bwcVersion +BuildParams.bwcVersions.withWireCompatiple(v -> v.onOrAfter("7.10.0") && + v != VersionProperties.getElasticsearchVersion()) { bwcVersion, baseName -> def baseCluster = testClusters.register(baseName) { - versions = [bwcVersionString, project.version] + versions = [bwcVersion.toString(), project.version] numberOfNodes = 3 testDistribution = 'DEFAULT' setting 'xpack.security.enabled', 'false' diff --git a/x-pack/qa/full-cluster-restart/build.gradle b/x-pack/qa/full-cluster-restart/build.gradle index ccc75ea05c01c..d02c75afeb917 100644 --- a/x-pack/qa/full-cluster-restart/build.gradle +++ b/x-pack/qa/full-cluster-restart/build.gradle @@ -1,4 +1,3 @@ -import org.elasticsearch.gradle.Version import org.elasticsearch.gradle.internal.info.BuildParams import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask @@ -30,72 +29,70 @@ tasks.register("copyTestNodeKeyMaterial", Copy) { into outputDir } -for (Version bwcVersion : BuildParams.bwcVersions.indexCompatible) { - def bwcVersionString = bwcVersion.toString(); - String baseName = "v"+ bwcVersionString; - - def baseCluster = testClusters.register(baseName) { - testDistribution = "DEFAULT" - versions = [bwcVersionString, project.version] - numberOfNodes = 2 - setting 'path.repo', "${buildDir}/cluster/shared/repo/${baseName}" - user username: "test_user", password: "x-pack-test-password" - - setting 'path.repo', "${buildDir}/cluster/shared/repo/${baseName}" - // some tests rely on the translog not being flushed - setting 'indices.memory.shard_inactive_time', '60m' - setting 'xpack.security.enabled', 'true' - setting 'xpack.security.transport.ssl.enabled', 'true' - setting 'xpack.license.self_generated.type', 'trial' - - extraConfigFile 'testnode.pem', file("${outputDir}/testnode.pem") - extraConfigFile 'testnode.crt', file("${outputDir}/testnode.crt") - - keystore 'xpack.watcher.encryption_key', file("${project.projectDir}/src/test/resources/system_key") - setting 'xpack.watcher.encrypt_sensitive_data', 'true' - - setting 'xpack.security.transport.ssl.key', 'testnode.pem' - setting 'xpack.security.transport.ssl.certificate', 'testnode.crt' - keystore 'xpack.security.transport.ssl.secure_key_passphrase', 'testnode' - - setting 'xpack.security.authc.api_key.enabled', 'true' - } - - tasks.register("${baseName}#oldClusterTest", StandaloneRestIntegTestTask) { - mustRunAfter("precommit") - useCluster baseCluster - dependsOn "copyTestNodeKeyMaterial" - doFirst { - delete("${buildDir}/cluster/shared/repo/${baseName}") +BuildParams.bwcVersions.withIndexCompatiple { bwcVersion, baseName -> + def baseCluster = testClusters.register(baseName) { + testDistribution = "DEFAULT" + versions = [bwcVersion.toString(), project.version] + numberOfNodes = 2 + setting 'path.repo', "${buildDir}/cluster/shared/repo/${baseName}" + user username: "test_user", password: "x-pack-test-password" + + setting 'path.repo', "${buildDir}/cluster/shared/repo/${baseName}" + // some tests rely on the translog not being flushed + setting 'indices.memory.shard_inactive_time', '60m' + setting 'xpack.security.enabled', 'true' + setting 'xpack.security.transport.ssl.enabled', 'true' + setting 'xpack.license.self_generated.type', 'trial' + + extraConfigFile 'testnode.pem', file("${outputDir}/testnode.pem") + extraConfigFile 'testnode.crt', file("${outputDir}/testnode.crt") + + keystore 'xpack.watcher.encryption_key', file("${project.projectDir}/src/test/resources/system_key") + setting 'xpack.watcher.encrypt_sensitive_data', 'true' + + setting 'xpack.security.transport.ssl.key', 'testnode.pem' + setting 'xpack.security.transport.ssl.certificate', 'testnode.crt' + keystore 'xpack.security.transport.ssl.secure_key_passphrase', 'testnode' + + setting 'xpack.security.authc.api_key.enabled', 'true' } - systemProperty 'tests.is_old_cluster', 'true' - exclude 'org/elasticsearch/upgrades/FullClusterRestartIT.class' - exclude 'org/elasticsearch/upgrades/FullClusterRestartSettingsUpgradeIT.class' - exclude 'org/elasticsearch/upgrades/QueryBuilderBWCIT.class' - } - - tasks.register("${baseName}#upgradedClusterTest", StandaloneRestIntegTestTask) { - mustRunAfter("precommit") - useCluster baseCluster - dependsOn "${baseName}#oldClusterTest" - doFirst { - testClusters.named(baseName).get().goToNextVersion() + + tasks.register("${baseName}#oldClusterTest", StandaloneRestIntegTestTask) { + mustRunAfter("precommit") + useCluster baseCluster + dependsOn "copyTestNodeKeyMaterial" + doFirst { + delete("${buildDir}/cluster/shared/repo/${baseName}") + } + systemProperty 'tests.is_old_cluster', 'true' + exclude 'org/elasticsearch/upgrades/FullClusterRestartIT.class' + exclude 'org/elasticsearch/upgrades/FullClusterRestartSettingsUpgradeIT.class' + exclude 'org/elasticsearch/upgrades/QueryBuilderBWCIT.class' } - systemProperty 'tests.is_old_cluster', 'false' - exclude 'org/elasticsearch/upgrades/FullClusterRestartIT.class' - exclude 'org/elasticsearch/upgrades/FullClusterRestartSettingsUpgradeIT.class' - exclude 'org/elasticsearch/upgrades/QueryBuilderBWCIT.class' - } - - String oldVersion = bwcVersionString.minus("-SNAPSHOT") - tasks.matching { it.name.startsWith("${baseName}#") && it.name.endsWith("ClusterTest") }.configureEach { - it.systemProperty 'tests.old_cluster_version', oldVersion - it.systemProperty 'tests.path.repo', "${buildDir}/cluster/shared/repo/${baseName}" - it.nonInputProperties.systemProperty('tests.rest.cluster', baseCluster.map(c -> c.allHttpSocketURI.join(","))) - it.nonInputProperties.systemProperty('tests.clustername', baseName) - } - - tasks.register(bwcTaskName(bwcVersion)) { - dependsOn "${baseName}#upgradedClusterTest" - } + + tasks.register("${baseName}#upgradedClusterTest", StandaloneRestIntegTestTask) { + mustRunAfter("precommit") + useCluster baseCluster + dependsOn "${baseName}#oldClusterTest" + doFirst { + testClusters.named(baseName).get().goToNextVersion() + } + systemProperty 'tests.is_old_cluster', 'false' + exclude 'org/elasticsearch/upgrades/FullClusterRestartIT.class' + exclude 'org/elasticsearch/upgrades/FullClusterRestartSettingsUpgradeIT.class' + exclude 'org/elasticsearch/upgrades/QueryBuilderBWCIT.class' + } + + String oldVersion = bwcVersion.toString().minus("-SNAPSHOT") + tasks.matching { it.name.startsWith("${baseName}#") && it.name.endsWith("ClusterTest") }.configureEach { + it.systemProperty 'tests.old_cluster_version', oldVersion + it.systemProperty 'tests.path.repo', "${buildDir}/cluster/shared/repo/${baseName}" + it.nonInputProperties.systemProperty('tests.rest.cluster', baseCluster.map(c -> c.allHttpSocketURI.join(","))) + it.nonInputProperties.systemProperty('tests.clustername', baseName) + } + + tasks.register(bwcTaskName(bwcVersion)) { + dependsOn "${baseName}#upgradedClusterTest" + } + } diff --git a/x-pack/qa/mixed-tier-cluster/build.gradle b/x-pack/qa/mixed-tier-cluster/build.gradle index 2884e2df7f3c2..8fbb0f88d128f 100644 --- a/x-pack/qa/mixed-tier-cluster/build.gradle +++ b/x-pack/qa/mixed-tier-cluster/build.gradle @@ -3,7 +3,6 @@ apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.bwc-test' apply plugin: 'elasticsearch.rest-test' -import org.elasticsearch.gradle.Version import org.elasticsearch.gradle.VersionProperties import org.elasticsearch.gradle.internal.info.BuildParams import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask @@ -13,17 +12,11 @@ dependencies { } // Only run tests for 7.9+, since the node.roles setting was introduced in 7.9.0 -for (Version bwcVersion : BuildParams.bwcVersions.wireCompatible.findAll { it.onOrAfter('7.9.0') }) { - if (bwcVersion == VersionProperties.getElasticsearchVersion()) { - // Not really a mixed cluster - continue; - } - - String bwcVersionString = bwcVersion.toString() - String baseName = "v" + bwcVersionString +BuildParams.bwcVersions.withWireCompatiple(v -> v.onOrAfter("7.9.0") && + v != VersionProperties.getElasticsearchVersion()) { bwcVersion, baseName -> def baseCluster = testClusters.register(baseName) { - versions = [bwcVersionString, project.version] + versions = [bwcVersion.toString(), project.version] numberOfNodes = 3 testDistribution = 'DEFAULT' setting 'xpack.security.enabled', 'false' diff --git a/x-pack/qa/rolling-upgrade-basic/build.gradle b/x-pack/qa/rolling-upgrade-basic/build.gradle index d02c652b4482a..fd1577052f871 100644 --- a/x-pack/qa/rolling-upgrade-basic/build.gradle +++ b/x-pack/qa/rolling-upgrade-basic/build.gradle @@ -1,4 +1,3 @@ -import org.elasticsearch.gradle.Version import org.elasticsearch.gradle.internal.info.BuildParams import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask @@ -10,13 +9,10 @@ dependencies { testImplementation project(':x-pack:qa') } -for (Version bwcVersion : BuildParams.bwcVersions.wireCompatible) { - String bwcVersionString = bwcVersion.toString() - String baseName = "v" + bwcVersionString - +BuildParams.bwcVersions.withWireCompatiple { bwcVersion, baseName -> def baseCluster = testClusters.register(baseName) { testDistribution = "DEFAULT" - versions = [bwcVersionString, project.version] + versions = [bwcVersion.toString(), project.version] numberOfNodes = 3 setting 'repositories.url.allowed_urls', 'http://snapshot.test*' @@ -35,7 +31,7 @@ for (Version bwcVersion : BuildParams.bwcVersions.wireCompatible) { nonInputProperties.systemProperty('tests.clustername', baseName) } - String oldVersion = bwcVersionString.replace('-SNAPSHOT', '') + String oldVersion = bwcVersion.toString().replace('-SNAPSHOT', '') tasks.register("${baseName}#oneThirdUpgradedTest", StandaloneRestIntegTestTask) { dependsOn "${baseName}#oldClusterTest" useCluster baseCluster diff --git a/x-pack/qa/rolling-upgrade-multi-cluster/build.gradle b/x-pack/qa/rolling-upgrade-multi-cluster/build.gradle index efddd145167e4..9cb9ab23b1c95 100644 --- a/x-pack/qa/rolling-upgrade-multi-cluster/build.gradle +++ b/x-pack/qa/rolling-upgrade-multi-cluster/build.gradle @@ -1,4 +1,3 @@ -import org.elasticsearch.gradle.Version import org.elasticsearch.gradle.internal.info.BuildParams import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask @@ -10,9 +9,7 @@ dependencies { testImplementation project(':x-pack:qa') } -for (Version bwcVersion : BuildParams.bwcVersions.wireCompatible) { - String bwcVersionString = bwcVersion.toString() - String baseName = "v" + bwcVersionString +BuildParams.bwcVersions.withWireCompatiple { bwcVersion, baseName -> def baseLeaderCluster = testClusters.register("${baseName}-leader") { numberOfNodes = 3 @@ -22,7 +19,7 @@ for (Version bwcVersion : BuildParams.bwcVersions.wireCompatible) { } testClusters.matching { it.name.startsWith("${baseName}-") }.configureEach { testDistribution = "DEFAULT" - versions = [bwcVersionString, project.version] + versions = [bwcVersion.toString(), project.version] setting 'repositories.url.allowed_urls', 'http://snapshot.test*' setting 'xpack.security.enabled', 'false' @@ -34,7 +31,7 @@ for (Version bwcVersion : BuildParams.bwcVersions.wireCompatible) { tasks.withType(StandaloneRestIntegTestTask).matching { it.name.startsWith("${baseName}#") }.configureEach { useCluster baseLeaderCluster useCluster baseFollowerCluster - systemProperty 'tests.upgrade_from_version', bwcVersionString.replace('-SNAPSHOT', '') + systemProperty 'tests.upgrade_from_version', bwcVersion.toString().replace('-SNAPSHOT', '') doFirst { def baseCluster = testClusters.named("${baseName}-${kindExt}").get() diff --git a/x-pack/qa/rolling-upgrade/build.gradle b/x-pack/qa/rolling-upgrade/build.gradle index 186e8042a0f09..0b47289f89d16 100644 --- a/x-pack/qa/rolling-upgrade/build.gradle +++ b/x-pack/qa/rolling-upgrade/build.gradle @@ -1,4 +1,4 @@ -import org.elasticsearch.gradle.Version +import org.elasticsearch.gradle.VersionProperties import org.elasticsearch.gradle.internal.info.BuildParams import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask @@ -30,16 +30,15 @@ tasks.register("copyTestNodeKeyMaterial", Copy) { into outputDir } -for (Version bwcVersion : BuildParams.bwcVersions.wireCompatible) { - String bwcVersionString = bwcVersion.toString() - String baseName = "v" + bwcVersionString +BuildParams.bwcVersions.withWireCompatiple { bwcVersion, baseName -> + String oldVersion = bwcVersion.toString() // SearchableSnapshotsRollingUpgradeIT uses a specific repository to not interfere with other tests String searchableSnapshotRepository = "${buildDir}/cluster/shared/searchable-snapshots-repo/${baseName}" def baseCluster = testClusters.register(baseName) { testDistribution = "DEFAULT" - versions = [bwcVersionString, project.version] + versions = [oldVersion, project.version] numberOfNodes = 3 setting 'repositories.url.allowed_urls', 'http://snapshot.test*' @@ -92,8 +91,6 @@ for (Version bwcVersion : BuildParams.bwcVersions.wireCompatible) { } } - String oldVersion = bwcVersionString - tasks.register("${baseName}#oldClusterTest", StandaloneRestIntegTestTask) { useCluster baseCluster mustRunAfter("precommit") From 430c430c034c1d37e889f6a72d811aeccb83df6b Mon Sep 17 00:00:00 2001 From: Armin Braun Date: Mon, 4 Oct 2021 22:39:52 +0200 Subject: [PATCH 142/250] Speed up Settings Filtering (#78632) Settings filtering can make use of the fact that we're working with a prefix tree in a number of cases. Also, we can avoid a lot of redundant empty settings instances here and there and have faster `exists` checks by using a hash-set instead of a tree-set even if there's no secure settings. --- .../common/settings/IndexScopedSettings.java | 3 - .../common/settings/Settings.java | 67 +++++++++++++++---- .../elasticsearch/index/IndexSettings.java | 6 +- .../settings/SettingsUpdaterTests.java | 4 +- .../common/settings/SettingsModuleTests.java | 18 +++-- .../common/settings/SettingsTests.java | 5 +- 6 files changed, 76 insertions(+), 27 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/common/settings/IndexScopedSettings.java b/server/src/main/java/org/elasticsearch/common/settings/IndexScopedSettings.java index 75cd526920222..d7c97a59b73ac 100644 --- a/server/src/main/java/org/elasticsearch/common/settings/IndexScopedSettings.java +++ b/server/src/main/java/org/elasticsearch/common/settings/IndexScopedSettings.java @@ -39,7 +39,6 @@ import java.util.HashSet; import java.util.Map; import java.util.Set; -import java.util.function.Predicate; /** * Encapsulates all valid index level settings. @@ -47,8 +46,6 @@ */ public final class IndexScopedSettings extends AbstractScopedSettings { - public static final Predicate INDEX_SETTINGS_KEY_PREDICATE = (s) -> s.startsWith(IndexMetadata.INDEX_SETTING_PREFIX); - private static final Set> ALWAYS_ENABLED_BUILT_IN_INDEX_SETTINGS = Set.of( MaxRetryAllocationDecider.SETTING_ALLOCATION_MAX_RETRY, MergeSchedulerConfig.AUTO_THROTTLE_SETTING, diff --git a/server/src/main/java/org/elasticsearch/common/settings/Settings.java b/server/src/main/java/org/elasticsearch/common/settings/Settings.java index 1a750d08e46c4..d18acf9d0d4f1 100644 --- a/server/src/main/java/org/elasticsearch/common/settings/Settings.java +++ b/server/src/main/java/org/elasticsearch/common/settings/Settings.java @@ -23,6 +23,7 @@ import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.common.unit.MemorySizeValue; +import org.elasticsearch.core.Nullable; import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.xcontent.DeprecationHandler; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; @@ -52,6 +53,7 @@ import java.util.List; import java.util.ListIterator; import java.util.Map; +import java.util.NavigableMap; import java.util.NoSuchElementException; import java.util.Objects; import java.util.Set; @@ -71,10 +73,10 @@ */ public final class Settings implements ToXContentFragment { - public static final Settings EMPTY = new Builder().build(); + public static final Settings EMPTY = new Settings(Map.of(), null); /** The raw settings from the full key to raw string value. */ - private final Map settings; + private final NavigableMap settings; /** The secure settings storage associated with these settings. */ private final SecureSettings secureSettings; @@ -88,9 +90,16 @@ public final class Settings implements ToXContentFragment { */ private Set keys; + private static Settings of(Map settings, SecureSettings secureSettings) { + if (secureSettings == null && settings.isEmpty()) { + return EMPTY; + } + return new Settings(settings, secureSettings); + } + private Settings(Map settings, SecureSettings secureSettings) { // we use a sorted map for consistent serialization when using getAsMap() - this.settings = Collections.unmodifiableSortedMap(new TreeMap<>(settings)); + this.settings = Collections.unmodifiableNavigableMap(new TreeMap<>(settings)); this.secureSettings = secureSettings; } @@ -198,15 +207,24 @@ private Object convertMapsToArrays(Map map) { * A settings that are filtered (and key is removed) with the specified prefix. */ public Settings getByPrefix(String prefix) { - return new Settings(new FilteredMap(this.settings, (k) -> k.startsWith(prefix), prefix), secureSettings == null ? null : - new PrefixedSecureSettings(secureSettings, prefix, s -> s.startsWith(prefix))); + if (prefix.isEmpty()) { + return this; + } + // create the the next prefix right after the given prefix, and use it as exclusive upper bound for the sub-map to filter by prefix + // below + char[] toPrefixCharArr = prefix.toCharArray(); + toPrefixCharArr[toPrefixCharArr.length - 1]++; + String toPrefix = new String(toPrefixCharArr); + final Map subMap = settings.subMap(prefix, toPrefix); + return Settings.of(subMap.isEmpty() ? Map.of() : new FilteredMap(subMap, null, prefix), + secureSettings == null ? null : new PrefixedSecureSettings(secureSettings, prefix, s -> s.startsWith(prefix))); } /** * Returns a new settings object that contains all setting of the current one filtered by the given settings key predicate. */ public Settings filter(Predicate predicate) { - return new Settings(new FilteredMap(this.settings, predicate, null), secureSettings == null ? null : + return Settings.of(new FilteredMap(this.settings, predicate, null), secureSettings == null ? null : new PrefixedSecureSettings(secureSettings, "", predicate)); } @@ -436,6 +454,9 @@ public Map getGroups(String settingPrefix, boolean ignoreNonGr private Map getGroupsInternal(String settingPrefix, boolean ignoreNonGrouped) throws SettingsException { Settings prefixSettings = getByPrefix(settingPrefix); + if (prefixSettings.isEmpty()) { + return Map.of(); + } Map groups = new HashMap<>(); for (String groupName : prefixSettings.names()) { Settings groupSettings = prefixSettings.getByPrefix(groupName + "."); @@ -523,8 +544,11 @@ public int hashCode() { } public static Settings readSettingsFromStream(StreamInput in) throws IOException { - Builder builder = new Builder(); int numberOfSettings = in.readVInt(); + if (numberOfSettings == 0) { + return EMPTY; + } + Builder builder = new Builder(); for (int i = 0; i < numberOfSettings; i++) { String key = in.readString(); Object value = in.readGenericValue(); @@ -689,12 +713,12 @@ public Set keySet() { } final Set newKeySet; if (secureSettings == null) { - newKeySet = settings.keySet(); + newKeySet = Set.copyOf(settings.keySet()); } else { // uniquify, since for legacy reasons the same setting name may exist in both final Set merged = new HashSet<>(settings.keySet()); merged.addAll(secureSettings.getSettingNames()); - newKeySet = Collections.unmodifiableSet(merged); + newKeySet = Set.copyOf(merged); } keys = newKeySet; return newKeySet; @@ -1182,19 +1206,25 @@ public Builder normalizePrefix(String prefix) { * set on this builder. */ public Settings build() { + final SecureSettings secSettings = secureSettings.get(); + if (secSettings == null && map.isEmpty()) { + return EMPTY; + } processLegacyLists(map); - return new Settings(map, secureSettings.get()); + return new Settings(map, secSettings); } } // TODO We could use an FST internally to make things even faster and more compact private static final class FilteredMap extends AbstractMap { private final Map delegate; + @Nullable private final Predicate filter; + @Nullable private final String prefix; // we cache that size since we have to iterate the entire set // this is safe to do since this map is only used with unmodifiable maps - private int size = -1; + private int size; @Override public Set> entrySet() { Set> delegateSet = delegate.entrySet(); @@ -1217,7 +1247,7 @@ public boolean hasNext() { return false; } while (iter.hasNext()) { - if (filter.test((currentElement = iter.next()).getKey())) { + if (test((currentElement = iter.next()).getKey())) { numIterated++; return true; } @@ -1271,24 +1301,33 @@ private FilteredMap(Map delegate, Predicate filter, Stri this.delegate = delegate; this.filter = filter; this.prefix = prefix; + if (filter == null) { + this.size = delegate.size(); + } else { + this.size = -1; + } } @Override public Object get(Object key) { if (key instanceof String) { final String theKey = prefix == null ? (String)key : prefix + key; - if (filter.test(theKey)) { + if (test(theKey)) { return delegate.get(theKey); } } return null; } + private boolean test(String theKey) { + return filter == null || filter.test(theKey); + } + @Override public boolean containsKey(Object key) { if (key instanceof String) { final String theKey = prefix == null ? (String) key : prefix + key; - if (filter.test(theKey)) { + if (test(theKey)) { return delegate.containsKey(theKey); } } diff --git a/server/src/main/java/org/elasticsearch/index/IndexSettings.java b/server/src/main/java/org/elasticsearch/index/IndexSettings.java index bd8f180368c7f..a91882ee2cca8 100644 --- a/server/src/main/java/org/elasticsearch/index/IndexSettings.java +++ b/server/src/main/java/org/elasticsearch/index/IndexSettings.java @@ -759,8 +759,10 @@ public synchronized boolean updateIndexMetadata(IndexMetadata indexMetadata) { * @return true if the settings are the same, otherwise false */ public static boolean same(final Settings left, final Settings right) { - return left.filter(IndexScopedSettings.INDEX_SETTINGS_KEY_PREDICATE) - .equals(right.filter(IndexScopedSettings.INDEX_SETTINGS_KEY_PREDICATE)); + if (left.equals(right)) { + return true; + } + return left.getByPrefix(IndexMetadata.INDEX_SETTING_PREFIX).equals(right.getByPrefix(IndexMetadata.INDEX_SETTING_PREFIX)); } /** diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/settings/SettingsUpdaterTests.java b/server/src/test/java/org/elasticsearch/action/admin/cluster/settings/SettingsUpdaterTests.java index 17eafb457fbb8..87d3558618f55 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/settings/SettingsUpdaterTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/cluster/settings/SettingsUpdaterTests.java @@ -29,6 +29,7 @@ import static java.util.Arrays.asList; import static org.elasticsearch.common.settings.AbstractScopedSettings.ARCHIVED_SETTINGS_PREFIX; +import static org.hamcrest.Matchers.either; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasItem; import static org.hamcrest.Matchers.not; @@ -603,7 +604,8 @@ public void testUpdateOfValidationDependentSettings() { Exception exception = expectThrows(IllegalArgumentException.class, () -> updater.updateSettings(finalCluster, Settings.builder().put(SETTING_FOO_HIGH.getKey(), 2).build(), Settings.EMPTY, logger)); - assertThat(exception.getMessage(), equalTo("[high]=2 is lower than [low]=5")); + assertThat(exception.getMessage(), + either(equalTo("[high]=2 is lower than [low]=5")).or(equalTo("[low]=5 is higher than [high]=2"))); } } diff --git a/server/src/test/java/org/elasticsearch/common/settings/SettingsModuleTests.java b/server/src/test/java/org/elasticsearch/common/settings/SettingsModuleTests.java index d56f4da1e9bd8..094f5940d8071 100644 --- a/server/src/test/java/org/elasticsearch/common/settings/SettingsModuleTests.java +++ b/server/src/test/java/org/elasticsearch/common/settings/SettingsModuleTests.java @@ -19,6 +19,7 @@ import static java.util.Collections.emptySet; import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.either; import static org.hamcrest.Matchers.hasToString; import static org.hamcrest.Matchers.is; @@ -30,11 +31,12 @@ public void testValidate() { SettingsModule module = new SettingsModule(settings); assertInstanceBinding(module, Settings.class, (s) -> s == settings); } + final String balanceSettingMessage = "Failed to parse value [[2.0]] for setting [cluster.routing.allocation.balance.shard]"; { Settings settings = Settings.builder().put("cluster.routing.allocation.balance.shard", "[2.0]").build(); IllegalArgumentException ex = expectThrows(IllegalArgumentException.class, () -> new SettingsModule(settings)); - assertEquals("Failed to parse value [[2.0]] for setting [cluster.routing.allocation.balance.shard]", ex.getMessage()); + assertEquals(balanceSettingMessage, ex.getMessage()); } { @@ -42,10 +44,16 @@ public void testValidate() { .put("some.foo.bar", 1).build(); IllegalArgumentException ex = expectThrows(IllegalArgumentException.class, () -> new SettingsModule(settings)); - assertEquals("Failed to parse value [[2.0]] for setting [cluster.routing.allocation.balance.shard]", ex.getMessage()); + final String unknownSettingMessage = + "unknown setting [some.foo.bar] please check that any required plugins are installed, or check the breaking " + + "changes documentation for removed settings"; assertEquals(1, ex.getSuppressed().length); - assertEquals("unknown setting [some.foo.bar] please check that any required plugins are installed, or check the breaking " + - "changes documentation for removed settings", ex.getSuppressed()[0].getMessage()); + if (ex.getMessage().equals(balanceSettingMessage)) { + assertEquals(unknownSettingMessage, ex.getSuppressed()[0].getMessage()); + } else { + assertEquals(unknownSettingMessage, ex.getMessage()); + assertEquals(balanceSettingMessage, ex.getSuppressed()[0].getMessage()); + } } { @@ -124,7 +132,7 @@ public void testLoggerSettings() { { Settings settings = Settings.builder().put("logger._root", "BOOM").put("logger.transport", "WOW").build(); IllegalArgumentException ex = expectThrows(IllegalArgumentException.class, () -> new SettingsModule(settings)); - assertEquals("Unknown level constant [BOOM].", ex.getMessage()); + assertThat(ex.getMessage(), either(is("Unknown level constant [BOOM].")).or(is("Unknown level constant [WOW]."))); } } diff --git a/server/src/test/java/org/elasticsearch/common/settings/SettingsTests.java b/server/src/test/java/org/elasticsearch/common/settings/SettingsTests.java index 9c22f120dee72..2e3364641f11e 100644 --- a/server/src/test/java/org/elasticsearch/common/settings/SettingsTests.java +++ b/server/src/test/java/org/elasticsearch/common/settings/SettingsTests.java @@ -34,6 +34,7 @@ import java.util.Map; import java.util.NoSuchElementException; import java.util.Set; +import java.util.TreeSet; import java.util.concurrent.TimeUnit; import static org.hamcrest.Matchers.contains; @@ -318,7 +319,7 @@ public void testFilteredMap() { assertEquals("ab2", filteredSettings.get("a.b.c")); assertEquals("ab3", filteredSettings.get("a.b.c.d")); - Iterator iterator = filteredSettings.keySet().iterator(); + Iterator iterator = new TreeSet<>(filteredSettings.keySet()).iterator(); for (int i = 0; i < 10; i++) { assertTrue(iterator.hasNext()); } @@ -364,7 +365,7 @@ public void testPrefixMap() { assertEquals("ab1", prefixMap.get("b")); assertEquals("ab2", prefixMap.get("b.c")); assertEquals("ab3", prefixMap.get("b.c.d")); - Iterator prefixIterator = prefixMap.keySet().iterator(); + Iterator prefixIterator = new TreeSet<>(prefixMap.keySet()).iterator(); for (int i = 0; i < 10; i++) { assertTrue(prefixIterator.hasNext()); } From 7d5b5aadf3441aadf62e1bccbea9549357aeefb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laurent=20Saint-F=C3=A9lix?= Date: Mon, 4 Oct 2021 23:17:06 +0200 Subject: [PATCH 143/250] Fix 'part' type for put_trained_model_definition_part API (#78449) https://github.com/elastic/elasticsearch/pull/76987 introduced this spec file but it seems the type for `Part` has slipped review. `Part` type should be `int` instead of `integer` according to [spec](https://github.com/elastic/elasticsearch/tree/main/rest-api-spec)! --- .../rest-api-spec/api/ml.put_trained_model_definition_part.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/ml.put_trained_model_definition_part.json b/rest-api-spec/src/main/resources/rest-api-spec/api/ml.put_trained_model_definition_part.json index 767bd2bd5b60f..87bebb39e3817 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/ml.put_trained_model_definition_part.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/ml.put_trained_model_definition_part.json @@ -23,7 +23,7 @@ "description":"The ID of the trained model for this definition part" }, "part":{ - "type":"integer", + "type":"int", "description":"The part number" } } From fd30c6daf86cbe0df2049c2b60580cbf90c448c4 Mon Sep 17 00:00:00 2001 From: James Rodewig <40268737+jrodewig@users.noreply.github.com> Date: Mon, 4 Oct 2021 17:42:42 -0400 Subject: [PATCH 144/250] Add reference to PHP client on Bulk API page (#78558) (#78651) Co-authored-by: James Rodewig <40268737+jrodewig@users.noreply.github.com> Co-authored-by: Christian Fratta --- docs/reference/docs/bulk.asciidoc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/reference/docs/bulk.asciidoc b/docs/reference/docs/bulk.asciidoc index 782c0896900f8..cb09ce068f219 100644 --- a/docs/reference/docs/bulk.asciidoc +++ b/docs/reference/docs/bulk.asciidoc @@ -142,6 +142,9 @@ JavaScript:: .NET:: See https://www.elastic.co/guide/en/elasticsearch/client/net-api/current/indexing-documents.html#bulkall-observable[`BulkAllObservable`] +PHP:: + See https://www.elastic.co/guide/en/elasticsearch/client/php-api/current/indexing_documents.html#_bulk_indexing[Bulk indexing] + [discrete] [[bulk-curl]] ===== Submitting bulk requests with cURL From 7ba84696c815108dd17e886c75ff52d0e3796022 Mon Sep 17 00:00:00 2001 From: Jack Conradson Date: Mon, 4 Oct 2021 14:50:57 -0700 Subject: [PATCH 145/250] Remove joda time from expressions (#78649) This change replaces joda time with java time moving from ReadableDateTime to ZonedDateTime in the expressions scripting module. --- .../script/expression/DateObject.java | 81 ++++++++++--------- .../expression/DateObjectValueSource.java | 16 ++-- 2 files changed, 51 insertions(+), 46 deletions(-) diff --git a/modules/lang-expression/src/main/java/org/elasticsearch/script/expression/DateObject.java b/modules/lang-expression/src/main/java/org/elasticsearch/script/expression/DateObject.java index ee88a6f59f782..78bbfd9dde167 100644 --- a/modules/lang-expression/src/main/java/org/elasticsearch/script/expression/DateObject.java +++ b/modules/lang-expression/src/main/java/org/elasticsearch/script/expression/DateObject.java @@ -9,9 +9,12 @@ */ import org.apache.lucene.search.DoubleValuesSource; +import org.elasticsearch.common.time.DateFormatters; import org.elasticsearch.index.fielddata.IndexFieldData; import org.elasticsearch.search.MultiValueMode; -import org.joda.time.ReadableDateTime; + +import java.time.ZonedDateTime; +import java.time.temporal.ChronoField; /** * Expressions API for date objects (.date) @@ -63,41 +66,43 @@ private DateObject() {} static DoubleValuesSource getVariable(IndexFieldData fieldData, String fieldName, String variable) { switch (variable) { case CENTURY_OF_ERA_VARIABLE: - return new DateObjectValueSource(fieldData, MultiValueMode.MIN, variable, ReadableDateTime::getCenturyOfEra); + return new DateObjectValueSource(fieldData, MultiValueMode.MIN, variable, zdt -> zdt.get(ChronoField.YEAR_OF_ERA) / 100); case DAY_OF_MONTH_VARIABLE: - return new DateObjectValueSource(fieldData, MultiValueMode.MIN, variable, ReadableDateTime::getDayOfMonth); + return new DateObjectValueSource(fieldData, MultiValueMode.MIN, variable, ZonedDateTime::getDayOfMonth); case DAY_OF_WEEK_VARIABLE: - return new DateObjectValueSource(fieldData, MultiValueMode.MIN, variable, ReadableDateTime::getDayOfWeek); + return new DateObjectValueSource(fieldData, MultiValueMode.MIN, variable, zdt -> zdt.getDayOfWeek().getValue()); case DAY_OF_YEAR_VARIABLE: - return new DateObjectValueSource(fieldData, MultiValueMode.MIN, variable, ReadableDateTime::getDayOfYear); + return new DateObjectValueSource(fieldData, MultiValueMode.MIN, variable, ZonedDateTime::getDayOfYear); case ERA_VARIABLE: - return new DateObjectValueSource(fieldData, MultiValueMode.MIN, variable, ReadableDateTime::getEra); + return new DateObjectValueSource(fieldData, MultiValueMode.MIN, variable, zdt -> zdt.get(ChronoField.ERA)); case HOUR_OF_DAY_VARIABLE: - return new DateObjectValueSource(fieldData, MultiValueMode.MIN, variable, ReadableDateTime::getHourOfDay); + return new DateObjectValueSource(fieldData, MultiValueMode.MIN, variable, ZonedDateTime::getHour); case MILLIS_OF_DAY_VARIABLE: - return new DateObjectValueSource(fieldData, MultiValueMode.MIN, variable, ReadableDateTime::getMillisOfDay); + return new DateObjectValueSource(fieldData, MultiValueMode.MIN, variable, zdt -> zdt.get(ChronoField.MILLI_OF_DAY)); case MILLIS_OF_SECOND_VARIABLE: - return new DateObjectValueSource(fieldData, MultiValueMode.MIN, variable, ReadableDateTime::getMillisOfSecond); + return new DateObjectValueSource(fieldData, MultiValueMode.MIN, variable, zdt -> zdt.get(ChronoField.MILLI_OF_SECOND)); case MINUTE_OF_DAY_VARIABLE: - return new DateObjectValueSource(fieldData, MultiValueMode.MIN, variable, ReadableDateTime::getMinuteOfDay); + return new DateObjectValueSource(fieldData, MultiValueMode.MIN, variable, zdt -> zdt.get(ChronoField.MINUTE_OF_DAY)); case MINUTE_OF_HOUR_VARIABLE: - return new DateObjectValueSource(fieldData, MultiValueMode.MIN, variable, ReadableDateTime::getMinuteOfHour); + return new DateObjectValueSource(fieldData, MultiValueMode.MIN, variable, ZonedDateTime::getMinute); case MONTH_OF_YEAR_VARIABLE: - return new DateObjectValueSource(fieldData, MultiValueMode.MIN, variable, ReadableDateTime::getMonthOfYear); + return new DateObjectValueSource(fieldData, MultiValueMode.MIN, variable, ZonedDateTime::getMonthValue); case SECOND_OF_DAY_VARIABLE: - return new DateObjectValueSource(fieldData, MultiValueMode.MIN, variable, ReadableDateTime::getSecondOfDay); + return new DateObjectValueSource(fieldData, MultiValueMode.MIN, variable, zdt -> zdt.get(ChronoField.SECOND_OF_DAY)); case SECOND_OF_MINUTE_VARIABLE: - return new DateObjectValueSource(fieldData, MultiValueMode.MIN, variable, ReadableDateTime::getSecondOfMinute); + return new DateObjectValueSource(fieldData, MultiValueMode.MIN, variable, ZonedDateTime::getSecond); case WEEK_OF_WEEK_YEAR_VARIABLE: - return new DateObjectValueSource(fieldData, MultiValueMode.MIN, variable, ReadableDateTime::getWeekOfWeekyear); + return new DateObjectValueSource(fieldData, MultiValueMode.MIN, variable, + zdt -> zdt.get(DateFormatters.WEEK_FIELDS_ROOT.weekOfWeekBasedYear())); case WEEK_YEAR_VARIABLE: - return new DateObjectValueSource(fieldData, MultiValueMode.MIN, variable, ReadableDateTime::getWeekyear); + return new DateObjectValueSource(fieldData, MultiValueMode.MIN, variable, + zdt -> zdt.get(DateFormatters.WEEK_FIELDS_ROOT.weekBasedYear())); case YEAR_VARIABLE: - return new DateObjectValueSource(fieldData, MultiValueMode.MIN, variable, ReadableDateTime::getYear); + return new DateObjectValueSource(fieldData, MultiValueMode.MIN, variable, ZonedDateTime::getYear); case YEAR_OF_CENTURY_VARIABLE: - return new DateObjectValueSource(fieldData, MultiValueMode.MIN, variable, ReadableDateTime::getYearOfCentury); + return new DateObjectValueSource(fieldData, MultiValueMode.MIN, variable, zdt -> zdt.get(ChronoField.YEAR_OF_ERA) % 100); case YEAR_OF_ERA_VARIABLE: - return new DateObjectValueSource(fieldData, MultiValueMode.MIN, variable, ReadableDateTime::getYearOfEra); + return new DateObjectValueSource(fieldData, MultiValueMode.MIN, variable, zdt -> zdt.get(ChronoField.YEAR_OF_ERA)); default: throw new IllegalArgumentException("Member variable [" + variable + "] does not exist for date object on field [" + fieldName + "]."); @@ -107,41 +112,43 @@ static DoubleValuesSource getVariable(IndexFieldData fieldData, String fieldN static DoubleValuesSource getMethod(IndexFieldData fieldData, String fieldName, String method) { switch (method) { case GETCENTURY_OF_ERA_METHOD: - return new DateObjectValueSource(fieldData, MultiValueMode.MIN, method, ReadableDateTime::getCenturyOfEra); + return new DateObjectValueSource(fieldData, MultiValueMode.MIN, method, zdt -> zdt.get(ChronoField.YEAR_OF_ERA) / 100); case GETDAY_OF_MONTH_METHOD: - return new DateObjectValueSource(fieldData, MultiValueMode.MIN, method, ReadableDateTime::getDayOfMonth); + return new DateObjectValueSource(fieldData, MultiValueMode.MIN, method, ZonedDateTime::getDayOfMonth); case GETDAY_OF_WEEK_METHOD: - return new DateObjectValueSource(fieldData, MultiValueMode.MIN, method, ReadableDateTime::getDayOfWeek); + return new DateObjectValueSource(fieldData, MultiValueMode.MIN, method, zdt -> zdt.getDayOfWeek().getValue()); case GETDAY_OF_YEAR_METHOD: - return new DateObjectValueSource(fieldData, MultiValueMode.MIN, method, ReadableDateTime::getDayOfYear); + return new DateObjectValueSource(fieldData, MultiValueMode.MIN, method, ZonedDateTime::getDayOfYear); case GETERA_METHOD: - return new DateObjectValueSource(fieldData, MultiValueMode.MIN, method, ReadableDateTime::getEra); + return new DateObjectValueSource(fieldData, MultiValueMode.MIN, method, zdt -> zdt.get(ChronoField.ERA)); case GETHOUR_OF_DAY_METHOD: - return new DateObjectValueSource(fieldData, MultiValueMode.MIN, method, ReadableDateTime::getHourOfDay); + return new DateObjectValueSource(fieldData, MultiValueMode.MIN, method, ZonedDateTime::getHour); case GETMILLIS_OF_DAY_METHOD: - return new DateObjectValueSource(fieldData, MultiValueMode.MIN, method, ReadableDateTime::getMillisOfDay); + return new DateObjectValueSource(fieldData, MultiValueMode.MIN, method, zdt -> zdt.get(ChronoField.MILLI_OF_DAY)); case GETMILLIS_OF_SECOND_METHOD: - return new DateObjectValueSource(fieldData, MultiValueMode.MIN, method, ReadableDateTime::getMillisOfSecond); + return new DateObjectValueSource(fieldData, MultiValueMode.MIN, method, zdt -> zdt.get(ChronoField.MILLI_OF_SECOND)); case GETMINUTE_OF_DAY_METHOD: - return new DateObjectValueSource(fieldData, MultiValueMode.MIN, method, ReadableDateTime::getMinuteOfDay); + return new DateObjectValueSource(fieldData, MultiValueMode.MIN, method, zdt -> zdt.get(ChronoField.MINUTE_OF_DAY)); case GETMINUTE_OF_HOUR_METHOD: - return new DateObjectValueSource(fieldData, MultiValueMode.MIN, method, ReadableDateTime::getMinuteOfHour); + return new DateObjectValueSource(fieldData, MultiValueMode.MIN, method, ZonedDateTime::getMinute); case GETMONTH_OF_YEAR_METHOD: - return new DateObjectValueSource(fieldData, MultiValueMode.MIN, method, ReadableDateTime::getMonthOfYear); + return new DateObjectValueSource(fieldData, MultiValueMode.MIN, method, ZonedDateTime::getMonthValue); case GETSECOND_OF_DAY_METHOD: - return new DateObjectValueSource(fieldData, MultiValueMode.MIN, method, ReadableDateTime::getSecondOfDay); + return new DateObjectValueSource(fieldData, MultiValueMode.MIN, method, zdt -> zdt.get(ChronoField.SECOND_OF_DAY)); case GETSECOND_OF_MINUTE_METHOD: - return new DateObjectValueSource(fieldData, MultiValueMode.MIN, method, ReadableDateTime::getSecondOfMinute); + return new DateObjectValueSource(fieldData, MultiValueMode.MIN, method, ZonedDateTime::getSecond); case GETWEEK_OF_WEEK_YEAR_METHOD: - return new DateObjectValueSource(fieldData, MultiValueMode.MIN, method, ReadableDateTime::getWeekOfWeekyear); + return new DateObjectValueSource(fieldData, MultiValueMode.MIN, method, + zdt -> zdt.get(DateFormatters.WEEK_FIELDS_ROOT.weekOfWeekBasedYear())); case GETWEEK_YEAR_METHOD: - return new DateObjectValueSource(fieldData, MultiValueMode.MIN, method, ReadableDateTime::getWeekyear); + return new DateObjectValueSource(fieldData, MultiValueMode.MIN, method, + zdt -> zdt.get(DateFormatters.WEEK_FIELDS_ROOT.weekBasedYear())); case GETYEAR_METHOD: - return new DateObjectValueSource(fieldData, MultiValueMode.MIN, method, ReadableDateTime::getYear); + return new DateObjectValueSource(fieldData, MultiValueMode.MIN, method, ZonedDateTime::getYear); case GETYEAR_OF_CENTURY_METHOD: - return new DateObjectValueSource(fieldData, MultiValueMode.MIN, method, ReadableDateTime::getYearOfCentury); + return new DateObjectValueSource(fieldData, MultiValueMode.MIN, method, zdt -> zdt.get(ChronoField.YEAR_OF_ERA) % 100); case GETYEAR_OF_ERA_METHOD: - return new DateObjectValueSource(fieldData, MultiValueMode.MIN, method, ReadableDateTime::getYearOfEra); + return new DateObjectValueSource(fieldData, MultiValueMode.MIN, method, zdt -> zdt.get(ChronoField.YEAR_OF_ERA)); default: throw new IllegalArgumentException("Member method [" + method + "] does not exist for date object on field [" + fieldName + "]."); diff --git a/modules/lang-expression/src/main/java/org/elasticsearch/script/expression/DateObjectValueSource.java b/modules/lang-expression/src/main/java/org/elasticsearch/script/expression/DateObjectValueSource.java index 9e1f167ea8489..f45aa005ffc96 100644 --- a/modules/lang-expression/src/main/java/org/elasticsearch/script/expression/DateObjectValueSource.java +++ b/modules/lang-expression/src/main/java/org/elasticsearch/script/expression/DateObjectValueSource.java @@ -10,15 +10,15 @@ import org.apache.lucene.index.LeafReaderContext; import org.apache.lucene.search.DoubleValues; -import org.elasticsearch.index.fielddata.LeafNumericFieldData; import org.elasticsearch.index.fielddata.IndexFieldData; +import org.elasticsearch.index.fielddata.LeafNumericFieldData; import org.elasticsearch.index.fielddata.NumericDoubleValues; import org.elasticsearch.search.MultiValueMode; -import org.joda.time.DateTimeZone; -import org.joda.time.MutableDateTime; -import org.joda.time.ReadableDateTime; import java.io.IOException; +import java.time.Instant; +import java.time.ZoneOffset; +import java.time.ZonedDateTime; import java.util.Objects; import java.util.function.ToIntFunction; @@ -26,10 +26,10 @@ class DateObjectValueSource extends FieldDataValueSource { final String methodName; - final ToIntFunction function; + final ToIntFunction function; DateObjectValueSource(IndexFieldData indexFieldData, MultiValueMode multiValueMode, - String methodName, ToIntFunction function) { + String methodName, ToIntFunction function) { super(indexFieldData, multiValueMode); Objects.requireNonNull(methodName); @@ -41,13 +41,11 @@ class DateObjectValueSource extends FieldDataValueSource { @Override public DoubleValues getValues(LeafReaderContext leaf, DoubleValues scores) { LeafNumericFieldData leafData = (LeafNumericFieldData) fieldData.load(leaf); - MutableDateTime joda = new MutableDateTime(0, DateTimeZone.UTC); NumericDoubleValues docValues = multiValueMode.select(leafData.getDoubleValues()); return new DoubleValues() { @Override public double doubleValue() throws IOException { - joda.setMillis((long)docValues.doubleValue()); - return function.applyAsInt(joda); + return function.applyAsInt(ZonedDateTime.ofInstant(Instant.ofEpochMilli((long)docValues.doubleValue()), ZoneOffset.UTC)); } @Override From 9ce1a29c2eee48c9d69b1186f7d5263b0c3fa35c Mon Sep 17 00:00:00 2001 From: Julie Tibshirani Date: Mon, 4 Oct 2021 17:11:46 -0700 Subject: [PATCH 146/250] Extend `dense_vector` to support indexing vectors (#78491) This PR extends the `dense_vector` type to allow vectors to be added to an ANN index: ``` "mappings": { "properties": { "my_vector": { "type": "dense_vector", "dims": 128, "index": true, "similarity": "l2_norm" } } } ``` A description of the parameters: * `index`. Setting this to `true` indicates the field should be added to the ANN index. The values will be parsed as a `KnnVectorField` instead of a doc values field. By default `index: false` to provide a smooth transition from 7.x, where vectors are not indexed. * `similarity`. When `index: true`, it's required to specify what similarity to use when indexing the vectors. Right now the accepted values are `l2_norm` and `dot_product`, which matches the Lucene options. (We decided to require `similarity` to be set since there's no default choice that works in general, and it's easy to overlook and accidentally get poor results.) Indexed vectors still support the same functionality as vectors based on doc values -- they work with vector script functions and `exists` queries. Relates to #78473. --- .../index/store/LuceneFilesExtensions.java | 5 +- .../test/vectors/10_dense_vector_basic.yml | 50 ++++++- .../vectors/20_dense_vector_special_cases.yml | 82 ++++++++--- .../vectors/30_dense_vector_script_access.yml | 68 +++++++++ .../mapper/DenseVectorFieldMapper.java | 129 ++++++++++++----- .../vectors/mapper/VectorEncoderDecoder.java | 5 +- .../BinaryDenseVectorScriptDocValues.java | 100 +++++++++++++ .../query/DenseVectorScriptDocValues.java | 105 +++++++------- .../query/KnnDenseVectorScriptDocValues.java | 98 +++++++++++++ .../query/KnnVectorFieldExistsQuery.java | 77 ++++++++++ .../xpack/vectors/query/ScoreScriptUtils.java | 49 ++----- .../vectors/query/VectorDVLeafFieldData.java | 17 ++- .../vectors/query/VectorIndexFieldData.java | 13 +- .../mapper/DenseVectorFieldMapperTests.java | 132 ++++++++++++++++-- .../mapper/DenseVectorFieldTypeTests.java | 31 ++-- ...inaryDenseVectorScriptDocValuesTests.java} | 119 +++++++++++----- .../query/DenseVectorFunctionTests.java | 109 ++++----------- .../KnnDenseVectorScriptDocValuesTests.java | 121 ++++++++++++++++ 18 files changed, 1004 insertions(+), 306 deletions(-) create mode 100644 x-pack/plugin/vectors/src/main/java/org/elasticsearch/xpack/vectors/query/BinaryDenseVectorScriptDocValues.java create mode 100644 x-pack/plugin/vectors/src/main/java/org/elasticsearch/xpack/vectors/query/KnnDenseVectorScriptDocValues.java create mode 100644 x-pack/plugin/vectors/src/main/java/org/elasticsearch/xpack/vectors/query/KnnVectorFieldExistsQuery.java rename x-pack/plugin/vectors/src/test/java/org/elasticsearch/xpack/vectors/query/{DenseVectorScriptDocValuesTests.java => BinaryDenseVectorScriptDocValuesTests.java} (58%) create mode 100644 x-pack/plugin/vectors/src/test/java/org/elasticsearch/xpack/vectors/query/KnnDenseVectorScriptDocValuesTests.java diff --git a/server/src/main/java/org/elasticsearch/index/store/LuceneFilesExtensions.java b/server/src/main/java/org/elasticsearch/index/store/LuceneFilesExtensions.java index 332bc08ad7eb6..f3ae4ae2d85b4 100644 --- a/server/src/main/java/org/elasticsearch/index/store/LuceneFilesExtensions.java +++ b/server/src/main/java/org/elasticsearch/index/store/LuceneFilesExtensions.java @@ -68,9 +68,10 @@ public enum LuceneFilesExtensions { TVF("tvf", "Term Vector Fields", false, false), TVM("tvm", "Term Vector Metadata", true, false), TVX("tvx", "Term Vector Index", false, false), + // kNN vectors format VEC("vec", "Vector Data", false, false), - // Lucene 9.0 indexed vectors metadata - VEM("vem","Vector Metadata", true, false); + VEX("vex", "Vector Index", false, false), + VEM("vem", "Vector Metadata", true, false); /** * Allow plugin developers of custom codecs to opt out of the assertion in {@link #fromExtension} diff --git a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/vectors/10_dense_vector_basic.yml b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/vectors/10_dense_vector_basic.yml index a0a06c5d8b0c5..6b7d547f7e36e 100644 --- a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/vectors/10_dense_vector_basic.yml +++ b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/vectors/10_dense_vector_basic.yml @@ -12,29 +12,37 @@ setup: number_of_replicas: 0 mappings: properties: - my_dense_vector: + vector: type: dense_vector dims: 5 + indexed_vector: + type: dense_vector + dims: 5 + index: true + similarity: dot_product - do: index: index: test-index id: 1 body: - my_dense_vector: [230.0, 300.33, -34.8988, 15.555, -200.0] + vector: [230.0, 300.33, -34.8988, 15.555, -200.0] + indexed_vector: [230.0, 300.33, -34.8988, 15.555, -200.0] - do: index: index: test-index id: 2 body: - my_dense_vector: [-0.5, 100.0, -13, 14.8, -156.0] + vector: [-0.5, 100.0, -13, 14.8, -156.0] + indexed_vector: [-0.5, 100.0, -13, 14.8, -156.0] - do: index: index: test-index id: 3 body: - my_dense_vector: [0.5, 111.3, -13.0, 14.8, -156.0] + vector: [0.5, 111.3, -13.0, 14.8, -156.0] + indexed_vector: [0.5, 111.3, -13.0, 14.8, -156.0] - do: indices.refresh: {} @@ -51,7 +59,7 @@ setup: script_score: query: {match_all: {} } script: - source: "dotProduct(params.query_vector, 'my_dense_vector')" + source: "dotProduct(params.query_vector, 'vector')" params: query_vector: [0.5, 111.3, -13.0, 14.8, -156.0] @@ -81,7 +89,37 @@ setup: script_score: query: {match_all: {} } script: - source: "cosineSimilarity(params.query_vector, 'my_dense_vector')" + source: "cosineSimilarity(params.query_vector, 'vector')" + params: + query_vector: [0.5, 111.3, -13.0, 14.8, -156.0] + + - match: {hits.total: 3} + + - match: {hits.hits.0._id: "3"} + - gte: {hits.hits.0._score: 0.999} + - lte: {hits.hits.0._score: 1.001} + + - match: {hits.hits.1._id: "2"} + - gte: {hits.hits.1._score: 0.998} + - lte: {hits.hits.1._score: 1.0} + + - match: {hits.hits.2._id: "1"} + - gte: {hits.hits.2._score: 0.78} + - lte: {hits.hits.2._score: 0.791} + +--- +"Cosine similarity with indexed vector": + - do: + headers: + Content-Type: application/json + search: + rest_total_hits_as_int: true + body: + query: + script_score: + query: {match_all: {} } + script: + source: "cosineSimilarity(params.query_vector, 'indexed_vector')" params: query_vector: [0.5, 111.3, -13.0, 14.8, -156.0] diff --git a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/vectors/20_dense_vector_special_cases.yml b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/vectors/20_dense_vector_special_cases.yml index 23748b1f14619..cd0eab261e734 100644 --- a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/vectors/20_dense_vector_special_cases.yml +++ b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/vectors/20_dense_vector_special_cases.yml @@ -2,7 +2,7 @@ setup: - skip: features: headers version: " - 7.3.99" - reason: "dense_vector functions check on empty values was added from 7.4" + reason: "vector functions check on empty values was added from 7.4" - do: indices.create: @@ -13,10 +13,14 @@ setup: number_of_shards: 1 mappings: properties: - my_dense_vector: - type: dense_vector - dims: 3 - + vector: + type: dense_vector + dims: 3 + indexed_vector: + type: dense_vector + dims: 3 + index: true + similarity: l2_norm --- "Indexing of Dense vectors should error when dims don't match defined in the mapping": @@ -27,7 +31,16 @@ setup: index: test-index id: 1 body: - my_dense_vector: [10, 2] + vector: [10, 2] + - match: { error.type: "mapper_parsing_exception" } + + - do: + catch: bad_request + index: + index: test-index + id: 1 + body: + indexed_vector: [10, 2] - match: { error.type: "mapper_parsing_exception" } --- @@ -37,14 +50,14 @@ setup: index: test-index id: 1 body: - my_dense_vector: [10, 10, 10] + vector: [10, 10, 10] - do: index: index: test-index id: 2 body: - my_dense_vector: [10.5, 10.9, 10.4] + vector: [10.5, 10.9, 10.4] - do: indices.refresh: {} @@ -61,7 +74,7 @@ setup: script_score: query: {match_all: {} } script: - source: "cosineSimilarity(params.query_vector, 'my_dense_vector')" + source: "cosineSimilarity(params.query_vector, 'vector')" params: query_vector: [10, 10, 10] @@ -81,7 +94,7 @@ setup: script_score: query: {match_all: {} } script: - source: "cosineSimilarity(params.query_vector, 'my_dense_vector')" + source: "cosineSimilarity(params.query_vector, 'vector')" params: query_vector: [10.0, 10.0, 10.0] @@ -97,7 +110,7 @@ setup: index: test-index id: 1 body: - my_dense_vector: [1, 2, 3] + vector: [1, 2, 3] - do: indices.refresh: {} @@ -112,7 +125,7 @@ setup: script_score: query: {match_all: {} } script: - source: "cosineSimilarity(params.query_vector, 'my_dense_vector')" + source: "cosineSimilarity(params.query_vector, 'vector')" params: query_vector: [1, 2, 3, 4] - match: { error.root_cause.0.type: "script_exception" } @@ -127,7 +140,7 @@ setup: script_score: query: {match_all: {} } script: - source: "dotProduct(params.query_vector, 'my_dense_vector')" + source: "dotProduct(params.query_vector, 'vector')" params: query_vector: [1, 2, 3, 4] - match: { error.root_cause.0.type: "script_exception" } @@ -139,7 +152,7 @@ setup: index: test-index id: 1 body: - my_dense_vector: [10, 10, 10] + vector: [10, 10, 10] - do: index: @@ -164,7 +177,24 @@ setup: script_score: query: {match_all: {} } script: - source: "cosineSimilarity(params.query_vector, 'my_dense_vector')" + source: "cosineSimilarity(params.query_vector, 'vector')" + params: + query_vector: [10.0, 10.0, 10.0] +- match: { error.root_cause.0.type: "script_exception" } + +- do: + catch: bad_request + headers: + Content-Type: application/json + search: + rest_total_hits_as_int: true + index: test-index + body: + query: + script_score: + query: {match_all: {} } + script: + source: "cosineSimilarity(params.query_vector, 'indexed_vector')" params: query_vector: [10.0, 10.0, 10.0] - match: { error.root_cause.0.type: "script_exception" } @@ -181,7 +211,27 @@ setup: script_score: query: {match_all: {} } script: - source: "doc['my_dense_vector'].size() == 0 ? 0 : cosineSimilarity(params.query_vector, 'my_dense_vector')" + source: "doc['vector'].size() == 0 ? 0 : cosineSimilarity(params.query_vector, 'vector')" + params: + query_vector: [10.0, 10.0, 10.0] + +- match: {hits.total: 2} +- match: {hits.hits.0._id: "1"} +- match: {hits.hits.1._id: "2"} +- match: {hits.hits.1._score: 0.0} + +- do: + headers: + Content-Type: application/json + search: + rest_total_hits_as_int: true + index: test-index + body: + query: + script_score: + query: {match_all: {} } + script: + source: "doc['indexed_vector'].size() == 0 ? 0 : cosineSimilarity(params.query_vector, 'indexed_vector')" params: query_vector: [10.0, 10.0, 10.0] diff --git a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/vectors/30_dense_vector_script_access.yml b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/vectors/30_dense_vector_script_access.yml index ef670b004507f..28682e77a6eca 100644 --- a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/vectors/30_dense_vector_script_access.yml +++ b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/vectors/30_dense_vector_script_access.yml @@ -63,3 +63,71 @@ - match: { hits.hits.1._score: 1 } - match: { hits.hits.2._id: "1" } - match: { hits.hits.2._score: 0 } + +--- +"Access to values of indexed dense_vector in script": + - skip: + version: " - 7.12.99" + reason: "Access to values of dense_vector in script was added in 7.13" + - do: + indices.create: + index: test-index + body: + mappings: + properties: + v: + type: dense_vector + dims: 3 + index: true + similarity: dot_product + + - do: + bulk: + index: test-index + refresh: true + body: + - '{"index": {"_id": "1"}}' + - '{"v": [1, 1, 1]}' + - '{"index": {"_id": "2"}}' + - '{"v": [1, 1, 2]}' + - '{"index": {"_id": "3"}}' + - '{"v": [1, 1, 3]}' + - '{"index": {"_id": "missing_vector"}}' + - '{}' + + # vector functions in loop – return the index of the closest parameter vector based on cosine similarity + - do: + search: + body: + query: + script_score: + query: { "exists": { "field": "v" } } + script: + source: | + float[] v = doc['v'].vectorValue; + float vm = doc['v'].magnitude; + + int closestPv = 0; + float maxCosSim = -1; + for (int i = 0; i < params.pvs.length; i++) { + float dotProduct = 0; + for (int j = 0; j < v.length; j++) { + dotProduct += v[j] * params.pvs[i][j]; + } + float cosSim = dotProduct / (vm * (float) params.pvs_magnts[i]); + if (maxCosSim < cosSim) { + maxCosSim = cosSim; + closestPv = i; + } + } + closestPv; + params: + pvs: [ [ 1, 1, 1 ], [ 1, 1, 2 ], [ 1, 1, 3 ] ] + pvs_magnts: [1.7320, 2.4495, 3.3166] + + - match: { hits.hits.0._id: "3" } + - match: { hits.hits.0._score: 2 } + - match: { hits.hits.1._id: "2" } + - match: { hits.hits.1._score: 1 } + - match: { hits.hits.2._id: "1" } + - match: { hits.hits.2._score: 0 } diff --git a/x-pack/plugin/vectors/src/main/java/org/elasticsearch/xpack/vectors/mapper/DenseVectorFieldMapper.java b/x-pack/plugin/vectors/src/main/java/org/elasticsearch/xpack/vectors/mapper/DenseVectorFieldMapper.java index c45d7a574d0fb..383a6c9697365 100644 --- a/x-pack/plugin/vectors/src/main/java/org/elasticsearch/xpack/vectors/mapper/DenseVectorFieldMapper.java +++ b/x-pack/plugin/vectors/src/main/java/org/elasticsearch/xpack/vectors/mapper/DenseVectorFieldMapper.java @@ -9,6 +9,10 @@ package org.elasticsearch.xpack.vectors.mapper; import org.apache.lucene.document.BinaryDocValuesField; +import org.apache.lucene.document.Field; +import org.apache.lucene.document.KnnVectorField; +import org.apache.lucene.index.VectorSimilarityFunction; +import org.apache.lucene.search.DocValuesFieldExistsQuery; import org.apache.lucene.search.Query; import org.apache.lucene.util.BytesRef; import org.elasticsearch.Version; @@ -21,12 +25,14 @@ import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.mapper.MapperBuilderContext; import org.elasticsearch.index.mapper.MapperParsingException; +import org.elasticsearch.index.mapper.SimpleMappedFieldType; import org.elasticsearch.index.mapper.TextSearchInfo; import org.elasticsearch.index.mapper.ValueFetcher; import org.elasticsearch.index.query.SearchExecutionContext; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.support.CoreValuesSourceType; import org.elasticsearch.search.lookup.SearchLookup; +import org.elasticsearch.xpack.vectors.query.KnnVectorFieldExistsQuery; import org.elasticsearch.xpack.vectors.query.VectorIndexFieldData; import java.io.IOException; @@ -52,8 +58,7 @@ private static DenseVectorFieldMapper toType(FieldMapper in) { } public static class Builder extends FieldMapper.Builder { - - Parameter dims + private final Parameter dims = new Parameter<>("dims", false, () -> null, (n, c, o) -> XContentMapValues.nodeIntegerValue(o), m -> toType(m).dims) .addValidator(dims -> { if (dims == null) { @@ -64,49 +69,68 @@ public static class Builder extends FieldMapper.Builder { "] should be in the range [1, " + MAX_DIMS_COUNT + "] but was [" + dims + "]"); } }); - Parameter> meta = Parameter.metaParam(); + + private final Parameter indexed = Parameter.indexParam(m -> toType(m).indexed, false); + private final Parameter similarity = Parameter.enumParam( + "similarity", false, m -> toType(m).similarity, null, VectorSimilarity.class); + private final Parameter> meta = Parameter.metaParam(); final Version indexVersionCreated; public Builder(String name, Version indexVersionCreated) { super(name); this.indexVersionCreated = indexVersionCreated; + + this.indexed.requiresParameters(similarity); + this.similarity.setSerializerCheck((id, ic, v) -> v != null); + this.similarity.requiresParameters(indexed); } @Override protected List> getParameters() { - return List.of(dims, meta); + return List.of(dims, indexed, similarity, meta); } @Override public DenseVectorFieldMapper build(MapperBuilderContext context) { return new DenseVectorFieldMapper( name, - new DenseVectorFieldType(context.buildFullName(name), indexVersionCreated, dims.getValue(), meta.getValue()), + new DenseVectorFieldType(context.buildFullName(name), indexVersionCreated, + dims.getValue(), indexed.getValue(), meta.getValue()), dims.getValue(), + indexed.getValue(), + similarity.getValue(), indexVersionCreated, multiFieldsBuilder.build(this, context), copyTo.build()); } } + enum VectorSimilarity { + l2_norm(VectorSimilarityFunction.EUCLIDEAN), + dot_product(VectorSimilarityFunction.DOT_PRODUCT); + + public final VectorSimilarityFunction function; + VectorSimilarity(VectorSimilarityFunction function) { + this.function = function; + } + } + public static final TypeParser PARSER = new TypeParser((n, c) -> new Builder(n, c.indexVersionCreated()), notInMultiFields(CONTENT_TYPE)); - public static final class DenseVectorFieldType extends MappedFieldType { + public static final class DenseVectorFieldType extends SimpleMappedFieldType { private final int dims; + private final boolean indexed; private final Version indexVersionCreated; - public DenseVectorFieldType(String name, Version indexVersionCreated, int dims, Map meta) { - super(name, false, false, true, TextSearchInfo.NONE, meta); + public DenseVectorFieldType(String name, Version indexVersionCreated, int dims, boolean indexed, Map meta) { + super(name, indexed, false, indexed == false, TextSearchInfo.NONE, meta); this.dims = dims; + this.indexed = indexed; this.indexVersionCreated = indexVersionCreated; } - int dims() { - return dims; - } - @Override public String typeName() { return CONTENT_TYPE; @@ -138,7 +162,17 @@ public boolean isAggregatable() { @Override public IndexFieldData.Builder fielddataBuilder(String fullyQualifiedIndexName, Supplier searchLookup) { - return new VectorIndexFieldData.Builder(name(), CoreValuesSourceType.KEYWORD, indexVersionCreated, dims); + return new VectorIndexFieldData.Builder(name(), CoreValuesSourceType.KEYWORD, indexVersionCreated, dims, indexed); + } + + @Override + public Query existsQuery(SearchExecutionContext context) { + if (indexed) { + return new KnnVectorFieldExistsQuery(name()); + } else { + assert hasDocValues(); + return new DocValuesFieldExistsQuery(name()); + } } @Override @@ -148,14 +182,19 @@ public Query termQuery(Object value, SearchExecutionContext context) { } } - private final Version indexCreatedVersion; private final int dims; + private final boolean indexed; + private final VectorSimilarity similarity; + private final Version indexCreatedVersion; private DenseVectorFieldMapper(String simpleName, MappedFieldType mappedFieldType, int dims, + boolean indexed, VectorSimilarity similarity, Version indexCreatedVersion, MultiFields multiFields, CopyTo copyTo) { super(simpleName, mappedFieldType, multiFields, copyTo); - this.indexCreatedVersion = indexCreatedVersion; this.dims = dims; + this.indexed = indexed; + this.similarity = similarity; + this.indexCreatedVersion = indexCreatedVersion; } @Override @@ -170,8 +209,30 @@ public boolean parsesArrayValue() { @Override public void parse(DocumentParserContext context) throws IOException { - int dims = fieldType().dims(); //number of vector dimensions + if (context.doc().getByKey(fieldType().name()) != null) { + throw new IllegalArgumentException("Field [" + name() + "] of type [" + typeName() + + "] doesn't not support indexing multiple values for the same field in the same document"); + } + Field field = fieldType().indexed + ? parseKnnVector(context) + : parseBinaryDocValuesVector(context); + context.doc().addWithKey(fieldType().name(), field); + } + + private Field parseKnnVector(DocumentParserContext context) throws IOException { + float[] vector = new float[dims]; + int index = 0; + for (Token token = context.parser().nextToken(); token != Token.END_ARRAY; token = context.parser().nextToken()) { + checkDimensionExceeded(index, context); + ensureExpectedToken(Token.VALUE_NUMBER, token, context.parser()); + vector[index++] = context.parser().floatValue(true); + } + checkDimensionMatches(index, context); + return new KnnVectorField(fieldType().name(), vector, similarity.function); + } + + private Field parseBinaryDocValuesVector(DocumentParserContext context) throws IOException { // encode array of floats as array of integers and store into buf // this code is here and not int the VectorEncoderDecoder so not to create extra arrays byte[] bytes = indexCreatedVersion.onOrAfter(Version.V_7_5_0) ? new byte[dims * INT_BYTES + INT_BYTES] : new byte[dims * INT_BYTES]; @@ -179,35 +240,39 @@ public void parse(DocumentParserContext context) throws IOException { ByteBuffer byteBuffer = ByteBuffer.wrap(bytes); double dotProduct = 0f; - int dim = 0; + int index = 0; for (Token token = context.parser().nextToken(); token != Token.END_ARRAY; token = context.parser().nextToken()) { - if (dim++ >= dims) { - throw new IllegalArgumentException("Field [" + name() + "] of type [" + typeName() + "] of doc [" + - context.sourceToParse().id() + "] has exceeded the number of dimensions [" + dims + "] defined in mapping"); - } + checkDimensionExceeded(index, context); ensureExpectedToken(Token.VALUE_NUMBER, token, context.parser()); float value = context.parser().floatValue(true); - byteBuffer.putFloat(value); dotProduct += value * value; + index++; } - if (dim != dims) { - throw new IllegalArgumentException("Field [" + name() + "] of type [" + typeName() + "] of doc [" + - context.sourceToParse().id() + "] has number of dimensions [" + dim + - "] less than defined in the mapping [" + dims +"]"); - } + checkDimensionMatches(index, context); if (indexCreatedVersion.onOrAfter(Version.V_7_5_0)) { // encode vector magnitude at the end float vectorMagnitude = (float) Math.sqrt(dotProduct); byteBuffer.putFloat(vectorMagnitude); } - BinaryDocValuesField field = new BinaryDocValuesField(fieldType().name(), new BytesRef(bytes)); - if (context.doc().getByKey(fieldType().name()) != null) { - throw new IllegalArgumentException("Field [" + name() + "] of type [" + typeName() + - "] doesn't not support indexing multiple values for the same field in the same document"); + return new BinaryDocValuesField(fieldType().name(), new BytesRef(bytes)); + } + + private void checkDimensionExceeded(int index, DocumentParserContext context) { + if (index >= dims) { + throw new IllegalArgumentException("The [" + typeName() + "] field [" + name() + + "] in doc [" + context.sourceToParse().id() + "] has more dimensions " + + "than defined in the mapping [" + dims + "]"); + } + } + + private void checkDimensionMatches(int index, DocumentParserContext context) { + if (index != dims) { + throw new IllegalArgumentException("The [" + typeName() + "] field [" + name() + + "] in doc [" + context.sourceToParse().id() + "] has a different number of dimensions " + + "[" + index + "] than defined in the mapping [" + dims + "]"); } - context.doc().addWithKey(fieldType().name(), field); } @Override diff --git a/x-pack/plugin/vectors/src/main/java/org/elasticsearch/xpack/vectors/mapper/VectorEncoderDecoder.java b/x-pack/plugin/vectors/src/main/java/org/elasticsearch/xpack/vectors/mapper/VectorEncoderDecoder.java index 56bd68ad08cb0..fde298f7881f0 100644 --- a/x-pack/plugin/vectors/src/main/java/org/elasticsearch/xpack/vectors/mapper/VectorEncoderDecoder.java +++ b/x-pack/plugin/vectors/src/main/java/org/elasticsearch/xpack/vectors/mapper/VectorEncoderDecoder.java @@ -10,6 +10,7 @@ import org.apache.lucene.util.BytesRef; import org.elasticsearch.Version; +import org.elasticsearch.xpack.vectors.query.DenseVectorScriptDocValues; import java.nio.ByteBuffer; @@ -53,7 +54,7 @@ private static float calculateMagnitude(Version indexVersion, BytesRef vectorBR) public static float getMagnitude(Version indexVersion, BytesRef vectorBR) { if (vectorBR == null) { - throw new IllegalArgumentException("A document doesn't have a value for a vector field!"); + throw new IllegalArgumentException(DenseVectorScriptDocValues.MISSING_VECTOR_FIELD_MESSAGE); } if (indexVersion.onOrAfter(Version.V_7_5_0)) { return decodeMagnitude(indexVersion, vectorBR); @@ -69,7 +70,7 @@ public static float getMagnitude(Version indexVersion, BytesRef vectorBR) { */ public static void decodeDenseVector(BytesRef vectorBR, float[] vector) { if (vectorBR == null) { - throw new IllegalArgumentException("A document doesn't have a value for a vector field!"); + throw new IllegalArgumentException(DenseVectorScriptDocValues.MISSING_VECTOR_FIELD_MESSAGE); } ByteBuffer byteBuffer = ByteBuffer.wrap(vectorBR.bytes, vectorBR.offset, vectorBR.length); for (int dim = 0; dim < vector.length; dim++) { diff --git a/x-pack/plugin/vectors/src/main/java/org/elasticsearch/xpack/vectors/query/BinaryDenseVectorScriptDocValues.java b/x-pack/plugin/vectors/src/main/java/org/elasticsearch/xpack/vectors/query/BinaryDenseVectorScriptDocValues.java new file mode 100644 index 0000000000000..2b24ccdfd01fc --- /dev/null +++ b/x-pack/plugin/vectors/src/main/java/org/elasticsearch/xpack/vectors/query/BinaryDenseVectorScriptDocValues.java @@ -0,0 +1,100 @@ +/* + * 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.vectors.query; + +import org.apache.lucene.index.BinaryDocValues; +import org.apache.lucene.util.BytesRef; +import org.elasticsearch.Version; +import org.elasticsearch.xpack.vectors.mapper.VectorEncoderDecoder; + +import java.io.IOException; +import java.nio.ByteBuffer; + +public class BinaryDenseVectorScriptDocValues extends DenseVectorScriptDocValues { + + private final BinaryDocValues in; + private final Version indexVersion; + private final float[] vector; + private BytesRef value; + + BinaryDenseVectorScriptDocValues(BinaryDocValues in, Version indexVersion, int dims) { + super(dims); + this.in = in; + this.indexVersion = indexVersion; + this.vector = new float[dims]; + } + + @Override + public void setNextDocId(int docId) throws IOException { + if (in.advanceExact(docId)) { + value = in.binaryValue(); + } else { + value = null; + } + } + + + @Override + public float[] getVectorValue() { + VectorEncoderDecoder.decodeDenseVector(value, vector); + return vector; + } + + @Override + public float getMagnitude() { + return VectorEncoderDecoder.getMagnitude(indexVersion, value); + } + + @Override + public int size() { + if (value == null) { + return 0; + } else { + return 1; + } + } + + @Override + public BytesRef getNonPrimitiveValue() { + return value; + } + + @Override + public double dotProduct(float[] queryVector) { + ByteBuffer byteBuffer = ByteBuffer.wrap(value.bytes, value.offset, value.length); + + double dotProduct = 0; + for (float queryValue : queryVector) { + dotProduct += queryValue * byteBuffer.getFloat(); + } + return (float) dotProduct; + } + + @Override + public double l1Norm(float[] queryVector) { + ByteBuffer byteBuffer = ByteBuffer.wrap(value.bytes, value.offset, value.length); + + double l1norm = 0; + for (float queryValue : queryVector) { + l1norm += Math.abs(queryValue - byteBuffer.getFloat()); + } + return l1norm; + } + + @Override + public double l2Norm(float[] queryVector) { + ByteBuffer byteBuffer = ByteBuffer.wrap(value.bytes, value.offset, value.length); + double l2norm = 0; + for (float queryValue : queryVector) { + double diff = queryValue - byteBuffer.getFloat(); + l2norm += diff * diff; + } + return Math.sqrt(l2norm); + } +} diff --git a/x-pack/plugin/vectors/src/main/java/org/elasticsearch/xpack/vectors/query/DenseVectorScriptDocValues.java b/x-pack/plugin/vectors/src/main/java/org/elasticsearch/xpack/vectors/query/DenseVectorScriptDocValues.java index f9f8b2edb654f..62d97cf71ae84 100644 --- a/x-pack/plugin/vectors/src/main/java/org/elasticsearch/xpack/vectors/query/DenseVectorScriptDocValues.java +++ b/x-pack/plugin/vectors/src/main/java/org/elasticsearch/xpack/vectors/query/DenseVectorScriptDocValues.java @@ -8,87 +8,84 @@ package org.elasticsearch.xpack.vectors.query; -import org.apache.lucene.index.BinaryDocValues; import org.apache.lucene.util.BytesRef; -import org.elasticsearch.Version; import org.elasticsearch.index.fielddata.ScriptDocValues; import org.elasticsearch.script.field.Field; -import org.elasticsearch.xpack.vectors.mapper.VectorEncoderDecoder; -import java.io.IOException; +public abstract class DenseVectorScriptDocValues extends ScriptDocValues { + public static final String MISSING_VECTOR_FIELD_MESSAGE = "A document doesn't have a value for a vector field!"; -public class DenseVectorScriptDocValues extends ScriptDocValues { - - private final BinaryDocValues in; - private final Version indexVersion; private final int dims; - private final float[] vector; - private BytesRef value; - - DenseVectorScriptDocValues(BinaryDocValues in, Version indexVersion, int dims) { - this.in = in; - this.indexVersion = indexVersion; + public DenseVectorScriptDocValues(int dims) { this.dims = dims; - this.vector = new float[dims]; - } - - @Override - public void setNextDocId(int docId) throws IOException { - if (in.advanceExact(docId)) { - value = in.binaryValue(); - } else { - value = null; - } } - // package private access only for {@link ScoreScriptUtils} - BytesRef getEncodedValue() { - return value; - } - - // package private access only for {@link ScoreScriptUtils} - int dims() { + public int dims() { return dims; } - @Override - public BytesRef get(int index) { - throw new UnsupportedOperationException("accessing a vector field's value through 'get' or 'value' is not supported!" + - "Use 'vectorValue' or 'magnitude' instead!'"); - } - /** * Get dense vector's value as an array of floats */ - public float[] getVectorValue() { - VectorEncoderDecoder.decodeDenseVector(value, vector); - return vector; - } + public abstract float[] getVectorValue(); /** * Get dense vector's magnitude */ - public float getMagnitude() { - return VectorEncoderDecoder.getMagnitude(indexVersion, value); - } + public abstract float getMagnitude(); - @Override - public int size() { - if (value == null) { - return 0; - } else { - return 1; - } - } + public abstract double dotProduct(float[] queryVector); + public abstract double l1Norm(float[] queryVector); + public abstract double l2Norm(float[] queryVector); @Override - public BytesRef getNonPrimitiveValue() { - return value; + public BytesRef get(int index) { + throw new UnsupportedOperationException("accessing a vector field's value through 'get' or 'value' is not supported!" + + "Use 'vectorValue' or 'magnitude' instead!'"); } @Override public Field toField(String fieldName) { throw new IllegalStateException("not implemented"); } + + public static DenseVectorScriptDocValues empty(int dims) { + return new DenseVectorScriptDocValues(dims) { + @Override + public float[] getVectorValue() { + throw new IllegalArgumentException(MISSING_VECTOR_FIELD_MESSAGE); + } + + @Override + public float getMagnitude() { + throw new IllegalArgumentException(MISSING_VECTOR_FIELD_MESSAGE); + } + + @Override + public double dotProduct(float[] queryVector) { + throw new IllegalArgumentException(MISSING_VECTOR_FIELD_MESSAGE); + } + + @Override + public double l1Norm(float[] queryVector) { + throw new IllegalArgumentException(MISSING_VECTOR_FIELD_MESSAGE); + } + + @Override + public double l2Norm(float[] queryVector) { + throw new IllegalArgumentException(MISSING_VECTOR_FIELD_MESSAGE); + } + + @Override + public void setNextDocId(int docId) { + // do nothing + } + + @Override + public int size() { + return 0; + } + }; + } } diff --git a/x-pack/plugin/vectors/src/main/java/org/elasticsearch/xpack/vectors/query/KnnDenseVectorScriptDocValues.java b/x-pack/plugin/vectors/src/main/java/org/elasticsearch/xpack/vectors/query/KnnDenseVectorScriptDocValues.java new file mode 100644 index 0000000000000..d7dbb055b5039 --- /dev/null +++ b/x-pack/plugin/vectors/src/main/java/org/elasticsearch/xpack/vectors/query/KnnDenseVectorScriptDocValues.java @@ -0,0 +1,98 @@ +/* + * 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.vectors.query; + +import org.apache.lucene.index.VectorValues; +import org.apache.lucene.util.VectorUtil; + +import java.io.IOException; +import java.util.Arrays; + +import static org.apache.lucene.search.DocIdSetIterator.NO_MORE_DOCS; + +public class KnnDenseVectorScriptDocValues extends DenseVectorScriptDocValues { + private final VectorValues in; + private float[] vector; + + KnnDenseVectorScriptDocValues(VectorValues in, int dims) { + super(dims); + this.in = in; + } + + @Override + public void setNextDocId(int docId) throws IOException { + int currentDoc = in.docID(); + if (currentDoc == NO_MORE_DOCS || docId < currentDoc) { + vector = null; + } else if (docId == currentDoc) { + vector = in.vectorValue(); + } else { + currentDoc = in.advance(docId); + if (currentDoc == docId) { + vector = in.vectorValue(); + } else { + vector = null; + } + } + } + + private float[] getVectorChecked() { + if (vector == null) { + throw new IllegalArgumentException(MISSING_VECTOR_FIELD_MESSAGE); + } + return vector; + } + + @Override + public float[] getVectorValue() { + float[] vector = getVectorChecked(); + // we need to copy the value, since {@link VectorValues} can reuse + // the underlying array across documents + return Arrays.copyOf(vector, vector.length); + } + + @Override + public float getMagnitude() { + float[] vector = getVectorChecked(); + double magnitude = 0.0f; + for (float elem : vector) { + magnitude += elem * elem; + } + return (float) Math.sqrt(magnitude); + } + + @Override + public double dotProduct(float[] queryVector) { + return VectorUtil.dotProduct(getVectorChecked(), queryVector); + } + + @Override + public double l1Norm(float[] queryVector) { + float[] vectorValue = getVectorChecked(); + double result = 0.0; + for (int i = 0; i < queryVector.length; i++) { + result += Math.abs(vectorValue[i] - queryVector[i]); + } + return result; + } + + @Override + public double l2Norm(float[] queryVector) { + return Math.sqrt(VectorUtil.squareDistance(getVectorValue(), queryVector)); + } + + @Override + public int size() { + if (vector == null) { + return 0; + } else { + return 1; + } + } +} diff --git a/x-pack/plugin/vectors/src/main/java/org/elasticsearch/xpack/vectors/query/KnnVectorFieldExistsQuery.java b/x-pack/plugin/vectors/src/main/java/org/elasticsearch/xpack/vectors/query/KnnVectorFieldExistsQuery.java new file mode 100644 index 0000000000000..3b273bf106ae9 --- /dev/null +++ b/x-pack/plugin/vectors/src/main/java/org/elasticsearch/xpack/vectors/query/KnnVectorFieldExistsQuery.java @@ -0,0 +1,77 @@ +/* + * 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.vectors.query; + +import org.apache.lucene.index.LeafReaderContext; +import org.apache.lucene.search.ConstantScoreScorer; +import org.apache.lucene.search.ConstantScoreWeight; +import org.apache.lucene.search.DocIdSetIterator; +import org.apache.lucene.search.IndexSearcher; +import org.apache.lucene.search.Query; +import org.apache.lucene.search.QueryVisitor; +import org.apache.lucene.search.ScoreMode; +import org.apache.lucene.search.Scorer; +import org.apache.lucene.search.Weight; + +import java.io.IOException; +import java.util.Objects; + +public class KnnVectorFieldExistsQuery extends Query { + + private final String field; + + /** Create a query that will match documents which have a value for the given {@code field}. */ + public KnnVectorFieldExistsQuery(String field) { + this.field = Objects.requireNonNull(field); + } + + public String getField() { + return field; + } + + @Override + public boolean equals(Object other) { + return sameClassAs(other) && field.equals(((KnnVectorFieldExistsQuery) other).field); + } + + @Override + public int hashCode() { + return 31 * classHash() + field.hashCode(); + } + + @Override + public String toString(String field) { + return "KnnVectorFieldExistsQuery [field=" + this.field + "]"; + } + + @Override + public void visit(QueryVisitor visitor) { + if (visitor.acceptField(field)) { + visitor.visitLeaf(this); + } + } + + @Override + public Weight createWeight(IndexSearcher searcher, ScoreMode scoreMode, float boost) { + return new ConstantScoreWeight(this, boost) { + @Override + public Scorer scorer(LeafReaderContext context) throws IOException { + DocIdSetIterator iterator = context.reader().getVectorValues(field); + if (iterator == null) { + return null; + } + return new ConstantScoreScorer(this, score(), scoreMode, iterator); + } + + @Override + public boolean isCacheable(LeafReaderContext ctx) { + return true; + } + }; + } +} diff --git a/x-pack/plugin/vectors/src/main/java/org/elasticsearch/xpack/vectors/query/ScoreScriptUtils.java b/x-pack/plugin/vectors/src/main/java/org/elasticsearch/xpack/vectors/query/ScoreScriptUtils.java index a917d7ddf52cc..82d7cd5362503 100644 --- a/x-pack/plugin/vectors/src/main/java/org/elasticsearch/xpack/vectors/query/ScoreScriptUtils.java +++ b/x-pack/plugin/vectors/src/main/java/org/elasticsearch/xpack/vectors/query/ScoreScriptUtils.java @@ -8,12 +8,10 @@ package org.elasticsearch.xpack.vectors.query; -import org.apache.lucene.util.BytesRef; import org.elasticsearch.ExceptionsHelper; import org.elasticsearch.script.ScoreScript; import java.io.IOException; -import java.nio.ByteBuffer; import java.util.List; public class ScoreScriptUtils { @@ -64,17 +62,15 @@ public DenseVectorFunction(ScoreScript scoreScript, } } - BytesRef getEncodedVector() { + void setNextVector() { try { docValues.setNextDocId(scoreScript._getDocId()); } catch (IOException e) { throw ExceptionsHelper.convertToElastic(e); } - BytesRef vector = docValues.getEncodedValue(); - if (vector == null) { + if (docValues.size() == 0) { throw new IllegalArgumentException("A document doesn't have a value for a vector field!"); } - return vector; } } @@ -86,15 +82,8 @@ public L1Norm(ScoreScript scoreScript, List queryVector, String field) { } public double l1norm() { - BytesRef vector = getEncodedVector(); - ByteBuffer byteBuffer = ByteBuffer.wrap(vector.bytes, vector.offset, vector.length); - - double l1norm = 0; - - for (float queryValue : queryVector) { - l1norm += Math.abs(queryValue - byteBuffer.getFloat()); - } - return l1norm; + setNextVector(); + return docValues.l1Norm(queryVector); } } @@ -106,15 +95,8 @@ public L2Norm(ScoreScript scoreScript, List queryVector, String field) { } public double l2norm() { - BytesRef vector = getEncodedVector(); - ByteBuffer byteBuffer = ByteBuffer.wrap(vector.bytes, vector.offset, vector.length); - - double l2norm = 0; - for (float queryValue : queryVector) { - double diff = queryValue - byteBuffer.getFloat(); - l2norm += diff * diff; - } - return Math.sqrt(l2norm); + setNextVector(); + return docValues.l2Norm(queryVector); } } @@ -126,14 +108,8 @@ public DotProduct(ScoreScript scoreScript, List queryVector, String fiel } public double dotProduct() { - BytesRef vector = getEncodedVector(); - ByteBuffer byteBuffer = ByteBuffer.wrap(vector.bytes, vector.offset, vector.length); - - double dotProduct = 0; - for (float queryValue : queryVector) { - dotProduct += queryValue * byteBuffer.getFloat(); - } - return dotProduct; + setNextVector(); + return docValues.dotProduct(queryVector); } } @@ -145,13 +121,8 @@ public CosineSimilarity(ScoreScript scoreScript, List queryVector, Strin } public double cosineSimilarity() { - BytesRef vector = getEncodedVector(); - ByteBuffer byteBuffer = ByteBuffer.wrap(vector.bytes, vector.offset, vector.length); - double dotProduct = 0.0; - for (float queryValue : queryVector) { - dotProduct += queryValue * byteBuffer.getFloat(); - } - return dotProduct / docValues.getMagnitude(); + setNextVector(); + return docValues.dotProduct(queryVector) / docValues.getMagnitude(); } } } diff --git a/x-pack/plugin/vectors/src/main/java/org/elasticsearch/xpack/vectors/query/VectorDVLeafFieldData.java b/x-pack/plugin/vectors/src/main/java/org/elasticsearch/xpack/vectors/query/VectorDVLeafFieldData.java index 080f5a10b750c..02cd0f5585968 100644 --- a/x-pack/plugin/vectors/src/main/java/org/elasticsearch/xpack/vectors/query/VectorDVLeafFieldData.java +++ b/x-pack/plugin/vectors/src/main/java/org/elasticsearch/xpack/vectors/query/VectorDVLeafFieldData.java @@ -11,6 +11,7 @@ import org.apache.lucene.index.BinaryDocValues; import org.apache.lucene.index.DocValues; import org.apache.lucene.index.LeafReader; +import org.apache.lucene.index.VectorValues; import org.apache.lucene.util.Accountable; import org.apache.lucene.util.BytesRef; import org.elasticsearch.Version; @@ -28,12 +29,14 @@ final class VectorDVLeafFieldData implements LeafFieldData { private final String field; private final Version indexVersion; private final int dims; + private final boolean indexed; - VectorDVLeafFieldData(LeafReader reader, String field, Version indexVersion, int dims) { + VectorDVLeafFieldData(LeafReader reader, String field, Version indexVersion, int dims, boolean indexed) { this.reader = reader; this.field = field; this.indexVersion = indexVersion; this.dims = dims; + this.indexed = indexed; } @Override @@ -54,8 +57,16 @@ public SortedBinaryDocValues getBytesValues() { @Override public ScriptDocValues getScriptValues() { try { - final BinaryDocValues values = DocValues.getBinary(reader, field); - return new DenseVectorScriptDocValues(values, indexVersion, dims); + if (indexed) { + VectorValues values = reader.getVectorValues(field); + if (values == null || values == VectorValues.EMPTY) { + return DenseVectorScriptDocValues.empty(dims); + } + return new KnnDenseVectorScriptDocValues(values, dims); + } else { + BinaryDocValues values = DocValues.getBinary(reader, field); + return new BinaryDenseVectorScriptDocValues(values, indexVersion, dims); + } } catch (IOException e) { throw new IllegalStateException("Cannot load doc values for vector field!", e); } diff --git a/x-pack/plugin/vectors/src/main/java/org/elasticsearch/xpack/vectors/query/VectorIndexFieldData.java b/x-pack/plugin/vectors/src/main/java/org/elasticsearch/xpack/vectors/query/VectorIndexFieldData.java index bb972c7af58f1..10f9b96254129 100644 --- a/x-pack/plugin/vectors/src/main/java/org/elasticsearch/xpack/vectors/query/VectorIndexFieldData.java +++ b/x-pack/plugin/vectors/src/main/java/org/elasticsearch/xpack/vectors/query/VectorIndexFieldData.java @@ -31,12 +31,14 @@ public class VectorIndexFieldData implements IndexFieldData build(IndexFieldDataCache cache, CircuitBreakerService breakerService) { - return new VectorIndexFieldData(name, valuesSourceType, indexVersion, dims); + return new VectorIndexFieldData(name, valuesSourceType, indexVersion, dims, indexed); } - } } diff --git a/x-pack/plugin/vectors/src/test/java/org/elasticsearch/xpack/vectors/mapper/DenseVectorFieldMapperTests.java b/x-pack/plugin/vectors/src/test/java/org/elasticsearch/xpack/vectors/mapper/DenseVectorFieldMapperTests.java index ec9a284b37202..c77621e414125 100644 --- a/x-pack/plugin/vectors/src/test/java/org/elasticsearch/xpack/vectors/mapper/DenseVectorFieldMapperTests.java +++ b/x-pack/plugin/vectors/src/test/java/org/elasticsearch/xpack/vectors/mapper/DenseVectorFieldMapperTests.java @@ -7,21 +7,31 @@ package org.elasticsearch.xpack.vectors.mapper; +import com.carrotsearch.randomizedtesting.generators.RandomPicks; + import org.apache.lucene.document.BinaryDocValuesField; +import org.apache.lucene.document.KnnVectorField; import org.apache.lucene.index.IndexableField; +import org.apache.lucene.search.DocValuesFieldExistsQuery; +import org.apache.lucene.search.Query; import org.apache.lucene.util.BytesRef; import org.elasticsearch.Version; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.index.mapper.DocumentMapper; +import org.elasticsearch.index.mapper.LuceneDocument; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.mapper.MapperParsingException; import org.elasticsearch.index.mapper.MapperTestCase; import org.elasticsearch.index.mapper.ParsedDocument; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.xpack.vectors.Vectors; +import org.elasticsearch.xpack.vectors.mapper.DenseVectorFieldMapper.DenseVectorFieldType; +import org.elasticsearch.xpack.vectors.mapper.DenseVectorFieldMapper.VectorSimilarity; +import org.elasticsearch.xpack.vectors.query.KnnVectorFieldExistsQuery; import java.io.IOException; import java.nio.ByteBuffer; +import java.util.Arrays; import java.util.Collection; import java.util.List; @@ -30,6 +40,11 @@ import static org.hamcrest.Matchers.instanceOf; public class DenseVectorFieldMapperTests extends MapperTestCase { + private final boolean indexed; + + public DenseVectorFieldMapperTests() { + this.indexed = randomBoolean(); + } @Override protected Collection getPlugins() { @@ -39,6 +54,9 @@ protected Collection getPlugins() { @Override protected void minimalMapping(XContentBuilder b) throws IOException { b.field("type", "dense_vector").field("dims", 4); + if (indexed) { + b.field("index", true).field("similarity", "dot_product"); + } } @Override @@ -51,6 +69,23 @@ protected void registerParameters(ParameterChecker checker) throws IOException { checker.registerConflictCheck("dims", fieldMapping(b -> b.field("type", "dense_vector").field("dims", 4)), fieldMapping(b -> b.field("type", "dense_vector").field("dims", 5))); + checker.registerConflictCheck("similarity", + fieldMapping(b -> b.field("type", "dense_vector") + .field("dims", 4) + .field("index", true) + .field("similarity", "dot_product")), + fieldMapping(b -> b.field("type", "dense_vector") + .field("dims", 4) + .field("index", true) + .field("similarity", "l2_norm"))); + checker.registerConflictCheck("index", + fieldMapping(b -> b.field("type", "dense_vector") + .field("dims", 4) + .field("index", true) + .field("similarity", "dot_product")), + fieldMapping(b -> b.field("type", "dense_vector") + .field("dims", 4) + .field("index", false))); } @Override @@ -58,6 +93,26 @@ protected boolean supportsStoredFields() { return false; } + @Override + protected void assertSearchable(MappedFieldType fieldType) { + assertThat(fieldType, instanceOf(DenseVectorFieldType.class)); + assertEquals(fieldType.isSearchable(), indexed); + } + + protected void assertExistsQuery(MappedFieldType fieldType, Query query, LuceneDocument fields) { + if (indexed) { + assertThat(query, instanceOf(KnnVectorFieldExistsQuery.class)); + KnnVectorFieldExistsQuery existsQuery = (KnnVectorFieldExistsQuery) query; + assertEquals("field", existsQuery.getField()); + } else { + assertThat(query, instanceOf(DocValuesFieldExistsQuery.class)); + DocValuesFieldExistsQuery existsQuery = (DocValuesFieldExistsQuery) query; + assertEquals("field", existsQuery.getField()); + assertDocValuesField(fields, "field"); + } + assertNoFieldNamesField(fields); + } + public void testDims() { { Exception e = expectThrows(MapperParsingException.class, () -> createMapperService(fieldMapping(b -> { @@ -110,6 +165,46 @@ public void testDefaults() throws Exception { ); } + public void testIndexedVector() throws Exception { + VectorSimilarity similarity = RandomPicks.randomFrom(random(), VectorSimilarity.values()); + DocumentMapper mapper = createDocumentMapper(fieldMapping(b -> b + .field("type", "dense_vector") + .field("dims", 3) + .field("index", true) + .field("similarity", similarity.name()))); + + float[] vector = {-12.1f, 100.7f, -4}; + ParsedDocument doc1 = mapper.parse(source(b -> b.array("field", vector))); + + IndexableField[] fields = doc1.rootDoc().getFields("field"); + assertEquals(1, fields.length); + assertThat(fields[0], instanceOf(KnnVectorField.class)); + + KnnVectorField vectorField = (KnnVectorField) fields[0]; + assertArrayEquals( + "Parsed vector is not equal to original.", + vector, + vectorField.vectorValue(), + 0.001f); + assertEquals(similarity.function, vectorField.fieldType().vectorSimilarityFunction()); + } + + public void testInvalidParameters() { + MapperParsingException e = expectThrows(MapperParsingException.class, + () -> createDocumentMapper(fieldMapping(b -> b + .field("type", "dense_vector") + .field("dims", 3) + .field("index", true)))); + assertThat(e.getMessage(), containsString("Field [index] requires field [similarity] to be configured")); + + e = expectThrows(MapperParsingException.class, + () -> createDocumentMapper(fieldMapping(b -> b + .field("type", "dense_vector") + .field("dims", 3) + .field("similarity", "l2_norm")))); + assertThat(e.getMessage(), containsString("Field [similarity] requires field [index] to be configured")); + } + public void testAddDocumentsToIndexBefore_V_7_5_0() throws Exception { Version indexVersion = Version.V_7_4_0; DocumentMapper mapper @@ -143,21 +238,32 @@ private static float[] decodeDenseVector(Version indexVersion, BytesRef encodedV } public void testDocumentsWithIncorrectDims() throws Exception { + for (boolean index : Arrays.asList(false, true)) { + int dims = 3; + XContentBuilder fieldMapping = fieldMapping(b -> { + b.field("type", "dense_vector"); + b.field("dims", dims); + b.field("index", index); + if (index) { + b.field("similarity", "dot_product"); + } + }); - int dims = 3; - DocumentMapper mapper = createDocumentMapper(fieldMapping(b -> b.field("type", "dense_vector").field("dims", dims))); + DocumentMapper mapper = createDocumentMapper(fieldMapping); - // test that error is thrown when a document has number of dims more than defined in the mapping - float[] invalidVector = new float[dims + 1]; - MapperParsingException e = expectThrows(MapperParsingException.class, - () -> mapper.parse(source(b -> b.array("field", invalidVector)))); - assertThat(e.getCause().getMessage(), containsString("has exceeded the number of dimensions [3] defined in mapping")); - - // test that error is thrown when a document has number of dims less than defined in the mapping - float[] invalidVector2 = new float[dims - 1]; - MapperParsingException e2 = expectThrows(MapperParsingException.class, - () -> mapper.parse(source(b -> b.array("field", invalidVector2)))); - assertThat(e2.getCause().getMessage(), containsString("has number of dimensions [2] less than defined in the mapping [3]")); + // test that error is thrown when a document has number of dims more than defined in the mapping + float[] invalidVector = new float[dims + 1]; + MapperParsingException e = expectThrows(MapperParsingException.class, + () -> mapper.parse(source(b -> b.array("field", invalidVector)))); + assertThat(e.getCause().getMessage(), containsString("has more dimensions than defined in the mapping [3]")); + + // test that error is thrown when a document has number of dims less than defined in the mapping + float[] invalidVector2 = new float[dims - 1]; + MapperParsingException e2 = expectThrows(MapperParsingException.class, + () -> mapper.parse(source(b -> b.array("field", invalidVector2)))); + assertThat(e2.getCause().getMessage(), + containsString("has a different number of dimensions [2] than defined in the mapping [3]")); + } } @Override diff --git a/x-pack/plugin/vectors/src/test/java/org/elasticsearch/xpack/vectors/mapper/DenseVectorFieldTypeTests.java b/x-pack/plugin/vectors/src/test/java/org/elasticsearch/xpack/vectors/mapper/DenseVectorFieldTypeTests.java index bc1e3557ee559..17d55e3ac311a 100644 --- a/x-pack/plugin/vectors/src/test/java/org/elasticsearch/xpack/vectors/mapper/DenseVectorFieldTypeTests.java +++ b/x-pack/plugin/vectors/src/test/java/org/elasticsearch/xpack/vectors/mapper/DenseVectorFieldTypeTests.java @@ -15,36 +15,45 @@ import java.util.List; public class DenseVectorFieldTypeTests extends FieldTypeTestCase { + private final boolean indexed; + + public DenseVectorFieldTypeTests() { + this.indexed = randomBoolean(); + } + + private DenseVectorFieldMapper.DenseVectorFieldType createFieldType() { + return new DenseVectorFieldMapper.DenseVectorFieldType("f", Version.CURRENT, 5, indexed, Collections.emptyMap()); + } public void testHasDocValues() { - DenseVectorFieldMapper.DenseVectorFieldType ft = new DenseVectorFieldMapper.DenseVectorFieldType( - "f", Version.CURRENT, 1, Collections.emptyMap()); - assertTrue(ft.hasDocValues()); + DenseVectorFieldMapper.DenseVectorFieldType ft = createFieldType(); + assertNotEquals(indexed, ft.hasDocValues()); + } + + public void testIsSearchable() { + DenseVectorFieldMapper.DenseVectorFieldType ft = createFieldType(); + assertEquals(indexed, ft.isSearchable()); } public void testIsAggregatable() { - DenseVectorFieldMapper.DenseVectorFieldType ft = new DenseVectorFieldMapper.DenseVectorFieldType( - "f", Version.CURRENT,1, Collections.emptyMap()); + DenseVectorFieldMapper.DenseVectorFieldType ft = createFieldType(); assertFalse(ft.isAggregatable()); } public void testFielddataBuilder() { - DenseVectorFieldMapper.DenseVectorFieldType ft = new DenseVectorFieldMapper.DenseVectorFieldType( - "f", Version.CURRENT,1, Collections.emptyMap()); + DenseVectorFieldMapper.DenseVectorFieldType ft = createFieldType(); assertNotNull(ft.fielddataBuilder("index", () -> { throw new UnsupportedOperationException(); })); } public void testDocValueFormat() { - DenseVectorFieldMapper.DenseVectorFieldType ft = new DenseVectorFieldMapper.DenseVectorFieldType( - "f", Version.CURRENT,1, Collections.emptyMap()); + DenseVectorFieldMapper.DenseVectorFieldType ft = createFieldType(); expectThrows(IllegalArgumentException.class, () -> ft.docValueFormat(null, null)); } public void testFetchSourceValue() throws IOException { - DenseVectorFieldMapper.DenseVectorFieldType ft = new DenseVectorFieldMapper.DenseVectorFieldType( - "f", Version.CURRENT, 5, Collections.emptyMap()); + DenseVectorFieldMapper.DenseVectorFieldType ft = createFieldType(); List vector = List.of(0.0, 1.0, 2.0, 3.0, 4.0); assertEquals(vector, fetchSourceValue(ft, vector)); } diff --git a/x-pack/plugin/vectors/src/test/java/org/elasticsearch/xpack/vectors/query/DenseVectorScriptDocValuesTests.java b/x-pack/plugin/vectors/src/test/java/org/elasticsearch/xpack/vectors/query/BinaryDenseVectorScriptDocValuesTests.java similarity index 58% rename from x-pack/plugin/vectors/src/test/java/org/elasticsearch/xpack/vectors/query/DenseVectorScriptDocValuesTests.java rename to x-pack/plugin/vectors/src/test/java/org/elasticsearch/xpack/vectors/query/BinaryDenseVectorScriptDocValuesTests.java index 7a77b93adba3c..edf0285259320 100644 --- a/x-pack/plugin/vectors/src/test/java/org/elasticsearch/xpack/vectors/query/DenseVectorScriptDocValuesTests.java +++ b/x-pack/plugin/vectors/src/test/java/org/elasticsearch/xpack/vectors/query/BinaryDenseVectorScriptDocValuesTests.java @@ -11,15 +11,78 @@ import org.apache.lucene.util.BytesRef; import org.elasticsearch.Version; import org.elasticsearch.test.ESTestCase; +import org.elasticsearch.xpack.vectors.mapper.VectorEncoderDecoder; import java.io.IOException; +import java.nio.ByteBuffer; import java.util.Arrays; import static org.hamcrest.Matchers.containsString; -public class DenseVectorScriptDocValuesTests extends ESTestCase { +public class BinaryDenseVectorScriptDocValuesTests extends ESTestCase { - private static BinaryDocValues wrap(float[][] vectors, Version indexVersion) { + public void testGetVectorValueAndGetMagnitude() throws IOException { + int dims = 3; + float[][] vectors = {{ 1, 1, 1 }, { 1, 1, 2 }, { 1, 1, 3 } }; + float[] expectedMagnitudes = { 1.7320f, 2.4495f, 3.3166f }; + + for (Version indexVersion : Arrays.asList(Version.V_7_4_0, Version.CURRENT)) { + BinaryDocValues docValues = wrap(vectors, indexVersion); + DenseVectorScriptDocValues scriptDocValues = new BinaryDenseVectorScriptDocValues(docValues, indexVersion, dims); + for (int i = 0; i < vectors.length; i++) { + scriptDocValues.setNextDocId(i); + assertArrayEquals(vectors[i], scriptDocValues.getVectorValue(), 0.0001f); + assertEquals(expectedMagnitudes[i], scriptDocValues.getMagnitude(), 0.0001f); + } + } + } + + public void testMissingValues() throws IOException { + int dims = 3; + float[][] vectors = {{ 1, 1, 1 }, { 1, 1, 2 }, { 1, 1, 3 } }; + BinaryDocValues docValues = wrap(vectors, Version.CURRENT); + DenseVectorScriptDocValues scriptDocValues = new BinaryDenseVectorScriptDocValues(docValues, Version.CURRENT, dims); + + scriptDocValues.setNextDocId(3); + Exception e = expectThrows(IllegalArgumentException.class, () -> scriptDocValues.getVectorValue()); + assertEquals("A document doesn't have a value for a vector field!", e.getMessage()); + + e = expectThrows(IllegalArgumentException.class, () -> scriptDocValues.getMagnitude()); + assertEquals("A document doesn't have a value for a vector field!", e.getMessage()); + } + + public void testGetFunctionIsNotAccessible() throws IOException { + int dims = 3; + float[][] vectors = {{ 1, 1, 1 }, { 1, 1, 2 }, { 1, 1, 3 } }; + BinaryDocValues docValues = wrap(vectors, Version.CURRENT); + DenseVectorScriptDocValues scriptDocValues = new BinaryDenseVectorScriptDocValues(docValues, Version.CURRENT, dims); + + scriptDocValues.setNextDocId(0); + Exception e = expectThrows(UnsupportedOperationException.class, () -> scriptDocValues.get(0)); + assertThat(e.getMessage(), containsString("accessing a vector field's value through 'get' or 'value' is not supported!")); + } + + public void testSimilarityFunctions() throws IOException { + int dims = 5; + float[] docVector = new float[] {230.0f, 300.33f, -34.8988f, 15.555f, -200.0f}; + float[] queryVector = new float[] {0.5f, 111.3f, -13.0f, 14.8f, -156.0f}; + + for (Version indexVersion : Arrays.asList(Version.V_7_4_0, Version.CURRENT)) { + BinaryDocValues docValues = wrap(new float[][]{docVector}, indexVersion); + DenseVectorScriptDocValues scriptDocValues = new BinaryDenseVectorScriptDocValues(docValues, Version.CURRENT, dims); + + scriptDocValues.setNextDocId(0); + + assertEquals("dotProduct result is not equal to the expected value!", + 65425.624, scriptDocValues.dotProduct(queryVector), 0.001); + assertEquals("l1norm result is not equal to the expected value!", 485.184, + scriptDocValues.l1Norm(queryVector), 0.001); + assertEquals("l2norm result is not equal to the expected value!", 301.361, + scriptDocValues.l2Norm(queryVector), 0.001); + } + } + + static BinaryDocValues wrap(float[][] vectors, Version indexVersion) { return new BinaryDocValues() { int idx = -1; int maxIdx = vectors.length; @@ -28,7 +91,7 @@ public BytesRef binaryValue() { if (idx >= maxIdx) { throw new IllegalStateException("max index exceeded"); } - return DenseVectorFunctionTests.mockEncodeDenseVector(vectors[idx], indexVersion); + return mockEncodeDenseVector(vectors[idx], indexVersion); } @Override @@ -62,44 +125,24 @@ public long cost() { }; } - public void testGetVectorValueAndGetMagnitude() throws IOException { - final int dims = 3; - float[][] vectors = {{ 1, 1, 1 }, { 1, 1, 2 }, { 1, 1, 3 } }; - float[] expectedMagnitudes = { 1.7320f, 2.4495f, 3.3166f }; + private static BytesRef mockEncodeDenseVector(float[] values, Version indexVersion) { + byte[] bytes = indexVersion.onOrAfter(Version.V_7_5_0) + ? new byte[VectorEncoderDecoder.INT_BYTES * values.length + VectorEncoderDecoder.INT_BYTES] + : new byte[VectorEncoderDecoder.INT_BYTES * values.length]; + double dotProduct = 0f; - for (Version indexVersion : Arrays.asList(Version.V_7_4_0, Version.CURRENT)) { - BinaryDocValues docValues = wrap(vectors, indexVersion); - final DenseVectorScriptDocValues scriptDocValues = new DenseVectorScriptDocValues(docValues, indexVersion, dims); - for (int i = 0; i < vectors.length; i++) { - scriptDocValues.setNextDocId(i); - assertArrayEquals(vectors[i], scriptDocValues.getVectorValue(), 0.0001f); - assertEquals(expectedMagnitudes[i], scriptDocValues.getMagnitude(), 0.0001f); - } + ByteBuffer byteBuffer = ByteBuffer.wrap(bytes); + for (float value : values) { + byteBuffer.putFloat(value); + dotProduct += value * value; } - } - - public void testMissingValues() throws IOException { - final int dims = 3; - float[][] vectors = {{ 1, 1, 1 }, { 1, 1, 2 }, { 1, 1, 3 } }; - BinaryDocValues docValues = wrap(vectors, Version.CURRENT); - final DenseVectorScriptDocValues scriptDocValues = new DenseVectorScriptDocValues(docValues, Version.CURRENT, dims); - scriptDocValues.setNextDocId(3); - Exception e = expectThrows(IllegalArgumentException.class, () -> scriptDocValues.getVectorValue()); - assertEquals("A document doesn't have a value for a vector field!", e.getMessage()); - - e = expectThrows(IllegalArgumentException.class, () -> scriptDocValues.getMagnitude()); - assertEquals("A document doesn't have a value for a vector field!", e.getMessage()); + if (indexVersion.onOrAfter(Version.V_7_5_0)) { + // encode vector magnitude at the end + float vectorMagnitude = (float) Math.sqrt(dotProduct); + byteBuffer.putFloat(vectorMagnitude); + } + return new BytesRef(bytes); } - public void testGetFunctionIsNotAccessible() throws IOException { - final int dims = 3; - float[][] vectors = {{ 1, 1, 1 }, { 1, 1, 2 }, { 1, 1, 3 } }; - BinaryDocValues docValues = wrap(vectors, Version.CURRENT); - final DenseVectorScriptDocValues scriptDocValues = new DenseVectorScriptDocValues(docValues, Version.CURRENT, dims); - - scriptDocValues.setNextDocId(0); - Exception e = expectThrows(UnsupportedOperationException.class, () -> scriptDocValues.get(0)); - assertThat(e.getMessage(), containsString("accessing a vector field's value through 'get' or 'value' is not supported!")); - } } diff --git a/x-pack/plugin/vectors/src/test/java/org/elasticsearch/xpack/vectors/query/DenseVectorFunctionTests.java b/x-pack/plugin/vectors/src/test/java/org/elasticsearch/xpack/vectors/query/DenseVectorFunctionTests.java index c6e5540d210ef..0b3557a9e70dd 100644 --- a/x-pack/plugin/vectors/src/test/java/org/elasticsearch/xpack/vectors/query/DenseVectorFunctionTests.java +++ b/x-pack/plugin/vectors/src/test/java/org/elasticsearch/xpack/vectors/query/DenseVectorFunctionTests.java @@ -7,116 +7,55 @@ package org.elasticsearch.xpack.vectors.query; -import org.apache.lucene.util.BytesRef; +import org.apache.lucene.index.BinaryDocValues; import org.elasticsearch.Version; import org.elasticsearch.script.ScoreScript; import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.xpack.vectors.mapper.VectorEncoderDecoder; import org.elasticsearch.xpack.vectors.query.ScoreScriptUtils.CosineSimilarity; import org.elasticsearch.xpack.vectors.query.ScoreScriptUtils.DotProduct; import org.elasticsearch.xpack.vectors.query.ScoreScriptUtils.L1Norm; import org.elasticsearch.xpack.vectors.query.ScoreScriptUtils.L2Norm; -import org.junit.Before; -import java.nio.ByteBuffer; import java.util.Arrays; import java.util.Collections; import java.util.List; +import java.util.function.Supplier; import static org.hamcrest.Matchers.containsString; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; public class DenseVectorFunctionTests extends ESTestCase { - private String field; - private float[] docVector; - private List queryVector; - private List invalidQueryVector; - - @Before - public void setUpVectors() { - field = "vector"; - docVector = new float[] {230.0f, 300.33f, -34.8988f, 15.555f, -200.0f}; - queryVector = Arrays.asList(0.5f, 111.3f, -13.0f, 14.8f, -156.0f); - invalidQueryVector = Arrays.asList(0.5, 111.3); - } public void testVectorFunctions() { - for (Version indexVersion : Arrays.asList(Version.V_7_4_0, Version.CURRENT)) { - BytesRef encodedDocVector = mockEncodeDenseVector(docVector, indexVersion); - float magnitude = VectorEncoderDecoder.getMagnitude(indexVersion, encodedDocVector); + String field = "vector"; + int dims = 5; + float[] docVector = new float[] {230.0f, 300.33f, -34.8988f, 15.555f, -200.0f}; + List queryVector = Arrays.asList(0.5f, 111.3f, -13.0f, 14.8f, -156.0f); + List invalidQueryVector = Arrays.asList(0.5, 111.3); - DenseVectorScriptDocValues docValues = mock(DenseVectorScriptDocValues.class); - when(docValues.getEncodedValue()).thenReturn(encodedDocVector); - when(docValues.getMagnitude()).thenReturn(magnitude); - when(docValues.dims()).thenReturn(docVector.length); + for (Version indexVersion : Arrays.asList(Version.V_7_4_0, Version.CURRENT)) { + BinaryDocValues docValues = BinaryDenseVectorScriptDocValuesTests.wrap(new float[][]{docVector}, indexVersion); + DenseVectorScriptDocValues scriptDocValues = new BinaryDenseVectorScriptDocValues(docValues, indexVersion, dims); ScoreScript scoreScript = mock(ScoreScript.class); - when(scoreScript.getDoc()).thenReturn(Collections.singletonMap(field, docValues)); - - testDotProduct(scoreScript); - testCosineSimilarity(scoreScript); - testL1Norm(scoreScript); - testL2Norm(scoreScript); + when(scoreScript.getDoc()).thenReturn(Collections.singletonMap(field, scriptDocValues)); + + // Test cosine similarity explicitly, as it must perform special logic on top of the doc values + CosineSimilarity function = new CosineSimilarity(scoreScript, queryVector, field); + assertEquals("cosineSimilarity result is not equal to the expected value!", + 0.790, function.cosineSimilarity(), 0.001); + + // Check each function rejects query vectors with the wrong dimension + assertDimensionMismatch(() -> new DotProduct(scoreScript, invalidQueryVector, field)); + assertDimensionMismatch(() -> new CosineSimilarity(scoreScript, invalidQueryVector, field)); + assertDimensionMismatch(() -> new L1Norm(scoreScript, invalidQueryVector, field)); + assertDimensionMismatch(() -> new L2Norm(scoreScript, invalidQueryVector, field)); } } - private void testDotProduct(ScoreScript scoreScript) { - DotProduct function = new DotProduct(scoreScript, queryVector, field); - double result = function.dotProduct(); - assertEquals("dotProduct result is not equal to the expected value!", 65425.624, result, 0.001); - - IllegalArgumentException e = - expectThrows(IllegalArgumentException.class, () -> new DotProduct(scoreScript, invalidQueryVector, field)); - assertThat(e.getMessage(), containsString("query vector has a different number of dimensions [2] than the document vectors [5]")); - } - - private void testCosineSimilarity(ScoreScript scoreScript) { - CosineSimilarity function = new CosineSimilarity(scoreScript, queryVector, field); - double result = function.cosineSimilarity(); - assertEquals("cosineSimilarity result is not equal to the expected value!", 0.790, result, 0.001); - - IllegalArgumentException e = - expectThrows(IllegalArgumentException.class, () -> new CosineSimilarity(scoreScript, invalidQueryVector, field)); - assertThat(e.getMessage(), containsString("query vector has a different number of dimensions [2] than the document vectors [5]")); - } - - private void testL1Norm(ScoreScript scoreScript) { - L1Norm function = new L1Norm(scoreScript, queryVector, field); - double result = function.l1norm(); - assertEquals("l1norm result is not equal to the expected value!", 485.184, result, 0.001); - - IllegalArgumentException e = - expectThrows(IllegalArgumentException.class, () -> new L1Norm(scoreScript, invalidQueryVector, field)); - assertThat(e.getMessage(), containsString("query vector has a different number of dimensions [2] than the document vectors [5]")); - } - - private void testL2Norm(ScoreScript scoreScript) { - L2Norm function = new L2Norm(scoreScript, queryVector, field); - double result = function.l2norm(); - assertEquals("l2norm result is not equal to the expected value!", 301.361, result, 0.001); - - IllegalArgumentException e = expectThrows(IllegalArgumentException.class, () -> new L2Norm(scoreScript, invalidQueryVector, field)); + private void assertDimensionMismatch(Supplier supplier) { + IllegalArgumentException e = expectThrows(IllegalArgumentException.class, supplier::get); assertThat(e.getMessage(), containsString("query vector has a different number of dimensions [2] than the document vectors [5]")); } - - static BytesRef mockEncodeDenseVector(float[] values, Version indexVersion) { - byte[] bytes = indexVersion.onOrAfter(Version.V_7_5_0) - ? new byte[VectorEncoderDecoder.INT_BYTES * values.length + VectorEncoderDecoder.INT_BYTES] - : new byte[VectorEncoderDecoder.INT_BYTES * values.length]; - double dotProduct = 0f; - - ByteBuffer byteBuffer = ByteBuffer.wrap(bytes); - for (float value : values) { - byteBuffer.putFloat(value); - dotProduct += value * value; - } - - if (indexVersion.onOrAfter(Version.V_7_5_0)) { - // encode vector magnitude at the end - float vectorMagnitude = (float) Math.sqrt(dotProduct); - byteBuffer.putFloat(vectorMagnitude); - } - return new BytesRef(bytes); - } } diff --git a/x-pack/plugin/vectors/src/test/java/org/elasticsearch/xpack/vectors/query/KnnDenseVectorScriptDocValuesTests.java b/x-pack/plugin/vectors/src/test/java/org/elasticsearch/xpack/vectors/query/KnnDenseVectorScriptDocValuesTests.java new file mode 100644 index 0000000000000..507f24886767f --- /dev/null +++ b/x-pack/plugin/vectors/src/test/java/org/elasticsearch/xpack/vectors/query/KnnDenseVectorScriptDocValuesTests.java @@ -0,0 +1,121 @@ +/* + * 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.vectors.query; + +import org.apache.lucene.index.VectorValues; +import org.apache.lucene.util.BytesRef; +import org.elasticsearch.test.ESTestCase; + +import java.io.IOException; + +import static org.hamcrest.Matchers.containsString; + +public class KnnDenseVectorScriptDocValuesTests extends ESTestCase { + + public void testGetVectorValueAndGetMagnitude() throws IOException { + int dims = 3; + float[][] vectors = {{ 1, 1, 1 }, { 1, 1, 2 }, { 1, 1, 3 } }; + float[] expectedMagnitudes = { 1.7320f, 2.4495f, 3.3166f }; + + DenseVectorScriptDocValues scriptDocValues = new KnnDenseVectorScriptDocValues(wrap(vectors), dims); + for (int i = 0; i < vectors.length; i++) { + scriptDocValues.setNextDocId(i); + assertArrayEquals(vectors[i], scriptDocValues.getVectorValue(), 0.0001f); + assertEquals(expectedMagnitudes[i], scriptDocValues.getMagnitude(), 0.0001f); + } + } + + public void testMissingValues() throws IOException { + int dims = 3; + float[][] vectors = {{ 1, 1, 1 }, { 1, 1, 2 }, { 1, 1, 3 } }; + DenseVectorScriptDocValues scriptDocValues = new KnnDenseVectorScriptDocValues(wrap(vectors), dims); + + scriptDocValues.setNextDocId(3); + Exception e = expectThrows(IllegalArgumentException.class, () -> scriptDocValues.getVectorValue()); + assertEquals("A document doesn't have a value for a vector field!", e.getMessage()); + + e = expectThrows(IllegalArgumentException.class, () -> scriptDocValues.getMagnitude()); + assertEquals("A document doesn't have a value for a vector field!", e.getMessage()); + } + + public void testGetFunctionIsNotAccessible() throws IOException { + int dims = 3; + float[][] vectors = {{ 1, 1, 1 }, { 1, 1, 2 }, { 1, 1, 3 } }; + DenseVectorScriptDocValues scriptDocValues = new KnnDenseVectorScriptDocValues(wrap(vectors), dims); + + scriptDocValues.setNextDocId(0); + Exception e = expectThrows(UnsupportedOperationException.class, () -> scriptDocValues.get(0)); + assertThat(e.getMessage(), containsString("accessing a vector field's value through 'get' or 'value' is not supported!")); + } + + public void testSimilarityFunctions() throws IOException { + int dims = 5; + float[] docVector = new float[] {230.0f, 300.33f, -34.8988f, 15.555f, -200.0f}; + float[] queryVector = new float[] {0.5f, 111.3f, -13.0f, 14.8f, -156.0f}; + + DenseVectorScriptDocValues scriptDocValues = new KnnDenseVectorScriptDocValues(wrap(new float[][]{docVector}), dims); + scriptDocValues.setNextDocId(0); + + assertEquals("dotProduct result is not equal to the expected value!", + 65425.624, scriptDocValues.dotProduct(queryVector), 0.001); + assertEquals("l1norm result is not equal to the expected value!", 485.184, + scriptDocValues.l1Norm(queryVector), 0.001); + assertEquals("l2norm result is not equal to the expected value!", 301.361, + scriptDocValues.l2Norm(queryVector), 0.001); + } + + private static VectorValues wrap(float[][] vectors) { + return new VectorValues() { + int index = 0; + + @Override + public int dimension() { + return 0; + } + + @Override + public int size() { + return vectors.length; + } + + @Override + public float[] vectorValue() { + return vectors[index]; + } + + @Override + public BytesRef binaryValue() { + // This value is never inspected, it's only used to check if the document has a vector + return new BytesRef(); + } + + @Override + public int docID() { + return index; + } + + @Override + public int nextDoc() { + throw new UnsupportedOperationException(); + } + + @Override + public int advance(int target) { + if (target >= size()) { + return NO_MORE_DOCS; + } + return index = target; + } + + @Override + public long cost() { + return size(); + } + }; + } +} From 5a8b07f7201aa6004eb4a5be119734bb6f2ed514 Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Mon, 4 Oct 2021 17:40:20 -0700 Subject: [PATCH 147/250] Convert logstash license object to LicensedFeature (#78637) This commit moves the logstash license checks to use the new LicensedFeature class. --- .../org/elasticsearch/license/XPackLicenseState.java | 2 -- .../org/elasticsearch/xpack/logstash/Logstash.java | 4 ++++ .../xpack/logstash/LogstashInfoTransportAction.java | 2 +- .../xpack/logstash/LogstashUsageTransportAction.java | 2 +- .../logstash/LogstashInfoTransportActionTests.java | 10 +++++----- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/XPackLicenseState.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/XPackLicenseState.java index be4843b8e9280..3e09fee438e9e 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/XPackLicenseState.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/XPackLicenseState.java @@ -62,8 +62,6 @@ public enum Feature { MACHINE_LEARNING(OperationMode.PLATINUM, true), - LOGSTASH(OperationMode.STANDARD, true), - OPERATOR_PRIVILEGES(OperationMode.ENTERPRISE, true); // NOTE: this is temporary. The Feature enum will go away in favor of LicensedFeature. diff --git a/x-pack/plugin/logstash/src/main/java/org/elasticsearch/xpack/logstash/Logstash.java b/x-pack/plugin/logstash/src/main/java/org/elasticsearch/xpack/logstash/Logstash.java index 619b81d3c9546..a8c7aeebef5f2 100644 --- a/x-pack/plugin/logstash/src/main/java/org/elasticsearch/xpack/logstash/Logstash.java +++ b/x-pack/plugin/logstash/src/main/java/org/elasticsearch/xpack/logstash/Logstash.java @@ -19,6 +19,8 @@ import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.index.codec.CodecService; import org.elasticsearch.indices.SystemIndexDescriptor; +import org.elasticsearch.license.License; +import org.elasticsearch.license.LicensedFeature; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.plugins.SystemIndexPlugin; import org.elasticsearch.rest.RestController; @@ -54,6 +56,8 @@ public class Logstash extends Plugin implements SystemIndexPlugin { public static final String LOGSTASH_CONCRETE_INDEX_NAME = ".logstash"; public static final String LOGSTASH_INDEX_NAME_PATTERN = LOGSTASH_CONCRETE_INDEX_NAME + "*"; + static final LicensedFeature.Momentary LOGSTASH_FEATURE = LicensedFeature.momentary(null, "logstash", License.OperationMode.STANDARD); + public Logstash() {} @Override diff --git a/x-pack/plugin/logstash/src/main/java/org/elasticsearch/xpack/logstash/LogstashInfoTransportAction.java b/x-pack/plugin/logstash/src/main/java/org/elasticsearch/xpack/logstash/LogstashInfoTransportAction.java index ecf4a3b531da8..a2970112b4964 100644 --- a/x-pack/plugin/logstash/src/main/java/org/elasticsearch/xpack/logstash/LogstashInfoTransportAction.java +++ b/x-pack/plugin/logstash/src/main/java/org/elasticsearch/xpack/logstash/LogstashInfoTransportAction.java @@ -31,7 +31,7 @@ public String name() { @Override public boolean available() { - return licenseState.isAllowed(XPackLicenseState.Feature.LOGSTASH); + return Logstash.LOGSTASH_FEATURE.checkWithoutTracking(licenseState); } @Override diff --git a/x-pack/plugin/logstash/src/main/java/org/elasticsearch/xpack/logstash/LogstashUsageTransportAction.java b/x-pack/plugin/logstash/src/main/java/org/elasticsearch/xpack/logstash/LogstashUsageTransportAction.java index 57906abbe1b56..a6e112949cbd1 100644 --- a/x-pack/plugin/logstash/src/main/java/org/elasticsearch/xpack/logstash/LogstashUsageTransportAction.java +++ b/x-pack/plugin/logstash/src/main/java/org/elasticsearch/xpack/logstash/LogstashUsageTransportAction.java @@ -53,7 +53,7 @@ protected void masterOperation( ClusterState state, ActionListener listener ) { - boolean available = licenseState.isAllowed(XPackLicenseState.Feature.LOGSTASH); + boolean available = Logstash.LOGSTASH_FEATURE.checkWithoutTracking(licenseState); LogstashFeatureSetUsage usage = new LogstashFeatureSetUsage(available); listener.onResponse(new XPackUsageFeatureResponse(usage)); } diff --git a/x-pack/plugin/logstash/src/test/java/org/elasticsearch/xpack/logstash/LogstashInfoTransportActionTests.java b/x-pack/plugin/logstash/src/test/java/org/elasticsearch/xpack/logstash/LogstashInfoTransportActionTests.java index 736deaaf1a479..f65e994de55ea 100644 --- a/x-pack/plugin/logstash/src/test/java/org/elasticsearch/xpack/logstash/LogstashInfoTransportActionTests.java +++ b/x-pack/plugin/logstash/src/test/java/org/elasticsearch/xpack/logstash/LogstashInfoTransportActionTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.action.support.ActionFilters; import org.elasticsearch.action.support.PlainActionFuture; import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.license.XPackLicenseState; +import org.elasticsearch.license.MockLicenseState; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.transport.TransportService; import org.elasticsearch.xpack.core.XPackFeatureSet; @@ -42,14 +42,14 @@ public void testEnabledDefault() throws Exception { } public void testAvailable() throws Exception { - final XPackLicenseState licenseState = mock(XPackLicenseState.class); + final MockLicenseState licenseState = mock(MockLicenseState.class); LogstashInfoTransportAction featureSet = new LogstashInfoTransportAction( mock(TransportService.class), mock(ActionFilters.class), licenseState ); boolean available = randomBoolean(); - when(licenseState.isAllowed(XPackLicenseState.Feature.LOGSTASH)).thenReturn(available); + when(licenseState.isAllowed(Logstash.LOGSTASH_FEATURE)).thenReturn(available); assertThat(featureSet.available(), is(available)); var usageAction = newUsageAction(available); @@ -65,8 +65,8 @@ public void testAvailable() throws Exception { } private LogstashUsageTransportAction newUsageAction(boolean available) { - XPackLicenseState licenseState = mock(XPackLicenseState.class); - when(licenseState.isAllowed(XPackLicenseState.Feature.LOGSTASH)).thenReturn(available); + final MockLicenseState licenseState = mock(MockLicenseState.class); + when(licenseState.isAllowed(Logstash.LOGSTASH_FEATURE)).thenReturn(available); return new LogstashUsageTransportAction(mock(TransportService.class), null, null, mock(ActionFilters.class), null, licenseState); } } From 714aa541b70d366e276766ea9f093f8d01961004 Mon Sep 17 00:00:00 2001 From: Ignacio Vera Date: Tue, 5 Oct 2021 07:09:33 +0200 Subject: [PATCH 148/250] Make feature factory more resilient to invalid polygons (#77200) Changes the approach how we simplify shapes so it is more heap friendly and resilient to complex polygons. --- .../vectortile/feature/FeatureFactory.java | 167 ++++-- .../FeatureFactoriesConsistencyTests.java | 29 - .../feature/FeatureFactoryTests.java | 49 ++ .../vectortile/feature/Antarctica.wkt.gz | Bin 0 -> 167193 bytes .../xpack/vectortile/feature/France.wkt.gz | Bin 0 -> 22944 bytes .../xpack/vectortile/feature/LICENSE.txt | 540 ++++++++++++++++++ .../xpack/vectortile/feature/NOTICE.txt | 2 + 7 files changed, 708 insertions(+), 79 deletions(-) create mode 100644 x-pack/plugin/vector-tile/src/test/resources/org/elasticsearch/xpack/vectortile/feature/Antarctica.wkt.gz create mode 100644 x-pack/plugin/vector-tile/src/test/resources/org/elasticsearch/xpack/vectortile/feature/France.wkt.gz create mode 100644 x-pack/plugin/vector-tile/src/test/resources/org/elasticsearch/xpack/vectortile/feature/LICENSE.txt create mode 100644 x-pack/plugin/vector-tile/src/test/resources/org/elasticsearch/xpack/vectortile/feature/NOTICE.txt diff --git a/x-pack/plugin/vector-tile/src/main/java/org/elasticsearch/xpack/vectortile/feature/FeatureFactory.java b/x-pack/plugin/vector-tile/src/main/java/org/elasticsearch/xpack/vectortile/feature/FeatureFactory.java index eb49acb160730..e1e517231ba1e 100644 --- a/x-pack/plugin/vector-tile/src/main/java/org/elasticsearch/xpack/vectortile/feature/FeatureFactory.java +++ b/x-pack/plugin/vector-tile/src/main/java/org/elasticsearch/xpack/vectortile/feature/FeatureFactory.java @@ -8,12 +8,9 @@ package org.elasticsearch.xpack.vectortile.feature; import com.wdtinc.mapbox_vector_tile.VectorTile; -import com.wdtinc.mapbox_vector_tile.adapt.jts.IGeometryFilter; import com.wdtinc.mapbox_vector_tile.adapt.jts.IUserDataConverter; import com.wdtinc.mapbox_vector_tile.adapt.jts.JtsAdapter; -import com.wdtinc.mapbox_vector_tile.adapt.jts.TileGeomResult; import com.wdtinc.mapbox_vector_tile.adapt.jts.UserDataIgnoreConverter; -import com.wdtinc.mapbox_vector_tile.build.MvtLayerParams; import com.wdtinc.mapbox_vector_tile.build.MvtLayerProps; import org.elasticsearch.common.geo.SphericalMercatorUtils; @@ -31,12 +28,18 @@ import org.elasticsearch.geometry.Rectangle; import org.elasticsearch.search.aggregations.bucket.geogrid.GeoTileUtils; import org.locationtech.jts.geom.Coordinate; +import org.locationtech.jts.geom.CoordinateSequence; +import org.locationtech.jts.geom.CoordinateSequenceFilter; import org.locationtech.jts.geom.Envelope; import org.locationtech.jts.geom.GeometryFactory; +import org.locationtech.jts.geom.IntersectionMatrix; import org.locationtech.jts.geom.LineString; +import org.locationtech.jts.geom.TopologyException; import org.locationtech.jts.simplify.TopologyPreservingSimplifier; import java.util.ArrayList; +import java.util.Arrays; +import java.util.Comparator; import java.util.List; /** @@ -44,57 +47,92 @@ */ public class FeatureFactory { - private final IGeometryFilter acceptAllGeomFilter = geometry -> true; private final IUserDataConverter userDataIgnoreConverter = new UserDataIgnoreConverter(); - private final MvtLayerParams layerParams; - private final GeometryFactory geomFactory = new GeometryFactory(); private final MvtLayerProps layerProps = new MvtLayerProps(); private final JTSGeometryBuilder builder; - - private final Envelope tileEnvelope; - private final Envelope clipEnvelope; + // extent used for clipping + private final org.locationtech.jts.geom.Geometry clipTile; + // transforms spherical mercator coordinates into the tile coordinates + private final CoordinateSequenceFilter sequenceFilter; + // pixel precision of the tile in the mercator projection. + private final double pixelPrecision; public FeatureFactory(int z, int x, int y, int extent) { + this.pixelPrecision = 2 * SphericalMercatorUtils.MERCATOR_BOUNDS / ((1L << z) * extent); final Rectangle r = SphericalMercatorUtils.recToSphericalMercator(GeoTileUtils.toBoundingBox(x, y, z)); - this.tileEnvelope = new Envelope(r.getMinX(), r.getMaxX(), r.getMinY(), r.getMaxY()); - this.clipEnvelope = new Envelope(tileEnvelope); - // pixel precision of the tile in the mercator projection. - final double pixelPrecision = 2 * SphericalMercatorUtils.MERCATOR_BOUNDS / ((1L << z) * extent); - this.clipEnvelope.expandBy(pixelPrecision, pixelPrecision); - this.builder = new JTSGeometryBuilder(geomFactory, geomFactory.toGeometry(tileEnvelope), pixelPrecision); - // TODO: Not sure what is the difference between extent and tile size? - this.layerParams = new MvtLayerParams(extent, extent); + final Envelope tileEnvelope = new Envelope(r.getMinX(), r.getMaxX(), r.getMinY(), r.getMaxY()); + final Envelope clipEnvelope = new Envelope(tileEnvelope); + clipEnvelope.expandBy(this.pixelPrecision, this.pixelPrecision); + final GeometryFactory geomFactory = new GeometryFactory(); + this.builder = new JTSGeometryBuilder(geomFactory); + this.clipTile = geomFactory.toGeometry(clipEnvelope); + this.sequenceFilter = new MvtCoordinateSequenceFilter(tileEnvelope, extent); } public List getFeatures(Geometry geometry) { + // Get geometry in spherical mercator final org.locationtech.jts.geom.Geometry jtsGeometry = geometry.visit(builder); - if (jtsGeometry.isValid() == false) { - return List.of(); - } - final TileGeomResult tileGeom = JtsAdapter.createTileGeom( - JtsAdapter.flatFeatureList(jtsGeometry), - tileEnvelope, - clipEnvelope, - geomFactory, - layerParams, - acceptAllGeomFilter + // clip the geometry to the tile + final List flatGeometries = clipGeometries( + clipTile.copy(), + JtsAdapter.flatFeatureList(jtsGeometry) ); - // MVT tile geometry to MVT features - final List features = JtsAdapter.toFeatures(tileGeom.mvtGeoms, layerProps, userDataIgnoreConverter); + // simplify geometry using the pixel precision + simplifyGeometry(flatGeometries, pixelPrecision); + // convert coordinates to MVT geometry + convertToMvtGeometry(flatGeometries, sequenceFilter); + // MVT geometry to MVT feature + final List features = JtsAdapter.toFeatures(flatGeometries, layerProps, userDataIgnoreConverter); final List byteFeatures = new ArrayList<>(features.size()); features.forEach(f -> byteFeatures.add(f.toByteArray())); return byteFeatures; } + private static List clipGeometries( + org.locationtech.jts.geom.Geometry envelope, + List geometries + ) { + final List intersected = new ArrayList<>(geometries.size()); + for (org.locationtech.jts.geom.Geometry geometry : geometries) { + try { + final IntersectionMatrix matrix = envelope.relate(geometry); + if (matrix.isContains()) { + // no need to clip + intersected.add(geometry); + } else if (matrix.isWithin()) { + // the clipped geometry is the envelope + intersected.add(envelope); + } else if (matrix.isIntersects()) { + // clip it + intersected.add(envelope.intersection(geometry)); + } else { + // disjoint + assert envelope.intersection(geometry).isEmpty(); + } + } catch (TopologyException e) { + // ignore + } + } + return intersected; + } + + private static void simplifyGeometry(List geometries, double precision) { + for (int i = 0; i < geometries.size(); i++) { + geometries.set(i, TopologyPreservingSimplifier.simplify(geometries.get(i), precision)); + } + } + + private static void convertToMvtGeometry(List geometries, CoordinateSequenceFilter sequenceFilter) { + for (org.locationtech.jts.geom.Geometry geometry : geometries) { + geometry.apply(sequenceFilter); + } + } + private static class JTSGeometryBuilder implements GeometryVisitor { private final GeometryFactory geomFactory; - private final org.locationtech.jts.geom.Geometry tile; - private final double pixelPrecision; - JTSGeometryBuilder(GeometryFactory geomFactory, org.locationtech.jts.geom.Geometry tile, double pixelPrecision) { - this.pixelPrecision = pixelPrecision; - this.tile = tile; + JTSGeometryBuilder(GeometryFactory geomFactory) { this.geomFactory = geomFactory; } @@ -128,6 +166,10 @@ public org.locationtech.jts.geom.Geometry visit(MultiPoint multiPoint) throws Ru for (int i = 0; i < multiPoint.size(); i++) { points[i] = buildPoint(multiPoint.get(i)); } + Arrays.sort( + points, + Comparator.comparingDouble(org.locationtech.jts.geom.Point::getX).thenComparingDouble(org.locationtech.jts.geom.Point::getY) + ); return geomFactory.createMultiPoint(points); } @@ -163,29 +205,16 @@ private LineString buildLine(Line line) { @Override public org.locationtech.jts.geom.Geometry visit(Polygon polygon) throws RuntimeException { - return simplifyGeometry(buildPolygon(polygon)); + return buildPolygon(polygon); } @Override public org.locationtech.jts.geom.Geometry visit(MultiPolygon multiPolygon) throws RuntimeException { final org.locationtech.jts.geom.Polygon[] polygons = new org.locationtech.jts.geom.Polygon[multiPolygon.size()]; for (int i = 0; i < multiPolygon.size(); i++) { - final org.locationtech.jts.geom.Polygon jtsPolygon = buildPolygon(multiPolygon.get(i)); - polygons[i] = jtsPolygon; - } - return simplifyGeometry(geomFactory.createMultiPolygon(polygons)); - } - - private org.locationtech.jts.geom.Geometry simplifyGeometry(org.locationtech.jts.geom.Geometry geometry) { - if (geometry.isValid() == false) { - // we only simplify the geometry if it is valid, otherwise algorithm might fail. - return geometry; - } - if (geometry.contains(tile)) { - // shortcut, we return the tile - return tile; + polygons[i] = buildPolygon(multiPolygon.get(i)); } - return TopologyPreservingSimplifier.simplify(geometry, pixelPrecision); + return geomFactory.createMultiPolygon(polygons); } private org.locationtech.jts.geom.Polygon buildPolygon(Polygon polygon) { @@ -226,4 +255,42 @@ public org.locationtech.jts.geom.Geometry visit(Rectangle rectangle) throws Runt return geomFactory.createPolygon(coordinates); } } + + private static class MvtCoordinateSequenceFilter implements CoordinateSequenceFilter { + + private final int extent; + private final double pointXScale, pointYScale, pointXTranslate, pointYTranslate; + + private MvtCoordinateSequenceFilter(Envelope tileEnvelope, int extent) { + this.extent = extent; + this.pointXScale = (double) extent / tileEnvelope.getWidth(); + this.pointYScale = (double) -extent / tileEnvelope.getHeight(); + this.pointXTranslate = -pointXScale * tileEnvelope.getMinX(); + this.pointYTranslate = -pointYScale * tileEnvelope.getMinY(); + } + + @Override + public void filter(CoordinateSequence seq, int i) { + seq.setOrdinate(i, 0, lon(seq.getOrdinate(i, 0))); + seq.setOrdinate(i, 1, lat(seq.getOrdinate(i, 1))); + } + + @Override + public boolean isDone() { + return false; + } + + @Override + public boolean isGeometryChanged() { + return true; + } + + private int lat(double lat) { + return (int) Math.round(pointYScale * lat + pointYTranslate) + extent; + } + + private int lon(double lon) { + return (int) Math.round(pointXScale * lon + pointXTranslate); + } + } } diff --git a/x-pack/plugin/vector-tile/src/test/java/org/elasticsearch/xpack/vectortile/feature/FeatureFactoriesConsistencyTests.java b/x-pack/plugin/vector-tile/src/test/java/org/elasticsearch/xpack/vectortile/feature/FeatureFactoriesConsistencyTests.java index 5ba51d51636d4..9febdbaa5606b 100644 --- a/x-pack/plugin/vector-tile/src/test/java/org/elasticsearch/xpack/vectortile/feature/FeatureFactoriesConsistencyTests.java +++ b/x-pack/plugin/vector-tile/src/test/java/org/elasticsearch/xpack/vectortile/feature/FeatureFactoriesConsistencyTests.java @@ -10,17 +10,14 @@ import org.apache.lucene.geo.GeoTestUtil; import org.elasticsearch.common.geo.GeoPoint; import org.elasticsearch.common.geo.SimpleFeatureFactory; -import org.elasticsearch.common.geo.SphericalMercatorUtils; import org.elasticsearch.geometry.MultiPoint; import org.elasticsearch.geometry.Point; import org.elasticsearch.geometry.Rectangle; import org.elasticsearch.search.aggregations.bucket.geogrid.GeoTileUtils; import org.elasticsearch.test.ESTestCase; -import org.hamcrest.Matchers; import java.io.IOException; import java.util.ArrayList; -import java.util.Arrays; import java.util.List; public class FeatureFactoriesConsistencyTests extends ESTestCase { @@ -30,8 +27,6 @@ public void testPoint() throws IOException { int x = randomIntBetween(0, (1 << z) - 1); int y = randomIntBetween(0, (1 << z) - 1); int extent = randomIntBetween(1 << 8, 1 << 14); - // check if we might have numerical error due to floating point arithmetic - assumeFalse("", hasNumericalError(z, x, y, extent)); Rectangle rectangle = GeoTileUtils.toBoundingBox(x, y, z); SimpleFeatureFactory builder = new SimpleFeatureFactory(z, x, y, extent); FeatureFactory factory = new FeatureFactory(z, x, y, extent); @@ -52,30 +47,6 @@ public void testPoint() throws IOException { assertArrayEquals(b1, b2); } - public void testIssue74341() throws IOException { - int z = 1; - int x = 0; - int y = 0; - int extent = 1730; - // this is the typical case we need to guard from. - assertThat(hasNumericalError(z, x, y, extent), Matchers.equalTo(true)); - double lon = -171.0; - double lat = 0.9999999403953552; - SimpleFeatureFactory builder = new SimpleFeatureFactory(z, x, y, extent); - FeatureFactory factory = new FeatureFactory(z, x, y, extent); - byte[] b1 = builder.point(lon, lat); - Point point = new Point(lon, lat); - byte[] b2 = factory.getFeatures(point).get(0); - assertThat(Arrays.equals(b1, b2), Matchers.equalTo(false)); - } - - private boolean hasNumericalError(int z, int x, int y, int extent) { - final Rectangle rectangle = SphericalMercatorUtils.recToSphericalMercator(GeoTileUtils.toBoundingBox(x, y, z)); - final double xDiff = rectangle.getMaxLon() - rectangle.getMinLon(); - final double yDiff = rectangle.getMaxLat() - rectangle.getMinLat(); - return (double) -extent / yDiff != -1d / (yDiff / (double) extent) || (double) extent / xDiff != 1d / (xDiff / (double) extent); - } - public void testRectangle() throws IOException { int z = randomIntBetween(1, 10); int x = randomIntBetween(0, (1 << z) - 1); diff --git a/x-pack/plugin/vector-tile/src/test/java/org/elasticsearch/xpack/vectortile/feature/FeatureFactoryTests.java b/x-pack/plugin/vector-tile/src/test/java/org/elasticsearch/xpack/vectortile/feature/FeatureFactoryTests.java index bde9e285eda6c..5e5781847a666 100644 --- a/x-pack/plugin/vector-tile/src/test/java/org/elasticsearch/xpack/vectortile/feature/FeatureFactoryTests.java +++ b/x-pack/plugin/vector-tile/src/test/java/org/elasticsearch/xpack/vectortile/feature/FeatureFactoryTests.java @@ -39,6 +39,8 @@ import java.util.function.Function; import java.util.zip.GZIPInputStream; +import static org.hamcrest.Matchers.iterableWithSize; + public class FeatureFactoryTests extends ESTestCase { public void testPoint() throws IOException { @@ -200,4 +202,51 @@ public void testTileInsidePolygon() throws Exception { final VectorTile.Tile.Feature feature = VectorTile.Tile.Feature.parseFrom(bytes.get(0)); assertThat(feature.getType(), Matchers.equalTo(VectorTile.Tile.GeomType.POLYGON)); } + + public void testManyIntersectingGeometries() { + final int z = randomIntBetween(2, 6); + final int x = randomIntBetween(0, (1 << z) - 1); + final int y = randomIntBetween(0, (1 << z) - 1); + final int extent = randomIntBetween(128, 8012); + final FeatureFactory builder = new FeatureFactory(z, x, y, extent); + // within geometries + assertThat(builder.getFeatures(GeoTileUtils.toBoundingBox(2 * x, 2 * y, z + 1)), iterableWithSize(1)); + assertThat(builder.getFeatures(GeoTileUtils.toBoundingBox(2 * x + 1, 2 * y, z + 1)), iterableWithSize(1)); + assertThat(builder.getFeatures(GeoTileUtils.toBoundingBox(2 * x, 2 * y + 1, z + 1)), iterableWithSize(1)); + assertThat(builder.getFeatures(GeoTileUtils.toBoundingBox(2 * x + 1, 2 * y + 1, z + 1)), iterableWithSize(1)); + // intersecting geometries + assertThat(builder.getFeatures(expandByHalf(GeoTileUtils.toBoundingBox(2 * x, 2 * y, z + 1))), iterableWithSize(1)); + assertThat(builder.getFeatures(expandByHalf(GeoTileUtils.toBoundingBox(2 * x + 1, 2 * y, z + 1))), iterableWithSize(1)); + assertThat(builder.getFeatures(expandByHalf(GeoTileUtils.toBoundingBox(2 * x, 2 * y + 1, z + 1))), iterableWithSize(1)); + assertThat(builder.getFeatures(expandByHalf(GeoTileUtils.toBoundingBox(2 * x + 1, 2 * y + 1, z + 1))), iterableWithSize(1)); + // contain geometries + assertThat(builder.getFeatures(GeoTileUtils.toBoundingBox(x / 4, y / 4, z - 2)), iterableWithSize(1)); + assertThat(builder.getFeatures(GeoTileUtils.toBoundingBox(x / 4, y / 4, z - 2)), iterableWithSize(1)); + } + + private Rectangle expandByHalf(Rectangle rectangle) { + double halfWidth = (rectangle.getMaxX() - rectangle.getMinX()) / 2; + double halfHeight = (rectangle.getMaxY() - rectangle.getMinY()) / 2; + double minX = Math.max(-180, rectangle.getMinX() - halfWidth); + double maxX = Math.min(180, rectangle.getMaxX() + halfWidth); + double minY = Math.max(-GeoTileUtils.LATITUDE_MASK, rectangle.getMinY() - halfHeight); + double maxY = Math.min(GeoTileUtils.LATITUDE_MASK, rectangle.getMaxY() + halfHeight); + return new Rectangle(minX, maxX, maxY, minY); + } + + public void testAntarctica() throws IOException, ParseException { + assertParsing(new GZIPInputStream(getClass().getResourceAsStream("Antarctica.wkt.gz"))); + } + + public void testFrance() throws IOException, ParseException { + assertParsing(new GZIPInputStream(getClass().getResourceAsStream("France.wkt.gz"))); + } + + private void assertParsing(InputStream is) throws IOException, ParseException { + // make sure we can parse big polygons + final BufferedReader reader = new BufferedReader(new InputStreamReader(is, StandardCharsets.UTF_8)); + final Geometry geometry = WellKnownText.fromWKT(StandardValidator.instance(true), true, reader.readLine()); + final FeatureFactory builder = new FeatureFactory(0, 0, 0, 4096); + assertThat(builder.getFeatures(geometry), iterableWithSize(1)); + } } diff --git a/x-pack/plugin/vector-tile/src/test/resources/org/elasticsearch/xpack/vectortile/feature/Antarctica.wkt.gz b/x-pack/plugin/vector-tile/src/test/resources/org/elasticsearch/xpack/vectortile/feature/Antarctica.wkt.gz new file mode 100644 index 0000000000000000000000000000000000000000..c105fdae9a14e5813f91f55ca51a5b34101af4d8 GIT binary patch literal 167193 zcmV(*K;FL}iwFo|)G%QH13_+dVRB=1X=7n7cWZP2Y`sa6wKX-QsX>>&4l8-CYC#-G^- z$a9XSPI@V;i+oOTCu8?3a<6^2n&gQwsS~uVr6>80vQLt4xow>!?^Cny@oz7Ec_bG@ z6uHfPOSW#M&N9`>x@YQ>_w=Su-Zs{~YQ5^~N77a= z!>#*WRekSS)=lzWb@ZL&dr#X*KIpEjAose)Q0p`Im?C2n+Dh_0r}r!JIx9Xo|HXtc z=_Joqx2X4SwLPQHk56etzjLv$a|febL(5LJ~;=tFDAdh7pt@+qwAh4xc==OjGJq+#@u;Q*T4JLDX!eT?-TpG|7~OT znX^2to^g^4cE@0Yd~0cIC;8mf2M5^y#s1$Bvpg6{sjg! zs~ewwkH~B9sh)eOYbE*c9OS4my1r+U?`&P89vep@`mQ)1J(m^av15v$mNIav^~HYv zbc`cYLRLl(1u`<*qO&nXMsFk6bd)o16Zx!NbI=&h9r_?7Yr9+Ixl2v*sJAyQ^{rr0 zkN$^}N8cFHsTx2kscDK*HVs}XfD=tlEmODh=IMrL^MV3o4J~F4rJ(j7# z=4!lWZb1b*V{>yKdu^!@V%P&`EBR>-Oeo16?AddYI0m~OFA2IHBA0s9x0UK)j$AosKz*IR`>f+T-qV&vhqYz!Xy0 zMu=*W7uGCg094wontQoxNMYSzE{(glTtJ>voP+U;r`R|C!L6}^Rh=wo+Q(Dl-V`Kv zLda{D5C?T=fSt-!Wa#;k^5tO0U7u`_1}jC{!GYas4N+quh1SQjgtlB#K~M>2Y9xKl z(!0lfUMCQv(ja%CiKa6lE?d`nx7L~&6O+?6Kw3^Q6{Y-AYv_OLNY84G53anb&p$@ zs{!tEyQuj1-O_KT?yI@u9Cn$7*e`Id$mH|fFr2Ge)ycl#C>ahA13vHAyrF%BvboxH zSPf086Vu&K=0fW&nNg#qj^t@-Wz;S*j3eo$Q)wZ}&I1=qH-QsN5gEqJwI(aoozz{@ zK%mOPQc9FmEM%30!5piW6>97ZkvCMdEoJIJi4rLGqc5Ukv1;sBb^+mA@)$IVwPaFr_jWIuyVUDJFhM0wjXkFxutxGcPhaq!# zQF*B~WUuTf$RF6UY7J9YMkKE%qb0e+TyNeP=+vHM*ou&@NiMDD9AU4IC+9GMlBZ_C zRJgav(1VoSUF5T`jYv#wC3QmOYDN0qlJRH^4ZWwjhBA!SGZx!sYk|hUN#<8{3?PP2 zDq7m>kX%Q7kCM#F)~A>&vC%1^K!%Ez9EQQNbALgG9Q0KHslskZyrC8*aN^a4W_ zi5!@9QsJP2JALhf@p{!YG-%gczPmoKF{JYvCOb7cXlEZ%YN)BM8_XB=f#oRf8q&aL zrbAe%j{|M#V*rkCCNEqZe2KiWt~ePih*kubkL%gs>fLpuA(T={EZP-Ulf>5DvOMgm zVOL%_y2r=k7UY6U)zqGYZ<=It;q6GXfvsCKNgDiD+XxwZP7WLQ#=MA~4sngC&&@Zb4~ncCuo6 zsYotjR_dD1pkZIT;{%QC??Gitr@-EW(V)?R0i^VB!v%+lj2Khv1a)B6#xblW?4lWVTx_>DeXVM<4IBAsZHo|ce;luAI*e#OPTn~+ zXfU~rUi{TG#Z3#zHfSG9>jXpWOt)T-y4Q3c3#`>NLs-$nhBMtJL7w;8Y{mzViLHjC zjAR&+CLdT7Rb~!GcXD))RAZ?%Cf(Z>8McOO6dJl!ts!}B8DQeI8e3VU?BzD5O?5wS7)BbfS(f%%fYLCd5(8fk0cWR1yn=!c{Q240`b9&TL)@ z#CyIJFOpji=M0~ z7pi6?8BL~SFs@DM%OiQh)>J1Q>PM}i;7`rvE8$jF-@I7n)_@~h8f_R~$s6HM>VVM} z%*Q)AjpZb-Q}#|OtY&q5CvAYFLb#`acgc}Q;^s4q%k3&}bT}nyjkYt!!4JZ&K1t?v zrHhQKaH{W1cfvX2XX{;f)va+DNruVTMV=7v>SW|WA{ElJsxeHc@fwF5E3}SEEGdZ) zHz#{IIJmJ&AXnIFpt-i2Hac|&qfpX8=LXV0dtaaRu=y?INdEhRFJ zyjnvLr6%C``VOhE>4Jm6%hot)eXElRwWm)~UFT|3;b6z6mINwOt#$3=E%K&2d-FVpd(={g#?1B8~3K2ACecyw#t%{F}ix9DW7+e`F;yCZDO zadb3Jy5&ILo5xWceDab5GK_=UJ-(SLaEHxTbVd)~tJE4+&D9BmJ=u>wd7;~{P6u{0 z85??jK)oLwgOR!sxspM(ysS}IsTW2tXQ$*=#$XELz9H0pZoQpbHFDm zSQJ`7OfokZms?n~t7#x;JVd@rGe5n=tK#Nm^<0ga7S2j)gAL?m!h#g_&`-(tC6ZI* zZ@vsci@#BvT%{Qvqi%8)abeEgYgF1+7c^4EsTl9-8XOpZi_5?XJEuMA{VJA|l@|w% z4pW)Gwsz8G-PH$FZkyF>REH%W?Bd?MqF5W9I&4eP)?TdWXg?3*q;?wfb$zFnpU->q z*D>dkLKREg(3N&QXubMTFt=hVYz;Rqu-3HD__Rer>Fav&1`T70y_TjER|y~4lAWEG zF16k@*^77K?QOv*R`v`Nu4%}0?n&d)-LTY{*Cz4#oVY%yHQ#DluF>QLX^RXCNe2=A zNjCA$Lva}7fm^~d8GoIe3#PriPbqaU)HjElKi!w~8cLY?mfCfg6r)-8QfB*(jPkYVW@FW|++Y2*=r?UfG1 z$4y150rKU2=Papo#)6($zant~Xbzc3g(t$AIaOeLzyk(qdzDy+tnPXnYX! zUD63N2sgyu9Fq?zUtjW&Zr(?)v`pojeoZo1)ZD-zhG8;zf8-Zo&Yi7JZsF63`%Wu! zA9`7(qd$Gn>RvX8Dqq@WlKXB~M~tqcqSi2ttTrkHSPIpPt3dTYU{SXe7ngUmCI*Df zm#=#y!=k5 z^3nn_gB9Gm;6pi=-TT}=G|&VT0VMOS$&GPJ$IwEq+ujj_>6TqnLRnzIuqiu-O>?J7 zykNn!sB%RWc+GwwZ^4;2RFN$Nc5@(m@j;&vEaK;4}r&kV zh3h#wm_-@(5*qG?Q!Ka?_W+F!oYtoJ4q{;HgRq6qH8{2cbgY!vrq_W+%jjbSLv zuzF$?u+_H6xKdP+AxCD;5FEd+TjSQ>#~<h z7sxubwdlPk+;xgk`KCp|j^;r<6 z8Z?wZOodcTK#ieXD(?;?ZyJb62GfsVJ&@5~=-Y@z=@H2mN(|S!kz^QdH5+eeiMWqN zq!D8bgN)^9qVl0(5Nq}UF4&$71XI`Q^(EIg$)&BL zPWb$Kle}m`sWsn+MIMY|O1|mwCL%J_ephSUN&E6zZ>=>N@2v&t6sYP0H;j2+9}y`U z)(-?o6&aWM<4HD&U&drf&>lX@o}-1rt^R5c_)fgV3TK-6&_}uInlYYJqo(&zt?SLF z$yn``v3Dd-987%?6Q7!TtvzmmB$LH8^*UZ3n67yN@~Mv{7MU5F!0?YTZ!vjfa1j|B zYjf2JIZj6jhj8o6jNQ`}nh`EVdw}!R%_Nj@N3ECM4l?p(PYoN(STx8bt&Y-uPBZPZ*&rq|K7k`qQu6#jWz2rVN28sDV zF5ZlT%*Xetja}P*&xzVNv?1 zZ+b;@)VM@93jo-&G{eJip?z%f$W7l2G%Mr!q~EQ^&;&lxYi}C(K|NCPJkoq8Ru?y; zfH{@D#Z9nE(+3>f9x=c%?Upff5&bnZk6uSc{zRDTy4~D6GYaIVdcdNbE0IrQtS@n% zUK!&_8Cxgz#a;PG*G=9AB~x)<+)}U5EAfQ!Eo$i~T@g*lSY@RMQJ>KYJ%jTDJ`>M5>MHjbc5dP8_S+-6L-Lx#=;@1 z$lJpkV>;VNE;HZpK<vM#!N_9vL+YoypZFYkqPTWGgNSbiRb*PyG8`e)!$jPSR&LKE#S-UfJTzc6yiH*-a;F(KEgKl}^5nVOe9-Wq zXNs~-7woR);Jdq6B?Io#?;cNqAsSEOIh<|ds!xOfedw>cZB2!(4O-t6~d#%u79j+T>A!#Z7Hwe3C_3NGr% zoRXl9jLnIoT_Yqed9B&6(fXcE@{NLE>TsPNv6m#%A~4x30Np%wQ(OmkrXkL_NBqn; zUQGn7FYno6^gx#Z2XlNMyNU|$g-OQ8wj7GEr*^ljuW2~ZzY3*tMW+3mRJpfPxzwq) z=wbUvFd$ex^PP1{`7yj%eG~-<#=_LuA+l>ei@moHuX)Oh)x)B(Ie2B zJ|&qDRTSszo>iV@aL|d14{d zn##$Y;HE99%m|#OcSbC49l20A>qDc)ZN2r}Fx>pl*31`nW~R89wDI)t#l*Ce%Qtw9 z693_Pb4qqS)_d~c!*Y7Guv+As*->5*KDx||Fx0)5d>A*9Azp&B>lt0h?> zICM%f!$4j1Dl3jY-E}lPI{1nlioLZXeSnL?vBMK0YKvFtZLkM;)2*6)~0LcmhDvN+Rm;E=lICWdqB_p)j+`4SG!AlQTGENab{wNS{5k4Hp!kz^Q#HT!@}$WU*RnE|?zeEJ#JourR;F^;X;prtFat1+WmrRG=F zrF}7cu-H}1%%hvbn^?r6FY;)`hA+zV=E*>9M9K|W;%tSCuJA2>w?7hbJWqnbB)AHR0i9&yykseXil@K|EsRgc3L zpnxJ(IEIh==M&W>%}h>q>p_wa^Vgfj+~nb>`PQ~ibh|}b0Q=U?`qMS@9}72Gp}Ikcqv&KDp6xzdg&Q*B@4_(#H1?#teKI)gFk&1ICGV<0f*ec$oQ%+t`@ zH=@6yld-IL8Y33xFIHeIOpo{GZ+04y$a=(kj1-b3jp?4zB>8xMkwto{whOFjgN1zB zvMreTn{%!C+{8KI|hak#%pX0n66x9_z%3f7#>hp6VYGmLIaYaD9_QQ-)+ z>!XGHi^ye_yvcAFyauN21(8v2*Pz?50mqa>u{v)?O@U&#DOj0odgB!PbxYfx;^BL_ zOv%IS{$C^En?hM2pvqTSZ~0NDQXREGjiseGFS0*ym*NBcyq1_fn@Z(mT%+k zyhP?&>m)In-;sx~*)*3<&qfl%PHUD%iY4L;Tssm%n<;<3yG61KLfv6wXCz*Jfi{vt$@W?uO8Wi^lEpupM7h((Jb*!2pWJxmBt z-@MnVH312v(-uXb$A=5tlS5sX@d)i0S`w9|)YDM|cu%W`8}h5Bzrz%bi2tf65m zjP<6zb&CE?F|T z_?5S)Oc}{3LSLnWlv89RSoRHlsiX~tWiU5EE0KB4((-M( z8PxY;z;u!+x29T)7ZzhDm_L$K7+_c9V}SnrLmjk>axyR!t2%}ViQGd{%T*FRp9Wjg zF>U)y1-JJu3!gDaJ8@E0T-B@Coe>g_n}@d6kQ?>r6geVIqbayUQS9jU=JL}gGZY7p zX+(Gy$#g|1PQRAnSyz~Kncu-XcCXsQ8W-UtS6Hk`WfXQ(h8KO2C*@utGbt4TW13PX zg$au{$$aOFV;&i8eJH^YHex`e#AQ$zB#|_T4cbA5+RUe$NE4e8UraJ2ZBU~(l!b+eNlu}1%yxg3M>`Tyu{d!}-^_;@?AlS$KGsW*$kA1BF- zj8ke*rS!?Z2bBL(LTq(p3WHSVtj?3g+`7oKrWWbeUjeg{9|I zY@nONrUUFM*MzYM!ISKRqAJOaR_GF0VZ9)ODXTkSSfg6=q#cvN`C6&I6==XthQBy! zX6(oKwo=ZSQwuR9GMxZ!d~X;&^ooFU^})foh5R6t*>Emg=X-Ish92EcvxB;hklKt0 zPCJR@$nH!s&i__E7|vp8kDShAF4Ro3HsEQRlA?%tF>|deFMlHAyw01AvC*dXOLUr~ z?kVgKK4JD<)Hp&%wCAJbGbp{kyE+M)P#sNQBo2}KZez5SofP6VIm3$y$Jq%1f2uz@ zMry&y&^aw1d9|eoW+z}Lb;3)sW&;7xJ?@K(%-tf_;{b~Tf(%7k zd`!byO)})4)B5JlTzgva5YyXa`pmPF!&E|N-|+=aWQ@8vLH*QRKlTkbWJ#RFHYO(>P9s8hlF;VnwxT9)SRl4CaX1KTo(c=97zD z6_`shU3j^Ei!ngQjJBp0iYOeXdyab@QO`1;LB`DxP=i578R5RdYh2tlmhvh+kS-tX z*e(h)j!Zkn6p*av8j=~-ZgQ7oAg)oQHN~iL8&EFcE)ag_4;iLK%Eag+O>dGfO!=b~ zIm2Dk6IIo^FWFTDpulZa!^Uhq>_tF^9LZ)>iTj3zY#KJ9M$~$S7b(f;TuFw!pY&Wm z^qWz}N#5mXe@h0?M=B5g=c~{m-9X?4^cT&Xgyb(=PDVIdX zt<&p=HHZ|Pd;zM4D;YG~x5>v-hZR}Gt+=MoX*iWFTVezhkRfIc#hA#Ap)5(>H*+In zp-u*TkPJqj+Ok#+!vVD&xj?aziXsmH7u*@D8O`7|4DZ}#sMZW2gr&&m)#^dum7428E2e698P%a>nvo$S^3wc>=QfN0!@Q#GnUD6v$*_bv zQtLIYVPr7XqSe6p>fSDBgGlJ2_W>7c1F}Fjcd^D zcq7&B^y;Z+ynf&>ZA&5;KjjFH>(T{~XLpQq9~ttbo0|ZGTgme!f_z4f1ozB*;$0cBpvG;a!#l8EO2G5*1rryf z<;D}5I$IO?D&;;?{fLl}fw2eKrn9G?XAyk2uyU8=l z@fj*-FcC~m+Yx*Vw-?6$)}VK$6UMPy7A@bc&w>5vnM3%fH6(DxopKnA1X63*7Fwr< zQ((}ea|n-?WM=dk;b&ZpkLhTJ|HAI38*79$RgK>SD?u#GoUi$0NY7X4SnDUX=%Cd2 zD8D?AO#~XP_0W4w9E6^it`QITmT}B?%|&H|oJAaNG)v;MZZNBnu5i857F39Ak8j3v zTz(OzoRQBMX*;#M6r?^(f_DpEs1GG*`q?eW?~D=qP8t~&lycuA{XG3PB#+D&iPn$@ z?mGj_zi`}s@M?`X%5}9+a|&S670o0}Mv9i}&LE6Pluz|Qb% zHl54D^U_`vd2}HhMj~=RjHClSbF?Wu3D}}RGj6_#jDc#3dsnds-N8h+N;2b$tH?~c z&EYXPvAH#$ZnG0u0QmwKiUU`kDe_2gTYj=Lqg3Rh%Qv%QnMIy`gV&7`c02tFN$xY_ zIKEe8)7$p|1m`pva>YAfD8uNvco)BxdhPx&%n11)cA^8_3xYiiB&vwDsY1o0HywA) z?3%D{#(Xr$8p#k4A84~W#W)}j<2AOH0qLDca~2hrD(hR)GU7*F;jaVoPo6+3u+5gWRCtB#R$?-MCi23`#J?5i% z5Aa~GUcc!q4QjKjn2SKYNuCTywK7(YTc;ti4KN8cpZQzqz_CCyHY5Y77(Q-1#lVzH zGEC;9*7(TKIx!f-h^R!J)ahX2sBNu9Pn}w?^B_8zD}D9JGt1+JDT#ygS1p)v``8lt zm0^|M0cN)6WEj2T3!82tyvG;$92#F2>dM`MeN&7BRLFYCz{Cc>zT;3`ij1pPd$_S9 zkk{ga>#-BB9}=I8H?v|JjB?2Jz)Xf2geYu1Cru>SeRfXcS@o3(U$QgZ#~5PEMr2D=?T@smJgjrQzy)qR4nn) zulgpa(y8LIo5>wB0EIGNi<0Oh7y`)*Xt;j{NMJi@1HO4`!wNG9bg0+W+i#F>)lnMC zc8fmll?6o~jJc0Vnc7IA&bK!ZzKtjOFxyGwnpmwQXF3Fl%%~)h`AB_*a3LA0Dx`j7 zFJ&Yh$wLWFjd!|?@(=RuArf0a8x^-+#C}aOc3^u!AjP)GTX|U|Gn6Fz#&yV7eH_xv zl3?SpjRK2H)l%DIyg9y>CQu`X$53Fc9zEW1S%{pg?h}ShS~7C5kZ;rZQYg7v2&-hy z!KRC`nf+zlSuAvh!V%wi3eTz#>9j4AjgMF&0!=JZ>UkzFG|up9e+`hKdPjS6604uo zsikHZa`#DMRH&!eGRi3s+i~o~Ak5aX8B9E}JiE|OecB9O%7>&2eLVAhGuBXKI+g5g zVKlfpfh}P0Zd|;R%eV(;6}wxSa=Ri-#S`bFVbR3Z`+%+3wAK5okUeAPO_Tp{c z9mITkU1g?ruVRHmqu=XP6UC3@cB+l$;b?k>JJ+mNLGlT3pNNfK-M0m1h-4SAsRR~T zBCc6SV-a3${MxNWMdrcXOxht;c>y7oR|Y?j{H_%zyrAm$8R!M_-bCD?eSb)#_8rdp z@c_~t#Y_z8Q|**_w{y;}4ciZew`nZ}E+h6=Q~|(5RC(z(hAIrms!mR?@1nqf2(1yM zn^C`s%zR9S0JQy3PvG0-NVYBXc$(96uq8IGaq0D@&_nyKCNrO^IQP?@(}Q7fTGQ+2 zIGQ~@6LI-|QHqy@FQp|Xxp>AskeT%^Vq;)7wm-80(?4K*3?$I-0-_5B(DU-muD;Pn zvDc_G0%3{VUmXGixRV^I2O1!eva89%MiP$j)iIi_+05sQXA+s~U?(J>eOFGMI4b>l zU%CZ;)RNe596q41XkKxG=U5=V_a5_&qbK?U$fGqI-HglEDHwzl_GB=}DKhc*eD~xV zc2(a*KeCae6!REK^Er=1vZhZ?yB7GI>0viq5pBv45B~i6Vq}L!r4Qn@L1I-4&x=oH zYnEEDHo0pR?O0#e1{h9FLNWx(b$_?1vxVWj8u2U+vuvzrR~Rf&4i2vjv6E>gGuzrmz#D<_o(qUKZLFyK@a}oDgJAgDwmb@tuV*w8>96 zQms6{EWN_NS|{{}wzp83`QYuI_uVLfaIZutu@k1q;0udkR>`>9^@97U6#^{*Z5a2+ ztyM82_F%k=*;@GsOYqryUmq$h5@f@B@|vkIwyzDND4OSb6ZUmg6?zVf$lNA{c{W7~3>O8@JnOvgPhHvyk}G`*@2SJD-suLmyzBuKn`9V* z?=7)UPyL%5-aL0w?tS{6IXFqKr}*AQ-7hW~jG23vpqrPVxNy7(h)%>Hkr^Ro)oyol zjgVL`$-9&A$+A2(G@SOzOI4fo-Cz>to8)re#isEPiOk?v->V66puU-9@qEJXRQ@1i zO(fBK7bs=i5aw+Dp83lEjPpTUAC@inZS|V+($mVYC21Qg~Xs! zrD45c8NBR>Gf^ZV7scE|Sy39cz39T3Hg6mFXDPsMthF zXI^QxXE!ywO1sDw=(*Ef(D(gr{I_U5iGFWJZ7kiC2dOam#9hPa(J~hXz*zY0H8e+v zhZlna8>&d3GV$p>QmmQ*i8ZRz_-+b=t7?FZIDdWvhb~0lug)I*;_9Q$+5WOGO!&7k zogoq=ldX;;Q{Ed&KyDYCvCSEH0nlCijEZsQvc^+Gvw&}y`Vg78{_l%3-<24dw92dR zHWe)%NXymiMA%)8k3M-n2@xYDgm6577n?xwteE3Id|~p_-k3|n<^@B;b^)*;Ust8u z%)3(KdY6yl3sWL_Ur&ay_Hq3t+m8EmM7+d{T!+iM5i;QVi@iMY4iVO}^@(ybCa-jt zax$&G*h6O6sP$yTr^v8Ei^#+s@;fB~adSGbkY;%UoOyeR%(mikaD<@i*_uT_x|NuU z*hRt{B)u(g=H`ivD}+nU)v6ema3Y@935A@>-I ze17-+^;(?XWD9u08){9U*!OtvtFx$+6)_Vg?~J{UxV!2nT{=ZIz|}uNE|ER2zKKQR zD5!RecAj3a7f!^)-{kJO>U)}JO@!QqS+`Aaob}8vqjR@jUq8T58PHA#@kgY+V5~sg zbnroMLxV#X%~rf0;Mw%f_t49`M=mwvy-a4cu$rwS&PvoX69hNFN~K}L9kSm{j;eo< zaiAN!zBt={L9U}qjxe3YPs_|l(%LbysQHr&3m2I{aW8C@S&vC3D3eA49T-&$g50xA zLR2(d=8(aBO9wXBmfC{}m*qY(4w;TMgJ&F^J6QNAN5U{apGZ3Os>p;kcPCWN`AIq= z$NDppz(?@7<3&+qJ$*MiWVa+n+YafVtFIo(=f(s%lQAakWMfT3Enw$+Sne5}+r`&y z*1=sOPs=DKhZglgbShuj>DL(U%|?=P;W<%+ysmVm1T z#blHK8@4bDr-|%<=fZ~#^}NOtTMku-wY#t8WgUr@S|X^{*HgZ(c%>PU?)Xo~vJ|=* zUra*0{)x<-wimV1PHs8#wA}|*KNEt8-Tf&Xe3b!GSRka^wR{A0U?gc>pPO{Nmhe=-Z0P^%)> zGSv4Wo4sU(1U8A};5Hrm0%mU`JBhg9Rs-^EZdf`@ zO=S{@$h`klk^$N~^~#@!Fpeoi9redW-QOqfaS%_f3z z4x7T!dSbIGN)7}{r~63Wl@I77?_0bi#JsxdWcQbhSA;$oecwcDTT!|xTGl^8AGF3(-q=6qY}Fs zGmSUNgBbw1NK9LBMjP+mM_sq72XTg<+(=@IoaQCpT!68LqnzYj_ju$?a3q;%FU_5l zs2msM@+#YL%X5z9B_>iy=Q0!Q$Qf#f=u_h_nb$;-89U`ZSf`p>cqpEhv)^vixlHn_ zR(nnYiAT+^T|GaDx~m>WYfj}oHPf4eEXYL8V`hj!bX@dS$pY~VEK%!aMsnsLsa<(8 z5l$MYdZf0luy+Pv_J~6z8TSHbhB9_Cn1-O&=M}2Np=_GVIh25EjVV@~R7|Ey%lg>Wy#gIT@Do*^f^X%RTx&UeqQmMP|I;D{08MtP+R^B;#PXbSKl9 zcYbkGT<*8$Q6h>Z+Sq)))_3Hv>2I?{;A_9eN7LOomITKsIX=FLKQ5z3L}Vy;&z%*5 zhRBikslEm1x`?jo%Gr#RZe?fd$*M*gH)9&E$a8DdtnQ^b&T*a$B3q0r@}AD19ejfk zxu5MkVaT)y8)PjzLPL7BiTt0uGgzR|>6^@;%GG9hUr(m)sHG<|1)wGN#+BF)0OG7R@Ve8)jBc0a(0cnc4v~) z-P5vfmhW~-du`h%5;mC94_QfB-WEp)?C@tPygRF|uT)Ye) zB6VzKQ*(wlpjwiwc$N{7KNdNqJOl^s-L!xzE;7r@-EES6P-W_a8)vynRA#dR9eWaq zlu24s+zPiCXA|Q?oiK7myUQX9UZ)`ljtzIJuq+L7<9s#1T#= z;XJ^n+Fl0lvPv#03AnW>CiCBeG9at*Q_HLM_r&hE3q>)ZkTSnXe1D-0X7iA1z%U+ zeQb+4%3YT!r(>;4EiqrAYb22@PhwrK+BZ#pStG=?d`0DVzRriFT(9agq1Dt0ZVFkr za78}&);VP)rMZ%|O|5?l)4Km`87>hColNqnRRV*UsCRhF(z_7kb+)&rZntf&V9km` z;_J>JMXl0+YH23d?&{bOC}LG+pDisCvAT+S?jyllgWQjniBVIo6VDT~b3K@CSG@su zSRZ3>%Jn453-N)H%#0YfW*CXc^eUS}RAHNBUVgn{1T4HF?`9UJKcJ(tZ|fbA6v)iF*r6IGA!k4V;KF$)G@!8A< z022q6`X<|YrCE$tWLSFbdS7mn(j=Idc@>ve?G_b_H-?f=_7iRW{&=!ZDWyuVdrKDj z(uc{z=byHygcicX2o#i{$ah%?Xc0 zZldEQ7lg0q4^FBU34p>grA`)6#nrg0o;;x>`+w7v?>Aj5?G(mOIc}1tsy~rT93YX0 zYKu?8KG+guO!QJ?n5RvOl&q2?o z+Rmm37j9M}hXlDU?;)QxLRbe-etn}}33!sFz~#Fm@MjB`GHGIh6hy^-a*qQruN-vT+Sg`Ou?xp47fXId0v zA$d$UCWKzdETXI7cTXi@A8V3}KsX5Q-2<~{5p(z^NPEnsrOYC(IdiSdW+xtEN#^^W zTjLUWa^|!3?a4p|?w$i-9i?J^Z?%_PJ_dbVH|C>LP_Zq=`inUx*#*9)=n?L~h{%7E z`Euytu{L9_N0dI?kNcW7eK5Smoe(TZt(kiJ$Y*GduppksWYzkb%p_muoKWWU zDMllPcDL~frKEGpw?&H=CR9l1(D(gRL|YLE9h-1%Y&H73#SMgZJ2p>N6dH)eW4+eH zr-NQ*kD4$O9>=a`5nN>gEi3l1S3?LsOErq!Tnlo(Nl0Au)_ub8tL^<_vDc4{xg;&V z_p1abg1>lt9*YV>2Dx~ZAoz;cbO^9xrfc-EQ?XhrS*s+dbV-ORXu{Z*whVMf*oRZK ziM!iMBC@rZjA+olU^DyJ>|WNpAx3c%4Z4jiB2L5SWF~K{UMs#~pS~hAC0eg-M8G}r z9W46Z4@7U@EN2nS=f~`{Q?2l@8?49Z#i61gp3DPealDM&_x`)a%Coe{a+QZ>NMq!*2(s^m^y zVsjis19*2>R)ZQMv*MNQ-4oG7K_1-(C9xiwK8Rb8(Hg%e!wAAR^;J9$f=qhL4)a*l zH&Yk1tk{~Hos_kTja8zYB$Gf59(zCdD!Ou=3WIB^_n-wwMPYz$5XY#!-jckW5EPB0 zm?g<{>rHn}XIYZlxORl$mr+C+WNd~R>h^r$Wn;b*C|5NNbR%Pg>_m! z!;(yQp>~GuuA|{?6`1*EVb0MQqJi<2mhEDKhomj{e5W8MnOi0@{_OW}Cj_$70QdDe z?ZN<6Ey&(>d2OPYX&}X~$0HDkdQP2z)pnb0)l(uF*28-KmeW>l&0*@2$vD1Yn1alc zCu$AM__e~(vcSlqB?EP0 z*nBidvXMn&RdE~*I67w}Wd-?E!&frTuiZbBWTJq-coZp0yjEx>?>e0aNoKJeHD=25 z@{>ldfejIJ+*!|(&kiiG>lMMR*klYzD?+eFJs>gATzqy|JEOUest*$D%Sg4fiCS(! zY`PufUB_-SF58fxe6z`p7cV1r@bYm~?P*$}7? zMU3BJ>ED-_WVX%p>tdZ2W#Hsu^jZR$*X*Q4!B(ICrSkevx!%;2?~o`&2TNUw4J$_iTM_dU2KNIJ>T%tq+_5Yv9YY*IcW>wx>$KrQl7Ej25jJ*sidN%1vy*!g5Ll4O|V~IxxZ9y_Dje4@qnZbYiT^cnZ794`c zw@B$soQ>|lC6*)7wi7ycnOXwGIaJ5lhV$LDW~6>1`X$NW>mx&nRmU8p05d?$zqr7O z61S|*>G3iAQPSuKnXfYcCku)upvgE1SNh#H&xBgdEht$iPKm#LFmYz54!V(296ibs}WD60no?I2CDsp~u& zroAPZd94qaIqUg_kiRdO{l&47x9Jbl_^66SCi1&+rimz_vv*!1?WVKt{5oTtdfCmw zat{aELfcojZo9q^KBAWDpw_C~{Qx}3*HwzNy&NY$7_4<9MAz^J_bb;v$)mq0UdTc% zYp|sTNOWgyaHZaH{AcrZiDl7WIQGfH6u-KL=)G1#rJoO6F#f@^e?5#&;=jl+WnqFB z5v#n3AJUxgY0FmLXYL&w7n-|9(RHb9!>14ocKW!p zZ0$=wP>rn>g#*{auqB$!5}6N2BF}lB@zJ`Ie9l+_4ibC`d)R#kWY<43j^;zFCNQCR zehK7=`6!14HpKH|Kb$@S4amaUEIBN)AOM4mo4XSsIGf~>LDWo>&n(&n`f(p@Gd5Vt z{d+o_wPbVLe2sk>gyq&^qiNLo`n~~N6xLB4FR7A63e`zn5733aclQkrFs`rB2;=mX zdf()seZ+!uYzI_t$^`9vFOPb%zET`B(_qkRJw9ebfcm=IQeM0`>wl})$gxT4WYDd; zg$!`+{v@KL&460nGZf?MmKVkB#2`t@?2qA5qpXPT-<6&RXRk71TM~eYw6E(n#C&`v zbDAZ2Pm_rN`zyghX<$r>9DgN%v(Dsn+dYi@oFvJkaQPw=kg*oTucHadeTkl#hP#`-u`wkz+J{3y8Dhr-u7Jo8a z4byP8TF-98w$qkoo=$pG6U{J&N9dI#GYCq@pxk5BEMs29;TYFgDNtKo$CU8+&h)2= zw|&A^`H)YM)Q4nT2Gc3;ep+6A0XDu{B8z1(%?UIZJo8cOgBl-o^(!3C)dt+#!oVh0b_veodyla0Y$IXTYLgca;*a4M0qzQo$e^0%J`$w)3mYB2D`Z~H` z^mPlX4Be3-x?z=l%I1q`c{zJ!v-eY zLGwzftanP=UeyVaVVp`nR$gnklhg9a2wpMl;spHw_}8e3rtc5dHN1S-4l83Pz~{O1 z=dgV5^sk5N-bgAODoyBx?g3z+bt57w79zGv5sm4Q*# z1csFPB|M1*CFbLM&a(wqtxvQ#@r5aB(c)i2$S#>qqUekwwyoQ80a<3 z!PNjhZM8>c@rX}q*b=p!iXturVh6B`IA%U^wkt6vxH7(CGYaEf%xEEvo#;2 z99|BM*u?HE$z#6(VL!Jz;cdy;ib{DTnJDp}PEtLx(%ZOB4t@D$QJ4J9hGU zHWpqak~~=CGRdrIq+t^jX*#DBtF7a>ncDP#K3Jq6$+#rEByJ_wlFTi068D;0pIq0W zVIQE62vJ(om%K6+NX8(gGhg3)I?4rHp>F-jkuljb3QNCCa3UNfwXEXgOTJ3>>^kc4 znbR22Rz)uJA$T))CaJ_L_tlE<>sMq|V~v#gx!p&2iN*4)J+(zcLTGj0?Nx42L6Qg)VIg}_S54Pp1eGq!C_?{lkr_z(cw`TqJqFh}J@gLk7h`DN zp5N2O?}N_D*BEwqt{yaOIUlC1Qptgw{&@GKRwgJgKi3 zh+WqQz`O<&YebdYCqs!jksH?NTlZpPb$0SFUrmjraU;<#$Q6pyu$5mM$%H^lbG}_m zM%CMGyWq~4Ps0)Oa(oA6d7v^yUi;O(va*TR)%ZuSvW_e^KUjI(U0c@_ z$Fae{M+`|nmS}rd@5YeZBolqq8WL7i&nw4wG%W+0O<$*k2W zGWO0_E{NMEBMRhK#RL3)#5yb}XGoew*fo<|Ur#IFjEiTm&R)+;F~*e1MTefjNEj&` z?x_*4`8MaC)L~4`9M2J8zXPKb&Nem(4*rUrWNXJxv8WE4hKEm~Co8GUNi%m9gH% zO*xSaN#4^|JPS3dYnm0tbmpV?$(5or(D2!tWkzy*kej8y>khBu|71=_xvzEWRi9*@ ziP5ZgX#q8%NE?@LA*OrJJ!63{<7zL4fF*gcHl;oZbLeCrbf+8YjmR%E2eKkZK;)hZ zl~mufJFyQ%WSE-Cd*q^$ysvTL`zm?KAQ@J$ThDxA9?T{&Ix3@VZjKH1PxWd^#O!0hR-IMP`R3SgntcnvL0?NUznOY zVQQIMy%sqN@ECFVpRN||$ivWd>!a=0QV!{2n$27->+l6x=}A$C zZySW4$wytCFn~dmoUF2F9#L%ejFQ{+@kq(1YLbacFwAJZnOd92S6HT0WGGpkQbK>d zt|?~3JmfTY4P95XH(iBRe}0iTqF$-R37dHYViD`w)-hQxi!qy>{^BU{mulkYl61z1 zdbx+&61C86nLj7CWZb3N;^H$U%sOu*8pmL!R~Na=>(&Hq6%+Te&BU-6GPNygF(-s3 z$*kYu<3wLtlH2AxpAO%ct|LMFR+5}xkUmZXOPOxXx9lVr0y12$b^?r$Tosh|O+FFE z+BHBb50hE?$HD=srn$9pO({uwUU#BzJ-)HyCiCd;a%;W^X?(2xGj*JZ;a!u=Fc%3PmQ%cHy_eh-QSGw3Z)P-EX7EtDlg;!X ztrU^#{K@p?g*Y1iVi?aR!w~fP!I+gy!~W)djO3n`3_}8zw1-LNs)++{pR-*MGE%)ONLILCbu-HNsc>?SbJr3+>DIiqvP9%iZ#7ViM~a0 zJnV@VSl=j_6-<$yD>7?smgX#LY_U!EtPVm8P$rRC#Z{d!oma=EFswIMwbh~Ry>U0s z)vFBUsy+wZ_8DVa_V5;5ix*xAhUU(Ez|q}xT1!8-x6xF4?03z6jnE$3{@PFcagt9`OEE2(2YHiJO!I(aO6xvw{&UX72>xl>=N!KH))iGt#Zk2;y5n-#qxai1v$BGb|yNoILhb;3Hi zF-Zomm8|DMG7B)Se-v9+ynakr8`%kqPhXQ~0whL68nO08?uq&w!b zGZ<6knw6Gjq@HF-1Y@2YElx6mg+T^wAmFZh^oYMS(gb7vb`d+@$lEz=oAb@?@n1Eg-pN<^E1q%Jp>kbTdRQUTwnN ztULxV8uJl?Ut}z)x+WyO`iSUek@1zHNsd-DnaI&o<4y$1++Xlv_xcUOUF3@3Dtp^B zSpjQAr78J<9ps(PG6v|iL{cF6W^`rLCoJAb-tKRHaqvG61e#Y2&$=5!tV1*b^~~T} zHEwrI9U3M@(pSAG2`3`DpS+X^{&XQwsntF5341n`tQVf5LIt!8gI!vXNsOc5QLoxDmgK0Xx}=y#(^U z=UV9SX+*7=+&MMs(i5GW#nOWW@IPVq1+K;`;zB%^BTlUNYygwK;# zr(;(h)0HH;!a{QC zMW3Xv!UvKQaNi@r2cnPL#qLo`%Z$weDY@44kXo*`v!=9qtK*$szCB7Zw5lfo3LRFA z$UPvI_qvu)HGtM5a~mJ=g0oD~AJhi$HR8>5h_SrIbGWr_jGx9^KRYtx1ubu(Uf20GoG>z9ef+xE7! zB=ij8@TIf(9QKL**SN zQl!?EAgBJ~5>6}0$`K~{Fcel~2KXkKg=w`=v@gUBmp5IFW8&z#@em?Nq=P-KL~9Qk z2J$P~8qP{_Frf=YCLo~v01T}47kS$dzfYxrM=jTTB+ITf0Us4+CZhCEpGQv+&^I>s zp|G372x;z%8R)-KW84>-*7Qb;BvWH+iZsal%rzMVu2G-#(#9*-iTd$$b9`@-s^cnmo>F%4DNE~`a?!=7;w>Y6 zyUCb}TN8Fhqu$LWO1Yt3-kgDjbmPkfF}b=j9lZcM9a&I8*DpgaFfhjVptXxoCr8AS zZU@KG@s!Rc7W?yh5b;DlvPviyeUUxOfByVi86$f2#fWipYi4MuwQJ_ysDqTWxn2cD z`itzTBh;tJa~}KkszIcqkjat1l=)_FDhzwEJF>h7J{DY9YCWCnR03<(p3eGS>}X8t z#g0Xi-cxUBnV~fTX6%*TT8z1H>+Pri!dOqaepvzf6Z%-2U9tUD0d+;baNK^vDtW)x zlJI1|!Y70u%WdpLx$whvC1`h&&nxFqz&F=a0uiY3;6YC^4W?H?#BU&U4La2F3gePa z@7ec%LuSRD7d)9YQlj-Mr58?MIp3M0r0R+z&{&etL8&tQyYuTVB0YhX{-)>gf=qz&=&q#6xqO!Cb@c_jMkXWhVRx zK;=7iv~CGI{!G`16F$h>Yf!FCuxJ zw^Xb8d7fpUwnsvcxFo;ld4{$QOB|+|zF<`c-NYyFCoEM#H+*9)FOg^ls8o{aK=$si zB$PrB`1IhBz(&xkB#f!*xQ-X1Lo(yHMefHhDa-_PO%UpT^)W|zfv^VtVYjW zX&8|S=wc%T&T^0iLs}ejLrgwR1~-Hkx>uK1d$sLiMo=iVddtoyr^k6td_7|@R+3rZ zP@C|B?3k(uLAbB@X^BaPWI$ z`hoD9oHZ!36N5CR%|rHO#87Zb~4Ay$VUT5UH8Q+uG?^ z0_NQB@pizE;gpO%7?a;n3?obJdEQ6faRNs{9lCFqFkx%V%h~2b9&e&P^&JaFE|o%@AJ?R z=xbBpDNObUfX_%##f)}W=xV(D42=YLzVphaj4lbsFgEWlQT7#EcLTLiWZp(ZZY~tY zVk*1|i40p`C>M0)Ym%3-p@Or3+O^cWtWPH>idRh~cHtbMT)+xC3PKF%BY*N92iNvd z4Ff})NrL&ZZo2_0z~kF7x3d}2hP71`!d_~5xHFZQ%nI{u`@Gg=GzIVT{^n8RZmvX$ z!qjEYajTbgz zFhto=JU)@69qLbHMaAPoR1HIlK%(6KVy%y>(Y(?%5t+R{bMG026UfiiTT}TSIYb`C zAU{yeRhelx>f8I<2yv^v$9iQqa3OE*n@EuluS6v&7_hyKI>pda1-7&DsSABDciQpV zF!qd1#Ca(vqMQdtMN|mI%rmsj;6HSOSAVc}!{v0=($=U6m*>(f?WI5(Gm>uqx*e>| z6eS}96}_mF+-`mNGRrA8k!6O zwTBNXi=H}Cz1?d7oCi+y9oJ6ZAA__to%V2XF0|}2H+**T^6q)OH^Z~MEDxm|h0jK^ zbc-?oDtX(WTPr=;WXk>!m6(dH{4BnC86%NJ)0K8qY0SU+A3_l0@xX=DB_a-QU;q3_ z@L(TVjBeD_hd zciob9Um~C;8C-81v&}bH=i|+7w70J_x5#bA17neQ^?h$~1)PAg(R5xe9Z$fjPNn0+ zrH@M&AAAz*ejK97%Ie;((vLEWCJd$d_W(==Yq?4dxYlIasxC)!+mN{76X&Z^!@9su zBQ#25C4{cp!mKje&}fmcVcfSd`(8yG<~VlO8sT+9iBAFaWH>+_5Ao(C#xQEDI@6ExlMER23GWKpWcKQ6-oPHkMUy-@F_8_l zITJF)wSX3LJCl5A>;CD4up3^dPU)@mU&;yNhOXX~2St!2W9qIpr2u%cj1Wxh_G$9= z#;jel03_l6+u0xTmF@LO6{ho|o6{M|d5nR&nsb)d>@L!<`b$UUqvpjg!Z}OVkllkfc zlEeUV)5@s0m`!HNDueXNXcuD%<(>MaWp|JO%P6Cq zxYCM0co)32V&6sP)1HBpBOXiS-CW+Ml(M7%KRd?TfjmsynlfIE8^*+m+El-lC4$U2 zm-QN5u;VVLJi@+Gbx#%!>KU=cITnLzzq&zRkPkDG?!7NX2qH5A@r|R=$~E#m7T_9P z<7BiJsk8=!1HppP8pSI&Ls*72T}XlcU?EvnLKV5}QqRJ{0l>ifpvVVjQRHyucpxfk zN?Zn5%K9WB`3&xWJGrU-f!nbHo3Y0sv992&7~JV92(v4&Adrvdt9>yPSU_^^UcOhz zgD?)|JkbBEcl$5g7;2{84RFa&BG)y6kP)sQtq#}DQSlK@yu3mHL|-uG&Z);tLm6p! zOCwUT@x!WP27v2zY!Hn;Tj)rq85L(!0~jp1)y++4rf!n}j)3+bh0O1b_%mEFLzCvsEJp z>z+ofs{BZTWY$+cixu9rHv}zu#a;#*Y)1=*(ELf=YrP%&%$!)~{XPcl67Tf= zo6~r8S%$s5ubjmfO9eQt`aXK152}y)AzG`D%FB5y44tng|dvqlOuc#4vO$O_$i&?GbS#dmN?F!HfF%z!1 zc_CYo3m~w{6^JS#_lLB0U@)%!*8r@X)sd$4rlwm&3$ zVkWL5C@2=pYFcVW9~+9DmEbh>!H0Jt?StEkrq1i5wvkrc*7A)gL?ZH$l*_erCumVM zk^t}K0&ZTi^`^D>L|atY1ZuN-u?h6klS=%0uhbYe`f*JQf1 zvRXvFj;SJ9Xv~{M!6@Fvj`m* zsy_s|EH5w_iWXoFgQ=BTKC0jxMcZ37$+$6dYjA|n@Zn%=hw61;FH}aF0%a7>yT8M@ z6{1RNk+&#LM7dgN)|qu<;-hMj+8f5E6GJsnu$x*r*2AizLgbnu_i}wD7IXLNe^FWB z)@>O^sTGC6S9D%Z*3I}Xb+j^0Pm?}FmDO1-gFtI0H*d;iMQpWZP*@>dA9%92`;LN@k}FI{=vwHd5-;q7fqLTTmB}k4vv!2G zkg!1K&leezwM}+n%nsn4t%bTQe5{j*bGSV0_OK*xRE7Q33Fo`^>x5WIF7a>_mBkM0 zk$ue)J$avx6JMG-X$p^yISkt-pQ0f=@wZF&f67Pj#24YOT^bwLeQXSzUR-{M1uis8#wJ}$d~S!x#0!x!A!d&|*=wpu6FQL# zf#lj%VXZ6%i;^Iwv zIk#YozeQqHiMuLE#3$`qJ$dF*iF{RzWrr_T+t674N3Ca9Nn!3^QG8;QynB_+)=<63 z%^;&A;lOMrZ}B8fmNW{_(0K#wF2i;7a?dXcy^qzv6d=YDfMu%4B7P?H$<2s_CjCDc zr=-1M=&{S7MS_b*-It1$u@;Zd9^*OM)G7$_pL3B{g_ZoO0xg(4TCxUwOiRTte(V^o zL5f2TCb^pV#3!GCzTE}B=ySK|-+a0-_1I)PazyMvESr+UhdD`}3v{hy=qY-=;atjo zN{n7mPi9{$Z=(2IPo_%>(5hl4m&i@mK5Fk%v@^3i4wkh~c$e2oj`IxAk6}RPSNUzl zel0c)r9Gq!C)CS)_EWL_^gZlZRrce1u>;iJ#S~wmMp9Mdf^0D|#XH8Kr#~L6qbTlx z(eE+_7mjsXHahg+7QEGMg2ggCE zH5Iib-Dm&)Zr_@8(l^RT+~CJ-QrmB+RIeg&zJdB9n^~pXAj2V39WK3JP2yOR(POy< z-KAZk?%|>Mu;n`lE~D`ub!5J`!O`04uTk?4p5x90>Z%#@Zg<|~KE{fW;m|Zl54lRy z-mIZl$)W1d{#ZTMX~Wn;eSrq&Ki*?`l`x=;-&yc6*+YIFd7OQA*0ub?A_QATTt4sD z^;!$iy~Eg|&rphodrMc^iqDuH+_i>Qes}Ofp~@+YgRVAG)K{)?#p;5VTu-MITXjr@ zIF~hI2$PM-Q1#U-a4%^la5W5nx{OGTK|oa}C!~vcSF0D~f>#&NARXe>IFCKr+?zl9 zr<$%6W2|&H>#;-BW*J{vNCslUqYK`1#2}r9d-}NmJGw-^N;XI*j5OaH>@cb*yMn z8k;5J3>*;0kh&_EIF%1VLdseJd-lY#ZaXX9k-pMCG+QeU!nusRHV|T)rc4kPYDb@M zH1QZ?D~1j4&PZYX<)JR?6B3%3^Z6`oJutN->MK5Xi1%wUzzNjG)%w%|WD(_Bv2V&=s0)(C(I^rV7afcpkodz_>=yyeHk5=d;vQ4dA;no*SEkj&vb7cuRQhCDAUQM|? z3o9>$MNN{I`rL2JNr>BVd7I!($};a8IGOEa-o` zqitLt2z?Ok3or)pREe#n4iCWBy*Rsyd`5FrquFJC?=KEhc_&-LUJ!9*Wd71^GP zM~!x9pIp&eykncGu*JG}W*?a5g6STj?NzYblAgjeBPXKy=RQSMVH)4d3TA z2kDQy1Y=Ie)3pUm&RfzEt7s_2;Sw=CGe*6c9~Izdm&61o{&$C4^ijeifs}FhTneE< zRf<6Ui#5`F!y|D%p6?u(Y_?vqT2~{3;kUgm1{#bP!O@Fu;yGX1XXh11do}ym-mFDG_?-9D1V_7$W%PDh6Z}j`PgiEEEtr}NT-d<6XS{A}1@BS-HZXOVgKQuI(P%x* zNn%-(CbC*nhMet^4eNv-rVAZZALsnyj$f=QY5*Rpf<)I?S?l_J`dqwCyZg*Y>1{Bz z)g9+-Wx3&ujjqS0`V2x!{T58MncfES(-mi7NXz36ZBxtL5Tlylq@-{Dv+KFG=gzUc zo3rTI9j`uwo8Ur?u^}kc*ypNK_58XE)_y%3R7r+t zle1{rP|D7L&vBNFnMdVsIesxYjqSGP*L?tgmGZ(J3lxT{RwnbhzIgNXwn2hxwH8 zHf37UFYr1tJq~L#AJ9Q_x%$C8FX|Rj!0T{;dns`y8G}y)yis=r zry-OfVpr1rq6@BV$JRO0bu_^}DxMY;`QD$9aBhFPwsmhrY!AL8@J?5|UoN2!iVHgY{BaK*xU<;0 zKbLU>Ih^svJB&YT`yh1WNqTzXeX9;bPN#{`^{V(F#6M%~qnlfwSYU`PSHR9A3Jhaa zINcYMXVS$s*(daTf5#%|hYkgSGA0mbGNJY=eXp3mgF@7OZ+&YH%g{*H_4 z$bg&Y;sGBOHf)#yn~uLDvEd%m%T@2P$mR$yHMyx8dPmy&G{W8FPg@_1@POxR1p>eX zk;1xxwABY;@j~OF=>@*zNl&OzV{H7#wnrerKjuw5ojd^(_=tc|R@&%Bqhav6pS^8! z&`)D8ST{D2n`LWEs1EY=#N)OVT66zdYSZebr*)yb8@@sJ<39+kOT4*NLOF_qE`G2z zt8Sb$p_<`0HPy@?E(D0zGcuv)*f$Y=0j@hX2vMk{hasZ9nw~dU0AA?^Ln1^njdNi~ zupuHAlO9z4hLWYtz( zH%u76lOOL6BfEu?IZzFSF=XD~%f`3|e75X0w<$Wz4)+%)IoWHn1U^%Vr^(#SK1k!12{RH>bYGKmq;G7pz>465 z^dv^Me_+TVZsa{1{~a)#-0}1nmN<4`l3i|e98ZG(Bngu-NbBCd<-m}Z#A)hQcS=DyaYb4GyD;viu9p!#yN?s0wzc59{RE)>h%t&$wD^=q~&Rtwte@4CZf z;F|&MGXl?~S;ZJr)Yf)MFJo{pn1+P9VUJxsV(gORawOMv*Z9dDg8Urap&hlj$My7v z-p~ixd0wHjExEv9V+#u1cA9QGsS@op_U3fVA?6fLi_3ku!`(b>IrD# zXBu3mjnU4~=J|EDvAjykW~Y8Vz}}_=bTyB2vFaq!`^cTndV2UMB3+9_Yj4}s zEKRn`E>O|~^@A-@vMsoHb-DdGW#@vM`}d|1iOv{g6=ziB-y|<+BD*^MrT@A`z$aYB z$>XWOxInhxuARVu+n5RdefrqjOHUX2QwD6Q3DXFeo$1b=80G-+2WHd!MtA-e`xTuH z>L!PE_c2s9*rfW{$ug($HGA?puy{Caddqu%Ppg}(k~i?W6-{rc1+mFnAYCZil`BHdu4GXPksF6VG6u&VW)i!P<9>eSW@608CidhQkQ=9k0{8SqE@+ z0(JYzv&;3C=py%Zw(|{5cpGLs+&ry)Qgytlg!>?CvN~L|69^mJF51nXZC}^hVovLR zxFv2TCYqi-tGjoJDZ91>?A%|5cIPacR2zg4hf>gPnAxq*M2d&ACt1vH%~`ZUVzU6; zaYs#hhh|4%=GCX-B3zmTY(m-h^h9vl7?jlHEqOXEDkT_7Gr@TDi{N?GcpqdHHCLO% zX!d#&T+I%gmQqwDg;w^WTF_$~>1(enk~-kIc8VWN?va`lZFseuO>er^Jx%Mb+SA{s zxd5lerg^YEP4JQYREJsLD)`(l+Pn*OIAB}>MeueNZW1XkO~?E@2#j!Bzu27oc3Lh< z)AA9~^P^~K_AQRH7avaxLmPjN?cC{kWV|A*-BqF~do3UE(W7;D(Vnzu5bVm~AH6pv z^zw9G7BT@Y)y*|va@Ta#!E~$T!xQ8~w;|uywCoLi+txh}H7(&XNxE6aq24<~+OC18 z*w}!FmvGsQP&`d_T55FD2F9UbxjD9Y?yRN2-3&^sQbXVSlHho;PB4CZd5ey@OtlZ`b`E0#OFiX~V)S9j-UEBeX#%%hpHOJ!S$Oanh2gB^M~JRDIvoz4U!r@IGA~ zX*&P-wAN8Ibfk0N54{acgE|M~KBs9=ZXkOKw{0wX!y4&8oy*N<5P~GNmsoqryRcw1* z*Cd#dW2vEpabbp%-;4CXBa)hhGk}{nO9QU1m90e0@T_h*?d^-SXxliqJP6w|>>Q>g zUkSLnbUH9uEi%d|OR?(&m>x(m^zh0W;DH71^C)701@7M31sF2Oc-qRg9VU%q3MM?R zK|~>QP=fms7X9!#Ls0T!6u`3r`$m2j+DJ5n6%WcvCnyE0oR}P z1;basd2Zb^C5b6?d3Va+W@tkTc&_uUn}hlm6AT8A*l6tV9B3Z8{wu_FdK=b)dN&%iZOobwHIeu^-RZ+5;h5@k|a-O<) z;lGXLL*LXPJu~%`hvodu5{XB`c>@vPk#rnU1nwBH9A5MAZei+cYS@8F!(Gtgt}Xda zZ$sbOxNh6f4NExHOt=GArIFa!ib(;(aHHkZp2S64rWWM9;keHx=i!|n!}IURkV~2Y z0bIRN70X9=i3?Nqs_St&bG7}X9BkII#QQPZPmUZn3RRR@?>I}->7X>!pY z&8xoTRjh$SJUtb|0zQ&6ezB9& z=&)TX_3uOqCCMdLWGr{G1JeRZ@KlU#Ib)%A3890fX&)8eTJ{1rG0Yv9g1u{OrR>6p zt1fh2cuM>iktu}d{6j8h;#^$Ad&}OXM#2v}clnAoJV}eUq4t>Z^!AA~BfyWR!$kxPQ+a5@)B7o` z=JApHlis%wxEig~KSO8YYWhV;h&9Gh@n`>6B0_Je&@5uLIPv*{_hdKO&Bqq>HX6&i zndh*>Nd6DFx2ml`#J&kW2QY^LM9Om(e0J&zBWgIw{GwsKg8kLHsF*^y;4RsqdsA2D z^X}HdMOM^NiC4^|?pC#TDow65HcfCtojxkp*4W2}3q=RZ+Rq)dVY}-%(!blKnGu2Y z&;l%DR`AgXwM~x9oB~Pj3O{afwiSD}hesJ(X=~Q>AS$6MIo03uWQ1Wl)Sn8G7nFat0R+kpw*j}aU+FQJou|ybCMYk=c#EQx!gkiN!ddp3;KjS z+SQ8O?l^EcCe#S6h;~kb$#vG#bGw@p7~?Siqlm$6LY9&o+~L@eh2|PJQ+Q z@%a+GdXs>$ZnK(+S$5L7=(V*4*Oo#ng~+1=+vAQ z>3Z0RkhFtU%e1UowuhcL)qos$DO`$DK0VQ4O_Mq@YAP*Lmf-A_&cHMpn(;K$eA<@h zUoptBv-`i_hCEtte=t9x72v*P>)a5^vYOlxt12$7WiF65V^=Qk^aD%-0DZ^gM)|Vj z->M;wNGkn4oWrRB39WBDh&*)q)A4hb7k4S7DKgHK!B#Afm$XJ#wJ8Fd4)Np!Pd$+hc$@CVAWh~b(RNLl}0ERt1Kfg$mt`>); zd$HPDMoO)hIZ9j8Jm?{FAFker2$+&2{URij)!|O=To}0LWNM+HtC%^@5 zTQ-fgDUM4lABo*HJ5v5vnB~f9WFFnyK~D2i1*6&7*P)KiM8r3wSo4?`jx-fql$U3N%&loJ>s=P`xta8ZsR56l zR9`Cl!qwRe`AIYaJxxb(y-h;%(9>mm8k#+wjoA;lsTnvh35VJybPQ+?!}%;-@t9Wf z^lZCDCA*GU>CKUs<-7yHKD7A~D*izR_aS1Y0F5Vu%@``)_P zsUle#nWna({Dsd6_?*+YC*tzm=C_J4hV@vncOfBi7JXhgeC!|q(|T%z((1i-fsdTa z;dWM$_r}B0cBs_Go#=4I<)Eu699NqjH0NjurYq-in8U7+_|;m0A(-uP8@gv`;|1A6 zvLCkc9PrJg2t5E0Dw-PxTd3qQWbnM?w@GEE|JFb3)i`{Mn;87#ch!@PPmu<;Hp*|9^SsH}9x0*$53#WyH@4TWDscz3F=y9JGZ-%iku}2DRI3J0Z1(OCXm>%3saPRG^ zI^I+U^azo0bp~&Mxba!65%G#pC4kRFLOZy}16Jgb;+r2e+b7cO4jSR8JrZ{~jQOm? zTVYdNg4a!@;_h;=8@F3*$?1m!##C?SV7gWJAnV3XuGci8En9Q=yj2UmP1@2yIi#V8 zk&aOWlWMpBsJEbVr4}y^myW|UXR80GR>08VjeouX1kSnK>2>c5zm0jYg%Wxs?9|v( z_3eL-9sIv-hQSp1PTTl@Q^*_&X!SNL($H$5+CpGMW=e)+FN)rfh~7LNOl}j*+jz>t zom~h_O^5rrMSk;;kRvwShU8Nr2B<-HE@{PzY@CdXmS0$mure!_mVUi_k;7i%|%x8F#;W=0EUUuc+ZVb3CyxNOtp4pSjz{v>FGNfKKeXdyC9eR8&y{;uR z*9Zh72ea_z#1aMgu& ze&}m>8QjlrX)Z^n9`U2+Y;~D+RxTdT!(k#lp48*J1e~X&eCTrpwsOZgr&!O^;`EM> z3Mh+@wmsvHFV(PEWb!U0gf6oA2(I@XU+_#$&%?GIj~_#M`ddw%V_O>RO#iIpUe0(a zfwCzJ1OcA^rSJ$Hu=kF|LToWnmu z07pQ$zxufY&G7TLx~!oTul>J_LkuKfqFNeelB#}(fs(^TaZ+BkP4n0)A-N;Jz^C6w z3tJ_vAD-yQq8sWM!@u!Yq8@J-B8w-*Jdv8Of-gs-9G`5WNpT&-~869kRDNt?vZ~jtLD}lUt9v4@* zJM;8nLqy#!M*XhJy>yod8IZR0b=+45n@-lA@JE0p9aXJ;KL5LNB73hm53~-fQ^0X8wfaVg$ZN zB#}_bq+8F@fkuSXiK4_fa4*RbF=_e{dJg0SD^eJer&-w{hrc1>`}9cb)Y>-EdOEm6T1XSp4oeE>$vF)R2ZQmH$~TZOWkq9=)Nh$X}_sT|}nIe&YZ(8G8I@zTC{YEJyTs9;bpO-#M;`GU7fPG5RDvCHzR_5*qSREvCNVwj23({Y0ep?A=-e z$L%j;j?lr19e9+>2u2;D7q`6iUiLVl^?jN-cIH4H7Cqm~-6I6dO@i=z^0ErUyPQrG zWYm1GG13*LaI(4X^JI!`$2rpRyGJ-@`&}AN?a^Z#N@S)#Z^gK=$7z7%!)Lhs@8dK_ z8;+M<#=4I?CmJ{hF%BFhGn%HkvaZ3jh_pFQhk#g4vTui`LkEp}5b?uR!;gdrgAZJl z8IhP zG|kkxD__XdG##!Hd9J13X>QM9qa>#87Ry84RTbX*p7*PirCFZcTSxt^zK8Uz1AXnk z$D1BMUuWMvh*zxo-lQ!1?ga|RHT#Bd~7qOl<2Uf zLg=3jXz#jEzt(N&u4f<&sLbzC&OhVe|&trTnK)7Q9{ zTvG0Sv%1|C^C4Avt{C506HViz4YtOCRUw=UnQk{*uPIEj?s*!H=Md;pP8ac&9Pj=`OTym&=@UC{BBlqovvzr8k@>907Q7+U*KIpX`3_ zb3Yl;yVYuKCquH~lWr?|UF9_HuX=MDgGar)BVnHiujiJL8b$wGjXvSI)WVR4?^9>* z&pU?GNdeRStGr(nGN%4pvFYi#^gtG4rLR~`8ppJ_SOQe`?JEpf;*RGFdjAlv?ohT< zlQ%rJamv-YD&?(uoDL50LCy`ZbTE&SknYAif_Z2S7903#X-A}HjkEJr4lDiC9Y)fp z`@NI=uFd>8Gxn+XF}J6)7nEY2w5;o8(}W=mj&n2VD4~U2qs6k$1rN^}L5;3rgCTwH ztf)=~LQG%d&JP$qB~6bUgm}7Ccj+~27FJ5Y+nBi~v4ts*y|JHdE7`OhJa0H;V|Qyy z3Vc+OQ0R}u?Hc2#6>*?3g3Sd*FV%8wg~U9D!-T$M;%rYs=+?U{$wRxiqNd;@6}H12 z4zKO-(Px_s9Ik=svm$D;9N@QTU@j<8e z#{i|{nZHXRXQ&Hap5ja|wiR=x%adj?Jg0J7y?oP;9Vr*j(zvntufab!H7t&>CAdJf zqm{FUDh{8;>k@CtI7b|Yq9tsynmk#7v8(4Wm^_8nNn`IF?(IEC4j85XC&XL{?UuoH z?Iu()eJ`w?p9tG)=d4Hq|`;r*Ue z`n8rE(`osdUuC(OMIbACv54K!M|;pXlu2DP3s#F1c?N*ZBiAJ z7)&OJwlo38_}RXdVqkmvr+YzUw7ZVLh>Hjf-S3-jJvh=&arc%0-=pip5CM$iAMQea zc3B%dlNKx7-n>=I+9Q|7=&C;7r?#@Y|(1|OwLf0NVvbg6k%Mj9A??q>+c>bL5*qiK@bd6I=rz8f``JVn>mU>%a z`aOK99KEK&&k48=XfoO*@JJ#K*XSnevj!eoI~LBlBx5dVNFi=UKAQASr7dZ2rlxxF zKe^SZ&lrdPkxg?y-%VQt9U^HbU>VOqmrTTNNt@Cqn^jwDaP*oUFg+nOOd3s=o%IVZ zBNljik9xz2KJ2(=nkLCr)VKEQfkQj6L5rm5*?_IyacBbiysWKMpK&#fCez5?aq95H zxS?ndxz2R|(!G-8Rkwz@+QuYg%1|4oB54~Jl$b1>(lH$$vgEaGhVf6VxB_~Bxc2J5 zQku?J=em}hJ7(^>_|7xr;#4gp_#osK&!^D*tr^vj{G)oU#P6Oj82bz#w)VU+m~ZWE zQg$UTN#*qdEZ{X|pco_{2JZpq;2hMky8*x!fAZoe?OtMC9sClcH@sw z=t*;INvmJ1&Aaes!6FIXG$f($@~#|;N;<;RpNIB1b^R`xJ`&(4mu1Dqr-nA3r=MZE zk~b+_g$LcckJ$6wxskya9TcYoe%U3)hb`k?5J?~1^4Q#51uhX^*%Z*~qu=9@6XLaL z@u7|LQXY+fo4P6#%wzlx>d zD_?~e6Kn|YBRgwiw<3rZ&mW<4mF@3)(LkWYHC*M{W&AA?2R^!NTpq_b&HvmS3{Pfu z+%&!1Y0}Urgyy~7>}QA9x_yOpHow;nQ{fm2_jk$N(;hsQk(2$|GLup5<0P6%1fH_; zewy_La39P0yqo0TEa!l>kVF={78V5=%(QP4Or@6`S(E;hafnD% zmj`DKQRo=nW|aXv=`++Wp1Y<=JbeA0UrlZ}vYUR-lQr+tCmVmnG^=-lGf&0H?VjB{ zy+E1f>fM8qd z(0;=#XMAl|;l2Yudc~Cg;M^%r0Bl=)>>QrvM#6F6YY%xZVIjWitXk6*Qf(!hs&Zk*d9PBie^?x(Vz78?J2ocqbw$X=J$I83rez=LNGKXys?1Z^?_ zG<%$JA-`zr6yp%f3OSg9-nUtvL=K#&wj68)cS4A9F3yNAP)-zzI=07=URVjxmtt~ z$Zw4Cq19dS{IUPnU7S?32Roj_yU5ZB(H-+RF63Qu+XadsKFDR*Tr*^&-xe+za<_)4vDjQXTy^L9 zJ?|3Gm`XPXoUZMv5h9zn3$BFZMGLyVbtuW&?{`ZJM=@joK2MDNKIFt&qn&X<<6x?xx@mA`%wBhPNCiq-mmNa=l{-7oVFUn_j}J5KE>8m zV69<#;8W~~IH+e#(h?b@ELb;b;ppdz4?$NyW0G`|)kpcczcblT`6@xgW43Veh!tYl zZ70cUXVULm1nrK1sy%R`!d+f%_v{)v#AR+zPj}LTuZY2I?(&!ZkNcCQv;IZ6wl{hcmRIb7@oFy5>Y#sdf#c!h<6Z+ilyANgw(d_ zY6@aFRUr|sAzGt=QIax&Qx%d>^nxbuaLI#g#fR?K)eB8Edlo%F$%PAojLv1v%u zZPMNL_BvGm(Q|zWC(EhaIrgSN-k9oCWcbnOba4(#oQQ>lWI&TY|4!{L{4s$gaq^Hc zpPRQykt&Q^BA%zc#gGn5M#6obsC)cwj_t|^997yCC4uYWL{VGl!a4R6Ja!5-;e|@~ z?2rblyTL5fz)Ozh>}CNTPoC&G0c$zp~x50H}7lJ2n6HDZ{<#3DVpGf zMDNeGzT)xO?@o@>cJ`vYF2GIM->6EX)O+0EIh7_x|Au(Jl~SZ(el#~|l4gno7Mh7% zybWg)VUL!X=EeJvG(P*Oea0Vm{GtvEKEA?r4G-zQFMF0dvKA7ZcJEHkxk@g;;J#w~ zMW>4;oW6^3P>ukP#2?sP@4;=Q>UKMeR&^^iD=F4Isn5KEogOBhskUj8aqoe7OV`il zQX;v@%o4RxJ2$1-+C`A3s_GWO@he|eQC=nl_3g_0oT@6lma&+HxR}S53-Y5pu$sNMbj->h#L}NzHF6+o z9arFQ^j2AzSp9d!uudgJhP?hPJV|1LA)mi^(-M&UU*hwjv=lvk)S48Z+tLrhR$sr{ z?SotY>UDp0@9<2JejKM^)$klp`*=s0Dm3772&Wd`yOoHLZV@BJ1gW-3I3fu9*CyFGp-Zbw@RP=WvXjx7a!;)|O$9i;o)5 z?>TjER+#qIZ<2BUl6i91c(pJJkM`2n?_Fv7=Q!zNfgdrKuP##*LI!W*`)o$6P}`kN zl0WX3R|>pqyMD2J7OFOYahXj=()u=a}l8Kr^vN z2_NZJiBzUt=_>i(eL!9fclW>h27;EOPKO6Z$%KZJ^rPHEF3lPERJKwxMO?DW>M_D5 z`Z!_W#!V5GIQXjZyL*)||N6OuQcOP`JN-W2wvIoq)vI(j@_uXJwOn0nkoz6ukgHI` z+9)dC%M`ZcEFJ1+oLGm^EVUU;zsD+f3K%0}u|%wnhIyi7_}WB;%*PVO$)H{?3(wvF zc$%q{Yrs~WYw+X+hv2i-SNMdkuc+Xf9dYmfd_~|#&y(+Gl3U@=6Dk^IhcBvl$-LpM z&KUn%hTv12iQmLZ@ZD0mJ}vFFLYhu*`dHkrerFdtYSnzr>8|8T@DbU#IHguhN4z6{ zUMgFqd%#Jhe!$nTpYmT8%Ysf4(s1JCfJX|U`wIpY>wFdIuYcw@YGe^pedfWD0I__C8fG@vBg*hX-(tbXRMYJtDP~D*bq##Kv$+kXh0ZsjIc&aU3`hM(JC#`XD8MQV!G zmWD@m(n>StzN+_!^>^~ix=@_CSA0~X2M`YDxGtE#IDz|cb}r?07b{oHBVG#1gut^} zQP}jQ{uRplD0}^P=NS$CF5wS~=whLwXhrPhGat;ZeBDs$Ol$DGJ_d;Tv~h@U?5Thf zm2j>T6+AF=rSKG$He(!05n}ae%@yOEdo7OfStysq#gxHNLFnh|`d_h>{HBX-iuVi{ zy4ct_*JBOdTZw&1?r0H?Tdu}1&GR;oDhw~il`7{~-3};lTBLA}{z9qXW2O82Tsm!? zFz?chH_Os7>BOtcj8k|IZTAwTe|O+8OFMqGO=q+>{CvQ5eRndo4t^})8s0B1zjz+* z;yAT9PGbC{MP5Jr`JS$z6`H4w71K;aS)U&gAMWTf+*Xr2zjZqZi+>5dfI#Ifl3%r-mO+Finj$8!Q;-#e7AN+j67E$v1 zQqwZw<9HIfjNwTk2-!l4S`0&V)=kjA8=nKI31xg|3V;z#_UtV#o2oU{@IX} zbfm!1yrmLRk}k4B>XsTxPi>i2^yjj~o_)QlyoghGYWX;RxBZsr=#FM>Q#AF-Up z3LL7!6%`Uy>Bit^Ng_0oW^Mc8b(V;FbtRL4Q{WZ9OJ%9y=5b#UJ6m1E6W}|=ellKY z!PtipJhSw1;U-(6WJPV-!7DT+8XmgNz|Rp5W%pO&!t=X@Yn>>uYop*t5=5wwQ#&tS zOWdmG1gHDEyM(g$i*(jz5!O&7e|r!+1!?eCF#0XIs~6-$EBTV#1lC51PX(Y zQ+0oq6SV%3?9~d$ijF63FH*VFTwB`YIM%dwA=hn+?2}*ZRqf`+kJ`DByv;e|>Ij>~#wjT@ z#H;I6Oa84rbfB&Dwu3{RqFqAGfa~nwAKjc(%_jVutQB9eR5@1aunhGQI#XPIby$2S zp6Bdl;b$wS9#JvfL3LPri!jAp6*=HJhv}-?O96(;-LJ0GHg|8L0ltEq&GW(M#m5Z{ z{^Zo)u=ble7ZMrxMjb!raL}}N%{b0U9tC@TMmp1?H|l+Utf(udr$M_v8_BsifSYqW z_&7bR!p+W!mE_hAF}16dkvdW4T^TkGbJdvg{24R?&=h;z-R zl7kJr$`fF2b7fuerOxJ^Q2|9Edf-)*!Io?9^vpKSD&CpzoBIn+&`0B(lalW9O=>b} zqx44=K4|!*v{4vCVxDyWS&=t7>YcxlzDCZm+Ns*IWhz(yozG-ZcGM8uJX7$ad`H^u zZ$8rk5jp0$RdH0IPFCVbH!@JyrYgD}xsi?^ol^(eJcKIhz@_9-+=|!iCLItAj?rm9 z5UKySmZUBtgo&?}kF?0bkLc?;>MJ5kwo(e$Zq3Uv?)X97Bqm*nWIvLz%$yHoty z^LuG4pG(v0@%-^wR2JCC6fJ?zDAZ`RcrQX=dPFD-pMT}REgR2Qr&slxGkmCpYNrgt zw@$Mn@S&GITcWvf-Yg-otCRwIKGzGt_lkUY=naeDTE@^hr%Sf)G=Ds4Cv?2wc+Eo;!*K zAZ)p-)3UC4hN+Tj;N)xvKBPM~vfF1VcRD(8&CG?QtoKP3P<&jHC6(kqy`9%Aib&*Wpg7oToSrPJ;NYFE1%Xf16@X7^|MbkrD(wc3 z6bnw~@!jLRd+WBgO9H^rhP6fhhyhResFL z5|b=6bd|_C*GViv4cfDAJXqu6bY0KF%j~g~onxh8TJ>^y@S~ng)$1)93HXwc9XOK| zorOBQg`W#E#pFpPjpu1>qH6{|wBO@ND@-xlil?!KYdo#4KHxASb>Yh!L>zSr4&W%& zJv-F9VS?8XiV%qC@DTK+tk&_ZU>Oh7gO0HWrR2(}0VjG`9IsQ}kA~_wy&sf?sY6&2 zJKojA+@MrbS>E8sW~dtfXz6a?+vJ;X)AJbD&|*8I4Pvp zTfr-8Y64c)xoTrIaqim<#;-1gaan~T?wUbZE+iVSo|;y(#r-&7b8>!q{+X0k$Qt8# zbXZ9Q_Ce(FV_~LPHtd5mXBZq-Yq8@)QMKN+z%;XoeRE`o_s$(gPqbnjNC=x29%`eQ z43aQu{H)f`;Lx5Ve^s;{9UbaFXVK?Aw`>(k(Ym%ru}&WG^m4{C;4I1j8>BhM@9;j3 zF*uAg{+s7RiUO$N%&nRtX1xSD4J(dRS^w@;SRs1Wo`h9O2M}5ZnJc*3>7OQ?9_4jv z{38*2;K6x6oQO5xEh5ALd%WBXHcWTx&yRXM&Q+#`FNE7;HjD1AK6)8Jo7%Qj+QkVu z2AQrAxCxc|#0MeqLpT|^UE3*<8YY~);h_z6t~JSAGc-J1^v_1yv}In}!w~Y`=O>wi zS-W`7a>tMJO}tARfilT@{64J(Zx#B%6Gq%MiAt_Ab^dq0rxSzax z1~~^NJZ9jqYHOSkVb(^b1Joxv_-6rQzus=;;3+N=njqyC^RGq3z2`KHtR}NG@jm+D zJ)LcM7nA}0$+*&+3WnzM>3H)(BrxdEIOI(Kq_I<0a8A`f%72Tfb!t5%Yz-gTBZ*}&{s`0ZMPmrF^bN#NirX=-Yq{%T1+|rWjbOBEFJ}#2WVLq_B?(p(0 z<0hMNK20@<>1_J0Up!y&0_%M&8qwfX1dlsOIv8q0QGzr=W$A6WlY}l{^8;VeNQULi zcbI*LVbSh2JF;hgo}+Pu*Ifjdh-~<2%t1RQPv!X%4yWK9=U4(J?7+w8t&+PRt*iRo zI2}&LfM=GS!A3gwsfy|RK%`X!f$=Iy}}8@IxelNL@g)G!ckZi^e{yX(nY;g zQVqRn10u|_mr~Rk?Ewv=IX^t!bM0w(mx()4M?a^St?E{dFOfzB_?7tHsAZ zYPHHE!Oy|c^92H__$c%k=|2BL%5ao?Am>8|J5UNO(JkzI9xH3HVCt9vS{ zKaFer$|G`m^AfoDF|iHp5_wo>^Y8S*zQNq-K`++YUiCKT#rA zx#I+vHTu?QSDs#Reee=#f#6$772v&G!8W5AoH=&aHAP?w&3B&r3cT|#zw4RL2*Z=l zUfk$nK1mEU&C@5eoM+FL@;RnULgUZ#M`848S@81Hph@5ynhyb}7zYU%^EuDlJ9@FN zineE;SDoJ$C)RfE3Z|p`j#fuJzvC8V4|gwqn#L_w%YEKmkdwaZO5|^Ll--HPF0Y|_ zK%nC48Zh28!AHX=aVW5ins6gV_Ek9dlqyWnc*v72|8CA{HU6=gX{r~~IUi{0tJEG` ztKjD&-otXVoOs)b{jPCHZwY+t8fW6@j7y4{2-ZudSDx`M5u8U8(f51cSr0p%rgpzp?6q?P^d0b+BIKXu5Zp0+$SozvNd{QIJu#2dC{Z=9uVP%HQ2WrC4vY01vmwuzHeZv zSoe9NtV3@)!&ctdLAv?IjzY<1T$@Q3=%hG2CSOa9{WPgjym+cZ3Khg#JARfPKGR=o z_Hy5f&XYQ9=Qm4Rca}vfNj|OA0wQ~TXctiZd?!ymi+0T_siauT4OzW#@}=ypdNO8i ziKqnwTL~QQ2F?B`9e!xR_trJTk#g0#8{N#xfmfBegA>2=%{_5o4&gOA*G-}nlDy!v zIoYIjY;r%)fm`WaA^}p79mCMrAwKyE*2kWVZa!{jj-ahhhr2_zDQ9OXJHKa3d%w5* z^6rU-<0_X-AbBCi;r5Zpu^P@8r(&tTcqBdMCuSor8i2e5}~CwFTqX!8>AAzq@9=^MN~C7srw1Dp}_F1+kh$ za#xvpCw9~0vmcqKv}$`^UL{2JRNWu=gcnnvH_MmM>F`rL2lgw%yERn3pAjo0-s@<@ zag&{o9=qR~F^$lPlPDp8qeI@GVdzatw?Wh<{f#IazjkwQ$>P5G@`7Xl`8qyK)P=}{!{j~jl2H(9&Uehec zb;M4x__-)$==Q48u5P6ZO?G|mkw)4rfqu)dB(q|~IE$KUX-)KRh;i0Ano_MPa+T~M zJXAvhQ}O51?}S)-iD9;aRo!@6>k6feQk;vgCI5i6{TnE;P_(%(}PKHhaFyzAFWV}X<_J*HM%ix?jqeE3%=Z8)S`P@7v2%mp;T{%9Sc36@E$qp(?}RsjNj>@ z)#DSYu}nAhvVoVMH5xPcCI$qjB1S$$FQLPqvs&;lf%RIzAaa@(#1q#L{HcTEAayOBZ^! z>{8)JzJ~5kE1`LxKR212j|KN}j9-r+)f92Gg1nNoFqma!syB_+Hb+m)eVC>$H47`gwKFk2edT+|_CQ8Y*N^ z#bTZ!p6QBsShIu*K~>t)8e60^RE~3tXpujQhK5qN_6Ss1 z+Ebm-YSEs`^c=a*7p@E8k>=g4PqlluOiYHXBT6)SEZc975N#@5d+qbS-K0o-MI6NO zJTfrGACczSofK@wXQ}gQYG;wX8z9fqz(soF5%_Dz?+#VW@%;I*6u(;)73;R!>)1I-HhZ4_R?e%W#3#Xl2xTYqn(Tg=nUibMyX-9mPCblc^ zo~q8oQNzm$^?3%J@SkO%RzqR5MIMBxt2~^^1xc#f;F()l1JW|*4%IYM*;%{{Y z#zu)eY4E#bXT4XP2m-OO#Aio&S=gf6%3U#fbxgt30fb=$D|Yc8J)%GLJNI*F^hIb) zkk(zvoP{@pZ>(8&XENw0cQSp6uwz-)QoA_5F5xvg-15Dvnh)9iH+C$6-2}drjXaEN zUcro@-z_!1EXQX%o0Fy3Tx*P8&O^hHeRNM-)~0V`iK(Z1Qf<=Uq^*a@llOF?lxhvi?Y`PvhoNiZr0Fh4w;9eeyfhQ8iWS4h$1Rqg z8$a7=doP^M2}$@w-w&J~xH0~{hl}Ms`Ql)3)bMQ?1-u@=!5+i2fAg~n#~uuqAa>}| zTF#lTD-5m@vkte}EkD;EG=uutq}U1`M8Y*%oP6ROdH$yF?TpFCxI5thGN|7 zi9Fw`#p2{J*fVZsS9xub#o=Jnna(muWlL80(>$PR17;O3`7SaIu8WUT=ADkv9guOC(VbPuOa+cX)F6U1tzR` z9`mHde5R@%7>BHOAHU2MM}^dT6@Q0UHATFR#3=3LfdIXMx$~#p7lH0& zDIy)Tt&8W6?%Ef0M;TB$-9TPa1A}c%R#!ye&eWVKdmACl4c|`d;_3J?8*XAJ zt$GAQxf?J};N`1HJK7w9IjWMIzwXhz(@oDK2gzX^LMx)2@UZVGys0{yIAP097`!cF za)Y{58A~p#8Z3{*!WX_a$H~ZwSoJyvoG%W|Zg048L9gV~*=L<{EJBB7c?wSvMa7Y# z2n+2KkH!%{Ta`i$oa>F)Q>E4J@cTyK$x&+8(KvV;aTkhnh{>5>1%lm1vNWnjmz=?#kOMa9*cuLtDW}yS#t;E zeBnsRLZO}BR)*P+UtAtPREovv>yDGidTCmmpr*HY{i-@|(3p=Kq9r7)9XOyt6TY|l zJA&VwMgr>D8%?oAQsgudb3J3~`FS+|n-D;blAhnV$>RB}%yYx*jQOuN`|l%0wkAB4fJEEI83f+uBOpCv1|9K9gL)aWrZ8 zqa&8M;|iQXnkM}t;`w}p_0}|DL%#Siq2l?~!@i);ijzsMWIEIhDUU{vPRFgSt8h4> z^}5s_)R;d^9R6Bd$~7X^=U$jvP0FQjfP26_KO7%h&8E4!k2sw^PDS+0`?G!cuTs90 z@2c&ty;C`$H+-JFaBx{`UlrbWdz08B6>6ne%*31c-aJ}rBtUKB&n?1_M!fE#!RwcW z>q=w|HVL(YS6HUj>SJp5Eh_uEb=F8b;H-*v)Ee|}AN~ALX}{=y$@StQH|K4acd`br z^TO>|FU^;-wcz70EofOoQ*c~hF`aZS=%VSI(f2QRAzMc2zc?)8*`G(m-JMWsx7!1p zqNPYgqK-NX9_yy79EG(vpALSJn=M75;q;A6G3gF%3Qid9v}07NC59!4)L6}9diDGK zr2U6aAKvnIe|LG^3-~#n@yUscYcY?7BTum1SxLu)imRKQw8ZMMXr+0+ZAc3mvFP}W zpg%;0_h}J$;3IQxs@g18p=xlxB82c)7kni0j-{b_hPFNIez*E0)ouzX_{dTAy{$HU zXfhnxP*@wJ7#fGd!T8-{($t}sqIl+)`{b2d2dA4ujwL1^OiMZOQO4ELOsR0Zjk{)b z#9K}BM1D_uVB7F>?ZvM`=NrGeN@#+=>_KoGPFH)uZR|KE+`S;q!CMkV5WxJjprey5 zKjef>ukvM1OyNg3@3{EbMcLn$g7jP6(w3Ptz$@Ame)QghQ!sfIS!<5r(?NG>_r5)P zWbtL77^2?(+mwg%ickWcv5wm9uy`?~&f2qAHxEog&R+*upPJr^Vr4aTp6`e8t6oIDSrDim$txQ`#85(#>s| z#AH4nr<}J-BKSwIIi= zQsGz}${T$;XNQL)4kqNHccNOMU)QTLSQZ_E%DPVPquwUH)e+&!F$X`!ar2)gMZVvk z#X@8J!mS_@Sp3pQleHVDm`3??H20B&=aeHTNb$Ec+(I6*xOQ2c>De0xFGNmnUQz9q zH41LD4m!CQq{*Mh!M!h@J@0Da7pnC-edZZ;3U4*`6ufHLY8Sv^TDl%R(qjF0IT81F z2`z8`T@p2GcxyW8hQGE5fJk5OZQ$_WHe0IAt9G~HSrG>7M&M)%NwivI?%W4I? zi!`+Iak7$a;ghE{=H>|ziOl}7&JHOz!6#QQ-%CF=<_eQoI++E z`E8*~@N-w+uypHQOtN5B&5@2_l`+PC42~l%ez%vsG*8MOZf?%`4#v3&elDpL?{$oG z7dsXGx!tfjmHS&b#YGWT=fbpV6(cZ)*lU{Jls%kYGUnB1OpY z)*`N9Rl%0|XLwhyfq~s=7Pk$*6`?#Z6c0_)SwX2bvSpc6{cIXaOC5y>p85H}OAxId zoOqOWA^amdo`dS4m) zBuieq!I`Y)_%=K%Qy9E>2_!gO2l9V;o^q3mm*v+yVy~8XrA7NppA5~N^|KsrgZO8ivGiF4 z+{1D%v-Te)bvxiQeC)IH;_E)Hs_wrZyjf_r7Jcxb7#uK|PjgKB^J+K)PTu6w_)RGX zhC6w?eeol0V?KkJiRRgZwR}K?SH{#1gFdqG)9RcD zIXw9Crm2pveV;$4ziKnIRBOHCbfZ78uS>Ph#SbhwwYE}E!MSOK&uGFltfyP|>2qE6 zczh{K9=wOfJ-AXvzGASXi*G`#dOk(-#WAekz>+vUHieEq*}kUAmF z)aN2uxyE^hlHON`Od#)SYL73)|AsZ!*5)bXeb<2TpX+VgP#Fj~jEWNCR23EBn?5}n z2Tmn_ej6`M%<{-dZCWBIXYc7K;zbyNZ>UrBu?V1oPaIhzNmv^h_!d6t2CK`Ae4-Ng zkSB=CsVD{wzH8iBW2sH?gr>`rz`;wDE=+7Fj~#R8jw1|O;B?>hk4X8lpRI`!Z){(7 z{Z}<$p9N~Z++9bZ_uUG-6Nn4-Vv9cM;1e&4t0_B2R_e5Sc2}tv8Nw&wB!2&^rC0}~ z;U5=CxqSyt>y?+=mTokXi?vA`o+L#LVtPN%({e+mG^x3j05Prmh4r#Gl_`tUYZ7Ok zmU3-#>X`xP)9G>Zk3E~|+?Oe_57BpKYdy5&{$tg*=6C-Fn zcKGkk+T?RoiRA{3&=$@?xnjTcdvMQ@PjUTAn;%5^yi1qCO$sRZS*RRBTrK5++trPF znkq2`&q#5{bJs>27Ndv@7nT-R{=wU_ex#M1iP+*GTe8K4dvscLDION; zn10&u(~TGfr@fYb^d|FjEbCb>jR~s$yENzf#7#yoMExv9Pi0GkBNw8FC?&6>3vW&5 zgmL<|YIVcO{t02%jSUhQqLZm%HgzyQ{i7m@Ptjy!DcT7{Qg=)T_LS|~n58d_rdNLJ0~9K^owYwZ$0n-n1CLa`pCdOTd61Cl7Dh=zwGB`&6; zAL@09R!CVhPTUr&d8B^|ob(SJ+)1ps3O`ms*Ma*ikGXb?XU66;%Dq?VKBoH|PTC#! zd_&3d-(51d2aY4};MYJG2{sx{sAZNISk&mE)nyoh&cKyykylJKRb=HR_$&4=iGOdpE=zuM8dWYz!_;Yu z5ijcoBFdy;`msBetwHzIlp&O9n$Ai;GwU2U7f8^SS9MO{NR!X!uZ5<$<0Bp&Cu!B_ zgMBU5GhyuoRAcSIe2($isy+;s?hZpaSzm6)DQ@xAOmycQ#m9kwS$>CYOoQ2{IT2Gg zJKu7t9fvvemWRw~1Xtihg~E?;Y$EscgKve7@oT7s@oMIq8aD&I$2VV=G-I$4Q+9oH zmB=Mc5H*cucUJ421x_c0n9liD)>m*D-+#Zw zYLV}_EbBD?64SR|mb4j2^(L~@qD2Cdq^6sme|AWo8l@^+gA<3qXZ-51W@FLJHxxho+9U;A8EZ-ANqQa76S}r(P>FOV(>1{0QQHS2rrZ$#=)(btn6+~40 z=(PyT1-yrKX0f+gzk(x58mfj#Rb=bkQkG}-MLU{uI7mO9O}p>Xt&{1_yJ+z4DGprE z$F9*LK)fA}zGhw0G@TwXDCY=@ zIupNBJbu1x?JI=7;;h4pdxkD<#Kq6@@NPMFcZ_)r9vbyZ$euqF#m^wNen+Q&NVpv! z3eqPeE5#j^$JQ+BN^UpYS)ObAk|CrUk?>F0(8czbZq}nUxs8i@wEbYAnJm>nSX-wW zQuY{ViXMylUur>t3_$!K!S}?=4w< zcDm}-jI93L5mHk&jpBsU(0a$}gv$qZzI?TXB62>X;;o^=ow1Wk1^7f8Y)=}!sz}=? zdgWJRHd9^Mrd3f}+d^Bju1?fOf;p}F|w51wG-xS^{n2K?>%r!5bjJ?yW354)%jwg*DoY__)=(V|~nhqtWgCE%* zDlyjG5N;(-D&=-RC`9e6&eXk3$GE2peFJ$yf z-+AG)i58(3LZkF+(4l?)SL@J|YaSnn6k*&c7g|R8!B_o2R1a|NT*yh(kOLnm!AZS8 z5U<}YYVv{3i&^Kz3mMO&rN@7uqcNE^bRo)}rV;dhp!1Z4WG_^W4rZ@EP)e5af01He zrIkMrEqMC(@5tu2VB`m(V^aG59T{cCYL!1w0AE0$zk=`RGk1K@*^5U$(0R&Anl5Cu zN-51h5VaTcJJz&{re6L)nDP7b6$i5A2*CXZO4*P1g{+p-a%MhI;v)Ji#IPpd{SQF9 z`T3nY@gOfS`9PGEukREH%h&zgNC!Gn-a6G@h+YjNeK!)86$W0w%>ud4 z59*Lf87<-mId8YW`^e(dyM6bOg>v1jzYyZl+ChGh1h3im@0!|xo5wNhArkVvn(5P3f2cmIJ>OMe!I zrYc80E`K1>Qog&$N>WPy?joaobE4D>;rsOp$q$rh3jJ9JOIX7s{{xZS@RdHzYV7)V z9~lMf{3DQz;&%NJNVEYUH2IyqX-NCKkLbtH|4yDVxAaFIHGDqFa;7gtPD=hGk7&=K zLhlRFg{1cH8Eg0w>i%vd`q}huX%-(S8TNzdEX0l8|3GN2-EEqXQAyGtiB!9#i?u%p*8O)YS^glAGn6=rz zTdB}LaQ+cW)*slZDK11T#<|Wv&@rR-cPkak(E1~k=n4(r+xHJM21@^KB|3IPg7^JH zONMS=xl6Zl@^wBdLBn%mn)MHqtla$rEz5EJ?j_pYAKUr6m-4g@i?jWK=n|E`e|Xk@ z&F|O9)=$9lVJ>8@v;N&mnJE6=->sDCT$0mwD`h;J`Hxh}-llWRKTz7GeQ)_pxvRSx zJ`n6><@<-UH){LO?6W1Te)m!)gM9oEO9x6634g{)1lZ^Im?bNO?ccMWs1@|?ksk;p z?7Ni`wKVCER7%rwp1vX|jsL^h@!d)Z7orDEE(CFQHNt`ql%YKMPM(&Pt$nvrA}Vr( z_GckdwRQ>Lt&~WN^X%{omGjj6BbE~Rm8*ZRvy`o(B(FbEPWyXLrF3liBmdhU=zOEE zRNCGx?z5BjHqx!nM%q+GdEoMgWOIoBkZG0EpIx-6BJBMmefF^SOP@WotxLvN9PMst zK%X77y9I_m8))OKSnXq7YzrQJZi-C+H>J<+*(6Y;uN>NiXTD3e$yhD@BXV{ovXnkM z=O9N~^^aAtDOafbvu`%O`kp@9W>NUjzXIqWn0}v4vncnUU-7eW|4b`K3&axX_h-i} zBbG}adt!M9hRb0*Z#z<(%RSjv<_YUYkiudsek2*HKQG0@q%lNMjfAV zDs;E)4}cHsqxv1Y6aVsOn~>Slzt=G7BW6W^kxXXA=Z_MMMPH#ZX~kH+Cg-5HOZi%y z11f;_H8@G5I4aX;o8YeO-k~B8IJWv%qzvQq`x={L-1eD2x<;EK3m6_vOMPYL-2-u#D@`5<&R<6t@+kh zo)FTbUt#|udDgF0NnZP`U!#)30lI;HMy^mxe@)7R99jPrD5UGp(LU;&@!8I=LD{W# zqkneFLGs*Rd(uiV_t%`HCX^OyzgM@SxcvQ3l1@I_zqMy7Ux7jy)=?TiW~8yz*RNa4 z%HiABh@`jA>R%hu`r?eQ2}x@Qdic~YLY(WfQ5yd7^-&G1GvE4}kH>mEk9@sZt(qJA zvrn3}l>bN+dOGghKQ0LCE?K^wtb=6FPz)d$?fzfnJn}UfX(7A&*JiBSh+9AVgeJMW zee7#ncnwS2y5RZX4%?SP?5zq*P!o&HMC)FyUzt&-~u3BH? zut2Kv6}AOxg8daI#R5fNaZ+I3&R=m-;O8y&j(c}va^4ixZERd7^ zxr_?*VErplO1mj@fsi>jz5=C?_Bg-xU@68H{!z{fktnD_eu$CTe2u|E6f1oNN}*&q ze;0$|@bbq$MPY6EV+U@Y`C|rpUF%nMH|owmzA3mO+aK2yY_p^Pac5G*`^PawTetbg zFV%VGj{!*7YyYwTh$Qa6PAQ)G6{y3zH#RvZwe&kdCaYtou z2Jtmotf|c(s}Gi+uP@45OMkYC@c?}-zD4`5ue}Eq+xl921pn990|h^C`dWI<yK{aSaH%K3FUk!aq(mR&J^(9iBDFbSuxgMj+N zuT5t>a-W?+rSbmSbMO)Dk2&}L_uoJGcf@~w@!uK!JLP}h>ED-~ILP27I>Yvx}dN{+xy9xI8E7IduOX%je)eXZtz+kA!%H z$RlSSQS?ZwN1#12?-7fSi=UPJT}B*W;~Y2 zW2`*(%wzIAR?%ZP{WYu}!|Sol9`o(7@E#-Zu@fIt^077_gY>akAG7wcd>`ZZU-S7f zupb-zUn~8w;~!K1@di8&gU6@vxE&tP#N)hp{2Px80i(c@ft{7;XI>hWSdj;_ZS_PEO)kJ`UJx5q2@IPU&+?LE%F$3OVE5Fan&LWXhVb4v-x~~kBZhBS@r^yc z0m?Uu`Gz{*c<386eIu)H`1Os^K5^VP*82v8->C5$T7KitZ;<+pWWV9=HzxiD&fnEzRsJ}^Jf0M=|OJ}(VJ-WW+S~ROK)D& zoBZ@H6oj`ikjy@_3K_Sc&t_U4hj$!2dx+MBla=C-{FaBr5}n@acQ+r3G7 zPvYL2-1lYxzG;GQF5#PS_+}-(sf%xZS z{pL!)3Ds}b^}mVPZ|?S+;QeNSzp3JHKKYw;{${4X>FaNf`=X3M`R^>5z&lbiqM z@4rd@Pa(itEbvwoyk!S(ZNgi?@K!mzr4Vnu#9LJHR$jd28E*~8Tj=qp5acZsd8$HBcc8F6v;c8E-n&X?nN0xmM=mqQz zXznu4J{LUCmD2TvX}r_oX{$fX)(|JD*b>r)rZJ9)H|5c26?%^$%ABf6gs=Gy!Q~i~ z4byr@dHt1laRWXwXKCoXRXR#j7U(GqgnC5qk(zb;&K+X1U(Nbo*)FnXe={o9pi=ii zczOhrg~ep_u(2>XOkcU-2WKSQfexo_g~gn?AelLWbOu&oLUi5_nCxb8xQt~=lff*3 z!z)I#uv7jQ0#U`x|zM#HzSSc7eFxVF)XO^dnVc;Q$F%clE^lXi^l5mj(o35*HEyv9s7j$Fg)U z4>7Zky;h*dsfC5wYN(IXMaN3 zUXDPQSNQX$SkaUB=GNH%aL!QzLyZy00r&EF-6-L_)N`*#&!S)Ih z0ipfi82ZIBLJ4q6p|fItP$_2SH&Vqh;Y&%$nE{t|=TA<%W@24X=wk&a>jM#Nz?9iq zg6%@qzMh9lH33_HL%eJ-gRZUHvcT9JFn)&>*Q(8kmS%Efx*FTA(ej!?TS<j2af6!&KqU7qy{}mC5_gm2+gD6 z*@71BGu+v|25dUkoJk(swWEU+d?zBipG|nNoauC6t5z{angDT1H-~XXsSo(B1XH0~f`~p^pd^B8vzwOT>?uwi zX1k^&L#RFQM!@Zi+54Z?_*pc(MbV=`?LB;J63*Je^v2MDQPe@O6Dm47ACq8jXRVff zjGbh*rjec#t>;)tLARXR*%f+fxQIEj%^j=dyt+*UkyM+G=~(2e&y~E9H*Rf6#3;%w z0z`>?n9-=o`{*0XRbzfn)SQqgRed2<>+%;7hni_PqgIZ3ud8LT$Bd35ufVPk|G^AL z*&Ek1m)ABf$&T4f4ryHq6v4?U+?^cTIq;S(;`^Ah&odcK2++BMJ>U ztdjM>#d&nR>)qUsc(7_xFwkXevKVEYKi&g%y zK6_*PnHAj8a1ET?d+-A9fTKn%X5(|Sqx>t@w7X(_(m2{$1JJlouc2~2GV~M~mXVG-hYJatxVtqxT2_5MW z9CHd-{apmd*WFQa0KQEOQg z2>(T*HZkH8wTI(ef~npT)5+UDHqFE$dPHG5s5!sX2c=S@YY54fT2li=w5bD$rNPbW z?rcyKQcYuS@X^LNOdB{MeVuj63n>G`b{^>NwP{O3RuQ|DfQNRqOObi52(2KUEb8Oh zC9nf-^rwN?61jTmVF5E98W8Q@7zb*2_=Z63SrW^ICecFAbyC^TtbtWL(8=`2ZP~R~ zzEL1WfsfUt|{An-DmTeEK{-pkzS;4*CDw`bXshl?CAMYr-Y!MtkFW zLShlEIjWB0!0jQ}6mp4=!Tz2?sSl+-T5oalyL0X6;Ii-IFuJjPNEmji1FiTN7nj;O zzCZPi%ihPT#()t-YtSjp6Rn$RghM-r+7lW!Jd0`!leBgp#k7RlY(xPiVy5i1asp28 zHSpLwdp2>B;uqSU+>>y&X&GxfYiKXbfoVW+dp~K1Z6s{kK^_BpD4!E2%=T71ihr`F z0~hHgM8mDD(St@)9{*J!_=`I+RxmNqs>@C(;CXvB+aspCOT{2geVMd zX+n0rXp^_?A{nh-QfK7oHoBW&Q(AVyH=e^4X0v`IP45X0rI-2%UR;OmE!hP39+HM5 zw&QxK1gNY~PI1F>p$1&WjK?W9h80gm{NerHY`tq3g{r%^Q*7SW^)XZ;k2&=!c5B5i z;u_p)ZI9ZmNu>^5)i2sL5#|e8Ea^7*Bd*pKqruiVOzamO3oH+A@AF^G%1wg;X}TFM zb?RbLP0HQ4D~q!bt1gtS)`=$*mr(>O`Y#f3k*%Bi9e`oX%1%ZEa{EB+cnQ8ULa!Y* z4P1TOYklT7)}W&EVec08_1rAuRaoOE?SU12cT>K)U`iX!_)7adJ?^oX)TYu&rVFj9 z3lJ-?Hf6uPgc3-7#0ZA=PVQ~Ga_tO;;m}}v{kM_uSQ4F`s!uh45+h>3cGXqE#EulT zCiX;gvIspBTro>#-(p^*Y*$~oIwtIAR{6rvE4aadAD=@cN9qLB^~%*D( z_EcH3Lg|A%A$DysQJj_T1b}gZ#bby4lp@YK*>+9rfG6&=Ji!rv=k@dU&U3R-q^4S* zJ_Ors&`Wkg9o78w+Eu6VVitL=@o@>Ry7DM(L42})a`l95fXz<=n+tPJ&R>)RKVC3& zyr1+MV*#5s>q|B-Zh$QA$(z=-PrT~5yJFm?k$SaWuS{e*&QNRHfJ5+1mk0GTx)(lj zc#DW~jBm?8O4~J65)v<&pFAIiU7WFEly~>d>K#+RE#P&W)H}Xqd5PiZ zq*m>bGVG6Cu;~POPLaP&eb-sE>_j1}{^vethM4Dcs@jp4qAdxVYCKQ2#z?C3TTIar zY=2*M-Beto8VSWQg*M`90`2X+W-1o^Sb_y*b4rY>YH40PbLwuQXl)Zp&QVMF6(P0L zR(JMc^Pm!~%f`7{{-TImJ$Sg~x0n{Nulm?;Q!<&Pp}p(0dw;=Wku)Y?>u`0%XO3d);QWm8Qc zh6@vT$(TpfQL=~IrDU}kRJB{vJZBy;yZls3m&+x^nThwS^KY8`yQ=LxWCc>pOlRiB zWLI6xAMs8juQB3NqIEw-FNxyT4^33(cGId;+jM5vp;#ieuvo(YL+KQgiDN?8itBruo!QsfL|s zlQ6n_^r|1U*Y~L@jjD6^J3Qn3GTXa&Id%WW>on_eL3Xcr?B6)c$V<=WvgA1I^_&-E zcjEx)w5_8)$S30U28<AVLLzh#&Ak>!PN^S`o(FF+@Ze5X?Y47 zX4}~AraSDFPbR#9TO;W;I~f$vRO{MXUT+kXZgIkR6F&ur(xLH_rrbo-Qz+nG%oEt8 z!BfDYijSWhIR4U%I>YPholuENca8mEQ75NAeWbuh-!+mUM;IFYUMqjH)sb4fEo;%Z z+y1;@suy|&#c}zr-+Hvu2Gxkta;uw@;4f3$^1+Q2X+>-5Hs&jGE1ASY#rAr7c{`p7 z3p{je=)}&R#2-PgLZ_)ZC(b$sxD;Ge$n8SwN*#Wfwyp^=b)=>#8{2?-ZqzT#*3>h< zf?42{<)--xp3fYPuS1)`blU9U*mF2GrI#qr9daY{o&>aeXO7w4Usuu$Q*u83YRO3| z7;tl0Y;Q@%ky()MrG=S6t^1xMmmCEsmfVg>gdDjJdZt89;UOb^wHMFy-d@&hrrs>V z1P`$s&u&#$R5#d%S_}0gd?Otac$wOyOUY^UZ@`p1o~cjoI5Gy?wNO+0ZX=Eit?j1F zHv7Xy?W?SF*`B>eNOLgvTR}jIk^HyYAj|ysxYbRJ%t|p@o)Chjz_tMt52aS zyMFK}-`zjleow<=F{)Zqy;9$@xQ*jm&Mr4sz;?Z>r5>KSWO#)Ef+F+*+XFbwE7S_; z>co`FbF!02c?Bksy5>(#H|hf0(MhW$m7Mg8d_meU8_jxOeJo9+v_-6gKL^-d?B~m~^K1k?m?)F_>sZ?6!3$gQGT2Zw(?e zz{6fm8$G#@QIpoY?xW=Tnx3ScJ+M;fc-WgTZsg1%(vlJmlMN8{wcA#_AHnu-4aTE_hUM>%V^y^xz`VMlp&D^;_A~6t1D47 zG4HBx1c`of!Xh9c%<87!dzYJln6cvqt}nRHNH6wIh5`u*Rp>K+(w6$Bv$#hlYIO3#4D1do zx*(~9y5)@>q`mjt!zWvFiKQIowU@5t$i)Bpbj&NdCfw(r?&%wL*O-!4HGihbbzKvi z>TK$on3>m8?lRTKD8X$7T>2dfe&NbJ5?vHW^EDtA z=%#ofLTYAg&RI>Lj#+IAwMo_Ku%*+pV}{{K0(bSB;ZAnhpS)_;iePDCl}wk*JCCBy zg8L5Vkjvqt=hEVxpv_=kuFxS*5cG`UU(-i)+G#nfC`N&j{-F(zMw=0u)cNk&b(Q4{ zwx_4IQC}yc~<0&bL+liKWeYYubgaK^`olQcUop`cmoA=mI z4HM$ZVN5Av#AI(pv#lAN7{GI8V3^HP7#^a`*HRaRrKzn+*rK8FDxT_@n>^2kSD*~o zZr-IKb5U!T*+OzK-6K$$(C{EWdw;l%tC;D5m z;4Iso5>Rt^6MyUqxay{dHDJ4I)6pThK$?3Lg)op`!;u(-v%Jy6u=IyMQt#+xAmcW1Dk@{(8bo*g)Y+vjxxxnsU@eOh+}D zoPoHF=eoK!shB&S2fwD;#N1TZ1WC>Ka*FWg`vRw_y0*J$zSo@T>DrXVze{kFn*lhT z`J_rf4i&HyWd?kLW6v8C77?f&psO8>DPHgF_j2Bz08;eUw1W~RWR%OU*dL--w}%?+ z&^hyoOnB(+`HSsEC=x5GZ!|3+`zCVUUkvLXMbI;DbdZpo@HqLPCO^^dLWAuY*7fOj zGQ;V&cu$Qq8xUbq)XB_PcUs$vr3Fl0Zo-G$%z*2@Cv799tro%11Ee9PwNQ1|KMx0d zCJFmba2q#Y>!w0`0u8kbB0obSbc0JLX9C|%Z0>rSOZ2g)%cD*i+WGEmluv3 zL_-e0Al=)~Ez!p&utPzmI6__dTjaamsjlzr;pSSN=8_?=_BQk+d0^j)*>??F^m4}3 z{F;N4HTs5TGS|kov&V-6+oLRha?fC_aH_qlN0*23JFN`xOlL1Pr@k~mf=uSyYM~uK zFlS=;HJ)Ch)Dzg-%nfK#$>Vw-a_0iB>7s|wMmH+ zUE}F{KWKW78rKZUWv^Zj4hDvtDw8`#5HUHN?n=^^Ov`M7>&YniP0V?~q+!ngfaiU) z`lAz5Aab*s63}!Yn_cBEI^Kre6SjSu=M-Xq_(s!k6|}@U>M=%YlszhQiaY3=O8bgMknc7fOY#WC{JO?_xBCaS=>s(ogQr!7JO`jnL> zE=tKh`p$HwABPE&r}_?4@T+d8`B_iQL7c}gQi|FXqdZJDD%XG}IhFOZ<0JSHc+4OQ za9MQ2eg<4hW?@Zth6hZE@f1;eJM95*fhr;e?j6}0(uJ3y(L9FDTW zX=tGFES!Xe&GYUnN%+aTrtEiL1tl^tJXX*8U5dtW>?xY?k4`pOM7cI1?A&fPN)!eM zKL^uY(|MMj%*Jd~p7+IeLM`f=aOLa-s+lEtJYk7Mnd;j%;@f_<273#(-LIeIDipl% zL1?l~2zz)OFgy_IyTKsT1h18j78F>`s~x44X(5eB!xOOWznpFpbFKzVr|-XCP(?MtEnPUZ*0ZnBanfsiMz{}uwZ-ynM!d`@tdzfv~O( zQa}Z_^W&0^W_nA$il=Cg%HXY`NAkd6!bzjtHECR4 zkOV;w5}M`Bd*IA#ehhR#<qGpS?BSVlk{1)c5jkH7F_K`I_KZy@AHE8mrO!+ar@z^`keOe}4R}3~?biSy zP3<}})AOi=&Qo>5rt1lU2~ANScI6(y_T=%jOJF!U6SjLohX(T9bmceV+SJKdtEAU> zl-vxZicAEZJCfr4Lg+WghZR7L?cPck|G@qx0ZIu8d4geY8+m)|hr*DZU)~>8%pe9u zo1ux#jK=oFl0dwpy`T*34xcn903!$X7*Xlqw%U@KQXjaz7}9nzI2xlg)otBEnpII(rsUDpVffvGVL#Rf)xuG zM^n1o?d@08N$dNGZ0G)UaNYE16L9Ra!8k^S8jwfd+waewPP^apv)P<^1p1LyPzdqL zGvJA_IsLL|a*pPaGED%*JO1V7m0rk(PSK*8BHqbTE+?YJ&T}s9su^-;y7_)T*;bzO zUgU)HsEyX2U=CV3|C}d1q4boDgQc~ntmp(dX%Wv&@l+rv=(#XAzlKErT$tV7eMh;r zqh;L6w*vO`GA()@3|v-28-y5{gh>fjTYI9c&p8kKtZNQWgm3~zz=!?uIyrSjCw5=Y zCs}ZK#_;THmyBIGqg)LSCfbqWsYOiz;5uJi%)TW8ErCsooq0yb(x-3dg2;njJVP6} zn;6Vah-{CKhl4uhCt2REtPV zQ%YfG=R>pi;-Ot>a&lHsh&$s1;&p+@EB6DZSJDw-*eP^By`bld#1s%4W)HqTVhyTV5mp3@xE6l1_u0u$&Q@b zk(UZ&2}h+Y-@a=;(TCA3CJL)vPU{Op^g?~&6Tu`n%Wip)9#dhnrB>gY$jF*7%0<8p z2C7^eCF(j^;M2j#4j($wdyD#q1&(5R&M2;YA-A1&P2a%)o4=SMySp6Bd&%B_M~C!6 zb(8_3Tj3rAr)SD0k+F41S~!KW2C~RtkR(TdW_)fb+GqzSz52jqR5U&l)cK2>mr#n^ zb6)7LQ=)uHVFGvCk+dLNy5#tJO_AePqYP|?Z$Pbm)2a2=VY0P7Ra+QCL;he-n#{?) zpG)xO+ABviO%oATS0Uz@Cb#-PR}}##u|Yd80~?;`I_)K^!EJJcl7JIUS{sKfgp9t1 z_(XSsz38S`JZT`=!ZY$D9RG~#KA33Lx@VG1}0vb>y!`Y6h{^s&vgcc#AFDFgK_Ly3X( zajQ=vKh0qm7X7d!oFucj@sXj{jq8yT4 zmiue>k*(2ks}9p!MZ{dNE{weKL=;HlrN(xzyc7;oGDpojbLwU0(S8xI<5#I7Bj80I zOOl!JsiD^P+P*nY?Z|PvQ3o`oop61DwwITVhOO<^=&+9IyGzoS!mK=r6ejkWp9#W+d7f<#N)ptNqke9sq3$L z=Wow9xYA#t2NIn1*8`UFxxIiwetDC<#`~x($Cnx9gg=+CEI9M5Jl0fPCE-Te-MP6H zwjBs5(w&4F!92EgG;sV^Ef@qsy8gK(a~*rHt!PT@8JRTTgjZ?Bezhi9B!05(zVjog z->$2)VL6Z>B7D88@la$Vk(}*FjN8K8yx3Td{F*7M`Gwlmb4EN{N^rkL_bZ9(DXs}t z)ry&#+)u(yGzYj|cFSvUL&FiLqn_K!>wD|LK@4_Y-RRevRoKdJ!elSRs3{h-o~)f$ zo4A&_-`AMtqgN>zgiF$sDp);+UD}C)NPf%M)yua-SU*duEu)I?!ZS`&Ke0m*k7=i$ zm0^|G!tf&yBAVnKix)*ixe}smw|+M6H55nOb`--9j9({Ewt~PFRDg~qyD4LyPQAZ9 z-1X-7K}!%Ig?Tdd&&&J#h1UrKHeIZpmkB<-`Nn*6rt#AFv2z;xao#n$T7C*-hbwQS z8M#8uc@=7INfVw@svxU5S>nN|bpq~71eH{Ns8#oCfoka0iI7X!y>RDUC-xqbsib<& zRKh151KleuXIkN|(yl9M?N*>y1 zUJU?SVy_41T?_>WZUX13w0S5qvMdFhfcowqqdUyeQXhL{mL)q=S|h1iSpopto!(!F zfvrxmdIvBrWeuA`RJsEzcc3at6w;-7p2a&<$)Qk_CO>k^E<-xfT{CaC}gZSU7y zA1CRQyta9gaghWqWzsVcluW@5A|Jt999y2ec=IFQw2~GnN+~2u-zrvtYLdTbb5>NX z0_K~m(Oq4nhg+exT=T6M{NtBdw$9B&A+wg#Q9fuVo^eVBZBec(kuzn`Qp6RBc00Vg z9GD`K6Cdv!wS6zKT^IGyO7Cnq1dJr*~ z*Vs5(mqp~l{qr$o5a?S7rqWDrqTAG%bboy!);uZmruyw%Te6H|_Hec5pf|+TfQLXYF*(_Fo$rRe%FjJcU@qCxFy7Z}Z5O)WzT_Zs9*V1Xmh*>ZYvP*) zQ>W$TOx@HspstTgmzj!E#yf&KvIZ{4Rj}Pc?|8gT3{loDd4pk^(@)y0 zrt1AsPoV4)d)&`m;^m9W{spmt zOeZI@HIX_tq?0qb;GMQhP0K#YHX;?W=yp5-1QK{lvx`axc8eQNU z%gNqTk53BL*jrJf=BX-O>l9po0h0=Hq7#a)Tuq;ewg}=Q7O%=!0C(XnQlQqtqb;~e zb8Mc3lQV){NPWXinzL=n_HCj4tdqI%P8{sCunv>xBzVi>0Ni>m0>*iL4hej-zuj;o zwn@q?<1gHAek8{G6_TIuk^CCC`gZ){q$Z7qO%$x|33fnABkOp?suKy5CA<#g4T3k$ zP2CfwvA5_Nwd3S&QmPSai*H>9;E4+05m2`3>ve3N(QW`KE8Q*x=nroLAmYP*R;+4RCj zHLErjDyV3eQI}2Vy;{XpBW{x_fKgxU=RTzvp*?K2&QYB+s~gpY6>=$U!omz-sgUZO70Ff zDN0b~+ApY+HKPhEu!%QGREnj~JXlPPezsuRAuy&YL}36!eT1s_RNyaR4Z#NZ5I4^`_SVt?R89YOWI!xRsE_2~QE zH(SM*pn7GY^@P)k_k!0;x>SSpp2+J1#*N#{`~6vNX%h*0&l;oEmSgn>!S7O|URwYhO|mLK|>Z1-4Pa=LB8;P z(?%|^Q>qL02$es(fpQYrcbWZFE{0q|Gi9n%E*ZzB3{AIb_4>+dsz($CmyGS) zB{n_{kn|dj`#>tL)&%5fg*Qp7En#KDLF;%TBF8&XEJAe$YNB1)VpL^XuV%0fG|oGO zmi?p{um@<-55hE%jcZ>eesB@-q~YEDBTO%=D zFm;sXRS^S*U_W86q#GX(Uvi2PJ2*viGDK7nf~TnOBn|b(3jU@b)_i-rnFz01GP{X; z!h1zP2-K;nVGzRgYF^LnR;GzV?)4etX!|kb1#qYZMj3pVUyIhalA(* zWK{W+@cU>hkQ;SVNHvkZTy(RV5{8ztWLFwqWu>h+q?NP}kM1hc zNYL}rZisduF$W1~T4QFBft#{13(qHT`F;}*(3bpfcNskM26PKa2X?v&73CE0X)X#KN zLVFE~IeU{Ru!PpVo%Z!Pzxsyjy**!4FOu>0njGo&Ki2oqSFSoUNWg@dL?wppk&Y`B zUw3%yk5_%`K;q@fz=pe&gHt^v_~W-)RTq>L>!9ttkP}i< zYry-S^qHDqjmL`Dsu&q!G5jtHn5UsWokBeR08v1$zm33cW&F%B`Loozb#XO7^fw|+ zkfKZXWZ%%|`1(?H>8zxAwUx=f4~19~hHEYch=Jm5Z4$lJnuw8v?a|?K2Y5>ea1d66 z)_=9`;sQpowFhptrjBn6aNp-go_b?>^|WNN9b_@yK-b#}BtIRY^FBW^ezR89czm4M zkgmq3zJU0ITa&@GjQpm9;aE=*oEvg?6oPaixCVEK#Z$Y_Woe?{#Y;7scv zm`z4?esYPcib#(U(Mmq-oq>6~sk8|{xnCuCSO~fXc+x8dL)E-m-HqhW0E8Wdw7!1w z1^xa0$$@VzTi@~m3U|2jy^or4E39+V*9=ld1e5#}Xzwj&o3dd?FjPhAd6J{5ZzPE+ zV-l&#p>Hg&ti7GU;41eL-2G(mp=o>T2;M9EAcvp|hMhmxAVXq+`%0o`+-f_2alP0V z*a}bm9>{?ubEuCdvXl6DYoQ0^M zrp9kkM&yJ6)eNp2I2bfCcf1O=^R{F5=lMjwpk~~JM^te1kkuuDfYmnRY{+HR3GhhA zjCDpKZi1D~J_&YNBT?LPf-{QR3*)?Kb9*XB^c+)!%k;s)tjfX;dF5b)xhXxCdwK;^ zH8SSNLoO90kNbRA!Fy!x0px00Z*oX803ZL-U25H1<|I*uNShj0SE3C+RiK3KC7Uzv zU;QGi(~3y$geP9XV`Ro8@r3o8QyQ;u5m3=SV;1!XN6PlcQamX@sJ`bTb-)Xp*VoK4XoTaMw92lbH55#0)<{v=lgfj#+3MM( zQ+7>O$dm6|glfcQaU}_^E%|sKrz{7ltt4cilxcQ?XE!-zcgkiWl^@e=CHD0T_He8F zTGx|wG}JAUtSGG~=@x!sO_OODH(BZqx!^G&ILaO^=%Lzi!0@;cig@r#`cEgAZb0>+B_H6L%E z2>RT5xE@K;p_pF4lmt!~t5bCCmcLicMqE$uxFD{wG5sco>sxiNADx7t zFdpQ`*b6-=tP84q*p1*P$X~SAkS@V%51@BO$r_OHWbCZFc2NanX|Y{VQ&`w*QwPlM zpq^}l+=mh^2CuAExNYxChFl^TuHZ%~GQoD!i{EgaR6VJ(kkzu+d}at!YtGKbLwVl5 zQ%82apo0=R&Jv&Ef~i8=df%R<4JQ@HWI2KNU#;gDvN3T)yT07^O|SWhL$q4h)vq2c zcKEZ#<*V%nT3!`D8)mz*86i70OR%sG!PM^47j|}`zJ=Nq*-5Wk76DiV-Z*NlI*X?y znFxK~q3d;1#|Bs?oA#a=d z@=2j6kyKJKJUcN_yc5PkA_eTdGJ)Z(*R{54j--m#$bYe9^-*GOYASIhi;p%E>5i_^ zxpHwEcW!EHc{Nt&=+SG#-ktr;DZ${nqOq^%sE<-vs88H#mW70COZyth{yrVyDBT3J zqgH?dFWNZhI$3G7OqC4r2$5VD-Zzrsu&idiV{~q57WQ=NSsmHr(bBWq4xPx`I4NBQ zL?V*1IP#fi=<22dM;6MZgtbmVH6fWrZtZYi-Ho-LtN=}c4Xth^sz&6ic5g2=wjWdo z88(TT8@QH{C4cRym}Y7`k6nE%NC5qU%|9?3 zKR*VVq7xr;sEsK2l%Pm;*hD}M@Q_iUPU^~UyhkelJ>AqUBfml)esIueQelg{H^(8i zID@yH@0;V0;zI}kDPjpLwUiSP55#bN%bV%P$D_0yCLv2O&jt-}oL6X^1iTSzaN3b+ z*Tb=#px6E9tK=SO)H#lcf*UmV2x%!(aNoK2JY9zXUrI&fhZoi^;4^baa>13DQ8yC{ zwJo;PmT(L$E#($Ve71?Vn&>8QUTBN6?`u`Onv93JkM-cs9wTsR=N@apDdExYrcAWl z9)3ZCk_nWXW=86f!*&3*JE*aC;ui;{>a7Zg3usl>u!-&%A9+fzwMpIicOaDr*cb=|2t@xWDe>eP_s09UZLYdtdqwLfVSV=teR>hsyP|I% zHLeNHs1e--_ZG$QfU6tVJSd)Uv_K(Q-bb+A<3lic$}uIT+Q-v#9_OxZ*~yL|IbaBO zx?1lj6fmh$8M*A=Fq>7aF(SX#Tj!_`MR|jgf*CVHP*N-zb&_|=+D^8(TH6+xCx3B8 zbw*(1yE@^rodI`=d=jL)dcXu8Yfgf6S4$WMS1f>C#F~DLo9gugQff-m+(_?LxBg;? zw$&+MfHxO{GX|_kKyqaRxJ*q@C1+G9Rzgkw&&IagOCp&Na5stp_o!I!1EKz#;2K;S z{(0k+yEUVzAFye(O=yprWs_|BnYRGp3QdhC z`GZ%(8xhh6?5Pw1Q({V^hTcVY1{I2HqQlL%pky^X_`GAGw43Q^y-Q-xPFBxv;l`6h z#Zi-^8zs*nNtQMHu*)saA>0i4iNo1N{TQ}*Q}`F2JmQ~2yI~2Hh$N-3oi~i0a4$iS z%ctz4*%(>d19a6RQBC4qS0A|4Qo41OcLb(NYR|5Fu5E|tOE3hFnrWEb=hDaQi1`HG zJY#eWM+E8vk3O}3spwlY>;~_;RuMOrKHUi|o3>Ml>I0J!V|&ls*CkkhfqT?%@>39W zA(QH0V@faKNp#gmX-(_(L6_It))^qEDDJf7O4i%IBa+po*QIg}<=DWXUrw(FRkQVO z5pO-+v3ZxaJBjOEaEod?4)-WkFe&^rj;`|xV~~Dw5k!?@p#%@`T%OO;awI!yY#KZW zMUcR8vqQkP1T}>d*<$LuV{FJy+R8a0>EVf-wNFd9d5*{OAhgH`0d5fo0c;Cj)VeyE zPrzJ_8i|P(uduQRLbKaJa5-cIM(ctNM=+FED?5p>4&XY91oH=`989F;dnXv71>2=j zVwYfIszTS!J#Vub1OqO)$_YH?e8{3Wo0 zdLt>gHg#=pCokpUaEnM#V5qwVW9aSy6GP)-&g-^^+^44R^=f00Djcr-IX$d)yv7l> z13Yi2;@)-GPN$b0ab1Q{i}4o}YH`gIkH+kpLOFuNUp~D8OVRaX@2rS@0X9)2y$plf zN*L#yw!(>GK>jJFSZb&-d@v9Mp|zV+RVn(?#|sYa;Cd8mIn-Vu+Sdi zJ)pLTCHo-qJ+|YqU3K(>#8kz;BVH>%ygHMw;1LP76N=a3ksjX13~wN?-5gz`E>+q* zT&dN=J-zh_!kbAIjOjeFk>@TkId}?tD4Nn!SGFeXPa_!|l7vgunLA`UEy2@+en9;> z7%1DV1xy}gEFm1hfFpl2^pp zDrqvkVojTQm)b?BPp1Y%*A2FV@oGW`(ypfZXJaB|O2T%e{TCrCiv%nmNR4U)z`YbH zlZO(PGvGt$wK}1Q=@GoByrp@%;pjG)ii0}nR8I`ez-c%<#=_whft}L}Xr1h27irzi zjYhc!SZ&ldnNeNqOM$|KCj<$)@<g!8-1`;U8g0ixWJ|7L7hgXPQQZ|rKD0r-s$DIg*?4-<^`XlT_ zS}$rp>n91W&(-BwF$Av~g%>7y9(Fz7uazNGp`1J)HCT=4qeLlL-%oev_+U7a#D!_3 zX|`>6URwru-nTSRi%DEkbnIp)D@u;L&ZRty8G#-;V`PLhjf8@AOR5f0#5uq_QrmQ0 zEvIBP>1}C=>8wKmuN>oa|xmT?%0>k&QP! zcCM;p-Y88|O?Ga!{sE)gsBzm7ygG2>Q9N644o`+hCuQocrZ!|33cI3I8r*wT+Phbkxa)e@XLqcCCU3{N$Rzdfou3Jt2|P&yH;Afn7E# zg*vR#gu}fOo^lOL(!V|jCjDA}Z?oYR<U^5G64vl}uBI5AvdcY3&vr-Z5^JxEP+u znS7R8qz*g7 zcQTwNYLpzZ%I^$xp8eiAFij1?y>#7zB+o9j#-5RCGvad!9zj{_;~PPv4y;0X@iG4B z9g!ibQ#YKnM6f-rmVU7+>l>I*ygXkecqM@AxmEkuW-P~NZ)jZ+16h`BOB(4Yu9KhW z2UoCZiACeU{FiEdimY+G9+qUjDY+57HiDco*UJ=ss$QmbD~1u0!C%bPFmPXflFRKHtXA8 z&I9jO?fLv+hL7NVZ_kZ3f@}&H7f+so9y$bYwHMd;`gZb0=W4m(Rjdej+@fvygg$T! zW>Xh(VLBV0*4k^n@mdh&08=<*W*_-63o}MOoQY5otoYx6n;M%Qd}T`LsPg(mZuFvI z9L%(WC;2#kVJdT|>wSW4bKs%bZDijhzXuGfX6})qqC~*GJflI10CGFWd&WA~QoxiB zl(K4qFOo@t_sBPc-6lEJkchV2ls5|S0Gm=M?UO*MDYOT5kT;&eljCp{EA*aQM8N@% zU=;ERQROTD#kQoLbeEEo zAy}3RV6LR8PGFe{_}n0za=3?2AGlz?QYSYOX2)`}h5W|Wqd+BaZ|(DwHx_-Nj@`7+ zlpf5Nz_@nP(m~>*;4yQb@gCjv&qx~LCE=M08xFdzuDR=UOK|M^Tgc$l2ez}82dt=q zI54Ipp~R7>vHdC6YX?)Ap{&Nro-vn27YO~gMX)x&3TjHV?h)V9}85@F?gVUuVWe5}CrhWCOr`4Z`FzC~*IDdBe(ivT~l zf`ZfGadJbs=|r9M6MkNAz2nUbe1lEH=Y+x_>ZC@@F<*IuzR*+iQDXAr?H{T&(QgTl z?uE}C-aY%C?RZ6C@1&gB6TVKw8~O9I=X{SKCH|%SRucq-)U+2WvU;@dHv`hYKAoejq8O=a+$#NA{U7L$1j~6`h^z=5~L}8+h z)+qZ;pFSuO79T@2`x^+<>oLBK2|`OYN)Wh5^@DiO_{a36Y28j8B^X8@4ZAB+AJ{}; zjZV(YdjhX;pIS+HAFf8y6p85x{{Gt;l1WdTBev)8-7VEpt&OHK+&5W)WX{SA5f_MWa_#_7c zORHeJM6V`_%zzeOL+zLVO>~7%VpDD{iWmS7MSu`FvLd8uOf;HMhJkPR=Eig#SxbQS z9RhcH(z#9~#k_j9w%^pQ{EQlJ>{qea&=DLj&Z{x>!Xp8?dX+%00wA_$gYAAEWvaEf zmkn-2KySfhR}1cPU{KQJ=rKI~PAmC|GrFcSajPi-;Nz`=%PhICaq!N7&+2(fZO3gj zKDIf}l>nGQ6gBW$?YLC7zq3NOin8!ETi4(q98~R#x~YEdYPjYGPD1LK>PRaK2)G4% zr3-)=B?t%QcY}e;$xTY|i5YA=JKt9d z=CSp(!go_5s?lM+HhYkL=q{kz*ZwnT6XH?bke?)lQu}Exy^E-B8#y7qgV$KvPpI$` zatq6X7R*l7(L519b+mD64X#iZ&7}xP&aRk2MkLv5)bQx__1&0M=sW~uu1S0jxOrB7xh-!MT*3(l zd`6ctN6Da>yX;U1AmFBAG(Jz%s|vU(ZTt7eHr*oXy7~02+^g``%xrB}=7>)05A{t{ zaO;Dv8VL!YIN4%+@PqX{jZOE7J@BQnadgMkw-CQJ^5}Yfa1FZeClv^G+WJJS5RxG# z#H(Pkuha=%bqS(DMG8$HrexhGl*n1x`fN2uf0^2o6p+~YEj?w3&3cpChn2sn3q+>m zbvvSA04Clt`rzVAVLOY~mSHZ<$Aqs!ZSD5Ttw*6_X`d8+Nij5fFem{R;ydzF%GK~} zmZDCui`uiah`(Cn!H%Egt$E+<)uC0SU|@~}Dp_@63fRrQu^;Fp5oo+}fYZ*5;IrRe zm_#;g{p5-S$ln)ACB0ccId4?+_D<%?t;(&Rtw~-?*e+XbN@4-~yV{`WaJYCvjQSoc z%uqa2>&Qijs@;Hfj=V~-H_q6?#hE`eBQ;96Ijq=u->dCP$k8}26oP%FV^d1{BcSwT z^>EekZl$TGGjH7<$&Ml9jvi5klI9wq>C$zboRJ9jbO|t~`X-P(H#~xE?_A)KN1Z$$ zDcN-@wcp`LCj_?l{MJ{(W+{155OWDr@mC*@c6n36_bpk(3#98(A)9e!-*@F*vriNS z12#o`=LI>V&Y%BeUP~CecFxl{?^+5XtK~(W=FA>~TGy9X4=cbP@!Qxj=6b)jmzNds z8dN2ULwoB8tXqE9_H1l&-d{>imKAA0{(U7hqQyliMTuyI;~aEeT5&A(ObH0L=Ymcd zd8o1xr5Bc4o{CU{%cT&pnsJlD+MxU(zVJqF>VU?6*Oq&4>3u@Vb?$0gqnLb%73A}B zvre$>0?#1!@!DHESYd%F6(e{lJ8+P2J>&QcAC=RvYNFU%vsbAVu{ecvlZ6cp-LVMLE@$wh{@g z-3e$NRvmBPy!yQwUky=H{QA|X?H5PbN{bs$`k&#E;x%JoHVLCgFkBBphwLw;(wY2L z&m0krqi1*^S|G$ z517)C`bksqU3_#hGUv{pgueF(wj;N5Wp=zryL)Gy3NA_?mZ8=p)a5!7CHdeHx*Dx( z&^`c@b)#vWp_F;oJH?89WSFFY#i8m`0_|+JUPn`6`zl;@zq_V*k536O6}1FYIco+? zP{C?~OIU({Yt17@4B1d?BCWKup?&N6NxYvcri6fou5nMS4_&Yc0`)yrBhC9(Mkugd z3i&y3VyJKAp*Ha^c($3JGg?%%2Bs4G)=&1}`t#P~Xs?k@t;SF?NL&+l*);4bwohjz ztSu)H8+!JE(MM}m#**MNc@mUY-NWmrcEblI!24v+_L%fd3`*{k`k2Z(3dk(LS zram_56*-O@vZy%Dul<%|XzQ5bWeay3^~u(?x1#~t z^4_JsA>GwUHR&7{=kM9Y>IkU->ZcA9k^C!MsYgC;J50|e|n{IFs)OKDcU9Z?1`W)V0*KNzOdXg8mB2t zLz-@a8b-q1UZpXwlq%fnd#n7XlPVH^88E(6t#F6sQv)Px_O+hDG1|9R{GL^?s$c*w z*>bT)@BBrWEXEW%u0Dof0V!d&5hKsLFE5!Fpgq|9k<Es_xvAq zZ7p(BQlTedPr~^N_Y==5_mIr4f!JGhY6}y6Q1p}5$JJpPXc+3mg^D(m7n~MMea*j9 zqQElWH@Xj&2L)+e_MI99%&@h7?HUT*MgdV@#I3tyIjKdi*NgXix)i8} zm9z!C?$s}L!V)w#4?7WTa=EH&d+-k_IUQ$K!gk~|7rl*mQ8{d_b>>Rh`H67t?)=CT zMnPZ-SC3qkNL4m?E`ea2@VOjBQ=Ej<5QnVmWjHUqB;PDd$E6QCMu{((`qD;XAh>g=0U6_im(1|jmzMu zlj1q_I-nz{(ts=BnP2joY^+`KB$|K;-HAjhdzA}@pSKC_`4X|?F5M0i)?kVGb@qo> z6we>rk-!AHf`Qpby(6Hp<83JUim+1_Wwkpdu=fIRZTtk>>~YJxiU)!6i(mS1R>a6ScLqX_K~BTEz`Snh9*3Mkz@7F+ij`F9T{|4XAbaTHgV{o)8B zfZt#K;}d_*DM8A4(dB`r@p1-cUvpD+G&~Y6bN0#%=E&|Q(k0EkE9n}v)Vx<)i8^D9 z8Fp`tjuOlHDV}tdU6iV6!gZnH!L;b_MqoUa-#c~ua~rQ(d)*IB>MeO^P$Bx}TwB|^ zQ&Q)bS6oRtFbqoLBi2$+QhT}0>>7KYmXU0v7eYblg?c|1*k)^O!QZYlW? z@|Cxtpk8#C0#^HI4^y%)R-M59(Py@#}Q@1z_hhbmqoxaqyhEQfJyGCgSuv)c3^;U-?ehK}H5_Yar2Q5@N+s zhjp&^{F)PHR?rfKH+*>Fr|3mBk2I$>V();d3()cs49dIii~Q8?;#K*1Tfl;RGtj z9UA@&_eP__lk&NUb_z|VMXbNh^MF)fXXE)ApBy0>(tB@y&FM^T@vumH|v)YE0g;XUS9kE{c_$`JWiPBV@@9ZXWD|nksE6CUP|ba#Ta78|zC_mOaVj+-XWZ0LFBkAAcgQrFqg~ zRS=Acg5Y>EcSmFbQax;CwSU&WVHhmekgwJrR zwe8TJe%YwX(LB_B?EJwJHGYBN36@XQ4qJYsDVp`9J5(%2z`bO&kTbQnfbCP_)#ri2 zp`8Jjb=LY?U<`e;rmLDDUwt}yy~4g~QCW9jOt!gsph!x%9mQZ2Xf1odI4{#>*~L;0 zyoW+CFjK__BtW+*Qmt?vN1#wFDMaMC^qLpWn&|*UTkZjS4L=PJZ>c)L-kGOqM3DkR z$t8L7RKgGhTx`#`uVX{}2O*p4dPI~Suxhn>*F9dm&0{H!wsxToUCT~NO}8hp=&l=*-<0Qec(Nw@GbtOCd#h4 zuC6JcDMv0&%KgwTPj2ParcsyuBJ7@Tym^>GM#pfi@AhDw^nw{Rhmi~HPzTg&_7`e7~1pEcse4Up}GnZs~?J@#v)6WcxYR*!h`A#H?E7uDvsm4JZ zMeJbTEa{!iUt3X|4ag)&>{86E3P^LG`_8f9vcx zR@fc>LI`%U@6x2k!C4e?*)@ln{y5TGmf-syM4KSPKy7$c$~y_y+4yj_rTb7^UgL9y zAUQa=AT$tDElc^Ls@1Cx>n`pGSICZDL|&gN`>0Wz z#dWhAi5M+PTV*FzHOPU9EY`3goa#AIgh7Woc*&_2+;2V+snnf~XRvRB&JpBjz^0(c zYd$do>^CD*aR{b^MX3Mp`HM_*pK1lmEU&OL^eLDX({f}lqN2s6fReON4&QtW6IEMX zl^&7v;)7Na`WO7!t79k?-uKgxQ_yn*b50iy$ADWaxv^~#Z>s6V-kWc~N9mn!cs%pu zsNoQ3zM@ka?DH@+_bO=H5INlnx1?Kkpuo0- z=lc68lZR?L8=8cW)8RD-8*zU-aUDsR}-oWX(g79r+ z`W7XZnmb}j^OlrHfQlmYr%vOKm)X` zUStBaCrOwsXx&o|eV%6FT`A88xl@>#O0{K_B87Kqw&Cl{eSK=4Ix1X`*LdWo*E`E| zm)-25LMia~2kjhfJ*r4Neyt02D`T>`W%VtjG^d*ok|`}1bi*fY#5isQmtOQ5e^2HH ziC=0JHj$C34?2|U>`thlH8L0reA;GZDK*q2&q=3NTET()$E->bxF(qBuynIly@()@ zD<_W=sn2ni)< zOBiy2+mKZYqRp$pHMBXwog)}A143-Mq+T>h!z-}UWbt`k zliy&YOSnfsAn;JGFBiy^7C1cfAVUJ~mL^F$#Ji#~D4#$H3)B7}=DDknO{J*}>A5AY zFKEqbiUk6CZo)lE-Z+k;5aOGfILQ-#hzm%2NKl3d3WS z1rt*nFcH`**DP%!9*BH0)QoT@^=&VUE_I89qm!+7yQ%za8F+@jP9%!#;%@u(F|PcX z3tOMQ29Iy|ig_$Ki5iZ*eb%S`$>3K6)4k)!N>KU9Oc?MZwv;*4$3C zN0v9}pd_WbKIg%8rck72K*%EUC+y}DY{TdY+cW*NJpy zeFC+e^FpF_WN0_Ix%!nYl6>@#@ZBp_%G6{+EQps{cZKY2sjXYWV6w!t>;v{l!8OGW zCW%mDomeZ4w%bD=0&YcVgudm2hRa}lO&QaeA$*PSSW)Qxh>$bbW+#2hl;oX)d0O05 z;BkxwjHdQ&PJ`*mwA+mFtWm1G5yScd&|p8S>Ke0;th1&B2D5gf!c`PZ0wxmEH!)Rw z>=IS%ttSo(E;~J-7mnBw@WC&qhm~!HIPMiruG|f_-cGq04}8uo6_a_-EE|Zz_&jvEpx8 zC@2)Z)CHVq*;o(t>g+jjPdFOJk9s3~TdI5)sNC58Pm1)-Z6kjuBval|ISKyMQkc??Nd7#N+}mzRn&-rDcYmHH`KhD)O5oa;H^b*2)rX? zuto%_Y+;nv*g4yFx5}v5xS$17HAFM`49LDKUoOm6ZKLKjR=mWI3mtm^R&99Ve3fI6 z8418-rwbl4_#2vYXw4L@PEQ)JNzhb1o>XKYi{v@|WRJIY#X;55lnBY5PK{mMy`&X- zM>HoV!8X#$3>hUJaT3~N4yc4_<=(z~r4_J5+$*SEbh7f=RT%auX7$u(Gps#m9Dyk& zBB^7tBUj9%#nBqTFL!d2obnQTNOgIzsSufT)lY8MqtbN_@A5V`#53yqL@H5rR^pMy z%cTOO?2&!X%oMT}6>Wiw2;zUFkX87HkERd1Y3}&7=FCxh)p^18joOta4x+dza2e07 zv7)qAJz?C*FTYU+y+XzGG0>9iq2W;?;N}-bhHG^Sr&jY@YB+j<+s71(!mK_B$a%9@ zBOHM8DI{+=D~BDwJVB|hlW z)9C`~`pB*oug7*@k?>H7J02;@p9iFFPovsj{*vnK6H_P2wnBtr0#{iuek2)I7#P;` z!7ZG#g4btC?1PW`UX(b{Po_n^lDfNB`rrr+Qfq9L`I7|L3mwmo_w#GKB%EZ930c=& zs#g&iIaBvWnML4bKd(JvBH*eu%;6`0(KNIs*e3gPddC#({=)iO3#j~#YDWFg87k7M zzy0?lC~0QxmdvPI!IfS;!DwgRW%?h1*YnK1B_o5)1f-^f>LKddKKIs4cU(cP2aJtk zq`DctC5Kfz&6$yc{=9k`OU>52nP$L?WXAMQ$%#~X`^@JEJ;8(z+UqE9{vzI{x^3(3 zFaJt)JIqNx-iW|IP+W(ppi%iua1k5yc3yxbxS{?(&*9b*U|~=1<5krWV2)?bs{DzS z;FgkJ#?LV7+~p$y%7Zg-#RZh)7Stg!K(JZL%+}iHXWjO?M^#-MDu*n=lv@ZG(`RlnS3m@N`Q0yxNU$`aerSrTK2eAU) zm`SAEnxNW3_e}kc?875;&LZh#kCm|cRT863Rw$>wjfhwWhQ=(lSnGNOZ09g#nVq3} zH4b6V4unm4HMrrX07m>Z?_t~|4WF4c;XMKyfV1=@ zW5^ZBOs}8id*;dC!@lx&bWf11>UF(k=&K`wUe_wN^f{C_*!hu)DR|q-xoG+UKcW0&*yK+IHduc+_YZX ztXcc&xoarW_-=7T3gq2MavOp-oY(GTbD6S#3wy$w#g_hcz+TZpCTTYPnpq|XyuVrsEZdwZyqyli!HQeFk=LJG zzAr=tTtgIiDahLLup)A7=Q0|--*($AZbK*SHv%$bvX1eT%pL zo@#RhA(1L|>z{(XH`bX0>936gnN&mMu1#&Bqf{9T)ziGq;h$)kI?2kPI)aAu?=T2K zjh)X@?RJHzcArG49}1Xsp`Rx_j^sDWtXDqDR|o!OaPy1%i^C}_;nqDx`IN_evTw9N zGe7@Llh?vK%DdA6s1eO+YIEc>Qq!9Ubz^#+qn?F7HEI*G0_i=$@uN$QE?d9n^4?W( zT4px?2}KyTOLS}FCn4C_{>gV~%j!+Yq{qoEw+~0?AaCBe^IvPZE>gq3vye1q-JCH3 zyRW7c5bWT;!Q3m6Qv|$M)cF$uJ-(!Hbha?^rg#sFTSMZgi6t<)LeBWX#N2yya_G(j ze8zOW(FwCx6el=~&^He0Xl64PUy{_S(VlslU zEnC-`S-0;F5_L!c|K#}>zeiH{zcP9@_F{OE9Oe9a^77sHTOz0YQ)^Mt@4h{&FW*6?9U;@ zyq=s_6m7FL#Z)uTRG0Gt&+^son?)ToC3pzxAKxrPci?39RKGc`B%;)RqWUqukAh)@ z5TF{j45d4GuP2;6O^;)BKw#L4ZKz~89vB^ijQEb=U(@K2O0x~*c)aGid|^fI1UZh9 z`C(fW+J0ZiWM-tl*gst;A?lfOu&JN&dSWFw(?7$;Rdgn+Wi)g}s!xTu1kFstPG_j9 z?)dmFFgDyt#r2-{ANuP7zbDM%b>xn;gbR`e@BDJ>8$qXn`ufbAhy!(3HWqW7upx|W97WMZp7Lbsxe8tyhPfo;5;c|- zFa;8s9eaYCzDQ~1ctg9S(|IJjeMTXdcimizT;*AHbn6Kk(SqE;`sS&J7!~OH>cnu< z9}k3}V$bZ@Q*%b%$GJ|jC9Uk^U7J5ro{Nrlz=+P}x2GBp!{vuihuUDz9~o-?Br&9~ zTR$tQ=ZBD~Fh%a~EdBcKN5CY9WnPLuci`FU_qqGq1C~y^KlgWHbi;`9Wh!hBYI(ss z%YC4z@-J2-yOS7%wP?7ntSSF?#RsGJ>Gw;SNG$Ep9{9=NnKC_q-?sOY&JY_0IJ^jUadduBEjk zDBI&h=aut*9fI>%jC8%7o>=&ISY@KJDjcI#m?iS1sN&Nf~JR$8uTcQ zu9bCI@Hp0$b9#r5bpreO0$3J#`6WvzdnOu@2VuQ8C$AUE#UCv4|J*+Lt6EhOUNkyHhn0$wfr0Y$`E+dJqp@?>%q`2bcX@U9a?xP>`OuQ~;V zZi^^z`Nz5_N+_B;Z;-+7R+Pz`saf9zvMjkr^5QE(2E*|C8YbLZ4U+_#3A{a$#EMc% zTUtLgEhFtP)^yWizVyD%cjY||^J^1ze)s&`j3(Sq)RxC+X?u093Hh$Z#9$Yz! zX$ij<5E(Ef2rNCRZ=YzoK^C(5dLFz=r8@yrx$3?PCeIG|SsXcig zNVqaDxHx+~Y(y-FCkhw82Lf|cO?ZSq0a#U;?qt-Qzqg)3Rf~IX5Aru)C?9;Wd>58D zVw>t4OZ0sRtscYgbynXuF?v_Po5;TVMqtOCK*!^@C9=u^tBDa9M~(8^2fw?}&WV~e zG|3(;p*N!zQ!Q0yyRXhyJVOCbv{8J&eYcU~)+9ybs~J7GZAum0j=RQeK1K;V=Vf?A zw5_O&{d&O{(wMJXmyceoz@{<`vl#3IspNjRlOGT6&v#Ijci<~^yCF&TP`ClSRAKCO zTNNz0F?(&zNBmMs--v>t2>8c;`-U9)tqc#o^7wdb4azLg_1W)aW}lhMokPN2}k~fbJ8m};X ziYWB5UZsTx4z%r+2WE|IzEX6{@k02D5r9WunN2^pr;nazx&p`crvK3X!@%~ef_UXc zg(-erpWB*ed42TkqefB|a26^5I?xOC);&w%iD0`A5!?BIWy;*gTY7m!j1v+Tpskm$ z-okZ6z$J?xzG|9+JmC8T|2>Qg3^XSR$KciQ4{{U8q9dG5esTnk(r2AqX25cV_{r_c z1}>k=I*XzT#0Ad~N$0tJ>cE6Kv#jc!*B)Q_e8owmcP~f9SAi7<72tc6l|Oe?27e*8 zJegxYxf1q3*Usolmfe7sl|)(;Dh0TtC~C{_y)>gOc~(~x%Y&6uM!Exva>}kM{7W(r zJj;_s3%W{4_XCB<0lp*BV_kTe5`~1zzt!TW(2M&Lzoo z;eW0ttM{5tw@poUJnege`W0))l?m8?u1wI_1WIn3?-SfwJX++|4YuWJt;7orQjQn1 z1tCxQve1VITaoZh*Nuvg9*AX?fjd(-fI{Y$gJq5bMGY=%7v41?23s(!SE5p72Q4@E zi$yKj`>OAeAl}Sp7@`3JEngkWMrkk5LxPQ69}0yUeP&W#?zqeZN;bpa(5BFlp@c(} zYzI2m@cX?8d#{?Xi0BWZ?VRW?PyH8H`pX+77DDvc$IQR&~YhkoV}fmvyg&DJC&LL>HYA=zBe1 zh;|h(1{!?FLoiHg3_Htz2LdWSA=zv8-g zR9-(YJ9~z!^B90(b$_I@Te3t~E}D^Xa7MlY?H^-|yc$N!Xe<5aVqLgM<|Gqc`j9V7 z3^P**76s=gPz1@-OY{IeK*GPau^Z@5QRrf$4|F2Ra&s}Mm=Lt}|~?xg^XPKr9=-XttM$Qe&HG@v<&&3odh{Jl71+>O;@qBudWQ{ zqiCz#c+W0{dGTYFS`e?hUEFPf?Z}^ca7_c2Z_h>%OK*oO-LoUoIp)o3st95H2P9qd zW5*8rMWN7|n}Rnsf~nbM5D45L5Y0ZJ?u)-(-I^UgZqPeblAnctRLe%E$bQr$PAYLu zPwAoB1H|)pfe?oI)cWiMcsze%CXm^5cTh821jRw3tG_h z<)3ei449cwcpjk~qb&(5P)Hf$KW$Ax4cb1wRH|}f#;Db(X_~_O8)(~U@WD_TP3!)6 z1Sol#(QCQy^(R-b2sr^!ckB6uNY)edhZ*}lxx5>95DZC=ph>C$=gj>tlW#!Lcg>xB z#!8d~Syq82iSa{WXP@c|Il}4m5;$ZsLDZ6 zr|^$KGk60XGkIRWZ&ZS0XJ=TG5Q)%sXYvVTXy6Vx;yx<-NVEcd7xgTb+)7>tEU2S+ zF+RgM&_W?|+NV(o3kq*nGKodS>+QUU%oWM{T~OSXe~W!VpS@kveu3}A=#NH08FICP z_R~KTHAwwI>l}Hdc{_pLgp^ap=ZIfZwpmw!W`=4Y8{dKU^T`u9S^?Uq-S>DU`U*&n zXUz>jyEwU$HCf%$>93~N4%Gcga%HqV&R+Q`{s|e=unHlheHoh6N9DJ=(bg-hW}c49Zt*S&LhX#qb15TGq~_pbhIt` z9<%uVHUfuf-v-gwC5dHxx1#r>`XC!QF(2O@Srzg3@S1)EEM0}94_zY{-M3T0t-12L z{60M5F%KN@!MImyH>2r0F;g=l>!2?>Egy@?vmBM3`A~{IPHsw7dSVZSA}CpSW2dV4 zAlFBw;>&#%Gkwk#W!6n7fzG5VzzR8mj%Pb09mY|h^Pz*7az2^w%vBz$`EAV2{k~O{ z!79&prS7BWBEa)#6e6vBvrCeQS28S_ANU>n%GB9;H00(H896f#t@sp_Ad<$(wc=_0-b;chw6KpNCTNnP4q9o}irlRgPmjyultkO67j(7G3(*=SsZM9-X{bf>OQX zSv=y7dfhOu$Wg#F5x8S zLvd?Ow}hicV~6MfwtPKcec=A$|$Kp42^KOi)gc~p>wu>!3%ldRE*n*zu9?g0m4 z!y%M>(~|sOOL8Wl{kt7JRD0?nQ=rb2Te=F20aEhicVH1F&}Scd$s7_1VhWz^lzy7b zg*ea$u1qX?hMY*FK%YtGJJyErCHf`nGY{?El-PB)q=I_N`4kcB9ch#%A$4+p9u?nx z-XD29520+Lc$E}%8)VyRQx|zq_pHw|s+e#nIhnjN!d$|t8eXzN3=p& zB~}nJir*raFZlt;N*aMaTg9~|Zvji9_7H=8CbOSmE2;k|4B1`HRPYWO#YS>PpNsU4 z?sFe$V5{zxY*p*qRZ=dd&`qh0tGLK{zkx!^muQi+#Nke78LyvuG*F0Mv&c6JV~-S} zvqlY?uqyCvQ(twnwFN=(9k_mOcWIY{LdcdqTshi7kv7hvv!cX|Lo~jWuL?KH#XzgM z=6~vpk0cRJqR&o=AFE_FxC4lf-So9h%}6w3me7(3)KsU;<3}rE0QkS(#VMfh#=Gg& zZ5eQzDeQ+T;tY)QoduL{t!ht@$mMYL)7#d>g?x0&>84SrxV3MfZw+U4F;qw=&`JrW z$Iw-oafY}vSNl6RQ2_Q*NW{!BbJ_2~414)NK+mQIc;qLQI z1Nk_5U~U4Vo2@d51s?h=xbs!TUB&4@$#hN1f~JK1Bcr`$q1*fFOY{Kgn3)qOB3%Lp z8HZnmm3(^-eKt>)i*vAIJqT?%Tv7=!rRjm{hG-`niZt@U+Nau4DjSRDiBP;bF-6Vp$0# zOzo0iOn7aXP3OA{;t1xQ=z*+SuV*;8G~CARBbi~a6^Qpelw!wkWLJ@dhoV>O&l(4~ z_M674xO4uU@`gQLOfm4b;_mTIBHkWDJGw_7-NCMxZ#1%}MrR)le5Wv^fiAvLy1E^{A+ zakOv`?_ca4n|O?cua2aAcoCq(dV;WV4;58|D!)bOfEd|5R1?vO;^J^^27TMUrr{_a z!D9hGEMg`=N zZR#P6w^wwdJeqsJpR?We$lU@8quy}ap~cG^ZVpi%Wj62lwfE2P`jZTPR`nR*+>f?+ zWl#JXBqqhE2t0*CSJ>kz-eS;h4mv|Pm~dzF^OAWqwn2Fl0jo8}#Zxaj*1bunFC$(g z)OC7iy6}Y730d(sJ``Pewwto6fk@^&AS8p_XSZ&ym~AAFvH6NxkGT?!k2^Tw@;huV z93=YjcO`I37}>jjYKL6Y5t-16hY}YBKXs+>tw*KpiF$ff7bq^b#oiwGcEx)omjzm} zU;?dEg(RCj!^RHj13_sCI?O4oF!0qkwnZtdi?t|LY%uZoe8PURkm4cC~5vCWbTI>jpl+AT|Y#R#IApnkzPrm^?zhJa)(xEqv;732*hbk3Bp@0lIeB#cJYSwzk~L$O}8zwx3>K0*FW}p zxHTSZWvVkh%;vW5bQnA48zwTX4^cG7U4z`85K-8fLKi3+IWgaFTMpMac}7ES*&PLN zJ)VLh0*{wuK(7R-!922#sdwE&h;?n1A=h}cG02n(koT}Xuqj%iEzaSa9ki%i+!WDT zyfPA?674Qz2yqmBXcWbk=B7Tpxu^HI(*s`J`9M(+il(rNamfXJrvHq`Ro!6~`b?zj z4dA_p5=}YjzNTF~o}h2s+uh=<61bnmaNLwgQg_q2vR7Vej2345dyGDFY`cfsy+9^W zRQEewxSysZ3mnG)UKw*)eC=^hlwb7U?VzKFIfPVsjhPTZ0K z-=6Ki?{)j{H>5{K2cB-B3lRio3xk1|&d^26xaRh6gIq3%@Rr;RxKrhsZN$r4zoV%KJS5?-rpDKIl86y$+x8 zFhPL3{&)=U?d}2W@p%Wtrfo`stNIC_bk+!U+%H#xmhS(f`-xwX#l@rbe8Uug< zI%ly*=F1l8PiRWgHi(5cOT>~w6@Vj@#CND5(BYnzf(1&bDp4av6vk}7Xfwoh8 z>OswcPh%6UAK{fctkN1~)P=cX2g-&-O0dUIE6VjkGI ztZqGjRwz1?B#|1d;;7wS3e&lLz+pH8U8Y&qq5)^_p}k%&!z$$JM1|CiA6Zq~fUO;-LAbq=UlfdZ{! zDg_*h=L(C!7GOD%OTqxIc=I+@P*+*=w0&z!ORjO(jJMN}rXTBOx zq^hDVeuf;?x^iKGTD%eTMAQ(pha+KAvCyUT_)v5KR`grnS3CoJi)6>R5Ee}|$SVQg zf|A>#!KXH-n^Jh|UP*6_r+xdB3X#?AyNfKL6fvyr5sXSq1{A08iqVqy96g}myJ85G zYt(29TjPix4rXvX8JDPP)C7T`&mL_?S2z-Ok&cUJjLoOSobyIbjQ72JWk7=t|JDw2 zKp^ZtPpw5XK{rK5ey}N3Otl>n`2>A?W|>BVrw?>MFJ*L#V?oon6xCM0gx&)+<>017 zXNiPEXq6{pix*^$7@02kF$r_5=J8UHGU9QeacR--aMc#*Dk>la#Tzk=db;rEj=&&d zO|(cu1#m2tK5qQ6tN1;>WgQl5!wJ8=z&KV7a#e^qfbQ0F@E*2%i4!@ENrZ0OgL=!T z%JOI;j@{9eqHHsk|zZg&x(Ff+Ew{{Rlz3w;_*z*M#WdJ!}{xl~Zhb zOL&ucqgyHeU4!Rl(^HNIdr%u~9s*U9MsIkpVEj2sj|ZiwYkFYfApl$}jxok{wb_HJ z&cs7F$M2Est>uA{v*sUrTil5r-W$0wE=qV;JTAgqelUc4rcugFVh9%@D5Jglx9+my7b z(D(LqWRh?dwXmS?!Z)MsfFf`TZN(EiO9Xy)6he9>J=^P+V^mBNfYjBk0P8B*^jTKL zXj{q|QwOhY3l#T7{5}?{dxb&5Xs4JtP_~{PPry2fCwNDj%2f4F+-iYd<#p-@wlppH ztJXzMsc|>emx4m%74zM!@~P<@*Avrbj;m7)>~3-P#Rxi1@R%=H;ZBTz(>Iz{g$|%s?#0Rf;S5)YsS!xD5+K=&Wa2&b=*cF$-oAcdGAgYBn6bqs& z46AsA_h!RqQYjKYegxDi_wf2GlEGk6*AiA1kJF3i3kP%W?%^47Zu_pc#j{8;K|C4J zH;ru3VY; zI`2ueNjyVO9MMfsGzL5m6f64IM2r^WMfEdga^nnRehXQvGrO%*UhN_&mgT0miH=13 z>5VCWM*pnQ5}E7SGA z$9y%?UzGZ<`+t#J9JE|zr0H_C#Yw2Pw=)Uhm=N_ZXdl|j<4%9FhZ%XgaqGL+DDr$p z_YnnR*jOr#)AcNB`Go3>(?gWl+{k-=d)o?>P+kn7&1cBQz;FnA9$`t1sX?}^x`P=S zow`hhV1m#QKLr!zim`I-tkEf%RL$st?J!U@fIR@z663e@nlu&nblXtsmHm9R>n{nq z`@vu^@FTo$LF^7f@9?;W#c`u;_0&M|jGyP9Zfm#~H3X%TEsBxf))|W#dX*M4E>}f> z_-Fz|+dW56BbgKwPS$KoT>qhpkv4x%1i_op66ys)j|fzkXt*RY2a40Y2}NLF_}8f2 z9)ZGy>*12$euN_6=pH5#Gtoocp=bh1EH6+(W;J@4C-j_XOVVTf8vNc%;CtX%Vse+# zn!!fYmFOlml(zy}QNajw=n}gW9WDOwsIB0@043Yhon8#8K;JQ4qT7wLRYO-4QQoe9^dS2f$@jJLA@ytLYMFwz&4^T~;wB_V3DY2)~?Ug_( zD5;#yZ-K;!K;Hqm{Jv%+E6X(#F%Y$#@y0}HBMS($5d;+~IU~1ycMNUUkmW3KKmDFY zp~G+N{jSVQyi4yJ2=qW?7~nq2-UY-3?_S@M8nF;i)z(6Q^QZZZ!xXmSami2W(X>Ln z*xaxR_uKR;EwtS99cM;3|DtuQ@_&uCvyqp#@>bVu5Z9D+6WWn$3^ zW$DM3QYe?W{}lE9Jp@I9XU+_^e-*lPWieW1e?^I#(w+5aRXOLNDExW2t%!d{buPia z5#GnC1r}M<9z*M))3?MlQgRx9dKg4a{C4V8a`h5#>XW>$ zY(SKBd4;{t(LL-Py!%?sWqY%Fw|DsgS1183Z^9>%iiK8HP0KBLRbj0U>NDXMwaL)~ z#SpjV;Uf0F$n=(oC1}4&auIs-fSaTex`(&>51;+0cf@#6sCK_^;qDeap!H?@1F9N- z)D7B$<^vt#7;hn0*^WApYwjyIit{i^*1DcD9PobNXD=Ra0KJYpyPs8Fa=U`9=%fj? z%Fedir#~c2cN&c{2-$}3n2hP|tuDW|3Tdx@tp^hbDDry8ZJ`PXbWrfUYJU_L9%;X>RhJ=oc{H|gaWm&J5 z_WTUyBG9)bdlKF(D=T10PvhD&EAMbz(RP|vS{Icrw+1L_>2ZyuRL_sAlinz*-Pb*c zQ4tUyN<1!GpS?KHrFii_lTZOPE^&8;eYr)u?3>*Vap%ZTmcWg!oJ(;gWq*e}h)^>6 z0=2?1=-ae?AWoR_^U}NH?_sivQ9;1x75XfRye@9ucz`FkdUV5|$6w?bK}Y(_8=#}N z9D8fl;WY<(g69-;i9$6_>EfF-DqGpXv)8&E9d@gzZDa%sjVgTQ#g6n&k?MS6W|4FB zZ5~2l{}>r#_6@y5CvAc;miOkJgo}G!dfla;^5?MHpPEpiVS-2%)I&xL@7A6}3D7Pg*VI%#sknw;`Q4NRHc+;OZ zhgjq=yz#Nc6F+l3OjHc% zVqEndm^Ge^Y?2-eN3qW6;k=L6eo?CMZu}aek}c6bZRMUBbdsR&(R^<%WiQ9Oo)vwU zFJ~Br;f%jjVuz=JY}=J?_aRYHp?f%1b11i6?%_&eWQ*NSYQvy6)Js6$tFm9?J=%_@ zo8!h!_pJ_y?#&feD2mbU_U!?y#6#5UKno-oD+c>6=HgvbOr%}kd*AX1&kmuQDh)u; zmLaH#-^JkDBTvK=1_cxDV1@>kykgH@jR7>*-hdM4^%jDF#BF*v9|39zV2M;W(0 z97cd+`5w99vvVwx%{|`v$_NzlveRpBR>uMH2K$9CP7Fs92aJ_Q+s-)Txn4)qnS9~J zb$wfUlTjS{7(q0syzk|B$}fxxtNinMeK#HuLAvP-A`aOlguKt z^qwhWeRqE&fl76XH3E3=B6+qxtq+t%MSE?Excp8rh4+W}AJriQeI{El~K3glZC-MiggQA4Wt z)6yJhr#b=-FRHy;e12bAPqi%(3eEc`e$`=8O< z$$ZhRbkQZk$Dia}Pk@RQPNsVzioT3)XHad_kmJC`45(km+4RYnmW19x4?i(viDoY6 zeU&@}-&L`XKPi4PP)v?}Rhj40oewsbK@IJ1jjNR$7_uMz&q0ni{RFKo4s1LsPQIQY zA_@8}PfCqTx~kW7e%yp-%rkyMvW~R!K5ag}|Jyy`^X(*c7_DVx3VV@!$UkjMOS2Rn zpyf3Dw1^~+6{3fCFDO}eaE47-k~y-$)-qX;DDyOm8j(3$#_Na|bDnQ(}LJnv%$5pgfM!VPj-R9H(g<`2; z3HaA`NlR_snnT#z)+(|Q(@k;2MpJ?)-ojuF>lq`-0l27xS6xsVPqf*nM8e8DLdPlR zm{PHN_OHifFEcsh6~|GmT$0`V&Pbmv&8VreuRM<#s%pz)<(}r>dWYWf605~-76@Nw zRt=z^da4(0$vk|DsT~Ex9QT*bJ|7Q;AHd0y?_j?Erk|;|oz_T6aCfK*%h$DDEF}la zs>zX#7}*^bdl!lLOehu$dZph}^Ocar_Z@pMU;R=3pmvx!v#RZmTfUg(%(AxKR?8v0 zMe4SzDcdJzthgxjoo~g#R4%;3Rd6H;d0T*q?HHZ)n+BJrq0D}7-UW88F8@Sp>w1Zz z3YArOwT*u^mZJs6n^u0P%=8!_Fm^xRFQWfDbynBi(7w0AwJ>ELPxvoD&c_r>-CwUg= zp(ux2XY&Z=Orc5vTq-%(J$o3{<9(l8^~yuEWJJK9?A!dcx9h4<6zk2kJe=cGtO20! z1aK+v+v1%ZfV()$W#156bU-!6Fj|gc56T0$*A=@%geYNvx+D{t|Ks03k^QS1*1OFb zU9M+}3R&lq@D}`j2d0G3XGCjU2=T`_H>C}qQ-CW4K8K%gpq%XO0r_icE`N5Mi!Dyq#9k=b5j??W{|z_as3 z`mA+h$ymH<+$_Az%|Er3?BY##u`9bWy&za-^mL1oW4N}A!&|d}o0>S^*B9~!dnax^ zK4CDQ0wpuU`^s$HLhMu@cyA*o*rSEuxZ3Dy?>g=tpdCnuhP4A!iJzP9y9t!)XJ9nf z7T(aUE!=%0eJ49xN~hVzf+=#v;(L5?#-=j3yNcNK{zJ$LFJ|~-;BKlXJ0*eKH;rd) zn^Z#1(YULq*wur2mqYtL35_Ia07}>P%_AMZ{1Vo&3mg4UGqP-g@DA&g)L8#OOMw|( zTLs|+mQIo(9DBeBHjR<5d#TV$gi(E(B;uRwB~rke6bWlO=C_{(WkwjvZg+&Bl-6U8 zh1*m!qj;NzhNR=95=ZHzP)zD&KzfT%T#>nu%8|mtn&OG@t5xYNi*ATAvc<^6R zRcL0MB=-PqwVIV;K|r&FlA>jXp;d3(BnN~o>!bV-cO76eMK4XKsu>?DP6BsZw&Yuv zs6tmXotSojT{5XAX?fphymQH`Hq%ngkjGnHU#=%%7Tq*NK2!YNzT-<7i;Hl4ONIMM z$y0P%}WZM`!;xTZR?2?Q!vx&wPlwwIUnLzLuJ>ajc zNgjiBA87qyGHEkBx=jkf$#ioh00r2%#|3(V9(y%$tc~P}x$!+Vc|8)G%6MEvy;gF+ zO!T>;Y0Xk(&=%jm5<73t8M{mSHIDP1JIcIWdAXqP<=lT>q*8}R|5$Az(F14p$`0Ot zaxs!B+d`uU6cIgKhWtDPM#+5 zWP-kH%~|eOGH44AIdNx$S4oqg?It%DIfUApi&8*6kK^5YP7Lhb8n?GLvV3>+`_8=K zuXj*gA3eNF-0(LEDY{;8h`+dlQdW-+o&}r?R{caJ9q69hq(hWkx`VMS`l}%5@uR)n zeV7&QZIa=^z!zyYMS57GuY73h5w}p=8qP3`s2P`MMi$usQ@Mr7DwE@#QXaY9iaWQB z8|d7MTL|6SGN(@eQNDgTAOxOjqP9WGcMo(e9}xo{r|PD&nOTc`uAXSA`FfstQ2T${ z5>D}t&2fFsBR_TALyeqeZG%PCr4u{*efD1Glqf~p_sxWhj2_V69G-4W|H(5#3^tR3D;hp;BBsJDh=^bdT z)2H85`moS;->IEje3f=7C|8sGsD^IOpd14GKPYh}ze?Po(F6Jvx#N^0V&AF2RLz%3 zRF08xxrI8%{ccsz(3XtfWI3zd%L(!SpS!^-y7XKPNzq$C15*QCwy zHhGb{PJ&Az{YwW!$;bkqz2K&3%dbFP+qiaQ5ea-NXZc`#4OL4I>Viek9hrku;m_e& zAWvn*xJWFx(`Z#RU8C*Yn*bcmr~0iy@)tvZbt~2>baUpL>m>Jh9>+}Xz_$a-mb+GouIe!IJQiOx);Uw3sr*=_uO^nD@yf$Dbn9&x-9?K}a zYx?w$p_yhb;&+oQ(G;7?G~|fgtayYu@C*FgEul4AU8P0vZOT$Qe&3Lgw-{L8GmV>q zMn+7+`~QBiNec`37Lj*^LKSO__T6iXKWJ3e`fvx9s{4>u3twbbNF&iZ2rRX{Y*XL`7)qFn-)D~5i*b0uZw2;N!}ck)C*C&H-u%7=tq%B{^}+dXoNcf@x2%vM^RroAOYCBB@f|lsnN+@ z&6~%3_t=&cqtB`kK?NvzbVhMgU!m`}dhQ6jNXA8TV+I4(LQ|0^=($M|ESa{L@*lq1 zw+)HcMX#rNzlJl^PsXWd7Hqt`D|@ZmROI(WxI%C8rk2%(Z93KsS5tF-C;zf$VKnpC zUwo=YFJ+qlX9i~#yU@e!)p``%Cx(CR-BUhQup>8ue(lp|!0qTI)>F@xAgo_+$Ngp| zZ#-BrTA1wJ>oZD5fTNzCO6rL41lW5@R>GXSIXTCZZ7ML1^G;L0HdcF&e@B+EfqYc|My#lfVTUjGP>$O{c?9IJiMlI@94)) z{{;Q=JyO7DLD*+QY;ShtSftQM9l4Ux5lqd5B5FOY`tl=57(#{Genv}~jCU}54&=h> zMsfNFO8S00!-B!q`;UTefxboUou-^mTgqA`0p65bu@)ETE~oz$shCrWfGMc+Oldy^ zi5C_|A;n_3-?vft!wW$RJ=je~cO4Vnf@gk>l&kv4`F1Z+sC#*}u~Q3_idipEKDN}s zqCnf*0g0Z8j-Fc*qQ@(zK=dcPawu)x)4Ii_ z7`>@Sm{Lc7yG?l*p(ty4DTYL#ES=R_u8)v_n^JrG1kK)*+d9R(^=6l%ds7E!ZWLTA zybHs|Y?TSv184hpuj-Khrd9JP74@KOm{JK&;hI57k9V4Kx2;QPhHaDd8`Wo^?9Kh( zHA)hIcfj6Kbm}dMky~K7DJR&GGCzN9r5^=*eLSBQ%v;P7lhzg%S!=3Vxz!sZS1Ny~ zDRwXWWo~~Es&(=ATg-dRa7xd;X7=TioBWX(Z4vfx+s3{WR*eYi;@2R`!hJs_JCJHH z_$LB9L}{a20@%w2(6cWs!axc9K;M;C=OJx<69(mU4a4e|{nJ+Af6!e#kEF82 z-;+vfc{%C`WMU&lP`!t}gSXf&tAxUNy`pARtaQR?*1{<=sjUe^6ju9BQ63{-8`Hpx z8s@2F+_%h^j+%WKqBH2XhS2v25#{3L6?*EDz3X?} z`JjQY4Mf?$J}J`S$yN#!g{nZ`pWJ-uN1^u_d=Ng;p^%f0jcoW&%NlaX5kJ+cwIo(kjd&fkr`wbs1jHaM+rpzs74rKT{R7Ufv0QNdoXm0wk$Vhu=`Gi9<-62DXU zuA{p$gbqsm{Pp!6PKKf~9vd4}L$yHR_)3j!%i&FVf=_NjSHe?(=y7|)YYLqSgH#Q78&n(B(Hb(j_1X)8QHDpfC?>d?|fn> zdPRRB<)r2~UI-@_D898GquNLk*~<6dLS<<4x>fPy@<{tr0Y5Wp$!Abe*zTYHbKKpw zZ4aXGo{{?9=#VBWF?hU3R)8aoWBR2GhwXItQ5ua_{Q3MeSZn?cq#GINK4OUF*9ddC zhdaWOE>a~r4t!`MQXy|0m81n+*3Z*V!kOfPe%YLrZI%q!A%vF_pSN^zc9U}X3J2K zJm}~%J&wJ3#_uqjBd*1H-EyY}3qj86-(Tg^vZ>0l1f5Va8y($GdmuRT@9(X&7EqWW z?4+ryXTL3K(S?rX*GTNWrze&4&Rp^7DzDGbYF@{%H+y7cibY!{F6WECGdgT({TbQ9 zVVwQOZIz~_*cJJCQ%b0%+pQkuY>c3l)zho~e%DQzrgVSz<}L4*FPDAC`)rBK{8%$5H)=EwR<0S5qJTE< zXP_uh1X^nff=I3-o(##6lWuubu>;+f;*;8uBC1pA_``}G)<7EMNKHGbD}n+oKo)o^ zE4^*@1`3l(dgZ5zu!hKpOTL_#+d z5@K_wDF=c5hzf7TaL3;1pPVCC2+;%UJikq++-fv0fX{SRdE3azBaRs_f2YYl5Sd zy>Y0R!Yf)jB`rWy4Sc}7ht$$j#b%y{T*a@O&R+5?dS>SdbOsflzJC%f1KmM&rlX|G z(*t_38UB3fl&KxnbFCklFVKhOW&<(djtA>+N6Zbc$#bj6eH%>A&qvOlfjUXq&ZEfy z+)#nQ%FnVzt>I7{GQ-3fY6D#-AGi{Qk5^d;1bMu<*;G!emRs)d(r0r{Z~GnIt)5MP zfAr;4Ry-o9Jay5YJznFd24+Ww0s6NX@kX57@2)>Ss=R+68u}pHbqN0lY@{{izPLrP zPt#Jz&8=}s?p7=Obcfa6#wHI%JVDPx13aE*aDB7NK{mS1{D||In0+X3fnbrb|)!?>Hm(dFw%~}83hUV-N+|`!rR5&b^Kjdhkt!-FOLYe~ z-x@qtCqA=zGvzOn!UTT$Wy<}n9&MYp!{8^;66JHSbBvU`+5JJi1NCIe-TN;5`EOM_ z1^PCo5}(;_!yP;Wd;3GjtCzxCXck4&XFvEzJ)_D24G2l9(YNzXf4tkZITX`XdA2}F zVT+ZAQh?iz-l~Uy`m$%76atqm6li0;TOlPHsp>`d0HLHbltkzB1_JBL^7(h;R)A3Z#Sy?LEOTI~1RkgfMqzyuU?{`QycbSSC=SB#8uZKtd8sg>a! zv*yN<3CcY2TaVszp-S|^fjHS46XM-oI21A2M$B|*%}&|lOOmeMGT#=H_9RQ-1X^)3 zJGT|_ym+?C1AWPw+D7ySXUS~Oqbu)FbU$PM;;6ntVd}Ms_zgEoIx`)aY?vA-{zNC} z9$mx$A^CF$&ifr(nflXUROAoht?#FdI>{LH{e9}oq2m_gqHN*hG zMzC+#@>>+#M_Yn+&Y#ST)j@D}etLQ{sC0+C-f2|-nj6)3IK$U!bVDKAv|pj$KJgUq z`?|RpEPXdPp>xOj4U%T+Zcz(4Zn`pn{7?ldMr45B+yhGSoGY8A=UNcGih7uNrY*9& zJlr}z{lHs2H|zo4U^Al`bbY;&KpRaP0cwwnl8$)XMzu<&L|0YJf$s99+}-z4`UU4M zM8MQf(A&<`=e3kvulasoqSK_&9`IP->u6sR9Uj7=_;e}_W+E54?YsfWv>esK+r`5I>TiTR0Xvf1|-RW1zv_nw%iZTliJ$BDxYb|r=-Y)0G zIBq6ukF}+}rzP4>CTfz1c|40}w#=*x>b*bn_^bu5Bw|pRGl>1Z^DSiNW2URJX2kmy zDAhflvA1VrJ_R8$&+h6TEIfiOCt+-xA-#4v;{Q%#gFC0@i*U+qqn0^-3lCI^#xA^| zfkJDPNhLde|NZfI!Q1EV=oBKkOiCd#8Gp}_o;SP`oW!6jNH2wMg>Q%0%5tmuE}3{| z?`OFF^gG(JvjWmMFEF%k(m;a)FFGJQ|E75b^K+o=$T_uJELot_wRu|ws4~!SM?*no zGw8~}q_($a{x&y=6=?r#U#w^km&>465_K&xV{Ny5yYC_(@=^`=X3G6La*KO?Cx#6G zw4{1;K*gWmxef~dmY4+mnH^D@GPy`H_#=5%)QNscz0FMEqZ}*1`suY+e4X+4q!T6@ z72SFbGo2M&$yc<6G%gRrw;Owb^`8Xt)Xg0d75n66a|;DMS$M!+=rvB-lM{*7+X}oX zybmt(LAeOd97D~EHkJ9y{qC=-<2%iiIhBs5U8jfJQbb6~ti=;X$bMz{MUPt_v5l3o z(^;x9rby@$+{$SMB>0jYkgy|k^ZI=vyW|EG%3GuLs$>^*x0a`O8bP#8mF-Q*ubaNr zo>SwJvWF75b~#k(;xz(%tJdola-bExPRa^gW(8A9w8e%>gSLjW252hqY*pvSh~u?X^J3!gAXk%>NpKuWY|C z!dCur?rE`H$b2ab#$ zV}0*#e`9?MFrKSWznsr?lujP0Lm;)-CCBfD3=fwY&97K? z#1|>)?q(5KQWAA@g>KiI)e$Y0CI`aav#k;gCru47vsjd9Eq_x68hBYlrAp({$Jb)R>7UEy&lDhze&duoSUIsR3|4_ty-InUV7(wGk zegl0Q)N)&P+ZkvJXUCDsSwQa}uFuXo=Fw#JxZ0nn=n+Vaz)HaVgzUf&UwW%qG+k7P zII6DpE`)yPYPjhUTIkpJc`|cWw8f0b5^Xrlt5BRYRxXA^!2RN)y)JaGDi9ge;6XkY zAn$7j+CPb6!e={%(4Ik&)$d5_U7@(4i`!DWyo8p!rxyqE>OI;Pv$v~KzKQb^bk1gW z1E|S+{2D?YCD9c-E0uM(c~gMBpiZNw`ZHUwi0~Aup&Mpycn7cKLGqlD{zG8Tib6UwT}~(cIw8FBwL9dXgXselOJIyLbW_O9I?fyShN1`H}Ap_ zMOW1I{Kztc?v{$x8)rus+F;v_ksa#S-;{NtAh-C7IxQIfyJ#)K%YIbo$2KUmE=x0$ zqKn4{bae9&u=2Uwb@B5T>qWo*<;?DqfLmU?mu#{j^lc8u>;!LrSCu#@(Pfi+psZ<> zD4F?1T9xLZ&^@g;NMgOgK2u5YeJCPE)xc`XK0<5A9;UX-%q{g!&kP0E=Ec$4UVk6q zih{8kt@ap+cSEWU^f2&%813>KchQUNkB+5CPEL>Dpn^C$l&-I~GnIFfsisTIG>7}H zx7tSa9@@wr7W^YdowEb~$WX4R(6N(Q=PKCIL$p)S;QCuV3B6bplw8Q+=~BEj&|C6_ zk-%ieAPeMn1qH`Sl++5LOV#{=zHRJ#jowA6DD12Bf9DJJy_3shmz2FdB((>MB=Of) zrf8SW>@Zml{*QbJbb>vy3sZB9Y@Kc8NeH|=vUeblXl&F$r9S+sUO^OlpJY z&(pYcSQ$mf%e~r?yup#U14SOpZDGsyuk|zhA`rLn7|1zGsp1=?(V&Q4`x%I>#jkPn z#N;9zapK2d^YB}TNqom}8-ggNM?>c(x>er7$8M&4IZ!qN6JxDD{XxMPp1QF(II7#O z6h>w%U$LAaLpM7ZEbh}iyruWix$W+khJ!klXGtNB#Q>j&*}ZrOf2tgyDFON$C4(SP z$`4kKA^Did8;o~JFl;3!-5WVgk4)4Qjy+r1)1B(Z_ac_b(4=rkQ%Lj;zB92z2bAF_ zi68N&}YU$3N3q}awGnsEEF1rh2kt!jYg-ga3)VERl-AsSo#aKFTS z1MSv@(Tf}{#sKT^O8UF5q$1Gd|Npcy0awj^wzezsV6`nh=>gkT zOb_(leR2p>vZtW$@LGOePO^~tokmMs)?W2V z{Rm2R#`IepqEZ8eh|Fj2E=s}`y0+iqLN+DQT094<2Z=H0+p+yMyh&7Grc*@Y>4t$r zh5`i)&uDQ=GEt_`E^EhVILN!|9`c;W2itbGy*-VU9s3XN%T`Q;NCEi>6m>@Pm453p zY8ghNMVwfmrKWj@O6-V{ambF5=8j)(fhEE}MoIS#l)NWD#O$i1?Bv*wq!A?^PyFGb z8@|YqsP4WUm*7oP1CetbI}=`%o?k<$&HcVfO0jT=-F3iB4w&4>ca`oA;D~b|zP#xn zbV49WCmUMf4~0_bQxG?VJed15?`)TBeVg;&v7)SIDn%G)RyUd()!PEZwnGQx4)%QK z`^1mEK~GcPPO2B9+xKo$Bzt1W#}JwW3Nju=DxeO~{|dCOFyin&vbzLYq-dl^m~-Sk zVJOa_agFP(a!jQd>+eYd4v?T*^>3Lf=ZbWo8C{MSUD2ydk1KhbNcX9tX9lI7-=vzO z7^4mZ& zCkWd0*Y6FqQ}S%IsjTIpJ9BqL&mj*Ls5FNIjg*m&06{>$zhia|vkjAodZJshOHQIy zi9(>Y_*PPGm4uU;wzNqKhIux9Zz?G~MT7sq$(17p`;3e2-+EKqY&OH%HDa)XR2To) zQDx8r5ux$7`|G*5sN`VboMK!Zv-xb_+_|3ydKR{jAB;MmKq-$Of1j*lbF`h@qDS6C z(99ya%I%y2S%EnErE=VbNC+n(=G(9 zF}Ju_mq|I{G;&+?CX8~+>w)f-%%WK1@yam9P1On6mbR6_lbc8pLwLpCqfn42=j!r% z;07y{#M-j`9)kE^o~Ri|$)FCcnfP&`{uyY?OeMHiFneQe>zqlzxx19@dY7heI@zAZ zueUDMBXgU|hZf*MYt7W8_?fCuWImI1^?gM%+Royw`6%TS|6!LV-}Z2c_3!JpsN4ps zTB$%u(vE?l=(^mmSaahAzbVn~jwiR|T7r}D#E+ejYx=$P^Hs-fuiUqT z#K7JGRFak#wweH^*=)!HZsG<6y&MMKuHfJmdMQM*!)J7*Re-`F`;W`05qLRCgnX1k z4S3q=-kposGXZx{%!86q9&>;+hRwhsIZM4>yg0s5koniQ+nS+9w5;`bv~Z2*X%vD9 zYTI*rRsgO3+rw%h+$S{TUu9K{Fd!t&b?u>A&p!5y!A@tt$ejvA0oIoGaS*w)7Vlnp zNvKK%0z^_YJsm}IbD*S+r1H9LVn$JSmGu-y5e{o@ph?wS?Lv7)$ja$3^$Ew zh>okvqf;#i@D6&RcrZi?VzQJIs#pzO{BOJwbrV z9~z`hmZ?Bccg3%D3J849f0oUOe$m&OZcBq0L!-XLo&v5Qv6`?YOA0K&VE$0#t40cN zKxC%dKl<^brw`*TJZ+lr7Q*gnkIR+rcSmY_u2iacX0)zGs9V=iR-}5b$AN_OcnO6% zs`s{dgdU24mSB~b7GOm=*d06r477;(;~0hT$S4^QGtqeQMb7uyQ!GO?K%i2xFgld@ z^3c^=$%l|5RVe&&Ifk`F1l|z@nZr)5cXf_E4~>oK_YSWBai6Xd#bFtd)b;?y+32?K zm}${1iNbypzlKY-a?c+N#gDF%91rVE-B%j-(i(ErsNPhuB!Jf7gAuwFyJ~!*bJ@xD ztPr`mLEkF1C0QiH>!#zew}?dheG7wfZ0 zDx!FD-X0=8rKTX%unH5o-rSJdQIV=8UEUeNt_RpG=u5R)k%Om^;9a|y?&AB4whQL^ z=l~K5tcyla6B3C)kvv;M-*;WCc!b%rV+ikEE^9U+AsHROVlmtSyZ;eNI_>>03ek7G z2@-L746GH)f1xEcJ%UPs)iAhYE#RpeIW?Q8eY7Pj(d(Sz8m-b$HuJ_nl=v8>5Mmi! zy6HC3QZ4^W-Cz|L2k6_zEU`q)i?gcjsO61^*pg=mbX#Pu$m8sO*(?lNWeYI%&kG7; z%iWHYUR;<5 zOSlJEtO8wUkNM;sSgKANOS%N#YyL>AvZR9#SQ6D$h!xq`mI5+a`RaIjqW_yFT~UF2rK33$sN#D z6|e*wFlu(?$PwC>#LhpByS9uDD8yT!^(cJ?)a>t4$!kgnYh*{3&nCvu7-ma<}FnaW4BP9@|=T47`%&Xue2;_(%_QY=ujE9)GT%JF4%D^vENRQA~7 zc;=_{u0Ty8FSI83qg{uFuYYW!jh#b?5)n|Y*6sl1kRufO(frWJ{fV~krEY)L4?Wl+ zZSZZBTum}Bg^GMSHx_Rq1Dc5Dh~I%XatfvHz-t$~tVi3iKf4L;i4tw$`tz^tQNjus zToAj*yQ?T?0CT?d5ww3BLTtF|znvm2ti5fBFQR7;?>q3YX7Kyzs2%b2w}mXwmO<~Q#jiC;q-_eVU=n?3-9gW{gV|%mc;Tk;4nH6Ppogw&bSmb( z16*5Em)uKA<~;*;1-eAXW~-;G=mB&Q`L=z7nHK2iskAncsgGY-2*L5lN<4iWu76i1xT#MA%QpO^M`=wumNsW7u2-W}wiX_ydMaA;tic zb(&2-{SInLjm}ft!`R|46gcFs0%W^LG-@P4Ylyx59T;yi2eyK_8?^1>TkvM9y@9Ts z%8bvd-6IC}X5Xuv;G5^>T`z|B?S+=g3G`hKvhA5lN^eb^PHCD`U&@?InYrgGe=nsQ zC9^0^^P}kP>)~xv-Cz4^LF29&gJ|F1$yJhJlh>`D@6MpmDd_xcb7=DNt?ik=_U!TE zUn4cn`{v{naNCK^=bd3(uSlwN@;*ccN4~YW?9zCzRn7ptwmnl&bVrpj)5|q0er-gw zhKVFp9Md}_Q5@62olRiJ&hIh1bDvaS9U)o+IzCZZavx7T*|R@x-i?F$ph>!Wd*ena zddGV(;l}3nz6w$0RwdHuM2$x2%n%CYN6EHBBza9@)YE%Nqckh}#jEgLzMxk|s5exZSFX*=|#si}< z;fFwfO5Zg+S!?*UlcnrQuhdlglb~wU{qB-?RbMqF`JBTd2eH+Ee`|AnSnf5#r`i|h z^=n7oGH;deb9idX=V?hb<%T8M(`R;8m$L{I&%HNTrkP(W(!%fNh}@T}WGhC3t5+Ndo-mn#Bq@%NbY~>C5N= z%>Wxd_r0|mJz#@*IdPY10$Yn@4|OmVTW&>iNj`lpNm21=aNGH$x)8}%p>Ll&eih#( zi99AM-2%n0@cOOFXv-CSA)FD2xZ?D|3b+3Wl&V0_?u{a)sw~2q*Q|04QeE?zwX0!M zR&gaXOAVtCv!mNe7O7v)4E>&}NaW1Z_I(P@ljyWtw5idpJO21cN>iih+p3iX#H~Z-dM!Rt+uOp zD@@OlM)n%J2l738JVjl_rrY}pz8S+8Lt^yIud?(+UP2vN^?6D`!Q zgqG$hYZT!4l(@Heg*3>EyvgH~>3)~+-x{r=z6K>~>94e2TV%puNibD1IxQ2xEI58nJPEt(8OIU#rKP!28g|(X5e`?$_4fXZILjKru>b zpkDJsH@b^@}z!t1y|@Q z{*6zr{dNT!tLVbg+chADIzqVu`>BxJUD3naPp3zK!N~zpmtx8(?*5iKhiVmbdD&@M z3?*!UmLM+)yRVTQqP8f8V4^#kvgZJ%Z6 zF`$WTPkJTmJzfu5e@@JX12j5l_^rGpuvX&9DygNJ79AppRa~pt>)3H7L(6*e^v%rf z3I%NIx&7R&MLu;z+0Mn%(tDVywaHBd$)76p%##oHZ8cL~Cx1{)rA$UyB7xpuIs;v$ z8^u6l(ZO%$4u2iyqJ`%E4di1aeYkSJ6tcxBNYuisz zu9B@Qd02D!qa{X61#Wl)B)+ZE9L-E8A%h=v;6u90%TjY1`h}_0-$rQ=& zmnzTb7X24bFX>||I)EJ^!=lvt3w&G2I=RHg_A_7-=esOX0RdWOzyD5dMcmxIB1{oY z31iw52;;?xaY+j{r(Ai$mCUG~PD3Jy@m%Eu`I$h9?E)p)u>Q4cP=oxuG2+ALbfU&TJaXtLi7cY0-L`z z92Fnh$`lH&wlfA+QJBq5u!s;Iw4CCPx)AM+fsss`X&mCL3e*Y>TS*vVd#WTA-MqG; zc~}LKpPIE6Yr&BXT*eHg-p7WKv7(DYc+HNzy?;yQyF@y!V zjhDGjv_MNJg{duqQt{T_qvwvtvWSVqq@TI(pW*k@TU5hqhsWzA^xXx9P5n2~3O#^w zo3|;|gQ*Zy2lQV%2GP+US3br|p!iK{<~oGohj*}l=G8kh@eGJcI0KZ}wC}k+Lx-gVyFGs&oWzc^XBB?StNk5L2| z^9CN#{Dy9V}DjVvJK ziz7j?K!L*Bl>x6SXK0lJEK?e;$jiWLdNSXzMQIF37OZ`3M2cdpLwc&YxJKLIvPdn_6Q}l02g_mHLcz)RU-cS%RD5mTLSE#3-vvYpNDkEG_aw?x&kL*_c#F{ zW7ZET6WE|{9?G5FJx|v)Vn|%tGP{ubrhbUhpFFdxM6@VtfEB@K)etd}a<+U-P|V6Q zqlP`Wnd1DDYh1dXHxnM=q*s@P@=*UdKDzfjq??~SYTqs^zP89V_jkg`8W@-3bj-8H zqsw~Jg}=*+ms?AnnV+|MyfTy)zdJ>dboJFqjy+Z5EcmBi;Wx4Txcu;F8N1Js4=?7NZ!L26r#oY zV}!E;e7j_N&$7s}fq1o}xhiZugzkFlp&SE7joNqpSU@q4T zudj9+VUA#0Iq&*`46&++Bd74$FTZ@)&wfu9)Jp^L> z+2pHKeE<@V%wXRS_zpn7G(;G$R-u%m{^|04Q` z;{KfQNeOPSMwjnY%ADglf@+$4!=AZ~@FEqxG-@}?e?W3KzCWMw&WnW*ewhJyK6joy z@5xo<32o#_j|>4dz7>(L&$Kw^5uZI&l2Kdm>nWGYCeq97d>{xW-;sa*m@(+fr1Kl` zpdAfMP?7>h$b{nE_ogxydv(!9mu-xk%y6!%?zW8i7vnTf8=Wx(m}Y-wH!a<6%V(;I zvU{nJGDE{t^})DmDUI?7L(o)8X5Po<3AJpb#oj$5(-e+K=Am*-;t4Tk>8Ig`o*7o2 zDzJd8a8LUj7r_>_dCS$g^*7j(@lTK3lRhqm@h^t@Vnv#n9t-#_UXNGX<{iPA_dZh`MQbv{tcZm1)sF^AfpR2yN1{Q`3Ca&i|QnWz1xLHd2v z_~jXyW;c9_bC-Ynd<}122k_DA&({j#vu!OR{Sb`uJwtrY96JKvsqgJ}v0Z5Fa6BYt z8C-bRZVvN(>{2JeCP=U0f>T*Pj#Nk8|NQy0BEG2qxFKHsjMtgOAZv(GlfvGcW=N(7 zs9gB0@y{GVQI)?P_m!#A`^>i)NKFJ7^fG{WCg9#uyZ`-c8e!kBN`^l7Fd<3I-X6icV^HR z)h-X|wbjgYe@3giBn;{=2pY=3LZn^LP~qc%*=_C&D|g8b4<%9OA5(j-pW&PFJ@*-? zH?X&Feqn7`-T+}<^yh=CTm)^9{%wCggcDVjOE!0RBm{r6s?o)kld1nO1$2S$%8)7V zMMr5@>Rl$$)h+1|aR+uEe9!``wi>FVjJO=c(E@C3`;$Z`PgR@*jq;n~d=;mP+_C*j z+0gB@6I{+4AC7g^8FKAUSLgejqY@vMmCUxFx>bcs5-{?-A52GToba>c_3R)4O;QA< zizUZN>W@Gr7-pVBFpE>dmX7Ung6^Tgq%SORy*j|<$grOEDUlAYVQc#f(( z$ZL9LdHfJ%@R*b&(DdbT;tOJZDS3K0P5q5rt>?#4i zJO9$}JX>M=$I;sfjM#&*AqG=948j{-$pxv=5Gs`!KSQA~SxjUQmm;t>P_G#oGV0ZRX=HtkCEI;lS(xK86^> zAw%f?+XKX`e&A<#aJ2-yH#STbd{+k1|M=YOJz{dYM5{o#fW^QF$uKB-r?Z7T^(YkuE=5(Pky1I1Yw2sx7}j#8s-$;K~pRU+oE$Jb+x@ z?;FRS2PH1zF}x!c1253&Zy2h-t07QaG}ROftyDKX*}*%^f^8l&Byl{6JqnZv;&b0gLQ% zzoT}~7^I2W_Fa>=+TsHAo;k=r)BD*+0^EV#VEOq~LxjHNTH2l)yg~J^WmhT4>L;h6 z1lIv5X}h_`TIBVD9?2vII^$aRtA%h(&hFfyLJG?Cdbsak?gEdLqXE%_tAXOX_bPoi z2F!B6F7A)Nnxcreb7QL>0R{gppJ7H0#6yEG_~z?5Q$4(e?Ru(bsI~5r7%_oDz#V@BJSEg~nEqVNzkh3EcOE!-n zte!1&@9U;#EKfN8-oL*-$|g$7wjyQz6=VzfV0hfPP5kO{J`A61&&VO#66mwB@JH|m_?-xhdBrQ^=r zgUOH*x*fNRMK`a<@TMjY+1$mU=U(|5$%={zqgDsa-aNUFp8|qAXDlV?kv<<(5cdAD<=r3xGigGw)h4W9s0G6CPhBiZeAT+$a8AnnYrDz_L<*)y`glY9;)pD!aFO` zt3;Uipr=PhxX|;!O{Z%fw}n$;h0e&_dno0n$8F1sg3e!%x+6^BbvK%4=RNz+YQ&fk zY6=&9Bawpvy4x&i!L{XQ`>o#|XU#+51Dbc{8MmWA2!25ca3(rK9vJkU z8m{Pk_x@m({YB=EQ~&8JXq(B9qH zz2l66j_;&h(IC@t+tF5DhafeqM(w@B*gH`&7*E`r?>RLH0E9xN>5CfyeWR8?1?7;+ ze*5+t%1a*Tn{{t+$fJ8beV)Cbc|Z6TK(mm7o9hZK&4<3T?WKB!tco6#NxQ zh|_^B&Wn0;IV2bEAuwk2oyvAa6B9lf0{U6$-xyLK3>4~ap{*=0U(}1gT0}W_7y~|v zOxaMGCFuT~z#A=T*b4q&kGHv7+ zj_tSRvUU=0gwS0xBNc~z*K1p4WGV%bcpC<@}e!*QZG6h(A z@V|D*kE&Q~dJK7606ckrACRA9(>dKOtdU0(My9@9L~l(60mQEm+d19{DUq$3hGqVh8q#!b z8X*sT>F)&J?snqu@%6nz6{ikLpWYP~;Y{}mO^v{JVGTk?DXXMsVvj_(bSz`IEvUW%eb3YV zXzzbR=#i*VOv8v&uwRhC?2|5p_n{W``#y(j3wpwPyoF{hGUy7DT+s8jyq1$5Ig`JR ziaR}#oW}aKhTN*34cof~`c~oeeGrkr_^8lDzG-m7AbK>0{?5>RZAa?6fu5H0dt3EW z^pj^W3|ZZv35-GCzG8F`p11R06AxJ5Nr-*~>j(Rr-O``2@OaI;!{ujbWo_;@5T} zLh>sFLaGn(cpg0(2?h2tz57Q|(}T~^f8Tre&eI#+=;#i zR=<~keL5U#l<VzfkB@w$L{_H*K#HI(xr@>a=8A>O9r9u>SKha6^Oyw3J}Q z+rM2xPv{1m^!hG;YxhbE9&qYF2yx}+TOnp#*iBSJj?cGNl&%!BF!J-^CU!NC6gb+9 ze&0cqX#Ij7yMIhFI981&gMWpnvJQ=b^b~Ix@2HA=9#E=3ZDVmF=y@+{4?Y(U{3Jq0 zmUO`N9FC&$f593i5GQvxx}?<=aE(YhFwAl`dv2F%?61gW{Bk#vs0VmZ8<~oYmbwGY0y(J+gI84_bcy{NiwtDBgq;sT2XD{Nxh}S+Q*WJ|eHiXK!BjOxktH zz3GJ9Sp4AJ#|!!$!jV@8{MuIULz6;#KO>fa-SgiGMkX)*HMb7kJi{=;*_@!fwh4Y8 zTlx<|xW?$6E4{!lF$;aS<nD4zsI~dH4w?x);+yniXBK*)+tWnY-b)e|fiVRmNuKrr1mJG{ekOh4 z8|@=6RqS?~tQ)svF4bq3`P%zM!(s*RbacHToo)C+-L6g!3>?`v1gQF^k!qMXe{xhG zyf7E!{&cOI1-!|z%D(sUaf-%o94~5}Q6}n8^E16zp&B<-t@~dTq5$tX7aAkIoVO4| zhrl0Rn4~Ra40EkgXC79q=tcx)Vm{9Q?O8(O?R^j3u)K`XZBw+V1y^K#q7~XI!$kDl zn(Jw7S}M2jJA9jYgbj!wl*lU&cvqc?4f@2MpJGe4v4%wvl-ueAucP4CcKA`?F2DLg zn9_1J_4h)nTVtB~V|Zo0>k>>L(lDZ`ilU z9#Pj_j~;B2`7p_|M)2cA;c38U1>rexC$%oOLp#e_B!jPfM%Xmn$umWBKkU@f4Z*CG zZ2hiPTQ9vKNaTG85$vL8Bm$XF(>Yo+Zqf^KvYV;{0UgNWhHJkG8_!s|8XxMzV znx}ZK;*kXVXTrk;{lOPCbL$&b`77cs%0383`XT>-*>$ruWD$bjVp6qWi_A!UN~EW_ zC?6OeC&9R}u3F>7I^LR}DO)`y>y*{p$xU`iD9sVqHH=$XQvwlv_W&=Xf_lBXq4x;f zgBq&pamehEHPfjI9K)>%W?aEAg%=HQpX)B3wWbrZ1)YeduLooB(K3V5ONS#dqv54P z9bWVA!D&+TdstxZndAz;7;eeOD6!H+=h0`^BTQ4S;VQQ^@HOuSDyT~aH`Sr_`iprR zh&=sKGfHq)Ff7RaMK12%`8IZiXM+vGb9BY<3%ak;S(&1>n|pqTxvGkZ5Y{R)nw> zdIfjtQ3XfQeam;ahv6=jo_OKsYMUhCuFC%wsZ@!+PfhjYyzfyp4#Erbdh>jiiw!;$ z2b_LMiq?^nhjCC(mZRSC^2G3#sDOC#z4RRcH@Rs-g;t3kHKHG?C5bn1G<$>FT%H>c zsh*P)HAU+JbG;n3mB`Er2|Um{x>wEHFIRLC0n#W~4H&1}5IoxVFa_%5DOfdRYV5RE za@+RS?$mKqY8UU6GAmvJTy5%7#yfZ4e+{pPQ*nF!UN7JHaBL0zR`1+{jUX<a&2ZE8tT!vQ(F>>H{Q`HFzTy=m2z2=mSPA6;l z;V1kO{z)nAQ>m zLe!?(TBAlm7>qm36LN==o`|Qb(hIoTi%N{V&EbBZ4J>Pm#^TTmxR>kognu?yAGFF{ zub1*1FYJSKl=~oQBUetdt^43Az$#CB_RF+j}Zm_p2K%$|7WggWc6Hk?a(2a3nW*mqdDbxs$lC3T@~t8+})> z%=k|7uAZH#0gA3M8xSY=pp}60#Yx^t05LwE}SKh{FiS%~-=ohobeZTvm z@|2j?Q9Mr*GREauE%t`ccq@mL)QxwB<*?gO0Ya!jjqEwJCWRhx%^$bH~0n;trgTc!O~x;99F)Hanp z2V9*<1bkOZ_^r=asldyx0EM@!O!}||x;OEP9p^sYO-7$+B!86ZUxaY(JJz;bCnE|Z z?}y5p4K>W_c|L@Cin@+c509fAsm})tyRhKkG1c%|BqAj|#G*6e{_3uYii8(!kaV|m z)a0HvHSSR^mB0ArQmv^}JNf8v+E>BLcikCjpq>zXLwRyjLf$lL*w5y_=sS~lp2SCy z^bt<)>Gwh+P+JKrVI#KRCFz6_EKFnlxeH-NHD`^+K@y^sI}Grt1l|qli&&6Gumi|$ z+@UyDITken(5kx#!lgR>@HXZ4a?6X<>y?&HR1=W;?1dUzNlo>x7~d)SgM_wAh3 zZ(x&znys7VX+~sn3{S|J*0KRU%A|;KOpgP4{gO}k4jFG{ore1Ohu9*%vqI5{#=!2W3Ah61Zf_=b)!p4B_dqkPQ2OqPN_8&~~gMX6kuDUgW z>+FOi5VwA}r|s4amK!}z5cqo}4f0;Meuj?>)e~EeUnFE3vUU$2kdiwn!h7q_KZ!vf zFDEwd>Y0LpBECoJ{r1d0pxlTR4_s$X;6y^ueGv3_*E1yK1cz2f!b?fZ902cF^{}Zo zp6Y~juH#PDJ3qsTgBs@<`qqQZpm~6iTI4BNN2(Jvu3ewUA;2yh9re$;{DU8}X6(B+ zM@??l7K{hE`x$pul!x5u$Wd=x1Vb>?2mVC{8hZe(hi@|n2fP+ZbmDF9g!r}}<~82M zKl$uJ<(Q%v(d)>c+~fFZ8lDUHy~%qsY>APWk!A4}&Z5?{?`QldxtEixtX%USujq_? z!IQ6SngM%a$h#baH)#=wcVA?gC!92-GXm;+=W>1Kv3_!JJMxlx7sjq(kGH!OH-0T< zGg@4daR|1^4@MWO=4?-^4hFnu&Is$N4R_M)PiG)*?{ zQ`rn8idH4V0zbpG=n*G`wAYAuZEIanG6Uzn$IT$NE|>#po{WJ z!DQQbfE?^SThHD6lM~(0Y1p$0*NuZB3XTo0{vrg_He?cwqcW^7xgk!UO5_V4uE4CKg~1AazP&1bC29SPV+0wz+| z(bR%bsaB1Ig`tuL0??!T{o)^OM#+0o9~{2bT|fIrsg}S+c?3-rW1ehmvXQ@-Ns+*N zW#1@!*5yu?uCXnOQ{`2P+HeJ|S_%2r>ydO`j^XQ6b@XgT&}jUE3Y|nv4-o&-6ikw~ zx+bYe)fiEjp**)4H}&`+VbMS4o+B|7<3up5dfrGlMOA!Jxt8UUhaYXb?+|Nu-$haE zkP~oX9K)+&8G$}S#!F{~IHX~Co{zhj^3ylPb>`ns9-ltp{F4j6JrZTZ^{S4yT&MszlGGU+^g96 z@8CItpAE8nVo~LzFOs`rQ5g*>>PL5v#${|t3;@Q~we%tI8Mfi&_l)jfCzh3s1T@|8dzjebfth%9 z3^nFT7%poK8irA=KR8XUXk!*d$9s6tZ(ooK>WUf+)k4AEQsm+W4pL3f?mTyVJ54S_ zwD9hhZy(AIil7C*b53#}Kp-;4H~z7s&n)96=LV&;PR#IE7s3KV=xH#(^VYKa!Tt}D$* zcYSyE{4N~T>*Jlh!Ne8tl!+1!To=P3VBi`eJhdV}3wY|B4({i0@*o?UcjpjyQ$cT! za_8f@Bdst@r7p5DuMZdrV{|YIdKGU)PPT2uTUVsL#}?cpr$PS6 zg)=OUB!q6S-EZjlt&nyCeplz=mq;*dyY<0I#v9*phAjW$TT4CsY#Yi&T|9t~?(p!d zqhf6In(qacqOKgJ9^95_!o%=XP zR*r=2=hd(wrin05NYGDN$WV#hJq*9iQI$i|?Tn2G4f&?r-i^7h(=qhsExfv!99P4I z6HF;JJH*^I5FA^x`n5kxPseu;E*Pmjhp4E0qkRPBR?|;Td%i&NRJo6f%CO*-974E= zmg_e0lN_a{?cm`q9yaovTPy9o^PmU`cz>%EV!iFB+0z-R?Jb`d`=Co3=sb4%z z`7ofzs@72CO=Xbu2zIt@_+4JE`*?F%%5m%U&Fb>KBO1r#;Xp8#BR|)b?B2Q3J}YCp z2T}nH&w2bkQiRg8^?{CA@KttD=Z?CRV2B?LPEx}wcMF6Wm()8g{EVxLsTYqF0rBkG zjAh|^Qu0@i8->(zsNkq0$46P$S#G@*yzCf&(0mxK@?HRU6D^=7ynGO17nbH{kAgct z4HwWl497{@qtvX%we9elJ!vlo_>^4p`JqqXd#IzI@<&U0`Lz@os|2 z1o4LRtWRYPUqV4Q;R^3`511>0Y=9BVrKxpjZW>0AFHU<3E>0gll{R(gQ!q7pJ_zyK z#B~A1Acz=rfIovF2iS)4rF+~G<6uKah)9(UhWGB`t<&@JRuq}V@?TO8f=Z5!qVT8) zE+X&`3yL>ZJtNP^O5^Ol+vqkd*5QDuNOSA!L;zr_Dy#dRCr!}F;he1{u@GkB+f4lq z-koiXG#>ZPUtH6lDbzszns|}hD@qDP*}4zq{9*JSdlM)y zF_LyYKD@0rpGG1QSlRcj#x?ykRh$jLnQ{_BU?WFT=+TRWPb;5tTm>e0mAj>RJ1O++ ze(hp+4ETMi#V}q~qi?rqdhcYmcK1PQ$#U0AT=I;MjL2?yyC4U6+~TL{F(-!GgZ1p4 z!lWj6A4@FVIMSwXDJy6y{F5gyTodAJkD4N+ywVJlB`}bC@&a_(gWNUu)qKInJfS!8 zR<@^gaY@qRnM*u%0dI?A-JqVVc?Wu%Yfx)T{LElT%An{&*sa-+pC1%IN~ zH;P!|B}~Wz+t37ZJJGttQ$L%B{q8Tme-G|!+sk1i&bbAX)HB@)qCx45*;RVJ^zFi= zfKelMCsmGhd^BWN=phe0H`A?yKud6I+MY8pH zBz^z2YtF)}H}VwIM+o7cA3bs%(%ZJ2>VAV~sJZolbxnO=GOg_+M1(9mS>3J*GB@Y& zDu#NbdfcD-@Qs?gdlYA&4!AO*z+=n3J2Sgcg5y6roOKUdqGQLl7Dmt}lDwI(KsfDyG4jM&Z= zOrCQjfdRv4tzUe$2kt_emuaF3`s}>z?>ZL`;?bYij7X8`e@ySR=^4~gRXkhKgHADYgp+C zY?e)A!zWaa6v6(@dlN9CK7#pDw!21X%U%hxb#F5a&w}7?lExEE_A6a1mjrBe@~j$V zPlqM2!U#H?+$T})RCO42X*uJgh}@0W$#V>v*P{7&k9yOX;FjL5;nQmVAYo5E;~-(n zW=&i2vBWPfoqBk6plsK}JX2e4*G>UWSzgyjf-k#Gi0oC5kIS)JU&jwmoW#4@<3Vkw ze-a&qYyU`Xk{k=T>NM=3C%(SNc@~zPEMtX9{5RTWq_v*lqFzQh#yr<#>y32CY$XMr zU`JlvmSrSwe6T5yMiBM?1D*rX|6g##R;xeW-{E)V+}Zj~*|ud45pgkmXUhvVzwfymKokE&OIKpXLXnr2gQb$|%j3sW>aUTaTO9 zw>J&lp9hK+c@aXh=%|nGJRQ&-zU339duT8I>UjH*Lo&R)RB4x^L^MBmNyq#U;e0DC)Z>RT^!kyLy&#|_@QL=I5gF8{{=x>zl#O!%f z1)-%t=tH+fB5^8jTK`#QSjYo!lgtN?FlLq<%j`~8o8h+_*7<2AOhdL z8ou&5j}|$nTQkK?C(IUL@vMMu#|S~G+|-Of7#-W^h^o8rew`>RjU8uw0K0o0%J27=ydbd*aM^xxV zkqPiF+7*CFSsH?Q+I*G}a|*bk^x1MCrTG_;Ac`$`M44Z3Tb>Ytlhr)9(Da~o0A6=( zw+peaK;xP`&r)u{&-oC4{M_^=WYQXQj>2bFh_{m;l_kokdXxwv! zZpYy1!v#Gj3hH$c33vqgW{l&C2ocy3PXlg@3`K1jUj2~)M$4L7en zGAL|!N7bzgU`BYeBT^Q9!{;IR4i)+W-zrYHL2f|}WuX(rxJn!VZZnu=fv1G61D;*h zG4PP}K2}r<9Q`DG{l~2bwI$6z>6#nhi2*NoOWFw-lBcUTMw~daHZ|v>0&8O9~IaJLwc6@qkdYkJC zDgwU?t=DCF_R(Y;VZ$^6WLV?j6WD+$mZ6leYtP4DvhGL zbA`@#g7(~4SB`ovIS6A?_bC3s>4ewVoQtCTBSfV_p&}k;FYR1ABuQ<=UW}ic!#kmd z4vZvUH#}yfe#iU~fH!=U{}N|PS0WQX`Hqz8PTr&yPtDh+yb)Dtbs?#5rFiXoHBw3~l#;IzH=3Uxk4$cr9(%$vk zVwmF6DYx+}Ho_|NHO%`+slQk_3D* za@Tfj+yOV$k4C&PL}mfY&F~NwLufe$+~r^;jUMT3!4suK_fcA;%mrNQab)+32o&^n zwjH6zj0y2b;3Tg)oQom528;za_8-Ah;IbrTKx}e^f3PlPxGV<+ad;2I+w2<$FX@ne zIwJ5bW2cUWg2ILBP#o-3-7s044#mZ(-3@m$m_y80q8=IeovmVRKCwl052R2A+_QBM z3B093#+O{;#CGEn5RH>tF}&a>9|pQGhvHCkoc=`^`?jN}FpIi%y{=Nk6?en7*F%o$ zNHF^5*H1(4saHsQ_pcBfUEG|_M{*)>EEI!*3A-lTr2f9xjB3q*?UY#_?>92=9LK$J zp9=s*K)S#9uJCq7Co2-xW9e+Alb!JR)m*A?olQ?kFTn!zKNof^`7j-*6@C9@1*?@3 zWW%DE!LPhRxd;IYf}dR7hNI)u0{J)NFXg%=E5Okz6tdmFBABEPbE8Ps-RyX z;Hr9J;HBX43K1v8lmiygB=Gy@vg@PZadiEx-|XY>ht%WG2wX*;4L(T7euEYEhP1f- zn{Y>n@itnA7EpL!%_IL{*ixpwulQ}<`Yq~fZyp8wHCwOMKgX`ZPY)fWc({+ZW@2{) z9y=Ya1Q2S%s<;aev)QCUiP6Xh0pFFM1@;R&lHT_z`{==kl5vltn#OqI*?n8OVXPky z?@dj&>#txyW$RAB@IQa}=O-TKJ9m2X`^}$(wA6jS?>y(@t%Z_(V2yg%hmS$g8cML2 zyGEsQ7=EufCj_BM$E2XIoPYJbW2iHq1|~E|ZJ}*$*}BN-5q)c$0Va0nVDp6td1mXD zG2V+(Nk04gMsG%7$jdTZ&v5Jnl?KnqB92!R4#&w1RoyS-bBj0?=^~XF@S${Zp#W!@ zJAFv)CuSs*5C8ndw}LZ<^S+u0;m_z#h0K3;4Lx}d1P-`-HGEq4&q&o@t?_|pYqE?S z*XpC^x3sf@-t37zpWT$MHxg#@9iSaM{)*kji}X=M2m}d3|72A*`=5=^?A@>T3)00z zSzRdBtsER$!^K$*=!lH$1a@FYA}J>h0%kH%d(8l<$=6nBYR)fyx^=r=F5S z!t}zW;!)Qk8gX2EqW`?Xc^8RPpj2qgdBF<;n^wns;PqocUw&c`ZS!7o=GC54a1qifti926v0n0>tO zCqtI+XdnJX7-q9IY?bbMLHO+5EM!UCdRzzBNr7`6)cVXiSy zGR0bMwz`P}yQ(XKlT1?%Pi17W>kn~_#PCX}#6`HVhdjJT-5j#`j<6LJkJDc5cg@h2 z15A|10lhAvtANF!1q$_$2QsXb2R!XuXDLL+pkAT)=2`8W!7*yW*BL;3mXqA# zYlwB^8eX*+ri{=X!y+EsGlN&j4t?+pLGnIZ!^s2Ir0~$elJ8qchUTlU9^n0 z6S?!Cj?{wI=2eQa`EXm(uN~2jf`;}_V`xoxj^VvETSMrlxo6Z79Jwa#FK(yN$J?cB z-&}`Nfv3o*WINUBz7fz_8H=txTldgVFnpC@xF{e%B=Mh-Yzvx4fSDw7!zlP^B%L}* z4-l>G>zRh5%Fn(n@*b1Am6IENtClU6$20QtC#|*~uggT~z@=OV^9D|so^!JA%?K_j zIC|$Bb&ibS9@Pl08J~%N@{63l<%Ht%b&&KZWoto~@D4lmfs}#NC?egjs*AVMhR)sUw)T#nLOqP5PLE^$N; z@7?b8HA4Ngnzx}9^(%%6So#O|P_@H?j_d@bbi4x7egdl`JErf-lvd-+X@S4%YkayF zJUK(z@%)k=pp3X~`%b{&!vt6EcF)vwpNu4*<#VwjMCn*#H-%>0nsUQ`)~oWbRtf%= z3@_KEk|xgntFpWZXcr}!h2?ZhK1wd9FxHgY1x$(aXMW9@k$+gH(yBcYjn@KEJOG%~ zf4`Wq#&;{=rk&CJx30fCM9=+VeK)OOn%UWfw6(&ryWXE>@R_CI>CiW1O*hRtij&>; z*&o~RTgTI%^SgJnG`Uxk?7#`BY~|c>r9y?ya3s(gX8g{)$UF_;(x!Gj*$;j&&^rQOH#n&Gx9gOG~TW$VYjhQ_UyqdT4*IQ2u44s0! z>Whc#1i`yl)9AXYdg=V6aK&Qi)8`sa{SPjsW*>Ebw_3>gY=|_7M%^0Px0~*hdh$Bi zBmdd0r!uO-eNtAMd`?IEUoIFqXToE5hx4}IhbShUIFZZptqLii*m`GnV!Qi zZmRB-+~s4Ftd^;AyBqQAHd&<`DkaaFQR7SG(an$CmnOm!D{T7umj6%Y1N~DoI+T9Kz}8 z*1Bd=7o@zl_`#|4Q{YiVwG>64szd?qnfVR>&d%Rk*7#=4bvf-B9n9MLy+y6MTX$*) zcjo#^|AI+HE8Qu;WTn~;JG*|@aZ4V6)_U@SeO2iRI##CLwyHe<*Ec@M^QYTl1=Uh@ z%JG2`a%OAkxBPa?WO?*b(u+eDXWEGHcf0XbAy9aQ6}%2t5H~Erp)`NepVYRk)%T7? zhQ_6I$y!*U-ocSTu$fBu2uOCi~wGC9f=2mLx$Awotbr4cyoRl#ALh= zmxD^HZP?akUSSWFdA4ESK5UZ+a?qXdGwjpPbXB*pp!KNfV56q838j?T)AYVRU8F_o zF~^^dG#X#a1mLO~igHEknXO@iw}DOMzh{;-QZ#~zaoIftHPsXf%bL@k(dN$4y`x?- zB9ZcazDG&M1gs-RWPyj$jl&;uL@K@_xIW#hHe6fquH1Gwa0{c_Lom`ChM!T|J*k}7c_&>d z8gqlBVgGga33t*F;Z8)09Jc!1%fx+f+5NY;2Kg6Dst93wO%ayzYHrQqmW51!XZ7}N zr{D_qGQY6;zw_f#cO;wbI|vE{t-{(bcLP&(*=FV6`i z+q$>}KUDSU0~1(DIHd`Q5_A=M0+Tx43~yyV()Y@Ot{*h2JFC5S=rQFUe8|9ZK@FN| zZv7V8$r7GZzoY8G`HPK&IKvQTU5}6SNyE=%?Vj)+Vn9Ccu$){YQ?`nMz7w|IBFU#P&8ZLNzyS8Leca&?-|m4t zOP}b29ovT^xwD>XWNJMMWQ<%;0tL`^<4*33e-F)t?E0rx1(u#%Asy+ZoV|BB%ts-Y zd3mmhB0?ZDQF+;j)ENTBX3Vs*6rGnwB+JBjJ@S)D##eQnvj&= zJbBmWvnAick6y;fm4dKUwDR-5^orZ(R~s?p2%inOaT>3}29{a@9E!XoM7$k#SY zhxx$NGw$q><;TzTzsK;XUsW=vl*V1*jsB{VzXc4*Miwi-t^6*%gLgEHETE;3*X4m% zYqGOt>y8rh*DbCK&r4Of__yj$4vCw=Dt4z#CZ}@KA525h(P`~(VHF>FnR`a&`CBVl zoJtW%=9rTztQSVbLT0azFU|x3#BAB~vSkbvNHO}RuGqMMntYy|jauthNT_5|DhuBF z^%K6Gcx_kOK8vF}*a8LmF-gn8N@%p*sK>P334OPT!Z5}Spr_s|%xscpdC-|%L0tNp_ zS0=ulZ7MQ zW{CyiM5Rye3(q2NPNo>G*nB6uWo1SSe1F@UKAPNFiavdBxse5=o>z08?~0@4Dskog zy$HHjZ0X4bK*H=68p>Hl-&d*k5*9_~2<-t)vf*nIcPas#xw|4#mdPdP^Te2UiMm+R zAh4Jv^@#^>H7EE$%pgt85|SnE1ZK?cPTsqnS5Pc^T=WTAS@+k%jWFjZ!)>KvcGk7ng`wGRw^qL>d%4;*63bIKVA6$q3wrLEj(MWd6#>8&u1G`W^Y=JMdD&wrNo*H zzppKwQh5IE{&Nf7ku2$SHfTz-af!S+!S6=7zSfFNvAd%S{GE5m9SWZ3bGT%9FyJyq zM)v+bc%A-5@yKmST*k7QXyK}aKyOqFs0@K2PHnk~7ONl{mlX~0t?j*}{HVwL_$d+Zw_nCg()7x8~EnYkrP zhE?}937vh(1aFNOg)pcGsl(Aaq!5&i8|5llqr9pzi)W8j;z(O9Rx_MI&~;Axb97z2 z8tx*~-g+1@-|ux@OM#=dCEtJ}6&(vSm=Jkg)CG8S$WvvA7XFI(#S!YGS&|zB>4s-5 z8P})^X3wDV?-@g4@}}SlZ@wcvOFU+vYh;q#e3s4d58^Pl_iYk6J%)GhS&zF)qNI%2 z;ZLe_PZ$H#t#O9;gwH-1DYpAPL>MyRZ=n%W1;1Uh_ysJ21~=i}?bq8-vj21v%<2)R zY|0M@9%Rf3MjtC51_>nxD!VDZW)RvqjzZqvt~pOtg=UoDp?s|Owf0&W>)c{#Vd=e* z+P}ybJ^jJFH@CAOm!iag$>H9^tNP&3=z=4kRx^V7ocbm|+{x}G*!e~TM@F=xvtxVV`!$Tlb|%VJ$<+ZPmg?;V!OCn6Wwarv>6-*)Dj%N9DKCplA=Qka0L;kCcGE@@c+BMIt254FUuqoj!6PeaAp z$%09=J#FW~@8YK^qh{m_=C0}@!*`XLzOldi<|zrI?QVEZg#&o@vSxDpyc1@-H1Zug zwdcKhDzk=aLgbKqCD{s-fl}3KxL--8L=og^_Nu*qie)5byAQXnNzxZZkV>5bey=ni z@_mup7mfG5)vJa8fNd-Jc_cb0bX;zC8Q}#Xi-T6iqfKCW+O=niS;uXO2yZn;nm}`E&Uv!-V zp6Fb~yJs!J+eYW{2mFrcYugQm)$3Bq9XdFIYu2qwM8Fr+!#`b!fM}kX@ItQJMRh$T zzhFu+>G}u`m}Ote+W}|pM}2-3E3mp|eIyQrv|A6N7lPmCREzxqNd5V7cBGLAeqD5z zsP|EcI|Z%g?O;_#*zR)oCxtgWPqi8=F9 zXXx^|cfY%)ti2HRZJpxFm_N-y_>zEAIzUBKH^t-A|W}~prt`Hahx|rLa z2S?US!vPnxc`SRCt~@Mq>U8;3nP< zwjI=Hzn@$uH>t*vBp3;)n>(G$OJ`&sPt%$n7zT1AZ!MZO6he(0ApE<-o9ml~=6S{c z*4)X0@7geYBi==C9XWw-Lx5v}?GjKo8e+g=nu?XHgOUE^ zD+nKGQX;k! zl6Z#Jd1jhJxxegV`NxkW4^s>0{j!1;yhqoXC%?h(%&sY%!WUtI!cMN*Fr1<>sKM2n zQYdfQ#D)o71hE^zGtP(qSdXt|>y?p6C?}o`mJ%+(tR=W9G}D66UYbTnGtQ8}3oA94O*_>pxPHo&6gKsW+MrSRdQY)+C_{p4YsT zN?Nu?GzB~N~(8;|f$>&LB;hADoSJ8H^F?{{;&R_7s$ zRRci^E3VrusKAPKh0iYH%K#2>5ih5fDnYmrEc$w_3lX2Gs9*XDgutLZmL)Zn6G#Vrixu%yn|+2XR?s5X=x)0)Ke_<>w|(k%4-C} zhm!NLEYlJqqOIjD)zt2T?$R&d9&NTG3V3q*sb5sn_af%>5_{iS^OJBj&5i7=Pswy3 zz`7Ei9}M}t`#z{rXzs=$0ApCkF4_btB92e%bW8tH_jYrKOcQqC{42(w&Uk$G=;+c6ROg?~+Owxm(q`z@ElmfD=EB-^Dv~RWb;EQvs0r zkgC{L;E)JU;X$GvIA!=lLR#QO?>KOX)T{d$O0ELO187y=65)l!Q^T(Zomi@>A;^c1)B>-hh|QcHb}r#;OOk*u zs5Uqmst38blSq_3{=Dqd=E>U>ip{aseGd-4glM>D3}x`D&`psk{Ex!7O#dwFwz zmZN-%|MTtY#fMtv`zTk;KT*lJUxh~HiagtZmD?8TgFcm7q$b8n4u!z3@HRZWPQ44Q zy)C;9*y$}2tqW?v=(@_R1fKH818-Zsq4U-xdQIyqamEnfa!8KWN69cDd-dLY6MVa_ zg}`s9r5j#K^OP=^{9lc_cQMmRv2V_nOTK5{Zx>s+@?ev8YZU3c<9-VjSxjiKbwa+` zIoCf~uGsp3r-a-?d9kHddKo%<`N2r@aocCi<~UZ7*9q@x*Y*{9j4SFZcDN%Yk`Q8h zLs|{22s7-2niwy{eVZpPguu@B$yCOc@>!^IA^+l!Xo#5-c#jk>htghsqmpIm2^MG5 z`2pOV6M|#(y|irozJi)7AN^YQO*xQ1tYuQ97)ddRbH_9C&hlzwsk3hHU+WLQowCdDQC{z%KMlT7ssSpQ8 zOq8u@aHq&+EE9U$?0D~4`N6S?L(u6*>AJ1QmhXys+_N=^YIK}bIX63&y6n$0r9OopT8VUw=ov zSfC3D;?!Q~)ZNaXXHlUdFcHf9!BVX7-bjzVo{!%4w@WwGe#eV>OToM1QfXPd80!_W z9-H|3<8CucF4L-n%XnR?*Nd;K&DZ&|$dojVjFb0e3|9p2>%E6Qu+lUC*^E!q=r$h!`|8QgL$;Wm_i+x{<qrX$k_jeNdOJFaJ=?3m;qr4V7w&5F_wsgM8<+`mPIKV;GCYTfwKhBv^;T(;pHu;#6k#Av9qU(o*DDvc< zu~l%xyq4QN5Ex2|yB?Xo&3-gh_xHbEj$d08aW(&!PRXZ7J}L2-hMTfT?hLIajfHI` zoMM;4ogzO{3-6b~u4^Z0SxaXY=<3o$qu(RX=|yAfGg(m->waZdYVi=SUR_#lm}lNY z-zTf2p^I|V+p7&j2-XA-a@-6b0`6`N#l-UOy$|acCjGFw@2O&&8~U!@8*zg82B|1ZoYDWxhf*K%4q5e0pxpLE@W7NYwd#U4#q#lQLdz=z^)(mWSyw zt!@+)$?S;gP0vI!n?Y6z)aaiuS(+vyRcx$OZ<#A zb2sq?y(jlCR&=*KK2)5tbyfp4@e@zO)eb5cHK(e}ZYcRG{uLLTagp*Bg2EA{QaTV&JO3nTKgCsY1r1ghHagKT@aWK9EM=T#o zsp~a7T>%Tc_VOAbX>lfej!o8ziQa`WWZTqUs3>+iQ$9$8MYPBuM$J(aDqcMqqqgs{ zk=64D_P*?%pZ~Y6Ni!Z&x`N2|-u%h;Z7jbQ7~+?w1EQAdwTJapb2@w>flYWz?Hl;L zy6x8Gwj9aw?Y4%vNDg~Pwxi)LYN$(SzXxLp@Y~+=1sriq#y3z_&d6y;Ss69zm21sD zif961!CyX4sNS5a@8=nvObGmL72b(-htAeL50uEH?tlFxi>$8iY3^N#j+u>#kG0&H z>&$_?!!<%z+Q-GS2)sr*mhdW`nZFp!!=S5*=<}g>w&pVl4@t=xS=Z)ZMFlL;*-oxV zcp5wo%1?Z8E4X9>j#LLZQGVZ5NndC^9|oR=V|Xd3`1_eeYKpU#S`_f=t0OUT&ywfe zv^{;^1zlW20WVvF$DuSo%{%*=J2^RM49a29dQtIlIPVph$f{xJ7~Jza9!kD1!t@DW z-kv{>(Q`s-Rv-Mno=6~(J;|D!ivKXFgfp~@BPb$c0eaaT{2Wm>qonIgYK2wAsohy( zy}l>1jjmzpw>^7D6@q|M35qw8!a~~v_?>UlT?9*YZuq`{-eB=}AIREj%r}JBmiPNz z#VLA;$FGye!1v{nYZpW)@!U)4N;iZNgIgzdaHVP7NJQwvUnuq0o{e|><=NWgBmx}A zmS{M7+;nwor?bG0(kp<^R5>@>>F&9bHncD6uU$5jSkmN1WK1v_4ked=ZnMZlLi+I6 zM@uQ`thp85E!XTNyV6%d)<&1kATXDHucYpz;~Oj_rSF8LO$B@{-3xr=fW8FS>&SJ- zbxBud-hpIwRRA6VZ1CMEk9KD=wpFfdyORZuJZPCI6 zju*-^3n$mi?q?Gp%bzdeVz=fI(N@0si)ri6ktp5$25I8iFrRh~=1qlk(QD9~lwrJe zmji*%eG@0=Z`%0T&ie;v(R#+HY1PfAO)o@x6@n5eO{?&~) z<3q)FQbhJ{Wr%Jbcsvc zQW0sq6Rzw3@g-A?39+8`JE}AXjXaX}tus<8jjwO{y=|c9C5Nptf3*&?(MG+|_4j@e z&GGHJNo_PfGZV4@e!GSpWGn}0`tHprbZFj=I@Ch$xgIA3wFv7Lf2t_X`MettF1NpS zsRwiK_V@nGtKvD~b07YK-=dzr1`oDe@6VTuh`lg}{_+f)Ct((mcYcK2eTQY^tht>x zagc_C0&;4@+jYsfGpdv%>15wL6X5clhTnOWOJ%~*SJQ6BD=m2Ln)d(vyw;OEf`k!s z$??5+XN$K*9;e~kf36m9UvTTO(xgX4WaK!i>TS9D^yQ-ovaX%iB_Ke{4Sx-tK(kFrp^5=g#yC;mEjwkzl#>4P+d>AiavCo>HtkI8|tkqXoV4>TnV`{W=Ea!H3M`jGFN{ITmobyBh3h3N$RZb;gX7{=Sa ztKnypZx5PG=(qs|gQ~LhBE_Z3VM10@7sVEEQl*#pR5O%RllPruC#U~JLd>b2r+NLI zMc+kNG!oog5gnZ@)qjxJbWg^`kXFgoBa7GxYB_Eagr;JkCVGX4VDm_DE*rk~L`Tw^ zi{>NyrT8KDx*3AR8QTq$L9(;41FE5;FuySCRWU}e$M%dslKwLF===Rh{@_F)(C{@Y zQbZ<~B9kTPDVnGC84R<#H8jnhzk@Hs@12>03;kkBQv1jo~LO2C_H@dZH%+f?%;xL42Ac6w{TxB4X@%wCN~aj_oq znPtZTaKzx&@Vw5M`3*H{7W~;j=PP*OI@Xj>L8!PaLH;Y7mZHinFZq^7@v0N-`Xv;X z)z;Fv=68DN94g-`abRYI|9ui=xGm&cExVZ2E|d3SRI><-jFJpLh!|J?U~$1t<#iKbRm7i+h1R|B2O>tn??Z-nt$wzd3`Y3TWW<#)w4`7fR*F|F zG?cOTgygS8bD{ux4fpW(>+u1_`PapL$)%>B{H7`vi5?pXlFSq#cW`Q!D1 z&D4q)8F5O1$g!Y3dcB|g_Nw3JE@1-psy9msH;H9{mU{iR>su8ow?W>D8W+6axebPV zt6*HTdECA?zYM=!>*nr=Q`qoWc`mFWc9f7o7h`##jxAClGgTBGa0>~SAQ!1OA92B^ zZ}<$6#>enf=N<5rj7g-ujHreJ#toYJ97Q({;MH?mMZ;}J zB0BK93uHpaTP2%_4KPx=2`g6~a*->;m_b92Hia(N;Q+JJ+&C=7e7QS(nZaAqRe~V+ z`pGx6eYq5lDoTTHWqy+l2glUIkXtjnDEZvmbSIV$jg+t*UWy<;apfLc*ilCO3SLsv z?U39jilu0MzoVrg;gRFU{x^(1z%Vt?l7vIRCH#fJqpnPFdzN(65XMvuxus)|UBQ+W z^ZHKSOin`|#;=BmyHVuSy>#9Z$)}+T(!)j-VEGqMm*#P-)}?D7op8B0{toWWoH~+8 zY{9*4w_#I1n!+*ln&aCJJK0LvsRry&W4dD7G zi`0xF2&7WKCDQciPTqzU^cMji<(7nRQKv-oT_u^J_{;PMwc%8B>q5?nKI~`l9etGH z5RL5mKj6^Ei@cC{9MzBqdZt$oypl_!?*MnG zmwZ&~ogu#Ksk5$jb5n zCQfinQ&bev;D+^n&;yy&j(Rarcr~jjhGx%Ku*599q6F(Kk9t#N)D3q9y?2-Z(<^5X zW$_!J;-XJITz;qRd~S;0{2?%md;b{-slPd=u*4tl@Kh2f+}XBsBPsdlmBi(m zn_~9t3r=i_r_X%GcJf=oCMYcz!W{k}NfOUzEac&OmvcNfmRJupsAzmn>J}lJm#0L% zDamnH3Ci(5#sR#Vr-{&!*YrEJns>9cA#^ib&&geXDJ&04$(47+?(4~to^DPlqJ#Ny zk?re^lES!a_^56nIjAXXOgU8hAbBI3-!)x`C>3w(K zL}9rLbP`R=u7~6!_ivelJ0c1@otlVvxN9n!YWh(T+b}%(=K>`g%s;s)`S(w;`O*vw9*FyilWYgE7O^k472CtGEE z&rmZfk!=0{+MN76w@lT5;^KZG7?3&Ly$ZY6Ll8$ZqOSC4P+>N2+Z|M`BH5oY@ zECuQOb!KSn)6aHsW+>JC9>=?W&Xa+SYUwvlfSuX02ym@`P^f6Cf3bE7@&EHjC}j~G zesgK~Z63uO#c%cX4C%aiFD5^IE4bQC{pyf6{;JXc%93Jjnr#xp;7${rSZLGWP;}tG-`f1opjcf@LEpzfbAncgJuR*N}H#( z$9_kj@ncGPx;P^Ks>CdHy#+?S&c0w+m2yU|^=(-Nu*Ia2g zv+&SM$zQzvI3|LAYwjUX*V~Kv4l`e8LhyS!`tfYK`qTAUcJ;se@wZQQoTY|)N>==) zIsg-4&ld(CxI88Yp4t5H@HrdCKbc?eJGJbPeTz@0bZiXojCIH%V{fsGjNw2X6*@^{ z54(l^%^P`%4?bZi{vNl8oxucJC79aBw=-;ICxt+u1hE2M!@e6%!JVCuexOd)Or-;! zvX(DGmYN19+<^{|^*eKKCf=5znJIdkKT+6VJ*l5~1i_%&bBFrqaf$Z12q`GQUGYF{ zu-(*@c=k}W_jVE%O1RHuuN4MIz8ZMTnp(r#<6{PbJUiRpicFeg=vlmOsBIsg9il99 z{J#_)rNz-gjW}Fw>&`Sd>PQDGhI*POz4_@F<^S$}*dHds?yo zZnh>i%JBBQJqI{R*+-e7p4k>_=|YtF~n)N`tnGIalp@8QQI@(y5MW!|?HMWfMmbtQDj z(Wisr9aG}5Q()$L_TJsZo=b&s>|3BdX!sZFy9TGTg-_SlkeZiLGItf||Fh>|dbVvv zd$(>^F*SvJw!frj3AUD<;E=OB=`ImF15=T-4cCvnzhL6J^&UNkSKcP?0LD8;Z|Vh5 zOfb?_wUlNV;~qPGQhli+K`#1hml?IV?d#-rM-!l<8#_m`wjG^Rs^rIeuQEIW?klf| zIBo6ccx$q!L;<=l*?PKaN-ucXL0c#t%a>3j4j#9lVkcz?W7pXHpbX;@VHi2wD|nGj z`aOIN-wNDiTPc3d5x$x{ykAv%?R~jm7v4N6d+~sWz z#|6;@!Ov((>4GYW;kdconj#ALhVM#Po@u1SPZT`FrO-(WTqv6RMWC~BSSg}@vAJ-@aq#p%9U{1=hvUZOBKPRM6XgUKo8FRgm3i*fX>kTf&gWeT))|QPuDxe3?9eN*GTB1*WBZ3=^24yC(W&;t&9P@ z4X5}Je5Ya0(V+)A@~G_@;DO`QUPMIw5~XtL+dN15^vjjoBR1w{8iOcLa3Bn#Wc9)A zFQYB}T}ZV#)!+iQe=R=XFObuYU5=DfHm?qnguTOc;!N)3Or)0tPt!VZaT~`wS*pYA zAN7wFY7I&i4v~(xtPDed=Cw<$tG5pdz3(SOQm^0Pcpqx{;Cp+z#?x`fdto@8Q zG8~(j{QAEr(plM5P!QbPP=n~kyPP}LSgJR)l4?Rtj z{Vb5-Svo`78ew;~nQ#29wrT_OCue}xD=M9U#~J18d)P*LXHNgLXQ&f)jD26x6UKa$ z=}6Ln(>kA!8~~g6HP^u#(Y3Ms4&Iq+Iml4jPIx`+TprZ637n(mawI=06Fg8G-G9#! z!R8NrC#H=Ac=hr@x{JX`G^sOJbX-cO4S=m=W|j=eJek7Ma`&KGbU8a_PjmRx;A_cS z(A$msr!@3-G^g0WEbFczJKDPGQD?Y35P0i+nf=N2!ELd`z!6#&J)fo$>~klu$tGOw zl|V(}%zWdYnokMR-$e16FQY>>+rY(?Y$1HCq6ZG!eW!2LT;x&_=vvIDM9KE{Ievo% z#f{fYd*U?3(8A&{MQV5eS{dIhvVGxzQZs88A-NpL&LSS>4+oxM#78|*l)ZR-pM#%w zlk_y99RFo(AgyJKV(ywgf}ixP;?!`Dd-V)8P;Q&EjY_yp!?y`--`Srv+A`>Y3`@&# z-;-9;JF;5-V)?P!vD9;>jtZFKU7L5DzkAnaw{B!)dIGoAa)5_b^g>gl=Ci|6-lzXL zdz!`XL$Jf6k%sU|6S>Yl2u!Uo8L0}ziJCoJGJ@wDsWuGgcRI&t8Op*Paa&;k*%%vtp;y zU?*+)9lXQcsngX$rgFVGo9_MBnV)Ha{<7y{sW-jnTW#rzza{12 zzTaM)d;YVmMswpx#xzW+k#miYiC)5UX_A&$`ex>eUu@n1cC(BY@Oz2g=D6PGj!i*9 zy5Z*hb{AZwoi)m zD03Kh-Sk`&p3MiR3ew5YK~(eCFXH}gl3oh<9vAgdpmEM$BOxg}mB_CNb_BOEeo$4j z#!*?)SwmJ(GdwKEeS^BwVW0~8Zmt9;_3=Htf7L%%6K$)wkz(nQ_2Q1lx7g7i@^kn5 z9Vbvqc(GIUGZMZyBn7`4M!I`G)x#2ON8jf~WIg@6Z1|>d?h?W}K&qDw`Fk?a@G0h zrz#zvkzDii#BpP;y%w^mu0ekm|6G3fUaiCXU?gbLTY-3o<9i`XV)*WSoOjUMK}D$9 zG~v9|W;0l^?OZJL>-n7HCGw6dTSH`nn9q?FH@@uJMY?}=YxA2&+6>vn|FIpvvTu~z zy*DxZbZ+b*+%`N^kr4!JEgV$wlf|`0kS*?O+5vnMI=&!-{AyH)BQ(P#mw5B+NISc4 zaxpy;6sNBHUbr4Se;GCn{^*vK@BQ6y%gNU73(`o&TT!RwNLp6aL;d_S?yit~<@VpS z_rdSDGPpUBEH{kYfXNQtYOp-1NHaAhB*v|tzi9D<%6q!G014ST0RC2d&*e%&nu$l= z8&fPK*vngSSQj0IEE=GEIp6THv|cd9!)2N!#Umxq|*fVFTm=*S?bO9I= zimbTnD}=+CYIr@|nxtF(;DWg%tM-E9LoklxoFvW=P3a=BB^fG7_H?Sj+&c?D`ZTK# zex>!z^jG5te3TOtH6Eimo{a!QK04k(vtf|@Tiy42)N`Dii|Ar zzyk9)&dM^zPEu5&SINdPA+07&M6vE)6s(-g-=KOVsiCPNb`l81-nm5Hrgf6}qO_S+ zFDS4jk;S`y7I#uOXOnH?O-|Nu*7Z?geU~!|j^CzZ-ka@U?Uur15|Wt>BtDOQl8qLZ1%&c}=vXUdtb zz&u&D+(|dO$?I|V&BjCpy;*+z9hg94<+gaC7D_wn&1G_Jy^C%Z47}~?BvZ+^94K9= zGgGjhIsH{M5a>6Y%x%~KZx6^72!)heLnPuI10Bt5d~QDDroc7rCGKoVO4M6E&0E>K z_~YXyl<=-C`G>mYS|eE$;t0cS=TBnT+j1l7FcN(iC;uW59ZwWeK2Eh->40v*f9>R? z<%IIT+O8$4lr0hrpN~K1L@;UOZE3+rp75MW%=cxgMT+Lly%G|vH2vN?w`sprCmOkx zZRK$_>iL3Q%Y+pXlW@8A9~R*bUud>|+m(B!<|3nAZ`6L}n?x(mM^*;?^#TwxbVAyD zi}!v3gO%K9`^{s<8>wyb#*a?Q7Z|WEWDSC|yobHL?X+A?`zKxir=BUNo@rlx;!iC( z29X9z2lq!I_g1NoHvU~ddcf6xl;+=dHj*{4DJeMMXDVbeBeq6%?G#otB( z{TCj`Sx9{8&*1m4``hr6Kg(Q)pv9cW(fEr$p}}dB=3SiU{4T8P0PxJ@!a#Y@1lM)A(hO@ zOlqIdwdUs3zCK9TPvWW{^qC)t4hJpyy^(yC?*mQO`<75M=&52qiGJ~p8opn^EYkiy zeyWv0LBukXeD7G41o}@Q8Yw4@5RpGdp zk25pbqmtS0X|hVa!U8=fZ}*eM4U_xqfBwjc-;rK;Jf}#K<%2Ics+>WO-bL0tybZ<$ z5*-$F`@7b=`kG`1*1L3J?Q*vX5K-#R^+Z06$#*)8ko&J4p#@!LI?WG-?E9~A+w2mW zM8{#LNVH6_^tmFDp>Myi-bOlYYDX*KKR#=Emfdp1XQ@Hd#T(u?A91yxa#xaRb9DD} zL?9?x|LM8C?+rMJ>OO^ppCi+ATR!A?WX{<8;`DUm*YtneM( zkIWe=&vZnUA5Z~hCujw_ zkYx9)#YKkB1HJT(c1;Q-H_g+#KQo!piy;cc@uNus_IpB5E= zStm57Jzhr*?~aqzPL*BMD& zMQJ;79I{FRH)WK3?vMxGPW_Erq&p$hot-qPuRoYFpscw;AUZNiHpE!#`$^1`A-M0a z#374ofbn8y;m(m005~|y1ZTAi@H>pMj7EZ`?t7dMhH=zCNl5c#>l5ncF~IkK?)#nd z#Sj0!oRT@*&p=&?&a6}+N_hN?gBy%tlGCT*chAlIYo*Hv%5B0Z2C5ssPy9>x-q1|= z)x5(w^U-UILpI*JRmUO)e#VCrYh<>p;>h|M;J5s>Gq3L^H-5VgG7=BjMSHLnt<|{fu>q>B?8r_||rIV!$ zkl+meBve5OKPzQ=fLyOUY(xoaGhBKWaX>ZDb0o*Lt%wtg=Pfv?tBB|{KYNK%8o|f6{Xd_kpOdfmnLM-IY}~(!6xh*)t}Alcc=BhV zXdI-rWf20ps@@oSI1)TO%vrU5H!Zz_|DUZZJCZENk*bUUYi+y_{S{mI0Y+wI?Z;Y; zHD=D%GY;v$jv1aP3kTCsmgs!xH>NbEXXradRC1}or7qR zSN=CzPPT%Sx$2F2r>G7AH+h2zBcV$$xCQ*(ah#PLmN;SOtEALy#_mpA-tdS>6jW=i zx=$-ve_R?-e_9)OZrdm8-os0}GVs7~Oogklt;h!M*}%!aK;1sL>6Zb&=ca!|VD_6gCbR~ja_e-gi$^DI^YW3a(gzr`%iN-C8`0G}px7%n9| z`3R1qI1`RaTeNQhkMc5AV5(i0E)EbP+$pI>*d&PTlg13?fYHS>;k~s!7OvsWpF#r< zvoIG4C4GvaPqt2)1-5-B>iy`d#Q^23BW~f`Zx@6=rE|&wCVLanFott|fRD+|Lyl1v z2EUeI@CoHoIMGqfFm}+Kt(ClGKtb=YawX7D2NV$|Sr{QuhI=N#;^Y#CEn$-;VcEp~ zKGmrkQAjRLACOANO;S^%szdcct9HT#1{Q%i8^*|{W#+>U@j0Q{EZ zWrPM`toNOZtdy*zp0`8wlHIrB;*<@+TS8BGO2Qjw91xePu6?U`EToi>`ElD^s@yHd&Poudw7p%zoa=vVzaGcIaKr@2 z=BHNbfGFC_&Yo49)YzXSCHTm?&%Apx>7{}~+9x%3w9MJwx26>UX46;4pqvyB@cWt< z3r|^Fn=d0J^TEFDTU);EKdd*JSD?c(-Pj^A4DUyTJ$tB$#n)({-8y|M?l!nOEW=e1 zPbdvym?jvRC(EVVWk|-aUxXCm0UX!$|m; zf)S0#%>kvmh`s>pF3Q50S2Qvlo@Xgnwwes(tdkWhY6E~-2j zR7olwGtCKSc%{DA9SDZm?2M{K1A4z;1Xa*bzr55LD3lg%G}(E<2Se#}A(r?*$Bo^&H07@T*3*!GADw z(8u&*Z^P6k9CZ2p3AdHw7;`~eF)G=5T?!a_aGoL!93~zx5bI|H5yRoSA&-`ww`~P= zM$!5gJDx5)MR3{Q!vnKteht#DJXay*HCmRQEe8fF32xuQo|03fDG-G4DLF+Di;;D& z-b&6&2R;Bkg%3DfV(GBJPsVM^D-XQLGfT(tc`>z{W3$1~pX>3nmSBUOVc0a0i`wN3 zC?kAYw(mko%BAtn?^$xe*6F1;uhg{(FPFt@u6q@tnY(!loeE}RJ0=OH7ge{F#mFD* ze0$*;H01hUP$@_Hn0IZ*q%W{9x9VQ~oD-l~p2t5K>%`{lK)AulGZMO=D`7a44eyaZ ziMKFS4MivI0KZW1xwWif4X@o;26`*NOpK-Ec0dw*xOs6O6sH*UprhAiM_+iJ<28?@{ns>&XZ+*4msd}hrldEwm|DCF@o_vh$>h6z2?c`jI zxakVUbK1$xr7Ul&KRaahLY+f)Up=|`&2mUD4H!&FSsMBI?mlqeyv?sMIvMb&@3cq! zg-wPq=&S31_^i*cjrWj*5uM_y5zOjkig)LlRY++3HyYb<+BtZUuo)3k;as<_GkyGP zhG5&DdDicF)_upfQvdLSx4mN;A}0Pt+^U}CSF1O~T}^V#Bdjt@hifCw^gQsc_Q6gttQD zR%7`5OhdMret~S%d5Ga$eWgb|{z`1#Ev@)(lmA@?;KfZtzC0#9=;wNqf|zMi8HVMQ z_HY=%Nzw-?-}b8T_S~4D)x7aTqBiT8?ZLDqv-C)-0Y3ZtxD3lp>-iljct@CR=Ap8a zh>)zt?^H1l9^eGA2_(41Mx&#qm83(Q_MM_M7%md-S$MbXR3z-=skwX~!Bfv{JwGIm zHt8{xgrR_9IDT)W&D$SUU`IEmaT^mi;fh}u3>m7&)`;jW!H}kNCv})bX~7Svye=}4 zx-hog92U5k(?t0R&(qTs#sx767zbjR{=gNXIM1MIE#YI&F5qe^6tFms<%>s{!iwJ| zY=YZrn)?!U^{KEv?OxFJvz^)Hrks}Jz# z>iHTHCz>~a!tg!A+Y35Q+w8oCM0<4}^7YPxVYv#%)ilQoN0f%KAY*&y@5QYm;bsyz zEQ66oB^2J1h_vrIeLmvdDR+=qkKTrGbmW>rJcj$UbhAM(O3763L4bn*cVx?kS);+4%Oof9be==+k-wlux zlRMuk_Z6NBedOl8+}9NW6duF{Q3Dt5$u{<@ic##3z=!waO%)j`BX?_XEV~(dzTI5i8|M0+ZIZ2+4=DbbxvHJNcZ<(mkDO z5H>XmXHA+M_0tf%@cS3<**Pu0Z5$atb0fuc*y8UDri}6dkJD@VVz%7tK*RpXGi6Ne zI+IVBJ&!BMO!tKM^4%G-bu>E&H{V`5bYrq`n5HYQ_PD?Z?#_o7EK0wLcgC4lppIv? zgrjtG={#jwI+l=U>yQQus-7S39(hgk7x%}5B*~^pCv^3F3Gpq(-!hS|B@|&Du3{!@ z03ABA%~11xZd#<}=eKl_Blh155-_;0Tp9`U?rWTxHtnJR&~m)?#}NfZ)Rn_HntL_i zk$nw)T5m6ii^;-az?a-!x+qxji?=mzbWvK5(rmUFY_Po)rB|`9YdN{=*gXXpaaJ`; zziw^A2T+_d3bp`f#Yq0(5+OWbT+3Z^+|S*qtw@@Qs3|BWgr%D=5^niIRLe%-Ex|qfdE%2N3pc64la$jer4TNX+SKE7iBm5)cGdgnjQj> z7v$3INq>T)&^jKNI7M1Lgs1qfP#OljD`{5@>VSLRHY2mwZkuzJB6t98;5(j@|oyv@&*)e!l%~wmL*5@cf<*DoHQhy5-yuzqLj%7tXB5y< zU#qKq%N-hh=Z-8LX0z+StFSu?T$@WMgo})V7LuLa`DlIo<(uIw{=_@8`*z&cYIaDh z8dtKzpt9Lf7?^H&#);t`*>~ku6q~|+rELsP1Y+D_-$>aoWDGCKG|_%sGbhPGu89Y7 znlTV?n)M)q%o>m@)w9u}XPSJjU7qjHZvHC$V;B!85#86gRl2VcGP*swOd!nGb!Lfh zWUhFyCxbJjfg(q6o~1uaH$DG

->EoORS!2Us3P_VuK!8a#+GM{=shj#50lpwy|a zA)ASZfU&>-ZOAdPEyv3`ARWHP*=oXiH~?DTn8$*aOA?;UxJbI@m_j>$5EotdQw*8J(V5N^f&jM3;I#54(9E#5(IMemT*@d2GG5{>_APlv+Nbi zKJz-2i!>PwCiNjytfLWNC!aS!oc{?!3n%;k$gu*L_eI0qhZ1;_mq?VDH6`ugiO8%Y zvkzmtMTk7Xm@5JV&JS!ehH<*PG%|a;D*-RU^pxBRLm;dyA}(}DFS!!XC3tHA(RBXg zXyi{PY{eSDaVq)kp%h6POvVf5V*(ySnqd%%*1Y*$(G~)BZn?H#F=qg-W82ySRpD|6 z#%CSd7SuV<(%?EdU+2uBKFaVJ(U;QO*z7v7h)xGPRxK;H;dFq`_j zW1Oo$1>ffv=XYBrJX^LRucd&Iw2}UdBhCfDr?;7wnQwTUIc@E9!_@j_^;G63VY%5R zW0`tdpK(`mJ8)mCX-@i)kxM|yh%`QnXcX9LOK<^h%0>np3&JP*$5cI%i*_Z)L74m) z#NQjPcjUzGxWF4el8^-qBAdK`o|$Wu>^i2x5BHJ zpN>0w+W+~O$l*mgjo~VmB7ORM-OopBc9arod9}DBrzAFuyf#C~x4r%1-DdK&la=(D zj=eav-k`t7M9?XfoKQ?zHarx`&Z^(LAtGqsup_Rb{`s0P>E^pAU8R}<25WD6DN8M{ zG^Uhbq(Tjh@XXAlakk8~M)?o~+3$ZrS7l@BFQqGn54duZ9Mq^t9D|HSTNcS*;? z%sV1>-VB(}n`Z$o(Jv~Yr-5=wPv8zbYrd01xq%BF88U_`{q*&|&-70QI$dDI1o@chASl&j{1_ zd5`vQgi*=38BKw6;#p8W?9t!-zPiEld%p(<`FuC;!gu8r6fSf7I%vzk_L)|i3CH`{ zC}4fsIUVM+2N6>JLJ;;dJE}xzS+`zYV6UEWY$Za+Id4%5Ojub*RhH*u$Y4p&61epe zMvnXaGcUu?C^;{2K}+j4cFEjJmSq_U?{tWN)+%CtTONk*jerf@BbR$GX%;Ow16PjN zyN)bqjOU2$G%8~bkMZ>uz;Eo^wS9huz_F+0{YNDGtYe)V#XoK= zJGdrp#ir)gA?e@0H<6I(8k(o-gzRbB>!n0@Zu$T>pWRZ2d3es66&ydFRgdd9Y&^Y} zuFY)07q)DEcd3a1gq)iOHtas{6^lt3yBUVEuRG+ny!eGFDv}$(h@0Am@5y#_=YJBm z_73{`;5ZOmw_dY31dgEwH-U9_0xrmlP-k~2Q@erS|8Qr6`lcidAK1zM6YT;99p{C6 z1kWy>WymEN-KA@l&nn<#-^Pf6BF-=fuDu4}Me(dgDy?UA!%Fj1We%BtvO+_~aDe{B zHkHlicDJMsz0H3MnY^+{b1O7>bcIJKvQgFlH+vF3d z1V=kP&UpLiHAUd6<*NA#<2So1%JC~SHfP0TP=bYyO_U8o(dY)3ToW8yn_@oo8fBLO(Qv|qL84O7JJt)yhJ;*K>uz-0!f}ldanyyqIQ#sm#e!H zkU<>7m{b1A-bG8m29B8@NlvD}p96;5k^L8o!j%l%gu8Pu!K%Bo%QqTMIW}+@fEu{7XwNPQnTSJd*3+~5b>_>M(kqGUTV^LW9-e%79%RDxG+2!Ze9FK z?tKLY9ghp;G2CdlvU9lFz1irc8#qv8o9G8Yfn857f_t~W+gx%$p=^?H8`-=8Kbt=s zLXz&$FfX>pa63u7I`O z{fW4DBB6v9;YtQWym$u^$iM?*uth!6zy)o@0`}#7uODiDOQ_ixu zzm>akb?G=*WE*~a0>XN{z2h+`r#n8urE8pR)$P9hq$)9zV!RX!6gG_xDLCT?kKTWQ zb};^WPd!$a`p4m8yB=P@Fqc$&#huLVn>nRtxu~2g?zG8#>fxTP(Lu#N7R1t*YPk8; z1PWDsc{{7yM5%zAd_6$HVB)Glf#t%ueF;S{_IC4{Q`*_;Gp5#QO#OD!SGhnfNEl*k z>C}N1jprpoDrbHS$WdJSRBi7pt$d`$Z7p3r17UKmBdpE*#DVmo={iPBS01!a61-Uj z)yvNXDik|{=Aw`R%r2200=o&Ms^%hLb8rE)9Ko7Rir1z74Q7{DUF=MoEv4Q50AP< zIlp{EfeW-N8k3=Pe)eXevw30ypi{V1cR!etTRH+kDd<*Lhpn)5 zBV!CFNA)!fE!oEngc(_0OYZSPg8h)s!ia9~Ig0l_AK4rw=ggM81l?~(@2HK>Z~1H( z7oP6pvM|8QaCP)Gg)&dRdu@|nEeh7xe9xIt_IlzpQ&+?7P@UP=$g=(X84`MB9e1Xi zEoxTgH7N9EI$P37RLT9D{+;Jmfe6dK`INYZlN2e~`TS3i@0czPch;+9De4EjTUPvI zJD?kAxc79o;7l5B9+7!aP_pmiEGrw(YVMz+K} z>zpGt$MKc5Wmp`(nOL)NZ;b!zb(&ayp zOJI0TsS0q{<3T|2?wwzP>6`mXFP7#p{KRcVry*K5O^!yklWL>kC+eNo)B7+&p%MZJh__{N6#SNH~P%qxUaNw z2=Dc(J~cPn%@i#+WQ=^0AQef=R@XcqAU5zmy@($HFmlrq9yiZAklfh-h!&OHpuj8S z?E-vNc?2%%A{pKzUkJf;>gx&U;yfo|1W)(hxT1^reY%Ea^j<+n%+>ln^5k&<8ujI~ z%gy@d5$cW4aRiwnYQ-Z3{k5QLuW4fn-awgCLfO4nq=T*O@RfE)9c7 zHLLE^dqW-0&IF9y&}u_1z0lwxbud&V581LK04a)7ixNJ~)w2?(B0;=ii);jLjYCp3 zpfNVhg`p|!sv+8K&qJ$vK?k^7e=d--ykS6kH=BWnwQab8#mg`Ao~_?vKC8@=7u<eN@i0hrO zZWd!O;AJnvMKS__$C5lJS~B&(1-L8H0EMgG?146uNB{;B9=&&owB zu<6?&da4OE$sl(02Mc8Zu*WD1jmvlGenj98zTcb4328$LB@PCixZ~v^N ziEN#I65gKLlSg09ziypBz@QV($ZYqLFc7z$I0;97PA(?s+`o^E z)4V6Va{q%cz;Xx1CDZ#EcGH=Ku_#;^du;A=N2=$9k7zcyfr`+j{O9~+ZK^rsQ*X`x z+G({1$MVA6j{i+B8x3G^DGnEh zZ>AfMbGhJ5W$~qibCxeq01|F82EYsI6fO>C#l*39W3>`Dbvf}~m>vlHTxE~29>lAw zdT@x|EI*x>!(JHW{cMxGJzx-7?T0G?8Tc;!Rf9N_s!q5dhRgDBo?=;?&S!&_y%0tS z(`taXr66tMi-fs{`O>?+;)emTfWavF;Kl6&Fz$f+jbNjq>R~8>BCM-?GE@}?-mDE& zc^4OHJn*_CAYOH!=XC~nDGJyDj(NEKyVEyF;#EOy!24O#Fa&FMe(O+Da>$#=|y~t4WD?dQMj*&mp&gJ7C4p#aM)_?l~+pK zq3TJyS^x4D3A|dmw(3OSeUdoRz!OIhkm^TnWq;+-p=v)I5GQ-Cc7N4CDq*6a?CEMv zkKa7mL4`s>!jS=)IF!6#T>wWm!Z3c%AdOz&c;h~~CSuhvaR=oQ5tEaaJUhencS%21 z#j^LKUJm<5ibTZEr5MJcQjzYaDlc|+;0Sqri)c%v1^68G)xWl^BlgZzRIj#@!_YwD zM~N)NK{u%O4`{Gu{S7HI-MxR5^^1PM>vY*UTFR5*Ja3(;tB3lkxfmg-qsVv8hACPL z;H63A7x=Nr=|5+uCT@d<<)PZeb0&fJCDl5xUM@}%Z7~GBnN*49rW`2QTB)0ow z;^4_v$K>5rA9JvQC438C4cM#J3+#oV8T}ZZqDt?0rfih72MpufKN&V11FZ=!Ic_^e z(&jaccj6%!kL61ph0p}_(?6ugF3DRR{@7@k);tvxD5C0nvdv4JDB_j87+y5F|tz(VCTHK zMR5**^@vK;jFBBKG(9`=`>qI7SXeI%oRZN7_r`Ug2*(^`XoisrJUr%l`{|XcnjZ3P zk+V)+3~5zeGVJIF8w0gHJ&NADIz@7B_W)j9j@349z?%Y>Et`BmJ~mv1pNY`<@t2>P z6%hfr>r7|eOMd!J#SK36ahf8;G(QCoMV?_>!q%N48hhk4ZF;0Y-H>t1t>TJG5p!lp z{TncNhUQy})ukcQS#wgSxDJ#`S3e1lxxH6Jhl%>P^GZT?A;A5X`BnzV#=Moqw0NZ} z-S3?<>HmfIO%*~#^ z2QQ8nIo6?fgbrO>jR5$Jj|)eyOG51OsjOu?8u=7X(QAO40p3Cy0D!lcBsx?QnBxMp zjFTICoRh_~4B^?iLzY%^_XSDG^bdlc!RzIA)9c_{W~0{_V+)OT@2C|9lxJ|P$>kw0 zHzz9ItvpuHTHLu6`hWo(hW~v#k*P-{mhRUSuiIk@?Q3S4NEJ>^>t=K+$3 z4MTs=g9{hCE7`b)dI*}?!T>{nD?hy|IQ3trs13uZP1@7Q((Pt&vk-t-F)55xD?yt-9nOD*CXj8V_hz819L3yn@; zTH4j(#s?!&J_h(;G%etHZ+-Zr`9!#lljh|H^`$-*?(k=xfktZ?N90Z3T96F9hs)RU z?pC09pDvH+%DhR!Q&qE-y}zp-SYNwv1n$o)j~tLA7{O!Dy6i`Cp9gf<`(|@M^k3bX z5UfocqC~qIHz^YFSY2J+0D6Lx%||9>*I<#)KAQ>8=kl0?E8|noBmp(>hWx?A!6l>i zz(@1Lnl8*d1U^jHO5C)V!0EUmK6Lf-oI-^6!#A{SHD?j_*^I}sowl;#N-_Jx#~eQT z8I3w#`FF0xDX>@8Z}L;XXSg>}+7dmNlCt;Jg7CL({N}x!cwPEcw{gFcZGKP`&76IUCo*2 z^Rcl&ZG58zI~y72{3=;~f4V-JbG*HDB%mi=&F~4l_x7A0VYSg|6*z;qpEDy?ggXbk z9nY%}x1+OE|9~V@PVx9HAI^Ay*zX=WkHo+(1H@)-FVR!QHxR`1_T0Tzx5gUo8ZCPt zPmg2z=!OE>&D%HR!ADx@L(`u4x@nj~$xMR0CBwMUuDzCf~;26!FILHk=v=EuizU+IaHT4;C z;KNd_z?)cfiNg)A_P{;*#suk$%{WLBvi$>L&FYTq=lc(781F?yF=&B(zN;n*kf8O3|S%{UT0LtdUA-1o13vvUN=KJ4;t(i|x&P z*=o4Juc6ZLNA-k}M=}M+*x`7uP#)OgbKaY*AkFY;VzmLh3fW{T+3+uuG6^H$PB6Ul zr)MP;_60nk6s(VLcwlg8h`!J>K+gD{Ey4R2M;Tw)d6OU<6SnCqv5R%r4Z_3fuF^A% z+P7ptZVFjH7=cvNa3jAH8v@mgnIp;27qt)mEWxmR-RusFLCqc)`~-p<^EL_3Mp*`+ z2p4p3PY^A*YKTeD#sVC--kWuFK7j(p>!91$@NCl!gLB64ro)LS!$b&zM}8Z13*uBBUq_4W>Hs!y%*KNr??n z>j3Hn^1^K@nDA+fgImR!LwL~ht%=i_{ZIIwoPFTx?rL_}e%VX08BX`dMkt#LAEYq( z7wcJBHD7ZzihJFAa)Q__+q~EJgk!BA!%%*!ZMEjC&2Q4fi(Fn{km^6fTwyKnJXfA6lE*}9;0MwFgAKl2E4s* z#dguBM?Gvf%~UEg@qJd~SXL8^nA&k&x{%JWN;GRt|6(tU7R6RsX31|yI7g|1p%HYd zS3y+hjTL$R+iRw^qEQccf)Da*-Qf_q({&FR;lprTl8ah0_=qa_YbW>JuYrfj(rDyX z6#*)7Uf4Ie+-wU0rS`A!F2^WvL|E{PfEPQBfrG8awS%bcCLVuVjpOn$jCc4PT~CQ) zA3L$o#dN@Rk-5 zabzPTen5XOyyjC7@a3vUcR!M=fZ=P>ik}}?QYvg=)vXUOqIddt!@;p~q-xFYlmmt3 zYavr0`*A9!ndO(FD1VO!MYq};?WTz7@85-r@5=HxGhP0ihvGfLvmowFJx32|i+33Z zmr>%;U&ZCY`H-_FESxsf%2}o;`G_OXU!5~yZRBVlN&^XxD^3{?pE5F_uF=ZFV`G$9 zIcVLR^aD6MCK$5+CvE$#AXv?sCFyJ6NTthJhHN3t16b?ryx9%T8P$(yozH3*3@HT; z`MbBK_HZ}g{qnp;f(&dI$IJdsyosWMpW7s&%W7_sCk)+F#YRPZC}Tx~rC_dqE^)8^ zO2_Q#n)#3_a>0;tkOy@l1(;ONtzKKJC|*NYj!0b z_s6QAEjVhc@rJZ%)gLB%dG*Kc(rJ*B@Jp`}u?+r$Tq)a0#;={IRH6CgCLTbdi!m{P zA*NbiVa2)vhbhyHA13HPJsppSS#{i>wULq%O0<=%1s1Pyh+)3sR{4Y@<4UWQ#Ssgx zAB}ab$P<0fs9C;PWgXuigUs%QXnRR8{<~%+ydhzLW+%o8N`)YnUSb5*pvKLis&WJw zWj#0chnzR9;hC*eu6Z_j2fsKaQ^ zg9od>ZbRgiRxPv|+j!l%R?%h=cSkRNbpvCniOafoH$dFgbGwR*O}Jq67H#RtL)_g-F$_Xa`@4INc^LOnPW~z%R&?#!GhlhXhS4vPGR~c{hno|Z8+jcYa?!(5b@kUdO2osg&l9+S zyZGTvkKNeq&V0QY^QG0?)#knPl^?dSK(6NXfZ}V}E-%wbYrtc=6rb-gpL!MtjdSy+ zww(G#JSNe!T_M$Lq7=;VR+lk$z>$iUTj1O)`{2fMFUBFTG~bB($pl+q5&wYjrJFM- z@5X&y47swdR)RR8XP;qbAGVg(uJ!eCoDkk&5pn(cCT57uG31dvI5u$iP1u$9b=h8` zzuy-8$zBM{hRg!Q9WMqLBBAJU7SnAAHNj&!M=Ic-2tz|XqSo0pVM037nh3Ie}KOJwO`Lz=+bKl&K zpV_(GmW>_KpZB+{!d#(r3olH)d8?~@N-e^>g(CqE#vHggH>VC_Q?9S6J#3zyXAII6 z^H+-k`3dh*Y{)klTUk4jnQTtSpZTQ&_^#U%s^RdNi9>$G_;UUg@l)J4c%JlS8Zh1g zzK8sGHQmYD#Jk^1`37@ksIi%Q_!`wflJ=SdelX26`0rld_*v)Itgo0*vIqEx)?J(- z`^&2hB#J8!S_!^+C(1h%Ug~?A<;-D7xFc;;_^H`7V9qEzw^0~)=T&obg$K{)$@y9s zLV6N!Wk3AO$oV)*2J%m|!!oifZ)u31u$hcFrkR(|0pT501#XLX+d~4j5A9z#@;$c8 z$Ieu<9w^B9;u0IbpICT1j8>>USTrNchiRde*y;TGTvlOwr!fNl*;igXoSPwmx4!Dd z-%69_RZ^g2qHd16Z1dI#5nyodx{|fMJb{b(mp^*9KWZ@|svlb}F}=>;dXU=HUinz6 zK5Zek;;Fe9@Kf_+S9$~%PW-%J!3NCY;Jorjfz-!`EnM%5xehe2itm@eqw8B5Y9mii zvS76|>`G}~af<>6uIGorw@7e5+--5g-{;|Dra?B^wwnfwTz;a2p|*Wj0N!E>-!G#S z4*S`2Xm`eM5Lb*p?X))b!<(4UX_3{rKh2-T#zNFmUN0l~I&F^lQ;*ifN*m31Prt=P zeBxU~VF&2#JaEt=@3c|g8fAh}_6}4bJd;trG9p^H{^s6C=Fv%KW9+xHKRnLro;R{F zU-i`yTDW)>2`mDK&&%!@NWhoGTff)lMTLo<&A|aw^O)~;Rxxqy=BEESpS4B%;uYuE z@fZ#!73|#He;l~cYrS|^#`QUk{F9Ggta7f0!>#V~ANF$|=m!c!J?)5RR-Y?@;H?;j z{i%L5pZ`!2diKIW0L0F(z3&cjMs`h|&+te1oZXNJ#xAdtxI+2-tj!^gYP)ohX?Zz< z6?pVzwZk=r=G6SA4Pgx1fp9ElpF#9+e*2eL|J~_#iXHQQ+Bvg5&{U|eb7JR9Gq#`I z_Ukl9bpU^@M3j>o(=s=saqgZpKY!u=B=yEo-kgd^B{n~AghU4bn^6x#qi*+q;H-lv86qHi*kYZ$ZHF<^5U?X z-y19y0qaR0**GUV;Udt%_?=F40X}X?2V5QF=I`E~7x{ykvK}mw1$M%?K4%7;F)MGv zahQMb+VgJsxniRDdY(3%C$Bidb<+#k97WN{YxnM?VYteZ2OO2AcXE}UJ79^=bthA+ z?BP&O^w5H3;?*D1tDWz$MTWRiBs941XTf$q{k6#a$^9PUAnD+PLR;?BZ-b?a=F}_? zS+3v*hoh5$SmRac@WPFapuSOr_)AGIP^l%`-)c@ zFKWEQ!TMiuLBqsBn#-VKAW)2cB?<;P*bqSTDKL2ji6Zlw*AT=&4~hc=of0(Oh!}5- zZ^rl^DHj9XgNZ6Iv8M>GfQFrhEj`fQL{bEFi7g~h+}PT34PZMF+C;Fd%#c$3~j@wVTD&iHBk8k1!e6H}=FgXa~R_>g^3pHU-9Xv}|Zb%h=W zIER43>QW6zOu*r+?NZwro(dTE+{8ejFM~q5e~N600=tAnfNqDr7BKYg{-?2>5jXrW zI50eDVUv@Fj$JNoh7DT9!uSac5BR4wJYiK2*ARP%-n;ScaPQDSEVxgaQSi75eSHfL zlgI4GY>IQ1eg&ZBp$3ZOt+HX7kmZ$SL0>2|me$QCgjt}EIH2j9{xpe1^ZJWSwd@?` zDbz@5;Hw6>v`mZbaKL)}1zO}|O#4!P9Qzi8+ zC*q<^N`?6{vh`R({BgW-t?ZP|s9#bm%D;?hL~R&SHhN+qU`Kxof3Rmz7{&~>fgl>0 zpa7Pof-wtv&THhe@JEnQ=g;m1NtXn-LnYAf(e9<5^uWXY#y}**@YLZ|ISaG1knDCp z8_rz%KqRSoNyMFpfjs{hFb!lW44orE5m+v|zP&IrNW7?^QmUk;0^FJPCm0@vY8VNt zf+xJ%E*-sIRR_*h?5ISc;@Ajd=V zRBAH|S7yd8ro!m9&8o$;e<%^ZvStLgsdXC^46ZtEH!wms%UB3s?$Ij`3 z=bh=>M~ESJQ8FX+<)^DS6qwr}B88=}QC=x2wm}%0zRmEgt{NdfcD%#UcC&DdZ&nS> z@vIslsm;w^BwhUH*Szlp-L!ucoJ>RI!!)xiE-tiW*Yav>-UgT&e9b<;pJRDJ@{&Vbc%f!#c<%g@;K(~!`ZNc>Mc15?l`!E<@NNt? zV7GnyIb20sW;I7%(5>VM4Pm|-2T!xBOhq!EnV;;lc+ZMdg zZ6jMEs&~%IQ(oOu%=Lg*n4$YGJPwtd+$Y!0+UVlZ-R`2Ou0aLJthpiVGou9S$acVX z%=H0gYA{c#53lP9&VwBEDzbh2UgwD@TPf;_txPB9KT38b?f zWV4p$9~>Y{cRRYg3H-r}%dkt&UQf2;ESpbIwaLZw=VSbtoao}kMvO7CZ`D~)?WA2p z{a|Jf14hIGdB6B<)|W>ZPcGYV%;H=)@n?4~mo5~8`i8?^*{_m9CmnvWHYduUbnMN| z4UEmi^D^e>bm4&W+Q+ zy1Uogrp~ki9|i|(bB6m8JvMW2#`~P_iTPG04hFJM;ZC?^*fIgQF%^$VO2=C%7Hs2< zi*Q+aj>I)vX51omZOesH&6J3Qkda5!kE#(|x4qT3+n9w%I9762J-3t^abN7c`oPUZ zWWbOR%F@us+k$at%evvAb={?(Jaj6uB?e)H4o)|)LI-*Y#xsq7GLFjjDp`GxgcUi% zpKQ7uqLMje?Bn*^YIX@&=C=EFbX_l)hkYeeiF@^)xi2AAd%L?q5jzw98Z%kho!RBh zY#3n%h#0k#DgDl*cxe*K>f{z)J2M=W?$8@wdYr<)tfWnJ&dg$LUgwX%W4PdxQF>nCfsVva2Js(U{Ix)5~VfCZZfYi4xDTFN;r~m z6)#suM4Y6<0E4H%@W46h(qro#6!5e&k-3+DIBSjj%-MVavPBs`|GtLL?% z9jgu_$Q@YY`j>?f0O5pPOJ;YdPu$ElhFhq45GK-ooqF1~BESK|37_0CMX}hd8pRDy z@#e9#Xumn?j^XVH?W@jv{yB5T{Up2YF1i8|#hhfVh_j<*9e<{u<%*aymU+yG3Xt;0 zrp;ugjLMs>U=X1?=d^-~;{SN_DF~A@iYwI--16n)qFEBwpl0jL!gwP*{=w3mJdU6R z$y^}YtC@7=Q}I9AtgqR46p~_rXb?6V7;sE_xiN7QHCr*@IC+Ly3g9(;rIC*;7>Rhz za2%4RQh*K=1I_W1v+4;GR0l(DnrjSuk~_xjpQXmB9VF%0APm+Nl%ivxGT z?uJ}Zp`hyK5F*|=6==&}9C9F$rd-mSsANl^mEUf8Ou!&BQYCv=QBiKtT*}4)JVc;P zv`?2E79vCyh{twWq~3S8BaWYzu&KHKH8f_lMZWb>%=xA|8eI^8#~hhvi1k3iNVZlF zE1MzMyvzd@l{xbXw@HZc#g%lWfcq7(=3(w;W*H(YYa7lh1I60w@(+UjG?Nd{P&&^* z0^V}Y>H(vl(b$mI%G^jK;~AdSImuB~_XiGed3S&J5jg}ZrpsJ#+{BK1)2rw8WT=-hV81Mx%q#H66hX5G1uAY+M2H*LE8EV*&7v@ICUh5QqpD02z z{e<5@3DpGu`S8zRp4A<;4vApC;cx1qcLydwO^IO`e9m7E!T_Jh&5>W|5`Vjm3RQjm zd|$z<=+cOSax{OV3Y6jV;^D!|O9voBsNx1V6828Yusy+ z*(pbcjG|x^vx_dQip*!^&^_6{*r=8(fjc}qd|#1?683W@f@QCw& zcP6~9qbtBC#h4MoVrJHII@5I*q@$@Bqio5X@e^eq5>`GX`t;sx$2IGdg4i-6p`Sue z91HK8K_`73(W(KC>v47Spj^@3C}#L5*puqWdD9#V@%a`ww9d_{yWSAFepgvewdr+? zw__A%G{L^D+jSs<+b`A)yT1#^6zi_~Gq$Khs-}Q>{mIhpExWaI{z5cm<&2Dt*q?|j zafcyR>HtbWwZF?6hA8m-10$Qu5l6LHUK#K#-P5L)*G+CdlBex*BbVN7nrw0@PR>U_)0%U z@U$PiX}%+AVMwV0;K8P1xJtX|!ml##t9UEJ>M|5MxA-zF7R{P(#(g1nYZ-=|nuC4H z6@`IE;gzCF+6NTCV31V(IU`sykrPU=g!5{3$Rm|fQ{|?d`GE4%6 zq_)Q^Hu36;qvv+^#}(aipd$$m(a%#!>xX&upUzuK!UWulj6Wof=x9S7#WD6sGm)c+ zKbS;|jn-VY13UvwRUf#u+)D_s=*RHj^_4KwZC%Nn*ZuKliuuKcnP=h!#eV^H5{3rH zZ&&sxSe?6HIh5@A8nbi}yx8C4vg$7ap$=heb4NMTjeCIBPFD%UHO}?4(MdjQq=OoVrASd!g$FFr=JX z!n?X~>rxaVI>l*zVJjRxl~5s+>^p?x8aWMD^DbX)!B;CHb{o;(0j`o61U#>jNK}d5 z?;+p_Mq;<59))L8*HMHFYGGX?(>Zo!XC4^Q(}UPa*sNY zrO#LUNwrtdX^w15xv4vQ$#?7Ot4uG-L;Cv7&zDJ0s>7A53c4-T!kwo{L}ybTay&ub zWKN~brvfei)$XMB4l8d`2b0wov5i)6;+VyQ9*1sjK{)?TF}#aO-jSYlJP`-%fMXaw zNewd?Kg{U}p8Mm03;V&rg2*5+*)V>wINfH^=imML*bqj-yY1}5qWut+n2($j&dC*! z7_X=2`st3r1(i=OOgP2O!p2BE%{Guao0}0cS#Aoz&g(+}U%M_GHccNb;W(6!SMf=L zb!aLn`VfnxIce}8BVdER(06^*?pSlmE!mV(nR^+Y3IyELOv%%yK|6RGo_%|>j>1Z> zV`=I10Nyw2fXhAWK`0|@UM=Pd987O+-eJqlJ%-S&BIya*zd0)XL_TJ z<8Y;yzL>D%mJBro%iB_4xNMT5h^l_ zf*aUnK?v-YlxtaXz|ABYP_wL=P)9=ArXNJAgc~Nck!fcS0u zJjVUWp{{UnE}sHne3xwAY`G{A_u(LN#E;0`L6y;7-Y@>{yEjW_no-Cflo%F;NurF= zW_oeLOZgWCG4B!yWgX60!FD_P@N|g1xn^mEpd7)m2XDurG5F6j?Nlj}0j}mh$Bqn9 zZ9PN6u&!@gM}UZ6@TE3aVv7|*zefiqrJ$C=8JKH%QX&{hKx_y?(b_vPzI)_#)#y{Z zBbAi48#o{-d2%gEas@DSxz)fp8e6J5<2igOL@{<%WsH$jzZ8dL&JtI%?33=OVn*(? z+486>TC1S!6(#)7lMbJ-cb;9)y>N6Ynd>}eh^0t)o+mSYlXRCmU&)5teEz^*c1386nU57TBn%nGSxIqMDI@o8N+0IKL-jug~s7W}3SXoCTLzi~ls<1=El8x9M`&Hf(UkMj%UO%5Q$bCO*{U^a2YErcXn!XwNo zhnr5br~-zy<#sCAi!vCfcw9$})WZ(ZezEn>dfRE|$Sch(?_!>N4x%9O-54)sgP$rIz zZg_V`)S&JnMJBl1pgvUpRDzQr1BrXlu1mPeOhkY|*KM1y!&?fYGMm4BPoFIai|{?* zYbYHy{Lc}7M!`lTx$A+l%G9BY6qVul1%%_;R@g%Vc5M3SX+p#|4=$o+$8|iy#u^=1i_t8U zaA>3cF}UMpCrL=MQCq+f{#e$a~v`q!fcosH`pmLxdwigC}9=O&IQ1YW8F;6p=PVorWYa4-C+~vJ&{u z^s7)78(F%<$S%W9X-7-oI#9eW65}8I-N4s$L@YQ=3W{c$L}2lidK2J1T+f2m$aZAW zVcd{mguEZaw$DiOs$~y!FxHPSL?xE1wstW2OT&UxfDRaIx=Y_M9G zU~u#wAf4p(fGFPp7c1*5(rp=71(tmo?eLZ+va5sg8AYTFCUb-jGLaJmli~ysAB{am) zz||bDwGg8<1;;kRGz-AU^>NjE59t%5G&}@`hjJJko?7Qv)R!z z%B$x`u8eGpwSTwkhAdn5RGmy_U$sq$Jfcy1` zS@K^4{FWIGAIAairUW}hcRIo_%=lAsYR1v+&y1^9^Aj#8&xd{eC(Y>zCIIeY-Lo5mX4?RL4bvS~g=}KostIiT8H5I!sd%Mey5WL^37@ zQp4_&gAAxFJ*Kxn#2@yVb+6+MqxemgJ%*cA78awtzLziFta|p`>X#Fe3HKMWvrg8l zCni?bC8^2)qMo||3|MzZY`8N!8qSUDO5mwZcuJlK|Li_)e-|EWX86)BqUdE0=mCZ; z-owWP7EgBcgiputxuW*KoB{Egr^iu#IXBfI^>oy%RF{8EJ5NZ&7?zsxs-W?_d8|aU zy_UkZyFP7hl<){-KrLYik$NqK*>T^oSMn<-Xx;OWEH8`|`A%!++1azJKn$HBU2zv; zvLE1SekaagTZovHN9pe@-F+HT=sDXLx8RJv#VsM>wyKZRiLmqj=Kux|uJ#cez2jeqzP+&OJKlo)YW4e^FiDjPhvRXyEdQe^4apk0q+&&RJ7NGy zwlFrbnWbmR9cJUHd%NyFa|OfR_6~#SjPmvjXwnG2W4^xntm1b3e97(lopG^Vl%e&n z&v_rZ<~v5pu_C4RcM7TEi%R|$Pgh{k^%l@37WZ>Z19XF>Y$v9MZ*q0|4CZ@@BfOSEPd{(k4VaQPQ zy`M=N%_?`J-=o$>ak)n0Q>EvG9o4||?Z%q#hnq%u+3tJ_JI7@Q&f zcEFv{14Pf~l=>dY&+Ttj$IwIXA_wgm(}3fQ_s5spryJhU#I&)eqKv8kacb^(@x8?n z_Z_0~>zy!1?e44AG#?ll;9rC`TAorcKHa_;?UGgBJ+m}o#_~ec=E|>$iIMiy*mMvP zoi*ouSfRyT1*hI@e?Q&QA>VM!=-lkTyYJJlrE1cH4I_7+f>&LAI}*Cn;wV*&5rC0q zx$``S2f}b{6*da+YEf&Jp6_-GMMqbSWV<{?<9HixNNj3Z2mES6!FfObi~+=}vsV#o z)SF9>k|ySlQAb*R9v2V^@HX%h#@qhZAi#N-V-Wq}C5e%_Iby#%@0m&QT~q{uNKD^e zs(`6x4Rj)+)989*Q^Cu(vT(_D6IS^d?x=kwQl<8Z%v~GY86(F)!o}!6(p+fVOWn^n zIZ~j|OgnE776ZtMu8++!>daMxII8M~Or>P-7r`ARc;S`9Fhb*9dgThkbf5mjNsdqkTvKd80d( zd(N*>68FF6lV=)e0`(-ZCMExLe*&vu?6peN2NkqVtqG?xx%UZ&MU(IujAsN4WA+~~ zST?8NW3eW{xA}Pq3{a*%xX9JXD!`NAvhdhm!{4ob--84<(=8l4Teu$318^@PGnJe? zY*o>3Qb^1_4i-gIE8O^JvHPs_E`K999fzOe(ONx%5Waejz`yI5CT*bV@-nPgFrr0L zg!*+RTH~Kr3F80!miLv=%&GnZq!+rL1`?I5#{QLwy{wy}A$HDt-G>d?UMqj7&#a?J ztCyw4&lmp$_1YS4?6CcX!tZLX@R}K9v&xbxnHOoerA|h%0 z*Ehc15kWJq9h75UKk?}!%OeZRQy*Q174Ww&D6qJ6pNb7+5m3nJpVh%1gxg4(5Weado-;W<5IB*u4e`X?r4h25 zKiQD$BRG1#oGd-5Y(eD2Sjj=sY%_x{_0hDPD zlmJg%o3UcAr_oP_OD)3GL6CbJ&V_ zfDx+yRukNthLP9%f4OLTYuOS%s<7*aI~IY8uXL9_wJK2p0T+U_`OsEuhHqU@@1heD zow*`c$z=_{-O6tdGvsRiAs=MT>=IH!tjzE;`rUu(SqOmknMW%gZ#ec7xua`%Js|;_ zUfc;?@H)5VAcC1Wk0tY|rzw=)BrH?ueY{Uq5EQkn`!*kcvD~Ho1r5F7^LKv8x`^S(jjCTJ#^&(L!`jg!k~(}Tw~BExO(3L zJpG&wse`bZsw*+^CE(F{<|60b6yiX!%eZ}UK*?p)NkKBQbn}ZE!kA;}UBlb=O(chi z#6|71GZzUaq6sHgfMa%0H@pk3B-WDF6_pia!{h11sx9oP`+Dly;qi}deI1Vb(D2uX zNumP=)oik9@(D|9z>8`T4EZLy+w1RM^}t6e7-e~I7{(h0sD5S(!y;P#%+`Hl`bR_D zL{d|Z{L&xQBYdPaH>Su((z$1K4Kn5XvTvuhPCQn1WyT7X#X6`!K62Q$LV`%`(Zxf( znC>QL%^)*T_18nBrgT?wSB_>}`^KkvO6~y+E^C**b8I(T%mcr>brg{)E>h|AY#nIv z+#MieSgrv9fIZ^EedWbPvlovjE0zOS|(U_Q5eCuSg66HT1RxQ&_b?vH67IYfRRyLEjO8*NF z2C%u3j5+93shw^hLe|{Xr%{t#Yr(-b7_V`1b8rY82{GdO;#QBFTShyL9ER*YNYEPo zo~Un?L8aC$K}PHJQow_d(Q2J`qOtls{Xip|aBRq)C2{-Rxl$q4>%m#OE1`8U!K8TW z0fmfi)`)ud2?KcALxSjKX$+J8rQiI?-6aIdmK5KjpfNM#yc*P-Jy}VwrGBrE#$$AN zMMAFO{DnK>4GhQlHP_7wbYE>y;eQ*)c}ZFxASXz!o@Y= zkv+F@obP{g*L| zGRY?1ix8nNcssaYO31pX@&N|plcgmc1h{UIrT?q$7rO{f7k2Gj;&)m znr_wF{iU76c7nr}B7+@a_zev&5zhlgW~wWhO|kxjV>5REAM*v=lH=TYlpZVX7F;w- z{^SCAqG0fqwrpTmuo_C6`s80<`Fb5$FjZ4-FhNZnHtIXlW4mlM;o-Xzg^R_!4|s|c zjbqfsm{0gHJ0I|MzWDFb;J3Ob>)xch;8YxxRwmrGM-H!kIsBk5EY&lyx@eERFeh`) z!-@A%aTIFSPNOmNZQM>g&bVF}9^QY(L2eD;1)rb?5|5Xh_dr1m>fWeu${C*hco*zP zxdK4P8a63A^xKZ$1HM;%Uq@D8cj@+yqYh_D%SuM|K?;iJmR}eh?ISv_7}ulnXJ|d> zaG+oRCf?AuKQipBMB%%4yU!Zl>^hNbQYe|n=9TP+Mk+#7XJRc&tiw`N0rBQa$d*ZBFx8?LrEyZ za;fN~F{scQ^%8^M-8)!;xRsX}qRVV*#mszRxp9Cr+pl<1&*l3QMvSw!280HvR}tKJ zv+5x!9l+q=&Z>K-6cykl-ZVBFGzf+fM3Fn%_qV@ZxzJQZTRJ`ESr7EYrY0;@?3Oos z?Ac2zuhi=2yha{sUw}$oD{Y)ods;-u16;54%A>eodzpFuIbeePl6&T9gvepTt9^`u zxr$AnxK6b+lu92tJSRRZ8&d38z^GyE`y-Fzn+Q8N0N)NGEmty?kj{mqO zD{iebKD~UtQN)6TUvU1P$@j4b@U*OY5d6h40F1QFAsAkc>VqFiVasq8K@8w&-y8Ge zb&&-e`_pcQm#k*M2p9HGLO?NX4Y&rk>ps$^!^w1Hm;fDG!q|1;XLlWVlmq+?X zI^R21%RRa%2#(q`s~K+N>U1{;jVo#0?*J(6gm{*Y?Ol~1Y+~ASf+W;_Ke?9=i;7e$ z!?-}Y-4(e`hQW#FN@z_c?7W^yfeh*Zb8xn@lqSPqm?TJ6-}|fyNF94_;_0D`tQ%Y< zf?-$WPezT~UkL__{2Xw7yCsMb%2O^*l$$N7qE8c<=nkg3uVlNQ`j%n4X!Xzb5_L zrNP5J)N;fKr7;PIfk!j$7LMu0A<&CQ6Ty|4+=57FH~o|h1HjqPi)UNxo^7Pj7_((T);e2ZW)>Ph;-9+^CumfQ^?t!TXpFt zlWfBL-rfg)!R;s`fU0ZK#zOARDZS-}()Mt>K_EKDpZ*IYLvL;GAqXDxC&9Y&R(IwiM_2A#Ja;(86L3+a5vE{!V}oRAcVP6+%jx~mK192>{6)wK zd!F62}D08Tnop+tF+nK65MKirRL$|Y|W;AI{!^J_Rh2m*lUlVrD&R@)g zX24q<vDnCum-WUMzGqIo5MGHl*V+u}O%*OZ!rfGc&$ zkG%UOdF@kt?7%y7K8e`ZC*5bYG9$eDGzx>VWV;dFwz6MeLijq_yxsgbUKlceybZ+l zC>Pl_E$R~O{K?j3>KEbhlF*>M?Ku*IzH;rA-AZnZ=6507n-@aZEIH`O{lV#nH)+FA z3(6x0!R=YPyc4wbw|p_up4f3E&pw4p&Gzyg&IAM-%5L5ONj{XB*{CkJ|D8KPtP+t% z^DH}=Reg^nYGn!STsr>0Cy;4)xAZbBC^&9cvS;44 z|1|JDiN<->y&yoqcl~S`Tld*nPge#tU_{-!bj;dz6OMbP#$w`t^phy^{Ja;0)g>kl z{^Ts)s^Us8s-Hw*dD$jkMM}~?pH=xHvgd=BE@=40YiA*d(!jOqW?v<&5$?x3EU2z# zwy)afkGGlC^AQ%xzuC25%gHYJ?kV>nUbt^=_jsAt2O-pKifZf(QCLBXAi~xQYMplIM5i6OZDp(}*8NQLUxQtCV8^Sch zXm9CFX%LTb9XIAk7LEaSX^@lkSGwkT*~7jWD}QmxODdg*n(f;Nj1mk<@9e14&bbNO zI6?o_F|v|b*2s}rxrRHK^U@RYJ&vE9Gma3uCtw7<{R&qp_e#a%VQ#1^Z(gwiW}+1w zW=5xSGO=-jwabNZ-AEYh#O}jVMbkQ|Shqb6AWF-%!;~$<)>r4|Yg&DvWu}`L6b?7x z`W7qP4kN1u1&!e=S#H34_FVD1v}>yhbb|Ml{_3dLg%fT?jmFV_PCKAX;!b4+mD z*NTS%5dqhqkI?=6)h&5J?K5vY!R<2*)8D1WAm1~+v~b9Ioggu#`TNVTv=bst@R#0c z%J4Yg5NK{lhw$}GSOFF~9Ay%cOUG@{@P23dpRxIn6~zqV6au@|sA;@`BY;~t zLR02V>mJcZGz=SKTAl?CGx8Xo?+z2|PVSZ_{iC#f2PN>nesLp?T4rTaLqJ`LD6cHuz)ct*{J5prjY`(=Z7x@0%WJgK9@I@;-C(Y%=TyWgMW)oK*kK+yy7DyzPO{n zj+)F+NCUaqe>Lwae}?xH@la~>t{isy%Hsj5G}Rp*lRBUGk;OVsw(&ix_u_fgm`L_1 z?JbXR&v)#ek{pfMXvJGQo_MEMN$EYGx3P2OJgIHwlkn_#V{j*KF=G2XKX_o+q=(Ofed0mGOpn}vW``#nhJDe&JW@v z(g}fNoaJu>Yk|*s_>;P8-U$EmL_W8_Xq31x*$68)zAJw*EbRP6xLxyGzQ*@iGsqDd znph-Lv(qb%BXO&MDR$I+I2!yZ!@Vb~4wCBKu^a3`51xAWZnztl2ZzCTHE1!vN4n^n zWjz?1(r-Q?R5P+O2xU8C^H)m{$F*CwyLg)HN1h|{H2&IjcHXb=MsmpKb-XBMydme_ zd=Y@Vd}a-1`$~@?q;`vD4zeC=`%}02^j&PW$;uaLNEM?CxOu7p9)6>Q^v9d8aaOLp zAuJLheU(M{zxx{R*TXe0)2?#~#aZoZL(IDBogf-JR|bH_^7KlWV$c9+s&X#QDeh3V zBIdc;jCb!(*s7R3S=zzS_(Dv;{J|KnlOK+Jcf(y=IDk$6j!MEjewA#`ZPZ=!W`yU{ zEBb~O_GIocGc6jW8(pX)I^Oz5@&V_at?f8AeFJ_+^N=e0z7mW z{hkjP>iGt9DpsN)j!_9|lhQa8iX-fREzY&(X&DDZnK@0SUZByji2leaWuqDJP|6}; z1V(vMO}*(M(%3=>M0XzGi~nadLme z^`UroK&)2&BErgZrj_ML6I9*0$E+jr(^U`AGxMyQHP;x7FPBB;M*BO8h;mK%PPuU) zoir8O`md?rNdnyxr;6iRHoZ3-zIhs*OJSQp5jd$9wjsXGsJy_|RSRP;ulbR2>Q?Wp z2$o&$?K&L)RI4>;CE7dovl zMD&U+1MGQwJh*vl1YAVE_SKMv#K*sIH&Gqn?Z_rHWQ)#YQm>Qrhk%a~i~?=N0qT_; z#M|EpAF2x@A!EJL@(EUwU%2Ah#0>_rz9UM~N&QkeAwia@*b%nP?!!uN$3H$Wy5*Go zlA#E4vIDM>=_cB;&xZ(@Hu**D0_#V`Rs!(B!d zsH-k(AeJA7shcDifg&eMgR-y+FI6D|#P1=OE-OD;68{`1k72BH+!)zTc9iG|h#!ze z5r>eidXsxg<2%a1b9GfzUDZ}jqHo}QFe84EBe!t8vHVux2k|29G1Sk{2G@g38!S|| zCoIa7?LmCz6@D$P1iY5Z=lDZ^q}+|b5mLu~rl67-K8VLrFpYyl?7Z@~d-g!tab|l8 zi13+l5m4_P^?)~Xg8p;Zb4D;AuW>FGc9y@Oi<{H%(HlQt2o-RS z7VspBKpds3auN?EXC&o^+T&hct;>jpdR!Q$KS}foZqO#yrZE2gQ>N!88>uc8K&M{f z0mC154CC>dx=6s|a2ScNIV^aI9HO(056}^JSHDGM3>;l66wIR!Z44nt3lYgU-SW5x ziuYeiJSD#fv_wJ?hM3WR>0SFTM#m;)l=vtT6y*5NAmnuzNRM5wcx@8;*}#It8w!g3=lTS64_SbGF^ zPgw};((78IbVEiWaq#{0?Oy;}YU2HLi-5)#mYvl{x6{m5ON#{`=;WrmiS>Ys%y=6X zx%sLeT&OGi`HX~dH?*earz7~Va7iGn{+ENG!Yy!k3EfP^)FqE_Z>hA27sj3Va&RSw zWyl&-`O&OPx$d#YeygRlPcXs1StCc~8vdwmyeVK_wWCk{&HYH;^2>PSu2%@>RutS8`&jref@ATh zZa!IznsFxs#NASf#UH2}Lr&y(xe4Ye@b|ltLqZbtX&kDkYsr^s4FI?;C**99lV|ng zItwO3>ydCvpIyxfO5egrjX_3qJ@UsaTiziH$-@<@AiNbTJaF+lK{7s?Jx>-CS{&Fd zn(53W)brYz62o;U;lCxBLT2a0))gHXrCP5BE18YRm6dyOaqpVF>zF%0D{oTw?6uFYokRsf>@M~wMnwTYk&;3yuCr$t%%}T8O zPW&&CNtjh!Wp5)x3WR!9StY8N;ks;5TMVok6~Qwi=>@-k2}5Ax(j!RXqmrOK0hXg* z4c>R(g`sdh&<>R=C?4o&mJbgiNRBC!(d9pGW zchm$$$YxVMZx}?t=@HZejU8$!AV~_BN9MX{V^Bt}OOZfd`sD78_ zk3RScVGdqBxBsX|xIKAu>^0a{tq4_b3%JL8Y7=ZWgM+zI25|mans1OKUS;tnG7nOV^C*A=%#_?kw$;-)sFG>X8Qn{EXdG z4`Rpn)Q1~ z{O-N~F3*(R!A>A`jT?~15Y;+$7($=_-s*-tFSoO&7gX{b!>3)0?tQ&18z32!>%?K; zBl7XYpzKsU-U_SV&EuaLo|Av^l(6gk&!!ppCFI@%ww5;;QC;S^!wvqycnuhTCzsbK zo~&;Xc^qf^Q5Xs*t8w;;kw+-vy2kxPCA>kJ7&vn#kMu%ZtLGb>#Cb$Nouzm_z}EB? ze+ocuVXe-ZCwF;*o*rM`6uxG{b>Q+)D}G;{a)kfSbO7&lkDLxOuXt>igA z%_er*AVd;gYx!kN;1$TTsre;ac!`aH{oU`SQM^a;=|3065TotzBtO?AKf-ywPkbz^ zMi#Yz zo+X>KXL)=x8+;tY!+1$J2`3T-dp$A+n{O#ud{sTG+nolPvIFjPwKx1>*sb1Wxtz>roD4pCE<{_=bx^D z*C27#xGWFM!{51@>kf9}n%jTHm&KoMmNdn0>Q&^0%u3#sPb8OnDFffmqfT3Yjtkpa z;;)M{$MKx6k@$FJ#fNj4Q-vsNY3HWtUeuIk!X7jK9!iBJ?uzJAynU5|3?Ntx8Uu}U3}p!hMV`l zCGzyZ-`uWwpW}7LD}zW4uNc_q>$Fw@3CPIuZy6r101_LoJT4CF$M`(!D^J8&-kA`C@>yqd6Bz06C zF^5c6*|Rct9&B&J9^Qj^7at!^o}AeE$XUJe%z%{1Gl&$|J0)5iA}C3;_DLG50G}~$ z7cSpT{#|cU5}gtF&g&DI1RaPoziJ|$61+O)O_UFRRpGc`XZ7=XKEIpL?4LaVPZ)o; z~rJyLyq8qptZA+rCIaDNI^?rwN{)LSuspVdn9_urx*)&>j@%^mNyT8$GLGJMDI{(=WKbzXpJ8{hk@h&3O zlledRXCzxnCsIG-+0I>?{LbI};e-o;5-9fVVLg(RqQ#Z*)s0)I6{1GBzV%7iWirt8oO^q>aUK7K85PsOQjbA@Sbg}e`(-(ZC`-;j(zFP2kZ3qI- zyy{{*yfw>XNST6pw(VJ5Nn2JFe>=d}{Go)Ifn%J>=D*8em^%3E_5spyZC;Av0q>@L z7yfQ6H@js=_$dDriWEcL-*-CX>@t1K*9v^;3&2e90Mg)dP!Q=amx;VKyPOv-lIdwQ#62RYLYaReH zpT!lbE7N-QJb~yYu0$P@oEDo7^o-C@XL(*)VgTMr^<0ByEz6TNIhWkJ5f3Vym^Kf|I}%6Eowr{o>y74q_4%NB z{K~>wd9y!7e{pjOsXZlpm6Rse&n(}zZ^7W?a18mtv+5ZI8QKinD=&(}7n~l>oe8&y zx7DC5d1-GEtVT?1jMdp*LA*wl{3_13p096T^&48R%Azu2F05kb(gznfTbJQBzQzA{-GT_T)i7S&I}N55r7?!0Vf8}nN~a>=sL`tpJE#`4<2lYS@8v%Fi=^5O=5aR>AUu!103ct6*(3OB-$-^Jx=w8U#X-u=?s zp977wj4fJ9{LHsU)*kfy!b>m*#5xTYRPc8=eCw+<+?$Qh{jF2@RqOt@{5yobB@sdQ zeHNQwS^liEJV!N84~iKFd3??0v>qgC;A`7$mS&Q0HUuF8(OlLQI^Ub+?T7W77;>g? zALPyI{Ym_HHUd?G#%%}{-&ffGs$MrlLm_zE7+;s@7B!Uc8Kx6S)x|SB2njNPrs^B| zw!J|VGO}cO92ci0!J4UGJ-zu5{E?8RN~@mI6@IgsR-{)R1ZJ>%;po1 zvD@F(a32poMhVW@x`nsaJkx7Q_ou4h`Q;UZV^B-{=_Pr#6N$F7o~6_qfv*|Nn!;;@ z7l1$bTaiO!6!<#>zk100D=XrE#LvUw5iudSl=H;@9(AjNN8B}BZ}=L>K~+y?0e7Wi-T0@TK3xgEza>iRZOf%M znnE=kF))IO{~3m-9!P)}*+jPMu5uR*_+2ET|8JJJ?MkqK7uOA&-Y+ouuvb3mPiQ+a-4*#fOu1G7Pim_ir58tjSwbzY{Ycw=6 zXQohzfUZ&Z5;45t*Qp)NAeZ?b|1^4GJj~&JD({I;qLkf}qaNwH_~gaCDB-Jw#cJTv zt`w6YIG)szveVCGcejck_lved*N-l=qDlXbIXH z&}p~OCK6jTJWzbnTA-ZbQFd|l$g)c=0H9-w{zLWZ1sAZ_@XygMD?T02=2u;jwkr+@ z^es9a@a*7Krj3P*%vB!F-Q>)|b!idFG89A%dKFkh(HhK6n^422rbbbis!uc8^_E4? za>9xEM)m??f657e77iCuV+1jd2q* zN_?g`R2@Nt>a!3ecvkSt=Vz%(voy zMC+=(`ifeehK)#!`cfa?(YdBGLcu{>-qMkxkFAyfwm=8ZXMfjPp-5bTl2M=r`ZSBI zp~SYq4d8^YGu<8C(}A28H&CV1cG>O(Yea9XBdr4za<+#;$}z-ytr}(off1AlOL#Ql z_$mkU&kYBAI$XMR{a-{LVzp%vaGTaZ`dDY#8b6hscQhc_3kE0?tP5Tut!0j zvXx~4^g2d~oH!+x3g`@1Jvcm?Se}>+=B<$123G(IWDc_#YP25x-U)AUASzpV)8>q+)a zUKXrF*_gZ|YkZgmr-wj@jH1W9(qe(>{ z73$1>T*~9UQx2_>WsofFCEki~e|@VrDi}|<>8@am9%Ou+Utzu~T#jat8EWhITzp$! zIGib=WjxK}m)avjM%gcydrVTHNLRq4Y{}gfKb;*YcMX@V4xfS_vJOuK2Ei!&u%6Cb zXM#rs+OKffP&|-%HWZs(ElBpv9_U}vmDI%*xLxtP%IhM{A^KKQw5;RjKLHC_vkacd zUq*hh~XL7Z!DreD>WEeaifag34JH zAddw8^waaK7a_v$jOskL!ia;Z&ntk?NpMAEX*?43Ki=Gz;gg z+jgTD>)oh4caZsZ+1|rjvS7H-1`KM~N&@hP62Yrzwzlucsu|$QH4YKYG#W`TG!R|9 z32MQsz%qwQ!e!sd?T=v`Lp9r?XGpbX6}Xr!$4K6;bq0Z$r&I9z#UY~LXQti?>Oi4Y z5!Z3W9C;4l-4c`RDfl8K1jTd^)AXOEqBSH6nCY6kyi)$({~aRSaTP=A17O3K%^*P- z8xZCo4+NLIt&(pRcaJ2bVn~cPjj2Rzn)_l+=Lum}pXCD@TUEJ4wdw)G%Bx>L5&INs zd)|BEJ7-z0yo$GI=F^93NnCM=pJbFn!-T-o7DgC4L7`RT#Xw z5&hCk+apdwF^lr4GFHrGFH3(N3d%?=v}ju5HDJZ(ttWpZ~~-ix0~DYXPY z|2r*_3Y!pHNV!$MD6n)Gc+U7P;p6Y$)8<1BC;#xoG$( zp+&7?1)+4Y(^F}UjM9L-316XC9wdP>SFn|GdnkKm*(Gv?f18@;@zP`aQ@Ehlo3i8x zU9yORlH?@LSTr_KCSKL%6B2LPlI<-r?`}DV!(XApXix?bC4N{H~(!veu); z@1)wUR>8u7uAwv+4<+H)^n5@C(bmFR=qaCfiVmaZ@Du77R~YE_$&nwn>Wh9{l$un# zM;P_dG9y7HP3Y1~grelSxnby44SSZT;SjHoHOSFd{Z&$SuoFzIaDR}}P2k%{A`!;b zUK{R!$_uc%1-@ckD{f#Lgf%KEc$2(ZT)4owf`7(5PVP-}BHK4%?L$w*pzliDjn1vq z^`M<#Q=>`+kRLH@WIY13qauim0y)!It9(xq5tYG{bsj@e>8u=ush9i*STpXgqi#t^2N-(E##v z&8XmVPN!toau+VIfWzoiy6WG?F;;t1Y8zFuM7Pa!Xi@-UM(YK+YMwV~b-^l5AgX9z zLGhrxF1&-%PVgu)v8s+&-8Br2{PYKhoJW9(@*B~P3w>t&;Gj@d@ShC-f*~x3hTNrm zJW+Mi;@Nt+bmVOPMbaJt`DcmSW)YKg<@5ktGMPKi;Brl(l52&IS|AW~AKwL0R$O2R z#QaH?QFG~OH(aW2VOmvb+}{J{^=!HlmYN$=$$L--gr_!2_E^h27RSM&-8wB&`?*9>nrk4Z`}v?%sx|0umnX}5(#GWs$7Kt z-wAx(3iS5)m?HS9s|^B3Py#?gMC_;|swF9p=bdP^o9kVQh|`!fJx73Il&dNGoo(1Y z6%@;@r&~H)PwW~B`OUI0CvC%2Qf;`={)QWK<7*cSU)D zX+fN5!GVe1CCLRI-(s0%Nn8qdps;Sczc}QE#Mtqxhw}Dql=bVfd)?*MzW<(W>CW(X z{%tbEDWq_VSY+`9C=1Vu^Kg4qs@^wzs{BE|Bvq>TPr-ibBdZtE=5g;tWbIxopB{C{duj$m?A4Eefaf=aUWC_d*@4lq#enl9VkCLJ3D z4&9dIRJ!CqdC*)g3+q4NH>zuZR5GU7B-+T^^54>t*zUobX4L3(XA6Ce zd+6J-bT?ky#*31~gT6bsD}j}c>-Iw-nDUWUjf1H@)S??7iS?(?W}N1%eIl(y?W+}hlNTJ;VJ`i?qmZS;Y;m}plp11Qh0 zF-_jA7Y!G(fpf-XIm)8me`n*d<#`HiRY=|9R_0 zgiB&cy7+y*&B<+pLoLeI5-&`0B7#$*hQGz|#gV)zlTFU)6LB3qSn!v4bgBcBCZrhG zpIoy!uH$V#dq*XZWnY(m0`Ru|E{Z#&QSf}IA^fKKly#I=64nEb&~}CopEuujUkUea zDUrs{Q72HH7f%An;IgpU+CfLHAKJE$R`QQ!oK`1R+NDn)8D#ZTK9?n*%~y7Jp9sh| zV`APk896SsboT^4+a02NU$Dm=@DX>M_P4kFq@Xi*?ow8YlQBEN@uO`ooWmkyXI@u5 zU{H6}{|v1yWEfAwM{L2a5f7gaZ7{h+d0HY*Jm3{{M!@Wv-Eb%CyWy>aPcTNL=1PXx z5P;w8EIuJBWaNg+Q!#yV)kA=*;pJ2@3XD{8BbVMeb6RBQQQdX9YF>G_oBitZkijtX zHIEn~!>x%qEd*kAbNQ|6l|3ZVJthBxzMG?W+;?F0uj(6d9D<81ajF_-9+%!drh{PE zwE~U=D8CI%>|$u9k=K54Zt3QDbrbF0gYfLo&W{FAuCE1!bhRT;oEMhSt4k*6yNG** zlB1OozlxN0uisu%mcdnX7L-xM?Qj(|T(V(ZVKIQp0c}uwAQNy8??34ND}GK&I}g%p ztGxCv%ki7eB^ajxnc0?Ch2vW&$<=zwyem%VYEL-c$jP*&gM-CC@6LIGpHwuV?D5U1 zJuTWrZcb0Y8kxwh?#0C;+~9nie{baQ@~~93k(cXB0WYR`6x8{(7uVS6@a5sl0~yr+ zzYO`ec=b}frubL3XA`&dW%#VvJ~@=h7WEPfVO|XYLBPG1O?tfxSGx*oc-fJZ3I}SFe`&3~gZ>#XZv>x z>f=)sB~jI(hfTpx0ng^WyG1U$>sMx#KC+ez=B?eO$%m=-$@MALE_b|hqU#tDIJW|> zO{C?5VZF8du!g$tmnijav2JAu{dc@#MJt4^OPM3iv=>aLpzn&HEqf|gnpPS4PMl5~ zG(w}U@@$Oh&*33$lvi*M;=~vbsMR*|l{T3;`4~xTJt%GHIqY)sJ5@S;-g>^d7}!tb ztJjp-oL-<<`69_2@>~e>&_5-Q_vufhBuY3>BV=^Ty=BGg}J5L*IfH ziykoH2}ZFa#V0!q>&q~EY>4RXrg9dGI=uHrn68|BiZT-HXa=cQ^~zR6i=D#f+tYB7 z7hb>+`w4Eck$DY~S5*p9A^y}^*d}(O881yusjQnT8AM1Ko?zU5Ul#bkHJsJqtLBiGUZ;}*zyoRA}^w41INx6>M-R{2H zPWg3f)r!Wxu~Bp}i+UiRn!5J;^P1S literal 0 HcmV?d00001 diff --git a/x-pack/plugin/vector-tile/src/test/resources/org/elasticsearch/xpack/vectortile/feature/France.wkt.gz b/x-pack/plugin/vector-tile/src/test/resources/org/elasticsearch/xpack/vectortile/feature/France.wkt.gz new file mode 100644 index 0000000000000000000000000000000000000000..c97e98015e79283a7ece1dab259ebb14669f4227 GIT binary patch literal 22944 zcmV(uKr*w0aTGXjVgFfB$ z>h{*Vv35o!c59uj1*?4sYkM~L+Sh6NwL5AXZr4gHOV}LUz4p^~)rc>~Ry2vecAe_? z-c>c=KF(g~qW!y++vYO1@ONPo?FG%&OBJ;GoXyxyt5a&*f;M^*hX2>@W@ns!g|&h; z)_`kSa|`2`46R=MDb`_looe0n5Nl(e?Tu)wRsCGs+zVr;4~?#u*|R%!m)3>VjsJv| zJ3ZvS=c-PbZQmP}H{7ua;u@xiu-pvJ`y61$~fDTK|8?qU&56FAx+M`3G~&>c3hYbY0! z$dK0s3H9;>>sspxiP9 z^@D?KY@RiR9k4ME4hN>W-Co#F&uf7egssxk!zN!8Hp{~mPb*wcVECEqZ?R0=T4FPY zXI3nG^;ov46Mf?3dBj*BV>rIEd15#^%h(W`;R0YR8uG-k^pFc^T+2DJIPMh;sFYL zxMk_|5JN-t3!eUb`iu^@!P-CFUho_5#mCRxc8Z6x3!45lNJhJU5d}Z!_uQ;;;cW3Q zu%hnm0Wacu;$N+1#1$-sTg$)B-n~Cq_vv=v9xJ4Bz^;WYbfW!fjW>ueTtidT*g(ir z!voWvMHuLLR<&ywz|u7O!Ny-LIj)bv0#hCO7B@mQO@S|;qkh3cuFvT0*n>_Cd{{gm7|3-Sx;V>% zE*Djp8V&62?t2(n5GIIKokk+{k|=4cRuhK%u=w|D5gmWF8)u#4 zZ&!8^RJ^vEow|;OI~MM|MGWH+10_~U5e8PeyD{7(?gA^bG`cb8_J}8zcYBcrIJxEu zd0=R-c|(pa=z#TfujM+^zlQ%Wj|6nuG~fwwzzc`nKXVxac}(w3IY-cKnOL7#Yc*T= z^!QUrTEzCX2t{m;sxH8)ibCoYN+#LBNn&Q7zSUB4KPU41g727Zw?Rc;AYA`xJYm44s0jC z2Uc)BH(X5~3ncfPb)KT-u{0b3VPI8WQSjU6q>N$&Quy(&RZPOOxM#Q#mI)rxUz5?QkJ^VjF_k@$Zdl3cCeYq#$0do&!eYFTsgTC%Dt+ z@P|+qLMMA!Zv#FV&azA8Qn@VP~7UCK2((RgF%oAhb`O)FFH?n&cwLh8XjjSe zyI07R#=vVvF4NLAI4GB9Fpy287O@phms?@!Ou^u^#Ww;rVO6)I_T(!UOe){v#`TG4 zxLn-@eq{OnL%VS_FUoFh8N<4&9e3EQ13Z75V5haQ&!3}iJ=gco;cBYpVj!ZWotV@g zEU!@K7Ids-5ZgI&xEPv$4Oi&!Ko*WmHHLf38-|{Mk)GoC^XG88X%7n|+pA{yM=6?qfsW}p;OD0A+(O~RT|hc5 z>b8*lv`hy=)ylUxYQ`}CbkU?x%zyJ%S%G#}s|yjkS%@X6sfRnkPmEzU`4Y=&2#Yy{ zLAZf9<@rzDR~!gfx;LUhB-6w$E_X95h+o5lyVObyQKQO8&dpBnBnX4L*R#YB9F2j6 znukF&liV;V5AI0akc9Db>)&L4zSW?0UvBo2=zg;RIEhCXM&zTz({%MMuCH;kWw?j* zZEYD{0cmn{ixguf35GN|e?Z`WzBeFUR?5TZ;o$aj4}Bbc3E6LCAXvibPcb6jV3_jd zjj%-FUSj;*EXHtEwsg^?vo0zOGHwvV4y<6;YxfWUu+_p7s6uql0xCvS5vz8d87(Vad&$F#~A?#BR4dRH-Mci$z0kx;Jt_Ql4lw_Yk8qAZG^r6t##sCsCUssu@ok4Z2z*V*P-O@?tZCl z2#Y$gAfKPy;t^~=p~$s>diZ2NpyzD}yu~t1Slgl~Ugjf;95=)EM~B1O_~?LTho9op z?Qx*X{?fXtmgL~dew5mo(}a!K&(A@@^QWYW{?l%9A0sEtrb(cCix`v%d|*MsQGQ2* z{^_5))FX^xq}ABTWe*8sH_<2cI^VIN*kVozPEaBM@>1b($fb087eibpISA%AK*vM7wDjJR?d$-_5PaD5GS8il)C@vY>V_h@}I-c93{9 z5WX)Q{~q?l5ZA;%w|Bmrm{t`80r0_g@w9L&7hmKHa*XEy&bjM0cFxk$QFZa{u~yd^ z0|u%zuf(C0aSIsLE$t5Y%{b8S*n@}jKZ8Zbgos*w~ z46ey`UUT}nT_o>pDyrM&BnW={Xzeh{YdE(APyakgon|>7moSy=y1D5Ac3+{kA81aZq>IqZ`mKn zly?}z*&ovw*b2TKRJn>N86WB)4H&K!uM{SDc`OE1xaMQVHRjO+hRbwmEQc90Ek^{my9Iu8t#yh1@mR}%Z>kuX7maBr{>U#pUPWn#R+zy_DQz!m1{ zwhJ-ZpH589#}A6l)9ui0%Oixo(vFIRjx%3Dw9LF4>o!NCHC0#z5t-|e6B{E5g*igw ztj2mIU##rx#z;$M%7;%#ZdaFYIY{(tU1Jc^&G<=(8Z%_2ZE4_=p0&*26S6n*ZmGIk z23DgDOB^5;?=IM7#33ldt!ZiyhWE|QH}$|ac(QA5!%Y@IjE_mazYi@?+98lbnVuTW zG5U5uF81AjXft-Z+4KO$K5E$-GGATB@eO`-gAbn1dxC*MtKICQS~A7KZq*n*p1E>) zlL*6(-|DNBstYkF@X|zeAFib}SY(#Q$mjI!0=aJAeGpx`+f5v@o%?kyw_CedVZn-a zZ!aHNR{h>eoIBmQAcIn6*Z#tCN%C9hPQLtbt(YW%ZJ+W2jpgL`_VI}ZC7q_ZVG=!9 z1*YGl*~d2muIRP3_7FsBNDTuVT0gAH&V>!$?BfA?D5V;s?kfyz*mCiEZWvyD)(?k9 zW5%vV%DR=;tuYYl_@*l;SCP+f0lQaRNIfDT#C(5=JH!eF?v>@k1{v1`1cB)mO#+ ze+z-4ZvABYND&%27GNO5)2g%&S%!xyPMwe#IFgSe4ma7rl)z-tKH!7R-}dNw&>&_> zuQ<~u9AsaQ4Fub>(}2czw+CZ!uhcdDb5OUYrwXag8Wnj(Cbo-ATjXW?dWkDdVe|7K zPw?cjPxv73G-DugA4bUML;X@ivoL`zCJQBW`p$XU>ojAyjdB)C^DZ_hvX=h}WasH` z>lu~^%Apxb7$2@JCt^YKd-R*AKNw`F@PG>e!_&CqIolvWjTn1=)=x7EL}m+^jn=7y zkNK{lB0Y>98?Cl(v8zr&y2DJNQhihpl52gR;YRY7K`pAj=E1U>7mDWNyEBq%N`aJ` zYmeHFp?R)<4##v9{~UOxr2*)vGAT~F5Hw2z_`jY&CgrNOzplc`H^4hh78`oA`oPf{ z!PeFFIO+aT!}Fm}qQvK{$dl*VOCN)yz*W^Bf<~ zg~Q%*5#kQj5m?)gaXdW`k3~G7t7Cl+n*VK@7`lIS0zt?e6Y<`7kre~VPhnPA(j{vQeGlmvmeP~&R3<92--s5S&9M$GcdIPu> zl}%sxTz3B&h7?2FfTVGaLDJF!3^H6zf{t~zT=D_Mi!#I_g;6MWAG};N2`KbEzgNJ* z-L8<{Jh3snpg1UZ9xuSSTF=K^%=Ns*<{fNG@eNloCM;e7c3oE^SG|Ai{VT>3HSE z!)3WWluE}$4W;lk&+TyVJUpDx-mfvrFnW{#W2&Zj@Nz#RK93jtJ?J25SGuVY8dvc% z+Q+w$@$)RR#xW7#6pTEYU>Q&IJg&SFKKsCQuOA5CzlS?w=3Rm=o?cSugxc@I0T==2 z^ZUrTdTu1fw{u}o1DD&)o+k*j7cb|w^xE={g4=my!()Q29K6pD^l3BSYHv**GiWz? zTba#!3*Dd}{~Vv7{VBM+n?c<&ar3p)JP$gcE-45E^^CI@#qr^_PCFk&U zWC+7W{#^4{oRB8ua?=jNji4r~wqUx%yJ-cUc}>CnchhduTiuuyBAUORPxqFS7_DS9 z+*)YDr@_F7A`XG)Xa#zuhHWK@u8_h&hr6_*M~^_Xs~%L@ZkMQ-F+R~yh|4PWExv*a!wN-4Y?L&K(RSD$k+XG; z1sBjdF=EiJYiym^+Fnb_XQ4+q>GBoYJQMrTF+n57CUtAKBhMDLMtH{a$U?(1w3H|| zw(-eK{fMU#MQLolJq8-S5W5d(?w7*Pij6?mfqCDQ>XkRcR9`UpQx$Wmqo+3AaoajNGPK?Ct0+OR6vj zzIZ^U^-}SZ;n$5>r`v(eTM5PoCqr&@YqP1BN5*|%FKs3EqlzFCA2v$97KCse*hq|{ z(bKF~KY}odp#?kD3jjfRRnKe|3HQY2_JIMvJH@XSRO++2wN$sO7=jn-jAEVQ1AA@S z$L~RH@L?On&Y{|j>z6BNq2qW}sE_Z@cME=tE3q4!dXw66n44d38GQZN+qQi^lbLN! zO7eLdsS>k^?Yu|e-h41@mfuFuZhO9yvgi69%cRvs7%yPYW701>_WmN_VbfZ>ZEd9N zur#-cYs&Wi$*?1jndi>GcS|?5EUHc(9~jxt?=9*G?gN6hsgFwZIG^t{o0o_mj414w zmcd#^eh$})Mna5PHIwzUW^{us@vR$HiF|Xam@`)l;Isdj&!XsXTZfcvWbUIc*N*a zWP$=F`DaTFw{>jNV^^c2i&7W1=x8Je%kRe%tb!i7fo;Y&xY?n^dZ;+hJooIWr}bke z%l)}shw|*n0w3954=>G8GdL>$#%RM)4>&U93x~cXvC~1Ayxi48)8aaQ1;ds!by0b1 z@4Rj;vd|-+!o0{Ghn*ejK6yT(6gAXuW6Y6fh5?W>9NwhW1VGn{qi;KSq}eKcHPl6K zj-?-hJ!p5TF9MspamH}KIT zYxnPsDHFsYgA1E}_d6)kY5C~-J&o<~t<7g-tuo(E{btHH*{aP2PboGoVoYsm1u)=V zelcqJ`n|)o(6@ZCG5`I*4sEXfwkXiyVE< z&$iZHaw{#tq8=uQflq3t&_}Hl?w4t(G04l%(Ca!dP>N?uo88jrz_hww@a4mEja|K; zk@#;n$wNr5^h5=Qku*clZ-${gy=QcZt8PZio7+Jc;C>%EmdRsDm^56T8=M2RqyED4 zedK}Xg+F}h(YMg^R@Jwc(Lm~#2f}o5A?ggZm~CFedFG!?w9`HrVK~{x~s25{`Pf0UPg)4^>{4E3+mGB_V^fpeXn4A7>nHC9_C)A z#{pT7Jn72Q*3w14Mb2WE<_llSo$T42(#^}w=y>E$!O$%X^nQo;jE_t{R2aA1)```; zMKtjHm5I^mRM;Nwp@2C=fb*5XCFwbPU@B)EW2442Va| zK=^cQ3}f@pf!SWGEfgy~2}lQCxx#b4vO9a{y%U$9*J-d!~ zY0UUE?3pSk-q~bNcaCRfCEBOY9f+xw=(2M?P)q^zZOdvhtk7z3p=H_QfDY((3Mhsw5xS_@ZjPB zgL&RKi$WOkfJwQwnb3WA>eo8MMD1t_aiWMivC=jmF<| z&QF*f$}aWJ?q36?HMOEAhz%=P{L#0u6Lpsk-#(lWn0JXG1ZQ0YHpl>NY$=pQgsmCc zqy#t&t&k?jYZQM9QSrnFcusE^|KT_5$5mMEGUUeF?d120jpW#p>ElFY#V#3qnK^*(!(^>ptQ+Ww_RZbk98Os@DjO|ujMGub7V>T^b zNciq`jTMjYEy0$$K&M3X5N92x;(cpAF8 zw1Lq-(#-~?Lt$9qa*f%;Y|;m!n*UA4v%8COO->9;T8`Q{$J3vTSv7{!*M@(sbk6}4 zCb^ARmnS=eO0dJ}VU9$BKs+#cGDhzPLqm64dm>pZWDse?VIU0f-(C{BnYkIAJgVD4 zhS$Wa)$Ut81+I7JDz};9a9h zFs8>_fum@OCA~P33-b%bQWvR-QJRWTx|CF=16MjTU^KUDvn0L=B=GYs^p4@<3HC2X z24ekbH;UA}NfVyTkHq#9Ert`=v{GxeZ8C1S_`TnYt~bN6R=azpfH`312`jsL$36~v zgNEdVS|{N`ygbYm>C@dDRfiS!3T(#7I|`8UvVM+wm!Yvdj?Eyjui!IabhUEOA~caL z8pGNQN2uOqA!f@dL5N(7jjhDR;y%0o> zF*L*u-vHc>I+><*K)ent(Uis_>=q z8tc-0Ujfd-mYy*OeJZG!69dOLsbISF4I(zdv>j_q#_Xvv=-wE3#TlM14%KlxzA*_K z$1&7&zN&`m8XpnaL`oSBU8Y}Vw&Gj`jMATQ<~riji^HX9!Dwj*`CSWz*;I3_Oa7^L z;MB*>pr%m%#@ZevHXp zoGXJ)k{(Ch3Lqf{>hL&lmWFzzQ>n*`ySe$-ATUhx7yjB+ZjeRAL;Kp9JjW2VAwo3X zdHPgid?W@VysuMvFeiyHx?pK|6x0pTSL`|q2&Fb*xPqL31!Q}sp*5UY2dmJ$=)B{O zdL2+&(gS@ikJ~ZL5ivfyu6(Q5Kw`BXCr9D)t&a(LS#i77b7U!bx1OXY*ZuP4(rIau z97X+BnRggYh6})BVJLzVs|-d3e2=deMQ`f&xCTnf0{(Amr#JsLw&`OatnKR6!vfG< zida8#SWrM+_c^8mKz@&I0@}1ii z00v>{NhS0!GJ2K|XCZ>dYo@hn>^{k06nfua2F{Q}dw`kNW)dQ|8w^krwr=qupqA|8 zvl+4AZ<*&uE3o;R?_5F<14q6+-RZx;KbbUz*u*ayqdDuk-*cSp?8@M(;jQ5eTMWH+ ztI`xQ#hg>Sn)NO!4$e)5En8_PYc*3{N&O(yz?hsRYn_l8Gy|mwXbcltnFNm9+0L-F za;HEVI4zmDm@9@D)NlC*GuIcSRAXTD&ULl;-nERix|~g{F=oiv8eWuDcy9~qLvw`! z3pr5;GdMYi8NH_cYgGH(4%7BJQNFwy2}FeuGV|k&eA}ka@@)+GbzU>t@q{tCj7L}a znkj5SH1qFW69ss6Th6dH=`r}%tPDr!C&|=w0xGR!*)Xgdoe+r8gTe!8QhJCnyw-`> zXoL?|mXn=9k`c}F+jF}Hf}O4 zK4MG>;Ix3C&f&3?tuUL)C;gcvxc0MRnn6Ym8Cw$GE3N+E>|W53w1psX-&~B=R)Rth zif??XmAU1k#F7UuHzI&yk zN%6$yu*?G;?s#9{5c5&>uTF7mDSGh>Dze;ieaG>a3=b{d2Zik$o6>LC0i(by8{Fig zoRHCdrGQJy%ZeCZ%`JRwC7%5JHo_OX?Ud!;!WXxYPVR!BZIiEzAj2U#F6(_{&@rkt=+Ly&a*b$G=Z}kYzRG_`Q zv^_@JeO7}h3EXLwYFm}p%Q6Av+3HRy<3z*;$#~;w?J(t+J*z(Lj4T(j6jW5P#+AA= zA?9CDpO7Vs?Ok^(gHTnBZi}kZn-5^!j%1QLb$CPaN~y&*79LZcA|8s_Y@h?C1SEwl z{aQW8Rj6Q=!e{ttYXo)9rQe%S=4{EM>-|+bdJ0?Jk2Rt&fL4#+fM~^;#M*RbjY~71 zESb~}cD1^{ndwVIfyA->M8(`(Rqg6=Zb2Gox)QJzYCEeu<{qWd;$q`4#=6yY`E#)! zv*l>w!CL=qBiLlBuWjs1+hdqi_3G!Crpc=^3*BSYMR{9B`|^;P?WV>EEJu6U0=8}W zX7P1<9Yf#mh7t`*vZHf%4ePhx7vRnLFqAP-tL|rTLsRn|s!n zmABLf@t%Fxr&(F*P%O<*DT>z}m#?2U7*{i=7X@5J?Qk{9U4@HRv!K}8w%u;gi^AAY zP7CV8%%*7!^zHqr&DPh>WVe{aA8OJN5B=)F$K5Tk(xby~GPLUpYjn%?bJk&kCxLuX z@r3CbMJ1Ksl60$|#Qk&)-X79@URVBTZJO=IP~KL4b3kCXY5D_vpN3995s!V2WxHXA zJk^37sS^5{A;bdd0p$1DJmV0fSW@$gdb0s|l-EiiZno;aFBL_%ykY=4jUr=2M-$#FLy$MjnAP=0F^V$cqIWgy?_7tWPaS!lfg4X-TEZouis=y zGuhf7vE7xYmuuH_f_sGl^5xNAw`;G(tK@*k4e5C5?WIFqzX59uymU&)dN5O@k1Rxv zQv&kj2ZWICsY7zB<}-^v-JVcmq78!-LA{)uzTV7D%WE=Z$0!e7@F>%bkIF9+W2gCXYvIP zla6WQ%d}6h@hMHB-hrCHFzi9noHgadq=_*Zs-FPr*qJ3ZciAXPgGnZ& zI1ImSw0?6aqlD=5C2?3FeG@z)#`PKG+knYvGq5Wi)e{-5o0z=s;37$CO%wA4T52HHs zFiQ9? z^GBa!vF`Wv^=P9%*l|MHt1OHA{(_YJ`p+-EvG*_X#>y#W^q?1rjL56D6!K#6V2`I8 z9)MC<8@S(yDfDB{I+NX`bgQVP>dA(ugp8kNm zWDRE8?{R;%dwt9l_btQUXJ>s-eoGw}5i3rc44dWRliA*4$IrmRT1tY)n zrz37tIO}9ycYDmy5SSq`w96gUTb`R@KQ3dXI!Cgmd8U0Pn5^nNm(Sfj-g*p|$TbB4 z|8F4kgQfQ_58rQ)bt2M{d~Drv_NO1_bTY1h7wF;#AM|$Ud3wXPa5$@dZfOD!51-6{l$P|FdTwLd9q7Ti z>2DG6DB0uDGwJ%KnnOlA+d~UYK2k?d)cgDmY^}V0^VoCw@K`-VT3L|8{9w;!DpH2N zr)NJCT28rhWNUh+&Zm}XhuK|n9Z%*kwCgHl%Sd(4ULIb43Pg}>!=w!M)Gaj^H$B7b zNDGEC$^$aw!+yTlq<{=MG03QYuLnqX+L@RG>JiKAg2;wvhVk`n|E;66e>pFZp%uLg zaP%B3`lWf(nXmagv{{rY^e_`he`cPO@%c42O$sfss*u4C4o9#&9FAUGZrJ*Bc|zp7 zUbgkf;g4J-NTDeo_o+T!kGQk!tbf9ge?j^xWJ&h263ln?4?S@+|WRhM?p; zzxQHNU(e^;`Niq7UtS{adq|aDtIv?C9q%WFjx=nEJ(xr3B(<6}bbrnKbBSM*M*0G|LxC73oUUpE4-o6n&o?OMN1scQ2)F#}EUZp7M< zw;T!K>Rs>8tBB80CaIlnhI5N+K=S4z$P*c`D*}ihGr`T!mJ%)z^r?Rl)*E>*4n&CI znc!U9P%4(Dl=<5d48MJ|f+mOJ5D=~&iBydqy5Y2RMaq6rJbI|V%jJ?_3-f07&+1Xr zL#+Jv^VBXnat@sNde&0U&(=`+4(2?_#IBQ+a}$nCgnwAl$i6Pexs*I}=DsnVGD*_# zh?L%J|Mqk2p+;W7@XLTTm;38N_y$9#jrr8}XC%q@fFLH145+S}iHF;L4HD-oMAd05 zXdaKVI1{8_So<0I06qIOy&2X}Jcq9xd5jRF8;i-5sc-Y~*(JRH;}_{xSATx-jlE9; zA5L;NG9J<39Jvl~6hi}(nP!8j640O5ZUrdn&a?0`Th|6Ns=W{BQ0#{j~m(4_I{+vNEZpr65Uou#@8Ad>F@||O*)G@;9 zeomCLiVKt{ind}aSr|cOEAy6b8_pV&>upE)FeO;a=hxoCysyU!Vcu$sFz@TNvKyBb zncT8F|I!b5<)T3l#L<1-k7ddF3sfd}gOe|nmJgd!EdS~B@!4rfpQvT9IYIe51nQ5H zYcESbc3b=fndWxp^O>W6XcT`sIyw5MY=txuWQdYM)nfW>nSiOUAu-x`r6VTIY`-m2 zu8Lq+`L91pTYfB;;4a(MpYxS+c$x_aBgkwZ{}q_^?8;f5_57GS#INWI(B@iJX|IGI zGUt@2o1dfq2>VlcclCMC70XmQbNv41qiTG8j`?^*5OuaMD|&CQXO^pX|Ky{+sK`>- z88iGHkLW3z_0`W)n29Zi-c$a(t1wY}p`lYClc3LR=IX~STV2-&`%uaV*h;sS^|5lT zIkU_cfiQl-LMD#hDK#BAn&4~YSaYp-ho_4+>2v2`;f(HnKzj&jLHNvJ(9W5h&{jYd zF)-UK(xbT1hiSJ=XgC%4AJ&AaN`odH&3v-!^{_t_U(-3Wf~@^BOQry6zZB0nCEqSD zy^o$-XP9+=OnuyY%%zVq^Zj9_X~?+W>Sfn6VgEgXv<^L?jo0R0`l`{kV$ku9YPo0P zEca*`5F@P;RLLhj9~ZvITH1OsD*k2}?VF_$91qx>uI9TXpNI3CyKL|8O9#>C*D;v% zh)VC^*VR`MeUdUw5@c&Xp98Gl?3kIHv9Rk?c90X{wCq6Fv*J;12|ym@R4y!nIKC!g zmSW2!8GODI+sa=zNSWQg$;VrRhqBr48UfrEDbP|+{{o#X^Fzz)3`j2{3wIQ)O^~;_ zw~Y~$GoYL?y&OHe{%-ja#5z;WRR@oQ^iDcg=!nIpXsArjJi;SiLJnI(mffF1&R4@n z$oXpc$dJtLJi?G(N_bah_gu`gD@_qV`oQ~U{TR^)_%WaBG@CEMlK!hzud1A4Ra#7f z%HtbpQ@OnfP6q&fT=mQ&ebVAHPUvsc_eicAX)S0O`wn%L%#B(rU1mhb)yn;*Szm&-!gW7)ofe60fZk z5X6{1@_y0Iyn3p&fe3$RzkV0XN*NTd2h#eVaj3oM_HjGEG`9? z8{B@r{Qk-7@YE0fpk&c^CnEj%nv5~*fdJz~hAVALo6@`nvxs zFjhBK0hH?#LFR}{%jpF5A0~o9eInfRrQ|a~HS>iAv{i{U{`~Co^*OEkxeki6xCzAW zSlwVLC9g13yO>cj$5ED@Sy3!rPX_DfbD9kOIb|BpXu0Urhx-2tgi*t*IHEsFR9$w! zDIXeue6-#Br*lS{k8iDrW&2u>?d+o^LvNxH76mL5ba^vbpUTsa1zYr!SgVrN+>E5u zY7UAO?QbA`5b~4s@D;eu&KbuV6yL6c5@tT<3WP zJkLCtQpAg%Hwn7fg{&EW<8KXk za`c%ZJpHh8OB#aA>iO-5B@4#SroY+se+(wW%=hOXzgd{H+AV8;?wORt`TEVKZ0f(D zlH~d~yL|rjn?2I@=hUk!r5qLgzWsMd3}(xnBu`6&ErLCNo;CBsrQ{ zO!_#7iYYeMpS$jZwDE1snH|6K+)KFZvOzqJ~ zGR#`fbJwlzMfz;X4c1;l=PxFG1EU$>4kLd2YcuKhtbXaP)`?Cu&Y( zwe|iZP&ATkOG{=_5D3zr`)83G>wVuJDT6^j594L(R)bK&W`@K%7x|nOj}0;+z|(B5 zhVUf~HCF$-KP;NXw{l*T1l=tg-+V$}*XQzMLVP^6X`9~XH-ttKHONT=rhUr z9Capu*H2RZ4ohMx{3Q8eQnnnI?L_v>{54DcWeN;k91ov*4i=Nt_NSu}O9OLEoeXK! zWO-t?bbq~ApGH4PRW6bTpOH*RP?1ZdRT?*w?o8F}1D@zVOl1`|wUi1=VB@_TGQPvI zA$iyhaWbo(v8jxcIvLHh1u^S&FkS@5K=FEiNR!oP_Cql}s{Tjcll6~0AEtqfQ0<6g zCUj$Ewp>l}z+{%E(IXi4Exnjop5}aX0m_>No&C)BWxzCcS<~_IQ$+CB-8$|(dOzr1RXp;u&}zyPs;?*4ka$L zRcj~_rhk&9Vb%{uvp_xuO*(<;7x-l5q=P}2V`WjZnWd|ixDXwnZo%A;>!8kmX(scyUa$Fw+Uu-b#6q)%*Muj z_mi~uwVG^srfK>z*X7Fwvz!!`C1+zdV~*ueIxp?VR5YK7_dG4IGRo^T&Bw?z9^z-9 zO>AMuiTpoi!rrg+}E$ zO}F8%*SO`km&I&|&a}xZG!|M~ru;SYMaJrjY1ihK4nF+js^R7$xHW6&0`hFK>C%BY zrn$#D{r$NF1h;HG#6lG;IYQ@MdACvOrRij%(CcEXXZ--T#DR+yZ!mPMeP$;m$RG-L z#OukQcP5H*OUMtQgAWk;T@0P9AY)SH!*2GMBEAm~gxs0^<^59J5pE{!CEfS+soca{YnMVa^3fE~)KbC`4ip>Q1s2IDv^kJu0WiC8QU})3@m7Fc&RP<8L4f4*7G)OEalr%gsv?xa~1FpyjfzpWZ)y^SzoZ zQ4@oCqv>fmBW+iZm!6kubF$sF9FeNWt-igNGz0bT$1Sy-v8_MvSgs-%qcwwk&EGyd z$}`y4I6qomrTqJ&*SeCaSIj+6cr<*R&|!I6f<-&=@W;Y)gPq)#8S!GuW&%8OuFYDJ z^QZI8bg%&(8ZYoXmVMluVQA!WEnwaszbLk{^z|aSwpq)Ub zNBEularFbPadGSbXLOP!`N>wSg)iNNOwl-0<3s_%`m-FbC4SN$|8X^D(^0J|E~kl? zTar(C-w;AoR*~TZ!OuH%uiG3JQs{cN{MB$gudbDOGK?{Q@OZ#&F2PW&XM(R^d~%;_ zeX@-MC+U1YY=1W_YbC?_ojY_%uOug6X4ds^BUTGHcjrs`Lqx9~n@*JWJw>LIy}v(s zPi~+}VabW9Ssgwv?Rgdd{yNX%pWR@=%kbApbxm+P4v*kc#O|NBi^JDXLU!0A{d7BM zzr7j0`k{-NrwBIr_*Y=w&S%b;@!V>VfP7WaRc$}65cbaCfKJ?R?j6NN2BuP!8l-ri zDYg;kGZvHdDVa1%?zChwKDXSK-5Ld;k?GLq@Y`R6;Aru;x}Cvp0-56^zZrLv@0JjJ z%r=+`rUqQw^uiqYr~hEAV-ReQ8P3@4?eW>}6C24rznHo%!@-HMAPWK95ASrI**k|3 zdcbQo&%i(X9>a1hBhlhY_ntPLLgKQAd%lE!mu*jXy7PeNn-P?F4ShoIk8#ts_Om%O zweBQQuQhW_298h4Xez*UvyxYZD+ywbxjWjt@o{7NqkPW5J$J<5<<@>CPVe)q2D8C< zob-Xn9f$k9xOcMmBz7nB$#2G8>x13#b1?O+=DOMOkKU!77;Llq?)jJ|J@4oESvoSW zmQ`wxcN0^B=Qe!S{qYLp8m+jGL7}g{@o9t#{U#~N&uYBE_i8|NYtMB0(+~agM@Bvz z%gK@N$a&1}(SBz0ad>zEde5O1v>Q;*@@AKJ#!(W&@;zxeYa9+CtBg9o`+5A?_;ofM zVq^0*(s~w$GA5>X@rrl5#ge=JIR=avAN}yP%E}a@sthd~5_Xq@9I(|K?=bV}s2p ziGD^|XIvs#Q>6uR)Og|e!>@{opfO?r})^^LenR<}@UZ26LTG@xC zQbm7W>1#g4nYT;smYp?A$$VQqq_I!-7P`o|DbnKl9BNrob>b!D5In)=?eQ=k+l9dh zx*9CORb{~@*j9W#ale$A3M}J1pFib7QuajcaA@7Gtr9i>^)-Sj?OnOn87XQWLLn4nA7CBL;2F-%%Dm5NIb^7V1C2Qg>f1b!@ z&U|(sd}bLQ`Mj^FJlu;MQZ(#VYTI=doUc7k)h12+7TbP)Yo2^ z4jQ9~jZ{|wAU03#%Rzr14~OMAGMh5Ct$i#}av$IIQ_ZO%yPfz^(}3uCf41Z^^)*fxG6`bz~O{+1h)$!2pkc8SntVF`se4J5ec5qe%zZIOVar_AvHXq5~=6& z9uLb3y9~<5nlU*|DqAu2v&X|IpOnw4_sQ@;k!`0|785-hWb$x>RQUt8d2Gq$Y@awE z4ANBHRCfGdjGJgVZuhl_HbjYzVMsNH?4YELyv3hUf ziCAqR{k+1bl`uOE>waRY`JU18wenjkPTM6~zWV+cB?Yy7zW4EM)`qp~%6yLfeAD0; zm@TXHXU}!?#uxzELxKH%2it!TAi);Y`>W@sC$02MedQrQM+kkaBU|1`L$CcxkPwhER?cUTr(m2u zq(&t$mF3(;BqrLR_x(8^tO=bH%K#`}msJiHzb*AX>xIC^SmLS`_jeWyq-`@UtCjSx zMdVXNgzHkAfmyX3`V)!9GDQBCnPC!eca=t%AdR?Byq+V>Sl(fcMAR@xoXpSX9N;FfXr%#H`(ws)<<{104CH*EDu z;ILfDi=CGz>T|E!ycx_MH^O@dT53Z4M^ayGK2t7(wIs%vKiNfHwDpHwJy}&)Aa%6z zWG!(171ivVN!y`#F1Mu7IN`{&<=j+2K1o~i#MBe)uZaAiG*s^rt_-d|emZ{_Hzr7D zp6fcX_er(F8i7ThGbLzJtuRi|g{3>gh?5DY*+Xanj2Uz0Dd%rOPU%qUqN>=v=Zc|i z+LXjRAxQzzl~>9IZW$D8kcqIWDzFacPevvd+f3)HCIp=Uufax11Ud`TxK=j4exktX2Iu3?7{^Sq zmgd8TMJcQPG;EA9&)3^2K3JUNJ|V@d*Wq*3>UwDNN$13x9lPWVRC((eY$u`nq;VgD zsw$@j86$mNMS1o5e17kAOV+&4h@4=G*ef~K^keRFUhJf&VqkL`_7;{vtBlLx*1_#H z$Q5j#m7cX6yLgQlgO{(H-O^cHI4@!9B}*z%f%Ep1!&Hd`+n>1gl>=D|61L<};M5heLjXZG{yxd#KL}ROwQl>}B0d zhE@IQck(iVr?p>-A&1KTkns2h%A(b?CGST$Q>>KrQCbb-qPD>;S8420+gC@dgN-x! zj0lRFThd+O{(jEY{2Dv3GM*6jXWa?5nw&5)o2VuD*LvunD!1R%3wC{I%RT|D#d2yA zGvJsq|2V<9vy)1J1@*ZcouvE`jJ$zoDX zbKH>Vj&swo!p_pr!K9y@BUq~vkZz#a^HVf$K9h&tR~Ab4D9e-Li3zm5=7%K=l5~yi zLW{9)dk*Ov+jl?UkkMb&V4l1tbQv$64E4VIFoV`JZjx4xvs1&dWvSWk%EYy5$yddP zyWz$>&0w7mH}E-Qk(paEAbMVU(fFj9loAvUi-yj!v&m$5@0J~bwP%JOKM58UlVPEm zd;hlPB()K&%X-7|Gs{vCbMAr|H6Ip39qwme7m8A48ON>^JxZHipqsX*C5?&tO{|sO z3YcW~9xn&enO_f++g-IB*jtrCX4=9D*WXvM#| zbUp;mSWB3G^vVp(8Y^8@j{YbUy8@_LW#uYKC37?0t~yVHI#A8m46f9OC{(*0{T$r2 z$~zfbt|i4E>@(AuWDM@Q#h;S-fZO$fEF|WeK^BSpUtM>Xq8dy%F`uu;ks6>PFUp1~ zu*n)fm{YAiKl%Qg#s4x)dZh|HbT2%=zsV~nW1rL=1=izOLC&&BH)Kb5JV_~WuW}~` z>!Lbk+k4eD`1WkYf)29<9zH*0JzO1rvOGo$aX|`JG&vXPgs|7JCkZ!ls2n*##&CuX zz-n3uZmRGi$!N4}1|tZ4teCxWc{y?4Z4+GU38o+syByhM=0;z~1ZDVV8KG&}(}~t+ zXqY(>b6AECu9;;Q0 z?SsKmRLS>4KR(YK+R%N(o#hp3V2_V%!ctWFMd%3U5j>~MuFzk3KUuWew9nsAnCT# z4MVzTe}vp6Bb$o%Jfr{#TBYn56-9CRxhmx_N$>Oih+B>C9O`}QCyHs?`|d~EaC%XIqdnhJ($Kt>)Wkh^25V~I;JG!~wz~4j|262ucXtFM zxnwPYy^Tl>EFZ$t%W5R&$%2*aqI7$6p-W<*19DPEK*!iX)lcrfT}2e1Z``cV&zXpKDvCW7uH&PvY92}9G%wMW1(Y77P3)R4C#-G$Dm0M zs8hd)#ysxcnl~eI9vf!zHOiCi(Z`;AjSQq;^~u+GS!U5KS9y|?Cbbq@jwdA;K$Y*L zi&?FI?}$+|-#H-ZO?GBqKjWl>`K2i0ao5T#IP<&62vkNKfHz<^-6SvOo%$8&7s zIi$=3G(GlNU)chEIDSossSq$9^aXOuk~5dI z?%$-7#*+lDDp*W~U3S#Q!BC_O9aq(pvG+b;d8M8u%bNl#y+UHVXmgvgX@QG@h(44@ zn?Wy(99|Ya^pT_=P!8`nvV_ys3HQO%a6S#!%lN>fI}Bp~a$B%;jLC!f4YQo@VLtqh zqsh12^4L`BtBQKIcGjbbvcTN&*E{wZYAaRM8|iSgOC&YWRX4^o^%jO{B&_a+&$JQ#4kWeZ zuX}yOM7p<4w@hv%R`HpN%%IQEvF8%OD(fA=Y8M){RDn|ZVRYw`CI~G2WY5>9hq|l#?cXH=v*db5) zh8%$CIdf`O6U?l8e_6yd(lAS-t!G3fdr5`+x}%$@T_)SVia6ruwI+={T``V9UI$({ znnL?E*j9S)-G0CX6N_8quiU+ylt}WMg@Nk=sk)mEpHdU-eU>OTe6R8n^K|Ao5PvMPo z^c?eEDVF59vwn{bD<{*OFbNbaYPZ(P&p|HH=y(nE`~7oI(Fd)23U4riVKieyVjt1C)Fds|%XW3j;O@We*SeL#CSW?CSj;({lvW;RSL^jz^sn0edZ4o4qrB-w2y z_nZDXSEL~Ac9r5Ps%JioQDXA&m{Ze-j)mufRat;^WNWFJ+AvuhO03NlX_z?5r+BDZ z-rLSZY;6}+*?dRXshG`GfIboDcp{l@cI_n^nxZo6$`Dc~mId)!IVv>$qeW zJ(5hw)WwcVD4pi3n_d8};)N^rcyz1SwnZ7&835?FH|708d9*4WX;UF@@&!ra$9u6@ zjZQ1TV%*EaV@|i}s!vDp#Kb7?eALepcDsv6J#{AJ@poJo3sS#!jLBE4E4H;ho&j$U zZZj%T9e`e!3yP((o3K`0+H5lxS3fu9{3ESeH2dUUrdL{50RH#qG{a!M6*ZdbKKp4-=XhpYTR{O=Yy- z(f#wE|N6&2Bwk+@80A9^IC1PnAK?2z==~7EjI&Qmo-w~X?N_OlSg?TIBxjIyMTw62 zm{nhNvAU~wl@syu<-hHQ>pC7xSQ*iMo*XxyatGF*g zrR`2jKP7*??6qnS91h)Au|_mz%fsM&G^$@RdXZNQW1la_j{%L(&M#{hIAtE!akV^8 ze%PStr+J1g?}rrjwR=mWLroNJT70LU$6sYfXr6P!=JH}+7}V0o&w+7P{l5TDjWOp@ z;R*J$9ybZc#j_ur!1T=rjBOB{_B(<8qT%H+F44ARj|kd>vmJx^6aUuxa{|ynIO*(Rd$&$gOrOqPxv_ z7OB}AtI;hec7g8fnM+=Dp)QJ9%NPhP;5WgTj`(_VQ#;_5Kx)#Q(41HT?9fpaQ`Iz1 zz+$5npH$j*hEo=7m%{%A(zkONSOY>g zF4J~2x5EG|Br)8)x*abvUBgfczwF; zZ9TvDv}068D3Vv~jS3})tIxSTx(vrRGrr3dL2k!dT(OBk^Uhe#wmJ(TST=iN-9{yb zI+P4$_E^rgbA_uI<*`PF!=`f1-`Lel5X)9st#S~iw+Q`LTS`G8(<@(85MGe^F6&Em z6@C;phepg-?)vj{;EBef1W#fE{Jo#i#t68g8AJGN1R5I;TrN7nu1`Ph#fWb^NOP3dq;(_BMOK<|$rSnWCc%(yz4ZTil_`)|APb z?E01&_^og^K*rT z>_0i=H})EGUHxxE2EmQf&S=zO=^U))5e%T=mWifzGeQm{9cWHpA|)qrpA|5-@Ah` zd&Y{xD|t_r;pviNEcL+`z@@Q37|9W*C)n21n2gGHF$SDXjZbl{^#|jV<2JUIsc$l8 zxz>d#_DrRdnu*)-rS<-NtCW)-ALI*JvpH;fgUT?y1khl^H9IZ5Ls)aPEU{ZW-H&b|+Z8YKb_94+YP^S9&hd6I zHQ98#!#53Kbh|vEs=NuYj%fSY-ln2*-{Zre^!oX^ZD4YymdS$H$IwvZmUd&*G;7^M zhMW_VS7VfwFZtANc8)Q5Z;pr`9ZuTlsz)QfqUpvz%xj46zkT3?Y z?cCwG29KdWLQ=0DSi3kFQQliX?T~g2 zX)~OCc%d#|mW9#!m)Xu76;_7rKlDCtwUo4P%c4-9jG)L0T*1l=3w@md@Rk}PyW86h z-J%Uar*(yMsjTYB;xYZHe-1*f`2x*ZJMBg_yZpfV-Vw*arB5?P-YsnS4WBPJ%SVN0 z)n}X0A=eT=PN+HPq*IUDF;e|{$c4^m!sx=McH`Xc%Ymujy+L#~Fw0}=(No>-$Siwl zz;`Q}BipAsB4g%hZbeI~zl1z%%T8g;*Z5D{tro3M6@&8a)oHwRngqZC%a%`9b>JoPixDIrE-yu)C~SYw=PQloE2WIwoVQcoFkM@!Uh%=gNgBF*wG5Ky8Dt{V z{3eLsNs(STWt4@p)%ukXgoCf!2{f1zI7^ZET7=)p-5~<^VCya zi{oxwVigsd--*i}aV zZONq1PL#lu72m0F-q{mmk|}S)r3l;&6XE0GV2zR$E=J$W=#rOp`NVVrT}$@M{%YC5;Zw)~@!&r;H^?pLK{xj8Ha z>1Bnb-F&C&U{yhX3SOI0S9(Kv$yn|9X<5YZnG*!;A#0XW(x1sgDoy`2qrOjx=W}IV bSgLlO1aLoF^Ur_&^S}LHT83|9s^b6v=@#1h literal 0 HcmV?d00001 diff --git a/x-pack/plugin/vector-tile/src/test/resources/org/elasticsearch/xpack/vectortile/feature/LICENSE.txt b/x-pack/plugin/vector-tile/src/test/resources/org/elasticsearch/xpack/vectortile/feature/LICENSE.txt new file mode 100644 index 0000000000000..43c8963d276d6 --- /dev/null +++ b/x-pack/plugin/vector-tile/src/test/resources/org/elasticsearch/xpack/vectortile/feature/LICENSE.txt @@ -0,0 +1,540 @@ +## ODC Open Database License (ODbL) + +### Preamble + +The Open Database License (ODbL) is a license agreement intended to +allow users to freely share, modify, and use this Database while +maintaining this same freedom for others. Many databases are covered by +copyright, and therefore this document licenses these rights. Some +jurisdictions, mainly in the European Union, have specific rights that +cover databases, and so the ODbL addresses these rights, too. Finally, +the ODbL is also an agreement in contract for users of this Database to +act in certain ways in return for accessing this Database. + +Databases can contain a wide variety of types of content (images, +audiovisual material, and sounds all in the same database, for example), +and so the ODbL only governs the rights over the Database, and not the +contents of the Database individually. Licensors should use the ODbL +together with another license for the contents, if the contents have a +single set of rights that uniformly covers all of the contents. If the +contents have multiple sets of different rights, Licensors should +describe what rights govern what contents together in the individual +record or in some other way that clarifies what rights apply. + +Sometimes the contents of a database, or the database itself, can be +covered by other rights not addressed here (such as private contracts, +trade mark over the name, or privacy rights / data protection rights +over information in the contents), and so you are advised that you may +have to consult other documents or clear other rights before doing +activities not covered by this License. + +------ + +The Licensor (as defined below) + +and + +You (as defined below) + +agree as follows: + +### 1.0 Definitions of Capitalised Words + +"Collective Database" - Means this Database in unmodified form as part +of a collection of independent databases in themselves that together are +assembled into a collective whole. A work that constitutes a Collective +Database will not be considered a Derivative Database. + +"Convey" - As a verb, means Using the Database, a Derivative Database, +or the Database as part of a Collective Database in any way that enables +a Person to make or receive copies of the Database or a Derivative +Database. Conveying does not include interaction with a user through a +computer network, or creating and Using a Produced Work, where no +transfer of a copy of the Database or a Derivative Database occurs. +"Contents" - The contents of this Database, which includes the +information, independent works, or other material collected into the +Database. For example, the contents of the Database could be factual +data or works such as images, audiovisual material, text, or sounds. + +"Database" - A collection of material (the Contents) arranged in a +systematic or methodical way and individually accessible by electronic +or other means offered under the terms of this License. + +"Database Directive" - Means Directive 96/9/EC of the European +Parliament and of the Council of 11 March 1996 on the legal protection +of databases, as amended or succeeded. + +"Database Right" - Means rights resulting from the Chapter III ("sui +generis") rights in the Database Directive (as amended and as transposed +by member states), which includes the Extraction and Re-utilisation of +the whole or a Substantial part of the Contents, as well as any similar +rights available in the relevant jurisdiction under Section 10.4. + +"Derivative Database" - Means a database based upon the Database, and +includes any translation, adaptation, arrangement, modification, or any +other alteration of the Database or of a Substantial part of the +Contents. This includes, but is not limited to, Extracting or +Re-utilising the whole or a Substantial part of the Contents in a new +Database. + +"Extraction" - Means the permanent or temporary transfer of all or a +Substantial part of the Contents to another medium by any means or in +any form. + +"License" - Means this license agreement and is both a license of rights +such as copyright and Database Rights and an agreement in contract. + +"Licensor" - Means the Person that offers the Database under the terms +of this License. + +"Person" - Means a natural or legal person or a body of persons +corporate or incorporate. + +"Produced Work" - a work (such as an image, audiovisual material, text, +or sounds) resulting from using the whole or a Substantial part of the +Contents (via a search or other query) from this Database, a Derivative +Database, or this Database as part of a Collective Database. + +"Publicly" - means to Persons other than You or under Your control by +either more than 50% ownership or by the power to direct their +activities (such as contracting with an independent consultant). + +"Re-utilisation" - means any form of making available to the public all +or a Substantial part of the Contents by the distribution of copies, by +renting, by online or other forms of transmission. + +"Substantial" - Means substantial in terms of quantity or quality or a +combination of both. The repeated and systematic Extraction or +Re-utilisation of insubstantial parts of the Contents may amount to the +Extraction or Re-utilisation of a Substantial part of the Contents. + +"Use" - As a verb, means doing any act that is restricted by copyright +or Database Rights whether in the original medium or any other; and +includes without limitation distributing, copying, publicly performing, +publicly displaying, and preparing derivative works of the Database, as +well as modifying the Database as may be technically necessary to use it +in a different mode or format. + +"You" - Means a Person exercising rights under this License who has not +previously violated the terms of this License with respect to the +Database, or who has received express permission from the Licensor to +exercise rights under this License despite a previous violation. + +Words in the singular include the plural and vice versa. + +### 2.0 What this License covers + +2.1. Legal effect of this document. This License is: + + a. A license of applicable copyright and neighbouring rights; + + b. A license of the Database Right; and + + c. An agreement in contract between You and the Licensor. + +2.2 Legal rights covered. This License covers the legal rights in the +Database, including: + + a. Copyright. Any copyright or neighbouring rights in the Database. + The copyright licensed includes any individual elements of the + Database, but does not cover the copyright over the Contents + independent of this Database. See Section 2.4 for details. Copyright + law varies between jurisdictions, but is likely to cover: the Database + model or schema, which is the structure, arrangement, and organisation + of the Database, and can also include the Database tables and table + indexes; the data entry and output sheets; and the Field names of + Contents stored in the Database; + + b. Database Rights. Database Rights only extend to the Extraction and + Re-utilisation of the whole or a Substantial part of the Contents. + Database Rights can apply even when there is no copyright over the + Database. Database Rights can also apply when the Contents are removed + from the Database and are selected and arranged in a way that would + not infringe any applicable copyright; and + + c. Contract. This is an agreement between You and the Licensor for + access to the Database. In return you agree to certain conditions of + use on this access as outlined in this License. + +2.3 Rights not covered. + + a. This License does not apply to computer programs used in the making + or operation of the Database; + + b. This License does not cover any patents over the Contents or the + Database; and + + c. This License does not cover any trademarks associated with the + Database. + +2.4 Relationship to Contents in the Database. The individual items of +the Contents contained in this Database may be covered by other rights, +including copyright, patent, data protection, privacy, or personality +rights, and this License does not cover any rights (other than Database +Rights or in contract) in individual Contents contained in the Database. +For example, if used on a Database of images (the Contents), this +License would not apply to copyright over individual images, which could +have their own separate licenses, or one single license covering all of +the rights over the images. + +### 3.0 Rights granted + +3.1 Subject to the terms and conditions of this License, the Licensor +grants to You a worldwide, royalty-free, non-exclusive, terminable (but +only under Section 9) license to Use the Database for the duration of +any applicable copyright and Database Rights. These rights explicitly +include commercial use, and do not exclude any field of endeavour. To +the extent possible in the relevant jurisdiction, these rights may be +exercised in all media and formats whether now known or created in the +future. + +The rights granted cover, for example: + + a. Extraction and Re-utilisation of the whole or a Substantial part of + the Contents; + + b. Creation of Derivative Databases; + + c. Creation of Collective Databases; + + d. Creation of temporary or permanent reproductions by any means and + in any form, in whole or in part, including of any Derivative + Databases or as a part of Collective Databases; and + + e. Distribution, communication, display, lending, making available, or + performance to the public by any means and in any form, in whole or in + part, including of any Derivative Database or as a part of Collective + Databases. + +3.2 Compulsory license schemes. For the avoidance of doubt: + + a. Non-waivable compulsory license schemes. In those jurisdictions in + which the right to collect royalties through any statutory or + compulsory licensing scheme cannot be waived, the Licensor reserves + the exclusive right to collect such royalties for any exercise by You + of the rights granted under this License; + + b. Waivable compulsory license schemes. In those jurisdictions in + which the right to collect royalties through any statutory or + compulsory licensing scheme can be waived, the Licensor waives the + exclusive right to collect such royalties for any exercise by You of + the rights granted under this License; and, + + c. Voluntary license schemes. The Licensor waives the right to collect + royalties, whether individually or, in the event that the Licensor is + a member of a collecting society that administers voluntary licensing + schemes, via that society, from any exercise by You of the rights + granted under this License. + +3.3 The right to release the Database under different terms, or to stop +distributing or making available the Database, is reserved. Note that +this Database may be multiple-licensed, and so You may have the choice +of using alternative licenses for this Database. Subject to Section +10.4, all other rights not expressly granted by Licensor are reserved. + +### 4.0 Conditions of Use + +4.1 The rights granted in Section 3 above are expressly made subject to +Your complying with the following conditions of use. These are important +conditions of this License, and if You fail to follow them, You will be +in material breach of its terms. + +4.2 Notices. If You Publicly Convey this Database, any Derivative +Database, or the Database as part of a Collective Database, then You +must: + + a. Do so only under the terms of this License or another license + permitted under Section 4.4; + + b. Include a copy of this License (or, as applicable, a license + permitted under Section 4.4) or its Uniform Resource Identifier (URI) + with the Database or Derivative Database, including both in the + Database or Derivative Database and in any relevant documentation; and + + c. Keep intact any copyright or Database Right notices and notices + that refer to this License. + + d. If it is not possible to put the required notices in a particular + file due to its structure, then You must include the notices in a + location (such as a relevant directory) where users would be likely to + look for it. + +4.3 Notice for using output (Contents). Creating and Using a Produced +Work does not require the notice in Section 4.2. However, if you +Publicly Use a Produced Work, You must include a notice associated with +the Produced Work reasonably calculated to make any Person that uses, +views, accesses, interacts with, or is otherwise exposed to the Produced +Work aware that Content was obtained from the Database, Derivative +Database, or the Database as part of a Collective Database, and that it +is available under this License. + + a. Example notice. The following text will satisfy notice under + Section 4.3: + + Contains information from DATABASE NAME, which is made available + here under the Open Database License (ODbL). + +DATABASE NAME should be replaced with the name of the Database and a +hyperlink to the URI of the Database. "Open Database License" should +contain a hyperlink to the URI of the text of this License. If +hyperlinks are not possible, You should include the plain text of the +required URI's with the above notice. + +4.4 Share alike. + + a. Any Derivative Database that You Publicly Use must be only under + the terms of: + + i. This License; + + ii. A later version of this License similar in spirit to this + License; or + + iii. A compatible license. + + If You license the Derivative Database under one of the licenses + mentioned in (iii), You must comply with the terms of that license. + + b. For the avoidance of doubt, Extraction or Re-utilisation of the + whole or a Substantial part of the Contents into a new database is a + Derivative Database and must comply with Section 4.4. + + c. Derivative Databases and Produced Works. A Derivative Database is + Publicly Used and so must comply with Section 4.4. if a Produced Work + created from the Derivative Database is Publicly Used. + + d. Share Alike and additional Contents. For the avoidance of doubt, + You must not add Contents to Derivative Databases under Section 4.4 a + that are incompatible with the rights granted under this License. + + e. Compatible licenses. Licensors may authorise a proxy to determine + compatible licenses under Section 4.4 a iii. If they do so, the + authorised proxy's public statement of acceptance of a compatible + license grants You permission to use the compatible license. + + +4.5 Limits of Share Alike. The requirements of Section 4.4 do not apply +in the following: + + a. For the avoidance of doubt, You are not required to license + Collective Databases under this License if You incorporate this + Database or a Derivative Database in the collection, but this License + still applies to this Database or a Derivative Database as a part of + the Collective Database; + + b. Using this Database, a Derivative Database, or this Database as + part of a Collective Database to create a Produced Work does not + create a Derivative Database for purposes of Section 4.4; and + + c. Use of a Derivative Database internally within an organisation is + not to the public and therefore does not fall under the requirements + of Section 4.4. + +4.6 Access to Derivative Databases. If You Publicly Use a Derivative +Database or a Produced Work from a Derivative Database, You must also +offer to recipients of the Derivative Database or Produced Work a copy +in a machine readable form of: + + a. The entire Derivative Database; or + + b. A file containing all of the alterations made to the Database or + the method of making the alterations to the Database (such as an + algorithm), including any additional Contents, that make up all the + differences between the Database and the Derivative Database. + +The Derivative Database (under a.) or alteration file (under b.) must be +available at no more than a reasonable production cost for physical +distributions and free of charge if distributed over the internet. + +4.7 Technological measures and additional terms + + a. This License does not allow You to impose (except subject to + Section 4.7 b.) any terms or any technological measures on the + Database, a Derivative Database, or the whole or a Substantial part of + the Contents that alter or restrict the terms of this License, or any + rights granted under it, or have the effect or intent of restricting + the ability of any person to exercise those rights. + + b. Parallel distribution. You may impose terms or technological + measures on the Database, a Derivative Database, or the whole or a + Substantial part of the Contents (a "Restricted Database") in + contravention of Section 4.74 a. only if You also make a copy of the + Database or a Derivative Database available to the recipient of the + Restricted Database: + + i. That is available without additional fee; + + ii. That is available in a medium that does not alter or restrict + the terms of this License, or any rights granted under it, or have + the effect or intent of restricting the ability of any person to + exercise those rights (an "Unrestricted Database"); and + + iii. The Unrestricted Database is at least as accessible to the + recipient as a practical matter as the Restricted Database. + + c. For the avoidance of doubt, You may place this Database or a + Derivative Database in an authenticated environment, behind a + password, or within a similar access control scheme provided that You + do not alter or restrict the terms of this License or any rights + granted under it or have the effect or intent of restricting the + ability of any person to exercise those rights. + +4.8 Licensing of others. You may not sublicense the Database. Each time +You communicate the Database, the whole or Substantial part of the +Contents, or any Derivative Database to anyone else in any way, the +Licensor offers to the recipient a license to the Database on the same +terms and conditions as this License. You are not responsible for +enforcing compliance by third parties with this License, but You may +enforce any rights that You have over a Derivative Database. You are +solely responsible for any modifications of a Derivative Database made +by You or another Person at Your direction. You may not impose any +further restrictions on the exercise of the rights granted or affirmed +under this License. + +### 5.0 Moral rights + +5.1 Moral rights. This section covers moral rights, including any rights +to be identified as the author of the Database or to object to treatment +that would otherwise prejudice the author's honour and reputation, or +any other derogatory treatment: + + a. For jurisdictions allowing waiver of moral rights, Licensor waives + all moral rights that Licensor may have in the Database to the fullest + extent possible by the law of the relevant jurisdiction under Section + 10.4; + + b. If waiver of moral rights under Section 5.1 a in the relevant + jurisdiction is not possible, Licensor agrees not to assert any moral + rights over the Database and waives all claims in moral rights to the + fullest extent possible by the law of the relevant jurisdiction under + Section 10.4; and + + c. For jurisdictions not allowing waiver or an agreement not to assert + moral rights under Section 5.1 a and b, the author may retain their + moral rights over certain aspects of the Database. + +Please note that some jurisdictions do not allow for the waiver of moral +rights, and so moral rights may still subsist over the Database in some +jurisdictions. + +### 6.0 Fair dealing, Database exceptions, and other rights not affected + +6.1 This License does not affect any rights that You or anyone else may +independently have under any applicable law to make any use of this +Database, including without limitation: + + a. Exceptions to the Database Right including: Extraction of Contents + from non-electronic Databases for private purposes, Extraction for + purposes of illustration for teaching or scientific research, and + Extraction or Re-utilisation for public security or an administrative + or judicial procedure. + + b. Fair dealing, fair use, or any other legally recognised limitation + or exception to infringement of copyright or other applicable laws. + +6.2 This License does not affect any rights of lawful users to Extract +and Re-utilise insubstantial parts of the Contents, evaluated +quantitatively or qualitatively, for any purposes whatsoever, including +creating a Derivative Database (subject to other rights over the +Contents, see Section 2.4). The repeated and systematic Extraction or +Re-utilisation of insubstantial parts of the Contents may however amount +to the Extraction or Re-utilisation of a Substantial part of the +Contents. + +### 7.0 Warranties and Disclaimer + +7.1 The Database is licensed by the Licensor "as is" and without any +warranty of any kind, either express, implied, or arising by statute, +custom, course of dealing, or trade usage. Licensor specifically +disclaims any and all implied warranties or conditions of title, +non-infringement, accuracy or completeness, the presence or absence of +errors, fitness for a particular purpose, merchantability, or otherwise. +Some jurisdictions do not allow the exclusion of implied warranties, so +this exclusion may not apply to You. + +### 8.0 Limitation of liability + +8.1 Subject to any liability that may not be excluded or limited by law, +the Licensor is not liable for, and expressly excludes, all liability +for loss or damage however and whenever caused to anyone by any use +under this License, whether by You or by anyone else, and whether caused +by any fault on the part of the Licensor or not. This exclusion of +liability includes, but is not limited to, any special, incidental, +consequential, punitive, or exemplary damages such as loss of revenue, +data, anticipated profits, and lost business. This exclusion applies +even if the Licensor has been advised of the possibility of such +damages. + +8.2 If liability may not be excluded by law, it is limited to actual and +direct financial loss to the extent it is caused by proved negligence on +the part of the Licensor. + +### 9.0 Termination of Your rights under this License + +9.1 Any breach by You of the terms and conditions of this License +automatically terminates this License with immediate effect and without +notice to You. For the avoidance of doubt, Persons who have received the +Database, the whole or a Substantial part of the Contents, Derivative +Databases, or the Database as part of a Collective Database from You +under this License will not have their licenses terminated provided +their use is in full compliance with this License or a license granted +under Section 4.8 of this License. Sections 1, 2, 7, 8, 9 and 10 will +survive any termination of this License. + +9.2 If You are not in breach of the terms of this License, the Licensor +will not terminate Your rights under it. + +9.3 Unless terminated under Section 9.1, this License is granted to You +for the duration of applicable rights in the Database. + +9.4 Reinstatement of rights. If you cease any breach of the terms and +conditions of this License, then your full rights under this License +will be reinstated: + + a. Provisionally and subject to permanent termination until the 60th + day after cessation of breach; + + b. Permanently on the 60th day after cessation of breach unless + otherwise reasonably notified by the Licensor; or + + c. Permanently if reasonably notified by the Licensor of the + violation, this is the first time You have received notice of + violation of this License from the Licensor, and You cure the + violation prior to 30 days after your receipt of the notice. + +Persons subject to permanent termination of rights are not eligible to +be a recipient and receive a license under Section 4.8. + +9.5 Notwithstanding the above, Licensor reserves the right to release +the Database under different license terms or to stop distributing or +making available the Database. Releasing the Database under different +license terms or stopping the distribution of the Database will not +withdraw this License (or any other license that has been, or is +required to be, granted under the terms of this License), and this +License will continue in full force and effect unless terminated as +stated above. + +### 10.0 General + +10.1 If any provision of this License is held to be invalid or +unenforceable, that must not affect the validity or enforceability of +the remainder of the terms and conditions of this License and each +remaining provision of this License shall be valid and enforced to the +fullest extent permitted by law. + +10.2 This License is the entire agreement between the parties with +respect to the rights granted here over the Database. It replaces any +earlier understandings, agreements or representations with respect to +the Database. + +10.3 If You are in breach of the terms of this License, You will not be +entitled to rely on the terms of this License or to complain of any +breach by the Licensor. + +10.4 Choice of law. This License takes effect in and will be governed by +the laws of the relevant jurisdiction in which the License terms are +sought to be enforced. If the standard suite of rights granted under +applicable copyright law and Database Rights in the relevant +jurisdiction includes additional rights not granted under this License, +these additional rights are granted in this License in order to meet the +terms of this License. diff --git a/x-pack/plugin/vector-tile/src/test/resources/org/elasticsearch/xpack/vectortile/feature/NOTICE.txt b/x-pack/plugin/vector-tile/src/test/resources/org/elasticsearch/xpack/vectortile/feature/NOTICE.txt new file mode 100644 index 0000000000000..33be0fd0e724b --- /dev/null +++ b/x-pack/plugin/vector-tile/src/test/resources/org/elasticsearch/xpack/vectortile/feature/NOTICE.txt @@ -0,0 +1,2 @@ +The Antarctica.wkt.gz and France.wkt.gz files come from the OpenStreetMap project (© OpenStreetMap contributors), +which is made available here under the Open Database License (ODbL). From 0ca3d12330753e9cc43fb03049ca32d0ae16de05 Mon Sep 17 00:00:00 2001 From: Chris Hegarty <62058229+ChrisHegarty@users.noreply.github.com> Date: Tue, 5 Oct 2021 07:29:50 +0100 Subject: [PATCH 149/250] Fix split package with OneMergeHelper (#78601) With LUCENE-10118 integrated, we can now remove the package -private dependency with org.apache.lucene.index.OneMergeHelper, and intercept the info/log messages coming from merge threads. This change alters the logging a little, but the fundamental information captured remains more or less the same. It is worth noting that since the merges occur asynconously, the actual post-merge statistics are best captured when the merge thread completes its operation - which is the case with the change in this PR. relates (#78166) --- server/build.gradle | 1 - .../apache/lucene/index/OneMergeHelper.java | 50 ---------------- ...ElasticsearchConcurrentMergeScheduler.java | 40 +++++++++---- .../index/engine/InternalEngineTests.java | 59 +++++++++++++++++++ 4 files changed, 88 insertions(+), 62 deletions(-) delete mode 100644 server/src/main/java/org/apache/lucene/index/OneMergeHelper.java diff --git a/server/build.gradle b/server/build.gradle index c1a0b05f13a88..b6cd15f955855 100644 --- a/server/build.gradle +++ b/server/build.gradle @@ -280,7 +280,6 @@ tasks.named('splitPackagesAudit').configure { // These are tricky because Lucene itself splits the index package, // but this should be fixed in Lucene 9 'org.apache.lucene.index.LazySoftDeletesDirectoryReaderWrapper', - 'org.apache.lucene.index.OneMergeHelper', 'org.apache.lucene.index.ShuffleForcedMergePolicy', // Joda should own its own packages! This should be a simple move. diff --git a/server/src/main/java/org/apache/lucene/index/OneMergeHelper.java b/server/src/main/java/org/apache/lucene/index/OneMergeHelper.java deleted file mode 100644 index 41fd337eb64d7..0000000000000 --- a/server/src/main/java/org/apache/lucene/index/OneMergeHelper.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -package org.apache.lucene.index; - -import java.io.IOException; - -/** - * Allows pkg private access - */ -public class OneMergeHelper { - private OneMergeHelper() {} - public static String getSegmentName(MergePolicy.OneMerge merge) { - return merge.info != null ? merge.info.info.name : "_na_"; - } - - /** - * The current MB per second rate limit for this merge. - **/ - public static double getMbPerSec(Thread thread, MergePolicy.OneMerge merge) { - if (thread instanceof ConcurrentMergeScheduler.MergeThread) { - return ((ConcurrentMergeScheduler.MergeThread) thread).rateLimiter.getMBPerSec(); - } - assert false: "this is not merge thread"; - return Double.POSITIVE_INFINITY; - } - - /** - * Returns total bytes written by this merge. - **/ - public static long getTotalBytesWritten(Thread thread, - MergePolicy.OneMerge merge) throws IOException { - /** - * TODO: The number of bytes written during the merge should be accessible in OneMerge. - */ - if (thread instanceof ConcurrentMergeScheduler.MergeThread) { - return ((ConcurrentMergeScheduler.MergeThread) thread).rateLimiter - .getTotalBytesWritten(); - } - assert false: "this is not merge thread"; - return merge.totalBytesSize(); - } - - -} diff --git a/server/src/main/java/org/elasticsearch/index/engine/ElasticsearchConcurrentMergeScheduler.java b/server/src/main/java/org/elasticsearch/index/engine/ElasticsearchConcurrentMergeScheduler.java index b049949202f51..a53c770455640 100644 --- a/server/src/main/java/org/elasticsearch/index/engine/ElasticsearchConcurrentMergeScheduler.java +++ b/server/src/main/java/org/elasticsearch/index/engine/ElasticsearchConcurrentMergeScheduler.java @@ -12,7 +12,6 @@ import org.apache.lucene.index.ConcurrentMergeScheduler; import org.apache.lucene.index.MergePolicy; import org.apache.lucene.index.MergeScheduler; -import org.apache.lucene.index.OneMergeHelper; import org.elasticsearch.common.logging.Loggers; import org.elasticsearch.common.metrics.CounterMetric; import org.elasticsearch.common.metrics.MeanMetric; @@ -67,6 +66,31 @@ public Set onGoingMerges() { return readOnlyOnGoingMerges; } + /** We're currently only interested in messages with this prefix. */ + private static final String MERGE_THREAD_MESSAGE_PREFIX = "merge thread"; + + @Override + /** Overridden to route specific MergeThread messages to our logger. */ + protected boolean verbose() { + if (logger.isTraceEnabled() && Thread.currentThread() instanceof MergeThread) { + return true; + } + return super.verbose(); + } + + @Override + /** Overridden to route specific MergeThread messages to our logger. */ + protected void message(String message) { + if (logger.isTraceEnabled() && Thread.currentThread() instanceof MergeThread && message.startsWith(MERGE_THREAD_MESSAGE_PREFIX)) { + logger.trace("{}", message); + } + super.message(message); + } + + private static String getSegmentName(MergePolicy.OneMerge merge) { + return merge.getMergeInfo() != null ? merge.getMergeInfo().info.name : "_na_"; + } + @Override protected void doMerge(MergeSource mergeSource, MergePolicy.OneMerge merge) throws IOException { int totalNumDocs = merge.totalNumDocs(); @@ -81,7 +105,7 @@ protected void doMerge(MergeSource mergeSource, MergePolicy.OneMerge merge) thro if (logger.isTraceEnabled()) { logger.trace("merge [{}] starting..., merging [{}] segments, [{}] docs, [{}] size, into [{}] estimated_size", - OneMergeHelper.getSegmentName(merge), merge.segments.size(), totalNumDocs, new ByteSizeValue(totalSizeInBytes), + getSegmentName(merge), merge.segments.size(), totalNumDocs, new ByteSizeValue(totalSizeInBytes), new ByteSizeValue(merge.estimatedMergeBytes)); } try { @@ -106,23 +130,18 @@ protected void doMerge(MergeSource mergeSource, MergePolicy.OneMerge merge) thro long throttledMS = TimeValue.nsecToMSec( merge.getMergeProgress().getPauseTimes().get(MergePolicy.OneMergeProgress.PauseReason.PAUSED) ); - final Thread thread = Thread.currentThread(); - long totalBytesWritten = OneMergeHelper.getTotalBytesWritten(thread, merge); - double mbPerSec = OneMergeHelper.getMbPerSec(thread, merge); totalMergeStoppedTime.inc(stoppedMS); totalMergeThrottledTime.inc(throttledMS); String message = String.format(Locale.ROOT, "merge segment [%s] done: took [%s], [%,.1f MB], [%,d docs], [%s stopped], " + - "[%s throttled], [%,.1f MB written], [%,.1f MB/sec throttle]", - OneMergeHelper.getSegmentName(merge), + "[%s throttled]", + getSegmentName(merge), TimeValue.timeValueMillis(tookMS), totalSizeInBytes/1024f/1024f, totalNumDocs, TimeValue.timeValueMillis(stoppedMS), - TimeValue.timeValueMillis(throttledMS), - totalBytesWritten/1024f/1024f, - mbPerSec); + TimeValue.timeValueMillis(throttledMS)); if (tookMS > 20000) { // if more than 20 seconds, DEBUG log it logger.debug("{}", message); @@ -184,5 +203,4 @@ void refreshConfig() { disableAutoIOThrottle(); } } - } diff --git a/server/src/test/java/org/elasticsearch/index/engine/InternalEngineTests.java b/server/src/test/java/org/elasticsearch/index/engine/InternalEngineTests.java index facd673a35752..d0a170d3c0d0f 100644 --- a/server/src/test/java/org/elasticsearch/index/engine/InternalEngineTests.java +++ b/server/src/test/java/org/elasticsearch/index/engine/InternalEngineTests.java @@ -34,6 +34,7 @@ import org.apache.lucene.index.LeafReaderContext; import org.apache.lucene.index.LiveIndexWriterConfig; import org.apache.lucene.index.LogDocMergePolicy; +import org.apache.lucene.index.LogMergePolicy; import org.apache.lucene.index.MergePolicy; import org.apache.lucene.index.NoMergePolicy; import org.apache.lucene.index.NumericDocValues; @@ -183,6 +184,7 @@ import static org.hamcrest.CoreMatchers.sameInstance; import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.containsInAnyOrder; +import static org.hamcrest.Matchers.containsInRelativeOrder; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.empty; import static org.hamcrest.Matchers.emptyArray; @@ -195,6 +197,7 @@ import static org.hamcrest.Matchers.in; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.lessThanOrEqualTo; +import static org.hamcrest.Matchers.matchesRegex; import static org.hamcrest.Matchers.not; import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.Matchers.nullValue; @@ -2174,6 +2177,62 @@ public void testIndexWriterInfoStream() throws IllegalAccessException, IOExcepti } } + private static class MockMTAppender extends AbstractAppender { + private final List messages = Collections.synchronizedList(new ArrayList<>()); + + List messages () { return messages; } + + MockMTAppender(final String name) throws IllegalAccessException { + super(name, RegexFilter.createFilter(".*(\n.*)*", new String[0], + false, null, null), null); + } + + @Override + public void append(LogEvent event) { + final String formattedMessage = event.getMessage().getFormattedMessage(); + if (event.getLevel() == Level.TRACE && formattedMessage.startsWith("merge thread")) { + messages.add(formattedMessage); + } + } + } + + public void testMergeThreadLogging() throws IllegalAccessException, IOException { + MockMTAppender mockAppender = new MockMTAppender("testMergeThreadLogging"); + mockAppender.start(); + + Logger rootLogger = LogManager.getRootLogger(); + Level savedLevel = rootLogger.getLevel(); + Loggers.addAppender(rootLogger, mockAppender); + Loggers.setLevel(rootLogger, Level.TRACE); + + LogMergePolicy lmp = newLogMergePolicy(); + lmp.setMergeFactor(2); + try (Store store = createStore()) { + InternalEngine engine = createEngine(defaultSettings, store, createTempDir(), lmp); // fmp + engine.index(indexForDoc(testParsedDocument("1", null, testDocument(), B_1, null))); + engine.index(indexForDoc(testParsedDocument("2", null, testDocument(), B_1, null))); + engine.index(indexForDoc(testParsedDocument("3", null, testDocument(), B_1, null))); + engine.index(indexForDoc(testParsedDocument("4", null, testDocument(), B_1, null))); + engine.forceMerge(true, 1, false, UUIDs.randomBase64UUID()); + engine.flushAndClose(); + + long merges = engine.getMergeStats().getTotal(); + if (merges > 0) { + List threadMsgs = + mockAppender.messages().stream() + .filter(line -> line.startsWith("merge thread")) + .collect(Collectors.toList()); + assertThat("messages:" + threadMsgs + ", merges=" + merges, threadMsgs.size(), greaterThanOrEqualTo(2)); + assertThat(threadMsgs, + containsInRelativeOrder(matchesRegex("^merge thread .* start$"), matchesRegex("^merge thread .* merge segment.*$"))); + } + } finally { + Loggers.removeAppender(rootLogger, mockAppender); + mockAppender.stop(); + Loggers.setLevel(rootLogger, savedLevel); + } + } + public void testSeqNoAndCheckpoints() throws IOException, InterruptedException { final int opCount = randomIntBetween(1, 256); long primarySeqNo = SequenceNumbers.NO_OPS_PERFORMED; From 920b3b52c28c16477fc62f19698acefc23d3775e Mon Sep 17 00:00:00 2001 From: Ignacio Vera Date: Tue, 5 Oct 2021 09:17:25 +0200 Subject: [PATCH 150/250] Add support for metrics aggregations to mvt end point (#78614) It adds support for several aggregations. --- .../search/search-vector-tile-api.asciidoc | 7 ++ .../xpack/vectortile/VectorTileRestIT.java | 37 +++++- .../vectortile/rest/RestVectorTileAction.java | 49 ++++---- .../vectortile/rest/VectorTileRequest.java | 34 +++--- .../rest/VectorTileRequestTests.java | 4 +- .../rest-api-spec/test/20_aggregations.yml | 106 ++++++++++++++++++ 6 files changed, 188 insertions(+), 49 deletions(-) diff --git a/docs/reference/search/search-vector-tile-api.asciidoc b/docs/reference/search/search-vector-tile-api.asciidoc index 0e539c49ca44b..6db48698639c2 100644 --- a/docs/reference/search/search-vector-tile-api.asciidoc +++ b/docs/reference/search/search-vector-tile-api.asciidoc @@ -260,10 +260,17 @@ If `false`, the response does not include the total number of hits matching the aggregation types: + * <> +* <> * <> +* <> * <> +* <> * <> +* <> +* <> +* <> * <> +* <> + The aggregation names can't start with `_mvt_`. The `_mvt_` prefix is reserved for internal aggregations. diff --git a/x-pack/plugin/vector-tile/src/javaRestTest/java/org/elasticsearch/xpack/vectortile/VectorTileRestIT.java b/x-pack/plugin/vector-tile/src/javaRestTest/java/org/elasticsearch/xpack/vectortile/VectorTileRestIT.java index 84c4f3b4912c3..40dc763be1c25 100644 --- a/x-pack/plugin/vector-tile/src/javaRestTest/java/org/elasticsearch/xpack/vectortile/VectorTileRestIT.java +++ b/x-pack/plugin/vector-tile/src/javaRestTest/java/org/elasticsearch/xpack/vectortile/VectorTileRestIT.java @@ -652,7 +652,7 @@ public void testWithFields() throws Exception { assertLayer(tile, META_LAYER, 4096, 1, 13); } - public void testMinAgg() throws Exception { + public void testSingleValueAgg() throws Exception { final Request mvtRequest = new Request(getHttpMethod(), INDEX_POLYGON + "/_mvt/location/" + z + "/" + x + "/" + y); mvtRequest.setJsonEntity( "{\n" @@ -676,6 +676,35 @@ public void testMinAgg() throws Exception { assertDoubleTag(metaLayer, metaLayer.getFeatures(0), "aggregations.minVal.max", 1.0); } + public void testMultiValueAgg() throws Exception { + final Request mvtRequest = new Request(getHttpMethod(), INDEX_POLYGON + "/_mvt/location/" + z + "/" + x + "/" + y); + mvtRequest.setJsonEntity( + "{\n" + + " \"aggs\": {\n" + + " \"percentilesAgg\": {\n" + + " \"percentiles\": {\n" + + " \"field\": \"value1\",\n" + + " \"percents\": [95, 99, 99.9]\n" + + " }\n" + + " }\n" + + " }\n" + + "}" + ); + final VectorTile.Tile tile = execute(mvtRequest); + assertThat(tile.getLayersCount(), Matchers.equalTo(3)); + assertLayer(tile, HITS_LAYER, 4096, 1, 2); + assertLayer(tile, AGGS_LAYER, 4096, 256 * 256, 4); + assertLayer(tile, META_LAYER, 4096, 1, 28); + // check pipeline aggregation values + final VectorTile.Tile.Layer metaLayer = getLayer(tile, META_LAYER); + assertDoubleTag(metaLayer, metaLayer.getFeatures(0), "aggregations.percentilesAgg.95.0.min", 1.0); + assertDoubleTag(metaLayer, metaLayer.getFeatures(0), "aggregations.percentilesAgg.95.0.max", 1.0); + assertDoubleTag(metaLayer, metaLayer.getFeatures(0), "aggregations.percentilesAgg.99.0.min", 1.0); + assertDoubleTag(metaLayer, metaLayer.getFeatures(0), "aggregations.percentilesAgg.99.0.max", 1.0); + assertDoubleTag(metaLayer, metaLayer.getFeatures(0), "aggregations.percentilesAgg.99.9.min", 1.0); + assertDoubleTag(metaLayer, metaLayer.getFeatures(0), "aggregations.percentilesAgg.99.9.max", 1.0); + } + public void testOverlappingMultipolygon() throws Exception { // Overlapping multipolygon are accepted by Elasticsearch but is invalid for JTS. This // causes and error in the mvt library that gets logged using slf4j @@ -720,7 +749,7 @@ private void assertSintTag(VectorTile.Tile.Layer layer, VectorTile.Tile.Feature return; } } - fail("Could not find tag [" + tag + " ]"); + fail("Could not find tag [" + tag + "]"); } private void assertDoubleTag(VectorTile.Tile.Layer layer, VectorTile.Tile.Feature feature, String tag, double value) { @@ -732,7 +761,7 @@ private void assertDoubleTag(VectorTile.Tile.Layer layer, VectorTile.Tile.Featur return; } } - fail("Could not find tag [" + tag + " ]"); + fail("Could not find tag [" + tag + "]"); } private void assertStringTag(VectorTile.Tile.Layer layer, VectorTile.Tile.Feature feature, String tag, String value) { @@ -744,7 +773,7 @@ private void assertStringTag(VectorTile.Tile.Layer layer, VectorTile.Tile.Featur return; } } - fail("Could not find tag [" + tag + " ]"); + fail("Could not find tag [" + tag + "]"); } private VectorTile.Tile execute(Request mvtRequest) throws IOException { diff --git a/x-pack/plugin/vector-tile/src/main/java/org/elasticsearch/xpack/vectortile/rest/RestVectorTileAction.java b/x-pack/plugin/vector-tile/src/main/java/org/elasticsearch/xpack/vectortile/rest/RestVectorTileAction.java index bf7fdb5dfb50c..0b65b5c7ee171 100644 --- a/x-pack/plugin/vector-tile/src/main/java/org/elasticsearch/xpack/vectortile/rest/RestVectorTileAction.java +++ b/x-pack/plugin/vector-tile/src/main/java/org/elasticsearch/xpack/vectortile/rest/RestVectorTileAction.java @@ -33,9 +33,7 @@ import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.SearchHits; import org.elasticsearch.search.aggregations.Aggregation; -import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.Aggregations; -import org.elasticsearch.search.aggregations.AggregatorFactories; import org.elasticsearch.search.aggregations.bucket.geogrid.GeoGridAggregationBuilder; import org.elasticsearch.search.aggregations.bucket.geogrid.GeoTileGridAggregationBuilder; import org.elasticsearch.search.aggregations.bucket.geogrid.GeoTileUtils; @@ -46,13 +44,14 @@ import org.elasticsearch.search.aggregations.metrics.InternalGeoBounds; import org.elasticsearch.search.aggregations.metrics.InternalGeoCentroid; import org.elasticsearch.search.aggregations.pipeline.StatsBucketPipelineAggregationBuilder; +import org.elasticsearch.search.aggregations.support.ValuesSourceAggregationBuilder.MetricsAggregationBuilder; import org.elasticsearch.search.fetch.subphase.FieldAndFormat; import org.elasticsearch.search.profile.SearchProfileResults; import org.elasticsearch.search.sort.SortBuilder; import java.io.IOException; -import java.util.Collection; import java.util.List; +import java.util.Set; import java.util.stream.Collectors; import static org.elasticsearch.rest.RestRequest.Method.GET; @@ -209,27 +208,33 @@ private static SearchRequestBuilder searchRequestBuilder(RestCancellableNodeClie searchRequestBuilder.addAggregation(tileAggBuilder); searchRequestBuilder.addAggregation(new StatsBucketPipelineAggregationBuilder(COUNT_TAG, GRID_FIELD + "." + COUNT_TAG)); if (request.getGridType() == VectorTileRequest.GRID_TYPE.CENTROID) { - GeoCentroidAggregationBuilder centroidAggregationBuilder = new GeoCentroidAggregationBuilder(CENTROID_AGG_NAME); - centroidAggregationBuilder.field(request.getField()); - tileAggBuilder.subAggregation(centroidAggregationBuilder); + tileAggBuilder.subAggregation(new GeoCentroidAggregationBuilder(CENTROID_AGG_NAME).field(request.getField())); } - final AggregatorFactories.Builder otherAggBuilder = request.getAggBuilder(); - if (otherAggBuilder != null) { - final Collection aggregations = otherAggBuilder.getAggregatorFactories(); - for (AggregationBuilder aggregation : aggregations) { - if (aggregation.getName().startsWith(INTERNAL_AGG_PREFIX)) { - throw new IllegalArgumentException( - "Invalid aggregation name [" - + aggregation.getName() - + "]. Aggregation names cannot start with prefix '" - + INTERNAL_AGG_PREFIX - + "'" - ); + final List> aggregations = request.getAggBuilder(); + for (MetricsAggregationBuilder aggregation : aggregations) { + if (aggregation.getName().startsWith(INTERNAL_AGG_PREFIX)) { + throw new IllegalArgumentException( + "Invalid aggregation name [" + + aggregation.getName() + + "]. Aggregation names cannot start with prefix '" + + INTERNAL_AGG_PREFIX + + "'" + ); + } + tileAggBuilder.subAggregation(aggregation); + final Set metricNames = aggregation.metricNames(); + for (String metric : metricNames) { + final String bucketPath; + // handle the case where the metric contains a dot + if (metric.contains(".")) { + bucketPath = GRID_FIELD + ">" + aggregation.getName() + "[" + metric + "]"; + } else { + bucketPath = GRID_FIELD + ">" + aggregation.getName() + "." + metric; } - tileAggBuilder.subAggregation(aggregation); - // we add the metric (.value) to the path in order to support aggregation names with '.' - final String bucketPath = GRID_FIELD + ">" + aggregation.getName() + ".value"; - searchRequestBuilder.addAggregation(new StatsBucketPipelineAggregationBuilder(aggregation.getName(), bucketPath)); + // we only add the metric name to multi-value metric aggregations + final String aggName = metricNames.size() == 1 ? aggregation.getName() : aggregation.getName() + "." + metric; + searchRequestBuilder.addAggregation(new StatsBucketPipelineAggregationBuilder(aggName, bucketPath)); + } } } diff --git a/x-pack/plugin/vector-tile/src/main/java/org/elasticsearch/xpack/vectortile/rest/VectorTileRequest.java b/x-pack/plugin/vector-tile/src/main/java/org/elasticsearch/xpack/vectortile/rest/VectorTileRequest.java index 2662b97562ac4..53030aed0e8d0 100644 --- a/x-pack/plugin/vector-tile/src/main/java/org/elasticsearch/xpack/vectortile/rest/VectorTileRequest.java +++ b/x-pack/plugin/vector-tile/src/main/java/org/elasticsearch/xpack/vectortile/rest/VectorTileRequest.java @@ -22,11 +22,7 @@ import org.elasticsearch.search.aggregations.AggregatorFactories; import org.elasticsearch.search.aggregations.PipelineAggregationBuilder; import org.elasticsearch.search.aggregations.bucket.geogrid.GeoTileUtils; -import org.elasticsearch.search.aggregations.metrics.AvgAggregationBuilder; -import org.elasticsearch.search.aggregations.metrics.CardinalityAggregationBuilder; -import org.elasticsearch.search.aggregations.metrics.MaxAggregationBuilder; -import org.elasticsearch.search.aggregations.metrics.MinAggregationBuilder; -import org.elasticsearch.search.aggregations.metrics.SumAggregationBuilder; +import org.elasticsearch.search.aggregations.support.ValuesSourceAggregationBuilder.MetricsAggregationBuilder; import org.elasticsearch.search.builder.SearchSourceBuilder; import org.elasticsearch.search.fetch.subphase.FieldAndFormat; import org.elasticsearch.search.sort.ScriptSortBuilder; @@ -85,7 +81,7 @@ protected static class Defaults { public static final List FETCH = emptyList(); public static final Map RUNTIME_MAPPINGS = emptyMap(); public static final QueryBuilder QUERY = null; - public static final AggregatorFactories.Builder AGGS = null; + public static final List> AGGS = emptyList(); public static final int GRID_PRECISION = 8; public static final GRID_TYPE GRID_TYPE = VectorTileRequest.GRID_TYPE.GRID; public static final int EXTENT = 4096; @@ -211,7 +207,7 @@ static VectorTileRequest parseRestRequest(RestRequest restRequest) throws IOExce private GRID_TYPE gridType = Defaults.GRID_TYPE; private int size = Defaults.SIZE; private int extent = Defaults.EXTENT; - private AggregatorFactories.Builder aggBuilder = Defaults.AGGS; + private List> aggs = Defaults.AGGS; private List fields = Defaults.FETCH; private List> sortBuilders; private boolean exact_bounds = Defaults.EXACT_BOUNDS; @@ -328,23 +324,19 @@ private void setSize(int size) { this.size = size; } - public AggregatorFactories.Builder getAggBuilder() { - return aggBuilder; + public List> getAggBuilder() { + return aggs; } private void setAggBuilder(AggregatorFactories.Builder aggBuilder) { + List> aggs = new ArrayList<>(aggBuilder.count()); for (AggregationBuilder aggregation : aggBuilder.getAggregatorFactories()) { - final String type = aggregation.getType(); - switch (type) { - case MinAggregationBuilder.NAME: - case MaxAggregationBuilder.NAME: - case AvgAggregationBuilder.NAME: - case SumAggregationBuilder.NAME: - case CardinalityAggregationBuilder.NAME: - break; - default: - // top term and percentile should be supported - throw new IllegalArgumentException("Unsupported aggregation of type [" + type + "]"); + if (aggregation instanceof MetricsAggregationBuilder) { + aggs.add((MetricsAggregationBuilder) aggregation); + } else { + throw new IllegalArgumentException( + "Unsupported aggregation of type [" + aggregation.getType() + "]." + "Only metric aggregations are supported." + ); } } for (PipelineAggregationBuilder aggregation : aggBuilder.getPipelineAggregatorFactories()) { @@ -352,7 +344,7 @@ private void setAggBuilder(AggregatorFactories.Builder aggBuilder) { final String type = aggregation.getType(); throw new IllegalArgumentException("Unsupported pipeline aggregation of type [" + type + "]"); } - this.aggBuilder = aggBuilder; + this.aggs = aggs; } public List> getSortBuilders() { diff --git a/x-pack/plugin/vector-tile/src/test/java/org/elasticsearch/xpack/vectortile/rest/VectorTileRequestTests.java b/x-pack/plugin/vector-tile/src/test/java/org/elasticsearch/xpack/vectortile/rest/VectorTileRequestTests.java index a7c57df0c2a07..6bf88379cd65a 100644 --- a/x-pack/plugin/vector-tile/src/test/java/org/elasticsearch/xpack/vectortile/rest/VectorTileRequestTests.java +++ b/x-pack/plugin/vector-tile/src/test/java/org/elasticsearch/xpack/vectortile/rest/VectorTileRequestTests.java @@ -150,8 +150,8 @@ public void testFieldAgg() throws IOException { aggregationBuilder.toXContent(builder, ToXContent.EMPTY_PARAMS); builder.endObject(); }, (vectorTileRequest) -> { - assertThat(vectorTileRequest.getAggBuilder().getAggregatorFactories(), Matchers.iterableWithSize(1)); - assertThat(vectorTileRequest.getAggBuilder().getAggregatorFactories().contains(aggregationBuilder), Matchers.equalTo(true)); + assertThat(vectorTileRequest.getAggBuilder(), Matchers.iterableWithSize(1)); + assertThat(vectorTileRequest.getAggBuilder().contains(aggregationBuilder), Matchers.equalTo(true)); }); } diff --git a/x-pack/plugin/vector-tile/src/yamlRestTest/resources/rest-api-spec/test/20_aggregations.yml b/x-pack/plugin/vector-tile/src/yamlRestTest/resources/rest-api-spec/test/20_aggregations.yml index e3a913d2965d3..2a37731e77763 100644 --- a/x-pack/plugin/vector-tile/src/yamlRestTest/resources/rest-api-spec/test/20_aggregations.yml +++ b/x-pack/plugin/vector-tile/src/yamlRestTest/resources/rest-api-spec/test/20_aggregations.yml @@ -93,3 +93,109 @@ setup: test.cardinality_value: cardinality: field: value + +--- +"value count agg": + - do: + search_mvt: + index: locations + field: location + x: 0 + y: 0 + zoom: 0 + body: + aggs: + test.value_count_value: + value_count: + field: value + +--- +"median absolute deviation agg": + - do: + search_mvt: + index: locations + field: location + x: 0 + y: 0 + zoom: 0 + body: + aggs: + test.median_absolute_deviation_value: + median_absolute_deviation: + field: value + +--- +"stats agg": + - do: + search_mvt: + index: locations + field: location + x: 0 + y: 0 + zoom: 0 + body: + aggs: + test.stats_values: + stats: + field: value + +--- +"extended stats agg": + - do: + search_mvt: + index: locations + field: location + x: 0 + y: 0 + zoom: 0 + body: + aggs: + test.extended_stats_values: + extended_stats: + field: value + +--- +"percentile agg": + - do: + search_mvt: + index: locations + field: location + x: 0 + y: 0 + zoom: 0 + body: + aggs: + test.percentiles_values: + percentiles: + field: value + +--- +"percentile rank agg": + - do: + search_mvt: + index: locations + field: location + x: 0 + y: 0 + zoom: 0 + body: + aggs: + test.percentile_ranks_values: + percentile_ranks: + field: value + values: [5, 10] + +--- +"boxplot deviation agg": + - do: + search_mvt: + index: locations + field: location + x: 0 + y: 0 + zoom: 0 + body: + aggs: + test.boxplot_values: + boxplot: + field: value From 6f62d32052df7acde0028ecdeec4cd362f9333f1 Mon Sep 17 00:00:00 2001 From: Chris Hegarty <62058229+ChrisHegarty@users.noreply.github.com> Date: Tue, 5 Oct 2021 08:30:52 +0100 Subject: [PATCH 151/250] Fix split package with org.apache.lucene.index.ShuffleForceMergePolicy (#78605) With LUCENE-10132 integrated, we can now replace the package -private dependency on the setDiagnostics method with the newly added addDiagnostics. With this change, SFMP can be relocated to its only-use package org.elasticsearch.index.engine. relates (#78166) --- server/build.gradle | 1 - .../elasticsearch/index/engine/InternalEngine.java | 1 - .../index/engine}/ShuffleForcedMergePolicy.java | 14 +++++++++----- .../engine/PrunePostingsMergePolicyTests.java | 1 - .../RecoverySourcePruneMergePolicyTests.java | 1 - .../engine}/ShuffleForcedMergePolicyTests.java | 3 +-- 6 files changed, 10 insertions(+), 11 deletions(-) rename server/src/main/java/org/{apache/lucene/index => elasticsearch/index/engine}/ShuffleForcedMergePolicy.java (90%) rename server/src/test/java/org/elasticsearch/{lucene/index => index/engine}/ShuffleForcedMergePolicyTests.java (97%) diff --git a/server/build.gradle b/server/build.gradle index b6cd15f955855..078d492569be2 100644 --- a/server/build.gradle +++ b/server/build.gradle @@ -280,7 +280,6 @@ tasks.named('splitPackagesAudit').configure { // These are tricky because Lucene itself splits the index package, // but this should be fixed in Lucene 9 'org.apache.lucene.index.LazySoftDeletesDirectoryReaderWrapper', - 'org.apache.lucene.index.ShuffleForcedMergePolicy', // Joda should own its own packages! This should be a simple move. 'org.joda.time.format.StrictISODateTimeFormat', diff --git a/server/src/main/java/org/elasticsearch/index/engine/InternalEngine.java b/server/src/main/java/org/elasticsearch/index/engine/InternalEngine.java index 821572cb4e937..5ece7108fbd32 100644 --- a/server/src/main/java/org/elasticsearch/index/engine/InternalEngine.java +++ b/server/src/main/java/org/elasticsearch/index/engine/InternalEngine.java @@ -22,7 +22,6 @@ import org.apache.lucene.index.MergePolicy; import org.apache.lucene.index.SegmentCommitInfo; import org.apache.lucene.index.SegmentInfos; -import org.apache.lucene.index.ShuffleForcedMergePolicy; import org.apache.lucene.index.SoftDeletesRetentionMergePolicy; import org.apache.lucene.index.Term; import org.apache.lucene.search.BooleanClause; diff --git a/server/src/main/java/org/apache/lucene/index/ShuffleForcedMergePolicy.java b/server/src/main/java/org/elasticsearch/index/engine/ShuffleForcedMergePolicy.java similarity index 90% rename from server/src/main/java/org/apache/lucene/index/ShuffleForcedMergePolicy.java rename to server/src/main/java/org/elasticsearch/index/engine/ShuffleForcedMergePolicy.java index b59136383c869..09c0c98e39144 100644 --- a/server/src/main/java/org/apache/lucene/index/ShuffleForcedMergePolicy.java +++ b/server/src/main/java/org/elasticsearch/index/engine/ShuffleForcedMergePolicy.java @@ -6,15 +6,21 @@ * Side Public License, v 1. */ -package org.apache.lucene.index; +package org.elasticsearch.index.engine; +import org.apache.lucene.index.CodecReader; +import org.apache.lucene.index.FilterMergePolicy; +import org.apache.lucene.index.LeafReader; +import org.apache.lucene.index.MergePolicy; +import org.apache.lucene.index.SegmentCommitInfo; +import org.apache.lucene.index.SegmentInfos; +import org.apache.lucene.index.SegmentReader; import org.elasticsearch.common.lucene.Lucene; import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; -import java.util.HashMap; import java.util.List; import java.util.Map; @@ -67,9 +73,7 @@ public CodecReader wrapForMerge(CodecReader reader) throws IOException { @Override public void setMergeInfo(SegmentCommitInfo info) { // record that this segment was merged with interleaved segments - Map copy = new HashMap<>(info.info.getDiagnostics()); - copy.put(SHUFFLE_MERGE_KEY, ""); - info.info.setDiagnostics(copy); + info.info.addDiagnostics(Map.of(SHUFFLE_MERGE_KEY, "")); super.setMergeInfo(info); } }); diff --git a/server/src/test/java/org/elasticsearch/index/engine/PrunePostingsMergePolicyTests.java b/server/src/test/java/org/elasticsearch/index/engine/PrunePostingsMergePolicyTests.java index 31454a704aaca..0039364c24415 100644 --- a/server/src/test/java/org/elasticsearch/index/engine/PrunePostingsMergePolicyTests.java +++ b/server/src/test/java/org/elasticsearch/index/engine/PrunePostingsMergePolicyTests.java @@ -18,7 +18,6 @@ import org.apache.lucene.index.LeafReader; import org.apache.lucene.index.MergePolicy; import org.apache.lucene.index.NumericDocValues; -import org.apache.lucene.index.ShuffleForcedMergePolicy; import org.apache.lucene.index.SoftDeletesRetentionMergePolicy; import org.apache.lucene.index.Term; import org.apache.lucene.index.Terms; diff --git a/server/src/test/java/org/elasticsearch/index/engine/RecoverySourcePruneMergePolicyTests.java b/server/src/test/java/org/elasticsearch/index/engine/RecoverySourcePruneMergePolicyTests.java index de10ad281181b..7283dd7efe675 100644 --- a/server/src/test/java/org/elasticsearch/index/engine/RecoverySourcePruneMergePolicyTests.java +++ b/server/src/test/java/org/elasticsearch/index/engine/RecoverySourcePruneMergePolicyTests.java @@ -23,7 +23,6 @@ import org.apache.lucene.index.NumericDocValues; import org.apache.lucene.index.SegmentCommitInfo; import org.apache.lucene.index.SegmentInfos; -import org.apache.lucene.index.ShuffleForcedMergePolicy; import org.apache.lucene.index.StandardDirectoryReader; import org.apache.lucene.index.Term; import org.apache.lucene.search.DocIdSetIterator; diff --git a/server/src/test/java/org/elasticsearch/lucene/index/ShuffleForcedMergePolicyTests.java b/server/src/test/java/org/elasticsearch/index/engine/ShuffleForcedMergePolicyTests.java similarity index 97% rename from server/src/test/java/org/elasticsearch/lucene/index/ShuffleForcedMergePolicyTests.java rename to server/src/test/java/org/elasticsearch/index/engine/ShuffleForcedMergePolicyTests.java index debae061a0f34..c8cef44bfde0b 100644 --- a/server/src/test/java/org/elasticsearch/lucene/index/ShuffleForcedMergePolicyTests.java +++ b/server/src/test/java/org/elasticsearch/index/engine/ShuffleForcedMergePolicyTests.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.lucene.index; +package org.elasticsearch.index.engine; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; @@ -20,7 +20,6 @@ import org.apache.lucene.index.LeafReaderContext; import org.apache.lucene.index.MergePolicy; import org.apache.lucene.index.SegmentInfos; -import org.apache.lucene.index.ShuffleForcedMergePolicy; import org.apache.lucene.search.Sort; import org.apache.lucene.search.SortField; import org.apache.lucene.store.Directory; From 2de2bef4deb4fdd7e774e74c1b5dbf40e3fdc88e Mon Sep 17 00:00:00 2001 From: Alan Woodward Date: Tue, 5 Oct 2021 09:17:16 +0100 Subject: [PATCH 152/250] Remove indices_segments 'verbose' parameter (#78451) The 'verbose' option to /_segments returns memory information for each segment. However, lucene 9 has stopped tracking this memory information as it is largely held off-heap and so is no longer significant. This commit deprecates the 'verbose' parameter and makes it a no-op. Fixes #75955 --- docs/reference/indices/segments.asciidoc | 57 ------------------- .../rest-api-spec/api/indices.segments.json | 6 +- .../segments/IndicesSegmentResponse.java | 5 +- .../segments/IndicesSegmentsRequest.java | 27 +++------ .../IndicesSegmentsRequestBuilder.java | 5 -- .../TransportIndicesSegmentsAction.java | 2 +- .../elasticsearch/index/engine/Engine.java | 10 ++-- .../index/engine/InternalEngine.java | 4 +- .../index/engine/ReadOnlyEngine.java | 4 +- .../elasticsearch/index/engine/Segment.java | 15 +---- .../elasticsearch/index/shard/IndexShard.java | 4 +- .../indices/RestIndicesSegmentsAction.java | 12 +++- .../index/engine/InternalEngineTests.java | 28 ++++----- .../index/shard/IndexShardTests.java | 6 +- .../engine/frozen/FrozenEngineTests.java | 6 +- 15 files changed, 60 insertions(+), 131 deletions(-) diff --git a/docs/reference/indices/segments.asciidoc b/docs/reference/indices/segments.asciidoc index aa432e5b7fe80..db13243c62d27 100644 --- a/docs/reference/indices/segments.asciidoc +++ b/docs/reference/indices/segments.asciidoc @@ -50,14 +50,6 @@ Defaults to `open`. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=index-ignore-unavailable] -`verbose`:: -experimental:[] -(Optional, Boolean) -If `true`, the response includes detailed information -about Lucene's memory usage. -Defaults to `false`. - - [[index-segments-api-response-body]] ==== {api-response-body-title} @@ -81,10 +73,6 @@ include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=docs-deleted] (Integer) include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=segment-size] -`memory_in_bytes`:: -(Integer) -include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=memory] - `committed`:: (Boolean) include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=committed] @@ -161,7 +149,6 @@ The API returns the following response: "num_docs": 1, "deleted_docs": 0, "size_in_bytes": 3800, - "memory_in_bytes": 0, "committed": false, "search": true, "version": "7.0.0", @@ -182,47 +169,3 @@ The API returns the following response: // TESTRESPONSE[s/"attributes": \{[^}]*\}/"attributes": $body.$_path/] // TESTRESPONSE[s/: (\-)?[0-9]+/: $body.$_path/] // TESTRESPONSE[s/7\.0\.0/$body.$_path/] - - -===== Verbose mode - -To add additional information that can be used for debugging, -use the `verbose` flag. - -experimental::[] - -[source,console] --------------------------------------------------- -GET /test/_segments?verbose=true --------------------------------------------------- -// TEST[continued] - -The API returns the following response: - -[source,console-response] --------------------------------------------------- -{ - ... - "_0": { - ... - "ram_tree": [ - { - "description": "postings [PerFieldPostings(format=1)]", - "size_in_bytes": 2696, - "children": [ - { - "description": "format 'Lucene50_0' ...", - "size_in_bytes": 2608, - "children" :[ ... ] - }, - ... - ] - }, - ... - ] - - } - ... -} --------------------------------------------------- -// TESTRESPONSE[skip:Response is too verbose to be fully shown in documentation, so we just show the relevant bit and don't test the response.] diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.segments.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.segments.json index 18eecb68564b8..e48b51f3e24e1 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.segments.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.segments.json @@ -55,7 +55,11 @@ "verbose":{ "type":"boolean", "description":"Includes detailed memory usage by Lucene.", - "default":false + "default":false, + "deprecated" : { + "version" : "8.0.0", + "description" : "lucene no longer keeps track of segment memory overhead as it is largely off-heap" + } } } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/segments/IndicesSegmentResponse.java b/server/src/main/java/org/elasticsearch/action/admin/indices/segments/IndicesSegmentResponse.java index fffcc28aeb948..776d2db03692e 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/segments/IndicesSegmentResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/segments/IndicesSegmentResponse.java @@ -19,6 +19,7 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.index.engine.Segment; import org.elasticsearch.transport.Transports; @@ -113,7 +114,9 @@ protected void addCustomXContentFields(XContentBuilder builder, Params params) t builder.field(Fields.NUM_DOCS, segment.getNumDocs()); builder.field(Fields.DELETED_DOCS, segment.getDeletedDocs()); builder.humanReadableField(Fields.SIZE_IN_BYTES, Fields.SIZE, segment.getSize()); - builder.humanReadableField(Fields.MEMORY_IN_BYTES, Fields.MEMORY, new ByteSizeValue(0)); + if (builder.getRestApiVersion() == RestApiVersion.V_7) { + builder.humanReadableField(Fields.MEMORY_IN_BYTES, Fields.MEMORY, new ByteSizeValue(0)); + } builder.field(Fields.COMMITTED, segment.isCommitted()); builder.field(Fields.SEARCH, segment.isSearch()); if (segment.getVersion() != null) { diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/segments/IndicesSegmentsRequest.java b/server/src/main/java/org/elasticsearch/action/admin/indices/segments/IndicesSegmentsRequest.java index da1031e56be8c..12ac412845881 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/segments/IndicesSegmentsRequest.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/segments/IndicesSegmentsRequest.java @@ -8,6 +8,7 @@ package org.elasticsearch.action.admin.indices.segments; +import org.elasticsearch.Version; import org.elasticsearch.action.support.broadcast.BroadcastRequest; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; @@ -21,41 +22,27 @@ public class IndicesSegmentsRequest extends BroadcastRequest { - protected boolean verbose = false; - public IndicesSegmentsRequest() { this(Strings.EMPTY_ARRAY); } public IndicesSegmentsRequest(StreamInput in) throws IOException { super(in); - verbose = in.readBoolean(); + if (in.getVersion().before(Version.V_8_0_0)) { + in.readBoolean(); // old 'verbose' option, since removed + } } public IndicesSegmentsRequest(String... indices) { super(indices); } - /** - * true if detailed information about each segment should be returned, - * false otherwise. - */ - public boolean verbose() { - return verbose; - } - - /** - * Sets the verbose option. - * @see #verbose() - */ - public void verbose(boolean v) { - verbose = v; - } - @Override public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); - out.writeBoolean(verbose); + if (out.getVersion().before(Version.V_8_0_0)) { + out.writeBoolean(false); + } } @Override diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/segments/IndicesSegmentsRequestBuilder.java b/server/src/main/java/org/elasticsearch/action/admin/indices/segments/IndicesSegmentsRequestBuilder.java index 013af3f651867..257f67d069fe0 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/segments/IndicesSegmentsRequestBuilder.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/segments/IndicesSegmentsRequestBuilder.java @@ -17,9 +17,4 @@ public class IndicesSegmentsRequestBuilder public IndicesSegmentsRequestBuilder(ElasticsearchClient client, IndicesSegmentsAction action) { super(client, action, new IndicesSegmentsRequest()); } - - public IndicesSegmentsRequestBuilder setVerbose(boolean verbose) { - request.verbose = verbose; - return this; - } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/segments/TransportIndicesSegmentsAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/segments/TransportIndicesSegmentsAction.java index 1165304a5a651..75d993eecc5a1 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/segments/TransportIndicesSegmentsAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/segments/TransportIndicesSegmentsAction.java @@ -89,7 +89,7 @@ protected void shardOperation(IndicesSegmentsRequest request, ShardRouting shard assert task instanceof CancellableTask; IndexService indexService = indicesService.indexServiceSafe(shardRouting.index()); IndexShard indexShard = indexService.getShard(shardRouting.id()); - return new ShardSegments(indexShard.routingEntry(), indexShard.segments(request.verbose())); + return new ShardSegments(indexShard.routingEntry(), indexShard.segments()); }); } } diff --git a/server/src/main/java/org/elasticsearch/index/engine/Engine.java b/server/src/main/java/org/elasticsearch/index/engine/Engine.java index e85153245a471..aacf9917ab008 100644 --- a/server/src/main/java/org/elasticsearch/index/engine/Engine.java +++ b/server/src/main/java/org/elasticsearch/index/engine/Engine.java @@ -829,13 +829,13 @@ protected void writerSegmentStats(SegmentsStats stats) { /** How much heap is used that would be freed by a refresh. Note that this may throw {@link AlreadyClosedException}. */ public abstract long getIndexBufferRAMBytesUsed(); - final Segment[] getSegmentInfo(SegmentInfos lastCommittedSegmentInfos, boolean verbose) { + final Segment[] getSegmentInfo(SegmentInfos lastCommittedSegmentInfos) { ensureOpen(); Map segments = new HashMap<>(); // first, go over and compute the search ones... try (Searcher searcher = acquireSearcher("segments", SearcherScope.EXTERNAL)){ for (LeafReaderContext ctx : searcher.getIndexReader().getContext().leaves()) { - fillSegmentInfo(Lucene.segmentReader(ctx.reader()), verbose, true, segments); + fillSegmentInfo(Lucene.segmentReader(ctx.reader()), true, segments); } } @@ -843,7 +843,7 @@ final Segment[] getSegmentInfo(SegmentInfos lastCommittedSegmentInfos, boolean v for (LeafReaderContext ctx : searcher.getIndexReader().getContext().leaves()) { SegmentReader segmentReader = Lucene.segmentReader(ctx.reader()); if (segments.containsKey(segmentReader.getSegmentName()) == false) { - fillSegmentInfo(segmentReader, verbose, false, segments); + fillSegmentInfo(segmentReader, false, segments); } } } @@ -879,7 +879,7 @@ final Segment[] getSegmentInfo(SegmentInfos lastCommittedSegmentInfos, boolean v return segmentsArr; } - private void fillSegmentInfo(SegmentReader segmentReader, boolean verbose, boolean search, Map segments) { + private void fillSegmentInfo(SegmentReader segmentReader, boolean search, Map segments) { SegmentCommitInfo info = segmentReader.getSegmentInfo(); assert segments.containsKey(info.info.name) == false; Segment segment = new Segment(info.info.name); @@ -902,7 +902,7 @@ private void fillSegmentInfo(SegmentReader segmentReader, boolean verbose, boole /** * The list of segments in the engine. */ - public abstract List segments(boolean verbose); + public abstract List segments(); public boolean refreshNeeded() { if (store.tryIncRef()) { diff --git a/server/src/main/java/org/elasticsearch/index/engine/InternalEngine.java b/server/src/main/java/org/elasticsearch/index/engine/InternalEngine.java index 5ece7108fbd32..a22b99bf80a0b 100644 --- a/server/src/main/java/org/elasticsearch/index/engine/InternalEngine.java +++ b/server/src/main/java/org/elasticsearch/index/engine/InternalEngine.java @@ -2058,9 +2058,9 @@ public long getIndexBufferRAMBytesUsed() { } @Override - public List segments(boolean verbose) { + public List segments() { try (ReleasableLock lock = readLock.acquire()) { - Segment[] segmentsArr = getSegmentInfo(lastCommittedSegmentInfos, verbose); + Segment[] segmentsArr = getSegmentInfo(lastCommittedSegmentInfos); // fill in the merges flag Set onGoingMerges = mergeScheduler.onGoingMerges(); diff --git a/server/src/main/java/org/elasticsearch/index/engine/ReadOnlyEngine.java b/server/src/main/java/org/elasticsearch/index/engine/ReadOnlyEngine.java index 2d652bb0feecc..496ea4211702d 100644 --- a/server/src/main/java/org/elasticsearch/index/engine/ReadOnlyEngine.java +++ b/server/src/main/java/org/elasticsearch/index/engine/ReadOnlyEngine.java @@ -378,8 +378,8 @@ public long getIndexBufferRAMBytesUsed() { } @Override - public List segments(boolean verbose) { - return Arrays.asList(getSegmentInfo(lastCommittedSegmentInfos, verbose)); + public List segments() { + return Arrays.asList(getSegmentInfo(lastCommittedSegmentInfos)); } @Override diff --git a/server/src/main/java/org/elasticsearch/index/engine/Segment.java b/server/src/main/java/org/elasticsearch/index/engine/Segment.java index d1cac264611fc..4823adf753297 100644 --- a/server/src/main/java/org/elasticsearch/index/engine/Segment.java +++ b/server/src/main/java/org/elasticsearch/index/engine/Segment.java @@ -14,17 +14,15 @@ import org.apache.lucene.search.SortedNumericSortField; import org.apache.lucene.search.SortedSetSelector; import org.apache.lucene.search.SortedSetSortField; -import org.apache.lucene.util.Accountable; -import org.elasticsearch.core.Nullable; import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.lucene.Lucene; import org.elasticsearch.common.unit.ByteSizeValue; +import org.elasticsearch.core.Nullable; import java.io.IOException; -import java.util.Collection; import java.util.Map; import java.util.Objects; @@ -274,17 +272,6 @@ private static void readRamTree(StreamInput in) throws IOException { } } - // the ram tree is written recursively since the depth is fairly low (5 or 6) - private void writeRamTree(StreamOutput out, Accountable tree) throws IOException { - out.writeString(tree.toString()); - out.writeVLong(tree.ramBytesUsed()); - Collection children = tree.getChildResources(); - out.writeVInt(children.size()); - for (Accountable child : children) { - writeRamTree(out, child); - } - } - @Override public String toString() { return "Segment{" + diff --git a/server/src/main/java/org/elasticsearch/index/shard/IndexShard.java b/server/src/main/java/org/elasticsearch/index/shard/IndexShard.java index 32cefdb43de01..a55d9d035575a 100644 --- a/server/src/main/java/org/elasticsearch/index/shard/IndexShard.java +++ b/server/src/main/java/org/elasticsearch/index/shard/IndexShard.java @@ -2085,8 +2085,8 @@ public Translog.Snapshot newChangesSnapshot(String source, long fromSeqNo, long return getEngine().newChangesSnapshot(source, fromSeqNo, toSeqNo, requiredFullRange, singleConsumer, accessStats); } - public List segments(boolean verbose) { - return getEngine().segments(verbose); + public List segments() { + return getEngine().segments(); } public String getHistoryUUID() { diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestIndicesSegmentsAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestIndicesSegmentsAction.java index 1c64b63ee9977..bdba1f1be041a 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestIndicesSegmentsAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestIndicesSegmentsAction.java @@ -12,6 +12,8 @@ import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.common.Strings; +import org.elasticsearch.common.logging.DeprecationCategory; +import org.elasticsearch.common.logging.DeprecationLogger; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.DispatchingRestToXContentListener; @@ -25,6 +27,8 @@ public class RestIndicesSegmentsAction extends BaseRestHandler { + private static final DeprecationLogger DEPRECATION_LOGGER = DeprecationLogger.getLogger(RestIndicesSegmentsAction.class); + private final ThreadPool threadPool; public RestIndicesSegmentsAction(ThreadPool threadPool) { @@ -47,7 +51,13 @@ public String getName() { public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { IndicesSegmentsRequest indicesSegmentsRequest = new IndicesSegmentsRequest( Strings.splitStringByCommaToArray(request.param("index"))); - indicesSegmentsRequest.verbose(request.paramAsBoolean("verbose", false)); + if (request.hasParam("verbose")) { + DEPRECATION_LOGGER.warn( + DeprecationCategory.INDICES, + "indices_segments_action_verbose", + "The [verbose] query parameter for [indices_segments_action] has no effect and is deprecated" + ); + } indicesSegmentsRequest.indicesOptions(IndicesOptions.fromRequest(request, indicesSegmentsRequest.indicesOptions())); return channel -> new RestCancellableNodeClient(client, request.getHttpChannel()).admin().indices().segments( indicesSegmentsRequest, diff --git a/server/src/test/java/org/elasticsearch/index/engine/InternalEngineTests.java b/server/src/test/java/org/elasticsearch/index/engine/InternalEngineTests.java index d0a170d3c0d0f..9ef4bbc9164d2 100644 --- a/server/src/test/java/org/elasticsearch/index/engine/InternalEngineTests.java +++ b/server/src/test/java/org/elasticsearch/index/engine/InternalEngineTests.java @@ -278,14 +278,14 @@ public void testVersionMapAfterAutoIDDocument() throws IOException { public void testVerboseSegments() throws Exception { try (Store store = createStore(); Engine engine = createEngine(defaultSettings, store, createTempDir(), NoMergePolicy.INSTANCE)) { - List segments = engine.segments(true); + List segments = engine.segments(); assertThat(segments.isEmpty(), equalTo(true)); ParsedDocument doc = testParsedDocument("1", null, testDocumentWithTextField(), B_1, null); engine.index(indexForDoc(doc)); engine.refresh("test"); - segments = engine.segments(true); + segments = engine.segments(); assertThat(segments.size(), equalTo(1)); ParsedDocument doc2 = testParsedDocument("2", null, testDocumentWithTextField(), B_2, null); @@ -295,7 +295,7 @@ public void testVerboseSegments() throws Exception { engine.index(indexForDoc(doc3)); engine.refresh("test"); - segments = engine.segments(true); + segments = engine.segments(); assertThat(segments.size(), equalTo(3)); } } @@ -307,11 +307,11 @@ public void testSegmentsWithMergeFlag() throws Exception { Engine.Index index = indexForDoc(doc); engine.index(index); engine.flush(); - assertThat(engine.segments(false).size(), equalTo(1)); + assertThat(engine.segments().size(), equalTo(1)); index = indexForDoc(testParsedDocument("2", null, testDocument(), B_1, null)); engine.index(index); engine.flush(); - List segments = engine.segments(false); + List segments = engine.segments(); assertThat(segments.size(), equalTo(2)); for (Segment segment : segments) { assertThat(segment.getMergeId(), nullValue()); @@ -319,7 +319,7 @@ public void testSegmentsWithMergeFlag() throws Exception { index = indexForDoc(testParsedDocument("3", null, testDocument(), B_1, null)); engine.index(index); engine.flush(); - segments = engine.segments(false); + segments = engine.segments(); assertThat(segments.size(), equalTo(3)); for (Segment segment : segments) { assertThat(segment.getMergeId(), nullValue()); @@ -335,7 +335,7 @@ public void testSegmentsWithMergeFlag() throws Exception { // ensure that we have released the older segments with a refresh so they can be removed assertFalse(engine.refreshNeeded()); - for (Segment segment : engine.segments(false)) { + for (Segment segment : engine.segments()) { assertThat(segment.getMergeId(), nullValue()); } // we could have multiple underlying merges, so the generation may increase more than once @@ -344,7 +344,7 @@ public void testSegmentsWithMergeFlag() throws Exception { final boolean flush = randomBoolean(); final long gen2 = store.readLastCommittedSegmentsInfo().getGeneration(); engine.forceMerge(flush, 1, false, UUIDs.randomBase64UUID()); - for (Segment segment : engine.segments(false)) { + for (Segment segment : engine.segments()) { assertThat(segment.getMergeId(), nullValue()); } @@ -362,14 +362,14 @@ public void testSegmentsWithIndexSort() throws Exception { createEngine(defaultSettings, store, createTempDir(), NoMergePolicy.INSTANCE, null, null, null, indexSort, null)) { - List segments = engine.segments(true); + List segments = engine.segments(); assertThat(segments.isEmpty(), equalTo(true)); ParsedDocument doc = testParsedDocument("1", null, testDocumentWithTextField(), B_1, null); engine.index(indexForDoc(doc)); engine.refresh("test"); - segments = engine.segments(false); + segments = engine.segments(); assertThat(segments.size(), equalTo(1)); assertThat(segments.get(0).getSegmentSort(), equalTo(indexSort)); @@ -380,7 +380,7 @@ public void testSegmentsWithIndexSort() throws Exception { engine.index(indexForDoc(doc3)); engine.refresh("test"); - segments = engine.segments(true); + segments = engine.segments(); assertThat(segments.size(), equalTo(3)); assertThat(segments.get(0).getSegmentSort(), equalTo(indexSort)); assertThat(segments.get(1).getSegmentSort(), equalTo(indexSort)); @@ -426,7 +426,7 @@ public void testSegments() throws Exception { try (Store store = createStore(); InternalEngine engine = createEngine(config(defaultSettings, store, createTempDir(), NoMergePolicy.INSTANCE, null, null, globalCheckpoint::get))) { - assertThat(engine.segments(false), empty()); + assertThat(engine.segments(), empty()); int numDocsFirstSegment = randomIntBetween(5, 50); Set liveDocsFirstSegment = new HashSet<>(); for (int i = 0; i < numDocsFirstSegment; i++) { @@ -436,7 +436,7 @@ public void testSegments() throws Exception { liveDocsFirstSegment.add(id); } engine.refresh("test"); - List segments = engine.segments(randomBoolean()); + List segments = engine.segments(); assertThat(segments, hasSize(1)); assertThat(segments.get(0).getNumDocs(), equalTo(liveDocsFirstSegment.size())); assertThat(segments.get(0).getDeletedDocs(), equalTo(0)); @@ -466,7 +466,7 @@ public void testSegments() throws Exception { engine.flush(); } engine.refresh("test"); - segments = engine.segments(randomBoolean()); + segments = engine.segments(); assertThat(segments, hasSize(2)); assertThat(segments.get(0).getNumDocs(), equalTo(liveDocsFirstSegment.size())); assertThat(segments.get(0).getDeletedDocs(), equalTo(updates + deletes)); diff --git a/server/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java b/server/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java index 123ef459fbdd0..beecb89d12ef3 100644 --- a/server/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java +++ b/server/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java @@ -3469,7 +3469,7 @@ public void testFlushOnIdle() throws Exception { indexDoc(shard, "_doc", Integer.toString(i)); shard.refresh("test"); // produce segments } - List segments = shard.segments(false); + List segments = shard.segments(); Set names = new HashSet<>(); for (Segment segment : segments) { assertFalse(segment.committed); @@ -3480,7 +3480,7 @@ public void testFlushOnIdle() throws Exception { shard.flush(new FlushRequest()); shard.forceMerge(new ForceMergeRequest().maxNumSegments(1).flush(false)); shard.refresh("test"); - segments = shard.segments(false); + segments = shard.segments(); for (Segment segment : segments) { if (names.contains(segment.getName())) { assertTrue(segment.committed); @@ -3496,7 +3496,7 @@ public void testFlushOnIdle() throws Exception { assertFalse(shard.isActive()); assertBusy(() -> { // flush happens in the background using the flush threadpool - List segmentsAfterFlush = shard.segments(false); + List segmentsAfterFlush = shard.segments(); assertEquals(1, segmentsAfterFlush.size()); for (Segment segment : segmentsAfterFlush) { assertTrue(segment.committed); diff --git a/x-pack/plugin/frozen-indices/src/test/java/org/elasticsearch/index/engine/frozen/FrozenEngineTests.java b/x-pack/plugin/frozen-indices/src/test/java/org/elasticsearch/index/engine/frozen/FrozenEngineTests.java index b82f3881cd367..51efedd68a88a 100644 --- a/x-pack/plugin/frozen-indices/src/test/java/org/elasticsearch/index/engine/frozen/FrozenEngineTests.java +++ b/x-pack/plugin/frozen-indices/src/test/java/org/elasticsearch/index/engine/frozen/FrozenEngineTests.java @@ -166,19 +166,19 @@ public void testSegmentStats() throws IOException { SegmentsStats segmentsStats = frozenEngine.segmentsStats(randomBoolean(), false); try (Engine.Searcher searcher = reader.acquireSearcher("test")) { segmentsStats = frozenEngine.segmentsStats(randomBoolean(), false); - assertEquals(frozenEngine.segments(randomBoolean()).size(), segmentsStats.getCount()); + assertEquals(frozenEngine.segments().size(), segmentsStats.getCount()); assertEquals(1, listener.afterRefresh.get()); } segmentsStats = frozenEngine.segmentsStats(randomBoolean(), false); assertEquals(0, segmentsStats.getCount()); try (Engine.Searcher searcher = reader.acquireSearcher("test")) { segmentsStats = frozenEngine.segmentsStats(randomBoolean(), true); - assertEquals(frozenEngine.segments(randomBoolean()).size(), segmentsStats.getCount()); + assertEquals(frozenEngine.segments().size(), segmentsStats.getCount()); assertEquals(2, listener.afterRefresh.get()); } assertFalse(frozenEngine.isReaderOpen()); segmentsStats = frozenEngine.segmentsStats(randomBoolean(), true); - assertEquals(frozenEngine.segments(randomBoolean()).size(), segmentsStats.getCount()); + assertEquals(frozenEngine.segments().size(), segmentsStats.getCount()); } } } From cfadab46b93083959acccf8ad1d871d5e5cfa13b Mon Sep 17 00:00:00 2001 From: Albert Zaharovits Date: Tue, 5 Oct 2021 11:45:39 +0300 Subject: [PATCH 153/250] Auto-configure the elastic user password (#78306) This adds a new way to specify the initial password for the elastic superuser. This makes use of the new autoconfiguration.password_hash secure setting. This setting contains the elastic user's password hash, which is used to validate the elastic's credentials, as long as there are no other alternatives in the .security index (either if the index does not exist, or if it does not contain the document for the elastic user). Still, the interesting thing, which sets this new setting apart from the bootstrap.password existing one, is that upon a successful validation the hash is written back on the .security index. Importantly, if the write fails, it results in a 500 or 503 error to the client, rather than a 401. This has the result that all the other nodes will use the same elastic password from the index from that point on. This whole mechanism facilitates fixing the elastic user password, for a cluster, before its nodes are started. Co-Authored-By: Lyudmila Fokina 35386883+BigPandaToo@users.noreply.github.com --- ...icsearchAuthenticationProcessingError.java | 35 ++ .../elasticsearch/ElasticsearchException.java | 7 +- .../ExceptionSerializationTests.java | 1 + .../security/authc/AuthenticationResult.java | 14 + .../DefaultAuthenticationFailureHandler.java | 11 + .../core/security/support/Exceptions.java | 10 + .../test/SecuritySingleNodeTestCase.java | 19 +- ...ervedRealmElasticAutoconfigIntegTests.java | 171 +++++++++ .../InitialSecurityConfigurationListener.java | 4 +- .../xpack/security/Security.java | 3 +- .../authc/esnative/NativeUsersStore.java | 9 +- .../authc/esnative/ReservedRealm.java | 131 ++++--- ...AutoConfigGenerateElasticPasswordHash.java | 4 +- .../user/TransportGetUsersActionTests.java | 6 +- .../user/TransportPutUserActionTests.java | 5 +- .../authc/esnative/NativeUsersStoreTests.java | 40 +- .../authc/esnative/ReservedRealmTests.java | 361 ++++++++++++++---- ...onfigGenerateElasticPasswordHashTests.java | 4 +- 18 files changed, 689 insertions(+), 146 deletions(-) create mode 100644 server/src/main/java/org/elasticsearch/ElasticsearchAuthenticationProcessingError.java create mode 100644 x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/authc/esnative/ReservedRealmElasticAutoconfigIntegTests.java diff --git a/server/src/main/java/org/elasticsearch/ElasticsearchAuthenticationProcessingError.java b/server/src/main/java/org/elasticsearch/ElasticsearchAuthenticationProcessingError.java new file mode 100644 index 0000000000000..c12ef1c213bf2 --- /dev/null +++ b/server/src/main/java/org/elasticsearch/ElasticsearchAuthenticationProcessingError.java @@ -0,0 +1,35 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch; + +import org.elasticsearch.common.io.stream.StreamInput; +import org.elasticsearch.rest.RestStatus; + +import java.io.IOException; + +/** + * Used to indicate that the authentication process encountered a server-side error (5xx) that prevented the credentials verification. + * The presented client credentials might or might not be valid. + * This differs from an authentication failure error in subtle ways. This should be preferred when the issue hindering credentials + * verification is transient, such as network congestion or overloaded instances, but not in cases of misconfiguration. + * However this distinction is further blurred because in certain configurations and for certain credential types, the same + * credential can be validated in multiple ways, only some of which might experience transient problems. + * When in doubt, rely on the implicit behavior of 401 authentication failure. + */ +public class ElasticsearchAuthenticationProcessingError extends ElasticsearchSecurityException { + + public ElasticsearchAuthenticationProcessingError(String msg, RestStatus status, Throwable cause, Object... args) { + super(msg, status, cause, args); + assert status == RestStatus.INTERNAL_SERVER_ERROR || status == RestStatus.SERVICE_UNAVAILABLE; + } + + public ElasticsearchAuthenticationProcessingError(StreamInput in) throws IOException { + super(in); + } +} diff --git a/server/src/main/java/org/elasticsearch/ElasticsearchException.java b/server/src/main/java/org/elasticsearch/ElasticsearchException.java index e592ba06240c2..5fd18008826d5 100644 --- a/server/src/main/java/org/elasticsearch/ElasticsearchException.java +++ b/server/src/main/java/org/elasticsearch/ElasticsearchException.java @@ -1038,7 +1038,12 @@ private enum ElasticsearchExceptionHandle { org.elasticsearch.action.search.VersionMismatchException.class, org.elasticsearch.action.search.VersionMismatchException::new, 161, - Version.V_7_12_0); + Version.V_7_12_0), + AUTHENTICATION_PROCESSING_ERROR( + org.elasticsearch.ElasticsearchAuthenticationProcessingError.class, + org.elasticsearch.ElasticsearchAuthenticationProcessingError::new, + 162, + Version.V_7_16_0); final Class exceptionClass; final CheckedFunction constructor; diff --git a/server/src/test/java/org/elasticsearch/ExceptionSerializationTests.java b/server/src/test/java/org/elasticsearch/ExceptionSerializationTests.java index 6e6f3a7aed5d1..64f0869b17502 100644 --- a/server/src/test/java/org/elasticsearch/ExceptionSerializationTests.java +++ b/server/src/test/java/org/elasticsearch/ExceptionSerializationTests.java @@ -822,6 +822,7 @@ public void testIds() { ids.put(159, NodeHealthCheckFailureException.class); ids.put(160, NoSeedNodeLeftException.class); ids.put(161, VersionMismatchException.class); + ids.put(162, ElasticsearchAuthenticationProcessingError.class); Map, Integer> reverse = new HashMap<>(); for (Map.Entry> entry : ids.entrySet()) { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/AuthenticationResult.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/AuthenticationResult.java index 459e91dec7598..bcc2bfde049e3 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/AuthenticationResult.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/AuthenticationResult.java @@ -134,6 +134,20 @@ public static AuthenticationResult terminate(String message, @Nullable Exception return new AuthenticationResult(Status.TERMINATE, null, message, cause, null); } + /** + * Creates an {@code AuthenticationResult} that indicates that the realm attempted to handle the authentication request, was + * unsuccessful and wants to terminate this authentication request. + * The reason for the failure is given in the supplied message. + *

+ * The {@link #getStatus() status} is set to {@link Status#TERMINATE}. + *

+ * The {@link #getUser() user} is not populated. + *

+ */ + public static AuthenticationResult terminate(String message) { + return terminate(message, null); + } + public boolean isAuthenticated() { return status == Status.SUCCESS; } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/DefaultAuthenticationFailureHandler.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/DefaultAuthenticationFailureHandler.java index e0f8d4adb076f..7299f1ffd6c5a 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/DefaultAuthenticationFailureHandler.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/DefaultAuthenticationFailureHandler.java @@ -6,6 +6,7 @@ */ package org.elasticsearch.xpack.core.security.authc; +import org.elasticsearch.ElasticsearchAuthenticationProcessingError; import org.elasticsearch.ElasticsearchSecurityException; import org.elasticsearch.common.util.concurrent.ThreadContext; import org.elasticsearch.rest.RestRequest; @@ -100,12 +101,22 @@ public ElasticsearchSecurityException failedAuthentication(TransportMessage mess @Override public ElasticsearchSecurityException exceptionProcessingRequest(RestRequest request, Exception e, ThreadContext context) { + // a couple of authn processing errors can also return {@link RestStatus#INTERNAL_SERVER_ERROR} or + // {@link RestStatus#SERVICE_UNAVAILABLE}, besides the obvious {@link RestStatus#UNAUTHORIZED} + if (e instanceof ElasticsearchAuthenticationProcessingError) { + return (ElasticsearchAuthenticationProcessingError) e; + } return createAuthenticationError("error attempting to authenticate request", e, (Object[]) null); } @Override public ElasticsearchSecurityException exceptionProcessingRequest(TransportMessage message, String action, Exception e, ThreadContext context) { + // a couple of authn processing errors can also return {@link RestStatus#INTERNAL_SERVER_ERROR} or + // {@link RestStatus#SERVICE_UNAVAILABLE}, besides the obvious {@link RestStatus#UNAUTHORIZED} + if (e instanceof ElasticsearchAuthenticationProcessingError) { + return (ElasticsearchAuthenticationProcessingError) e; + } return createAuthenticationError("error attempting to authenticate request", e, (Object[]) null); } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/support/Exceptions.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/support/Exceptions.java index 9b2652883455f..ed3e0204c6dd5 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/support/Exceptions.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/support/Exceptions.java @@ -6,7 +6,9 @@ */ package org.elasticsearch.xpack.core.security.support; +import org.elasticsearch.ElasticsearchAuthenticationProcessingError; import org.elasticsearch.ElasticsearchSecurityException; +import org.elasticsearch.ExceptionsHelper; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.xpack.core.XPackField; @@ -34,4 +36,12 @@ public static ElasticsearchSecurityException authorizationError(String msg, Obje public static ElasticsearchSecurityException authorizationError(String msg, Exception cause, Object... args) { return new ElasticsearchSecurityException(msg, RestStatus.FORBIDDEN, cause, args); } + + public static ElasticsearchAuthenticationProcessingError authenticationProcessError(String msg, Exception cause, Object... args) { + RestStatus restStatus = RestStatus.SERVICE_UNAVAILABLE; + if (RestStatus.INTERNAL_SERVER_ERROR == ExceptionsHelper.status(ExceptionsHelper.unwrapCause(cause))) { + restStatus = RestStatus.INTERNAL_SERVER_ERROR; + } + return new ElasticsearchAuthenticationProcessingError(msg, restStatus, cause, args); + } } diff --git a/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/test/SecuritySingleNodeTestCase.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/test/SecuritySingleNodeTestCase.java index c6753a3dff1a5..ee42a07b41c1e 100644 --- a/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/test/SecuritySingleNodeTestCase.java +++ b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/test/SecuritySingleNodeTestCase.java @@ -58,12 +58,6 @@ public abstract class SecuritySingleNodeTestCase extends ESSingleNodeTestCase { private static SecuritySettingsSource SECURITY_DEFAULT_SETTINGS = null; private static CustomSecuritySettingsSource customSecuritySettingsSource = null; private static RestClient restClient = null; - private static SecureString BOOTSTRAP_PASSWORD = null; - - @BeforeClass - public static void generateBootstrapPassword() { - BOOTSTRAP_PASSWORD = TEST_PASSWORD_SECURE_STRING.clone(); - } @BeforeClass public static void initDefaultSettings() { @@ -82,10 +76,6 @@ public static void initDefaultSettings() { public static void destroyDefaultSettings() { SECURITY_DEFAULT_SETTINGS = null; customSecuritySettingsSource = null; - if (BOOTSTRAP_PASSWORD != null) { - BOOTSTRAP_PASSWORD.close(); - BOOTSTRAP_PASSWORD = null; - } tearDownRestClient(); } @@ -180,10 +170,17 @@ protected Settings nodeSettings() { if (builder.getSecureSettings() == null) { builder.setSecureSettings(new MockSecureSettings()); } - ((MockSecureSettings) builder.getSecureSettings()).setString("bootstrap.password", BOOTSTRAP_PASSWORD.toString()); + SecureString boostrapPassword = getBootstrapPassword(); + if (boostrapPassword != null) { + ((MockSecureSettings) builder.getSecureSettings()).setString("bootstrap.password", boostrapPassword.toString()); + } return builder.build(); } + protected SecureString getBootstrapPassword() { + return TEST_PASSWORD_SECURE_STRING; + } + @Override protected Collection> getPlugins() { return customSecuritySettingsSource.nodePlugins(); diff --git a/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/authc/esnative/ReservedRealmElasticAutoconfigIntegTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/authc/esnative/ReservedRealmElasticAutoconfigIntegTests.java new file mode 100644 index 0000000000000..9d4e3d9f2a288 --- /dev/null +++ b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/authc/esnative/ReservedRealmElasticAutoconfigIntegTests.java @@ -0,0 +1,171 @@ +/* + * 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.security.authc.esnative; + +import org.elasticsearch.action.admin.cluster.settings.ClusterUpdateSettingsRequest; +import org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest; +import org.elasticsearch.action.admin.indices.get.GetIndexRequest; +import org.elasticsearch.action.admin.indices.get.GetIndexResponse; +import org.elasticsearch.action.support.IndicesOptions; +import org.elasticsearch.client.Request; +import org.elasticsearch.client.RequestOptions; +import org.elasticsearch.client.ResponseException; +import org.elasticsearch.cluster.metadata.Metadata; +import org.elasticsearch.common.Strings; +import org.elasticsearch.common.settings.MockSecureSettings; +import org.elasticsearch.common.settings.SecureString; +import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.rest.RestStatus; +import org.elasticsearch.test.SecuritySingleNodeTestCase; +import org.elasticsearch.xpack.core.security.action.user.PutUserAction; +import org.elasticsearch.xpack.core.security.action.user.PutUserRequest; +import org.elasticsearch.xpack.core.security.authc.support.Hasher; +import org.elasticsearch.xpack.core.security.authc.support.UsernamePasswordToken; +import org.elasticsearch.xpack.core.security.index.RestrictedIndicesNames; +import org.junit.BeforeClass; + +import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; +import static org.elasticsearch.xpack.core.security.index.RestrictedIndicesNames.SECURITY_MAIN_ALIAS; +import static org.hamcrest.Matchers.is; + +public class ReservedRealmElasticAutoconfigIntegTests extends SecuritySingleNodeTestCase { + + private static Hasher hasher; + + @BeforeClass + public static void setHasher() { + hasher = getFastStoredHashAlgoForTests(); + } + + @Override + public Settings nodeSettings() { + Settings.Builder settingsBuilder = Settings.builder() + .put(super.nodeSettings()) + .put("xpack.security.authc.password_hashing.algorithm", hasher.name()); + ((MockSecureSettings) settingsBuilder.getSecureSettings()).setString("autoconfiguration.password_hash", + new String(hasher.hash(new SecureString("auto_password_that_is_longer_than_14_chars_because_of_FIPS".toCharArray())))); + return settingsBuilder.build(); + } + + @Override + protected boolean addMockHttpTransport() { + return false; // enable HTTP + } + + @Override + protected SecureString getBootstrapPassword() { + return null; // no bootstrap password for this test + } + + public void testAutoconfigFailedPasswordPromotion() { + try { + // prevents the .security index from being created automatically (after elastic user authentication) + ClusterUpdateSettingsRequest updateSettingsRequest = new ClusterUpdateSettingsRequest(); + updateSettingsRequest.transientSettings(Settings.builder().put(Metadata.SETTING_READ_ONLY_ALLOW_DELETE_SETTING.getKey(), + true)); + assertAcked(client().admin().cluster().updateSettings(updateSettingsRequest).actionGet()); + + // delete the security index, if it exist + GetIndexRequest getIndexRequest = new GetIndexRequest(); + getIndexRequest.indices(SECURITY_MAIN_ALIAS); + getIndexRequest.indicesOptions(IndicesOptions.lenientExpandOpen()); + GetIndexResponse getIndexResponse = client().admin().indices().getIndex(getIndexRequest).actionGet(); + if (getIndexResponse.getIndices().length > 0) { + assertThat(getIndexResponse.getIndices().length, is(1)); + assertThat(getIndexResponse.getIndices()[0], is(RestrictedIndicesNames.INTERNAL_SECURITY_MAIN_INDEX_7)); + DeleteIndexRequest deleteIndexRequest = new DeleteIndexRequest(getIndexResponse.getIndices()); + assertAcked(client().admin().indices().delete(deleteIndexRequest).actionGet()); + } + + // elastic user gets 503 for the good password + Request restRequest = randomFrom(new Request("GET", "/_security/_authenticate"), new Request("GET", "_cluster/health"), + new Request("GET", "_nodes")); + RequestOptions.Builder options = RequestOptions.DEFAULT.toBuilder(); + options.addHeader(UsernamePasswordToken.BASIC_AUTH_HEADER, UsernamePasswordToken.basicAuthHeaderValue("elastic", + new SecureString("auto_password_that_is_longer_than_14_chars_because_of_FIPS".toCharArray()))); + restRequest.setOptions(options); + ResponseException exception = expectThrows(ResponseException.class, () -> getRestClient().performRequest(restRequest)); + assertThat(exception.getResponse().getStatusLine().getStatusCode(), is(RestStatus.SERVICE_UNAVAILABLE.getStatus())); + + // but gets a 401 for the wrong password + Request restRequest2 = randomFrom(new Request("GET", "/_security/_authenticate"), new Request("GET", "_cluster/health"), + new Request("GET", "_nodes")); + options = RequestOptions.DEFAULT.toBuilder(); + options.addHeader(UsernamePasswordToken.BASIC_AUTH_HEADER, UsernamePasswordToken.basicAuthHeaderValue("elastic", + new SecureString("wrong password_that_is_longer_than_14_chars_because_of_FIPS".toCharArray()))); + restRequest2.setOptions(options); + exception = expectThrows(ResponseException.class, () -> getRestClient().performRequest(restRequest2)); + assertThat(exception.getResponse().getStatusLine().getStatusCode(), is(RestStatus.UNAUTHORIZED.getStatus())); + } finally { + ClusterUpdateSettingsRequest updateSettingsRequest = new ClusterUpdateSettingsRequest(); + updateSettingsRequest.transientSettings(Settings.builder().put(Metadata.SETTING_READ_ONLY_ALLOW_DELETE_SETTING.getKey(), + (String) null)); + assertAcked(client().admin().cluster().updateSettings(updateSettingsRequest).actionGet()); + } + } + + public void testAutoconfigSucceedsAfterPromotionFailure() throws Exception { + try { + // create any non-elastic user, which triggers .security index creation + final PutUserRequest putUserRequest = new PutUserRequest(); + final String username = randomAlphaOfLength(8); + putUserRequest.username(username); + final SecureString password = new SecureString("super-strong-password!".toCharArray()); + putUserRequest.passwordHash(Hasher.PBKDF2.hash(password)); + putUserRequest.roles(Strings.EMPTY_ARRAY); + client().execute(PutUserAction.INSTANCE, putUserRequest).get(); + + // but then make the cluster read-only + ClusterUpdateSettingsRequest updateSettingsRequest = new ClusterUpdateSettingsRequest(); + updateSettingsRequest.transientSettings(Settings.builder().put(Metadata.SETTING_READ_ONLY_ALLOW_DELETE_SETTING.getKey(), + true)); + assertAcked(client().admin().cluster().updateSettings(updateSettingsRequest).actionGet()); + + // elastic user now gets 503 for the good password + Request restRequest = randomFrom(new Request("GET", "/_security/_authenticate"), new Request("GET", "_cluster/health"), + new Request("GET", "_nodes")); + RequestOptions.Builder options = RequestOptions.DEFAULT.toBuilder(); + options.addHeader(UsernamePasswordToken.BASIC_AUTH_HEADER, UsernamePasswordToken.basicAuthHeaderValue("elastic", + new SecureString("auto_password_that_is_longer_than_14_chars_because_of_FIPS".toCharArray()))); + restRequest.setOptions(options); + ResponseException exception = expectThrows(ResponseException.class, () -> getRestClient().performRequest(restRequest)); + assertThat(exception.getResponse().getStatusLine().getStatusCode(), is(RestStatus.SERVICE_UNAVAILABLE.getStatus())); + + // clear cluster-wide write block + updateSettingsRequest = new ClusterUpdateSettingsRequest(); + updateSettingsRequest.transientSettings(Settings.builder().put(Metadata.SETTING_READ_ONLY_ALLOW_DELETE_SETTING.getKey(), + (String) null)); + assertAcked(client().admin().cluster().updateSettings(updateSettingsRequest).actionGet()); + + if (randomBoolean()) { + Request restRequest2 = randomFrom(new Request("GET", "/_security/_authenticate"), new Request("GET", "_cluster/health"), + new Request("GET", "_nodes")); + options = RequestOptions.DEFAULT.toBuilder(); + options.addHeader(UsernamePasswordToken.BASIC_AUTH_HEADER, UsernamePasswordToken.basicAuthHeaderValue("elastic", + new SecureString("wrong password_that_is_longer_than_14_chars_because_of_FIPS".toCharArray()))); + restRequest2.setOptions(options); + exception = expectThrows(ResponseException.class, () -> getRestClient().performRequest(restRequest2)); + assertThat(exception.getResponse().getStatusLine().getStatusCode(), is(RestStatus.UNAUTHORIZED.getStatus())); + } + + // now the auto config password can be promoted, and authn succeeds + Request restRequest3 = randomFrom(new Request("GET", "/_security/_authenticate"), new Request("GET", "_cluster/health"), + new Request("GET", "_nodes")); + options = RequestOptions.DEFAULT.toBuilder(); + options.addHeader(UsernamePasswordToken.BASIC_AUTH_HEADER, UsernamePasswordToken.basicAuthHeaderValue("elastic", + new SecureString("auto_password_that_is_longer_than_14_chars_because_of_FIPS".toCharArray()))); + restRequest3.setOptions(options); + assertThat(getRestClient().performRequest(restRequest3).getStatusLine().getStatusCode(), is(RestStatus.OK.getStatus())); + } finally { + ClusterUpdateSettingsRequest updateSettingsRequest = new ClusterUpdateSettingsRequest(); + updateSettingsRequest.transientSettings(Settings.builder().put(Metadata.SETTING_READ_ONLY_ALLOW_DELETE_SETTING.getKey(), + (String) null)); + assertAcked(client().admin().cluster().updateSettings(updateSettingsRequest).actionGet()); + } + } +} diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/InitialSecurityConfigurationListener.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/InitialSecurityConfigurationListener.java index 9b1935228aa4b..b887e3a28db08 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/InitialSecurityConfigurationListener.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/InitialSecurityConfigurationListener.java @@ -31,7 +31,7 @@ import java.util.Map; import java.util.function.BiConsumer; -import static org.elasticsearch.xpack.security.authc.esnative.ReservedRealm.AUTOCONFIG_BOOOTSTRAP_ELASTIC_PASSWORD_HASH; +import static org.elasticsearch.xpack.security.authc.esnative.ReservedRealm.AUTOCONFIG_ELASTIC_PASSWORD_HASH; import static org.elasticsearch.xpack.security.authc.esnative.ReservedRealm.BOOTSTRAP_ELASTIC_PASSWORD; import static org.elasticsearch.xpack.security.tool.CommandUtils.generatePassword; @@ -87,7 +87,7 @@ public void accept(SecurityIndexManager.State previousState, SecurityIndexManage }, this::outputOnError), 2); if (false == BOOTSTRAP_ELASTIC_PASSWORD.exists(environment.settings()) - && false == AUTOCONFIG_BOOOTSTRAP_ELASTIC_PASSWORD_HASH.exists(environment.settings())) { + && false == AUTOCONFIG_ELASTIC_PASSWORD_HASH.exists(environment.settings())) { final SecureString elasticPassword = new SecureString(generatePassword(20)); nativeUsersStore.updateReservedUser( ElasticUser.NAME, diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/Security.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/Security.java index 6802d5d128c56..701b8c9c2f8b8 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/Security.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/Security.java @@ -498,8 +498,7 @@ Collection createComponents(Client client, ThreadPool threadPool, Cluste scriptService); final AnonymousUser anonymousUser = new AnonymousUser(settings); components.add(anonymousUser); - final ReservedRealm reservedRealm = new ReservedRealm(environment, settings, nativeUsersStore, - anonymousUser, securityIndex.get(), threadPool); + final ReservedRealm reservedRealm = new ReservedRealm(environment, settings, nativeUsersStore, anonymousUser, threadPool); final SecurityExtension.SecurityComponents extensionComponents = new ExtensionComponents(environment, client, clusterService, resourceWatcherService, nativeRoleMappingStore); Map realmFactories = new HashMap<>(InternalRealms.getFactories(threadPool, resourceWatcherService, diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/esnative/NativeUsersStore.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/esnative/NativeUsersStore.java index 47bdae1d846d2..49058d0c06a83 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/esnative/NativeUsersStore.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/esnative/NativeUsersStore.java @@ -48,6 +48,7 @@ import org.elasticsearch.xpack.core.security.authc.AuthenticationResult; import org.elasticsearch.xpack.core.security.authc.esnative.ClientReservedRealm; import org.elasticsearch.xpack.core.security.authc.support.Hasher; +import org.elasticsearch.xpack.core.security.user.ElasticUser; import org.elasticsearch.xpack.core.security.user.User; import org.elasticsearch.xpack.core.security.user.User.Fields; import org.elasticsearch.xpack.security.support.SecurityIndexManager; @@ -309,6 +310,10 @@ public void updateReservedUser( }); } + void createElasticUser(char[] passwordHash, ActionListener listener) { + updateReservedUser(ElasticUser.NAME, passwordHash, DocWriteRequest.OpType.CREATE, RefreshPolicy.IMMEDIATE, listener); + } + /** * Asynchronous method to put a user. A put user request without a password hash is treated as an update and will fail with a * {@link ValidationException} if the user does not exist. If a password hash is provided, then we issue a update request with an @@ -685,10 +690,6 @@ static final class ReservedUserInfo { this.hasher = Hasher.resolveFromHash(this.passwordHash); } - ReservedUserInfo deepClone() { - return new ReservedUserInfo(Arrays.copyOf(passwordHash, passwordHash.length), enabled); - } - boolean hasEmptyPassword() { return passwordHash.length == 0; } diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/esnative/ReservedRealm.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/esnative/ReservedRealm.java index bc1c848359092..ebfaf45c3bfbb 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/esnative/ReservedRealm.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/esnative/ReservedRealm.java @@ -38,7 +38,6 @@ import org.elasticsearch.xpack.core.security.user.User; import org.elasticsearch.xpack.security.authc.esnative.NativeUsersStore.ReservedUserInfo; import org.elasticsearch.xpack.security.authc.support.CachingUsernamePasswordRealm; -import org.elasticsearch.xpack.security.support.SecurityIndexManager; import java.util.ArrayList; import java.util.Arrays; @@ -46,6 +45,8 @@ import java.util.Collections; import java.util.List; import java.util.Map; +import java.util.Set; +import java.util.function.Consumer; /** * A realm for predefined users. These users can only be modified in terms of changing their passwords; no other modifications are allowed. @@ -57,21 +58,25 @@ public class ReservedRealm extends CachingUsernamePasswordRealm { public static final String NAME = "reserved"; private final ReservedUserInfo bootstrapUserInfo; + private final ReservedUserInfo autoconfigUserInfo; public static final Setting BOOTSTRAP_ELASTIC_PASSWORD = SecureSetting.secureString("bootstrap.password", KeyStoreWrapper.SEED_SETTING); - public static final Setting AUTOCONFIG_BOOOTSTRAP_ELASTIC_PASSWORD_HASH = - SecureSetting.secureString("autoconfig.password_hash", null); + + // we do not document this setting on the website because it mustn't be set by the users + // it is only set by various installation scripts + public static final Setting AUTOCONFIG_ELASTIC_PASSWORD_HASH = + SecureSetting.secureString("autoconfiguration.password_hash", null); private final NativeUsersStore nativeUsersStore; private final AnonymousUser anonymousUser; private final boolean realmEnabled; private final boolean anonymousEnabled; - private final SecurityIndexManager securityIndex; + private final boolean elasticUserAutoconfigured; private final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(logger.getName()); public ReservedRealm(Environment env, Settings settings, NativeUsersStore nativeUsersStore, AnonymousUser anonymousUser, - SecurityIndexManager securityIndex, ThreadPool threadPool) { + ThreadPool threadPool) { super(new RealmConfig(new RealmConfig.RealmIdentifier(TYPE, NAME), Settings.builder() .put(settings) @@ -81,11 +86,27 @@ public ReservedRealm(Environment env, Settings settings, NativeUsersStore native this.realmEnabled = XPackSettings.RESERVED_REALM_ENABLED_SETTING.get(settings); this.anonymousUser = anonymousUser; this.anonymousEnabled = AnonymousUser.isAnonymousEnabled(settings); - this.securityIndex = securityIndex; - final Hasher reservedRealmHasher = Hasher.resolve(XPackSettings.PASSWORD_HASHING_ALGORITHM.get(settings)); - final char[] hash = BOOTSTRAP_ELASTIC_PASSWORD.get(settings).length() == 0 ? new char[0] : - reservedRealmHasher.hash(BOOTSTRAP_ELASTIC_PASSWORD.get(settings)); - bootstrapUserInfo = new ReservedUserInfo(hash, true); + char[] autoconfigPasswordHash = null; + // validate the password hash setting value, even if it is not going to be used + if (AUTOCONFIG_ELASTIC_PASSWORD_HASH.exists(settings)) { + autoconfigPasswordHash = AUTOCONFIG_ELASTIC_PASSWORD_HASH.get(settings).getChars(); + if (autoconfigPasswordHash.length == 0 || Set.of(Hasher.SHA1, Hasher.MD5, Hasher.SSHA256, Hasher.NOOP) + .contains(Hasher.resolveFromHash(autoconfigPasswordHash))) { + throw new IllegalArgumentException("Invalid password hash for elastic user auto configuration"); + } + } + elasticUserAutoconfigured = + AUTOCONFIG_ELASTIC_PASSWORD_HASH.exists(settings) && false == BOOTSTRAP_ELASTIC_PASSWORD.exists(settings); + if (elasticUserAutoconfigured) { + autoconfigUserInfo = new ReservedUserInfo(autoconfigPasswordHash, true); + bootstrapUserInfo = null; + } else { + autoconfigUserInfo = null; + final Hasher reservedRealmHasher = Hasher.resolve(XPackSettings.PASSWORD_HASHING_ALGORITHM.get(settings)); + final char[] hash = BOOTSTRAP_ELASTIC_PASSWORD.get(settings).length() == 0 ? new char[0] : + reservedRealmHasher.hash(BOOTSTRAP_ELASTIC_PASSWORD.get(settings)); + bootstrapUserInfo = new ReservedUserInfo(hash, true); + } } @Override @@ -95,29 +116,44 @@ protected void doAuthenticate(UsernamePasswordToken token, ActionListener { - AuthenticationResult result; + getUserInfo(token.principal(), (userInfo) -> { if (userInfo != null) { - try { - if (userInfo.hasEmptyPassword()) { - result = AuthenticationResult.terminate("failed to authenticate user [" + token.principal() + "]", null); - } else if (userInfo.verifyPassword(token.credentials())) { + if (userInfo.hasEmptyPassword()) { + listener.onResponse(AuthenticationResult.terminate("failed to authenticate user [" + token.principal() + "]")); + } else { + ActionListener hashCleanupListener = ActionListener.runBefore(listener, () -> { + if (userInfo != bootstrapUserInfo && userInfo != autoconfigUserInfo) { + Arrays.fill(userInfo.passwordHash, (char) 0); + } + }); + if (userInfo.verifyPassword(token.credentials())) { final User user = getUser(token.principal(), userInfo); logDeprecatedUser(user); - result = AuthenticationResult.success(user); + // promote the auto-configured password as the elastic user password + if (userInfo == autoconfigUserInfo) { + assert ElasticUser.NAME.equals(token.principal()); + nativeUsersStore.createElasticUser(userInfo.passwordHash, ActionListener.wrap(aVoid -> { + hashCleanupListener.onResponse(AuthenticationResult.success(user)); + }, e -> { + // exceptionally, we must propagate a 500 or a 503 error if the auto config password hash + // can't be promoted as the elastic user password, otherwise, such errors will + // implicitly translate to 401s, which is wrong because the presented password was successfully + // verified by the auto-config hash; the client must retry the request. + listener.onFailure(Exceptions.authenticationProcessError("failed to promote the auto-configured " + + "elastic password hash", e)); + })); + } else { + hashCleanupListener.onResponse(AuthenticationResult.success(user)); + } } else { - result = AuthenticationResult.terminate("failed to authenticate user [" + token.principal() + "]", null); + hashCleanupListener.onResponse(AuthenticationResult.terminate("failed to authenticate user [" + + token.principal() + "]")); } - } finally { - assert userInfo.passwordHash != bootstrapUserInfo.passwordHash : "bootstrap user info must be cloned"; - Arrays.fill(userInfo.passwordHash, (char) 0); } } else { - result = AuthenticationResult.terminate("failed to authenticate user [" + token.principal() + "]", null); + listener.onResponse(AuthenticationResult.terminate("failed to authenticate user [" + token.principal() + "]")); } - // we want the finally block to clear out the chars before we proceed further so we handle the result here - listener.onResponse(result); - }, listener::onFailure)); + }); } } @@ -134,14 +170,14 @@ protected void doLookupUser(String username, ActionListener listener) { } else if (AnonymousUser.isAnonymousUsername(username, config.settings())) { listener.onResponse(anonymousEnabled ? anonymousUser : null); } else { - getUserInfo(username, ActionListener.wrap((userInfo) -> { + getUserInfo(username, (userInfo) -> { if (userInfo != null) { listener.onResponse(getUser(username, userInfo)); } else { // this was a reserved username - don't allow this to go to another realm... listener.onFailure(Exceptions.authenticationError("failed to lookup user [{}]", username)); } - }, listener::onFailure)); + }); } } @@ -170,7 +206,6 @@ private User getUser(String username, ReservedUserInfo userInfo) { } } - public void users(ActionListener> listener) { if (realmEnabled == false) { listener.onResponse(anonymousEnabled ? Collections.singletonList(anonymousUser) : Collections.emptyList()); @@ -211,23 +246,18 @@ public void users(ActionListener> listener) { } } - - private void getUserInfo(final String username, ActionListener listener) { - if (securityIndex.indexExists() == false) { - listener.onResponse(getDefaultUserInfo(username)); - } else { - nativeUsersStore.getReservedUserInfo(username, ActionListener.wrap((userInfo) -> { - if (userInfo == null) { - listener.onResponse(getDefaultUserInfo(username)); - } else { - listener.onResponse(userInfo); - } - }, (e) -> { - logger.error((Supplier) () -> - new ParameterizedMessage("failed to retrieve password hash for reserved user [{}]", username), e); - listener.onResponse(null); - })); - } + private void getUserInfo(final String username, Consumer consumer) { + nativeUsersStore.getReservedUserInfo(username, ActionListener.wrap((userInfo) -> { + if (userInfo == null) { + consumer.accept(getDefaultUserInfo(username)); + } else { + consumer.accept(userInfo); + } + }, (e) -> { + logger.error((Supplier) () -> + new ParameterizedMessage("failed to retrieve password hash for reserved user [{}]", username), e); + consumer.accept(null); + })); } private void logDeprecatedUser(final User user){ @@ -242,7 +272,15 @@ private void logDeprecatedUser(final User user){ private ReservedUserInfo getDefaultUserInfo(String username) { if (ElasticUser.NAME.equals(username)) { - return bootstrapUserInfo.deepClone(); + if (elasticUserAutoconfigured) { + assert bootstrapUserInfo == null; + assert autoconfigUserInfo != null; + return autoconfigUserInfo; + } else { + assert bootstrapUserInfo != null; + assert autoconfigUserInfo == null; + return bootstrapUserInfo; + } } else { return ReservedUserInfo.defaultEnabledUserInfo(); } @@ -250,5 +288,6 @@ private ReservedUserInfo getDefaultUserInfo(String username) { public static void addSettings(List> settingsList) { settingsList.add(BOOTSTRAP_ELASTIC_PASSWORD); + settingsList.add(AUTOCONFIG_ELASTIC_PASSWORD_HASH); } } diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/enrollment/tool/AutoConfigGenerateElasticPasswordHash.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/enrollment/tool/AutoConfigGenerateElasticPasswordHash.java index c96aeead444a0..b762f7648775b 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/enrollment/tool/AutoConfigGenerateElasticPasswordHash.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/enrollment/tool/AutoConfigGenerateElasticPasswordHash.java @@ -19,7 +19,7 @@ import org.elasticsearch.xpack.core.XPackSettings; import org.elasticsearch.xpack.core.security.authc.support.Hasher; -import static org.elasticsearch.xpack.security.authc.esnative.ReservedRealm.AUTOCONFIG_BOOOTSTRAP_ELASTIC_PASSWORD_HASH; +import static org.elasticsearch.xpack.security.authc.esnative.ReservedRealm.AUTOCONFIG_ELASTIC_PASSWORD_HASH; import static org.elasticsearch.xpack.security.tool.CommandUtils.generatePassword; /** @@ -53,7 +53,7 @@ protected void execute(Terminal terminal, OptionSet options, Environment env) th SecureString elasticPassword = new SecureString(generatePassword(20)); KeyStoreWrapper nodeKeystore = KeyStoreWrapper.bootstrap(env.configFile(), () -> new SecureString(new char[0])) ) { - nodeKeystore.setString(AUTOCONFIG_BOOOTSTRAP_ELASTIC_PASSWORD_HASH.getKey(), hasher.hash(elasticPassword)); + nodeKeystore.setString(AUTOCONFIG_ELASTIC_PASSWORD_HASH.getKey(), hasher.hash(elasticPassword)); nodeKeystore.save(env.configFile(), new char[0]); terminal.print(Terminal.Verbosity.NORMAL, elasticPassword.toString()); } catch (Exception e) { diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/user/TransportGetUsersActionTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/user/TransportGetUsersActionTests.java index ea97f4bd26755..c0e6c61855380 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/user/TransportGetUsersActionTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/user/TransportGetUsersActionTests.java @@ -91,7 +91,7 @@ public void testAnonymousUser() { when(securityIndex.isAvailable()).thenReturn(true); AnonymousUser anonymousUser = new AnonymousUser(settings); ReservedRealm reservedRealm = - new ReservedRealm(mock(Environment.class), settings, usersStore, anonymousUser, securityIndex, threadPool); + new ReservedRealm(mock(Environment.class), settings, usersStore, anonymousUser, threadPool); TransportService transportService = new TransportService(Settings.EMPTY, mock(Transport.class), null, TransportService.NOOP_TRANSPORT_INTERCEPTOR, x -> null, null, Collections.emptySet()); TransportGetUsersAction action = new TransportGetUsersAction(Settings.EMPTY, mock(ActionFilters.class), @@ -163,7 +163,7 @@ public void testReservedUsersOnly() { ReservedRealmTests.mockGetAllReservedUserInfo(usersStore, Collections.emptyMap()); ReservedRealm reservedRealm = - new ReservedRealm(mock(Environment.class), settings, usersStore, new AnonymousUser(settings), securityIndex, threadPool); + new ReservedRealm(mock(Environment.class), settings, usersStore, new AnonymousUser(settings), threadPool); PlainActionFuture> userFuture = new PlainActionFuture<>(); reservedRealm.users(userFuture); final Collection allReservedUsers = userFuture.actionGet(); @@ -209,7 +209,7 @@ public void testGetAllUsers() { when(securityIndex.isAvailable()).thenReturn(true); ReservedRealmTests.mockGetAllReservedUserInfo(usersStore, Collections.emptyMap()); ReservedRealm reservedRealm = new ReservedRealm(mock(Environment.class), settings, usersStore, new AnonymousUser(settings), - securityIndex, threadPool); + threadPool); TransportService transportService = new TransportService(Settings.EMPTY, mock(Transport.class), null, TransportService.NOOP_TRANSPORT_INTERCEPTOR, x -> null, null, Collections.emptySet()); TransportGetUsersAction action = new TransportGetUsersAction(Settings.EMPTY, mock(ActionFilters.class), diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/user/TransportPutUserActionTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/user/TransportPutUserActionTests.java index e489d36c7c544..46d8f20e1b403 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/user/TransportPutUserActionTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/user/TransportPutUserActionTests.java @@ -33,7 +33,6 @@ import org.elasticsearch.xpack.security.authc.esnative.NativeUsersStore; import org.elasticsearch.xpack.security.authc.esnative.ReservedRealm; import org.elasticsearch.xpack.security.authc.esnative.ReservedRealmTests; -import org.elasticsearch.xpack.security.support.SecurityIndexManager; import java.util.Collection; import java.util.Collections; @@ -121,14 +120,12 @@ public void onFailure(Exception e) { public void testReservedUser() { NativeUsersStore usersStore = mock(NativeUsersStore.class); - SecurityIndexManager securityIndex = mock(SecurityIndexManager.class); - when(securityIndex.isAvailable()).thenReturn(true); ReservedRealmTests.mockGetAllReservedUserInfo(usersStore, Collections.emptyMap()); Settings settings = Settings.builder().put("path.home", createTempDir()).build(); final ThreadPool threadPool = mock(ThreadPool.class); when(threadPool.getThreadContext()).thenReturn(new ThreadContext(settings)); ReservedRealm reservedRealm = new ReservedRealm(TestEnvironment.newEnvironment(settings), settings, usersStore, - new AnonymousUser(settings), securityIndex, threadPool); + new AnonymousUser(settings), threadPool); PlainActionFuture> userFuture = new PlainActionFuture<>(); reservedRealm.users(userFuture); final User reserved = randomFrom(userFuture.actionGet().toArray(new User[0])); diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/esnative/NativeUsersStoreTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/esnative/NativeUsersStoreTests.java index f328ede14107f..d1a90f7859521 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/esnative/NativeUsersStoreTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/esnative/NativeUsersStoreTests.java @@ -10,21 +10,26 @@ import org.elasticsearch.action.ActionRequest; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.ActionType; +import org.elasticsearch.action.DocWriteRequest; import org.elasticsearch.action.get.GetRequest; import org.elasticsearch.action.get.GetResponse; +import org.elasticsearch.action.index.IndexRequest; +import org.elasticsearch.action.index.IndexResponse; import org.elasticsearch.action.support.PlainActionFuture; import org.elasticsearch.action.support.WriteRequest; import org.elasticsearch.action.update.UpdateRequest; import org.elasticsearch.client.Client; import org.elasticsearch.client.FilterClient; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.core.Tuple; import org.elasticsearch.common.settings.SecureString; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; +import org.elasticsearch.core.Tuple; import org.elasticsearch.index.get.GetResult; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.threadpool.ThreadPool; +import org.elasticsearch.xpack.core.security.action.realm.ClearRealmCacheRequest; +import org.elasticsearch.xpack.core.security.action.realm.ClearRealmCacheResponse; import org.elasticsearch.xpack.core.security.authc.AuthenticationResult; import org.elasticsearch.xpack.core.security.authc.support.Hasher; import org.elasticsearch.xpack.core.security.index.RestrictedIndicesNames; @@ -38,6 +43,7 @@ import org.elasticsearch.xpack.core.security.user.User; import org.elasticsearch.xpack.security.support.SecurityIndexManager; import org.junit.Before; +import org.mockito.Mockito; import java.io.IOException; import java.util.Collections; @@ -45,6 +51,7 @@ import java.util.List; import java.util.Map; import java.util.concurrent.CopyOnWriteArrayList; +import java.util.concurrent.ExecutionException; import java.util.function.Consumer; import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; @@ -53,6 +60,7 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.notNullValue; import static org.hamcrest.CoreMatchers.nullValue; +import static org.hamcrest.Matchers.is; import static org.mockito.Matchers.any; import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.mock; @@ -210,6 +218,36 @@ public void testDefaultReservedUserInfoPasswordEmpty() { assertThat(constructedUserInfo.hasEmptyPassword(), equalTo(false)); } + @SuppressWarnings("unchecked") + public void testCreateElasticUser() throws Exception { + final NativeUsersStore nativeUsersStore = startNativeUsersStore(); + + PlainActionFuture future = new PlainActionFuture<>(); + char[] passwordHash = randomAlphaOfLength(4).toCharArray(); + nativeUsersStore.createElasticUser(passwordHash, future); + + Tuple> createElasticUserRequest = findRequest(IndexRequest.class); + assertThat(createElasticUserRequest.v1().opType(), is(DocWriteRequest.OpType.CREATE)); + assertThat(createElasticUserRequest.v1().index(), is(RestrictedIndicesNames.SECURITY_MAIN_ALIAS)); + assertThat(createElasticUserRequest.v1().id(), is(NativeUsersStore.getIdForUser(NativeUsersStore.RESERVED_USER_TYPE, "elastic"))); + assertThat(createElasticUserRequest.v1().getRefreshPolicy(), is(WriteRequest.RefreshPolicy.IMMEDIATE)); + + if (randomBoolean()) { + ((ActionListener) createElasticUserRequest.v2()).onResponse(Mockito.mock(IndexResponse.class)); + Tuple> clearRealmCacheRequest = findRequest(ClearRealmCacheRequest.class); + assertThat(clearRealmCacheRequest.v1().allRealms(), is(true)); + assertThat(clearRealmCacheRequest.v1().usernames().length, is(1)); + assertThat(clearRealmCacheRequest.v1().usernames()[0], is("elastic")); + ((ActionListener) clearRealmCacheRequest.v2()).onResponse(Mockito.mock(ClearRealmCacheResponse.class)); + future.get(); + } else { + Exception exception = mock(Exception.class); + createElasticUserRequest.v2().onFailure(exception); + ExecutionException executionException = expectThrows(ExecutionException.class, () -> future.get()); + assertThat(executionException.getCause(), is(exception)); + } + } + @SuppressWarnings("unchecked") private ARequest actionRespond(Class requestClass, AResponse response) { diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/esnative/ReservedRealmTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/esnative/ReservedRealmTests.java index 5d3f2f518bb19..3ad210962c991 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/esnative/ReservedRealmTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/esnative/ReservedRealmTests.java @@ -6,6 +6,7 @@ */ package org.elasticsearch.xpack.security.authc.esnative; +import org.elasticsearch.ElasticsearchAuthenticationProcessingError; import org.elasticsearch.ElasticsearchSecurityException; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.support.PlainActionFuture; @@ -14,6 +15,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; import org.elasticsearch.env.Environment; +import org.elasticsearch.rest.RestStatus; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.xpack.core.XPackSettings; @@ -32,8 +34,8 @@ import org.elasticsearch.xpack.core.security.user.User; import org.elasticsearch.xpack.core.security.user.UsernamesField; import org.elasticsearch.xpack.security.authc.esnative.NativeUsersStore.ReservedUserInfo; -import org.elasticsearch.xpack.security.support.SecurityIndexManager; import org.junit.Before; +import org.mockito.ArgumentCaptor; import org.mockito.stubbing.Answer; import java.util.Collection; @@ -49,8 +51,11 @@ import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.empty; import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.instanceOf; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.nullValue; +import static org.mockito.Matchers.any; +import static org.mockito.Matchers.anyString; import static org.mockito.Matchers.eq; import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.mock; @@ -67,14 +72,11 @@ public class ReservedRealmTests extends ESTestCase { private static final SecureString EMPTY_PASSWORD = new SecureString("".toCharArray()); private NativeUsersStore usersStore; - private SecurityIndexManager securityIndex; private ThreadPool threadPool; @Before public void setupMocks() throws Exception { usersStore = mock(NativeUsersStore.class); - securityIndex = mock(SecurityIndexManager.class); - when(securityIndex.isAvailable()).thenReturn(true); mockGetAllReservedUserInfo(usersStore, Collections.emptyMap()); threadPool = mock(ThreadPool.class); when(threadPool.getThreadContext()).thenReturn(new ThreadContext(Settings.EMPTY)); @@ -84,17 +86,42 @@ public void testInvalidHashingAlgorithmFails() { final String invalidAlgoId = randomFrom("sha1", "md5", "noop"); final Settings invalidSettings = Settings.builder().put("xpack.security.authc.password_hashing.algorithm", invalidAlgoId).build(); IllegalArgumentException exception = expectThrows(IllegalArgumentException.class, () -> new ReservedRealm(mock(Environment.class), - invalidSettings, usersStore, new AnonymousUser(Settings.EMPTY), securityIndex, threadPool)); + invalidSettings, usersStore, new AnonymousUser(Settings.EMPTY), threadPool)); assertThat(exception.getMessage(), containsString(invalidAlgoId)); assertThat(exception.getMessage(), containsString("Invalid algorithm")); } + public void testInvalidAutoConfigPasswordHashFails() { + char[] invalidAutoConfHash = + randomFrom(Hasher.MD5.hash(new SecureString(randomAlphaOfLengthBetween(0, 8).toCharArray())), + Hasher.SHA1.hash(new SecureString(randomAlphaOfLengthBetween(0, 8).toCharArray())), + Hasher.SSHA256.hash(new SecureString(randomAlphaOfLengthBetween(0, 8).toCharArray())), + randomAlphaOfLengthBetween(1, 16).toCharArray(), + new char[0] + ); + MockSecureSettings mockSecureSettings = new MockSecureSettings(); + mockSecureSettings.setString("autoconfiguration.password_hash", new String(invalidAutoConfHash)); + if (randomBoolean()) { + mockSecureSettings.setString("bootstrap.password", "foobar longer than 14 chars because of FIPS"); + } + Settings invalidSettings = Settings.builder().setSecureSettings(mockSecureSettings).build(); + IllegalArgumentException exception = expectThrows(IllegalArgumentException.class, () -> new ReservedRealm(mock(Environment.class), + invalidSettings, usersStore, new AnonymousUser(Settings.EMPTY), threadPool)); + assertThat(exception.getMessage(), containsString("Invalid password hash for elastic user auto configuration")); + } + public void testReservedUserEmptyPasswordAuthenticationFails() throws Throwable { final String principal = randomFrom(UsernamesField.ELASTIC_NAME, UsernamesField.KIBANA_NAME, UsernamesField.LOGSTASH_NAME, UsernamesField.BEATS_NAME); + SecureString password = new SecureString("password longer than 14 chars because of FIPS".toCharArray()); + // Mocked users store is initiated with default hashing algorithm + final Hasher hasher = Hasher.resolve("bcrypt"); + char[] hash = hasher.hash(password); + ReservedUserInfo userInfo = new ReservedUserInfo(hash, true); + mockGetAllReservedUserInfo(usersStore, Collections.singletonMap(principal, userInfo)); final ReservedRealm reservedRealm = new ReservedRealm(mock(Environment.class), Settings.EMPTY, usersStore, - new AnonymousUser(Settings.EMPTY), securityIndex, threadPool); + new AnonymousUser(Settings.EMPTY), threadPool); PlainActionFuture listener = new PlainActionFuture<>(); @@ -103,14 +130,22 @@ public void testReservedUserEmptyPasswordAuthenticationFails() throws Throwable } public void testAuthenticationDisabled() throws Throwable { - Settings settings = Settings.builder().put(XPackSettings.RESERVED_REALM_ENABLED_SETTING.getKey(), false).build(); - final boolean securityIndexExists = randomBoolean(); - if (securityIndexExists) { - when(securityIndex.indexExists()).thenReturn(true); + MockSecureSettings mockSecureSettings = new MockSecureSettings(); + if (randomBoolean()) { + mockSecureSettings.setString("bootstrap.password", "foobar longer than 14 chars because of FIPS"); + } + if (randomBoolean()) { + mockSecureSettings.setString("autoconfiguration.password_hash", + new String(randomFrom(Hasher.BCRYPT, Hasher.PBKDF2).hash( + new SecureString("barbaz longer than 14 chars because of FIPS".toCharArray())))); } + Settings settings = Settings.builder() + .put(XPackSettings.RESERVED_REALM_ENABLED_SETTING.getKey(), false) + .setSecureSettings(mockSecureSettings) + .build(); final ReservedRealm reservedRealm = new ReservedRealm(mock(Environment.class), settings, usersStore, - new AnonymousUser(settings), securityIndex, threadPool); + new AnonymousUser(settings), threadPool); final User expected = randomReservedUser(true); final String principal = expected.principal(); @@ -132,13 +167,12 @@ public void testAuthenticationDisabledUserWithStoredPassword() throws Throwable private void verifySuccessfulAuthentication(boolean enabled) throws Exception { final ReservedRealm reservedRealm = new ReservedRealm(mock(Environment.class), Settings.EMPTY, usersStore, - new AnonymousUser(Settings.EMPTY), securityIndex, threadPool); + new AnonymousUser(Settings.EMPTY), threadPool); final User expectedUser = randomReservedUser(enabled); final String principal = expectedUser.principal(); - final SecureString newPassword = new SecureString("foobar".toCharArray()); + final SecureString newPassword = new SecureString("foobar longer than 14 chars because of FIPS".toCharArray()); // Mocked users store is initiated with default hashing algorithm final Hasher hasher = Hasher.resolve("bcrypt"); - when(securityIndex.indexExists()).thenReturn(true); doAnswer(getAnswer(enabled, newPassword, hasher)).when(usersStore).getReservedUserInfo(eq(principal), anyActionListener()); // test empty password @@ -156,7 +190,6 @@ private void verifySuccessfulAuthentication(boolean enabled) throws Exception { assertEquals(expectedUser, authenticated); assertThat(expectedUser.enabled(), is(enabled)); - verify(securityIndex, times(2)).indexExists(); verify(usersStore, times(2)).getReservedUserInfo(eq(principal), anyActionListener()); verifyNoMoreInteractions(usersStore); @@ -176,17 +209,30 @@ private Answer> getAnswer(boolean enabled, SecureString newPassword, } public void testLookup() throws Exception { - final ReservedRealm reservedRealm = - new ReservedRealm(mock(Environment.class), Settings.EMPTY, usersStore, - new AnonymousUser(Settings.EMPTY), securityIndex, threadPool); final User expectedUser = randomReservedUser(true); final String principal = expectedUser.principal(); + // auto conf and bootstrap passwords only influence the elastic user + MockSecureSettings mockSecureSettings = new MockSecureSettings(); + if (randomBoolean()) { + mockSecureSettings.setString("bootstrap.password", "foobar longer than 14 chars because of FIPS"); + } + if (randomBoolean()) { + mockSecureSettings.setString("autoconfiguration.password_hash", + new String(randomFrom(Hasher.BCRYPT, Hasher.PBKDF2).hash( + new SecureString("barbaz longer than 14 chars because of FIPS".toCharArray())))); + } + final ReservedRealm reservedRealm = + new ReservedRealm(mock(Environment.class), + Settings.builder() + .setSecureSettings(mockSecureSettings) + .build(), usersStore, + new AnonymousUser(Settings.EMPTY), threadPool); PlainActionFuture listener = new PlainActionFuture<>(); reservedRealm.doLookupUser(principal, listener); final User user = listener.actionGet(); assertEquals(expectedUser, user); - verify(securityIndex).indexExists(); + verify(usersStore).getReservedUserInfo(eq(principal), anyActionListener()); PlainActionFuture future = new PlainActionFuture<>(); reservedRealm.doLookupUser("foobar", assertListenerIsOnlyCalledOnce(future)); @@ -196,10 +242,22 @@ public void testLookup() throws Exception { } public void testLookupDisabled() throws Exception { - Settings settings = Settings.builder().put(XPackSettings.RESERVED_REALM_ENABLED_SETTING.getKey(), false).build(); + MockSecureSettings mockSecureSettings = new MockSecureSettings(); + if (randomBoolean()) { + mockSecureSettings.setString("bootstrap.password", "foobar longer than 14 chars because of FIPS"); + } + if (randomBoolean()) { + mockSecureSettings.setString("autoconfiguration.password_hash", + new String(randomFrom(Hasher.BCRYPT, Hasher.PBKDF2).hash( + new SecureString("barbaz longer than 14 chars because of FIPS".toCharArray())))); + } + Settings settings = Settings.builder() + .put(XPackSettings.RESERVED_REALM_ENABLED_SETTING.getKey(), false) + .setSecureSettings(mockSecureSettings) + .build(); final ReservedRealm reservedRealm = new ReservedRealm(mock(Environment.class), settings, usersStore, new AnonymousUser(settings), - securityIndex, threadPool); + threadPool); final User expectedUser = randomReservedUser(true); final String principal = expectedUser.principal(); @@ -210,30 +268,39 @@ public void testLookupDisabled() throws Exception { verifyZeroInteractions(usersStore); } - public void testLookupDisabledAnonymous() throws Exception { + MockSecureSettings mockSecureSettings = new MockSecureSettings(); + if (randomBoolean()) { + mockSecureSettings.setString("bootstrap.password", "foobar longer than 14 chars because of FIPS"); + } + if (randomBoolean()) { + mockSecureSettings.setString("autoconfiguration.password_hash", + new String(randomFrom(Hasher.BCRYPT, Hasher.PBKDF2).hash( + new SecureString("barbaz longer than 14 chars because of FIPS".toCharArray())))); + } Settings settings = Settings.builder() .put(XPackSettings.RESERVED_REALM_ENABLED_SETTING.getKey(), false) .put(AnonymousUser.ROLES_SETTING.getKey(), "anonymous") + .setSecureSettings(mockSecureSettings) .build(); final ReservedRealm reservedRealm = new ReservedRealm(mock(Environment.class), settings, usersStore, new AnonymousUser(settings), - securityIndex, threadPool); + threadPool); final User expectedUser = new AnonymousUser(settings); final String principal = expectedUser.principal(); PlainActionFuture listener = new PlainActionFuture<>(); reservedRealm.doLookupUser(principal, assertListenerIsOnlyCalledOnce(listener)); assertThat(listener.actionGet(), equalTo(expectedUser)); + verifyZeroInteractions(usersStore); } public void testLookupThrows() throws Exception { final ReservedRealm reservedRealm = new ReservedRealm(mock(Environment.class), Settings.EMPTY, usersStore, - new AnonymousUser(Settings.EMPTY), securityIndex, threadPool); + new AnonymousUser(Settings.EMPTY), threadPool); final User expectedUser = randomReservedUser(true); final String principal = expectedUser.principal(); - when(securityIndex.indexExists()).thenReturn(true); final RuntimeException e = new RuntimeException("store threw"); doAnswer((i) -> { ActionListener callback = (ActionListener) i.getArguments()[1]; @@ -246,7 +313,6 @@ public void testLookupThrows() throws Exception { ElasticsearchSecurityException securityException = expectThrows(ElasticsearchSecurityException.class, future::actionGet); assertThat(securityException.getMessage(), containsString("failed to lookup")); - verify(securityIndex).indexExists(); verify(usersStore).getReservedUserInfo(eq(principal), anyActionListener()); verifyNoMoreInteractions(usersStore); @@ -273,7 +339,7 @@ public void testIsReservedDisabled() { public void testGetUsers() { final ReservedRealm reservedRealm = new ReservedRealm(mock(Environment.class), Settings.EMPTY, usersStore, - new AnonymousUser(Settings.EMPTY), securityIndex, threadPool); + new AnonymousUser(Settings.EMPTY), threadPool); PlainActionFuture> userFuture = new PlainActionFuture<>(); reservedRealm.users(userFuture); assertThat(userFuture.actionGet(), @@ -283,13 +349,23 @@ public void testGetUsers() { public void testGetUsersDisabled() { final boolean anonymousEnabled = randomBoolean(); + MockSecureSettings mockSecureSettings = new MockSecureSettings(); + if (randomBoolean()) { + mockSecureSettings.setString("bootstrap.password", "foobar longer than 14 chars because of FIPS"); + } + if (randomBoolean()) { + mockSecureSettings.setString("autoconfiguration.password_hash", + new String(randomFrom(Hasher.BCRYPT, Hasher.PBKDF2).hash( + new SecureString("barbaz longer than 14 chars because of FIPS".toCharArray())))); + } Settings settings = Settings.builder() .put(XPackSettings.RESERVED_REALM_ENABLED_SETTING.getKey(), false) .put(AnonymousUser.ROLES_SETTING.getKey(), anonymousEnabled ? "user" : "") + .setSecureSettings(mockSecureSettings) .build(); final AnonymousUser anonymousUser = new AnonymousUser(settings); final ReservedRealm reservedRealm = new ReservedRealm(mock(Environment.class), settings, usersStore, anonymousUser, - securityIndex, threadPool); + threadPool); PlainActionFuture> userFuture = new PlainActionFuture<>(); reservedRealm.users(userFuture); if (anonymousEnabled) { @@ -300,27 +376,44 @@ public void testGetUsersDisabled() { } public void testFailedAuthentication() throws Exception { - when(securityIndex.indexExists()).thenReturn(true); + MockSecureSettings mockSecureSettings = new MockSecureSettings(); + if (randomBoolean()) { + mockSecureSettings.setString("bootstrap.password", "foobar longer than 14 chars because of FIPS"); + } + if (randomBoolean()) { + mockSecureSettings.setString("autoconfiguration.password_hash", + new String(randomFrom(Hasher.BCRYPT, Hasher.PBKDF2).hash( + new SecureString("barbaz longer than 14 chars because of FIPS".toCharArray())))); + } SecureString password = new SecureString("password".toCharArray()); // Mocked users store is initiated with default hashing algorithm final Hasher hasher = Hasher.resolve("bcrypt"); char[] hash = hasher.hash(password); + boolean enabled = randomBoolean(); + User reservedUser = randomReservedUser(enabled); + String principal = reservedUser.principal(); ReservedUserInfo userInfo = new ReservedUserInfo(hash, true); - mockGetAllReservedUserInfo(usersStore, Collections.singletonMap("elastic", userInfo)); - final ReservedRealm reservedRealm = new ReservedRealm(mock(Environment.class), Settings.EMPTY, usersStore, - new AnonymousUser(Settings.EMPTY), securityIndex, threadPool); + mockGetAllReservedUserInfo(usersStore, Collections.singletonMap(principal, userInfo)); + final ReservedRealm reservedRealm = new ReservedRealm(mock(Environment.class), + Settings.builder().setSecureSettings(mockSecureSettings).build(), + usersStore, + new AnonymousUser(Settings.EMPTY), threadPool); if (randomBoolean()) { PlainActionFuture future = new PlainActionFuture<>(); - - reservedRealm.authenticate(new UsernamePasswordToken(ElasticUser.NAME, password), future); + reservedRealm.authenticate(new UsernamePasswordToken(principal, password), future); User user = future.actionGet().getUser(); - assertEquals(new ElasticUser(true), user); + assertEquals(reservedUser, user); + if (new KibanaUser(enabled).equals(reservedUser)) { + assertWarnings("The user [kibana] is deprecated and will be removed in a future version of Elasticsearch. " + + "Please use the [kibana_system] user instead."); + } } PlainActionFuture future = new PlainActionFuture<>(); - reservedRealm.authenticate(new UsernamePasswordToken(ElasticUser.NAME, new SecureString("foobar".toCharArray())), future); - assertFailedAuthentication(future, ElasticUser.NAME); + reservedRealm.authenticate(new UsernamePasswordToken(principal, + new SecureString("foobar longer than 14 chars because of FIPS".toCharArray())), future); + assertFailedAuthentication(future, principal); } private void assertFailedAuthentication(PlainActionFuture future, String principal) throws Exception { @@ -332,38 +425,143 @@ private void assertFailedAuthentication(PlainActionFuture assertThat(result.getException(), is(nullValue())); } - @SuppressWarnings("unchecked") - public void testBootstrapElasticPasswordWorksOnceSecurityIndexExists() throws Exception { + public void testBootstrapElasticPasswordWorksWhenElasticUserIsMissing() throws Exception { + doAnswer((i) -> { + @SuppressWarnings("unchecked") + ActionListener callback = (ActionListener) i.getArguments()[1]; + callback.onResponse(null); + return null; + }).when(usersStore).getReservedUserInfo(eq("elastic"), anyActionListener()); + + MockSecureSettings mockSecureSettings = new MockSecureSettings(); + mockSecureSettings.setString("bootstrap.password", "foobar longer than 14 chars because of FIPS"); + Settings settings = Settings.builder().setSecureSettings(mockSecureSettings).build(); + + ReservedRealm reservedRealm = new ReservedRealm(mock(Environment.class), settings, usersStore, + new AnonymousUser(Settings.EMPTY), threadPool); + PlainActionFuture listener = new PlainActionFuture<>(); + + reservedRealm.doAuthenticate(new UsernamePasswordToken(new ElasticUser(true).principal(), + mockSecureSettings.getString("bootstrap.password")), + listener); + AuthenticationResult result = listener.get(); + assertThat(result.getStatus(), is(AuthenticationResult.Status.SUCCESS)); + + // add auto configured password which should be ignored because the bootstrap password has priority + mockSecureSettings.setString("autoconfiguration.password_hash", new String(randomFrom(Hasher.BCRYPT, Hasher.PBKDF2) + .hash(new SecureString("bazbar longer than 14 chars because of FIPS".toCharArray())))); + settings = Settings.builder().setSecureSettings(mockSecureSettings).build(); + + reservedRealm = new ReservedRealm(mock(Environment.class), settings, usersStore, new AnonymousUser(Settings.EMPTY), threadPool); + + // authn still works for the bootstrap password + listener = new PlainActionFuture<>(); + reservedRealm.doAuthenticate(new UsernamePasswordToken(new ElasticUser(true).principal(), + new SecureString("foobar longer than 14 chars because of FIPS".toCharArray())), + listener); + result = listener.get(); + assertThat(result.getStatus(), is(AuthenticationResult.Status.SUCCESS)); + + // authn fails for the auto configured password hash + listener = new PlainActionFuture<>(); + reservedRealm.doAuthenticate(new UsernamePasswordToken(new ElasticUser(true).principal(), + new SecureString("bazbar longer than 14 chars because of FIPS".toCharArray())), + listener); + assertFailedAuthentication(listener, ElasticUser.NAME); + } + + public void testAutoconfigElasticPasswordWorksWhenElasticUserIsMissing() throws Exception { MockSecureSettings mockSecureSettings = new MockSecureSettings(); - mockSecureSettings.setString("bootstrap.password", "foobar"); + char[] autoconfHash = randomFrom(Hasher.BCRYPT, Hasher.PBKDF2).hash( + new SecureString("foobar longer than 14 chars because of FIPS".toCharArray())); + mockSecureSettings.setString("autoconfiguration.password_hash", new String(autoconfHash)); Settings settings = Settings.builder().setSecureSettings(mockSecureSettings).build(); - when(securityIndex.indexExists()).thenReturn(true); final ReservedRealm reservedRealm = new ReservedRealm(mock(Environment.class), settings, usersStore, - new AnonymousUser(Settings.EMPTY), securityIndex, threadPool); + new AnonymousUser(Settings.EMPTY), threadPool); PlainActionFuture listener = new PlainActionFuture<>(); doAnswer((i) -> { - @SuppressWarnings("rawtypes") - ActionListener callback = (ActionListener) i.getArguments()[1]; + @SuppressWarnings("unchecked") + ActionListener callback = (ActionListener) i.getArguments()[1]; callback.onResponse(null); return null; }).when(usersStore).getReservedUserInfo(eq("elastic"), anyActionListener()); + // mock auto config password is promoted successfully + doAnswer((i) -> { + @SuppressWarnings("unchecked") + ActionListener callback = (ActionListener) i.getArguments()[1]; + callback.onResponse(null); + return null; + }).when(usersStore).createElasticUser(any(char[].class), anyActionListener()); reservedRealm.doAuthenticate(new UsernamePasswordToken(new ElasticUser(true).principal(), - mockSecureSettings.getString("bootstrap.password")), + new SecureString("foobar longer than 14 chars because of FIPS".toCharArray())), listener); - final AuthenticationResult result = listener.get(); + AuthenticationResult result = listener.get(); assertThat(result.getStatus(), is(AuthenticationResult.Status.SUCCESS)); + verify(usersStore).getReservedUserInfo(eq("elastic"), anyActionListener()); + ArgumentCaptor userHashCaptor = ArgumentCaptor.forClass(char[].class); + verify(usersStore).createElasticUser(userHashCaptor.capture(), anyActionListener()); + assertThat(userHashCaptor.getValue(), is(autoconfHash)); + + // wrong password doesn't attempt to promote + listener = new PlainActionFuture<>(); + reservedRealm.doAuthenticate(new UsernamePasswordToken(new ElasticUser(true).principal(), + new SecureString("wrong password".toCharArray())), + listener); + assertFailedAuthentication(listener, ElasticUser.NAME); + verify(usersStore, times(2)).getReservedUserInfo(eq("elastic"), anyActionListener()); + verify(usersStore).createElasticUser(any(char[].class), anyActionListener()); + } + + public void testAutoconfigElasticPasswordAuthnErrorWhenHashPromotionFails() throws Exception { + MockSecureSettings mockSecureSettings = new MockSecureSettings(); + char[] autoconfHash = randomFrom(Hasher.BCRYPT, Hasher.PBKDF2).hash( + new SecureString("foobar longer than 14 chars because of FIPS".toCharArray())); + mockSecureSettings.setString("autoconfiguration.password_hash", new String(autoconfHash)); + Settings settings = Settings.builder().setSecureSettings(mockSecureSettings).build(); + + final ReservedRealm reservedRealm = new ReservedRealm(mock(Environment.class), settings, usersStore, + new AnonymousUser(Settings.EMPTY), threadPool); + PlainActionFuture listener = new PlainActionFuture<>(); + + doAnswer((i) -> { + @SuppressWarnings("unchecked") + ActionListener callback = (ActionListener) i.getArguments()[1]; + callback.onResponse(null); + return null; + }).when(usersStore).getReservedUserInfo(eq("elastic"), anyActionListener()); + // mock auto config password is NOT promoted successfully + doAnswer((i) -> { + @SuppressWarnings("unchecked") + ActionListener callback = (ActionListener) i.getArguments()[1]; + callback.onFailure(new Exception("any failure to promote the auto configured password")); + return null; + }).when(usersStore).createElasticUser(any(char[].class), anyActionListener()); + reservedRealm.doAuthenticate(new UsernamePasswordToken(new ElasticUser(true).principal(), + new SecureString("foobar longer than 14 chars because of FIPS".toCharArray())), + listener); + ExecutionException exception = expectThrows(ExecutionException.class, () -> listener.get()); + assertThat(exception.getCause(), instanceOf(ElasticsearchAuthenticationProcessingError.class)); + assertThat(((ElasticsearchAuthenticationProcessingError)exception.getCause()).status(), is(RestStatus.INTERNAL_SERVER_ERROR)); + verify(usersStore).getReservedUserInfo(eq("elastic"), anyActionListener()); + ArgumentCaptor userHashCaptor = ArgumentCaptor.forClass(char[].class); + verify(usersStore).createElasticUser(userHashCaptor.capture(), anyActionListener()); + assertThat(userHashCaptor.getValue(), is(autoconfHash)); } public void testBootstrapElasticPasswordFailsOnceElasticUserExists() throws Exception { MockSecureSettings mockSecureSettings = new MockSecureSettings(); - mockSecureSettings.setString("bootstrap.password", "foobar"); + mockSecureSettings.setString("bootstrap.password", "foobar longer than 14 chars because of FIPS"); + if (randomBoolean()) { + mockSecureSettings.setString("autoconfiguration.password_hash", + new String(randomFrom(Hasher.BCRYPT, Hasher.PBKDF2).hash( + new SecureString("barbaz longer than 14 chars because of FIPS".toCharArray())))); + } Settings settings = Settings.builder().setSecureSettings(mockSecureSettings).build(); - when(securityIndex.indexExists()).thenReturn(true); final ReservedRealm reservedRealm = new ReservedRealm(mock(Environment.class), settings, usersStore, - new AnonymousUser(Settings.EMPTY), securityIndex, threadPool); + new AnonymousUser(Settings.EMPTY), threadPool); PlainActionFuture listener = new PlainActionFuture<>(); SecureString password = new SecureString("password".toCharArray()); // Mocked users store is initiated with default hashing algorithm @@ -379,6 +577,10 @@ public void testBootstrapElasticPasswordFailsOnceElasticUserExists() throws Exce reservedRealm.doAuthenticate(new UsernamePasswordToken(new ElasticUser(true).principal(), mockSecureSettings.getString("bootstrap.password")), listener); assertFailedAuthentication(listener, "elastic"); + listener = new PlainActionFuture<>(); + reservedRealm.doAuthenticate(new UsernamePasswordToken(new ElasticUser(true).principal(), + new SecureString("barbaz longer than 14 chars because of FIPS".toCharArray())), listener); + assertFailedAuthentication(listener, "elastic"); // now try with the real password listener = new PlainActionFuture<>(); reservedRealm.doAuthenticate(new UsernamePasswordToken(new ElasticUser(true).principal(), password), listener); @@ -386,32 +588,46 @@ public void testBootstrapElasticPasswordFailsOnceElasticUserExists() throws Exce assertThat(result.getStatus(), is(AuthenticationResult.Status.SUCCESS)); } - public void testBootstrapElasticPasswordWorksBeforeSecurityIndexExists() throws ExecutionException, InterruptedException { + public void testAutoconfigPasswordHashFailsOnceElasticUserExists() throws Exception { MockSecureSettings mockSecureSettings = new MockSecureSettings(); - mockSecureSettings.setString("bootstrap.password", "foobar"); + mockSecureSettings.setString("autoconfiguration.password_hash", + new String(randomFrom(Hasher.BCRYPT, Hasher.PBKDF2).hash( + new SecureString("auto_password longer than 14 chars because of FIPS".toCharArray())))); Settings settings = Settings.builder().setSecureSettings(mockSecureSettings).build(); - when(securityIndex.indexExists()).thenReturn(false); final ReservedRealm reservedRealm = new ReservedRealm(mock(Environment.class), settings, usersStore, - new AnonymousUser(Settings.EMPTY), securityIndex, threadPool); + new AnonymousUser(Settings.EMPTY), threadPool); PlainActionFuture listener = new PlainActionFuture<>(); - + // Mocked users store is initiated with default hashing algorithm + final Hasher hasher = Hasher.resolve("bcrypt"); + doAnswer(getAnswer(true, new SecureString("password longer than 14 chars because of FIPS".toCharArray()), hasher)).when(usersStore) + .getReservedUserInfo(eq("elastic"), anyActionListener()); reservedRealm.doAuthenticate(new UsernamePasswordToken(new ElasticUser(true).principal(), - mockSecureSettings.getString("bootstrap.password")), - listener); + new SecureString("password longer than 14 chars because of FIPS".toCharArray())), listener); final AuthenticationResult result = listener.get(); assertThat(result.getStatus(), is(AuthenticationResult.Status.SUCCESS)); + // but auto config password does not work + listener = new PlainActionFuture<>(); + reservedRealm.doAuthenticate(new UsernamePasswordToken(new ElasticUser(true).principal(), + new SecureString("auto_password longer than 14 chars because of FIPS".toCharArray())), listener); + assertFailedAuthentication(listener, "elastic"); + verify(usersStore, times(2)).getReservedUserInfo(eq("elastic"), anyActionListener()); + verify(usersStore, times(0)).createElasticUser(any(char[].class), anyActionListener()); } - public void testNonElasticUsersCannotUseBootstrapPasswordWhenSecurityIndexExists() throws Exception { + public void testNonElasticUsersCannotUseBootstrapPassword() throws Exception { final MockSecureSettings mockSecureSettings = new MockSecureSettings(); - final String password = randomAlphaOfLengthBetween(8, 24); + final String password = randomAlphaOfLengthBetween(15, 24); mockSecureSettings.setString("bootstrap.password", password); + if (randomBoolean()) { + mockSecureSettings.setString("autoconfiguration.password_hash", + new String(randomFrom(Hasher.BCRYPT, Hasher.PBKDF2).hash( + new SecureString("barbaz longer than 14 chars because of FIPS".toCharArray())))); + } Settings settings = Settings.builder().setSecureSettings(mockSecureSettings).build(); - when(securityIndex.indexExists()).thenReturn(true); final ReservedRealm reservedRealm = new ReservedRealm(mock(Environment.class), settings, usersStore, - new AnonymousUser(Settings.EMPTY), securityIndex, threadPool); + new AnonymousUser(Settings.EMPTY), threadPool); PlainActionFuture listener = new PlainActionFuture<>(); final String principal = randomFrom(KibanaUser.NAME, KibanaSystemUser.NAME, LogstashSystemUser.NAME, BeatsSystemUser.NAME, @@ -426,22 +642,26 @@ public void testNonElasticUsersCannotUseBootstrapPasswordWhenSecurityIndexExists assertThat(result.getStatus(), is(AuthenticationResult.Status.TERMINATE)); } - public void testNonElasticUsersCannotUseBootstrapPasswordWhenSecurityIndexDoesNotExists() throws Exception { + public void testNonElasticUsersCannotUseAutoconfigPasswordHash() throws Exception { final MockSecureSettings mockSecureSettings = new MockSecureSettings(); - final String password = randomAlphaOfLengthBetween(8, 24); - mockSecureSettings.setString("bootstrap.password", password); + final String password = randomAlphaOfLengthBetween(15, 24); + mockSecureSettings.setString("autoconfiguration.password_hash", + new String(randomFrom(Hasher.BCRYPT, Hasher.PBKDF2).hash(new SecureString(password.toCharArray())))); Settings settings = Settings.builder().setSecureSettings(mockSecureSettings).build(); - when(securityIndex.indexExists()).thenReturn(false); final ReservedRealm reservedRealm = new ReservedRealm(mock(Environment.class), settings, usersStore, - new AnonymousUser(Settings.EMPTY), securityIndex, threadPool); + new AnonymousUser(Settings.EMPTY), threadPool); PlainActionFuture listener = new PlainActionFuture<>(); final String principal = randomFrom(KibanaUser.NAME, KibanaSystemUser.NAME, LogstashSystemUser.NAME, BeatsSystemUser.NAME, APMSystemUser.NAME, RemoteMonitoringUser.NAME); - reservedRealm.doAuthenticate(new UsernamePasswordToken(principal, mockSecureSettings.getString("bootstrap.password")), listener); - final AuthenticationResult result = listener.get(); - assertThat(result.getStatus(), is(AuthenticationResult.Status.TERMINATE)); + doAnswer((i) -> { + ActionListener callback = (ActionListener) i.getArguments()[1]; + callback.onResponse(null); + return null; + }).when(usersStore).getReservedUserInfo(eq(principal), anyActionListener()); + reservedRealm.doAuthenticate(new UsernamePasswordToken(principal, new SecureString(password.toCharArray())), listener); + assertFailedAuthentication(listener, principal); } private User randomReservedUser(boolean enabled) { @@ -459,6 +679,11 @@ public static void mockGetAllReservedUserInfo(NativeUsersStore usersStore, Map { + ((ActionListener) i.getArguments()[1]).onResponse(null); + return null; + }).when(usersStore).getReservedUserInfo(anyString(), anyActionListener()); + for (Entry entry : collection.entrySet()) { doAnswer((i) -> { ((ActionListener) i.getArguments()[1]).onResponse(entry.getValue()); diff --git a/x-pack/qa/security-tools-tests/src/test/java/org/elasticsearch/xpack/security/enrollment/tool/AutoConfigGenerateElasticPasswordHashTests.java b/x-pack/qa/security-tools-tests/src/test/java/org/elasticsearch/xpack/security/enrollment/tool/AutoConfigGenerateElasticPasswordHashTests.java index 2b279eb9b3c11..b9b56f0ec8ea5 100644 --- a/x-pack/qa/security-tools-tests/src/test/java/org/elasticsearch/xpack/security/enrollment/tool/AutoConfigGenerateElasticPasswordHashTests.java +++ b/x-pack/qa/security-tools-tests/src/test/java/org/elasticsearch/xpack/security/enrollment/tool/AutoConfigGenerateElasticPasswordHashTests.java @@ -31,7 +31,7 @@ import java.util.Map; import static org.elasticsearch.test.SecurityIntegTestCase.getFastStoredHashAlgoForTests; -import static org.elasticsearch.xpack.security.authc.esnative.ReservedRealm.AUTOCONFIG_BOOOTSTRAP_ELASTIC_PASSWORD_HASH; +import static org.elasticsearch.xpack.security.authc.esnative.ReservedRealm.AUTOCONFIG_ELASTIC_PASSWORD_HASH; import static org.hamcrest.Matchers.containsInAnyOrder; import static org.hamcrest.Matchers.emptyString; import static org.hamcrest.Matchers.equalTo; @@ -98,7 +98,7 @@ public void testSuccessfullyGenerateAndStoreHash() throws Exception { assertNotNull(keyStoreWrapper); keyStoreWrapper.decrypt(new char[0]); assertThat(keyStoreWrapper.getSettingNames(), - containsInAnyOrder(AUTOCONFIG_BOOOTSTRAP_ELASTIC_PASSWORD_HASH.getKey(), "keystore.seed")); + containsInAnyOrder(AUTOCONFIG_ELASTIC_PASSWORD_HASH.getKey(), "keystore.seed")); } public void testExistingKeystoreWithWrongPassword() throws Exception { From e09edf4842df0debdc7de08a7a0fb61edd468b58 Mon Sep 17 00:00:00 2001 From: Bogdan Pintea Date: Tue, 5 Oct 2021 11:18:36 +0200 Subject: [PATCH 154/250] Mute CrossClusterSearchLeakIT#testSearch() (#78676) * Mute CrossClusterSearchLeakIT#testSearch() Mute CrossClusterSearchLeakIT#testSearch(). * style fix spacing around equal sign. --- .../org/elasticsearch/search/ccs/CrossClusterSearchLeakIT.java | 1 + 1 file changed, 1 insertion(+) diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/ccs/CrossClusterSearchLeakIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/ccs/CrossClusterSearchLeakIT.java index 4ff0089cdbb71..2774f8f6d4459 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/ccs/CrossClusterSearchLeakIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/ccs/CrossClusterSearchLeakIT.java @@ -66,6 +66,7 @@ private int indexDocs(Client client, String field, String index) { *
  • scroll vs no scroll
  • * */ + @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/78673") public void testSearch() throws Exception { assertAcked(client(LOCAL_CLUSTER).admin().indices().prepareCreate("demo") .setMapping("f", "type=keyword") From 310b4ac453925926e654b9d3fb3706d1fb780d97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Fern=C3=A1ndez=20Casta=C3=B1o?= Date: Tue, 5 Oct 2021 11:41:28 +0200 Subject: [PATCH 155/250] Respect generational files in recoveryDiff (#77695) Today `MetadataSnapshot#recoveryDiff` considers the `.liv` file as per-commit rather than per-segment and often transfers them during peer recoveries and snapshot restores. It also considers differences in `.fnm`, `.dvd` and `.dvm` files as indicating a difference in the whole segment, even though these files may be adjusted without changing the segment itself. This commit adjusts this logic to attach these generational files to the segments themselves, allowing Elasticsearch only to transfer them if they are genuinely needed. Closes #55142 Co-authored-by: David Turner --- .../BlobStoreIndexShardSnapshot.java | 29 +++- .../BlobStoreIndexShardSnapshots.java | 2 +- .../org/elasticsearch/index/store/Store.java | 160 +++++++++++------- .../index/store/StoreFileMetadata.java | 79 ++++++++- .../blobstore/BlobStoreRepository.java | 33 +++- .../blobstore/ChecksumBlobStoreFormat.java | 39 ++++- .../snapshots/SnapshotsService.java | 7 + .../snapshots/blobstore/FileInfoTests.java | 38 ++++- .../elasticsearch/index/store/StoreTests.java | 134 ++++++++++----- .../SnapshotsRecoveryPlannerServiceTests.java | 2 +- 10 files changed, 390 insertions(+), 133 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/index/snapshots/blobstore/BlobStoreIndexShardSnapshot.java b/server/src/main/java/org/elasticsearch/index/snapshots/blobstore/BlobStoreIndexShardSnapshot.java index d139e1cfff020..391384d1a6132 100644 --- a/server/src/main/java/org/elasticsearch/index/snapshots/blobstore/BlobStoreIndexShardSnapshot.java +++ b/server/src/main/java/org/elasticsearch/index/snapshots/blobstore/BlobStoreIndexShardSnapshot.java @@ -27,6 +27,8 @@ import java.util.Objects; import java.util.stream.IntStream; +import static org.elasticsearch.index.store.StoreFileMetadata.UNAVAILABLE_WRITER_UUID; + /** * Shard snapshot metadata */ @@ -36,6 +38,7 @@ public class BlobStoreIndexShardSnapshot implements ToXContentFragment { * Information about snapshotted file */ public static class FileInfo implements Writeable { + public static final String SERIALIZE_WRITER_UUID = "serialize_writer_uuid"; private final String name; private final ByteSizeValue partSize; @@ -238,6 +241,7 @@ public boolean isSame(FileInfo fileInfo) { static final String PART_SIZE = "part_size"; static final String WRITTEN_BY = "written_by"; static final String META_HASH = "meta_hash"; + static final String WRITER_UUID = "writer_uuid"; /** * Serializes file info into JSON @@ -245,7 +249,7 @@ public boolean isSame(FileInfo fileInfo) { * @param file file info * @param builder XContent builder */ - public static void toXContent(FileInfo file, XContentBuilder builder) throws IOException { + public static void toXContent(FileInfo file, XContentBuilder builder, Params params) throws IOException { builder.startObject(); builder.field(NAME, file.name); builder.field(PHYSICAL_NAME, file.metadata.name()); @@ -259,10 +263,19 @@ public static void toXContent(FileInfo file, XContentBuilder builder) throws IOE builder.field(WRITTEN_BY, file.metadata.writtenBy()); } - if (file.metadata.hash() != null && file.metadata().hash().length > 0) { - BytesRef br = file.metadata.hash(); - builder.field(META_HASH, br.bytes, br.offset, br.length); + final BytesRef hash = file.metadata.hash(); + if (hash != null && hash.length > 0) { + builder.field(META_HASH, hash.bytes, hash.offset, hash.length); + } + + final BytesRef writerUuid = file.metadata.writerUuid(); + // We serialize by default when SERIALIZE_WRITER_UUID is not present since in deletes/clones + // we read the serialized files from the blob store and we enforce the version invariants when + // the snapshot was done + if (writerUuid.length > 0 && params.paramAsBoolean(SERIALIZE_WRITER_UUID, true)) { + builder.field(WRITER_UUID, writerUuid.bytes, writerUuid.offset, writerUuid.length); } + builder.endObject(); } @@ -281,6 +294,7 @@ public static FileInfo fromXContent(XContentParser parser) throws IOException { ByteSizeValue partSize = null; String writtenBy = null; BytesRef metaHash = new BytesRef(); + BytesRef writerUuid = UNAVAILABLE_WRITER_UUID; XContentParserUtils.ensureExpectedToken(token, XContentParser.Token.START_OBJECT, parser); while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) { if (token == XContentParser.Token.FIELD_NAME) { @@ -303,6 +317,9 @@ public static FileInfo fromXContent(XContentParser parser) throws IOException { metaHash.bytes = parser.binaryValue(); metaHash.offset = 0; metaHash.length = metaHash.bytes.length; + } else if (WRITER_UUID.equals(currentFieldName)) { + writerUuid = new BytesRef(parser.binaryValue()); + assert writerUuid.length > 0; } else { XContentParserUtils.throwUnknownField(currentFieldName, parser.getTokenLocation()); } @@ -326,7 +343,7 @@ public static FileInfo fromXContent(XContentParser parser) throws IOException { } else if (checksum == null) { throw new ElasticsearchParseException("missing checksum for name [" + name + "]"); } - return new FileInfo(name, new StoreFileMetadata(physicalName, length, checksum, writtenBy, metaHash), partSize); + return new FileInfo(name, new StoreFileMetadata(physicalName, length, checksum, writtenBy, metaHash, writerUuid), partSize); } @Override @@ -503,7 +520,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws builder.field(INCREMENTAL_SIZE, incrementalSize); builder.startArray(FILES); for (FileInfo fileInfo : indexFiles) { - FileInfo.toXContent(fileInfo, builder); + FileInfo.toXContent(fileInfo, builder, params); } builder.endArray(); return builder; diff --git a/server/src/main/java/org/elasticsearch/index/snapshots/blobstore/BlobStoreIndexShardSnapshots.java b/server/src/main/java/org/elasticsearch/index/snapshots/blobstore/BlobStoreIndexShardSnapshots.java index 503128b26b8f7..2c3fb3143e524 100644 --- a/server/src/main/java/org/elasticsearch/index/snapshots/blobstore/BlobStoreIndexShardSnapshots.java +++ b/server/src/main/java/org/elasticsearch/index/snapshots/blobstore/BlobStoreIndexShardSnapshots.java @@ -208,7 +208,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws // First we list all blobs with their file infos: builder.startArray(Fields.FILES); for (Map.Entry entry : files.entrySet()) { - FileInfo.toXContent(entry.getValue(), builder); + FileInfo.toXContent(entry.getValue(), builder, params); } builder.endArray(); // Then we list all snapshots with list of all blobs that are used by the snapshot diff --git a/server/src/main/java/org/elasticsearch/index/store/Store.java b/server/src/main/java/org/elasticsearch/index/store/Store.java index cf62b50a17756..50e252e99c04c 100644 --- a/server/src/main/java/org/elasticsearch/index/store/Store.java +++ b/server/src/main/java/org/elasticsearch/index/store/Store.java @@ -52,10 +52,10 @@ import org.elasticsearch.common.lucene.store.InputStreamIndexInput; import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Setting.Property; -import org.elasticsearch.common.util.iterable.Iterables; import org.elasticsearch.core.AbstractRefCounted; import org.elasticsearch.core.RefCounted; import org.elasticsearch.core.TimeValue; +import org.elasticsearch.core.Tuple; import org.elasticsearch.core.internal.io.IOUtils; import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.env.ShardLock; @@ -90,6 +90,7 @@ import java.util.concurrent.locks.ReentrantReadWriteLock; import java.util.function.Consumer; import java.util.function.LongUnaryOperator; +import java.util.function.Predicate; import java.util.zip.CRC32; import java.util.zip.Checksum; @@ -834,16 +835,22 @@ static LoadedMetadata loadMetadata(IndexCommit commit, Directory directory, Logg if (version.onOrAfter(maxVersion)) { maxVersion = version; } + + final BytesRef segmentInfoId = StoreFileMetadata.toWriterUuid(info.info.getId()); + final BytesRef segmentCommitInfoId = StoreFileMetadata.toWriterUuid(info.getId()); + for (String file : info.files()) { checksumFromLuceneFile(directory, file, builder, logger, version.toString(), - SEGMENT_INFO_EXTENSION.equals(IndexFileNames.getExtension(file))); + SEGMENT_INFO_EXTENSION.equals(IndexFileNames.getExtension(file)), + IndexFileNames.parseGeneration(file) == 0 ? segmentInfoId : segmentCommitInfoId); } } if (maxVersion == null) { maxVersion = org.elasticsearch.Version.CURRENT.minimumIndexCompatibilityVersion().luceneVersion; } final String segmentsFile = segmentCommitInfos.getSegmentsFileName(); - checksumFromLuceneFile(directory, segmentsFile, builder, logger, maxVersion.toString(), true); + checksumFromLuceneFile(directory, segmentsFile, builder, logger, maxVersion.toString(), true, + StoreFileMetadata.toWriterUuid(segmentCommitInfos.getId())); } catch (CorruptIndexException | IndexNotFoundException | IndexFormatTooOldException | IndexFormatTooNewException ex) { // we either know the index is corrupted or it's just not there throw ex; @@ -869,7 +876,7 @@ static LoadedMetadata loadMetadata(IndexCommit commit, Directory directory, Logg } private static void checksumFromLuceneFile(Directory directory, String file, Map builder, - Logger logger, String version, boolean readFileAsHash) throws IOException { + Logger logger, String version, boolean readFileAsHash, BytesRef writerUuid) throws IOException { final String checksum; final BytesRefBuilder fileHash = new BytesRefBuilder(); try (IndexInput in = directory.openInput(file, READONCE_CHECKSUM)) { @@ -894,7 +901,7 @@ private static void checksumFromLuceneFile(Directory directory, String file, Map logger.debug(() -> new ParameterizedMessage("Can retrieve checksum from file [{}]", file), ex); throw ex; } - builder.put(file, new StoreFileMetadata(file, length, checksum, version, fileHash.get())); + builder.put(file, new StoreFileMetadata(file, length, checksum, version, fileHash.get(), writerUuid)); } } @@ -923,8 +930,6 @@ public Map asMap() { return metadata; } - private static final String DEL_FILE_EXTENSION = "del"; // legacy delete file - private static final String LIV_FILE_EXTENSION = "liv"; // lucene 5 delete file private static final String SEGMENT_INFO_EXTENSION = "si"; /** @@ -935,77 +940,107 @@ public Map asMap() { *
  • different: they exist in both snapshots but their they are not identical
  • *
  • missing: files that exist in the source but not in the target
  • * - * This method groups file into per-segment files and per-commit files. A file is treated as - * identical if and on if all files in it's group are identical. On a per-segment level files for a segment are treated - * as identical iff: - *
      - *
    • all files in this segment have the same checksum
    • - *
    • all files in this segment have the same length
    • - *
    • the segments {@code .si} files hashes are byte-identical Note: This is a using a perfect hash function, - * The metadata transfers the {@code .si} file content as it's hash
    • - *
    *

    - * The {@code .si} file contains a lot of diagnostics including a timestamp etc. in the future there might be - * unique segment identifiers in there hardening this method further. + * Individual files are compared by name, length, checksum and (if present) a UUID that was assigned when the file was originally + * written. The segment info ({@code *.si}) files and the segments file ({@code segments_N}) are also checked to be a byte-for-byte + * match. *

    - * The per-commit files handles very similar. A commit is composed of the {@code segments_N} files as well as generational files - * like deletes ({@code _x_y.del}) or field-info ({@code _x_y.fnm}) files. On a per-commit level files for a commit are treated - * as identical iff: - *

      - *
    • all files belonging to this commit have the same checksum
    • - *
    • all files belonging to this commit have the same length
    • - *
    • the segments file {@code segments_N} files hashes are byte-identical Note: This is a using a perfect hash function, - * The metadata transfers the {@code segments_N} file content as it's hash
    • - *
    + * Files are collected together into a group for each segment plus one group of "per-commit" ({@code segments_N}) files. Each + * per-segment group is subdivided into a nongenerational group (most of them) and a generational group (e.g. {@code *.liv}, + * {@code *.fnm}, {@code *.dvm}, {@code *.dvd} that have been updated by subsequent commits). *

    - * NOTE: this diff will not contain the {@code segments.gen} file. This file is omitted on recovery. + * For each segment, if any nongenerational files are different then the whole segment is considered to be different and will be + * recovered in full. If all the nongenerational files are the same but any generational files are different then all the + * generational files are considered to be different and will be recovered in full, but the nongenerational files are left alone. + * Finally, if any file is different then all the per-commit files are recovered too. */ - public RecoveryDiff recoveryDiff(MetadataSnapshot recoveryTargetSnapshot) { + public RecoveryDiff recoveryDiff(final MetadataSnapshot targetSnapshot) { + final List perCommitSourceFiles = new ArrayList<>(); + final Map, List>> perSegmentSourceFiles = new HashMap<>(); + // per segment, a tuple of <> + + for (StoreFileMetadata sourceFile : this) { + if (sourceFile.name().startsWith("_")) { + final String segmentId = IndexFileNames.parseSegmentName(sourceFile.name()); + final boolean isGenerationalFile = IndexFileNames.parseGeneration(sourceFile.name()) > 0L; + final Tuple, List> perSegmentTuple = perSegmentSourceFiles + .computeIfAbsent(segmentId, k -> Tuple.tuple(new ArrayList<>(), new ArrayList<>())); + (isGenerationalFile ? perSegmentTuple.v2() : perSegmentTuple.v1()).add(sourceFile); + } else { + assert sourceFile.name().startsWith(IndexFileNames.SEGMENTS + "_") : "unexpected " + sourceFile; + perCommitSourceFiles.add(sourceFile); + } + } + final List identical = new ArrayList<>(); final List different = new ArrayList<>(); final List missing = new ArrayList<>(); - final Map> perSegment = new HashMap<>(); - final List perCommitStoreFiles = new ArrayList<>(); - for (StoreFileMetadata meta : this) { - final String segmentId = IndexFileNames.parseSegmentName(meta.name()); - final String extension = IndexFileNames.getExtension(meta.name()); - if (IndexFileNames.SEGMENTS.equals(segmentId) || - DEL_FILE_EXTENSION.equals(extension) || LIV_FILE_EXTENSION.equals(extension)) { - // only treat del files as per-commit files fnm files are generational but only for upgradable DV - perCommitStoreFiles.add(meta); + final List tmpIdentical = new ArrayList<>(); // confirm whole group is identical before adding to 'identical' + final Predicate> groupComparer = sourceGroup -> { + assert tmpIdentical.isEmpty() : "not cleaned up: " + tmpIdentical; + boolean groupIdentical = true; + for (StoreFileMetadata sourceFile : sourceGroup) { + final StoreFileMetadata targetFile = targetSnapshot.get(sourceFile.name()); + if (targetFile == null) { + groupIdentical = false; + missing.add(sourceFile); + } else if (groupIdentical && targetFile.isSame(sourceFile)) { + tmpIdentical.add(sourceFile); + } else { + groupIdentical = false; + different.add(sourceFile); + } + } + if (groupIdentical) { + identical.addAll(tmpIdentical); } else { - perSegment.computeIfAbsent(segmentId, k -> new ArrayList<>()).add(meta); + different.addAll(tmpIdentical); } - } - final ArrayList identicalFiles = new ArrayList<>(); - for (List segmentFiles : Iterables.concat(perSegment.values(), Collections.singleton(perCommitStoreFiles))) { - identicalFiles.clear(); - boolean consistent = true; - for (StoreFileMetadata meta : segmentFiles) { - StoreFileMetadata storeFileMetadata = recoveryTargetSnapshot.get(meta.name()); - if (storeFileMetadata == null) { - consistent = false; - missing.add(meta); - } else if (storeFileMetadata.isSame(meta) == false) { - consistent = false; - different.add(meta); + tmpIdentical.clear(); + return groupIdentical; + }; + final Consumer> allDifferent = sourceGroup -> { + for (StoreFileMetadata sourceFile : sourceGroup) { + final StoreFileMetadata targetFile = targetSnapshot.get(sourceFile.name()); + if (targetFile == null) { + missing.add(sourceFile); } else { - identicalFiles.add(meta); + different.add(sourceFile); } } - if (consistent) { - identical.addAll(identicalFiles); + }; + + boolean segmentsIdentical = true; + + for (Tuple, List> segmentFiles : perSegmentSourceFiles.values()) { + final List nonGenerationalFiles = segmentFiles.v1(); + final List generationalFiles = segmentFiles.v2(); + + if (groupComparer.test(nonGenerationalFiles)) { + // non-generational files are identical, now check the generational files + segmentsIdentical = groupComparer.test(generationalFiles) && segmentsIdentical; } else { - // make sure all files are added - this can happen if only the deletes are different - different.addAll(identicalFiles); + // non-generational files were different, so consider the whole segment as different + segmentsIdentical = false; + allDifferent.accept(generationalFiles); } } - RecoveryDiff recoveryDiff = new RecoveryDiff(Collections.unmodifiableList(identical), - Collections.unmodifiableList(different), Collections.unmodifiableList(missing)); - assert recoveryDiff.size() == this.metadata.size() - : "some files are missing recoveryDiff size: [" + recoveryDiff.size() + "] metadata size: [" + - this.metadata.size() + "]"; + + if (segmentsIdentical) { + // segments were the same, check the per-commit files + groupComparer.test(perCommitSourceFiles); + } else { + // at least one segment was different, so treat all the per-commit files as different too + allDifferent.accept(perCommitSourceFiles); + } + + final RecoveryDiff recoveryDiff = new RecoveryDiff( + Collections.unmodifiableList(identical), + Collections.unmodifiableList(different), + Collections.unmodifiableList(missing)); + assert recoveryDiff.size() == metadata.size() : "some files are missing: recoveryDiff is [" + recoveryDiff + + "] comparing: [" + metadata + "] to [" + targetSnapshot.metadata + "]"; return recoveryDiff; } @@ -1109,7 +1144,6 @@ public String toString() { } } - /** * Returns true if the file is auto-generated by the store and shouldn't be deleted during cleanup. * This includes write lock files diff --git a/server/src/main/java/org/elasticsearch/index/store/StoreFileMetadata.java b/server/src/main/java/org/elasticsearch/index/store/StoreFileMetadata.java index 01ce1e3fb055a..a571391e7a1e4 100644 --- a/server/src/main/java/org/elasticsearch/index/store/StoreFileMetadata.java +++ b/server/src/main/java/org/elasticsearch/index/store/StoreFileMetadata.java @@ -9,12 +9,17 @@ package org.elasticsearch.index.store; import org.apache.lucene.codecs.CodecUtil; +import org.apache.lucene.index.IndexWriter; +import org.apache.lucene.index.SegmentCommitInfo; +import org.apache.lucene.index.SegmentInfo; +import org.apache.lucene.index.SegmentInfos; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.Version; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.lucene.store.ByteArrayIndexInput; +import org.elasticsearch.core.Nullable; import java.io.IOException; import java.text.ParseException; @@ -22,6 +27,9 @@ public class StoreFileMetadata implements Writeable { + public static final BytesRef UNAVAILABLE_WRITER_UUID = new BytesRef(); + private static final org.elasticsearch.Version WRITER_UUID_MIN_VERSION = org.elasticsearch.Version.V_8_0_0; + private final String name; // the actual file size on "disk", if compressed, the compressed size @@ -33,17 +41,22 @@ public class StoreFileMetadata implements Writeable { private final BytesRef hash; + private final BytesRef writerUuid; + public StoreFileMetadata(String name, long length, String checksum, String writtenBy) { - this(name, length, checksum, writtenBy, null); + this(name, length, checksum, writtenBy, null, UNAVAILABLE_WRITER_UUID); } - public StoreFileMetadata(String name, long length, String checksum, String writtenBy, BytesRef hash) { + public StoreFileMetadata(String name, long length, String checksum, String writtenBy, BytesRef hash, BytesRef writerUuid) { assert assertValidWrittenBy(writtenBy); this.name = Objects.requireNonNull(name, "name must not be null"); this.length = length; this.checksum = Objects.requireNonNull(checksum, "checksum must not be null"); this.writtenBy = Objects.requireNonNull(writtenBy, "writtenBy must not be null"); this.hash = hash == null ? new BytesRef() : hash; + + assert writerUuid != null && (writerUuid.length > 0 || writerUuid == UNAVAILABLE_WRITER_UUID); + this.writerUuid = Objects.requireNonNull(writerUuid, "writerUuid must not be null"); } /** @@ -55,6 +68,11 @@ public StoreFileMetadata(StreamInput in) throws IOException { checksum = in.readString(); writtenBy = in.readString(); hash = in.readBytesRef(); + if (in.getVersion().onOrAfter(WRITER_UUID_MIN_VERSION)) { + writerUuid = StoreFileMetadata.toWriterUuid(in.readBytesRef()); + } else { + writerUuid = UNAVAILABLE_WRITER_UUID; + } } @Override @@ -64,6 +82,9 @@ public void writeTo(StreamOutput out) throws IOException { out.writeString(checksum); out.writeString(writtenBy); out.writeBytesRef(hash); + if (out.getVersion().onOrAfter(WRITER_UUID_MIN_VERSION)) { + out.writeBytesRef(writerUuid); + } } /** @@ -119,6 +140,24 @@ public boolean isSame(StoreFileMetadata other) { // we can't tell if either or is null so we return false in this case! this is why we don't use equals for this! return false; } + + // If we have the file contents, we directly compare the contents. This is useful to compare segment info + // files of source-only snapshots where the original segment info file shares the same id as the source-only + // segment info file but its contents are different. + if (hashEqualsContents()) { + return hash.equals(other.hash); + } + + if (writerUuid.length > 0 && other.writerUuid.length > 0) { + // if the writer ID is missing on one of the files then we ignore this field and just rely on the checksum and hash, but if + // it's present on both files then it must be identical + if (writerUuid.equals(other.writerUuid) == false) { + return false; + } else { + assert name.equals(other.name) && length == other.length && checksum.equals(other.checksum) : this + " vs " + other; + assert hash.equals(other.hash) : this + " vs " + other + " with hashes " + hash + " vs " + other.hash; + } + } return length == other.length && checksum.equals(other.checksum) && hash.equals(other.hash); } @@ -142,6 +181,42 @@ public BytesRef hash() { return hash; } + /** + * Returns the globally-unique ID that was assigned by the {@link IndexWriter} that originally wrote this file: + * + * - For `segments_N` files this is {@link SegmentInfos#getId()} which uniquely identifies the commit. + * - For non-generational segment files this is {@link SegmentInfo#getId()} which uniquely identifies the segment. + * - For generational segment files (i.e. updated docvalues, liv files etc) this is {@link SegmentCommitInfo#getId()} + * which uniquely identifies the generation of the segment. + * + * This ID may be {@link StoreFileMetadata#UNAVAILABLE_WRITER_UUID} (i.e. zero-length) if unavilable, e.g.: + * + * - The file was written by a version of Lucene prior to {@link org.apache.lucene.util.Version#LUCENE_8_6_0}. + * - The metadata came from a version of Elasticsearch prior to {@link StoreFileMetadata#WRITER_UUID_MIN_VERSION}). + * - The file is not one of the files listed above. + * + */ + public BytesRef writerUuid() { + return writerUuid; + } + + static BytesRef toWriterUuid(BytesRef bytesRef) { + if (bytesRef.length == 0) { + return UNAVAILABLE_WRITER_UUID; + } else { + return bytesRef; + } + } + + static BytesRef toWriterUuid(@Nullable byte[] id) { + if (id == null) { + return UNAVAILABLE_WRITER_UUID; + } else { + assert id.length > 0; + return new BytesRef(id); + } + } + private static boolean assertValidWrittenBy(String writtenBy) { try { Version.parse(writtenBy); diff --git a/server/src/main/java/org/elasticsearch/repositories/blobstore/BlobStoreRepository.java b/server/src/main/java/org/elasticsearch/repositories/blobstore/BlobStoreRepository.java index e9dbf5944eb8e..427493200cc36 100644 --- a/server/src/main/java/org/elasticsearch/repositories/blobstore/BlobStoreRepository.java +++ b/server/src/main/java/org/elasticsearch/repositories/blobstore/BlobStoreRepository.java @@ -2735,6 +2735,7 @@ public void snapshotShard(SnapshotShardContext context) { final ShardGeneration indexGeneration; final boolean writeShardGens = SnapshotsService.useShardGenerations(context.getRepositoryMetaVersion()); + final boolean writeFileInfoWriterUUID = SnapshotsService.includeFileInfoWriterUUID(context.getRepositoryMetaVersion()); // build a new BlobStoreIndexShardSnapshot, that includes this one and all the saved ones List newSnapshotsList = new ArrayList<>(); newSnapshotsList.add(new SnapshotFiles(snapshotId.getName(), indexCommitPointFiles, context.stateIdentifier())); @@ -2749,11 +2750,16 @@ public void snapshotShard(SnapshotShardContext context) { // reference a generation that has not had all its files fully upload. indexGeneration = ShardGeneration.newGeneration(); try { + final Map serializationParams = Collections.singletonMap( + BlobStoreIndexShardSnapshot.FileInfo.SERIALIZE_WRITER_UUID, + Boolean.toString(writeFileInfoWriterUUID) + ); INDEX_SHARD_SNAPSHOTS_FORMAT.write( updatedBlobStoreIndexShardSnapshots, shardContainer, indexGeneration.toBlobNamePart(), - compress + compress, + serializationParams ); } catch (IOException e) { throw new IndexShardSnapshotFailedException( @@ -2787,7 +2793,11 @@ public void snapshotShard(SnapshotShardContext context) { + blobsToDelete; afterWriteSnapBlob = () -> { try { - writeShardIndexBlobAtomic(shardContainer, newGen, updatedBlobStoreIndexShardSnapshots); + final Map serializationParams = Collections.singletonMap( + BlobStoreIndexShardSnapshot.FileInfo.SERIALIZE_WRITER_UUID, + Boolean.toString(writeFileInfoWriterUUID) + ); + writeShardIndexBlobAtomic(shardContainer, newGen, updatedBlobStoreIndexShardSnapshots, serializationParams); } catch (IOException e) { throw new IndexShardSnapshotFailedException( shardId, @@ -2831,7 +2841,17 @@ public void snapshotShard(SnapshotShardContext context) { ); try { final String snapshotUUID = snapshotId.getUUID(); - INDEX_SHARD_SNAPSHOT_FORMAT.write(blobStoreIndexShardSnapshot, shardContainer, snapshotUUID, compress); + final Map serializationParams = Collections.singletonMap( + BlobStoreIndexShardSnapshot.FileInfo.SERIALIZE_WRITER_UUID, + Boolean.toString(writeFileInfoWriterUUID) + ); + INDEX_SHARD_SNAPSHOT_FORMAT.write( + blobStoreIndexShardSnapshot, + shardContainer, + snapshotUUID, + compress, + serializationParams + ); } catch (IOException e) { throw new IndexShardSnapshotFailedException(shardId, "Failed to write commit point", e); } @@ -3233,7 +3253,7 @@ private ShardSnapshotMetaDeleteResult deleteFromShardSnapshotMeta( INDEX_SHARD_SNAPSHOTS_FORMAT.write(updatedSnapshots, shardContainer, writtenGeneration.toBlobNamePart(), compress); } else { writtenGeneration = new ShardGeneration(indexGeneration); - writeShardIndexBlobAtomic(shardContainer, indexGeneration, updatedSnapshots); + writeShardIndexBlobAtomic(shardContainer, indexGeneration, updatedSnapshots, Collections.emptyMap()); } final Set survivingSnapshotUUIDs = survivingSnapshots.stream().map(SnapshotId::getUUID).collect(Collectors.toSet()); return new ShardSnapshotMetaDeleteResult( @@ -3263,7 +3283,8 @@ private ShardSnapshotMetaDeleteResult deleteFromShardSnapshotMeta( private void writeShardIndexBlobAtomic( BlobContainer shardContainer, long indexGeneration, - BlobStoreIndexShardSnapshots updatedSnapshots + BlobStoreIndexShardSnapshots updatedSnapshots, + Map serializationParams ) throws IOException { assert indexGeneration >= 0 : "Shard generation must not be negative but saw [" + indexGeneration + "]"; logger.trace( @@ -3273,7 +3294,7 @@ private void writeShardIndexBlobAtomic( writeAtomic( shardContainer, blobName, - out -> INDEX_SHARD_SNAPSHOTS_FORMAT.serialize(updatedSnapshots, blobName, compress, out), + out -> INDEX_SHARD_SNAPSHOTS_FORMAT.serialize(updatedSnapshots, blobName, compress, serializationParams, out), true ); } diff --git a/server/src/main/java/org/elasticsearch/repositories/blobstore/ChecksumBlobStoreFormat.java b/server/src/main/java/org/elasticsearch/repositories/blobstore/ChecksumBlobStoreFormat.java index 9882cd89caa61..79a83205cbac9 100644 --- a/server/src/main/java/org/elasticsearch/repositories/blobstore/ChecksumBlobStoreFormat.java +++ b/server/src/main/java/org/elasticsearch/repositories/blobstore/ChecksumBlobStoreFormat.java @@ -38,6 +38,7 @@ import java.io.OutputStream; import java.util.Collections; import java.util.Locale; +import java.util.Map; import java.util.zip.CRC32; /** @@ -263,7 +264,7 @@ private int getAvailable() throws IOException { /** * Writes blob with resolving the blob name using {@link #blobName} method. *

    - * The blob will optionally by compressed. + * The blob will optionally be compressed. * * @param obj object to be serialized * @param blobContainer blob container @@ -271,11 +272,37 @@ private int getAvailable() throws IOException { * @param compress whether to use compression */ public void write(T obj, BlobContainer blobContainer, String name, boolean compress) throws IOException { + write(obj, blobContainer, name, compress, Collections.emptyMap()); + } + + /** + * Writes blob with resolving the blob name using {@link #blobName} method. + *

    + * The blob will optionally be compressed. + * + * @param obj object to be serialized + * @param blobContainer blob container + * @param name blob name + * @param compress whether to use compression + * @param serializationParams extra serialization parameters + */ + public void write(T obj, BlobContainer blobContainer, String name, boolean compress, Map serializationParams) + throws IOException { final String blobName = blobName(name); - blobContainer.writeBlob(blobName, false, false, out -> serialize(obj, blobName, compress, out)); + blobContainer.writeBlob(blobName, false, false, out -> serialize(obj, blobName, compress, serializationParams, out)); } - public void serialize(final T obj, final String blobName, final boolean compress, OutputStream outputStream) throws IOException { + public void serialize(final T obj, final String blobName, final boolean compress, final OutputStream outputStream) throws IOException { + serialize(obj, blobName, compress, Collections.emptyMap(), outputStream); + } + + public void serialize( + final T obj, + final String blobName, + final boolean compress, + final Map extraParams, + final OutputStream outputStream + ) throws IOException { try ( OutputStreamIndexOutput indexOutput = new OutputStreamIndexOutput( "ChecksumBlobStoreFormat.serialize(blob=\"" + blobName + "\")", @@ -297,8 +324,12 @@ public void close() { compress ? CompressorFactory.COMPRESSOR.threadLocalOutputStream(indexOutputOutputStream) : indexOutputOutputStream ) ) { + ToXContent.Params params = extraParams.isEmpty() + ? SNAPSHOT_ONLY_FORMAT_PARAMS + : new ToXContent.DelegatingMapParams(extraParams, SNAPSHOT_ONLY_FORMAT_PARAMS); + builder.startObject(); - obj.toXContent(builder, SNAPSHOT_ONLY_FORMAT_PARAMS); + obj.toXContent(builder, params); builder.endObject(); } CodecUtil.writeFooter(indexOutput); diff --git a/server/src/main/java/org/elasticsearch/snapshots/SnapshotsService.java b/server/src/main/java/org/elasticsearch/snapshots/SnapshotsService.java index c7eb8351f58f5..42e2a446cf2f0 100644 --- a/server/src/main/java/org/elasticsearch/snapshots/SnapshotsService.java +++ b/server/src/main/java/org/elasticsearch/snapshots/SnapshotsService.java @@ -128,6 +128,9 @@ public class SnapshotsService extends AbstractLifecycleComponent implements Clus public static final Version UUIDS_IN_REPO_DATA_VERSION = Version.V_7_12_0; + // TODO: Update to 7.16 after backporting + public static final Version FILE_INFO_WRITER_UUIDS_IN_SHARD_DATA_VERSION = Version.CURRENT; + public static final Version OLD_SNAPSHOT_FORMAT = Version.V_7_5_0; public static final String POLICY_ID_METADATA_FIELD = "policy"; @@ -2322,6 +2325,10 @@ public static boolean includesUUIDs(Version repositoryMetaVersion) { return repositoryMetaVersion.onOrAfter(UUIDS_IN_REPO_DATA_VERSION); } + public static boolean includeFileInfoWriterUUID(Version repositoryMetaVersion) { + return repositoryMetaVersion.onOrAfter(FILE_INFO_WRITER_UUIDS_IN_SHARD_DATA_VERSION); + } + /** Deletes snapshot from repository * * @param deleteEntry delete entry in cluster state diff --git a/server/src/test/java/org/elasticsearch/index/snapshots/blobstore/FileInfoTests.java b/server/src/test/java/org/elasticsearch/index/snapshots/blobstore/FileInfoTests.java index c4a6e54bb8427..3dc9e6474d2b6 100644 --- a/server/src/test/java/org/elasticsearch/index/snapshots/blobstore/FileInfoTests.java +++ b/server/src/test/java/org/elasticsearch/index/snapshots/blobstore/FileInfoTests.java @@ -12,6 +12,7 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.unit.ByteSizeValue; +import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentParser; @@ -22,7 +23,9 @@ import org.elasticsearch.test.ESTestCase; import java.io.IOException; +import java.util.Collections; +import static org.elasticsearch.index.store.StoreFileMetadata.UNAVAILABLE_WRITER_UUID; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; @@ -34,6 +37,7 @@ public class FileInfoTests extends ESTestCase { public void testToFromXContent() throws IOException { final int iters = scaledRandomIntBetween(1, 10); for (int iter = 0; iter < iters; iter++) { + final BytesRef writerUuid = randomBytesRef(20); final BytesRef hash = new BytesRef(scaledRandomIntBetween(0, 1024 * 1024)); hash.length = hash.bytes.length; for (int i = 0; i < hash.length; i++) { @@ -44,12 +48,23 @@ public void testToFromXContent() throws IOException { Math.abs(randomLong()), randomAlphaOfLengthBetween(1, 10), Version.LATEST.toString(), - hash + hash, + writerUuid ); ByteSizeValue size = new ByteSizeValue(Math.abs(randomLong())); BlobStoreIndexShardSnapshot.FileInfo info = new BlobStoreIndexShardSnapshot.FileInfo("_foobar", meta, size); XContentBuilder builder = XContentFactory.contentBuilder(XContentType.JSON).prettyPrint(); - BlobStoreIndexShardSnapshot.FileInfo.toXContent(info, builder); + boolean serializeWriterUUID = randomBoolean(); + final ToXContent.Params params; + if (serializeWriterUUID && randomBoolean()) { + // We serialize by the writer uuid by default + params = new ToXContent.MapParams(Collections.emptyMap()); + } else { + params = new ToXContent.MapParams( + Collections.singletonMap(FileInfo.SERIALIZE_WRITER_UUID, Boolean.toString(serializeWriterUUID)) + ); + } + BlobStoreIndexShardSnapshot.FileInfo.toXContent(info, builder, params); byte[] xcontent = BytesReference.toBytes(BytesReference.bytes(shuffleXContent(builder))); final BlobStoreIndexShardSnapshot.FileInfo parsedInfo; @@ -65,18 +80,27 @@ public void testToFromXContent() throws IOException { assertThat(parsedInfo.metadata().hash().length, equalTo(hash.length)); assertThat(parsedInfo.metadata().hash(), equalTo(hash)); assertThat(parsedInfo.metadata().writtenBy(), equalTo(Version.LATEST.toString())); + if (serializeWriterUUID) { + assertThat(parsedInfo.metadata().writerUuid(), equalTo(writerUuid)); + } else { + assertThat(parsedInfo.metadata().writerUuid(), equalTo(UNAVAILABLE_WRITER_UUID)); + } assertThat(parsedInfo.isSame(info.metadata()), is(true)); } } + private static BytesRef randomBytesRef(int maxSize) { + final BytesRef hash = new BytesRef(scaledRandomIntBetween(1, maxSize)); + hash.length = hash.bytes.length; + for (int i = 0; i < hash.length; i++) { + hash.bytes[i] = randomByte(); + } + return hash; + } + public void testInvalidFieldsInFromXContent() throws IOException { final int iters = scaledRandomIntBetween(1, 10); for (int iter = 0; iter < iters; iter++) { - final BytesRef hash = new BytesRef(scaledRandomIntBetween(0, 1024 * 1024)); - hash.length = hash.bytes.length; - for (int i = 0; i < hash.length; i++) { - hash.bytes[i] = randomByte(); - } String name = "foobar"; String physicalName = "_foobar"; String failure = null; diff --git a/server/src/test/java/org/elasticsearch/index/store/StoreTests.java b/server/src/test/java/org/elasticsearch/index/store/StoreTests.java index a8810a9b08774..33ef0007e5423 100644 --- a/server/src/test/java/org/elasticsearch/index/store/StoreTests.java +++ b/server/src/test/java/org/elasticsearch/index/store/StoreTests.java @@ -9,6 +9,7 @@ import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.codecs.CodecUtil; +import org.apache.lucene.document.BinaryDocValuesField; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.SortedDocValuesField; @@ -473,11 +474,16 @@ public void testRecoveryDiff() throws IOException, InterruptedException { List docs = new ArrayList<>(); for (int i = 0; i < numDocs; i++) { Document doc = new Document(); - doc.add(new StringField("id", "" + i, random().nextBoolean() ? Field.Store.YES : Field.Store.NO)); - doc.add(new TextField("body", - TestUtil.randomRealisticUnicodeString(random()), random().nextBoolean() ? Field.Store.YES : Field.Store.NO)); - doc.add(new SortedDocValuesField("dv", new BytesRef(TestUtil.randomRealisticUnicodeString(random())))); + final Field.Store stringFieldStored = random().nextBoolean() ? Field.Store.YES : Field.Store.NO; + doc.add(new StringField("id", "" + i, stringFieldStored)); + final String textFieldContent = TestUtil.randomRealisticUnicodeString(random()); + final Field.Store textFieldStored = random().nextBoolean() ? Field.Store.YES : Field.Store.NO; + doc.add(new TextField("body", textFieldContent, textFieldStored)); + final String docValueFieldContent = TestUtil.randomRealisticUnicodeString(random()); + doc.add(new BinaryDocValuesField("dv", new BytesRef(docValueFieldContent))); docs.add(doc); + logger.info("--> doc [{}] id=[{}] (store={}) body=[{}] (store={}) dv=[{}]", + i, i, stringFieldStored, textFieldContent, textFieldStored, docValueFieldContent); } long seed = random().nextLong(); Store.MetadataSnapshot first; @@ -492,9 +498,8 @@ public void testRecoveryDiff() throws IOException, InterruptedException { final boolean lotsOfSegments = rarely(random); for (Document d : docs) { writer.addDocument(d); - if (lotsOfSegments && random.nextBoolean()) { - writer.commit(); - } else if (rarely(random)) { + if (lotsOfSegments && random.nextBoolean() || rarely(random)) { + logger.info("--> commit after doc {}", d.getField("id").stringValue()); writer.commit(); } } @@ -521,9 +526,7 @@ public void testRecoveryDiff() throws IOException, InterruptedException { final boolean lotsOfSegments = rarely(random); for (Document d : docs) { writer.addDocument(d); - if (lotsOfSegments && random.nextBoolean()) { - writer.commit(); - } else if (rarely(random)) { + if (lotsOfSegments && random.nextBoolean() || rarely(random)) { writer.commit(); } } @@ -548,35 +551,40 @@ public void testRecoveryDiff() throws IOException, InterruptedException { assertThat(selfDiff.different, empty()); assertThat(selfDiff.missing, empty()); - - // lets add some deletes - Random random = new Random(seed); - IndexWriterConfig iwc = new IndexWriterConfig(new MockAnalyzer(random)).setCodec(TestUtil.getDefaultCodec()); - iwc.setMergePolicy(NoMergePolicy.INSTANCE); - iwc.setUseCompoundFile(random.nextBoolean()); - iwc.setOpenMode(IndexWriterConfig.OpenMode.APPEND); - IndexWriter writer = new IndexWriter(store.directory(), iwc); - writer.deleteDocuments(new Term("id", Integer.toString(random().nextInt(numDocs)))); - writer.commit(); - writer.close(); - Store.MetadataSnapshot metadata = store.getMetadata(null); + // delete a doc + final String deleteId = Integer.toString(random().nextInt(numDocs)); + Store.MetadataSnapshot metadata; + { + Random random = new Random(seed); + IndexWriterConfig iwc = new IndexWriterConfig(new MockAnalyzer(random)).setCodec(TestUtil.getDefaultCodec()); + iwc.setMergePolicy(NoMergePolicy.INSTANCE); + iwc.setUseCompoundFile(random.nextBoolean()); + iwc.setOpenMode(IndexWriterConfig.OpenMode.APPEND); + IndexWriter writer = new IndexWriter(store.directory(), iwc); + logger.info("--> delete doc {}", deleteId); + writer.deleteDocuments(new Term("id", deleteId)); + writer.commit(); + writer.close(); + metadata = store.getMetadata(null); + } StoreFileMetadata delFile = null; for (StoreFileMetadata md : metadata) { if (md.name().endsWith(".liv")) { delFile = md; + logger.info("--> delFile=[{}]", delFile); break; } } Store.RecoveryDiff afterDeleteDiff = metadata.recoveryDiff(second); if (delFile != null) { - assertThat(afterDeleteDiff.identical.size(), equalTo(metadata.size() - 2)); // segments_N + del file - assertThat(afterDeleteDiff.different.size(), equalTo(0)); - assertThat(afterDeleteDiff.missing.size(), equalTo(2)); + assertThat(afterDeleteDiff.toString(), afterDeleteDiff.identical.size(), equalTo(metadata.size() - 2)); // segments_N + del file + assertThat(afterDeleteDiff.toString(), afterDeleteDiff.different.size(), equalTo(0)); + assertThat(afterDeleteDiff.toString(), afterDeleteDiff.missing.size(), equalTo(2)); } else { // an entire segment must be missing (single doc segment got dropped) - assertThat(afterDeleteDiff.identical.size(), greaterThan(0)); - assertThat(afterDeleteDiff.different.size(), equalTo(0)); - assertThat(afterDeleteDiff.missing.size(), equalTo(1)); // the commit file is different + assertThat(afterDeleteDiff.toString(), afterDeleteDiff.identical.size(), greaterThan(0)); + assertThat(afterDeleteDiff.toString(), afterDeleteDiff.different.size(), equalTo(0)); + assertThat(afterDeleteDiff.toString(), afterDeleteDiff.missing.size(), equalTo(1)); // the commit file is different } // check the self diff @@ -586,30 +594,70 @@ public void testRecoveryDiff() throws IOException, InterruptedException { assertThat(selfDiff.missing, empty()); // add a new commit - iwc = new IndexWriterConfig(new MockAnalyzer(random)).setCodec(TestUtil.getDefaultCodec()); - iwc.setMergePolicy(NoMergePolicy.INSTANCE); - iwc.setUseCompoundFile(true); // force CFS - easier to test here since we know it will add 3 files - iwc.setOpenMode(IndexWriterConfig.OpenMode.APPEND); - writer = new IndexWriter(store.directory(), iwc); - writer.addDocument(docs.get(0)); - writer.close(); + { + Random random = new Random(seed); + IndexWriterConfig iwc = new IndexWriterConfig(new MockAnalyzer(random)).setCodec(TestUtil.getDefaultCodec()); + iwc.setMergePolicy(NoMergePolicy.INSTANCE); + iwc.setUseCompoundFile(true); // force CFS - easier to test here since we know it will add 3 files + iwc.setOpenMode(IndexWriterConfig.OpenMode.APPEND); + IndexWriter writer = new IndexWriter(store.directory(), iwc); + logger.info("--> add new empty doc"); + writer.addDocument(new Document()); + writer.close(); + } Store.MetadataSnapshot newCommitMetadata = store.getMetadata(null); Store.RecoveryDiff newCommitDiff = newCommitMetadata.recoveryDiff(metadata); if (delFile != null) { - assertThat(newCommitDiff.identical.size(), - equalTo(newCommitMetadata.size() - 5)); // segments_N, del file, cfs, cfe, si for the new segment - assertThat(newCommitDiff.different.size(), equalTo(1)); // the del file must be different - assertThat(newCommitDiff.different.get(0).name(), endsWith(".liv")); - assertThat(newCommitDiff.missing.size(), equalTo(4)); // segments_N,cfs, cfe, si for the new segment + assertThat(newCommitDiff.toString(), newCommitDiff.identical.size(), + equalTo(newCommitMetadata.size() - 4)); // segments_N, cfs, cfe, si for the new segment + assertThat(newCommitDiff.toString(), newCommitDiff.different.size(), equalTo(0)); // the del file must be different + assertThat(newCommitDiff.toString(), newCommitDiff.missing.size(), equalTo(4)); // segments_N,cfs, cfe, si for the new segment + assertTrue(newCommitDiff.toString(), newCommitDiff.identical.stream().anyMatch(m -> m.name().endsWith(".liv"))); } else { - assertThat(newCommitDiff.identical.size(), + assertThat(newCommitDiff.toString(), newCommitDiff.identical.size(), equalTo(newCommitMetadata.size() - 4)); // segments_N, cfs, cfe, si for the new segment - assertThat(newCommitDiff.different.size(), equalTo(0)); - assertThat(newCommitDiff.missing.size(), + assertThat(newCommitDiff.toString(), newCommitDiff.different.size(), equalTo(0)); + assertThat(newCommitDiff.toString(), newCommitDiff.missing.size(), equalTo(4)); // an entire segment must be missing (single doc segment got dropped) plus the commit is different } + // update doc values + Store.MetadataSnapshot dvUpdateSnapshot; + final String updateId = randomValueOtherThan(deleteId, () -> Integer.toString(random().nextInt(numDocs))); + { + Random random = new Random(seed); + IndexWriterConfig iwc = new IndexWriterConfig(new MockAnalyzer(random)).setCodec(TestUtil.getDefaultCodec()); + iwc.setMergePolicy(NoMergePolicy.INSTANCE); + iwc.setUseCompoundFile(random.nextBoolean()); + iwc.setOpenMode(IndexWriterConfig.OpenMode.APPEND); + try(IndexWriter writer = new IndexWriter(store.directory(), iwc)) { + final String newDocValue = TestUtil.randomRealisticUnicodeString(random()); + logger.info("--> update doc [{}] with dv=[{}]", updateId, newDocValue); + writer.updateBinaryDocValue(new Term("id", updateId), "dv", new BytesRef(newDocValue)); + writer.commit(); + } + dvUpdateSnapshot = store.getMetadata(null); + } + logger.info("--> source: {}", dvUpdateSnapshot.asMap()); + logger.info("--> target: {}", newCommitMetadata.asMap()); + Store.RecoveryDiff dvUpdateDiff = dvUpdateSnapshot.recoveryDiff(newCommitMetadata); + final int delFileCount; + if (delFile == null || dvUpdateDiff.different.isEmpty()) { + // liv file either doesn't exist or belongs to a different segment from the one that we just updated + delFileCount = 0; + assertThat(dvUpdateDiff.toString(), dvUpdateDiff.different, empty()); + } else { + // liv file is generational and belongs to the updated segment + delFileCount = 1; + assertThat(dvUpdateDiff.toString(), dvUpdateDiff.different.size(), equalTo(1)); + assertThat(dvUpdateDiff.toString(), dvUpdateDiff.different.get(0).name(), endsWith(".liv")); + } + + assertThat(dvUpdateDiff.toString(), dvUpdateDiff.identical.size(), equalTo(dvUpdateSnapshot.size() - 4 - delFileCount)); + assertThat(dvUpdateDiff.toString(), dvUpdateDiff.different.size(), equalTo(delFileCount)); + assertThat(dvUpdateDiff.toString(), dvUpdateDiff.missing.size(), equalTo(4)); // segments_N, fnm, dvd, dvm for the updated segment + deleteContent(store.directory()); IOUtils.close(store); } diff --git a/server/src/test/java/org/elasticsearch/indices/recovery/plan/SnapshotsRecoveryPlannerServiceTests.java b/server/src/test/java/org/elasticsearch/indices/recovery/plan/SnapshotsRecoveryPlannerServiceTests.java index 6d00b3a931ef1..077cf634ab46c 100644 --- a/server/src/test/java/org/elasticsearch/indices/recovery/plan/SnapshotsRecoveryPlannerServiceTests.java +++ b/server/src/test/java/org/elasticsearch/indices/recovery/plan/SnapshotsRecoveryPlannerServiceTests.java @@ -471,7 +471,7 @@ private void assertUsesExpectedSnapshot(ShardRecoveryPlan shardRecoveryPlan, // StoreFileMetadata doesn't implement #equals, we rely on StoreFileMetadata#isSame for equality checks private boolean containsFile(List files, StoreFileMetadata fileMetadata) { for (StoreFileMetadata file : files) { - if (file.isSame(fileMetadata)) { + if (fileMetadata.name().equals(file.name()) && file.isSame(fileMetadata)) { return true; } } From 545eb1ada066ce3ec0941e20ab3683ec49a05d7e Mon Sep 17 00:00:00 2001 From: Rene Groeschke Date: Tue, 5 Oct 2021 11:42:52 +0200 Subject: [PATCH 156/250] Fix system property resolution at configuration time (#78669) This fixes system property resolution when running the build with --configuration-cache One step closer to make use of configuration cache --- .../internal/conventions/VersionPropertiesLoader.java | 6 ++---- .../groovy/elasticsearch.authenticated-testclusters.gradle | 2 +- .../src/main/groovy/elasticsearch.run.gradle | 4 ++-- qa/remote-clusters/build.gradle | 2 +- x-pack/plugin/ml/build.gradle | 2 +- 5 files changed, 7 insertions(+), 9 deletions(-) diff --git a/build-conventions/src/main/java/org/elasticsearch/gradle/internal/conventions/VersionPropertiesLoader.java b/build-conventions/src/main/java/org/elasticsearch/gradle/internal/conventions/VersionPropertiesLoader.java index 0b437abd4cb45..1702c03f91177 100644 --- a/build-conventions/src/main/java/org/elasticsearch/gradle/internal/conventions/VersionPropertiesLoader.java +++ b/build-conventions/src/main/java/org/elasticsearch/gradle/internal/conventions/VersionPropertiesLoader.java @@ -43,9 +43,8 @@ protected static void loadBuildSrcVersion(Properties loadedProps, ProviderFactor ); } String qualifier = providers.systemProperty("build.version_qualifier") - .orElse("") .forUseAtConfigurationTime() - .get(); + .getOrElse(""); if (qualifier.isEmpty() == false) { if (qualifier.matches("(alpha|beta|rc)\\d+") == false) { throw new IllegalStateException("Invalid qualifier: " + qualifier); @@ -53,9 +52,8 @@ protected static void loadBuildSrcVersion(Properties loadedProps, ProviderFactor elasticsearch += "-" + qualifier; } final String buildSnapshotSystemProperty = providers.systemProperty("build.snapshot") - .orElse("true") .forUseAtConfigurationTime() - .get(); + .getOrElse("true"); switch (buildSnapshotSystemProperty) { case "true": elasticsearch += "-SNAPSHOT"; diff --git a/build-tools-internal/src/main/groovy/elasticsearch.authenticated-testclusters.gradle b/build-tools-internal/src/main/groovy/elasticsearch.authenticated-testclusters.gradle index 444678f1646d4..b52e6ec7f005c 100644 --- a/build-tools-internal/src/main/groovy/elasticsearch.authenticated-testclusters.gradle +++ b/build-tools-internal/src/main/groovy/elasticsearch.authenticated-testclusters.gradle @@ -22,7 +22,7 @@ tasks.withType(StandaloneRestIntegTestTask).configureEach { systemProperty 'tests.rest.cluster.password', clusterCredentials.password } -testClusters.all { +testClusters.configureEach { setting 'xpack.security.enabled', 'true' setting 'xpack.license.self_generated.type', 'trial' user clusterCredentials diff --git a/build-tools-internal/src/main/groovy/elasticsearch.run.gradle b/build-tools-internal/src/main/groovy/elasticsearch.run.gradle index 1d9b437789cba..d5e400be0f10e 100644 --- a/build-tools-internal/src/main/groovy/elasticsearch.run.gradle +++ b/build-tools-internal/src/main/groovy/elasticsearch.run.gradle @@ -15,8 +15,8 @@ import org.elasticsearch.gradle.testclusters.RunTask testClusters.register("runTask") { testDistribution = providers.systemProperty('run.distribution').orElse('default').forUseAtConfigurationTime().get() - if (providers.systemProperty('run.distribution').orElse('default').forUseAtConfigurationTime().get() == 'default') { - String licenseType = providers.systemProperty("run.license_type").orElse("basic").forUseAtConfigurationTime().get() + if (providers.systemProperty('run.distribution').forUseAtConfigurationTime().getOrElse('default') == 'default') { + String licenseType = providers.systemProperty("run.license_type").forUseAtConfigurationTime().getOrElse("basic") if (licenseType == 'trial') { setting 'xpack.ml.enabled', 'true' setting 'xpack.graph.enabled', 'true' diff --git a/qa/remote-clusters/build.gradle b/qa/remote-clusters/build.gradle index 6ffb2b857195e..93e1da8c52b9d 100644 --- a/qa/remote-clusters/build.gradle +++ b/qa/remote-clusters/build.gradle @@ -65,7 +65,7 @@ tasks.named("preProcessFixture").configure { dockerCompose { tcpPortsToIgnoreWhenWaiting = [9600, 9601] - if ('default'.equalsIgnoreCase(providers.systemProperty('tests.distribution').orElse('default').forUseAtConfigurationTime().get())) { + if ('default'.equalsIgnoreCase(providers.systemProperty('tests.distribution').forUseAtConfigurationTime().getOrElse('default'))) { useComposeFiles = ['docker-compose.yml'] } else { useComposeFiles = ['docker-compose-oss.yml'] diff --git a/x-pack/plugin/ml/build.gradle b/x-pack/plugin/ml/build.gradle index 28245cd949b94..42c58d4649bbf 100644 --- a/x-pack/plugin/ml/build.gradle +++ b/x-pack/plugin/ml/build.gradle @@ -16,7 +16,7 @@ repositories { forRepository { ivy { name "ml-cpp" - url providers.systemProperty('build.ml_cpp.repo').orElse('https://prelert-artifacts.s3.amazonaws.com').forUseAtConfigurationTime().get() + url providers.systemProperty('build.ml_cpp.repo').forUseAtConfigurationTime().orElse('https://prelert-artifacts.s3.amazonaws.com').get() metadataSources { // no repository metadata, look directly for the artifact artifact() From 5c7fac77b36b21b726ad812d1716c95d4fa0a71f Mon Sep 17 00:00:00 2001 From: James Rodewig <40268737+jrodewig@users.noreply.github.com> Date: Tue, 5 Oct 2021 05:47:50 -0400 Subject: [PATCH 157/250] [DOCS] Add Beats config example for ingest pipelines (#78633) * [DOCS] Add Beats config example for ingest pipelines The Elasticsearch ingest pipeline docs cover ingest pipelines for Fleet and Elastic Agent. However, the docs don't cover Beats. This adds those docs. Relates to https://github.com/elastic/beats/pull/28239. * Update docs/reference/ingest.asciidoc Co-authored-by: DeDe Morton Co-authored-by: DeDe Morton --- docs/reference/ingest.asciidoc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/reference/ingest.asciidoc b/docs/reference/ingest.asciidoc index 0eaec88027533..81cee132905c6 100644 --- a/docs/reference/ingest.asciidoc +++ b/docs/reference/ingest.asciidoc @@ -271,6 +271,21 @@ Use the <> index setting to set a final pipeline. {es} applies this pipeline after the request or default pipeline, even if neither is specified. +[discrete] +[[pipelines-for-beats]] +=== Pipelines for {beats} + +To add an ingest pipeline to an Elastic Beat, specify the `pipeline` +parameter under `output.elasticsearch` in `.yml`. For example, +for {filebeat}, you'd specify `pipeline` in `filebeat.yml`. + +[source,yaml] +---- +output.elasticsearch: + hosts: ["localhost:9200"] + pipeline: my-pipeline +---- + [discrete] [[pipelines-for-fleet-elastic-agent]] === Pipelines for {fleet} and {agent} From af0f44201882cbaf28ee8a4c70c9250061fbbf1e Mon Sep 17 00:00:00 2001 From: Dimitris Athanasiou Date: Tue, 5 Oct 2021 14:23:04 +0300 Subject: [PATCH 158/250] [DOCS] Fix a typo in annotated text examples (#78683) Fixes `start` to `strat` for the second example. `strat` looks weird but it is a short name of the legendary `stratocaster` guitar. --- docs/plugins/mapper-annotated-text.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/plugins/mapper-annotated-text.asciidoc b/docs/plugins/mapper-annotated-text.asciidoc index 157fe538bb083..232fb687cf8e6 100644 --- a/docs/plugins/mapper-annotated-text.asciidoc +++ b/docs/plugins/mapper-annotated-text.asciidoc @@ -137,7 +137,7 @@ GET my-index-000001/_search inject the single token value `Beck` at the same position as `beck` in the token stream. <2> Note annotations can inject multiple tokens at the same position - here we inject both the very specific value `Jeff Beck` and the broader term `Guitarist`. This enables -broader positional queries e.g. finding mentions of a `Guitarist` near to `start`. +broader positional queries e.g. finding mentions of a `Guitarist` near to `strat`. <3> A benefit of searching with these carefully defined annotation tokens is that a query for `Beck` will not match document 2 that contains the tokens `jeff`, `beck` and `Jeff Beck` From 1971bd4591da612d42df679ab91a9dbd170de765 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20Zolt=C3=A1n=20Szab=C3=B3?= Date: Tue, 5 Oct 2021 14:06:48 +0200 Subject: [PATCH 159/250] [DOCS] Adds Transform alerts docs (#78185) --- .../images/transform-alert-actions.png | Bin 0 -> 33480 bytes .../images/transform-check-config.png | Bin 0 -> 62813 bytes .../transform/images/transform-rule.png | Bin 0 -> 91300 bytes docs/reference/transform/index.asciidoc | 1 + .../transform/transform-alerts.asciidoc | 87 ++++++++++++++++++ docs/reference/transform/transforms.asciidoc | 1 + 6 files changed, 89 insertions(+) create mode 100644 docs/reference/transform/images/transform-alert-actions.png create mode 100644 docs/reference/transform/images/transform-check-config.png create mode 100644 docs/reference/transform/images/transform-rule.png create mode 100644 docs/reference/transform/transform-alerts.asciidoc diff --git a/docs/reference/transform/images/transform-alert-actions.png b/docs/reference/transform/images/transform-alert-actions.png new file mode 100644 index 0000000000000000000000000000000000000000..01c823935f7e06e54dcc9087c2c3581a7d7eda52 GIT binary patch literal 33480 zcmeFZWpEtJ(k&`xw8&y+W(Er_W?9V4%*@P;7L1sgC0ooESZGNWGc&*O*|ztI_u|F9 z|L*(Fw)n5CrL*&Y+#_TKRiK84d>{l6doR}r0+M{J3<82 ze~Ca5F){!d3koVAM2^6OgW=sV*b7s@coaCE=zU>x*Do)IRb6HLTxU@M04w%H?@dY6 z%tk1B191>{{GbR64sHY&U!|?91Y+n0vP2>#BmuhQBy{Wy;{_g`17Sc2S^*2|2vu(f zvII7Q9U;W}UJqo6NAlz5!AI-TE~4JOt?HlHD3w1k54W~9gnPdf1t!i#zC$_5)>F_( z&d60P_z8mmP=TE4H0H;LBn2lGfr3&<7g6!+21SwSBEC>y79|i<8%mM@gxCaXS;sC!O zAmE9iAke_ycfhacXRtqK!Sp|a|Jer}`&ICRvWTQ4@K@Q$(Zs~o$=uEvPBRsF4bXWD z6?JEISs5N9I~xWAV>?3=26r3#UsXW(+>N#qI2f21m`DWRh=_>z9F0wRltjgUR|o#%Coy++w&!7FbaQiK zaARe#b2MXQ=H}*RWMW}tVW9_>pm*}HbvAIPw{;@@=OTZuBWmJgSW?5VrK)qrL(}lE%Uqb zf1mtak&p4$lmC|{{!#OPjso>80LRDpx6K6LKK3@+fPe^rNQ!DDrU>1O735i+0?*HG%GPLBO^0#M#LMLwvk`<{W zV*KV$^AnmDirg1>cO{={bSuQjq*IeO2ck-Hksn;%SE<)Y@eBH$q64H-r1*zG|J7YT z8E6vY2iuiyRu#X=YyoNcTt37Uf~DXnEXD+hgw4aF#kws`u@qV@asH`fZqk?QS@}b5 zq<Ps7)oW(kOO3sLUZ}OF1V1PjZ|(Mej2+i5qLX$~^P>GuQFqJUA{fEukc-hwJu`aCr^dOyJJ zB*)_OlR-vjo^Sb!P0m@cny)_ITt6?tSB-gG?c|HW?~=d7I9#rhpt=~?vDfjAxq4q85|tYKPA}W-Wch~8>Q?)P12d(|^KO>5 zn`^eKgw^}55R^nBv zw`F27Xjf(@W_i&7J%KWXQBO|RXuUpzb#M4;t>>8}SQ`EYhmZ|j*lzzDu?oPEyvlhM zO}G2_TU}J<@o{$i+zCcNP}{H11O;KEJ07 z!Brd%d--g6%GeHFhN%ubX7IJnL^Swc18tztXCbVu(rU2^Fa$NRvXVx`nJW=9oDYvN z^QqSBVesil9$#s;SZ{HgVvxEpTG;$%KsrY*lbiDR{J`2|yP7ze%P&#!>8%X?gUdjo z!H#`Dmf7o(oeg1=i8Pk-!3@Bddms`se^55F!o+c{)8ndiFBAHWKu{Q))%0_XUXM~x zsO(2nlkC0e!l7hx>0N~mft41k!ub>mSxX+$$Df;T9-9Y%vgp^+`SogSMF9D!^8E#}F`z0l441y1&>`E)+*>f>>N}v!jML zDUQYt^qEh7%4D-4Hv1A8mBD(;j!R^^%Jwpo?ESB;G5LW}pz3?wg>bF0*1MgpPj6Gt zlJO&DmRsO**cJtVKaS``=<4cbrj^QM%xLaWD;FoT>S{(L@EPP)_Jzfjx_zot4>&#% z`Ko-*T!PQ%{&9Ds(>tyj17)l{GnH6`XF~ZV-E12UeYl2v(j8O&f^o}a`1WK4mUv#i z0^bsp>+e{?r1eV>t!CTrVEqA~9spDBXJ8tf<7CMy`7L%P`}Sdxvryu6k>E%@m*JChghV$$^3V^)~8xK0G!@8dBi zksa0+#)FLhn$Q&)%9h-HTpk}YRWkzdO1Dv3XEL`k1--;AsYI;h>epApuBYoydU*51 z^@Cr_WHRDm9y+f_h$+ywj3#yzCao$Ll}5k$?8T#Z`5t^2iX$k7-;;;$X%Z|I3A@!? za)rZOTU*n#-~#>Q)=YL_%mU!eW^t~=p$s}aim1qO3Ui)!2Njb7HcRy>p~z3FP$cx4 zjiv3!LzBl?q9|&)_*;On3p9$d1$S}F(d~$OZ7nU_s>`#r4*8TOrRzL*cXYKh5bmK= z`jt|XG5sO0RauB^P8tr&Yjqy4Q$C;jb6vg?76F@;cFDo#%~m}Df$m0wKJg}Zq(k7R zJa_BwpxxUE+usVZ1#_1<|FUPRnNOK)^@hhsWn^;kki}^yhW@~+BFy!r1(TQ@y@$42 zt-_U`Mzx(x=bfR92E+DsCc9O6x6%VS-q}cQD;9B{RGfOfo`(={*4cSFPKW~F|@rc*<+>ibaxM{N_G*F-R3wG{{?)G zuS|45RCx13ICJpiUfxIou*<%~<F?-N_0@CTn>*8 ztv8h3(Rxo@BIMa$5io^`#39pd&sC?En-C3YRqKo9ncrg*Me|Gw3k` z7`jcVUa|JR(?w04Sc|wSUA9%p+OOhmS@pFGmdWSoYWi&Q{TQNArJWr?lenNFfdT{n zZAkE>`ZH!9#GyO<{Xsm>e-gJ*I0Et#DLKoBDdlq`(>0Nv3q)o zsXPBsZ_ggnZoR8;fkanxrbsfv?EFv91XQ$i?=eLB4icm%)PMS_U)>cwMB~C{C17En z^1mh{B%m<0>cMg4AO6@)WfE{|=Mu~7iTI}?N)!Z9uOX^HIn*DsuayHs(Vyo&-Dm%E zB_TTC6fsKdz7*%roUxY&R>)stueEUDuj=bQf`HLsZWLPn_17aZ5Kz;ctytZlKU1~- z{}JeaH1vPUhHi`ZZ)F)7HQSxJb9(F(2n0Pvf%C}10x`Z)iMu>%17XU-tn=FwUd!q7 zrt$SQBMHmJ+V1H)64F0z00PsG@oPl5y<2}%7>HE0n8<8$-g-p5ym=9&l+P~8U^PoJ z>w>!8ozN=O@P2#Esn+hM(W4tISOLyJ0{=h;< zN4NFxef8bg-9Q*j2GkH4EnCPC0IZF!aFV9d`3A3f=|TtRzWBhyz$mnvpRZ0$wbrqy z_r}2wHjbqGhJ8Y={_T}Q(Qr(;tA+^!YTe%4j{q~ba^()piEQQ=98L>Sc1sn?+!2N2 z)s8zh*B|cXDgYjUWLClb&(rNm$)t{7@iDifa`$scsmKt6^Ua~E z#%W|q#ej!dQ!ImyZ}E)DSjApDwAbx%p`PbWf{DpkZWIoujhxw3?(9Udi|@;$3l5V# z69$8l%x&D+Qk_wW8UZFAJQjVz4s*~Y2F>j7w9)>~Sej+``rsSG%6hE>>*L)zS|Zxs z&h2G%q2b`})^oA`{p*Vt&fN+`xmsZ=Pj`dq1hJo=A7DgfrJ?&6_s-)w-65IvlkSoq zdk|MEFapA$)s>RXwz{jfxqi4ZTY{Q660J#AuDTNmLslM=(`lS}<@XKbi{t#P!`q^iFC5ZXeKAtC z(o&}TBChFj&j0L58*KLEYO`&tKs@;N@u4F*xuhqD=?{$ zqTAvIFs7_)0rGjVYBjGx^EFzeQx8Ly8+r59HddOA=G~di`mcCAH+jB-wJt}TqmJ%S zXS*@9&gXeAhdvzxVlE4_>LTR)B;Qg60vwJ=;ytv{8z z=4jS?Xtmg41@1Be$}V#>E?h9VWe2RwigzZm;((Ar8HLN?TtKyM+eeKC(?U-iJh|Lw z`CV@B?exrr*@kA%acFJ%ERHJkqxl#WfTf8?jKHK(& z-7PwjM43eB?uUP$l}Ij4F?$c~=e~#5LFqD){*)N5K{~+mT*I$gsqi6}L90Fd^hcM3 zWD;3E1nfHn5@xM}^r#AWa@2!I>y78O>zkubn;BU_(8#lGS9{;BkqP)z;!?oZ`0RJD zH9RzdVU^|g@({jU77G%5ZX7x!ck0_8ZSjtwuRP(7yW^4`m)rR_N1We)am#)`@`wE7 zu`^)ARMKcMqY!({y?u;W(glPT)*I=5>G^)WOu3$aauU{Jzb0s8em+$^<~@Tcg4>w0 zsd|H{OVdQQ-RW^gKZ)+b@yW@y%;!V`L0|8iPSJ>W{de`XJY=Ri8F%Z3xA9d%0nf?A zB2XTc&p$i224jgCSap`2`+MB1KMgoC$Kg)()&pBQqO;R>|iNjA$r)f5*?Z0nDu+OWBQJRc8dzFY0^)0|`htP~0WQ}VA9%<1WAR_2Lf%6FXVH;&o&#xW6#SHQMVT$;;!#-i0DiCA8I-zSe*Zfv6*jExg~I-d8e|La^wU)WJ6aNe=xVi;9;)<-pie zMajFBK)_jjQVCDcS6g=~m7g~Ui&bc;-UL9ML>X%7oXJ);z@k%X%(B}J?DtAJ*HDD3 z!^1xe4$55tQ8RKNQdH>U;a*%WF{OL?3XBw#7AA9o!$)OhGn-*{(#TjN2rXudRFMuc z(=`;2zXU-Wnx573?JVWdWw6qw1^@J<3ZbR^aZfzXVlr783CV86hL;{l+_0%3v=-hg zcfrBIajkjpMLkweH&ZxvIA2B&`9A6aF!rhtRRv(~D<;$JaFvBq!wkth8A&HDoNv7- zPMD_;GGj>bddM-O{uA|}D1tE`f~T^Wz_r0An%RaTU{kp5*QKl1+SfgP$zqi_hgPpE z5Hns`+TdfNis$2li^_P1i^J^L=)BhBv{${>jqRk@?d|d1>r=RiyltOO-SuLDiPdA9 zm;7?0M@47#`1pB5+Ja3Lex?*?zOL-N1DiJ*!xx@-+jsB`x~AT5{2n61sO}BO*=H7_!{Z9 zuUf91h=K7!{4Mz@+0E#5Yt$oNYzJieYpB5x4}+(ia-#Tir;diSbuTD z??gqhfAXm93jMQ*plL~DL{3EJtKQ%>g>I+2BPqn*&T1vM<8BJ8y7%N}r9~2jcWLH3 zFFDz7T>1%W1;!fRB@#3is&$li-!mV7dYFuT7>G(s?MV{}MM!CAI+!UYA0U(|wzuHJNnB*`Np!7ZZ>MDf}FJ}4f4K8-}P80FGKH__N4tpSLnDiI$AVWwz_jkS<-M3R&AQiBKJh? z;fO7hir=mwbFu3WL~!0kh1XUZk0d(Y0Zau>2^+A#391{{^*t0oUIhzT0U{L{k~o>I z)!!(o!KUX2DJsi{=Na79V=zI_7r zbC`1Eb1Sy6lpX_z&nOC`9xfZvHB;&Iae0Pfk)Gf3tklZCM*4BOQ&Iq>OTVgAM9&Z?GPy#mL@5JiOQuRUqtduMB&w?KBPSmfF#nFx zAf~+}B8YeW8epB#?$Qv$J0>f~B#jaI)$|pR|rHpewRtg{BPjmFNW$5(onh~YW8=bVLSi`1aL>cTZZ`q1ONd~qFy>n zu4(MQ0lX6tFn~uY4CeT4wjeO-=%6r6Q8;qWP=BL1JfHv>eN_1|e+9r40|6T^2t~{J z7fFK#LJI#Q(*J1be`!mLSt6v<;(shKAf593#0w>->pFvg|AB#4I&Cn4?~+%MPa-S5 z=EtaIE$ll}6CZK6zxb9j44>bQeAK6|!aKs}rfM=tYxx{aO7a%;^oD6Lv;j1_58|jq zwtp6GoG5!)^&b1N?xG;E^|ttG_envxaee3%-~D#TbaGH#*SVaBnPV8>X+R{IN>W_5 zyCf|qUqOkypz`6I++49F56veQfG0k*0a`DD`l7cz#&6G{%k|&9!cdc7zpA}|v^hld ze7;A6gn}Az6WDW3cL4fY^j5I;U!M_#IUi3GU`?)OtZ6DSfSp+H(2bg-|L7lO@BEVt++RbmE;W)?bgv(t3T2E%0ahA8y*j~eJ=d;77m%-_BYp-*!` z_W@@Jw(WP<&}$7ND(>yD zXKiggJSfnXj_6f+s|qWUj}0G3K318EPOC#od3i^-a^cq|FwUQn=TdhcvVGNw4r5oCGuvycg{F;z zuVsSZf(W||L8s|ocYiqR7Va8nbboxjbTy~gnM#)nj*8h=smKT8FZ6@tT#`?~e!YpP z{V9|x*9Qf^8()<x@3=&H!q?p$FF9%KJwr;D4Zj-? zECcudwICNo(JLLdrWd&18$3xggi$MSOu2nBAW&yw0b@16T_Ku1B{gFsXsZzpPom8{#f# z;q=aNqQYdL3rd55fPg@z28r|d-R%LddL$!5(%3G~e_(d~7>Ldu$Z2-w6@W#6aP+D- zs_4+EIXvqG9~Ts;6}dhJtN!RuPtW;x%(C?}Z#*uPuBmo2mG~3s93P5IlGv^N>lpsva84s$e>Kk9nPaGidQ-l8(c zU}L_s3SCbdDh)#s)XZ9E7%S61dWJ4rkR4x$eKvVZmNM_#wayn`cPX46JM;rAB*#|HIM6&89}}(Nxg>9Qb`;$PmgxRg}N#gg>>&5pYSB z&x+k*RHhEEO(L}XJ=bTfChKXHk%Bv)o6H+FjURox2O3FGw`XG7nB!~^?xBb6=_i-3 zhw^Po9q|=OL6zxdb=875#0&Sg$HYV82 zCUxWMo?BIy8cfhSGT;Yepb9W(0?uAV@t|e$y3pbfet1&HOPMv3OI(!oebF$elOUp^ zQW#em{P7$mJC1?x_090JX$89ectXhR;&k8e>ZWlC9?|^M1CV_cj;x{QX+B z4zEHB1O7b?$9=%z=97Q(GAY}BHiCqE3frD#~btmR0JyM$)nAdT?;sDz}TG&)~xhm9yPqd zQSSrGPho4{nS#W9u2R+XmvsacDh1SH1w+RbAhk#pYKu2=w@XY8eZcFa$z(rx%> z6hN;IKb~bTmt+{dF@icCSz%=JF*|oGG<8~BkCMIf%-oi{-kva1T3br9HeS}wY}w?3 zf~D#pz*uM8;j32_pHE}0zuD+U0b^W$nvN;SD>Fv=fP@w) z`SP5ABft`4HuBBRU~k$jWniIY3i(=RMhf0|PXK(r$W{~lQ+%aluXry~S8icOUvylG z-TWx$$$9(Nw_cC1ZTdR&GK*vDsm-xPli2Y23Jt8-J_-~JLZ;gr!=5_Iv+j?6%xj2c z2fUcB6RkKJV5kpX`>SRs_&nY+cB-T6bxOIm#gQ1JGuIY9K!k)33g#Z3-Q{kF^RVHV z7{B#0puRX<;^hcXsLZIne@=fPWDA~0)4WOR7o*L=R+NbkuxIBp!UUHUPw<49E9dmj z<@3cjjO;2z145;#ET%ODcN+2DeJytD`;)6-`KLDPEUfHyAfT9V(YX*6dVzDsU%{-l z+EYl>t-^b-cvl)~-qW3;e7no}z&Y`)%?ixxVuE*j_QMs|>Gd}rt*=OTq5WyhqKkUb zV^o^~68_kIv@{-Ei-);aYhUquump7GwoBj@H(#G->eR5O|y+t)?=lEKWQ{abM zyjE1}O#PryfPfdplO@79q$nxcRs@*ZQWOLr^dR7UGo7bKctt^o>iKnYQkP*Tuk9*> zX6H>xu#Ib4tL`Y_>Y$;eTeL#V`Pp$Pc+1!OIDBqsSjB?9Vh3RK);0U6R6d8lPK`}& zFIApx*>yEz+Lt*()#OD}<(w@V4dUI4aBjE(d0_$~M@K>Xs`Ff(Zkp*h9-#gNlQ2+R zME$_4GD_5^YOXs=CqEMAHv5jtiNe^-$k-}2mW4#CrRm4s6}f+N-jk@E;FVG#KlkEF zLRVMUIV>rU{Q+spgrSIG)B0zJ*2pKjp#AtypS^X9zC^d8Y(cOTxdEVV#^SYb;uLDg zBw2APdqfQ=iMs>)K(NPy;WysFY)z5<@JaxMkdY!{VO1d=h)%0c8BUd@rgRn z9rQpzQ}Ay6dUc>weZ(QbsY4xiwc3vF$ys^&!WG8{8hdrKuLE+@^&Hdvw31kbqRRog zxk};R9quw>71ynBBz0`gn0-Ca*LpJmX$0-hNJ2MoS`m=U*@S3<$x9;AEhpA()5_`y zak%hNv_|)7I_JqyA-a|h8?V&2s$YCtH1!-tABv7oxD^RFDd2$kIg8aGa`T-rd@=(0 z&`KVhs&`PAL9iaCp~(q_b>bGCsz{~Y{WX~$Qn8b%d+q9S+XEFVnsoapDwnXKOXwgI z;`qd-6i9GXDF|0i@1XFQ&TkDvbHVf&i0>;10AUgb7exmJ-iQx$6`OA7*$=;Ctn^Mw zGLuy+yLfw6_S5ARuf#~$00QV*$K|mI%1H;NkgwrELSfE|J&4+d1|j;sd_aI9#n^nT zcQ;hLnSez514}$X=lAtgkd5fGD^)s;HJBoj0~@N8Mbxql)z5DfMT74_F%4w-(3B4h zC$G;e^xD0q;?~07+wpN`utngTjBI}dL~Wu$AkD5Etg3J41bi#jW)kF(OAOn1o8sHX9XCR-=?I>w18FZ=bG^aUKtAiK`z>zi4 z)g^(6WkNcH1F{jAa{VPXN(I-Mc}AJK2j-KK%qnxcu^RLiz(-c5VvmpUgWu9}(m}U& zB6JiZH$R&kw%M)i)mBJ-y2uLZ;k- z8TZ76xaSWnvew~6+h1?kGoq>%d9kdI&EJ+O!`J*!<({FkJMSOjkv3C!5)jGl*%l$R zfw2N95CU=#i9`zU-$D6l#(TLH!u6GZ%CMo%4@ku^4)Ypk)0$K-q$JX}0fw}dHvQ9j ze}i{*N+Js1KS23^Sarp}7$H*2r9emc!$^Su0!q&~fBB65{t-ZCNydAw@;~eu;N^fN zkpBNm1f-LpP=VF1USE><`CaS>avA<8_PQhZmQt~>-;t+>XQ6t`0S-pz`cUZlTQsIf zp{?Sokp^AmcISggHD6556JF<}1t6(Nno=&epm<_=Hnobk>2hFqWO#b3%(oA7uH1$4 z@%$B>-{Vr|mXxTsm-HP_1r+7DVB?~n6%qdccp<%2T5bm$eM61DTbNaba(Ud+K!$AM zLbvaeR0!N|p`PD~JO*v@_fae@N+8J=Q@&|Y7Dx}wpTPa39EmPCy?ldPCfmWVeMFlp zVgfLoo(gQ7VHRuo9oMJ#o~}NX>E-1n(`hIzjosjKSl!$XjC~T0*C~?0W>vV{9_jC! z0k_zj?7Ch*U^TWo6H1{?DRDHBp6+@=Hs2^PQ7JR@;BkE>+nG$s$z-=7GyNtvn=c}< z-!~KoT)ssu*Q?=JT8ap(joMQ=jTN2-&fT>#)pbzG_4a(g8iUW7Fc^-78&#th7MpNa_a2wSo6hD(r>rik zb6!;pJ-PiRWh)x@pc9#dgaq}X`nS3Zc3iEUgM5||OJ5*tI-yWl_>XYAaztLYbSm}6 z%$g0ZLD@^o%|2RHpH?A>+);*p#k3V;M5UtGn+EY}TEFpndPFW`K=xC$WkhtYi z0X4lwdtf4ktc+i^rnu9d45|E-W~0ptgXha*jP~Ys)}iNoQC(r!^bEOEnK~-6Mr{65 z>#MJiUxLSI8oey|(_Qi9&Zt5L3%SYi&j24Py*0ke#pPcTu7nr%{88U$hd$5i!yPLg z&tpB!7T+XoIcGPwg_V*Hx3e*4U4}*sR@sZKp~4X~zoaqWQA9w0A`v6?W%URyr)@%* z#0RN(qV7)ZB74vW-=|6ba-ELQYzy4WBXb(N6 z=$Nl{%4~Xs0^Z@N4m&p|o;O+W5(AR;o%wx3!|rs`O0C!!1@@_5Zu=*3WPy1DjY+&V ziyFx>Z>0~9pNUC@Z_aCakVmb$o)F+%WXnXTy=IcJoj1M$6dp(tKVvh7;VZNqYc%X7 zowkY>$xL+eu}?93aqY%5VZ*EMwmB%*CfSNUz8ycndoVKA^lmbMB8BxDJ?~#6abbJW zoF+y|jRoS*AI+Ch!&`i>&-ju5Ua6p2gqM+?A)Pk}4r7$@wT1q(SkxQQ?StiPxyLX) zj)afrO}wvOb{zg`gYo1?_}!^w7w6MOxkp<>9KOW%yM1Zk>R<5(aIdkBzIORS_nTVR ziNj=8GY-vKed?E|GfDQ1y_WBZv(5@V^d#@JdRM*ErUxaKE$V{>*!?RUX$)j+kCd~K7hS??rW zbwI4a6ItLML>y|jSS`oCIm0>*x1_280G=XF_Qq#dcsCpR=(Hc!;?@LGLk9{T`;5l6 zu3uK}xUjrN3xwYG#{uw^bG87v6S>SilMv;O-L_rkDGqu)p1f|~7x8A-=I#5ftEoc! z4^>{R_PIK^yq;7sILzrl0ytnQUCE+AG{StclA0xv|1HnW5ia)y?o2?pd(IkpPd<|k zw(98$8JMS#q{c0!GkxINAs z(0XA$b3Qol;Ybt-ljGl3JFr{tws2VLH0f9*o>eYhZFk9H(CaRC(OH*#>+afCZ?;>J z5?5Pe0DHc0<{D~Ws&hhq@!AyRHvL|qipp#aH%4+#IF%{5Fq=ZVK&4uqtdj4oL8CS< zA_EBPAEQ<$%G1P81MpVkZSDTd@4LPzY)QXlWN-!ho)}vZmHPZaPxSMLSfjoMFQ6%5 zELbW#q86H6FRq(pgdq_EdOr)bfq$&(k3>qRoI*;YQVSLcN4CjrqoZ^cy?9@z%!CV_ z_=CpP+2`$5c943e-^koLg-iUoL#@ygquu2xR@<~prH)UvN=dN+25*Q7bfSm+)qdxK zL8TUi-|toX9@Ynia9?EqI^&9^d(H?InMVFJd#>C>`Jn};PgdkY5QfUnY7k_D300~T zX7!owCpv107k%ZE^VKD{->GJWMhuA8`8lxz-#d<1@@?de6}Phyb?OrNJaW!E701=5 z^8_PDC`yOK{_DH-Fq7BjDy?sq7!?-tl@FUi9S9FFpd6m#XTsi)c0;QTd;SQv3o366 z`Wm6^ukMVm2bY4&9f4OG8?_qkDh`oYjQ4%19`-*nWrh7+-r5@Ql47!2q-BoBEut^N zSh8x~BR5menvP)C6$m@8qPo~F)r;5`?t1#=vB^FP%>l=~&fsra9kysT+C9Serw^m+ z0W$!pVU}bN+DVlKcx$MJ%sTY#U zl=3JqaBGtNZ^@ex_nh;Va8rE}vC2vpEdx`5TZ>|PJ-#Ucgf;7}WelrV;}&nAeT@p( zI9j(p9;Bvp+;WO#N(1JHjZ4lN;nr)*NUZdrMLAQs+CP!wQmv+-$%q)M`k5 z>n;R0ie+&vOw5-GU}N%_QWnpmLQX;vwStW-_}e{i+7Vz%Q#7`WuNPq*HKGK2m&(=3 z$Oz58j3wNN_U{_>ASK@|l&a=6pDmJy5Jm~vibR>lQ0cTgJ1atv$^dCA==wNfxP02} z-T-IO)mC3Xx=%x)URX?l;DT)tfiNFUv!wQxNr0S=XL*B95Y%<5aJ6-Y(%ey6UP`6f z)8wYr-ffIw>Jcvnt>TC17X#|v+p{+<7L9s$B#a9xQChVZ$=Tuw;@8x^u~vhalb;`a zN)@-}=Tsr$jQ2J+`k)jO$s{XN9kdU*c*DUWaI~ ziPb5>3145`3p&0EuX{bY(wB){Q5eE*Lds^d3bVCwEi%x@C z!U;Fg!PGZc0@CJ16?$7(q}K)bjS;ee`EFxQNbiRk2N+)6&FL9KE>lkiWmlw#)hbL? zN3$r?66wd?ZY4I6T{$p!GH;(HiY#6~8(a*e@_s_%@p;U?wyAAFj=in)h+`+jqES(Z z5$i{41*Y+&aseUP)U%NOGYG9|k}uLj-rf@Zgodna%^Cyib|=fC!=L!ILa%F>&*VpHYU7RjD8}z5gS51Xc2ADATk}aLs(GW% zM9<)_E!LBAJz3W~*h}4BH4N^JN`f#y2MsVyJ*T}Ji{_I9&QX%tM**%EKYDAe*8<5M z+x#}q3ITTS&jQtg-PG?kaA4GF0`yC$q)&3hd*-XrI(CBB<1QbcjZCFUqrUVJZSYN` zQq|E8U=i+*iD{#&-$UFR)Z&Tj501Ar>Tf7{fb*7GX(HC)XU61l4;qfEZ~6OA3^D_9_lfP?}-TCqTi}V@jT!Wk60rYz{>`v+Mo*k!Fc-PIa14;!^(KXX2ms0g*ofgGG zTqVa)_U3G}+w73bJF^`^_#K2rsyfjLFl@{h2=}4o;PsN}@Pw^xE*sQ3K%kl5>enh6 z>?9!XB?6Iw5+JYM%1I0kqs{~xl?SSvJ0oCmDN|*zP5A}a>R4#C;uQHbv#TA3FFOU(n3iQK>w5UnoTG*`haHzJ9Heh|hcB2w^t(tw6hsV{N7V_pA z+X;ZYUI5w9&$2~zKs1F>tGC3+-yWGEuXTXM<}oT`NU6_3(6=j#8>!>uw&US0c&}ml zE7{WH3UjOy5^g(%7sq3)nRp9Z0Mmot_f*uW-{%GDS&A|a`iTd-eMocGYQB_$FyN~| zP$ycmYDMwog9~1M7B>#g%F%+|x6l}^GL42%$N8w7GmnP;N5rfhr<2MQGnpG+AZc)} z$_n~GXsSc)L3-*8O?-?Qu4dBJMk|u}wjkC}f^B`sPh{}*CFB!FH8k4KFl#IE&V}u- zTSXA^-(`jzj!|n->*8uT49Wa*B{y`mGVA1{J294IKKhI3oI|&C+sr&8u1z!NM!TS8 zP&m}ipRK>l?G<5bLHRx1-61Q8FueE5Yuedr72(^mHg{#ItZU*>t6S20)f@JcJ~l;B z+$sq@$6{2!MpJ(svP2y^kBLrdH5wu~m{2Pmjbgg1aQtwy^yy|41Oq0R@u zVWG_X)<|^I1Shhklmi4>69SVo%5}`MIa+uZW2~!yTRgtFT>q-?-kr{ zmXP+fXfkJ6u`2Vs#Z)(VqrJiKtRYt(vnkaYiC{eY6UnOil@~3L=d?9Q?~Owo73&^_TK)};#RzH~3<_1}PYPiO zNZ7`76HN-O(t0=lJ~C=~AYtNU-Qr*jK7$(%g?wuA?den0VDyX5U@IL30i^5xIdkD= z2lY)bhMnTbufZNhB!2?j?4S6UNPimQ9`tTQrHOZGXJGXY5bx| zS@BKd{=vCGfz&HdQ>dU|ihpTRm_W>G3`hR@Uz!xcFPhXBqWp;8;sUd{e$k}r2hqCz zrAdJUX;P+4l*&zrARq##zupD#(VXP3P5xgZ-v5a7ztf2Sqox0qmTpbI4Vv2&tc=cV zq?(x-Ni)R4Qs;Lixx0~=K~vHs^C5qqP>}50gS+!J4%Y#DfKN?E9L^=BZR6^Q2ckZ} z{DV+FI4m+Oth7ZNJWFU$c#`vHD-hYPs|@dFaFZIocf3j^2(WVmkKS*>R;L6dtTksN zY@fpJ*@${5+jz+puYMApqTcUITwg_iWGXDC&Ty~vcR^`>jIs_4*7&FweHh9NMpqdK zM=>Rdp^R1X`oJ5Ug1BIq;7`(f&7N-KKNfn2vcN-$Ar6#uhy9$WvPUM1RXs~dx#m}A1 zY-EC%qlT73LL7m{jGb*Clo{zuG`)Bv&gG0b*#ovD?q(AQoJy@0kbr?Ww#LgB5s5O% z23I!kZM$nA$w!$J_9no80EO#$R}1(;ft;0_&5C6SVA?E}cefuPXsV{n!yd&AX1oXc zqlqhYR88wF&6rKZclr-oW5`kCyr@IPIz{bbi>;s?z= z!Exm9f93(KmOzhsPZYu5UZpwM+iFx(LR}^b~ z?eoOl?JQ*vqh=32a%bL5@D;qp$9x9O1FncHh()YQtu!Q+7CG5WHjhvg{h?C%bz(Mq zAx0qnYVpIm5xb>awdEA}t_l$`c#NW+I067}i>>mcwMLoEEXCYsHTtUDRj;e)*Dj}! zYC$ie*;O>kLMd)Osx&Vshci^oI$KhJt5e~67_#cw5r;j>uUBvo;J--#De{R2Qo3#} zDr^q-OzezE1$q8j-n>B}kN1#@3jVim(m@#x#A>j7mxu+a5@7pqY;_|;Uk)MPqcL78 z=PLY68gwfvxIj~$M)xT5NY$L9H*;Ec_RG`uog44``N(6LT!v#JoBe?md&nUj1ilV? zmU2{sNjEZ^&7;_U-i<7m_~D34};5h%XxWw18|iM5<6>? z&}}?8Heg341$pPSMHKNjHCV*3z z1%a-{(LTv*G^#v40@zp&EK^&=7R7!n|IHmL0mXNIUvWQl||+ZI1IS&q)f zC-bgm? zFBY#J*I9MYo8;GY%JcXftv(p6+>MFO%58wUd$J{+R5D(KTIgGdXXr*Y75}9muJ@Zj z*LQ3hUCbYkBBDB24F+-Gf}@e@_K4+cf$z8mllD@a(2FCUUW@Er*AMP<#^!2WWx2No zzEukzl6o0?bb7rr>w(TlHJo3H1OMiV4^X>7Km*wS@ zGj^u%$dtoZ4wb_o{VKS4b8kX#j&J4{DIEFf)MI#^$=)wXoH1TM#Vj_-KO0~>#aG}L zi8v#`d-sxjxY+%F+WYFSxSFM1AP_7BhXj{Ef(H){Aq0ZE!w@vMI}DcK?t$R$u7hik z;O_1)xDE2{oHse=yX*b~_pWv32iBTlckk}r)m62to_ac9C4Z>Dq~J$1Lx4*JJc7Hk zwd%U7E0DhFpvn{=?mZ_G)F+wDpNyQkD`2X3QDva&p=8jkv7oiqz!f_Lz(6|h-W^{ufJZp5O6hunEMmuYIWFScZo*^ zfSp=CTs+ZS3xTe``y9h;$z6-G5dx2pqc}HmGIz;__5gzFDu$Sw>`wGLSKmx3*?Rb^ z1A;6Il->J2g9eS@L0g`}O5W7vN<>QYbh$sn(o17ZjatLPY2vT9=+j=KC?e6DoTbSK zg?973#MiRnG;~t@#J<(65<<&H9FTW>f~rfzz9qO3#P2iKv8!uapXO=9&cxfO)N*}Y z1UfEOr&-19>Cu<6?J*hc-nKYQ`WDFiZdvNp=xOIP%k{~7Y^KlzCdaIGVtPN5w)5{1 zaNm52-Ys^r+D z-lB?c;sv6JT|GTYe-uLT7e#w@m05!Q%Da+{1xds)eWYuxO|?q!_WbIQ7h25ZJxr(S zwFe_TB@ZNVqxH7yX$cJ?DiBQ(3#f->m4?^XH>9}vdXb8v8?&u|!WuYuwE&l{fhfms zSneAJKZX&Y<%aIJ9OnTaNp^6O;1Fo3M|ecvzg%aa!mqsEOHgsKek`vblL-<_)E|0& zVj3zQ^Op2LV4N`5s-f^r-HL!es^OhO*iq`7tRL5X(bU8e6KTT?acWw{&F#0fW>-& z*cb0Syj{48@3uIrn`No{lMnLV5^wL}G_4P*NtbjAx6Ps2gtCB7sz`56-hb9ueMQL* zl59B$S~L~i6g-XXl&OD5E6?0_<#WUT&1;m<^*}$(`<>9B1EQj!z=x~U#RUAL#+&%P zvPNkyjv=vbT$&sqdqT=oRLBjr@-vf4e7W*+*tHMIhlLgj?4!+=Eb1H%9ebuy+9E=| zq}5kcY>nZy&#P-sIeedhKjeSsVhJfBt@(z+XXky%UoYk8Y=x%w)rinXeYVN!X>Tl> zWrzYXN|y}6F1cVX9CT$d%&8QWPWLEO69Xf5`aSyFU(zRn3+d2oQc6%29&zxG@m6Ef zcUj$G0J=p7$SP-*O`L$WdAI+bk!Tl{S4m6R47JQ7*0KvR2rm{&5^3&?x1! zq>oSeHZnTrmvDrX!DR2dvCrF;Ztw(LWcO+VkPuM6$6=Q})!FW__ryC4xj^5{qI1Q%%29($r&UAU*#Op3)yyRn|ls_SC^N_c=hakJYe@pP7u_6d3~ z#JaW?BByNM&8a!hh#dC`Dk){}F7I4HWg~%7u8btGWA)sUd@yh-;*Jt=!7MG8hjX5kbMKvAxr@tt*uDfop|r~kQUKcb7vddxN|rk&`IuT>HQo-E zrU%_*^W&DBIdhAmtf|DP-G*)%c2|PrE4SyxR!@sT50|Ua_SN_i<2JWJia`mE99E5)bA`m;Tk2g0|?g_!!w?}+ASGNf<(-Y_3 zD1#ma+(A!Tr`zRPMx;A!Cr}Td^07}3TjlI!zcu&eYu|q0sL*_>u?jxTdpM74TGvR? z4&*(yku2xUygx(kr9}%sXV#*C*A3tJ{`R>X>nD`*ty#OzbYlp;FLl^3eDqpb?j1b| z)|fIXh+3j0?dt0D_gC2FEwQ&mO=*cTN)^S!L@$3l{6K z=u{^Qk#?;YPZl1yqx&K^zYq&TVeO6%d|7%SV<&O4DI+ow+9K>hXQRJEioodKmN~OS zeGC*%L~aXCSxKN1Fo#8B5wlQj*oVG#>fhd!0BQ+@zaaF9J5y+>Sx%!1%FVG{e=o>@ zqNJ=TmOJls*(j=4H{bVz4Dcel5Lj3zFHC3#vg+F1)k%R1Q>f_#u-A%cJu_qU zcSm1zI?)=u*&Q}ek&0XvvnVr7h!3D*t=HTBZI3(=5}1EPh8>?ais|asna+m`uu0x~ zoXlkS1w@R^D2RSSCB}}LI#o10J81Zlfil*p%3t}$y3Y=~fz(x`jUMG#TCL}i02}63 z(J7F|r^Z72LE~rfCl?AA@hpSj_veRw3TW444`(WeDT{A(_w1rldCPuxP6g=ED z<+(#t*FIKkT&n{<0%I5o!&t!D%NTsua{zq@-*cblYLr9ZKlhUUOUnAIBW%5>ZWizY zmQa>0fHGi{RSOsr__CYH6NU3R7;aso`~*wS)_P<#^PPxycf5H_u!32L<$G?)NP!KX zT?P7Q+`TUmRQghL6+P@GgANHyh`v0Md-R=Taxos@K@fq&EOqse`hOwQY&~p!DKYkTV=XNbC;E`J>QgwhPfMhMFlC z5euZS@f@B&%)5T^90=Mi7>HwLp=}OGU~>U)vr%S>Q14lJ^(`zS@;_o0+div_Rt?XIAaKn_^Wx9cWdH!q^Ewu*{J1jVVCC;+0fpw3Q-Ee*)d&7iOH@pYR2ENWHC(f zSR8aj7usT#ffZ5>l1!@1_@AsZuIKCAC;S}01+E%<1&e?y+@HDx2Gf7ZHm8@Ip8jz| zc)u@bW|xe>69^7wM$kwGBO%~-v%Q+1ts;~T&x)N7|6=gmM0|i&Z*g~_JFF)4!lAip=&|y=zQPN#E zMEESVW3H(lIa!iaR`G*-lGbL!=c>j@wnIc^+Sa&$_ijx_<7Ss#Yyx&*DEj^kl1RUK zoq&=bO8POpH+%|!_g0YM2btE?;Q#ZJv@{UU>}pdW{Tr}^0~U1E z`7h89h^hXsD}>+r0NK3Jl6hzEC%?NWjs^m)D$n_NF%bMw0m8`Wr_XRA+zORr3YE*G zL<1r+0K~}47RqQffc4{JSaNj+pYxGeC1R%g6?vpdb1sMZ5JCwX0kbCUH~_D%8M8(B zUDj&*4X#7JD=tcyPnhC4777YV`WDmtIK-JeU*w70=@n)=DWB8$1u?hjey&hf&9{qv z_h<-&&**0)^VsGs>}C|;oiN=Ui&HKRM8;>>q8xC0eDIULIy;MSn61bDJ!*Ym)aue> zVzU%_#)v@CS^QcNkd@&`2eHiFHo4l3c1tDn&G#k)$)eq*X5?z~E8Uw^J~>&l*(Owg zAh2)tO{!}l0AwKL14r9!4u0frwo;1j3d(mbJE|;xlugMfnRikIa?hK^b3ko+~nlR5cCDr<|@uko$R&ipwGGra#&8SPk0z=5tx5m8R4sB4yuG)94CRSf`UAa^4#&Xts)a z_q#^Y=M8onj$!QasxekMBf@ufqgMcOKoO-xt2GGV!Fex3G@W;{{!#Mt+0Lke*=#O# z34olku(13x^h0c-#GQQYdzCYEX}rbLYuwwXbLZ{`9S@)k1?&5p-H@B_0JLm46TtH@ zO05PEVuz5cjgy2jP|nWoQWd#O8f$`whtR0giN)~8Fs*T*Wcp1pFa9lnm5l1JUCSPk z6LL9TiLyAGD&hOtKALL$D@jhr>qsn35D6I*z+AvBHo1oAHiJcpxh$gC!B^z`ufQh< zmvXK2s<@s(rlq8M|PNRjyFliYR30h!n4kQQE zS}u#F33=wG%umN8CnsZ>&70nREpT{z5UtstEK6fO=KCUx9gT*Mtgn zo6!JhMPz>*lh~&iT7|Q-_E~$vozqS8i7auGy@`wzhoLlX>k2H9i0nl4vY|{dG$k@t zr8>htG@dMi50oc4bx;(mvtXk$I<4Ab<=hFYe^tlXp5j&581Ol-QsrFJHSou8Z!-tK ztXP5O(MaN{jNASTUpoq<6c`&NGD)xiN>Z|K=wpTWA-kpOrFJ*q^t#Oze(EFfW; z$+iCmfb#r$&z>t6+Y7)f;-I&CgV8)OO+7-54i5lxklPQJ+48_0KmBQImp-oYYkda! zx2+!Ao1^`4^eC)}iLz;euj2)j2`b^bv&CS>d2owqP6;H z^wTUbN1RJH`24*16Dm#@W?YS4I|7@f|MBn~l}F9TV2xrCKXFO%`@o6s07uW>bXlJ2 zjgeGB>^1=1$!dKNl!(cdPS|d;=u@q9VZ9mR6AB?@pmJ6^jegxK8Tag{Y|xvWLJuAh z%ZugcS*8X`d5?_NK%yWCG$5ikH2Fo&j7U^>*=%_2A!MX@_H6g|g7_oh6_8x~4VZRN z=engu@4G&n=f3&;%RoKT!DzRh6x%7ctsLBGeB<6@TV6bA7qnU17t^EQRH5Db{N#*~ zF)q`5E*5nomI7X-Ks)O8@{rOvR#xeX%yW}%v%aE}F2$yh+wi8Vv=cy(Mkkmnmlbj+ zLlSc|tMv$I0?E@pM%<)4@Hxi2UGBX9hK?U-lTxC|K?4-`nhD@D#AiL+gQFk}Fw7Sp zf9KO@t8yc89y+olj_qiy1%Jk|BLh?>B51PA={pfL3N>#T_)zwtmwPq)r_jxn4C<&{ zfRc(+qbH+NoLa}9bMXZ!>n#{*)+6^XS_$=YLgHqcEf#gf2hn1Us-)0E`-2(O zh94E41DdPOICl{OZsrr9q_J>-h+~BFWEdb5gRrev(wqV8$t%{!x6o&@Dg2JKCA!V2 z;bcovK{zyM3`N~K#B2_DCstK}=kt>$!xQ!x4Vil2Ef*cQ;o;(Iu{p8R?}h5{aVySo z6c|*|*=AZj9DA9ss$B{E5EDJ(q227SWDSYOJYc zCaCP;NCjU7T$vKY-xg_aW9=8A0+VQ-M2Ns5zTRMaCkr@=V@o~3-xdP^qcDw)?s z_`}W7992mC-fRArV(l?YkX}KGJrz8$7j(LKAY9Z%vvzpWBpTBC%{|yfu<6$ip^-9O zh)97FL_z8VL;dC>SoXkpj+vD%H$c$ywruI$RB@rt|>w|*J$W!b0IbPQ@>NM28x_3>F$@7;?yK=c$Nbnkb&Dq1&c9mD-5 z@;?jEQ?>Y<3Av}1Flgmwt2=!X4(J|xPRvqPZ9X4e8%$~h@KELIw%#$0-$dvS)RIm# znNqJl`yrRB(Si9~ylpMyQQ=MaHae!w+NS%B95KQf7?sSccnP*l(NZ2&SHCCwm!@jKU`%pTp%^A z%XT#4c_K2%Wi-b~=Rebz_(aC(XiUi}dE1=P|DD8oph9a9O~|mmlKW23`-g99FG(-) zS3&P-o<~=H?Is^1A>6$@gsjasmFx{Bx6#4R1~VNkw|eCn4XBO7uG$~i8C%{7p<_w0 z9q|Q_)jMDLJhN_FSCn|?VsAm`RBtRR0N#~jHy(mq&usA)q1Y|nKErbxf^PiU}}pK?&{ zU011052dw!Na4Lomr^T@EGi0dP+6hqv5@>O6jBd%eq3JiY?D$*@g(tz#A%96{E(d= z2vpqRVMoz+zlb#!UH%Z32_+t2NJmgq38pR6dliVLsE;Y}RLsvS2WSBP<(M68L zIlVSx`o`U`QBQMnvwIn&eqr$@WjJ7Q_B#(d-|{Sk-+k!2iFRo#fU1G{qj@gV!b&5S z#qo4aWYA}FWs(oSn`}20Wec*^co*cy6}<00bt)R*0br1gP9q{hmnE|OoY{!c!;P3f z`kTGTtQ)HzD6hyj6Iq>aT=)7Dc^&;zJe{~9wmZU)8HWoOBuYc+dLw13KLpNLa($Y+ z<8oz)V8X&8DW$3Or4BZW@lx?EtBvxHW`4+*7dnwQH)*hV%1!Fq$ujWnqcC3n-NtJ% z`&amNzbul3Y=l8dD+S(4j~w}0OkO5wlT3r~jsri5i|x0^bz}>|tcpQ$k5bnQ_KmR4 ziQ8d;vwS+aI7!h2Bb}1eC&=0+=pg2%wGydq5Y1wI&t-nsR>3Jd4*#nG(i~;fv#sVG zdx=GMa4`(iAi-f3R5^i*A97DJ z88qy3@Oh@*Ebd0zo!6Mo_k-?>vOCHk1dRBc&+}=#b}PB>%yTqc?QhV8NMUaea@$K; zGg5RG&g{HOIXE_Ynaj;aE3=>tyRIkSDvGp9<~R>!6IjY~AQ#hwAdk->i;thtbv2a@ zQ-}j}p;~Nt3ovgWN0bZc{D$y$6DD=8Q}%UOfk9&&As5z+@sf8;{F>98Yz=vo%+XMw zNIfH3=%y8tnNVZlStxg&ACv!VVUJ3g=d-nQDne~KA~ziPpdzo>HN?rut|+|4+OuIF z0X_I(T#mrQRA7->Zu7V^nEdO3n#A!)p%J=Jyi7yDBmPBd$eS1Q`mihFz-jQ0%jlr@dh_`YZhTJkD6w`>&_lrGb=9N&u$g&Cc zY8_zeAc5#joS=J;srq%l&YclN!drN%a_2ZbODi#TY>G%ciH^qlb=r$EvpYfvTdfjw z+@icnR-`%|C$zGZnS%O9-K}pNXO=3;BqfWz<+efasvfghpJ_@(vO8HIny_%4J7?QF z-Y{*be?Kb*(e*Y^0ift91dF3SjpSs~Yb@Nga^8%7iqZ2NEp@-gMBsRZ1G081M?H>bUh;-vczO&RR6nAf36)($0o6 z-Qyy27!iN*=}E1ndz#SY@CjzSBPMS+JH+`?rkcp1*sgy`YHNMp@XXwCINVldu4Iws z{x&X4wJfc^!g^YpZ$#&NZAaKV1HT;FU{ad;i&y*F`KFNiOjg6JkB@!10&D|Q#k%|K z`Q|!E+w?)TIjnm06|RMMp@^7$cH&5=;@nLT*5U?ZYYMU;{!Z*9n%dSMjy1tfx zm`xY-Kv{vB6!K2@Gp4MCxV+bP*wS#gXLn;A8$7p~KPCo|rK^kufQjnfT%LO^0p~Y( zcsumdS?bruFKv7c^12k@0%$$Y*X@xTsyQVsNVGV%*jiq}z~LZnw6ZE%xFY!skB&PL zh%;gMI&ktqd^5DP|2vPptjiL|wT^+G+r{p-V5sGt-kn~?(|z;eNpu#*<0lRH&oG)- zjg^FRnfum)A8=czjh=#P%)*8fvM(HFTQuJjkvSJzkGjp!lqh>$H8rxKMG@M4ERG@~nIxY??kzk^SA7?!;~CF%0it_HZWF@_YH3=l=dyV>lN`0uG^4d<^}IPu z{iHeenF|U!yw0cF+K!WZD)XGJ`!4bo_SGW6$*VX(SOXVW?%Fm-Yb2W4 zD;taOy0VtrIZUQRz`Z3W!kG}NF>t>Uy{3X}j4@b_L?$0(z+QWmF`WAzZk*ajX2}U% zGB>WYYCA6_h}oU*&dfu)+KDu?#_~s5ie-{jS09x`(6d2_TYg}QqPqhVA^Y`QLI~Lp z{Lh)2hRL#*_aqzW(yBt!@kTO)hPKB=XrOj zWDtp$h0COQ;e7D2_@{=fo@Ie4@?j$9%@V~7hrJ0_Fm96*LSsgaUF$E0)_%?*@$sOC z0+S}R?Dz;<+i2Wdq1i7Z$YX=>Sd)x zGdS8BgnTS1yK4w#ddcmR(e~T;ProLWSq(<-Azf76X!NRUALp#2SzLCr9)(!aVTC?g z6hJht=zg%CDWuIaE^pF~TUy{59)z^nf=Jvo7W~I*-^e8gSB~y?B<+_r^YU-gY^D@8 zU7@K@rd|FFeG3PhyLWMQ*#mJVpFTm2J$EKP;Cis8NhIfgJ#a!$+-cv3&_0<(Q+Cr? z8fA8z<6Hww#A_xCwpy3U4zEr{j}e*%JIJb?(SgsLDqsGw+{s&S)l+%8udZfW$SErW zZMRgwAw@pxPiJ4T!!_;|*y^RaHXZRBeSi*2V7Fa)b;iO-utCl3KvTRm5y^mD^ zJ-(TJolXG1$Vpjm|NfFxWY(iMr;jg(PxDLY$e>094DKLmm;L^lAZ&F4e-sZ9OPGQf zu@a00=At+w!xm0=K=^%ivT@ov&YOKS^+hRpH9gb2M9q;mC=}kpwJ677aZDz`S3$zz z=wA}s96gb5DjXXtm2cK=ulCm?G;h}QLp0l!Z?*Z_gpk#`ZVCA*yx|ZuC?d~vA~kHD zyM&-ntRPDE^Wle_+b1+=CA6@BTKe;z^mWfWcayPTXCIgQwZ0FP-74sm`*w)%7!#q zd8K!sJFr5Y)bevpN-$$<3nU;8^0NsJUVZD=EHwf!88`%#58B=$*VvD6HrM}rr-*cg zM<^dmt`Y}2f&&@^)&mW?gy2X7|FkgF^@d|S+d9Ao{`va~DrR9gf)h-*fC!+w-+g{3 zq<|Y};&K1*yE!m`Ky)l`vAZX2tJJ@52rS_i5=tAJ^$@Vu|GI)=4VdqLhw$H30Ho#r zO6ySSe4_*mij?w)4=)Ywy7=C#~9YK9SB?#K7TFhJMFU!_E+*z z5+>XrP-^%Kau2_}(~BNI*NBa4IUVl%)xAKyCYW^bQNL)i*|TGF@XtnpN0ej`hTF9*Do<|eK=)%|T4-{u!XOu10Kpd&QTpL%aVPe&|Gl9+k>jURukE>X&R=9kctn z^3S60SQ6#2atSJC2+DN$oSufbe*8z(z$3OK2xmVjFSJVcv`~PHFFu%i&>2ywFw?D6 z(eVGHo>1@@umF>>-r{>&h9q_8!h+El!NO@iRZT0Cbj?5==f9SY8^MmzmG>|G`1?-* z%7A7w5~q2lwCMqj7;OH_^Jd~KlG!x-nPIYxOz^Xlbp zUYZpU-@4qTiw)L4T4(?>&hSB-*7x(pr2WoKU!tRa|1&io97L*dqymb)c4YGN#o(CN za?hX8E*kID98J%ak|L!R-c&0*nDwf2Bk4+xBo*(_f2xV!{qFmB`Cs7%ejwb)SID}f zxTP3Yvq`3G-yw?-Id+^uN_nKd9^*wT^o751OUXwRNz(lJ+vfgbHQ0Q9Kz%({e2^`G zW6v^t6eSTCze$Q>FX%yhrHVD7!DOp$C%9@L&zk1beg?2pB%$E zFPu5BAzpaXk$$tPESY~^a^wZ^Y%on0TCaiBobA3&O@slZ?()JpC)z>5l{@BGV5~2u zIv5>lF9qBj)M*6g!S&vM1w61xID1Tfr?5-J@99lUDTyAw&JoKZx}x8{C^_IqGZrF&X;y!uK z-GTU5jjbTs3BrwQOqB%szAES&YV>7sRO)#xKY9I@#sQ;|G{#c2PuEYi)^NY#*&h+e zWWWl7lg?A~+nyv+)yB$U7N^k+!))=5@NXpN>@nZ$k83Zc8YU_yx5)a5p!;uSWs4An z+UC2i>YUYx>)4%T=T|_ipcCAUq$|?AqTx8XnQwx>=p?cDec6P#z1HQA;`I4~_JJ8L zWXp6b|Bp1MGopT=$2QmS-ERK70UZFhEz|vo$L^14&By_M8w@pdk?PM5{r}{GN_sdg zh*e68>t&hc*aobF{jzR*8|GTI&5u2l{4lKnUK%s9_CH&Dy|j3p3feBnOA7&QfRN{} zfkRAjndKa}Mu^4d9<`VFCif;p|M<8hSU(HliXRj%4)3po%C|u-tl6OJ)8+f7n=`_% zXS&+Qm1)!IBKJ1BcU?z1kUL%=#M{ksS|$YZfPh-eueebY@_6kB;v)_hotI^5crX6g zYzkyVdc$#60FiMg?M{RH%3-0$h3du40kyd(ak9@Te9o0mg@oo5gB#f@}D49P5ASy`R5cPlOzZ3l)BOQr0>|uTqG|xc2goMBAxT6lu0O zkj>SaZp!rnR1%i!Jy(Y@a;JwAO7l0aMQZn*Q>8lFdGj^q<{FZzSw;h>zG}Yq0mg7yWU* z<#vyub+O1z$HV~o0$K-~S(noo9w@D>TXduMYV!PnL4M+O)a+?iq*_udcqGu}?6}u_ z(ct7QaMCqC)ogC!%fiz8h-QFlN?(ZyjFu<*dp8MQ;6jR)N)K<-J|XDbV-%HWTsdH*WF@>`to2rVouJ>EfRo! z%ui#IS-r4p7Pwo%BeuD(0Z&EeSl=F&YBW#zKRYrp=nbtzCQr2BLwA}ho{g9V&Ni@| zqh|M%&%c+sAMkXV`Rr(M8VmE2nM(k9T8dh|IPz^#;W`Q*oyz`{W%CmEkKv4jA!rbK zPZlW6JJSG>HJs_m>qbtCnKoy-TFddVhn8zjtxCi1n<{-(1`(!u`%@)XCdav}UgcX% zbF(+CN4ucbnz}e?7R`F^Bkw2A%lqTJ41t4Vt4e@yPa}=rSpCTfxKhL~4fZ=oYy!A$mWW@yRHyctt}4sxPGpI6VSYNjxzUOo<<9Yt389o40xUR`I6m&lbd+CNerp^ z+1%rY(Q0Z_&*(%||5kC>(QLZ14;NZ(tsNW;|HQf)iG`_hskyAYRA=Z|g*Lpk)7pF{ zP-sTSS*{W|HgtBy=U$(C+pi+3GvGG90;t=YskMBhulzyyR}dixo0s*`kbtYjD8Tns z2TpIDLAzMQsj_ZeGyr*2j29~3lDzgH&MekKuwt zphLm(&hh?;|HrZkQ;-5d5Qp>pkiSlAHia-;JOYu*zsKQ#h|)GTn#KIrzDN23VG^`2 o$|CV!Z literal 0 HcmV?d00001 diff --git a/docs/reference/transform/images/transform-check-config.png b/docs/reference/transform/images/transform-check-config.png new file mode 100644 index 0000000000000000000000000000000000000000..82cd205e37bf5b49bffc88aba3c9673656cbc126 GIT binary patch literal 62813 zcmeGEWmFtd*ENb_K@vO!3*NZXxI^%e;OWVsP)6$O=%7o`QugWU>geY z6;=?xq55$G1(>n5A%1g7h_CI6o98tXwQaALtl*#)tzho0udjY+YtQnDnhZimJxtb? zQH@DRmCaazN6c1uHQHpri~kA)4HANdmH8p0;MD?&EGf!_{7r@USGZCtBI2id`0{TM zuzvW20$L&g`Fo6vCwRs>9H{CMDlza*5bNx5Yb^R8_#`)OXz2Z_=VyL@X2vozFylk> z)ARH3;q&veW=~t2`L3&X83cWpuCWT1n?=ZZ)<31Y4^p-{vj@>4ybC{ zL_x(~~pULwaWm>pvzCJkDIeR|`XXT_R@-b4xoeXI_%OXK(@E{~Tr@ zA^LlYy%{fw%4ZoOAuC%$A~t$PdPWky*F;1_Jhlc#Tynyq|IC5^cuBt4+go!nFgQ6m z(K|8ITiF^jFmZBnGBAP}z+gJy3_3d(OM6{sI!imyOC|rQN7&F#-`2$1-o(n1=uf@6 zdR7khyd)%lF7!WtFZXHaZ1TTXvb6j6Sil1^{3&5zqGx3IpSl54o zECBZa*Wlw|V&(aJ{{KhG|6cLGELHy3l7*G+zb*f(D%P*%GE&2nYcP31LA6XUKyTICqS0tX{8g zq^Pd(TIfOcsKUF=zT?3dyW-K*8DAAl#sx3JN%SCvWV5cdvaY3ec+-WT5LTbg$q#It z>c5d{^nHIIPa8ZM8EJAkPf79Mw%WQ{JDhczgMmdSf_!<=K$Vz8LDk!CRs?N8B1Ay^ zd38BJ(FeYz2-`uQL6+3MG_%`5E{>_rVSGh3HT~7vo>yukHb} z|JWU%uFUWp{BM~xO#i? zR4yd5tDh6$v_z}fbl?Zm`uvE`CFp-V;3t^OV^b7{wN80|d%iu@ds?DVuQw1w6|G24 z@ZymO0SzJ@Y>E8BY?~PU29@tn(Esjp7Io#C$l~is#9tQ>S)wwEhJ$Tm!Vi;4kqj2< zkX0mKyzvGqu19tYZ&TllbXTt$qDS-ZVedLYoiTn%p8O8BB@zEhKMn7r2mWUv@)Z_rS%Y%_DAPNP&ipSyKV^p zEt5gJZ!ze+HKYo|;}O(FKyY$)=00E0d-vyw1d7O4Ou-3wTHf2EY5HA#V=5Qd%O~fT z%!AkB8{RD*u9;@>BU^Rs)ppw>_~vs>B3Q~<;=0aTeWy7=$d$>{X*Iry(0;k#u=yHu zL}q;H7cVurK#i^GJ=(SjJREy57l&jj(6#YHfW*Q+jB0r-JAal==J%1RUdlPQXN9z+mBvzR)o_q1@bl$OIpA8dbiAR3uWl$+Y&6Q3YyPql5 z?p@97wZ53O@o+y~BMX3hgN!`gd&WRS1TkNG{4IQx(=NF=#cZZT_dKpxrgYSIvu}2E z6oqeFYpdCjE^FxLPh%xLgP3~5eYS;$O|y4a#{vtP8P~UOu7P9 z*)4xm^10uL_ewlG!l4YE>K+PLjp%L~^Zaf3HZ$}(>s6l$vamOod+cDtz8{KSBdM3= z=sfo`oLhFCV(x{bm-l*KIV~r5Y_=Z#Q3w+Wc$~kOPB+DJN^NWnEB95ocYma*Z+(2q z-R+DrEFM=ZQkb$|>yk*ZT+5O~9U|-Ma+3q94wG=^Yh(ny=z&398ucPq7;BooH zp#3h^EO1>Bn;Ne3H6^u~9tX8+5G*+x9PL_Dz&Y+Ze0zI*(y zGFka#P7k%*SlQBVcBWNot%CY}c`Qw3+M&2kM-L25q-cEC3Usr9;wd272n310BR%6& zTe{Uar_ElBDjGxSuV9^p1r6CcYvRZLIJ%2LgdhyMAg|}g_xIPwJx9E53Aoz&KOas(=vH_-Qd;)g#U9 zHMzUF9RJwb*3$e;EOd8qV|axZFc!OV$cyEVa?}|`_PnF7s#9ft`>~mDsWs-@+B zw2>5U6xACLF)(?$HX4r-G+QhcA(&1Tcw4B~u5YVWUh-^4kr9_7M8SA^)<%Nd98;#3 zT6x{B6EfpzRdYht!RO@%2aAn_DO@$RL6tlaV>LJ_1A==dJzTXcgHk#oyt>5|S4 zVKFk~4hkpBlTGtPc9}j-MXyO}na5(yk9I2wvfCgBo}p_Odwh%j^2^(jBFmt((<)RF8rS zry0ZIPGx_Ge@Tg^kS2I{IwbTm6Cpq$vqtFM1YyyXgsdnXQZLk4zyXt}p_1{yq*zshU!;Rs4dZkjW%*?HkNBrNFhLt?U*U@B>ey4BAP1Y&>Tuy$L%GP|s zp;dx)@CgbRr&K8WnaUpfus>b$f#=c~2c6WqmdAawWiuGHtJ&-uNGu$;QP&crw$1qJ z1m^Gf{Mrf6VILXxWva>LZKdt!M7G`?re(q6Ifcw7KBIL?gv5N8#*+`Hdc-A45|um0 z-KH^d*i`a4GRx@)nOIX7M-$Rs&1)yCoob&VJHC%?O-x6Ku)V>0!v9!RxIbv@4Go99 zSL!34q1U}MVPZH*qs`DCLEQYL7D&5bGJf&)um*{YHW?lV=e_QI&0$1obD#U}F~ioU zP`j%dwEW6u_mG#x$C}4GUa3>CV&CHd&3$Suj#$XgBruLfK9q!9>H%4`(ufK9&~h-2 z&UbIBa94IC<9jd>;oz@4S?IdDIwI{ScaD-4Au1Y);CIicXU!koh?VIX?5gU_H|?&5 z5LjDh1xL9DoG3($g{&lKGY6FD)PJ0d7>L;yC>D|{6~U`6Fza>IawTn2&y{TmXN|;x zCd)P$Q~xeIE0+iy?l4r;4hO%G<;kTdX(YS*#3PE`FZGYoT2;dd=y($KG(w1Iw2Ysu zVAZIh$QkOo(Wy-fsI7XU1uB)|n_ClSTsA(6tyVc5v@kmP9m>Y=*F-1dr6Kc$o2$YK~AN>~_MSQhGb>5w@NA}2j^$!DZyn@6P&;0^R{Q`|v%mFBq zQY?~(^3oIKQGa^d2O0fDf4T1w(XX)Mztz6|U56nM{?8g)GbMbIN{5gA56UtoX+z6m zu7-6W{ySAz<3h1SNKIfUeEZw#Z3*zd1i0kQWUyX9OD?eh^e)S1L6H}DmmCOz^ncE{ zE(m-duI)&klK1AHU%NOUEr^x}s7rT+t+q${6bcJv%_rhn4EcvDIU@TN(kPteP3 z%<&dz3S(2Gy$^p4R#^TtMGjRS{7X|XqXA9v|1;yZbXeQ#R96FD%EUOOFmclT%87Bk&j#7-(a1bjDb>e zpX0Sxy_mhi6g=GmflisTzq`L5%tbiWTWvOTNT!d6Ap8cH()-T08CG)BjC9XpOw@k6 zT_5Q!@mTS=T@4jI02A@hy(paf740mZal&)}3u1}Q5FJ97A{4?~ash9sS0^Lf$2%>t zbY@B(2YY)tkt$aVzOp(xKbJh79_rDu?+h4ye6_E**S}@quo}@)D;ER+$bR>W1W;MU zGA@{`M0Y)Bw#?IaWTHXw&19bJFshm77d8^D0cRI0#t~kRyGirp7MZ>!<&Deiso1qkGHN!@eOZ(Pd z`^b1W-(TUYS>_D=9^0F!X=n`&dwP0OWB)z6n(+R6Fh=KCrdY9kp;Gnht)bgR>M-Cg zQ(*8ci7E{TgCL>rGS#nBor~yQK{vN|t4V^;Haoxg4wh>P)oU$gay1q;%8jq37Fs;s z19-2;56P^|a8Lf^Ng< z{X%8VMt0Ayj~9E7G`VFIaf;i8{Pb65pd*O&T^|_raSN1Da5x7jZA!*hPtrR%Y#tc7 z91ijjzc|^sq^5F~+4W)`%vHZ%n{IYI#KoN~g-ffXh>aYAJidK1Y+~3uF(^-Xe|M|e zef||DBlv44QWoW0^`NnM3VG;5IK7ayI-J09lXvea&Sbln%_Baz$H zL7rA|kkrB2noqgDXue5Aex7P!SnR$6I#1m*szem&v`O}HwnVgAqjfL_RmS>gDsSOv zEWPII1ZHD7+d}Gfr;Y>kDGIu$6ds3KX+9yA$}dmgTC7dcTK1wYL^C+5h_rHEv`Is^MlVJ$~KT- zJZLa_V@ryiMLsqesJO>7AKch8Db&>M0T~Cf9HR-syeVrpbWMh;tH`KV3KaWbuzT zH?ubb3KcMiinJ<~u4NNSFHTO{@GptXIkgkScFW9W=y?=SYUgVYe~Gdw7R02}{M73r zOX8F?I+&}+7v+pY@OX5;Ob@Zd5nuU?`l}TV2me*S{C-_|CUN2Ktn(`KF{n(j@b;ku z{@q+Ts)=s0)cP+>1vTmQiP~t&=BZ9^c6c(yyv&lm^#T)f(AVat%fLN;{}{JQyZ91H z&4QS%7)IR>eGktRbZREPGv)Gb7PE)}dKhGVoffBS-M?zBtP~0~G<*9eB}S5oVZq*N zvlWf#5Pmx`=?0k!l6)qmD|?=&W?9iyTx~4RQ{(ye|1$R8gTbdRlk6%)rg8uAI0{K zof5c0{5Zp$l6M= zO!$ze<-uCu2DdDoRuG!WSivd~x8Qoc7kD^dYX(j2H^LYqnmD8iCbpQXN?+S-;(?fd zgLc?iV~A5>0I6+U-M5_?zK1Kj5G7Fc);SZ@_oWo+&417U99lq}2p95rsNTy0FHY10 z0DvBBSIkc@%jXbG#;^cxX_W2OfIK^T06moLV{0Ja3Hd+(y=aUiRH@L)XN`Mg?X0&K z2b=`F$ihF>$gX)fY#F#c@l}Q-p+2fdSOrHThCrAD3<_o;! zAp3(Q%`vG(UV^GW#+@eKz2OAJZO;-MRL(&!_}qeQg$4HPBA@vOqi)a^kLLqMGVi*6 z{B7k=qGT?Yxg$<7(Wi&=(mbt70;9*XLQuD;TAakAjCpU^B1y_9n{VdE?7-$s|Pa(5fK6muXNUl_hl9hPY(sNg-)4m+JMxB{I?^!F`>dCxNZwKcKi{u-^u|H|@ zRbMQ;bNhhP{p$C2o%|FLgTsC((mp#5FpB=h0JEsh>#%Z`d%fXlZ6U`Lx@TGC z*xZgJ4}|Ofnq1z*(`zebHXolJHP)BgPT?x#sSrFr zt%oAwfY-wLpT|2$7yI8*oIYMi^hHy!d#0TGhoy0tB!Y9^FfHuSF^(%2tKqZ`-y(Q>d;d7?9OZhfJ0@Q}T^CD~_+63B z}G{Qqogp^=);-H{nE*&VeszE2&OX*2@Qwi-g(?#buD?oS)Z;MrtI8Z zCON)6mN)78g$?-8CZN=lPu! zL^Gw&Xiv%ep>ME0h(^Xz$BNC_o5+^C;}oga5{Lw2PT$ItO6P<+ZGB3x-agVCN`2%W zh@lT%YHrv+*Y@It+1Bm@qEZagsiG23@&l$h_c?U>J!Qfcd`^Yjw?dTZ7D;j9F_dVg z(|KXpgGxU&>c`cNG&gOvYAr!gq!JlFj%G~QEtZ1PV%=1JRDBs!@IvHVY`B(1L3fEE zwkn=DBYc@3JfN%=1cFX+Po~(vOy&`s6`-Ysz;?dAJ=^O3cB~cVIi4l;s&(G!1DTWb zie=dTTyeasZUfvv9M$&^-(T;HW!r%B!6fLwyb2PhyNdi(D~$pm7w9B5tFfLNf1GI9 zG95?{si#2Q$T8Iqh6150tE=f+eE1a&Q^Twq@sb<(38%4w)ku2QSaiw3*^tM|!cZI5r331ZU_|BKWHCs716t zifj^Z6|Im3>_e-Th5GbFVIXx{XFHL~?gV{|T4__Fgz!X zwj#LgWLg2u$j9+029xJc_uVordPuYg6Yzqm_bD zB#opDf6O&m*XBs1;6C18PVZ`JOn#9GeNBdl%L38tdfj{M^$okoMqjLBco9j7Ukg1- zA-DE{!q0v@YqwzJO*P~}rf5+{u7$OOU8mD}OZP9`%!?hiSa6~|g_m*CkUQ-zg*!Vg zG#tv5P2eP@{m{;;>+-MbW3RZK^~lcFG4*wAlxncDMsakmd+Fk$C{OLnFlIpLIzK&S za&dKS32_N+-mfJf`D}V$!Yf%09&dCzCXgeQM$3^L12;E&sOBfg)RP{*y0vZX#|RM~ z5Emuw`zVhSOa3{IWnrVDfaUZJyG0$sVRB4tCc#JT!FqY_e*4KzI27&tU_-6Q6jGCb z`&l+Vn>AraqzXf>BQbu+*7@*AV$GWwW#Q_8FZ{uIJUJlmTJNu*`ycJ=q2WZ?Iyi#; zuP0{^baBKYsY-tL!Kh-KQ?FB=WtifTmGVN9pI&_swl5#TiaRJdH-tR zyWhorVS9kIRuBY|L9(f(QrzFJN|XUCz@U#oyDtc74FeLlk7H_~i1zPb6%am#k}t(@xt*~;0PnM+uaHvk2K@8o{&*7rv?$YLTivBKa@vCob!B})3d zvtjh!DdPjM$5{a@3X0R^AQo|{wVm}MRTzvO9pvuYadtek*-<>fNbnLH)Oas?9ru%Z zFmO5)k1Dzo4}!ZW=(a}FqewaiLA*DXkJzJA*86ctmXvDSf{4gt=-C7{imNOfM+48) zcD;~cA@|c!x@Rm2s?*VJVcNH#Fu~Gvu3FNSCYTHN0M`e5~Iim8wLRw|W77BPhkx5_0N?=~OCVoztw^>1#swJ*f3 zaKwok5D?$qhE6%!>kC()jW+;jnsD*Jz~?vD=k-!^E`NFKqH?g!vka-tu({R6M*8AX%qw z1F$^y$)xbFUxRa_AN<4drg}-F`D)t1%@(+WV2eR!gI6#xU+R0x`)Y@bRhN9>P<~Z9 zX*-W<2Mi@J6MH>1xoWR%;6Wn@V|j}NKZ*8Ar6q)>9=-Pu{}CL`M@|U(^n(NEE&1oM z8OH>0_ODDgEDzI`2FFU{!LV|DF;&g&8js$HPO~MVc8g@Z|&86 zPGZ|b!{l&RR7kHr$YTH-QR_!5_~=7$@)azJ0vn?GO`}U zHRg*wSp+Ng%h$(1Xd#uPs@?v-5J)ze_NPbhND-<4N!6}k5_z0Uz7jJj8t$g8V(Sy4FjQ*? z1K#e4WEo2Z8;6Ga`qkf+#g~3$v4Wy)>fvEqdXatAHT}asREN9o|`fe;V zoZ-CZAj1+0$dQ+5^D?1c=qSukFnHx zhjW)IHSVu~u-dq`X)vB)m&d_$=EEF|$wkYCdaEZ$sYoNx(PD0gW6+D+@xgyQn{QI~ za}vum{Z!2%cRqM-uTGAP|65jn8h@)H+fg)-Im(iZ#{?)4q|$g)G;b)JzrdHvVP6O_w~zAl>0as9d02gQMG%h|=pF_VhS;Pbc&xZ! zD0zBWmM_0xPBlIR1!9dha4;}Pr##JQ8|jWgS+Q76BYuDV&d2_MwQ#0mW)vl@>Psky zVT)kXq*iKi?xx6$z3{f5r`~oqscT?UlF4Na#{LMS0zO@~6V{aP0?VSRdu5J>!ETFI z4Q|j2X>X>Jq0)H0Z#8pHMm@E%_V}-~047u{wbCR=XkAdg#EQRl zeqh~J?i$DC*Tvb{I7*?@@sc7+5yLi_#XD-XD#{9gxg-|y-yJh}xH+|mR>40{tnFy` zt&RCw-R(O3(P%j8)%n&_$wHp`+ zq)9ig4{{}q<8c8G-FPOlnFGwX5P*0hD5Nb@v^5gfdqU(&CiZVEAA~ELwgBKS7KYb% zZV6dswv5&vgNUG5pfJrIlE`XCBoc&i*FRUo!_-rgZdy$}$E)7x_?c8Xb>WKTWB%B> zBkKp2521-uvJ)K~L4~U0j1dC%Z*Po#30TZ#;q6KTfrn`Jz?5vWs0AYSFG8?`j54o+ zB(Q_X5qq@%^waI{Xpoo+5&qb&qTe<=CqFrfY=#WOM6G3E2Nk8QB`RCBl1&s4Bx5ryqL4X0OHMnGxUo_3e zCk^`#4YYDdv=YT{+~+Zj>i=*K;RNHWxJgvYRuk( zL%1mT?kK5B2FgkKQd1G2fl!`Zc2!U8c-%1pa=k~F`i7T@V?&6EJ1}48HWt!EkvjS( zncbL!3d!$P4FZ`S=S7Jsu1oVKm(yXvDvJWgODF;#96CS8lE^At=%!*5p{@|Zv^GA8 zM}uX5{1E|VNyM}v<;#~_faX4RDBTI~VGsm72f;-I3>feS{~_Mqz>wHJ2T{ZM^G)-~ zWWHevBM4l`C_p*yhJZ9-U~&g@A=315N_5sB1xGwOuaf=YiT;;WA|e6qWqLvvR_>u4 z64JZLTeO-?k0VXPV2uk2FvIOF+xbSwu#jcNK~k2+=|f`JWC5e)@Em07fp0{#sTp=k zyHty-`27dN7W_B%UHql`9}^r`F$Z}q?Vgx!bIFMIONXn$bP6dS460}`E-Q^8>$^#uA?*`(K!cI)Ras?|dDoXhp zC%7bf)W>IK-HyOzX&B!UZO^~|bY~T0Fpx~OU@yx{h4)iwYo=J8rhw$fF&)uKk5~l2 z?u*@rEn4sAFqCLCn~K&s%saAJEx|nAUr(oHh`dP}wb?!-J_$6{zZE7My4z$oUu>YG zR$bRfmBeCLtt{bh> z)J~u;K={@POaqyTDYr}LP*(0R38WHw54ZQUv=8^%Ft1u3&Z;y*M1nDV8XMoEQ%Ib} zt%RyiVY7U}9?zEaci3mkdvAxyVm61(Ka%{)#aJ(GiC0FY`q;>DWv$mvaH+}VWLv}P z@@VM~Q3qRXI@4vGGT(mjz=_N90Q3BC9`9GH`$(S5Wrw*NyTEETqd&1#TxWa8)!;r2 zsa|8*o2>oZHk`zMdfMwSR<5s}V!T;UeRDapeCb(99y+8I)K}x@%mpMc{IdF^eh=TB zv_mhnK0_o_8q~P)k%PSMJqQxn%|eul6U|u9u=@OapQKM3g9tgw__K<^218$g2L}n= zIsE~Cg=3pu&xbwetUphze(}8z5-Coc8Y|H>Tl5>|Gx4?E z9MGvY4c6-pD!4i(2+C}B+{+_KwYpyveY_iHG@C|TXtqOH4owT0*u!;J4)yd$c^|?( z5C9Neue|r3R&&Rt(%9OMSV1!ZAsJ-P!%4MOe75)vvrT8CdA_BkgnV~-Y;%QN;&s-i zBy+XLP|sf>9%YO}$c;xHUJb?-PnvwQTJJ$x;q^k>aOHHps2it&x0tUH2527p#HqrW z)!OB)4gg>)7ASR0P)LvEN~7=~IA_==`Dive65DMJ?L3PxIJ>&+@z`vpRbH2~^ZCTQ z*9W9%MRVEQ&vA+qeV1&TEK zS8seBu8%wxnw?OjQ~A0RS@&g+GaG(zIq+-&82k+u{hoXLRA>)83IX3F`;hD9-p`Ml zA8(q(up@*ubPbow8fi-!AA-x- zMo+2TQ`txLIvL_e2$G(U9Z_EKyKpLl!r+hiTo>w#m;xaIo_T6QvpdlR!sUE=zO{CjsZn8nRGpuhx>4Lut8q{|I>ry`!j$s z%lvR#Q4rcXVSA{_Y^%4HWdhK=BwNENq1$__`$gg5u>`jG68K%e9vSt)O2t}*B?--3 z!%NL@CsSWNcXD%}H`Fk%ODAvZY*j~ZJkiOeaf8eCDfZlAHD=^`+kIPvw@2snCwETw zdT~?DkfW~mOYd|y0<12eebds?;`ommB~DJn^MG&((4<_SPPL^gHFST6Ha^w|sI@t> z3(~;1`Xvot;~6vqhTkg_14@w_kx)czJwiwqsQCBu{)C=ifuX#|nL)h=>#(-5D-+uv z%T4hyo+|L*cV)W9Z!m}RiFF=}=(nNZ`aE{l?)YL{NT38IUp}|T`_cboxrA3d^XmGT zAD(^F`($7@P}}I)Pk+zEvyUBmislR*SC6E+SgjZgAR3GTaonDA)d|rEmJw{I2k498 z8M)eT2yfR;GviTGLz7s#xR0}hd|?Uo)AWpSzNv10d{<@!45_aqe$^koSHww_86SHp z6w67t!Ga6MzRXLj>-B~`51H^;JO;*TXNoG~aai}^F>vcv%e&8@=EjvDF68r87z_k> zVKOM9h{Ri8&au)_v`D&No;h8*L@s@->lPeI)>0|gdpBL+T4gr>y53HGw0*!qVeL_` zz;g4Vy1}|VZEub)oorIUb$e(tTdXZ12H7}fY_vdQ8tm2Lv2&f%BFtE2eM{op(rxRpjeujy@o!aZh-sQR7ge`S?W#h z5EzKgF%CNb=&K1V_u<4T>${5t4!g*v&+i=MEhq(D6diJB?sc1d7){3GOYE;%62>w9BtLI9+`bO=wXqKL*5Cj>3poxhjwVDMnjCY+-d| zk!ofl*z`zA0xD*vcael%&RTs`wsp~Z-I-%F12rYn!Kq5GhCCW!~HjSl~*296P&AAJw z=s_4%0f5@|r|ITv(~{!I#2Hz3Ged*pg?it9`J7D8=7t|Ex*>`Du0E2=S`FrzA0{iH zgVhy9!$!>Uvcte~31A050+GRCl`WK9se8fEa*-IpQ@!I=Kilr7+g^>y>dFGeX+-md zI*G=g-6?g>{c;#|YNQ|5I!!6qSxMZBa+H0hj{Ad_z-JG8gDtM9$4kxeC6?^$%7+E< z9UYBE%K$eG#Ry6$S{K*&KS=+L0Zv%3TK8`d*vl`wk5ceCR0a00v)mEg)N# z>PzD{^0OP6 z>;3S6!}LJ~iAf8_=G=a77Ws4H_fKK1r5Xf>bKef$o76dYLd7v`D3zAf7M5-5jEm4s zmt)OUnS3A9@6m4p2Yi3Mshl~6syY?JU74%4>U_E907MvA#p-M`nNTja@gjnu@24i- zH2F;JR4S$Txhhp_z&-sGwn-Vn!P=bN)0P|NAK+R1+1^QfZl^l= zfkgGEUL6YE`~bLA@t#t-23s_NhCT~1&;m7HH`DL(v|LRFl&(@v^5s!aHo`(}Uf-s3 z-i!k0v&1ulb~!Aj^K%%o>8j#-PVwZ78#<`DK|0Hgq8L-L$XWJN(i14Lz|HSkyOp@e zj6BzM)^y^CIYn&Y1mK)&!N+x77l=BsjNK0ZEjX=!Qys?JMwlqrp0lC{DH--CjMmA;ZGJh}O?OSc_g z=^Kd0Pg=H@&eu48_j^kPg0~UtkFGI{FcZd958&4F!5j1;>`XDv@+esQH2PV}j_!N! z^e@hg`M#R(MX6PrZ^tS`3%kipCUOM*ku5rgNG#rAQ}X*`-g>@Q;tsrSt3&A{p^2u# z4y4sc^#ey~Yc!&Fv>2uC%bJWET$NgYO6$%+9TK876~Aaj&M-<@zEpfMzYj}cY?04hC3x%F<%QGU%ppls)Q#1X zoCzr!cDOhhl9UrkPj7X2>hcbSiH%O(=@$wJtcjNw=#Yn5<GWdAlHjz53bnkd z;y>YmFa;zIS^pdaY%gkr@|vM-2<1l?Uzj2a=OvwX+Lt6WK=LO1Q3Tc^JG{tQ1DJs5 zg2^xS)xTUeGo(LGpUx$jy5H<)0WE4vh98sjeAvmp5cdgoRnXPed{DZJty*I8{y5?; z(mC$OA;eec@P(Hf!FN6Jm-<$RdP;U;mq=HYKP<%Jj+$UP8oZjrdH@F87W(qUTDdhD z^)4l>G?VDO1qW)}5@DfJYm#<*wno}aM zNL#izS4f+c;v)>NTbNilG+N$L*C`JN7i_a^G4=Uxbkwxws)!KeZit4thlnDJJ7d$- z+to|~9z}Nd5y`pna=z(v;=R)e&1PP*7a7FG9~lHLd-xiWci&QLh7YBAnwmmZK94O( zJb~xz*dRpDX6OnQApp{FzD00l6{Fh|6B#d+1QHI-`ar+fHzou7g*QhJF!|&1MJU>T z=?p4hj}4b$r3}^Ia_=AH0?;@UbZuuZ68q#RpuObT-o%ppA>IF9V;J$a|Gzq{Buqi) z`E)Q0L+pRlA-Yh5SuHHOB)SD=c1$zx5w{plTY`MK})i%?b= z?hkA5^JBt4)*uyN4T`KjD81~tBH{wlGoo;c1Eeqg_eLF%mEQ#6Hkr zd+x{$UcF>~GJJs>`TzcrSN6oy0mWW7-LiTqMgqA5F2K*<#qKWI`%D;*==`pD#{sa@ z;4JBIU7=QQfB)VjCD72BhMqx3_m=cXt;RA3#0?`aL0T*+nfLZkbkTTBV<^$={mK z)}hg<*DzsG!9JX%KW^z8&*A`LVb430IHk?;ZaZs-&}Y%f0-5sHQfYj?O}A%yk8_F* zL(Oj2?K3l2M@L6_8ud}CC?E?!2Vd6amikXmfjSTDZGgdP}-VI7?DauVdqNYqojOg`qRXyg9sdx0*-sL1a#`|dZK5t&37Ezc3SnD z6?(T7WLwToPVC8m_K`4GG6`8CntaT1_+p?qfmIUIuHjDxtI77*P}#ECX~{*b5i>N} zkA}e{DyuJs3Uow0li4?vO2-X05Vs<&ocovxP`>E`-acDnGw0i*Hd_a(0d9&u3n%Z{ zEdw_CqtrJ&3N%7`!|;U)6!If@-5d+;PzZTDrV5oEG-`@e(J(N+b^3?@)M4lca%`{Ek*ZfiN8B zK1Hh5dUZMH>>YK|gm^<@^tbH)B~>4^UMn)gy$&YTQ)BTtv?b~rRjMJ#D) zj5ZZ6+M#9kkBA9gPn@IfQfruWcfD1%o79DMd>*ZgRGAiW7WJSaMAcxdXS1dFI@inh z2{BAy3KYrX%lB+QCi=p_8#%C{iE8~(cd9weDw1v=8STp!t_V-6`HZtHCbJSucFNF{ zOtMq3|BON+5|}U~LZb$+1C_iiU{~dmaKNcz5jb~i+iCs*!scv4;sQwTrJhHPX|#WM zbx{wb7}GucrMB#QMu3zbquUi8AoKRRS@oK2atU5aJD(@KdAcXGew;&ccHL~dCkql1 zl^l#O6|N;{MqTa}3Ad(u)fd1Xifhx~CpDlTI&@Yw4Mg;C?elKlicNSSg#1hj$!KH8 z!3?3A&4){w6fvjOK}qbR@BNVpYl14B{wTEzcK{kke{F+`YedOPUogfx&Sm;=-f71k z40SkO%OL zLS)w|Iy+wvBEa+F{0_Q*ae@srRV*I6BMUPAoIibq`>|UOh5ijd(k39cTfv2<{i8)xW-RKsnHZL?mIi0Wz4ON8V zGl{l7vjHkcye>Gx7{-jt8u?sg4$p&#k~EtPx$Gdd>#@vM){LrCHo|Y^6J@#{csylr zm0m6;-)g8bN!#U)y`fv>cCXfE$9%Woy!oFHRe9`0>px1y(}x0_M4tcGY?X3%gdC{^ z1Nt%NK1Q*o+21vWZ>be1OT#yaMQ=RDO2aL{h>D2cg+@~uLT^W&9lw9<{k!kCj4a|) zF*H>PK?M@X1Y0aH+RloE!yXw-{dzF8#&9tHJnnMOsWjbinrOP_>cUOnpTaSH5;*C{iGorPU z{#S>Lh65~gYgdQyOFn%A2Cjf=y-uWUT>Rtka+XcZncjlH!0;m2e7*+X^l5b9(9~tg zkv~`sL!XvXA_4sU(4KTl4PacIJo{O@+to#goWX;K=kkKqjD|uXbD7b5dYfh#ILVU0ch$tiDzGgl?=PUNgiNUJAQ4!ExZOzTi@4fidr-)V1n^Mx;= z9EcvY(H}iO>yTJn6v5h&A+lu3(gK>K07UseuH$Qea}0EL+&L7MIiG$2(frjJp=QF+ zE*8WcO|xe!goG2((G)0=31TLRQ_5z*Bo@?*->QA9y_Uo(G`tHqU^iPr$70Z$)c&qg z*Y+MM#_c>ZDqksL@8AjYNjJ#lxS3?jE;=^&B<12b@Ax65XRexxmZSTp5 z8<0In7uCA>il>cojLdyh=md9nBawSigk*&P$?J6hZ1eRGd+IiCSAE$rVIKQM;*-La;9F7 z0(#Q|>|`FG)R23l8)m9nf4;%|Ud)9##GRd~=)@a5UZErIgMIWdwqUiAezDq24s%W2 z`#--0u$J=)!L7R>IXqt`qYExi`&nP};n?(@)f1FR#P%YTYkOo_M7K~!gTT{+(YxT* zXX3L>27rwHVHWnrisHEOI8j=;P-~v&+AM4X`447mg7u~e#`H_HW7#6zTu6dv(j(g3 zGKU%T2u$M8P1aJRy0>M<0$mNWGl;R$pOWNM5MKv-dR%fV4#v{ZkW|~ey)G`&dvw#? zx#djR>E_3}d>3)L94azXl9r(Sb%2VA(atmFd(b=TofuJ7Tb+7BTe)YH-yX77gDi4> zFoPWUy2s0s=1RNkg^_9BzU^t|qZ>#$4r~OPw#&fLG#d)W6se&hW^=;Bm? z-rpxf_P{Cxy}P=;p0Uab97;0OQuGuM`05%x;<1TY?MX9Qc!sm>F*Pttx<|G!asg#0 zRC`jR_W)$IFmjegQ(vu*q|Cc2nmgMbqyTBC1W$Px(@Q^MH>I}xavJTN3nMZ z(n%iZFBoo{mn71A8mO&(D#H1D00Lo_OaR&h>ka4y4zFj^nC!N zuiw3EyL*YgUoIPLCwzAgx6(h6JCcrA4PYB*3#if5BrSE=S53gqMm?hAMX#^koh_Z4 zG&94joL;A3qeslA!S>-mI!Ds9reo#`K~FA8duw}VOgzLfs)kM-a@H&6IDZ+0G1u`sU2IbBIDq zzjujMyH?52U88WoOx(eJI=J@HW>*TLL2(Fnl!XAhd5xA2yBXSv0FJYz>`MfP)ivwn zv+gntnR?D(GMISFiPlH&cT_7_TLE383IA*4;OO2c@AGUs6ZNHgw9DG{!Ed`Sz?Nuy zwJj9>XK&Fp&^-CdiYF6t?aN?vvGBAH*=O0P*w_Kj!*_36AJ_;RuL%@d`+qtZV-@;A(WKvE)k@=Mq0YNTN;KQ7&@f8yPu0 zvR%IZQMcJR3J+v6f9>>z^dFCFgp)=3vc;r?K57TG9uKBDD$^!;;XC%dTLR&1n}tmS zG9@By0(=ik4?(OCzK$I2eNitsG;d^?DDNXcP_XcE4GRwUS>vhjA_B85CsJU$Cb0HU!isk!F zY19f&_{CG!Q|)c52^1-dmgJ&vu3k&F!4}|9ohjdDwCxszv-WqU%@EE{4D)grVgAGU zN5A(KeD9%o=oYwgLFoyOpT^qrS5`K^IW(%SY{P=STuz9dgWNFrVZp_x&F0ZOqFw@C zx33R;1j9!kd0rg}PAgN&I|Q#3vf1ONr>qvP8S^-wVT8V34piKz`ZOs=a$j@7)>|$V zlqo+->U|22m%ZvS#2+Z{n(@=ruSTc%`(0UfPl-RI;riE+GAaF*g1>YT<7heeN*&*$ z)8*$99tV`8Eg3&{Zj$UZTj}4$;Ws7L;PGa;H`mufQrRSEKS#e|X*C=nLW=li^7abO z3k9uNgqUOBn8!90JFyJ5cyT|2o#yteiQJjwsqa{K)u7^5Y&Njer8Z_O_K1I0cV!J< z@+@E5?8>Lj;IFmDA(oE)+9e&0%VHoY@(W9?Pz!MYHvDirj+LpFTo^73XTs4Nj`y__ z@-;kzPc^^s>9?PpFQ#B~op?kM_OW(QqRje=Ux&ek8uucch67ukQn4*PCLN;FRh$3q zW}N|k?gxB*0_Y#zmG$2~$gf{@=UMaDhF3tYn!TkL!&z3}si)(`wLj^ZtLG8ER^ICF zSG=*Ijb+GYb}w6O2>I;qK_OkoIFn@~MUqGxIN1_xH?tZGmkWt{l_N=RrO39qIXe?XqX|$}PxkMBECw z-fuwq4qoTi=C5zF_$kxyvU)EpGo`_GKZ=R@z9o3N!RCgem)%o&Tq*Q8lHyLnWpx2^m zmM^L;*qR&Zlq))WvH#3(dULtGr?6@^d?IzHl=8cnrRj5@uO}H|4_ojFj`+fDTp->| zd$Y$!{;wCinbO~CU`)&Nc)U3zr$rtSY3IU3B#AzC2X@ypvM`^Q$BXqZYF9FH=d{Wq zaE5magHSK-@?Ho{p9XYIus%3G0tXVzBoQa`x`$2o{{ZJg>wB_b*D~cTCQ> zTrz+Ara&wFD4Zj|8`<965@dOmzM8$`>0E~+Owv8#cy&COj}XHmjyaiBC%pr&`!PG; z^O1~sj>eCA;p3rB(qZ$(Z@QL*j$LgkemVDC5lfS8wp^KDj0=agI|Z=a{+u|WMj6yp zm_#LecK^qTtdCdw3Aw3FV}O|)S_}o^wl5RPE?aMzK#*8cT$XpzkWBeG=)~Q=bUN5X zNarwFpX8VNMfuVajaV-GIs#&n-L`{F5|dDW2??f;D)UyRykd}co}lR!+_(1)F3b;f z<*%#o`ly0zKd+dP3G>;qpskTh|5`zGSldja)qT%mOnlnfc@v+)*$q&u&c|b{58}_AEz0N`kZbiV1KVgYmyuId|iunJi5o0@@$iy}zin z*AdqeR7H4@2sr6B>-3Ons!Me)E-Ji39o6}Z>U7s5s>QIc)6mDp{+!$73 z!9j5ms~ojZG6=r;Se4XOyH|gXtZh@k?{c6{L4!spXfKyx3oChkS)_c>*)up^s%q&- zY+lUAS-kC#!c`LHFCAH!;xpqwnN7tmK9>Fv6wRezVWo+vAT^eChM$3QTVod&M2WAA zqcS}mqH1O*A^2fKIlCFN2W4-(N}wiqT&U=Ee0W7vhCngNvw(Tli{GE{BMJGxUxi^q zv&GGu5lLX(Z7-yUWRp2cvdjGucW)cB8wM`$(|r;TK2~*m7HE~dH7*h*)}m~OH`l~< zW_ovE`Sy}t&#L^LrgNHiS@=Th9a^ou=Pf0An-5zkvT#F@ORS~16wGWy|05c}1+Qu9 zVI`_`Sxi?LgEqZkK5}T90vg$M{@?^rU(E1~1PsO$25f51;V?lkalyDzGy&^k?{7X{ z<@#g(xr%)vEuF=8onT!yX$KBZVG0j5NEueBy_EqU3TE;6?sJm@4Z;h_(|{9uS^U{n z+#`xoHm~BS)>H;!ZI&p4jl3SSjq1;9h4V78zp%AcJV-Mk8Nx;?OpdoSH%`ftcP8gJ z!DnrcE))34Wjr2OjT6*j?H0U~{j3oLqGo-|NH%!+pFw#y5_tTEgeEnDZR5={G5x5e z!b5~oa#GTPe z4rFz5W{(YQ9?syd_c>k4lZraRW(qJo!VYNgW2Og}EL=zYj(MNClr0Th@yZ=~?Dc3Z7rh=O7x#kysQ9b-KT12}?|HI|DK5vLYwlYpm^{ZoJg zLPqsa)ujN+vh?-*)@fBDB;43ebK_OL>gU@{-1TpbuQrl{C6KUac3sM7gUkW~_FAO=;wsvWDa#;dvJ zSWv_7siKAJg;5q##>QUK18&pA|j^dl?T;2}4We&5r-lqsTqVZ8wkNOtB~4zS(|)Wm4crjHpdRVi~bx zi$`eU_&7c1v_{DnA5I;nVAx(ADOl6R8;ct{YeNBQv-V*XSv|#a&9#nBsbh@YhPEMC z(BoF(WojZM1r2B7IUg-Zjebt&@t&d&+fLDI+%lG+@7TIW5Y#~j>#23>aQ5AaM7)`= zu?j#Wnf~>hGr9h?c6ES&JEXtPB?97M%!sJeDJ-wC7o+ptf$F5%;WI&pFzGYt$pVFM z4RnrMrxI=s;a+thdox4<_iqr0ph2me`@^&N>z)^3);hc+*_-huPD~8q-&-5vP0~S| zua6j9KNX^d?ePhyADG;rQ@Ae=$67BqV#b@L>IIScc?_@CzXOh6MpxJ0af!WRQUV0ce z3|CASW_WJ9(1hSQ9iZ#VHWweHsLfuX&{$3t04w`EfK$I;i8Yn&Dn3nWVl{GeV^pSd ztYW&LD4;G?l;)sE5T?~zemQ>jmCg5u`Y=1>{`1NQSyuB!gaa3%_DuokrFMSA=G|=E z+SOCpcH`hndLg#VEQbT3Hy&lu#Sca9D_I6#T}A_Gx)x!Q_X9oAzS}GKH&qrbFyQF!!#ZSy7p4&-azB(Q6H$v%%?of(xUPk7{18w(Y@MTlI4&PS|wfII0?qZ+1~F z^bag4<&)tB+wt;RU##lH8EH$9pBgV|Z_aeaQm}QcGD`JqEl4`;@P0gF$ivYaP|$(k z)YXaV_Hh=ecYn3*{el(%Hsd;Qz&4^qGhibJW7zU-)RktwE;H%hNDzM)s&7F_O$JUj zDAlY_<_*~%SFWwp&1h|^oj&=zV>Y0NIaR3qQq}iby)jF3*WE(AVCZH<@0i8IoA-5G z-y2p(H^97nj2OZuj8_sfGlHap!QDKz&79|0n$>O;P3Hs!tK46XJkvsE9xa=wSdHn4`;7(ZBKr|;brsy}bV#?57nrORsLgBENLaw5Ah zzmw-wdnbaQ$8oLF$Y-gzSR7&9b{<03JE9-_WcZezSzr4+F7pXdAYDVD(TW`qAx$V{bf_e3h^S$k>qts0uxz4rSb zgVQGymh)B{l|F5LX?Rp6zQOhUei((jWTSB!PF-2}^WgJ=MGW>c zP~d5sCrL!Kb)jUHufV-w(UTY%$O_Am#SBUTR_v=7$SnQazgcRloUVTZY}ZKoP;h@G zqqx-e>Km-JcQK?kzw(O&Uu)*X(3H5XwOCOp{3MVa@XCib593O^GaMNT@u;;@F}b%E zmpI2l^RFos5ST$6UHFC@V_&&>6ruCNC_HlF`$|i1o#Vf6iEH zdR9pWZph4yQILa@K-I2Y;Oli_8#!)Ex~gB&y5-6*R|T=J%7$2_IQr!@DO&f#?zsF2 z^yUx;of5aYP2QouwMzW#eyDy|6{@cBLii)IAqA!C2jh-N)@6%s$9J4?810x@)WQq8 z7_GC?mx$;#nK(2QI&G3TXEs{B%9wcEAjehB{eIMK^EbhE=(^MjCq>O2!cWGpupgGA)~2pKUzZc&;6H|EuQfVBEcIRJD;lh*%3GyYFBid})< zLbVx78xbe9%16MT75GOv4bb3DxUpGkDV#urhi_p!_@|JTt(g~Q_3aN=@OjOYR_$64 z2&hn2%_jYmDkM!r2ig*FeH2J!0+kipuqB;e0@;R{AK?)YlGcD6$sqT$7P6gi0SBmq zK_t~EAm-|%BX4A()V6Lt(?G{nvP`NyT*ZjG2jp!IpTuqg3cyw49@}ZSPZEi_ZGb>m zUrblf$v+%MXji*u`uO)A0|AKa?h(BvGSFqJ2Yj7T-}#x06yUq!-oa%7MFb2f_A__Xt4V zGN9GI{;j{k`!13><>?=@W0?3S4XiLR-|Wr)LM1}8%R%qvFzCHz#9PlahIS@qD!ti5aXpo!`nwL3q(l z{Pi{d#99#k#K%?-PNEFH#j$1$%bCU3mY(iv{@8LapUWAmO5rP_2j zusnlgv#^Rmqp0A5NhK$km{l>2?Pa>YN_i|gSnLpQ1U`1~PfnlfX z+IeRD%~ck{pZFq>ix9z-!cE#{=~bfBhzNArw{VUqV&34(gSjFHZ&Zx`6kxhZ{l0KU zC(x^j0CdntKpJ_WWg`rWMk&j7L8@~EShJ2p*u__?I02h zMyD8fSWc2aayInDt%q_dOgAx1`Y-v=OS8e2jU8O)p_G7@r$GhQ2#f z*&14`Qj0j8d`5%4X^Bkw3=a70DE-QVGxzY^7)(&b$$70llFkn9jl823#jG59+#u7y zzdYwZ$S+Hv*N(kBoRtTc>t;rza1}RrF*;#NwLJ-0&!3{TzW;&_0@tdiUiK|6rX3;) z{+yY)b{A&yIa$pWNZl2`yWG!$T0QLe`};qJZ?ArrKOX_vjs;#6!xpxdT0OBS3)BiR zLAlKd)gvQ%%>@n{a=m+bCipBr2;t#%f0{B@A))Q(0-V!Wcv7{3%I~-EBG2GONClB| z3PmoDt^{DFWX0;u#NIa>nv>~4!bHRjAua89Bm5k$hXNkH>$IHVboM}Qsj_$`Dgj3( zAh1I#6&V@H;W_0*487MGetNiD_FX^F<9XgL`T_|$Q@Q5;<}?HTB#qzs=Yc?pcCm}z zt5>g7rq8X%A~(KCyP(D1^hc&ODQEYh7RtejdM_atQN2;h8b*cC4cP#jp`h%D>5B~+ z9eL4`0ba+gSlhJQ_0|0>Mmc$N475L8P8#h3PY4GG_c~WDL9Usgk=k9L69$9PQr|*) zx+X%lwm$f~rO6R{qbq$3nQoE2m|oWs5Kl`>!-8QQDOmjWNc~Vv$p_}kX*G<|dBqm= zW71jv=KN%}n^L^?zd^eV%*RNzFzZBz{*Ee>= zA|t2juS)2n$sD&+UBanXSBFwHr86Esv;3c1${Sbt=`x3e-=I}CgMah zH#8MGs*<-}TO^WvXn$Q2A@1|P+k5HPFcaXppGT?WU=Cc*fO_EGzb}%0Vu3H&%`w`^ z>mrsKkKjj(H!IHNn2L1WU^PF2YwTzD?7RS#>Y+hi{OyVURCuTasU%@oh1SMtRm<=C z+7ltIzjM%w5hAD#U&M*Pfrjrw588Yeg$fykCF* zx4{ZDxS+_JiAI!Z+V`{)oIJKREc75qkcDRXClc;YnF;7JD4)<#|5+4=-|y)6x0ZwY zP4BKrMa6i*;9%1rjSISbu-Ui0ONUr$@e@y17Y^Cw6p@QL=cy$IWk#H2T+Z^BB>e z)mt}y@PomXY!8(=F*Tc=Ktc;G2jz-uvrw9D9LEkeRF5EQ;a(4dFQ%X;;1uy6FC5E`N# zzdDYM4^;fcL*I=RYq}?*Z? zP+g@xsv!OT3hvMIm4o)&JzhM;KYm4RnP9_wYYFTAyAA1b^2W|;ZHg3w3X~d~gY0b# z<Rp@-)bU| zs6%D#ASzL%uV;`j6eNwqE+%uu+aE7B7M96HlLT#%LHcV=pY-6WkVPI_8pFSb%2&o6R64h)&u8oWC;o&6WO|61q=_Bx%i zG%p;)=VsrwDB?1(8x8Is0oUpa>I|LI>p4l2@BJbWVY^jWgVv8zVc4nV-ksx(TPgM)Zfh3y1qR?TLsWHlvca)r|%GE}%~7Jc!*JC%bcjn;q*G5qhAaDiLe+*MjY{W}wXO+XeQ zErrMI`7APz4?@T2UK;KYB(<1)ua8gI0DbupY?!|v+(h32laye4v*MBcVWb@Ap zLH8k~`M+5U^Eq-(f=CwLzlVEBl62yg@rMtLM1mgi%=#_yrh+a9bI$5!$?CzO|ITJ5 z^{ePk)aPNizQ*POu{y$fxr`{{-CgFa4m7Q^lUT(+5cSIqRC21U)5@LY zwRgf_0T^^@zZB=vb)z5qomZVl~U|LFw$z_02|{rj_mbhb+^yUt|4$p_^5M`I|Y zlNZl3d`DDQ0WmO?^YLp|bB!Ya4*k+eL!$h6e>0IYGN9^{Rkr8>Jz1ksQD5F<0;#oq z55vi)&k#D9m?}*m%ZLC_Ys-AMzlQT#`d1Oo`n+wc=xOY4y_^OQgI0$|58vzesrtTa z*7V9*JlKp{(OlNIK|nrkX`o2Yu7KA%^37X1v97>3nZPZMSFZJ$?@kIAh~L#YZR~RL zIjqwHI`HXCU5e|gt74g%nKhrgmd}qy($)u7=UdFNc7ILdGU7g zN3BJT^_@$ZBRj%UyVAuTEZfKXF1oq7xiWooI2mg0E9~Inpy4dDcrag^`4t6sXR>f& zGFzIvNV%0yA?>mmbGgI+R<%^8R!wj&L$CRA49H8TqokD3b^=OiVWprT zKG#DTNpG*3_1%Z+(RMX=eRp@f;TuPxjiC+67f9#%RVI*vy+^Z=F+lZxVD#xVtVG#A zeGjIp?Om){o(U9TDC7Vno-;p{RXgTK_ExQ}uD)F(dOFNOLi<)|9@pz-khTL!802uA zvP!VINakGM-j+Fvz*Btw95?>Lwvgo9t4O2Js?NsO*H@>~ffEppN(W9PC$5ht0f^IU zIHw7dh*X=7W&(WcM?jb;;-LHa-)Bh;P6N9?$A*oKEp}aAkHom3TzYhC^8M$urnYl5 zl$jE3$NuFb_(kK)m~+s~Tui3QOW%hJZb6Up;M=N(R$+&?rJ&|?i^&2-K;51LT-vM6 z{`B+Ci?J&b6QERkzTrs#fOSs&vb$!FyN9Xfjl_Gi;U6|7(w3mJ&Efuf7p7`w0GkX4 z%7A1+W-C6wNaJ%4PfbgMHQvuwnJ}aQSx%+>Cr$t~wY!juBmST^arboh^?o!x^H8t(eTFB!IWm~c{kws~!_O_%k}u;D&SBAEoDAOT zMNYDF4fb)E3$?|XAKl#GFZN;cGc0@4Pr0`Ak$)yWQgO_RU35#iBfEiB1gC>t$FV!frseZK8u4k8SB+m1xqGha?fv~ofjoJnf%gS3lRigAPU#8; zhH14I-wM_%o}=BVifdqk{klV|Y z@^I_PSHd3WKlt`x)%k{Z^X0CR?MwY_Y)P05U9 zDa**rO|AEcfJn$&y)}c!F^yTjSvp2JD%SS33a}<8i{6Bz)6iP$ji3e9SwWiSs$E$w z4!8k*)3OobpC<;pvF1z#Rf-{CtCz}Q zJ2*JxgkrCaQc$ci@i4VMwrZc{L1O3Hypif#U$)*%@e6F>h!6{uSTb{LowKcj%6$Z# zZ-hW?Y$c4DCSj&UdQ3A-33jW-r;d>icf#e@f248MYIPKnuOBGu+KkkECWH;ssHf33 zueS%s=lBe}p9;i!iq88;*e5sEXcVFNbwyM)7PDfDMk!pSle~{P;UW^oZx>Nt=LN0A zKsxA58Zq-d@NR++7trzxwx!o)D%W@MH7IZ&3dp45vyw(5yv%77 z;j8-f<@4h=Ne(ubVh-{jNLKcz2v zewp0ve!~mUeGHk=Lu@$=D{!86a_FLy-zL^PYR=5OM|<>h<#CwSGncg?aPcc+Az1DC zKrT@dla9~(AAwnbFbA!>m&CWB9ywZ-Zcr=DMZVkyL;$xr)bvA!RC&v3>}?FGFtstW z77Cz{Eq6=CD$ot?3p zdI@z>dyTr*;90ietm4B1+9|WHmiw8U9^|Aj3wwxw*#vABK~wRr;sb3pt7@`uBWFL&mJ#PqTQT0RR&U0nn25Qt~bZF z#a7JVjdQ84h8Cdpsf?z3Pe#S?Ia?IpZViKeZhqUa#|v10*)9RED{q&zN$sC3RmTx&TbiuH=K|ZuV3uKIEA1w z!(^F9l_1rsZ|b!DP0|=h!*||&Y5a6S3aLr z_)@^(w}dYw_VTokBr2a?;DaTz4Dribl1r7q*K|roqqF$zriCPM2HrOau)?)s=%sfX zn)RnXD*RsHo0up*sMsvNyheC05O#@=G38=lu&^#x4ip6<&F8Y9q)B@h!m%^aAQc@KO9v;_RAR-~rpgVc16u55+cW0OKAk9(isc2OvJ&Umgrnwqf8v%6^BvM{&+A+DFZH}b?SkA0D+XiZSS5tql5d8L1l9oYjp=l9iq_-duoj;LOW zCrqEkyo!cA6D%U8Iw+MuskuK9njO!e$W4bKEz9tR%bY1v<)|9?Q)a!(hAv4!2CscQ zhr{S*w_I7sNAp$MEx_P6ck9$LhG@hIzdJ$1EPCvBPGKCuY1JQIL`~++cuby#{(y{G zsjSRJ@H-thw0oqTxBrX{tfm;xEv_%HY?fmDs&3wQm`&-p=z54SUdrz`Sr20HD06h= zvzyHDEs-h~5bgM^mTjR;FjGvV*X#^-IaJyXpf(>hXcB$lQJb3>VKHHfGx#&QA}2Y} zlJpZc9KIN7sRIoyJbcwNKNALx;y#D-diuod;B2i(V&afe$6vDwfen!dHLhXTt+o+SuB`_W!HX{PO*-;DLu6g|$3oo@3Got@jIiSBN*(-J^h`l4yM)KN zDljC08KP);qYZCMFtII|Lqt@qykN8?$mA!GPDw%ZCi29n8&(`ohM^0OUcvcXE4q$4 z{8aQe-OK*t2J_<;X)i$QKTqO>P*}4VSAL>qu5nX0FD?IE?+6bJ6-b2YwY!5~VfTv@ zfnfQolCM-s!taFMbY!CKP@}bnMiZMdRN8d}M2bqfm#J!u6&Vz>ah{e!ijBTUH>VUQ z5*?9#Vu!0BwGPBV@c&hfVdremwUD)j5C&`=hUu#KjJYs!#C0E zmTdN|dZ+~HaXkF{?%Vj^(WvlN3L=|FEe@3WLaenHrdM{KqtuX0B=acCwNhf+MD$1F zDV5Zd39ZPIL$lwKjtIzxWarp#y2}J-M~lcX0NdRf@(2%+-*m|Ry7SecIapyzib}X1 zZ~NZ7mlbZzEITuFQd{6hYveIP+@x!It<8q<{2r}eA}s_okP0tBX(FVeF%^>uofIG` z#27flInt(=9~q$MwNj$~5f`5T?BS6@BUvkWHuG8<-}mKLc6m-w0Xy9$?8Obf#-!#HKpcXbr`UwpG9?2ZM7%1iccNagC4D79^0;)gWtgNtEnWYiYR-tn( z&;x!~M5<5De(`4Y8s+m6Yr+qay^23%7^d!r87^p^?qNNHnzJ{*2U2AmT1#Wt}@S^o*$xWyC zsP5Gr8gcfOl&?kcD$I-`K$zmMLzxu5ggM%GNJr%E4RP+4hfCIB+B_7X!pwKi-3OqL zE>N{5l5^5oC!KF7;IfZ1T|sl^p-X5a{IX$*AXls@%jt{~x}+?r9MTwb{tbN+A+ILA z4S#>}?Y$#k1<}&c#P#K;OK5|#?f9=Y!SvFfln$DuD(Oo;-d`~3(hs1}guR`yn6*(2 zWCx&+j0xZ(yMoZ3x(Vi4U&j2pL;JG1Ky?laP*xl2O9^$u&DvFGfL=abDnB%F!oGDG zDu;fuS*Y?qT^}ih-rwG3IPE|<=W4e|S&VhRzQU#d0?*iajAD=>XiH~3Uzrl>(0JqS zxKZk*TPla(>~(x>f9pO+XwoXM{<)1l0aEBpBwbN!e=&!8n~R!|373Im!J z#nnE}8`YP%LnF#w?Fs#OsLLC15n5{o46EkK@mA+Xjpq?r52NkUbx-o}2?tIu5=Ea+ zp^NWKlQ%A>#c%oc2i7RXyR>X!Q>L6(8}esS;dZw^kRuM?6M80=z4`CWUnc?XoU<|N}ltwKa7nah!k$)HyBKvlcRnDwD_jH=9YaT!$T zla@SixoD75H__gFdBTjlw_Wb*^6`z5(&PSHjSce*Fz4PA*-eXD(MOG1^NB>?o%KR? zLR>|422Gid+=_q)sfze{u}<_Bi*6QXPgoVhZ5&Ma)%vJ(M!37?0oNl7O0E~L_t2I& zqCj63o2GU|c`HY>=D1z{3CWu+mIeBk9xK;$zHOUwSnYW7MDw*d`1iTRXxv)I#>l5V zxVOiVh_+Q<33FPJA`2)*MLR5>`fPR(QSf!b9VBSy)8X{Z}cfj?yRRfqtL#K?|g$M zds1u=C9y=qx(U}U*V(~0fyuz{ZU|&YY)-GV%XlJ@+?!WBhHzvRymG>ah|<> zrNxiC2UmTrOM~p&TJ3w>(-&Kax3|^fYSZSJcUu{Ia^5%J|GHlR2TMVJ0eta()Xh4G;CAk5 zQl2sDMNkx7m@RJD53iNx#-=JQT{fG`y>8Ir4`y-LPa7tS@fxxNV@r{?4@b*ra$}Y> z+9ExCya&Ge+6?4y`8;Vj9#`8r0iq)t+ErG%K`n!qynvTSO=GL^416u`9&8bnsI;_K zl}oMxyLeYmiwlY&Ck4_-GX13$i&&hPtfR^f)U}7-aesufTiYZusYM71fF61y(eVp6 zyFib^6I1zWEk)hW*7NF0lgDPya3fCU{MyoVbhj>SchKxwYiv5N-SPwN;FI!VPvXAgkOt$YQmfLZNMiod zK%HEcxf&}m=KJWoi+3k?SMH8_&K8=Q8bxYqQTX!0{hnp1`jBJ>&Ago5Fp;>nDT2h< zwzwM9-6;)?Y}--`2zkQI7M2y+RH0r3eLO=c-ueEVUy!;|!KmK-7Ws+U$70+gz}KlA z_AAa-fnmXwjyS8uZKr6QZfj6U=;uzmSGL?p96xXjac&8mc8r038h?$ke96aHP8OZI zKpzu%RUG;<1Zog|V^ag(8nB6+Y3581G57rfRL&++sa%wB@TS>l z+{0;0EY0pNiinIP--5Sx%tL;BP4>sf{gv){@hfADqi+x>rZkcL4Va8Isd*5H{Zy^e zpXw?}7*p1+u9Vc3rqG=XJh~w{-N3PLiPGZa1C|IzAZs!1(QYJvw1UW8Ty@l)7Q4>^BBnWa67K}dyI+Cu5CI=v0gPBtVlnB z%jOXbNo39}$$}4Yrs)a2Enu&#%TX{a9mp%EL%nsOPN1Pn*Ac=X-9egIk!xf&q*jzF zZ|C{SS7Sb66?^qN-n}Qb$9ua}GpK;~LwogBZP8?N__O}^&00B_aLoEy%~yxTE4tX9 zzYEjt@XN#0Xbl42RB&5q&4@ccrML;H`5?>MC60c2g{MXT?gTKIq_AIDs-3T{s0<>F zgxpemZmkm?ZouSWzz&F2ppQ~CfcbZ)iHG;K7S;RO*%isaY07@WG2G?H58_A{d3h1L zg*-PD;$gy%Tq%jAw}U)t^e2XCvVdM%d~(WLOR2!qR~0XmJaG&hGvzi;_tC48mxwt1 ze6BZ*Om>64a~pqIPgJB-hSyoU@uiqOpgtoF{( zT)wbMPJu*{m6+cHku2q}cgiD8wslZ!TW{g6HliSG2@NZ@uOpT*(lwtY@YVkQeN3su zwOHx0c%J51e9z{@pkblnozDU?P@IKQ!J@KUg@63a0?NY5E;iSw_bCueWrwKdovabN z?j(GEaXxDYgc|@i(~Om{jQgV^<6Fn6R4tCG)`%Uu6al2d&1I)E6DW=0LvVej<{PCj zJ<6^~}My9ZrH{T{%4CzH9XA@V?XvDwmeoJ@^zA|@7n^3U`h1IhcdL_E;o=LF3 zlfR-JkwskE6cwf{9JTade4u~GbnRtRpx9yy{fRn}-27N#KMHj{br0Fp+chE9C85+0 zG^{L*O@9?BN@|H&ktAZOklJARUjRq!_W+)zX(Pn~(%*Q`Gh{74V2%0;T^auG?;@KN zz^d5GJCq;pU*HiAi2q=dW+DIgb!otMZf@VY!v6~`BEXrGN9WCR=hiGL#VO$|*G(N_ z@6@(JCnlRO%ZGcNjZ`6;(Bb6f`00AR)MQ3Fxs=$;eyHsxPLPZ;g3RAWxTvG4;mn)7 zRppL$%ujocLpitHFNiDy&gb-Z%y(OT9&iv&Ld6PE_4w+tY=}VlT%f8QRVc9)O9G=5 zB@ix@k%rUIla(eW1zX2m9ur4b(TDA$(lU$==~al8dYuk{g$vRIjq4+*T3E6Ltn}kt z^W99ed~3x*t(4T0z%Km#VbW1PPZ1I~#x#htmvUTanR?Gu{-*^{rq#yS%2t!%fv$%m z2EGQ>AE{t1iFT<(GbOw1FAVZ4H7KL$=QNesI@cn^bz7poQM;aYcfn($%g~Cok2=+cxW>V-u8& zWz;WS@0}LzS}x7*6>;;>CGnot9!N~WvVlD6W1sJ5FlM4Ef-oNxYHy)N>Ujp)_w~bZ z=5uQ_4}}M7wR+sP4@w80PB`WncJ^v(4&wIsXQ7top0;D;OB8J6QCx^jB4-OtGW}*A3=+~ zV}7l$W*s5LdDGBoI`5#XPhRMRkg%^uKMVT5)c&Y-Sx&6Wud4YT?^OwL_*_MmXw|?l zmDFhWwX{Khk&nJOU!Z)M-m(OuABXv&{u3K`d4WqQZ|C%sFRv;i*Xpfa1b65qzvBq~ zJVVkvv3z%>C-{<4%YE`OTu5@2`$b*1>>OW#trA~<3IPkKHhsyodxMDo=q~ zS{)o(T+0!Hc?R>nq}}?y*t?iTnwp=b)fORfIapk$u}pO}OieZSbImwMLm*w*yA3K) zm(MZB#)bCI7WYPlf&&-z8oypXRQL>td@;3xm(Lj2Atfl)f=chpBUf|MN} zwcTKXK5oHqOMLF~0L8JwVM~*G_@sP!h}_s#bb{nUU_p8$mjonJ($1>p0v_+m={PI?vAOO(=YUzg;Jimk$;+=5#0iE3yWSR z@(lDOSaQ)bGy{c5IJ^}h0-8NgtT4~SBDWWR+F&-^fgSDiq9> zds{uTe0z{<{6$lUy9zsbAGPQJ&M_@$%=ckU=`oX)ti#1D?_%xmZI&qfqHcB%{!ZOV zt@%rYT7_)S8G>h zfJY^$HeI*A+AYq_?FrdjYvt+*bG`0Y+6E6~q%0mnR6H3k z>U})vRv5&qs!Ed{rNeSq9~h~oP5<&Wer8mk)KOF{!wcQaPm*~c?va$2E|XBpqgyXb zvofz6F$G1Ss@2Y;FD4jD>P%UWl$Bexj0cEX`)k@!C%;(28RBa&W;of)3L3+f0)Js1=iQqT7j&c2ac{>5G_7B|W1$h5B5DF}S16f}Z zo&U#eKqH>Pvn`Hg8~!^u`~&c&kMTsZ{)fZKa03oHC-JDzf2U$&1K<^@L!z3$mnrgp z$%z4W*8T3%`c&9as&ym-t>R_S%M2gIMUV3=qrRy59Iv;p{_!=OFL`E9>kPbZIQhJ` zD=I@D?p)%clrYxZE#7e1EJ)bf+pEnqzlRm*>zQCbPv<&7b8h*xVps&o*II;1==|;9 z=jatOzf5t~6N)vlg0pKrJp{Hha#1#-hzGTPU}-z2M_F|;f__6lfd*rA6`Bmopjto>bXtNCdIl2dX5|vavybC`MB0qX1FOT>%b`cp&gs zC=XWTuvrL-XYuu63OUh(9?rLC94*`eFRdG>Mi>C*I*>O(y-7lTXawpoQ zB_ziDULfs^EH>YMA^hjfG!}#7!s<5})TGr-PoFJR%2?W+IjSK+fY+4?IGGPwR{b8T zK7(l`PsHz%tCBl75oFY>{NY15CTqxaCm`6R)&!J)QvNvh!kKZ}_rbX+Q35DvAWl=H zRY-8LJ)TmeS*`%E$eOEpRJXQUzP&A$QzdIP>V?+Lij!^LW)?FI=5We5F$cn*-X}1t z`ZYNpNpf0Ts}yq`m>(|O=-B@SasblQ7~YCJdTS(u21ER%UXxQE@nSPUWhtn=!;KLr z>w61qLsq0;p?Llv^%+TRj}e^w^JAq6cohjHm8{`)5|9o%*e*-Q?gLr zeGvO4N$}q8eMrI=g247W{cpFnOAV4w?|5~nu!`-+ev(mkGG>}jP{*?v=sWuY70okS z?=B17{;nK=>(TvlJ$qAv7(kuWIaPne3+=Hg1_ybtAiinB=aHlKjFMIP1ZLT%!x_1) zkz3_f4`=m-P;7=m06?z+3YAk_0HNxlGmTOmg0*v`v(3?b&nr0f$p(9)ZOF#6+k@$h z$;RMgTUFm_8qGdz2KAh@C!1`Achm3Y=|&`1R#vPc5b=5(XDY~QzN`q$)j6|+@)p1R z{`L448$Y2yK;oZ4%?LkFajRt3u9}p|Q_c+eGTMnQi5S<_AbhR`Z zy=q+IQ!k742!_3Ug$bEo_kmtJF(q(20w|`(DL_$sY;T{EZ(2fSJG&#`k z#cee@SY=$$7(~5xjU9JVu~7)@fP(AyPh>6&P6CE|mRtzo|u)6a?iKla`#D9)w} z0}KQS5InfML$KiP?(XjH4k5wa-QC?K3GOnuySqF4=F7i(x0hSBRl8N(P&3ug@J{zR z=dp?KB;|eRJAwir|Ldpc-H8y>1eH+R{}|V)(f+fLil}_>iJ#)W?UeS>X|yGLh7tl- z;C9?8aZQcF<;V*XG+|c`GEhSG_VH11tW|F8P@D&71IitvdYXHuY|_TvgPG z&m9NU28z4Gi4hjbS0se#-(H34w#Jux#3s$MeFVB+za?@@(~9%)@x__ZnjFk(mnc!_ z67DYT>v@Z)RqNyraZ(VbBFf0bK*IKZY!a2xgJt&%(Dk}Cc{&^*h!9z6ap-Z6`1rrJ zPUu$|xCdY<#X3RZ&Ut+u3Q+5F+FXt>^(OdySA?pn_rz$7ADpM}QFoO!QiX!Lgk{nj zm9G;}*o+6^0G1YIuxR-y;J2jQ?Q68uKHqU)GRhSOiiAj&s!*#&_PJjrb)jD?uB+j< z6dX%qJs3abD)S-X!>kMnPiL_)pv^OjKI=F7-{EGA|Cg=R{kCRK3MzD>*sgV*?9gC7 zjR~evE8Fh!d8Uk=38Evbt8pX3=JTcPEJm%j>wb*O*77EnetR<;1kOG6EY}QXGg-|R z{VK=NDQ>gfPM!9q2FE@o>Z9%aEAzu$($Z}pUTm@~am0LbBcM!Y$-Z_}V*J%93EP+T z8#wg;9>5^~k9__5l)%#;)Iy|zw?CDSIUG;X+;_+AjVU`drI5hYyvw3#n(Ea7#L(>S ztGH%lY|$y4E`hq%0V__&y&K6}?mf_4u=l_94uuGXV2qy#`78f@PZ*QpuM(_|iV^*f zTM66-c%R`b|6T4ij6h=^36}5v?>c!V z1sI?czCz{y-fRur-WEo`DDnTT#0$eucv`f865#|HuA6^GB{} z&D8aIl_^v0O!6G6?Ipu-J$s49X0wq6c#snG7IE_cs}=M+Fj!I9EDmyUst<4l zE%ib`0NiZLm@w^bRH zpr#(C-pxh&`&873fy>TW-)#1XQPQ3eCDN!RHQ6m!guU61vR~cv34vkI%m2LEeO$-} z68>ZWr_N%_*|O;v3@C-Ol~z<%5_0mSBw7tguJ>gTeEhSSS|Kms^+LwgrqgA>8Fv0iBa9b9kKVqk?pv5l?Pl)N{dV;%B_a4^qL*Q z8g^uoUyApixy8_^mF4Gu3``e}9CYin&-gT2E`A3h$tC|U0;{19bnp-PeOWxz2EFzE zV8ot7Kfq8Rf#JU10>sAxB!~|u(Y-ZKyRFL=dEIaM6?`VRl=!zv(}&F0*o!`}lNU*m{j2FU!zX9PnDI2}qD!DQ2Uok>CF7$3;nzkdX9iR5ut@ zg$&LOk8Y<1P(QcdpD@Aa-M z%9<1}ymq+!a&kD~9w0Yi0hDd49i?soqaGlUJ!IA}sc$(Evx1+PDM3)?l!T?fJNiF$5H*Kn69t037gq3SI9r z6et!-O-G$-9c0V+l^!#jO(>kl`#uPCGU#=s$Yyg2L;}%`Nfua5y}X!@d@eSVIRQ7P zYToYo%X+AiIY}W$AB@v&POdgayjJ~o69khj|I5SA#3H=W6`-ar zbs0ftvirt8-FoTPrhYqB>$AK)YIFvA5kNx53|Q-WBp{ru3jtNC(%kLF?~kQI0|;gA zt?OVPp9)JN;|%^s$px63EZ@$d&(gggugb1fXp$80^z@FFo1;0CTXj4n4yN*PB)l33 zwHfp{S0)?) zO>=N!LJpoo5}Tu1zP1cSfrD>cmgvd;=*Gf@+9@uvd?p79KE3R^hqgcf@%yZHq3}$( zmYPp1gHA`x-N~8+hvSa?A?<4{!wrwuz2ds>M~#+p&{Y0_^7KK;0fdIJxw2sT9Np|Q zz{Xd31PE&^YeFOFV>30z;d^7sX{Z$0qwlP?Ga-<(f!Hi1)m5tfLVerarWl7M%+ zGC)E_b9whg3N?y=X!?ehuBPWBlqrQH$IJy2*`kdVMGufL8_niM`II{j2`XPD8WkX# z9JWRKb5%f0H~Xt?t_sD=ZZ9K(Z`GV{gcjOk;jQ(EG4x^?BuyCpA`P-e6`(emKz(9X4z-` zNwfmo4P|+74g}=0(NR&V?>0qt2>(rqH&S8LRS3(KtAvvQFcx4siUi5*GJ+wC!2qS7 ziPc1CFxx!nCYAZ{ajnzha=Oq`T_H&FHdi{e&N4-{qPQ^mXbkw1X6K0vOERwA`8+n;Bo;Y>PcU;5cBEHJ!vvdczm zcD&YTp!^wdjLxn50jSwUPM3PU4t>8K2`x2xAvW8EQs)7gz!N(G%OwUMRsPDi6DhL* zPkxV&eiy&r4=UN#<%P-&6}lg$%fpWQBhzQ>D~zdC8%lMlunzE@%A)NPG*jwp(_ST0+2UL7LxHatF*w*2J?DCzOS!;#&NZ0cd`89s3Y+u!Wrie!b>S%@KDYeiLK>?$9?JV8hF&SVl+8?r za{<1Tz!K3t?e0+RkB`s@*vIJmG<4?oq&A5+TRGR;a^2?1iS<#1zAWT_{>d`|nlloN@jCNp6OJ~%)y_>vN~5>BWN#}t82?rFA0SYW{HuMy zaoPXLwLS#613iQ{%D<5w|F6$LlYm7T@(;`V0QQNL_v8P%5B(sZo%sAkIN(2`nm@2m z_J2b|;E4Mw1T+s&uzCMm5KPhp-ZFqRzS7x?l&#F3xy66^0t`uB?&=y6PQ2x0%X8^V}}&;Ofo`C|b) zVU|aN{BP#=;qSJf{@=DO_S8_Jf4kyGCqu#zyP@pokH*IujFq9pzlQmQWX$sJXyo;=-`_3;*mKxu>5mnMV+!fMO=^&)khi$ z?C-`kqWwP^+l%9#a^cGE(+evI8+SmavPGlLmKx-Q?P?E=%?503eSRSh+x~2=R_7wI zbCAN3hzg#1`$n+w541xDtHu9FF9r$)Av^O?%EIK3dLrTG2Wi5g+ZPBvW*)u;nsc5K z2+rGy#Hb;dl_~xX5BqXQNKrgW5r;G=On~~|h=_lVF3>%Q*kdusA)bfThOc(A|O(RgIt@C!&`P&>f)}_Op?Av2pDD23B~#E5gmcZ z%lFVu2n={ng;P*~3X6!yD;W&Fp-cnSs72-H!%?_=Bab$qaa#6kKHTd28Wt8+7!sns zE6ow&y0SOpd~%1|uBJ(tDC+nP4^{V~}2+LXPoS2(_03U_x{ zCjoagqm&S_a&PEVm`M(+h<23Sg|??oLBWCaPb$_&+QHF<@|I#}68r6bnKp;(Ip+Cu zofaeyFAU#3NBIw*%puS#+2sTf^Ah4C!^25%LbeRANe62zm6d73jcB>ndgWukM=wy* zii(7_C{$YFCr~60ir~(cXC`l{8-F~n4{0;ar$%#9Tw5`;Fzxyuur4VE4vm0c#A?OH z?F856dMFN5AD(-Tb%J0_I(J_sBR?s+zGaPvO&k{%WZSJFBwwlw?};mSdlEGv)l`XM~vs0pF_|`vNVuJW4TF zF~HOxWA|b-L(x#p4Gj%V252Difll*U-NRUt7nMpH_uaIT8a;R@KxwA1!!&=4Wp~`K4&3rs$fL?5V3+pb&>$=1 z?rwRX#KUKDDO4TvNicCgSm1$$-P%-B;74GRYc)wHNTke6uJhupW!YBe5c)2(==pgk z(bZ5{*KFTfnJ^nifDrVE%3^iL{g#M2yuCA(z-Fg=^s4Qq3w3x{(RFZO4hZPrLiyL= zJ{xc9d=8M_e-pVSjL`(2VifkG#~eKW7EANKvhK0Qj|R&b6Rz`mBX_F9r{(ETvFLVz z4ycVqSr@$VEtv40j6qE`nucmS4q;LZ+>Y$UvO$m&;#Wc=5~$GL3?yy* zvYJJ~8o5jchj*qReH+mzS{Pp^S#q7@H@W7DVdlyw1fUY68m@qZbUKYXc6c1lkgLnD z$J1!#GZ+fzYdi`0GKyb!)H*`8Q_iVjZ$vocTLm{k4ODfAei?S!deoV_4XhU_CrkMLS0Odkczz>**Ztw z_m>V_03v+DvmkDxDNP+WVk5CSIpK`)I3o^DRO-x!2JdUC4#Q+{s(bRDvX4;Qa#^}r zk~hBToSA|`JtZFXYUWWFNTwNh@n zhBz25vn8WrdS%_?YnGkXl5pI>h6uhZR5oPxQ z<~i}7AN9I@1IGcA9_Vx^il65OC%>O4ReyZdC4DrKz&OV;ulK`E9Nzy#!vqrraKbQ0 zkIRNtRg=&W#fjT5<2)QQG;trxtl1F+DKl%JsK0OSITJ3{s!CfjcQNnw9TJaG{meWdoHb$eq11Kps zTy7*3!WedH$QBqwxYChf=Lw&uZdLV86@|DF-F^yD4-Gg;TspfX!2zs^indb$rM_$Ff(>`htHWCh~o%eZF4PEMZV8RoDfg$s0u;}*_bW;+|Fc1=g zA5I9pPMyS7LSli%CPNHy*}WNNNn%FCBEU~>-+y{D)bpbZkwmvAfeyrJO|fpg3F)La zv2`55`j`l09*e{4ZGOkMB*PnfR))Af`3XJj#7ZygdtfQc38h=X{oP%(&k*TU`Dw^c z+e0O5c-Ki&+G+xW=_kJ=bV&TTRdttm)=MGrclUry2ht1 z42ESp8>D_7BpjP8_VT9>1)~q&o~e#_0BNw7efOGtE+67lJ!3ejCNNbObGMC_mJopl z8WA^13D&q=G3zmLqVeT}u)E;K&8&D@>nZ-@#g%Cn8eClabv%J>T$l~Poh8|lCwbJ8 zit|RU>aEIKfj_P1OtV?4uvKkXE+!_XAeUQaPDsrIf!Sqv>cACt1^&xBSFR+i1clf~ zj!V(uI-CL=t;<5Got(KbSX0TeR8hi0w;d_*47VMhu{QX!9)Mef{$Vf~@!Ckj=X)QQ z%AeckSW8=l4t1FxJoG`Xj;$aFhXrJVnW$Z#^VVlfQx)N@_Yk9~yM-Xv7q)kI)BqOv zE6PDTkSQjlVpTXRht-|7xCh(i@$r))b5~lmOH3PAlrxjlM#+`5li=`a|3<6*Qq>MPPh+S=c!)xS~zv2o!Zt9v5q>b$dt9}sqq zk^<@a9teKNO~e*^U++7aS}}6jMP(?_VQ*}n0scQNF~MG2kNTjtlS^(8u%GYj=lbf@ zE(Btiva`5TI~?MdhO^^^KsQ8GQ3DX+7z#zf;vaI3xb1bs>d`F@PBwtJ%)D>kcJo7k0y40!6EiUErEtAs=_OrdQW#@~_*~tMXAs7_1T2$ork$Xdnu~_l2O?YoSj}W~kW7y5p zRL9nrDB3DLiur{gTh3BiH;SMf`vwe`Y7Pc6wKWS%gM!&q<(BZ@# zV)la2=|+>uHGtB!O2kMsGH~9et90BS7DXFrQ;4KK>!9?WLlS%B=O?T`@q=4wsf0Pe zfS!yhetDp=P%Yq2Du7gyo5x|xI-#P1yEeN;`mHzTm%XDyhJVq_F%ivCcO4Rt%@DHf z!f)g;T@l1Kwb(8kOh3SNXx`C_!r3D=b;@p*lQp}j>DgA8-nhkd+78FHnn1ldysXMG z-IyNj?iQsE8y&Jv)CU3uz+yP>d5D>HWzk8gM`?;JXYwEU1z53NR-9j*6u>pLd8$SX z+6nUS{cdcvKUM#sh$_B_E=AB#S$E@bWo`WEXmYEdai%_(*K+3{tQK9rRLjm;drSET zGnp<4cOfjHubu{NT$D`^cktYlmdE>QC&G~vIXKfKc)LU*)mk|r7^=@uP+XipNJ@lM z1mb$nVXLwN@a&6rSCt(d?V(GrBd`BcQ~(+C4~dQD)YaEu;FB zE+%tHUdWWmSr=o_A>v5wWB8QzzO%;;MKgj1xJh4SGG|M66C>lvJ>DzFR7q;iVBjNfMLIcgO00h0n-?J0~<1e;Y=JSv2N1Ajv9=r~t z-f^GA!u&twq?dm#H6NEREj2wzf4a3v9qk}KiP$_`Qx=k6@lpUkrAbXg(|a8cF;i3UarP>- z*%CO8RefRykR4lbO0c8TIqR7vY;^@&L_E;t-!R6b{ZoQg&aAO6zY+ry;sk#oARa1L zxm1x#CfXTjc2xnF)B^(U-spgfNy{8sRo`oLkINGAHE)j+;ma*aLZYb491{d4TBh9V zNbOjjPkl7At3TPqeYuG#aVUf9_sh6XY_W|Wz6RsS83~feOl_?EWiLa14S@=1AS4u| zvVzvz?i8h^(w|ma zm$ANWM3-6ML27lM3gNQ?*rfoL0<0{T=@X@feXykA`qI0dvV{m-ak*F>xFK4@uE!x)gA_q)!bhY$wQf@m&dFe|-=s zQ>x~G)NT<6nT_W5k1Z+W7ui_cWjvN;oN~D;_K@3@ScKoPn65yOxxb%=F^n|ZDm~es zP)KqIcRjR8zVB(BPXPl?%3AF%Z&sPKm-t$qJ4XP{PRR0Wp3NjAMw%LpNf-LN_2Uye?w>f`THsKar_sv1Pb@Pz_Jx9($$!bhvN9 zV%5*UvVEUzeudaQDT1zEE04ogCWrH`DKJ~6y4UerQeV&OR%EGl+ph7TZ^;Gc;J%cv z?CNdvs{KOqPp6lgTJ?M9yX^O-g&r7)X?#x@o4>YF0bh{ZyW|)&Ys_Kjbeb}r?vG_` zZ9AM}=tInd_&ygWjioCBjzZ>3c1k6Rg<;ep`J(WH?e;_{R?Ko)+RC}!9xh`f?a(?q ztz#Ha_r=#>7$p**JLjVtEMO+0Xu@hPAKlT>QKC9_H2gH9Vs;;lB;I~5xboj5t{2sO zwG48#%_aDo&5|fEKal)E#>Zen`5iD&?e6#v^6`8fLw0^@$d*i&ncLcy&l6^B^Lq!& zG#QzW-e(YzH+k%#QLCDwVSq1$yf&RoV?92c-nA;L@Oeg16gU5bXDXH(MYUPODn6RFO>m^XlPpXng7WFN{*#)g|RdNl2Bs z>h9O7iec>8a{2ixyhg(iE0tWG^tlGF3E#Ab)i2wu?Hn450U5>Nzm7*Ve8u(1H z(CIX)bZOIq78ck)Mpxnh2z|lYu5VsG0a+W}8xvFiYM0Zz{mBDNPb#ySO6uk&a=+D` zV~yu6r_iyhj*3%y^NIe$K|I4}r+qpmXFzN4i$FB6zg()BSCroO?d{0-86G!nAiM)K#5%oKycn)%PGUbj;As|m#ya|18~z}bPbz{sCSl6rr#YNsCzX2kJVePYD1 z(Td<5N;F13PX6u2Pv2*&n4T&_)vz zm7gLU$Es+>Pu0YdW$_Lk*LY@uCr_IcU%f}yGthG0LNc@cZck!2TcV>(*ZYyqWGI7k zS1hxQTkICQA?GbHsC3gGpbakXGhoAiPrZM-Jt}$qcsx@o(|pcdTLFN#W#p4&BUigt zqdO7N)Fa)b&-bS?1QFiJ^bp#4$MbeEYf>^5N~yot_Q&pU+8wHO>*)m+tGm8sL|wYd zvbhtTb-e~tR<~jVb(PUB*8`~V*iz)-DssLu;3YJ6U#7>4%Nzi>`Up(i<7DK}dU3^i zd4+dE?K)8c_7%vvSpukte3xHdPOj}DnvJ6-Ry^QJy(YSP^=Nzf)DQOciUCjE4H&S~ z_u4xTl(}ubw}jExY`-`-F$8Ocwl?xkr-sjw!%_sK+3KZFgbwud^iL(i1AD`g36vj2 z7Yg|i@Snm^xUv3#zQ+SW4r-MJ&)jokbA*-JUHqrbZc7u{;2tFkT{q3Px?;t$Pw^3{ zX8nXc1Y2F5j=P%priTU{eOWy1S2b20&&{8^?+&K=+-3YW05XN0C{J?N%Mll=gkBE6 z?{4AUTzWNCbTi(`UZ>rAuJD?*fkEz*Aqt*c))n(mRyx=FYr5l=ahJ7c<_SXt@jRQ8d4Yv}>|J7&Dp9S( z?tf+)C??=iAB>K5TgMr5;!`^;G`M>W{Ow-R^3=O~7Uj2zLN2ku1k+pb4XiXB+#1@#}^t1Rp;ku;nJ+!cMf&9THKy2&M zMQrQdKlj7j+4O%H!!+2f2d%8G){VYD8V3;mW=5`&f>Z3R)eityCiDZV&r*1au>OAW zOi*t=`K#+@|74U$nvAP-M7DO3r=Es^C97ExH?02aH*0k{AEJA&E;sORPpEq9nm2uB z1eeL~E+!6PI4$lSotH~e4c>>|z^D?@cf8D!*zTLh9(AdFleC59a#11mcI3Ps@nr+( zd!W#t=p1(Bkd!dE)=p@USG+H~_XDL)r)y@D&ALSgkCXS#o7q^F7yxz`{Iqr$=~>s{ zk$&-o9XbZcy*vAEN$>A`kGX}l4(=z|aVl>UR`-!^%Shr6r^e}=6}n~as*UEe5}iQt zLVocJkZxD&u9^?aDOvo=NuHTB_|C%Zo2Bt5S?tuOzN7swpQ5|WxQ#IP*n7ME*W1RKz5e&HtTPJ!;);brsdkD-f=z`YhHGsOH>LK ztP_0^NI3Mbnvv6(r&2Oe$Mg4v+^tRu*?!c?#-zfMN+2@4W0(esSMSN8-eA!)lvfzzn}Bj)D5e46=SSQ=@3UucF?TamkYNAKucq zK59t|&%^2+^0)Xh8WO#FXS>qP_}KG_Bpa!*eT4V@Z7;*!vc@CEZ;xPfZ_ogVwAj2ubq%%5JZJ5B3fYvO5~|e7wBxS6Y_S9XzvFHiE#NLNUgrKBs~feL_(5l7~x5Hr90d zUIy#?WRfPyaNIPmSHrI4Ls}ofZ(63?GxitG`^Aj(b)REwVyBGCzkA{Osm~yAA^%m* z2)@qsn9Hua|9b2CFgcrCp}ncnoa21qcQilsdJv*0Lh;XQ)4ITfc1Af*mx)EIOIrhW!$qUs#3|=; zTXc%yCF5+O`%Qo(sM}&R9t%NVz%)p=_rK-%sXwJ$XCwiU54fCy>2JD1nVgMs3KmRu z_@mKNuU`*wJg;w)55pNKOv`pr4Frk~jQoZFBA_uIpF;L;E|3XIJo*57(PY7SS6&#} zFcqTX;<-ZBs!BlRaKZP{^x(^F0f1gX$mX^ zfbFnUm#3XDITzWWR;%7!GJ3YA={Ck8uh>rbXL01d}jY`)+>aMgSO35B*YHR0ntqxi(=mW!{P1-v; zkhFbqbaO0Rq1RQWlEb1-?HMri)UJ`<`1QNTIYv)cS2uwqm|}M%8L&>G%U`40|AU59 zgBO5G6n&trPP=PAENa4oSNbD3zwAW%0-p1FgIr{QC+~`*v(z%nu*pi8oc_@jVk#*e z>PT;x2zA}$s@Ze^+#|e;@7u^0UK=N8d`JOT_f^Yofn@8j{MbukiDuT7axuS3_@g}$ zV?bbV)Z~l>bE!i9(-#1i1W47&UEUhh8hH?ZQKF7cIEwKfm`F9q0aBZ_Hv_w$IB~Fr zvSbmIS@++Ux!@isqrOG(IS`2wiW8DTByXvbwtPv>qicXXI(wQeX-|eNMEI%LA)?vQ z^2H{WzlM-VICO;VyueLc@I;c`v3X+0t#x&AG4}oBw4V8TyaFf7Y9r9eLL%kq-th&M zATq+5EC!7A!n|JK=y%I7+Hk0mXge1@2A}Aj;pHVRS&S7synX@-wmgqrDEEdwNd`2lL)@N9@2(!TMpc3wBr;MeJ1k zUEa(E7|t*R31vbzBYIjNh?tf4QA`fh7E1GIL z1bav$v%3nwZ0F)i^Cg7WTb{(85rYLI4~B~jFFQIoiuyB+$3|oB&s@RuZx(E`BM}sS zv}SMrsKK#l?=p_F!r;z(FC~_<$SQ-R-I<2)vWm#OxxF12JC8`WI)s2pt;0hafyMcS zb*81_(_S;**fd?YOR%fKc`1oG-qHsFz?4-&_E%H>^DXN_x0{^zSUd=pT8W{18CLfiUMwt6gn$42=f_wH#&}dE4R?pzm^!>@nt?0(w7$(Q&6kG&Zw6D zE`tQ>i}fqHs8$T-E=tu(R6DHd0rKv&H#|-kYdiIxOzhb*Dn^{5R@=2Mq0kk4TrR9g z9SUOPjot7pc&(m!5RQZeRS0)EE&T*;4^p4h59hP$ZUa!$DG(T%h2Gy9?gv`0ThFsl z>d{V4f=pE1nwqgDHPKm8tT@@Ms8kc`)J|Y6SE>b1&C2|lKg75cL$T0K{Kq?xHlA_k zZfl!3io>$wQn3j#fRx(Tmp&*K&gl|fWlIzc2x1-)wf4-&g;bI1LTWB`5mz-T2Q zETB9)KLIV@jeN+N=yUiD9u7_fpsU`b7%tCMe!bkoxvr&YAtCk{IE}ZTUqviCo6~SV ziG7BHV(je-eijiT1GyS1qD(U}BdPyZ3(xmQigk8!5LI>kCMYC0S!E(ctJev&Z)kKm z6L`PPz}nUBx(y{BezVzrrmWM1vCRr0t|Fc~%y=!FW=n-m9`lE2bQw#=XVqTI=G?Hh zB4RDDkivBj#`q`yihOf@o%zH&p}I8$g8N0|D#wCPm%YP{Jf2nO_v@mebMdHwEhn?d z>3M=qYSnCWaISCpI%Rh%yK9{Pu5^T1SUChM8#vwmXKoPs`K0nqQZj zEPje5PO6lk|G*)Spg~S_ZXRxk2I^}o0ko-tkJ>Zvg{t~088Tr#dnA4&gKQrhs3eZ! zE1GFMpA8>=fj#()Y4Z3kYGED!2oBnsU-x4>$BEs}IAEdWN!PWW%1?9|I_ss4DB097 zXOH&N;#nuqEbrZDL8w1|VPu6IoxK3pNML^|H><7P9B=7rN;^XK!sg5731xNIuhGOx z$`qICyU5XpC}ngdVek25Ea{3pm%V0C1xn*pQJ4*9yV$^$F)Q`K`_KvLZ7bZK# zBEump=MjE-8{^jA&UILPh2Gx2_&r|9o`4km)_9!bXO4FZq1)o1^pRCZpv@wZGUi@7 zt)y>KxZbB+Rdc1cZgzPDN7weO1Ycgl$15kzkFe}nZJJIBhCxZ-ER$P7t2^!PJe37T z!186jq{_t~=dNVVKq9HkV6CcTr>gCBg*vZE4=IYY-`u$CO!ojkgUyx3D2AM(azIw) zINkN}l_9`?2DPQpL`B;C;OCgcKI3h#L2n5(U}2t;7^*=LO{{~pEtAWynMbw0Tz9kb z1bV!t)G52t@blzq>OB#aw#-0~U#^C#ss=Im>7VTa6c#Km=jgA`g{3&78n+OSPjiv% z>2crFadebQ#E+;5Z;#77;s!?du}y>^rlv!`4iD`7nN?~Y3KiEp3-`&O%Swz48QJ>Dt!Mk$cBO9_<9Og(h=fda0N*K{GONnGpnr4>JT)DTf))R)tbcUXa;8_&4pF)` zqF109uLzRk_`)t(IX1+|P?RZ(TqHeO<+>_@3p-k5{^)encZCu!U_jI5mzmewpP5w; zomr940_Wx7D`#g?dkzR=pV@RP527P}mW+(6IS3cTAuTit3OZB`Mu!W;3jzMZ@NI)v z%O-v=0>0U!Q9(4hS;!P$glPq?);SS@3N&YjXUD7kPy0{1-@Yhe|gIU9M5CjYAH?FL%~!-t4Cy3mbye!7r1(a~uUE@c=qXBL;%E+z(^ zEJV0H38SsvgryrSo0ebtG~OwRxgC44iej7@B9Np9N!nb6m@Sa$k}@OYwCU)}(2?j+ zw2NkL5tZy{%f)SZ`(5g1c%_#UIMmXoLH0oF#u~3Q%?{$_LU6~9j+iQZ;jRTw?18Q6 z3*&jD6}5Tq5u5>YdbZGlk=rs4v<6h~(wCIz1dw>Z<%ccn1B@2`#`Z{tZJ)rykrA?I&RS z)JL`>OsK?mGQNM_RR-13-XvTlMNEH^8kEtnur<`$GEzaVY|hg4V2|MI%%7;tnw1hE z9W6D`>Xs=X&{2nUrvwVOq~7ir` zE~fzJewj%?cqi_`e*EQUaj2pIMG@U(8||e=H-NLumMfEZbfHEk#fd^G1zw7Cw}UFS z?}t$?uF*=8?H6QeV2aNNw{J;B7M^eXRjV_0Zw3e--8r=>>lqk>Qtk;q1$m z@MO=r2FEBpV1uXH)gbljEz#s>i;JFGw##kI>`8gyeU4RoTTBH$*k4^D)NFe$J!XSboP^!5L!((DUw?Wowe*c+xREf*PBSfqAe0Qi) z1~~v-LPel-4`Gp?$#{!hk7i*5`PI7?;$`4o$&jL-{n8#D*8hB?!=XP<*72?a;yj3r z`1pm_xDSt#CFN5|d7a2bS$Z?Ber~|$9gW!mc(=ytD&cAPcDZ7G;dn`NEf7XC5qx=0 z(ZUy^C>i+&76vgPvu^NIcND$TY@@1ZEu6?a{xpjOTcM;NR5zxl1kdVifr|ASn7X7g z=XPB_L-SB#Dkma41rX1fLgiqknVbV{o$~@#Spo#N)~s00x_Lc++kBTg;Hze> zfCNo-Pw&iDCSk(E3KBv(QHLwKkzrP=xtW(E>dRyd(&U||;8}rLIZTE&AM|;A$BFnR$54!sC!qN=1z< zhQ6zDL6i35mC8nhgCwqFj6cI;&&`8dXs~Mp zH-1fyi7o0xUHne_8S!;Eh5u*QX>6MV!Sp?Tkd(ZLds78sDhjcz>fn$f1KFU063+_t zT%cCs%kg%SgDUQ~wze`UR>9D`2##;6%c3s8vz}}D`!YCv-LR@zvnvDDB1i!WXZm}` z_FczMOinemxj;+2xvdqKBX|O$E|2Q&TJGi+C-(@5H#jiHB^Yn}26XXxYP8L@f+h~^ zb5Ya;$YU^89#X6-NkS7z=*(M)0;yX~vKUcpJKBgiC1Yb_TX%PNgMkAvAawNaR}h*0 zN>jZ-c?RUav_(pIFj!*?O2*Is43D5BPQOXQNsJSo{~0GjQ+wSLyouei^L`z+^r3zEuF6)P5I6p0JwRs7T)o zLO7+U3~~iXJcv>%mfbE&w+jp@8Zt4}^}ZIU@&tLx%F@@(rq3}mF<<{=#>3(Agz&sO zFy+(!;z!ahLO zDW_l#ibLedWeQem5@E9B5a>c;x$C5LSHD?o%2W$0wOAX<_t{J+@ex4O;IDIuA z6u&uQ{^aDV;V+BqQ)7OK5_y~}meosB-5Dy!mmc&8hi=i$Q0x;puJfFyl1~5dlumH< zIMfP+k+A09Rc%BTXM5m>hK8E*Eq?7I+9X3jmRi*9+><+5>V&4#a_cVw%o%XNx{Cap@cG+3%PJ6U~ZW)h7?RY1Qx$hD*dN`<% z$8#4Xaj?`_KMn#W{(vqur^iNVS$2HP$PSa`c#XkX#D&^^sg*EHpBjBCjKu<1;(INo~GM}jlSUa0<#<0cp zE4Li06w%lJpxJC`fIbMMEb?pqtoz#0atPw>iz^(ty(5X{t?U*O5<ao^Hsl}SIC_H1jna%ew}8cJb)hK}g)P4RplVtqKqH0Psm@%unFX@92uu4RRooQ(+lF%0`mt8liyIl>YEAI(gJlDW6&O4vmEH!*1 z41}Odo6D7%Grv;{Bwqe;k~28Z@@vTMb$Ijcu$6dwo$$reQ#Ysl8)W$rnz+_s8(lh! z1q{gcRIxY_4MwmTb8rZR5dXyquGR@j#TM3jecf*cP6L(G?rC6GZ*|ocUqK^zncKHP zM8$!Xm34HA8i}1J7F~65c}aCuP|vu3!`LdYn2t&kx#+ZKa6EVVN%4_@`N?wzmg-T* z(?mhm0?0-E60+9mnIPh~=cN@%gD_`!|FDf%c8+byeZ|p{(~qC+x2fW+ zuv$SJ2bmeKnc{kp^Y*Xwc*-V_(SmI5j-NJ2cZBOa)Kn#BD1wx5t)sJ;ozCG?KVvHeIjl{vy80|?U}h27J(zR1OAYwl^!$KomOKR%|RVciN4qspI zc7889YPHxX_iHm1*|zBoyO81TvRQa!*X&S~kixsomK#2urfoHG5B!*^!R-<(Rv{Y=ddNf2wq%-jR!8S6bgC=C z=Bt+d^%6w3GB~aiOJARt>@KUNoN>uVdaty9o7nus!t;SO>R+vBU3VTiEemImbz;`A z8_#U6k;jFsq$7*5|3V{M+m`U;wZ9q-%hSy5E@>wuK*9E71X(Op&XzxE%lwMQJ&+-# zX}9Y~BYDSe>s?)DOiDp}j8}#VtNr$UB@dx#hU(IPm$b6P3^Voy_~yJFL-` z*PasPe(nB~q7sPkUWyUPYV{lVN9gF@_H&Ykq zdr6g#!4eiC_d^Ts{_OnvoCnoOS1#hhRJS8hjK&c-di>2q_h9-bon~8h!&w=1-NuHk zdlAnUk>mU&mwq*Zl|itZ)=bWp{j59>l54` ztKdT)5FcZW`P3FRpz9ypNj%reDiMvsE#r#|-t2)gNDNcc{9>58&@5N&y*aWRrEU<0 zN+a!Y^?$T?RdG=V-(E@yi|$am8(@ILw(xjeW1qdh{KaiptZlJBQ}B7$=`GIBZSCb_PC$dZj~Nya@Ody+4_i!EL$V ze)++^j#_kYoR>tzHQ_ro9ZQ^8PDx0cETvdcJpr}n3e|xoG&cG#Le8bV+5eL3?G95U zg&5U?CvwjVoXoz$_N#4uR~N!z`;Ylca!XU$J-Pm7ihg6iwB_jQXrra42iHiNCCSMQ z{8h~mk3hLRHy#d7Ou6*>jrP_Fs3_g`V7n;{xOqY&_eh-(Hp>-M6S5uQEvmy^W8$(? zn3BZKx$eE*`*A=Qmfxw*v&$<+pPz5BLcVcA-jP|f#sDzkqoOsPoE{#L8FajGxat>X z)&xC$yxn`WHB>xW>{XW9l|6(3$JRgFWH$V^l3CMaT`pyh2~KO)o_~h!ve$0`?191v zyssGqpKi@7O{05;p{rXe)j zWtioZ@CTPRc<%B^{zC9>JWNTZ@@N3pK_7XJ%1WJY(Hqv&NLqI7}~R_CoqC5ltte$ z$iaFOwzt4t^}5FG9gJ42%9cT|A;v_1>E_wf3rmKI1oe!?4+a`NgNXE`mU$27OgsZ> zMEk$lF4$Sx3Yl-PKebj`74}_^`siXkSL!CN)-GD5k}uR#Q}UT5*urVwN42VfU1HmJ zCyXOs_sOrSlau)V7cJeoDc}0&ODK4S^rYl3;OvIRdpsjyb_x#8@qD4Y&`mfbF$l^XBBCaX{G1+*-q^6%y4NtKUn+f z_+ZgjyAjyBFKv1HtP%UIq>k?g@X=g|Mx+$d}`P{b>i+n6O8O=;9y>!IFRT z*j3>}!laZ@24aYL6*Ey5LS08Z_zloJ4M9e+O za@|zxx$@xnu2z~9Y_;@3p1N+41_?`Cx`M4g%$!&Kdk%H8 z9Do*TSzyHq2>Z;e@4h*)X8eXsm9@D3@#bXmM=&p?TY~+n!H1X-L}7$%wXS7E{Atxt zBPTq0k8egVDqf`6!`k;!Gf=rBu^_L;=k#(?7z9o08Yo%@?z z9DRdA1`%mIgcm9w3C4Wu>=Ov`OQSzp`?Fz6Jrof?n=1{N(eb*Do@9jX@HLG?R-GuT}#+yt0RnJ(AmV1XBzu)o#%dMOip%CI-u`Y;jlcLsz6xvx{<3>=b+w z?+3+W>f+ICXEG~GR#qV4arcA5w^lki5u!82YB!sx;nAP~|BFvECCT#3^fZtpD-h0?0v@fwmBo z2q|FnFa6LXrTtJX(-7tgNV0@R(*GMOQ6Ml4K<6YO_b`S)u-*?yQdbISi@|oE{-#Sj zuE!|YIgV>7^hmNi0BDP?`%v*V<6uOAO7L=VgkR~7!~oh7mXjphbosIw1Ps2t&>DV6 zVgqeijkuYRxd=yK@KKs$Y|KdV|6lZGw*Nav=gLu&U0Lp1=J%22Gu*M=pND=9l2-v; z>U84aarF7gL3inlzM8+^Iw-Bd?5%cy97`%5(~YBx%Aj!!WF#?gwC zp#2O5etVS6RB(E2=6kIc4Vs90Iv`heBU_S~p!bptTS5iayqT~!X$lIhX+qAiKs0q3 zO(_zrnlAjqu!=&KX1~QCKW3NuR>XisCfoch&m+`7x{IEXF||$oLWZe7Lm~#-n16&M zhg^SZT1Dzq&%Jiw-4v$*v2vg&H1c*MB*8=+O&0TjT^ zg7({Cz8!qJm3UFbZ(Yanloy%8bNGz~lEbN#A}K0fCI4gf*>5G|WA?;%&06Cg-AGd2 z`&&gyFrWf0PzgCUcysObe37)p{hRslL;od#Qcw7j^mW3noFh>0d*`rmaKZEeKQOHB$0EekH!}qH2b^P;^yx-*Rno1Ct;4UMxK3Zxm95j13w?>BhG`YnGllD!&7sH0m)~D)tWhl%ZjlQ3L zaQFg+UrWbYO3Z#>aKV2xTs0 z*mBQdKy6@nzC$WfyUn3*6h*)QI3olir~4aB4fD#wr^xf)o5(tBGkQu~L~SkTYlh`w zOArnO(`-W{ttT;!$1I#kpL0o9d0cF2j3bo5)p zzMU5J2w~TGHck9BE6g^qH150#6n+wBRz$Lwl!lpILPEC~wP1?kEOgbyn6cswsjzx@ zlaT{fzz!!$JzggO^tm>s+XY(Kki{85c%z;0l@z{?u7~n)+b=6a*>E*1rNY(10Mv~&W|ht2eY%;warpOFtc3RQf5en9OfkZ0{Ni07Yw%oJ#ceFPIlZ> zHCws&sbf4d^-xMeg~IOo*cWO59x(594E&I_qsK4*aGh*uIitgEby(3Rzh`U zj)h~)3EU|ieJoVhstM6D%Gp33#s zhn-P(023=U)@u;SB9a)%I^0emE6NQ3U(pA=gRv{8pV8;}91+S;98-fr>zs+RoN^V< zbb~$Lg>=!=8xH)-&9`VCl3-aY@RZu~q-0}d?IxJINKe+QoGtm|jEj$7+~3vJC1qz< zcItI!g+K!SPPDOCz^$2HGL?}@A=icRibX5+U3V3OR>zL$^fhSovjU**DwX$zC6II? zY&?I|H3lsBFpH{dv12h*y&ipin+=bLRKjFX#Nkg)XX3X_fUhre{ONKq4~qWD>&zom zP0>9}=YnoVCAE63JkJ+E9F)rs6$fR>e2hl2h6MdrlqB|6XsGIVgPBOR-K2kCx^U*} zvA(q`ZI5#?guKyKLlB6-1D*9+H*%0RWU)$chI>pyMn=9TRRnFa`Z{Q->C3>Cd<<2` zgYCw!RL01k`57wGs;XspEfx;IxubH|L%j697TG4N-KiRTiP18>fYkPwpJ-1cjHBI_ ze*JboI{mo2D!)zB;F|O&gB+>FqE#~WvHn(3PTZu0b*rq{f%|?1vQE<(X3{KYDkq$bmvd`gcT||K)28TTMvm|OL`wyq2f5y%ThW9fXl6TUm@k4 z>%PAeeQXq&fS((NeTl(7qwqKTkZRjWqy1%DNI3vu61=lB0V(l0*-}#Wm?w>FGLEc+ zYqO|Fg$oC7PJ-QRN>e6g+y1n9=?esmfbv^8p#@%|XVL-oSQk)N6-zbvU)Ef-I^+WfR1y5E z^Yi}m(ht_{`ucFacblbSiizpZldLUzCk{z?Y$EMoM_a#tZrIn&Z)`-48F-)om*0dC zG6&KT%PQRN4!#e`g)tA;My2vOymx>lG7rE@`p3t|i-QfCFOE_<7l9p`XO;tZ%OcPZ z`khNiOpFo$H#EoP1t*eBhWaW17h!l4>1}?L<9)&8ro2-MwG*@fSu!P=bA(_4OG+Z5 z>H_zO@Q|xJ{wiha!zzS1%;891r+Ef&l{ZVCKd4PC(wEEpWSMlazVhYepk%B zj5NK?41hWj_|YSS^a?hj0C#=HD)RKsd&dGCbQLaMT;!A9(E?#W4cQwXq-L^t0XY8n zJ<9Kq(*OV6{@+Y;Ggw1GwYOZsVmlmQd*8~n8wN9=7kL2#uEUB=hY^YAfMEDBP&WO+!@Hm0`vgG zne7;me!CGTAS?fiZavwxQ}a4ok&?v$lp_l{Hn!|hpv%kE*A|r%`O`m4?j2|~SGCig z%YwMwolaciS0YUENB*LW!(ZIDRMxcRv^W(@Axo> z35h1?=>CFZ%*3YTM9}#Ga~E{;Dhc?gL#2v30_ciAKcMOfl#t@we5&t=O5w~V(wb|m z;16JXMTQ|I*B@9glm$F`1h-=DUkQjgn+W`W`t7(4efmb4zOo)sQ0}`ou_rED(ysOw%qY#}++nt&_Bbltk{-jS3M!PmOjI|2FO%30rv|gz5sX9EBu#pIKgH!)F z&3SlWuTHrAD9FTZHpeV3GCJ_h+E4=pBp06`L~8 zx2}9R5dxU4BH85gjIb-lbybt|Fw;$mLQPBq^1*w&SE6Atqs!pf=-6wdK$bkGSzsyy zIgWJHyUE$V&vBrX5%Vt5~DjtuYvjz3afv1oY;j6>xIW!ugi)9 zm(Kg&7`pIOj<}m?K;Y(sT;mViT#EdO&w{MupoNfRoa5H4EGyV|-f!Z;Q2h7a{jioO z+ai{0k`qMz+*^IJ>H-e11hwGB)vJ=yWFD~_(Jp62wJaW^HQU`&+OxsyXlC4Q`l~DT z)C5DkL6+^~=3HRJ@M(_Zm+ zuuPW;dN;jtt58kZ6|}qb6f^ zpu`xRkJj_K?+>hMBUqdV^nvQ^_792pylXKEQ>c?PzUtQAlKH7o8|7 z#&q16&*nHR(D_;B5P5&9>=49}K)^D!`q@#%zc?63u?CaZbvsbg0ruD2{MqqKf{XTt zA^nGeaq+Q6a;t+M;nUvn`dKqBVNDCdQc4kfc+cy(>GHLCg4cT+1u9TJ6+ z?%s8>R61=n?@xN};%1XgCZ04Uu3PiG?K+s#)#|#O#=e0&heKPg{ipPjKho{ZbULS&v>(qXQWbqXXC3cf-}n-bhUmIfm@Z##4hl-`0+CPLkCN1)r)B* zoUK`cTr&u8Ix?1zh&fstjDr>r1e}t8o~kVdW3;J1uZFCQL`|(Z|H?yO*0tfeZ>bt} z=Wo*)F#>kdRYSdp0cliiZ_IOdYT=!E#zL{kZ&8-rq}#u10N5pFR2wM+=E}%Br>qS4 z#U|n`$pdMSSY`cCJ#ssF3~orKH>f_JX3QwE9kW>9iJI>0TQ(lDLI=-<_cfj zOPwAnH^r&E7^QZ;HQc9|4MZ~}unV;PQ^yWZ)D|^e_+O@2dfWxa+vmxn172 zlQ3RXK$6j_eyFP}{5^Zf*S%l_qSx#9QH)3uBX*qrRv|UGfKD?8cM0tV#0s;a8MOsQs2?7Gj5CQ_45CIOHf-B(o0|Ek4 z+)`BZowTSZ;GLtLnWeQU1jOq&V*>+BY5LdwhK2?P{lj!LFC5*J!onhz415PW1^{s1 zPLZiT4D`T8LqZA&Q6e+rV|g|Ab|8Fa+6x$p_d2n;`lcX`Q&wtnUujvK5B0_4RYzjH zRt9q36NH0=qp%_(G_>)H*is!mB?u!oh&eKGAxX$NC!u|31W)L&Oc+BF$YMl9N4P3G zh&iYMybnTbxcU%tJknBYJ5tt#t$>d0^|Bv$=p{d}ch}cfMLIh30^%pbG0_h)^xtWI zOwCgK`~v|wUj=rw#e|;-mK>T~6b|lPil~Zj8zicX1Pf}A2I==0wJc<0*+zuQAPBe+ zA`&4z@vx#@X69o;bAvbN+OZlR5!@iwxsuk{jmZ(xJ$a#__iCP=1Vh=FE38fBa+?&d&BcOiXTWZj5eh zjCPLZOf1~o+)T`@OsuR7;1Uc@?zYZ`Kn7bU^8bkZrXyzRWb9~Z?`&yj3wWk$Xk_Q& z%uh!4+|ZxD|M)ZoTK;Xx*6CNbz#U|I&S7FsLm z-1C1V@t>IgmkO4%zzaU6KVv5FLgWLQ35gDC>{=N8 z^?ag^y!t~00x=H`(xXc$kY|tLcLAv@nAct74-7&Oe<&3RgUN6dR?Gh;~q1y-{SyRo+g2oWKHy#Ewrg~5%M#TzLJ{@bz77@z*1 zrNHAH!e&MKmoW?Q(0^Y2f%;dpdC2~eG|F=4TE|X_GRcey4BB;r{(x+{ORX_0-#51HeV)rBh_3#R!}AAraD(LW>AKym9}`MB=Kt5U7OYPZROUDRs86B z6h4<*^h#;K$-~vM>t&MZ@Iw^mP2Od`@1a6 z5c0x`Ew2ujb{TE~`0T(~J?~BNfh30X{iS+^-bZfvWgy#I;Df+9n)^eo`XoV;bTkn! zRk2#B!|6=9zPgC0sOi?wT$Sf2apM;&oPl(%awlQ}?K<1Uo`@u=512jqdaX?kAq(Go zUG_Np4_iI+rE)}+^50U@=(PZADwPPhY~vs9(8P+Vbwm@KwuTZ2xvSD0Y{ukwM}&#a zINc7t5JB;p_#D>gxtYs52R?uqLQG7|D4D3VDN468ojQbWgVDoQGeLHCu{3te{R|`% z@*EqqJnJvNhTs2O9w06@Td_)>>(I8Dl%5-W%nWE(FMk?1#iBDk|H(pikUC**vi5CY zToraY05)Rd(DTq~@Or1f|Fl0h25G#5R<-1H6am+ygI4ln;AL4PF`EP`@tdD{eG=7X za+`NYZ68Pj0AKaIcChdSeMD-`XNxq7;*qbvw7;kt+|p@R5KI<)A|zl~nxs*NeF7yi zQCFMGJB=9bYd@8@#WAGUzv-*+cYbKUmff8!B06Zek_XIq-Cv(r=)gVQR@Yd~^wR7W zm$xOZ_>%1IA1&7|%|+XgSK7psT4#~}p5e#nQWzMV4&xs!TCzPai!AP3w|fLerIYA2 z_set|fSq%$c6?V}B$9rOF<0&dElFf*bKZbe&0d%W1)n28gV&UJ z8_}^hJ9uy7S_Zb>j15UAP^CHoz7iij)F3}@Qdd7M*oo#MR>)`ae5EcbrPr?GOM|y8 z@n{EhHM#83nu3zzMg{J=Hu_|0cc=1{`%slC3?QAX2jcTjXN_Ak&orw|6SeIc#YZGF zk`;3$2u={th=XREIEtaNyngJZts=_2l_{&EHYL!+{c{>g{GphSSDcpSegY@$Hkx!1|NGy!VaeVgCOW4Xnh%KF2J3Yecn>TE9& zR3aYwR5tT?t`(r1{rw29N7^xknN=5+To!G4%l&7arTprfBWyzy0`}PLEbsZeZqPO2 z6VJkI3Y%w0_2b+@{SvLZTkCX2D7tpFS=6Y5$=Hjq#S@p|gciQYw$q+%4aZu30UHCY zUmLR&6HL5rkUJ9;J_bgdMcpxdBP{NqPMvd+vh7F)ciz*?3eO$<<&j$*sSl_1tVOT8 z%TN2nAA-H{HcNGKkC|@<=#82TIz=j>knv&&x%W3>tc=G#_sC-5lK7;hz8lpvqhO^r{q~S=n`ROLPiwI;m_VEhc z^_@Q5K*=R%*r3&*$V&d&)OJ1yg@-W@A=Ho|=SW93o^tTo*M@8_1J8&M2hfeW0y24O zuNplBk_zm#HIkUG$^g#lg$6kmeT%$!qWsAZ!YeVGAf~%!h13?+Vl|Fx{H5gzix2nv z9ebfot2WhYP0p6hc4M{(1*>+j~m`)Jy?KA^2~t$`p45^!Go=Okq-AfchKRo_x7+w zpVvVo5$^~$a^>Vv0@|>a7CHsjA~0eo{VLl@AQolA>Rr44P#On_qHneaZ-OrY3Tl94 zg}rdp<_w2E_VQpMRTKjQ$7H@{=WwFZw!nG8*alf4{y(@R!~=*WqubJ-xOm@r{n`p) zPIscTSvHerDY6qkw;JuJ^~m1>s>E-E(|W2Zco=h!w?z!RtvQYxlvaA*eeU%)EKz@e zlN)k;$zRqk&5U&1A4fiBCZXqfz%gD^v>jSf`Q7Rhl=XUVlzi)~#dpB_DhM-UBT{v% z>(%`)!&=f2YBrl`R-XNzvVAKHFwdidEtW3(Dppx#dJZ8kIDNifbpt~+l&cO7U7gZ@ zo!{f+{;y7g3_sm(XJ16rRlM$XSaR52@=0yK+@+(U*x~Y@`JiprI)@h%%xtvefuibM z%f?1gAbVM&91{DwD;PYAEPHW{qM^71*qE5K8ke1nxO=L>)qBM2As2ne+VQ%o7HyC7 zpz(vWvL>BgH+iYkFX?uPX&hEkjgFfpy^*P7L1R|sZTlZnW1}252PKev$tFEP4E!&Z zJ`N)<*UyX=qdc{$b=*^19g1`y0S9A)`Ml7 zQ1}Ptj%HQgGK<}hA9hO{=cqy8ou~iWw->K-Oa2G{C5@Ob{8%#o{X3?cc!`Z94>??r|H0K!KuP*_n7r;RYdyy9?ysbty_9%i{)0ITCo@wBW``Kef(64)uwc7 ztD|baFK(65(aaw*rZ4uFm#zYoZ?kI zPS(WdN(3=r{QWDHk9}^~hRBf7RxCw6QpzM9Cl75qMDp`GZAIQx9?7P9NxHFM?@tyf zZ{ZuCRos*Sh~ZB}f2KHmAQ4xfl_{#DR`t~Ujrw$GV3g#7bZPu%|ELL&m{O=vW9v!- ziqN1x`UUs|3wzcl;4q2*C?x>@4Qe5br29xs=)V~98$bvH8yXSq4<3vaI(_*GLB^-I z#Q!fsH9`j?RR19OKUiD}aD(_Rh*Hpa`VR;bf?`2<7t|xv1^q`(6tVYU&>El3V)YLb zxZors!0PW~ADkoQ1NF*qU^Io}A108&Ni4C)|0q!uf{@`A8|Fj!|1bduPQsM}{?-t{ zIq}&L;u@!HW+;D|Ko0~bAyfQ?i$YKX&zjW@UNzirrQrWuaS8QOT6HC~WB)sl6zEYx zA)xnT(Rp1XCoictHwKhh-jBqR2EL-vd3PMmZa$I`*A@I?aLl;R<*vkJ027;BA)0WG zQn@!0jG+a<__^L>IG$1~4H_OT{S2&3gu5=bI-UP?;3mN!)vPvSxp+mJqJO!+#N_U{ z9iQ75BNJ^sM`1ofNEPA6-|?a5=4>-gHkEZ?*&F_xKi6cEvk~QvySDUjuWB2Ogqtdv zNjLuf=4@VckTZsWX?titoMe(D0)hIofN( z!jK$){2-+%obf*C66f~XD161B)PEi*7icx~#mg~J8sfq5Z1rKW@yzk(F~&qaDJikJ zwT`Jy6L4UIMg!2kY6)8K{qbovgG<5o!=9EkUPFO(YaQW4j27JO;(Ra?&c;U3#Ftha zCcTgJhKBJ9cT)>qx}$T|+n*h(uMh{Bui}?|=c>$H!l7a!Jfa$AplC)1a2pLl^;f)y zt6@kOPQuy3nT=DTR{EzEMVv63?s{j*H>OpG8y*D z)%C&p+vVIq7K2sBgVEiqgKsMo_5RJ}?UIM=i&W1G(hf=(BYLsXD(0s91ANE>nxez; zcSHXUzf2x)Et2Kc@%xar|gGE z$Quy}Cas)veZIM}uz*?nbI~(QcS5)zy{H<}v0&Dnws-f8wXv z=2-fXL0O4kB-Nz5x3t%4szloRO!EGd005xUf&v8vMc4eIj<329ixO4<6w@Kn=aBf!#p6YrV7b&v{uTNJTJ0%x0C_bv^Zpo zdgR2%hj-v*Pq^h13{UOb)>0)Y&OGR6j)5)ZUbl3)q$?2JS-p=vg2Mznl=0FN8;@izAgXLDYY!fv|l!(3Rm+I|8VY$dPwbncF@sjQDf{zw$ z_$*NNrdW}acD7+2G>VM&XE4^go{uYlE~b%W zF^{fe$y(Q_udH^Rm~+H!Ad^7zBEyIIEz%F6^u*{ubPs|cIAQ^1^P#vc+SzdI4=>7R zYe;YVhLZ1aT@-Jzi^_siTc+#z;4^=0_H4)j39;lyo2|Hkmk(cf5-s(c|-?zUl&?Sl@}^5*)hwvHc2(Hwh-qEgt{Gv0`HF9qPI zTlhWS_(&Z!8+kBPe5>e7#y>}VM7_RUGocOhqWN;QrS~v?xzd&Y2$A>0kf{)kTnV2E)n>!Qc6zPxt z^5HxuvBQOi1bb0$!>u~r@baOPzVX7-=$;5Y;eDjfd01r}RmVfneBvME|+du>LIvLKM1XJcLW-}Uu7NXY8B$@N{oO8i+P z?XCY=7}4J^Mv)8d~ z_-MTi-3r*oInL>?aur00%_I_sSXpAvpZ94M&B^*RX`9>$2ZCUmDX`$m=Myj+Eyx96 z*#f#)zEXvQOCnJl#UyqFUiV%?NVtQ?*)4Nck_4={M;k%~U*)|ZRET^yJ5oWhw28m8 z(Jq946BANU-*1LesyFpT+$db`-Ev+V(^%Mb#Y%&FF`{p`(^T7m4Wz!P(e28LIW^d1 z%tYH(mH-{qZ zj=@n*_=8-9;=$lq1~ZaA=r6f7NihEOX-WB~h4>&aN{u%#A^iuq3WDjMtoKa*O^T&> z2GlU*NdFjyub<7wBuroacY^;9(E3x5f`L8-t|r1iKtBdd{~pM~@i&PA5e%OxI{QWb zLDW8A`fGg=MgJJRrNLdIM3lf5`D>RwAqQ&>f_k!Yf0Lv|z+IANu0sC@Qj>t`U!NGg z|C{uGjL3Ax$o9MPL8p7Z%_c+RtGVqu zd~@Y4-EGRJHy>@Pwr3kn$|JCT%_*S@jQ*5)lrGWs&Ss|!vwM3tIZJKs_G&vW;s=}B zNPU-%{kr0KeYj;+<&dEjhO4Klal-Tq9b-!^#&Wr=!YiWC(LvR0Mt0MEK?gm(9W7GD zO}&5@WZf2Z))13e<7~IsipYV2i3M*~{Y%;vjEJlLlI`>__+O?;9;jC(N8T2P z-d9;C^+)BcWv%8uCwj-av8d70kt=mTrr#<{ohD%m~n+r~{m zgk+uqZExkXS^@4=rl;vE>UwT#4I|AH9(H$wo|@&^iE+I6I0;^J zYzrnMcQ+A_qSgL2!`MO0tU+fDefS74u0B|;k3;GNOP1?ANAi2i(F$!s<9ZE+nd{w9 z1AF8IX#a7V2Mr}m-PLhlytA;`N}Pz|!?)O;(X?c)jy!F@kt?c}>ZF`)Np>N#9e)ry z(myld*1tk`HPGZ;kgwEfJzlFu>aNrijOFT(k2qs*62--*M-oJqy{97o17+UxK4WpB zq~X;75tY8&f}x1zRJcj9{!uY`t<0A5{B?JR{msToY1L|nB~1cTgqMetYU6t7=GOgL zCTIYpE{SH>w0E~wx6A4{K%CmJ6}tgSQq-HewX;%@J-l~ll-2T-3b$N}si9#Qb$-2v zzzTf1f?u!LTQ*Bg=awB$#?2;k_Z4=dbdOe=rj+FJ$B#r-=T2gpOu^!omE722x^A%hcTD0ujc`P>O>?dU4 z^8AACUZF~J^CN^dx-hHxCai_oF>`3aV+hEwa-b&-H-wxlw>uT^Ci~vmctYSP*f@GRx!Zo#(Juak z>{*eO(P}S!E4N6to^+HP%u|PYV5h?v9N0WPR`D@FDfD)$Zg8S(QL_h$_JnDK2 zU1mof&uN>JGx9*K%6^08E?*8Sz8%I1gSA2zA#gsv8Yk)-3gnJu$5Fk}Ty@yJ7gwHK zoxs?d{nXf;;q<1`?1;wlX~%2sQJB{s-e&eQKP^ygVOLJu!>f66PS9amIm=0iYw^NR zHmQ_g=HZ&eD(ZFcryx@61@m(cOBK#~yl$8{k3KYz$#uN<7M~vT$ou1fCE5+t{&96} zsZ||AN3p);9G#l05J(xA<=42o4Z5(zU1hazH=M_%DI6ED6EyTIeAhCz@!`IPp60Af z&nkZz@>L^xb)S9dOm11UHn=2-cHcBugmX|Q8$+v|!fO*#jsvQcQY);^zBH7^`WRDB zM~?e_rECSNfIciw(kJG9U))5SXdnWw>!Wo}H_pxCK|M~u2dD!V*-xfH>pvbN!|MYF zFKw{Ae(Z4O@#DH@3$R&7g^arK6pTFz)|_-pi7-Rh;e$`^`{srspmr(RC2pD8D6ZJEUJ(QtSr4tt$#eMq3pc z|E2~{T!>ajPujkuzW|hs#YQ^|UWiV!_LeAht7`vVS%U2ODf*TAQ6fiJ%tlHGC`HDnf;ruW5k6p|b9>z8J z#Vyo%FSIlX%GSn`4|W%(foJxp%Yc2s<+6`2Dqlkeo;c-_e5G4i)>}d_&uiUme!cp^ z8<)?t+=anzcO;Wx(&_uC)wFERX#{F~{Y-#K;M0PQk}s=e1bJ-J4*yw<$FP=an5R;2 z-^=?Pb#POQjgZ){ky_UHi=`L%qS#+mFAqqd_!$3s}*aS zT;ek7=9sL6f!&^=OiGn33+=bjzRQXNVduLdg%7P=Y>nTx)_MPjBZO`#(N**Ztgt~e z2*V63E+PV%EyF{uHKf_p?8xVbg6T#FMT5co&=+wCIW#~uEtP(1Iz2lYaq{4ImqUul z`%EY>>4M$ewNEx2vagRDqVYT}!us}V*N^dDh6MD%zzLt*ZggMOyr}ntD?L^>saeO3 z34Y?5W?BO(^QbccuDFAIsi8U|+M}>g~R) zITLti{z;Agqwa3v2m==T(2MTKclvNlS{55Z?2+Z&0@kPVf%2#3JV^<*wMgj?A9foF zYpvTc{NN|8HtGa)2L~c_X&caPmLzZ+3PKD|R`ft+xmlcyv%45A{d_g*x@`WR%uX_t zsz%w{H&=toy*SRZ=q`-Ty%2D&c69XA4tR>zZc|FsrqSmsbmKsl8_ID>{Pb_7uqPdC za0OGS)BA7Tw2;cYEw3GPw@jKNC+D)KIf>qwa^1-P4`9WPAd1n%10enFC!TzCY0fTI zuTny`3=m|N^NlOlFb#W7gAiL3ys2$Dvf@d$_A&26m!>}z-hU$gA~c?Y?4$Sf)xc_G z4{iDS@M4{Gx5+d*W6g9$q&fDdrI>?Ov5g>@E3rTko?aw4j39VHv6Na$e6w0Ja{?oh z1q6R#_J;2FZ{Q)}oMIH3UL{A2Y=n7eem2f55x&;6QsFGeFr3wIW1~g6#K=OPeE%v2 zbJAivE|Xd%$YU`~dy)+y&~1`22Qn_IQr(tw*=5cPm)hcN)#rGGOR_J0>HGk*-O&EX zap}(B;ip}3#@&c_^lvl!4=Qw(RVnuUX$kSn*y%SYwVk$K)x{j)-bBMKQwN0zG**V| z=oiE)Paomic6+E)fV&!W;zd&o;?dCl1l?Q8u!yZ2IlC@>qSvbNQA2ZE%g9hJuK<}; zCu}ya?kf*z=REC&j+S^ z{Xe}lJcd}Br~%eUkiEhSGkoW@RBtX#P2{E9Xz$9VZ1bI;BeMjz{G}8=wJ0AK`tG*| znpqN&FE(6(XAUh68%_G0aw5y3=+##oHC4}8`wZ(<|9WS>E(F?hYn39k#F+9GN(=~K= z3l>3$zM1kK+S>eY^+O=S=)S?!Jq0$8vobsW;1-cTv{$#*Rg>&9H2eTJ%c0M}DZ^p# zu@}*xio;Nl(hEu{3SxVt}(Y@AwePn~Krm+TnHJnX%nVv8G!{N-7Lr1S4mG&Ov z^bnJ~5oTwvjbkAw=3)5oLX|4!7gQsGDmp|w!=foJ%YsKh3QI0<=BKwqa)1k$M5|U+ zI-1F&CK#OJc#+~DpynssKRlM*)0w8}pXV^My(Dntoz5w0l3rG-JUjGCjDVT$6r0E( zhEp>_*38Yg<&JhGvrn&iIIL1G!I>K&NRPCs#Lx(0TE6(J@vMPud6e9`PyO~m^W7pf zmudv(o&AZcLSgL@O5&zzW+md75lV^g_w0{d^JdIPm-EhtZl1#q`L)|1tbQt|JN880 z8dM4tf0>|xc?f`+86SozOt)$EBo5WgqZPUxPj!lExTLPc6n73ctkf5sS9 zqHQrZf$}>Xh)BnF!Z~JVNCyZ-s)e@ah(|){kM24HviVQ1tPuuuo7UDi(2SKssn=e7 zw`4=@N9~Hv5}}A?Uv^)ce^S7K)-AX4*qnqspV`yk#1;9(PmW{ta9j6&Tn2|&jgcbPO5XqY`x6>C3FTN~ZXEoL(-L&b++BHghr}Ow$(Y zo2L2|S|X(nGhTuqQ)=6?U4SLuU#wgU6_Af4!L+o8{J301*JIq{t<{BSVCvnx0pFq$ zq0B3an6nYjxVahqWAY%VIkm!bU?I7;O>@d2k1KW*i}s zf0s#Sxl#0O?O0%zKj43$A=5WhJ*rv!WiRjt>+l#!vga%j_ARI%1#>@_q(wV)H|aK3 z!EEw{nUKZa_he0~-WBW|aoJ8wLnk`t=rPwtoKpE7{Bgr!KHCf&?o)m{p23?8rWoKo zk8VH}+snU7eXNkkv%VgLfA)`6g6!E@hY6_u$13svp%hFaLbLNu{7`DWli!|_vxJuG4O*_c5ZjeX8MP8E9PM}t z{(7q`J-p*?18#>kllY{);tFvYwfW9KwU&c1V*p?0Uq^jP5^9t3lcV?9%)Ym zR?;*>I)(e3Wo-wOppUX|5YH}r=k{KAo9pmeLtI7c_Mpu#$|E2ak(&Q)+vP`6VRbO z9k~|0D~sfw_U!-+By+_qx=y&5J^id)A3p;5SGg>p7Acm->n!ci(rA7z9Zh9Y&$+A3 zld}f*13UyJ9=V01Nd#?AUH8V95wuj+%&?NU6DG^Gl{H;hw;75Lmv}%eHxVWamzhch zt}Z+CMVVlilJO9bmC6c4r; zut-KeYP%lHQ5#H@xv(`#%yr%`F;#A!F#7IY+V2Sdz;WN(ETHhbw06AiSF|~knyYeY ze)T$5f4)%a>?#<-aOku63s6?;oyk-hijv4t5&TiB?iPa%*@W3pBG^~x=(6oPo@c15 z%)l1`IzKzMKGHMu1^Z7}b;@nZJyr*k8A`8AwTmzZXzE-WK$QpWdv(ODTjkP@8$T5- zbM*~)>Z~Z|s!Ta93~)PNw_ag0YBHLSW+jZ=HZJ5`c?@9o)Qq?;OZ|$sMVAIxbj2ae zb)<1wehT>77SetnihLs3epIlMa$;PX&c#Zc+TN>>MB*FuLj7>T_Z=JxF)4SIc_Klx zzRlnvP?e6n;w?54?Na#;;O2CbrEiG|U0r#K9Nqyco!7ULkPj#YUJSOEqZ!=A3v}nJ z8vXn0n=x_g6zs-@HB<1{;Zu8?AUj{j5n&CV%c&Sl>?BPdHwy-MG@>M~mAl1{AH-($ zTb%RnIefzP-1rCL*qR%o<+SU#O&hqZZyTQ&rr`}`xJ%Jm(F7mV+8z(p$v3{Lms%5t z(an@_%`xh=ye9EFtsP2h7E0s%NSXsBM`AdTIOADgq2SboJ>1ETs!y8`#k>$IF_VB~0!N#IjDv)O<+bf9k zK3n^m6R1bYPuTPvs|PLaj?(a^uyGKm)2_wLo>$#W!$5|x>G!I%MHV-GL1=NkGY^>R z#M*V

    KK~0zI)Ww>-0VaQrg|%W_|w#D6J&h*E^kj`NL9cJeq-ueD(W2a+b@=y~c> z$!0Jzq;q_frNwW*c~sxN?PTV2WX=l}|O!v?!B^^ZASvVr-#0hDbUuEp8 zds^@pRq0QRPn-JM|FiOGFt4aumK%t7efAEoAiF(ns`#h3Vz<|au5CP#nEyhje`E_u zJQXNi4%MVOMTPm*e^QN*FauoQMrr3c_BgWOR~b!dtykV`v?fP!K_Z41g(7CL042Lv z%{krixeCc+&YM63F%Rvk`vAhZDoyh32G3l@zjtH(x?P8=zs?bKU)*os0?;#cql72pJ5lLq`S4X%F)HwG0GCrJ0jXr)dt(1iKw8c9LWgs;d(i!-q=%Uv#sQQJl& z>yWjs2p-iHyiE;1pfXY2B0i+Xy6X7qnvrtb;QBIHn7TydZ@@B)Qu(A+tW*>*x9Il6?<43CF@4^tZ5g_hyzDV7 z3L36qy{QyJly`TkXiGhalrO?_t(SP_ja)CkYK|A4`4_U=e2>I%R+nDBxi)g0ADaPE z;WkvpBB!%(pGMJLA8lrF*(U035AXv#;UCsV2b*rEE?rWUh*>g~&sNi-#V>1{Bk^|= zyBgJ(Z>8E{CgXT&-%GVNaSX8##@O-VPnK@J(w9qJl|e)%1>(XK*M?&a^5ociM*g}2 zz=8-9jF8Sb@zNuR8tJL@q24}q(f6v91&*Uz6uKMWV+D(}p)4G)&}u;J5U_qs_-zKz zvb&Q~*u#TO&u$!sK~qacVnL@?#<5x_H4)yEcO5;m>I2aIUw zN?nF75*5iU1JS(kCqT$HQ>$F%tigB!Z?@}%(LN|A>(~}V4i}Qvgp4~4fpRkwL?9dI9=?)!ix)dCDHK+7=+S|IH` ze(EtNNqkGIvdhY4o8z$Z?(3dNpc3f_OzPpB{P;~^f(y%ZDq9I)npUV5G z5?bF!{xM`eTNS}w?e^jIJtFAj6Ti`HrgB8XIre53^o9$eIpcu~Jw<*&gp00-&`>61 zD^tTr%oY*ETA5^iIXPLKfpXp{oZ>3*z*d2h^<;+<>|G;dD;s zmsDBqCq${tmQDH?TO%ad2WQ)(R#Nw2AsM{sPa2*_Q}qIBXh$#DI?0OW73JaYyRpA+ zH_Oi{h*l$7T|7SYzdX5gL(=)fvRPq0wql-lT$(oMz3$v&7ZX`F0m_{kSs%-x; z$PO+QUiNU2+w^-m`9?=)_vub(Ik$0_wdUc~{Vs!ct7~rbou(bJmn(fNFNz2^bEI$= zgfngz3xcAEO5*E7yaW^ZZzqnbds`AMQQsj~@XH;0!VqOc8`RG9zIaVFmt-z&aUvAwIW!B?EB3ueB^+ zRNmVo@qRq*y?TR<(c9#Kw(J`k%|M@@z`*xX<^|Skfb<+{ zkP^#+>(ArLDzgK)Opc71$Zh9(9548t$nOQjtqOOa3-4b2@A?iv_a#`MAr;6X)VPa> zHa6OvoYhl+@x>6q`*Oagpw!^7)KF&ng5yQy)}fk*Sw6$1DbLH!K7Ej6HcBk@MUI~X z_j1Uk%7kW6N|af0z8^L67BRtk=ID$79|rJy_kus3$!h}WuL;_I!6wH+>=627e1%La`RS}Ai3)%hI_X=>s^B8*K$Ie=Kb|g>UK{_vCL6&kO_&uw|;G*dRK1-ZwnH7wU3uSH|Xgo|XUx zjQ&q(t047LSVKNc#?CU$S3he3e95Bb;Wr+Buv!vc<2g|p+q5x^$+1c<9`$IX+L2t{ zKTf~l6Ym!!^5Zr!(CpbKN7&G>?Oo;>ScWRJUCZnF7S&fDrnwRC>wkBU!Icafc-4ly z-odETV8Lh8HnN@qUSd+jzNV{hlI%K?KWylI!+L-r4bNBiT5^*fLzVUG|GKPrhX=DK zndKpF`+ct7wU@CsdM?(^S_c^Y?5iAq`Cn86Cm#hO3$Fkzsr$=#cr+oPmeRz&C@amp zpZ~)$6!IpODbb;8SNiE`I!P)eHF}dk3EJbB?}HUzgezwWZ>uK(^y32}b6z#{;F5bw zed|%O&?zu^bvg9)TSQSoL)p)QGS;Go!~g1Fq@DE z8yi=3J2Uzd5D*Xy4kV~JhgtY@Pb;3nGDC{{}mVb%DQw9ss)F zFa;U)rQrz5-=V(<*kBGi$6s2*|K>`li44qpSyMXB@Az;Ebb2rc0r}LksQ(=*m;irg zaWI>@E?i7We~4>s37{&mz{7hn@zj6dh~yYSAYXCkdm?tc>mjEpJxXam`&%Y zr524p#0|iq6WH|povwe(C;ul3>N)0s+ly8NzlFDt9UK6bzY#pL`I%#9z8rhtt1flE z(&|2Ij$60IHfGhtZSE7reZQuqDoZwUQ@xr>sY zI}a1UNa#M{N9lOjmG9RG^LZFb+L#WR!UkYz?SA>-$j5F1*o2RVbLmTDEIX@v@c)Qq zf$x_3Uo0$mqMg45Oz|5o|5(NH^x5FKxlek(T#(@n>{0+p^)Oa<4Y~c;%_$IMT@VZaH0RImPtOWO!LwiO(&iraWF>puIG01K|w7!sHL2&p0D2@#$Pi2{Y{O&93 zmLO(MnPg}Q>rNm4vXCB8b!QC+*k3MOcoj(SRZ0p@!NG}(Bo60ewdtAd)mv5rvj%G= z1;cLEM$^-YD7h}7SpYaBtZOsDw|+1Lx*$LDvh!|6{Zi$d`tQ{PnGM6Lqju&_6%4*z z=%5!aAjlzMqn!1gqLgkkVX%BCb~tnd*RbXxur6TwlCVJ~glP_k94!d+%ljNqVI1hT z)nA0LqE~xM8?x0tNk4u19vj41on`kvXx2MWt)Ge3v4z1c>78(MiH1`)N#WXF4r%dH zXoiiaH&^kt-DK6n7EnS}3a3R!*{Q}StcAaCM0zgyOW&KANG4ZWYP;ev$C*%9B3{q2 zA~b^RWfgH^J9P=peO}7i<+Oup`n+OYz5;rmeD@CP5T<4FdK8`L5`p2m(QRqsUw13~ zo!(gS(tC0Qcx8W@{KRLOA=?zkpD{r9O2-B&#nM*YwK0mm8%$8w*fxgs8xyW;@*2$2KNLyF4TTAYK1Wl75_2g+Jw9)M~_^eQ@=ZA8azT; zwuS27_EDP(l1i3cL|#}TOfC2{G$*C9BgRnt{w)C5`4TTZnz6nK`Js)VRxcOWor%Vl zRGKFH1s2WLySzrdjD>tXRy)spE7+a6!jv1kxqY5p8W2u;ng~oBi4R{3Xf2hZU1oEfU)_<#037Sx2cnHf zY?qW2t6x|0yF3_@OQDZ1IR1!~RxdK(B=4wDrdLQY@cPIr)(G_csNu0*E+;?d+C6=B zaKN##b(D;UHm<)L)$NPRXZ+HGi`8_252#rs*FlvoEV~O>qdJyb$oy;w$)ZqYqX(0}M6O1**^Rmkv+2^4yAKJze#1<(l_I(lwcymoc6uI60oGIjB;H#V&Es9Bn9lJk)=z1f-*5BTSdTMvusdGV=84u|; z`O%aIvSa?xIEy)Zsn1h6`3mVk6u}|iBe%(?QHuD+JIYItZZVT@+GglokVSw?sp7lk zpK4=4YUXy)r)xc0elr79n|zV>xH18eQ<^#TKJ}Ayss`4~q>$ChhAEae;QN$Sz&i)` zz49oQ!S&zx2;l!3N_YoR^ek=nP5J+Po-J?{`r6GE?33TuMX+R_N_cQ>2w!$t9*HwX z`DywE;sD`3qrK}4d}=F6Pg1WJlh^zTwUg<~34(w58LpK4;Rx+j;wfx3lA2%WcTa^; z-&~RPZ;geip>7-u7`ZtoSKPzA-0W{-lq0Rp3KmB|=N@$k0j-Bc|xb-$VVI9H0<?xy53Sf_3Ce2l7#S)XGK?XNK>0J+ri zZO(nCG(#fe(-a3Oqfj{MSRv58?Od9H7*ItG&lO>Hdv>KkDn3CcdF@ds})B)*32kVW*B^)6fV~<`9 zZJKUFOG)6~JmlKQfIuFZu4Z&1U-b9zt^VBwmAo^VpX8ACk$o@=Do|-hOOSGI*&<;< znGDJ$me$LeJOmhfk*4AKExKt`o*IQ4W312|HIM;x`Wv{_LTBy;ydFGVgy9NH%cce> zwWh0mrcWnlr}pXN5+;YLcA1%RAM!;)1aa922@wcBLi;%U6h5MI$o_?L$BF#u^n&u6 ziDd$idIxW>ey&wB11Is5hv_t44l%m;U-VS8z()On#5d1wK$3+|jEytpbenyREI95x zZ|bhjw=>sXB*0ztR66{EN%pW{T-*%BL(`ZRrcaR)LdkZ1MNEe^LaJefvKRb2nBo8B zYMs#Jc^7WMzc=ut0FBQr<7g)R!SF&*mCqLlVNn(SK)zTZ$7g+jv5G$VH^+W3M$gzA zi7<=o?+Vy>RtR)VG#P&{dGIfahyV)z_uCRCBQ4@p#s%A<^-BlK;7d#N`gmS~sQlnd z6Wq?%h0R66_1+slS-P>j9_B8InoWAXx@?_;ua1~@papJz`;hP$U(mb`zFm}j%as*U4J1DXlqTVyDUt6-#6~u;L=c0VPb?1*mG9fM4<> z3Hb)W>bWd(bCPVx65V&z(cnup5UKgp!<9aIp3J15WCxF$6qR0g%SS>FUvIl$*r3;7 zKW3NkWi*XCFf^KVo6ByF(P^70j{gqzS}uE8o{-x^$7~NLNY#onuU;m`p;h_@@AkG? z-(-EOaC9`_|6=d0;^OGGxXs`YJh($3cyI~sPUG$p+}&M+CqQs_cXtm?aCaJar;)F7 z&MRkTZsvaGs`}U6Ra?DvX25>LU%Q-QfyDrRgkpWpd) z3|FN|qICPSPO<;<#ckNv+>W?}tei*MR?CHQO03Z&_7~6vl$$i;?V>3XGGOl2bnj2A ziTeN@2&C~knzhhu@yuBDm2t!4xMED0)AhyZJjtF;d9k_^5Ih0bSV9QAjuTF`xV!dgl#dz(F#tN zct;cIwCnhy@t^F+9MW?mSZw3g!|62f^>!;C)xLjG?h=wuW)q1a^!0rGMXAdc;I-Ipw?@qH0{8sUuH!l3 z>tyD5FlD4g8!9n3?WkHg$5^YgHQijPit|-Z+U3GSNnmSFy>6K)iwdabT${02xbX*jczt-Wk3)%HVdsOIx_`)5sr(kp!-f9yYFuNM|Kn7 zqH7J7hP9rrFpgk$P$eCjJuR(wqW-m%(@%n}U$4zUkN<2}?go zLuZz+@gP@&?fNh8$U%~x{}<5H06L0m%QK)kwUn5P*WVD_dw&MOp&mB9?U}xfrPK{# z_zN`7zv6Pq3A2VuYx`W3Yjo&!KHpJ!jlhpic0MWg_Oi(Aqg1H=BK*Jb&R6uT+yz~E z$K5g8N+_ejBr=M-zDYmHfak~Er(Qq}Dcdeg*hDYlUJWIi zi@h`%lpx3h$Kz$V>#Zz^4eEdl_S2hNu~v=7zg$mN$;k(!l5BW-RY^IL*1S-E{jq5x z;_z*auW9Xjk@%P#o#ZaKYYhFmCAo0=ibovthf!Jk2)y#D(5lng5pM?EF$>S`jr{y6 zj(k+SnaS9ZyuY!4*u2A$3XvPynL+V<|?p4)4+;x?RF71{c3ENs&W z9-hBnnaD_uTdID&S@csSonW!JWKlRzad=v)((H)%sodus(6{lUPr^HPCJNmAFbP}G z)dh@s4_15xI0MnM?7%-S3f*s1f%zeEMYM=SloS73F|2-}0&FLt@E23{fNzF)2XJ5* zC%8-*$E?9%w>;J|NB})4171LnL1Cfxj9`rpn15_1bpPUewLYqpE$Hh+yrH&*7gY3- z-pSOdyoNuS}7cl~!b;$!li zxpZuyIaXYk^geNlFpwhhvXEW-IV`6&LpE7UsdUgFE7TlCto%ukbT) z@j+@PI%)G3$4ka^&p+(I%FgeD4cf&YAPRqga0~qp5Uo2shcP;jPRjg&gvTOjTyfo! zv=N`UjOt>w5O?_|7g>HSRlyoxa((LtO5wj!&#c;UTk{R7w_IOL4;=a&#~(`Fz87jG zOYDx{WW7el$PX$;FvDU{nF<$jr~U2gj{1GxQ!=$|(GOVQ7M&b+UsDolutnAmwzC)V zhPVDvVe*=aaCB>nk4HFjKw9+`>G=K!2G9Lu)E4i=dnk)IXHd$w7ji;6_1bSR19Ua7 z0N3y2Fc$b)EUr0*^K;DY1^qaS)s^qcrdWN>cUTh?yZm|W?c{H9=UMIvk3y%k8%#6U zW*D*OS6?EHACOQ8*=EBz+_=-$J9kE5JL$XSGWb6`y=v#@R^+9toO3-PW|7~JAZ3N! z^S_Q*gFL^18x@_r^$XIZrDQ1DjJ#&uSLP*FlM(7JWRS8}nFJEC@2Z4>MHPfTE@^ee z%gZ_Da4LIbdx=jp**o3YG`QFu^A|5z2syBunq=GGtatYh>wQ$qVwFI-MoX^j9ZP~= zskTT%7>;^&YM)_s4gDw_3$6v0q2nXYod^7@?O29(W%mOE|BDW{b^4di2R%7+bJ+EG zqa*OTmab^$v(;*Kj4}Wm*E!BnNfjH~vRUx!1GcHK1czdAX#7c&4`H9khmX@*pRh8| zuJ69AZfiCgh~PR z3Bs6nA_NyO5Ff4M?`p6N&p4o`<=h!}TB)|ai9Kx>1~op2BB&S`Mlfl(=eTE zQcR!Be%rP})4R1)Px^}_<7KJHh!COCf?4t$vw2y8GHCvH#CQU;w0HB0^XsZdJcEd2 zsJTsuIoz2ngwJF)mFgE z!CDeqFo&4P9NpLL1kFLGr<1GkTtiJXnT{1x{;$;a0r&&@>!MGaX@a>$`Ine$U&4(CUaJ?B zx&VC3lCu=;s~vy!`^Ne-2Mpd;6z4c zrJ)OJHl!1%;f_xHUSe~M!N)}i&}M_&J@YRCGBw2x@oQBkW5OgK1NvECnW#^Vu^q>u zW{8byR6^Zea6Eqey}^uCGYCZUOgRQ88}YmO?^%(inzn4c_^0msS%iFp54L>9OI~35 zv}_Hmt3FLNHqXE~%J(|Kx4l(rkMZ3a#GSg2KY_b}`qdXVxVD!}d5kb_4 zNTvW-wNbqkJk1n`4>|HWlx^_b1C~CJi~1=PycxTaw1LFJirQqoVmqkOeg%|pRO`YT zGJTxW2D<=>6IIpfk@OPFC%Qf1A3X+=SqBOAF$IfOqe3X>HdBq6{KdT~>$!yCXpLbp zP5n9^JoQ;Y^k8eRJdPSFZm)Opc$kHhj%RXv)|sE?@x+|r#_L|Un(3QM3loP`DQ*pRLe&9R1uUF}SE+O|6OAW9w+LqF znhAJH#tZiXg6CtlQ`fLMCQ4-bp9eu5x@o4J5$_K)j8Ybl-$eU1;XSr|UvA0*1os&()K!#w;#!A#w*ogWu2)NArRNBox<9Pb$BN0vrz;7J(nTs>q%A4$n3bisgqq-nFtQ4P=BNh*45Q*t={Ee9c z=kJ9-il|Hq+-7?hvPzxu1s(gomV^=7(O&KS#>+#qLi-ND|KzRUY?MOUZhC&{MxNv- zm?AH5DOmq{*EuhE2cA*RTXrZPt2a1}jtBTa4-bNG>0Cm{7JOr}-EBgC5xN}8ee-#*qHLi!A8aLGz{ zk7-9y_3u~Y$SE}6Po$-PWI6=q$#=1jE^d zEZy-sY5>KVNzavx-O`myiV)MgEt55(3mSH9#H^$6H5YLn&Bp{4K zICzsR3)98Oo^Reb&}*d%>80W(irgZs>#p_4*tw}nfS0%!Ywz8- zlit1T1W(k~h1n9n!#~(y1lueig7@W|PY!cu!@77uU++(pe)AQ4ek&Dy%`c`w8Zy(N zB?<~V;VVJ-f%`2?Z9e#wLDNG1j10WAEmR*Rc&4bVzTBT0PdTQyBc_cM*r0w{j(R9m z;&Pr)h!upI;Jccx*3G5i1ac3%m;A3rFri(?QU{mda?m>jzP*ltSiiyzfn?6lzlh2R zL*t54%rCr09;a?PnkH{1ZVS~Q%Fx01Gbw%hT-D{|;PVr*CH5sz2m%<(9UI@B2-u9c z57u3Jn2|ev%VZjeatjKB*zvYJw!G0;2InDa24vRDcIaS3)uq=`FY@t7`WHonn4^uM zM_Lvv>cY2AY0-;AU#59%TPF6If_5#TM*r~jfZ#tG2Gm@@YpHkZ2<{Z-iqQYP?Yo2H zcas*d4QE&i4AHp`YpwrbJRdGZNavD@FJ>5s|3^xI4FLWhz>SgdKkgL&@dMESM-#wU zO;+pvWk3{!v`7WR_S7>yJ;J}ubb{633?R;D8n*ol+u6Xdoo%h7{mb7;1{iz-8~n=o z`dt693+7vZeF7|6y*&Q5P6|TyNP}~r;T3xNk6BQ1=8so`^ZnKKKMxN~{Nt5yhqNO0 zkJCdTIGY8BXL|$xJRF+tk5|GeUSs6nHb+vxAF;EUwb96bbV%XV{&*!Uvs&Z)Q8ld{mR*0VtkuBXBkph*Kbi%y0p*UObUiMk6Q+(>vh)MlX{T;ZEQh;3gOiP*k|8Y z{B($;4^lgdpx@rKYV==~dsNxnlC621wOk3g=)&YOV}Ejdaz)8#H8>L2m6#NzC?2sC zb4vEc6Je1YZr8+6fo1)tZR8{W(Z2EqbN(*?soz1w`;o$6JZaa&AAJjs4A&wd9d zTQ5!#%n#TQQk?@EeiRR?%a(IGeJ~#1J1{%lJJ=`67hR|4zaDUzQg3nC+w%CQX>5{% z1q!P9XlqI94P0b)6FNCnI98fC85lUd>oj7rT1bl~blHYh88H?J6U@S@*w<@?xmYX~ zYa>?I>YL-g-WB$-*w4#7dhPjg<(ecY{hs+R%SWD{+Wey$aP#7&mb5Tr%a&Prfx0XW z4&%NWyI_YzU3-m3pRV;LK2*tzQ*P{v=1PnGHR z!nfr({Ye(1q+mgNvqb7OB0go3-K94ZSBAr0t$A$2Rkqd)<-6(L^+*_}+V@g1-gWk_ zkPGO4dWgawhsB?aUX*ZS(-~B|C5BeJexIeKZ;iN2R*jLtH58d2KGJ$}Nu`A$f@oEOm47 zjB~Y*Eql*CyP-TRE_!b!=*-y#D5L!N6Waf*{_<(kjTWb3f)yPH+Lv<$mPCx(1Ua3E z0To&El!D9kE;mZwN5RxKneJNO(zJ4gYZ&>TmqQmQSQxJZd5(-U0NyrigzIE&u!pN=sq`MK%&8ks-SA?6-54Vnx13NND)Vyr7x`19s7jy2+>>uomHsaWBsNs(`xu{8<9**PlR_tU4%hMUzW5GoETT zKS(~|@vkts4j1%uSrBGtDE@%c$brPsXvsCs*O63_tEB`R7N;5Xom1xRF*-H`2w1w@ zI?4*&D^VO6<2u_X*Kc@}CX)kqF$GNJLe-j9N(`}U3F7#`C_wOSvG!sVTv}x={7w%) zSV8yAtJbeDvwmnf(P89jy_>!1oO1&KAa}4PdG+-=*dpoV%NYep=hv*wt`&ua7Q`fI zVzGaY2k1@&&z53~7Xx0-{vBqnyZ$_ulKc2Dd&}G*E`nZU!>fu^%vjp5LRoHgj_$*s%=uOPq z!tqu6#gcQWj!uGOoZG~4!nRY8N$qEr6Yh(NRMYNGfX*i+YooWsveC4LnG>#d5ib*z zf_F}=TO5D&OC1DgCEeh}SB(Hl_8s!z7ZzIm`N^S3K}KSg?j(g6G917f}-f4{^3B5Cr zCGbV=w!wwF3-vrG2k5y;j&$&@osG!5EhPMjBpzB$`0+a920wx0Yg-D|e4lit$Fa%! zSFc|kHb5oT*zhq_fTWC3URRZJ5J|NBGz2g5jw+B8jF$-#2`cL_2*gp`hc<8j8&4Z4 zHi{ppcCIQ0T8FZaJZ)$J@Q(w_ndrKiMjd{Sj*l~+bIWJN zw!EfD;XWEw-PgUU z0t7wJ+0i@^au$NuFSG0zL066~ZEiTz8NXMpw7W9aGBQ$h^=PHCE;WtOfNY6lhk&4m z;^+m--MOk=T6lQKKz~wF@C5-rfZ~m1py+Bli=tNmF(K?tGfQRiz?#@|q43+Z+*#)Q z^;W#!A#Bn2af;{Wc-ZX>0{!>kVXL36c?e6AK zdAZ(%3MPw>1YxRfpJA%=1&+KU_6%o#LO;I-qj0K1yGeEWK|KSTUQf=a^EuO(kYnQX z1cjJioGM7JjYtnti@e$dWZUY>H_N@r8oKDViI&0dG_j*X%<92sX-WFrt;Y21QpOouz zIZVCdEv$TQztrM24&%&)KGpPE+kMnCr}erV##_1#@6aH?=y3ARSY7sNzpgP-HLH%K z$=Hc^$^{V^f(I-D$7TMvblWA_28lyEL-M?G+8-%op??e&8C7YurTm}-NKbj{b~+~3 znvLS04y@GB`Csi$2)S6PJ0-hjXsMQnvkORPuEGMQ4(k$V6LC83)o{YLF0U}dmKu#w zUCyQ^EN~y=9?*Y%=c5DQz6AB~{MIz~>WrGG-;vScv|XiuN73cxm$0CANynnAxiOOf zXZ6xdmhqVnr zu>B>4|r_!A)RqEHfG$AStsq`jcfli_h&lHlwbTf?|d~vYXWVUI}~O&a~r3S%4|kP#OFBvP@-SVNky(^Lql|x>)?|Qpy4WE< z*G02KMCkqV$^kFcNmnp)-eKSjnlX2fea5Pl9u zxSP+8C6lNm{JD?T-0Q7AI8|ySak27xM^{%)33O(zj)NHH-7c|PviiLmjG|<9^_k0fq0-4&GvchC7v~Fqz0j!^=SQvOR&aEOS$vJ% z<;U6YAjd(ZL)AN`OS2s@ENqR0Q)Ma^W|*WVx{u zf7#)RwnB?l^>EzFMq#XHaYru{kMd}{Csy!2RnMX4+i1kI&=XmUA>@&gQ7<=H2uCZ` z8<201@g(kI|NLmiZnNXDGdQlT(pb+pDFdKZ9z=R_3Z{FS$^BGzKwb2WTeVb!qu0$t z@)^FLz==ZEKRb1fwnlJI;+TV*6A$d&`ueDD!c(PP_ukMTkm(wfwFMlJNvfJAQ3fh# zozJd*OD(G>;4IFg4Dt4GR9yKPoj{t$pX^Jzs@vfi9Vam-y*EdZ7T90}uOG^jz^6*B zPAi;jB=(*_NP!B;9QkOD;sN8C*AY@^5n3n?|BE}W5NSWf{x}At%G!mKy(lg{m29dM z804AuoOu3_Ug*z}RmqMd%79?IoaT_Z^duU0_`iw+*NM{FBM-C$d zB0*CFST&jCe)6W!DhqC+<1?G)zV<(iWp^c2(Gut9VQEvpOU z9!sv1Z0JHCK7-{a*m(IOji87YNW$kU8szts$b{z~Hw2E(=YXYju~bv@Yp_yLI^_4g z3I9<;YB)#fxj`iA^)hNCKvnz3 z-BU>c8H44=6AlIZU+x6eyh}a2#vV#m<*$`fetbHp3VEA)PX%0BJeq8^J2CWYT4pa( z`dOYre&g3{`pk0VCjEor8$JosRvz*MQw(XDCl^86*z>o}_auX|cr(gi)UJ5}uM#N@ zKLX_KE=#Qp3#Jy*65u&fR%_q1$Z}%0ZNo<;yd=ba>Yf{=E6~CW+UO!?8#}m87BTqV zldRq*ZlYCV$(O@#`g9t5xEn9P_?XDp7rEUKQFVKNScg-5!T)$&GSEwW1_$Lq*x@En zi*Oxy6iKeyW!V$y25)0;jQ(T?o=(^dH4cq#qf~vt6PQL&1EAtd1kPv75;3NCBHg&$ z2Z#kQg8r-RxdDZ6g-BIQ0A$$Q`*jpf^6kg-g0cjzS}=kAKHcC4VKbORPUXJIGf6b< z;12&8MibW_6Sh~|Z(gUn|2$Zblm|yG%?(njuql_d~GP zlV=P}Xz39;6l1*}mqrjA-~)9qoWbe2b6SYh?)}Ky?O8H~=XHhf= z)>(*n`GN?O0~Yz^=7m5FnhhiApl`h1SNl1Jc~qrBNWC;{4pXp+Uwa@DXhdM2T%NO> z<2g0+jp+qVGyMgT(&O~=o*L%vX~)P-djK75FVG=e&2EPe?c3y=Fuu?m%klH!+kD|zp>T_`MLRJ+m=UCg z4FDU-uas5&ZhLRy<3s4ozvUcOs1*d}2+auj6VyAAnip`^h{GP{+O=#e6Oka|tPQ%I zv7Fnkl|XB}=;|An2`~Z&AlaIxrl6G3>g~x45piV)KlwyX7m;*Sbh4Y0mF(keOs7A} z6oWu^#cmG{YK#)bNoOM5SLGg&n7}E|0I)QMq+QpBwx27=@(kQ|70M;aVnOM74%!O? zbMF4{7q1EFF>s4oJ8vUO_3OlM4?b63D*<_;OmKtZD6y%tYYSwQBC78c86S##j!nzK z`rpLNa>6{}&BZ(q_XYb}v^{tbmbJn{mvpg-p6M#+k8sOu+FehQw_^0XU4&oQq|*YO zQyl^B@coEnNU!>fFscnM$^}xANgNfaQ46&OKuLHWPhLsnPA43CcC>{ypn)enSa#o2 zKY*&RIX?o+Iv#o??kAN+^4yK|-9e4=O>hQdPRDOd&mC+lJmDMTU@M?39s&jyG@x8X zKC9-GG-L?{`V@=JP{9g^=0s%0?WBN`x7)w`LMh;3$eMOwS1mAPo2c!sBw%m5U^IP# zreHwGJsC;}mz2HdYoL27Z-uc7HlzVckUc^`_QxtVvgEYkb}mRQ95i=0NGP^IH0o-6 zzRAMI9cxEe2=dRtDISnOY&2*_z$T{?(T$hS=W#6o_y`|3q^+KIUSqY?sR{QYDp(>l zeM3u-*&g?&d~>1RQovXtcScNSp_5M3}&@{?NCif~cT zB=u(;XzmUI+$}@lSxDSW`Rd_1-n86?YJayx+63m{YGok~LbtjlzPJ#sI5oXM^#(Lp zCk|*!c?67-L1c#-Qi!ae@&^@|?JQ|)wP|QFpGp2nHyv>^Kk-KyOh!V88SpHvCg%OT z`wbs%rO`S!vV6?YzD2{%j4a%;gY=y+!NL}ocIGd5UY&#?l!`famZs)!Q$_UdWMc2r zx(}tYoDw_AF5g{_@fJCVk@%M=VX)0;hz4zXae1w8j95q3RIs!;?V@N0A6?jAPVH(F z`dHLW|H|YwA;1{d(rJEgpc80s#u#i^2WXl8l<=-_=6WY&|B(7*Z2odD^#Uy%M|d&y zmSct-8tK_$c_gr(;O*GpA^qTfIo~XkzOIIw#7~b#`OqLC_$^YVHyaoQ78wG&!*M52 zYsCevjD-R3C81JbiwDTUv5bXs5UQfaOOFF#t`sTf9jzDJgU&7^PSDdZw)$Xedl6ri zNm;d~oO`NJOi_~w5OJ;)F<_tj1m)dx-|=m>Z%)G2W*P8R7^6=Z|7yyr^RUMPrNB&G zsS>!OeU{4dz9^I?5uo|80_(84V$Ak+QG?t4Ao;`U^>sJgDYaUmDa$pq_lqD+A0_N6 zIRI&70^Ww(=-}PnHKe{kva>&^+c%3=Xoa76j6H7Zo+|(;d4D)wWqcv3GoG(jWL_RC*Vkm zh{U&U{XrQ{+f4zp!hEUTm7xfEm-b!j-uVQ2O?U5?i3}^}yZyGPqIss3{g-eUia5=K z0jE+G8uHVzNXw4QR}iLD?H#bQ^@t?-N%wa=RiitQ3CM3UfT(!r1Z+P!*NujQw<4Y) z=65g7rIJdefXot(8^xnEZ}{59_29u^=5+gG&uZ2iI=XHiOpRHAQe2+_xO75HE~y9v zZP`8zMIfC_Oq!Ek&yY#|yRAJghmV^&(%}P7y%f-&kz~K6R#xj{d)tBCXR5|9p7<)K zn!7y+UYR`MK5@UJd~cqXZb9LUFE7iF^0Zc`x7B=x&=ZTy&uiEDR7=+0eGa9CaxGdo z6C7GhUzNJagxYIhhTVICGBJ(#rYF?Y($^N|;rL7v_W@JZMN z>k>HN--ozoL!NG~St}d{ZGN@9Be|@PVIl}zKe+nQ+S`KTD}E6&^1&2enS}5;`-RLO zymibRm*cpmW@Eh*PUf;CyF-U0;`dygnio_?fSAVv%QTfO2q)md7m}u1EZB9&o=BLm zvZn0_tuQ?l{XX$ZmikONwo$&^PdNWdj0@f+lF(Z33a)wGJcb^(&MUzOA#eeXX4$+Y z{rZ;N*9uSXG)3J*UB41AhR0O_$B9-M*|8YD?!a7_bu7=#S=|VkQ*Ryb(Y%0WUpl`I z6lDS{`i7kS7<${oGP1j+81?Mcu%Yoc;VUS;KaR&N!!4c)U6(VMsZ>qD3hlJ`?DOZ1 zS66e7o#AMV1+vs~kwEJOd0+(dpGB0r3xOg%r}v$GC%J9=Zo&p6u+L(F0FtRxW7ZGw zX*QdzQ2^~tH*3h$u7fOi;bex`7c6Y}DYEs&+=eb(sBAK;zO=!U5+;x%F}EZAN7U-H zz$rh(fa1>xdFXlM?K4R6e3WwV3QwqQF_HM|a@VfC@UawCL^?cJUbFopEOSn{5T)oL@epnxOOsi+S z-Vlax5hUNGw5)Mb-B&3KSbS8SqUv(I7?R@wJG0H4Bc8>AXOBaJpXxV0Q_^x!r{^e| zmnA$Fi(%iQU!yt$IwPR6b29pcZ;H0M@ZfkkFRDspuNOZfb@l@hPDUyw)4X#dmun5) z`HFf8kG>jCzM^9*ei?y#@!n408hOJo^(`AGQENv_ox7HX&zd*sQCB z@`vkAP$Rm(J2j*v#6%HbP5@9ld_>z%WlC1g28OZb^Yx^M_DF#E4$pCMpM39fmhr+e z7)X;3Jzf3Ms(YOZ5UfU*>(2cM0V2M5G9+$ZYZ^5N^`}*yiI#8c&pHEDycIwq_C;pc zHi2}u3iwVryE^h~HsZx>lXpENC21Dq0bJ2?PobhQVB=#L8*@y&qx``O*$2yg zoCCOZi-*&=@3aWJk3DTwv{?x1HWA(CMQ(cMqQ-t%(jAZbobP(FpaPlwR3>A54dw~1 zu5lZ-2i%hNZ1_oIb_|qZ>KPYR3mbeFpUy{prSG5taPYkaDV>kCMawZ~5nwZY{8 znLm-(O$3w>@HA~Dg^eSB5nRC1ybLVzLGf6MT`_%ARX3@5gFR)(rk}z$R%aW;y+I%( zf$nu@P3626WP%Ywzc@>)D)w^o)}&B^+%FHxI^0)CUH>quc*% z!Y|e-FnmKc%}F>xH8}4xBAIx_(~hrco5*mVD&MrGDxS*|&fJEvAtQ9zDz;&~$)PXt zaGYA~6MfRV?+m^k)M_%v%yG}0MfX_m@X8`p@svi3s?_PIY+O6O9$S@yY9_7B(~XJQ zCZ~@9>q5M0di>CDTihV@e_`KSE}>BLIn@2Os%{Mm6!lX!Bs*>m4e}ut%7x47>a0 z$){vl*ehn}r>Vt$P0*WKg@NaQElawYdZCI#gZ2llFDEP~kC!}epP4==+6>jq;{tDz zG=q?{s84W1&JRZ!>zUa^z7@ABVF{7yeFR(C+pT{FD^fp@19tngx5g01(Nyj;^ev4o zwgI>e@k*)a-DJ%dSpjz#g*A@e_Lo*w?Zp$VtYPt>;GlPGhVg|HYGL)gqHxi)-oKaY z%}*4_s5_7ULw<#N8G{tHP+;rj`}g&!bn{89VANy&lBI!42G^*@*f zIv`mD%t?~_)ReIQAukX@-8A6)xkAMG{{cndr=vN6=?S*eqV&lBCiMl(S(u8Ze!=~3 zNsUmzm12aVEv5NytwKW-f$s-m;y?ZYPk%q+|F6`)EA<;v0J}ux?+4@_=eNrljk2Yk zqPOWR?aANId^pCR<%cEzTa~1)Xp+P{OJ62U4z85hEKe==A$mLMPk<5Y%XC&I~sYa|}OHC_D7#Et-Qb z4A;*hYbM~Rs@4m{yG|4?bXs2Gp4jL<&?x}cTr<~`+x7Pva?Dgq^{AE0cj;38dVl@A zkPZyN8HgPcJ!JQvtvru=j9Y#0zoXy1<}J>MYhX`cl0LM0-7<@POI+#0Iam1AG35L_ zlA$roNXhyQk^k3s{!b>-89IgsX{gOESZiBJvrOs`0qw;-vv?XUUz}mgU^pGd- z6eS6-&L7$TZOnqJWN7=si=(Pn3cpX*VIfJzc*ps}FaFj7$Uj3glLC-%-Y~D@>@WrF z+YwAYg;uclU&nvyDG&NKCVSTZk~Aa#fjN~6!R1^oS@OFq<0?%Uk6~PX+m`H-M5_xY zvfI(At(N>31D3YC%Y6Pbpm8Pr$mE;EHi?9VN0F=?j<2<#8wr2TO$nhJfyCw5PjYn;M0=@3Y|Fhr_D>eSw=xX!g8myxOV61A`Pn z0st*|y3EnE)_J;YeTi0B{Wb~RBEoC{mB=uUn389QnjZdDd)0^f!fJ$~m02j-iC-}V z2W25c39zSQ_pb?jy3$XcznN3J?mrNHJypm=(wnUo#m2vLl#)KiLVH$7<p%F94im8w^%O^U>3HqTFWu$l;rFZu?wcl`LhI8jh? zJS*7x>o8$7KIW;3R=8qhZ)z9=Ivzr2J_I7k{Oyq^A%1jyijxl6Tsi8>OwJ^@&HEbS zR@Xj3jkvY&Nb{ovzNH>FkIziymjYQ+GNI4{$NMd1{07Q!Y&adYWK;RHz|@~3;^(uU z1yvD4nDB@j!sZ-4?iUBMLtSc4D^&apAAAm zhGvukImTklDmRLzUlz)OpBkx!`O+|z?$s`x@w(%??07}eQuI5Td-tvjz{k>J6i8Tbw~f z@)wJ~G~2dTwJTEz_`K;Lh&-(JKgutA|NMEfSmj&yi+|6HBimP19R4 zZZ2r}U5Dik=O>iA6XdEK2`y{MeBw;9jqZAH7OJI+U*e~e7n87hmlIC+EgpO5>WlP0 zS61PK)P8Fm-29B$FC0jjaClKb`hJt`4T!M#Jya@eZsER&D0?_6sBpB2q+}lk#PHh! zTQ6XAot3j>ed-i86TU43rtr@AeyW~x!Xn^M!x1=#=uyH_ZCBI{aw0BEp3N1!F5!09JU6ieI)RG!x!&~se%*nm z2psa94>XQxxw<*Y&-Aj3Y%K8vf4?~q(pn$#SVCPVg0Ef!8ifT=9_YS17}j`Y>`ce z74D&s2!z&H?>Fr32oo6*#MUQtZx7y_A6y+4zrB3Rw}y>HK|k2FNX?$e*6|7Q7wehpUZvkF;lYJ2B<^8+h2P0+v~BS9SeJXJOow` z-tbxN3WkH+y0KiU{4P-TLeLhX``n(#f5LT=6Q}>aHmkLG@!bUwGIga4>+&-V_3%v- zjxSGM>W)k=MD{U53-~kYRT)}gz{mGcLM)`m@LX<=7Q--I%*q1$y4EWUD6U6Gl%)^& zxvOI?E0yh&&llc!gvuexn^}FyL zQ6tcg+JDMH7L+_*|3z7PW)A9dXZ~;}Hre|u1bt&9g8NFHAoJhC+U!@S{Rd|6DS#3jv1;C16VkDd|bAt z?+rybGE26Nu4d1VgE}kG$jwJq$yt7Z)xd4m@ml7*`1<1>Ra19nqgCLiA8xEwMj$Yfhc#$dY-7j$tw4@%!c3I@st9K&cI zzp@3AA)8l{j&%#jB*8$8;iIqi)x)vULJx`H*a*wetc$@Jz7NjhsW(6nnkK@ZDPilt zEesKUbRo*d)4o&0YVCfs2%N88(BFcr@QrQ9|2ZbTwph<)sQk4eAH}Tm$-#%zKLBzv z#8@lO-n~soVIYg#F$wi#C-nu*MY|XJpjeM5NSFwCF4vxp*XwgX<}!r{4|3GxJLhO9 zYC%zbZ>l7WyM4|>P%|#GkAPFZ8IRK|d_BXIXw>$eD?wmUOV7M}l`nzaNyH|N?Jx;P znp&T?jAhvEuaT#iEY2XLx>#i)2?k4+gEU!hI+^hDk|EOVeXk6u7c-P1U# z#ZhMq#Px_MmMdWv**pR{Jq>pH@)t(Mq?_Q=(oV~>X`^^9?`k*{FrcZe%ikIH4I$Xp z$&NWOJ}h}3I)71D*H`u;HUOlqQ$y-atME!_z2AOn7P+_$0^&?OmZ9jXE*p%yk<<-? zJQ%d)&ftXq+N}JJ6%4#ZhMAD-G=SP$ z{$|uMSar-Lt|n`qxuOwNd~sU$!CI)~{~$j44oUma^{#=2&|t4F%W; z_ugTYEsaGOW9u23`Owj(k83|V#jdme|hlBYO=eWs)?hBSd`y z*)hpx!b7oI>tT=852BpYA}tojZ2OCk>*7B;(pZkSJx(zYQJqAhRUj@5WMpKbe{8v& z3VVSytLugnYCOEiKtH-Y819-4k3I5dGM7K=?_1L2)3AbPC6WC#=Ydn0vTh6@gI|{S z!KHVV10J-b26kO@!l~YW(Gw{OL&n4EivA_gJ&8d(!0)&C8DV6Ux6lXb5^0d;pc+kB`8_e;(3Ce(@&0rOY^SA(CJHLiWLX0(he#l(F(#g^PVec=4>iD`gP8jC^ z!Gk*l2!03>T!U+Hmk{LO!R6o<2o~Jk-Q6|8-QC??=j8s&{XF&7JM(3#rlx8>QMK!I zH@$oB-M!cPt?N3Xm%Re+8#ah#5m{x-hh#uqj&bU`y4y;Yyz@;8U2l-(rs?;F7dvv|GR|d5Y3}W!rG>&uqMBY%Lm@?ZTsbdHY&v zz*{9MRWu;NE{QUWHFN~! zOjv>$oj38fyZCs-G|8-T4QgWoFbCkETH}sUOrPQkSQdr8f_Qk>rIy=INPXcK--DeA zMK28-ewo6aieK+u)(Aao<5C=Pu}4=!@^lUTBVqu*#KiKHaYq3ev@QD3@E=zl?PUwn zLA6Z+UrSf#Bi+Fn)`US_O{(Dgzk%2_0+?42#Sj}LombO}fy-YgP0t$K0k~;BAa!CU zy7=iO$xAaHSM#3$)ZHohS^5Ri<0*Ub6gv;5w-Y8D_V(hF!i&o8a@9X;rf)|zC3#YX zsn}Te9pZfhQUdP%su5>6!x<0>iF6Q<(&83xec6ZDYR?f@9e?!qDuDGT{6sww7;BF7 z-$2omIQhy+c<5?{)c)T;`_CU2PDrTCo%88k-Tw@AeHMX4wcdBq{QST9r{sD_hLG~b zTsdtgrL+0VpY--OOYjTzuLe1{-=4n=-Yh#DyP2inZq6L@BG*G$+EdXVY)wyZ`&O;Nx!u9#_U+YX#kcV&8mvS%FFLEQFX40xjlAA@BTo!@QO=1c zjhA?!BY!#v2ExVDwRIzh4|_F(VC;wfJ$%6p6nVENG}KlC(_t+A-QWV4s?!b%9*-Rz zm28O+Jna@N5->^O8MB_j(>xKz9_6Q}=eOnlK!D~Zjr?XO*!*1&r}eyWyFwbyerrAp zq`+PHkkj&-J*oRFp`<@FU8Fxe-R_P*PcNMGV`6wJV3aL^m(I4?`P5U^m|$~%rO7d< z??oVXM8DzfrmLoLg~h06QoSv~_F#N+ks7lN&Qj^=S}a7$Y9df>aS8cUp4?qvuFamM zRHr(awATmdxv>RWXtDaJ+u+cfnk9h@3vD+L`WkdLWt8=S6tU0LBwg3AM7=9!=(rQj#2Jk zp=$9_c_K#&sW=hhOwJUF|C&4FS=ZEuTmCMP`+7dovu>_ZP>YxDG?mvGrEkl?DPz?iWJPrRl?E_uI)SO_ajJ_IaUK7bsR!_IqK; zSCik*9q8XDNJAJ~2vC~=cC|0Gxtp&(^`20KgHO-pYqV1g!qfUpkq&bJ+1rK-i5+RT z0D|Tv>6CLa0$*witdGsb!5-LHc7AOHAC&k-EGi;v-TV-5#?$wIRYuo1^lEWN1S($B zdltRyPv&y8vFNtN)t$`A&CY{Eo_IdY6ckhWg6KZRUmw&e=I+4D4--Br|HcwiwT*FP zF?!vXupt_MO%aGVSIDy+zou6Kwil`M*x1C9$>u@$pzP$2Hbp#j<}->&D?C4c#4}H} zz{~6tTl7GXxK9vq_uw&c(^1`=UKw>Ih|g0@_~A^Jlt+?T5@oN7 z2RF9;#vmH*SGkC$Tc)mk)3?nyQ2~uwCuM)m@$+$sqr>2;BWA!2vQRvjJb_Ye62_zTRTd($N?ILb%M#nd`Jf)Z`JG;P`@SI&Su+*!! z6tmS53OY0tY~(y)KVATAe{LC|r1k*xe@6NNK=|8zi#|R~+x!2F7UsK`U)z0nV?&%|LdKlh1 zRX>Xu!=p-{`}rksH#CYmWL##nRz+;;X}y3+H@EaKf0LKcuk-NI#d4|AJ^cV>P0qb) zL!U&TsKxhA4V-z|F+HAAv@4(vM%DWj$5gD;V8D2K{kz#*-XQ>eC!D|@cjBZKaf&bE z{OrDN_`PP;SMi@SC9ATKRUrRe$GR!Di(wfr#Zv`+4FgD?rT!`5K*587Mt znEB4HFze_2FkX~Glvz0rqhcKZ`b>AtQY!H+KgAi6nlgZkpn z@_Kr7({Ogz3yu$NW58G%n011ka>%g#*20NP7dDQs0~JlClN)1?h1 z?c*MLjioacY<>j&;!sP~aGJ^6fil<)K;cQ+rmKRusm}_wt$ff5x)b+l|2ut!H-e9(kzR>pgQEX8=$#jYYjZ3xnHMRy zPlW+&BO6-6B??ljFob*#iMq@{HM|+$lwiNh*GGzm|5fx%1HAEK(H4U!4Cc)Y5$%rZ zE4AcY+V*1OKRq9+k4<@}V_-t!vtU-rJS`}v8@afzN5LY3k(Ii3Q+FaEINuhpc zP6VSP?Vd}GL?vn$Fw5}fHKkFS5SZab3}5c^HV#AE*#2R0G50i%z8@Y?FmtrVe8wBk zDUs>C^9jv@U}t`TgMKnZ^-z^q7x!xOe#s=(_04GK5B~S`S1@XqacD&8WxqFN49Po1 zcsGwz18K+TOF9?w*m*U$7qGp158U=LSl&a-QV!T^IL|isC(gO`YI9XifthW$PIy#2 zX|E=RvLI6if^WU?P(r@~!LUBl zb<(hc$IsRBiHvP3L&GnCldaZfIW&pABwNo=(HqKN_4XMN-R!qu@qXznk5VbH^fLr2 z2Cdz8Pn#gh(uV_z7hlqy)nWBi%S1<65XL?GRy18CKv##)nOds2n@*oRHEQdu$0gxW z`5gS~sv@;V-tEPF%`8yAEjw`cmf6{M>tt z<|B>W2J0>Xx8jp+;f1DLAtZnUksBlXgDaP8gZdWIHW)2a6k+mW=_ZEs)4o`$;tg*C z^|SQ7!3`}wi0BM_y64bcTGPrFIXboH=h(v1z=NgC)D0hLoWTl$r=lhaQZ=~Y`Nz|i zB46X-B&mB#A#V|~kILU>KH+TjqWHVH4^bp!magSN9c$E|cz|dvK9kRZLQ}$E3tL)- z=FbwoiSz$~q6uLSrb>z?gj|-w$CxJ z_v-aM#9c49R5XPoyT8nZ1fuRMG+Cuxe8G!DuW9DxLlG1X#nggbZ4kC1jc?nA-^4n2 zc_Cu1uG@%zvp+fh%EO<3_g3T$9Hqvm3gGM$WQ(Pc&V6VnFVd+K*4Z2KR>_|9L5oVS z#<%DU8~~q9qyALfy=S4~+H0;e0ht2X+^P(~k~HaB78wK0l?74i6BGL&)P2aR~3F8A9-gw^6_M<@m*hp+*w*X(I&nd;L3 zfiU<7o+=?lfvp1kJPlcb8f&m$*IN(i#Vy$adiB291l#KB1N;Ud-fhN~pRRMLvZ)xv z!t-7J#tF0>oqSksmvNpdvmrD-7|}+-U&Qu4C8(YK0jIalv3u zV&iXIXg!*00-*w(F42riMu0!rliq`C8H0`5MLaHMHG0)}j@7J%)t z=eKg_L9;7Zi0}_!>t@5@*|1?0>%HHPBM&fHWhuEsH&UaUc~`DiA0S`NNu0!LMtF6i zZrLN01W8$tLL_W!-gYT^F?my<;TBYUFuwxbmADdq6`M39ip{Q z73=D1iey}m4&q`1T*-^;bUL5mP~c7NC;Sj2RCq@27~q>Ty@xyy?8zpkwnDrd@tw=c zTzW%TmZbE9ST9>$^`^j9r0z=uf`)Zz{HHb#EwAVUUp^=9@(%ST0VBT1kE>LD!sHoX z<{=-}e$WOt^`TH$4!b4qVu>MkoeU{Y}XZnX4Pfo(;_)l-LU!v z7~%NYI$7Sm8zOdn93i>>trLVLhH}yD8%QujJUh-m^qcOO{hcJb*X_x&{oCGsUN$e+ zkV;iuMR}G!m?wN3yZW@Ug$Br$gYe>bw**t8*OMN)20V>Gub!7f@kt|=;Y<5>Eq2uj zhvskevFdkoKY-!C+Po~}5T1@pTy8LfpmS>`J#(aECrVS-PcBgW`OO9?824UGr{mN> z`lfM-PTs@X+HNqm;Cqs{#h7o#B1rj_M#lEO z8*4JutetKT7*>Vo-y!Swe{%>pg+i!gOk|^*ZbO4@hXpu~iYUB#95`Kd1z08pLFzUz z)ZEAo;H*g0+&@zk>{WhfbAD}`aH43Pw4`M2-Dxq+gc#Wp(aV%fp&0J)aVU_daIy+V&W|LKnU%6~ehT30 z{r#C#?J4Mza56_;u6y30fFya=YQg%QYJowU}sX^I{rz6j@I#9R0zP+iN#mq=UxMCg=f9;5FNKVZP6zi14&IvtD;00<| zKU$iNLofpm_YXI0=<}B?&dw|ARc@d>UR_sDrxbN_H=Bb~*Zo}PWMRFmEel}L4cV5S z#9r}55~^#?^)BOzf#0r~bW}pKv541~r4@I(?=fLwUi=6UV4n{hlPP20paz8VZp;c! z$rBLo0Tx|X%Y)w6I^_WJ@HAawv44>qL-G3i6_Q|1wUHOJtwW&~_3*Nuh5AgE_^OlX zKCu^QD?6HVxqq2Oa;mt#H?O#`x5FIXrkx@oLZ~U4Ha2)k2p-OY_qbr_*V;l~M=>q) z=yVZ=3Pu*jc|*u;62(Igec*oSjTy_1iAWe<3RZ!x@HP4f$8R|W)tPw9Y*B2$!}pC| zGBMEY`Z-+uyb*K~wUe4@sfXaX=9exJrrv^}EcMqQP+|`454sTYyY#H^+v9Z->MJvp zE4w4-IpB6((0MpWPREfqLpOkz9?iSkgH+LeDEbDKN9T?l@oPDBLv4!%Y23X7qKMd}z#&%c4r*h61 zi{wRo?)?3BxuJHW{SP1Ah9C$5Q?>49kPNZ`?DTsQbD!Y&DjI)<0A1yic+?FWJU2OO zlbhA92k4Wm71TYdp>42ygNd7+)(N2n*^lr`Mu|R_Naml0>H|H)HkQx1Ot!6Vg8U2w zoVwUK@-_Z^d#i22;?`McFPp&T4lZ z12Dr!quDeC_b6R_I!;w4zrV`&?YCN!TW>BWbZy>%bv^*S+uGWh9$^_nZ*f=Lgj;#`zMKtTkk1m^=cpN+i{*$g-kbmm0oG6O;;Y4_=WGY)KJ-lXf$f3=iN>F29A2T*`{qn zd|6hmZdicIQ3UgE&NZmOlR3Ip*`}_mFTtikzkG zrfjq{jJkuB9TM|74Ga>0yEXJ?oa`SJ2S~<(Ky{jOqN6eNeh+s+D1`wiZ0x7gq42J> z9%tMcg1+=C(hRlP*TXBYe}S6gx8BW@v(D-nY{E@QaFVF`p7O0g5}D#m47em9|M&oz z>X8zL&GI(rrt`DD!;GgS;aT=?rBP1c*s6xZmU<6Ve=&k~=R zzv!YdyiBiOaTK*|gs?a)>{vJq7pmQP(;8CVI*fdb=MY$?b)jGs@S!utgiE3DR^!v2QJ``%t=vWPQ^b=toMJe zO~F`MlQSjySFY(lk}7ZiWJL;gqPmd(n-%#Y3`unKOhhT6|Chg&RQw}z^8fvle|qW9 zQ~ZB-PfBwIw0iDhhUt)ea`(0A8x$$$whQaC0pvYKr1xpvZ}8GoBKUuO_t$XDfWX1C zTyJzeL&Qt@tu#XemY??aa(S=zQ@ZJo1{8`EGfO~>o4ron0+-=qL#cT0#U|c4Y$Z2U zrnXK#nZH&9j06Z|EQo!WgwPZ`sCc?$0x6`DY)-m4TcO=yhGD-LT%Ug4D(JP!gn7z+Tf0+Ml6E^O-!4+1c4};>_nrQ@48CQ)+WTrwHlIa%Tp`Vmt1sRw~&vI;!Bm zf%?b{%xWzOcxJUHf904-FSWbEd_?bjO<6-Q86>JwEHOC<#A=hV+UWbog13_s z9mNOJ#nYE#RCq85F#o4;@E0>V3|!w{DCWa1Z<(6cCz65R#x{G&u?RJE;`eO%A{b)v zHUb%KDB%+WqO&UeGFy_O5Ii8?W&tNZ<~QRzNqIxKN9*fUFO}TdCJBxUhRC#?qb4C6 z*@f~I3PAt{o(*5d#`8>}Guh>3a_yz^{>$OC{i~W72shc#xdMHTtUN9kwZE*;jb`_$ z{CVm72XI5mi9d+NuWVI))UN@&{A6YIrlsG8OLWoKI?{O{MBRsvKOtO&sTgC%0=UBicaywNP;rsp8*-0t|319EoHNzKib zc{u=YNp{Pf#m7FADv>#lUF*W#>vT0$7(fmFjd4H)r}3k!mggDr@xJ?)wCVSrn_miRbXH)^4X zgh(TrkoU9i4epae8%E?!TBFo;p!LTUieaXF>-U#yf04okiGvuKjGH}gD+jtsu_gAo&5hUu>xo(!U{+si=)Yf73cUz>kWtGz zr(0bnst{a^M!~92>#tj`VB+#VH0%6bce8=!lk+Y9x_bMKgpHYw8wa!5J9eu@?oGW_ zm&&BALEHe)jP^F@vG6bu>PCE+&%sTRA3_PnAR|*)%#8dv@MO1n>m8VFk{Rj%lJr=Z zX%3VR&#US{&}uo2qVVqQ2MMbS9;mUjV~(UI|4r}uSD8IP*xd|jzDf(jaTa~Ig}G{a zk0ETPy^CXsE7086#q?TcEhs-4Ynk!`l^_l_h`tYMVxLGdj_Odl9ta!L`uKD5j)H~K znKhdQ5k-F)uNz53$deqQaEo`vxyf(~`|k0D3LB%Bw&dbzW9Q2jc3$gXIvvjXz2C#V zCWgBuz@WgiBfi#5^>(0$52Grh)DG-t=tnW!;=I19COXb*vC4C;S#j19u%o#tH+l>|rv z5*bq3BXrR#jbpY}k%8486++x@waXhNt}F)P>1scG+<*u70-?)IDK;H(-$ANlVuv*% zrq7Y>H5uyGHNIn>;-8MeS(zS(J!k2gtJ3XA}>n!g&3 zIKHP!6J|i4mu+ld>5+euX?&BB@eKa>G3SH`ldhSqr#RD$WH5foK)Y+i-SN;i9mW^rv-2_kCvDv!NV3VD4B1C@Cw z?cK^2=7{ljloRmI^Ie56`JGU@Q&7wWz_hick*S_;u1V5t!>Uut)nvEsE=^D@c!D(++r~^W6 zCztKhs&KeXDT`wSWGw;VT{lkQ}75sd~gax;x`dz@IzZ+w~?UCX#$GJsYmJh(@ONg(ahKlNBI z6Me5?26a(uY*UkD(vor z5B<2IwV&!^)Zl*Fo-!ZrR-CoN2v5Rw(fF|+CFs#RyJ(_Ucc>?k+zKOhJAH?g%ZMOp z1-MWOxNS3&w1fNSkX+J6Vg0-j=sRf?oD1l9FYFKK_d43GV9Xh2jP97V&`Cpjdh;Ior>tgArv!v_|q$^ z&+AscPBT`Brg!c~+G3DDPdFfUN~yneLl+UeZ8QdrIdQT3Ualk-M*$udz& zmho$MYBJA@2X<|JAgJoSm#~n^ensPPHFuqnz!?ee?NVmTm|Nu-(gYD{QvC1EX2$A5 zXDz6Jz~Po;RS$<*VzO<><+zjgH$38 zVB(LNhZTocsGQvSO3j+icFAr1yr9P_lOq}n!sFk|E+)|DDAv){;5HK3^|_w&l`Fp% zhRHlBxj6O~?ap;F-&QKS`Y@7S$E&iJF)NjC9pVB{TpGuWsCPwmKK-h=eBEzN!m|c= z|6bF$gw_Oek-9Sz&rE&2#{QyTLwz9h>m!7I-LTJA!XJi;-ijDhAPhh4Lu>=-GB@*l zfZ6$Qw;uCq5`AB-eM=abnhqUiA!t{K0I#k=%3?$Hjb4xRuK>0cb$1KxD=6EsVo?-l7!9s0!S7< zvM_;At`^-AI(wYLnjQlB7VrGPdK;RP;x`mpSVqc8|C}qKqF# z1icSs^QcL&eH&<958+W8nTB{|^jH2ax&6cfvo3S9CwH5u>{ngQ&+Qfjd}w{177!Q$ zTigM@a~@5?2_wMZ(aDwez2*o0=350V42gzr=jtmUBlrcWZjn~*T<>`bu;s%Z0C-S(s%6q zl4~tezV;w9w;WC_M%7+KKk}PRBw`Q!?847Z1RozyTxgE!pqFxhWqVYG($C zo!+Nc=Q&$%@Ykqj=>JESm0A60W70o0+iw9k`#-9z#CpeM1tFwzO&0oSi3gy82U!5@O^EcU!226a-etzCr-21b&*4iE108;aPfCM8Stg zxD}=+DOfU9XFwB1N5|^&!A|z7#v0B)fUrK`-8x&U<%sBcu}-BDVM26;3=6#cqk|Av z3On{=FsR=KQFw|$w!*g4&gr3vd*z3b^JGhF{B&`DJEv-pm!63gq0>wwB{49`ue*T< zj01!C)M*fCPu|@mEuhwJxY=3y7;(3zQ!csfUpVn2K+?IQhMs)^z8UvgUY5iY_LTAZ z71Zo@G&*v06Mj9iv48gv!udN+AeW-#;C6?><-P8~S1?p*?ZkX4CnqG>M7rA#ZOTaR z|94(D_6!lcW->BN7*FtA^5ye~5NpJ0PO? zbWAc&YF~rvm&rsRzXb%(zOiEa;)s!m&Th3vDD& zQc~>uKAu6wl&@Sq=3TD>Xg}MeG--YPc#T491`|f*ZB4KMgEfGtqc@uStcQ{ z07#1eHy8vd=Z5}M&JDd6mHW@pe@dt+{gKfBTSyJ5&qn-HN{pBx6Zb!l{fDPnJC&HqM`Ajd+O$$W+Mi99A=y1S!$Nv8h?xK^Xb&6a>c2<>Ranq~#YS6BQ! z*}40Etz#X(yuA1g3_3}!a{g!oa+E>aJ~uP_l}Sx3H>V5yv%8IuK~3y@s()JTs}Zvg zpHCyTfN~2~7x~w)WUes8%fg?)#Rg-;kI9$FwGn_Bg(I)ESH=RE>p4TS2%(9KTWxYqHm;R3x2&7f-B zv4Lr#FHG$TLwoDl66Pgn$l*zf1Vk-%FB`^$FNdF++;7vMdjp3TK^y7SVY_n;t}`!Q zfwA0?v_se5!|dFXBp_X(R=O-J6-`5J*2=8kcmUE}LT)!whx(&VR9bP)F~*r@$)ewe ztN$Z@Z4k%dfiYKlTkN!TI>3Ck0E_8bs_QlD;a56>;wkB=n2eibPZ~NzC=U6V(;S#9 zN&5Ios0mRe1a<9^6=?kQ{amz4*9Tq<=l>i+l>Aft>5k+2`3RP3a1UQ0iwZSc$S%47 z^E;|uO58Qjh~a`$lw?`Svt^50wU3uKUu=T(=D3TdaDCGH2s$VUn7SU8SILQtaQkR?L>9xXEbew6 zzm%@PrSpSq1LA@Nz5 zu6MyitNy8!Cn=2jZ1H({VLJ5gfd(R->%sOl$IXAnfWqP$0sSaja1w%jg7!mdElE)` z4^*F2o+tBVEWr9rU?!{O%H*=@`?vRwUrRo#OTbMkSu-C_TVzV3qNXHq+~h+@$)dIQ zhkAW4lMySNS+Cq4q?_ro>sg18w5O+Pxx>l|ydEuikFp7pD8!GHIs9P!qd8eZVI2<|>VRz7BV_ za&lals$JQEFH}sRhyWf> zg&^Fe5BiI0a-hMwRJhDKaHCRDsol;mTnbWBlOa7x3oi69*TKA(E&cpJWW-CMUha~VciF`fR zLmULnR+|Wfm3_}kBNYUu^~an!67Pwh^z+p?ig0F3F(LM=R07lcT+K<7A0v=#C-JYk z0Y&{SQ#pntI3D~KtavQixwxYE-HuD565+~$SNmK#x<-7$aL>!*E}J9HHS0P~qC#YS zU1bpHR)u>=@Z_el-~#!gY6C@=)GUWqE;XC<5&a=i`rPGp#)9P9RIA#PjY+>TEvllb zr(NE$NWUI|S|(05@yGaUy2WJZ4vUsJca>=_DOnpyrWMKc=pjXB%Bl{J>j66iA`3V; z|1!dNt9k8Z|H!q$l)ZL-N3&wqWiS9WU7{8YPcNu;&kIr6HAHxQDz3VnDb)=4qa94M zv-VA~zwTkmP9V?GQii$XV5oZ4dW!b*|UxKp5;r|6?{oRNK3BKlJ+9>7TC~f!I_g>_> ze6Yz9EIhRFlBG?5a{XNnCLlGNrEjMpF`z-IW7}c;+L>2D_|@r@UkJACF~B>Q3R%Ei z_#P;1wKCRDliKbQ5cu>Vjx=a~_Oo??`!F2pPOl6nYF-)MQw!m2xtz0R!TtI!E4$lL zx-=BywsuNDsd3Hg8m2v#^tMM(z&qJGNp#~+67Yr__*^atSXmT0u9siY9ofK?LOi3> zhn&SeD<5SIRLHtL*T~ME$HvVkAkwOou@_856+xN=Dz!?k^g0#Z6Er>&12H$KKM2k@ zzPFbE1JBAiTGSkcxjQ!*=H4j#!tYe+pw;Z(NwNJRAWK;6DM~8{Qze2`Psoyf%TPk2 zCaWSE6v6foNPsDuvqzhh?u`zId*-2==0Gv$D@gJg9(Qag0gpjx4iNYcCQCD&E+J3O zI45)x3M(!G-UO{WP4#ui)@Np)_e_4^mKKelpKkEA>#)HzhAc18D1C`c{e*W^@(JwG zklglAmxD6(TPTI&$tK4~(&_XM#&KT~Z14t=Gdl!F@{oannj6p;upY zOaLf*R7A4hnem|m&kgJxq(HJ=yxMpmu|MIaJpZB1e8~?8*Otg<#T+3hhQqSg;6687 z=rmjuLv67G*bIIN_dGOfseC}I_ZDt3TN(ag``R>(bCQ5Ev?WFMgT7p-aors4Lp&|Z zXc$M)eWAJ>(adIJR@FHH{)m1}3jHO1q92~JBHSK)*2!!8<(*1OKMKI~TCUZ*uK&d+-&Gvr5{>^3fl(y8>Z^tX3{CKcjE_|pcN!?GGb4{*qMpy0^2 zzP)zBYF&()*Jh0~j6q=1iH_5t;$buh^vp?Xv}CkB^Llv#r>ylqnOLf<{XG3sbk)Wm z=L7in!o2fMVpKSkXJeQP10vSk(HY870a<#>%|)lzuJDgi=|0j#mlO6(`~Rv4&(sNR z2G>;ZJpEWCfr+I7Bi@7qT41fr{s$Jz@v~-ERR^NTzCZR8Te_p>gILmE{9%?W@s7+D zN+f#x$Fns<837@UVmI@!m|{)=PfAIo>{Q+wWj@8iF9e)^`l`3TxxRkQ{CO|vK{XMoE5_9@eg$7{=Zm{*gmF;Iyv=l8J+i#Q36(j$ zy^9Jb6)apCPOASt5KAXTRuup>RU{_rcG)^Q)mltumWFs;AJBa_lRf&;{PWWYQR;L< zG`p12bRd4a5S`LH+B;WaF6VfK)NPyT2#Cq2m%BKAx^kV0C;Y9lLELK36+Zvg|g9e0th2+aMZF?J_ zhTqrZLO8SUU+M1uK&}(s6%}tGkZT_wnZy1S@wA~2?$>F&j$Mo+14rL$M3qV~sE#r~ zJ74G8YY0^4B13KV0PU46e;yXq9|U7)92~1WJtK!RnJ1I1hWcWm3ABIbPr^@{gRtFb zSvQfRZV%+gWsKBsE$cu%prc@>p)t!R2ODr)E-;L$Jlt4fPR#?=&g92=Fx(xr*DT zt0qK>_-)>v@&b)L?FX#2WV@CSIE0KN%LgdtF?nv3a+oB~ii2rb8%{M2KZCR>|4!bk z9j51kG8{P=3YtT#-jK0iVCmYpQU2cVP1=^Ebi*E`?busK&USN=v=KOC&qGq<M0aJReolU1qf{*yj)Oe-K_+srj zHEg>3qdeuSIvp~0@X~%?*9JWAU+Ig$OG{WeMvx;=Gm5%xE|x*0%UvnTG#b^6 z#?+D-ACTZ#0#W8iusZ>j3M(ZB@#^KpTt}lRzBOEpx1=EFf#1d z$}_~_)ukSHqqHh^YHW|@)ywetV^hwkCPwn5fim~F;aMqf2Ct^}CwC&N(QyW2Cp>bO ztbwL_Hix#frWX~F8GKKv-1dFixap56v+5!QhzBSO1Z9jRSVz^E0%&lH3SPVTtdY-d z?Tpw{ZY_#NVl>ZelN!=)eAkf?TAL@~?)p7?5#N;WS1)D-2A5pC>Ox&j$MZZLNj|HS&%%J)dyqH;U*M|DVp%qyoxmo^_T>q_dMHPYK7WmheyoNH z6O(z=Z#bS#8G)PV@<fdoj)KkO6oL@)MI+t;Eh9v|-`}~mlDHG2EpV}%5ir>z3n+}<%(xi$;4>c$i zeIxV*4xKF_YV?yta=A`Sy{>ML>Qrj{Tg^gyEY0}0Iz_fp-Jei}kH|LQNe|rOwYfXV z;ac9Ouzc~lj%QGwfQzSW1F%wI3i0&u2)>pZ4 z$RiozbYRsEX8w|o8u!~z~ z>8-dQid{avFIIDP;Tuy} ztlK6mgX$$pfr%yAbJEMT57l^;v}+nNmi2^4uhda z_Ok6>6BcxQIC5d?LiH^#97XW35%(|qF%oIzL=f-X^A^N zci`JxiJIyl9^8%xT!-jE(T6}QzJin;WBajDg+pAqp)dh)BWPe0EY+M_>$y*`{YCWf zDa92DECQcgXWNH$nF^KP8@?`ZQ|Q|$_GPVEEg9bL#1DEK1O#6%5ZP2=d~c$SJn1!b zcJ@`^4FaI_-n-!!K!fI6ey$x7lywhl*Cz^X;prb!!8)$g81(A#!cMim@oYd7AiS$> zoPm5~V_CAELp003WwcFwZ|pKIA<{E2v&=+yHo*E-l6 z=Uq_KMzr?DPB8l@^c!y^CrX*cet$m1sLK@u*wJ07FAH0m;$P+w+-ArV2+z#{Q9&XR zjTtEuvVIkr1q9pr5)vZ9C_8B@8L+fxpF`0R;4HeQ=anRIM1fdXqjGRM+47-nJ!YMG zT6k~C1{o@EjUdakN9PaH%Fbo7R((W#65zSK8PP?SS3)F#hc_#fA+3||nvgLfPk1ML z#a4z5z8O3`9&ANQ)R;RX>#TIfVb?rq$>uXk=X=ei+h81bYmeo0{GoG`(}>V(6bh;0 z8B5^kEesDb4?dEEm1~^OAuqM`FD65v=!S?GMp3?j8`OKW@0zyA;J)&XR*d&=#`^Oa>tvi;TZbcdr2=~&qNPCQK5w-Fyk1|M!fLj*26GJ{K~ zIXy#}A;VH58>sZY(pLxsw_E<%*zU~K!g~8l$o4m=Hup+$6JKqUt znXOgjyySScm@0!dJ-!fDpV$!(`~d&oZs)OZ)Uay!+RPh>q~q%oRN}8i_R>sj^B8P% z%dB@@nsN1xZw%{avjg6iQSKo>Np5-Hgob>BQ~Jb%m26mqW$*&(;RkVQud-*c$TIt} zka8GUe#Dk-nGtuQZFl#yxx>N5>fhSQe1o=q(=IZn7Wx^ca(JlTC)s4hF6Y8$Q4U&> zr&Igb2K;y5dNk}`4TZ3LJ2QLku=z##=v#=x05!pPE}8HlW+`D6lZCJ&})G;faNZd#+WUxMLs! z!IDVu&0P}y3YUsyeUD_<&vZOoU|*dnh}7DTWnT){#B8a3gtbELUt~a^5%42kYSmf4 zE(ojUje{3u9pNZ2G)kfX77jMs`T)a1^;(_c?yGE&WjUmaDqp!lw2?l5bV; z2S3^^_!17u3!nXax#;N^beg{rdct##&B*eUiiwOC3yP~}B%X&{-SA17CAY+4mS>SW z!9gY<6j^0l#eqBal9#P2f}40oT3N)+6!+Ux4nJ+67&5}zom<;Fj|9M5`P_aced>^X z%wwx$(0+Mq+WC9=u0}?cA9uL(+ZYv_|IVdqT{CPExTwv0{5`!6_D_ln;PYF{X8e!vfNpalr3yth}zZ@6dD_7Bnlp3V%SAfYP$5l-1Gaw6Fk7&{|z0gXy)=P=C8Z z=6r^!@y{K{9<~0r$v+M%wqoqU^!UFfyD^X!cDIdrtACAB$FMT6aJ61aQvWqi4uiDB zi7W6m%l%`zjG+ai^8a%+m9B}sVAFaj@4pWek@1$+FuSjI`uEiA(vTKH{_~@MoGT-R z%#ak3P?)@Ca}{W z?x&yb2Cn@7CnUTI$IGJJF`ZpHb^br&dWJ+1D%ilVCNZ3qJW>}x8H9fx{b$Xh1<`-c z{;i}^vv*E=ByOz{{9wQin6rhDfz~U5q&*Gsb__CL{jA;hN6eannQ}SdlK<4bGF5_sg zqowhSV_C{-JJE20ZX!{1W1UxYb<|vJjT@Wp>Gu2m`y5TDVwG>#&3l*oqBn+pLPK%v zaraAkM_4ul^#Am}^^F%N-ISc~*qEr1!HHOMz4>&w?HFh5Ob=- z(3GhuMO3%xBC8Ifu_IBBCj7{0;_oTo(x|a|qr)~teAKe+Ow4Do=<;jY%^_UiA4x=G z|DMObdTVt2P*UIMV}TvPsQd2nn=|n+gQJJ7vw^~Do^jn42E3`F+B6e4h3i1KgRr=+ z>Nhmyl^atW#7;?|lM2bn0&Ah`1_zO}x83jhGzBcVR)$X+#tX0OFJ^E|Z}lcA3azK# zh~vC0v^Ldj{M=&0Qeh1MfBqSocSrvv}ylpE?_G zErwG$Q^hMr@HP#dEM&o6;)zH6v>I&rN!*kUgJMMVk}0@qT8AqR#+~3Q?ipqpxSC+d zb*;;AhZ0VH?kwBSOgigpjp^nvkZnIxO3hUj(C}GnqYX63j&(lxA|gyYFP3Xd#HqlG z4Pp!xGR(Yj%V=Y9Z$Eg<4m4ZR8a*EpSTY*h-avPHjGbnP)!t_yje6&NY1|6-#qSgt z&-XfNQ9Mg)c|EZ`&aD>PoE9})DTOM|sv_u7$4Gnp*s*X?EwP(^27OR5Uf=6Io5(M( z(Pjj)5=ZHowba1om}BO{XP33-pXx5AuX31w*t_)hoUM!+Lx=a_R4`Xlnlv7DoWy5| zLSo-?^%R&ji|_h)xHWDe8$W%$A7EafX5%1YQ%M+4(pc$ePS?^TYn&^wd9*K&YLYZ7O6)_kZSSNzlX=;wyA8T$@j1M{=@&K<`P;cn)2R#yKP9oyqn*JYw%g$ zMuU))(dE7jg;XJnQ%-r3LfCaHgxmGjZ{blYA%4c@U1HqcUab@Po7uywSnZ)K8~_@d_nT@gc&(S+mp$k< z@8{n?NE7wGKGl(n(z1w4-b#H?upfxt0$o+7PL^m@ydS8t;~n0LtwZSg`E%F7d5U2o z)1yOs*W}sk)0Bf|jv#j4Nx#I%pQhSP!-)CAv~)c)19M7PsW$I$AH%_ECN}TsxO#dw z*9t|9vnb8u!tsh&$hAwy;{iJIYKHZKmHku}94>v|aSXBzN z2&R*f6}oGgrl(mgcKT{poIdu!UVCe~(5D#`obn*w1x^?@zFKhZ^=lAIpz=Y_B+IC- z;d7F)bE&a2pYW5`a+ojw3@txYKQ%YR%T^Udj4zuoPw@BTG))2%^yd45VL02N%2Wav z1kwWL`ekPp=mYonXX=c*%0-_&=I)d52cuAx9c-4c)RFCoE6Z^$6bM@1sUkJ(Hc|Zd zjPWgv5G<(<;OZ8bX$feXZpinTi&euP@>SX~8XAiO8I4)r7`l}io9?fDa^Wr$)VSM> z{6eLQ(*4M1sFf}sjV1-3gv$V`5_P(94y==RA;3i585~JZF)Yd*%wo*jRD+<$cgwIQ z(lwzz%}o|u@Rnj1?RYQfEwY$G6pGc}sxFv+{W2%0vfegCok1tjeUM@_akT*whvr4E zlsr?Vi&k+a4ol>uw&b|u_{4)!iZYROVW}y3qymQma$h6f@Pj%m7c`A3To)zeHiJqh zw-miWGzc^y4je=Y)_WcI521_pU=2pq{rUN=yBRC@WfKg!jw``T2E6GSTn{(jH_QE* zXE)GO<2a4O!eQ@tb=gJv@T*PcpRlhJ5EEP3FgD*A=OK4o!0wJhN&C z{8(a04p+SyWF~OPxZjFTx+4%n9cg?`g0r%Q0}YD4(4^9b(dkn!7pon7(LOG%Hp#4! zTtdO)^=NDZdFL$+@1!u%F8x5Zql?91e&8hMj+?aJru=6u^U=iXCj)LhEPd*)R1 zq>OXg;yC>8-7$o$3LzVa)(buYN(7ic;lpnlfIDEu|nwe(F=an9zwM_MJHo}P1?Xe##NUH z>5OI%9oMoI<1J$}!`g1d79A^fQ&|f&Y6h>xdLjP=EwlG@sHj|Kgj0l5*}l(Sz_oR0 zcHV<3ZX@)?YUP(HSlAA=?>FB$ctqd#OQ88hq)qQ#i{ud12x}LU$SyEtnPqU6?CRyNgx5Zwp{GLjX#8`;7d$22tN5v7L zsVGTZgtC3R+WtcVuSveH+kg*7fZ$WGQ%CLiaX86mlC&umzdRaEqjck2T*NW%4T_M3 zlRi4>rzokAdU<`xNP)}}#zRL6s%^9nx^Lp6eBo^6R23+ZS#3$2%Sb65LpS8RtSd6* z(!D;Wtn9Vv`rme=8-HLqgrkrbU<>GT3QLu~|7SkFrQw1t5IVIQxuRUZ+Ej}AS1dpD zruC`^Lq0R#=~q*L5c zy{s&qeSEmJ`~(rCJAzO9W4`bsX|X4=WbtkO5j$Y7AqtXWCRSk*U|@g7LjCK1L<^Qs z0fwte7C%SkpKU{0|J%C&j}tEa^)8}IejC9vMNtudtzhx;-*);e+ko@mo8_AWcB|s$ zuHnXC!&Q+Uux^VlN2;NJ)ucETuz{7mZs%S9dLh%2q$0HX09_&$pi2x^XnU-mF4uch zmT9#!tvt#ft5> zN~4xeXK>hNyd7Vx*IQHM+S~Acs$4qDa!SRDd4{CL3PUT2q*)+2`~6McR`6QhhLdY| zZo%2qxZ%d3+|NjXr%bxqZ3gjA9F@DwyFRTqz2CEprxMF`qI8QhbbSQ08Z4pS1z%80 zmX(U~HcO9#kZ`BVRX*4oLGYFNsn9j*98*Tp`Ebo0q2zqZtswLmUQ=js4Tjets& z=;?O;9+et$Ta!>)py%s3S!efPM9YjB$e`UIS)y7&Q6QCoC~{dSn@&FX;@T7-A$^&KP_%iKAp`)ftcRYbLo0Rg|5>0FKT|cLooXb z!0q#OpsABN+5|(%WFzXPD@S~S;Cf5Ca~!6ac8_aFu-9trBMB;~VvNt@YG~GqXLAkV zD8@hpWuSN?jYL#Dl8`HZqntDO0dkQea5X28zt88=l8{Mu%brQEmcQ%`xuhBm#VFbg z>t2OKX0+xD2i8m$s-Vz<^P^jrx9H~v!&4lLcaHcJzY2OcUv9rvtog|5;MsDd+h|uC z&#WX_IG#$6$7T|XEkoe0g1!cS^YfgHYW1fb#%AS^($=V2X51lXUef zr(3~Yp7z#Yj3LOn=i@??U6{UNfuh^)@~J8k>iFi^)M-Q7W~GGE*8C~PWRs9~bD=TD zHOlK7AL8@ULMW}<*=C}sJK-=rLujX5y3yk40?w-VL{H%6sn`+cQe2^QQUOG5I5e&( z-@fn6-m7&M9WRAVRu_fdf58Fg=Z%@kqTgc@jjD3_hjR+4M26vdf2}rKg~wkOU((;( zDdMx2Q6Dbqkn5LZf8elOeB1f(*hu)^Ra_FAnQE@VnhEGA&N0yTAf3sroyeeVwk&Q8 zNu0De5Dgtk`7m3)NV7QLOiPZ+|gwr;$U# z-t4dwOBJ!VugfQf^tNL!KxAm?!R=_-E#>QuXUx_4$U?26*6}D0&x%33XOpd1B(dr6 z@%03bVvd$sbEOpZjRK<*+}YNYM`t}(gXZy}gwkUIfO*qrc}~h#E{ML`OEzrK@nLv? zve|L(828pPPMM5M?0e><^Lv5m_8iuNURzN%@^g}Q95E8U&^67fs+4;g&p)hZERY>F zpU3nW$0WQ~vC@yI;BgI#JNb{Q^h9eOtz$);D7IaO2dYi(bgQMHNBt^=-34$D?(VL|E30#VjP+ zCP=a{#MW#kx0sOMUik!_%kgK3guj(1RPNEV1t_DVRAW5KAP|ASGXqWLatJWv1nND4 zCAjOH+Ff&V$C5c-tGQTdsBCA`WT;V^bQS3i<6EIF&L}?tB}j9aYfcMw(su6j1*AgJ zMG6dVYD9h0IJ_dcBC{Sze8^g_4ic_Po?+61zty2gGGh+5lw1gR)oDz@n|O`e9iZfdHQ@c*NmLYg98ljeUsr? z%A9Lo!lEMBdeQe1j>ukG_dd(>F(DwZAStb)Q})hnMGHm#ZTnEuD%J3>)yG(nv81F| zdxL5PnED|>pd#lC?BiN!>lG8lu|qHn)oMSgFk4Z^>To=2AoDKuTmUH+NQ$IzTQ#_y zF16ezM7{I4I^dK%%JB~#m3rq=p;frdH;jdTP|tf ESV%CZb7j{fph;j@QotB~&& zFNeRwtF){h--X`cHw?71RvEuf@*N|;4M5En!AA|fwcm-1f8&101@-gYyKwe-J;g7Z z$=yqnBHwaddUvYCHy14&i2SX2+m?y!6C|fMc$C|K4dG|->{UkVrD1Nd(RhrEd?DNY zv&&lpyq}q@3BPXa8sMsP^9E$2K?PE&=aCMe6UZ@i=i6L+;CjZ^{NBl$tE7M>sc$B& z?_Ptky#x#enmY__KRSoQ6^!BNU?EWR?CTDrIs;ITl^y%7oOG$moB15n#YP=3owMyx ztJgTn`^XH`zwF22Y2y~uN=;PUzFOe8TyfWzKqyq4e?$hv{*W=>PudoE8heLbyWaOD z8G)FAtMp>aYk-k+aIbz}rU8GZq^b6Ug6l=M$0!Gbg>G@d!O0qVzk2`z>)xUBllHdj zzUpYf07@kUvpmmXAPs8Fd-LrBP$<&77Fs)}S#rQhIxx-gFyQ; z@kS46g0syrtHo#gc0pAvQ}8SZ9^&jO-+ksjUv89CnW!>#*G(8rX9c7WT(7ukyzS|g zQT24~;tsu|LvyJ^U3c?o=qOBiH|s${0*mI!^1$L4k9YCBRF}Q}8FwXD+~BD{YPDlY zdgt`HgahLmTA7mJz|)(7nu9P(t@Q3?wn#d!3hRX$?eYS={Ja*~obMYgJYUCQwO%|P zF=oMWzlL=${8hT7@KO!1?G&H+V&(*_?K`eMK9rPc(cjJV#j{(eoiY3 zG>B@iDE6%9!4F6H^}}#b?u+8`;Y_TiR#J~TA}$Bf)On7!vNeM$zlP(8(BdBcw)}FK zpu?I1$$qX#uWs>~=)pD=}M-Ezd zAE)#E$Gi~LO0b4`Y0nn@GoPia3@Y6h!3KzM&0p!PG#jiP=Cwuf||n5pg{|snn{7zNi_JEZf>j?h}q1{pUJ&VzBzo+fC^ zK&!Hy6saOxiw4Ac~QrBQ^;Kp{^c^Y)>71SUf)U9I#pnT>Y+I+J$CaNR)S zTB&SlfZIw|p8>zSUg%QiQ?%tm1N7Z~{EACQ1y3C5wrMRt4zQnpbR<@_3O#UdlRrzG zBy`UZ@~jRB^N6nNND|joXj44J zoV#tOtA=W+>d-f>{HY`mJc4qCa(COWHTcgwC>5`ZjO00E5?=219+af>9J>qUN}Fo# ze?5!V-B2&GGsilNtfR=kCr%iCz5xL9( zWd_8dCYJS(I}3ZycfQ%HsH)A7iSE@uqehc18!8{jLARak;A1eCW9fBrRB8@Q(I1=0 z?SsgSEJ%&>Q7+5~?_e%b9XOl?`zd_Y1Nw%wvAz)eaWtCFWqp^E3`}%6JGypfY-mfW zdM>H+jIVjIrt0Mt*jdMLcLp%2uUNzA&Q`t=53u@J)wx;S3hunwnW4o4wN$J*>@bHg zz8H9z!-Jrj3EZt)Y)JN9s^otnqm?JEtoB?}XMs`UScb?}e=&$(K~P0H?*q+y^lNlf zI=xJFJD=IvJRX`Far!bpPIpUKJ!~g@#5ipy0o{q#`+Wv*z?}vI_PPjK$PBUYd^%9C zoIq_V zYu1cH$EUf7=kr~WLWL_!B_6M{-&%!st5eqp#)#HZt3o)}!@~~zY<@^7x@wIPs}c-M zuD-q>>34kWyelhhYmr*EPyy5N%qiS#a{SHZ{(F5{E?7o#*>Q(&rS*j>3OIRuLEhcS zCJ3^6-fT@S*`F#kI~5Q>_p}*~Reo4n^oT)?FK9VR!U+9*Vb@Z$W;uPfmh3$l2o0YL>QAh`pT9-{F{u9Mz+Qh8SymocvW`z2 zB}ntulYhA!m1)l(hmDc=jd^P$K<~rG4{W5B^HzS}dgTX`(Gg zAv^oy8fpcLdZUR&S#lAnAU^6n+3IUf-4t6NPtb|QZaEX(e&*?jVWR>EW*|HM&j_3r zPG1NL45wKHZjy9I&anM){8Fr9mXLzmx)DO2Nj3dz`5u&W0zjr~&U=QTGoA?B0k z%^9ppM=hbvzC?4P0`V>45yoS((fUhPMduLvU;`uz6_%IjhsamF!dwr#J9a=_eIYg& zwBhDgiE^JZz6$X2_RvVt&k#j|=1TjppI^v!x1*%wSo1GSW%{|k)50KsXM#S=MdkhY z0Re4#4i%}C!F}7#n)))+E|FcbGUeLot>JRsr~MWurbgSVg9VE3?SZ(80j8vhR%@}w zXE#Z!++m4=6PD)`&R@Akk6Umtxpq_v(w6E1t`o8E#qqWZ`+EbkUR`fH$E&_Z6|&*k;^@vtmpQ+3gV*vpKuKKrI2i zpZ?~#_FgN|#i?cHn~XjMy}{Fw8a<^bc7r_1%XL?ls&y!*E~t-8hY@5do7bc-rXL~q zA?rX2s(VxT`I!K)rdAVje2>}oPdfb%+!F_1|EMyjLac5=5vvk-MU8zDp>$6vT^JME}40_HPc&DTfDcyQ+4XbqX%h8vfLw~m9l zYW(`&8KA+7ni#~>S17!!`H5~AVPAOJkU0&!GPku|R;aS}9JV*c;nSc^Pb`$L*AZVp zH9wt~umjD<@NTSs+Lpg|Pu^tW|NdJ?afOgYuzWE8d#Jf+Y)Nu#D96*Q{*;_~jBZmX8!9XW5=S zMbk=0p6t(v+bw-!I)jxmDweLuVhk(k|7f^UC!V1Q%X}heFI05U3L;uC>a#=r`RXRcBrCWy&dn#a%W z(o>rNsT^Ym3t2cn(F}p#^$Kq8!uY{-qn$U(kl?()SgACQjcQbr+vYBIBeQxdw~UQ@ z5*J(4X8m|YcqP0<{I1331)q}VOoYRF`p%eUYf}{Loj~GUdG61e}eoXXZX!g}^HE z|BlpUqF%;Fg)>Ui!?H{;KbpcKR!+^=zUE{zNE@U~M4AI!>fhmP#daPLYlaE&9}w_4 zx-B|lAkU-+W?ij{)?b(r&^>YI-{Ei~T9kj{Hvp*V+XaA+a3n40=|s%XioyT>PVG5B)u`}`8)W($_s{45jb*NK8HWAE zGAm$!OaJdzfF%EKkp!NiZrp;wpB>~|C;sE0`P}~EW8FuQtT;##)162(lNa|8dW?kq zR!H=TG~PqutC?=cBo$#5uKj-^NWXWJ9-`p$C9fYJ1-Brz3^ax!XFK9CUvQx@nWka? z(phLDpE2n9mg%nGNAM1&p;L-9k)smwQmnorVAO0lVhNW_prL{u?Ni*GZzUwH9?%cS zrC$tJNEK=3+x2qS011q{&}+81LhlTGd!Hnp_59Tut5)e>4kcw8twNJUQq0DXcos7t zn}E?YH*c#s$wO+EA*JBBl{w9mUbQ@~d-ZkFOMU&bVHCMk=Xsdb{p;p~mDW|uLb)Va zIu#mv8T^@qJr#P1i-p?LVd0+24gxZWYDEGyafcd{b_<2BH=CBZO66Nrr$fsyb_nan zQ@oGqNN6o8K_hfp7TjoQFigU|jw5s@n-LkC3xHLCUG%+$z8}&{^pA?!vcLI^GO0AC z`<|KP>X6ar=`#3Z20x?IK4-kkDhX)}mqVY#9-~bc zQ15ZJVwHlqb3%~>`B+^E-T1!!84u)K zB^v^OZ?x3jP)6sc6whA^b7xB=aT^K7=Kx2xXOqi;YO(J5LE}`n1Iq^;cP~+(b=iiCIpG=g#M{8lW7;X> zZ(ntdZ_C^Oz?^N|D0H#ovfp{KLMH6Jn|}3D%}jyi65|~A9xteMJ=v9+N@5YNDf6ul z@gHNUf6j+5oU6p7ACFD#946)4cHf_UYGk77u-tDT64e*+qr%6ymY-{d9ijP0vjCox zV{2oa^36IS>S3xveo)O$4xi?#49!ZA%viku*oH>_v*thortb5%PCiJ`ggb}6YD?8<4 zZ=K9bTC1}qjt@;M!SnK{u)e26Hivo!^;NG*@l779z7QI;p}%D>QAspcG4MYmH(ZPm zdPdUm)S`fm!>GaZB%4KFyTh0WAR&Vhhm|toSkh8|)Z>-!#Ku!Bkd_Y_c(@yUHCG>f zBQ?8s$7ekDYCC|~{u~K2b0Eu2q+cePqTWI^j(QqPBUk;+RDVQT1J@G1jaP4BITid% z1T<#2{TP*Sld%-$ly{Hxa!2BE$CX1<(1DJ}BkJALNgj~>MWx;F!9)Lfe@#FJ$*cSR z41U?%zv}rWFF)cW%%CImO+R*T zg?1zVxEMpok_@yjD1c-%4m(+aQ~iKI$w8+e@gH(QY4|hvfmbBA zTPqc)L!lc3#xq}xi*p+Rbx)wx?x9iaeBu(BwVKaI9x)b5#{sHiCs9IhhEg1~Dh9V@ z@PXi*^SdFIJv3x&QO&pCiL13kazH`{Y}+N5^dsN0$n5SKs!x^WGi%I7=DoPv`zE(6 zHoxceg20RxF6Im=%t9vu%K;%gA8ruOY`$8{*6sJob;iEs4uoYeL2D8W!(<}$xH@86 zN^7uWBPSRQdaN^>S*{q~^f4XUtFLC&pL=JMZ)aXGiiwrRVH1a=<0W^tHA;><{mg8# zs)C1E?T>ZDh}Knx)cM3A+hD!R%-s3d(9!EK2=tK9Z_%la^?4vGI6-QrEHmFi1~PzL zBzF}lVUgh(z`)5h%~gLC*H-eWsZT0=7AAuj#;>^t4I{7 z-=Dl|QKyvjo;|}X;?(i(53hTNL?rNLZEf;l;%lCf;1TDFp=uko^d3#>z1J zC#C`i@ub+trCf(wUGyKFIJW&}l+=RKgP?O?C5WS^sZ4Weilp&DbSQNJGx0za_}!nj}ZWFiUIW#q5!1=>u2%nR=9GpARuI1F*G&A* z)Qud}Myv1%Nh;Jd(CY1f-`vm9L&ScR1u?D(Z1g|D;r;A<>vxtw`8H0WtB0*%WS8!1 zKp#)v@*i>?FaovAXV4h6Oje73Uj4t{{;q&A-S?sA&*3i!Lt(oG7}Kq1;TkXg@Jyc} zeIp0B1H|Y@|MN$BxzCdG38o|X;-6_*dtU#k1@PDYCIm)Sqn0g2%E<2T7ZlNLu;yw^iEVK33i#9(uVB#Q{+jI3g7z5MJfP;# z8s0y$0vvZgfNelZ%8K;w11UIxF$~GXZvljWfBr0p_S>I$9xCxaoYmaDO2|1N47KA#VNKg-N4$QVpN|&tMUO`}=+VM)B_`qL+XB zL!1hUV*iR&2;ePa!%|TFrQ?wLZUXd=5!4BkBqqprw^rl(NiT23Q?!4dPmwMd6ksZ` zLMSGimDJL1ddKii(>1xwH7_MxyGAaPpmr>u;M$d_Sb?E+oOj4c@7F!w*^elC89TNt z8`22L9m$GZC220%3MKdHq)E5h{N#pevVR6?%Z>q@a?T3nGCYx@cSh-CUfd1`;?r&} zEpevfchXtOFN(%=q6eR3ST$N38JMz`H5SU$nBqqnCV~u_LDYpmF|!7S*l+I(FjsXr zqW_Uk1vU(sT2DHu1=c7NG!@h7DAw{#H~ZB)jxUAh-F4fHqgm6+uxDZnd?U-5NPa zOTDVl#P*==){0kZuf4^B&A`kiZH5!W(L_bfm$=+H(kqNPG8NLke@sX zRg>R+t|KsEf%lu{&C2iHD zcYdWJ3+~F@==*A@C|K?O13_&hakR#M+^ktPp=9W(lzL8ikUUEUN;Mwo+!wp>4nvIy z{XStRX=d7GvG-N56^+2e4)Yg2=k0sAxCaZB4q}3iMQqBdZ-QoKi$Fu8b4xEX1%8(< z?ubAcXsHZ;GX0WrbybbEPkh_e64gS%(Somw8hfipB$(Xa^r%Kc+M}?fM&a}l&;Doc ztmwjLAaF@oEQz%E!k680VGLt3_lftK{{SINEVw-JMM)i30w3Z2*(fOQt3J_|*VXZB z+GuiN9dkAO*7ZSAmAXZ*w(p}mKT}Z7=0n(z-T?)v+4jZQx5rs7PDnK?0M&W78wuCF zk(-JMv~@3OTkO!8eK;)L1j;J~$^b-l>r(CSgd~;2^piq2`7kE(|A>z?5G~}`5JkVY zBc)vvByi)B-f60WbV{i!y=2Y6A~OxD(=8`C*EK(oMYh0(RRz(DJA4wfC|00o#T?0$ z2pU~wjDT#$zB+!_D3Koq9&q-tjhLo8s&Q{d{W&ZVLG+thEFd7DrPR--3dz{qpw%38 z&*qN#S-#5If>p)bsvL7@Ua&jc6f%Tb01$~yJt8v_Xf0k#jfJqd-KMVFug5ilk=15&ku55JOJwsd!FSHjVH5-6x-WEa8w>ldhY}0-bds z_RU7AIxl?6950XOjH{Kxx-O;vupr|<{#H27uOeIZ`;fjhB^uK*1N5EG)}CBm!S^=P z;Kusi^Y;z9tvO{Q^RC~%X)&sb!26)7CwU+0h$U1noA4xOQI;HN*wMkN+Eowu6+2w6 zC{b}OTQEmz+SIlrg*6bx$>Pt=czvVu1-ca!=gsoa=ta-8YHt~~+ojC&=R(ICHkuO5 zxmkK7i`!Bn&`lcok~CjuvbGNIK-Md2ZH<~jDQlTNjPpJ=_^+*5x}Z3*dq}F)I}0KC zTR1{HlnfXRs^YgDXcjYXn*LB8b4a5B8_mz$x2F5pS5FTdN-fr+l^~+5;IY;+NyXAJ z^V!Xs6K|MCm$bAi^_|-oVodn6C~Od+a?1_h``eX-#a$q)Phtk>8) zKFGN1-_Q2BbO`c3bMGSs1qWYGr$EbAOH{`yR$HA>GpllU~3o z#-lgvxYmtKy>XG1NRkzMQNlB-gx%kSTivO42RcipqfweA{!#>6htHyWwL93m&K+yJ zK6RPz)AB`ey}&2J_#hfSf}Dx2eOBN2GE>R^*ECn9&~gOfQI+qLHK*@Wa?ASdI5wV0 zenKQ-06MmG#^}4xJ`Uj!RNpQ6pN0E~{RmFkLKO^nTTb;qMxB}jI;UbHZ5<5W8L-5D zD7q57$Jy3PtG`LclbCPQvTk-bQOpbId3CEd^^2UspO(OEFX_uWNnFe-Q)N8w7AGV( z8UHQ5f=|*f@vj7Krp(>)-R#^p8Y41?C~%2qzVt^;Ibg@LE5ZA+UtT95jAp}l97J-% z9nk&t5eyLXX(&e`!58@s`tm&E+KM@!E#9gSewIS_T_1}H;`pFnA3OT}nbkM3Eq9aH z6uRe1?1D$ifk+Nv#zXNdu)lgE0%IcKGPCG-ZnX@PF$|SFd35JScZ;+!D6_a zQ#_^7LCuTp@ufB$K&3%M;w{BasFKMES1M;MMWt1Df3qUu1xaUNjEc!Z^Bk&)8CQ8!xh;De7wK50 z#WD*G(eoMSj=??mZ7);e=!*D6>C+Gn($fCY__gObQlYGL6lky|7NarM&!yT7CJK zvtoo*cZVR^?w03`tfEvsSe9Ei90jlpK*Dyp4Q`4V7IXg7*2LnGl?NEmc!s&!$}9Cd z^BbtK;pz(s+vY`3^PgN0dLhz`mL8bEMXgZxxO!=IakMC7|4A>b$mXxPW7_C6wjHof zNt6_gi8$hDF9P2rK2E|bQ8VZzN9H!s0Sj%4n1}f$*f;^(X7~Q^!%Ju=8_vTORM*>Q z0Bs*Dg+0z_5=jF^;3=wlc4h*}a;I~7KI4^WM_y5Ts~a@bKo#cnMEZC+h`#yWVhTEZ z6)Lxs>dZA|`zMJ|5ylsDD^i*v+V8bRcqiyB`z#%ZLkDW1=!2YK8l)$>45vh0_OSz# zWg4juf~UE)5UJO|>fe?j!k>JBB;l`jCkO*ksfsIrUtcS&F!9nz>iv4BTn)gwhnf5U%>%+?|8ZEvi(xB}U5q3H)3BG= zfjk+12oAQ${k8N{LYHx?!JLHChfGd#&i04k{U;So^*;%Zu)h-^S>ls}{y8%N^DH(+ zumq1NW#qx+e|$PLMZkLz{*smOFOysaxH7qyV%qsP`Xc;0Q&s%5*8Y!Ivhg#qz33)k~BN0>}S@OSa6Cb0yurVHFaaYv$w^pReVT@v|@`<=%#4ze;l+Q0+i9Y4EnCDuWqaZ z0JzkZ7qNDmDc;715X;6#*hM<|y++}9deV1GTDpf!FNDo0p;Zax>6Glnz$fAhNM-O) zzl^58WY#1GfLaTijA~N=x&Pvcg+c47zi#hhw!u%ugD#fq{VybqHphZxm+Qk=5zv#`OkuJ+^5!`Gs^^3n$VfaB!l^v>5x`}( z9+_OU>?$%Jq^!Nw+Fq3X#{{oXgc&-=mV$p@BqxSc_DuVzO+@tJtW`RVOP3q!+&&(w z4~KuZq+8?Ihu`eEoBJCPssWlI zEEG$w0M$0PQU*w(*Y|EOFijWMQb3X!;F-FE{cyiekdCc>=RIz1ilv6*SfEzd;N@I> ztRLK&8@6!+f)ATCG8O|V0H$-!rsayD4CSFZ#x$cO4R%iLh<|i#a{M$Wi9cIvJekGg zqSODxFR=|!DNV=H6JjaDhP_;%6~>!MB2ucjYJ}(=H!EU_1qNJhzkFL|IsjJp5N18v z!FPUaCS^fxmp0l+p8aGx8xrrUdP``-hZ0pL=HFcDzB)!#%SS67XNfm)PyO$ivWApQ zcimD-t?Q*rk;=i%eqh<)lt*H2PwB*Rb*o{E)hqnsGRv}G<{njZ z-(vCxj5d>3jSgF6>?QUq70P2BRp9893Z(%QS@y>BB+5O~dgh!%Ba)bhicw|AW~rpv zj&_lQ!kEkO%JatJ%#q9eqG?k#$$mhSM|^ZoWm$wO-{<{~tT)ZKOb?s6*SC+oC%Q(E z*~3^)8)CDCI^XvK29`Rya}k{layKrCUG3^X|J@W0!-{58o}cY?7T5gk{Dp&ymuVEH zkq7qBdd7T-yq2TKw~qQhx31IZmPkc&l16d)UKS$nC9 zY>((qZs3m;kwpCZ96*25M;tY@>0=_Pt_}|nVNK)U1svWj8{7wUZkDTgh;N4=UVB&k zRv8(9V@nhojFB(V+fpJw6SG_E+4}PI+2fBqA&{oFB4g@wlD)Ac(1W{iZ?U@Osf+B! zdmeWvk-c`=P70xx09A+gT^JTEMdR}K{57b> z442(FUJXA=LJQZ{Qu0Nnf@<_8KsS4LSqE#b5TK{|FaXEWnyNILd&yt`sR^ZRzuZY~ zq)7Hg@#o^gOY&ddntx3XjpT6aywT6UKb;d$EEQF0mRM>w9rvE1B4jABvRST*l$bkO zOuRKHF`ZQ_15=Zr-mAVQ=4P~6o99BvD4MB?0cMi z>NDIx#Ipt7YBkO35ELM0z`4*8zOUy?wpa%U^k-LhS%bqW`>$Fpl=VLztY7zvrk&-~ z`A;S3qR!#guPc_@i{M=^t%A6K4nnr=-sipJv7B<&&4=60_^4P+BtW0n%q7FnqpUdH zY>S=pYyR1&ByIciS5_*t%v4R|(FlI1)IM`E*$o@q{wgjd-r?`&Jc?uK#^m3v-u%FL z=mIm2roM~jb#ow?V;sxF;${A!V*{-TO`nc}Iq3>c=UlL;7#JVDboOes*!&e52eKWE zva8^vMveFNc(a2^@*+Cx^2KvW*FbyYa8Q%c0-amy_<*138`!xYmA7jF_STlGU;$bC zG!LxtH>UGlKn;~*gNiE)I=vtQA92!h3~|=PDj;Uds+*)yYcdgR=T)yansj+P1J2Rf zb=~>YS5n^(!~UaP4WM44cb&a};C7hw&Tv0B10smLr-NQ5Q0u20WGtAhH1>+)m18ZT zg{s8%o8ek(dUU@|1TQ{i-Oq<`6@-Wk5_0^DGi5uYX;K^RqG?Ib7LR3+OR@IN>f3}S zcLnOObRmdL)(d4ZybI?}8ZDOf3RR26aHxs!7DGb`Y(>RS0d(wD4c#y>rQ*G}^~<{J z^3lLyNe9F^d#5KvvBt<&Bcq`uT?@=NbP2-*`y}Y`3_2hAflgZI20aiWRXFu^VxM0+ zah+aiiDxHq%tKk=@pcy|)$h1P_}*h{(Rq0+lQws;W@{?pcbwO=e3UK~>HXYlK)F>z z+8(>MG9X?^9YHXiDDd<+ryjEM^HP8>bAran=Hl^tx{_w10Q^F&asAM;6b%)C;FOuk zy*L~=uWT!loC4ET34gz7Adc#A@2DId`W9B} z{kxx6Wv@VYu~lr-QmJMtG*rqZm{9Dq_o?KUtVmWT?_SN3!5RzS_+H}AAsB7`T#av* z+Wp2+A+ntJo>TrytH50e1GuHf6LYOe=`sCfA9Zcp#6F$_U(egSTb>sqUPsb97JRn{ z8Y#c7l^tX_BdYsn%C)su+@6#i9#5)ahYIJmS}O&1I;d0k*i5G91&q4ajkk#r#MH+! z5?OVf>;(Y6;v#AE+jy35K8Gu{a`?;BW1bQw=hE{CjX5z20U`-sdwG>SlU zkxjBzW?w6put}l_h*&PoaKk}xbOfuyg*ZwzOAA}h4^Xi0_DUc)%rx|mxUNb)KZxs) z$qbNk;=9=caEyc(t@mA+PID{29u)y`D}pT-AkI|s%nIwoP7(^9fu_l4Co$M)IB6$c_8D)ERSF;<8D*AAwY!T17P(nJx6^9EQPUe=ZSQ+9d^}wO69Ti z&_wBykMH3we;kjb%uj^iu{Cvkk74q zLhUO>M@C+bsd}lbvad;`GG7K0^v(7-Bb1+jnq=KRJysrG-oQ&jc=4$GWs~z8L&QeK zdOECv@S4vsp}$xF*0@?_LRFP|hjZ3W4NyL@UwglK)qy}2x2ZQfBw;S;7ATe2k0?Yh zv8&56Hx|Z6oWymGordCU@oZsJ@+-w+(U+qDR-IJ z{$&Ph9)#OEN+e)_pZb7*2VEaY_23+SY3%NWD(g3Q@TqfD?`2fXP?f>>ceF5fbDq$}RNf@ab7oa9HGS>C6lj+&(vwkny86+NfB)l8kE4(yb|gEkB`VgP`= zaC;&;h35Mk&cw>R3&tO{FK77ZK7|O2=<$wz9@9DAyW|{E(|D=P;WvL2sjps(M=FCn zQ(0@xpgP0MU(!zUUE$NlEQA(>Q_mZWkK-g*ywKzoe6J2P-hb`FW-QrUx=@7wmL7io z6)m#?>mx!!ImsPVu`(5v`ajf_39T~6SLKD zo_C3M;lxW~FWcCy{K5|;k#xf3q?ra$p?ctbpZA($?Mh%t`xDH7BUH?#0Yv`!=(0fJ zCFL$3Ldung8{k<;@0#y;lPKo-I({zH1y1T!bkfp(Br0ozXVSp^Mu_faq>BKvv@L-a zG1nw`of`IRJC>>z@BM3JYXv~*oTHUf9)3brVU|aink$n6D(P`4OjmmWiV1GfpcD{g)}}DBEvO?P3If0UMrs{TWSm8?x;wjd@)$%FdFo=o-{Z?{2Rw9J7J|mv$^t zUc18_-VYDY}QvJk_=8W8-}j}q-=EsZ#y%-R_vU=BKqbNsh)iBLpsD1j)zTAd3EIDAbxL^>aI!o5l7ZIHmeWk8UYA zRvoRuJj>?_on5&K|l zTXiP*M*A9LIO^i&ecwv%Qd9q`P4JLZMVn1nv1(yZsMvUb3BDwh770#gn_PhRJ?OqV z>Z(OXCWF(MBB$piQP`sPI~#UVu>gny^x&!e*RO{DN#PFu72XjEfsU<(xfhSNF=`Z? zPm_k)txYO1s7dq@Y5|+$f?gR!w5xM~ZOpTKT}7wOb%V^;x!Tw;7+X77N)PAvi1VsMj%g=3qJ%|QFggEUV zau|3u##IY@cHiu5OK^yLzpvX18)+rIVXGKyQDy$g;;z{mx_0T!`sqti*p7WtCq#sX zT9S}ldl|d+*q&nwt$rLeCijEm-a!;+9A$*BgM*ic<%utYqf#u;#*%rg&20Sl4(*V0 zZbh=$2IthiqWPhZy38r~yO8jrSpI zAF)>zq(a)4LVR`ZH*>%ZIY5?a8&Au3nXLE`$?;GR#6(53Ofi7s_-og$ zf6^m*1t6aOshJ5nyO}>eAlhQ@+F7mOe{S!-p5v{|<2j~mUSU9|4Z;zES%RajG~Wn- zA(EPIjc#cG*+oNOw?BRQF64kz;P^%Aj|)RB2Xu!-UY{j%d=JZPtHy9gW^~(rxuEH7 zGl)yLW1CH;BJEwPb&D~%Tc%^PtFL@PQHiMchJpfIs*>-IOOF7HOp2Jvn5T#1O1m-x z60|~f{7l^D^!cu2L-MHJ`irg;WKsH+zvGz-t-t$sKP;0zkP4~Z03bID$UVo5WO?DPlk zCaox+h`n-ui5)v}mv{wV+4pZc-YikDUrek(`Q)HJ`~?=14#FQZgltgbzBOm_H|`em zOO8(Ap)})9SdX~umtcg-81Ma`>3|X|UR+JDN7n3#`rN!}i z&+Y%rp>d2~n@UTE_iw60LVvtEga;w7L(r@;eHb10FvmP7mPs>|d5PEv99gng(!l}B zY+3U$G%}n1xBxHpWzgD2w=#PNK;(+VodKdn27Ywo`9k`;Q=n1__Am3!Ze|DWK>mXc zJbS}PXy_rW5f>B01i} zBH1~bdzmbV^ig#`>XNy5YaG|-G{g#-WUu);O$)4qO2_wI5aPGK5eGc|-T5zP}>pJ-!poB-uxlZXNlNHRKt--T4$ z*bG1lQU0ZHh!Y11hADMMW$`l>j_Jm+?Tt5konSPg8S40jR}Iw<~xu# z!Q5v)y zN{qye57jDBV!EtFI+m&wuhb8q4;>Nb-NYAm5^(XO`m+J3jV?kGjaOZ_)ez3fMpK{% zs@J>5FBQ$%l|ir*TMi}SwbRuZj~{RGpXMl}TnLh>`S2R{dj=QUY#f1|SDUrL`RA%b zM&`1rO%mbD%N^A0mJLrV)l~tQO$I3j58y2s#h!p04n(q5>~?ykoFf<;7HLTEwR>y zExszcuhw6v!@WpC9`{xb#gOEq#zA`RY0-#DlALQ=@(4NUB;w3t+B$}Gx~UEK`jP5& zQV;k6`_QPLPdQT5HeI9tTOK#;<&`4RRI-a|67ufUK>@SjgnTH-RzfB#Qdv)5p5R)I z9*Q>oXp}@MQ?y6j=M*~`7M(}eQgbk);yssPnS~vO!@s#`h~wIhCLWu_wB2}n_hkM{ zbgWqWePM#~%sUuKOrwrzLzB?#*yu^-Fr}%^xqR0OpQZaMX2SrfwSlw`tpw3c#H3ST zRbr3QI3}sY)aHF`cI#1)k4-GNS$0s&{ImaN1bjS)wPPdQ$m>4Yqf%T56(hw%7G#-9 z#w_*enq4KvM=rS}PR5B)t^6n)x2kcYKb3R$+ks$l05kk9q2bT-nXRPP*lT+42++Kq za#-opHC0-EN+b4A3CZ=AIu@m=W+~6SH<~UmWVY-e1cJ8JYAofE(h{?*r0`wn>L|aiFPn5CWiIQ5T=; zt1$G4MA~reC@`VH87C%p#;!s4z^V|@0t`P%7_5YE7(glvZ*r{qA~1puRk;&lW%hD_ z1Ea!H z>mKg%4Q8~dZ~qX&$yUi?))Sdb4f$rmMLwknp3s{g`e8s@V3e}S{CbNozIP^{6`4FJ zFy9=j%cv`_mm;UMOqHjBzwPpDg7=3cMIye^jCRmApj)QvyX}=6jfT>qA}+?am2rMi zd&py0xZ2CH(xOn6D=Ss{k$>?1l%^J@u6zfvTep$cnV}L9wmNj8I;e*HU0A+i>^Vm; z&YAq5%>@!nJ^i5nBqR5zP=3Qmr8gF#MY?~Tt-!Hd;;NpO=+YCf@A$ryUykXUA|JP7 zeoJ1JF0BC_FFaFr+hN1NN~4SrP^9vC0h7I#cH#&=JhZIyYCMyYY)`8ccCPoQ~yJmoknttQwL#%;``tT zx4Z&Qv30%*zwJ@0O~!ae!0_Re+Md}WmR6EnI~s?x#mEB%4qz?!K?m8%5dOzM}Gx+;@)Y!nPkw#{xp9`WE?{78Q zTfM}GE&ck&)AecHkSS1&i}D>!@0 ziSc!R&p=-oE%?Blvy5cZ!sgA_tMwtU;S-smv99Z8=&zuHjJaL>6hzRoUw2g1Nx9&v zOlXIqkvy^L-bJV{dJ+qxQJQj4C*+~7;(n)Fa`A8nU_M*qnctnLqH2t2$`k&Eu6}J; ze&5jbeE{kkdVgW@Ag`aVMikvSE7yxZa2^WdB=&`9O7yps$Uld#FU*64@B86wR(0$@ zSosCQjX1<4CO7=)KRWRfnIQU>Y+7mfe+@lR zPNH+{0l$D?sVY%+<$0Jo>jml|l~U?MlesK7=wh?oEspmbGpEmPmoYtz5=l2_V7 za(4$q$5M--xWMNh?jTw_KA%3sW$$B5^|q>;71Zmq1tq~%j`u9*AuF~Nhs(4!E$82j zjEuPVGx%IUo;SOk+uP%=ELVWjvxN(;9&7XF`OlQSJ2v<6z!-!O;SzX-93m-xA9YXlVytM;~^>} zBhTA-k#mk%hUMb1@;T#ucyd`>?ycK+uBK_DZT}nwAtA$w9N&!(>E&B@k7raMDV67OrvBopPKb>b3}o?Y1=NL5g{>tkM0uLEX_Pa&26dqF4cJ5P7Fj{L0<5++FhvgC@D$p9bJiZ0JaRIP}Bl z)M}KX2nOPW2EEdwYGn@726NhQv3u13CQhjz_EA|F#aF5v>Zf^>RmycJv1qyn-O{Fk zVy4@+s6;ZcHoebZM#Fb@s2aBh!@(O>E08)VEsBve_PB!s0^H{=#&a^2`01 zB#ZI}HFKp38r`ULs)?z9uTP8jCoJ|)-@M0V?@?&Y`E3cL))h^MW0&?wb|=51#D%e5 zpQ7>?W?RlRJvN*&{ye_`HQP8(pYLL?P&YGeb1A(EAJLfUm(T9+5gtoCjV}cqp1J}A_~Jcf{LLs zK)%k>JhNrL`ltgY*!#{n=%G{i%|cz%FI4R$yFY8=xe96a zxQs?L+pPFqrR-!n+RK&CDeNcO%4>olg^i78LzC(lIUK={?$?mpNk^HyE?FtBmz{v8 zAF-~Q10`ol7pOKs*>ug<2k{U&xZUgAY}OfvIlNKw41Ay6W0}hmWuqVJUKuM^n|6G% zwprIlQ`+v0o~D+3u9uEFO@!MXknr+^EU_N1zQZ;>GpoDvajAbv{P08T3Ayk?1Ml-5 z&z8Ylp{c6bc#&UYO7!i;tUWlZ^&Xr%28x|cvA-h~n4R>x@?GA7Rwz_K!F7I8|J2?f z3)MZvdfC6`|0(qu%VPl(UH5~MZKs_v;dE|2-E~e z__`jJeZauNGV_+ZCgP-$<-Knz#!NlIby*X5xJZv`&h1tSL63Op-xvQ_4y}LDrz>Fq zmUJf}BtxUDh$1+QkUDqqQY&%0>Zz9&7@IYM2vURubw%A&ak`}FsV8AwR zAl2==Dl^)--Cix@s$VRbK`O4usZzXWcNbi66zH+kEi$a53Rd_Qh_~K)R5OQ0^Q1sVF z6?bk%JHnq3`~V#+*zVeC+ZW1nn38hl{{6_D0j;5k)xv%q7FHmzVYcPrfHbZM+f?oI zCDYpLH_LHF{o?V{pM7|3+HUdA34Ko7s>3oh*Z{k*-vBI2m!D@w4~LhY>kcLMaElI{VDI}WN>A?(_ah*XK9CFqzk5K2! z6GU3XBqrschmWN5F>ug*VM4OTix7_1gJvw9<&#BulbZYWfr&s`I##9F0@DR4JA3bj zOYd8}*@{9f=hNFQQeNOMx-AAROj*VUwhO$rJ# z8faO~{~nIWtN46EY4is^@+_n>9A+h%1U9Rwu1r%hFiZ7Fg@Jp1INif7{Wu3{G|}PJ z6+01$_tw*GG8bI5k+Iuhec8*3DP^sWaO5%j>+*L|=Vxm-FRvH(c%N70Gjk914yLuX zVf-FM9~nA$5SzCKrG{2{td*hR)82eY``$Sm z53gCTAATEq=iDhPL*pF$K8X;25@0dTQ>40Ogko$5AT)obuW8J=?y7nJ(Yrrd;+;)&LaZ zY)|CMf{Hk34wWBjlcL^fq_b*L@-H}0s`RKEqi{e(tdhAR>K5v)NK|}Ds*(}4UHhsW zkIkPr8MXH}ejSI3!oSEpdc)7sJPdrco-MC%5$2D0{$=u+5blx$6NMn9_4PVkBg(z zI2F?1X#5~hYxBYZp|01X%*}SW2ubty*qWB{&;zB{11}R)sej+EXE#OimE+$bU}bV7)j1%&2oMK>FuKHTopbY z^A~^fM-AfrsveYOAur$Oy%K}U5m6a2EPZbN{N}o)27D_CO(w?;gZSK=EOTFgMVGr8 zg&`F>ePwn4y-xX-LBl!;!IE2N%?xq}U{ID%ol;rcm)9hpUK&8TM6qWL)kf^!^J;^r z23M!rQH`RGl0L37iHK@mzWSW<5RPzhG{2iNlUw9o84=vPJD7+Og>)q<$LbFVH-uld zS!ik`hQ|pCk7|bJNp)|Xni1inJ6A$B9O%=Dz~0GF17;<{?s0W1&?28&_Uk5)M4^r? zH=Q=oX5^pIJ-`+=6AAh!W?74@rac=noz>vZaQ-|~*0A`*x(L|$|_l}&e4Dm}RZ zk|ipPZV#<@&Ri6ug3$z?b|c6b1hjsH=KJBlurwT)x{0K=`z)FHJ`DkTS$4S^Mt%J zF+peLef}72Vme{dw14!yFPj6pOG-XE7@asGUyzPtRg7SagC^7saBO*bCsgxv59*7A zdp#tc?if0bm-JW}fYywz>%GBuZb=Sv<^cq?dZaYFblX}jw)D`^^55*hyGdo!!devO zVC(qzWqHp{hK64T5=Hd{kYpia6LqiY?IL&XKBBhqmd|w$o^CC679cijZCLS-PPSXZ zD|S;EC_=-O1HN&WLp{FmgOxwadR4Q*<)Zf9d5PHnLCroO((~G|gA`lG(`wSr$=y&N z5&NuAcI>F2T$IKi?n_H@8=X+{IR0b>falixO$HE67kp@7*QP+A}{R+7y zcZUL*^$D8)2cI>C38g8K73=;=OpG=m&bE^!G2YdBJW7a2q&n@O<%$;<<7uYr>QB=V z`vUqtRmhGwPHsETr$0OQ5}ViGX{l@_6;B`s8*0Xta^G~=V=4Q0236vmkqc0_M-eF-=L|_BKsab z45^k+YnOl6vO}Jwf7KHZ{mgj{#q@;g>p z*e5-BHFIvflj`TCc3*OkqJGGI7sG6)nyX>x2h*MFH(I46 zy|0Jbt}?22vvl|puM@`jAZOOnc^69**urv=su=6CIq+0(7j3y@{psy0uMj~hBZuA& z(!Ar+SF=92Pvsx7*fW1^clpBKP5?r?HM;96s~@PN<^*Tg6X<1dA7(o())*ZwYi@E! zJNLTA5uBaZ)pa1Q=R|&2*(cw%Dl{BShIUtHc{Q~Lt@3Do!TAb2M-+<+d;-r8ve+)X zn#fYRu39ijC8wU%$38c6t{8_$s*{o7G4(gxve@pBW20lMSXVT%Z$fmGP2g_tFvpGA z%7EG##8BHA4~05W%&e6czL(6AgaZV;5EeM3c&&SPP~5@@Zh=gds7{d<4}M*K>|ftV zEK@_KGU?ecqp74z)xKzU%7T!<;KzK7K&!3gGd6u9sMHOqtp19V>3ru3&0E*?)IbUX zca8P#Dhz#c=!+yT05Ib3*%e28tS_dBe+ssstA@+3N{|E+_1f$-+zYK=fnPK@`5)c=CB{%J2n)#PLu;r>cO zpcTPTbwWFt%rgE72m5`afc(qJiJ^|a!C4p@sIW@GOx&x#abDsgNVFFA^1|L0GTQ(C z{3Lzf)5)0zJ^l^g!ka_C(HG)tB_Q|{L>Bx8c~PXvRQ5#`}63*LZ73A({L9^T?W_3-?M>=!tcZ&>0Gla*=LT{XIi^H_LI7z`gMrJKh z9-MjXHL^`7cT(VKRCM5O=9~9!Ao1o5{U|syyLIaLumSiU)y9*0Uy4w(w!VeS4Y3yO zT&Yg#k(29TUJwBlDRJkdQ?-RJ@p5ul-im+o#_X-ES-G)S8NP7~nBM%M-0F<)_gct6 z_KV3ir&L^3+D2)!3NtgX-4{u96*Dz;$lk@6d1t7aGDccqNgge$Wz(XvkiAcd@B#g7 zkTKn8e7v<YE*?%Q_Bwk)&idA} z(UZ$3d2*uelh&*j;e&N;>0CUCvLWf_l$7S6v9|dvL;nuf0vMdlG1TORtI(!ULuf;y z8m(g=)~-F3Ds5LR(rmDm2o5 z(WYTqS52TLa)q_`&yAFFAE67EFt;q8qc=At+@na*o(g1DIbos6Hd}QefQbgNlw_r* z7B2tR5NPyF`*Il8b>QmF?)iB3sC|DkFSR!8q$H^hA@{Y&DT~)3RO98ja)AbXWPOD- zJ=}yt#-sSyC`;dKth}{OpVK1IQTD3>aKEx)QkwBlT`g_@43bOgl{CpCP;_I6!E>f+ zGq^?xD=2F?8ALRlKgp8y+%;*o?~A4dG!3U)NTrE?UQ+K=lD-{Rb-gWpA*}7{!_-wp z&_c^4^~zj2W8aRBas^Q3c(1I)$5vY0Fsf`4l}nK1{(+HbWNCLZxT(W(6>x5}@9+q# z)7yC#nFUnbvf;PfLI&%Rnp(z({aicS{87-$;(WP7&TRdYuutf*S@Hg^D(qTxA>R1v zCEu`{oZ4ggBbE8X=-}<20$@q;Zzr`m7%HAL;bO(A+g0ay12Y`8Gw;G0nVqJfLc?Fj zH{VSqCd`Z_ZBL%R43JA{vCMY!0pCkybVBu^GriV_^^o9zYq)*{N>&Ly7(m0kGPAuKZXRrF{)T`Aw6ls1}i_*sHj)ME~>$N>7|Dpix zncSp@Q$5t(rCD?|0jCkDTTkz}ve8=&HC-a!`tP3KbVMw2%dN>5K3%X8^%YSv%JW5^ zoRzt@Bp z2Cvj+f*%CRREIvCC)T-ZWgScC$ff%c%!Fe35tPJc2u_9mj+0}C`sSct`UK5z%VK5b zP=doL7$DfgOt-$yf2XR6dvfME5sbBm5&)TMbW2lF(e_crDq1y4Wjko$Y7CDn-#$Ud zHo2>&NzVdR+dHZS@yiKv5e+)c0jrUW$&?>xlEid=&Ud?l0ecT^r~C5V!$dk(AQ~)E z@S1i9Hpa z(`!SsM)doDIeF>li>a@2pj2!-EF5UJ-uWdub1tviVaLs##OHEm+cbcV3fjdo9_ zm;RnP(-@9bwnm**g?jV>h)`}d%i7Xw!JEJqLNL=5n^olhvtSN~RqMb?<6}gx;%;2# zmXCEVf9ho|?eWF3PhjY00Dd$dp_9heM4CVLvk`U7# zs``kbqBg#c_PP?2S0C@*Fk190kN#T1v$NZUh{74VI^csurOsy>iBc*2pLp4hd8_)RHlJ5$#~=w+QLD^{pUns5Q3x{^ehK!-%*Ox_XL&NIGu{!Q8_%UmgicYK$* zm8Z?q1J}PnsvHJ16lLe$8@l^7H?8uZ@FG5w7=~((Hg>*kEL3v5oEjv_+~yyl z0qhJ-MZVyX)}ZzJ!6=gct8cm>$|;wz_^f{x3-+(Y;)FyaUvxQkHW*J(gZKqQoE=XCAv+7a$injo9JA3(CtYKc=4Wl0h(u{{ z`uFvH0Bkc1>d!K5;*8G$cYTSunY45-{Yll-yI8s{@lUckc)D#fwZ^Bo zsH0!ecw(~X)2~eX-)fhL468f(HFSOWGhfmrZ~o|rJqQw?h^Td7PGiz?28O;fgr&oJ zO8{KPBCseu{RrPAt00s+;|fHc5lJRT=X?z)>R4oQ)jG+jxZI-`vcy1^a&gV!Sx?YA zvJxo~=dAdwd~0D*%>`nnR&FwDZ#@+A6hg-K?`J#Mg8|-J(qU$ivMXitwrOv4DO`L& zb3Nm~tF;a93IJ0x5hdQuUx)LkU|Pxuw!BRu`@m0US0~RX7wCSk2fD(F_HJjXV?Q2a z^^|{GWxP$@H8t45FY^+*)Zcx?d4Gerw9!GtogPcyja$}^;nXPv8yHdAewKim4!!!- zUfV!AB68f;;nk}jY z{lK?X*sv4*0eC`;5DL1o#Db21z!wg#OO^UBUVV54g%HqJ$V6hoyhEgW7X_B_N-9=# zovZHg>dEEzMSQG#CG-kON#5T9N~(`RyG~nRS5nm}g?-cCyw0 zUKjg4L;vAuw_)f($ar?u%>NlrA|do8n~apd-YJB>1aU@(D>&70|9GAd`qC$ei9=@i ze^^M~5a)VJHKR1*KM&cH6k@`s-1_Up5<|89;wsU~sQmeU$YugUhnONU9sYXAF}}LL z=u23XwEx3i{&Kbi&Cp%F7r0Yf7$uzZ3nia^K8%|u z9o`5Mvyv&9cPqu5mrN$W?XzEg7g zIuiq}2n(OmP{TQ?7i2 zGI_54*1mj0#)L=B0~MNX57k`48Sjp=n(5N2+_8owBmVT8=&=f}Hri`?$y{k>T%3-E zCB8F@{rgSf#i4KSQ6)#yF5`eUZ6ebZr0Dc%lH!hzf>*UQJXlPKrke-v&UUW*p4%Wy zH(~HZ`n<$51w#HvkD&((J7L_jckQR;rlv%#M7a?|LW;OQ%OtByk zQn9))24S0S=l-;F!L#-XOt<}}s?-%8RFWLOmJX<ga$rz^2D=rgc9m!J zti2t)@w>Lh&zCp`=p1m+e8``DAD5kE0)r!>`Vi7bb~@ogeiele{xZ%W@wCd4y^pXJ z0kwvJ&u`Zn7#!3e{d`16Uy{ht!ZTA$l}5(++@ijm1{BVMplbp?8fMQylUw5{ehKav zYLt?m{t0Z>SRIsg=~R;3BykAfb+kfbB(g}|>1S&EZfez7EcSVu;7E2Xc1^%4PTc}k z(%Tz!VXdRCLpZH8D9U-Ulk?8(Y}`iEXstk4ft*33e5#t`x(G}+#_@aLPFzS|Ksmd1 zTVOo@@bM&cKbnuEuyK6W!I%Tpy6HYW07W~y$OPz@)Mbwf=;PQ=O|`2hrz(Fih4SYD zl^V`4xYAOo;RxMSk{Q#*7wKoX&WYSF-wiB)6lvO+v_5url38`i#u*kLjAL78ZrJ=x3~_4EW90r~~XG3j~YP%Kj8t|P}rpGCaX*4;|3tkihM z?T7~{{`BSvUwgt2GwIER|ovrUh<%$t#4nH|91yLlfOcJ&H)nXJoNIK2Q|qkkM( zNQbP_v=iHV)`m>eix?P^JDe$TF+aL+xo?J0Yk2>75!$*5ea>$)L&yb5{0wBZiN^@k z;yvdkjWFMyD=Ls}C+}k5VN;T@)4L*E>mVe2OvzDLeV7$&Gl396G!sCavf4qrHO&ulcH z670*9vU?Kv9lASF$hX5CaN=JkV^6g%z)qPyHscJ?*E!vO98xaEo*ge6Fj2n%9ZxTi z4JaI|pT+WWZ3;hUe7*VOcMrlt!80{a?(FT-guVa@M|06HxJBOB6FE07+7!-JbTih ziM`_@WBwRbz!R8eCblt*X7N@5lp&HarTX5SC>+-1iuA<_WD?`}A8SsR6AwA6pLs=& z*`wsN?S?BiDY?omH&o|`&U7jmj1?pros}J;NW#~c0SKT+uEOQ8trj#XH2g1}n?GMdhD(-F4aL|qS!PV-{haTJHt zcyIpl;*_UWa<@@l32%=G3C0Sk*vgOslo1QpfF=x|?Z_>@^-+6AVL?|?vDr8Ym;o}i`h1xGj|D=(@&tV4i=iVmnFWYvRr+(6g7?$xf% z2Q$!9W1hCMo7veXx1(T`YBSv?rO-%bzo*bD^fCjG^Gl+GEwJ4y(D6XX9$mL3Ls&Wp0tG~qWJ~z zHjeKWn~UHr&Cff2uR+!U%@(EgY&WI%YsyHrNbu+?l>CFdS?hiX`^KS1Mp{KxnyzyD z-|Cb%186lQMH(1TOVUqIzkl9D7;zY)q#Zs5YEY&v#hetVBX!{ArO$1AFez} z7%mq#3h2MTqX;&&QcI^fYk76h#%UanJmaiqwXc#eR&HfTn5>U+f$D5J{%0P~LgumZ z?Uy{=AgrG?vE6*`6?qZ2iwCx>iF?)qA)r>Wr}FgSz7(Wa64T>}pGu9*CDmqROd2to z-<9cO8yRJ@M9hXAcma=Zo^ul1bE>@4?`83&sJ6NIkx@fL57hDy1@V64 zqzrTDND~>(sm~d8caV+$vQbxzthB_vftQo{WG6JH($o70;AkaKfqsk8I2d49y5xm|glS|Ks zu*!8gL)_o5%Lxn9TXP^y;*8jkRYF73&SctC8#5VEn%hG^Z2uRsK2e@L)HyM`>Bb#M z$|gSK-ags*vb{}z;eUeuGKjo?-M!s% {rules-ui}**. + +On the *Create rule* window, give a name to the rule and optionally provide +tags. Specify the time interval for the rule to check {transform} health +changes. You can also select a notification option with the _Notify_ selector. +An alert remains active as long as the configured conditions are met during the +check interval. When there is no matching condition in the next interval, the +`Recovered` action group is invoked and the status of the alert changes to `OK`. +For more details, refer to the documentation of +{kibana-ref}/create-and-manage-rules.html#defining-rules-general-details[general rule details]. + +Select the {transform-cap} health rule type under the Stack Monitoring section. + +[role="screenshot"] +image::images/transform-rule.png["Creating a transform health rule"] + + +[[creating-transform-health-rules]] +=== {transform-cap} health + +Select the {transform} or {transforms} to include. You can also use a special +character (`*`) to apply the rule to all your {transforms}. {transforms-cap} +created after the rule are automatically included. + +The following health check is available and enabled by default: + +_{transform-cap} is not started_:: + Notifies if the corresponding {transforms} is not started or it does not index + any data. The notification message recommends the necessary actions to solve + the error. + +[role="screenshot"] +image::images/transform-check-config.png["Selecting health check"] + +As the last step in the rule creation process, +<> that occur when the conditions +are met. + + +[[defining-actions]] +== Defining actions + +Connect your rule to actions that use supported built-in integrations by +selecting a connector type. Connectors are {kib} services or third-party +integrations that perform an action when the rule conditions are met. + +[role="screenshot"] +image::images/transform-alert-actions.png["Selecting connector type"] + + +For example, you can choose _Slack_ as a connector type and configure it to send +a message to a channel you selected. You can also create an index connector that +writes the JSON object you configure to a specific index. It's also possible to +customize the notification messages. A list of variables is available to include +in the message, like {transform} ID, description, {transform} state, and so on. + +After you save the configurations, the rule appears in the *{rules-ui}* list +where you can check its status and see the overview of its configuration +information. + +The name of an alert is always the same as the {transform} ID of the associated +{transform} that triggered it. You can mute the notifications for a particular +{transform} on the page of the rule that lists the individual alerts. You can +open it via *{rules-ui}* by selecting the rule name. \ No newline at end of file diff --git a/docs/reference/transform/transforms.asciidoc b/docs/reference/transform/transforms.asciidoc index a7b5520a04915..2be820d43e79d 100644 --- a/docs/reference/transform/transforms.asciidoc +++ b/docs/reference/transform/transforms.asciidoc @@ -14,6 +14,7 @@ documents that have a certain unique key. * <> * <> * <> +* <> * <> * <> * <> From 87592d7e6cfde2eb5eb6e89b67971bcd16f29dd8 Mon Sep 17 00:00:00 2001 From: Benjamin Trent Date: Tue, 5 Oct 2021 08:37:18 -0400 Subject: [PATCH 160/250] [Ingest] allow docs to write native `double[]` and `double[][]` (#78646) * [Ingest] allow docs to write native `double[]` and `double[][]` * Adding test for new native double array support * fixing test Co-authored-by: Elastic Machine --- .../elasticsearch/ingest/IngestDocument.java | 10 ++++ .../ingest/IngestDocumentTests.java | 47 +++++++++++++++---- 2 files changed, 47 insertions(+), 10 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/ingest/IngestDocument.java b/server/src/main/java/org/elasticsearch/ingest/IngestDocument.java index ffba580a0849e..96a6b601b19a3 100644 --- a/server/src/main/java/org/elasticsearch/ingest/IngestDocument.java +++ b/server/src/main/java/org/elasticsearch/ingest/IngestDocument.java @@ -741,6 +741,16 @@ public static Object deepCopy(Object value) { } else if (value instanceof byte[]) { byte[] bytes = (byte[]) value; return Arrays.copyOf(bytes, bytes.length); + } else if (value instanceof double[][]) { + double[][] doubles = (double[][]) value; + double[][] result = new double[doubles.length][]; + for (int i = 0; i < doubles.length; i++) { + result[i] = Arrays.copyOf(doubles[i], doubles[i].length); + } + return result; + } else if (value instanceof double[]) { + double[] doubles = (double[]) value; + return Arrays.copyOf(doubles, doubles.length); } else if (value == null || value instanceof String || value instanceof Integer || value instanceof Long || value instanceof Float || value instanceof Double || value instanceof Boolean || diff --git a/server/src/test/java/org/elasticsearch/ingest/IngestDocumentTests.java b/server/src/test/java/org/elasticsearch/ingest/IngestDocumentTests.java index 110045a322c9a..aa7c393941ca1 100644 --- a/server/src/test/java/org/elasticsearch/ingest/IngestDocumentTests.java +++ b/server/src/test/java/org/elasticsearch/ingest/IngestDocumentTests.java @@ -21,6 +21,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.stream.DoubleStream; import static org.elasticsearch.ingest.IngestDocumentMatcher.assertIngestDocument; import static org.hamcrest.Matchers.both; @@ -38,6 +39,8 @@ public class IngestDocumentTests extends ESTestCase { private static final ZonedDateTime BOGUS_TIMESTAMP = ZonedDateTime.of(2016, 10, 23, 0, 0, 0, 0, ZoneOffset.UTC); private IngestDocument ingestDocument; + private static final String DOUBLE_ARRAY_FIELD = "double_array_field"; + private static final String DOUBLE_DOUBLE_ARRAY_FIELD = "double_double_array"; @Before public void setTestIngestDocument() { @@ -69,6 +72,14 @@ public void setTestIngestDocument() { list2.add("bar"); list2.add("baz"); document.put("list2", list2); + document.put(DOUBLE_ARRAY_FIELD, DoubleStream.generate(ESTestCase::randomDouble).limit(randomInt(1000)).toArray()); + document.put( + DOUBLE_DOUBLE_ARRAY_FIELD, + new double[][] { + DoubleStream.generate(ESTestCase::randomDouble).limit(randomInt(1000)).toArray(), + DoubleStream.generate(ESTestCase::randomDouble).limit(randomInt(1000)).toArray(), + DoubleStream.generate(ESTestCase::randomDouble).limit(randomInt(1000)).toArray() } + ); ingestDocument = new IngestDocument("index", "id", null, null, null, document); } @@ -779,23 +790,23 @@ public void testSetFieldValueEmptyName() { public void testRemoveField() { ingestDocument.removeField("foo"); - assertThat(ingestDocument.getSourceAndMetadata().size(), equalTo(7)); + assertThat(ingestDocument.getSourceAndMetadata().size(), equalTo(9)); assertThat(ingestDocument.getSourceAndMetadata().containsKey("foo"), equalTo(false)); ingestDocument.removeField("_index"); - assertThat(ingestDocument.getSourceAndMetadata().size(), equalTo(6)); + assertThat(ingestDocument.getSourceAndMetadata().size(), equalTo(8)); assertThat(ingestDocument.getSourceAndMetadata().containsKey("_index"), equalTo(false)); ingestDocument.removeField("_source.fizz"); - assertThat(ingestDocument.getSourceAndMetadata().size(), equalTo(5)); + assertThat(ingestDocument.getSourceAndMetadata().size(), equalTo(7)); assertThat(ingestDocument.getSourceAndMetadata().containsKey("fizz"), equalTo(false)); assertThat(ingestDocument.getIngestMetadata().size(), equalTo(1)); ingestDocument.removeField("_ingest.timestamp"); - assertThat(ingestDocument.getSourceAndMetadata().size(), equalTo(5)); + assertThat(ingestDocument.getSourceAndMetadata().size(), equalTo(7)); assertThat(ingestDocument.getIngestMetadata().size(), equalTo(0)); } public void testRemoveInnerField() { ingestDocument.removeField("fizz.buzz"); - assertThat(ingestDocument.getSourceAndMetadata().size(), equalTo(8)); + assertThat(ingestDocument.getSourceAndMetadata().size(), equalTo(10)); assertThat(ingestDocument.getSourceAndMetadata().get("fizz"), instanceOf(Map.class)); @SuppressWarnings("unchecked") Map map = (Map) ingestDocument.getSourceAndMetadata().get("fizz"); @@ -804,17 +815,17 @@ public void testRemoveInnerField() { ingestDocument.removeField("fizz.foo_null"); assertThat(map.size(), equalTo(2)); - assertThat(ingestDocument.getSourceAndMetadata().size(), equalTo(8)); + assertThat(ingestDocument.getSourceAndMetadata().size(), equalTo(10)); assertThat(ingestDocument.getSourceAndMetadata().containsKey("fizz"), equalTo(true)); ingestDocument.removeField("fizz.1"); assertThat(map.size(), equalTo(1)); - assertThat(ingestDocument.getSourceAndMetadata().size(), equalTo(8)); + assertThat(ingestDocument.getSourceAndMetadata().size(), equalTo(10)); assertThat(ingestDocument.getSourceAndMetadata().containsKey("fizz"), equalTo(true)); ingestDocument.removeField("fizz.list"); assertThat(map.size(), equalTo(0)); - assertThat(ingestDocument.getSourceAndMetadata().size(), equalTo(8)); + assertThat(ingestDocument.getSourceAndMetadata().size(), equalTo(10)); assertThat(ingestDocument.getSourceAndMetadata().containsKey("fizz"), equalTo(true)); } @@ -848,7 +859,7 @@ public void testRemoveSourceObject() { public void testRemoveIngestObject() { ingestDocument.removeField("_ingest"); - assertThat(ingestDocument.getSourceAndMetadata().size(), equalTo(7)); + assertThat(ingestDocument.getSourceAndMetadata().size(), equalTo(9)); assertThat(ingestDocument.getSourceAndMetadata().containsKey("_ingest"), equalTo(false)); } @@ -870,7 +881,7 @@ public void testRemoveEmptyPathAfterStrippingOutPrefix() { public void testListRemoveField() { ingestDocument.removeField("list.0.field"); - assertThat(ingestDocument.getSourceAndMetadata().size(), equalTo(8)); + assertThat(ingestDocument.getSourceAndMetadata().size(), equalTo(10)); assertThat(ingestDocument.getSourceAndMetadata().containsKey("list"), equalTo(true)); Object object = ingestDocument.getSourceAndMetadata().get("list"); assertThat(object, instanceOf(List.class)); @@ -1046,4 +1057,20 @@ public void testSetInvalidSourceField() throws Exception { } } + public void testDeepCopy() { + IngestDocument copiedDoc = new IngestDocument( + IngestDocument.deepCopyMap(ingestDocument.getSourceAndMetadata()), + IngestDocument.deepCopyMap(ingestDocument.getIngestMetadata()) + ); + assertArrayEquals( + copiedDoc.getFieldValue(DOUBLE_ARRAY_FIELD, double[].class), + ingestDocument.getFieldValue(DOUBLE_ARRAY_FIELD, double[].class), + 1e-10 + ); + assertArrayEquals( + copiedDoc.getFieldValue(DOUBLE_DOUBLE_ARRAY_FIELD, double[][].class), + ingestDocument.getFieldValue(DOUBLE_DOUBLE_ARRAY_FIELD, double[][].class) + ); + } + } From 2893ea911bda884ccf095a2d00cfce2c097e82c1 Mon Sep 17 00:00:00 2001 From: James Rodewig <40268737+jrodewig@users.noreply.github.com> Date: Tue, 5 Oct 2021 08:52:11 -0400 Subject: [PATCH 161/250] [DOCS] Remove duplicate line from migration guide (#78688) --- docs/reference/migration/index.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference/migration/index.asciidoc b/docs/reference/migration/index.asciidoc index 5d6639f49984b..6cfb4a5ae874e 100644 --- a/docs/reference/migration/index.asciidoc +++ b/docs/reference/migration/index.asciidoc @@ -33,7 +33,7 @@ and mappings for deprecated functionality. For more information about {minor-version}, see the <> and <>. -For information about how to upgrade your cluster, see <>. For information about how to upgrade your cluster, see <>. +For information about how to upgrade your cluster, see <>. * <> From a56065dc9fffc2ae9f20a0dbdd40443d5acb9260 Mon Sep 17 00:00:00 2001 From: James Rodewig <40268737+jrodewig@users.noreply.github.com> Date: Tue, 5 Oct 2021 09:16:32 -0400 Subject: [PATCH 162/250] [DOCS] Fix rollover API response body heading --- docs/reference/indices/rollover-index.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference/indices/rollover-index.asciidoc b/docs/reference/indices/rollover-index.asciidoc index 623d9666a3683..36378ca804922 100644 --- a/docs/reference/indices/rollover-index.asciidoc +++ b/docs/reference/indices/rollover-index.asciidoc @@ -156,7 +156,7 @@ Data streams do not support this parameter. [role="child_attributes"] [[rollover-index-api-response-body]] -==== {api-request-body-title} +==== {api-response-body-title} `acknowledged`:: (Boolean) From 8e872967d06e24d4f9bbcf483097effe43d90048 Mon Sep 17 00:00:00 2001 From: Benjamin Trent Date: Tue, 5 Oct 2021 09:41:38 -0400 Subject: [PATCH 163/250] [ML] updating NER result to be inline with existing inference results (#78574) * [ML] updating NER result to be inline with existing inference results * addressing PR comments * changing PERSON to PER in default IOB NER tagging * addressing PR comments Co-authored-by: Elastic Machine --- .../core/ml/inference/results/NerResults.java | 151 +++++++++---- .../ml/inference/trainedmodel/NerConfig.java | 1 - .../trainedmodel/NerConfigUpdate.java | 19 +- .../ml/inference/results/NerResultsTests.java | 48 +++-- .../xpack/ml/inference/nlp/NerProcessor.java | 109 ++++++++-- .../ml/inference/nlp/NerProcessorTests.java | 199 ++++++++++++------ 6 files changed, 367 insertions(+), 160 deletions(-) diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/NerResults.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/NerResults.java index 8d7a70774a8b2..582fd31604030 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/NerResults.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/NerResults.java @@ -7,7 +7,6 @@ package org.elasticsearch.xpack.core.ml.inference.results; -import org.elasticsearch.common.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; @@ -21,24 +20,32 @@ import java.util.Objects; import java.util.stream.Collectors; -import static org.elasticsearch.xpack.core.ml.inference.trainedmodel.InferenceConfig.DEFAULT_RESULTS_FIELD; public class NerResults implements InferenceResults { public static final String NAME = "ner_result"; + public static final String ENTITY_FIELD = "entities"; + + private final String resultsField; + private final String annotatedResult; private final List entityGroups; - public NerResults(List entityGroups) { + public NerResults(String resultsField, String annotatedResult, List entityGroups) { this.entityGroups = Objects.requireNonNull(entityGroups); + this.resultsField = Objects.requireNonNull(resultsField); + this.annotatedResult = Objects.requireNonNull(annotatedResult); } public NerResults(StreamInput in) throws IOException { entityGroups = in.readList(EntityGroup::new); + resultsField = in.readString(); + annotatedResult = in.readString(); } @Override public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { + builder.field(resultsField, annotatedResult); builder.startArray("entities"); for (EntityGroup entity : entityGroups) { entity.toXContent(builder, params); @@ -55,95 +62,145 @@ public String getWriteableName() { @Override public void writeTo(StreamOutput out) throws IOException { out.writeList(entityGroups); + out.writeString(resultsField); + out.writeString(annotatedResult); } @Override public Map asMap() { Map map = new LinkedHashMap<>(); - map.put(DEFAULT_RESULTS_FIELD, entityGroups.stream().map(EntityGroup::toMap).collect(Collectors.toList())); + map.put(resultsField, annotatedResult); + map.put(ENTITY_FIELD, entityGroups.stream().map(EntityGroup::toMap).collect(Collectors.toList())); return map; } @Override public Object predictedValue() { - // Used by the inference aggregation - throw new UnsupportedOperationException("Named Entity Recognition does not support a single predicted value"); + return annotatedResult; } public List getEntityGroups() { return entityGroups; } + public String getResultsField() { + return resultsField; + } + + public String getAnnotatedResult() { + return annotatedResult; + } + @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; NerResults that = (NerResults) o; - return Objects.equals(entityGroups, that.entityGroups); + return Objects.equals(entityGroups, that.entityGroups) + && Objects.equals(resultsField, that.resultsField) + && Objects.equals(annotatedResult, that.annotatedResult); } @Override public int hashCode() { - return Objects.hash(entityGroups); + return Objects.hash(entityGroups, resultsField, annotatedResult); } public static class EntityGroup implements ToXContentObject, Writeable { - private static final ParseField LABEL = new ParseField("label"); - private static final ParseField SCORE = new ParseField("score"); - private static final ParseField WORD = new ParseField("word"); - - private final String label; - private final double score; - private final String word; - - public EntityGroup(String label, double score, String word) { - this.label = Objects.requireNonNull(label); - this.score = score; - this.word = Objects.requireNonNull(word); + static final String CLASS_NAME = "class_name"; + static final String CLASS_PROBABILITY = "class_probability"; + static final String START_POS = "start_pos"; + static final String END_POS = "end_pos"; + + private final String entity; + private final String className; + private final double classProbability; + private final int startPos; + private final int endPos; + + public EntityGroup( + String entity, + String className, + double classProbability, + int startPos, + int endPos + ) { + this.entity = entity; + this.className = className; + this.classProbability = classProbability; + this.startPos = startPos; + this.endPos = endPos; + if (endPos < startPos) { + throw new IllegalArgumentException("end_pos [" + endPos + "] less than start_pos [" + startPos + "]"); + } } public EntityGroup(StreamInput in) throws IOException { - label = in.readString(); - score = in.readDouble(); - word = in.readString(); + this.entity = in.readString(); + this.className = in.readString(); + this.classProbability = in.readDouble(); + this.startPos = in.readInt(); + this.endPos = in.readInt(); + } + + @Override + public void writeTo(StreamOutput out) throws IOException { + out.writeString(entity); + out.writeString(className); + out.writeDouble(classProbability); + out.writeInt(startPos); + out.writeInt(endPos); } @Override public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { builder.startObject(); - builder.field(LABEL.getPreferredName(), label); - builder.field(SCORE.getPreferredName(), score); - builder.field(WORD.getPreferredName(), word); + builder.field("entity", entity); + builder.field(CLASS_NAME, className); + builder.field(CLASS_PROBABILITY, classProbability); + if (startPos >= 0) { + builder.field(START_POS, startPos); + } + if (endPos >= 0) { + builder.field(END_POS, endPos); + } builder.endObject(); return builder; } - @Override - public void writeTo(StreamOutput out) throws IOException { - out.writeString(label); - out.writeDouble(score); - out.writeString(word); - } - public Map toMap() { Map map = new LinkedHashMap<>(); - map.put(LABEL.getPreferredName(), label); - map.put(SCORE.getPreferredName(), score); - map.put(WORD.getPreferredName(), word); + map.put("entity", entity); + map.put(CLASS_NAME, className); + map.put(CLASS_PROBABILITY, classProbability); + if (startPos >= 0) { + map.put(START_POS, startPos); + } + if (endPos >= 0) { + map.put(END_POS, endPos); + } return map; } - public String getLabel() { - return label; + public String getEntity() { + return entity; + } + + public String getClassName() { + return className; + } + + public double getClassProbability() { + return classProbability; } - public double getScore() { - return score; + public int getStartPos() { + return startPos; } - public String getWord() { - return word; + public int getEndPos() { + return endPos; } @Override @@ -151,14 +208,16 @@ public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; EntityGroup that = (EntityGroup) o; - return Double.compare(that.score, score) == 0 && - Objects.equals(label, that.label) && - Objects.equals(word, that.word); + return Double.compare(that.classProbability, classProbability) == 0 + && startPos == that.startPos + && endPos == that.endPos + && Objects.equals(entity, that.entity) + && Objects.equals(className, that.className); } @Override public int hashCode() { - return Objects.hash(label, score, word); + return Objects.hash(entity, className, classProbability, startPos, endPos); } } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NerConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NerConfig.java index 8d1b0884c095d..b0e18240da21e 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NerConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NerConfig.java @@ -62,7 +62,6 @@ private static ConstructingObjectParser createParser(boolean ig ); parser.declareStringArray(ConstructingObjectParser.optionalConstructorArg(), CLASSIFICATION_LABELS); parser.declareString(ConstructingObjectParser.optionalConstructorArg(), RESULTS_FIELD); - return parser; } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NerConfigUpdate.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NerConfigUpdate.java index d2f84046f4c1f..1efcfe58e4b4b 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NerConfigUpdate.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NerConfigUpdate.java @@ -19,6 +19,7 @@ import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import static org.elasticsearch.xpack.core.ml.inference.trainedmodel.NlpConfig.RESULTS_FIELD; @@ -87,23 +88,27 @@ public String getName() { @Override public InferenceConfig apply(InferenceConfig originalConfig) { - if (resultsField == null || resultsField.equals(originalConfig.getResultsField())) { - return originalConfig; - } - if (originalConfig instanceof NerConfig == false) { throw ExceptionsHelper.badRequestException( - "Inference config of type [{}] can not be updated with a inference request of type [{}]", + "Inference config of type [{}] can not be updated with a request of type [{}]", originalConfig.getName(), getName()); } - NerConfig nerConfig = (NerConfig)originalConfig; + if (isNoop(nerConfig)) { + return nerConfig; + } + return new NerConfig( nerConfig.getVocabularyConfig(), nerConfig.getTokenization(), nerConfig.getClassificationLabels(), - resultsField); + Optional.ofNullable(resultsField).orElse(nerConfig.getResultsField()) + ); + } + + boolean isNoop(NerConfig originalConfig) { + return (this.resultsField == null || this.resultsField.equals(originalConfig.getResultsField())); } @Override diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/NerResultsTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/NerResultsTests.java index 24141a8b3cf2f..676aa35d01a5c 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/NerResultsTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/NerResultsTests.java @@ -10,11 +10,12 @@ import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.test.AbstractWireSerializingTestCase; -import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; +import java.util.stream.Stream; -import static org.elasticsearch.xpack.core.ml.inference.trainedmodel.InferenceConfig.DEFAULT_RESULTS_FIELD; +import static org.elasticsearch.xpack.core.ml.inference.results.NerResults.ENTITY_FIELD; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasSize; @@ -27,25 +28,46 @@ protected Writeable.Reader instanceReader() { @Override protected NerResults createTestInstance() { int numEntities = randomIntBetween(0, 3); - List entityGroups = new ArrayList<>(); - for (int i=0; i new NerResults.EntityGroup( + randomAlphaOfLength(10), + randomAlphaOfLength(10), + randomDouble(), + randomIntBetween(-1, 5), + randomIntBetween(5, 10) + ) + ).limit(numEntities) + .collect(Collectors.toList()) + ); } @SuppressWarnings("unchecked") public void testAsMap() { NerResults testInstance = createTestInstance(); Map asMap = testInstance.asMap(); - List> resultList = (List>)asMap.get(DEFAULT_RESULTS_FIELD); - assertThat(resultList, hasSize(testInstance.getEntityGroups().size())); - for (int i=0; i> resultList = (List>)asMap.get(ENTITY_FIELD); + if (resultList != null) { + assertThat(resultList, hasSize(testInstance.getEntityGroups().size())); + } + assertThat(asMap.get(testInstance.getResultsField()), equalTo(testInstance.getAnnotatedResult())); + for (int i = 0; i < testInstance.getEntityGroups().size(); i++) { NerResults.EntityGroup entity = testInstance.getEntityGroups().get(i); Map map = resultList.get(i); - assertThat(map.get("label"), equalTo(entity.getLabel())); - assertThat(map.get("score"), equalTo(entity.getScore())); - assertThat(map.get("word"), equalTo(entity.getWord())); + assertThat(map.get(NerResults.EntityGroup.CLASS_NAME), equalTo(entity.getClassName())); + assertThat(map.get("entity"), equalTo(entity.getEntity())); + assertThat(map.get(NerResults.EntityGroup.CLASS_PROBABILITY), equalTo(entity.getClassProbability())); + Integer startPos = (Integer)map.get(NerResults.EntityGroup.START_POS); + Integer endPos = (Integer)map.get(NerResults.EntityGroup.END_POS); + if (startPos != null) { + assertThat(startPos, equalTo(entity.getStartPos())); + } + if (endPos != null) { + assertThat(endPos, equalTo(entity.getEndPos())); + } } } } diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/NerProcessor.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/NerProcessor.java index a1f61be3c7680..9370849a74b81 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/NerProcessor.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/NerProcessor.java @@ -12,6 +12,7 @@ import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.xpack.core.ml.inference.results.InferenceResults; import org.elasticsearch.xpack.core.ml.inference.results.NerResults; +import org.elasticsearch.xpack.core.ml.inference.results.WarningInferenceResults; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.NerConfig; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.NlpConfig; import org.elasticsearch.xpack.ml.inference.deployment.PyTorchResult; @@ -25,11 +26,14 @@ import java.util.EnumSet; import java.util.List; import java.util.Locale; +import java.util.Optional; + +import static org.elasticsearch.xpack.core.ml.inference.trainedmodel.InferenceConfig.DEFAULT_RESULTS_FIELD; public class NerProcessor implements NlpTask.Processor { public enum Entity implements Writeable { - NONE, MISC, PERSON, ORGANIZATION, LOCATION; + NONE, MISC, PER, ORG, LOC; @Override public void writeTo(StreamOutput out) throws IOException { @@ -38,21 +42,21 @@ public void writeTo(StreamOutput out) throws IOException { @Override public String toString() { - return name().toLowerCase(Locale.ROOT); + return name().toUpperCase(Locale.ROOT); } } // Inside-Outside-Beginning (IOB) tag enum IobTag { - O(Entity.NONE), // Outside of a named entity - B_MISC(Entity.MISC), // Beginning of a miscellaneous entity right after another miscellaneous entity - I_MISC(Entity.MISC), // Miscellaneous entity - B_PER(Entity.PERSON), // Beginning of a person's name right after another person's name - I_PER(Entity.PERSON), // Person's name - B_ORG(Entity.ORGANIZATION), // Beginning of an organisation right after another organisation - I_ORG(Entity.ORGANIZATION), // Organisation - B_LOC(Entity.LOCATION), // Beginning of a location right after another location - I_LOC(Entity.LOCATION); // Location + O(Entity.NONE), // Outside a named entity + B_MISC(Entity.MISC), // Beginning of a miscellaneous entity right after another miscellaneous entity + I_MISC(Entity.MISC), // Miscellaneous entity + B_PER(Entity.PER), // Beginning of a person's name right after another person's name + I_PER(Entity.PER), // Person's name + B_ORG(Entity.ORG), // Beginning of an organisation right after another organisation + I_ORG(Entity.ORG), // Organisation + B_LOC(Entity.LOC), // Beginning of a location right after another location + I_LOC(Entity.LOC); // Location private final Entity entity; @@ -71,11 +75,15 @@ boolean isBeginning() { private final NlpTask.RequestBuilder requestBuilder; private final IobTag[] iobMap; + private final String resultsField; + private final boolean ignoreCase; NerProcessor(NlpTokenizer tokenizer, NerConfig config) { validate(config.getClassificationLabels()); this.iobMap = buildIobMap(config.getClassificationLabels()); this.requestBuilder = tokenizer.requestBuilder(); + this.resultsField = config.getResultsField(); + this.ignoreCase = config.getTokenization().doLowerCase(); } /** @@ -112,7 +120,7 @@ static IobTag[] buildIobMap(List classificationLabels) { } IobTag[] map = new IobTag[classificationLabels.size()]; - for (int i=0; i entities) { + if (entities.isEmpty()) { + return seq; + } + StringBuilder annotatedResultBuilder = new StringBuilder(); + int curPos = 0; + for (var entity : entities) { + if (entity.getStartPos() == -1) { + continue; + } + if (entity.getStartPos() != curPos) { + annotatedResultBuilder.append(seq, curPos, entity.getStartPos()); + } + String entitySeq = seq.substring(entity.getStartPos(), entity.getEndPos()); + annotatedResultBuilder.append("[") + .append(entitySeq) + .append("]") + .append("(") + .append(entity.getClassName()) + .append("&") + .append(entitySeq.replace(" ", "+")) + .append(")"); + curPos = entity.getEndPos(); + } + if (curPos < seq.length()) { + annotatedResultBuilder.append(seq, curPos, seq.length()); + } + return annotatedResultBuilder.toString(); } static class NerResultProcessor implements NlpTask.ResultProcessor { private final IobTag[] iobMap; + private final String resultsField; + private final boolean ignoreCase; - NerResultProcessor(IobTag[] iobMap) { + NerResultProcessor(IobTag[] iobMap, String resultsField, boolean ignoreCase) { this.iobMap = iobMap; + this.resultsField = Optional.ofNullable(resultsField).orElse(DEFAULT_RESULTS_FIELD); + this.ignoreCase = ignoreCase; } @Override public InferenceResults processResult(TokenizationResult tokenization, PyTorchResult pyTorchResult) { if (tokenization.getTokenizations().isEmpty() || tokenization.getTokenizations().get(0).getTokens().length == 0) { - return new NerResults(Collections.emptyList()); + return new WarningInferenceResults("no valid tokens to build result"); } // TODO - process all results in the batch @@ -157,8 +203,14 @@ public InferenceResults processResult(TokenizationResult tokenization, PyTorchRe // which could easily be close to 1. double[][] normalizedScores = NlpHelpers.convertToProbabilitiesBySoftMax(pyTorchResult.getInferenceResult()[0]); List taggedTokens = tagTokens(tokenization.getTokenizations().get(0), normalizedScores, iobMap); - List entities = groupTaggedTokens(taggedTokens); - return new NerResults(entities); + + List entities = groupTaggedTokens( + taggedTokens, + ignoreCase ? + tokenization.getTokenizations().get(0).getInput().toLowerCase(Locale.ROOT) : + tokenization.getTokenizations().get(0).getInput() + ); + return new NerResults(resultsField, buildAnnotatedText(tokenization.getTokenizations().get(0).getInput(), entities), entities); } /** @@ -167,9 +219,7 @@ public InferenceResults processResult(TokenizationResult tokenization, PyTorchRe * in the original input replacing them with a single token that * gets labelled based on the average score of all its sub-tokens. */ - static List tagTokens(TokenizationResult.Tokenization tokenization, - double[][] scores, - IobTag[] iobMap) { + static List tagTokens(TokenizationResult.Tokenization tokenization, double[][] scores, IobTag[] iobMap) { List taggedTokens = new ArrayList<>(); int startTokenIndex = 0; while (startTokenIndex < tokenization.getTokens().length) { @@ -219,12 +269,13 @@ static List tagTokens(TokenizationResult.Tokenization tokenization, * When multiple tokens are grouped together, the entity score is the * mean score of the tokens. */ - static List groupTaggedTokens(List tokens) { + static List groupTaggedTokens(List tokens, String inputSeq) { if (tokens.isEmpty()) { return Collections.emptyList(); } List entities = new ArrayList<>(); int startTokenIndex = 0; + int startFindInSeq = 0; while (startTokenIndex < tokens.size()) { TaggedToken token = tokens.get(startTokenIndex); if (token.tag.getEntity() == Entity.NONE) { @@ -246,9 +297,21 @@ static List groupTaggedTokens(List tokens) scoreSum += endToken.score; endTokenIndex++; } - entities.add(new NerResults.EntityGroup(token.tag.getEntity().toString(), - scoreSum / (endTokenIndex - startTokenIndex), entityWord.toString())); + String entity = entityWord.toString(); + int i = inputSeq.indexOf(entity, startFindInSeq); + entities.add( + new NerResults.EntityGroup( + entity, + token.tag.getEntity().toString(), + scoreSum / (endTokenIndex - startTokenIndex), + i, + i == -1 ? -1 : i + entity.length() + ) + ); startTokenIndex = endTokenIndex; + if (i != -1) { + startFindInSeq = i + entity.length(); + } } return entities; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/NerProcessorTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/NerProcessorTests.java index f135e6786356c..56846a4531c0f 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/NerProcessorTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/NerProcessorTests.java @@ -10,6 +10,7 @@ import org.elasticsearch.common.ValidationException; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.ml.inference.results.NerResults; +import org.elasticsearch.xpack.core.ml.inference.results.WarningInferenceResults; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.BertTokenization; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.NerConfig; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.VocabularyConfig; @@ -27,6 +28,7 @@ import static org.hamcrest.Matchers.empty; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasSize; +import static org.hamcrest.Matchers.instanceOf; import static org.hamcrest.Matchers.is; import static org.mockito.Mockito.mock; @@ -34,41 +36,41 @@ public class NerProcessorTests extends ESTestCase { public void testBuildIobMap_WithDefault() { NerProcessor.IobTag[] map = NerProcessor.buildIobMap(randomBoolean() ? null : Collections.emptyList()); - for (int i=0; i classLabels = Arrays.stream(tags).map(NerProcessor.IobTag::toString).collect(Collectors.toList()); NerProcessor.IobTag[] map = NerProcessor.buildIobMap(classLabels); - for (int i=0; i classLabels = Arrays.stream(tags).map(NerProcessor.IobTag::toString).collect(Collectors.toList()); NerConfig nerConfig = new NerConfig(new VocabularyConfig("test-index"), null, classLabels, null); ValidationException ve = expectThrows(ValidationException.class, () -> new NerProcessor(mock(BertTokenizer.class), nerConfig)); - assertThat(ve.getMessage(), - containsString("the classification label [B_MISC] is duplicated in the list [I_MISC, B_MISC, B_MISC, O]")); + assertThat( + ve.getMessage(), + containsString("the classification label [B_MISC] is duplicated in the list [I_MISC, B_MISC, B_MISC, O]") + ); } public void testValidate_NotAEntityLabel() { @@ -77,45 +79,51 @@ public void testValidate_NotAEntityLabel() { ValidationException ve = expectThrows(ValidationException.class, () -> new NerProcessor(mock(BertTokenizer.class), nerConfig)); assertThat(ve.getMessage(), containsString("classification label [foo] is not an entity I-O-B tag")); - assertThat(ve.getMessage(), - containsString("Valid entity I-O-B tags are [O, B_MISC, I_MISC, B_PER, I_PER, B_ORG, I_ORG, B_LOC, I_LOC]")); + assertThat( + ve.getMessage(), + containsString("Valid entity I-O-B tags are [O, B_MISC, I_MISC, B_PER, I_PER, B_ORG, I_ORG, B_LOC, I_LOC]") + ); } public void testProcessResults_GivenNoTokens() { - NerProcessor.NerResultProcessor processor = new NerProcessor.NerResultProcessor(NerProcessor.IobTag.values()); + NerProcessor.NerResultProcessor processor = new NerProcessor.NerResultProcessor(NerProcessor.IobTag.values(), null, false); TokenizationResult tokenization = tokenize(Collections.emptyList(), ""); - NerResults result = (NerResults) processor.processResult(tokenization, new PyTorchResult("test", null, 0L, null)); - assertThat(result.getEntityGroups(), is(empty())); + assertThat( + processor.processResult(tokenization, new PyTorchResult("test", null, 0L, null)), + instanceOf(WarningInferenceResults.class) + ); } public void testProcessResults() { - NerProcessor.NerResultProcessor processor = new NerProcessor.NerResultProcessor(NerProcessor.IobTag.values()); + NerProcessor.NerResultProcessor processor = new NerProcessor.NerResultProcessor(NerProcessor.IobTag.values(), null, true); TokenizationResult tokenization = tokenize( Arrays.asList("el", "##astic", "##search", "many", "use", "in", "london"), "Many use Elasticsearch in London" ); - double[][][] scores = {{ - { 7, 0, 0, 0, 0, 0, 0, 0, 0}, // many - { 7, 0, 0, 0, 0, 0, 0, 0, 0}, // use - { 0.01, 0.01, 0, 0.01, 0, 7, 0, 3, 0}, // el - { 0.01, 0.01, 0, 0, 0, 0, 0, 0, 0}, // ##astic - { 0, 0, 0, 0, 0, 0, 0, 0, 0}, // ##search - { 0, 0, 0, 0, 0, 0, 0, 0, 0}, // in - { 0, 0, 0, 0, 0, 0, 0, 6, 0} // london - }}; + double[][][] scores = { + { + { 7, 0, 0, 0, 0, 0, 0, 0, 0 }, // many + { 7, 0, 0, 0, 0, 0, 0, 0, 0 }, // use + { 0.01, 0.01, 0, 0.01, 0, 7, 0, 3, 0 }, // el + { 0.01, 0.01, 0, 0, 0, 0, 0, 0, 0 }, // ##astic + { 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // ##search + { 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // in + { 0, 0, 0, 0, 0, 0, 0, 6, 0 } // london + } }; NerResults result = (NerResults) processor.processResult(tokenization, new PyTorchResult("1", scores, 1L, null)); + assertThat(result.getAnnotatedResult(), equalTo("Many use [Elasticsearch](ORG&Elasticsearch) in [London](LOC&London)")); assertThat(result.getEntityGroups().size(), equalTo(2)); - assertThat(result.getEntityGroups().get(0).getWord(), equalTo("elasticsearch")); - assertThat(result.getEntityGroups().get(0).getLabel(), equalTo(NerProcessor.Entity.ORGANIZATION.toString())); - assertThat(result.getEntityGroups().get(1).getWord(), equalTo("london")); - assertThat(result.getEntityGroups().get(1).getLabel(), equalTo(NerProcessor.Entity.LOCATION.toString())); + assertThat(result.getEntityGroups().get(0).getEntity(), equalTo("elasticsearch")); + assertThat(result.getEntityGroups().get(0).getClassName(), equalTo(NerProcessor.Entity.ORG.toString())); + assertThat(result.getEntityGroups().get(1).getEntity(), equalTo("london")); + assertThat(result.getEntityGroups().get(1).getClassName(), equalTo(NerProcessor.Entity.LOC.toString())); } public void testProcessResults_withIobMap() { - NerProcessor.IobTag [] iobMap = new NerProcessor.IobTag[] { + NerProcessor.IobTag[] iobMap = new NerProcessor.IobTag[] { NerProcessor.IobTag.B_LOC, NerProcessor.IobTag.I_LOC, NerProcessor.IobTag.B_MISC, @@ -124,29 +132,30 @@ public void testProcessResults_withIobMap() { NerProcessor.IobTag.I_PER, NerProcessor.IobTag.B_ORG, NerProcessor.IobTag.I_ORG, - NerProcessor.IobTag.O - }; + NerProcessor.IobTag.O }; - NerProcessor.NerResultProcessor processor = new NerProcessor.NerResultProcessor(iobMap); + NerProcessor.NerResultProcessor processor = new NerProcessor.NerResultProcessor(iobMap, null, true); TokenizationResult tokenization = tokenize( Arrays.asList("el", "##astic", "##search", "many", "use", "in", "london"), "Elasticsearch in London" ); - double[][][] scores = {{ - { 0.01, 0.01, 0, 0.01, 0, 0, 7, 3, 0}, // el - { 0.01, 0.01, 0, 0, 0, 0, 0, 0, 0}, // ##astic - { 0, 0, 0, 0, 0, 0, 0, 0, 0}, // ##search - { 0, 0, 0, 0, 0, 0, 0, 0, 5}, // in - { 6, 0, 0, 0, 0, 0, 0, 0, 0} // london - }}; + double[][][] scores = { + { + { 0.01, 0.01, 0, 0.01, 0, 0, 7, 3, 0 }, // el + { 0.01, 0.01, 0, 0, 0, 0, 0, 0, 0 }, // ##astic + { 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // ##search + { 0, 0, 0, 0, 0, 0, 0, 0, 5 }, // in + { 6, 0, 0, 0, 0, 0, 0, 0, 0 } // london + } }; NerResults result = (NerResults) processor.processResult(tokenization, new PyTorchResult("1", scores, 1L, null)); + assertThat(result.getAnnotatedResult(), equalTo("[Elasticsearch](ORG&Elasticsearch) in [London](LOC&London)")); assertThat(result.getEntityGroups().size(), equalTo(2)); - assertThat(result.getEntityGroups().get(0).getWord(), equalTo("elasticsearch")); - assertThat(result.getEntityGroups().get(0).getLabel(), equalTo(NerProcessor.Entity.ORGANIZATION.toString())); - assertThat(result.getEntityGroups().get(1).getWord(), equalTo("london")); - assertThat(result.getEntityGroups().get(1).getLabel(), equalTo(NerProcessor.Entity.LOCATION.toString())); + assertThat(result.getEntityGroups().get(0).getEntity(), equalTo("elasticsearch")); + assertThat(result.getEntityGroups().get(0).getClassName(), equalTo(NerProcessor.Entity.ORG.toString())); + assertThat(result.getEntityGroups().get(1).getEntity(), equalTo("london")); + assertThat(result.getEntityGroups().get(1).getClassName(), equalTo(NerProcessor.Entity.LOC.toString())); } public void testGroupTaggedTokens() { @@ -163,14 +172,17 @@ public void testGroupTaggedTokens() { tokens.add(new NerProcessor.NerResultProcessor.TaggedToken("for", NerProcessor.IobTag.O, 1.0)); tokens.add(new NerProcessor.NerResultProcessor.TaggedToken("Elastic", NerProcessor.IobTag.B_ORG, 1.0)); - List entityGroups = NerProcessor.NerResultProcessor.groupTaggedTokens(tokens); + List entityGroups = NerProcessor.NerResultProcessor.groupTaggedTokens( + tokens, + "Hi Sarah Jessica, I live in Manchester and work for Elastic" + ); assertThat(entityGroups, hasSize(3)); - assertThat(entityGroups.get(0).getLabel(), equalTo("person")); - assertThat(entityGroups.get(0).getWord(), equalTo("Sarah Jessica")); - assertThat(entityGroups.get(1).getLabel(), equalTo("location")); - assertThat(entityGroups.get(1).getWord(), equalTo("Manchester")); - assertThat(entityGroups.get(2).getLabel(), equalTo("organization")); - assertThat(entityGroups.get(2).getWord(), equalTo("Elastic")); + assertThat(entityGroups.get(0).getClassName(), equalTo("PER")); + assertThat(entityGroups.get(0).getEntity(), equalTo("Sarah Jessica")); + assertThat(entityGroups.get(1).getClassName(), equalTo("LOC")); + assertThat(entityGroups.get(1).getEntity(), equalTo("Manchester")); + assertThat(entityGroups.get(2).getClassName(), equalTo("ORG")); + assertThat(entityGroups.get(2).getEntity(), equalTo("Elastic")); } public void testGroupTaggedTokens_GivenNoEntities() { @@ -178,7 +190,7 @@ public void testGroupTaggedTokens_GivenNoEntities() { tokens.add(new NerProcessor.NerResultProcessor.TaggedToken("Hi", NerProcessor.IobTag.O, 1.0)); tokens.add(new NerProcessor.NerResultProcessor.TaggedToken("there", NerProcessor.IobTag.O, 1.0)); - List entityGroups = NerProcessor.NerResultProcessor.groupTaggedTokens(tokens); + List entityGroups = NerProcessor.NerResultProcessor.groupTaggedTokens(tokens, "Hi there"); assertThat(entityGroups, is(empty())); } @@ -188,16 +200,19 @@ public void testGroupTaggedTokens_GivenConsecutiveEntities() { tokens.add(new NerProcessor.NerResultProcessor.TaggedToken("Sue", NerProcessor.IobTag.B_PER, 1.0)); tokens.add(new NerProcessor.NerResultProcessor.TaggedToken("and", NerProcessor.IobTag.O, 1.0)); tokens.add(new NerProcessor.NerResultProcessor.TaggedToken("Bob", NerProcessor.IobTag.B_PER, 1.0)); - tokens.add(new NerProcessor.NerResultProcessor.TaggedToken("to", NerProcessor.IobTag.O, 1.0)); + tokens.add(new NerProcessor.NerResultProcessor.TaggedToken("too", NerProcessor.IobTag.O, 1.0)); - List entityGroups = NerProcessor.NerResultProcessor.groupTaggedTokens(tokens); + List entityGroups = NerProcessor.NerResultProcessor.groupTaggedTokens( + tokens, + "Rita, Sue, and Bob too" + ); assertThat(entityGroups, hasSize(3)); - assertThat(entityGroups.get(0).getLabel(), equalTo("person")); - assertThat(entityGroups.get(0).getWord(), equalTo("Rita")); - assertThat(entityGroups.get(1).getLabel(), equalTo("person")); - assertThat(entityGroups.get(1).getWord(), equalTo("Sue")); - assertThat(entityGroups.get(2).getLabel(), equalTo("person")); - assertThat(entityGroups.get(2).getWord(), equalTo("Bob")); + assertThat(entityGroups.get(0).getClassName(), equalTo("PER")); + assertThat(entityGroups.get(0).getEntity(), equalTo("Rita")); + assertThat(entityGroups.get(1).getClassName(), equalTo("PER")); + assertThat(entityGroups.get(1).getEntity(), equalTo("Sue")); + assertThat(entityGroups.get(2).getClassName(), equalTo("PER")); + assertThat(entityGroups.get(2).getEntity(), equalTo("Bob")); } public void testGroupTaggedTokens_GivenConsecutiveContinuingEntities() { @@ -208,20 +223,64 @@ public void testGroupTaggedTokens_GivenConsecutiveContinuingEntities() { tokens.add(new NerProcessor.NerResultProcessor.TaggedToken("NextPersonSecondName", NerProcessor.IobTag.I_PER, 1.0)); tokens.add(new NerProcessor.NerResultProcessor.TaggedToken("something_else", NerProcessor.IobTag.B_ORG, 1.0)); - List entityGroups = NerProcessor.NerResultProcessor.groupTaggedTokens(tokens); + List entityGroups = NerProcessor.NerResultProcessor.groupTaggedTokens( + tokens, + "FirstName SecondName, NextPerson NextPersonSecondName. something_else" + ); assertThat(entityGroups, hasSize(3)); - assertThat(entityGroups.get(0).getLabel(), equalTo("person")); - assertThat(entityGroups.get(0).getWord(), equalTo("FirstName SecondName")); - assertThat(entityGroups.get(1).getLabel(), equalTo("person")); - assertThat(entityGroups.get(1).getWord(), equalTo("NextPerson NextPersonSecondName")); - assertThat(entityGroups.get(2).getLabel(), equalTo("organization")); + assertThat(entityGroups.get(0).getClassName(), equalTo("PER")); + assertThat(entityGroups.get(0).getEntity(), equalTo("FirstName SecondName")); + assertThat(entityGroups.get(1).getClassName(), equalTo("PER")); + assertThat(entityGroups.get(1).getEntity(), equalTo("NextPerson NextPersonSecondName")); + assertThat(entityGroups.get(2).getClassName(), equalTo("ORG")); + } + + public void testAnnotatedTextBuilder() { + String input = "Alexander, my name is Benjamin Trent, I work at Acme Inc."; + List entities = List.of( + new NerResults.EntityGroup( + "alexander", + "PER", + 0.9963429980065166, + 0, + 9 + ), + new NerResults.EntityGroup( + "benjamin trent", + "PER", + 0.9972042749283819, + 22, + 36 + ), + new NerResults.EntityGroup( + "acme inc", + "ORG", + 0.9982026600781208, + 48, + 56 + ) + ); + assertThat( + NerProcessor.buildAnnotatedText(input, entities), + equalTo( + "[Alexander](PER&Alexander), " + + "my name is [Benjamin Trent](PER&Benjamin+Trent), " + + "I work at [Acme Inc](ORG&Acme+Inc)." + ) + ); + } + + public void testAnnotatedTextBuilder_empty() { + String input = "There are no entities"; + List entities = List.of(); + assertThat(NerProcessor.buildAnnotatedText(input, entities), equalTo(input)); } private static TokenizationResult tokenize(List vocab, String input) { - BertTokenizer tokenizer = BertTokenizer.builder( - vocab, - new BertTokenization(true, false, null) - ).setDoLowerCase(true).setWithSpecialTokens(false).build(); + BertTokenizer tokenizer = BertTokenizer.builder(vocab, new BertTokenization(true, false, null)) + .setDoLowerCase(true) + .setWithSpecialTokens(false) + .build(); return tokenizer.buildTokenizationResult(List.of(tokenizer.tokenize(input))); } } From b5b73ed025ec0f28f1876e039904bfa1f83f3519 Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Tue, 5 Oct 2021 06:49:06 -0700 Subject: [PATCH 164/250] Revert "Remove multiple paths from NodeEnvironment (#72599)" (#78655) This reverts commit b6436c51cd6ed1f6e63d977d71184e5584dd74b6. The revert had no merge conflicts. relates #78525 relates #71205 --- .../elasticsearch/env/NodeEnvironment.java | 273 ++++++++++++------ .../env/NodeRepurposeCommand.java | 6 +- 2 files changed, 180 insertions(+), 99 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/env/NodeEnvironment.java b/server/src/main/java/org/elasticsearch/env/NodeEnvironment.java index 9bfe598dc0566..4f572db20a47b 100644 --- a/server/src/main/java/org/elasticsearch/env/NodeEnvironment.java +++ b/server/src/main/java/org/elasticsearch/env/NodeEnvironment.java @@ -64,6 +64,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; +import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; @@ -143,9 +144,9 @@ public String toString() { } private final Logger logger = LogManager.getLogger(NodeEnvironment.class); - private final NodePath nodePath; + private final NodePath[] nodePaths; private final Path sharedDataPath; - private final Lock lock; + private final Lock[] locks; private final AtomicBoolean closed = new AtomicBoolean(false); private final Map shardLocks = new HashMap<>(); @@ -176,8 +177,8 @@ public String toString() { public static class NodeLock implements Releasable { - private final Lock lock; - private final NodePath nodePath; + private final Lock[] locks; + private final NodePath[] nodePaths; public NodeLock(final Logger logger, @@ -194,18 +195,18 @@ public NodeLock(final Logger logger, final Environment environment, final CheckedFunction pathFunction, final Function subPathMapping) throws IOException { + nodePaths = new NodePath[1]; + locks = new Lock[1]; try { Path dataDir = environment.dataFile(); Path dir = subPathMapping.apply(dataDir); if (pathFunction.apply(dir) == false) { - lock = null; - nodePath = null; return; } try (Directory luceneDir = FSDirectory.open(dir, NativeFSLockFactory.INSTANCE)) { logger.trace("obtaining node lock on {} ...", dir.toAbsolutePath()); - lock = luceneDir.obtainLock(NODE_LOCK_FILENAME); - nodePath = new NodePath(dir); + locks[0] = luceneDir.obtainLock(NODE_LOCK_FILENAME); + nodePaths[0] = new NodePath(dir); } catch (IOException e) { logger.trace(() -> new ParameterizedMessage( "failed to obtain node lock on {}", dir.toAbsolutePath()), e); @@ -220,12 +221,17 @@ public NodeLock(final Logger logger, } public NodePath getNodePath() { - return nodePath; + return nodePaths[0]; } @Override public void close() { - IOUtils.closeWhileHandlingException(lock); + for (int i = 0; i < locks.length; i++) { + if (locks[i] != null) { + IOUtils.closeWhileHandlingException(locks[i]); + } + locks[i] = null; + } } } @@ -252,10 +258,10 @@ public NodeEnvironment(Settings settings, Environment environment) throws IOExce throw new IllegalStateException(message, e); } - this.lock = nodeLock.lock; - this.nodePath = nodeLock.nodePath; + this.locks = nodeLock.locks; + this.nodePaths = nodeLock.nodePaths; - logger.debug("using node location {}", nodePath); + logger.debug("using node location {}", Arrays.toString(nodePaths)); maybeLogPathDetails(); maybeLogHeapDetails(); @@ -263,7 +269,7 @@ public NodeEnvironment(Settings settings, Environment environment) throws IOExce applySegmentInfosTrace(settings); assertCanWrite(); - ensureAtomicMoveSupported(nodePath); + ensureAtomicMoveSupported(nodePaths); if (upgradeLegacyNodeFolders(logger, settings, environment, nodeLock)) { assertCanWrite(); @@ -271,13 +277,13 @@ public NodeEnvironment(Settings settings, Environment environment) throws IOExce if (DiscoveryNode.canContainData(settings) == false) { if (DiscoveryNode.isMasterNode(settings) == false) { - ensureNoIndexMetadata(nodePath); + ensureNoIndexMetadata(nodePaths); } - ensureNoShardData(nodePath); + ensureNoShardData(nodePaths); } - this.nodeMetadata = loadNodeMetadata(settings, logger, nodePath); + this.nodeMetadata = loadNodeMetadata(settings, logger, nodePaths); success = true; } finally { @@ -430,28 +436,43 @@ private void maybeLogPathDetails() throws IOException { if (logger.isDebugEnabled()) { // Log one line per path.data: StringBuilder sb = new StringBuilder(); - sb.append('\n').append(" -> ").append(nodePath.path.toAbsolutePath()); - - FsInfo.Path fsPath = FsProbe.getFSInfo(nodePath); - sb.append(", free_space [") - .append(fsPath.getFree()) - .append("], usable_space [") - .append(fsPath.getAvailable()) - .append("], total_space [") - .append(fsPath.getTotal()) - .append("], mount [") - .append(fsPath.getMount()) - .append("], type [") - .append(fsPath.getType()) - .append(']'); + for (NodePath nodePath : nodePaths) { + sb.append('\n').append(" -> ").append(nodePath.path.toAbsolutePath()); + + FsInfo.Path fsPath = FsProbe.getFSInfo(nodePath); + sb.append(", free_space [") + .append(fsPath.getFree()) + .append("], usable_space [") + .append(fsPath.getAvailable()) + .append("], total_space [") + .append(fsPath.getTotal()) + .append("], mount [") + .append(fsPath.getMount()) + .append("], type [") + .append(fsPath.getType()) + .append(']'); + } logger.debug("node data locations details:{}", sb); } else if (logger.isInfoEnabled()) { - Path path = nodePath.path.toAbsolutePath(); - FsInfo.Path fsPath = FsProbe.getFSInfo(nodePath); + FsInfo.Path totFSPath = new FsInfo.Path(); + Set allTypes = new HashSet<>(); + Set allMounts = new HashSet<>(); + for (NodePath nodePath : nodePaths) { + FsInfo.Path fsPath = FsProbe.getFSInfo(nodePath); + String mount = fsPath.getMount(); + if (allMounts.contains(mount) == false) { + allMounts.add(mount); + String type = fsPath.getType(); + if (type != null) { + allTypes.add(type); + } + totFSPath.add(fsPath); + } + } // Just log a 1-line summary: - logger.info("using data path: mount [{}], usable_space [{}], total_space [{}], type [{}]", - fsPath.getMount(), fsPath.getAvailable(), fsPath.getTotal(), fsPath.getType()); + logger.info("using [{}] data paths, mounts [{}], net usable_space [{}], net total_space [{}], types [{}]", + nodePaths.length, allMounts, totFSPath.getAvailable(), totFSPath.getTotal(), toString(allTypes)); } } @@ -466,15 +487,29 @@ private void maybeLogHeapDetails() { * scans the node paths and loads existing metadata file. If not found a new meta data will be generated */ private static NodeMetadata loadNodeMetadata(Settings settings, Logger logger, - NodePath nodePath) throws IOException { - final Path path = nodePath.path; - NodeMetadata metadata = PersistedClusterStateService.nodeMetadata(path); + NodePath... nodePaths) throws IOException { + final Path[] paths = Arrays.stream(nodePaths).map(np -> np.path).toArray(Path[]::new); + NodeMetadata metadata = PersistedClusterStateService.nodeMetadata(paths); if (metadata == null) { // load legacy metadata - final NodeMetadata legacyMetadata = NodeMetadata.FORMAT.loadLatestState(logger, NamedXContentRegistry.EMPTY, path); + final Set nodeIds = new HashSet<>(); + for (final Path path : paths) { + final NodeMetadata oldStyleMetadata = NodeMetadata.FORMAT.loadLatestState(logger, NamedXContentRegistry.EMPTY, path); + if (oldStyleMetadata != null) { + nodeIds.add(oldStyleMetadata.nodeId()); + } + } + if (nodeIds.size() > 1) { + throw new IllegalStateException( + "data paths " + Arrays.toString(paths) + " belong to multiple nodes with IDs " + nodeIds); + } + // load legacy metadata + final NodeMetadata legacyMetadata = NodeMetadata.FORMAT.loadLatestState(logger, NamedXContentRegistry.EMPTY, paths); if (legacyMetadata == null) { + assert nodeIds.isEmpty() : nodeIds; metadata = new NodeMetadata(generateNodeId(settings), Version.CURRENT); } else { + assert nodeIds.equals(Collections.singleton(legacyMetadata.nodeId())) : nodeIds + " doesn't match " + legacyMetadata; metadata = legacyMetadata; } } @@ -856,7 +891,7 @@ public void setDetails(String details) { } public boolean hasNodeFile() { - return nodePath != null && lock != null; + return nodePaths != null && locks != null; } /** @@ -865,7 +900,7 @@ public boolean hasNodeFile() { */ public Path nodeDataPath() { assertEnvIsLocked(); - return nodePath.path; + return nodePaths[0].path; } /** @@ -891,10 +926,10 @@ public String nodeId() { */ public NodePath nodePath() { assertEnvIsLocked(); - if (nodePath == null || lock == null) { + if (nodePaths == null || locks == null) { throw new IllegalStateException("node is not configured to store local location"); } - return nodePath; + return nodePaths[0]; } /** @@ -902,9 +937,11 @@ public NodePath nodePath() { */ public Path indexPath(Index index) { assertEnvIsLocked(); - return nodePath.resolve(index); + return nodePaths[0].resolve(index); } + + /** * Returns all shard paths excluding custom shard path. Note: Shards are only allocated on one of the * returned paths. The returned array may contain paths to non-existing directories. @@ -915,7 +952,7 @@ public Path indexPath(Index index) { */ public Path availableShardPath(ShardId shardId) { assertEnvIsLocked(); - return nodePath.resolve(shardId); + return nodePaths[0].resolve(shardId); } /** @@ -930,11 +967,15 @@ public Set availableIndexFolders() throws IOException { * @param excludeIndexPathIdsPredicate folder names to exclude */ public Set availableIndexFolders(Predicate excludeIndexPathIdsPredicate) throws IOException { - if (nodePath == null || lock == null) { + if (nodePaths == null || locks == null) { throw new IllegalStateException("node is not configured to store local location"); } assertEnvIsLocked(); - return availableIndexFoldersForPath(nodePath, excludeIndexPathIdsPredicate); + Set indexFolders = new HashSet<>(); + for (NodePath nodePath : nodePaths) { + indexFolders.addAll(availableIndexFoldersForPath(nodePath, excludeIndexPathIdsPredicate)); + } + return indexFolders; } @@ -959,7 +1000,7 @@ public Set availableIndexFoldersForPath(final NodePath nodePath) throws */ public Set availableIndexFoldersForPath(final NodePath nodePath, Predicate excludeIndexPathIdsPredicate) throws IOException { - if (nodePath == null || lock == null) { + if (nodePaths == null || locks == null) { throw new IllegalStateException("node is not configured to store local location"); } assertEnvIsLocked(); @@ -982,11 +1023,11 @@ public Set availableIndexFoldersForPath(final NodePath nodePath, Predica * Resolves all existing paths to indexFolderName in ${data.paths}/indices */ public Path resolveIndexFolder(String indexFolderName) { - if (nodePath == null || lock == null) { + if (nodePaths == null || locks == null) { throw new IllegalStateException("node is not configured to store local location"); } assertEnvIsLocked(); - return nodePath.indicesPath.resolve(indexFolderName); + return nodePaths[0].indicesPath.resolve(indexFolderName); } /** @@ -999,12 +1040,44 @@ public Path resolveIndexFolder(String indexFolderName) { */ public Set findAllShardIds(final Index index) throws IOException { assert index != null; - if (nodePath == null || lock == null) { + if (nodePaths == null || locks == null) { throw new IllegalStateException("node is not configured to store local location"); } assertEnvIsLocked(); final Set shardIds = new HashSet<>(); - final Path indexPath = nodePath.indicesPath.resolve(index.getUUID()); + final String indexUniquePathId = index.getUUID(); + for (final NodePath nodePath : nodePaths) { + shardIds.addAll(findAllShardsForIndex(nodePath.indicesPath.resolve(indexUniquePathId), index)); + } + return shardIds; + } + + /** + * Find all the shards for this index, returning a map of the {@code NodePath} to the number of shards on that path + * @param index the index by which to filter shards + * @return a map of NodePath to count of the shards for the index on that path + * @throws IOException if an IOException occurs + */ + public Map shardCountPerPath(final Index index) throws IOException { + assert index != null; + if (nodePaths == null || locks == null) { + throw new IllegalStateException("node is not configured to store local location"); + } + assertEnvIsLocked(); + final Map shardCountPerPath = new HashMap<>(); + final String indexUniquePathId = index.getUUID(); + for (final NodePath nodePath : nodePaths) { + Path indexLocation = nodePath.indicesPath.resolve(indexUniquePathId); + if (Files.isDirectory(indexLocation)) { + shardCountPerPath.put(nodePath, (long) findAllShardsForIndex(indexLocation, index).size()); + } + } + return shardCountPerPath; + } + + private static Set findAllShardsForIndex(Path indexPath, Index index) throws IOException { + assert indexPath.getFileName().toString().equals(index.getUUID()); + Set shardIds = new HashSet<>(); if (Files.isDirectory(indexPath)) { try (DirectoryStream stream = Files.newDirectoryStream(indexPath)) { for (Path shardPath : stream) { @@ -1022,24 +1095,28 @@ public Set findAllShardIds(final Index index) throws IOException { @Override public void close() { - if (closed.compareAndSet(false, true) && lock != null) { - try { - logger.trace("releasing lock [{}]", lock); - lock.close(); - } catch (IOException e) { - logger.trace(() -> new ParameterizedMessage("failed to release lock [{}]", lock), e); + if (closed.compareAndSet(false, true) && locks != null) { + for (Lock lock : locks) { + try { + logger.trace("releasing lock [{}]", lock); + lock.close(); + } catch (IOException e) { + logger.trace(() -> new ParameterizedMessage("failed to release lock [{}]", lock), e); + } } } } private void assertEnvIsLocked() { - if (closed.get() == false && lock != null) { - try { - lock.ensureValid(); - } catch (IOException e) { - logger.warn("lock assertion failed", e); - throw new IllegalStateException("environment is not locked", e); + if (closed.get() == false && locks != null) { + for (Lock lock : locks) { + try { + lock.ensureValid(); + } catch (IOException e) { + logger.warn("lock assertion failed", e); + throw new IllegalStateException("environment is not locked", e); + } } } } @@ -1050,29 +1127,31 @@ private void assertEnvIsLocked() { * not supported by the filesystem. This test is executed on each of the data directories. * This method cleans up all files even in the case of an error. */ - private static void ensureAtomicMoveSupported(final NodePath nodePath) throws IOException { - assert Files.isDirectory(nodePath.path) : nodePath.path + " is not a directory"; - final Path src = nodePath.path.resolve(TEMP_FILE_NAME + ".tmp"); - final Path target = nodePath.path.resolve(TEMP_FILE_NAME + ".final"); - try { - Files.deleteIfExists(src); - Files.createFile(src); - Files.move(src, target, StandardCopyOption.ATOMIC_MOVE, StandardCopyOption.REPLACE_EXISTING); - } catch (AtomicMoveNotSupportedException ex) { - throw new IllegalStateException("atomic_move is not supported by the filesystem on path [" - + nodePath.path - + "] atomic_move is required for elasticsearch to work correctly.", ex); - } finally { + private static void ensureAtomicMoveSupported(final NodePath[] nodePaths) throws IOException { + for (NodePath nodePath : nodePaths) { + assert Files.isDirectory(nodePath.path) : nodePath.path + " is not a directory"; + final Path src = nodePath.path.resolve(TEMP_FILE_NAME + ".tmp"); + final Path target = nodePath.path.resolve(TEMP_FILE_NAME + ".final"); try { Files.deleteIfExists(src); + Files.createFile(src); + Files.move(src, target, StandardCopyOption.ATOMIC_MOVE, StandardCopyOption.REPLACE_EXISTING); + } catch (AtomicMoveNotSupportedException ex) { + throw new IllegalStateException("atomic_move is not supported by the filesystem on path [" + + nodePath.path + + "] atomic_move is required for elasticsearch to work correctly.", ex); } finally { - Files.deleteIfExists(target); + try { + Files.deleteIfExists(src); + } finally { + Files.deleteIfExists(target); + } } } } - private void ensureNoShardData(final NodePath nodePath) throws IOException { - List shardDataPaths = collectShardDataPaths(nodePath); + private void ensureNoShardData(final NodePath[] nodePaths) throws IOException { + List shardDataPaths = collectShardDataPaths(nodePaths); if (shardDataPaths.isEmpty() == false) { final String message = String.format( Locale.ROOT, @@ -1084,8 +1163,8 @@ private void ensureNoShardData(final NodePath nodePath) throws IOException { } } - private void ensureNoIndexMetadata(final NodePath nodePath) throws IOException { - List indexMetadataPaths = collectIndexMetadataPaths(nodePath); + private void ensureNoIndexMetadata(final NodePath[] nodePaths) throws IOException { + List indexMetadataPaths = collectIndexMetadataPaths(nodePaths); if (indexMetadataPaths.isEmpty() == false) { final String message = String.format( Locale.ROOT, @@ -1101,8 +1180,8 @@ private void ensureNoIndexMetadata(final NodePath nodePath) throws IOException { /** * Collect the paths containing shard data in the indicated node paths. The returned paths will point to the shard data folder. */ - static List collectShardDataPaths(NodePath nodePath) throws IOException { - return collectIndexSubPaths(nodePath, NodeEnvironment::isShardPath); + static List collectShardDataPaths(NodePath[] nodePaths) throws IOException { + return collectIndexSubPaths(nodePaths, NodeEnvironment::isShardPath); } @@ -1110,21 +1189,23 @@ static List collectShardDataPaths(NodePath nodePath) throws IOException { * Collect the paths containing index meta data in the indicated node paths. The returned paths will point to the * {@link MetadataStateFormat#STATE_DIR_NAME} folder */ - static List collectIndexMetadataPaths(NodePath nodePath) throws IOException { - return collectIndexSubPaths(nodePath, NodeEnvironment::isIndexMetadataPath); + static List collectIndexMetadataPaths(NodePath[] nodePaths) throws IOException { + return collectIndexSubPaths(nodePaths, NodeEnvironment::isIndexMetadataPath); } - private static List collectIndexSubPaths(NodePath nodePath, Predicate subPathPredicate) throws IOException { + private static List collectIndexSubPaths(NodePath[] nodePaths, Predicate subPathPredicate) throws IOException { List indexSubPaths = new ArrayList<>(); - Path indicesPath = nodePath.indicesPath; - if (Files.isDirectory(indicesPath)) { - try (DirectoryStream indexStream = Files.newDirectoryStream(indicesPath)) { - for (Path indexPath : indexStream) { - if (Files.isDirectory(indexPath)) { - try (Stream shardStream = Files.list(indexPath)) { - shardStream.filter(subPathPredicate) - .map(Path::toAbsolutePath) - .forEach(indexSubPaths::add); + for (NodePath nodePath : nodePaths) { + Path indicesPath = nodePath.indicesPath; + if (Files.isDirectory(indicesPath)) { + try (DirectoryStream indexStream = Files.newDirectoryStream(indicesPath)) { + for (Path indexPath : indexStream) { + if (Files.isDirectory(indexPath)) { + try (Stream shardStream = Files.list(indexPath)) { + shardStream.filter(subPathPredicate) + .map(Path::toAbsolutePath) + .forEach(indexSubPaths::add); + } } } } diff --git a/server/src/main/java/org/elasticsearch/env/NodeRepurposeCommand.java b/server/src/main/java/org/elasticsearch/env/NodeRepurposeCommand.java index 9b92638a440f8..bfd3b2667b2b0 100644 --- a/server/src/main/java/org/elasticsearch/env/NodeRepurposeCommand.java +++ b/server/src/main/java/org/elasticsearch/env/NodeRepurposeCommand.java @@ -77,10 +77,10 @@ private void processNoMasterNoDataNode(Terminal terminal, Path[] dataPaths, Envi NodeEnvironment.NodePath[] nodePaths = toNodePaths(dataPaths); terminal.println(Terminal.Verbosity.VERBOSE, "Collecting shard data paths"); - List shardDataPaths = NodeEnvironment.collectShardDataPaths(nodePaths[0]); + List shardDataPaths = NodeEnvironment.collectShardDataPaths(nodePaths); terminal.println(Terminal.Verbosity.VERBOSE, "Collecting index metadata paths"); - List indexMetadataPaths = NodeEnvironment.collectIndexMetadataPaths(nodePaths[0]); + List indexMetadataPaths = NodeEnvironment.collectIndexMetadataPaths(nodePaths); Set indexPaths = uniqueParentPaths(shardDataPaths, indexMetadataPaths); @@ -116,7 +116,7 @@ private void processMasterNoDataNode(Terminal terminal, Path[] dataPaths, Enviro NodeEnvironment.NodePath[] nodePaths = toNodePaths(dataPaths); terminal.println(Terminal.Verbosity.VERBOSE, "Collecting shard data paths"); - List shardDataPaths = NodeEnvironment.collectShardDataPaths(nodePaths[0]); + List shardDataPaths = NodeEnvironment.collectShardDataPaths(nodePaths); if (shardDataPaths.isEmpty()) { terminal.println(NO_SHARD_DATA_TO_CLEAN_UP_FOUND); return; From 06d6fb958600786dc8a52b2b43254427f398a7b8 Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Tue, 5 Oct 2021 06:49:51 -0700 Subject: [PATCH 165/250] Convert graph license object to LicensedFeature (#78656) This commit moves the graph license checks to use the new LicensedFeature class. --- .../java/org/elasticsearch/license/XPackLicenseState.java | 2 -- .../main/java/org/elasticsearch/xpack/graph/Graph.java | 4 ++++ .../xpack/graph/GraphInfoTransportAction.java | 2 +- .../xpack/graph/GraphUsageTransportAction.java | 3 +-- .../xpack/graph/action/TransportGraphExploreAction.java | 3 ++- .../xpack/graph/GraphInfoTransportActionTests.java | 8 ++++---- 6 files changed, 12 insertions(+), 10 deletions(-) diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/XPackLicenseState.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/XPackLicenseState.java index 3e09fee438e9e..bc5dddd39e63c 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/XPackLicenseState.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/XPackLicenseState.java @@ -58,8 +58,6 @@ public enum Feature { CCR(OperationMode.PLATINUM, true), - GRAPH(OperationMode.PLATINUM, true), - MACHINE_LEARNING(OperationMode.PLATINUM, true), OPERATOR_PRIVILEGES(OperationMode.ENTERPRISE, true); diff --git a/x-pack/plugin/graph/src/main/java/org/elasticsearch/xpack/graph/Graph.java b/x-pack/plugin/graph/src/main/java/org/elasticsearch/xpack/graph/Graph.java index 51944b7327118..e937468fd66a9 100644 --- a/x-pack/plugin/graph/src/main/java/org/elasticsearch/xpack/graph/Graph.java +++ b/x-pack/plugin/graph/src/main/java/org/elasticsearch/xpack/graph/Graph.java @@ -14,6 +14,8 @@ import org.elasticsearch.common.settings.IndexScopedSettings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.SettingsFilter; +import org.elasticsearch.license.License; +import org.elasticsearch.license.LicensedFeature; import org.elasticsearch.plugins.ActionPlugin; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.rest.RestController; @@ -34,6 +36,8 @@ public class Graph extends Plugin implements ActionPlugin { + public static final LicensedFeature.Momentary GRAPH_FEATURE = LicensedFeature.momentary(null, "graph", License.OperationMode.PLATINUM); + protected final boolean enabled; public Graph(Settings settings) { diff --git a/x-pack/plugin/graph/src/main/java/org/elasticsearch/xpack/graph/GraphInfoTransportAction.java b/x-pack/plugin/graph/src/main/java/org/elasticsearch/xpack/graph/GraphInfoTransportAction.java index 7c6eefa51aa9f..0e03ecb6a55f2 100644 --- a/x-pack/plugin/graph/src/main/java/org/elasticsearch/xpack/graph/GraphInfoTransportAction.java +++ b/x-pack/plugin/graph/src/main/java/org/elasticsearch/xpack/graph/GraphInfoTransportAction.java @@ -36,7 +36,7 @@ public String name() { @Override public boolean available() { - return licenseState != null && licenseState.isAllowed(XPackLicenseState.Feature.GRAPH); + return licenseState != null && Graph.GRAPH_FEATURE.checkWithoutTracking(licenseState); } @Override diff --git a/x-pack/plugin/graph/src/main/java/org/elasticsearch/xpack/graph/GraphUsageTransportAction.java b/x-pack/plugin/graph/src/main/java/org/elasticsearch/xpack/graph/GraphUsageTransportAction.java index 19a4e8c6f6384..316e911288cc1 100644 --- a/x-pack/plugin/graph/src/main/java/org/elasticsearch/xpack/graph/GraphUsageTransportAction.java +++ b/x-pack/plugin/graph/src/main/java/org/elasticsearch/xpack/graph/GraphUsageTransportAction.java @@ -14,7 +14,6 @@ import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.license.XPackLicenseState; -import org.elasticsearch.license.XPackLicenseState.Feature; import org.elasticsearch.protocol.xpack.XPackUsageRequest; import org.elasticsearch.tasks.Task; import org.elasticsearch.threadpool.ThreadPool; @@ -44,7 +43,7 @@ public GraphUsageTransportAction(TransportService transportService, ClusterServi protected void masterOperation(Task task, XPackUsageRequest request, ClusterState state, ActionListener listener) { GraphFeatureSetUsage usage = - new GraphFeatureSetUsage(licenseState.isAllowed(Feature.GRAPH), XPackSettings.GRAPH_ENABLED.get(settings)); + new GraphFeatureSetUsage(Graph.GRAPH_FEATURE.checkWithoutTracking(licenseState), XPackSettings.GRAPH_ENABLED.get(settings)); listener.onResponse(new XPackUsageFeatureResponse(usage)); } } diff --git a/x-pack/plugin/graph/src/main/java/org/elasticsearch/xpack/graph/action/TransportGraphExploreAction.java b/x-pack/plugin/graph/src/main/java/org/elasticsearch/xpack/graph/action/TransportGraphExploreAction.java index 7075507a5d032..7e4925b8506be 100644 --- a/x-pack/plugin/graph/src/main/java/org/elasticsearch/xpack/graph/action/TransportGraphExploreAction.java +++ b/x-pack/plugin/graph/src/main/java/org/elasticsearch/xpack/graph/action/TransportGraphExploreAction.java @@ -49,6 +49,7 @@ import org.elasticsearch.transport.TransportService; import org.elasticsearch.xpack.core.XPackField; import org.elasticsearch.xpack.core.graph.action.GraphExploreAction; +import org.elasticsearch.xpack.graph.Graph; import java.util.ArrayList; import java.util.HashMap; @@ -93,7 +94,7 @@ public TransportGraphExploreAction(ThreadPool threadPool, NodeClient client, Tra @Override protected void doExecute(Task task, GraphExploreRequest request, ActionListener listener) { - if (licenseState.checkFeature(XPackLicenseState.Feature.GRAPH)) { + if (Graph.GRAPH_FEATURE.check(licenseState)) { new AsyncGraphAction(request, listener).start(); } else { listener.onFailure(LicenseUtils.newComplianceException(XPackField.GRAPH)); diff --git a/x-pack/plugin/graph/src/test/java/org/elasticsearch/xpack/graph/GraphInfoTransportActionTests.java b/x-pack/plugin/graph/src/test/java/org/elasticsearch/xpack/graph/GraphInfoTransportActionTests.java index 5891d269eb662..06276c2e2a028 100644 --- a/x-pack/plugin/graph/src/test/java/org/elasticsearch/xpack/graph/GraphInfoTransportActionTests.java +++ b/x-pack/plugin/graph/src/test/java/org/elasticsearch/xpack/graph/GraphInfoTransportActionTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.action.support.PlainActionFuture; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.license.XPackLicenseState; +import org.elasticsearch.license.MockLicenseState; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.transport.TransportService; import org.elasticsearch.xpack.core.XPackFeatureSet; @@ -24,18 +24,18 @@ public class GraphInfoTransportActionTests extends ESTestCase { - private XPackLicenseState licenseState; + private MockLicenseState licenseState; @Before public void init() throws Exception { - licenseState = mock(XPackLicenseState.class); + licenseState = mock(MockLicenseState.class); } public void testAvailable() throws Exception { GraphInfoTransportAction featureSet = new GraphInfoTransportAction( mock(TransportService.class), mock(ActionFilters.class), Settings.EMPTY, licenseState); boolean available = randomBoolean(); - when(licenseState.isAllowed(XPackLicenseState.Feature.GRAPH)).thenReturn(available); + when(licenseState.isAllowed(Graph.GRAPH_FEATURE)).thenReturn(available); assertThat(featureSet.available(), is(available)); var usageAction = new GraphUsageTransportAction(mock(TransportService.class), null, null, From fdf739b712c0906b8bdc8ba69f5efc3cd9cee051 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20Zolt=C3=A1n=20Szab=C3=B3?= Date: Tue, 5 Oct 2021 16:22:59 +0200 Subject: [PATCH 166/250] [DOCS] Removes LLRC from Java REST book. (#78602) --- docs/java-rest/index.asciidoc | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/java-rest/index.asciidoc b/docs/java-rest/index.asciidoc index 9fc15fd69c89b..f688d152f228d 100644 --- a/docs/java-rest/index.asciidoc +++ b/docs/java-rest/index.asciidoc @@ -7,8 +7,6 @@ include::../Versions.asciidoc[] include::overview.asciidoc[] -include::low-level/index.asciidoc[] - include::high-level/index.asciidoc[] include::redirects.asciidoc[] \ No newline at end of file From 19d12f19f52b7bd601dc37b1fe971e7828cc9be1 Mon Sep 17 00:00:00 2001 From: Alexander Reelsen Date: Tue, 5 Oct 2021 16:32:20 +0200 Subject: [PATCH 167/250] [DOCS] Add script note to nested query docs (#77431) As the script has only access to the nested document, this should be documented. Co-authored-by: James Rodewig <40268737+jrodewig@users.noreply.github.com> --- docs/reference/query-dsl/nested-query.asciidoc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/reference/query-dsl/nested-query.asciidoc b/docs/reference/query-dsl/nested-query.asciidoc index 392f779305bec..2a53a918d8826 100644 --- a/docs/reference/query-dsl/nested-query.asciidoc +++ b/docs/reference/query-dsl/nested-query.asciidoc @@ -121,6 +121,12 @@ field `path`. [[nested-query-notes]] ==== Notes +[[nested-query-script-notes]] +===== Context of script queries +If you run a <> within a nested query, +you can only access doc values from the nested document, not the parent +or root document. + [[multi-level-nested-query-ex]] ===== Multi-level nested queries From cb73e3fea76462235b4c89ab2d46abcaa8e81468 Mon Sep 17 00:00:00 2001 From: Artem Prigoda Date: Tue, 5 Oct 2021 17:00:41 +0200 Subject: [PATCH 168/250] Expose ImmutableOpenMap.values as a Java Collection (#78529) #76921 added support for getting entries as a Java stream, #77897 added the ability to get keys as a Set. This PR adds the values method which returns a Collection to bring the ImmutableOpenMap API closer to java.util.Map --- .../GetIndexTemplatesResponseTests.java | 8 +-- .../ingest/geoip/GeoIpDownloaderIT.java | 6 +- .../admin/indices/create/ShrinkIndexIT.java | 12 ++-- .../cluster/ClusterInfoServiceIT.java | 23 ++++--- .../routing/RemoveReplicaPriorityIT.java | 8 +-- .../decider/DiskThresholdDeciderIT.java | 5 +- .../gateway/RecoveryFromGatewayIT.java | 4 +- .../recovery/IndexPrimaryRelocationIT.java | 2 +- .../indices/state/CloseIndexIT.java | 5 +- .../routing/PartitionedRoutingIT.java | 2 +- .../snapshots/CloneSnapshotIT.java | 6 +- .../snapshots/ConcurrentSnapshotsIT.java | 6 +- .../TransportSnapshotsStatusAction.java | 7 +- .../alias/TransportIndicesAliasesAction.java | 5 +- .../get/TransportGetIndexTemplatesAction.java | 4 +- .../action/ingest/IngestActionForwarder.java | 2 +- .../cluster/ClusterChangedEvent.java | 4 +- .../cluster/RestoreInProgress.java | 9 ++- .../cluster/SnapshotsInProgress.java | 13 ++-- .../UnsafeBootstrapMasterCommand.java | 5 +- .../cluster/metadata/AutoExpandReplicas.java | 5 +- .../cluster/metadata/IndexMetadata.java | 20 +++--- .../metadata/IndexNameExpressionResolver.java | 5 +- .../metadata/IndexTemplateMetadata.java | 10 +-- .../cluster/metadata/Metadata.java | 50 +++++++------- .../MetadataIndexTemplateService.java | 4 +- .../cluster/node/DiscoveryNodes.java | 3 +- .../cluster/routing/RoutingNodes.java | 10 ++- .../cluster/routing/RoutingTable.java | 6 +- .../decider/DiskThresholdDecider.java | 7 +- .../common/collect/ImmutableOpenMap.java | 24 +++++-- .../io/stream/VersionedNamedWriteable.java | 11 ++-- .../elasticsearch/discovery/PeerFinder.java | 5 +- .../env/NodeRepurposeCommand.java | 8 +-- .../gateway/ClusterStateUpdaters.java | 5 +- .../gateway/DanglingIndicesState.java | 5 +- .../gateway/PersistedClusterStateService.java | 11 +--- .../gateway/ReplicaShardAllocator.java | 6 +- .../index/engine/SegmentsStats.java | 6 +- .../RemoveCorruptedShardDataCommand.java | 7 +- .../indices/ShardLimitValidator.java | 7 +- .../indices/TimestampFieldMapperService.java | 4 +- .../VerifyNodeRepositoryAction.java | 9 +-- .../snapshots/RestoreService.java | 22 +++---- .../snapshots/SnapshotsService.java | 14 ++-- .../nodes/TransportNodesActionTests.java | 2 +- .../cluster/ClusterChangedEventTests.java | 11 ++-- .../cluster/node/DiscoveryNodesTests.java | 35 ++++------ .../allocation/AddIncrementallyTests.java | 4 +- .../allocation/BalanceConfigurationTests.java | 8 +-- .../allocation/FailedNodeRoutingTests.java | 7 +- .../allocation/FailedShardsRoutingTests.java | 19 +++--- .../allocation/ThrottlingAllocationTests.java | 8 +-- .../EnableAllocationShortCircuitTests.java | 4 +- .../common/collect/ImmutableOpenMapTests.java | 65 ++++++++++++++++++- .../indices/ShardLimitValidatorTests.java | 8 +-- ...ClusterStateServiceRandomUpdatesTests.java | 2 +- .../ReactiveStorageDeciderDecisionTests.java | 4 +- .../ccr/action/AutoFollowCoordinator.java | 9 +-- .../allocation/DataTierAllocationDecider.java | 6 +- .../xpack/core/ilm/LifecyclePolicyUtils.java | 4 +- .../xpack/core/ilm/PhaseCacheManagement.java | 4 +- .../SwapAliasesAndDeleteSourceIndexStep.java | 4 +- .../xpack/core/DataTierTests.java | 19 ++---- .../xpack/enrich/EnrichPolicyRunner.java | 6 +- .../action/EnrichCoordinatorStatsAction.java | 2 +- .../frozen/FrozenIndexRecoveryTests.java | 6 +- ...adataMigrateToDataTiersRoutingService.java | 4 +- .../xpack/ilm/IndexLifecycleService.java | 8 +-- .../TransportDeleteLifecycleAction.java | 12 +--- .../integration/RunDataFrameAnalyticsIT.java | 4 +- .../ml/integration/MlConfigMigratorIT.java | 5 +- .../xpack/ml/dataframe/DestinationIndex.java | 5 +- .../xpack/ql/index/IndexResolver.java | 5 +- .../FrozenSearchableSnapshotsIntegTests.java | 6 +- .../SearchableSnapshotsIntegTests.java | 6 +- ...bleSnapshotsPersistentCacheIntegTests.java | 2 +- ...SnapshotRecoveryStateIntegrationTests.java | 6 +- ...rchableSnapshotsNodeCachesStatsAction.java | 2 +- .../SearchableSnapshotAllocator.java | 2 +- .../ShrinkIndexWithSecurityTests.java | 2 +- .../testkit/RepositoryAnalyzeAction.java | 14 ++-- .../HistoryTemplateHttpMappingsTests.java | 5 +- .../integration/HistoryIntegrationTests.java | 6 +- 84 files changed, 340 insertions(+), 391 deletions(-) diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/GetIndexTemplatesResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/GetIndexTemplatesResponseTests.java index 1301c1bdad7c6..26eb969f0ecb2 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/GetIndexTemplatesResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/GetIndexTemplatesResponseTests.java @@ -29,7 +29,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Comparator; -import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.Map; @@ -105,10 +104,10 @@ public void testParsingFromEsResponse() throws IOException { assertThat(result.mappings().sourceAsMap(), equalTo(expectedMapping.get("_doc"))); assertThat(result.aliases().size(), equalTo(esIMD.aliases().size())); - List expectedAliases = Arrays.stream(esIMD.aliases().values().toArray(AliasMetadata.class)) + List expectedAliases = esIMD.aliases().values().stream() .sorted(Comparator.comparing(AliasMetadata::alias)) .collect(Collectors.toList()); - List actualAliases = Arrays.stream(result.aliases().values().toArray(AliasMetadata.class)) + List actualAliases = result.aliases().values().stream() .sorted(Comparator.comparing(AliasMetadata::alias)) .collect(Collectors.toList()); for (int j = 0; j < result.aliases().size(); j++) { @@ -186,8 +185,7 @@ static void toXContent(GetIndexTemplatesResponse response, XContentBuilder build serverTemplateBuilder.patterns(clientITMD.patterns()); - Iterator aliases = clientITMD.aliases().valuesIt(); - aliases.forEachRemaining((a)->serverTemplateBuilder.putAlias(a)); + clientITMD.aliases().values().forEach(serverTemplateBuilder::putAlias); serverTemplateBuilder.settings(clientITMD.settings()); serverTemplateBuilder.order(clientITMD.order()); diff --git a/modules/ingest-geoip/src/internalClusterTest/java/org/elasticsearch/ingest/geoip/GeoIpDownloaderIT.java b/modules/ingest-geoip/src/internalClusterTest/java/org/elasticsearch/ingest/geoip/GeoIpDownloaderIT.java index ce670f702b650..e2e7290fa9b68 100644 --- a/modules/ingest-geoip/src/internalClusterTest/java/org/elasticsearch/ingest/geoip/GeoIpDownloaderIT.java +++ b/modules/ingest-geoip/src/internalClusterTest/java/org/elasticsearch/ingest/geoip/GeoIpDownloaderIT.java @@ -16,6 +16,7 @@ import org.elasticsearch.action.ingest.SimulatePipelineRequest; import org.elasticsearch.action.ingest.SimulatePipelineResponse; import org.elasticsearch.action.search.SearchResponse; +import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentBuilder; @@ -51,7 +52,6 @@ import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; import java.util.stream.Stream; -import java.util.stream.StreamSupport; import java.util.zip.GZIPInputStream; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; @@ -398,8 +398,8 @@ private void putPipeline() throws IOException { } private List getGeoIpTmpDirs() throws IOException { - final Set ids = StreamSupport.stream(clusterService().state().nodes().getDataNodes().values().spliterator(), false) - .map(c -> c.value.getId()) + final Set ids = clusterService().state().nodes().getDataNodes().values().stream() + .map(DiscoveryNode::getId) .collect(Collectors.toSet()); // All nodes share the same geoip base dir in the shared tmp dir: Path geoipBaseTmpDir = internalCluster().getDataNodeInstance(Environment.class).tmpFile().resolve("geoip-databases"); diff --git a/server/src/internalClusterTest/java/org/elasticsearch/action/admin/indices/create/ShrinkIndexIT.java b/server/src/internalClusterTest/java/org/elasticsearch/action/admin/indices/create/ShrinkIndexIT.java index 6f75acd9ff389..3970095587932 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/action/admin/indices/create/ShrinkIndexIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/action/admin/indices/create/ShrinkIndexIT.java @@ -86,7 +86,7 @@ public void testCreateShrinkIndexToN() { ImmutableOpenMap dataNodes = client().admin().cluster().prepareState().get().getState().nodes() .getDataNodes(); assertTrue("at least 2 nodes but was: " + dataNodes.size(), dataNodes.size() >= 2); - DiscoveryNode[] discoveryNodes = dataNodes.values().toArray(DiscoveryNode.class); + DiscoveryNode[] discoveryNodes = dataNodes.values().toArray(DiscoveryNode[]::new); String mergeNode = discoveryNodes[0].getName(); // ensure all shards are allocated otherwise the ensure green below might not succeed since we require the merge node // if we change the setting too quickly we will end up with one replica unassigned which can't be assigned anymore due @@ -159,7 +159,7 @@ public void testShrinkIndexPrimaryTerm() throws Exception { final ImmutableOpenMap dataNodes = client().admin().cluster().prepareState().get().getState().nodes().getDataNodes(); assertThat(dataNodes.size(), greaterThanOrEqualTo(2)); - final DiscoveryNode[] discoveryNodes = dataNodes.values().toArray(DiscoveryNode.class); + final DiscoveryNode[] discoveryNodes = dataNodes.values().toArray(DiscoveryNode[]::new); final String mergeNode = discoveryNodes[0].getName(); // This needs more than the default timeout if a large number of shards were created. ensureGreen(TimeValue.timeValueSeconds(120)); @@ -239,7 +239,7 @@ public void testCreateShrinkIndex() { ImmutableOpenMap dataNodes = client().admin().cluster().prepareState().get().getState().nodes().getDataNodes(); assertTrue("at least 2 nodes but was: " + dataNodes.size(), dataNodes.size() >= 2); - DiscoveryNode[] discoveryNodes = dataNodes.values().toArray(DiscoveryNode.class); + DiscoveryNode[] discoveryNodes = dataNodes.values().toArray(DiscoveryNode[]::new); // ensure all shards are allocated otherwise the ensure green below might not succeed since we require the merge node // if we change the setting too quickly we will end up with one replica unassigned which can't be assigned anymore due // to the require._name below. @@ -340,7 +340,7 @@ public void testCreateShrinkIndexFails() throws Exception { ImmutableOpenMap dataNodes = client().admin().cluster().prepareState().get().getState().nodes() .getDataNodes(); assertTrue("at least 2 nodes but was: " + dataNodes.size(), dataNodes.size() >= 2); - DiscoveryNode[] discoveryNodes = dataNodes.values().toArray(DiscoveryNode.class); + DiscoveryNode[] discoveryNodes = dataNodes.values().toArray(DiscoveryNode[]::new); String spareNode = discoveryNodes[0].getName(); String mergeNode = discoveryNodes[1].getName(); // ensure all shards are allocated otherwise the ensure green below might not succeed since we require the merge node @@ -419,7 +419,7 @@ public void testCreateShrinkWithIndexSort() throws Exception { ImmutableOpenMap dataNodes = client().admin().cluster().prepareState().get().getState().nodes() .getDataNodes(); assertTrue("at least 2 nodes but was: " + dataNodes.size(), dataNodes.size() >= 2); - DiscoveryNode[] discoveryNodes = dataNodes.values().toArray(DiscoveryNode.class); + DiscoveryNode[] discoveryNodes = dataNodes.values().toArray(DiscoveryNode[]::new); String mergeNode = discoveryNodes[0].getName(); // ensure all shards are allocated otherwise the ensure green below might not succeed since we require the merge node // if we change the setting too quickly we will end up with one replica unassigned which can't be assigned anymore due @@ -481,7 +481,7 @@ public void testShrinkCommitsMergeOnIdle() throws Exception { client().admin().indices().prepareFlush("source").get(); ImmutableOpenMap dataNodes = client().admin().cluster().prepareState().get().getState().nodes().getDataNodes(); - DiscoveryNode[] discoveryNodes = dataNodes.values().toArray(DiscoveryNode.class); + DiscoveryNode[] discoveryNodes = dataNodes.values().toArray(DiscoveryNode[]::new); // ensure all shards are allocated otherwise the ensure green below might not succeed since we require the merge node // if we change the setting too quickly we will end up with one replica unassigned which can't be assigned anymore due // to the require._name below. diff --git a/server/src/internalClusterTest/java/org/elasticsearch/cluster/ClusterInfoServiceIT.java b/server/src/internalClusterTest/java/org/elasticsearch/cluster/ClusterInfoServiceIT.java index 1b67e47f5f1f5..81c3cf2dc3b16 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/cluster/ClusterInfoServiceIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/cluster/ClusterInfoServiceIT.java @@ -8,7 +8,6 @@ package org.elasticsearch.cluster; -import com.carrotsearch.hppc.cursors.ObjectCursor; import org.elasticsearch.ElasticsearchException; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.ActionRequest; @@ -159,20 +158,20 @@ public void testClusterInfoServiceCollectsInformation() { assertNotNull(shardDataSetSizes); assertThat("some usages are populated", leastUsages.values().size(), Matchers.equalTo(2)); assertThat("some shard sizes are populated", shardSizes.values().size(), greaterThan(0)); - for (ObjectCursor usage : leastUsages.values()) { - logger.info("--> usage: {}", usage.value); - assertThat("usage has be retrieved", usage.value.getFreeBytes(), greaterThan(0L)); + for (DiskUsage usage : leastUsages.values()) { + logger.info("--> usage: {}", usage); + assertThat("usage has be retrieved", usage.getFreeBytes(), greaterThan(0L)); } - for (ObjectCursor usage : mostUsages.values()) { - logger.info("--> usage: {}", usage.value); - assertThat("usage has be retrieved", usage.value.getFreeBytes(), greaterThan(0L)); + for (DiskUsage usage : mostUsages.values()) { + logger.info("--> usage: {}", usage); + assertThat("usage has be retrieved", usage.getFreeBytes(), greaterThan(0L)); } - for (ObjectCursor size : shardSizes.values()) { - logger.info("--> shard size: {}", size.value); - assertThat("shard size is greater than 0", size.value, greaterThanOrEqualTo(0L)); + for (Long size : shardSizes.values()) { + logger.info("--> shard size: {}", size); + assertThat("shard size is greater than 0", size, greaterThanOrEqualTo(0L)); } - for (ObjectCursor size : shardDataSetSizes.values()) { - assertThat("shard data set size is greater than 0", size.value, greaterThanOrEqualTo(0L)); + for (Long size : shardDataSetSizes.values()) { + assertThat("shard data set size is greater than 0", size, greaterThanOrEqualTo(0L)); } ClusterService clusterService = internalTestCluster.getInstance(ClusterService.class, internalTestCluster.getMasterName()); diff --git a/server/src/internalClusterTest/java/org/elasticsearch/cluster/routing/RemoveReplicaPriorityIT.java b/server/src/internalClusterTest/java/org/elasticsearch/cluster/routing/RemoveReplicaPriorityIT.java index f5f07daddded1..ffe90a462af9f 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/cluster/routing/RemoveReplicaPriorityIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/cluster/routing/RemoveReplicaPriorityIT.java @@ -9,6 +9,7 @@ package org.elasticsearch.cluster.routing; import org.elasticsearch.cluster.metadata.IndexMetadata; +import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.CollectionUtils; import org.elasticsearch.plugins.Plugin; @@ -19,7 +20,6 @@ import java.util.Collection; import java.util.concurrent.atomic.AtomicBoolean; import java.util.stream.Collectors; -import java.util.stream.StreamSupport; import static org.elasticsearch.cluster.routing.ShardRoutingState.INITIALIZING; import static org.elasticsearch.cluster.routing.ShardRoutingState.STARTED; @@ -53,9 +53,9 @@ public void testReplicaRemovalPriority() throws Exception { }); } - final String dataNodeIdFilter = StreamSupport.stream(client().admin().cluster().prepareState().clear().setNodes(true).get() - .getState().nodes().getDataNodes().values().spliterator(), false) - .map(c -> c.value.getId()).limit(3).collect(Collectors.joining(",")); + final String dataNodeIdFilter = client().admin().cluster().prepareState().clear().setNodes(true).get() + .getState().nodes().getDataNodes().values().stream() + .map(DiscoveryNode::getId).limit(3).collect(Collectors.joining(",")); final String excludedDataNodeId = dataNodeIdFilter.substring(0, dataNodeIdFilter.indexOf(',')); createIndex(INDEX_NAME, Settings.builder() diff --git a/server/src/internalClusterTest/java/org/elasticsearch/cluster/routing/allocation/decider/DiskThresholdDeciderIT.java b/server/src/internalClusterTest/java/org/elasticsearch/cluster/routing/allocation/decider/DiskThresholdDeciderIT.java index 017212bbde20b..3642b1a01fd61 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/cluster/routing/allocation/decider/DiskThresholdDeciderIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/cluster/routing/allocation/decider/DiskThresholdDeciderIT.java @@ -40,7 +40,6 @@ import java.util.Locale; import java.util.Set; import java.util.concurrent.TimeUnit; -import java.util.stream.StreamSupport; import static org.elasticsearch.index.store.Store.INDEX_STORE_STATS_REFRESH_INTERVAL_SETTING; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; @@ -206,8 +205,8 @@ private void refreshDiskUsage() { ClusterInfoServiceUtils.refresh(((InternalClusterInfoService) clusterInfoService)); // if the nodes were all under the low watermark already (but unbalanced) then a change in the disk usage doesn't trigger a reroute // even though it's now possible to achieve better balance, so we have to do an explicit reroute. TODO fix this? - if (StreamSupport.stream(clusterInfoService.getClusterInfo().getNodeMostAvailableDiskUsages().values().spliterator(), false) - .allMatch(cur -> cur.value.getFreeBytes() > WATERMARK_BYTES)) { + if (clusterInfoService.getClusterInfo().getNodeMostAvailableDiskUsages().values().stream() + .allMatch(e -> e.getFreeBytes() > WATERMARK_BYTES)) { assertAcked(client().admin().cluster().prepareReroute()); } diff --git a/server/src/internalClusterTest/java/org/elasticsearch/gateway/RecoveryFromGatewayIT.java b/server/src/internalClusterTest/java/org/elasticsearch/gateway/RecoveryFromGatewayIT.java index 68426b47f2b6c..2f6d5b542d186 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/gateway/RecoveryFromGatewayIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/gateway/RecoveryFromGatewayIT.java @@ -8,7 +8,6 @@ package org.elasticsearch.gateway; -import com.carrotsearch.hppc.cursors.ObjectCursor; import org.elasticsearch.action.admin.cluster.configuration.AddVotingConfigExclusionsAction; import org.elasticsearch.action.admin.cluster.configuration.AddVotingConfigExclusionsRequest; import org.elasticsearch.action.admin.cluster.configuration.ClearVotingConfigExclusionsAction; @@ -133,8 +132,7 @@ private Map assertAndCapturePrimaryTerms(Map pre } final Map result = new HashMap<>(); final ClusterState state = client().admin().cluster().prepareState().get().getState(); - for (ObjectCursor cursor : state.metadata().indices().values()) { - final IndexMetadata indexMetadata = cursor.value; + for (IndexMetadata indexMetadata : state.metadata().indices().values()) { final String index = indexMetadata.getIndex().getName(); final long[] previous = previousTerms.get(index); final long[] current = IntStream.range(0, indexMetadata.getNumberOfShards()).mapToLong(indexMetadata::primaryTerm).toArray(); diff --git a/server/src/internalClusterTest/java/org/elasticsearch/indices/recovery/IndexPrimaryRelocationIT.java b/server/src/internalClusterTest/java/org/elasticsearch/indices/recovery/IndexPrimaryRelocationIT.java index bc1a0289d29ac..405c4d0d845ae 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/indices/recovery/IndexPrimaryRelocationIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/indices/recovery/IndexPrimaryRelocationIT.java @@ -58,7 +58,7 @@ public void run() { indexingThread.start(); ClusterState initialState = client().admin().cluster().prepareState().get().getState(); - DiscoveryNode[] dataNodes = initialState.getNodes().getDataNodes().values().toArray(DiscoveryNode.class); + DiscoveryNode[] dataNodes = initialState.getNodes().getDataNodes().values().toArray(DiscoveryNode[]::new); DiscoveryNode relocationSource = initialState.getNodes().getDataNodes().get(initialState.getRoutingTable() .shardRoutingTable("test", 0).primaryShard().currentNodeId()); for (int i = 0; i < RELOCATION_COUNT; i++) { diff --git a/server/src/internalClusterTest/java/org/elasticsearch/indices/state/CloseIndexIT.java b/server/src/internalClusterTest/java/org/elasticsearch/indices/state/CloseIndexIT.java index 3e78c9707371b..729e76950fb38 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/indices/state/CloseIndexIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/indices/state/CloseIndexIT.java @@ -23,7 +23,6 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.util.set.Sets; import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.index.IndexService; import org.elasticsearch.index.IndexSettings; @@ -379,8 +378,8 @@ public void testNoopPeerRecoveriesWhenIndexClosed() throws Exception { public void testRecoverExistingReplica() throws Exception { final String indexName = "test-recover-existing-replica"; internalCluster().ensureAtLeastNumDataNodes(2); - List dataNodes = randomSubsetOf(2, Sets.newHashSet( - clusterService().state().nodes().getDataNodes().valuesIt()).stream().map(DiscoveryNode::getName).collect(Collectors.toSet())); + List dataNodes = randomSubsetOf(2, clusterService().state().nodes().getDataNodes().values() + .stream().map(DiscoveryNode::getName).collect(Collectors.toSet())); createIndex(indexName, Settings.builder() .put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1) .put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 1) diff --git a/server/src/internalClusterTest/java/org/elasticsearch/routing/PartitionedRoutingIT.java b/server/src/internalClusterTest/java/org/elasticsearch/routing/PartitionedRoutingIT.java index 8fa627dfe99e8..20ea1d0b6799b 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/routing/PartitionedRoutingIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/routing/PartitionedRoutingIT.java @@ -84,7 +84,7 @@ public void testShrinking() throws Exception { client().admin().indices().prepareUpdateSettings(index) .setSettings(Settings.builder() .put("index.routing.allocation.require._name", client().admin().cluster().prepareState().get().getState().nodes() - .getDataNodes().values().toArray(DiscoveryNode.class)[0].getName()) + .getDataNodes().values().toArray(DiscoveryNode[]::new)[0].getName()) .put("index.blocks.write", true)).get(); ensureGreen(); diff --git a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/CloneSnapshotIT.java b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/CloneSnapshotIT.java index 257ea05e236ca..a5e8a0ff3c8b6 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/CloneSnapshotIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/CloneSnapshotIT.java @@ -7,8 +7,6 @@ */ package org.elasticsearch.snapshots; -import com.carrotsearch.hppc.cursors.ObjectCursor; - import org.elasticsearch.action.ActionFuture; import org.elasticsearch.action.ActionRunnable; import org.elasticsearch.action.admin.cluster.snapshots.create.CreateSnapshotResponse; @@ -684,8 +682,8 @@ public void testStartCloneDuringRunningDelete() throws Exception { for (SnapshotsInProgress.Entry entry : state.custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY).forRepo(repoName)) { if (entry.shardsByRepoShardId().isEmpty() == false) { assertEquals(sourceSnapshot, entry.source().getName()); - for (ObjectCursor value : entry.shardsByRepoShardId().values()) { - assertSame(value.value, SnapshotsInProgress.ShardSnapshotStatus.UNASSIGNED_QUEUED); + for (SnapshotsInProgress.ShardSnapshotStatus value : entry.shardsByRepoShardId().values()) { + assertSame(value, SnapshotsInProgress.ShardSnapshotStatus.UNASSIGNED_QUEUED); } return true; } diff --git a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/ConcurrentSnapshotsIT.java b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/ConcurrentSnapshotsIT.java index 2b945950feaf8..af3c142935450 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/ConcurrentSnapshotsIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/ConcurrentSnapshotsIT.java @@ -7,8 +7,6 @@ */ package org.elasticsearch.snapshots; -import com.carrotsearch.hppc.cursors.ObjectCursor; - import org.elasticsearch.ElasticsearchException; import org.elasticsearch.ExceptionsHelper; import org.elasticsearch.action.ActionFuture; @@ -1996,8 +1994,8 @@ private void createIndexWithContent(String indexName, String nodeInclude, String private static boolean snapshotHasCompletedShard(String repoName, String snapshot, SnapshotsInProgress snapshotsInProgress) { for (SnapshotsInProgress.Entry entry : snapshotsInProgress.forRepo(repoName)) { if (entry.snapshot().getSnapshotId().getName().equals(snapshot)) { - for (ObjectCursor shard : entry.shards().values()) { - if (shard.value.state().completed()) { + for (SnapshotsInProgress.ShardSnapshotStatus shard : entry.shards().values()) { + if (shard.state().completed()) { return true; } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/status/TransportSnapshotsStatusAction.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/status/TransportSnapshotsStatusAction.java index 4edcaed358dc0..90672c003c112 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/status/TransportSnapshotsStatusAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/status/TransportSnapshotsStatusAction.java @@ -8,7 +8,6 @@ package org.elasticsearch.action.admin.cluster.snapshots.status; -import com.carrotsearch.hppc.cursors.ObjectCursor; import com.carrotsearch.hppc.cursors.ObjectObjectCursor; import org.apache.logging.log4j.LogManager; @@ -127,9 +126,9 @@ protected void masterOperation( Set nodesIds = new HashSet<>(); for (SnapshotsInProgress.Entry entry : currentSnapshots) { - for (ObjectCursor status : entry.shardsByRepoShardId().values()) { - if (status.value.nodeId() != null) { - nodesIds.add(status.value.nodeId()); + for (SnapshotsInProgress.ShardSnapshotStatus status : entry.shardsByRepoShardId().values()) { + if (status.nodeId() != null) { + nodesIds.add(status.nodeId()); } } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/alias/TransportIndicesAliasesAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/alias/TransportIndicesAliasesAction.java index 87c595690a543..afba42cd21e91 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/alias/TransportIndicesAliasesAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/alias/TransportIndicesAliasesAction.java @@ -8,7 +8,6 @@ package org.elasticsearch.action.admin.indices.alias; -import com.carrotsearch.hppc.cursors.ObjectCursor; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.elasticsearch.action.ActionListener; @@ -212,8 +211,8 @@ private static String[] concreteAliases(AliasActions action, Metadata metadata, String[] indexAsArray = {concreteIndex}; ImmutableOpenMap> aliasMetadata = metadata.findAliases(action, indexAsArray); List finalAliases = new ArrayList<>(); - for (ObjectCursor> curAliases : aliasMetadata.values()) { - for (AliasMetadata aliasMeta: curAliases.value) { + for (List aliases : aliasMetadata.values()) { + for (AliasMetadata aliasMeta : aliases) { finalAliases.add(aliasMeta.alias()); } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/template/get/TransportGetIndexTemplatesAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/template/get/TransportGetIndexTemplatesAction.java index 180a72d9834c1..3b01afe80c4d2 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/template/get/TransportGetIndexTemplatesAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/template/get/TransportGetIndexTemplatesAction.java @@ -8,6 +8,7 @@ package org.elasticsearch.action.admin.indices.template.get; import com.carrotsearch.hppc.cursors.ObjectObjectCursor; + import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.support.ActionFilters; import org.elasticsearch.action.support.master.TransportMasterNodeReadAction; @@ -24,7 +25,6 @@ import org.elasticsearch.transport.TransportService; import java.util.ArrayList; -import java.util.Arrays; import java.util.List; public class TransportGetIndexTemplatesAction extends @@ -50,7 +50,7 @@ protected void masterOperation(Task task, GetIndexTemplatesRequest request, Clus // If we did not ask for a specific name, then we return all templates if (request.names().length == 0) { - results = Arrays.asList(state.metadata().templates().values().toArray(IndexTemplateMetadata.class)); + results = new ArrayList<>(state.metadata().templates().values()); } else { results = new ArrayList<>(); } diff --git a/server/src/main/java/org/elasticsearch/action/ingest/IngestActionForwarder.java b/server/src/main/java/org/elasticsearch/action/ingest/IngestActionForwarder.java index be4410b838271..7ed02ccd275f4 100644 --- a/server/src/main/java/org/elasticsearch/action/ingest/IngestActionForwarder.java +++ b/server/src/main/java/org/elasticsearch/action/ingest/IngestActionForwarder.java @@ -53,6 +53,6 @@ private DiscoveryNode randomIngestNode() { @Override public void applyClusterState(ClusterChangedEvent event) { - ingestNodes = event.state().getNodes().getIngestNodes().values().toArray(DiscoveryNode.class); + ingestNodes = event.state().getNodes().getIngestNodes().values().toArray(DiscoveryNode[]::new); } } diff --git a/server/src/main/java/org/elasticsearch/cluster/ClusterChangedEvent.java b/server/src/main/java/org/elasticsearch/cluster/ClusterChangedEvent.java index 6632e5703860a..7e2450de3fe87 100644 --- a/server/src/main/java/org/elasticsearch/cluster/ClusterChangedEvent.java +++ b/server/src/main/java/org/elasticsearch/cluster/ClusterChangedEvent.java @@ -10,6 +10,7 @@ import com.carrotsearch.hppc.cursors.ObjectCursor; import com.carrotsearch.hppc.cursors.ObjectObjectCursor; + import org.elasticsearch.cluster.metadata.IndexGraveyard; import org.elasticsearch.cluster.metadata.IndexGraveyard.IndexGraveyardDiff; import org.elasticsearch.cluster.metadata.IndexMetadata; @@ -250,8 +251,7 @@ private List indicesDeletedFromClusterState() { final Metadata previousMetadata = previousState.metadata(); final Metadata currentMetadata = state.metadata(); - for (ObjectCursor cursor : previousMetadata.indices().values()) { - IndexMetadata index = cursor.value; + for (IndexMetadata index : previousMetadata.indices().values()) { IndexMetadata current = currentMetadata.index(index.getIndex()); if (current == null) { if (deleted == null) { diff --git a/server/src/main/java/org/elasticsearch/cluster/RestoreInProgress.java b/server/src/main/java/org/elasticsearch/cluster/RestoreInProgress.java index cc10503148a69..218219d570c6c 100644 --- a/server/src/main/java/org/elasticsearch/cluster/RestoreInProgress.java +++ b/server/src/main/java/org/elasticsearch/cluster/RestoreInProgress.java @@ -8,8 +8,8 @@ package org.elasticsearch.cluster; -import com.carrotsearch.hppc.cursors.ObjectCursor; import com.carrotsearch.hppc.cursors.ObjectObjectCursor; + import org.elasticsearch.Version; import org.elasticsearch.cluster.ClusterState.Custom; import org.elasticsearch.common.collect.ImmutableOpenMap; @@ -432,8 +432,7 @@ public RestoreInProgress(StreamInput in) throws IOException { @Override public void writeTo(StreamOutput out) throws IOException { out.writeVInt(entries.size()); - for (ObjectCursor v : entries.values()) { - Entry entry = v.value; + for (Entry entry : entries.values()) { out.writeString(entry.uuid); entry.snapshot().writeTo(out); out.writeByte(entry.state().value()); @@ -445,8 +444,8 @@ public void writeTo(StreamOutput out) throws IOException { @Override public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException { builder.startArray("snapshots"); - for (ObjectCursor entry : entries.values()) { - toXContent(entry.value, builder); + for (Entry entry : entries.values()) { + toXContent(entry, builder); } builder.endArray(); return builder; diff --git a/server/src/main/java/org/elasticsearch/cluster/SnapshotsInProgress.java b/server/src/main/java/org/elasticsearch/cluster/SnapshotsInProgress.java index 4974e3ee7d735..0eb189755dc18 100644 --- a/server/src/main/java/org/elasticsearch/cluster/SnapshotsInProgress.java +++ b/server/src/main/java/org/elasticsearch/cluster/SnapshotsInProgress.java @@ -8,9 +8,8 @@ package org.elasticsearch.cluster; -import com.carrotsearch.hppc.ObjectContainer; -import com.carrotsearch.hppc.cursors.ObjectCursor; import com.carrotsearch.hppc.cursors.ObjectObjectCursor; + import org.elasticsearch.Version; import org.elasticsearch.cluster.ClusterState.Custom; import org.elasticsearch.core.Nullable; @@ -272,9 +271,9 @@ public static Entry startClone(Snapshot snapshot, SnapshotId source, Map shards) { - for (ObjectCursor status : shards) { - if (status.value.state().completed == false) { + public static boolean completed(Collection shards) { + for (ShardSnapshotStatus status : shards) { + if (status.state().completed == false) { return false; } } @@ -282,8 +281,8 @@ public static boolean completed(ObjectContainer shards) { } private static boolean hasFailures(ImmutableOpenMap clones) { - for (ObjectCursor value : clones.values()) { - if (value.value.state().failed()) { + for (ShardSnapshotStatus value : clones.values()) { + if (value.state().failed()) { return true; } } diff --git a/server/src/main/java/org/elasticsearch/cluster/coordination/UnsafeBootstrapMasterCommand.java b/server/src/main/java/org/elasticsearch/cluster/coordination/UnsafeBootstrapMasterCommand.java index c1a50aa75ff7b..74e2adabb87ac 100644 --- a/server/src/main/java/org/elasticsearch/cluster/coordination/UnsafeBootstrapMasterCommand.java +++ b/server/src/main/java/org/elasticsearch/cluster/coordination/UnsafeBootstrapMasterCommand.java @@ -7,8 +7,8 @@ */ package org.elasticsearch.cluster.coordination; -import com.carrotsearch.hppc.cursors.ObjectCursor; import joptsimple.OptionSet; + import org.elasticsearch.ElasticsearchException; import org.elasticsearch.cli.Terminal; import org.elasticsearch.cluster.ClusterState; @@ -104,8 +104,7 @@ protected void processNodePaths(Terminal terminal, Path[] dataPaths, OptionSet o .clusterUUIDCommitted(true) .persistentSettings(persistentSettings) .coordinationMetadata(newCoordinationMetadata); - for (ObjectCursor idx : metadata.indices().values()) { - IndexMetadata indexMetadata = idx.value; + for (IndexMetadata indexMetadata : metadata.indices().values()) { newMetadata.put(IndexMetadata.builder(indexMetadata).settings( Settings.builder().put(indexMetadata.getSettings()) .put(IndexMetadata.SETTING_HISTORY_UUID, UUIDs.randomBase64UUID()))); diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/AutoExpandReplicas.java b/server/src/main/java/org/elasticsearch/cluster/metadata/AutoExpandReplicas.java index 265f13deda13a..760be3cb40a69 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/AutoExpandReplicas.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/AutoExpandReplicas.java @@ -7,7 +7,6 @@ */ package org.elasticsearch.cluster.metadata; -import com.carrotsearch.hppc.cursors.ObjectCursor; import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.routing.allocation.RoutingAllocation; import org.elasticsearch.cluster.routing.allocation.decider.Decision; @@ -98,8 +97,8 @@ public boolean expandToAllNodes() { private OptionalInt getDesiredNumberOfReplicas(IndexMetadata indexMetadata, RoutingAllocation allocation) { if (enabled) { int numMatchingDataNodes = 0; - for (ObjectCursor cursor : allocation.nodes().getDataNodes().values()) { - Decision decision = allocation.deciders().shouldAutoExpandToNode(indexMetadata, cursor.value, allocation); + for (DiscoveryNode discoveryNode : allocation.nodes().getDataNodes().values()) { + Decision decision = allocation.deciders().shouldAutoExpandToNode(indexMetadata, discoveryNode, allocation); if (decision.type() != Decision.Type.NO) { numMatchingDataNodes++; } diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/IndexMetadata.java b/server/src/main/java/org/elasticsearch/cluster/metadata/IndexMetadata.java index 3daef056f551f..b3b4fd4cd9710 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/IndexMetadata.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/IndexMetadata.java @@ -911,12 +911,12 @@ public void writeTo(StreamOutput out) throws IOException { writeSettingsToStream(settings, out); out.writeVLongArray(primaryTerms); out.writeVInt(mappings.size()); - for (ObjectCursor cursor : mappings.values()) { - cursor.value.writeTo(out); + for (MappingMetadata mappingMetadata : mappings.values()) { + mappingMetadata.writeTo(out); } out.writeVInt(aliases.size()); - for (ObjectCursor cursor : aliases.values()) { - cursor.value.writeTo(out); + for (AliasMetadata aliasMetadata : aliases.values()) { + aliasMetadata.writeTo(out); } out.writeVInt(customData.size()); for (final ObjectObjectCursor cursor : customData) { @@ -929,8 +929,8 @@ public void writeTo(StreamOutput out) throws IOException { DiffableUtils.StringSetValueSerializer.getInstance().write(cursor.value, out); } out.writeVInt(rolloverInfos.size()); - for (ObjectCursor cursor : rolloverInfos.values()) { - cursor.value.writeTo(out); + for (RolloverInfo rolloverInfo : rolloverInfos.values()) { + rolloverInfo.writeTo(out); } if (out.getVersion().onOrAfter(SYSTEM_INDEX_FLAG_ADDED)) { out.writeBoolean(isSystem); @@ -1391,8 +1391,8 @@ public static void toXContent(IndexMetadata indexMetadata, XContentBuilder build if (context != Metadata.XContentContext.API) { builder.startObject(KEY_ALIASES); - for (ObjectCursor cursor : indexMetadata.getAliases().values()) { - AliasMetadata.Builder.toXContent(cursor.value, builder, params); + for (AliasMetadata aliasMetadata : indexMetadata.getAliases().values()) { + AliasMetadata.Builder.toXContent(aliasMetadata, builder, params); } builder.endObject(); @@ -1427,8 +1427,8 @@ public static void toXContent(IndexMetadata indexMetadata, XContentBuilder build builder.endObject(); builder.startObject(KEY_ROLLOVER_INFOS); - for (ObjectCursor cursor : indexMetadata.getRolloverInfos().values()) { - cursor.value.toXContent(builder, params); + for (RolloverInfo rolloverInfo : indexMetadata.getRolloverInfos().values()) { + rolloverInfo.toXContent(builder, params); } builder.endObject(); builder.field(KEY_SYSTEM, indexMetadata.isSystem); diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/IndexNameExpressionResolver.java b/server/src/main/java/org/elasticsearch/cluster/metadata/IndexNameExpressionResolver.java index a8ee8afc7ec4e..03b994e25c529 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/IndexNameExpressionResolver.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/IndexNameExpressionResolver.java @@ -49,11 +49,9 @@ import java.util.Objects; import java.util.Set; import java.util.SortedMap; -import java.util.Spliterators; import java.util.function.Predicate; import java.util.stream.Collectors; import java.util.stream.Stream; -import java.util.stream.StreamSupport; public class IndexNameExpressionResolver { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(IndexNameExpressionResolver.class); @@ -573,8 +571,7 @@ public String[] indexAliases(ClusterState state, String index, Predicate cursor.value) + aliasCandidates = indexAliases.values().stream() .filter(aliasMetadata -> resolvedExpressions.contains(aliasMetadata.alias())) .toArray(AliasMetadata[]::new); } else { diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/IndexTemplateMetadata.java b/server/src/main/java/org/elasticsearch/cluster/metadata/IndexTemplateMetadata.java index ba4b26b5d7058..60a1473e97fe0 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/IndexTemplateMetadata.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/IndexTemplateMetadata.java @@ -7,8 +7,8 @@ */ package org.elasticsearch.cluster.metadata; -import com.carrotsearch.hppc.cursors.ObjectCursor; import com.carrotsearch.hppc.cursors.ObjectObjectCursor; + import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.cluster.AbstractDiffable; import org.elasticsearch.cluster.Diff; @@ -213,8 +213,8 @@ public void writeTo(StreamOutput out) throws IOException { cursor.value.writeTo(out); } out.writeVInt(aliases.size()); - for (ObjectCursor cursor : aliases.values()) { - cursor.value.writeTo(out); + for (AliasMetadata aliasMetadata : aliases.values()) { + aliasMetadata.writeTo(out); } out.writeOptionalVInt(version); } @@ -402,8 +402,8 @@ private static void toInnerXContent(IndexTemplateMetadata indexTemplateMetadata, } builder.startObject("aliases"); - for (ObjectCursor cursor : indexTemplateMetadata.aliases().values()) { - AliasMetadata.Builder.toXContent(cursor.value, builder, params); + for (AliasMetadata aliasMetadata : indexTemplateMetadata.aliases().values()) { + AliasMetadata.Builder.toXContent(aliasMetadata, builder, params); } builder.endObject(); } diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/Metadata.java b/server/src/main/java/org/elasticsearch/cluster/metadata/Metadata.java index cce12421ee6e0..b92a2fbb4538c 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/Metadata.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/Metadata.java @@ -27,16 +27,6 @@ import org.elasticsearch.cluster.block.ClusterBlock; import org.elasticsearch.cluster.block.ClusterBlockLevel; import org.elasticsearch.cluster.coordination.CoordinationMetadata; -import org.elasticsearch.common.xcontent.NamedObjectNotFoundException; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentParserUtils; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.core.Nullable; import org.elasticsearch.common.Strings; import org.elasticsearch.common.UUIDs; import org.elasticsearch.common.collect.HppcMaps; @@ -48,6 +38,16 @@ import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Setting.Property; import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.common.xcontent.NamedObjectNotFoundException; +import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.common.xcontent.ToXContent; +import org.elasticsearch.common.xcontent.ToXContentFragment; +import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.common.xcontent.XContentHelper; +import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.common.xcontent.XContentParserUtils; +import org.elasticsearch.core.Nullable; import org.elasticsearch.gateway.MetadataStateFormat; import org.elasticsearch.index.Index; import org.elasticsearch.index.IndexNotFoundException; @@ -210,10 +210,10 @@ public interface NonRestorableCustom extends Custom { this.templates = templates; int totalNumberOfShards = 0; int totalOpenIndexShards = 0; - for (ObjectCursor cursor : indices.values()) { - totalNumberOfShards += cursor.value.getTotalNumberOfShards(); - if (IndexMetadata.State.OPEN.equals(cursor.value.getState())) { - totalOpenIndexShards += cursor.value.getTotalNumberOfShards(); + for (IndexMetadata indexMetadata : indices.values()) { + totalNumberOfShards += indexMetadata.getTotalNumberOfShards(); + if (IndexMetadata.State.OPEN.equals(indexMetadata.getState())) { + totalOpenIndexShards += indexMetadata.getTotalNumberOfShards(); } } this.totalNumberOfShards = totalNumberOfShards; @@ -277,8 +277,7 @@ public boolean hasAlias(String alias) { } public boolean equalsAliases(Metadata other) { - for (ObjectCursor cursor : other.indices().values()) { - IndexMetadata otherIndex = cursor.value; + for (IndexMetadata otherIndex : other.indices().values()) { IndexMetadata thisIndex = index(otherIndex.getIndex()); if (thisIndex == null) { return false; @@ -365,10 +364,9 @@ private ImmutableOpenMap> findAliases(final String[] for (String index : concreteIndices) { IndexMetadata indexMetadata = indices.get(index); List filteredValues = new ArrayList<>(); - for (ObjectCursor cursor : indexMetadata.getAliases().values()) { - AliasMetadata value = cursor.value; + for (AliasMetadata aliasMetadata : indexMetadata.getAliases().values()) { boolean matched = matchAllAliases; - String alias = value.alias(); + String alias = aliasMetadata.alias(); for (int i = 0; i < patterns.length; i++) { if (include[i]) { if (matched == false) { @@ -380,7 +378,7 @@ private ImmutableOpenMap> findAliases(final String[] } } if (matched) { - filteredValues.add(value); + filteredValues.add(aliasMetadata); } } if (filteredValues.isEmpty() == false) { @@ -831,8 +829,8 @@ public static boolean isGlobalStateEquals(Metadata metadata1, Metadata metadata2 } } int customCount2 = 0; - for (ObjectCursor cursor : metadata2.customs.values()) { - if (cursor.value.context().contains(XContentContext.GATEWAY)) { + for (Custom custom : metadata2.customs.values()) { + if (custom.context().contains(XContentContext.GATEWAY)) { customCount2++; } } @@ -1005,8 +1003,8 @@ public void writeTo(StreamOutput out) throws IOException { indexMetadata.writeTo(out); } out.writeVInt(templates.size()); - for (ObjectCursor cursor : templates.values()) { - cursor.value.writeTo(out); + for (IndexTemplateMetadata template : templates.values()) { + template.writeTo(out); } VersionedNamedWriteable.writeVersionedWritables(out, customs); } @@ -1668,8 +1666,8 @@ public static void toXContent(Metadata metadata, XContentBuilder builder, ToXCon } builder.startObject("templates"); - for (ObjectCursor cursor : metadata.templates().values()) { - IndexTemplateMetadata.Builder.toXContentWithTypes(cursor.value, builder, params); + for (IndexTemplateMetadata template : metadata.templates().values()) { + IndexTemplateMetadata.Builder.toXContentWithTypes(template, builder, params); } builder.endObject(); diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/MetadataIndexTemplateService.java b/server/src/main/java/org/elasticsearch/cluster/metadata/MetadataIndexTemplateService.java index 2a80812b295b5..d6338c231c004 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/MetadataIndexTemplateService.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/MetadataIndexTemplateService.java @@ -9,6 +9,7 @@ import com.carrotsearch.hppc.cursors.ObjectCursor; import com.carrotsearch.hppc.cursors.ObjectObjectCursor; + import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.apache.lucene.util.CollectionUtil; @@ -888,8 +889,7 @@ public static List findV1Templates(Metadata metadata, Str .resolveExpression(indexName, new IndexNameExpressionResolver.Context(null, null, null)); final Predicate patternMatchPredicate = pattern -> Regex.simpleMatch(pattern, resolvedIndexName); final List matchedTemplates = new ArrayList<>(); - for (ObjectCursor cursor : metadata.templates().values()) { - final IndexTemplateMetadata template = cursor.value; + for (IndexTemplateMetadata template: metadata.templates().values()) { if (isHidden == null || isHidden == Boolean.FALSE) { final boolean matched = template.patterns().stream().anyMatch(patternMatchPredicate); if (matched) { diff --git a/server/src/main/java/org/elasticsearch/cluster/node/DiscoveryNodes.java b/server/src/main/java/org/elasticsearch/cluster/node/DiscoveryNodes.java index c6473f51522aa..373a296059d4b 100644 --- a/server/src/main/java/org/elasticsearch/cluster/node/DiscoveryNodes.java +++ b/server/src/main/java/org/elasticsearch/cluster/node/DiscoveryNodes.java @@ -258,8 +258,7 @@ public DiscoveryNode getMasterNode() { * @return node identified by the given address or null if no such node exists */ public DiscoveryNode findByAddress(TransportAddress address) { - for (ObjectCursor cursor : nodes.values()) { - DiscoveryNode node = cursor.value; + for (DiscoveryNode node : nodes.values()) { if (node.getAddress().equals(address)) { return node; } diff --git a/server/src/main/java/org/elasticsearch/cluster/routing/RoutingNodes.java b/server/src/main/java/org/elasticsearch/cluster/routing/RoutingNodes.java index 56b405aea8c8e..965993955aeef 100644 --- a/server/src/main/java/org/elasticsearch/cluster/routing/RoutingNodes.java +++ b/server/src/main/java/org/elasticsearch/cluster/routing/RoutingNodes.java @@ -8,8 +8,6 @@ package org.elasticsearch.cluster.routing; -import com.carrotsearch.hppc.cursors.ObjectCursor; - import org.apache.logging.log4j.Logger; import org.apache.lucene.util.CollectionUtil; import org.elasticsearch.Assertions; @@ -87,14 +85,14 @@ public RoutingNodes(ClusterState clusterState, boolean readOnly) { Map> nodesToShards = new HashMap<>(); // fill in the nodeToShards with the "live" nodes - for (ObjectCursor cursor : clusterState.nodes().getDataNodes().values()) { - nodesToShards.put(cursor.value.getId(), new LinkedHashMap<>()); // LinkedHashMap to preserve order + for (DiscoveryNode node : clusterState.nodes().getDataNodes().values()) { + nodesToShards.put(node.getId(), new LinkedHashMap<>()); // LinkedHashMap to preserve order } // fill in the inverse of node -> shards allocated // also fill replicaSet information - for (ObjectCursor indexRoutingTable : routingTable.indicesRouting().values()) { - for (IndexShardRoutingTable indexShard : indexRoutingTable.value) { + for (IndexRoutingTable indexRoutingTable : routingTable.indicesRouting().values()) { + for (IndexShardRoutingTable indexShard : indexRoutingTable) { assert indexShard.primary != null; for (ShardRouting shard : indexShard) { // to get all the shards belonging to an index, including the replicas, diff --git a/server/src/main/java/org/elasticsearch/cluster/routing/RoutingTable.java b/server/src/main/java/org/elasticsearch/cluster/routing/RoutingTable.java index 36acc0ee4e4f6..8ea68ad3657db 100644 --- a/server/src/main/java/org/elasticsearch/cluster/routing/RoutingTable.java +++ b/server/src/main/java/org/elasticsearch/cluster/routing/RoutingTable.java @@ -9,8 +9,8 @@ package org.elasticsearch.cluster.routing; import com.carrotsearch.hppc.IntSet; -import com.carrotsearch.hppc.cursors.ObjectCursor; import com.carrotsearch.hppc.cursors.ObjectObjectCursor; + import org.elasticsearch.cluster.Diff; import org.elasticsearch.cluster.Diffable; import org.elasticsearch.cluster.DiffableUtils; @@ -343,8 +343,8 @@ public static RoutingTable readFrom(StreamInput in) throws IOException { public void writeTo(StreamOutput out) throws IOException { out.writeLong(version); out.writeVInt(indicesRouting.size()); - for (ObjectCursor index : indicesRouting.values()) { - index.value.writeTo(out); + for (IndexRoutingTable index : indicesRouting.values()) { + index.writeTo(out); } } diff --git a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/DiskThresholdDecider.java b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/DiskThresholdDecider.java index 468c3a670c6b7..34d234c1f9ff7 100644 --- a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/DiskThresholdDecider.java +++ b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/DiskThresholdDecider.java @@ -8,7 +8,6 @@ package org.elasticsearch.cluster.routing.allocation.decider; -import com.carrotsearch.hppc.cursors.ObjectCursor; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.elasticsearch.Version; @@ -421,9 +420,9 @@ DiskUsage averageUsage(RoutingNode node, ImmutableOpenMap usa } long totalBytes = 0; long freeBytes = 0; - for (ObjectCursor du : usages.values()) { - totalBytes += du.value.getTotalBytes(); - freeBytes += du.value.getFreeBytes(); + for (DiskUsage du : usages.values()) { + totalBytes += du.getTotalBytes(); + freeBytes += du.getFreeBytes(); } return new DiskUsage(node.nodeId(), node.node().getName(), "_na_", totalBytes / usages.size(), freeBytes / usages.size()); } diff --git a/server/src/main/java/org/elasticsearch/common/collect/ImmutableOpenMap.java b/server/src/main/java/org/elasticsearch/common/collect/ImmutableOpenMap.java index 2f4720f619884..55e914d9216be 100644 --- a/server/src/main/java/org/elasticsearch/common/collect/ImmutableOpenMap.java +++ b/server/src/main/java/org/elasticsearch/common/collect/ImmutableOpenMap.java @@ -20,8 +20,10 @@ import com.carrotsearch.hppc.predicates.ObjectPredicate; import com.carrotsearch.hppc.procedures.ObjectObjectProcedure; +import java.util.AbstractCollection; import java.util.AbstractMap; import java.util.AbstractSet; +import java.util.Collection; import java.util.Iterator; import java.util.Map; import java.util.Set; @@ -162,17 +164,27 @@ public boolean contains(Object o) { } /** - * @return Returns a container with all values stored in this map. + * Returns a direct iterator over the keys. */ - public ObjectContainer values() { - return map.values(); + public Iterator valuesIt() { + return iterator(map.values()); } /** - * Returns a direct iterator over the keys. + * Returns a {@link Collection} view of the values contained in the map. */ - public Iterator valuesIt() { - return iterator(map.values()); + public Collection values() { + return new AbstractCollection() { + @Override + public Iterator iterator() { + return valuesIt(); + } + + @Override + public int size() { + return map.size(); + } + }; } static Iterator iterator(ObjectCollection collection) { diff --git a/server/src/main/java/org/elasticsearch/common/io/stream/VersionedNamedWriteable.java b/server/src/main/java/org/elasticsearch/common/io/stream/VersionedNamedWriteable.java index 9c263ab815ffe..1700a002a2f65 100644 --- a/server/src/main/java/org/elasticsearch/common/io/stream/VersionedNamedWriteable.java +++ b/server/src/main/java/org/elasticsearch/common/io/stream/VersionedNamedWriteable.java @@ -8,7 +8,6 @@ package org.elasticsearch.common.io.stream; -import com.carrotsearch.hppc.cursors.ObjectCursor; import org.elasticsearch.Version; import org.elasticsearch.common.collect.ImmutableOpenMap; @@ -54,15 +53,15 @@ static void writeVersionedWritables(StreamOu throws IOException { // filter out custom states not supported by the other node int numberOfCustoms = 0; - for (final ObjectCursor cursor : customs.values()) { - if (shouldSerialize(out, cursor.value)) { + for (final T value : customs.values()) { + if (shouldSerialize(out, value)) { numberOfCustoms++; } } out.writeVInt(numberOfCustoms); - for (final ObjectCursor cursor : customs.values()) { - if (shouldSerialize(out, cursor.value)) { - out.writeNamedWriteable(cursor.value); + for (final T value : customs.values()) { + if (shouldSerialize(out, value)) { + out.writeNamedWriteable(value); } } } diff --git a/server/src/main/java/org/elasticsearch/discovery/PeerFinder.java b/server/src/main/java/org/elasticsearch/discovery/PeerFinder.java index c57f584c1a65e..d946c4241012a 100644 --- a/server/src/main/java/org/elasticsearch/discovery/PeerFinder.java +++ b/server/src/main/java/org/elasticsearch/discovery/PeerFinder.java @@ -8,7 +8,6 @@ package org.elasticsearch.discovery; -import com.carrotsearch.hppc.cursors.ObjectCursor; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.message.ParameterizedMessage; @@ -243,8 +242,8 @@ private boolean handleWakeUp() { } logger.trace("probing master nodes from cluster state: {}", lastAcceptedNodes); - for (ObjectCursor discoveryNodeObjectCursor : lastAcceptedNodes.getMasterNodes().values()) { - startProbe(discoveryNodeObjectCursor.value.getAddress()); + for (DiscoveryNode discoveryNode : lastAcceptedNodes.getMasterNodes().values()) { + startProbe(discoveryNode.getAddress()); } configuredHostsResolver.resolveConfiguredHosts(providedAddresses -> { diff --git a/server/src/main/java/org/elasticsearch/env/NodeRepurposeCommand.java b/server/src/main/java/org/elasticsearch/env/NodeRepurposeCommand.java index bfd3b2667b2b0..a982e9241da46 100644 --- a/server/src/main/java/org/elasticsearch/env/NodeRepurposeCommand.java +++ b/server/src/main/java/org/elasticsearch/env/NodeRepurposeCommand.java @@ -7,9 +7,11 @@ */ package org.elasticsearch.env; -import com.carrotsearch.hppc.cursors.ObjectObjectCursor; import joptsimple.OptionParser; import joptsimple.OptionSet; + +import com.carrotsearch.hppc.cursors.ObjectObjectCursor; + import org.elasticsearch.ElasticsearchException; import org.elasticsearch.cli.Terminal; import org.elasticsearch.cluster.ClusterState; @@ -31,7 +33,6 @@ import java.util.Set; import java.util.stream.Collectors; import java.util.stream.Stream; -import java.util.stream.StreamSupport; import static org.elasticsearch.env.NodeEnvironment.INDICES_FOLDER; @@ -93,8 +94,7 @@ private void processNoMasterNoDataNode(Terminal terminal, Path[] dataPaths, Envi } final Set indexUUIDs = Sets.union(indexUUIDsFor(indexPaths), - StreamSupport.stream(metadata.indices().values().spliterator(), false) - .map(imd -> imd.value.getIndexUUID()).collect(Collectors.toSet())); + metadata.indices().values().stream().map(IndexMetadata::getIndexUUID).collect(Collectors.toSet())); outputVerboseInformation(terminal, indexPaths, indexUUIDs, metadata); diff --git a/server/src/main/java/org/elasticsearch/gateway/ClusterStateUpdaters.java b/server/src/main/java/org/elasticsearch/gateway/ClusterStateUpdaters.java index 558053ca9dc31..604363a8d8ecd 100644 --- a/server/src/main/java/org/elasticsearch/gateway/ClusterStateUpdaters.java +++ b/server/src/main/java/org/elasticsearch/gateway/ClusterStateUpdaters.java @@ -8,7 +8,6 @@ package org.elasticsearch.gateway; -import com.carrotsearch.hppc.cursors.ObjectCursor; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.message.ParameterizedMessage; @@ -82,8 +81,8 @@ static ClusterState recoverClusterBlocks(final ClusterState state) { static ClusterState updateRoutingTable(final ClusterState state) { // initialize all index routing tables as empty final RoutingTable.Builder routingTableBuilder = RoutingTable.builder(state.routingTable()); - for (final ObjectCursor cursor : state.metadata().indices().values()) { - routingTableBuilder.addAsRecovery(cursor.value); + for (final IndexMetadata indexMetadata : state.metadata().indices().values()) { + routingTableBuilder.addAsRecovery(indexMetadata); } // start with 0 based versions for routing table routingTableBuilder.version(0); diff --git a/server/src/main/java/org/elasticsearch/gateway/DanglingIndicesState.java b/server/src/main/java/org/elasticsearch/gateway/DanglingIndicesState.java index 9d31d78fedc21..ffa8f6d84947e 100644 --- a/server/src/main/java/org/elasticsearch/gateway/DanglingIndicesState.java +++ b/server/src/main/java/org/elasticsearch/gateway/DanglingIndicesState.java @@ -8,7 +8,6 @@ package org.elasticsearch.gateway; -import com.carrotsearch.hppc.cursors.ObjectCursor; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.elasticsearch.cluster.metadata.IndexGraveyard; @@ -54,8 +53,8 @@ public Map getDanglingIndices() { final Set excludeIndexPathIds = new HashSet<>(metadata.indices().size()); - for (ObjectCursor cursor : metadata.indices().values()) { - excludeIndexPathIds.add(cursor.value.getIndex().getUUID()); + for (IndexMetadata indexMetadata : metadata.indices().values()) { + excludeIndexPathIds.add(indexMetadata.getIndex().getUUID()); } try { diff --git a/server/src/main/java/org/elasticsearch/gateway/PersistedClusterStateService.java b/server/src/main/java/org/elasticsearch/gateway/PersistedClusterStateService.java index 1b19151c57546..cff89ca920ee3 100644 --- a/server/src/main/java/org/elasticsearch/gateway/PersistedClusterStateService.java +++ b/server/src/main/java/org/elasticsearch/gateway/PersistedClusterStateService.java @@ -7,8 +7,6 @@ */ package org.elasticsearch.gateway; -import com.carrotsearch.hppc.cursors.ObjectCursor; - import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.message.ParameterizedMessage; @@ -673,8 +671,7 @@ private WriterStats updateMetadata(Metadata previouslyWrittenMetadata, Metadata } final Map indexMetadataVersionByUUID = new HashMap<>(previouslyWrittenMetadata.indices().size()); - for (ObjectCursor cursor : previouslyWrittenMetadata.indices().values()) { - final IndexMetadata indexMetadata = cursor.value; + for (IndexMetadata indexMetadata : previouslyWrittenMetadata.indices().values()) { final Long previousValue = indexMetadataVersionByUUID.putIfAbsent(indexMetadata.getIndexUUID(), indexMetadata.getVersion()); assert previousValue == null : indexMetadata.getIndexUUID() + " already mapped to " + previousValue; @@ -682,8 +679,7 @@ private WriterStats updateMetadata(Metadata previouslyWrittenMetadata, Metadata int numIndicesUpdated = 0; int numIndicesUnchanged = 0; - for (ObjectCursor cursor : metadata.indices().values()) { - final IndexMetadata indexMetadata = cursor.value; + for (IndexMetadata indexMetadata : metadata.indices().values()) { final Long previousVersion = indexMetadataVersionByUUID.get(indexMetadata.getIndexUUID()); if (previousVersion == null || indexMetadata.getVersion() != previousVersion) { logger.trace("updating metadata for [{}], changing version from [{}] to [{}]", @@ -739,8 +735,7 @@ private WriterStats addMetadata(Metadata metadata) throws IOException { metadataIndexWriter.updateGlobalMetadata(globalMetadataDocument); } - for (ObjectCursor cursor : metadata.indices().values()) { - final IndexMetadata indexMetadata = cursor.value; + for (IndexMetadata indexMetadata : metadata.indices().values()) { final Document indexMetadataDocument = makeIndexMetadataDocument(indexMetadata, documentBuffer); for (MetadataIndexWriter metadataIndexWriter : metadataIndexWriters) { metadataIndexWriter.updateIndexMetadataDocument(indexMetadataDocument, indexMetadata.getIndex()); diff --git a/server/src/main/java/org/elasticsearch/gateway/ReplicaShardAllocator.java b/server/src/main/java/org/elasticsearch/gateway/ReplicaShardAllocator.java index 43adcf9ef70e1..6eb1e25078731 100644 --- a/server/src/main/java/org/elasticsearch/gateway/ReplicaShardAllocator.java +++ b/server/src/main/java/org/elasticsearch/gateway/ReplicaShardAllocator.java @@ -8,8 +8,6 @@ package org.elasticsearch.gateway; -import com.carrotsearch.hppc.cursors.ObjectCursor; - import org.apache.logging.log4j.Logger; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.cluster.metadata.Metadata; @@ -240,8 +238,8 @@ public static Tuple> canBeAllocatedT Decision madeDecision = Decision.NO; final boolean explain = allocation.debugDecision(); Map nodeDecisions = explain ? new HashMap<>() : null; - for (ObjectCursor cursor : allocation.nodes().getDataNodes().values()) { - RoutingNode node = allocation.routingNodes().node(cursor.value.getId()); + for (DiscoveryNode discoveryNode : allocation.nodes().getDataNodes().values()) { + RoutingNode node = allocation.routingNodes().node(discoveryNode.getId()); if (node == null) { continue; } diff --git a/server/src/main/java/org/elasticsearch/index/engine/SegmentsStats.java b/server/src/main/java/org/elasticsearch/index/engine/SegmentsStats.java index 75a292790b1cf..d5381f1a1b0c1 100644 --- a/server/src/main/java/org/elasticsearch/index/engine/SegmentsStats.java +++ b/server/src/main/java/org/elasticsearch/index/engine/SegmentsStats.java @@ -8,8 +8,8 @@ package org.elasticsearch.index.engine; -import com.carrotsearch.hppc.cursors.ObjectCursor; import com.carrotsearch.hppc.cursors.ObjectObjectCursor; + import org.elasticsearch.Version; import org.elasticsearch.common.Strings; import org.elasticsearch.common.collect.ImmutableOpenMap; @@ -228,8 +228,8 @@ public void writeTo(StreamOutput out) throws IOException { out.writeLong(maxUnsafeAutoIdTimestamp); out.writeVInt(files.size()); - for (ObjectCursor file : files.values()) { - file.value.writeTo(out); + for (FileStats file : files.values()) { + file.writeTo(out); } } diff --git a/server/src/main/java/org/elasticsearch/index/shard/RemoveCorruptedShardDataCommand.java b/server/src/main/java/org/elasticsearch/index/shard/RemoveCorruptedShardDataCommand.java index b3e537cb34e08..7fb4741cdc396 100644 --- a/server/src/main/java/org/elasticsearch/index/shard/RemoveCorruptedShardDataCommand.java +++ b/server/src/main/java/org/elasticsearch/index/shard/RemoveCorruptedShardDataCommand.java @@ -57,7 +57,6 @@ import java.util.HashMap; import java.util.Map; import java.util.Objects; -import java.util.stream.StreamSupport; import static org.elasticsearch.common.lucene.Lucene.indexWriterConfigWithNoMerging; @@ -131,9 +130,9 @@ protected void findAndProcessShardPath(OptionSet options, Environment environmen && NodeEnvironment.INDICES_FOLDER.equals(shardParentParent.getFileName().toString()) // `indices` check ) { shardId = Integer.parseInt(shardIdFileName); - indexMetadata = StreamSupport.stream(clusterState.metadata().indices().values().spliterator(), false) - .map(imd -> imd.value) - .filter(imd -> imd.getIndexUUID().equals(indexUUIDFolderName)).findFirst() + indexMetadata = clusterState.metadata().indices().values().stream() + .filter(imd -> imd.getIndexUUID().equals(indexUUIDFolderName)) + .findFirst() .orElse(null); } else { throw new ElasticsearchException("Unable to resolve shard id. Wrong folder structure at [ " + path.toString() diff --git a/server/src/main/java/org/elasticsearch/indices/ShardLimitValidator.java b/server/src/main/java/org/elasticsearch/indices/ShardLimitValidator.java index fc874861e129a..fc37bb3983d53 100644 --- a/server/src/main/java/org/elasticsearch/indices/ShardLimitValidator.java +++ b/server/src/main/java/org/elasticsearch/indices/ShardLimitValidator.java @@ -22,7 +22,6 @@ import java.util.Set; import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Predicate; -import java.util.stream.StreamSupport; import static org.elasticsearch.cluster.metadata.IndexMetadata.INDEX_NUMBER_OF_SHARDS_SETTING; @@ -193,7 +192,7 @@ static Optional checkShardLimit(int newShards, ClusterState state, int m if ((currentOpenShards + newShards) > maxShardsInCluster) { Predicate indexMetadataPredicate = imd -> imd.getState().equals(IndexMetadata.State.OPEN) && group.equals(INDEX_SETTING_SHARD_LIMIT_GROUP.get(imd.getSettings())); - long currentFilteredShards = StreamSupport.stream(state.metadata().indices().values().spliterator(), false).map(oc -> oc.value) + long currentFilteredShards = state.metadata().indices().values().stream() .filter(indexMetadataPredicate).mapToInt(IndexMetadata::getTotalNumberOfShards).sum(); if ((currentFilteredShards + newShards) > maxShardsInCluster) { String errorMessage = "this action would add [" + newShards + "] shards, but this cluster currently has [" + @@ -205,9 +204,7 @@ static Optional checkShardLimit(int newShards, ClusterState state, int m } private static int nodeCount(ClusterState state, Predicate nodePredicate) { - return (int) - StreamSupport.stream(state.getNodes().getDataNodes().values().spliterator(), false) - .map(oc -> oc.value).filter(nodePredicate).count(); + return (int) state.getNodes().getDataNodes().values().stream().filter(nodePredicate).count(); } private static boolean hasFrozen(DiscoveryNode node) { diff --git a/server/src/main/java/org/elasticsearch/indices/TimestampFieldMapperService.java b/server/src/main/java/org/elasticsearch/indices/TimestampFieldMapperService.java index 531a2877ca6eb..080eb51c0eeab 100644 --- a/server/src/main/java/org/elasticsearch/indices/TimestampFieldMapperService.java +++ b/server/src/main/java/org/elasticsearch/indices/TimestampFieldMapperService.java @@ -8,7 +8,6 @@ package org.elasticsearch.indices; -import com.carrotsearch.hppc.cursors.ObjectCursor; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.message.ParameterizedMessage; @@ -89,8 +88,7 @@ public void applyClusterState(ClusterChangedEvent event) { fieldTypesByIndex.keySet().removeIf(index -> hasUsefulTimestampField(metadata.index(index)) == false); // capture mappers for indices that do exist - for (ObjectCursor cursor : metadata.indices().values()) { - final IndexMetadata indexMetadata = cursor.value; + for (IndexMetadata indexMetadata : metadata.indices().values()) { final Index index = indexMetadata.getIndex(); if (hasUsefulTimestampField(indexMetadata) && fieldTypesByIndex.containsKey(index) == false) { diff --git a/server/src/main/java/org/elasticsearch/repositories/VerifyNodeRepositoryAction.java b/server/src/main/java/org/elasticsearch/repositories/VerifyNodeRepositoryAction.java index 259e208af5f75..d6db8d078ff31 100644 --- a/server/src/main/java/org/elasticsearch/repositories/VerifyNodeRepositoryAction.java +++ b/server/src/main/java/org/elasticsearch/repositories/VerifyNodeRepositoryAction.java @@ -8,9 +8,6 @@ package org.elasticsearch.repositories; -import com.carrotsearch.hppc.ObjectContainer; -import com.carrotsearch.hppc.cursors.ObjectCursor; - import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.message.ParameterizedMessage; @@ -32,6 +29,7 @@ import java.io.IOException; import java.util.ArrayList; +import java.util.Collection; import java.util.List; import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.atomic.AtomicInteger; @@ -68,10 +66,9 @@ public void verify(String repository, String verificationToken, final ActionList final DiscoveryNodes discoNodes = clusterService.state().nodes(); final DiscoveryNode localNode = discoNodes.getLocalNode(); - final ObjectContainer masterAndDataNodes = discoNodes.getMasterAndDataNodes().values(); + final Collection masterAndDataNodes = discoNodes.getMasterAndDataNodes().values(); final List nodes = new ArrayList<>(); - for (ObjectCursor cursor : masterAndDataNodes) { - DiscoveryNode node = cursor.value; + for (DiscoveryNode node : masterAndDataNodes) { if (RepositoriesService.isDedicatedVotingOnlyNode(node.getRoles()) == false) { nodes.add(node); } diff --git a/server/src/main/java/org/elasticsearch/snapshots/RestoreService.java b/server/src/main/java/org/elasticsearch/snapshots/RestoreService.java index f8514a50bdd74..192ab027ba814 100644 --- a/server/src/main/java/org/elasticsearch/snapshots/RestoreService.java +++ b/server/src/main/java/org/elasticsearch/snapshots/RestoreService.java @@ -827,11 +827,11 @@ private static RestoreInProgress.State overallState( ImmutableOpenMap shards ) { boolean hasFailed = false; - for (ObjectCursor status : shards.values()) { - if (status.value.state().completed() == false) { + for (RestoreInProgress.ShardRestoreStatus status : shards.values()) { + if (status.state().completed() == false) { return nonCompletedState; } - if (status.value.state() == RestoreInProgress.State.FAILURE) { + if (status.state() == RestoreInProgress.State.FAILURE) { hasFailed = true; } } @@ -843,8 +843,8 @@ private static RestoreInProgress.State overallState( } public static boolean completed(ImmutableOpenMap shards) { - for (ObjectCursor status : shards.values()) { - if (status.value.state().completed() == false) { + for (RestoreInProgress.ShardRestoreStatus status : shards.values()) { + if (status.state().completed() == false) { return false; } } @@ -853,8 +853,8 @@ public static boolean completed(ImmutableOpenMap shards) { int failedShards = 0; - for (ObjectCursor status : shards.values()) { - if (status.value.state() == RestoreInProgress.State.FAILURE) { + for (RestoreInProgress.ShardRestoreStatus status : shards.values()) { + if (status.state() == RestoreInProgress.State.FAILURE) { failedShards++; } } @@ -1266,8 +1266,8 @@ && isSystemIndex(snapshotIndexMetadata) == false) { indexMdBuilder.removeAllAliases(); } // Add existing aliases - for (ObjectCursor alias : currentIndexMetadata.getAliases().values()) { - indexMdBuilder.putAlias(alias.value); + for (AliasMetadata alias : currentIndexMetadata.getAliases().values()) { + indexMdBuilder.putAlias(alias); } } else { ensureNoAliasNameConflicts(snapshotIndexMetadata); @@ -1402,8 +1402,8 @@ private void applyGlobalStateRestore(ClusterState currentState, Metadata.Builder } if (metadata.templates() != null) { // TODO: Should all existing templates be deleted first? - for (ObjectCursor cursor : metadata.templates().values()) { - mdBuilder.put(cursor.value); + for (IndexTemplateMetadata cursor : metadata.templates().values()) { + mdBuilder.put(cursor); } } if (metadata.customs() != null) { diff --git a/server/src/main/java/org/elasticsearch/snapshots/SnapshotsService.java b/server/src/main/java/org/elasticsearch/snapshots/SnapshotsService.java index 42e2a446cf2f0..0833f60e39dec 100644 --- a/server/src/main/java/org/elasticsearch/snapshots/SnapshotsService.java +++ b/server/src/main/java/org/elasticsearch/snapshots/SnapshotsService.java @@ -8,7 +8,6 @@ package org.elasticsearch.snapshots; -import com.carrotsearch.hppc.cursors.ObjectCursor; import com.carrotsearch.hppc.cursors.ObjectObjectCursor; import org.apache.logging.log4j.LogManager; @@ -1016,11 +1015,11 @@ private static boolean assertNoDanglingSnapshots(ClusterState state) { .collect(Collectors.toSet()); for (List repoEntry : snapshotsInProgress.entriesByRepo()) { final SnapshotsInProgress.Entry entry = repoEntry.get(0); - for (ObjectCursor value : entry.shardsByRepoShardId().values()) { - if (value.value.equals(ShardSnapshotStatus.UNASSIGNED_QUEUED)) { + for (ShardSnapshotStatus value : entry.shardsByRepoShardId().values()) { + if (value.equals(ShardSnapshotStatus.UNASSIGNED_QUEUED)) { assert reposWithRunningDelete.contains(entry.repository()) : "Found shard snapshot waiting to be assigned in [" + entry + "] but it is not blocked by any running delete"; - } else if (value.value.isActive()) { + } else if (value.isActive()) { assert reposWithRunningDelete.contains(entry.repository()) == false : "Found shard snapshot actively executing in [" + entry @@ -1380,8 +1379,7 @@ private static boolean removedNodesCleanupNeeded(SnapshotsInProgress snapshotsIn // nothing to do for already completed snapshots or clones that run on master anyways return false; } - for (ObjectCursor shardStatus : snapshot.shardsByRepoShardId().values()) { - final ShardSnapshotStatus shardSnapshotStatus = shardStatus.value; + for (ShardSnapshotStatus shardSnapshotStatus : snapshot.shardsByRepoShardId().values()) { if (shardSnapshotStatus.state().completed() == false && removedNodeIds.contains(shardSnapshotStatus.nodeId())) { // Snapshot had an incomplete shard running on a removed node so we need to adjust that shard's snapshot status return true; @@ -2248,8 +2246,8 @@ private static boolean isWritingToRepository(SnapshotsInProgress.Entry entry) { // Entry is writing to the repo because it's finalizing on master return true; } - for (ObjectCursor value : entry.shardsByRepoShardId().values()) { - if (value.value.isActive()) { + for (ShardSnapshotStatus value : entry.shardsByRepoShardId().values()) { + if (value.isActive()) { // Entry is writing to the repo because it's writing to a shard on a data node or waiting to do so for a concrete shard return true; } diff --git a/server/src/test/java/org/elasticsearch/action/support/nodes/TransportNodesActionTests.java b/server/src/test/java/org/elasticsearch/action/support/nodes/TransportNodesActionTests.java index adfbe8b0d1061..0623b6df0c23d 100644 --- a/server/src/test/java/org/elasticsearch/action/support/nodes/TransportNodesActionTests.java +++ b/server/src/test/java/org/elasticsearch/action/support/nodes/TransportNodesActionTests.java @@ -311,7 +311,7 @@ private static class DataNodesOnlyTransportNodesAction @Override protected void resolveRequest(TestNodesRequest request, ClusterState clusterState) { - request.setConcreteNodes(clusterState.nodes().getDataNodes().values().toArray(DiscoveryNode.class)); + request.setConcreteNodes(clusterState.nodes().getDataNodes().values().toArray(DiscoveryNode[]::new)); } } diff --git a/server/src/test/java/org/elasticsearch/cluster/ClusterChangedEventTests.java b/server/src/test/java/org/elasticsearch/cluster/ClusterChangedEventTests.java index 5bb61e5f29058..234a3f8f96e07 100644 --- a/server/src/test/java/org/elasticsearch/cluster/ClusterChangedEventTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/ClusterChangedEventTests.java @@ -8,8 +8,8 @@ package org.elasticsearch.cluster; -import com.carrotsearch.hppc.cursors.ObjectCursor; import com.carrotsearch.hppc.cursors.ObjectObjectCursor; + import org.elasticsearch.Version; import org.elasticsearch.cluster.block.ClusterBlocks; import org.elasticsearch.cluster.metadata.IndexGraveyard; @@ -31,7 +31,6 @@ import java.util.Collections; import java.util.EnumSet; import java.util.HashSet; -import java.util.Iterator; import java.util.List; import java.util.Set; import java.util.stream.Collectors; @@ -479,8 +478,8 @@ private static IndexMetadata createIndexMetadata(final Index index, final long v // Create the routing table for a cluster state. private static RoutingTable createRoutingTable(final long version, final Metadata metadata) { final RoutingTable.Builder builder = RoutingTable.builder().version(version); - for (ObjectCursor cursor : metadata.indices().values()) { - builder.addAsNew(cursor.value); + for (IndexMetadata indexMetadata : metadata.indices().values()) { + builder.addAsNew(indexMetadata); } return builder.build(); } @@ -509,8 +508,8 @@ private static ClusterState executeIndicesChangesTest(final ClusterState previou final TombstoneDeletionQuantity deletionQuantity) { final int numAdd = randomIntBetween(0, 5); // add random # of indices to the next cluster state final List stateIndices = new ArrayList<>(); - for (Iterator iter = previousState.metadata().indices().valuesIt(); iter.hasNext();) { - stateIndices.add(iter.next().getIndex()); + for (IndexMetadata indexMetadata : previousState.metadata().indices().values()) { + stateIndices.add(indexMetadata.getIndex()); } final int numDel; switch (deletionQuantity) { diff --git a/server/src/test/java/org/elasticsearch/cluster/node/DiscoveryNodesTests.java b/server/src/test/java/org/elasticsearch/cluster/node/DiscoveryNodesTests.java index 813035b5f629b..5386b478305a9 100644 --- a/server/src/test/java/org/elasticsearch/cluster/node/DiscoveryNodesTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/node/DiscoveryNodesTests.java @@ -39,7 +39,7 @@ public class DiscoveryNodesTests extends ESTestCase { public void testResolveNodeByIdOrName() { DiscoveryNodes discoveryNodes = buildDiscoveryNodes(); - DiscoveryNode[] nodes = discoveryNodes.getNodes().values().toArray(DiscoveryNode.class); + DiscoveryNode[] nodes = discoveryNodes.getNodes().values().toArray(DiscoveryNode[]::new); DiscoveryNode node = randomFrom(nodes); DiscoveryNode resolvedNode = discoveryNodes.resolveNode(randomBoolean() ? node.getId() : node.getName()); assertThat(resolvedNode.getId(), equalTo(node.getId())); @@ -83,8 +83,7 @@ public void testAll() { assertThat(discoveryNodes.resolveNodes("_all"), arrayContainingInAnyOrder(allNodes)); final String[] nonMasterNodes = - StreamSupport.stream(discoveryNodes.getNodes().values().spliterator(), false) - .map(n -> n.value) + discoveryNodes.getNodes().values().stream() .filter(n -> n.isMasterNode() == false) .map(DiscoveryNode::getId) .toArray(String[]::new); @@ -97,15 +96,13 @@ public void testCoordinatorOnlyNodes() { final DiscoveryNodes discoveryNodes = buildDiscoveryNodes(); final String[] coordinatorOnlyNodes = - StreamSupport.stream(discoveryNodes.getNodes().values().spliterator(), false) - .map(n -> n.value) + discoveryNodes.getNodes().values().stream() .filter(n -> n.canContainData() == false && n.isIngestNode() == false && n.isMasterNode() == false) .map(DiscoveryNode::getId) .toArray(String[]::new); final String[] nonCoordinatorOnlyNodes = - StreamSupport.stream(discoveryNodes.getNodes().values().spliterator(), false) - .map(n -> n.value) + discoveryNodes.getNodes().values().stream() .filter(n -> n.isMasterNode() || n.canContainData() || n.isIngestNode()) .map(DiscoveryNode::getId) .toArray(String[]::new); @@ -136,7 +133,7 @@ public void testResolveNodesIds() { expectedNodeIdsSet.add(nodeId); } int numNodeNames = randomIntBetween(0, 3); - DiscoveryNode[] nodes = discoveryNodes.getNodes().values().toArray(DiscoveryNode.class); + DiscoveryNode[] nodes = discoveryNodes.getNodes().values().toArray(DiscoveryNode[]::new); for (int i = 0; i < numNodeNames; i++) { DiscoveryNode discoveryNode = randomFrom(nodes); nodeSelectors.add(discoveryNode.getName()); @@ -330,24 +327,18 @@ Set matchingNodeIds(DiscoveryNodes nodes) { }, CUSTOM_ATTRIBUTE("attr:value") { @Override Set matchingNodeIds(DiscoveryNodes nodes) { - Set ids = new HashSet<>(); - nodes.getNodes().valuesIt().forEachRemaining(node -> { - if ("value".equals(node.getAttributes().get("attr"))) { - ids.add(node.getId()); - } - }); - return ids; + return nodes.getNodes().values().stream() + .filter(node -> "value".equals(node.getAttributes().get("attr"))) + .map(DiscoveryNode::getId) + .collect(Collectors.toSet()); } }, CUSTOM_ROLE("custom_role:true") { @Override Set matchingNodeIds(DiscoveryNodes nodes) { - Set ids = new HashSet<>(); - nodes.getNodes().valuesIt().forEachRemaining(node -> { - if (node.getRoles().stream().anyMatch(role -> role.roleName().equals("custom_role"))) { - ids.add(node.getId()); - } - }); - return ids; + return nodes.getNodes().values().stream() + .filter(node->node.getRoles().stream().anyMatch(role -> role.roleName().equals("custom_role"))) + .map(DiscoveryNode::getId) + .collect(Collectors.toSet()); } }; diff --git a/server/src/test/java/org/elasticsearch/cluster/routing/allocation/AddIncrementallyTests.java b/server/src/test/java/org/elasticsearch/cluster/routing/allocation/AddIncrementallyTests.java index e1cbbe591bc0f..0252c286d5369 100644 --- a/server/src/test/java/org/elasticsearch/cluster/routing/allocation/AddIncrementallyTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/routing/allocation/AddIncrementallyTests.java @@ -260,8 +260,8 @@ private ClusterState initCluster(AllocationService service, int numberOfNodes, i Metadata metadata = metadataBuilder.build(); - for (ObjectCursor cursor : metadata.indices().values()) { - routingTableBuilder.addAsNew(cursor.value); + for (IndexMetadata indexMetadata : metadata.indices().values()) { + routingTableBuilder.addAsNew(indexMetadata); } RoutingTable initialRoutingTable = routingTableBuilder.build(); diff --git a/server/src/test/java/org/elasticsearch/cluster/routing/allocation/BalanceConfigurationTests.java b/server/src/test/java/org/elasticsearch/cluster/routing/allocation/BalanceConfigurationTests.java index fc7f3798c4a56..a82749ca53432 100644 --- a/server/src/test/java/org/elasticsearch/cluster/routing/allocation/BalanceConfigurationTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/routing/allocation/BalanceConfigurationTests.java @@ -116,8 +116,8 @@ private ClusterState initCluster(AllocationService strategy) { Metadata metadata = metadataBuilder.build(); - for (ObjectCursor cursor : metadata.indices().values()) { - routingTableBuilder.addAsNew(cursor.value); + for (IndexMetadata indexMetadata : metadata.indices().values()) { + routingTableBuilder.addAsNew(indexMetadata); } RoutingTable initialRoutingTable = routingTableBuilder.build(); @@ -344,8 +344,8 @@ public ShardAllocationDecision decideShardAllocation(ShardRouting shard, Routing .settings(settings(Version.CURRENT)).numberOfShards(5).numberOfReplicas(1); metadataBuilder = metadataBuilder.put(indexMeta); Metadata metadata = metadataBuilder.build(); - for (ObjectCursor cursor : metadata.indices().values()) { - routingTableBuilder.addAsNew(cursor.value); + for (IndexMetadata indexMetadata : metadata.indices().values()) { + routingTableBuilder.addAsNew(indexMetadata); } RoutingTable routingTable = routingTableBuilder.build(); DiscoveryNodes.Builder nodes = DiscoveryNodes.builder(); diff --git a/server/src/test/java/org/elasticsearch/cluster/routing/allocation/FailedNodeRoutingTests.java b/server/src/test/java/org/elasticsearch/cluster/routing/allocation/FailedNodeRoutingTests.java index 597dc5667886f..14bdfb857b7f2 100644 --- a/server/src/test/java/org/elasticsearch/cluster/routing/allocation/FailedNodeRoutingTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/routing/allocation/FailedNodeRoutingTests.java @@ -8,7 +8,6 @@ package org.elasticsearch.cluster.routing.allocation; -import com.carrotsearch.hppc.cursors.ObjectCursor; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.elasticsearch.Version; @@ -121,9 +120,9 @@ public void testRandomClusterPromotesNewestReplica() throws InterruptedException } // Log the node versions (for debugging if necessary) - for (ObjectCursor cursor : state.nodes().getDataNodes().values()) { - Version nodeVer = cursor.value.getVersion(); - logger.info("--> node [{}] has version [{}]", cursor.value.getId(), nodeVer); + for (DiscoveryNode discoveryNode : state.nodes().getDataNodes().values()) { + Version nodeVer = discoveryNode.getVersion(); + logger.info("--> node [{}] has version [{}]", discoveryNode.getId(), nodeVer); } // randomly create some indices diff --git a/server/src/test/java/org/elasticsearch/cluster/routing/allocation/FailedShardsRoutingTests.java b/server/src/test/java/org/elasticsearch/cluster/routing/allocation/FailedShardsRoutingTests.java index 4b34a0e924d6f..2cdb8482d045f 100644 --- a/server/src/test/java/org/elasticsearch/cluster/routing/allocation/FailedShardsRoutingTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/routing/allocation/FailedShardsRoutingTests.java @@ -8,7 +8,6 @@ package org.elasticsearch.cluster.routing.allocation; -import com.carrotsearch.hppc.cursors.ObjectCursor; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.elasticsearch.Version; @@ -642,13 +641,13 @@ public void testReplicaOnNewestVersionIsPromoted() { assertNotNull(replicaNodeVersion); logger.info("--> shard {} got assigned to node with version {}", startedReplica, replicaNodeVersion); - for (ObjectCursor cursor : clusterState.nodes().getDataNodes().values()) { - if ("node1".equals(cursor.value.getId())) { + for (DiscoveryNode discoveryNode : clusterState.nodes().getDataNodes().values()) { + if ("node1".equals(discoveryNode.getId())) { // Skip the node that the primary was on, it doesn't have a replica so doesn't need a version check continue; } - Version nodeVer = cursor.value.getVersion(); - assertTrue("expected node [" + cursor.value.getId() + "] with version " + nodeVer + Version nodeVer = discoveryNode.getVersion(); + assertTrue("expected node [" + discoveryNode.getId() + "] with version " + nodeVer + " to be before " + replicaNodeVersion, replicaNodeVersion.onOrAfter(nodeVer)); } @@ -671,14 +670,14 @@ public void testReplicaOnNewestVersionIsPromoted() { assertNotNull(replicaNodeVersion); logger.info("--> shard {} got assigned to node with version {}", startedReplica, replicaNodeVersion); - for (ObjectCursor cursor : clusterState.nodes().getDataNodes().values()) { - if (primaryShardToFail.currentNodeId().equals(cursor.value.getId()) || - secondPrimaryShardToFail.currentNodeId().equals(cursor.value.getId())) { + for (DiscoveryNode discoveryNode : clusterState.nodes().getDataNodes().values()) { + if (primaryShardToFail.currentNodeId().equals(discoveryNode.getId()) || + secondPrimaryShardToFail.currentNodeId().equals(discoveryNode.getId())) { // Skip the node that the primary was on, it doesn't have a replica so doesn't need a version check continue; } - Version nodeVer = cursor.value.getVersion(); - assertTrue("expected node [" + cursor.value.getId() + "] with version " + Version nodeVer = discoveryNode.getVersion(); + assertTrue("expected node [" + discoveryNode.getId() + "] with version " + nodeVer + " to be before " + replicaNodeVersion, replicaNodeVersion.onOrAfter(nodeVer)); } } diff --git a/server/src/test/java/org/elasticsearch/cluster/routing/allocation/ThrottlingAllocationTests.java b/server/src/test/java/org/elasticsearch/cluster/routing/allocation/ThrottlingAllocationTests.java index fb7933bc79c0f..1abc6bbcd3698 100644 --- a/server/src/test/java/org/elasticsearch/cluster/routing/allocation/ThrottlingAllocationTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/routing/allocation/ThrottlingAllocationTests.java @@ -9,7 +9,7 @@ package org.elasticsearch.cluster.routing.allocation; import com.carrotsearch.hppc.IntHashSet; -import com.carrotsearch.hppc.cursors.ObjectCursor; + import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.elasticsearch.Version; @@ -338,9 +338,9 @@ private ClusterState createRecoveryStateAndInitializeAllocations( Snapshot snapshot = new Snapshot("repo", new SnapshotId("snap", "randomId")); Set snapshotIndices = new HashSet<>(); String restoreUUID = UUIDs.randomBase64UUID(); - for (ObjectCursor cursor: metadata.indices().values()) { - Index index = cursor.value.getIndex(); - IndexMetadata.Builder indexMetadataBuilder = IndexMetadata.builder(cursor.value); + for (IndexMetadata im : metadata.indices().values()) { + Index index = im.getIndex(); + IndexMetadata.Builder indexMetadataBuilder = IndexMetadata.builder(im); final int recoveryType = randomInt(5); if (recoveryType <= 4) { addInSyncAllocationIds(index, indexMetadataBuilder, gatewayAllocator, node1); diff --git a/server/src/test/java/org/elasticsearch/cluster/routing/allocation/decider/EnableAllocationShortCircuitTests.java b/server/src/test/java/org/elasticsearch/cluster/routing/allocation/decider/EnableAllocationShortCircuitTests.java index 3e35b69abedfc..a1b3d4f1e91fc 100644 --- a/server/src/test/java/org/elasticsearch/cluster/routing/allocation/decider/EnableAllocationShortCircuitTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/routing/allocation/decider/EnableAllocationShortCircuitTests.java @@ -98,7 +98,7 @@ public void testRebalancingSkippedIfDisabled() { public void testRebalancingSkippedIfDisabledIncludingOnSpecificIndices() { ClusterState clusterState = createClusterStateWithAllShardsAssigned(); - final IndexMetadata indexMetadata = randomFrom(clusterState.metadata().indices().values().toArray(IndexMetadata.class)); + final IndexMetadata indexMetadata = randomFrom(clusterState.metadata().indices().values().toArray(IndexMetadata[]::new)); clusterState = ClusterState.builder(clusterState).metadata(Metadata.builder(clusterState.metadata()) .put(IndexMetadata.builder(indexMetadata).settings(Settings.builder().put(indexMetadata.getSettings()) .put(INDEX_ROUTING_REBALANCE_ENABLE_SETTING.getKey(), EnableAllocationDecider.Rebalance.NONE.name()))).build()).build(); @@ -113,7 +113,7 @@ public void testRebalancingSkippedIfDisabledIncludingOnSpecificIndices() { public void testRebalancingAttemptedIfDisabledButOverridenOnSpecificIndices() { ClusterState clusterState = createClusterStateWithAllShardsAssigned(); - final IndexMetadata indexMetadata = randomFrom(clusterState.metadata().indices().values().toArray(IndexMetadata.class)); + final IndexMetadata indexMetadata = randomFrom(clusterState.metadata().indices().values()); clusterState = ClusterState.builder(clusterState).metadata(Metadata.builder(clusterState.metadata()) .put(IndexMetadata.builder(indexMetadata).settings(Settings.builder().put(indexMetadata.getSettings()) .put(INDEX_ROUTING_REBALANCE_ENABLE_SETTING.getKey(), diff --git a/server/src/test/java/org/elasticsearch/common/collect/ImmutableOpenMapTests.java b/server/src/test/java/org/elasticsearch/common/collect/ImmutableOpenMapTests.java index 1480bb0ddf902..034d5c18feaff 100644 --- a/server/src/test/java/org/elasticsearch/common/collect/ImmutableOpenMapTests.java +++ b/server/src/test/java/org/elasticsearch/common/collect/ImmutableOpenMapTests.java @@ -15,6 +15,7 @@ import org.elasticsearch.test.ESTestCase; import java.util.ArrayList; +import java.util.Comparator; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -22,8 +23,12 @@ import java.util.SortedSet; import java.util.TreeMap; import java.util.TreeSet; +import java.util.function.Predicate; import java.util.stream.Collectors; +import static org.hamcrest.Matchers.arrayContainingInAnyOrder; +import static org.hamcrest.Matchers.containsInAnyOrder; +import static org.hamcrest.Matchers.empty; import static org.hamcrest.Matchers.equalTo; public class ImmutableOpenMapTests extends ESTestCase { @@ -36,9 +41,17 @@ public class ImmutableOpenMapTests extends ESTestCase { .fPut("Korea", "₩") .build(); + ImmutableOpenMap countryPopulations = ImmutableOpenMap.builder() + .fPut("Poland", 37_846_611) + .fPut("France", 65_273_511) + .fPut("Spain", 46_754_778) + .fPut("Germany", 83_783_942) + .fPut("Italy", 60_461_826) + .build(); + public void testStreamOperationsAreSupported() { assertThat(regionCurrencySymbols.stream().filter(e -> e.getKey().startsWith("U")).map(Map.Entry::getValue) - .collect(Collectors.toSet()), equalTo(Set.of("£", "$"))); + .collect(Collectors.toSet()), equalTo(Set.of("£", "$"))); } public void testSortedStream() { @@ -120,6 +133,56 @@ public void testEmptyKeySetWorks() { assertThat(ImmutableOpenMap.of().keySet().size(), equalTo(0)); } + public void testEmptyValuesIsCollection() { + assertThat(ImmutableOpenMap.of().values(), empty()); + } + + public void testValuesIsCollection() { + assertThat(countryPopulations.values(), containsInAnyOrder(37_846_611, 46_754_778, 60_461_826, 65_273_511, 83_783_942)); + } + + public void testValuesToArray() { + Integer[] populations = countryPopulations.values().toArray(Integer[]::new); + + assertThat(populations, arrayContainingInAnyOrder(37_846_611, 46_754_778, 60_461_826, 65_273_511, 83_783_942)); + } + + public void testStreamOperationOnValues() { + assertThat(countryPopulations.values().stream() + .filter(e -> e > 60_000_000) + .sorted(Comparator.reverseOrder()) + .limit(2).collect(Collectors.toList()), + equalTo(List.of(83_783_942, 65_273_511))); + } + + public void testStreamOperationsOnRandomMapValues() { + ImmutableOpenMap map = randomImmutableOpenMap(); + + int limit = randomIntBetween(0, map.size()); + List collectedViaStream = map.values() + .stream() + .filter(Predicate.not(e -> e.contains("ab") || e.contains("cd") || e.contains("ef"))) + .sorted() + .limit(limit) + .collect(Collectors.toList()); + + SortedSet filteredSortedStrings = new TreeSet<>(); + for (ObjectObjectCursor cursor : map) { + if ((cursor.value.contains("ab") || cursor.value.contains("cd") || cursor.value.contains("ef")) == false) { + filteredSortedStrings.add(cursor.value); + } + } + int i = 0; + List collectedIteratively = new ArrayList<>(); + for (String s : filteredSortedStrings) { + if (i++ >= limit) { + break; + } + collectedIteratively.add(s); + } + assertThat(collectedViaStream, equalTo(collectedIteratively)); + } + private static ImmutableOpenMap randomImmutableOpenMap() { return Randomness.get().longs(randomIntBetween(1, 1000)) .mapToObj(e -> Tuple.tuple(e, randomAlphaOfLength(8))) diff --git a/server/src/test/java/org/elasticsearch/indices/ShardLimitValidatorTests.java b/server/src/test/java/org/elasticsearch/indices/ShardLimitValidatorTests.java index 94639adbd27c1..722383adad858 100644 --- a/server/src/test/java/org/elasticsearch/indices/ShardLimitValidatorTests.java +++ b/server/src/test/java/org/elasticsearch/indices/ShardLimitValidatorTests.java @@ -26,11 +26,9 @@ import org.elasticsearch.index.Index; import org.elasticsearch.test.ESTestCase; -import java.util.Arrays; import java.util.Optional; import java.util.Set; import java.util.stream.Collectors; -import java.util.stream.StreamSupport; import static org.elasticsearch.cluster.metadata.MetadataIndexStateServiceTests.addClosedIndex; import static org.elasticsearch.cluster.metadata.MetadataIndexStateServiceTests.addOpenedIndex; @@ -116,7 +114,7 @@ public void testValidateShardLimitUpdateReplicas() { } public Index[] getIndices(ClusterState state) { - return Arrays.stream(state.metadata().indices().values().toArray(IndexMetadata.class)) + return state.metadata().indices().values().stream() .map(IndexMetadata::getIndex) .collect(Collectors.toList()) .toArray(Index.EMPTY_ARRAY); @@ -201,8 +199,8 @@ private static DiscoveryNode createNode(String group) { } private static Metadata.Builder freezeMetadata(Metadata.Builder builder, Metadata metadata) { - StreamSupport.stream(metadata.indices().values().spliterator(), false) - .map(oc -> oc.value).map(imd -> IndexMetadata.builder(imd).settings(Settings.builder().put(imd.getSettings()) + metadata.indices().values().stream() + .map(imd -> IndexMetadata.builder(imd).settings(Settings.builder().put(imd.getSettings()) .put(ShardLimitValidator.INDEX_SETTING_SHARD_LIMIT_GROUP.getKey(), ShardLimitValidator.FROZEN_GROUP))) .forEach(builder::put); return builder; diff --git a/server/src/test/java/org/elasticsearch/indices/cluster/IndicesClusterStateServiceRandomUpdatesTests.java b/server/src/test/java/org/elasticsearch/indices/cluster/IndicesClusterStateServiceRandomUpdatesTests.java index b2d7ba31da13a..14628086b0910 100644 --- a/server/src/test/java/org/elasticsearch/indices/cluster/IndicesClusterStateServiceRandomUpdatesTests.java +++ b/server/src/test/java/org/elasticsearch/indices/cluster/IndicesClusterStateServiceRandomUpdatesTests.java @@ -441,7 +441,7 @@ public ClusterState randomlyUpdateClusterState(ClusterState state, } else { // remove node if (state.nodes().getDataNodes().size() > 3) { - DiscoveryNode discoveryNode = randomFrom(state.nodes().getNodes().values().toArray(DiscoveryNode.class)); + DiscoveryNode discoveryNode = randomFrom(state.nodes().getNodes().values()); if (discoveryNode.equals(state.nodes().getMasterNode()) == false) { state = cluster.removeNodes(state, Collections.singletonList(discoveryNode)); updateNodes(state, clusterStateServiceMap, indicesServiceSupplier); diff --git a/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/storage/ReactiveStorageDeciderDecisionTests.java b/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/storage/ReactiveStorageDeciderDecisionTests.java index 51d6305b6db72..11addd6a847cf 100644 --- a/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/storage/ReactiveStorageDeciderDecisionTests.java +++ b/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/storage/ReactiveStorageDeciderDecisionTests.java @@ -274,9 +274,7 @@ public void testMoveToEmpty() { } private Set allIndices() { - return StreamSupport.stream(state.metadata().getIndices().values().spliterator(), false) - .map(cursor -> cursor.value) - .collect(Collectors.toSet()); + return new HashSet<>(state.metadata().getIndices().values()); } private ClusterState moveToCold(Set candidates) { diff --git a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/action/AutoFollowCoordinator.java b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/action/AutoFollowCoordinator.java index 1ef59857e7cc9..188c444f80794 100644 --- a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/action/AutoFollowCoordinator.java +++ b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/action/AutoFollowCoordinator.java @@ -6,8 +6,6 @@ */ package org.elasticsearch.xpack.ccr.action; -import com.carrotsearch.hppc.predicates.ObjectPredicate; - import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.message.ParameterizedMessage; @@ -51,7 +49,6 @@ import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; -import java.util.HashSet; import java.util.LinkedHashMap; import java.util.List; import java.util.Locale; @@ -700,9 +697,9 @@ static Function cleanFollowedRemoteIndices( AutoFollowMetadata currentAutoFollowMetadata = currentState.metadata().custom(AutoFollowMetadata.TYPE); Map> autoFollowPatternNameToFollowedIndexUUIDs = new HashMap<>(currentAutoFollowMetadata.getFollowedLeaderIndexUUIDs()); - Set remoteIndexUUIDS = new HashSet<>(); - remoteMetadata.getIndices().values() - .forEach((ObjectPredicate) value -> remoteIndexUUIDS.add(value.getIndexUUID())); + Set remoteIndexUUIDS = remoteMetadata.getIndices().values().stream() + .map(IndexMetadata::getIndexUUID) + .collect(Collectors.toSet()); boolean requiresCSUpdate = false; for (String autoFollowPatternName : autoFollowPatternNames) { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/cluster/routing/allocation/DataTierAllocationDecider.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/cluster/routing/allocation/DataTierAllocationDecider.java index 6ff489bad3626..648e7b44c86e3 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/cluster/routing/allocation/DataTierAllocationDecider.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/cluster/routing/allocation/DataTierAllocationDecider.java @@ -7,8 +7,6 @@ package org.elasticsearch.xpack.cluster.routing.allocation; -import com.carrotsearch.hppc.cursors.ObjectCursor; - import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.node.DiscoveryNodeRole; @@ -201,8 +199,8 @@ public static String[] parseTierList(String tiers) { static boolean tierNodesPresent(String singleTier, DiscoveryNodes nodes) { assert singleTier.equals(DiscoveryNodeRole.DATA_ROLE.roleName()) || DataTier.validTierName(singleTier) : "tier " + singleTier + " is an invalid tier name"; - for (ObjectCursor node : nodes.getNodes().values()) { - for (DiscoveryNodeRole discoveryNodeRole : node.value.getRoles()) { + for (DiscoveryNode node : nodes.getNodes().values()) { + for (DiscoveryNodeRole discoveryNodeRole : node.getRoles()) { String s = discoveryNodeRole.roleName(); if (s.equals(DiscoveryNodeRole.DATA_ROLE.roleName()) || s.equals(singleTier)) { return true; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/LifecyclePolicyUtils.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/LifecyclePolicyUtils.java index 02bd034c6bf9a..3070dfa719b04 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/LifecyclePolicyUtils.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/LifecyclePolicyUtils.java @@ -29,7 +29,6 @@ import java.io.InputStream; import java.util.List; import java.util.stream.Collectors; -import java.util.stream.StreamSupport; /** * A utility class used for index lifecycle policies @@ -92,8 +91,7 @@ private static void validate(BytesReference source) { */ public static ItemUsage calculateUsage(final IndexNameExpressionResolver indexNameExpressionResolver, final ClusterState state, final String policyName) { - final List indices = StreamSupport.stream(state.metadata().indices().values().spliterator(), false) - .map(cursor -> cursor.value) + final List indices = state.metadata().indices().values().stream() .filter(indexMetadata -> policyName.equals(LifecycleSettings.LIFECYCLE_NAME_SETTING.get(indexMetadata.getSettings()))) .map(indexMetadata -> indexMetadata.getIndex().getName()) .collect(Collectors.toList()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/PhaseCacheManagement.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/PhaseCacheManagement.java index bc45d73acc0c9..601aab492d5b2 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/PhaseCacheManagement.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/PhaseCacheManagement.java @@ -26,9 +26,7 @@ import java.util.LinkedHashSet; import java.util.List; import java.util.Set; -import java.util.Spliterators; import java.util.stream.Collectors; -import java.util.stream.StreamSupport; import static org.elasticsearch.xpack.core.ilm.LifecycleExecutionState.ILM_CUSTOM_METADATA_KEY; @@ -135,7 +133,7 @@ public static boolean updateIndicesForPolicy(final Metadata.Builder mb, final Cl } final List indicesThatCanBeUpdated = - StreamSupport.stream(Spliterators.spliteratorUnknownSize(currentState.metadata().indices().valuesIt(), 0), false) + currentState.metadata().indices().values().stream() .filter(meta -> newPolicy.getName().equals(LifecycleSettings.LIFECYCLE_NAME_SETTING.get(meta.getSettings()))) .filter(meta -> isIndexPhaseDefinitionUpdatable(xContentRegistry, client, meta, newPolicy.getPolicy(), licenseState)) .collect(Collectors.toList()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/SwapAliasesAndDeleteSourceIndexStep.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/SwapAliasesAndDeleteSourceIndexStep.java index 5b738021b2a22..63cc99301b7a6 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/SwapAliasesAndDeleteSourceIndexStep.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/SwapAliasesAndDeleteSourceIndexStep.java @@ -13,7 +13,6 @@ import org.elasticsearch.client.Client; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.ClusterStateObserver; -import org.elasticsearch.cluster.metadata.AliasMetadata; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.core.TimeValue; @@ -77,8 +76,7 @@ static void deleteSourceIndexAndTransferAliases(Client client, IndexMetadata sou .addAliasAction(IndicesAliasesRequest.AliasActions.removeIndex().index(sourceIndexName)) .addAliasAction(IndicesAliasesRequest.AliasActions.add().index(targetIndex).alias(sourceIndexName)); // copy over other aliases from source index - sourceIndex.getAliases().values().spliterator().forEachRemaining(aliasMetaDataObjectCursor -> { - AliasMetadata aliasMetaDataToAdd = aliasMetaDataObjectCursor.value; + sourceIndex.getAliases().values().forEach(aliasMetaDataToAdd -> { // inherit all alias properties except `is_write_index` aliasesRequest.addAliasAction(IndicesAliasesRequest.AliasActions.add() .index(targetIndex).alias(aliasMetaDataToAdd.alias()) diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/DataTierTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/DataTierTests.java index bdf611eac53a8..bfe7dda5175c1 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/DataTierTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/DataTierTests.java @@ -24,7 +24,6 @@ import java.util.Map; import java.util.Set; import java.util.concurrent.atomic.AtomicInteger; -import java.util.stream.StreamSupport; import static org.elasticsearch.xpack.core.DataTier.DATA_COLD; import static org.elasticsearch.xpack.core.DataTier.DATA_HOT; @@ -43,43 +42,37 @@ public void testNodeSelection() { DiscoveryNodes discoveryNodes = buildDiscoveryNodes(); final String[] dataNodes = - StreamSupport.stream(discoveryNodes.getNodes().values().spliterator(), false) - .map(n -> n.value) + discoveryNodes.getNodes().values().stream() .filter(DiscoveryNode::canContainData) .map(DiscoveryNode::getId) .toArray(String[]::new); final String[] contentNodes = - StreamSupport.stream(discoveryNodes.getNodes().values().spliterator(), false) - .map(n -> n.value) + discoveryNodes.getNodes().values().stream() .filter(DataTier::isContentNode) .map(DiscoveryNode::getId) .toArray(String[]::new); final String[] hotNodes = - StreamSupport.stream(discoveryNodes.getNodes().values().spliterator(), false) - .map(n -> n.value) + discoveryNodes.getNodes().values().stream() .filter(DataTier::isHotNode) .map(DiscoveryNode::getId) .toArray(String[]::new); final String[] warmNodes = - StreamSupport.stream(discoveryNodes.getNodes().values().spliterator(), false) - .map(n -> n.value) + discoveryNodes.getNodes().values().stream() .filter(DataTier::isWarmNode) .map(DiscoveryNode::getId) .toArray(String[]::new); final String[] coldNodes = - StreamSupport.stream(discoveryNodes.getNodes().values().spliterator(), false) - .map(n -> n.value) + discoveryNodes.getNodes().values().stream() .filter(DataTier::isColdNode) .map(DiscoveryNode::getId) .toArray(String[]::new); final String[] frozenNodes = - StreamSupport.stream(discoveryNodes.getNodes().values().spliterator(), false) - .map(n -> n.value) + discoveryNodes.getNodes().values().stream() .filter(DataTier::isFrozenNode) .map(DiscoveryNode::getId) .toArray(String[]::new); diff --git a/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/EnrichPolicyRunner.java b/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/EnrichPolicyRunner.java index 94328df0b47cb..8846c96057556 100644 --- a/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/EnrichPolicyRunner.java +++ b/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/EnrichPolicyRunner.java @@ -66,7 +66,6 @@ import java.util.Set; import java.util.function.LongSupplier; import java.util.stream.Collectors; -import java.util.stream.StreamSupport; import static org.elasticsearch.xpack.core.ClientHelper.ENRICH_ORIGIN; @@ -137,10 +136,7 @@ public void run() { } private List> toMappings(GetIndexResponse response) { - return StreamSupport.stream(response.mappings().values().spliterator(), false) - .map(cursor -> cursor.value) - .map(MappingMetadata::getSourceAsMap) - .collect(Collectors.toList()); + return response.mappings().values().stream().map(MappingMetadata::getSourceAsMap).collect(Collectors.toList()); } private Map getMappings(final GetIndexResponse getIndexResponse, final String sourceIndexName) { diff --git a/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/action/EnrichCoordinatorStatsAction.java b/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/action/EnrichCoordinatorStatsAction.java index 4b71fd69a57e5..ab5f2289511d7 100644 --- a/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/action/EnrichCoordinatorStatsAction.java +++ b/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/action/EnrichCoordinatorStatsAction.java @@ -154,7 +154,7 @@ public TransportAction( @Override protected void resolveRequest(Request request, ClusterState clusterState) { - DiscoveryNode[] ingestNodes = clusterState.getNodes().getIngestNodes().values().toArray(DiscoveryNode.class); + DiscoveryNode[] ingestNodes = clusterState.getNodes().getIngestNodes().values().toArray(DiscoveryNode[]::new); request.setConcreteNodes(ingestNodes); } diff --git a/x-pack/plugin/frozen-indices/src/internalClusterTest/java/org/elasticsearch/index/engine/frozen/FrozenIndexRecoveryTests.java b/x-pack/plugin/frozen-indices/src/internalClusterTest/java/org/elasticsearch/index/engine/frozen/FrozenIndexRecoveryTests.java index 02520be6c691c..04b996b9adb32 100644 --- a/x-pack/plugin/frozen-indices/src/internalClusterTest/java/org/elasticsearch/index/engine/frozen/FrozenIndexRecoveryTests.java +++ b/x-pack/plugin/frozen-indices/src/internalClusterTest/java/org/elasticsearch/index/engine/frozen/FrozenIndexRecoveryTests.java @@ -12,7 +12,6 @@ import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.CollectionUtils; -import org.elasticsearch.common.util.set.Sets; import org.elasticsearch.indices.recovery.RecoveryState; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.protocol.xpack.frozen.FreezeRequest; @@ -48,10 +47,7 @@ public void testRecoverExistingReplica() throws Exception { internalCluster().ensureAtLeastNumDataNodes(2); List dataNodes = randomSubsetOf( 2, - Sets.newHashSet(clusterService().state().nodes().getDataNodes().valuesIt()) - .stream() - .map(DiscoveryNode::getName) - .collect(Collectors.toSet()) + clusterService().state().nodes().getDataNodes().values().stream().map(DiscoveryNode::getName).collect(Collectors.toSet()) ); createIndex( indexName, diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/cluster/metadata/MetadataMigrateToDataTiersRoutingService.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/cluster/metadata/MetadataMigrateToDataTiersRoutingService.java index 87bfe72079b64..8989598e36fec 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/cluster/metadata/MetadataMigrateToDataTiersRoutingService.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/cluster/metadata/MetadataMigrateToDataTiersRoutingService.java @@ -42,10 +42,8 @@ import java.util.Map; import java.util.Objects; import java.util.SortedMap; -import java.util.Spliterators; import java.util.TreeMap; import java.util.stream.Collectors; -import java.util.stream.StreamSupport; import static org.elasticsearch.cluster.metadata.IndexMetadata.INDEX_ROUTING_EXCLUDE_GROUP_SETTING; import static org.elasticsearch.cluster.metadata.IndexMetadata.INDEX_ROUTING_INCLUDE_GROUP_SETTING; @@ -236,7 +234,7 @@ private static void refreshCachedPhaseForPhasesWithoutAllocateAction(Metadata.Bu XPackLicenseState licenseState) { String policyName = oldPolicy.getName(); final List managedIndices = - StreamSupport.stream(Spliterators.spliteratorUnknownSize(currentState.metadata().indices().valuesIt(), 0), false) + currentState.metadata().indices().values().stream() .filter(meta -> policyName.equals(LifecycleSettings.LIFECYCLE_NAME_SETTING.get(meta.getSettings()))) .collect(Collectors.toList()); diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycleService.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycleService.java index 1c879a623db1a..a9091276f63cd 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycleService.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycleService.java @@ -6,8 +6,6 @@ */ package org.elasticsearch.xpack.ilm; -import com.carrotsearch.hppc.cursors.ObjectCursor; - import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.message.ParameterizedMessage; @@ -166,8 +164,7 @@ void onMaster(ClusterState clusterState) { // If we just became master, we need to kick off any async actions that // may have not been run due to master rollover - for (ObjectCursor cursor : clusterState.metadata().indices().values()) { - IndexMetadata idxMeta = cursor.value; + for (IndexMetadata idxMeta : clusterState.metadata().indices().values()) { String policyName = LifecycleSettings.LIFECYCLE_NAME_SETTING.get(idxMeta.getSettings()); if (Strings.isNullOrEmpty(policyName) == false) { final LifecycleExecutionState lifecycleState = LifecycleExecutionState.fromIndexMetadata(idxMeta); @@ -334,8 +331,7 @@ void triggerPolicies(ClusterState clusterState, boolean fromClusterStateChange) // loop through all indices in cluster state and filter for ones that are // managed by the Index Lifecycle Service they have a index.lifecycle.name setting // associated to a policy - for (ObjectCursor cursor : clusterState.metadata().indices().values()) { - IndexMetadata idxMeta = cursor.value; + for (IndexMetadata idxMeta : clusterState.metadata().indices().values()) { String policyName = LifecycleSettings.LIFECYCLE_NAME_SETTING.get(idxMeta.getSettings()); if (Strings.isNullOrEmpty(policyName) == false) { final LifecycleExecutionState lifecycleState = LifecycleExecutionState.fromIndexMetadata(idxMeta); diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/TransportDeleteLifecycleAction.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/TransportDeleteLifecycleAction.java index c0af59c8cb449..a43a35154602b 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/TransportDeleteLifecycleAction.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/TransportDeleteLifecycleAction.java @@ -7,7 +7,6 @@ package org.elasticsearch.xpack.ilm.action; -import com.carrotsearch.hppc.cursors.ObjectCursor; import org.elasticsearch.ResourceNotFoundException; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.support.ActionFilters; @@ -17,7 +16,6 @@ import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.block.ClusterBlockException; import org.elasticsearch.cluster.block.ClusterBlockLevel; -import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; import org.elasticsearch.cluster.metadata.Metadata; import org.elasticsearch.cluster.service.ClusterService; @@ -32,10 +30,8 @@ import java.util.List; import java.util.SortedMap; -import java.util.Spliterator; import java.util.TreeMap; import java.util.stream.Collectors; -import java.util.stream.StreamSupport; import static org.elasticsearch.xpack.core.ilm.LifecycleSettings.LIFECYCLE_NAME_SETTING; @@ -54,12 +50,10 @@ protected void masterOperation(Task task, Request request, ClusterState state, A new AckedClusterStateUpdateTask(request, listener) { @Override public ClusterState execute(ClusterState currentState) { - Spliterator> indicesIt = currentState.metadata().indices().values().spliterator(); String policyToDelete = request.getPolicyName(); - List indicesUsingPolicy = StreamSupport.stream(indicesIt, false) - .map(idxMeta -> idxMeta.value) - .filter((idxMeta) -> LIFECYCLE_NAME_SETTING.get(idxMeta.getSettings()).equals(policyToDelete)) - .map((idxMeta) -> idxMeta.getIndex().getName()) + List indicesUsingPolicy = currentState.metadata().indices().values().stream() + .filter(idxMeta -> LIFECYCLE_NAME_SETTING.get(idxMeta.getSettings()).equals(policyToDelete)) + .map(idxMeta -> idxMeta.getIndex().getName()) .collect(Collectors.toList()); if (indicesUsingPolicy.isEmpty() == false) { throw new IllegalArgumentException("Cannot delete policy [" + request.getPolicyName() diff --git a/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/RunDataFrameAnalyticsIT.java b/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/RunDataFrameAnalyticsIT.java index 2adbbfe16bdbb..1777c9d8ee604 100644 --- a/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/RunDataFrameAnalyticsIT.java +++ b/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/RunDataFrameAnalyticsIT.java @@ -14,7 +14,6 @@ import org.elasticsearch.action.index.IndexRequest; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.action.support.WriteRequest; -import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.index.IndexSettings; @@ -28,7 +27,6 @@ import org.elasticsearch.xpack.core.ml.dataframe.DataFrameAnalyticsState; import org.elasticsearch.xpack.core.ml.dataframe.analyses.OutlierDetection; import org.junit.After; -import org.junit.Before; import java.util.HashMap; import java.util.List; @@ -248,7 +246,7 @@ public void testOutlierDetectionWithMoreFieldsThanDocValueFieldLimit() throws Ex GetSettingsResponse docValueLimitSetting = client().admin().indices().getSettings(getSettingsRequest).actionGet(); int docValueLimit = IndexSettings.MAX_DOCVALUE_FIELDS_SEARCH_SETTING.get( - docValueLimitSetting.getIndexToSettings().values().iterator().next().value); + docValueLimitSetting.getIndexToSettings().valuesIt().next()); BulkRequestBuilder bulkRequestBuilder = client().prepareBulk(); bulkRequestBuilder.setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE); diff --git a/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/MlConfigMigratorIT.java b/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/MlConfigMigratorIT.java index c11f0e602fde7..c487e565963f3 100644 --- a/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/MlConfigMigratorIT.java +++ b/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/MlConfigMigratorIT.java @@ -6,7 +6,6 @@ */ package org.elasticsearch.xpack.ml.integration; -import com.carrotsearch.hppc.cursors.ObjectCursor; import org.elasticsearch.Version; import org.elasticsearch.action.DocWriteRequest; import org.elasticsearch.action.index.IndexRequest; @@ -162,9 +161,7 @@ public void testMigrateConfigs() throws InterruptedException, IOException { doAnswer(invocation -> { ClusterStateUpdateTask listener = (ClusterStateUpdateTask) invocation.getArguments()[1]; ClusterState result = listener.execute(clusterState); - for (ObjectCursor value : result.metadata().customs().values()){ - customs.add(value.value); - } + customs.addAll(result.metadata().customs().values()); listener.clusterStateProcessed("source", mock(ClusterState.class), mock(ClusterState.class)); return null; }).when(clusterService).submitStateUpdateTask(eq("remove-migrated-ml-configs"), any()); diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/DestinationIndex.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/DestinationIndex.java index c5477afe9868f..bb11a0e687b5a 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/DestinationIndex.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/DestinationIndex.java @@ -41,7 +41,6 @@ import java.time.Clock; import java.util.Collections; import java.util.HashMap; -import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.concurrent.atomic.AtomicReference; @@ -209,9 +208,7 @@ private static Settings settings(GetSettingsResponse settingsResponse) { @Nullable private static Integer findMaxSettingValue(GetSettingsResponse settingsResponse, String settingKey) { Integer maxValue = null; - Iterator settingsIterator = settingsResponse.getIndexToSettings().valuesIt(); - while (settingsIterator.hasNext()) { - Settings settings = settingsIterator.next(); + for (Settings settings : settingsResponse.getIndexToSettings().values()) { Integer indexValue = settings.getAsInt(settingKey, null); if (indexValue != null) { maxValue = maxValue == null ? indexValue : Math.max(indexValue, maxValue); diff --git a/x-pack/plugin/ql/src/main/java/org/elasticsearch/xpack/ql/index/IndexResolver.java b/x-pack/plugin/ql/src/main/java/org/elasticsearch/xpack/ql/index/IndexResolver.java index 46c59ef1037ff..2c5322eea826c 100644 --- a/x-pack/plugin/ql/src/main/java/org/elasticsearch/xpack/ql/index/IndexResolver.java +++ b/x-pack/plugin/ql/src/main/java/org/elasticsearch/xpack/ql/index/IndexResolver.java @@ -6,7 +6,6 @@ */ package org.elasticsearch.xpack.ql.index; -import com.carrotsearch.hppc.cursors.ObjectCursor; import com.carrotsearch.hppc.cursors.ObjectObjectCursor; import org.elasticsearch.ElasticsearchSecurityException; @@ -249,8 +248,8 @@ private void filterResults(String javaRegex, GetAliasesResponse aliases, GetInde Set result = new TreeSet<>(Comparator.comparing(IndexInfo::name)); // filter aliases (if present) if (aliases != null) { - for (ObjectCursor> cursor : aliases.getAliases().values()) { - for (AliasMetadata amd : cursor.value) { + for (List aliasList : aliases.getAliases().values()) { + for (AliasMetadata amd : aliasList) { String alias = amd.alias(); if (alias != null && (pattern == null || pattern.matcher(alias).matches())) { result.add(new IndexInfo(alias, IndexType.ALIAS)); diff --git a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/FrozenSearchableSnapshotsIntegTests.java b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/FrozenSearchableSnapshotsIntegTests.java index 1fb4bdc079f05..1d3dc9224483b 100644 --- a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/FrozenSearchableSnapshotsIntegTests.java +++ b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/FrozenSearchableSnapshotsIntegTests.java @@ -62,7 +62,6 @@ import java.util.Locale; import java.util.Map; import java.util.concurrent.atomic.AtomicBoolean; -import java.util.stream.StreamSupport; import static org.elasticsearch.index.IndexSettings.INDEX_SOFT_DELETES_SETTING; import static org.elasticsearch.index.query.QueryBuilders.matchQuery; @@ -377,10 +376,7 @@ public void testCreateAndRestorePartialSearchableSnapshot() throws Exception { internalCluster().ensureAtLeastNumDataNodes(2); final DiscoveryNode dataNode = randomFrom( - StreamSupport.stream( - client().admin().cluster().prepareState().get().getState().nodes().getDataNodes().values().spliterator(), - false - ).map(c -> c.value).toArray(DiscoveryNode[]::new) + client().admin().cluster().prepareState().get().getState().nodes().getDataNodes().values() ); assertAcked( diff --git a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsIntegTests.java b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsIntegTests.java index 69d9f2f3e4491..4db3e0c5e74ec 100644 --- a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsIntegTests.java +++ b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsIntegTests.java @@ -71,7 +71,6 @@ import java.util.concurrent.CyclicBarrier; import java.util.stream.Collectors; import java.util.stream.IntStream; -import java.util.stream.StreamSupport; import static org.elasticsearch.cluster.metadata.IndexMetadata.INDEX_NUMBER_OF_SHARDS_SETTING; import static org.elasticsearch.index.IndexSettings.INDEX_SOFT_DELETES_SETTING; @@ -298,10 +297,7 @@ public void testCreateAndRestoreSearchableSnapshot() throws Exception { internalCluster().ensureAtLeastNumDataNodes(2); final DiscoveryNode dataNode = randomFrom( - StreamSupport.stream( - client().admin().cluster().prepareState().get().getState().nodes().getDataNodes().values().spliterator(), - false - ).map(c -> c.value).toArray(DiscoveryNode[]::new) + client().admin().cluster().prepareState().get().getState().nodes().getDataNodes().values() ); assertAcked( diff --git a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/cache/full/SearchableSnapshotsPersistentCacheIntegTests.java b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/cache/full/SearchableSnapshotsPersistentCacheIntegTests.java index 5dddf0cebbe5c..32737e45e5193 100644 --- a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/cache/full/SearchableSnapshotsPersistentCacheIntegTests.java +++ b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/cache/full/SearchableSnapshotsPersistentCacheIntegTests.java @@ -76,7 +76,7 @@ public void testCacheSurviveRestart() throws Exception { assertAcked(client().admin().indices().prepareDelete(indexName)); final DiscoveryNodes discoveryNodes = client().admin().cluster().prepareState().clear().setNodes(true).get().getState().nodes(); - final String dataNode = randomFrom(discoveryNodes.getDataNodes().values().toArray(DiscoveryNode.class)).getName(); + final String dataNode = randomFrom(discoveryNodes.getDataNodes().values()).getName(); mountSnapshot( fsRepoName, diff --git a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/recovery/SearchableSnapshotRecoveryStateIntegrationTests.java b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/recovery/SearchableSnapshotRecoveryStateIntegrationTests.java index 8b684138a9237..ad8805967e15c 100644 --- a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/recovery/SearchableSnapshotRecoveryStateIntegrationTests.java +++ b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/recovery/SearchableSnapshotRecoveryStateIntegrationTests.java @@ -7,8 +7,6 @@ package org.elasticsearch.xpack.searchablesnapshots.recovery; -import com.carrotsearch.hppc.ObjectContainer; - import org.elasticsearch.action.admin.indices.recovery.RecoveryResponse; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.cluster.node.DiscoveryNode; @@ -217,11 +215,11 @@ private RecoveryState getRecoveryState(String indexName) { @SuppressForbidden(reason = "Uses FileSystem APIs") private long getPhysicalCacheSize(Index index, String snapshotUUID) throws Exception { - final ObjectContainer dataNodes = getDiscoveryNodes().getDataNodes().values(); + final Collection dataNodes = getDiscoveryNodes().getDataNodes().values(); assertThat(dataNodes.size(), equalTo(1)); - final String dataNode = dataNodes.iterator().next().value.getName(); + final String dataNode = dataNodes.iterator().next().getName(); final IndexService indexService = internalCluster().getInstance(IndicesService.class, dataNode).indexService(index); final Path shardCachePath = CacheService.getShardCachePath(indexService.getShard(0).shardPath()); diff --git a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/action/cache/TransportSearchableSnapshotsNodeCachesStatsAction.java b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/action/cache/TransportSearchableSnapshotsNodeCachesStatsAction.java index 53300ed66e7ce..342266ec8613f 100644 --- a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/action/cache/TransportSearchableSnapshotsNodeCachesStatsAction.java +++ b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/action/cache/TransportSearchableSnapshotsNodeCachesStatsAction.java @@ -105,7 +105,7 @@ protected void resolveRequest(NodesRequest request, ClusterState clusterState) { final DiscoveryNode[] resolvedNodes; if (request.nodesIds() == null || request.nodesIds().length == 0) { - resolvedNodes = dataNodes.values().toArray(DiscoveryNode.class); + resolvedNodes = dataNodes.values().toArray(DiscoveryNode[]::new); } else { resolvedNodes = Arrays.stream(request.nodesIds()) .filter(dataNodes::containsKey) diff --git a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/allocation/SearchableSnapshotAllocator.java b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/allocation/SearchableSnapshotAllocator.java index 0cefbf6597b3f..3490cd6315529 100644 --- a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/allocation/SearchableSnapshotAllocator.java +++ b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/allocation/SearchableSnapshotAllocator.java @@ -398,7 +398,7 @@ private AsyncShardFetch.FetchResult fetchData(ShardRouti ); final AsyncCacheStatusFetch asyncFetch = asyncFetchStore.computeIfAbsent(shardId, sid -> new AsyncCacheStatusFetch()); final DiscoveryNodes nodes = allocation.nodes(); - final DiscoveryNode[] dataNodes = asyncFetch.addFetches(nodes.getDataNodes().values().toArray(DiscoveryNode.class)); + final DiscoveryNode[] dataNodes = asyncFetch.addFetches(nodes.getDataNodes().values().toArray(DiscoveryNode[]::new)); if (dataNodes.length > 0) { client.execute( TransportSearchableSnapshotCacheStoresAction.TYPE, diff --git a/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/ShrinkIndexWithSecurityTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/ShrinkIndexWithSecurityTests.java index f7bb459d7b31b..9bc77792fb8fb 100644 --- a/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/ShrinkIndexWithSecurityTests.java +++ b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/ShrinkIndexWithSecurityTests.java @@ -40,7 +40,7 @@ public void testShrinkIndex() throws Exception { ImmutableOpenMap dataNodes = client().admin().cluster().prepareState().get().getState().nodes() .getDataNodes(); - DiscoveryNode[] discoveryNodes = dataNodes.values().toArray(DiscoveryNode.class); + DiscoveryNode[] discoveryNodes = dataNodes.values().toArray(DiscoveryNode[]::new); final String mergeNode = discoveryNodes[0].getName(); ensureGreen(); // relocate all shards to one node such that we can merge it. diff --git a/x-pack/plugin/snapshot-repo-test-kit/src/main/java/org/elasticsearch/repositories/blobstore/testkit/RepositoryAnalyzeAction.java b/x-pack/plugin/snapshot-repo-test-kit/src/main/java/org/elasticsearch/repositories/blobstore/testkit/RepositoryAnalyzeAction.java index b369d28be3eea..91767c982fe6c 100644 --- a/x-pack/plugin/snapshot-repo-test-kit/src/main/java/org/elasticsearch/repositories/blobstore/testkit/RepositoryAnalyzeAction.java +++ b/x-pack/plugin/snapshot-repo-test-kit/src/main/java/org/elasticsearch/repositories/blobstore/testkit/RepositoryAnalyzeAction.java @@ -7,9 +7,6 @@ package org.elasticsearch.repositories.blobstore.testkit; -import com.carrotsearch.hppc.ObjectContainer; -import com.carrotsearch.hppc.cursors.ObjectCursor; - import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.message.ParameterizedMessage; @@ -59,6 +56,7 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collection; import java.util.Collections; import java.util.HashSet; import java.util.List; @@ -180,11 +178,11 @@ private static boolean isSnapshotNode(DiscoveryNode discoveryNode) { } private static List getSnapshotNodes(DiscoveryNodes discoveryNodes) { - final ObjectContainer nodesContainer = discoveryNodes.getMasterAndDataNodes().values(); - final List nodes = new ArrayList<>(nodesContainer.size()); - for (ObjectCursor cursor : nodesContainer) { - if (isSnapshotNode(cursor.value)) { - nodes.add(cursor.value); + final Collection nodesCollection = discoveryNodes.getMasterAndDataNodes().values(); + final List nodes = new ArrayList<>(nodesCollection.size()); + for (DiscoveryNode node : nodesCollection) { + if (isSnapshotNode(node)) { + nodes.add(node); } } return nodes; diff --git a/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateHttpMappingsTests.java b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateHttpMappingsTests.java index c22d0eff4c174..9743587ba92b7 100644 --- a/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateHttpMappingsTests.java +++ b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateHttpMappingsTests.java @@ -29,7 +29,6 @@ import org.junit.Before; import java.util.ArrayList; -import java.util.Iterator; import java.util.List; import java.util.Map; @@ -158,9 +157,7 @@ public void testExceptionMapping() { // ensure that enabled is set to false List indexed = new ArrayList<>(); GetMappingsResponse mappingsResponse = client().admin().indices().prepareGetMappings(HistoryStoreField.INDEX_PREFIX + "*").get(); - Iterator iterator = mappingsResponse.getMappings().valuesIt(); - while (iterator.hasNext()) { - MappingMetadata mapping = iterator.next(); + for (MappingMetadata mapping : mappingsResponse.getMappings().values()) { Map docMapping = mapping.getSourceAsMap(); if (abortAtInput) { Boolean enabled = ObjectPath.eval("properties.result.properties.input.properties.error.enabled", docMapping); diff --git a/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/integration/HistoryIntegrationTests.java b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/integration/HistoryIntegrationTests.java index 5beb3b6de7c5f..2360275845d3b 100644 --- a/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/integration/HistoryIntegrationTests.java +++ b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/integration/HistoryIntegrationTests.java @@ -105,7 +105,7 @@ public void testFailedInputResultWithDotsInFieldNameGetsStored() throws Exceptio // as fields with dots are allowed in 5.0 again, the mapping must be checked in addition GetMappingsResponse response = client().admin().indices().prepareGetMappings(".watcher-history*").get(); XContentSource source = new XContentSource( - response.getMappings().values().iterator().next().value.source().uncompressed(), XContentType.JSON); + response.getMappings().valuesIt().next().source().uncompressed(), XContentType.JSON); // lets make sure the body fields are disabled if (useChained) { String chainedPath = SINGLE_MAPPING_NAME + @@ -146,7 +146,7 @@ public void testPayloadInputWithDotsInFieldNameWorks() throws Exception { // as fields with dots are allowed in 5.0 again, the mapping must be checked in addition GetMappingsResponse response = client().admin().indices().prepareGetMappings(".watcher-history*").get(); XContentSource source = new XContentSource( - response.getMappings().values().iterator().next().value.source().uncompressed(), XContentType.JSON); + response.getMappings().valuesIt().next().source().uncompressed(), XContentType.JSON); // lets make sure the body fields are disabled if (useChained) { @@ -203,7 +203,7 @@ public void testThatHistoryContainsStatus() throws Exception { // also ensure that the status field is disabled in the watch history GetMappingsResponse response = client().admin().indices().prepareGetMappings(".watcher-history*").get(); XContentSource mappingSource = - new XContentSource(response.getMappings().values().iterator().next().value.source().uncompressed(), XContentType.JSON); + new XContentSource(response.getMappings().valuesIt().next().source().uncompressed(), XContentType.JSON); assertThat(mappingSource.getValue(SINGLE_MAPPING_NAME + ".properties.status.enabled"), is(false)); assertThat(mappingSource.getValue(SINGLE_MAPPING_NAME + ".properties.status.properties.status"), is(nullValue())); assertThat(mappingSource.getValue(SINGLE_MAPPING_NAME + ".properties.status.properties.status.properties.active"), is(nullValue())); From 185662f09c769d38bc57491a78810e3397de94cb Mon Sep 17 00:00:00 2001 From: Benjamin Trent Date: Tue, 5 Oct 2021 11:03:11 -0400 Subject: [PATCH 169/250] [ML] adding some new test hooks for inference results testing (#78694) New testing scaffolding for inference ingest testing and a bug fix for text embedding inference results --- .../ClassificationInferenceResults.java | 5 ++ .../inference/results/InferenceResults.java | 2 + .../core/ml/inference/results/NerResults.java | 1 + .../results/PyTorchPassThroughResults.java | 5 ++ .../results/RawInferenceResults.java | 7 ++ .../results/RegressionInferenceResults.java | 5 ++ .../results/TextEmbeddingResults.java | 10 ++- .../results/WarningInferenceResults.java | 5 ++ .../ClassificationInferenceResultsTests.java | 60 +++++----------- .../results/InferenceResultsTestCase.java | 72 +++++++++++++++++++ .../ml/inference/results/NerResultsTests.java | 42 +++++++++-- .../PyTorchPassThroughResultsTests.java | 12 +++- .../RegressionInferenceResultsTests.java | 26 +++---- .../results/TextEmbeddingResultsTests.java | 12 +++- .../results/WarningInferenceResultsTests.java | 41 ++--------- 15 files changed, 201 insertions(+), 104 deletions(-) create mode 100644 x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/InferenceResultsTestCase.java diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/ClassificationInferenceResults.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/ClassificationInferenceResults.java index fa98f62daed7a..502d7bdc2641d 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/ClassificationInferenceResults.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/ClassificationInferenceResults.java @@ -196,6 +196,11 @@ public Double getPredictionScore() { return predictionScore; } + @Override + public String getResultsField() { + return resultsField; + } + @Override public Map asMap() { Map map = new LinkedHashMap<>(); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/InferenceResults.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/InferenceResults.java index 0f34c4b7f7b88..443d741346fa3 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/InferenceResults.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/InferenceResults.java @@ -30,6 +30,8 @@ static void writeResult(InferenceResults results, IngestDocument ingestDocument, } } + String getResultsField(); + Map asMap(); Object predictedValue(); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/NerResults.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/NerResults.java index 582fd31604030..5fdf455369be2 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/NerResults.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/NerResults.java @@ -83,6 +83,7 @@ public List getEntityGroups() { return entityGroups; } + @Override public String getResultsField() { return resultsField; } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/PyTorchPassThroughResults.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/PyTorchPassThroughResults.java index 36985ce7f7301..0b532412822f3 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/PyTorchPassThroughResults.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/PyTorchPassThroughResults.java @@ -55,6 +55,11 @@ public void writeTo(StreamOutput out) throws IOException { out.writeString(resultsField); } + @Override + public String getResultsField() { + return resultsField; + } + @Override public Map asMap() { Map map = new LinkedHashMap<>(); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/RawInferenceResults.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/RawInferenceResults.java index 7e5f73b7b6165..9713a001f77cf 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/RawInferenceResults.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/RawInferenceResults.java @@ -14,6 +14,8 @@ import java.util.Map; import java.util.Objects; +import static org.elasticsearch.xpack.core.ml.inference.trainedmodel.InferenceConfig.DEFAULT_RESULTS_FIELD; + public class RawInferenceResults implements InferenceResults { public static final String NAME = "raw"; @@ -53,6 +55,11 @@ public int hashCode() { return Objects.hash(Arrays.hashCode(value), featureImportance); } + @Override + public String getResultsField() { + return DEFAULT_RESULTS_FIELD; + } + @Override public Map asMap() { throw new UnsupportedOperationException("[raw] does not support map conversion"); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/RegressionInferenceResults.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/RegressionInferenceResults.java index 8a08752aea5d0..737b7b4aca367 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/RegressionInferenceResults.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/RegressionInferenceResults.java @@ -104,6 +104,11 @@ public Object predictedValue() { return super.value(); } + @Override + public String getResultsField() { + return resultsField; + } + @Override public Map asMap() { Map map = new LinkedHashMap<>(); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/TextEmbeddingResults.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/TextEmbeddingResults.java index fc65980c22c53..d83991b1a2c41 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/TextEmbeddingResults.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/TextEmbeddingResults.java @@ -13,7 +13,7 @@ import java.io.IOException; import java.util.Arrays; -import java.util.Collections; +import java.util.LinkedHashMap; import java.util.Map; import java.util.Objects; @@ -34,6 +34,10 @@ public TextEmbeddingResults(StreamInput in) throws IOException { resultsField = in.readString(); } + public String getResultsField() { + return resultsField; + } + public double[] getInference() { return inference; } @@ -56,7 +60,9 @@ public void writeTo(StreamOutput out) throws IOException { @Override public Map asMap() { - return Collections.singletonMap(resultsField, inference); + Map map = new LinkedHashMap<>(); + map.put(resultsField, inference); + return map; } @Override diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/WarningInferenceResults.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/WarningInferenceResults.java index 59c250e595096..65b20572d3de2 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/WarningInferenceResults.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/WarningInferenceResults.java @@ -58,6 +58,11 @@ public int hashCode() { return Objects.hash(warning); } + @Override + public String getResultsField() { + return NAME; + } + @Override public Map asMap() { Map asMap = new LinkedHashMap<>(); diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/ClassificationInferenceResultsTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/ClassificationInferenceResultsTests.java index d03e17b648fc2..5bc9295ec01a7 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/ClassificationInferenceResultsTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/ClassificationInferenceResultsTests.java @@ -9,7 +9,6 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.ingest.IngestDocument; -import org.elasticsearch.test.AbstractWireSerializingTestCase; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.ClassificationConfig; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.ClassificationConfigTests; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.PredictionFieldType; @@ -26,11 +25,11 @@ import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasSize; -public class ClassificationInferenceResultsTests extends AbstractWireSerializingTestCase { +public class ClassificationInferenceResultsTests extends InferenceResultsTestCase { public static ClassificationInferenceResults createRandomResults() { ClassificationConfig config = ClassificationConfigTests.randomClassificationConfig(); - Double value = randomDouble(); + double value = randomDouble(); if (config.getPredictionFieldType() == PredictionFieldType.BOOLEAN) { // value must be close to 0 or 1 value = randomBoolean() ? 0.0 : 1.0; @@ -51,46 +50,6 @@ public static ClassificationInferenceResults createRandomResults() { randomBoolean() ? null : randomDoubleBetween(0.0, 1.0, false)); } - public void testWriteResultsWithClassificationLabel() { - ClassificationInferenceResults result = - new ClassificationInferenceResults(1.0, - "foo", - Collections.emptyList(), - Collections.emptyList(), - ClassificationConfig.EMPTY_PARAMS, - 1.0, - 1.0); - IngestDocument document = new IngestDocument(new HashMap<>(), new HashMap<>()); - writeResult(result, document, "result_field", "test"); - - assertThat(document.getFieldValue("result_field.predicted_value", String.class), equalTo("foo")); - } - - public void testWriteResultsWithoutClassificationLabel() { - ClassificationInferenceResults result = new ClassificationInferenceResults(1.0, - null, - Collections.emptyList(), - Collections.emptyList(), - ClassificationConfig.EMPTY_PARAMS, - 1.0, - 1.0); - IngestDocument document = new IngestDocument(new HashMap<>(), new HashMap<>()); - writeResult(result, document, "result_field", "test"); - - assertThat(document.getFieldValue("result_field.predicted_value", String.class), equalTo("1.0")); - - result = new ClassificationInferenceResults(2.0, - null, - Collections.emptyList(), - Collections.emptyList(), - ClassificationConfig.EMPTY_PARAMS, - 1.0, - 1.0); - writeResult(result, document, "result_field", "test"); - assertThat(document.getFieldValue("result_field.0.predicted_value", String.class), equalTo("1.0")); - assertThat(document.getFieldValue("result_field.1.predicted_value", String.class), equalTo("2.0")); - } - @SuppressWarnings("unchecked") public void testWriteResultsWithTopClasses() { List entries = Arrays.asList( @@ -227,6 +186,21 @@ public void testToXContent() { stringRep = Strings.toString(result); expected = "{\"predicted_value\":\"label1\",\"prediction_probability\":1.0,\"prediction_score\":1.0}"; assertEquals(expected, stringRep); + } + @Override + void assertFieldValues(ClassificationInferenceResults createdInstance, IngestDocument document, String resultsField) { + String path = resultsField + "." + createdInstance.getResultsField(); + switch (createdInstance.getPredictionFieldType()) { + case NUMBER: + assertThat(document.getFieldValue(path, Double.class), equalTo(createdInstance.predictedValue())); + break; + case STRING: + assertThat(document.getFieldValue(path, String.class), equalTo(createdInstance.predictedValue())); + break; + case BOOLEAN: + assertThat(document.getFieldValue(path, Boolean.class), equalTo(createdInstance.predictedValue())); + break; + } } } diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/InferenceResultsTestCase.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/InferenceResultsTestCase.java new file mode 100644 index 0000000000000..0a06eafbc7697 --- /dev/null +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/InferenceResultsTestCase.java @@ -0,0 +1,72 @@ +/* + * 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.core.ml.inference.results; + +import org.elasticsearch.Version; +import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.ingest.IngestDocument; +import org.elasticsearch.test.AbstractWireSerializingTestCase; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +abstract class InferenceResultsTestCase extends AbstractWireSerializingTestCase { + + public void testWriteToIngestDoc() throws IOException { + for (int i = 0 ; i < NUMBER_OF_TEST_RUNS; ++i) { + T inferenceResult = createTestInstance(); + if (randomBoolean()) { + inferenceResult = copyInstance(inferenceResult, Version.CURRENT); + } + IngestDocument document = new IngestDocument(new HashMap<>(), new HashMap<>()); + String parentField = randomAlphaOfLength(10); + String modelId = randomAlphaOfLength(10); + boolean alreadyHasResult = randomBoolean(); + if (alreadyHasResult) { + document.setFieldValue(parentField, Map.of()); + } + InferenceResults.writeResult(inferenceResult, document, parentField, modelId); + assertFieldValues(inferenceResult, document, alreadyHasResult ? parentField + ".1" : parentField); + } + } + + abstract void assertFieldValues(T createdInstance, IngestDocument document, String resultsField); + + public void testWriteToDocAndSerialize() throws IOException { + for (int i = 0 ; i < NUMBER_OF_TEST_RUNS; ++i) { + T inferenceResult = createTestInstance(); + if (randomBoolean()) { + inferenceResult = copyInstance(inferenceResult, Version.CURRENT); + } + IngestDocument document = new IngestDocument(new HashMap<>(), new HashMap<>()); + String parentField = randomAlphaOfLength(10); + String modelId = randomAlphaOfLength(10); + boolean alreadyHasResult = randomBoolean(); + if (alreadyHasResult) { + document.setFieldValue(parentField, Map.of()); + } + InferenceResults.writeResult(inferenceResult, document, parentField, modelId); + try (XContentBuilder builder = XContentFactory.jsonBuilder()) { + builder.startObject(); + Map metadataMap = document.getMetadata(); + for (Map.Entry metadata : metadataMap.entrySet()) { + if (metadata.getValue() != null) { + builder.field(metadata.getKey().getFieldName(), metadata.getValue().toString()); + } + } + Map source = IngestDocument.deepCopyMap(document.getSourceAndMetadata()); + metadataMap.keySet().forEach(mD -> source.remove(mD.getFieldName())); + builder.field("_source", source); + builder.field("_ingest", document.getIngestMetadata()); + builder.endObject(); + } + } + } +} diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/NerResultsTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/NerResultsTests.java index 676aa35d01a5c..a5ab1147fd520 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/NerResultsTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/NerResultsTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.core.ml.inference.results; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.test.AbstractWireSerializingTestCase; +import org.elasticsearch.ingest.IngestDocument; import java.util.List; import java.util.Map; @@ -19,7 +19,7 @@ import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasSize; -public class NerResultsTests extends AbstractWireSerializingTestCase { +public class NerResultsTests extends InferenceResultsTestCase { @Override protected Writeable.Reader instanceReader() { return NerResults::new; @@ -50,9 +50,10 @@ public void testAsMap() { NerResults testInstance = createTestInstance(); Map asMap = testInstance.asMap(); List> resultList = (List>)asMap.get(ENTITY_FIELD); - if (resultList != null) { - assertThat(resultList, hasSize(testInstance.getEntityGroups().size())); + if (resultList == null) { + return; } + assertThat(resultList, hasSize(testInstance.getEntityGroups().size())); assertThat(asMap.get(testInstance.getResultsField()), equalTo(testInstance.getAnnotatedResult())); for (int i = 0; i < testInstance.getEntityGroups().size(); i++) { NerResults.EntityGroup entity = testInstance.getEntityGroups().get(i); @@ -70,4 +71,37 @@ public void testAsMap() { } } } + + @Override + @SuppressWarnings("unchecked") + void assertFieldValues(NerResults createdInstance, IngestDocument document, String resultsField) { + assertThat( + document.getFieldValue(resultsField + "." + createdInstance.getResultsField(), String.class), + equalTo(createdInstance.getAnnotatedResult()) + ); + + if (createdInstance.getEntityGroups().size() > 0) { + List> resultList = (List>) document.getFieldValue( + resultsField + "." + ENTITY_FIELD, + List.class + ); + assertThat(resultList.size(), equalTo(createdInstance.getEntityGroups().size())); + for (int i = 0; i < createdInstance.getEntityGroups().size(); i++) { + NerResults.EntityGroup entity = createdInstance.getEntityGroups().get(i); + Map map = resultList.get(i); + assertThat(map.get(NerResults.EntityGroup.CLASS_NAME), equalTo(entity.getClassName())); + assertThat(map.get("entity"), equalTo(entity.getEntity())); + assertThat(map.get(NerResults.EntityGroup.CLASS_PROBABILITY), equalTo(entity.getClassProbability())); + Integer startPos = (Integer)map.get(NerResults.EntityGroup.START_POS); + Integer endPos = (Integer)map.get(NerResults.EntityGroup.END_POS); + if (startPos != null) { + assertThat(startPos, equalTo(entity.getStartPos())); + } + if (endPos != null) { + assertThat(endPos, equalTo(entity.getEndPos())); + } + } + } + } + } diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/PyTorchPassThroughResultsTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/PyTorchPassThroughResultsTests.java index d7ca81547baa9..9a48cf72c0f4b 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/PyTorchPassThroughResultsTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/PyTorchPassThroughResultsTests.java @@ -8,14 +8,14 @@ package org.elasticsearch.xpack.core.ml.inference.results; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.test.AbstractWireSerializingTestCase; +import org.elasticsearch.ingest.IngestDocument; import java.util.Map; import static org.elasticsearch.xpack.core.ml.inference.trainedmodel.InferenceConfig.DEFAULT_RESULTS_FIELD; import static org.hamcrest.Matchers.hasSize; -public class PyTorchPassThroughResultsTests extends AbstractWireSerializingTestCase { +public class PyTorchPassThroughResultsTests extends InferenceResultsTestCase { @Override protected Writeable.Reader instanceReader() { return PyTorchPassThroughResults::new; @@ -41,4 +41,12 @@ public void testAsMap() { assertThat(asMap.keySet(), hasSize(1)); assertArrayEquals(testInstance.getInference(), (double[][]) asMap.get(DEFAULT_RESULTS_FIELD)); } + + @Override + void assertFieldValues(PyTorchPassThroughResults createdInstance, IngestDocument document, String resultsField) { + assertArrayEquals( + createdInstance.getInference(), + document.getFieldValue(resultsField + "." + createdInstance.getResultsField(), double[][].class) + ); + } } diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/RegressionInferenceResultsTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/RegressionInferenceResultsTests.java index 71bcfd157961d..9fda627abd8ea 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/RegressionInferenceResultsTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/RegressionInferenceResultsTests.java @@ -9,7 +9,6 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.ingest.IngestDocument; -import org.elasticsearch.test.AbstractWireSerializingTestCase; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.RegressionConfig; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.RegressionConfigTests; @@ -21,11 +20,12 @@ import java.util.stream.Stream; import static org.elasticsearch.xpack.core.ml.inference.results.InferenceResults.writeResult; +import static org.hamcrest.Matchers.closeTo; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasSize; -public class RegressionInferenceResultsTests extends AbstractWireSerializingTestCase { +public class RegressionInferenceResultsTests extends InferenceResultsTestCase { public static RegressionInferenceResults createRandomResults() { return new RegressionInferenceResults(randomDouble(), @@ -36,20 +36,6 @@ public static RegressionInferenceResults createRandomResults() { .collect(Collectors.toList())); } - public void testWriteResults() { - RegressionInferenceResults result = new RegressionInferenceResults(0.3, RegressionConfig.EMPTY_PARAMS); - IngestDocument document = new IngestDocument(new HashMap<>(), new HashMap<>()); - writeResult(result, document, "result_field", "test"); - - assertThat(document.getFieldValue("result_field.predicted_value", Double.class), equalTo(0.3)); - - result = new RegressionInferenceResults(0.5, RegressionConfig.EMPTY_PARAMS); - writeResult(result, document, "result_field", "test"); - - assertThat(document.getFieldValue("result_field.0.predicted_value", Double.class), equalTo(0.3)); - assertThat(document.getFieldValue("result_field.1.predicted_value", Double.class), equalTo(0.5)); - } - public void testWriteResultsWithImportance() { List importanceList = Stream.generate(RegressionFeatureImportanceTests::createRandomInstance) .limit(5) @@ -99,4 +85,12 @@ public void testToXContent() { expected = "{\"" + resultsField + "\":1.0,\"feature_importance\":[{\"feature_name\":\"foo\",\"importance\":1.0}]}"; assertEquals(expected, stringRep); } + + @Override + void assertFieldValues(RegressionInferenceResults createdInstance, IngestDocument document, String resultsField) { + assertThat( + document.getFieldValue(resultsField + "." + createdInstance.getResultsField(), Double.class), + closeTo(createdInstance.value(), 1e-10) + ); + } } diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/TextEmbeddingResultsTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/TextEmbeddingResultsTests.java index fc0608df28359..8d9e0834d81b0 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/TextEmbeddingResultsTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/TextEmbeddingResultsTests.java @@ -8,14 +8,14 @@ package org.elasticsearch.xpack.core.ml.inference.results; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.test.AbstractWireSerializingTestCase; +import org.elasticsearch.ingest.IngestDocument; import java.util.Map; import static org.elasticsearch.xpack.core.ml.inference.trainedmodel.InferenceConfig.DEFAULT_RESULTS_FIELD; import static org.hamcrest.Matchers.hasSize; -public class TextEmbeddingResultsTests extends AbstractWireSerializingTestCase { +public class TextEmbeddingResultsTests extends InferenceResultsTestCase { @Override protected Writeable.Reader instanceReader() { return TextEmbeddingResults::new; @@ -38,4 +38,12 @@ public void testAsMap() { assertThat(asMap.keySet(), hasSize(1)); assertArrayEquals(testInstance.getInference(), (double[]) asMap.get(DEFAULT_RESULTS_FIELD), 1e-10); } + + @Override + void assertFieldValues(TextEmbeddingResults createdInstance, IngestDocument document, String resultsField) { + assertArrayEquals( + document.getFieldValue(resultsField + "." + createdInstance.getResultsField(), double[].class), + createdInstance.getInference(), 1e-10 + ); + } } diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/WarningInferenceResultsTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/WarningInferenceResultsTests.java index 76d931e0bd9f9..2c5cc3dcdb32a 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/WarningInferenceResultsTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/WarningInferenceResultsTests.java @@ -6,49 +6,17 @@ */ package org.elasticsearch.xpack.core.ml.inference.results; -import org.elasticsearch.common.xcontent.ParseField; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.ingest.IngestDocument; -import org.elasticsearch.test.AbstractSerializingTestCase; -import java.io.IOException; -import java.util.HashMap; - -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.xpack.core.ml.inference.results.InferenceResults.writeResult; import static org.hamcrest.Matchers.equalTo; -public class WarningInferenceResultsTests extends AbstractSerializingTestCase { - - private static final ConstructingObjectParser PARSER = - new ConstructingObjectParser<>("inference_warning", - a -> new WarningInferenceResults((String) a[0]) - ); - - static { - PARSER.declareString(constructorArg(), new ParseField(WarningInferenceResults.NAME)); - } +public class WarningInferenceResultsTests extends InferenceResultsTestCase { public static WarningInferenceResults createRandomResults() { return new WarningInferenceResults(randomAlphaOfLength(10)); } - public void testWriteResults() { - WarningInferenceResults result = new WarningInferenceResults("foo"); - IngestDocument document = new IngestDocument(new HashMap<>(), new HashMap<>()); - writeResult(result, document, "result_field", "test"); - - assertThat(document.getFieldValue("result_field.warning", String.class), equalTo("foo")); - - result = new WarningInferenceResults("bar"); - writeResult(result, document, "result_field", "test"); - - assertThat(document.getFieldValue("result_field.0.warning", String.class), equalTo("foo")); - assertThat(document.getFieldValue("result_field.1.warning", String.class), equalTo("bar")); - } - @Override protected WarningInferenceResults createTestInstance() { return createRandomResults(); @@ -60,7 +28,10 @@ protected Writeable.Reader instanceReader() { } @Override - protected WarningInferenceResults doParseInstance(XContentParser parser) throws IOException { - return PARSER.apply(parser, null); + void assertFieldValues(WarningInferenceResults createdInstance, IngestDocument document, String resultsField) { + assertThat( + document.getFieldValue(resultsField + ".warning", String.class), + equalTo(createdInstance.getWarning()) + ); } } From 3cbb265f9d6207540673f63bf4a7a00d864fe3e8 Mon Sep 17 00:00:00 2001 From: Armin Braun Date: Tue, 5 Oct 2021 17:15:46 +0200 Subject: [PATCH 170/250] Store Disk Threshold Ignore Setting in IndexMetadata (#78672) Speed up disk threshold allocation decider by storing the ignore flag directly in the index metadata. Also, make the relocating shards size estimate more effective. --- .../cluster/metadata/IndexMetadata.java | 15 +++++++++++++-- .../allocation/decider/DiskThresholdDecider.java | 12 ++++++------ 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/IndexMetadata.java b/server/src/main/java/org/elasticsearch/cluster/metadata/IndexMetadata.java index b3b4fd4cd9710..98f8dea776ace 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/IndexMetadata.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/IndexMetadata.java @@ -25,6 +25,7 @@ import org.elasticsearch.cluster.node.DiscoveryNodeFilters; import org.elasticsearch.cluster.routing.IndexRouting; import org.elasticsearch.cluster.routing.allocation.IndexMetadataUpdater; +import org.elasticsearch.cluster.routing.allocation.decider.DiskThresholdDecider; import org.elasticsearch.common.collect.ImmutableOpenIntMap; import org.elasticsearch.common.collect.ImmutableOpenMap; import org.elasticsearch.common.collect.MapBuilder; @@ -397,6 +398,8 @@ public static APIBlock readFrom(StreamInput input) throws IOException { private final long creationDate; + private final boolean ignoreDiskWatermarks; + private IndexMetadata( final Index index, final long version, @@ -425,7 +428,9 @@ private IndexMetadata( final boolean isHidden, final IndexLongFieldRange timestampRange, final int priority, - final long creationDate) { + final long creationDate, + final boolean ignoreDiskWatermarks + ) { this.index = index; this.version = version; @@ -462,6 +467,7 @@ private IndexMetadata( this.timestampRange = timestampRange; this.priority = priority; this.creationDate = creationDate; + this.ignoreDiskWatermarks = ignoreDiskWatermarks; assert numberOfShards * routingFactor == routingNumShards : routingNumShards + " must be a multiple of " + numberOfShards; } @@ -556,6 +562,10 @@ public ActiveShardCount getWaitForActiveShards() { return waitForActiveShards; } + public boolean ignoreDiskWatermarks() { + return ignoreDiskWatermarks; + } + public Settings getSettings() { return settings; } @@ -1329,7 +1339,8 @@ public IndexMetadata build() { INDEX_HIDDEN_SETTING.get(settings), timestampRange, IndexMetadata.INDEX_PRIORITY_SETTING.get(settings), - settings.getAsLong(SETTING_CREATION_DATE, -1L) + settings.getAsLong(SETTING_CREATION_DATE, -1L), + DiskThresholdDecider.SETTING_IGNORE_DISK_WATERMARKS.get(settings) ); } diff --git a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/DiskThresholdDecider.java b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/DiskThresholdDecider.java index 34d234c1f9ff7..5f8bf439e2960 100644 --- a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/DiskThresholdDecider.java +++ b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/DiskThresholdDecider.java @@ -35,7 +35,6 @@ import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.snapshots.SnapshotShardSizeInfo; -import java.util.List; import java.util.Set; import static org.elasticsearch.cluster.routing.allocation.DiskThresholdSettings.CLUSTER_ROUTING_ALLOCATION_HIGH_DISK_WATERMARK_SETTING; @@ -113,15 +112,16 @@ public static long sizeOfRelocatingShards(RoutingNode node, boolean subtractShar // no longer initializing because their recovery failed or was cancelled. // Where reserved space is unavailable (e.g. stats are out-of-sync) compute a conservative estimate for initialising shards - final List initializingShards = node.shardsWithState(ShardRoutingState.INITIALIZING); - initializingShards.removeIf(shardRouting -> reservedSpace.containsShardId(shardRouting.shardId())); - for (ShardRouting routing : initializingShards) { + for (ShardRouting routing : node.shardsWithState(ShardRoutingState.INITIALIZING)) { if (routing.relocatingNodeId() == null) { // in practice the only initializing-but-not-relocating shards with a nonzero expected shard size will be ones created // by a resize (shrink/split/clone) operation which we expect to happen using hard links, so they shouldn't be taking // any additional space and can be ignored here continue; } + if (reservedSpace.containsShardId(routing.shardId())) { + continue; + } final String actualPath = clusterInfo.getDataPath(routing); // if we don't yet know the actual path of the incoming shard then conservatively assume it's going to the path with the least @@ -161,7 +161,7 @@ public Decision canAllocate(ShardRouting shardRouting, RoutingNode node, Routing return decision; } - if (SETTING_IGNORE_DISK_WATERMARKS.get(allocation.metadata().index(shardRouting.index()).getSettings())) { + if (allocation.metadata().index(shardRouting.index()).ignoreDiskWatermarks()) { return YES_DISK_WATERMARKS_IGNORED; } @@ -332,7 +332,7 @@ public Decision canRemain(ShardRouting shardRouting, RoutingNode node, RoutingAl return decision; } - if (SETTING_IGNORE_DISK_WATERMARKS.get(allocation.metadata().index(shardRouting.index()).getSettings())) { + if (allocation.metadata().index(shardRouting.index()).ignoreDiskWatermarks()) { return YES_DISK_WATERMARKS_IGNORED; } From 841c544921dec31d5797509f3103198305d60d16 Mon Sep 17 00:00:00 2001 From: Mark Vieira Date: Tue, 5 Oct 2021 10:08:26 -0700 Subject: [PATCH 171/250] Ensure rest snippets task output directory is cleaned before execution (#78653) --- .../elasticsearch/gradle/internal/doc/DocsTestPlugin.groovy | 3 +++ .../gradle/internal/doc/RestTestsFromSnippetsTask.groovy | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/build-tools-internal/src/main/groovy/org/elasticsearch/gradle/internal/doc/DocsTestPlugin.groovy b/build-tools-internal/src/main/groovy/org/elasticsearch/gradle/internal/doc/DocsTestPlugin.groovy index 2d68538c0ccb3..73981d408f871 100644 --- a/build-tools-internal/src/main/groovy/org/elasticsearch/gradle/internal/doc/DocsTestPlugin.groovy +++ b/build-tools-internal/src/main/groovy/org/elasticsearch/gradle/internal/doc/DocsTestPlugin.groovy @@ -66,6 +66,9 @@ class DocsTestPlugin implements Plugin { TaskProvider buildRestTests = project.tasks.register('buildRestTests', RestTestsFromSnippetsTask) { defaultSubstitutions = commonDefaultSubstitutions testRoot.convention(restRootDir) + doFirst { + project.delete(restRootDir) + } } // TODO: This effectively makes testRoot not customizable, which we don't do anyway atm diff --git a/build-tools-internal/src/main/groovy/org/elasticsearch/gradle/internal/doc/RestTestsFromSnippetsTask.groovy b/build-tools-internal/src/main/groovy/org/elasticsearch/gradle/internal/doc/RestTestsFromSnippetsTask.groovy index cf551f6ee04f3..4b789b2c85e8c 100644 --- a/build-tools-internal/src/main/groovy/org/elasticsearch/gradle/internal/doc/RestTestsFromSnippetsTask.groovy +++ b/build-tools-internal/src/main/groovy/org/elasticsearch/gradle/internal/doc/RestTestsFromSnippetsTask.groovy @@ -68,7 +68,6 @@ class RestTestsFromSnippetsTask extends SnippetsTask { RestTestsFromSnippetsTask(ObjectFactory objectFactory) { testRoot = objectFactory.directoryProperty() TestBuilder builder = new TestBuilder() - doFirst { outputRoot().delete() } perSnippet builder.&handleSnippet doLast builder.&checkUnconverted doLast builder.&finishLastTest From a74573be9ec02e61b55621f3a91af3b167951e30 Mon Sep 17 00:00:00 2001 From: Mayya Sharipova Date: Tue, 5 Oct 2021 13:21:39 -0400 Subject: [PATCH 172/250] Expand segment sorter for all timeseries indices (#78639) PR #75195 added segment sorter on @timestamp desc for datastream indices. This PR applies segment sorter to all indices that have @timestamp field. The presence of @timestamp field can serve as a strong indication that we are dealing with timeseries indices. The most common type of query for timeseries indices is to get the latest data, that is data sorted by @timestamp desc. This PR sorts segments by @timestamp desc which allows to speed up this kind of queries. Relates to #75195 --- .../search/380_sort_segments_on_timestamp.yml | 139 ++++++++++++++++++ .../cluster/metadata/DataStream.java | 16 +- .../index/mapper/MappingLookup.java | 14 ++ .../elasticsearch/index/shard/IndexShard.java | 13 +- ...1_sort_segments_migrate_to_data_stream.yml | 111 -------------- x-pack/qa/runtime-fields/build.gradle | 2 + 6 files changed, 176 insertions(+), 119 deletions(-) create mode 100644 rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/search/380_sort_segments_on_timestamp.yml delete mode 100644 x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/131_sort_segments_migrate_to_data_stream.yml diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/search/380_sort_segments_on_timestamp.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/search/380_sort_segments_on_timestamp.yml new file mode 100644 index 0000000000000..8a1f6b03ef8b1 --- /dev/null +++ b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/search/380_sort_segments_on_timestamp.yml @@ -0,0 +1,139 @@ +--- +"Test that index segments are sorted on timestamp field if @timestamp field is defined in mapping": + - skip: + version: " - 7.99.99" + reason: "sorting segments was added in 7.16" + features: allowed_warnings + + - do: + indices.create: + index: test_index1 + body: + mappings: + properties: + "@timestamp": + type: date + settings: + number_of_shards: 1 + number_of_replicas: 0 + + # 1st segment + - do: + index: + index: test_index1 + body: { "foo": "bar1", "@timestamp": "2021-08-01" } + refresh: true + + # 2nd segment + - do: + index: + index: test_index1 + body: { "foo": "bar2", "@timestamp": "2021-08-02" } + refresh: true + + # test that segments are sorted by @timestamp DESC + - do: + search: + index: test_index1 + body: + fields: [{ "field":"@timestamp", "format":"yyyy-MM-dd" }] + - match: { hits.total.value: 2 } + - match: { hits.hits.0.fields.@timestamp: ["2021-08-02"] } + - match: { hits.hits.1.fields.@timestamp: ["2021-08-01"] } + +--- +"Test that index segments are NOT sorted on timestamp field when @timestamp field is dynamically added": + - skip: + version: " - 7.99.99" + reason: "sorting segments was added in 7.16" + features: allowed_warnings + + - do: + indices.create: + index: test_index2 + body: + settings: + number_of_shards: 1 + number_of_replicas: 0 + + # 1st segment + - do: + index: + index: test_index2 + body: { "foo": "bar1", "@timestamp": "2021-08-01" } + refresh: true + + # 2nd segment + - do: + index: + index: test_index2 + body: { "foo": "bar2", "@timestamp": "2021-08-02" } + refresh: true + + # test that segments are NOT sorted by @timestamp DESC as the field was not + - do: + search: + index: test_index2 + body: + fields: [{ "field":"@timestamp", "format":"yyyy-MM-dd" }] + - match: { hits.hits.0.fields.@timestamp: ["2021-08-01"] } + - match: { hits.hits.1.fields.@timestamp: ["2021-08-02"] } + + # test that after we reopen the index, segments are sorted by @timestamp DESC + - do: + indices.close: + index: test_index2 + - is_true: acknowledged + - do: + indices.open: + index: test_index2 + - is_true: acknowledged + - do: + search: + index: test_index2 + body: + fields: [{ "field":"@timestamp", "format":"yyyy-MM-dd" }] + - match: { hits.total.value: 2 } + - match: { hits.hits.0.fields.@timestamp: ["2021-08-02"] } + - match: { hits.hits.1.fields.@timestamp: ["2021-08-01"] } + +--- +"Test if segments are missing @timestamp field we don't get errors": + - skip: + version: " - 7.99.99" + reason: "sorting segments was added in 7.16" + features: allowed_warnings + + - do: + indices.create: + index: test_index3 + body: + mappings: + properties: + "@timestamp": + type: date + settings: + number_of_shards: 1 + number_of_replicas: 0 + + # 1st segment missing @timestamp field + - do: + index: + index: test_index3 + body: { "foo": "bar1"} + refresh: true + + # 2nd segment + - do: + index: + index: test_index3 + body: { "foo": "bar2", "@timestamp": "2021-08-02" } + refresh: true + + - do: + search: + index: test_index3 + body: + fields: [{ "field":"@timestamp", "format":"yyyy-MM-dd" }] + - match: { hits.hits.0.fields.@timestamp: ["2021-08-02"] } + - is_false: hits.hits.1.fields.@timestamp diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/DataStream.java b/server/src/main/java/org/elasticsearch/cluster/metadata/DataStream.java index de446504f1a40..d6e074f481635 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/DataStream.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/DataStream.java @@ -10,6 +10,7 @@ import org.apache.lucene.document.LongPoint; import org.apache.lucene.index.LeafReader; import org.apache.lucene.index.PointValues; +import org.elasticsearch.ElasticsearchException; import org.elasticsearch.cluster.AbstractDiffable; import org.elasticsearch.cluster.Diff; import org.elasticsearch.common.Strings; @@ -42,8 +43,8 @@ public final class DataStream extends AbstractDiffable implements To public static final String BACKING_INDEX_PREFIX = ".ds-"; public static final DateFormatter DATE_FORMATTER = DateFormatter.forPattern("uuuu.MM.dd"); - // Datastreams' leaf readers should be sorted by desc order of their timestamp field, as it allows search time optimizations - public static Comparator DATASTREAM_LEAF_READERS_SORTER = + // Timeseries indices' leaf readers should be sorted by desc order of their timestamp field, as it allows search time optimizations + public static Comparator TIMESERIES_LEAF_READERS_SORTER = Comparator.comparingLong( (LeafReader r) -> { try { @@ -51,14 +52,17 @@ public final class DataStream extends AbstractDiffable implements To if (points != null) { byte[] sortValue = points.getMaxPackedValue(); return LongPoint.decodeDimension(sortValue, 0); - } else if (r.numDocs() == 0) { - // points can be null if the segment contains only deleted documents + } else { + // As we apply this segment sorter to any timeseries indices, + // we don't have a guarantee that all docs contain @timestamp field. + // Some segments may have all docs without @timestamp field, in this + // case they will be sorted last. return Long.MIN_VALUE; } } catch (IOException e) { + throw new ElasticsearchException("Can't access [" + + DataStream.TimestampField.FIXED_TIMESTAMP_FIELD + "] field for the index!", e); } - throw new IllegalStateException("Can't access [" + - DataStream.TimestampField.FIXED_TIMESTAMP_FIELD + "] field for the data stream!"); }) .reversed(); diff --git a/server/src/main/java/org/elasticsearch/index/mapper/MappingLookup.java b/server/src/main/java/org/elasticsearch/index/mapper/MappingLookup.java index 8f4d259abb140..02e1698b7f5d2 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/MappingLookup.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/MappingLookup.java @@ -9,6 +9,7 @@ package org.elasticsearch.index.mapper; import org.apache.lucene.codecs.PostingsFormat; +import org.elasticsearch.cluster.metadata.DataStream; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.analysis.IndexAnalyzers; import org.elasticsearch.index.analysis.NamedAnalyzer; @@ -389,6 +390,19 @@ public boolean isDataStreamTimestampFieldEnabled() { return dtfm != null && dtfm.isEnabled(); } + /** + * Returns if this mapping contains a timestamp field that is of type date, indexed and has doc values. + * @return {@code true} if contains a timestamp field of type date that is indexed and has doc values, {@code false} otherwise. + */ + public boolean hasTimestampField() { + final MappedFieldType mappedFieldType = fieldTypesLookup().get(DataStream.TimestampField.FIXED_TIMESTAMP_FIELD); + if (mappedFieldType instanceof DateFieldMapper.DateFieldType) { + return mappedFieldType.isSearchable() && mappedFieldType.hasDocValues(); + } else { + return false; + } + } + /** * Key for the lookup to be used in caches. */ diff --git a/server/src/main/java/org/elasticsearch/index/shard/IndexShard.java b/server/src/main/java/org/elasticsearch/index/shard/IndexShard.java index a55d9d035575a..eaa2a3a361bd3 100644 --- a/server/src/main/java/org/elasticsearch/index/shard/IndexShard.java +++ b/server/src/main/java/org/elasticsearch/index/shard/IndexShard.java @@ -186,7 +186,7 @@ import java.util.stream.Collectors; import java.util.stream.StreamSupport; -import static org.elasticsearch.cluster.metadata.DataStream.DATASTREAM_LEAF_READERS_SORTER; +import static org.elasticsearch.cluster.metadata.DataStream.TIMESERIES_LEAF_READERS_SORTER; import static org.elasticsearch.index.seqno.RetentionLeaseActions.RETAIN_ALL; import static org.elasticsearch.index.seqno.SequenceNumbers.UNASSIGNED_SEQ_NO; @@ -408,6 +408,14 @@ public Sort getIndexSort() { return indexSortSupplier.get(); } + /** + * Returns if this shard is a part of datastream + * @return {@code true} if this shard is a part of datastream, {@code false} otherwise + */ + public boolean isDataStreamIndex() { + return isDataStreamIndex; + } + public ShardGetService getService() { return this.getService; } @@ -2905,6 +2913,7 @@ private EngineConfig newEngineConfig(LongSupplier globalCheckpointSupplier) { this.warmer.warm(reader); } }; + final boolean isTimeseriesIndex = mapperService == null ? false : mapperService.mappingLookup().hasTimestampField(); return new EngineConfig( shardId, threadPool, @@ -2928,7 +2937,7 @@ private EngineConfig newEngineConfig(LongSupplier globalCheckpointSupplier) { replicationTracker::getRetentionLeases, this::getOperationPrimaryTerm, snapshotCommitSupplier, - isDataStreamIndex ? DATASTREAM_LEAF_READERS_SORTER : null); + isTimeseriesIndex ? TIMESERIES_LEAF_READERS_SORTER : null); } /** diff --git a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/131_sort_segments_migrate_to_data_stream.yml b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/131_sort_segments_migrate_to_data_stream.yml deleted file mode 100644 index c83230304e7fd..0000000000000 --- a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/131_sort_segments_migrate_to_data_stream.yml +++ /dev/null @@ -1,111 +0,0 @@ ---- -"Test that datastream index segments are sorted on timestamp field desc after data stream migration": - - skip: - version: " - 7.15.99" - reason: "sorting segments was added in 7.16" - features: allowed_warnings - - - do: - allowed_warnings: - - "index template [my-template] has index patterns [my_ds] matching patterns from existing older templates [global] with patterns (global => [*]); this template [my-template] will take precedence during new index creation" - indices.put_index_template: - name: my-template - body: - index_patterns: [ my_ds ] - data_stream: { } - template: - settings: - number_of_shards: 1 - number_of_replicas: 0 - - - do: - indices.create: - index: test_index1 - body: - settings: - number_of_shards: 1 - number_of_replicas: 0 - aliases: - my_ds: - is_write_index: true - - # 1st segment - - do: - index: - index: my_ds - body: { "foo": "bar1", "@timestamp": "2021-08-01" } - refresh: true - - # 2nd segment - - do: - index: - index: my_ds - body: { "foo": "bar2", "@timestamp": "2021-08-02" } - refresh: true - - # test that segments are sorted as indexed by @timestamp ASC - - do: - search: - index: my_ds - body: - fields: [{ "field":"@timestamp", "format":"yyyy-MM-dd" }] - - match: { hits.total.value: 2 } - - match: { hits.hits.0.fields.@timestamp: ["2021-08-01"] } - - match: { hits.hits.1.fields.@timestamp: ["2021-08-02"] } - - # migrate to data-stream - - do: - indices.migrate_to_data_stream: - name: my_ds - - is_true: acknowledged - - # test that segments are still sorted as indexed by @timestamp ASC - # as we don't reopen existing shards and index readers after migration - - do: - search: - index: my_ds - body: - fields: [{ "field":"@timestamp", "format":"yyyy-MM-dd" }] - - match: { hits.total.value: 2 } - - match: { hits.hits.0.fields.@timestamp: ["2021-08-01"] } - - match: { hits.hits.1.fields.@timestamp: ["2021-08-02"] } - - # rollover data stream to create new backing index - - do: - indices.rollover: - alias: "my_ds" - - match: { rolled_over: true } - # save the new backing index names for later use - - set: { new_index: idx0name } - - # 1st segment in the new backing index - - do: - index: - index: my_ds - body: { "foo": "bar3", "@timestamp": "2021-08-03" } - refresh: true - - # 2nd segment in the new backing index - - do: - index: - index: my_ds - body: { "foo": "bar4", "@timestamp": "2021-08-04" } - refresh: true - - - # test that segments are sorted by @timestamp DESC in the new backing index, - # as the newly created index and shard pick up the index leaf sorter - - do: - search: - index: $idx0name - body: - fields: [{ "field":"@timestamp", "format":"yyyy-MM-dd" }] - - match: { hits.total.value: 2 } - - match: { hits.hits.0.fields.@timestamp: ["2021-08-04"] } - - match: { hits.hits.1.fields.@timestamp: ["2021-08-03"] } - - - - do: - indices.delete_data_stream: - name: my_ds - - is_true: acknowledged diff --git a/x-pack/qa/runtime-fields/build.gradle b/x-pack/qa/runtime-fields/build.gradle index ee84e942756d1..2701c52b4a2b4 100644 --- a/x-pack/qa/runtime-fields/build.gradle +++ b/x-pack/qa/runtime-fields/build.gradle @@ -96,6 +96,8 @@ subprojects { // The error messages are different 'search/330_fetch_fields/error includes field name', 'search/330_fetch_fields/error includes glob pattern', + // we need a @timestamp field to be defined in index mapping + 'search/380_sort_segments_on_timestamp/*', /////// NOT SUPPORTED /////// ].join(',') } From 2cf160f2c00f93317c928bfaf859634c79c53c78 Mon Sep 17 00:00:00 2001 From: Jack Conradson Date: Tue, 5 Oct 2021 10:41:39 -0700 Subject: [PATCH 173/250] Remove deprecated code from stored scripts (#78643) This change removes several pieces of deprecated code from stored scripts. Stored scripts/templates are no longer allowed to be an empty and will throw an exception when used with PutStoredScript. ScriptMetadata will now drop any existing stored scripts that are empty with a deprecation warning in the case they have not been previously removed. The code field is now only allowed as source as part of a PutStoredScript JSON blob. --- .../migration/migrate_8_0/scripting.asciidoc | 27 +++++ .../elasticsearch/script/StoredScriptsIT.java | 2 +- .../elasticsearch/script/ScriptMetadata.java | 94 +++--------------- .../script/StoredScriptSource.java | 70 ++----------- .../script/ScriptMetadataTests.java | 99 +------------------ .../script/StoredScriptTests.java | 29 +----- 6 files changed, 58 insertions(+), 263 deletions(-) diff --git a/docs/reference/migration/migrate_8_0/scripting.asciidoc b/docs/reference/migration/migrate_8_0/scripting.asciidoc index f4e9724d04c63..04a5ff40a6231 100644 --- a/docs/reference/migration/migrate_8_0/scripting.asciidoc +++ b/docs/reference/migration/migrate_8_0/scripting.asciidoc @@ -22,4 +22,31 @@ scripts. Any use of `getDayOfWeek` expecting a return value of `int` will result in a compilation error or runtime error and may not allow the upgraded node to start. ==== + +.Stored scripts no longer support empty scripts or search templates. +[%collapsible] +==== +*Details* + +The {ref}/create-stored-script-api.html[create or update stored script API]'s +`source` parameter cannot be empty. + +*Impact* + +Before upgrading, use the {ref}/delete-stored-script-api.html[delete stored +script API] to delete any empty stored scripts or search templates. +In 8.0, {es} will drop any empty stored scripts or empty search templates from +the cluster state. Requests to create a stored script or search template with +an empty `source` will return an error. +==== + +.The create or update stored script API's `code` parameter has been removed. +[%collapsible] +==== +*Details* + +The {ref}/create-stored-script-api.html[create or update stored script API]'s +`code` parameter has been removed. Use the `source` parameter instead. + +*Impact* + +Discontinue use of the `code` parameter. Requests that include the parameter +will return an error. +==== // end::notable-breaking-changes[] \ No newline at end of file diff --git a/server/src/internalClusterTest/java/org/elasticsearch/script/StoredScriptsIT.java b/server/src/internalClusterTest/java/org/elasticsearch/script/StoredScriptsIT.java index 4874b67c339da..b1615cd04003b 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/script/StoredScriptsIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/script/StoredScriptsIT.java @@ -55,7 +55,7 @@ public void testBasics() { IllegalArgumentException e = expectThrows(IllegalArgumentException.class, () -> client().admin().cluster().preparePutStoredScript() .setId("id#") - .setContent(new BytesArray("{}"), XContentType.JSON) + .setContent(new BytesArray("{\"script\": {\"lang\": \"" + LANG + "\", \"source\": \"1\"} }"), XContentType.JSON) .get()); assertEquals("Validation Failed: 1: id cannot contain '#' for stored script;", e.getMessage()); } diff --git a/server/src/main/java/org/elasticsearch/script/ScriptMetadata.java b/server/src/main/java/org/elasticsearch/script/ScriptMetadata.java index 8f8b958b832a9..fb18105bb4c0a 100644 --- a/server/src/main/java/org/elasticsearch/script/ScriptMetadata.java +++ b/server/src/main/java/org/elasticsearch/script/ScriptMetadata.java @@ -7,6 +7,8 @@ */ package org.elasticsearch.script; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.elasticsearch.ResourceNotFoundException; import org.elasticsearch.Version; import org.elasticsearch.cluster.ClusterState; @@ -18,8 +20,6 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.logging.DeprecationCategory; -import org.elasticsearch.common.logging.DeprecationLogger; import org.elasticsearch.common.xcontent.ToXContentFragment; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; @@ -38,9 +38,9 @@ public final class ScriptMetadata implements Metadata.Custom, Writeable, ToXContentFragment { /** - * Standard deprecation logger for used to deprecate allowance of empty templates. + * Standard logger used to warn about dropped scripts. */ - private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(ScriptMetadata.class); + private static final Logger logger = LogManager.getLogger(ScriptMetadata.class); /** * A builder used to modify the currently stored scripts data held within @@ -162,16 +162,10 @@ static ScriptMetadata deleteStoredScript(ScriptMetadata previous, String id) { * ... * } * } - * - * When loading from a source prior to 6.0, if multiple scripts - * using the old namespace id format of [lang#id] are found to have the - * same id but different languages an error will occur. */ public static ScriptMetadata fromXContent(XContentParser parser) throws IOException { Map scripts = new HashMap<>(); String id = null; - StoredScriptSource source; - StoredScriptSource exists; Token token = parser.currentToken(); @@ -189,52 +183,6 @@ public static ScriptMetadata fromXContent(XContentParser parser) throws IOExcept switch (token) { case FIELD_NAME: id = parser.currentName(); - break; - case VALUE_STRING: - if (id == null) { - throw new ParsingException(parser.getTokenLocation(), - "unexpected token [" + token + "], expected [, , {]"); - } - - int split = id.indexOf('#'); - String lang; - - if (split == -1) { - throw new IllegalArgumentException("illegal stored script id [" + id + "], does not contain lang"); - } else { - lang = id.substring(0, split); - id = id.substring(split + 1); - source = new StoredScriptSource(lang, parser.text(), Collections.emptyMap()); - - if (source.getSource().isEmpty()) { - if (source.getLang().equals(Script.DEFAULT_TEMPLATE_LANG)) { - deprecationLogger.critical( - DeprecationCategory.TEMPLATES, - "empty_templates", - "empty templates should no longer be used" - ); - } else { - deprecationLogger.critical( - DeprecationCategory.TEMPLATES, - "empty_scripts", - "empty scripts should no longer be used" - ); - } - } - } - - exists = scripts.get(id); - - if (exists == null) { - scripts.put(id, source); - } else if (exists.getLang().equals(lang) == false) { - throw new IllegalArgumentException("illegal stored script, id [" + id + "] used for multiple scripts with " + - "different languages [" + exists.getLang() + "] and [" + lang + "]; scripts using the old namespace " + - "of [lang#id] as a stored script id will have to be updated to use only the new namespace of [id]"); - } - - id = null; - break; case START_OBJECT: if (id == null) { @@ -242,31 +190,21 @@ public static ScriptMetadata fromXContent(XContentParser parser) throws IOExcept "unexpected token [" + token + "], expected [, , {]"); } - exists = scripts.get(id); - source = StoredScriptSource.fromXContent(parser, true); - - if (exists == null) { - // due to a bug (https://github.com/elastic/elasticsearch/issues/47593) - // scripts may have been retained during upgrade that include the old-style - // id of lang#id; these scripts are unreachable after 7.0, so they are dropped - if (id.contains("#") == false) { - scripts.put(id, source); + StoredScriptSource source = StoredScriptSource.fromXContent(parser, true); + // as of 8.0 we drop scripts/templates with an empty source + // this check should be removed for the next upgradable version after 8.0 + // since there is a guarantee no more empty scripts will exist + if (source.getSource().isEmpty()) { + if (Script.DEFAULT_TEMPLATE_LANG.equals(source.getLang())) { + logger.warn("empty template [" + id + "] found and dropped"); + } else { + logger.warn("empty script [" + id + "] found and dropped"); } - } else if (exists.getLang().equals(source.getLang()) == false) { - throw new IllegalArgumentException( - "illegal stored script, id [" - + id - + "] used for multiple scripts with different languages [" - + exists.getLang() - + "] and [" - + source.getLang() - + "]; scripts using the old namespace of [lang#id] as a stored script id will have to be updated " - + "to use only the new namespace of [id]" - ); + } else { + scripts.put(id, source); } id = null; - break; default: throw new ParsingException(parser.getTokenLocation(), "unexpected token [" + token + "], expected [, , {]"); @@ -318,8 +256,6 @@ public void writeTo(StreamOutput out) throws IOException { } } - - /** * This will write XContent from {@link ScriptMetadata}. The following format will be written: * diff --git a/server/src/main/java/org/elasticsearch/script/StoredScriptSource.java b/server/src/main/java/org/elasticsearch/script/StoredScriptSource.java index afcbd4ba07766..ac6e8089c134d 100644 --- a/server/src/main/java/org/elasticsearch/script/StoredScriptSource.java +++ b/server/src/main/java/org/elasticsearch/script/StoredScriptSource.java @@ -11,19 +11,18 @@ import org.elasticsearch.cluster.AbstractDiffable; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.Diff; -import org.elasticsearch.common.xcontent.ParseField; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.logging.DeprecationCategory; import org.elasticsearch.common.logging.DeprecationLogger; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; import org.elasticsearch.common.xcontent.NamedXContentRegistry; import org.elasticsearch.common.xcontent.ObjectParser; import org.elasticsearch.common.xcontent.ObjectParser.ValueType; +import org.elasticsearch.common.xcontent.ParseField; import org.elasticsearch.common.xcontent.ToXContentObject; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentFactory; @@ -63,7 +62,7 @@ public class StoredScriptSource extends AbstractDiffable imp /** * Standard {@link ParseField} for source on the inner level. */ - public static final ParseField SOURCE_PARSE_FIELD = new ParseField("source", "code"); + public static final ParseField SOURCE_PARSE_FIELD = new ParseField("source"); /** * Standard {@link ParseField} for options on the inner level. @@ -121,8 +120,7 @@ private void setOptions(Map options) { * Validates the parameters and creates an {@link StoredScriptSource}. * * @param ignoreEmpty Specify as {@code true} to ignoreEmpty the empty source check. - * This allow empty templates to be loaded for backwards compatibility. - * This allow empty templates to be loaded for backwards compatibility. + * This allow empty templates to be dropped for backwards compatibility. */ private StoredScriptSource build(boolean ignoreEmpty) { if (lang == null) { @@ -132,29 +130,13 @@ private StoredScriptSource build(boolean ignoreEmpty) { } if (source == null) { - if (ignoreEmpty || Script.DEFAULT_TEMPLATE_LANG.equals(lang)) { - if (Script.DEFAULT_TEMPLATE_LANG.equals(lang)) { - deprecationLogger.critical(DeprecationCategory.TEMPLATES, "empty_templates", - "empty templates should no longer be used"); - } else { - deprecationLogger.critical(DeprecationCategory.TEMPLATES, "empty_scripts", - "empty scripts should no longer be used"); - } + if (ignoreEmpty) { + source = ""; } else { throw new IllegalArgumentException("must specify source for stored script"); } - } else if (source.isEmpty()) { - if (ignoreEmpty || Script.DEFAULT_TEMPLATE_LANG.equals(lang)) { - if (Script.DEFAULT_TEMPLATE_LANG.equals(lang)) { - deprecationLogger.critical(DeprecationCategory.TEMPLATES, "empty_templates", - "empty templates should no longer be used"); - } else { - deprecationLogger.critical(DeprecationCategory.TEMPLATES, "empty_scripts", - "empty scripts should no longer be used"); - } - } else { - throw new IllegalArgumentException("source cannot be empty"); - } + } else if (source.isEmpty() && ignoreEmpty == false) { + throw new IllegalArgumentException("source cannot be empty"); } if (options.size() > 1 || options.size() == 1 && options.get(Script.CONTENT_TYPE_OPTION) == null) { @@ -175,21 +157,9 @@ private StoredScriptSource build(boolean ignoreEmpty) { } /** - * This will parse XContent into a {@link StoredScriptSource}. The following formats can be parsed: - * - * The simple script format with no compiler options or user-defined params: - * - * Example: - * {@code - * {"script": "return Math.log(doc.popularity) * 100;"} - * } + * This will parse XContent into a {@link StoredScriptSource}. * - * The above format requires the lang to be specified using the deprecated stored script namespace - * (as a url parameter during a put request). See {@link ScriptMetadata} for more information about - * the stored script namespaces. - * - * The complex script format using the new stored script namespace - * where lang and source are required but options is optional: + * Examples of legal JSON: * * {@code * { @@ -215,22 +185,6 @@ private StoredScriptSource build(boolean ignoreEmpty) { * } * } * - * The use of "source" may also be substituted with "code" for backcompat with 5.3 to 5.5 format. For example: - * - * {@code - * { - * "script" : { - * "lang" : "", - * "code" : "", - * "options" : { - * "option0" : "", - * "option1" : "", - * ... - * } - * } - * } - * } - * * Note that the "source" parameter can also handle template parsing including from * a complex JSON object. * @@ -249,12 +203,6 @@ public static StoredScriptSource parse(BytesReference content, XContentType xCon token = parser.nextToken(); - if (token == Token.END_OBJECT) { - deprecationLogger.critical(DeprecationCategory.TEMPLATES, "empty_templates", "empty templates should no longer be used"); - - return new StoredScriptSource(Script.DEFAULT_TEMPLATE_LANG, "", Collections.emptyMap()); - } - if (token != Token.FIELD_NAME) { throw new ParsingException(parser.getTokenLocation(), "unexpected token [" + token + ", expected [" + SCRIPT_PARSE_FIELD.getPreferredName() + "]"); diff --git a/server/src/test/java/org/elasticsearch/script/ScriptMetadataTests.java b/server/src/test/java/org/elasticsearch/script/ScriptMetadataTests.java index c9a0aa2033097..f2793289e6088 100644 --- a/server/src/test/java/org/elasticsearch/script/ScriptMetadataTests.java +++ b/server/src/test/java/org/elasticsearch/script/ScriptMetadataTests.java @@ -21,48 +21,9 @@ import java.io.IOException; import java.io.UncheckedIOException; -import java.util.Collections; public class ScriptMetadataTests extends AbstractSerializingTestCase { - public void testFromXContentLoading() throws Exception { - // failure to load to old namespace scripts with the same id but different langs - XContentBuilder builder = XContentFactory.jsonBuilder(); - builder.startObject().field("lang0#id0", "script0").field("lang1#id0", "script1").endObject(); - XContentParser parser0 = XContentType.JSON.xContent() - .createParser(NamedXContentRegistry.EMPTY, DeprecationHandler.THROW_UNSUPPORTED_OPERATION, - BytesReference.bytes(builder).streamInput()); - expectThrows(IllegalArgumentException.class, () -> ScriptMetadata.fromXContent(parser0)); - - // failure to load a new namespace script and old namespace script with the same id but different langs - builder = XContentFactory.jsonBuilder(); - builder.startObject().field("lang0#id0", "script0") - .startObject("id0").field("lang", "lang1").field("source", "script1").endObject().endObject(); - XContentParser parser1 = XContentType.JSON.xContent() - .createParser(NamedXContentRegistry.EMPTY, DeprecationHandler.THROW_UNSUPPORTED_OPERATION, - BytesReference.bytes(builder).streamInput()); - expectThrows(IllegalArgumentException.class, () -> ScriptMetadata.fromXContent(parser1)); - - // failure to load a new namespace script and old namespace script with the same id but different langs with additional scripts - builder = XContentFactory.jsonBuilder(); - builder.startObject().field("lang0#id0", "script0").field("lang0#id1", "script1") - .startObject("id1").field("lang", "lang0").field("source", "script0").endObject() - .startObject("id0").field("lang", "lang1").field("source", "script1").endObject().endObject(); - XContentParser parser2 = XContentType.JSON.xContent() - .createParser(NamedXContentRegistry.EMPTY, DeprecationHandler.THROW_UNSUPPORTED_OPERATION, - BytesReference.bytes(builder).streamInput()); - expectThrows(IllegalArgumentException.class, () -> ScriptMetadata.fromXContent(parser2)); - - // okay to load the same script from the new and old namespace if the lang is the same - builder = XContentFactory.jsonBuilder(); - builder.startObject().field("lang0#id0", "script0") - .startObject("id0").field("lang", "lang0").field("source", "script1").endObject().endObject(); - XContentParser parser3 = XContentType.JSON.xContent() - .createParser(NamedXContentRegistry.EMPTY, DeprecationHandler.THROW_UNSUPPORTED_OPERATION, - BytesReference.bytes(builder).streamInput()); - ScriptMetadata.fromXContent(parser3); - } - public void testGetScript() throws Exception { ScriptMetadata.Builder builder = new ScriptMetadata.Builder(null); @@ -126,72 +87,18 @@ public void testBuilder() { public void testLoadEmptyScripts() throws IOException { XContentBuilder builder = XContentFactory.jsonBuilder(); - builder.startObject().field("mustache#empty", "").endObject(); - XContentParser parser = XContentType.JSON.xContent() - .createParser(NamedXContentRegistry.EMPTY, DeprecationHandler.THROW_UNSUPPORTED_OPERATION, - BytesReference.bytes(builder).streamInput()); - ScriptMetadata.fromXContent(parser); - assertWarnings("empty templates should no longer be used"); - - builder = XContentFactory.jsonBuilder(); - builder.startObject().field("lang#empty", "").endObject(); - parser = XContentType.JSON.xContent() - .createParser(NamedXContentRegistry.EMPTY, DeprecationHandler.THROW_UNSUPPORTED_OPERATION, - BytesReference.bytes(builder).streamInput()); - ScriptMetadata.fromXContent(parser); - assertWarnings("empty scripts should no longer be used"); - - builder = XContentFactory.jsonBuilder(); builder.startObject().startObject("script").field("lang", "lang").field("source", "").endObject().endObject(); - parser = XContentType.JSON.xContent() + XContentParser parser = XContentType.JSON.xContent() .createParser(NamedXContentRegistry.EMPTY, DeprecationHandler.THROW_UNSUPPORTED_OPERATION, BytesReference.bytes(builder).streamInput()); - ScriptMetadata.fromXContent(parser); - assertWarnings("empty scripts should no longer be used"); + assertTrue(ScriptMetadata.fromXContent(parser).getStoredScripts().isEmpty()); builder = XContentFactory.jsonBuilder(); builder.startObject().startObject("script").field("lang", "mustache").field("source", "").endObject().endObject(); parser = XContentType.JSON.xContent() .createParser(NamedXContentRegistry.EMPTY, DeprecationHandler.THROW_UNSUPPORTED_OPERATION, BytesReference.bytes(builder).streamInput()); - ScriptMetadata.fromXContent(parser); - assertWarnings("empty templates should no longer be used"); - } - - public void testOldStyleDropped() throws IOException { - XContentBuilder builder = XContentBuilder.builder(XContentType.JSON.xContent()); - - builder.startObject(); - { - builder.startObject("painless#test"); - { - builder.field("lang", "painless"); - builder.field("source", "code"); - } - builder.endObject(); - builder.startObject("lang#test"); - { - builder.field("lang", "test"); - builder.field("source", "code"); - } - builder.endObject(); - builder.startObject("test"); - { - builder.field("lang", "painless"); - builder.field("source", "code"); - } - builder.endObject(); - } - builder.endObject(); - - XContentParser parser = XContentType.JSON.xContent() - .createParser(NamedXContentRegistry.EMPTY, DeprecationHandler.THROW_UNSUPPORTED_OPERATION, - BytesReference.bytes(builder).streamInput()); - ScriptMetadata smd = ScriptMetadata.fromXContent(parser); - assertNull(smd.getStoredScript("painless#test")); - assertNull(smd.getStoredScript("lang#test")); - assertEquals(new StoredScriptSource("painless", "code", Collections.emptyMap()), smd.getStoredScript("test")); - assertEquals(1, smd.getStoredScripts().size()); + assertTrue(ScriptMetadata.fromXContent(parser).getStoredScripts().isEmpty()); } @Override diff --git a/server/src/test/java/org/elasticsearch/script/StoredScriptTests.java b/server/src/test/java/org/elasticsearch/script/StoredScriptTests.java index fc72296f86f78..88320e9f46698 100644 --- a/server/src/test/java/org/elasticsearch/script/StoredScriptTests.java +++ b/server/src/test/java/org/elasticsearch/script/StoredScriptTests.java @@ -84,17 +84,6 @@ public void testSourceParsing() throws Exception { assertThat(parsed, equalTo(source)); } - // complex script using "code" backcompat - try (XContentBuilder builder = XContentFactory.contentBuilder(XContentType.JSON)) { - builder.startObject().field("script").startObject().field("lang", "lang").field("code", "code").endObject().endObject(); - - StoredScriptSource parsed = StoredScriptSource.parse(BytesReference.bytes(builder), XContentType.JSON); - StoredScriptSource source = new StoredScriptSource("lang", "code", Collections.emptyMap()); - - assertThat(parsed, equalTo(source)); - } - assertWarnings("Deprecated field [code] used, expected [source] instead"); - // complex script with script object and empty options try (XContentBuilder builder = XContentFactory.contentBuilder(XContentType.JSON)) { builder.startObject().field("script").startObject().field("lang", "lang").field("source", "code") @@ -165,25 +154,13 @@ public void testSourceParsingErrors() throws Exception { } public void testEmptyTemplateDeprecations() throws IOException { - try (XContentBuilder builder = XContentFactory.contentBuilder(XContentType.JSON)) { - builder.startObject().endObject(); - - StoredScriptSource parsed = StoredScriptSource.parse(BytesReference.bytes(builder), XContentType.JSON); - StoredScriptSource source = new StoredScriptSource(Script.DEFAULT_TEMPLATE_LANG, "", Collections.emptyMap()); - - assertThat(parsed, equalTo(source)); - assertWarnings("empty templates should no longer be used"); - } - try (XContentBuilder builder = XContentFactory.contentBuilder(XContentType.JSON)) { builder.startObject().field("script").startObject().field("lang", "mustache") .field("source", "").endObject().endObject(); - StoredScriptSource parsed = StoredScriptSource.parse(BytesReference.bytes(builder), XContentType.JSON); - StoredScriptSource source = new StoredScriptSource(Script.DEFAULT_TEMPLATE_LANG, "", Collections.emptyMap()); - - assertThat(parsed, equalTo(source)); - assertWarnings("empty templates should no longer be used"); + IllegalArgumentException iae = expectThrows(IllegalArgumentException.class, () -> + StoredScriptSource.parse(BytesReference.bytes(builder), XContentType.JSON)); + assertEquals("source cannot be empty", iae.getMessage()); } } From aa3d5109b1ef3c51f4cf97a956de39d783e6c317 Mon Sep 17 00:00:00 2001 From: James Baiera Date: Tue, 5 Oct 2021 14:05:20 -0400 Subject: [PATCH 174/250] Automatically install monitoring templates at plugin initialization (#78350) This PR adds a MonitoringIndexTemplateRegistry to the monitoring plugin which automatically installs all monitoring templates locally when the plugin is initialized. Exporters have been updated to no longer attempt installation of the monitoring templates, and instead will wait for the templates to become available before setting themselves as started. Some older functionality related to templates has been removed as well, such as the expectation that version 6 monitoring templates are installed, as well as the setting that controls their installation (xpack.monitoring.exporters..index.template.create_legacy_templates). --- .../migration/migrate_8_0/monitoring.asciidoc | 14 ++ .../AutoFollowStatsMonitoringDocTests.java | 5 +- .../ccr/FollowStatsMonitoringDocTests.java | 5 +- .../exporter/MonitoringTemplateUtils.java | 60 ------ .../main/resources/monitoring-alerts-7.json | 4 +- .../src/main/resources/monitoring-beats.json | 4 +- .../src/main/resources/monitoring-es.json | 4 +- .../src/main/resources/monitoring-kibana.json | 4 +- .../main/resources/monitoring-logstash.json | 4 +- .../enrich/EnrichCoordinatorDocTests.java | 7 +- .../enrich/ExecutingPolicyDocTests.java | 7 +- .../exporter/http/HttpExporterIT.java | 189 ++++++++--------- .../xpack/monitoring/Monitoring.java | 8 +- .../MonitoringTemplateRegistry.java | 199 ++++++++++++++++++ .../exporter/http/HttpExporter.java | 30 +-- .../exporter/http/TemplateHttpResource.java | 49 +---- .../exporter/local/LocalExporter.java | 51 ++--- ...ortMonitoringMigrateAlertsActionTests.java | 5 +- .../AbstractIndicesCleanerTestCase.java | 8 +- .../local/LocalIndicesCleanerTests.java | 11 +- .../MonitoringTemplateUtilsTests.java | 55 ----- .../http/HttpExporterResourceTests.java | 152 +++++-------- .../exporter/http/HttpExporterTests.java | 10 +- .../http/TemplateHttpResourceTests.java | 49 ++--- .../LocalExporterResourceIntegTests.java | 10 +- .../test/MonitoringIntegTestCase.java | 16 +- 26 files changed, 455 insertions(+), 505 deletions(-) create mode 100644 x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/MonitoringTemplateRegistry.java diff --git a/docs/reference/migration/migrate_8_0/monitoring.asciidoc b/docs/reference/migration/migrate_8_0/monitoring.asciidoc index e0e0e3fd6d0e8..cdedfe29982c5 100644 --- a/docs/reference/migration/migrate_8_0/monitoring.asciidoc +++ b/docs/reference/migration/migrate_8_0/monitoring.asciidoc @@ -30,4 +30,18 @@ had no function and are now removed in 8.0.0. *Impact* + Discontinue the use of the `xpack.monitoring.exporters.*.index.pipeline.master_timeout` setting. ==== + +.The `index.template.create_legacy_templates` setting on Monitoring HTTP exporter configurations has been removed. +[%collapsible] +==== +*Details* + +The `xpack.monitoring.exporters.*.index.template.create_legacy_templates` property was +deprecated in 7.16.0. This parameter instructed the exporter to install the previous version +of monitoring templates on the monitoring cluster. These older templates were meant to assist +in transitioning to the current monitoring data format. They are currently empty and are no +longer of any use. + +*Impact* + +Discontinue the use of the `xpack.monitoring.exporters.*.index.template.create_legacy_templates` setting. +==== //end::notable-breaking-changes[] diff --git a/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/monitoring/collector/ccr/AutoFollowStatsMonitoringDocTests.java b/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/monitoring/collector/ccr/AutoFollowStatsMonitoringDocTests.java index 4037530c4347f..fc36bc6bfbfe4 100644 --- a/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/monitoring/collector/ccr/AutoFollowStatsMonitoringDocTests.java +++ b/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/monitoring/collector/ccr/AutoFollowStatsMonitoringDocTests.java @@ -19,7 +19,7 @@ import org.elasticsearch.xpack.core.ccr.AutoFollowStats.AutoFollowedCluster; import org.elasticsearch.xpack.core.monitoring.MonitoredSystem; import org.elasticsearch.xpack.core.monitoring.exporter.MonitoringDoc; -import org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils; +import org.elasticsearch.xpack.monitoring.MonitoringTemplateRegistry; import org.elasticsearch.xpack.monitoring.exporter.BaseMonitoringDocTestCase; import org.junit.Before; @@ -146,8 +146,9 @@ public void testShardFollowNodeTaskStatusFieldsMapped() throws IOException { builder.value(status); Map serializedStatus = XContentHelper.convertToMap(XContentType.JSON.xContent(), Strings.toString(builder), false); + byte[] loadedTemplate = MonitoringTemplateRegistry.getTemplateConfigForMonitoredSystem(MonitoredSystem.ES).loadBytes(); Map template = - XContentHelper.convertToMap(XContentType.JSON.xContent(), MonitoringTemplateUtils.loadTemplate("es"), false); + XContentHelper.convertToMap(XContentType.JSON.xContent(), loadedTemplate, 0, loadedTemplate.length, false); Map autoFollowStatsMapping = (Map) XContentMapValues.extractValue("mappings._doc.properties.ccr_auto_follow_stats.properties", template); diff --git a/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/monitoring/collector/ccr/FollowStatsMonitoringDocTests.java b/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/monitoring/collector/ccr/FollowStatsMonitoringDocTests.java index 39ce1873ecba6..8c97f753cae09 100644 --- a/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/monitoring/collector/ccr/FollowStatsMonitoringDocTests.java +++ b/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/monitoring/collector/ccr/FollowStatsMonitoringDocTests.java @@ -19,7 +19,7 @@ import org.elasticsearch.xpack.core.ccr.ShardFollowNodeTaskStatus; import org.elasticsearch.xpack.core.monitoring.MonitoredSystem; import org.elasticsearch.xpack.core.monitoring.exporter.MonitoringDoc; -import org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils; +import org.elasticsearch.xpack.monitoring.MonitoringTemplateRegistry; import org.elasticsearch.xpack.monitoring.exporter.BaseMonitoringDocTestCase; import org.junit.Before; @@ -240,8 +240,9 @@ public void testShardFollowNodeTaskStatusFieldsMapped() throws IOException { builder.value(status); Map serializedStatus = XContentHelper.convertToMap(XContentType.JSON.xContent(), Strings.toString(builder), false); + byte[] loadedTemplate = MonitoringTemplateRegistry.getTemplateConfigForMonitoredSystem(MonitoredSystem.ES).loadBytes(); Map template = - XContentHelper.convertToMap(XContentType.JSON.xContent(), MonitoringTemplateUtils.loadTemplate("es"), false); + XContentHelper.convertToMap(XContentType.JSON.xContent(), loadedTemplate, 0, loadedTemplate.length, false); Map followStatsMapping = (Map) XContentMapValues .extractValue("mappings._doc.properties.ccr_stats.properties", template); assertThat(serializedStatus.size(), equalTo(followStatsMapping.size())); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/monitoring/exporter/MonitoringTemplateUtils.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/monitoring/exporter/MonitoringTemplateUtils.java index 7657d99544c34..45ecfdc958d97 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/monitoring/exporter/MonitoringTemplateUtils.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/monitoring/exporter/MonitoringTemplateUtils.java @@ -9,16 +9,11 @@ import org.elasticsearch.Version; import org.elasticsearch.common.time.DateFormatter; import org.elasticsearch.xpack.core.monitoring.MonitoredSystem; -import org.elasticsearch.xpack.core.template.TemplateUtils; import java.time.Instant; -import java.util.Locale; public final class MonitoringTemplateUtils { - private static final String TEMPLATE_FILE = "/monitoring-%s.json"; - private static final String TEMPLATE_VERSION_PROPERTY = "monitoring.template.version"; - /** * The last version of X-Pack that updated the templates and pipelines. *

    @@ -40,63 +35,8 @@ public final class MonitoringTemplateUtils { */ public static final String OLD_TEMPLATE_VERSION = "6"; - /** - * IDs of templates that can be used with {@linkplain #loadTemplate(String) loadTemplate}. - */ - public static final String[] TEMPLATE_IDS = { "alerts-7", "es", "kibana", "logstash", "beats" }; - - /** - * IDs of templates that can be used with {@linkplain #createEmptyTemplate(String) createEmptyTemplate} that are not managed by a - * Resolver. - *

    - * These should only be used by the HTTP Exporter to create old templates so that older versions can be properly upgraded. Older - * instances will attempt to create a named template based on the templates that they expect (e.g., ".monitoring-es-2") and not the - * ones that we are creating. - */ - public static final String[] OLD_TEMPLATE_IDS = { "data", "es", "kibana", "logstash" }; //excluding alerts since 6.x watches use it - private MonitoringTemplateUtils() { } - /** - * Get a template name for any template ID. - * - * @param id The template identifier. - * @return Never {@code null} {@link String} prefixed by ".monitoring-". - * @see #TEMPLATE_IDS - */ - public static String templateName(final String id) { - return ".monitoring-" + id; - } - - /** - * Get a template name for any template ID for old templates in the previous version. - * - * @param id The template identifier. - * @return Never {@code null} {@link String} prefixed by ".monitoring-" and ended by the {@code OLD_TEMPLATE_VERSION}. - * @see #OLD_TEMPLATE_IDS - */ - public static String oldTemplateName(final String id) { - return ".monitoring-" + id + "-" + OLD_TEMPLATE_VERSION; - } - - public static String loadTemplate(final String id) { - String resource = String.format(Locale.ROOT, TEMPLATE_FILE, id); - return TemplateUtils.loadTemplate(resource, TEMPLATE_VERSION, TEMPLATE_VERSION_PROPERTY); - } - - /** - * Create a template that does nothing but exist and provide a newer {@code version} so that we know that we created it. - * - * @param id The template identifier. - * @return Never {@code null}. - * @see #OLD_TEMPLATE_IDS - * @see #OLD_TEMPLATE_VERSION - */ - public static String createEmptyTemplate(final String id) { - // e.g., { "index_patterns": [ ".monitoring-data-6*" ], "version": 6000002 } - return "{\"index_patterns\":[\".monitoring-" + id + "-" + OLD_TEMPLATE_VERSION + "*\"],\"version\":" + LAST_UPDATED_VERSION + "}"; - } - /** * Get the index name given a specific date format, a monitored system and a timestamp. * diff --git a/x-pack/plugin/core/src/main/resources/monitoring-alerts-7.json b/x-pack/plugin/core/src/main/resources/monitoring-alerts-7.json index 8f3e2d2916ee7..4e77d35b4de25 100644 --- a/x-pack/plugin/core/src/main/resources/monitoring-alerts-7.json +++ b/x-pack/plugin/core/src/main/resources/monitoring-alerts-7.json @@ -1,6 +1,6 @@ { - "index_patterns": [ ".monitoring-alerts-${monitoring.template.version}" ], - "version": 7140099, + "index_patterns": [ ".monitoring-alerts-${xpack.monitoring.template.version}" ], + "version": ${xpack.monitoring.template.release.version}, "settings": { "index": { "number_of_shards": 1, diff --git a/x-pack/plugin/core/src/main/resources/monitoring-beats.json b/x-pack/plugin/core/src/main/resources/monitoring-beats.json index 77e25d189f1f7..e3e070fa4f685 100644 --- a/x-pack/plugin/core/src/main/resources/monitoring-beats.json +++ b/x-pack/plugin/core/src/main/resources/monitoring-beats.json @@ -1,6 +1,6 @@ { "index_patterns": [ - ".monitoring-beats-${monitoring.template.version}-*" + ".monitoring-beats-${xpack.monitoring.template.version}-*" ], "settings": { "index.auto_expand_replicas": "0-1", @@ -9,7 +9,7 @@ "index.number_of_replicas": 0, "index.number_of_shards": 1 }, - "version": 7140099, + "version": ${xpack.monitoring.template.release.version}, "mappings": { "_doc": { "dynamic": false, diff --git a/x-pack/plugin/core/src/main/resources/monitoring-es.json b/x-pack/plugin/core/src/main/resources/monitoring-es.json index 45a23a35ed233..db8b51971405e 100644 --- a/x-pack/plugin/core/src/main/resources/monitoring-es.json +++ b/x-pack/plugin/core/src/main/resources/monitoring-es.json @@ -1,6 +1,6 @@ { - "index_patterns": [ ".monitoring-es-${monitoring.template.version}-*" ], - "version": 7140099, + "index_patterns": [ ".monitoring-es-${xpack.monitoring.template.version}-*" ], + "version": ${xpack.monitoring.template.release.version}, "settings": { "index.number_of_shards": 1, "index.number_of_replicas": 0, diff --git a/x-pack/plugin/core/src/main/resources/monitoring-kibana.json b/x-pack/plugin/core/src/main/resources/monitoring-kibana.json index 7a7e7475c1d0c..ad631b8e5762c 100644 --- a/x-pack/plugin/core/src/main/resources/monitoring-kibana.json +++ b/x-pack/plugin/core/src/main/resources/monitoring-kibana.json @@ -1,6 +1,6 @@ { - "index_patterns": [ ".monitoring-kibana-${monitoring.template.version}-*" ], - "version": 7140099, + "index_patterns": [ ".monitoring-kibana-${xpack.monitoring.template.version}-*" ], + "version": ${xpack.monitoring.template.release.version}, "settings": { "index.number_of_shards": 1, "index.number_of_replicas": 0, diff --git a/x-pack/plugin/core/src/main/resources/monitoring-logstash.json b/x-pack/plugin/core/src/main/resources/monitoring-logstash.json index 2277033b59f39..8ccaffde9bbb6 100644 --- a/x-pack/plugin/core/src/main/resources/monitoring-logstash.json +++ b/x-pack/plugin/core/src/main/resources/monitoring-logstash.json @@ -1,6 +1,6 @@ { - "index_patterns": [ ".monitoring-logstash-${monitoring.template.version}-*" ], - "version": 7140099, + "index_patterns": [ ".monitoring-logstash-${xpack.monitoring.template.version}-*" ], + "version": ${xpack.monitoring.template.release.version}, "settings": { "index.number_of_shards": 1, "index.number_of_replicas": 0, diff --git a/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/monitoring/collector/enrich/EnrichCoordinatorDocTests.java b/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/monitoring/collector/enrich/EnrichCoordinatorDocTests.java index 97a68ff96c69d..1d6a44b186933 100644 --- a/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/monitoring/collector/enrich/EnrichCoordinatorDocTests.java +++ b/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/monitoring/collector/enrich/EnrichCoordinatorDocTests.java @@ -16,7 +16,7 @@ import org.elasticsearch.xpack.core.enrich.action.EnrichStatsAction.Response.CoordinatorStats; import org.elasticsearch.xpack.core.monitoring.MonitoredSystem; import org.elasticsearch.xpack.core.monitoring.exporter.MonitoringDoc; -import org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils; +import org.elasticsearch.xpack.monitoring.MonitoringTemplateRegistry; import org.elasticsearch.xpack.monitoring.exporter.BaseMonitoringDocTestCase; import java.io.IOException; @@ -129,9 +129,12 @@ public void testEnrichCoordinatorStatsFieldsMapped() throws IOException { builder.endObject(); Map serializedStatus = XContentHelper.convertToMap(XContentType.JSON.xContent(), Strings.toString(builder), false); + byte[] loadedTemplate = MonitoringTemplateRegistry.getTemplateConfigForMonitoredSystem(MonitoredSystem.ES).loadBytes(); Map template = XContentHelper.convertToMap( XContentType.JSON.xContent(), - MonitoringTemplateUtils.loadTemplate("es"), + loadedTemplate, + 0, + loadedTemplate.length, false ); Map followStatsMapping = (Map) XContentMapValues.extractValue( diff --git a/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/monitoring/collector/enrich/ExecutingPolicyDocTests.java b/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/monitoring/collector/enrich/ExecutingPolicyDocTests.java index 11c034074d314..0650298a3c844 100644 --- a/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/monitoring/collector/enrich/ExecutingPolicyDocTests.java +++ b/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/monitoring/collector/enrich/ExecutingPolicyDocTests.java @@ -15,7 +15,7 @@ import org.elasticsearch.xpack.core.enrich.action.EnrichStatsAction.Response.ExecutingPolicy; import org.elasticsearch.xpack.core.monitoring.MonitoredSystem; import org.elasticsearch.xpack.core.monitoring.exporter.MonitoringDoc; -import org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils; +import org.elasticsearch.xpack.monitoring.MonitoringTemplateRegistry; import org.elasticsearch.xpack.monitoring.exporter.BaseMonitoringDocTestCase; import java.io.IOException; @@ -142,9 +142,12 @@ public void testEnrichCoordinatorStatsFieldsMapped() throws IOException { builder.endObject(); Map serializedStatus = XContentHelper.convertToMap(XContentType.JSON.xContent(), Strings.toString(builder), false); + byte[] loadedTemplate = MonitoringTemplateRegistry.getTemplateConfigForMonitoredSystem(MonitoredSystem.ES).loadBytes(); Map template = XContentHelper.convertToMap( XContentType.JSON.xContent(), - MonitoringTemplateUtils.loadTemplate("es"), + loadedTemplate, + 0, + loadedTemplate.length, false ); Map followStatsMapping = (Map) XContentMapValues.extractValue( diff --git a/x-pack/plugin/monitoring/src/internalClusterTest/java/org/elasticsearch/xpack/monitoring/exporter/http/HttpExporterIT.java b/x-pack/plugin/monitoring/src/internalClusterTest/java/org/elasticsearch/xpack/monitoring/exporter/http/HttpExporterIT.java index 53b81459ec774..2929cd9549622 100644 --- a/x-pack/plugin/monitoring/src/internalClusterTest/java/org/elasticsearch/xpack/monitoring/exporter/http/HttpExporterIT.java +++ b/x-pack/plugin/monitoring/src/internalClusterTest/java/org/elasticsearch/xpack/monitoring/exporter/http/HttpExporterIT.java @@ -44,10 +44,10 @@ import org.elasticsearch.test.http.MockResponse; import org.elasticsearch.test.http.MockWebServer; import org.elasticsearch.xpack.core.monitoring.exporter.MonitoringDoc; -import org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils; import org.elasticsearch.xpack.core.ssl.SSLService; import org.elasticsearch.xpack.monitoring.LocalStateMonitoring; import org.elasticsearch.xpack.monitoring.MonitoringService; +import org.elasticsearch.xpack.monitoring.MonitoringTemplateRegistry; import org.elasticsearch.xpack.monitoring.MonitoringTestUtils; import org.elasticsearch.xpack.monitoring.collector.indices.IndexRecoveryMonitoringDoc; import org.elasticsearch.xpack.monitoring.exporter.ClusterAlertsUtil; @@ -71,7 +71,6 @@ import java.util.Map; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import java.util.stream.Collectors; import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils.LAST_UPDATED_VERSION; @@ -93,8 +92,6 @@ public class HttpExporterIT extends MonitoringIntegTestCase { private final List clusterAlertBlacklist = rarely() ? randomSubsetOf(Arrays.asList(ClusterAlertsUtil.WATCH_IDS)) : Collections.emptyList(); - private final boolean templatesExistsAlready = randomBoolean(); - private final boolean includeOldTemplates = randomBoolean(); private final boolean remoteClusterAllowsWatcher = randomBoolean(); private final boolean currentLicenseAllowsWatcher = true; private final boolean watcherAlreadyExists = randomBoolean(); @@ -147,7 +144,6 @@ private Settings.Builder baseSettings() { .put("xpack.monitoring.exporters._http.headers.ignored", "value") // ensure that headers can be used by settings .put("xpack.monitoring.exporters._http.host", getFormattedAddress(webServer)) .putList("xpack.monitoring.exporters._http.cluster_alerts.management.blacklist", clusterAlertBlacklist) - .put("xpack.monitoring.exporters._http.index.template.create_legacy_templates", includeOldTemplates) .put("xpack.monitoring.exporters._http.auth.username", userName); } @@ -156,7 +152,7 @@ public void testExport() throws Exception { enqueueGetClusterVersionResponse(Version.CURRENT); enqueueSetupResponses(webServer, - templatesExistsAlready, includeOldTemplates, + true, remoteClusterAllowsWatcher, currentLicenseAllowsWatcher, watcherAlreadyExists); enqueueResponse(200, "{\"errors\": false, \"msg\": \"successful bulk request\"}"); @@ -164,7 +160,7 @@ public void testExport() throws Exception { export(settings, newRandomMonitoringDocs(nbDocs)); assertMonitorResources(webServer, - templatesExistsAlready, includeOldTemplates, + true, remoteClusterAllowsWatcher, currentLicenseAllowsWatcher, watcherAlreadyExists); assertBulk(webServer, nbDocs); } @@ -183,7 +179,7 @@ public void testSecureSetting() throws Exception { enqueueGetClusterVersionResponse(Version.CURRENT); enqueueSetupResponses(webServer, - templatesExistsAlready, includeOldTemplates, + true, remoteClusterAllowsWatcher, currentLicenseAllowsWatcher, watcherAlreadyExists); enqueueResponse(200, "{\"errors\": false, \"msg\": \"successful bulk request\"}"); @@ -196,7 +192,7 @@ public void testSecureSetting() throws Exception { localStateMonitoring.getMonitoring().reload(settings); enqueueGetClusterVersionResponse(Version.CURRENT); enqueueSetupResponses(webServer, - templatesExistsAlready, includeOldTemplates, + true, remoteClusterAllowsWatcher, currentLicenseAllowsWatcher, watcherAlreadyExists); enqueueResponse(200, "{\"errors\": false, \"msg\": \"successful bulk request\"}"); @@ -222,7 +218,7 @@ public void testExportWithHeaders() throws Exception { enqueueGetClusterVersionResponse(Version.CURRENT); enqueueSetupResponses(webServer, - templatesExistsAlready, includeOldTemplates, + true, remoteClusterAllowsWatcher, currentLicenseAllowsWatcher, watcherAlreadyExists); enqueueResponse(200, "{\"errors\": false, \"msg\": \"successful bulk request\"}"); @@ -230,7 +226,7 @@ public void testExportWithHeaders() throws Exception { export(settings, newRandomMonitoringDocs(nbDocs)); assertMonitorResources(webServer, - templatesExistsAlready, includeOldTemplates, + true, remoteClusterAllowsWatcher, currentLicenseAllowsWatcher, watcherAlreadyExists, headers, null); assertBulk(webServer, nbDocs, headers, null); @@ -275,7 +271,7 @@ public void testExportWithBasePath() throws Exception { enqueueGetClusterVersionResponse(Version.CURRENT); enqueueSetupResponses(webServer, - templatesExistsAlready, includeOldTemplates, + true, remoteClusterAllowsWatcher, currentLicenseAllowsWatcher, watcherAlreadyExists); enqueueResponse(200, "{\"errors\": false}"); @@ -283,7 +279,7 @@ public void testExportWithBasePath() throws Exception { export(builder.build(), newRandomMonitoringDocs(nbDocs)); assertMonitorResources(webServer, - templatesExistsAlready, includeOldTemplates, + true, remoteClusterAllowsWatcher, currentLicenseAllowsWatcher, watcherAlreadyExists, headers, basePath); assertBulk(webServer, nbDocs, headers, basePath); @@ -294,19 +290,18 @@ public void testHostChangeReChecksTemplate() throws Exception { enqueueGetClusterVersionResponse(Version.CURRENT); enqueueSetupResponses(webServer, - templatesExistsAlready, includeOldTemplates, + true, remoteClusterAllowsWatcher, currentLicenseAllowsWatcher, watcherAlreadyExists); enqueueResponse(200, "{\"errors\": false}"); export(settings, Collections.singletonList(newRandomMonitoringDoc())); assertMonitorResources(webServer, - templatesExistsAlready, includeOldTemplates, + true, remoteClusterAllowsWatcher, currentLicenseAllowsWatcher, watcherAlreadyExists); assertBulk(webServer); try (MockWebServer secondWebServer = createMockWebServer()) { - String missingTemplate = null; final Settings newSettings = Settings.builder() .put(settings) @@ -314,43 +309,15 @@ public void testHostChangeReChecksTemplate() throws Exception { .build(); enqueueGetClusterVersionResponse(secondWebServer, Version.CURRENT); - // pretend that one of the templates is missing - for (Tuple template : monitoringTemplates(includeOldTemplates)) { - if (missingTemplate != null) { - enqueueResponse(secondWebServer, 200, "{\"" + template.v1() + "\":{\"version\":" + LAST_UPDATED_VERSION + "}}"); - } else { - missingTemplate = template.v1(); - - enqueueResponse(secondWebServer, 404, "template [" + template.v1() + "] does not exist"); - enqueueResponse(secondWebServer, 201, "template [" + template.v1() + "] created"); - } - } - // opposite of if it existed before - enqueueWatcherResponses(secondWebServer, remoteClusterAllowsWatcher, currentLicenseAllowsWatcher, watcherAlreadyExists); + enqueueSetupResponses(secondWebServer, true, remoteClusterAllowsWatcher, currentLicenseAllowsWatcher, + watcherAlreadyExists); enqueueResponse(secondWebServer, 200, "{\"errors\": false}"); // second event export(newSettings, Collections.singletonList(newRandomMonitoringDoc())); - assertMonitorVersion(secondWebServer); - - String resourcePrefix = "/_template/"; - for (Tuple template : monitoringTemplates(includeOldTemplates)) { - MockRequest recordedRequest = secondWebServer.takeRequest(); - assertThat(recordedRequest.getMethod(), equalTo("GET")); - assertThat(recordedRequest.getUri().getPath(), equalTo(resourcePrefix + template.v1())); - assertMonitorVersionQueryString(recordedRequest.getUri().getQuery(), Collections.emptyMap()); - - if (missingTemplate.equals(template.v1())) { - recordedRequest = secondWebServer.takeRequest(); - assertThat(recordedRequest.getMethod(), equalTo("PUT")); - assertThat(recordedRequest.getUri().getPath(), equalTo(resourcePrefix + template.v1())); - assertMonitorVersionQueryString(recordedRequest.getUri().getQuery(), Collections.emptyMap()); - assertThat(recordedRequest.getBody(), equalTo(getExternalTemplateRepresentation(template.v2()))); - } - } - assertMonitorWatches(secondWebServer, remoteClusterAllowsWatcher, currentLicenseAllowsWatcher, watcherAlreadyExists, - null, null); + assertMonitorResources(secondWebServer, true, remoteClusterAllowsWatcher, currentLicenseAllowsWatcher, + watcherAlreadyExists); assertBulk(secondWebServer); } } @@ -394,12 +361,50 @@ public void testUnsupportedClusterVersion() throws Exception { assertMonitorVersion(webServer); } + public void testRemoteTemplatesNotPresent() throws Exception { + final Settings settings = Settings.builder() + .put("xpack.monitoring.exporters._http.type", "http") + .put("xpack.monitoring.exporters._http.host", getFormattedAddress(webServer)) + .build(); + + // returning an unsupported cluster version + enqueueGetClusterVersionResponse(Version.CURRENT); + enqueueSetupResponses(webServer, + false, + remoteClusterAllowsWatcher, currentLicenseAllowsWatcher, watcherAlreadyExists); + + // ensure that the exporter is not able to be used + try (HttpExporter exporter = createHttpExporter(settings)) { + final CountDownLatch awaitResponseAndClose = new CountDownLatch(1); + + final ActionListener listener = ActionListener.wrap( + bulk -> { + assertNull(bulk); + + awaitResponseAndClose.countDown(); + }, + e -> fail(e.getMessage()) + ); + + exporter.openBulk(listener); + + // wait for it to actually respond + assertTrue(awaitResponseAndClose.await(15, TimeUnit.SECONDS)); + } + + // 1) version request, 2) first template get request + assertThat(webServer.requests(), hasSize(2)); + + assertMonitorVersion(webServer); + assertMonitorTemplates(webServer, false, null, null); + } + public void testDynamicIndexFormatChange() throws Exception { final Settings settings = baseSettings().build(); enqueueGetClusterVersionResponse(Version.CURRENT); enqueueSetupResponses(webServer, - templatesExistsAlready, includeOldTemplates, + true, remoteClusterAllowsWatcher, currentLicenseAllowsWatcher, watcherAlreadyExists); enqueueResponse(200, "{\"errors\": false, \"msg\": \"successful bulk request\"}"); @@ -407,7 +412,7 @@ public void testDynamicIndexFormatChange() throws Exception { export(settings, Collections.singletonList(doc)); assertMonitorResources(webServer, - templatesExistsAlready, includeOldTemplates, + true, remoteClusterAllowsWatcher, currentLicenseAllowsWatcher, watcherAlreadyExists); MockRequest recordedRequest = assertBulk(webServer); @@ -428,7 +433,7 @@ public void testDynamicIndexFormatChange() throws Exception { .build(); enqueueGetClusterVersionResponse(Version.CURRENT); - enqueueSetupResponses(webServer, true, includeOldTemplates, + enqueueSetupResponses(webServer, true, true, true, true); enqueueResponse(200, "{\"errors\": false, \"msg\": \"successful bulk request\"}"); @@ -440,7 +445,7 @@ public void testDynamicIndexFormatChange() throws Exception { String expectedMonitoringIndex = ".monitoring-es-" + TEMPLATE_VERSION + "-" + newTimeFormatter.format(Instant.ofEpochMilli(doc.getTimestamp())); - assertMonitorResources(webServer, true, includeOldTemplates, + assertMonitorResources(webServer, true, true, true, true); recordedRequest = assertBulk(webServer); @@ -469,34 +474,47 @@ private void assertMonitorVersion(final MockWebServer webServer, @Nullable final } private void assertMonitorResources(final MockWebServer webServer, - final boolean templateAlreadyExists, final boolean includeOldTemplates, + final boolean templateAlreadyExists, final boolean remoteClusterAllowsWatcher, final boolean currentLicenseAllowsWatcher, final boolean watcherAlreadyExists) throws Exception { - assertMonitorResources(webServer, templateAlreadyExists, includeOldTemplates, + assertMonitorResources(webServer, templateAlreadyExists, remoteClusterAllowsWatcher, currentLicenseAllowsWatcher, watcherAlreadyExists, null, null); } private void assertMonitorResources(final MockWebServer webServer, - final boolean templateAlreadyExists, final boolean includeOldTemplates, + final boolean templateAlreadyExists, final boolean remoteClusterAllowsWatcher, final boolean currentLicenseAllowsWatcher, final boolean watcherAlreadyExists, @Nullable final Map customHeaders, @Nullable final String basePath) throws Exception { assertMonitorVersion(webServer, customHeaders, basePath); - assertMonitorTemplates(webServer, templateAlreadyExists, includeOldTemplates, customHeaders, basePath); + assertMonitorTemplates(webServer, templateAlreadyExists, customHeaders, basePath); assertMonitorWatches(webServer, remoteClusterAllowsWatcher, currentLicenseAllowsWatcher, watcherAlreadyExists, customHeaders, basePath); } private void assertMonitorTemplates(final MockWebServer webServer, final boolean alreadyExists, - final boolean includeOldTemplates, @Nullable final Map customHeaders, @Nullable final String basePath) throws Exception { - final List> templates = monitoringTemplates(includeOldTemplates); + final String resourcePrefix = "/_template/"; + final String pathPrefix = basePathToAssertablePrefix(basePath); + + for (String resource : MonitoringTemplateRegistry.TEMPLATE_NAMES) { + final MockRequest getRequest = webServer.takeRequest(); + + assertThat(getRequest.getMethod(), equalTo("GET")); + assertThat(getRequest.getUri().getPath(), equalTo(pathPrefix + resourcePrefix + resource)); + assertMonitorVersionQueryString(getRequest.getUri().getQuery(), Collections.emptyMap()); + assertHeaders(getRequest, customHeaders); - assertMonitorVersionResource(webServer, alreadyExists, "/_template/", templates, customHeaders, basePath); + if (alreadyExists == false) { + // If the templates do not exist already, the resources simply short circuit on the first missing template + // and notifies the exporter to wait. + break; + } + } } private void assertMonitorVersionResource(final MockWebServer webServer, final boolean alreadyExists, @@ -723,33 +741,30 @@ private void enqueueGetClusterVersionResponse(MockWebServer mockWebServer, Versi } private void enqueueSetupResponses(final MockWebServer webServer, - final boolean templatesAlreadyExists, final boolean includeOldTemplates, + final boolean templatesAlreadyExists, final boolean remoteClusterAllowsWatcher, final boolean currentLicenseAllowsWatcher, final boolean watcherAlreadyExists) throws IOException { - enqueueTemplateResponses(webServer, templatesAlreadyExists, includeOldTemplates); + enqueueTemplateResponses(webServer, templatesAlreadyExists); enqueueWatcherResponses(webServer, remoteClusterAllowsWatcher, currentLicenseAllowsWatcher, watcherAlreadyExists); } - private void enqueueTemplateResponses(final MockWebServer webServer, - final boolean alreadyExists, final boolean includeOldTemplates) + private void enqueueTemplateResponses(final MockWebServer webServer, final boolean alreadyExists) throws IOException { if (alreadyExists) { - enqueueTemplateResponsesExistsAlready(webServer, includeOldTemplates); + enqueueTemplateResponsesExistsAlready(webServer); } else { - enqueueTemplateResponsesDoesNotExistYet(webServer, includeOldTemplates); + enqueueTemplateResponsesDoesNotExistYet(webServer); } } - private void enqueueTemplateResponsesDoesNotExistYet(final MockWebServer webServer, - final boolean includeOldTemplates) + private void enqueueTemplateResponsesDoesNotExistYet(final MockWebServer webServer) throws IOException { - enqueueVersionedResourceResponsesDoesNotExistYet(monitoringTemplateNames(includeOldTemplates), webServer); + enqueueVersionedResourceResponsesDoesNotExistYet(Arrays.asList(MonitoringTemplateRegistry.TEMPLATE_NAMES), webServer); } - private void enqueueTemplateResponsesExistsAlready(final MockWebServer webServer, - final boolean includeOldTemplates) + private void enqueueTemplateResponsesExistsAlready(final MockWebServer webServer) throws IOException { - enqueueVersionedResourceResponsesExistsAlready(monitoringTemplateNames(includeOldTemplates), webServer); + enqueueVersionedResourceResponsesExistsAlready(Arrays.asList(MonitoringTemplateRegistry.TEMPLATE_NAMES), webServer); } private void enqueueVersionedResourceResponsesDoesNotExistYet(final List names, final MockWebServer webServer) @@ -904,38 +919,6 @@ private MockWebServer createMockWebServer() throws IOException { return server; } - private List> monitoringTemplates(final boolean includeOldTemplates) { - return includeOldTemplates ? monitoringTemplatesWithOldTemplates() : monitoringTemplates(); - } - - // this can be removed in 7.0 - private List> monitoringTemplatesWithOldTemplates() { - final List> expectedTemplates = monitoringTemplates(); - - expectedTemplates.addAll( - Arrays.stream(MonitoringTemplateUtils.OLD_TEMPLATE_IDS) - .map(id -> new Tuple<>(MonitoringTemplateUtils.oldTemplateName(id), MonitoringTemplateUtils.createEmptyTemplate(id))) - .collect(Collectors.toList())); - - return expectedTemplates; - } - - private List monitoringTemplateNames(final boolean includeOldTemplates) { - return includeOldTemplates ? monitoringTemplateNamesWithOldTemplates() : monitoringTemplateNames(); - } - - // this can be removed in 7.0 - protected List monitoringTemplateNamesWithOldTemplates() { - final List expectedTemplateNames = monitoringTemplateNames(); - - expectedTemplateNames.addAll( - Arrays.stream(MonitoringTemplateUtils.OLD_TEMPLATE_IDS) - .map(MonitoringTemplateUtils::oldTemplateName) - .collect(Collectors.toList())); - - return expectedTemplateNames; - } - private String getExternalTemplateRepresentation(String internalRepresentation) throws IOException { try (XContentParser parser = XContentFactory.xContent(XContentType.JSON) .createParser(NamedXContentRegistry.EMPTY, LoggingDeprecationHandler.INSTANCE, internalRepresentation)) { diff --git a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/Monitoring.java b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/Monitoring.java index eb277fd68cb56..50688b621c0ff 100644 --- a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/Monitoring.java +++ b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/Monitoring.java @@ -123,7 +123,12 @@ public Collection createComponents(Client client, ClusterService cluster final MonitoringService monitoringService = new MonitoringService(settings, clusterService, threadPool, collectors, exporters); var usageServices = new MonitoringUsageServices(monitoringService, exporters); - return Arrays.asList(monitoringService, exporters, migrationCoordinator, cleanerService, usageServices); + + MonitoringTemplateRegistry templateRegistry = new MonitoringTemplateRegistry(settings, clusterService, threadPool, client, + xContentRegistry); + templateRegistry.initialize(); + + return Arrays.asList(monitoringService, exporters, migrationCoordinator, cleanerService, usageServices, templateRegistry); } @Override @@ -151,6 +156,7 @@ public List> getSettings() { settings.add(MonitoringService.ENABLED); settings.add(MonitoringService.ELASTICSEARCH_COLLECTION_ENABLED); settings.add(MonitoringService.INTERVAL); + settings.add(MonitoringTemplateRegistry.MONITORING_TEMPLATES_ENABLED); settings.add(Collector.INDICES); settings.add(ClusterStatsCollector.CLUSTER_STATS_TIMEOUT); settings.add(IndexRecoveryCollector.INDEX_RECOVERY_TIMEOUT); diff --git a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/MonitoringTemplateRegistry.java b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/MonitoringTemplateRegistry.java new file mode 100644 index 0000000000000..d4f14d70fb61c --- /dev/null +++ b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/MonitoringTemplateRegistry.java @@ -0,0 +1,199 @@ +/* + * 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.monitoring; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.elasticsearch.Version; +import org.elasticsearch.client.Client; +import org.elasticsearch.cluster.service.ClusterService; +import org.elasticsearch.common.settings.Setting; +import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.threadpool.ThreadPool; +import org.elasticsearch.xpack.core.ClientHelper; +import org.elasticsearch.xpack.core.monitoring.MonitoredSystem; +import org.elasticsearch.xpack.core.template.IndexTemplateConfig; +import org.elasticsearch.xpack.core.template.IndexTemplateRegistry; + +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.stream.Collectors; + +public class MonitoringTemplateRegistry extends IndexTemplateRegistry { + private static final Logger logger = LogManager.getLogger(MonitoringTemplateRegistry.class); + + /** + * The monitoring template registry version. This version number is normally incremented each change starting at "1", but + * the legacy monitoring templates used release version numbers within their version fields instead. Because of this, we + * continue to use the release version number in this registry, even though this is not standard practice for template + * registries. + */ + public static final int REGISTRY_VERSION = Version.V_7_14_0.id; + private static final String REGISTRY_VERSION_VARIABLE = "xpack.monitoring.template.release.version"; + + /** + * Current version of templates used in their name to differentiate from breaking changes (separate from product version). + * This would have been used for {@link MonitoringTemplateRegistry#REGISTRY_VERSION}, but the legacy monitoring + * template installation process used the release version of the last template change in the template version + * field instead. We keep it around to substitute into the template names. + */ + private static final String TEMPLATE_VERSION = "7"; + private static final String TEMPLATE_VERSION_VARIABLE = "xpack.monitoring.template.version"; + private static final Map ADDITIONAL_TEMPLATE_VARIABLES = Map.of(TEMPLATE_VERSION_VARIABLE, TEMPLATE_VERSION); + + public static final Setting MONITORING_TEMPLATES_ENABLED = Setting.boolSetting( + "xpack.monitoring.templates.enabled", + true, + Setting.Property.NodeScope, + Setting.Property.Dynamic + ); + + private final ClusterService clusterService; + private volatile boolean monitoringTemplatesEnabled; + + ////////////////////////////////////////////////////////// + // Alerts template (for matching the ".monitoring-alerts-${version}" index) + ////////////////////////////////////////////////////////// + public static final String ALERTS_INDEX_TEMPLATE_NAME = ".monitoring-alerts-7"; + public static final IndexTemplateConfig ALERTS_INDEX_TEMPLATE = new IndexTemplateConfig( + ALERTS_INDEX_TEMPLATE_NAME, + "/monitoring-alerts-7.json", + REGISTRY_VERSION, + REGISTRY_VERSION_VARIABLE, + ADDITIONAL_TEMPLATE_VARIABLES + ); + + ////////////////////////////////////////////////////////// + // Beats template (for matching ".monitoring-beats-${version}-*" indices) + ////////////////////////////////////////////////////////// + public static final String BEATS_INDEX_TEMPLATE_NAME = ".monitoring-beats"; + public static final IndexTemplateConfig BEATS_INDEX_TEMPLATE = new IndexTemplateConfig( + BEATS_INDEX_TEMPLATE_NAME, + "/monitoring-beats.json", + REGISTRY_VERSION, + REGISTRY_VERSION_VARIABLE, + ADDITIONAL_TEMPLATE_VARIABLES + ); + + ////////////////////////////////////////////////////////// + // ES template (for matching ".monitoring-es-${version}-*" indices) + ////////////////////////////////////////////////////////// + public static final String ES_INDEX_TEMPLATE_NAME = ".monitoring-es"; + public static final IndexTemplateConfig ES_INDEX_TEMPLATE = new IndexTemplateConfig( + ES_INDEX_TEMPLATE_NAME, + "/monitoring-es.json", + REGISTRY_VERSION, + REGISTRY_VERSION_VARIABLE, + ADDITIONAL_TEMPLATE_VARIABLES + ); + + ////////////////////////////////////////////////////////// + // Kibana template (for matching ".monitoring-kibana-${version}-*" indices) + ////////////////////////////////////////////////////////// + public static final String KIBANA_INDEX_TEMPLATE_NAME = ".monitoring-kibana"; + public static final IndexTemplateConfig KIBANA_INDEX_TEMPLATE = new IndexTemplateConfig( + KIBANA_INDEX_TEMPLATE_NAME, + "/monitoring-kibana.json", + REGISTRY_VERSION, + REGISTRY_VERSION_VARIABLE, + ADDITIONAL_TEMPLATE_VARIABLES + ); + + ////////////////////////////////////////////////////////// + // Logstash template (for matching ".monitoring-logstash-${version}-*" indices) + ////////////////////////////////////////////////////////// + public static final String LOGSTASH_INDEX_TEMPLATE_NAME = ".monitoring-logstash"; + public static final IndexTemplateConfig LOGSTASH_INDEX_TEMPLATE = new IndexTemplateConfig( + LOGSTASH_INDEX_TEMPLATE_NAME, + "/monitoring-logstash.json", + REGISTRY_VERSION, + REGISTRY_VERSION_VARIABLE, + ADDITIONAL_TEMPLATE_VARIABLES + ); + + public static final String[] TEMPLATE_NAMES = new String[]{ + ALERTS_INDEX_TEMPLATE_NAME, + BEATS_INDEX_TEMPLATE_NAME, + ES_INDEX_TEMPLATE_NAME, + KIBANA_INDEX_TEMPLATE_NAME, + LOGSTASH_INDEX_TEMPLATE_NAME + }; + + + private static final Map MONITORED_SYSTEM_CONFIG_LOOKUP = new HashMap<>(); + static { + MONITORED_SYSTEM_CONFIG_LOOKUP.put(MonitoredSystem.BEATS.getSystem(), BEATS_INDEX_TEMPLATE); + MONITORED_SYSTEM_CONFIG_LOOKUP.put(MonitoredSystem.ES.getSystem(), ES_INDEX_TEMPLATE); + MONITORED_SYSTEM_CONFIG_LOOKUP.put(MonitoredSystem.KIBANA.getSystem(), KIBANA_INDEX_TEMPLATE); + MONITORED_SYSTEM_CONFIG_LOOKUP.put(MonitoredSystem.LOGSTASH.getSystem(), LOGSTASH_INDEX_TEMPLATE); + } + + public static IndexTemplateConfig getTemplateConfigForMonitoredSystem(MonitoredSystem system) { + return Optional.ofNullable(MONITORED_SYSTEM_CONFIG_LOOKUP.get(system.getSystem())) + .orElseThrow(() -> new IllegalArgumentException("Invalid system [" + system + "]")); + } + + public MonitoringTemplateRegistry(Settings nodeSettings, ClusterService clusterService, ThreadPool threadPool, Client client, + NamedXContentRegistry xContentRegistry) { + super(nodeSettings, clusterService, threadPool, client, xContentRegistry); + this.clusterService = clusterService; + this.monitoringTemplatesEnabled = MONITORING_TEMPLATES_ENABLED.get(nodeSettings); + } + + @Override + public void initialize() { + super.initialize(); + clusterService.getClusterSettings().addSettingsUpdateConsumer(MONITORING_TEMPLATES_ENABLED, this::updateEnabledSetting); + } + + private void updateEnabledSetting(boolean newValue) { + if (newValue) { + monitoringTemplatesEnabled = true; + } else { + logger.info( + "monitoring templates [{}] will not be installed or reinstalled", + getLegacyTemplateConfigs().stream().map(IndexTemplateConfig::getTemplateName).collect(Collectors.joining(",")) + ); + monitoringTemplatesEnabled = false; + } + } + + @Override + protected List getLegacyTemplateConfigs() { + if (monitoringTemplatesEnabled) { + return Arrays.asList( + ALERTS_INDEX_TEMPLATE, + BEATS_INDEX_TEMPLATE, + ES_INDEX_TEMPLATE, + KIBANA_INDEX_TEMPLATE, + LOGSTASH_INDEX_TEMPLATE + ); + } else { + return Collections.emptyList(); + } + } + + @Override + protected String getOrigin() { + return ClientHelper.MONITORING_ORIGIN; + } + + @Override + protected boolean requiresMasterNode() { + // Monitoring templates have historically been installed from the master node of the cluster only. + // Other nodes use the existence of templates as a coordination barrier in some parts of the code. + // Templates should only be installed from the master node while we await the deprecation and + // removal of those features so as to avoid ordering issues with exporters. + return true; + } +} diff --git a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/http/HttpExporter.java b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/http/HttpExporter.java index 774e07b943714..b2c9fc8a853c6 100644 --- a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/http/HttpExporter.java +++ b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/http/HttpExporter.java @@ -40,10 +40,10 @@ import org.elasticsearch.common.util.concurrent.ThreadContext; import org.elasticsearch.common.util.set.Sets; import org.elasticsearch.license.XPackLicenseState.Feature; -import org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils; import org.elasticsearch.xpack.core.ssl.SSLConfigurationSettings; import org.elasticsearch.xpack.core.ssl.SSLService; import org.elasticsearch.xpack.monitoring.Monitoring; +import org.elasticsearch.xpack.monitoring.MonitoringTemplateRegistry; import org.elasticsearch.xpack.monitoring.exporter.ClusterAlertsUtil; import org.elasticsearch.xpack.monitoring.exporter.ExportBulk; import org.elasticsearch.xpack.monitoring.exporter.Exporter; @@ -324,12 +324,6 @@ public Iterator> settings() { public static final Setting.AffixSetting TEMPLATE_CHECK_TIMEOUT_SETTING = Setting.affixKeySetting("xpack.monitoring.exporters.","index.template.master_timeout", (key) -> Setting.timeSetting(key, TimeValue.MINUS_ONE, Property.Dynamic, Property.NodeScope), HTTP_TYPE_DEPENDENCY); - /** - * A boolean setting to enable or disable whether to create placeholders for the old templates. - */ - public static final Setting.AffixSetting TEMPLATE_CREATE_LEGACY_VERSIONS_SETTING = - Setting.affixKeySetting("xpack.monitoring.exporters.","index.template.create_legacy_templates", - (key) -> Setting.boolSetting(key, true, Property.Dynamic, Property.NodeScope), HTTP_TYPE_DEPENDENCY); /** * Minimum supported version of the remote monitoring cluster (same major). */ @@ -826,24 +820,8 @@ private static void configureTemplateResources(final Config config, TEMPLATE_CHECK_TIMEOUT_SETTING.getConcreteSettingForNamespace(config.name()).get(config.settings()); // add templates not managed by resolvers - for (final String templateId : MonitoringTemplateUtils.TEMPLATE_IDS) { - final String templateName = MonitoringTemplateUtils.templateName(templateId); - final Supplier templateLoader = () -> MonitoringTemplateUtils.loadTemplate(templateId); - - resources.add(new TemplateHttpResource(resourceOwnerName, templateTimeout, templateName, templateLoader)); - } - - // Add dummy templates (e.g. ".monitoring-es-6") to enable the ability to check which version of the actual - // index template (e.g. ".monitoring-es") should be applied. - boolean createLegacyTemplates = - TEMPLATE_CREATE_LEGACY_VERSIONS_SETTING.getConcreteSettingForNamespace(config.name()).get(config.settings()); - if (createLegacyTemplates) { - for (final String templateId : MonitoringTemplateUtils.OLD_TEMPLATE_IDS) { - final String templateName = MonitoringTemplateUtils.oldTemplateName(templateId); - final Supplier templateLoader = () -> MonitoringTemplateUtils.createEmptyTemplate(templateId); - - resources.add(new TemplateHttpResource(resourceOwnerName, templateTimeout, templateName, templateLoader)); - } + for (final String templateName : MonitoringTemplateRegistry.TEMPLATE_NAMES) { + resources.add(new TemplateHttpResource(resourceOwnerName, templateTimeout, templateName)); } } @@ -950,7 +928,7 @@ public void doClose() { } public static List> getDynamicSettings() { - return Arrays.asList(HOST_SETTING, TEMPLATE_CREATE_LEGACY_VERSIONS_SETTING, AUTH_USERNAME_SETTING, BULK_TIMEOUT_SETTING, + return Arrays.asList(HOST_SETTING, AUTH_USERNAME_SETTING, BULK_TIMEOUT_SETTING, CONNECTION_READ_TIMEOUT_SETTING, CONNECTION_TIMEOUT_SETTING, PROXY_BASE_PATH_SETTING, SNIFF_ENABLED_SETTING, TEMPLATE_CHECK_TIMEOUT_SETTING, SSL_SETTING, HEADERS_SETTING); } diff --git a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/http/TemplateHttpResource.java b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/http/TemplateHttpResource.java index a6ac7843e3fec..5d2880b80b5dd 100644 --- a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/http/TemplateHttpResource.java +++ b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/http/TemplateHttpResource.java @@ -6,32 +6,19 @@ */ package org.elasticsearch.xpack.monitoring.exporter.http; -import org.apache.http.HttpEntity; -import org.apache.http.entity.ContentType; -import org.apache.http.entity.StringEntity; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.elasticsearch.action.ActionListener; import org.elasticsearch.client.RestClient; -import org.elasticsearch.cluster.metadata.IndexTemplateMetadata; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils; -import java.io.IOException; import java.util.Collections; import java.util.Map; import java.util.Objects; import java.util.TreeMap; -import java.util.function.Supplier; /** * {@code TemplateHttpResource}s allow the checking and uploading of templates to a remote cluster. @@ -56,10 +43,6 @@ public class TemplateHttpResource extends PublishableHttpResource { * The name of the template that is sent to the remote cluster. */ private final String templateName; - /** - * Provides a fully formed template (e.g., no variables that need replaced). - */ - private final Supplier template; /** * Create a new {@link TemplateHttpResource}. @@ -67,14 +50,11 @@ public class TemplateHttpResource extends PublishableHttpResource { * @param resourceOwnerName The user-recognizable name. * @param masterTimeout Master timeout to use with any request. * @param templateName The name of the template (e.g., ".template123"). - * @param template The template provider. */ - public TemplateHttpResource(final String resourceOwnerName, @Nullable final TimeValue masterTimeout, - final String templateName, final Supplier template) { + public TemplateHttpResource(final String resourceOwnerName, @Nullable final TimeValue masterTimeout, final String templateName) { super(resourceOwnerName, masterTimeout, PARAMETERS); this.templateName = Objects.requireNonNull(templateName); - this.template = Objects.requireNonNull(template); } /** @@ -91,31 +71,12 @@ protected void doCheck(final RestClient client, final ActionListener li } /** - * Publish the missing {@linkplain #templateName template}. + * If a template source is given, then publish the missing {@linkplain #templateName template}. If a template + * is not provided to be installed, then signal that the resource is not ready until a valid one appears. */ @Override protected void doPublish(final RestClient client, final ActionListener listener) { - putResource(client, listener, logger, - "/_template", templateName, Collections.emptyMap(), this::templateToHttpEntity, "monitoring template", - resourceOwnerName, "monitoring cluster"); - } - - /** - * Create a {@link HttpEntity} for the {@link #template}. - * - * @return Never {@code null}. - */ - HttpEntity templateToHttpEntity() { - // the internal representation of a template has type nested under mappings. - // this uses xContent to help remove the type before sending to the remote cluster - try (XContentParser parser = XContentFactory.xContent(XContentType.JSON) - .createParser(NamedXContentRegistry.EMPTY, LoggingDeprecationHandler.INSTANCE, template.get())) { - XContentBuilder builder = JsonXContent.contentBuilder(); - IndexTemplateMetadata.Builder.removeType(IndexTemplateMetadata.Builder.fromXContent(parser, templateName), builder); - return new StringEntity(BytesReference.bytes(builder).utf8ToString(), ContentType.APPLICATION_JSON); - } catch (IOException ex) { - throw new IllegalStateException("Cannot serialize template [" + templateName + "] for monitoring export", ex); - } + listener.onResponse(ResourcePublishResult.notReady("waiting for remote monitoring cluster to install appropriate template " + + "[" + templateName + "] (version mismatch or missing)")); } - } diff --git a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/local/LocalExporter.java b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/local/LocalExporter.java index 07557ee2bf090..bad592de621c2 100644 --- a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/local/LocalExporter.java +++ b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/local/LocalExporter.java @@ -15,7 +15,6 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest; -import org.elasticsearch.action.admin.indices.template.put.PutIndexTemplateRequest; import org.elasticsearch.action.support.master.AcknowledgedResponse; import org.elasticsearch.client.Client; import org.elasticsearch.cluster.ClusterChangedEvent; @@ -51,6 +50,7 @@ import org.elasticsearch.xpack.core.watcher.transport.actions.put.PutWatchAction; import org.elasticsearch.xpack.core.watcher.watch.Watch; import org.elasticsearch.xpack.monitoring.Monitoring; +import org.elasticsearch.xpack.monitoring.MonitoringTemplateRegistry; import org.elasticsearch.xpack.monitoring.cleaner.CleanerService; import org.elasticsearch.xpack.monitoring.exporter.ClusterAlertsUtil; import org.elasticsearch.xpack.monitoring.exporter.ExportBulk; @@ -77,9 +77,6 @@ import static org.elasticsearch.common.Strings.collectionToCommaDelimitedString; import static org.elasticsearch.xpack.core.ClientHelper.MONITORING_ORIGIN; import static org.elasticsearch.xpack.core.ClientHelper.executeAsyncWithOrigin; -import static org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils.LAST_UPDATED_VERSION; -import static org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils.TEMPLATE_VERSION; -import static org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils.templateName; public class LocalExporter extends Exporter implements ClusterStateListener, CleanerService.Listener, LicenseStateListener { @@ -157,7 +154,7 @@ public void licenseStateChanged() { * * @return {@code true} if it is ready. {@code false} if not. */ - boolean isExporterReady() { + public boolean isExporterReady() { // forces the setup to occur if it hasn't already final boolean running = resolveBulk(clusterService.state(), false) != null; // Report on watcher readiness @@ -298,8 +295,8 @@ private boolean performSetup(ClusterState clusterState, boolean clusterStateChan */ private boolean setupIfNotElectedMaster(final ClusterState clusterState) { // any required template is not yet installed in the given cluster state, we'll wait. - for (final String template : MonitoringTemplateUtils.TEMPLATE_IDS) { - if (hasTemplate(clusterState, MonitoringTemplateUtils.templateName(template)) == false) { + for (final String template : MonitoringTemplateRegistry.TEMPLATE_NAMES) { + if (hasTemplate(clusterState, template) == false) { logger.debug("monitoring index template [{}] does not exist, so service cannot start (waiting on master)", template); return false; @@ -342,18 +339,19 @@ private boolean setupIfElectedMaster(final ClusterState clusterState, final bool final List asyncActions = new ArrayList<>(); final AtomicInteger pendingResponses = new AtomicInteger(0); - // Check that each required template exists, installing it if needed - final List missingTemplates = Arrays.stream(MonitoringTemplateUtils.TEMPLATE_IDS) - .filter(id -> hasTemplate(clusterState, templateName(id)) == false) + // Check that each required template exists. We can install the other resources needed while we wait for them to appear, so + // continue with the async installation and return the readiness at the end of the setup. + final List missingTemplates = Arrays.stream(MonitoringTemplateRegistry.TEMPLATE_NAMES) + .filter(name -> hasTemplate(clusterState, name) == false) .collect(Collectors.toList()); + boolean templatesInstalled = false; if (missingTemplates.isEmpty() == false) { - logger.debug((Supplier) () -> new ParameterizedMessage("template {} not found", missingTemplates)); - for (String templateId : missingTemplates) { - final String templateName = MonitoringTemplateUtils.templateName(templateId); - asyncActions.add(() -> putTemplate(templateName, MonitoringTemplateUtils.loadTemplate(templateId), - new ResponseActionListener<>("template", templateName, pendingResponses))); - } + // Check to see if the template installation is disabled. If it isn't, then we should say so in the log. + logger.debug((Supplier) () -> new ParameterizedMessage("monitoring index templates [{}] do not exist, so service " + + "cannot start (waiting on registered templates)", missingTemplates)); + } else { + templatesInstalled = true; } // avoid constantly trying to setup Watcher, which requires a lot of overhead and avoid attempting to setup during a cluster state @@ -371,12 +369,12 @@ private boolean setupIfElectedMaster(final ClusterState clusterState, final bool logger.trace("already installing something, waiting for install to complete"); return false; } - } else { + } else if (templatesInstalled) { logger.debug("monitoring index templates are installed on master node, service can start"); } - // everything is setup (or running) - return true; + // everything the exporter can do is setup (or running). Return status of templates. + return templatesInstalled; } private void setupClusterAlertsTasks(ClusterState clusterState, boolean clusterStateChange, List asyncActions, @@ -448,18 +446,7 @@ private void responseReceived(final AtomicInteger pendingResponses, final boolea private boolean hasTemplate(final ClusterState clusterState, final String templateName) { final IndexTemplateMetadata template = clusterState.getMetadata().getTemplates().get(templateName); - return template != null && hasValidVersion(template.getVersion(), LAST_UPDATED_VERSION); - } - - // FIXME this should use the IndexTemplateMetadataUpgrader - private void putTemplate(String template, String source, ActionListener listener) { - logger.debug("installing template [{}]", template); - - PutIndexTemplateRequest request = new PutIndexTemplateRequest(template).source(source, XContentType.JSON); - assert Thread.currentThread().isInterrupted() == false : "current thread has been interrupted before putting index template!!!"; - - executeAsyncWithOrigin(client.threadPool().getThreadContext(), MONITORING_ORIGIN, request, listener, - client.admin().indices()::putTemplate); + return template != null && hasValidVersion(template.getVersion(), MonitoringTemplateRegistry.REGISTRY_VERSION); } /** @@ -577,7 +564,7 @@ public void onCleanUpIndices(TimeValue retention) { .collect(Collectors.toSet()); // avoid deleting the current alerts index, but feel free to delete older ones - currents.add(".monitoring-alerts-" + TEMPLATE_VERSION); + currents.add(MonitoringTemplateRegistry.ALERTS_INDEX_TEMPLATE_NAME); Set indices = new HashSet<>(); for (ObjectObjectCursor index : clusterState.getMetadata().indices()) { diff --git a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/action/TransportMonitoringMigrateAlertsActionTests.java b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/action/TransportMonitoringMigrateAlertsActionTests.java index aec052678e937..63127a2365acd 100644 --- a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/action/TransportMonitoringMigrateAlertsActionTests.java +++ b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/action/TransportMonitoringMigrateAlertsActionTests.java @@ -42,12 +42,12 @@ import org.elasticsearch.xpack.core.monitoring.action.MonitoringMigrateAlertsAction; import org.elasticsearch.xpack.core.monitoring.action.MonitoringMigrateAlertsRequest; import org.elasticsearch.xpack.core.monitoring.action.MonitoringMigrateAlertsResponse; -import org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils; import org.elasticsearch.xpack.core.watcher.transport.actions.get.GetWatchAction; import org.elasticsearch.xpack.core.watcher.transport.actions.get.GetWatchRequest; import org.elasticsearch.xpack.core.watcher.watch.Watch; import org.elasticsearch.xpack.monitoring.Monitoring; import org.elasticsearch.xpack.monitoring.MonitoringService; +import org.elasticsearch.xpack.monitoring.MonitoringTemplateRegistry; import org.elasticsearch.xpack.monitoring.exporter.ClusterAlertsUtil; import org.elasticsearch.xpack.monitoring.exporter.http.HttpExporter; import org.elasticsearch.xpack.monitoring.exporter.local.LocalExporter; @@ -521,8 +521,7 @@ private void assertWatchesExist(boolean exist) { } protected List monitoringTemplateNames() { - return Arrays.stream(MonitoringTemplateUtils.TEMPLATE_IDS) - .map(MonitoringTemplateUtils::templateName) + return Arrays.stream(MonitoringTemplateRegistry.TEMPLATE_NAMES) .collect(Collectors.toList()); } diff --git a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/cleaner/AbstractIndicesCleanerTestCase.java b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/cleaner/AbstractIndicesCleanerTestCase.java index b638306faad82..42452cc6fc7ea 100644 --- a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/cleaner/AbstractIndicesCleanerTestCase.java +++ b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/cleaner/AbstractIndicesCleanerTestCase.java @@ -14,6 +14,7 @@ import org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils; import org.elasticsearch.xpack.monitoring.exporter.Exporter; import org.elasticsearch.xpack.monitoring.exporter.Exporters; +import org.elasticsearch.xpack.monitoring.exporter.local.LocalExporter; import org.elasticsearch.xpack.monitoring.test.MonitoringIntegTestCase; import org.junit.Before; @@ -22,6 +23,7 @@ import java.util.Locale; import static org.elasticsearch.test.ESIntegTestCase.Scope.TEST; +import static org.hamcrest.Matchers.is; @ClusterScope(scope = TEST, numDataNodes = 0, numClientNodes = 0) public abstract class AbstractIndicesCleanerTestCase extends MonitoringIntegTestCase { @@ -158,10 +160,14 @@ public void testRetentionAsGlobalSetting() throws Exception { assertIndicesCount(retention); } - protected CleanerService.Listener getListener() { + protected CleanerService.Listener getListener() throws Exception { Exporters exporters = internalCluster().getInstance(Exporters.class, internalCluster().getMasterName()); for (Exporter exporter : exporters.getEnabledExporters()) { if (exporter instanceof CleanerService.Listener) { + // Ensure that the exporter is initialized. + if (exporter instanceof LocalExporter) { + assertBusy(() -> assertThat(((LocalExporter) exporter).isExporterReady(), is(true))); + } return (CleanerService.Listener) exporter; } } diff --git a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/cleaner/local/LocalIndicesCleanerTests.java b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/cleaner/local/LocalIndicesCleanerTests.java index 9f357b9aa7ec8..858fa4e3cf523 100644 --- a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/cleaner/local/LocalIndicesCleanerTests.java +++ b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/cleaner/local/LocalIndicesCleanerTests.java @@ -17,7 +17,10 @@ import org.elasticsearch.xpack.monitoring.exporter.local.LocalExporter; import java.time.ZonedDateTime; +import java.util.ArrayList; import java.util.Collection; +import java.util.Iterator; +import java.util.List; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.hamcrest.Matchers.equalTo; @@ -51,8 +54,14 @@ protected void assertIndicesCount(int count) throws Exception { //in some cases. When the plugin security is enabled, it expands wildcards to the existing index, which then gets deleted, //so when es core gets the request with the explicit index name, it throws an index not found exception as that index //doesn't exist anymore. If we ignore unavailable instead no error will be thrown. - GetSettingsResponse getSettingsResponse = client().admin().indices().prepareGetSettings() + GetSettingsResponse getSettingsResponse = client().admin().indices().prepareGetSettings().addIndices(".monitoring-*") .setIndicesOptions(IndicesOptions.fromOptions(true, true, true, true, true)).get(); + Iterator indices = getSettingsResponse.getIndexToSettings().keysIt(); + List collectedIndices = new ArrayList<>(); + while (indices.hasNext()) { + String next = indices.next(); + collectedIndices.add(next); + } assertThat(getSettingsResponse.getIndexToSettings().size(), equalTo(count)); }); } diff --git a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/MonitoringTemplateUtilsTests.java b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/MonitoringTemplateUtilsTests.java index aa7762af3cd40..6c1de5c6352b6 100644 --- a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/MonitoringTemplateUtilsTests.java +++ b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/MonitoringTemplateUtilsTests.java @@ -9,71 +9,16 @@ import org.elasticsearch.common.time.DateFormatter; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.monitoring.MonitoredSystem; -import org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils; -import java.io.IOException; import java.time.ZoneOffset; import java.time.ZonedDateTime; -import static org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils.LAST_UPDATED_VERSION; -import static org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils.OLD_TEMPLATE_IDS; -import static org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils.OLD_TEMPLATE_VERSION; import static org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils.TEMPLATE_VERSION; import static org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils.indexName; -import static org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils.oldTemplateName; -import static org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils.templateName; -import static org.elasticsearch.xpack.core.template.TemplateUtilsTests.assertTemplate; -import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; -import static org.hamcrest.Matchers.greaterThan; -import static org.hamcrest.Matchers.notNullValue; public class MonitoringTemplateUtilsTests extends ESTestCase { - public void testTemplateName() { - assertThat(templateName("abc"), equalTo(".monitoring-abc")); - assertThat(templateName("XYZ"), equalTo(".monitoring-XYZ")); - assertThat(templateName("es"), equalTo(".monitoring-es")); - assertThat(templateName("kibana"), equalTo(".monitoring-kibana")); - assertThat(templateName("logstash"), equalTo(".monitoring-logstash")); - assertThat(templateName("beats"), equalTo(".monitoring-beats")); - } - - public void testOldTemplateName() { - assertThat(oldTemplateName("abc"), equalTo(".monitoring-abc-" + OLD_TEMPLATE_VERSION)); - assertThat(oldTemplateName("XYZ"), equalTo(".monitoring-XYZ-" + OLD_TEMPLATE_VERSION)); - assertThat(oldTemplateName("es"), equalTo(".monitoring-es-" + OLD_TEMPLATE_VERSION)); - assertThat(oldTemplateName("kibana"), equalTo(".monitoring-kibana-" + OLD_TEMPLATE_VERSION)); - assertThat(oldTemplateName("logstash"), equalTo(".monitoring-logstash-" + OLD_TEMPLATE_VERSION)); - assertThat(oldTemplateName("beats"), equalTo(".monitoring-beats-" + OLD_TEMPLATE_VERSION)); - } - - public void testLoadTemplate() throws IOException { - String source = MonitoringTemplateUtils.loadTemplate("test"); - - assertThat(source, notNullValue()); - assertThat(source.length(), greaterThan(0)); - assertTemplate(source, equalTo("{\n" + - " \"index_patterns\": \".monitoring-data-" + TEMPLATE_VERSION + "\",\n" + - " \"mappings\": {\n" + - " \"_doc\": {\n" + - " \"_meta\": {\n" + - " \"template.version\": \"" + TEMPLATE_VERSION + "\"\n" + - " }\n" + - " }\n" + - " }\n" + - "}\n")); - } - - public void testCreateEmptyTemplate() throws IOException { - final String id = randomFrom(OLD_TEMPLATE_IDS); - final String json = MonitoringTemplateUtils.createEmptyTemplate(id); - - // ensure that the index is created with the proper ID - assertThat(json, containsString("\".monitoring-" + id + "-" + OLD_TEMPLATE_VERSION + "*\"")); - assertThat(json, containsString("\"version\":" + LAST_UPDATED_VERSION)); - } - public void testIndexName() { final long timestamp = ZonedDateTime.of(2017, 8, 3, 13, 47, 58, 0, ZoneOffset.UTC).toInstant().toEpochMilli(); diff --git a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/http/HttpExporterResourceTests.java b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/http/HttpExporterResourceTests.java index ce46d0cceaab0..97a35d42f1367 100644 --- a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/http/HttpExporterResourceTests.java +++ b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/http/HttpExporterResourceTests.java @@ -10,6 +10,7 @@ import org.apache.http.StatusLine; import org.apache.http.entity.ContentType; import org.apache.http.entity.StringEntity; +import org.apache.http.util.EntityUtils; import org.elasticsearch.Version; import org.elasticsearch.client.Request; import org.elasticsearch.client.Response; @@ -38,8 +39,7 @@ import java.util.List; import java.util.stream.Collectors; -import static org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils.OLD_TEMPLATE_IDS; -import static org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils.TEMPLATE_IDS; +import static org.elasticsearch.xpack.monitoring.MonitoringTemplateRegistry.TEMPLATE_NAMES; import static org.elasticsearch.xpack.monitoring.exporter.http.AsyncHttpResourceHelper.whenPerformRequestAsyncWith; import static org.elasticsearch.xpack.monitoring.exporter.http.AsyncHttpResourceHelper.wrapMockListener; import static org.hamcrest.Matchers.hasSize; @@ -63,12 +63,11 @@ public class HttpExporterResourceTests extends AbstractPublishableHttpResourceTe private final XPackLicenseState licenseState = mock(XPackLicenseState.class); private final boolean remoteClusterHasWatcher = randomBoolean(); private final boolean validLicense = randomBoolean(); - private final boolean createOldTemplates = randomBoolean(); /** * kibana, logstash, and beats */ - private final int EXPECTED_TEMPLATES = TEMPLATE_IDS.length + (createOldTemplates ? OLD_TEMPLATE_IDS.length : 0); + private final int EXPECTED_TEMPLATES = TEMPLATE_NAMES.length; private final int EXPECTED_WATCHES = ClusterAlertsUtil.WATCH_IDS.length; private final RestClient client = mock(RestClient.class); @@ -76,9 +75,7 @@ public class HttpExporterResourceTests extends AbstractPublishableHttpResourceTe private final List templateNames = new ArrayList<>(EXPECTED_TEMPLATES); private final List watchNames = new ArrayList<>(EXPECTED_WATCHES); - private final Settings exporterSettings = Settings.builder() - .put("xpack.monitoring.exporters._http.index.template.create_legacy_templates", createOldTemplates) - .build(); + private final Settings exporterSettings = Settings.builder().build(); private final MultiHttpResource resources = HttpExporter.createResources( @@ -86,13 +83,7 @@ public class HttpExporterResourceTests extends AbstractPublishableHttpResourceTe @Before public void setupResources() { - templateNames.addAll(Arrays.stream(TEMPLATE_IDS).map(MonitoringTemplateUtils::templateName).collect(Collectors.toList())); - - if (createOldTemplates) { - templateNames.addAll( - Arrays.stream(OLD_TEMPLATE_IDS).map(MonitoringTemplateUtils::oldTemplateName).collect(Collectors.toList())); - } - + templateNames.addAll(Arrays.stream(TEMPLATE_NAMES).collect(Collectors.toList())); watchNames.addAll(Arrays.stream(ClusterAlertsUtil.WATCH_IDS).map(id -> "my_cluster_uuid_" + id).collect(Collectors.toList())); assertThat("Not all templates are supplied", templateNames, hasSize(EXPECTED_TEMPLATES)); @@ -132,7 +123,7 @@ public void testTemplateCheckBlocksAfterSuccessfulVersion() { final Exception exception = failureGetException(); final boolean firstSucceeds = randomBoolean(); int expectedGets = 1; - int expectedPuts = 0; + final ResourcePublishResult expectedResult; whenValidVersionResponse(); @@ -158,69 +149,35 @@ public void testTemplateCheckBlocksAfterSuccessfulVersion() { // last check fails implies that N - 2 publishes succeeded! whenPerformRequestAsyncWith(client, new RequestMatcher(is("GET"), startsWith("/_template/")), first, otherResponses, exception); - whenSuccessfulPutTemplates(otherResponses.size() + 1); - - expectedGets += 1 + successful + unsuccessful; - expectedPuts = (successfulFirst ? 0 : 1) + unsuccessful; - } else { - whenPerformRequestAsyncWith(client, new RequestMatcher(is("GET"), startsWith("/_template/")), exception); - } - - assertTrue(resources.isDirty()); - awaitCheckAndPublish(null); - // ensure it didn't magically become not-dirty - assertTrue(resources.isDirty()); - - verifyVersionCheck(); - verifyGetTemplates(expectedGets); - verifyPutTemplates(expectedPuts); - verifyNoMoreInteractions(client); - } - - public void testTemplatePublishBlocksAfterSuccessfulVersion() { - final Exception exception = failurePutException(); - final boolean firstSucceeds = randomBoolean(); - int expectedGets = 1; - int expectedPuts = 1; - - whenValidVersionResponse(); - - // failure in the middle of various templates being checked/published; suggests a node dropped - if (firstSucceeds) { - final Response firstSuccess = successfulPutResponse(); - // -2 from one success + a necessary failure after it! - final int extraPasses = randomIntBetween(0, EXPECTED_TEMPLATES - 2); - final int successful = randomIntBetween(0, extraPasses); - final int unsuccessful = extraPasses - successful; - - final List otherResponses = successfulPutResponses(unsuccessful); - // first one passes for sure, so we need an extra "unsuccessful" GET - whenGetTemplates(successful, unsuccessful + 2); - - // previous publishes must have succeeded - whenPerformRequestAsyncWith(client, new RequestMatcher(is("PUT"), startsWith("/_template/")), - firstSuccess, otherResponses, exception); + // Since we return a "Not Ready" response on any templates that are not available (instead + // of trying to publish them), we set the expected number of gets to be the first run of successful responses + // plus the first failure + if (successfulFirst) { + expectedGets += successful + 1; // the string of successes, then the last failure. + } - // GETs required for each PUT attempt (first is guaranteed "unsuccessful") - expectedGets += successful + unsuccessful + 1; - // unsuccessful are PUT attempts + the guaranteed successful PUT (first) - expectedPuts += unsuccessful + 1; + if (unsuccessful == 0) { + // There is only going to be one response, and it will be an exception + expectedResult = null; + } else { + // The first bad response will be either a 404 or a template with an old version + String missingTemplateName = TEMPLATE_NAMES[expectedGets - 1]; + expectedResult = new ResourcePublishResult(false, "waiting for remote monitoring cluster to install " + + "appropriate template [" + missingTemplateName + "] (version mismatch or missing)", HttpResource.State.DIRTY); + } } else { - // fail the check so that it has to attempt the PUT - whenGetTemplates(0, 1); - - whenPerformRequestAsyncWith(client, new RequestMatcher(is("PUT"), startsWith("/_template/")), exception); + whenPerformRequestAsyncWith(client, new RequestMatcher(is("GET"), startsWith("/_template/")), exception); + expectedResult = null; } assertTrue(resources.isDirty()); - awaitCheckAndPublish(null); + awaitCheckAndPublish(resources, expectedResult); // ensure it didn't magically become not-dirty assertTrue(resources.isDirty()); verifyVersionCheck(); verifyGetTemplates(expectedGets); - verifyPutTemplates(expectedPuts); verifyNoMoreInteractions(client); } @@ -230,8 +187,7 @@ public void testWatcherCheckBlocksAfterSuccessfulTemplatePublish() { final Exception exception = failureGetException(); whenValidVersionResponse(); - whenGetTemplates(successfulGetTemplates, unsuccessfulGetTemplates); - whenSuccessfulPutTemplates(unsuccessfulGetTemplates); + whenGetTemplates(EXPECTED_TEMPLATES); // there's only one check whenPerformRequestAsyncWith(client, new RequestMatcher(is("GET"), is("/_xpack")), exception); @@ -243,22 +199,18 @@ public void testWatcherCheckBlocksAfterSuccessfulTemplatePublish() { verifyVersionCheck(); verifyGetTemplates(EXPECTED_TEMPLATES); - verifyPutTemplates(unsuccessfulGetTemplates); verifyWatcherCheck(); verifyNoMoreInteractions(client); } public void testWatchCheckBlocksAfterSuccessfulWatcherCheck() { - final int successfulGetTemplates = randomIntBetween(0, EXPECTED_TEMPLATES); - final int unsuccessfulGetTemplates = EXPECTED_TEMPLATES - successfulGetTemplates; final Exception exception = validLicense ? failureGetException() : failureDeleteException(); final boolean firstSucceeds = randomBoolean(); int expectedGets = 1; int expectedPuts = 0; whenValidVersionResponse(); - whenGetTemplates(successfulGetTemplates, unsuccessfulGetTemplates); - whenSuccessfulPutTemplates(unsuccessfulGetTemplates); + whenGetTemplates(EXPECTED_TEMPLATES); whenWatcherCanBeUsed(validLicense); // failure in the middle of various watches being checked/published; suggests a node dropped @@ -309,7 +261,6 @@ public void testWatchCheckBlocksAfterSuccessfulWatcherCheck() { verifyVersionCheck(); verifyGetTemplates(EXPECTED_TEMPLATES); - verifyPutTemplates(unsuccessfulGetTemplates); verifyWatcherCheck(); if (validLicense) { verifyGetWatches(expectedGets); @@ -321,16 +272,13 @@ public void testWatchCheckBlocksAfterSuccessfulWatcherCheck() { } public void testWatchPublishBlocksAfterSuccessfulWatcherCheck() { - final int successfulGetTemplates = randomIntBetween(0, EXPECTED_TEMPLATES); - final int unsuccessfulGetTemplates = EXPECTED_TEMPLATES - successfulGetTemplates; final Exception exception = failurePutException(); final boolean firstSucceeds = randomBoolean(); int expectedGets = 1; int expectedPuts = 1; whenValidVersionResponse(); - whenGetTemplates(successfulGetTemplates, unsuccessfulGetTemplates); - whenSuccessfulPutTemplates(unsuccessfulGetTemplates); + whenGetTemplates(EXPECTED_TEMPLATES); // license needs to be valid, otherwise we'll do DELETEs, which are tested earlier whenWatcherCanBeUsed(true); @@ -369,7 +317,6 @@ public void testWatchPublishBlocksAfterSuccessfulWatcherCheck() { verifyVersionCheck(); verifyGetTemplates(EXPECTED_TEMPLATES); - verifyPutTemplates(unsuccessfulGetTemplates); verifyWatcherCheck(); verifyGetWatches(expectedGets); verifyPutWatches(expectedPuts); @@ -377,13 +324,10 @@ public void testWatchPublishBlocksAfterSuccessfulWatcherCheck() { } public void testDeployClusterAlerts() { - final int successfulGetTemplates = randomIntBetween(0, EXPECTED_TEMPLATES); - final int unsuccessfulGetTemplates = EXPECTED_TEMPLATES - successfulGetTemplates; final Exception exception = failurePutException(); whenValidVersionResponse(); - whenGetTemplates(successfulGetTemplates, unsuccessfulGetTemplates); - whenSuccessfulPutTemplates(unsuccessfulGetTemplates); + whenGetTemplates(EXPECTED_TEMPLATES); // license needs to be valid, otherwise we'll do DELETEs, which are tested earlier whenWatcherCanBeUsed(true); @@ -412,7 +356,6 @@ public void testDeployClusterAlerts() { verifyVersionCheck(); verifyGetTemplates(EXPECTED_TEMPLATES); - verifyPutTemplates(unsuccessfulGetTemplates); verifyWatcherCheck(); verifyGetWatches(0); verifyPutWatches(0); @@ -421,14 +364,11 @@ public void testDeployClusterAlerts() { } public void testSuccessfulChecksOnElectedMasterNode() { - final int successfulGetTemplates = randomIntBetween(0, EXPECTED_TEMPLATES); - final int unsuccessfulGetTemplates = EXPECTED_TEMPLATES - successfulGetTemplates; final int successfulGetWatches = randomIntBetween(0, EXPECTED_WATCHES); final int unsuccessfulGetWatches = EXPECTED_WATCHES - successfulGetWatches; whenValidVersionResponse(); - whenGetTemplates(successfulGetTemplates, unsuccessfulGetTemplates); - whenSuccessfulPutTemplates(unsuccessfulGetTemplates); + whenGetTemplates(EXPECTED_TEMPLATES); if (remoteClusterHasWatcher) { whenWatcherCanBeUsed(validLicense); if (validLicense) { @@ -449,7 +389,6 @@ public void testSuccessfulChecksOnElectedMasterNode() { verifyVersionCheck(); verifyGetTemplates(EXPECTED_TEMPLATES); - verifyPutTemplates(unsuccessfulGetTemplates); verifyWatcherCheck(); if (remoteClusterHasWatcher) { if (validLicense) { @@ -473,12 +412,9 @@ public void testSuccessfulChecksIfNotElectedMasterNode() { HttpExporter.createResources( new Exporter.Config("_http", "http", exporterSettings, clusterService, licenseState)).allResources; - final int successfulGetTemplates = randomIntBetween(0, EXPECTED_TEMPLATES); - final int unsuccessfulGetTemplates = EXPECTED_TEMPLATES - successfulGetTemplates; whenValidVersionResponse(); - whenGetTemplates(successfulGetTemplates, unsuccessfulGetTemplates); - whenSuccessfulPutTemplates(unsuccessfulGetTemplates); + whenGetTemplates(EXPECTED_TEMPLATES); assertTrue(resources.isDirty()); @@ -490,7 +426,6 @@ public void testSuccessfulChecksIfNotElectedMasterNode() { verifyVersionCheck(); verifyGetTemplates(EXPECTED_TEMPLATES); - verifyPutTemplates(unsuccessfulGetTemplates); verifyNoMoreInteractions(client); } @@ -533,17 +468,31 @@ private Response unsuccessfulGetWatchResponse(final String watchId) { private Response successfulGetResourceResponse(final String resourcePath, final String resourceName) { final HttpEntity goodEntity = entityForResource(true, resourceName, MonitoringTemplateUtils.LAST_UPDATED_VERSION); - + if (logger.isTraceEnabled()) { + try { + logger.trace("Generated HTTP response for resource [{}]: [{}]", resourceName, EntityUtils.toString(goodEntity)); + } catch (IOException e) { + logger.warn("Generated HTTP response for resource [" + resourceName + "] that cannot be deserialized!", e); + } + } return response("GET", resourcePath + resourceName, successfulCheckStatus(), goodEntity); } private Response unsuccessfulGetResourceResponse(final String resourcePath, final String resourceName) { if (randomBoolean()) { final HttpEntity badEntity = entityForResource(false, resourceName, MonitoringTemplateUtils.LAST_UPDATED_VERSION); + if (logger.isTraceEnabled()) { + try { + logger.trace("Generated bad HTTP entity for resource [{}]: [{}]", resourceName, EntityUtils.toString(badEntity)); + } catch (IOException e) { + logger.warn("Generated bad HTTP response for resource [" + resourceName + "] that cannot be deserialized!", e); + } + } return response("GET", resourcePath + resourceName, successfulCheckStatus(), badEntity); } + logger.trace("Generated NOT FOUND response for resource [{}]", resourceName); return unsuccessfulGetResponse(); } @@ -623,19 +572,12 @@ private void whenValidVersionResponse() { whenPerformRequestAsyncWith(client, new RequestMatcher(is("GET"), is("/")), versionResponse); } - private void whenGetTemplates(final int successful, final int unsuccessful) { - final List gets = getTemplateResponses(0, successful, unsuccessful); + private void whenGetTemplates(final int successful) { + final List gets = getTemplateResponses(0, successful, 0); whenPerformRequestAsyncWith(client, new RequestMatcher(is("GET"), startsWith("/_template/")), gets); } - private void whenSuccessfulPutTemplates(final int successful) { - final List successfulPuts = successfulPutResponses(successful); - - // empty is possible if they all exist - whenPerformRequestAsyncWith(client, new RequestMatcher(is("PUT"), startsWith("/_template/")), successfulPuts); - } - private void whenWatcherCanBeUsed(final boolean validLicense) { final Metadata metadata = mock(Metadata.class); diff --git a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/http/HttpExporterTests.java b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/http/HttpExporterTests.java index e2c932119ff56..ed5a0deb5e2ae 100644 --- a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/http/HttpExporterTests.java +++ b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/http/HttpExporterTests.java @@ -28,6 +28,7 @@ import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.ssl.SSLService; +import org.elasticsearch.xpack.monitoring.MonitoringTemplateRegistry; import org.elasticsearch.xpack.monitoring.exporter.ClusterAlertsUtil; import org.elasticsearch.xpack.monitoring.exporter.ExportBulk; import org.elasticsearch.xpack.monitoring.exporter.Exporter; @@ -47,8 +48,6 @@ import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; -import static org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils.OLD_TEMPLATE_IDS; -import static org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils.TEMPLATE_IDS; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasSize; @@ -388,7 +387,6 @@ public void testCreateSniffer() throws IOException { public void testCreateResources() { final boolean clusterAlertManagement = randomBoolean(); - final boolean createOldTemplates = randomBoolean(); final TimeValue templateTimeout = randomFrom(TimeValue.timeValueSeconds(30), null); final Settings.Builder builder = Settings.builder() @@ -398,10 +396,6 @@ public void testCreateResources() { builder.put("xpack.monitoring.exporters._http.cluster_alerts.management.enabled", false); } - if (createOldTemplates == false) { - builder.put("xpack.monitoring.exporters._http.index.template.create_legacy_templates", false); - } - if (templateTimeout != null) { builder.put("xpack.monitoring.exporters._http.index.template.master_timeout", templateTimeout.getStringRep()); } @@ -434,7 +428,7 @@ public void testCreateResources() { assertThat(multiResource.getResources().size(), equalTo(version + templates.size() + watcherCheck.size())); assertThat(version, equalTo(1)); - assertThat(templates, hasSize(createOldTemplates ? TEMPLATE_IDS.length + OLD_TEMPLATE_IDS.length : TEMPLATE_IDS.length)); + assertThat(templates, hasSize(MonitoringTemplateRegistry.TEMPLATE_NAMES.length)); assertThat(watcherCheck, hasSize(clusterAlertManagement ? 1 : 0)); assertThat(watches, hasSize(clusterAlertManagement ? ClusterAlertsUtil.WATCH_IDS.length : 0)); diff --git a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/http/TemplateHttpResourceTests.java b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/http/TemplateHttpResourceTests.java index e49e33cbdb81a..92f9626325641 100644 --- a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/http/TemplateHttpResourceTests.java +++ b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/http/TemplateHttpResourceTests.java @@ -7,17 +7,18 @@ package org.elasticsearch.xpack.monitoring.exporter.http; import org.apache.http.HttpEntity; -import org.apache.http.entity.ContentType; -import org.apache.http.entity.StringEntity; +import org.apache.lucene.util.SetOnce; import org.elasticsearch.Version; +import org.elasticsearch.action.ActionListener; +import org.elasticsearch.client.RestClient; import org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils; -import java.io.IOException; -import java.io.InputStream; -import java.util.Collections; import java.util.function.Supplier; import static org.hamcrest.Matchers.is; +import static org.hamcrest.Matchers.notNullValue; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verifyZeroInteractions; /** * Tests {@link TemplateHttpResource}. @@ -34,25 +35,7 @@ public class TemplateHttpResourceTests extends AbstractPublishableHttpResourceTe private final Supplier template = () -> templateValueInternal; private final int minimumVersion = Math.min(MonitoringTemplateUtils.LAST_UPDATED_VERSION, Version.CURRENT.id); - private final TemplateHttpResource resource = new TemplateHttpResource(owner, masterTimeout, templateName, template); - - public void testTemplateToHttpEntity() throws IOException { - //the internal representation is converted to the external representation for the resource - final byte[] templateValueBytes = templateValueExternal.getBytes(ContentType.APPLICATION_JSON.getCharset()); - final HttpEntity entity = resource.templateToHttpEntity(); - - assertThat(entity.getContentType().getValue(), is(ContentType.APPLICATION_JSON.toString())); - - final InputStream byteStream = entity.getContent(); - - assertThat(byteStream.available(), is(templateValueBytes.length)); - - for (final byte templateByte : templateValueBytes) { - assertThat(templateByte, is((byte)byteStream.read())); - } - - assertThat(byteStream.available(), is(0)); - } + private final TemplateHttpResource resource = new TemplateHttpResource(owner, masterTimeout, templateName); public void testDoCheckExists() { final HttpEntity entity = entityForResource(true, templateName, minimumVersion); @@ -84,12 +67,18 @@ public void testDoCheckError() { } } - public void testDoPublishTrue() { - assertPublishSucceeds(resource, "/_template", templateName, Collections.emptyMap(), StringEntity.class); - } - - public void testDoPublishFalseWithException() { - assertPublishWithException(resource, "/_template", templateName, Collections.emptyMap(), StringEntity.class); + public void testDoPublishFalseWithNonPublishedResource() { + RestClient mockClient = mock(RestClient.class); + SetOnce result = new SetOnce<>(); + resource.doPublish(mockClient, ActionListener.wrap(result::set, + e -> {throw new RuntimeException("Unexpected exception", e);})); + verifyZeroInteractions(mockClient); // Should not have used the client at all. + HttpResource.ResourcePublishResult resourcePublishResult = result.get(); + assertThat(resourcePublishResult, notNullValue()); + assertThat(resourcePublishResult.getResourceState(), notNullValue()); + assertThat(resourcePublishResult.getResourceState(), is(HttpResource.State.DIRTY)); + assertThat(resourcePublishResult.getReason(), + is("waiting for remote monitoring cluster to install appropriate template [.my_template] (version mismatch or missing)")); } public void testParameters() { diff --git a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/local/LocalExporterResourceIntegTests.java b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/local/LocalExporterResourceIntegTests.java index 78c4a8defd70c..c2fc28b1ce1a7 100644 --- a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/local/LocalExporterResourceIntegTests.java +++ b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/local/LocalExporterResourceIntegTests.java @@ -24,6 +24,7 @@ import org.elasticsearch.xpack.core.monitoring.MonitoredSystem; import org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils; import org.elasticsearch.xpack.core.watcher.transport.actions.put.PutWatchAction; +import org.elasticsearch.xpack.monitoring.MonitoringTemplateRegistry; import org.elasticsearch.xpack.monitoring.exporter.ClusterAlertsUtil; import org.elasticsearch.xpack.monitoring.exporter.MonitoringMigrationCoordinator; @@ -58,7 +59,8 @@ protected Settings nodeSettings(int nodeOrdinal, Settings otherSettings) { .build(); } - private final MonitoredSystem system = randomFrom(MonitoredSystem.values()); + private final MonitoredSystem system = randomFrom(MonitoredSystem.ES, MonitoredSystem.BEATS, MonitoredSystem.KIBANA, + MonitoredSystem.LOGSTASH); public void testCreateWhenResourcesNeedToBeAddedOrUpdated() throws Exception { assumeFalse("https://github.com/elastic/elasticsearch/issues/68608", Constants.MAC_OS_X); @@ -178,7 +180,7 @@ private void putResources(final Integer version) throws Exception { } private void putTemplate(final Integer version) throws Exception { - final String templateName = MonitoringTemplateUtils.templateName(system.getSystem()); + final String templateName = MonitoringTemplateRegistry.getTemplateConfigForMonitoredSystem(system).getTemplateName(); final BytesReference source = generateTemplateSource(templateName, version); assertAcked(client().admin().indices().preparePutTemplate(templateName).setSource(source, XContentType.JSON).get()); @@ -248,7 +250,7 @@ private int newEnoughVersion() { } private void assertTemplatesExist() { - for (String templateName : monitoringTemplateNames()) { + for (String templateName : MonitoringTemplateRegistry.TEMPLATE_NAMES) { assertTemplateInstalled(templateName); } } @@ -310,7 +312,7 @@ private void assertResourcesExist() throws Exception { } private void assertTemplateNotUpdated() { - final String name = MonitoringTemplateUtils.templateName(system.getSystem()); + final String name = MonitoringTemplateRegistry.getTemplateConfigForMonitoredSystem(system).getTemplateName(); for (IndexTemplateMetadata template : client().admin().indices().prepareGetTemplates(name).get().getIndexTemplates()) { final String docMapping = template.getMappings().toString(); diff --git a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/test/MonitoringIntegTestCase.java b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/test/MonitoringIntegTestCase.java index 7f8652fd136df..b50a269809f53 100644 --- a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/test/MonitoringIntegTestCase.java +++ b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/test/MonitoringIntegTestCase.java @@ -19,9 +19,9 @@ import org.elasticsearch.test.ESIntegTestCase; import org.elasticsearch.test.store.MockFSIndexStore; import org.elasticsearch.test.transport.MockTransportService; -import org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils; import org.elasticsearch.xpack.monitoring.LocalStateMonitoring; import org.elasticsearch.xpack.monitoring.MonitoringService; +import org.elasticsearch.xpack.monitoring.MonitoringTemplateRegistry; import org.elasticsearch.xpack.monitoring.exporter.ClusterAlertsUtil; import org.junit.After; import org.junit.Before; @@ -75,7 +75,7 @@ protected Collection> nodePlugins() { @Override protected Set excludeTemplates() { - return new HashSet<>(monitoringTemplateNames()); + return new HashSet<>(Arrays.asList(MonitoringTemplateRegistry.TEMPLATE_NAMES)); } @Before @@ -122,18 +122,6 @@ protected void ensureMonitoringIndicesYellow() { ensureYellowAndNoInitializingShards(".monitoring-es-*"); } - protected List> monitoringTemplates() { - return Arrays.stream(MonitoringTemplateUtils.TEMPLATE_IDS) - .map(id -> new Tuple<>(MonitoringTemplateUtils.templateName(id), MonitoringTemplateUtils.loadTemplate(id))) - .collect(Collectors.toList()); - } - - protected List monitoringTemplateNames() { - return Arrays.stream(MonitoringTemplateUtils.TEMPLATE_IDS) - .map(MonitoringTemplateUtils::templateName) - .collect(Collectors.toList()); - } - protected List> monitoringWatches() { final ClusterService clusterService = clusterService(); From 609a7321b288b736b77a9504bdd66a52132a853d Mon Sep 17 00:00:00 2001 From: Bo Andersen Date: Tue, 5 Oct 2021 20:10:08 +0200 Subject: [PATCH 175/250] [DOCS] Added missing backtick for code snippet (#78241) --- docs/reference/indices/field-usage-stats.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference/indices/field-usage-stats.asciidoc b/docs/reference/indices/field-usage-stats.asciidoc index 599f82aabbfd9..d63faffb25fde 100644 --- a/docs/reference/indices/field-usage-stats.asciidoc +++ b/docs/reference/indices/field-usage-stats.asciidoc @@ -22,7 +22,7 @@ GET /my-index-000001/_field_usage_stats [[field-usage-stats-api-request]] ==== {api-request-title} -`GET //_field_usage_stats +`GET //_field_usage_stats` [[field-usage-stats-api-request-prereqs]] ==== {api-prereq-title} From dbb8a015ad90aadc3a482d6c7bc9f3313aef4b33 Mon Sep 17 00:00:00 2001 From: James Rodewig <40268737+jrodewig@users.noreply.github.com> Date: Tue, 5 Oct 2021 14:14:29 -0400 Subject: [PATCH 176/250] [DOCS] Fix typos in flattened field type docs --- docs/reference/mapping/types/flattened.asciidoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/reference/mapping/types/flattened.asciidoc b/docs/reference/mapping/types/flattened.asciidoc index 82dd988aa99b0..00d01ba9a9505 100644 --- a/docs/reference/mapping/types/flattened.asciidoc +++ b/docs/reference/mapping/types/flattened.asciidoc @@ -29,7 +29,7 @@ document content, as it treats all values as keywords and does not provide full search functionality. The default approach, where each subfield has its own entry in the mappings, works well in the majority of cases. -An flattened object field can be created as follows: +A flattened object field can be created as follows: [source,console] -------------------------------- @@ -112,7 +112,7 @@ When querying, it is not possible to refer to field keys using wildcards, as in `range`, treat the values as string keywords. Highlighting is not supported on `flattened` fields. -It is possible to sort on an flattened object field, as well as perform simple +It is possible to sort on a flattened object field, as well as perform simple keyword-style aggregations such as `terms`. As with queries, there is no special support for numerics -- all values in the JSON object are treated as keywords. When sorting, this implies that values are compared From 88525f074e5ed0078462501d5e73bb0e5bf8c1b0 Mon Sep 17 00:00:00 2001 From: Nik Everett Date: Tue, 5 Oct 2021 14:27:20 -0400 Subject: [PATCH 177/250] TSDB: Feature flag is more builds (#78705) * TSDB: Feature flag is more builds This adds the tsdb feature flag for `index.mode` to the data streams rest tests. Without this the rest tests fail when we run a non-snapshot build. They more than fail - they trip an assertion. :wq * Another one --- .../test/indices.put_settings/10_basic.yml | 9 ++++++ .../plugin/data-streams/qa/rest/build.gradle | 3 ++ .../data_stream/160_unsupported_setting.yml | 32 +++++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/160_unsupported_setting.yml diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/indices.put_settings/10_basic.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/indices.put_settings/10_basic.yml index d16ca152eb6ec..00cdd287f06df 100644 --- a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/indices.put_settings/10_basic.yml +++ b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/indices.put_settings/10_basic.yml @@ -126,3 +126,12 @@ setup: test-index.settings.index.query_string.lenient: "true" - match: test-index.settings.index.translog.durability: "async" + +--- +put unsupported setting: + - do: + catch: bad_request + indices.put_settings: + index: test-index + body: + garbage: garbage diff --git a/x-pack/plugin/data-streams/qa/rest/build.gradle b/x-pack/plugin/data-streams/qa/rest/build.gradle index eaf3de5923419..80e3647638994 100644 --- a/x-pack/plugin/data-streams/qa/rest/build.gradle +++ b/x-pack/plugin/data-streams/qa/rest/build.gradle @@ -21,6 +21,9 @@ testClusters.configureEach { // disable ILM history, since it disturbs tests using _all setting 'indices.lifecycle.history_index_enabled', 'false' setting 'xpack.security.enabled', 'false' + if (BuildParams.isSnapshotBuild() == false) { + systemProperty 'es.index_mode_feature_flag_registered', 'true' + } } if (BuildParams.inFipsJvm){ // These fail in CI but only when run as part of checkPart2 and not individually. diff --git a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/160_unsupported_setting.yml b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/160_unsupported_setting.yml new file mode 100644 index 0000000000000..d74bd2e598a86 --- /dev/null +++ b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/160_unsupported_setting.yml @@ -0,0 +1,32 @@ +bad setting fails: + - skip: + version: all + reason: https://github.com/elastic/elasticsearch/issues/78677 + features: allowed_warnings + + - do: + allowed_warnings: + - "index template [tsdbds-template1] has index patterns [simple-data-stream1] matching patterns from existing older templates [global] with patterns (global => [*]); this template [my-template1] will take precedence during new index creation" + indices.put_index_template: + name: my-template1 + body: + index_patterns: [gargage*] + data_stream: {} + template: + settings: + index: + number_of_replicas: 0 + number_of_shards: 2 + garbage: garbage + mappings: + properties: + "@timestamp": + type: date + + - do: + bulk: + refresh: true + index: garbage + body: + - '{"create": {}}' + - '{"@timestamp": "2021-04-28T18:50:04.467Z"}' From 260769395d0dcfaf843472abcfcd8f51b03d72c7 Mon Sep 17 00:00:00 2001 From: Mark Vieira Date: Tue, 5 Oct 2021 12:02:20 -0700 Subject: [PATCH 178/250] Add compatibility tests to rest resources artifact (#78534) --- .../rest/compat/YamlRestCompatTestPlugin.java | 37 +++++++++++++++++-- x-pack/rest-resources-zip/build.gradle | 23 +++++++++++- 2 files changed, 54 insertions(+), 6 deletions(-) diff --git a/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/rest/compat/YamlRestCompatTestPlugin.java b/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/rest/compat/YamlRestCompatTestPlugin.java index 502d3f886fc60..7559c11d69962 100644 --- a/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/rest/compat/YamlRestCompatTestPlugin.java +++ b/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/rest/compat/YamlRestCompatTestPlugin.java @@ -27,14 +27,17 @@ import org.gradle.api.artifacts.Configuration; import org.gradle.api.artifacts.Dependency; import org.gradle.api.file.Directory; +import org.gradle.api.file.RelativePath; import org.gradle.api.plugins.JavaBasePlugin; import org.gradle.api.provider.Provider; import org.gradle.api.tasks.SourceSet; import org.gradle.api.tasks.SourceSetContainer; +import org.gradle.api.tasks.Sync; import org.gradle.api.tasks.TaskProvider; import java.io.File; import java.nio.file.Path; +import java.util.Arrays; import java.util.Map; import static org.elasticsearch.gradle.internal.test.rest.RestTestUtil.setupTestDependenciesDefaults; @@ -44,6 +47,8 @@ */ public class YamlRestCompatTestPlugin implements Plugin { private static final String REST_COMPAT_CHECK_TASK_NAME = "checkRestCompat"; + private static final String COMPATIBILITY_APIS_CONFIGURATION = "restCompatSpecs"; + private static final String COMPATIBILITY_TESTS_CONFIGURATION = "restCompatTests"; private static final String SOURCE_SET_NAME = "yamlRestCompatTest"; private static final Path RELATIVE_API_PATH = Path.of("rest-api-spec/api"); private static final Path RELATIVE_TEST_PATH = Path.of("rest-api-spec/test"); @@ -138,10 +143,24 @@ public void apply(Project project) { task.onlyIf(t -> isEnabled(project)); }); - + // copy both local source set apis and compat apis to a single location to be exported as an artifact + TaskProvider bundleRestCompatApis = project.getTasks().register("bundleRestCompatApis", Sync.class, task -> { + task.setDestinationDir(project.getLayout().getBuildDirectory().dir("bundledCompatApis").get().getAsFile()); + task.setIncludeEmptyDirs(false); + task.from(copyCompatYamlSpecTask.flatMap(t -> t.getOutputResourceDir().map(d -> d.dir(RELATIVE_API_PATH.toString())))); + task.from(yamlCompatTestSourceSet.getResources(), s -> { + s.include(RELATIVE_API_PATH + "/*"); + s.eachFile( + details -> details.setRelativePath( + new RelativePath(true, Arrays.stream(details.getRelativePath().getSegments()).skip(2).toArray(String[]::new)) + ) + ); + }); + }); + // transform the copied tests task TaskProvider transformCompatTestTask = project.getTasks() - .register("yamlRestTestV"+ compatibleVersion + "CompatTransform", RestCompatTestTransformTask.class, task -> { + .register("yamlRestTestV" + compatibleVersion + "CompatTransform", RestCompatTestTransformTask.class, task -> { task.getSourceDirectory().set(copyCompatYamlTestTask.flatMap(CopyRestTestsTask::getOutputResourceDir)); task.getOutputDirectory() .set(project.getLayout().getBuildDirectory().dir(compatTestsDir.resolve("transformed").toString())); @@ -152,6 +171,16 @@ public void apply(Project project) { yamlCompatTestSourceSet.getOutput().dir(copyCompatYamlSpecTask.map(CopyRestApiTask::getOutputResourceDir)); yamlCompatTestSourceSet.getOutput().dir(transformCompatTestTask.map(RestCompatTestTransformTask::getOutputDirectory)); + // Register artifact for transformed compatibility apis and tests + Configuration compatRestSpecs = project.getConfigurations().create(COMPATIBILITY_APIS_CONFIGURATION); + Configuration compatRestTests = project.getConfigurations().create(COMPATIBILITY_TESTS_CONFIGURATION); + project.getArtifacts().add(compatRestSpecs.getName(), bundleRestCompatApis.map(Sync::getDestinationDir)); + project.getArtifacts() + .add( + compatRestTests.getName(), + transformCompatTestTask.flatMap(t -> t.getOutputDirectory().dir(RELATIVE_TEST_PATH.toString())) + ); + // Grab the original rest resources locations so we can omit them from the compatibility testing classpath down below Provider originalYamlSpecsDir = project.getTasks() .withType(CopyRestApiTask.class) @@ -162,8 +191,8 @@ public void apply(Project project) { .named(RestResourcesPlugin.COPY_YAML_TESTS_TASK) .flatMap(CopyRestTestsTask::getOutputResourceDir); - String testTaskName = "yamlRestTestV"+ compatibleVersion + "CompatTest"; - + String testTaskName = "yamlRestTestV" + compatibleVersion + "CompatTest"; + // setup the test task Provider yamlRestCompatTestTask = RestTestUtil.registerTestTask(project, yamlCompatTestSourceSet, testTaskName); project.getTasks().withType(RestIntegTestTask.class).named(testTaskName).configure(testTask -> { diff --git a/x-pack/rest-resources-zip/build.gradle b/x-pack/rest-resources-zip/build.gradle index 41749cc813fda..8ef2ba046bac7 100644 --- a/x-pack/rest-resources-zip/build.gradle +++ b/x-pack/rest-resources-zip/build.gradle @@ -9,29 +9,48 @@ apply plugin: 'base' configurations { apis + compatApis freeTests + freeCompatTests platinumTests + platinumCompatTests } dependencies { apis project(path: ':rest-api-spec', configuration: 'restSpecs') freeTests project(path: ':rest-api-spec', configuration: 'restTests') + compatApis project(path: ':rest-api-spec', configuration: 'restCompatSpecs') + compatApis project(path: ':x-pack:plugin', configuration: 'restCompatSpecs') + freeCompatTests project(path: ':rest-api-spec', configuration: 'restCompatTests') platinumTests project(path: ':x-pack:plugin', configuration: 'restXpackTests') + platinumCompatTests project(path: ':x-pack:plugin', configuration: 'restCompatTests') } -tasks.register('restResourcesZip', Zip).configure { +def restResourcesZip = tasks.register('restResourcesZip', Zip) { description = 'Build archive containing all REST API specifications and YAML tests' destinationDirectory = layout.buildDirectory.dir('distributions') from(configurations.apis) { into 'rest-api-spec/api' } + from(configurations.compatApis) { + into 'rest-api-spec/compatApi' + duplicatesStrategy = 'exclude' + } from(configurations.freeTests) { into 'rest-api-spec/test/free' } + from(configurations.freeCompatTests) { + into 'rest-api-spec/compatTest/free' + } from(configurations.platinumTests) { into 'rest-api-spec/test/platinum' } + from(configurations.platinumCompatTests) { + into 'rest-api-spec/compatTest/platinum' + } } -tasks.named("assemble").configure { dependsOn 'restResourcesZip' } +artifacts { + archives restResourcesZip +} From e5af31678f40e85434d7ecd6c411e28942221360 Mon Sep 17 00:00:00 2001 From: Gordon Brown Date: Tue, 5 Oct 2021 13:56:54 -0600 Subject: [PATCH 179/250] Ensure Node Shutdown doesn't stall when all nodes in the cluster have a copy of a shard (#78578) --- .../xpack/shutdown/NodeShutdownShardsIT.java | 74 +++++++++++++++++++ .../TransportGetShutdownStatusAction.java | 39 ++++++++-- ...TransportGetShutdownStatusActionTests.java | 36 +++++++++ 3 files changed, 144 insertions(+), 5 deletions(-) diff --git a/x-pack/plugin/shutdown/src/internalClusterTest/java/org/elasticsearch/xpack/shutdown/NodeShutdownShardsIT.java b/x-pack/plugin/shutdown/src/internalClusterTest/java/org/elasticsearch/xpack/shutdown/NodeShutdownShardsIT.java index 098e028d4118d..7d68f47709e49 100644 --- a/x-pack/plugin/shutdown/src/internalClusterTest/java/org/elasticsearch/xpack/shutdown/NodeShutdownShardsIT.java +++ b/x-pack/plugin/shutdown/src/internalClusterTest/java/org/elasticsearch/xpack/shutdown/NodeShutdownShardsIT.java @@ -7,12 +7,19 @@ package org.elasticsearch.xpack.shutdown; +import org.apache.logging.log4j.message.ParameterizedMessage; import org.elasticsearch.Build; import org.elasticsearch.action.admin.cluster.node.info.NodeInfo; import org.elasticsearch.action.admin.cluster.node.info.NodesInfoResponse; +import org.elasticsearch.action.index.IndexRequestBuilder; import org.elasticsearch.action.support.master.AcknowledgedResponse; +import org.elasticsearch.cluster.ClusterState; +import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.cluster.metadata.SingleNodeShutdownMetadata; import org.elasticsearch.cluster.node.DiscoveryNode; +import org.elasticsearch.cluster.routing.ShardRouting; +import org.elasticsearch.cluster.routing.ShardRoutingState; +import org.elasticsearch.cluster.routing.UnassignedInfo; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.test.ESIntegTestCase; @@ -20,6 +27,7 @@ import java.util.Arrays; import java.util.Collection; +import java.util.List; import static org.elasticsearch.cluster.metadata.SingleNodeShutdownMetadata.Status.COMPLETE; import static org.hamcrest.Matchers.equalTo; @@ -137,6 +145,72 @@ public void testShardStatusIsCompleteOnNonDataNodes() throws Exception { assertThat(getResp.getShutdownStatuses().get(0).migrationStatus().getStatus(), equalTo(COMPLETE)); } + /** + * Checks that, if we get to a situation where a shard can't move because all other nodes already have a copy of that shard, + * we'll still return COMPLETE instead of STALLED. + */ + public void testNotStalledIfAllShardsHaveACopyOnAnotherNode() throws Exception { + internalCluster().startNodes(2); + + final String indexName = "test"; + prepareCreate(indexName).setSettings( + Settings.builder() + .put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1) + .put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 1) // <- Ensure we have a copy of the shard on both nodes + .put(UnassignedInfo.INDEX_DELAYED_NODE_LEFT_TIMEOUT_SETTING.getKey(), 0) // Disable "normal" delayed allocation + ).get(); + ensureGreen(indexName); + indexRandomData(); + + String nodeToStopId = findIdOfNodeWithPrimaryShard(indexName); + PutShutdownNodeAction.Request putShutdownRequest = new PutShutdownNodeAction.Request( + nodeToStopId, + SingleNodeShutdownMetadata.Type.REMOVE, + this.getTestName(), + null, + null + ); + AcknowledgedResponse putShutdownResponse = client().execute(PutShutdownNodeAction.INSTANCE, putShutdownRequest).get(); + assertTrue(putShutdownResponse.isAcknowledged()); + + assertBusy(() -> { + GetShutdownStatusAction.Response getResp = client().execute( + GetShutdownStatusAction.INSTANCE, + new GetShutdownStatusAction.Request(nodeToStopId) + ).get(); + + assertThat(getResp.getShutdownStatuses().get(0).migrationStatus().getStatus(), equalTo(COMPLETE)); + }); + } + + private void indexRandomData() throws Exception { + int numDocs = scaledRandomIntBetween(100, 1000); + IndexRequestBuilder[] builders = new IndexRequestBuilder[numDocs]; + for (int i = 0; i < builders.length; i++) { + builders[i] = client().prepareIndex("test").setSource("field", "value"); + } + indexRandom(true, builders); + } + + private String findIdOfNodeWithPrimaryShard(String indexName) { + ClusterState state = client().admin().cluster().prepareState().get().getState(); + List startedShards = state.routingTable().shardsWithState(ShardRoutingState.STARTED); + return startedShards.stream() + .filter(ShardRouting::primary) + .filter(shardRouting -> indexName.equals(shardRouting.index().getName())) + .map(ShardRouting::currentNodeId) + .findFirst() + .orElseThrow( + () -> new AssertionError( + new ParameterizedMessage( + "could not find a primary shard of index [{}] in list of started shards [{}]", + indexName, + startedShards + ) + ) + ); + } + private String getNodeId(String nodeName) throws Exception { NodesInfoResponse nodes = client().admin().cluster().prepareNodesInfo().clear().get(); return nodes.getNodes() diff --git a/x-pack/plugin/shutdown/src/main/java/org/elasticsearch/xpack/shutdown/TransportGetShutdownStatusAction.java b/x-pack/plugin/shutdown/src/main/java/org/elasticsearch/xpack/shutdown/TransportGetShutdownStatusAction.java index a7af8666d62cf..81675b85d1af2 100644 --- a/x-pack/plugin/shutdown/src/main/java/org/elasticsearch/xpack/shutdown/TransportGetShutdownStatusAction.java +++ b/x-pack/plugin/shutdown/src/main/java/org/elasticsearch/xpack/shutdown/TransportGetShutdownStatusAction.java @@ -28,6 +28,7 @@ import org.elasticsearch.cluster.routing.allocation.AllocationDecision; import org.elasticsearch.cluster.routing.allocation.AllocationService; import org.elasticsearch.cluster.routing.allocation.RoutingAllocation; +import org.elasticsearch.cluster.routing.allocation.ShardAllocationDecision; import org.elasticsearch.cluster.routing.allocation.decider.AllocationDeciders; import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.Strings; @@ -45,6 +46,8 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; +import java.util.Set; +import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; public class TransportGetShutdownStatusAction extends TransportMasterNodeAction< @@ -222,8 +225,13 @@ static ShutdownShardMigrationStatus shardMigrationStatus( ); allocation.setDebugMode(RoutingAllocation.DebugMode.EXCLUDE_YES_DECISIONS); + // We also need the set of node IDs which are currently shutting down. + Set shuttingDownNodes = currentState.metadata().nodeShutdowns().keySet(); + + AtomicInteger shardsToIgnoreForFinalStatus = new AtomicInteger(0); + // Explain shard allocations until we find one that can't move, then stop (as `findFirst` short-circuits) - final Optional unmovableShard = currentState.getRoutingNodes() + Optional> unmovableShard = currentState.getRoutingNodes() .node(nodeId) .shardsWithState(ShardRoutingState.STARTED) .stream() @@ -238,6 +246,21 @@ static ShutdownShardMigrationStatus shardMigrationStatus( .filter(pair -> pair.v2().getMoveDecision().getAllocationDecision().equals(AllocationDecision.THROTTLED) == false) // These shards will move as soon as possible .filter(pair -> pair.v2().getMoveDecision().getAllocationDecision().equals(AllocationDecision.YES) == false) + // If the shard that can't move is on every node in the cluster, we shouldn't be `STALLED` on it. + .filter(pair -> { + final boolean hasShardCopyOnOtherNode = currentState.routingTable() + .allShards(pair.v1().index().getName()) + .stream() + .filter(shardRouting -> shardRouting.id() == pair.v1().id()) + // If any shards are both 1) `STARTED` and 2) are not on a node that's shutting down, we have at least one copy + // of this shard safely on a node that's not shutting down, so we don't want to report `STALLED` because of this shard. + .filter(ShardRouting::started) + .anyMatch(routing -> shuttingDownNodes.contains(routing.currentNodeId()) == false); + if (hasShardCopyOnOtherNode) { + shardsToIgnoreForFinalStatus.incrementAndGet(); + } + return hasShardCopyOnOtherNode == false; + }) .peek(pair -> { if (logger.isTraceEnabled()) { // don't serialize the decision unless we have to logger.trace( @@ -251,12 +274,19 @@ static ShutdownShardMigrationStatus shardMigrationStatus( ); } }) - .map(Tuple::v1) .findFirst(); - if (unmovableShard.isPresent()) { + if (totalRemainingShards == shardsToIgnoreForFinalStatus.get() && unmovableShard.isEmpty()) { + return new ShutdownShardMigrationStatus( + SingleNodeShutdownMetadata.Status.COMPLETE, + 0, + "[" + + shardsToIgnoreForFinalStatus.get() + + "] shards cannot be moved away from this node but have at least one copy on another node in the cluster" + ); + } else if (unmovableShard.isPresent()) { // We found a shard that can't be moved, so shard relocation is stalled. Blame the unmovable shard. - ShardRouting shardRouting = unmovableShard.get(); + ShardRouting shardRouting = unmovableShard.get().v1(); return new ShutdownShardMigrationStatus( SingleNodeShutdownMetadata.Status.STALLED, @@ -269,7 +299,6 @@ static ShutdownShardMigrationStatus shardMigrationStatus( ).getFormattedMessage() ); } else { - // We couldn't find any shards that can't be moved, so we're just waiting for other recoveries or initializing shards return new ShutdownShardMigrationStatus(SingleNodeShutdownMetadata.Status.IN_PROGRESS, totalRemainingShards); } } diff --git a/x-pack/plugin/shutdown/src/test/java/org/elasticsearch/xpack/shutdown/TransportGetShutdownStatusActionTests.java b/x-pack/plugin/shutdown/src/test/java/org/elasticsearch/xpack/shutdown/TransportGetShutdownStatusActionTests.java index 1aaa13e79b746..b9c45e3f35265 100644 --- a/x-pack/plugin/shutdown/src/test/java/org/elasticsearch/xpack/shutdown/TransportGetShutdownStatusActionTests.java +++ b/x-pack/plugin/shutdown/src/test/java/org/elasticsearch/xpack/shutdown/TransportGetShutdownStatusActionTests.java @@ -343,6 +343,42 @@ public void testStalled() { ); } + public void testNotStalledIfAllShardsHaveACopyOnAnotherNode() { + Index index = new Index(randomAlphaOfLength(5), randomAlphaOfLengthBetween(1, 20)); + IndexMetadata imd = generateIndexMetadata(index, 3, 0); + IndexRoutingTable indexRoutingTable = IndexRoutingTable.builder(index) + .addShard(TestShardRouting.newShardRouting(new ShardId(index, 0), LIVE_NODE_ID, false, ShardRoutingState.STARTED)) + .addShard(TestShardRouting.newShardRouting(new ShardId(index, 0), SHUTTING_DOWN_NODE_ID, true, ShardRoutingState.STARTED)) + .build(); + + // Force a decision of NO for all moves and new allocations, simulating a decider that's stuck + canAllocate.set((r, n, a) -> Decision.NO); + // And the remain decider simulates NodeShutdownAllocationDecider + canRemain.set((r, n, a) -> n.nodeId().equals(SHUTTING_DOWN_NODE_ID) ? Decision.NO : Decision.YES); + + RoutingTable.Builder routingTable = RoutingTable.builder(); + routingTable.add(indexRoutingTable); + ClusterState state = createTestClusterState(routingTable.build(), List.of(imd), SingleNodeShutdownMetadata.Type.REMOVE); + + ShutdownShardMigrationStatus status = TransportGetShutdownStatusAction.shardMigrationStatus( + state, + SHUTTING_DOWN_NODE_ID, + SingleNodeShutdownMetadata.Type.REMOVE, + true, + clusterInfoService, + snapshotsInfoService, + allocationService, + allocationDeciders + ); + + assertShardMigration( + status, + SingleNodeShutdownMetadata.Status.COMPLETE, + 0, + containsString("[1] shards cannot be moved away from this node but have at least one copy on another node in the cluster") + ); + } + public void testOnlyInitializingShardsRemaining() { Index index = new Index(randomAlphaOfLength(5), randomAlphaOfLengthBetween(1, 20)); IndexMetadata imd = generateIndexMetadata(index, 3, 0); From abe0c06afd92ba89a3c110d4fbec6a85ec06c377 Mon Sep 17 00:00:00 2001 From: Nilanshu V Rajmane Date: Wed, 6 Oct 2021 02:56:15 +0530 Subject: [PATCH 180/250] [DOCS] Change "p0" to "yaml" in example command (#78716) Relates to https://github.com/elastic/elasticsearch/issues/78631 Co-authored-by: Nilanshu Vithal Rajmane --- TESTING.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TESTING.asciidoc b/TESTING.asciidoc index 908dbeec36fd5..038d447e3ffe5 100644 --- a/TESTING.asciidoc +++ b/TESTING.asciidoc @@ -324,7 +324,7 @@ A specific test case can be run with the following command: --------------------------------------------------------------------------- ./gradlew ':rest-api-spec:yamlRestTest' \ --tests "org.elasticsearch.test.rest.ClientYamlTestSuiteIT" \ - -Dtests.method="test {p0=cat.segments/10_basic/Help}" + -Dtests.method="test {yaml=cat.segments/10_basic/Help}" --------------------------------------------------------------------------- The YAML REST tests support all the options provided by the randomized runner, plus the following: From 324996ed3265d3046f4e63230e666f31275212bc Mon Sep 17 00:00:00 2001 From: Yang Wang Date: Wed, 6 Oct 2021 13:54:20 +1100 Subject: [PATCH 181/250] Allow fleet-server service account to setup Fleet (#78192) This PR adds necessary application privilege for Kibana to allow fleet-server service account to initiate the Fleet setup process. Resolves: #78078 --- .../security/get-service-accounts.asciidoc | 12 ++++++++++- .../authz/store/ReservedRolesStore.java | 2 +- .../authz/store/ReservedRolesStoreTests.java | 15 +++++++++++++ .../authc/service/ServiceAccountIT.java | 12 ++++++++++- .../authc/service/ElasticServiceAccounts.java | 5 ++++- .../service/ElasticServiceAccountsTests.java | 21 ++++++++++++++++++- 6 files changed, 62 insertions(+), 5 deletions(-) diff --git a/x-pack/docs/en/rest-api/security/get-service-accounts.asciidoc b/x-pack/docs/en/rest-api/security/get-service-accounts.asciidoc index 919636c1b75a2..1384200976ec0 100644 --- a/x-pack/docs/en/rest-api/security/get-service-accounts.asciidoc +++ b/x-pack/docs/en/rest-api/security/get-service-accounts.asciidoc @@ -97,7 +97,17 @@ GET /_security/service/elastic/fleet-server "allow_restricted_indices": true } ], - "applications": [], + "applications": [ + { + "application" : "kibana-*", + "privileges" : [ + "reserved_fleet-setup" + ], + "resources" : [ + "*" + ] + } + ], "run_as": [], "metadata": {}, "transient_metadata": { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/store/ReservedRolesStore.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/store/ReservedRolesStore.java index 8a8ca060ae5ac..7b68bf5bac877 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/store/ReservedRolesStore.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/store/ReservedRolesStore.java @@ -367,7 +367,7 @@ public static RoleDescriptor kibanaSystemRoleDescriptor(String name) { "manage_pipeline", "manage_ilm", // For the endpoint package that ships a transform "manage_transform", - InvalidateApiKeyAction.NAME, "grant_api_key", + InvalidateApiKeyAction.NAME, "grant_api_key", "manage_own_api_key", GetBuiltinPrivilegesAction.NAME, "delegate_pki", // To facilitate ML UI functionality being controlled using Kibana security privileges "manage_ml", diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/store/ReservedRolesStoreTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/store/ReservedRolesStoreTests.java index 7e8af5dd23618..397aa516f2a8f 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/store/ReservedRolesStoreTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/store/ReservedRolesStoreTests.java @@ -92,6 +92,10 @@ import org.elasticsearch.xpack.core.ml.action.ExplainDataFrameAnalyticsAction; import org.elasticsearch.xpack.core.ml.action.FinalizeJobExecutionAction; import org.elasticsearch.xpack.core.rollup.action.GetRollupIndexCapsAction; +import org.elasticsearch.xpack.core.security.action.CreateApiKeyAction; +import org.elasticsearch.xpack.core.security.action.CreateApiKeyRequest; +import org.elasticsearch.xpack.core.security.action.GetApiKeyRequest; +import org.elasticsearch.xpack.core.security.action.apikey.QueryApiKeyRequest; import org.elasticsearch.xpack.core.textstructure.action.FindStructureAction; import org.elasticsearch.xpack.core.ml.action.FlushJobAction; import org.elasticsearch.xpack.core.ml.action.ForecastJobAction; @@ -375,6 +379,17 @@ public void testKibanaSystemRole() { // API keys assertThat(kibanaRole.cluster().check(InvalidateApiKeyAction.NAME, request, authentication), is(true)); assertThat(kibanaRole.cluster().check(GrantApiKeyAction.NAME, request, authentication), is(true)); + final CreateApiKeyRequest createApiKeyRequest = new CreateApiKeyRequest(randomAlphaOfLength(8), null, null); + assertThat(kibanaRole.cluster().check(CreateApiKeyAction.NAME, createApiKeyRequest, authentication), is(true)); + // Can only get and query its own API keys + assertThat(kibanaRole.cluster().check(CreateApiKeyAction.NAME, new GetApiKeyRequest(), authentication), is(false)); + assertThat(kibanaRole.cluster().check(CreateApiKeyAction.NAME, + new GetApiKeyRequest(null, null, null, null, true), authentication), + is(true)); + final QueryApiKeyRequest queryApiKeyRequest = new QueryApiKeyRequest(); + assertThat(kibanaRole.cluster().check(CreateApiKeyAction.NAME, queryApiKeyRequest, authentication), is(false)); + queryApiKeyRequest.setFilterForCurrentUser(); + assertThat(kibanaRole.cluster().check(CreateApiKeyAction.NAME, queryApiKeyRequest, authentication), is(true)); // ML assertRoleHasManageMl(kibanaRole); diff --git a/x-pack/plugin/security/qa/service-account/src/javaRestTest/java/org/elasticsearch/xpack/security/authc/service/ServiceAccountIT.java b/x-pack/plugin/security/qa/service-account/src/javaRestTest/java/org/elasticsearch/xpack/security/authc/service/ServiceAccountIT.java index 24d1a09c463f3..8c8374b02f5eb 100644 --- a/x-pack/plugin/security/qa/service-account/src/javaRestTest/java/org/elasticsearch/xpack/security/authc/service/ServiceAccountIT.java +++ b/x-pack/plugin/security/qa/service-account/src/javaRestTest/java/org/elasticsearch/xpack/security/authc/service/ServiceAccountIT.java @@ -113,7 +113,17 @@ public class ServiceAccountIT extends ESRestTestCase { + " \"allow_restricted_indices\": true\n" + " }\n" + " ],\n" - + " \"applications\": [],\n" + + " \"applications\": [" + + " {\n" + + " \"application\" : \"kibana-*\",\n" + + " \"privileges\" : [\n" + + " \"reserved_fleet-setup\"\n" + + " ],\n" + + " \"resources\" : [\n" + + " \"*\"\n" + + " ]\n" + + " }" + + " ],\n" + " \"run_as\": [],\n" + " \"metadata\": {},\n" + " \"transient_metadata\": {\n" diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/service/ElasticServiceAccounts.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/service/ElasticServiceAccounts.java index ddf42431b8080..3d7c76d780499 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/service/ElasticServiceAccounts.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/service/ElasticServiceAccounts.java @@ -39,7 +39,10 @@ final class ElasticServiceAccounts { .allowRestrictedIndices(true) .build() }, - null, + new RoleDescriptor.ApplicationResourcePrivileges[]{ + RoleDescriptor.ApplicationResourcePrivileges.builder() + .application("kibana-*").resources("*").privileges("reserved_fleet-setup").build() + }, null, null, null, diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/service/ElasticServiceAccountsTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/service/ElasticServiceAccountsTests.java index b190799b2cd01..43a87171a5a17 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/service/ElasticServiceAccountsTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/service/ElasticServiceAccountsTests.java @@ -96,6 +96,7 @@ import org.elasticsearch.xpack.core.security.authc.Authentication; import org.elasticsearch.xpack.core.security.authz.RoleDescriptor; import org.elasticsearch.xpack.core.security.authz.permission.Role; +import org.elasticsearch.xpack.core.security.authz.privilege.ApplicationPrivilege; import org.elasticsearch.xpack.core.security.authz.store.ReservedRolesStore; import org.elasticsearch.xpack.core.security.user.KibanaSystemUser; import org.elasticsearch.xpack.core.security.user.User; @@ -127,7 +128,7 @@ public void testKibanaSystemPrivileges() { assertThat(serviceAccountRoleDescriptor.getMetadata(), equalTo(reservedRolesStoreRoleDescriptor.getMetadata())); } - public void testElasticFleetPrivileges() { + public void testElasticFleetServerPrivileges() { final Role role = Role.builder( ElasticServiceAccounts.ACCOUNTS.get("elastic/fleet-server").roleDescriptor(), null, RESTRICTED_INDICES_AUTOMATON).build(); final Authentication authentication = mock(Authentication.class); @@ -187,6 +188,24 @@ public void testElasticFleetPrivileges() { assertThat(role.indices().allowedIndicesMatcher(UpdateSettingsAction.NAME).test(dotFleetIndex), is(false)); assertThat(role.indices().allowedIndicesMatcher("indices:foo").test(dotFleetIndex), is(false)); }); + + final String kibanaApplication = "kibana-" + randomFrom(randomAlphaOfLengthBetween(8, 24), ".kibana"); + final String privilegeName = randomAlphaOfLengthBetween(3, 16); + assertThat(role.application().grants( + new ApplicationPrivilege( + kibanaApplication, privilegeName, "reserved_fleet-setup"), "*"), + is(true)); + + final String otherApplication = randomValueOtherThanMany(s -> s.startsWith("kibana"), + () -> randomAlphaOfLengthBetween(3, 8)) + "-" + randomAlphaOfLengthBetween(8, 24); + assertThat(role.application().grants( + new ApplicationPrivilege(otherApplication, privilegeName, "reserved_fleet-setup"), "*"), + is(false)); + + assertThat(role.application().grants( + new ApplicationPrivilege(kibanaApplication, privilegeName, + randomArray(1, 5, String[]::new, () -> randomAlphaOfLengthBetween(3, 16))), "*"), + is(false)); } public void testElasticServiceAccount() { From eeb09f0248765c7b24a4ba8129e29141e1e7c956 Mon Sep 17 00:00:00 2001 From: Yang Wang Date: Wed, 6 Oct 2021 15:15:25 +1100 Subject: [PATCH 182/250] [Test] Skip single rest compat test for invalidateApiKey Temporarily mute till #78664 gets merged. --- x-pack/plugin/build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/x-pack/plugin/build.gradle b/x-pack/plugin/build.gradle index 9de02eb58edba..59e7034103c5d 100644 --- a/x-pack/plugin/build.gradle +++ b/x-pack/plugin/build.gradle @@ -115,6 +115,7 @@ tasks.named("yamlRestTestV7CompatTransform").configure{ task -> task.skipTest("rollup/put_job/Test basic put_job", "rollup was an experimental feature, also see #41227") task.skipTest("rollup/start_job/Test start job twice", "rollup was an experimental feature, also see #41227") task.skipTest("ml/trained_model_cat_apis/Test cat trained models", "A type field was added to cat.ml_trained_models #73660, this is a backwards compatible change. Still this is a cat api, and we don't support them with rest api compatibility. (the test would be very hard to transform too)") + task.skipTest("api_key/10_basic/Test invalidate api keys with single id", "waiting for https://github.com/elastic/elasticsearch/pull/78664") task.replaceKeyInDo("license.delete", "xpack-license.delete") task.replaceKeyInDo("license.get", "xpack-license.get") From b2e4639d422941d63732b377aeb2472164f1277a Mon Sep 17 00:00:00 2001 From: Ignacio Vera Date: Wed, 6 Oct 2021 08:13:47 +0200 Subject: [PATCH 183/250] Move legacy geo_shape implementation to its own module (#77856) This commit moves the legacy geo_shape implementation to its own module and removes the dependency on Spatial4J / JTS from server. --- modules/legacy-geo/build.gradle | 53 + .../licenses/jts-core-1.15.0.jar.sha1 | 0 .../legacy-geo}/licenses/jts-core-LICENSE.txt | 0 .../legacy-geo}/licenses/jts-core-NOTICE.txt | 0 .../legacy-geo/licenses/lucene-LICENSE.txt | 475 ++++ modules/legacy-geo/licenses/lucene-NOTICE.txt | 192 ++ ...extras-9.0.0-snapshot-cb366d04d4a.jar.sha1 | 0 .../licenses/spatial4j-0.7.jar.sha1 | 0 .../legacy-geo}/licenses/spatial4j-ABOUT.txt | 0 .../licenses/spatial4j-LICENSE.txt | 0 .../legacy-geo}/licenses/spatial4j-NOTICE.txt | 0 .../GeoBoundingBoxQueryLegacyGeoShapeIT.java | 20 +- .../legacygeo/search}/LegacyGeoShapeIT.java | 25 +- .../legacygeo}/GeoShapeType.java | 153 +- .../legacygeo/LegacyGeoPlugin.java | 30 + .../legacygeo}/ShapesAvailability.java | 2 +- .../legacygeo}/XShapeCollection.java | 22 +- .../legacygeo}/builders/CircleBuilder.java | 21 +- .../builders/CoordinatesBuilder.java | 19 +- .../legacygeo}/builders/EnvelopeBuilder.java | 16 +- .../builders/GeometryCollectionBuilder.java | 32 +- .../builders/LineStringBuilder.java | 50 +- .../builders/MultiLineStringBuilder.java | 23 +- .../builders/MultiPointBuilder.java | 20 +- .../builders/MultiPolygonBuilder.java | 34 +- .../legacygeo}/builders/PointBuilder.java | 18 +- .../legacygeo}/builders/PolygonBuilder.java | 157 +- .../legacygeo}/builders/ShapeBuilder.java | 44 +- .../mapper/LegacyGeoShapeFieldMapper.java | 233 +- .../legacygeo}/parsers/CoordinateNode.java | 4 +- .../legacygeo}/parsers/GeoJsonParser.java | 43 +- .../legacygeo}/parsers/GeoWKTParser.java | 129 +- .../legacygeo}/parsers/ShapeParser.java | 21 +- .../query/LegacyGeoShapeQueryProcessor.java | 60 +- .../legacygeo}/BaseGeoParsingTestCase.java | 24 +- .../legacygeo/GeoJsonShapeParserTests.java | 2293 +++++++++++++++++ .../legacygeo}/GeoWKTShapeParserTests.java | 118 +- .../legacygeo/GeometryIOTests.java | 96 + .../legacygeo/ShapeBuilderTests.java | 805 ++++++ .../AbstractShapeBuilderTestCase.java | 8 +- .../builders/CircleBuilderTests.java | 6 +- .../builders/EnvelopeBuilderTests.java | 50 +- .../GeometryCollectionBuilderTests.java | 96 + .../builders/LineStringBuilderTests.java | 6 +- .../builders/MultiLineStringBuilderTests.java | 6 +- .../builders/MultiPointBuilderTests.java | 9 +- .../builders/MultiPolygonBuilderTests.java | 117 +- .../builders/PointBuilderTests.java | 7 +- .../builders/PolygonBuilderTests.java | 76 +- .../LegacyGeoShapeFieldMapperTests.java | 118 +- .../mapper/LegacyGeoShapeFieldTypeTests.java | 14 +- .../search}/LegacyGeoShapeQueryTests.java | 130 +- .../legacygeo/search/LegacyGeoUtilsTests.java | 86 + .../test}/ElasticsearchGeoAssertions.java | 115 +- .../legacygeo/test/RandomGeoGenerator.java | 85 + .../legacygeo/test}/RandomShapeGenerator.java | 69 +- .../TestLegacyGeoShapeFieldMapperPlugin.java | 13 +- server/build.gradle | 20 - .../elasticsearch/common/geo/GeoUtils.java | 9 +- .../AbstractShapeGeometryFieldMapper.java | 2 +- .../index/query/QueryBuilders.java | 39 - .../elasticsearch/search/SearchModule.java | 14 +- .../common/geo/GeoJsonParserTests.java | 20 +- .../common/geo/GeoJsonShapeParserTests.java | 1421 ---------- .../common/geo/GeometryIOTests.java | 73 +- .../common/geo/ShapeBuilderTests.java | 842 ------ .../GeometryCollectionBuilderTests.java | 96 - .../index/search/geo/GeoUtilsTests.java | 54 - .../test/geo/RandomGeoGenerator.java | 3 +- x-pack/plugin/security/build.gradle | 1 + x-pack/plugin/spatial/build.gradle | 3 +- .../GeoShapeWithDocValuesFieldMapper.java | 4 +- ...LegacyGeoShapeWithDocValuesQueryTests.java | 2 +- x-pack/plugin/sql/qa/server/build.gradle | 1 + x-pack/plugin/vector-tile/build.gradle | 1 + 75 files changed, 5398 insertions(+), 3450 deletions(-) create mode 100644 modules/legacy-geo/build.gradle rename {server => modules/legacy-geo}/licenses/jts-core-1.15.0.jar.sha1 (100%) rename {server => modules/legacy-geo}/licenses/jts-core-LICENSE.txt (100%) rename {server => modules/legacy-geo}/licenses/jts-core-NOTICE.txt (100%) create mode 100644 modules/legacy-geo/licenses/lucene-LICENSE.txt create mode 100644 modules/legacy-geo/licenses/lucene-NOTICE.txt rename {server => modules/legacy-geo}/licenses/lucene-spatial-extras-9.0.0-snapshot-cb366d04d4a.jar.sha1 (100%) rename {server => modules/legacy-geo}/licenses/spatial4j-0.7.jar.sha1 (100%) rename {server => modules/legacy-geo}/licenses/spatial4j-ABOUT.txt (100%) rename {server => modules/legacy-geo}/licenses/spatial4j-LICENSE.txt (100%) rename {server => modules/legacy-geo}/licenses/spatial4j-NOTICE.txt (100%) rename {server/src/internalClusterTest/java/org/elasticsearch/search/geo => modules/legacy-geo/src/internalClusterTest/java/org/elasticsearch/legacygeo/search}/GeoBoundingBoxQueryLegacyGeoShapeIT.java (69%) rename {server/src/internalClusterTest/java/org/elasticsearch/search/geo => modules/legacy-geo/src/internalClusterTest/java/org/elasticsearch/legacygeo/search}/LegacyGeoShapeIT.java (75%) rename {server/src/main/java/org/elasticsearch/common/geo => modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo}/GeoShapeType.java (70%) create mode 100644 modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/LegacyGeoPlugin.java rename {server/src/main/java/org/elasticsearch/common/geo => modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo}/ShapesAvailability.java (96%) rename {server/src/main/java/org/elasticsearch/common/geo => modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo}/XShapeCollection.java (67%) rename {server/src/main/java/org/elasticsearch/common/geo => modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo}/builders/CircleBuilder.java (92%) rename {server/src/main/java/org/elasticsearch/common/geo => modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo}/builders/CoordinatesBuilder.java (81%) rename {server/src/main/java/org/elasticsearch/common/geo => modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo}/builders/EnvelopeBuilder.java (92%) rename {server/src/main/java/org/elasticsearch/common/geo => modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo}/builders/GeometryCollectionBuilder.java (86%) rename {server/src/main/java/org/elasticsearch/common/geo => modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo}/builders/LineStringBuilder.java (80%) rename {server/src/main/java/org/elasticsearch/common/geo => modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo}/builders/MultiLineStringBuilder.java (90%) rename {server/src/main/java/org/elasticsearch/common/geo => modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo}/builders/MultiPointBuilder.java (80%) rename {server/src/main/java/org/elasticsearch/common/geo => modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo}/builders/MultiPolygonBuilder.java (87%) rename {server/src/main/java/org/elasticsearch/common/geo => modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo}/builders/PointBuilder.java (83%) rename {server/src/main/java/org/elasticsearch/common/geo => modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo}/builders/PolygonBuilder.java (87%) rename {server/src/main/java/org/elasticsearch/common/geo => modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo}/builders/ShapeBuilder.java (94%) rename {server/src/main/java/org/elasticsearch/index => modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo}/mapper/LegacyGeoShapeFieldMapper.java (75%) rename {server/src/main/java/org/elasticsearch/common/geo => modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo}/parsers/CoordinateNode.java (98%) rename {server/src/main/java/org/elasticsearch/common/geo => modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo}/parsers/GeoJsonParser.java (88%) rename {server/src/main/java/org/elasticsearch/common/geo => modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo}/parsers/GeoWKTParser.java (79%) rename {server/src/main/java/org/elasticsearch/common/geo => modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo}/parsers/ShapeParser.java (86%) rename {server/src/main/java/org/elasticsearch/index => modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo}/query/LegacyGeoShapeQueryProcessor.java (81%) rename {server/src/test/java/org/elasticsearch/common/geo => modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo}/BaseGeoParsingTestCase.java (84%) create mode 100644 modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/GeoJsonShapeParserTests.java rename {server/src/test/java/org/elasticsearch/common/geo => modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo}/GeoWKTShapeParserTests.java (83%) create mode 100644 modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/GeometryIOTests.java create mode 100644 modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/ShapeBuilderTests.java rename {server/src/test/java/org/elasticsearch/common/geo => modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo}/builders/AbstractShapeBuilderTestCase.java (95%) rename {server/src/test/java/org/elasticsearch/common/geo => modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo}/builders/CircleBuilderTests.java (95%) rename {server/src/test/java/org/elasticsearch/common/geo => modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo}/builders/EnvelopeBuilderTests.java (64%) create mode 100644 modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/builders/GeometryCollectionBuilderTests.java rename {server/src/test/java/org/elasticsearch/common/geo => modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo}/builders/LineStringBuilderTests.java (93%) rename {server/src/test/java/org/elasticsearch/common/geo => modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo}/builders/MultiLineStringBuilderTests.java (92%) rename {server/src/test/java/org/elasticsearch/common/geo => modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo}/builders/MultiPointBuilderTests.java (90%) rename {server/src/test/java/org/elasticsearch/common/geo => modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo}/builders/MultiPolygonBuilderTests.java (51%) rename {server/src/test/java/org/elasticsearch/common/geo => modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo}/builders/PointBuilderTests.java (85%) rename {server/src/test/java/org/elasticsearch/common/geo => modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo}/builders/PolygonBuilderTests.java (72%) rename {server/src/test/java/org/elasticsearch/index => modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo}/mapper/LegacyGeoShapeFieldMapperTests.java (89%) rename {server/src/test/java/org/elasticsearch/index => modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo}/mapper/LegacyGeoShapeFieldTypeTests.java (89%) rename {server/src/test/java/org/elasticsearch/search/geo => modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/search}/LegacyGeoShapeQueryTests.java (61%) create mode 100644 modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/search/LegacyGeoUtilsTests.java rename {server/src/test/java/org/elasticsearch/test/hamcrest => modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/test}/ElasticsearchGeoAssertions.java (74%) create mode 100644 modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/test/RandomGeoGenerator.java rename {server/src/test/java/org/elasticsearch/test/geo => modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/test}/RandomShapeGenerator.java (89%) rename {test/framework/src/main/java/org/elasticsearch => modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo}/test/TestLegacyGeoShapeFieldMapperPlugin.java (61%) delete mode 100644 server/src/test/java/org/elasticsearch/common/geo/GeoJsonShapeParserTests.java delete mode 100644 server/src/test/java/org/elasticsearch/common/geo/ShapeBuilderTests.java delete mode 100644 server/src/test/java/org/elasticsearch/common/geo/builders/GeometryCollectionBuilderTests.java diff --git a/modules/legacy-geo/build.gradle b/modules/legacy-geo/build.gradle new file mode 100644 index 0000000000000..8d45856cabce5 --- /dev/null +++ b/modules/legacy-geo/build.gradle @@ -0,0 +1,53 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +apply plugin: 'elasticsearch.internal-cluster-test' +apply plugin: 'nebula.optional-base' + +esplugin { + description 'Placeholder plugin for geospatial features in ES' + classname 'org.elasticsearch.legacygeo.LegacyGeoPlugin' +} + +dependencies { + api "org.apache.lucene:lucene-spatial-extras:${versions.lucene}" + api "org.locationtech.spatial4j:spatial4j:${versions.spatial4j}", optional + api "org.locationtech.jts:jts-core:${versions.jts}", optional + testImplementation project(":test:framework") +} + +tasks.named("thirdPartyAudit").configure { + ignoreMissingClasses( + + // from org.locationtech.spatial4j.io.GeoJSONReader (spatial4j) + 'org.noggit.JSONParser', + + // from org.locationtech.spatial4j.io.jackson.ShapeAsGeoJSONSerialize + 'com.fasterxml.jackson.databind.JsonSerializer', + 'com.fasterxml.jackson.databind.JsonDeserializer', + 'com.fasterxml.jackson.databind.node.ArrayNode', + 'com.fasterxml.jackson.databind.DeserializationContext', + 'com.fasterxml.jackson.databind.JsonNode', + 'com.fasterxml.jackson.databind.SerializerProvider', + 'com.fasterxml.jackson.databind.module.SimpleModule', + 'com.fasterxml.jackson.databind.node.ObjectNode', + + // from lucene-spatial + 'com.google.common.geometry.S2Cell', + 'com.google.common.geometry.S2CellId', + 'com.google.common.geometry.S2Projections', + 'com.google.common.geometry.S2Point', + 'com.google.common.geometry.S2$Metric', + 'com.google.common.geometry.S2LatLng' + ) +} + +tasks.named("dependencyLicenses").configure { + mapping from: /lucene-.*/, to: 'lucene' +} + diff --git a/server/licenses/jts-core-1.15.0.jar.sha1 b/modules/legacy-geo/licenses/jts-core-1.15.0.jar.sha1 similarity index 100% rename from server/licenses/jts-core-1.15.0.jar.sha1 rename to modules/legacy-geo/licenses/jts-core-1.15.0.jar.sha1 diff --git a/server/licenses/jts-core-LICENSE.txt b/modules/legacy-geo/licenses/jts-core-LICENSE.txt similarity index 100% rename from server/licenses/jts-core-LICENSE.txt rename to modules/legacy-geo/licenses/jts-core-LICENSE.txt diff --git a/server/licenses/jts-core-NOTICE.txt b/modules/legacy-geo/licenses/jts-core-NOTICE.txt similarity index 100% rename from server/licenses/jts-core-NOTICE.txt rename to modules/legacy-geo/licenses/jts-core-NOTICE.txt diff --git a/modules/legacy-geo/licenses/lucene-LICENSE.txt b/modules/legacy-geo/licenses/lucene-LICENSE.txt new file mode 100644 index 0000000000000..28b134f5f8e4d --- /dev/null +++ b/modules/legacy-geo/licenses/lucene-LICENSE.txt @@ -0,0 +1,475 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + + +Some code in core/src/java/org/apache/lucene/util/UnicodeUtil.java was +derived from unicode conversion examples available at +http://www.unicode.org/Public/PROGRAMS/CVTUTF. Here is the copyright +from those sources: + +/* + * Copyright 2001-2004 Unicode, Inc. + * + * Disclaimer + * + * This source code is provided as is by Unicode, Inc. No claims are + * made as to fitness for any particular purpose. No warranties of any + * kind are expressed or implied. The recipient agrees to determine + * applicability of information provided. If this file has been + * purchased on magnetic or optical media from Unicode, Inc., the + * sole remedy for any claim will be exchange of defective media + * within 90 days of receipt. + * + * Limitations on Rights to Redistribute This Code + * + * Unicode, Inc. hereby grants the right to freely use the information + * supplied in this file in the creation of products supporting the + * Unicode Standard, and to make copies of this file in any form + * for internal or external distribution as long as this notice + * remains attached. + */ + + +Some code in core/src/java/org/apache/lucene/util/ArrayUtil.java was +derived from Python 2.4.2 sources available at +http://www.python.org. Full license is here: + + http://www.python.org/download/releases/2.4.2/license/ + +Some code in core/src/java/org/apache/lucene/util/UnicodeUtil.java was +derived from Python 3.1.2 sources available at +http://www.python.org. Full license is here: + + http://www.python.org/download/releases/3.1.2/license/ + +Some code in core/src/java/org/apache/lucene/util/automaton was +derived from Brics automaton sources available at +www.brics.dk/automaton/. Here is the copyright from those sources: + +/* + * Copyright (c) 2001-2009 Anders Moeller + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +The levenshtein automata tables in core/src/java/org/apache/lucene/util/automaton +were automatically generated with the moman/finenight FSA package. +Here is the copyright for those sources: + +# Copyright (c) 2010, Jean-Philippe Barrette-LaPierre, +# +# Permission is hereby granted, free of charge, to any person +# obtaining a copy of this software and associated documentation +# files (the "Software"), to deal in the Software without +# restriction, including without limitation the rights to use, +# copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following +# conditions: +# +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +# OTHER DEALINGS IN THE SOFTWARE. + +Some code in core/src/java/org/apache/lucene/util/UnicodeUtil.java was +derived from ICU (http://www.icu-project.org) +The full license is available here: + http://source.icu-project.org/repos/icu/icu/trunk/license.html + +/* + * Copyright (C) 1999-2010, International Business Machines + * Corporation and others. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * provided that the above copyright notice(s) and this permission notice appear + * in all copies of the Software and that both the above copyright notice(s) and + * this permission notice appear in supporting documentation. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE + * LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR + * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER + * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Except as contained in this notice, the name of a copyright holder shall not + * be used in advertising or otherwise to promote the sale, use or other + * dealings in this Software without prior written authorization of the + * copyright holder. + */ + +The following license applies to the Snowball stemmers: + +Copyright (c) 2001, Dr Martin Porter +Copyright (c) 2002, Richard Boulton +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holders nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +The following license applies to the KStemmer: + +Copyright © 2003, +Center for Intelligent Information Retrieval, +University of Massachusetts, Amherst. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +3. The names "Center for Intelligent Information Retrieval" and +"University of Massachusetts" must not be used to endorse or promote products +derived from this software without prior written permission. To obtain +permission, contact info@ciir.cs.umass.edu. + +THIS SOFTWARE IS PROVIDED BY UNIVERSITY OF MASSACHUSETTS AND OTHER CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + +The following license applies to the Morfologik project: + +Copyright (c) 2006 Dawid Weiss +Copyright (c) 2007-2011 Dawid Weiss, Marcin Miłkowski +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * Neither the name of Morfologik nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--- + +The dictionary comes from Morfologik project. Morfologik uses data from +Polish ispell/myspell dictionary hosted at http://www.sjp.pl/slownik/en/ and +is licenced on the terms of (inter alia) LGPL and Creative Commons +ShareAlike. The part-of-speech tags were added in Morfologik project and +are not found in the data from sjp.pl. The tagset is similar to IPI PAN +tagset. + +--- + +The following license applies to the Morfeusz project, +used by org.apache.lucene.analysis.morfologik. + +BSD-licensed dictionary of Polish (SGJP) +http://sgjp.pl/morfeusz/ + +Copyright © 2011 Zygmunt Saloni, Włodzimierz Gruszczyński, + Marcin Woliński, Robert Wołosz + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the + distribution. + +THIS SOFTWARE IS PROVIDED BY COPYRIGHT HOLDERS “AS IS” AND ANY EXPRESS +OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/modules/legacy-geo/licenses/lucene-NOTICE.txt b/modules/legacy-geo/licenses/lucene-NOTICE.txt new file mode 100644 index 0000000000000..1a1d51572432a --- /dev/null +++ b/modules/legacy-geo/licenses/lucene-NOTICE.txt @@ -0,0 +1,192 @@ +Apache Lucene +Copyright 2014 The Apache Software Foundation + +This product includes software developed at +The Apache Software Foundation (http://www.apache.org/). + +Includes software from other Apache Software Foundation projects, +including, but not limited to: + - Apache Ant + - Apache Jakarta Regexp + - Apache Commons + - Apache Xerces + +ICU4J, (under analysis/icu) is licensed under an MIT styles license +and Copyright (c) 1995-2008 International Business Machines Corporation and others + +Some data files (under analysis/icu/src/data) are derived from Unicode data such +as the Unicode Character Database. See http://unicode.org/copyright.html for more +details. + +Brics Automaton (under core/src/java/org/apache/lucene/util/automaton) is +BSD-licensed, created by Anders Møller. See http://www.brics.dk/automaton/ + +The levenshtein automata tables (under core/src/java/org/apache/lucene/util/automaton) were +automatically generated with the moman/finenight FSA library, created by +Jean-Philippe Barrette-LaPierre. This library is available under an MIT license, +see http://sites.google.com/site/rrettesite/moman and +http://bitbucket.org/jpbarrette/moman/overview/ + +The class org.apache.lucene.util.WeakIdentityMap was derived from +the Apache CXF project and is Apache License 2.0. + +The Google Code Prettify is Apache License 2.0. +See http://code.google.com/p/google-code-prettify/ + +JUnit (junit-4.10) is licensed under the Common Public License v. 1.0 +See http://junit.sourceforge.net/cpl-v10.html + +This product includes code (JaspellTernarySearchTrie) from Java Spelling Checkin +g Package (jaspell): http://jaspell.sourceforge.net/ +License: The BSD License (http://www.opensource.org/licenses/bsd-license.php) + +The snowball stemmers in + analysis/common/src/java/net/sf/snowball +were developed by Martin Porter and Richard Boulton. +The snowball stopword lists in + analysis/common/src/resources/org/apache/lucene/analysis/snowball +were developed by Martin Porter and Richard Boulton. +The full snowball package is available from + http://snowball.tartarus.org/ + +The KStem stemmer in + analysis/common/src/org/apache/lucene/analysis/en +was developed by Bob Krovetz and Sergio Guzman-Lara (CIIR-UMass Amherst) +under the BSD-license. + +The Arabic,Persian,Romanian,Bulgarian, Hindi and Bengali analyzers (common) come with a default +stopword list that is BSD-licensed created by Jacques Savoy. These files reside in: +analysis/common/src/resources/org/apache/lucene/analysis/ar/stopwords.txt, +analysis/common/src/resources/org/apache/lucene/analysis/fa/stopwords.txt, +analysis/common/src/resources/org/apache/lucene/analysis/ro/stopwords.txt, +analysis/common/src/resources/org/apache/lucene/analysis/bg/stopwords.txt, +analysis/common/src/resources/org/apache/lucene/analysis/hi/stopwords.txt, +analysis/common/src/resources/org/apache/lucene/analysis/bn/stopwords.txt +See http://members.unine.ch/jacques.savoy/clef/index.html. + +The German,Spanish,Finnish,French,Hungarian,Italian,Portuguese,Russian and Swedish light stemmers +(common) are based on BSD-licensed reference implementations created by Jacques Savoy and +Ljiljana Dolamic. These files reside in: +analysis/common/src/java/org/apache/lucene/analysis/de/GermanLightStemmer.java +analysis/common/src/java/org/apache/lucene/analysis/de/GermanMinimalStemmer.java +analysis/common/src/java/org/apache/lucene/analysis/es/SpanishLightStemmer.java +analysis/common/src/java/org/apache/lucene/analysis/fi/FinnishLightStemmer.java +analysis/common/src/java/org/apache/lucene/analysis/fr/FrenchLightStemmer.java +analysis/common/src/java/org/apache/lucene/analysis/fr/FrenchMinimalStemmer.java +analysis/common/src/java/org/apache/lucene/analysis/hu/HungarianLightStemmer.java +analysis/common/src/java/org/apache/lucene/analysis/it/ItalianLightStemmer.java +analysis/common/src/java/org/apache/lucene/analysis/pt/PortugueseLightStemmer.java +analysis/common/src/java/org/apache/lucene/analysis/ru/RussianLightStemmer.java +analysis/common/src/java/org/apache/lucene/analysis/sv/SwedishLightStemmer.java + +The Stempel analyzer (stempel) includes BSD-licensed software developed +by the Egothor project http://egothor.sf.net/, created by Leo Galambos, Martin Kvapil, +and Edmond Nolan. + +The Polish analyzer (stempel) comes with a default +stopword list that is BSD-licensed created by the Carrot2 project. The file resides +in stempel/src/resources/org/apache/lucene/analysis/pl/stopwords.txt. +See http://project.carrot2.org/license.html. + +The SmartChineseAnalyzer source code (smartcn) was +provided by Xiaoping Gao and copyright 2009 by www.imdict.net. + +WordBreakTestUnicode_*.java (under modules/analysis/common/src/test/) +is derived from Unicode data such as the Unicode Character Database. +See http://unicode.org/copyright.html for more details. + +The Morfologik analyzer (morfologik) includes BSD-licensed software +developed by Dawid Weiss and Marcin Miłkowski (http://morfologik.blogspot.com/). + +Morfologik uses data from Polish ispell/myspell dictionary +(http://www.sjp.pl/slownik/en/) licenced on the terms of (inter alia) +LGPL and Creative Commons ShareAlike. + +Morfologic includes data from BSD-licensed dictionary of Polish (SGJP) +(http://sgjp.pl/morfeusz/) + +Servlet-api.jar and javax.servlet-*.jar are under the CDDL license, the original +source code for this can be found at http://www.eclipse.org/jetty/downloads.php + +=========================================================================== +Kuromoji Japanese Morphological Analyzer - Apache Lucene Integration +=========================================================================== + +This software includes a binary and/or source version of data from + + mecab-ipadic-2.7.0-20070801 + +which can be obtained from + + http://atilika.com/releases/mecab-ipadic/mecab-ipadic-2.7.0-20070801.tar.gz + +or + + http://jaist.dl.sourceforge.net/project/mecab/mecab-ipadic/2.7.0-20070801/mecab-ipadic-2.7.0-20070801.tar.gz + +=========================================================================== +mecab-ipadic-2.7.0-20070801 Notice +=========================================================================== + +Nara Institute of Science and Technology (NAIST), +the copyright holders, disclaims all warranties with regard to this +software, including all implied warranties of merchantability and +fitness, in no event shall NAIST be liable for +any special, indirect or consequential damages or any damages +whatsoever resulting from loss of use, data or profits, whether in an +action of contract, negligence or other tortuous action, arising out +of or in connection with the use or performance of this software. + +A large portion of the dictionary entries +originate from ICOT Free Software. The following conditions for ICOT +Free Software applies to the current dictionary as well. + +Each User may also freely distribute the Program, whether in its +original form or modified, to any third party or parties, PROVIDED +that the provisions of Section 3 ("NO WARRANTY") will ALWAYS appear +on, or be attached to, the Program, which is distributed substantially +in the same form as set out herein and that such intended +distribution, if actually made, will neither violate or otherwise +contravene any of the laws and regulations of the countries having +jurisdiction over the User or the intended distribution itself. + +NO WARRANTY + +The program was produced on an experimental basis in the course of the +research and development conducted during the project and is provided +to users as so produced on an experimental basis. Accordingly, the +program is provided without any warranty whatsoever, whether express, +implied, statutory or otherwise. The term "warranty" used herein +includes, but is not limited to, any warranty of the quality, +performance, merchantability and fitness for a particular purpose of +the program and the nonexistence of any infringement or violation of +any right of any third party. + +Each user of the program will agree and understand, and be deemed to +have agreed and understood, that there is no warranty whatsoever for +the program and, accordingly, the entire risk arising from or +otherwise connected with the program is assumed by the user. + +Therefore, neither ICOT, the copyright holder, or any other +organization that participated in or was otherwise related to the +development of the program and their respective officials, directors, +officers and other employees shall be held liable for any and all +damages, including, without limitation, general, special, incidental +and consequential damages, arising out of or otherwise in connection +with the use or inability to use the program or any product, material +or result produced or otherwise obtained by using the program, +regardless of whether they have been advised of, or otherwise had +knowledge of, the possibility of such damages at any time during the +project or thereafter. Each user will be deemed to have agreed to the +foregoing by his or her commencement of use of the program. The term +"use" as used herein includes, but is not limited to, the use, +modification, copying and distribution of the program and the +production of secondary products from the program. + +In the case where the program, whether in its original form or +modified, was distributed or delivered to or received by a user from +any person, organization or entity other than ICOT, unless it makes or +grants independently of ICOT any specific warranty to the user in +writing, such person, organization or entity, will also be exempted +from and not be held liable to the user for any such damages as noted +above as far as the program is concerned. diff --git a/server/licenses/lucene-spatial-extras-9.0.0-snapshot-cb366d04d4a.jar.sha1 b/modules/legacy-geo/licenses/lucene-spatial-extras-9.0.0-snapshot-cb366d04d4a.jar.sha1 similarity index 100% rename from server/licenses/lucene-spatial-extras-9.0.0-snapshot-cb366d04d4a.jar.sha1 rename to modules/legacy-geo/licenses/lucene-spatial-extras-9.0.0-snapshot-cb366d04d4a.jar.sha1 diff --git a/server/licenses/spatial4j-0.7.jar.sha1 b/modules/legacy-geo/licenses/spatial4j-0.7.jar.sha1 similarity index 100% rename from server/licenses/spatial4j-0.7.jar.sha1 rename to modules/legacy-geo/licenses/spatial4j-0.7.jar.sha1 diff --git a/server/licenses/spatial4j-ABOUT.txt b/modules/legacy-geo/licenses/spatial4j-ABOUT.txt similarity index 100% rename from server/licenses/spatial4j-ABOUT.txt rename to modules/legacy-geo/licenses/spatial4j-ABOUT.txt diff --git a/server/licenses/spatial4j-LICENSE.txt b/modules/legacy-geo/licenses/spatial4j-LICENSE.txt similarity index 100% rename from server/licenses/spatial4j-LICENSE.txt rename to modules/legacy-geo/licenses/spatial4j-LICENSE.txt diff --git a/server/licenses/spatial4j-NOTICE.txt b/modules/legacy-geo/licenses/spatial4j-NOTICE.txt similarity index 100% rename from server/licenses/spatial4j-NOTICE.txt rename to modules/legacy-geo/licenses/spatial4j-NOTICE.txt diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/geo/GeoBoundingBoxQueryLegacyGeoShapeIT.java b/modules/legacy-geo/src/internalClusterTest/java/org/elasticsearch/legacygeo/search/GeoBoundingBoxQueryLegacyGeoShapeIT.java similarity index 69% rename from server/src/internalClusterTest/java/org/elasticsearch/search/geo/GeoBoundingBoxQueryLegacyGeoShapeIT.java rename to modules/legacy-geo/src/internalClusterTest/java/org/elasticsearch/legacygeo/search/GeoBoundingBoxQueryLegacyGeoShapeIT.java index b8589bb3407a4..c92df28e79591 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/geo/GeoBoundingBoxQueryLegacyGeoShapeIT.java +++ b/modules/legacy-geo/src/internalClusterTest/java/org/elasticsearch/legacygeo/search/GeoBoundingBoxQueryLegacyGeoShapeIT.java @@ -6,13 +6,14 @@ * Side Public License, v 1. */ -package org.elasticsearch.search.geo; +package org.elasticsearch.legacygeo.search; import org.elasticsearch.Version; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.legacygeo.test.TestLegacyGeoShapeFieldMapperPlugin; import org.elasticsearch.plugins.Plugin; -import org.elasticsearch.test.TestLegacyGeoShapeFieldMapperPlugin; +import org.elasticsearch.search.geo.GeoBoundingBoxQueryIntegTestCase; import org.elasticsearch.test.VersionUtils; import java.io.IOException; @@ -33,9 +34,17 @@ protected Collection> nodePlugins() { @Override public XContentBuilder getMapping() throws IOException { - return XContentFactory.jsonBuilder().startObject().startObject("_doc") - .startObject("properties").startObject("location").field("type", "geo_shape").field("strategy", "recursive") - .endObject().endObject().endObject().endObject(); + return XContentFactory.jsonBuilder() + .startObject() + .startObject("_doc") + .startObject("properties") + .startObject("location") + .field("type", "geo_shape") + .field("strategy", "recursive") + .endObject() + .endObject() + .endObject() + .endObject(); } @Override @@ -43,4 +52,3 @@ public Version randomSupportedVersion() { return VersionUtils.randomIndexCompatibleVersion(random()); } } - diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/geo/LegacyGeoShapeIT.java b/modules/legacy-geo/src/internalClusterTest/java/org/elasticsearch/legacygeo/search/LegacyGeoShapeIT.java similarity index 75% rename from server/src/internalClusterTest/java/org/elasticsearch/search/geo/LegacyGeoShapeIT.java rename to modules/legacy-geo/src/internalClusterTest/java/org/elasticsearch/legacygeo/search/LegacyGeoShapeIT.java index 375ab6e41f061..86114e491fc0d 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/geo/LegacyGeoShapeIT.java +++ b/modules/legacy-geo/src/internalClusterTest/java/org/elasticsearch/legacygeo/search/LegacyGeoShapeIT.java @@ -6,15 +6,16 @@ * Side Public License, v 1. */ -package org.elasticsearch.search.geo; +package org.elasticsearch.legacygeo.search; import org.elasticsearch.Version; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.geometry.Circle; +import org.elasticsearch.legacygeo.test.TestLegacyGeoShapeFieldMapperPlugin; import org.elasticsearch.plugins.Plugin; -import org.elasticsearch.test.TestLegacyGeoShapeFieldMapperPlugin; +import org.elasticsearch.search.geo.GeoShapeIntegTestCase; import org.elasticsearch.test.VersionUtils; import java.io.IOException; @@ -58,21 +59,27 @@ protected boolean allowExpensiveQueries() { */ public void testLegacyCircle() throws Exception { // create index - assertAcked(prepareCreate("test").setSettings(settings(randomSupportedVersion()).build()) - .setMapping("shape", "type=geo_shape,strategy=recursive,tree=geohash").get()); + assertAcked( + prepareCreate("test").setSettings(settings(randomSupportedVersion()).build()) + .setMapping("shape", "type=geo_shape,strategy=recursive,tree=geohash") + .get() + ); ensureGreen(); indexRandom(true, client().prepareIndex("test").setId("0").setSource("shape", (ToXContent) (builder, params) -> { - builder.startObject().field("type", "circle") - .startArray("coordinates").value(30).value(50).endArray() - .field("radius","77km") + builder.startObject() + .field("type", "circle") + .startArray("coordinates") + .value(30) + .value(50) + .endArray() + .field("radius", "77km") .endObject(); return builder; })); // test self crossing of circles - SearchResponse searchResponse = client().prepareSearch("test").setQuery(geoShapeQuery("shape", - new Circle(30, 50, 77000))).get(); + SearchResponse searchResponse = client().prepareSearch("test").setQuery(geoShapeQuery("shape", new Circle(30, 50, 77000))).get(); assertThat(searchResponse.getHits().getTotalHits().value, equalTo(1L)); } } diff --git a/server/src/main/java/org/elasticsearch/common/geo/GeoShapeType.java b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/GeoShapeType.java similarity index 70% rename from server/src/main/java/org/elasticsearch/common/geo/GeoShapeType.java rename to modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/GeoShapeType.java index 3781a66792942..fb72ee793d399 100644 --- a/server/src/main/java/org/elasticsearch/common/geo/GeoShapeType.java +++ b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/GeoShapeType.java @@ -5,23 +5,24 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -package org.elasticsearch.common.geo; +package org.elasticsearch.legacygeo; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.geo.builders.CircleBuilder; -import org.elasticsearch.common.geo.builders.CoordinatesBuilder; -import org.elasticsearch.common.geo.builders.EnvelopeBuilder; -import org.elasticsearch.common.geo.builders.GeometryCollectionBuilder; -import org.elasticsearch.common.geo.builders.LineStringBuilder; -import org.elasticsearch.common.geo.builders.MultiLineStringBuilder; -import org.elasticsearch.common.geo.builders.MultiPointBuilder; -import org.elasticsearch.common.geo.builders.MultiPolygonBuilder; -import org.elasticsearch.common.geo.builders.PointBuilder; -import org.elasticsearch.common.geo.builders.PolygonBuilder; -import org.elasticsearch.common.geo.builders.ShapeBuilder; -import org.elasticsearch.common.geo.parsers.CoordinateNode; +import org.elasticsearch.common.geo.Orientation; import org.elasticsearch.common.io.stream.NamedWriteableRegistry.Entry; import org.elasticsearch.common.unit.DistanceUnit; +import org.elasticsearch.legacygeo.builders.CircleBuilder; +import org.elasticsearch.legacygeo.builders.CoordinatesBuilder; +import org.elasticsearch.legacygeo.builders.EnvelopeBuilder; +import org.elasticsearch.legacygeo.builders.GeometryCollectionBuilder; +import org.elasticsearch.legacygeo.builders.LineStringBuilder; +import org.elasticsearch.legacygeo.builders.MultiLineStringBuilder; +import org.elasticsearch.legacygeo.builders.MultiPointBuilder; +import org.elasticsearch.legacygeo.builders.MultiPolygonBuilder; +import org.elasticsearch.legacygeo.builders.PointBuilder; +import org.elasticsearch.legacygeo.builders.PolygonBuilder; +import org.elasticsearch.legacygeo.builders.ShapeBuilder; +import org.elasticsearch.legacygeo.parsers.CoordinateNode; import org.locationtech.jts.geom.Coordinate; import java.util.ArrayList; @@ -36,8 +37,7 @@ public enum GeoShapeType { POINT("point") { @Override - public PointBuilder getBuilder(CoordinateNode coordinates, DistanceUnit.Distance radius, - Orientation orientation, boolean coerce) { + public PointBuilder getBuilder(CoordinateNode coordinates, DistanceUnit.Distance radius, Orientation orientation, boolean coerce) { return new PointBuilder().coordinate(validate(coordinates, coerce).coordinate); } @@ -45,7 +45,8 @@ public PointBuilder getBuilder(CoordinateNode coordinates, DistanceUnit.Distance CoordinateNode validate(CoordinateNode coordinates, boolean coerce) { if (coordinates.isEmpty()) { throw new ElasticsearchParseException( - "invalid number of points (0) provided when expecting a single coordinate ([lat, lng])"); + "invalid number of points (0) provided when expecting a single coordinate ([lat, lng])" + ); } else if (coordinates.children != null) { throw new ElasticsearchParseException("multipoint data provided when single point data expected."); } @@ -54,8 +55,12 @@ CoordinateNode validate(CoordinateNode coordinates, boolean coerce) { }, MULTIPOINT("multipoint") { @Override - public MultiPointBuilder getBuilder(CoordinateNode coordinates, DistanceUnit.Distance radius, - Orientation orientation, boolean coerce) { + public MultiPointBuilder getBuilder( + CoordinateNode coordinates, + DistanceUnit.Distance radius, + Orientation orientation, + boolean coerce + ) { validate(coordinates, coerce); CoordinatesBuilder coordinatesBuilder = new CoordinatesBuilder(); for (CoordinateNode node : coordinates.children) { @@ -68,11 +73,14 @@ public MultiPointBuilder getBuilder(CoordinateNode coordinates, DistanceUnit.Dis CoordinateNode validate(CoordinateNode coordinates, boolean coerce) { if (coordinates.children == null || coordinates.children.isEmpty()) { if (coordinates.coordinate != null) { - throw new ElasticsearchParseException("single coordinate found when expecting an array of " + - "coordinates. change type to point or change data to an array of >0 coordinates"); + throw new ElasticsearchParseException( + "single coordinate found when expecting an array of " + + "coordinates. change type to point or change data to an array of >0 coordinates" + ); } - throw new ElasticsearchParseException("no data provided for multipoint object when expecting " + - ">0 points (e.g., [[lat, lng]] or [[lat, lng], ...])"); + throw new ElasticsearchParseException( + "no data provided for multipoint object when expecting " + ">0 points (e.g., [[lat, lng]] or [[lat, lng], ...])" + ); } else { for (CoordinateNode point : coordinates.children) { POINT.validate(point, coerce); @@ -84,8 +92,12 @@ CoordinateNode validate(CoordinateNode coordinates, boolean coerce) { }, LINESTRING("linestring") { @Override - public LineStringBuilder getBuilder(CoordinateNode coordinates, DistanceUnit.Distance radius, - Orientation orientation, boolean coerce) { + public LineStringBuilder getBuilder( + CoordinateNode coordinates, + DistanceUnit.Distance radius, + Orientation orientation, + boolean coerce + ) { validate(coordinates, coerce); CoordinatesBuilder line = new CoordinatesBuilder(); for (CoordinateNode node : coordinates.children) { @@ -97,16 +109,22 @@ public LineStringBuilder getBuilder(CoordinateNode coordinates, DistanceUnit.Dis @Override CoordinateNode validate(CoordinateNode coordinates, boolean coerce) { if (coordinates.children.size() < 2) { - throw new ElasticsearchParseException("invalid number of points in LineString (found [{}] - must be >= 2)", - coordinates.children.size()); + throw new ElasticsearchParseException( + "invalid number of points in LineString (found [{}] - must be >= 2)", + coordinates.children.size() + ); } return coordinates; } }, MULTILINESTRING("multilinestring") { @Override - public MultiLineStringBuilder getBuilder(CoordinateNode coordinates, DistanceUnit.Distance radius, - Orientation orientation, boolean coerce) { + public MultiLineStringBuilder getBuilder( + CoordinateNode coordinates, + DistanceUnit.Distance radius, + Orientation orientation, + boolean coerce + ) { validate(coordinates, coerce); MultiLineStringBuilder multiline = new MultiLineStringBuilder(); for (CoordinateNode node : coordinates.children) { @@ -118,20 +136,27 @@ public MultiLineStringBuilder getBuilder(CoordinateNode coordinates, DistanceUni @Override CoordinateNode validate(CoordinateNode coordinates, boolean coerce) { if (coordinates.children.size() < 1) { - throw new ElasticsearchParseException("invalid number of lines in MultiLineString (found [{}] - must be >= 1)", - coordinates.children.size()); + throw new ElasticsearchParseException( + "invalid number of lines in MultiLineString (found [{}] - must be >= 1)", + coordinates.children.size() + ); } return coordinates; } }, POLYGON("polygon") { @Override - public PolygonBuilder getBuilder(CoordinateNode coordinates, DistanceUnit.Distance radius, - Orientation orientation, boolean coerce) { + public PolygonBuilder getBuilder( + CoordinateNode coordinates, + DistanceUnit.Distance radius, + Orientation orientation, + boolean coerce + ) { validate(coordinates, coerce); // build shell - LineStringBuilder shell = LineStringBuilder.class.cast(LINESTRING.getBuilder(coordinates.children.get(0), - radius, orientation, coerce)); + LineStringBuilder shell = LineStringBuilder.class.cast( + LINESTRING.getBuilder(coordinates.children.get(0), radius, orientation, coerce) + ); // build polygon with shell and holes PolygonBuilder polygon = new PolygonBuilder(shell, orientation); for (int i = 1; i < coordinates.children.size(); ++i) { @@ -145,19 +170,24 @@ public PolygonBuilder getBuilder(CoordinateNode coordinates, DistanceUnit.Distan void validateLinearRing(CoordinateNode coordinates, boolean coerce) { if (coordinates.children == null || coordinates.children.isEmpty()) { String error = "Invalid LinearRing found."; - error += (coordinates.coordinate == null) ? - " No coordinate array provided" : " Found a single coordinate when expecting a coordinate array"; + error += (coordinates.coordinate == null) + ? " No coordinate array provided" + : " Found a single coordinate when expecting a coordinate array"; throw new ElasticsearchParseException(error); } int numValidPts = coerce ? 3 : 4; if (coordinates.children.size() < numValidPts) { - throw new ElasticsearchParseException("invalid number of points in LinearRing (found [{}] - must be >= [{}])", - coordinates.children.size(), numValidPts); + throw new ElasticsearchParseException( + "invalid number of points in LinearRing (found [{}] - must be >= [{}])", + coordinates.children.size(), + numValidPts + ); } // close linear ring iff coerce is set and ring is open, otherwise throw parse exception if (coordinates.children.get(0).coordinate.equals( - coordinates.children.get(coordinates.children.size() - 1).coordinate) == false) { + coordinates.children.get(coordinates.children.size() - 1).coordinate + ) == false) { if (coerce) { coordinates.children.add(coordinates.children.get(0)); } else { @@ -176,7 +206,8 @@ CoordinateNode validate(CoordinateNode coordinates, boolean coerce) { */ if (coordinates.children == null || coordinates.children.isEmpty()) { throw new ElasticsearchParseException( - "invalid LinearRing provided for type polygon. Linear ring must be an array of coordinates"); + "invalid LinearRing provided for type polygon. Linear ring must be an array of coordinates" + ); } for (CoordinateNode ring : coordinates.children) { validateLinearRing(ring, coerce); @@ -187,8 +218,12 @@ CoordinateNode validate(CoordinateNode coordinates, boolean coerce) { }, MULTIPOLYGON("multipolygon") { @Override - public MultiPolygonBuilder getBuilder(CoordinateNode coordinates, DistanceUnit.Distance radius, - Orientation orientation, boolean coerce) { + public MultiPolygonBuilder getBuilder( + CoordinateNode coordinates, + DistanceUnit.Distance radius, + Orientation orientation, + boolean coerce + ) { validate(coordinates, coerce); MultiPolygonBuilder polygons = new MultiPolygonBuilder(orientation); for (CoordinateNode node : coordinates.children) { @@ -205,8 +240,12 @@ CoordinateNode validate(CoordinateNode coordinates, boolean coerce) { }, ENVELOPE("envelope") { @Override - public EnvelopeBuilder getBuilder(CoordinateNode coordinates, DistanceUnit.Distance radius, - Orientation orientation, boolean coerce) { + public EnvelopeBuilder getBuilder( + CoordinateNode coordinates, + DistanceUnit.Distance radius, + Orientation orientation, + boolean coerce + ) { validate(coordinates, coerce); // verify coordinate bounds, correct if necessary Coordinate uL = coordinates.children.get(0).coordinate; @@ -220,7 +259,9 @@ CoordinateNode validate(CoordinateNode coordinates, boolean coerce) { if (coordinates.children.size() != 2) { throw new ElasticsearchParseException( "invalid number of points [{}] provided for geo_shape [{}] when expecting an array of 2 coordinates", - coordinates.children.size(), GeoShapeType.ENVELOPE.shapename); + coordinates.children.size(), + GeoShapeType.ENVELOPE.shapename + ); } return coordinates; } @@ -232,8 +273,7 @@ public String wktName() { }, CIRCLE("circle") { @Override - public CircleBuilder getBuilder(CoordinateNode coordinates, DistanceUnit.Distance radius, - Orientation orientation, boolean coerce) { + public CircleBuilder getBuilder(CoordinateNode coordinates, DistanceUnit.Distance radius, Orientation orientation, boolean coerce) { return new CircleBuilder().center(coordinates.coordinate).radius(radius); } @@ -246,8 +286,12 @@ CoordinateNode validate(CoordinateNode coordinates, boolean coerce) { }, GEOMETRYCOLLECTION("geometrycollection") { @Override - public ShapeBuilder getBuilder(CoordinateNode coordinates, DistanceUnit.Distance radius, - Orientation orientation, boolean coerce) { + public ShapeBuilder getBuilder( + CoordinateNode coordinates, + DistanceUnit.Distance radius, + Orientation orientation, + boolean coerce + ) { // noop, handled in parser return null; } @@ -283,11 +327,16 @@ public static GeoShapeType forName(String geoshapename) { if (shapeTypeMap.containsKey(typename)) { return shapeTypeMap.get(typename); } - throw new IllegalArgumentException("unknown geo_shape ["+geoshapename+"]"); + throw new IllegalArgumentException("unknown geo_shape [" + geoshapename + "]"); } - public abstract ShapeBuilder getBuilder(CoordinateNode coordinates, DistanceUnit.Distance radius, - Orientation orientation, boolean coerce); + public abstract ShapeBuilder getBuilder( + CoordinateNode coordinates, + DistanceUnit.Distance radius, + Orientation orientation, + boolean coerce + ); + abstract CoordinateNode validate(CoordinateNode coordinates, boolean coerce); /** wkt shape name */ diff --git a/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/LegacyGeoPlugin.java b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/LegacyGeoPlugin.java new file mode 100644 index 0000000000000..edd26afe526ca --- /dev/null +++ b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/LegacyGeoPlugin.java @@ -0,0 +1,30 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.legacygeo; + +import org.elasticsearch.common.io.stream.NamedWriteableRegistry; +import org.elasticsearch.plugins.ExtensiblePlugin; +import org.elasticsearch.plugins.Plugin; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +public class LegacyGeoPlugin extends Plugin implements ExtensiblePlugin { + + @Override + public List getNamedWriteables() { + if (ShapesAvailability.JTS_AVAILABLE && ShapesAvailability.SPATIAL4J_AVAILABLE) { + return new ArrayList<>(GeoShapeType.getShapeWriteables()); + + } + return Collections.emptyList(); + } + +} diff --git a/server/src/main/java/org/elasticsearch/common/geo/ShapesAvailability.java b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/ShapesAvailability.java similarity index 96% rename from server/src/main/java/org/elasticsearch/common/geo/ShapesAvailability.java rename to modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/ShapesAvailability.java index e0b7cbe62532f..41d574fc240d2 100644 --- a/server/src/main/java/org/elasticsearch/common/geo/ShapesAvailability.java +++ b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/ShapesAvailability.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.geo; +package org.elasticsearch.legacygeo; public class ShapesAvailability { diff --git a/server/src/main/java/org/elasticsearch/common/geo/XShapeCollection.java b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/XShapeCollection.java similarity index 67% rename from server/src/main/java/org/elasticsearch/common/geo/XShapeCollection.java rename to modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/XShapeCollection.java index 7be44a445acc9..891bd4b546a59 100644 --- a/server/src/main/java/org/elasticsearch/common/geo/XShapeCollection.java +++ b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/XShapeCollection.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.geo; +package org.elasticsearch.legacygeo; import org.locationtech.spatial4j.context.SpatialContext; import org.locationtech.spatial4j.shape.Shape; @@ -19,17 +19,17 @@ */ public class XShapeCollection extends ShapeCollection { - private boolean pointsOnly = false; + private boolean pointsOnly = false; - public XShapeCollection(List shapes, SpatialContext ctx) { - super(shapes, ctx); - } + public XShapeCollection(List shapes, SpatialContext ctx) { + super(shapes, ctx); + } - public boolean pointsOnly() { - return this.pointsOnly; - } + public boolean pointsOnly() { + return this.pointsOnly; + } - public void setPointsOnly(boolean pointsOnly) { - this.pointsOnly = pointsOnly; - } + public void setPointsOnly(boolean pointsOnly) { + this.pointsOnly = pointsOnly; + } } diff --git a/server/src/main/java/org/elasticsearch/common/geo/builders/CircleBuilder.java b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/CircleBuilder.java similarity index 92% rename from server/src/main/java/org/elasticsearch/common/geo/builders/CircleBuilder.java rename to modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/CircleBuilder.java index 547c74c2695a5..fdff95a0b4345 100644 --- a/server/src/main/java/org/elasticsearch/common/geo/builders/CircleBuilder.java +++ b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/CircleBuilder.java @@ -6,19 +6,18 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.geo.builders; - -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.geo.GeoShapeType; -import org.elasticsearch.common.geo.parsers.ShapeParser; -import org.locationtech.spatial4j.shape.Circle; -import org.locationtech.jts.geom.Coordinate; +package org.elasticsearch.legacygeo.builders; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.unit.DistanceUnit; import org.elasticsearch.common.unit.DistanceUnit.Distance; +import org.elasticsearch.common.xcontent.ParseField; import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.legacygeo.GeoShapeType; +import org.elasticsearch.legacygeo.parsers.ShapeParser; +import org.locationtech.jts.geom.Coordinate; +import org.locationtech.spatial4j.shape.Circle; import java.io.IOException; import java.util.Objects; @@ -154,7 +153,7 @@ public Circle buildS4J() { @Override public org.elasticsearch.geometry.Circle buildGeometry() { - return new org.elasticsearch.geometry.Circle(center.x, center.y, unit.toMeters(radius)); + return new org.elasticsearch.geometry.Circle(center.x, center.y, unit.toMeters(radius)); } @Override @@ -185,8 +184,8 @@ public boolean equals(Object obj) { return false; } CircleBuilder other = (CircleBuilder) obj; - return Objects.equals(center, other.center) && - Objects.equals(radius, other.radius) && - Objects.equals(unit.ordinal(), other.unit.ordinal()); + return Objects.equals(center, other.center) + && Objects.equals(radius, other.radius) + && Objects.equals(unit.ordinal(), other.unit.ordinal()); } } diff --git a/server/src/main/java/org/elasticsearch/common/geo/builders/CoordinatesBuilder.java b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/CoordinatesBuilder.java similarity index 81% rename from server/src/main/java/org/elasticsearch/common/geo/builders/CoordinatesBuilder.java rename to modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/CoordinatesBuilder.java index 3389857bcbbad..c537c0d3b4a82 100644 --- a/server/src/main/java/org/elasticsearch/common/geo/builders/CoordinatesBuilder.java +++ b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/CoordinatesBuilder.java @@ -6,10 +6,10 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.geo.builders; +package org.elasticsearch.legacygeo.builders; -import org.locationtech.jts.geom.Coordinate; import org.elasticsearch.ElasticsearchException; +import org.locationtech.jts.geom.Coordinate; import java.util.ArrayList; import java.util.Arrays; @@ -34,9 +34,12 @@ public CoordinatesBuilder coordinate(Coordinate coordinate) { int expectedDims; int actualDims; if (points.isEmpty() == false - && (expectedDims = Double.isNaN(points.get(0).z) ? 2 : 3) != (actualDims = Double.isNaN(coordinate.z) ? 2 : 3)) { - throw new ElasticsearchException("unable to add coordinate to CoordinateBuilder: " + - "coordinate dimensions do not match. Expected [{}] but found [{}]", expectedDims, actualDims); + && (expectedDims = Double.isNaN(points.get(0).z) ? 2 : 3) != (actualDims = Double.isNaN(coordinate.z) ? 2 : 3)) { + throw new ElasticsearchException( + "unable to add coordinate to CoordinateBuilder: " + "coordinate dimensions do not match. Expected [{}] but found [{}]", + expectedDims, + actualDims + ); } else { this.points.add(coordinate); @@ -60,7 +63,7 @@ public CoordinatesBuilder coordinate(double longitude, double latitude) { * @param coordinates array of {@link Coordinate}s to add * @return this */ - public CoordinatesBuilder coordinates(Coordinate...coordinates) { + public CoordinatesBuilder coordinates(Coordinate... coordinates) { return this.coordinates(Arrays.asList(coordinates)); } @@ -81,8 +84,8 @@ public CoordinatesBuilder coordinates(Collection coordinat */ public CoordinatesBuilder close() { Coordinate start = points.get(0); - Coordinate end = points.get(points.size()-1); - if(start.x != end.x || start.y != end.y) { + Coordinate end = points.get(points.size() - 1); + if (start.x != end.x || start.y != end.y) { points.add(start); } return this; diff --git a/server/src/main/java/org/elasticsearch/common/geo/builders/EnvelopeBuilder.java b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/EnvelopeBuilder.java similarity index 92% rename from server/src/main/java/org/elasticsearch/common/geo/builders/EnvelopeBuilder.java rename to modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/EnvelopeBuilder.java index 1be8e535c5372..ef9df9ec84b79 100644 --- a/server/src/main/java/org/elasticsearch/common/geo/builders/EnvelopeBuilder.java +++ b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/EnvelopeBuilder.java @@ -6,17 +6,16 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.geo.builders; - -import org.elasticsearch.common.geo.GeoShapeType; -import org.elasticsearch.common.geo.parsers.GeoWKTParser; -import org.elasticsearch.common.geo.parsers.ShapeParser; -import org.locationtech.spatial4j.shape.Rectangle; -import org.locationtech.jts.geom.Coordinate; +package org.elasticsearch.legacygeo.builders; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.legacygeo.GeoShapeType; +import org.elasticsearch.legacygeo.parsers.GeoWKTParser; +import org.elasticsearch.legacygeo.parsers.ShapeParser; +import org.locationtech.jts.geom.Coordinate; +import org.locationtech.spatial4j.shape.Rectangle; import java.io.IOException; import java.util.Objects; @@ -130,7 +129,6 @@ public boolean equals(Object obj) { return false; } EnvelopeBuilder other = (EnvelopeBuilder) obj; - return Objects.equals(topLeft, other.topLeft) && - Objects.equals(bottomRight, other.bottomRight); + return Objects.equals(topLeft, other.topLeft) && Objects.equals(bottomRight, other.bottomRight); } } diff --git a/server/src/main/java/org/elasticsearch/common/geo/builders/GeometryCollectionBuilder.java b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/GeometryCollectionBuilder.java similarity index 86% rename from server/src/main/java/org/elasticsearch/common/geo/builders/GeometryCollectionBuilder.java rename to modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/GeometryCollectionBuilder.java index 299735b786fbc..97dba205d8b51 100644 --- a/server/src/main/java/org/elasticsearch/common/geo/builders/GeometryCollectionBuilder.java +++ b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/GeometryCollectionBuilder.java @@ -6,18 +6,18 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.geo.builders; +package org.elasticsearch.legacygeo.builders; import org.elasticsearch.ElasticsearchException; -import org.elasticsearch.common.geo.GeoShapeType; -import org.elasticsearch.common.geo.XShapeCollection; -import org.elasticsearch.common.geo.parsers.GeoWKTParser; -import org.elasticsearch.common.geo.parsers.ShapeParser; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.geometry.Geometry; import org.elasticsearch.geometry.GeometryCollection; +import org.elasticsearch.legacygeo.GeoShapeType; +import org.elasticsearch.legacygeo.XShapeCollection; +import org.elasticsearch.legacygeo.parsers.GeoWKTParser; +import org.elasticsearch.legacygeo.parsers.ShapeParser; import org.locationtech.spatial4j.shape.Shape; import java.io.IOException; @@ -25,8 +25,7 @@ import java.util.List; import java.util.Objects; -public class GeometryCollectionBuilder extends ShapeBuilder, GeometryCollectionBuilder> { +public class GeometryCollectionBuilder extends ShapeBuilder, GeometryCollectionBuilder> { public static final GeoShapeType TYPE = GeoShapeType.GEOMETRYCOLLECTION; @@ -38,8 +37,7 @@ public class GeometryCollectionBuilder extends ShapeBuilder getShapeAt(int i) { if (i >= this.shapes.size() || i < 0) { - throw new ElasticsearchException("GeometryCollection contains " + this.shapes.size() + " shapes. + " + - "No shape found at index " + i); + throw new ElasticsearchException( + "GeometryCollection contains " + this.shapes.size() + " shapes. + " + "No shape found at index " + i + ); } return this.shapes.get(i); } @@ -153,8 +152,7 @@ public GeoShapeType type() { @Override public int numDimensions() { if (shapes == null || shapes.isEmpty()) { - throw new IllegalStateException("unable to get number of dimensions, " + - "GeometryCollection has not yet been initialized"); + throw new IllegalStateException("unable to get number of dimensions, " + "GeometryCollection has not yet been initialized"); } return shapes.get(0).numDimensions(); } @@ -168,11 +166,9 @@ public Shape buildS4J() { shapes.add(shape.buildS4J()); } - if (shapes.size() == 1) - return shapes.get(0); - else - return new XShapeCollection<>(shapes, SPATIAL_CONTEXT); - //note: ShapeCollection is probably faster than a Multi* geom. + if (shapes.size() == 1) return shapes.get(0); + else return new XShapeCollection<>(shapes, SPATIAL_CONTEXT); + // note: ShapeCollection is probably faster than a Multi* geom. } @Override diff --git a/server/src/main/java/org/elasticsearch/common/geo/builders/LineStringBuilder.java b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/LineStringBuilder.java similarity index 80% rename from server/src/main/java/org/elasticsearch/common/geo/builders/LineStringBuilder.java rename to modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/LineStringBuilder.java index a63f6c99b6b16..f758b31756dcb 100644 --- a/server/src/main/java/org/elasticsearch/common/geo/builders/LineStringBuilder.java +++ b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/LineStringBuilder.java @@ -6,13 +6,13 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.geo.builders; +package org.elasticsearch.legacygeo.builders; -import org.elasticsearch.common.geo.GeoShapeType; -import org.elasticsearch.common.geo.parsers.ShapeParser; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.geometry.Line; +import org.elasticsearch.legacygeo.GeoShapeType; +import org.elasticsearch.legacygeo.parsers.ShapeParser; import org.locationtech.jts.geom.Coordinate; import org.locationtech.jts.geom.Geometry; import org.locationtech.jts.geom.GeometryFactory; @@ -37,7 +37,9 @@ public class LineStringBuilder extends ShapeBuilder coordinates) { super(coordinates); if (coordinates.size() < 2) { - throw new IllegalArgumentException("invalid number of points in LineString (found [" + coordinates.size()+ "] - must be >= 2)"); + throw new IllegalArgumentException( + "invalid number of points in LineString (found [" + coordinates.size() + "] - must be >= 2)" + ); } } @@ -69,7 +71,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws public LineStringBuilder close() { Coordinate start = coordinates.get(0); Coordinate end = coordinates.get(coordinates.size() - 1); - if(start.x != end.x || start.y != end.y) { + if (start.x != end.x || start.y != end.y) { coordinates.add(start); } return this; @@ -83,8 +85,7 @@ public GeoShapeType type() { @Override public int numDimensions() { if (coordinates == null || coordinates.isEmpty()) { - throw new IllegalStateException("unable to get number of dimensions, " + - "LineString has not yet been initialized"); + throw new IllegalStateException("unable to get number of dimensions, " + "LineString has not yet been initialized"); } return Double.isNaN(coordinates.get(0).z) ? 2 : 3; } @@ -93,10 +94,10 @@ public int numDimensions() { public JtsGeometry buildS4J() { Coordinate[] coordinates = this.coordinates.toArray(new Coordinate[this.coordinates.size()]); Geometry geometry; - if(wrapdateline) { + if (wrapdateline) { ArrayList strings = decomposeS4J(FACTORY, coordinates, new ArrayList()); - if(strings.size() == 1) { + if (strings.size() == 1) { geometry = strings.get(0); } else { LineString[] linestrings = strings.toArray(new LineString[strings.size()]); @@ -111,13 +112,12 @@ public JtsGeometry buildS4J() { @Override public org.elasticsearch.geometry.Geometry buildGeometry() { - return new Line(coordinates.stream().mapToDouble(i->i.x).toArray(), coordinates.stream().mapToDouble(i->i.y).toArray() - ); + return new Line(coordinates.stream().mapToDouble(i -> i.x).toArray(), coordinates.stream().mapToDouble(i -> i.y).toArray()); } static ArrayList decomposeS4J(GeometryFactory factory, Coordinate[] coordinates, ArrayList strings) { - for(Coordinate[] part : decompose(+DATELINE, coordinates)) { - for(Coordinate[] line : decompose(-DATELINE, part)) { + for (Coordinate[] part : decompose(+DATELINE, coordinates)) { + for (Coordinate[] line : decompose(-DATELINE, part)) { strings.add(factory.createLineString(line)); } } @@ -138,35 +138,35 @@ private static Coordinate[][] decompose(double dateline, Coordinate[] coordinate double shift = coordinates[0].x > DATELINE ? DATELINE : (coordinates[0].x < -DATELINE ? -DATELINE : 0); for (int i = 1; i < coordinates.length; i++) { - double t = intersection(coordinates[i-1], coordinates[i], dateline); - if(Double.isNaN(t) == false) { + double t = intersection(coordinates[i - 1], coordinates[i], dateline); + if (Double.isNaN(t) == false) { Coordinate[] part; - if(t<1) { - part = Arrays.copyOfRange(coordinates, offset, i+1); - part[part.length-1] = Edge.position(coordinates[i-1], coordinates[i], t); - coordinates[offset+i-1] = Edge.position(coordinates[i-1], coordinates[i], t); + if (t < 1) { + part = Arrays.copyOfRange(coordinates, offset, i + 1); + part[part.length - 1] = Edge.position(coordinates[i - 1], coordinates[i], t); + coordinates[offset + i - 1] = Edge.position(coordinates[i - 1], coordinates[i], t); shift(shift, part); - offset = i-1; + offset = i - 1; shift = coordinates[i].x > DATELINE ? DATELINE : (coordinates[i].x < -DATELINE ? -DATELINE : 0); } else { - part = shift(shift, Arrays.copyOfRange(coordinates, offset, i+1)); + part = shift(shift, Arrays.copyOfRange(coordinates, offset, i + 1)); offset = i; } parts.add(part); } } - if(offset == 0) { + if (offset == 0) { parts.add(shift(shift, coordinates)); - } else if(offset < coordinates.length-1) { + } else if (offset < coordinates.length - 1) { Coordinate[] part = Arrays.copyOfRange(coordinates, offset, coordinates.length); parts.add(shift(shift, part)); } return parts.toArray(new Coordinate[parts.size()][]); } - private static Coordinate[] shift(double shift, Coordinate...coordinates) { - if(shift != 0) { + private static Coordinate[] shift(double shift, Coordinate... coordinates) { + if (shift != 0) { for (int j = 0; j < coordinates.length; j++) { coordinates[j] = new Coordinate(coordinates[j].x - 2 * shift, coordinates[j].y); } diff --git a/server/src/main/java/org/elasticsearch/common/geo/builders/MultiLineStringBuilder.java b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/MultiLineStringBuilder.java similarity index 90% rename from server/src/main/java/org/elasticsearch/common/geo/builders/MultiLineStringBuilder.java rename to modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/MultiLineStringBuilder.java index a0afa636f1de7..bd3c2b2cc79ed 100644 --- a/server/src/main/java/org/elasticsearch/common/geo/builders/MultiLineStringBuilder.java +++ b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/MultiLineStringBuilder.java @@ -6,16 +6,16 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.geo.builders; +package org.elasticsearch.legacygeo.builders; -import org.elasticsearch.common.geo.GeoShapeType; -import org.elasticsearch.common.geo.parsers.GeoWKTParser; -import org.elasticsearch.common.geo.parsers.ShapeParser; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.geometry.Line; import org.elasticsearch.geometry.MultiLine; +import org.elasticsearch.legacygeo.GeoShapeType; +import org.elasticsearch.legacygeo.parsers.GeoWKTParser; +import org.elasticsearch.legacygeo.parsers.ShapeParser; import org.locationtech.jts.geom.Coordinate; import org.locationtech.jts.geom.Geometry; import org.locationtech.jts.geom.LineString; @@ -94,8 +94,7 @@ protected StringBuilder contentToWKT() { public int numDimensions() { if (lines == null || lines.isEmpty()) { - throw new IllegalStateException("unable to get number of dimensions, " + - "LineStrings have not yet been initialized"); + throw new IllegalStateException("unable to get number of dimensions, " + "LineStrings have not yet been initialized"); } return lines.get(0).numDimensions(); } @@ -106,7 +105,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws builder.field(ShapeParser.FIELD_TYPE.getPreferredName(), TYPE.shapeName()); builder.field(ShapeParser.FIELD_COORDINATES.getPreferredName()); builder.startArray(); - for(LineStringBuilder line : lines) { + for (LineStringBuilder line : lines) { line.coordinatesToXcontent(builder, false); } builder.endArray(); @@ -117,12 +116,12 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws @Override public JtsGeometry buildS4J() { final Geometry geometry; - if(wrapdateline) { + if (wrapdateline) { ArrayList parts = new ArrayList<>(); for (LineStringBuilder line : lines) { LineStringBuilder.decomposeS4J(FACTORY, line.coordinates(false), parts); } - if(parts.size() == 1) { + if (parts.size() == 1) { geometry = parts.get(0); } else { LineString[] lineStrings = parts.toArray(new LineString[parts.size()]); @@ -147,9 +146,9 @@ public org.elasticsearch.geometry.Geometry buildGeometry() { List linestrings = new ArrayList<>(lines.size()); for (int i = 0; i < lines.size(); ++i) { LineStringBuilder lsb = lines.get(i); - linestrings.add(new Line(lsb.coordinates.stream().mapToDouble(c->c.x).toArray(), - lsb.coordinates.stream().mapToDouble(c->c.y).toArray() - )); + linestrings.add( + new Line(lsb.coordinates.stream().mapToDouble(c -> c.x).toArray(), lsb.coordinates.stream().mapToDouble(c -> c.y).toArray()) + ); } return new MultiLine(linestrings); } diff --git a/server/src/main/java/org/elasticsearch/common/geo/builders/MultiPointBuilder.java b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/MultiPointBuilder.java similarity index 80% rename from server/src/main/java/org/elasticsearch/common/geo/builders/MultiPointBuilder.java rename to modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/MultiPointBuilder.java index 578bd62057042..9aaef6749eb75 100644 --- a/server/src/main/java/org/elasticsearch/common/geo/builders/MultiPointBuilder.java +++ b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/MultiPointBuilder.java @@ -6,14 +6,14 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.geo.builders; +package org.elasticsearch.legacygeo.builders; -import org.elasticsearch.common.geo.GeoShapeType; -import org.elasticsearch.common.geo.XShapeCollection; -import org.elasticsearch.common.geo.parsers.ShapeParser; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.geometry.MultiPoint; +import org.elasticsearch.legacygeo.GeoShapeType; +import org.elasticsearch.legacygeo.XShapeCollection; +import org.elasticsearch.legacygeo.parsers.ShapeParser; import org.locationtech.jts.geom.Coordinate; import org.locationtech.spatial4j.shape.Point; @@ -60,8 +60,8 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws @Override public XShapeCollection buildS4J() { - //Could wrap JtsGeometry but probably slower due to conversions to/from JTS in relate() - //MultiPoint geometry = FACTORY.createMultiPoint(points.toArray(new Coordinate[points.size()])); + // Could wrap JtsGeometry but probably slower due to conversions to/from JTS in relate() + // MultiPoint geometry = FACTORY.createMultiPoint(points.toArray(new Coordinate[points.size()])); List shapes = new ArrayList<>(coordinates.size()); for (Coordinate coord : coordinates) { shapes.add(SPATIAL_CONTEXT.makePoint(coord.x, coord.y)); @@ -76,8 +76,9 @@ public MultiPoint buildGeometry() { if (coordinates.isEmpty()) { return MultiPoint.EMPTY; } - return new MultiPoint(coordinates.stream().map(coord -> new org.elasticsearch.geometry.Point(coord.x, coord.y)) - .collect(Collectors.toList())); + return new MultiPoint( + coordinates.stream().map(coord -> new org.elasticsearch.geometry.Point(coord.x, coord.y)).collect(Collectors.toList()) + ); } @Override @@ -88,8 +89,7 @@ public GeoShapeType type() { @Override public int numDimensions() { if (coordinates == null || coordinates.isEmpty()) { - throw new IllegalStateException("unable to get number of dimensions, " + - "LineString has not yet been initialized"); + throw new IllegalStateException("unable to get number of dimensions, " + "LineString has not yet been initialized"); } return Double.isNaN(coordinates.get(0).z) ? 2 : 3; } diff --git a/server/src/main/java/org/elasticsearch/common/geo/builders/MultiPolygonBuilder.java b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/MultiPolygonBuilder.java similarity index 87% rename from server/src/main/java/org/elasticsearch/common/geo/builders/MultiPolygonBuilder.java rename to modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/MultiPolygonBuilder.java index a2cb0be779e78..5aa6d9d7dff34 100644 --- a/server/src/main/java/org/elasticsearch/common/geo/builders/MultiPolygonBuilder.java +++ b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/MultiPolygonBuilder.java @@ -6,18 +6,18 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.geo.builders; +package org.elasticsearch.legacygeo.builders; -import org.elasticsearch.common.geo.GeoShapeType; -import org.elasticsearch.common.geo.XShapeCollection; import org.elasticsearch.common.geo.Orientation; -import org.elasticsearch.common.geo.parsers.GeoWKTParser; -import org.elasticsearch.common.geo.parsers.ShapeParser; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.geometry.MultiPolygon; import org.elasticsearch.geometry.Polygon; +import org.elasticsearch.legacygeo.GeoShapeType; +import org.elasticsearch.legacygeo.XShapeCollection; +import org.elasticsearch.legacygeo.parsers.GeoWKTParser; +import org.elasticsearch.legacygeo.parsers.ShapeParser; import org.locationtech.jts.geom.Coordinate; import org.locationtech.spatial4j.shape.Shape; @@ -130,7 +130,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws builder.field(ShapeParser.FIELD_TYPE.getPreferredName(), TYPE.shapeName()); builder.field(ShapeParser.FIELD_ORIENTATION.getPreferredName(), orientation.name().toLowerCase(Locale.ROOT)); builder.startArray(ShapeParser.FIELD_COORDINATES.getPreferredName()); - for(PolygonBuilder polygon : polygons) { + for (PolygonBuilder polygon : polygons) { builder.startArray(); polygon.coordinatesArray(builder, params); builder.endArray(); @@ -147,8 +147,7 @@ public GeoShapeType type() { @Override public int numDimensions() { if (polygons == null || polygons.isEmpty()) { - throw new IllegalStateException("unable to get number of dimensions, " + - "Polygons have not yet been initialized"); + throw new IllegalStateException("unable to get number of dimensions, " + "Polygons have not yet been initialized"); } return polygons.get(0).numDimensions(); } @@ -158,9 +157,9 @@ public Shape buildS4J() { List shapes = new ArrayList<>(this.polygons.size()); - if(wrapdateline) { + if (wrapdateline) { for (PolygonBuilder polygon : this.polygons) { - for(Coordinate[][] part : polygon.coordinates()) { + for (Coordinate[][] part : polygon.coordinates()) { shapes.add(jtsGeometry(PolygonBuilder.polygonS4J(FACTORY, part))); } } @@ -169,14 +168,12 @@ public Shape buildS4J() { shapes.add(jtsGeometry(polygon.toPolygonS4J(FACTORY))); } } - if (shapes.size() == 1) - return shapes.get(0); - else - return new XShapeCollection<>(shapes, SPATIAL_CONTEXT); - //note: ShapeCollection is probably faster than a Multi* geom. + if (shapes.size() == 1) return shapes.get(0); + else return new XShapeCollection<>(shapes, SPATIAL_CONTEXT); + // note: ShapeCollection is probably faster than a Multi* geom. } - @SuppressWarnings({"unchecked"}) + @SuppressWarnings({ "unchecked" }) @Override public MultiPolygon buildGeometry() { List shapes = new ArrayList<>(this.polygons.size()); @@ -186,7 +183,7 @@ public MultiPolygon buildGeometry() { if (poly instanceof List) { shapes.addAll((List) poly); } else { - shapes.add((Polygon)poly); + shapes.add((Polygon) poly); } } if (shapes.isEmpty()) { @@ -209,7 +206,6 @@ public boolean equals(Object obj) { return false; } MultiPolygonBuilder other = (MultiPolygonBuilder) obj; - return Objects.equals(polygons, other.polygons) && - Objects.equals(orientation, other.orientation); + return Objects.equals(polygons, other.polygons) && Objects.equals(orientation, other.orientation); } } diff --git a/server/src/main/java/org/elasticsearch/common/geo/builders/PointBuilder.java b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/PointBuilder.java similarity index 83% rename from server/src/main/java/org/elasticsearch/common/geo/builders/PointBuilder.java rename to modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/PointBuilder.java index 1c9a3be8f12a1..eaa69d7ede8f0 100644 --- a/server/src/main/java/org/elasticsearch/common/geo/builders/PointBuilder.java +++ b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/PointBuilder.java @@ -6,12 +6,12 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.geo.builders; +package org.elasticsearch.legacygeo.builders; -import org.elasticsearch.common.geo.GeoShapeType; -import org.elasticsearch.common.geo.parsers.ShapeParser; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.legacygeo.GeoShapeType; +import org.elasticsearch.legacygeo.parsers.ShapeParser; import org.locationtech.jts.geom.Coordinate; import org.locationtech.spatial4j.shape.Point; @@ -29,7 +29,7 @@ public PointBuilder() { } public PointBuilder(double lon, double lat) { - //super(new ArrayList<>(1)); + // super(new ArrayList<>(1)); super(); this.coordinates.add(new Coordinate(lon, lat)); } @@ -64,11 +64,11 @@ public static PointBuilder newPoint(double longitude, double latitude) { @Override public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { - builder.startObject(); - builder.field(ShapeParser.FIELD_TYPE.getPreferredName(), TYPE.shapeName()); - builder.field(ShapeParser.FIELD_COORDINATES.getPreferredName()); - toXContent(builder, coordinates.get(0)); - return builder.endObject(); + builder.startObject(); + builder.field(ShapeParser.FIELD_TYPE.getPreferredName(), TYPE.shapeName()); + builder.field(ShapeParser.FIELD_COORDINATES.getPreferredName()); + toXContent(builder, coordinates.get(0)); + return builder.endObject(); } @Override diff --git a/server/src/main/java/org/elasticsearch/common/geo/builders/PolygonBuilder.java b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/PolygonBuilder.java similarity index 87% rename from server/src/main/java/org/elasticsearch/common/geo/builders/PolygonBuilder.java rename to modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/PolygonBuilder.java index fbc5500f46220..a8b171742aafd 100644 --- a/server/src/main/java/org/elasticsearch/common/geo/builders/PolygonBuilder.java +++ b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/PolygonBuilder.java @@ -6,16 +6,16 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.geo.builders; +package org.elasticsearch.legacygeo.builders; -import org.elasticsearch.core.Tuple; -import org.elasticsearch.common.geo.GeoShapeType; import org.elasticsearch.common.geo.Orientation; -import org.elasticsearch.common.geo.parsers.ShapeParser; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.util.set.Sets; import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.core.Tuple; +import org.elasticsearch.legacygeo.GeoShapeType; +import org.elasticsearch.legacygeo.parsers.ShapeParser; import org.locationtech.jts.geom.Coordinate; import org.locationtech.jts.geom.Geometry; import org.locationtech.jts.geom.GeometryFactory; @@ -157,12 +157,11 @@ private static void validateLinearRing(LineStringBuilder lineString) { */ List points = lineString.coordinates; if (points.size() < 4) { - throw new IllegalArgumentException( - "invalid number of points in LinearRing (found [" + points.size() + "] - must be >= 4)"); + throw new IllegalArgumentException("invalid number of points in LinearRing (found [" + points.size() + "] - must be >= 4)"); } if (points.get(0).equals(points.get(points.size() - 1)) == false) { - throw new IllegalArgumentException("invalid LinearRing found (coordinates are not closed)"); + throw new IllegalArgumentException("invalid LinearRing found (coordinates are not closed)"); } } @@ -203,7 +202,7 @@ public Coordinate[][][] coordinates() { final AtomicBoolean translated = new AtomicBoolean(false); int offset = createEdges(0, orientation, shell, null, edges, 0, translated); for (int i = 0; i < holes.length; i++) { - int length = createEdges(i+1, orientation, shell, holes[i], edges, offset, translated); + int length = createEdges(i + 1, orientation, shell, holes[i], edges, offset, translated); holeComponents[i] = edges[offset]; offset += length; } @@ -230,9 +229,10 @@ private static LineStringBuilder filterRing(LineStringBuilder linearRing) { // same point continue; } - if (linearRing.coordinates.get(i - 1).x == linearRing.coordinates.get(i + 1).x && - linearRing.coordinates.get(i - 1).y > linearRing.coordinates.get(i).y != - linearRing.coordinates.get(i + 1).y > linearRing.coordinates.get(i).y) { + if (linearRing.coordinates.get(i - 1).x == linearRing.coordinates.get(i + 1).x + && linearRing.coordinates.get(i - 1).y > linearRing.coordinates.get(i).y != linearRing.coordinates.get( + i + 1 + ).y > linearRing.coordinates.get(i).y) { // coplanar continue; } @@ -255,7 +255,7 @@ public org.elasticsearch.geometry.Geometry buildGeometry() { protected XContentBuilder coordinatesArray(XContentBuilder builder, Params params) throws IOException { shell.coordinatesToXcontent(builder, true); - for(LineStringBuilder hole : holes) { + for (LineStringBuilder hole : holes) { hole.coordinatesToXcontent(builder, true); } return builder; @@ -274,11 +274,9 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws } public Geometry buildS4JGeometry(GeometryFactory factory, boolean fixDateline) { - if(fixDateline) { + if (fixDateline) { Coordinate[][][] polygons = coordinates(); - return polygons.length == 1 - ? polygonS4J(factory, polygons[0]) - : multipolygonS4J(factory, polygons); + return polygons.length == 1 ? polygonS4J(factory, polygons[0]) : multipolygonS4J(factory, polygons); } else { return toPolygonS4J(factory); } @@ -307,7 +305,8 @@ public org.elasticsearch.geometry.Polygon toPolygonGeometry() { } protected static org.elasticsearch.geometry.LinearRing linearRing(List coordinates) { - return new org.elasticsearch.geometry.LinearRing(coordinates.stream().mapToDouble(i -> i.x).toArray(), + return new org.elasticsearch.geometry.LinearRing( + coordinates.stream().mapToDouble(i -> i.x).toArray(), coordinates.stream().mapToDouble(i -> i.y).toArray() ); } @@ -324,8 +323,7 @@ public GeoShapeType type() { @Override public int numDimensions() { if (shell == null) { - throw new IllegalStateException("unable to get number of dimensions, " + - "Polygon has not yet been initialized"); + throw new IllegalStateException("unable to get number of dimensions, " + "Polygon has not yet been initialized"); } return shell.numDimensions(); } @@ -334,10 +332,10 @@ protected static Polygon polygonS4J(GeometryFactory factory, Coordinate[][] poly LinearRing shell = factory.createLinearRing(polygon[0]); LinearRing[] holes; - if(polygon.length > 1) { - holes = new LinearRing[polygon.length-1]; + if (polygon.length > 1) { + holes = new LinearRing[polygon.length - 1]; for (int i = 0; i < holes.length; i++) { - holes[i] = factory.createLinearRing(polygon[i+1]); + holes[i] = factory.createLinearRing(polygon[i + 1]); } } else { holes = null; @@ -375,8 +373,8 @@ protected static MultiPolygon multipolygonS4J(GeometryFactory factory, Coordinat private static int component(final Edge edge, final int id, final ArrayList edges, double[] partitionPoint) { // find a coordinate that is not part of the dateline Edge any = edge; - while(any.coordinate.x == +DATELINE || any.coordinate.x == -DATELINE) { - if((any = any.next) == edge) { + while (any.coordinate.x == +DATELINE || any.coordinate.x == -DATELINE) { + if ((any = any.next) == edge) { break; } } @@ -437,9 +435,9 @@ private static int component(final Edge edge, final int id, final ArrayList> compon result[i] = component.toArray(new Coordinate[component.size()][]); } - if(debugEnabled()) { + if (debugEnabled()) { for (int i = 0; i < result.length; i++) { LOGGER.debug("Component [{}]:", i); for (int j = 0; j < result[i].length; j++) { @@ -491,9 +489,9 @@ private static Coordinate[][] holes(Edge[] holes, int numHoles) { final Coordinate[][] points = new Coordinate[numHoles][]; for (int i = 0; i < numHoles; i++) { - double[] partitionPoint = new double[3]; - int length = component(holes[i], -(i+1), null, partitionPoint); // mark as visited by inverting the sign - points[i] = coordinates(holes[i], new Coordinate[length+1], partitionPoint); + double[] partitionPoint = new double[3]; + int length = component(holes[i], -(i + 1), null, partitionPoint); // mark as visited by inverting the sign + points[i] = coordinates(holes[i], new Coordinate[length + 1], partitionPoint); } return points; @@ -504,10 +502,10 @@ private static Edge[] edges(Edge[] edges, int numHoles, List> for (int i = 0; i < edges.length; i++) { if (edges[i].component >= 0) { - double[] partitionPoint = new double[3]; - int length = component(edges[i], -(components.size()+numHoles+1), mainEdges, partitionPoint); + double[] partitionPoint = new double[3]; + int length = component(edges[i], -(components.size() + numHoles + 1), mainEdges, partitionPoint); List component = new ArrayList<>(); - component.add(coordinates(edges[i], new Coordinate[length+1], partitionPoint)); + component.add(coordinates(edges[i], new Coordinate[length + 1], partitionPoint)); components.add(component); } } @@ -583,7 +581,7 @@ private static void assign(Edge[] holes, Coordinate[][] points, int numHoles, Ed final int component = -edges[index].component - numHoles - 1; - if(debugEnabled()) { + if (debugEnabled()) { LOGGER.debug("\tposition ({}) of edge {}: {}", index, current, edges[index]); LOGGER.debug("\tComponent: {}", component); LOGGER.debug("\tHole intersections ({}): {}", current.coordinate.x, Arrays.toString(edges)); @@ -608,14 +606,14 @@ private static int merge(Edge[] intersections, int offset, int length, Edge[] ho // the second edge only (the first edge is either polygon or // already handled) if (e2.component > 0) { - //TODO: Check if we could save the set null step + // TODO: Check if we could save the set null step numHoles--; - holes[e2.component-1] = holes[numHoles]; + holes[e2.component - 1] = holes[numHoles]; holes[numHoles] = null; } // only connect edges if intersections are pairwise // 1. per the comment above, the edge array is sorted by y-value of the intersection - // with the dateline. Two edges have the same y intercept when they cross the + // with the dateline. Two edges have the same y intercept when they cross the // dateline thus they appear sequentially (pairwise) in the edge array. Two edges // do not have the same y intercept when we're forming a multi-poly from a poly // that wraps the dateline (but there are 2 ordered intercepts). @@ -623,12 +621,14 @@ private static int merge(Edge[] intersections, int offset, int length, Edge[] ho // For boundary conditions (e.g., intersect but not crossing) there is no sibling edge // to connect. Thus the first logic check enforces the pairwise rule // 2. the second logic check ensures the two candidate edges aren't already connected by an - // existing edge along the dateline - this is necessary due to a logic change in - // ShapeBuilder.intersection that computes dateline edges as valid intersect points - // in support of OGC standards - if (e1.intersect != Edge.MAX_COORDINATE && e2.intersect != Edge.MAX_COORDINATE - && (e1.next.next.coordinate.equals3D(e2.coordinate) && Math.abs(e1.next.coordinate.x) == DATELINE - && Math.abs(e2.coordinate.x) == DATELINE) == false ) { + // existing edge along the dateline - this is necessary due to a logic change in + // ShapeBuilder.intersection that computes dateline edges as valid intersect points + // in support of OGC standards + if (e1.intersect != Edge.MAX_COORDINATE + && e2.intersect != Edge.MAX_COORDINATE + && (e1.next.next.coordinate.equals3D(e2.coordinate) + && Math.abs(e1.next.coordinate.x) == DATELINE + && Math.abs(e2.coordinate.x) == DATELINE) == false) { connect(e1, e2); } } @@ -641,12 +641,12 @@ private static void connect(Edge in, Edge out) { // Connecting two Edges by inserting the point at // dateline intersection and connect these by adding // two edges between this points. One per direction - if(in.intersect != in.next.coordinate) { + if (in.intersect != in.next.coordinate) { // NOTE: the order of the object creation is crucial here! Don't change it! // first edge has no point on dateline Edge e1 = new Edge(in.intersect, in.next); - if(out.intersect != out.next.coordinate) { + if (out.intersect != out.next.coordinate) { // second edge has no point on dateline Edge e2 = new Edge(out.intersect, out.next); in.next = new Edge(in.intersect, e2, in.intersect); @@ -659,7 +659,7 @@ private static void connect(Edge in, Edge out) { // first edge intersects with dateline Edge e2 = new Edge(out.intersect, in.next, out.intersect); - if(out.intersect != out.next.coordinate) { + if (out.intersect != out.next.coordinate) { // second edge has no point on dateline Edge e1 = new Edge(out.intersect, out.next); in.next = new Edge(in.intersect, e1, in.intersect); @@ -672,15 +672,22 @@ private static void connect(Edge in, Edge out) { } } - private static int createEdges(int component, Orientation orientation, LineStringBuilder shell, - LineStringBuilder hole, Edge[] edges, int offset, final AtomicBoolean translated) { + private static int createEdges( + int component, + Orientation orientation, + LineStringBuilder shell, + LineStringBuilder hole, + Edge[] edges, + int offset, + final AtomicBoolean translated + ) { // inner rings (holes) have an opposite direction than the outer rings // XOR will invert the orientation for outer ring cases (Truth Table:, T/T = F, T/F = T, F/T = T, F/F = F) boolean direction = (component == 0 ^ orientation == Orientation.RIGHT); // set the points array accordingly (shell or hole) Coordinate[] points = (hole != null) ? hole.coordinates(false) : shell.coordinates(false); - ring(component, direction, orientation == Orientation.LEFT, points, 0, edges, offset, points.length-1, translated); - return points.length-1; + ring(component, direction, orientation == Orientation.LEFT, points, 0, edges, offset, points.length - 1, translated); + return points.length - 1; } /** @@ -694,8 +701,17 @@ private static int createEdges(int component, Orientation orientation, LineStrin * number of points * @return Array of edges */ - private static Edge[] ring(int component, boolean direction, boolean handedness, - Coordinate[] points, int offset, Edge[] edges, int toffset, int length, final AtomicBoolean translated) { + private static Edge[] ring( + int component, + boolean direction, + boolean handedness, + Coordinate[] points, + int offset, + Edge[] edges, + int toffset, + int length, + final AtomicBoolean translated + ) { double signedArea = 0; double minX = Double.POSITIVE_INFINITY; double maxX = Double.NEGATIVE_INFINITY; @@ -718,11 +734,11 @@ private static Edge[] ring(int component, boolean direction, boolean handedness, // calculate range final double rng = maxX - minX; // translate the points if the following is true - // 1. shell orientation is cw and range is greater than a hemisphere (180 degrees) but not spanning 2 hemispheres - // (translation would result in a collapsed poly) - // 2. the shell of the candidate hole has been translated (to preserve the coordinate system) + // 1. shell orientation is cw and range is greater than a hemisphere (180 degrees) but not spanning 2 hemispheres + // (translation would result in a collapsed poly) + // 2. the shell of the candidate hole has been translated (to preserve the coordinate system) boolean incorrectOrientation = component == 0 && handedness != orientation; - if ( (incorrectOrientation && (rng > DATELINE && rng != 2*DATELINE)) || (translated.get() && component != 0)) { + if ((incorrectOrientation && (rng > DATELINE && rng != 2 * DATELINE)) || (translated.get() && component != 0)) { translate(points); // flip the translation bit if the shell is being translated if (component == 0) { @@ -755,10 +771,17 @@ private static Edge[] ring(int component, boolean direction, boolean handedness, * number of points to use * @return the edges creates */ - private static Edge[] concat(int component, boolean direction, Coordinate[] points, final int pointOffset, Edge[] edges, - final int edgeOffset, int length) { - assert edges.length >= length+edgeOffset; - assert points.length >= length+pointOffset; + private static Edge[] concat( + int component, + boolean direction, + Coordinate[] points, + final int pointOffset, + Edge[] edges, + final int edgeOffset, + int length + ) { + assert edges.length >= length + edgeOffset; + assert points.length >= length + pointOffset; edges[edgeOffset] = new Edge(points[pointOffset], null); for (int i = 1; i < length; i++) { if (direction) { @@ -789,7 +812,7 @@ private static Edge[] concat(int component, boolean direction, Coordinate[] poin private static void translate(Coordinate[] points) { for (Coordinate c : points) { if (c.x < 0) { - c.x += 2*DATELINE; + c.x += 2 * DATELINE; } } } @@ -821,8 +844,6 @@ public boolean equals(Object obj) { return false; } PolygonBuilder other = (PolygonBuilder) obj; - return Objects.equals(shell, other.shell) && - Objects.equals(holes, other.holes) && - Objects.equals(orientation, other.orientation); + return Objects.equals(shell, other.shell) && Objects.equals(holes, other.holes) && Objects.equals(orientation, other.orientation); } } diff --git a/server/src/main/java/org/elasticsearch/common/geo/builders/ShapeBuilder.java b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/ShapeBuilder.java similarity index 94% rename from server/src/main/java/org/elasticsearch/common/geo/builders/ShapeBuilder.java rename to modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/ShapeBuilder.java index ad595ea9ec032..82f54a8f9f806 100644 --- a/server/src/main/java/org/elasticsearch/common/geo/builders/ShapeBuilder.java +++ b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/ShapeBuilder.java @@ -6,19 +6,19 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.geo.builders; +package org.elasticsearch.legacygeo.builders; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.elasticsearch.Assertions; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.geo.GeoShapeType; -import org.elasticsearch.common.geo.parsers.GeoWKTParser; import org.elasticsearch.common.io.stream.NamedWriteable; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.xcontent.ToXContentObject; import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.legacygeo.GeoShapeType; +import org.elasticsearch.legacygeo.parsers.GeoWKTParser; import org.locationtech.jts.geom.Coordinate; import org.locationtech.jts.geom.Geometry; import org.locationtech.jts.geom.GeometryFactory; @@ -38,8 +38,10 @@ /** * Basic class for building GeoJSON shapes like Polygons, Linestrings, etc */ -public abstract class ShapeBuilder> implements NamedWriteable, ToXContentObject { +public abstract class ShapeBuilder> + implements + NamedWriteable, + ToXContentObject { protected static final Logger LOGGER = LogManager.getLogger(ShapeBuilder.class); @@ -72,7 +74,7 @@ public abstract class ShapeBuilder coordinates) { protected ShapeBuilder(StreamInput in) throws IOException { int size = in.readVInt(); coordinates = new ArrayList<>(size); - for (int i=0; i < size; i++) { + for (int i = 0; i < size; i++) { coordinates.add(readFromStream(in)); } } @@ -119,7 +121,7 @@ protected static void writeCoordinateTo(Coordinate coordinate, StreamOutput out) @SuppressWarnings("unchecked") private E thisRef() { - return (E)this; + return (E) this; } /** @@ -148,7 +150,7 @@ public E coordinate(Coordinate coordinate) { * @param coordinates array of {@link Coordinate}s to add * @return this */ - public E coordinates(Coordinate...coordinates) { + public E coordinates(Coordinate... coordinates) { return this.coordinates(Arrays.asList(coordinates)); } @@ -170,20 +172,18 @@ public E coordinates(Collection coordinates) { * @return Array of coordinates */ protected Coordinate[] coordinates(boolean closed) { - Coordinate[] result = coordinates.toArray(new Coordinate[coordinates.size() + (closed?1:0)]); - if(closed) { - result[result.length-1] = result[0]; + Coordinate[] result = coordinates.toArray(new Coordinate[coordinates.size() + (closed ? 1 : 0)]); + if (closed) { + result[result.length - 1] = result[0]; } return result; } protected JtsGeometry jtsGeometry(Geometry geom) { - //dateline180Check is false because ElasticSearch does it's own dateline wrapping + // dateline180Check is false because ElasticSearch does it's own dateline wrapping JtsGeometry jtsGeometry = new JtsGeometry(geom, SPATIAL_CONTEXT, false, MULTI_POLYGON_MAY_OVERLAP); - if (AUTO_VALIDATE_JTS_GEOMETRY) - jtsGeometry.validate(); - if (AUTO_INDEX_JTS_GEOMETRY) - jtsGeometry.index(); + if (AUTO_VALIDATE_JTS_GEOMETRY) jtsGeometry.validate(); + if (AUTO_INDEX_JTS_GEOMETRY) jtsGeometry.index(); return jtsGeometry; } @@ -450,13 +450,13 @@ protected static XContentBuilder toXContent(XContentBuilder builder, Coordinate */ protected XContentBuilder coordinatesToXcontent(XContentBuilder builder, boolean closed) throws IOException { builder.startArray(); - for(Coordinate coord : coordinates) { + for (Coordinate coord : coordinates) { toXContent(builder, coord); } - if(closed) { + if (closed) { Coordinate start = coordinates.get(0); - Coordinate end = coordinates.get(coordinates.size()-1); - if(start.x != end.x || start.y != end.y) { + Coordinate end = coordinates.get(coordinates.size() - 1); + if (start.x != end.x || start.y != end.y) { toXContent(builder, coordinates.get(0)); } } @@ -469,7 +469,7 @@ public boolean equals(Object o) { if (this == o) return true; if ((o instanceof ShapeBuilder) == false) return false; - ShapeBuilder that = (ShapeBuilder) o; + ShapeBuilder that = (ShapeBuilder) o; return Objects.equals(coordinates, that.coordinates); } diff --git a/server/src/main/java/org/elasticsearch/index/mapper/LegacyGeoShapeFieldMapper.java b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/mapper/LegacyGeoShapeFieldMapper.java similarity index 75% rename from server/src/main/java/org/elasticsearch/index/mapper/LegacyGeoShapeFieldMapper.java rename to modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/mapper/LegacyGeoShapeFieldMapper.java index 7c376953b95d0..1d96bb5ce73a7 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/LegacyGeoShapeFieldMapper.java +++ b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/mapper/LegacyGeoShapeFieldMapper.java @@ -5,7 +5,7 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -package org.elasticsearch.index.mapper; +package org.elasticsearch.legacygeo.mapper; import org.apache.lucene.search.Query; import org.apache.lucene.spatial.prefix.PrefixTreeStrategy; @@ -22,19 +22,27 @@ import org.elasticsearch.common.geo.GeometryFormatterFactory; import org.elasticsearch.common.geo.Orientation; import org.elasticsearch.common.geo.ShapeRelation; -import org.elasticsearch.common.geo.ShapesAvailability; import org.elasticsearch.common.geo.SpatialStrategy; -import org.elasticsearch.common.geo.XShapeCollection; -import org.elasticsearch.common.geo.builders.ShapeBuilder; -import org.elasticsearch.common.geo.parsers.ShapeParser; import org.elasticsearch.common.lucene.Lucene; import org.elasticsearch.common.unit.DistanceUnit; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.core.CheckedConsumer; import org.elasticsearch.geometry.Geometry; -import org.elasticsearch.index.query.LegacyGeoShapeQueryProcessor; +import org.elasticsearch.index.mapper.AbstractShapeGeometryFieldMapper; +import org.elasticsearch.index.mapper.DocumentParserContext; +import org.elasticsearch.index.mapper.FieldMapper; +import org.elasticsearch.index.mapper.GeoShapeQueryable; +import org.elasticsearch.index.mapper.MappedFieldType; +import org.elasticsearch.index.mapper.Mapper; +import org.elasticsearch.index.mapper.MapperBuilderContext; +import org.elasticsearch.index.mapper.MapperParsingException; import org.elasticsearch.index.query.SearchExecutionContext; +import org.elasticsearch.legacygeo.ShapesAvailability; +import org.elasticsearch.legacygeo.XShapeCollection; +import org.elasticsearch.legacygeo.builders.ShapeBuilder; +import org.elasticsearch.legacygeo.parsers.ShapeParser; +import org.elasticsearch.legacygeo.query.LegacyGeoShapeQueryProcessor; import org.locationtech.spatial4j.shape.Point; import org.locationtech.spatial4j.shape.Shape; import org.locationtech.spatial4j.shape.jts.JtsGeometry; @@ -70,15 +78,21 @@ *

    * "field" : "POLYGON ((100.0 0.0, 101.0 0.0, 101.0 1.0, 100.0 1.0, 100.0 0.0)) * - * @deprecated use {@link GeoShapeFieldMapper} + * @deprecated use {@link org.elasticsearch.index.mapper.GeoShapeFieldMapper} */ @Deprecated public class LegacyGeoShapeFieldMapper extends AbstractShapeGeometryFieldMapper> { public static final String CONTENT_TYPE = "geo_shape"; - public static final Set DEPRECATED_PARAMETERS - = Set.of("strategy", "tree", "tree_levels", "precision", "distance_error_pct", "points_only"); + public static final Set DEPRECATED_PARAMETERS = Set.of( + "strategy", + "tree", + "tree_levels", + "precision", + "distance_error_pct", + "points_only" + ); public static boolean containsDeprecatedParameter(Set paramKeys) { return DEPRECATED_PARAMETERS.stream().anyMatch(paramKeys::contains); @@ -121,15 +135,14 @@ public static class DeprecatedParameters { private static void checkPrefixTreeSupport(String fieldName) { if (ShapesAvailability.JTS_AVAILABLE == false || ShapesAvailability.SPATIAL4J_AVAILABLE == false) { - throw new ElasticsearchParseException("Field parameter [{}] is not supported for [{}] field type", - fieldName, CONTENT_TYPE); + throw new ElasticsearchParseException("Field parameter [{}] is not supported for [{}] field type", fieldName, CONTENT_TYPE); } } } private static Builder builder(FieldMapper in) { - return ((LegacyGeoShapeFieldMapper)in).builder; + return ((LegacyGeoShapeFieldMapper) in).builder; } public static class Builder extends FieldMapper.Builder { @@ -141,28 +154,42 @@ public static class Builder extends FieldMapper.Builder { final Parameter> coerce; Parameter> orientation = orientationParam(m -> builder(m).orientation.get()); - Parameter strategy = new Parameter<>("strategy", false, () -> SpatialStrategy.RECURSIVE, - (n, c, o) -> SpatialStrategy.fromString(o.toString()), m -> builder(m).strategy.get()) - .deprecated(); - Parameter tree = Parameter.stringParam("tree", false, m -> builder(m).tree.get(), Defaults.TREE) - .deprecated(); - Parameter treeLevels = new Parameter<>("tree_levels", false, () -> null, + Parameter strategy = new Parameter<>( + "strategy", + false, + () -> SpatialStrategy.RECURSIVE, + (n, c, o) -> SpatialStrategy.fromString(o.toString()), + m -> builder(m).strategy.get() + ).deprecated(); + Parameter tree = Parameter.stringParam("tree", false, m -> builder(m).tree.get(), Defaults.TREE).deprecated(); + Parameter treeLevels = new Parameter<>( + "tree_levels", + false, + () -> null, (n, c, o) -> o == null ? null : XContentMapValues.nodeIntegerValue(o), - m -> builder(m).treeLevels.get()) - .deprecated(); - Parameter precision = new Parameter<>("precision", false, () -> null, + m -> builder(m).treeLevels.get() + ).deprecated(); + Parameter precision = new Parameter<>( + "precision", + false, + () -> null, (n, c, o) -> o == null ? null : DistanceUnit.Distance.parseDistance(o.toString()), - m -> builder(m).precision.get()) - .deprecated(); - Parameter distanceErrorPct = new Parameter<>("distance_error_pct", true, () -> null, + m -> builder(m).precision.get() + ).deprecated(); + Parameter distanceErrorPct = new Parameter<>( + "distance_error_pct", + true, + () -> null, (n, c, o) -> o == null ? null : XContentMapValues.nodeDoubleValue(o), - m -> builder(m).distanceErrorPct.get()) - .deprecated() - .acceptsNull(); - Parameter pointsOnly = new Parameter<>("points_only", false, + m -> builder(m).distanceErrorPct.get() + ).deprecated().acceptsNull(); + Parameter pointsOnly = new Parameter<>( + "points_only", + false, () -> null, - (n, c, o) -> XContentMapValues.nodeBooleanValue(o), m -> builder(m).pointsOnly.get()) - .deprecated().acceptsNull(); + (n, c, o) -> XContentMapValues.nodeBooleanValue(o), + m -> builder(m).pointsOnly.get() + ).deprecated().acceptsNull(); Parameter> meta = Parameter.metaParam(); @@ -222,8 +249,20 @@ public Builder(String name, Version version, boolean ignoreMalformedByDefault, b @Override protected List> getParameters() { - return Arrays.asList(indexed, ignoreMalformed, ignoreZValue, coerce, orientation, - strategy, tree, treeLevels, precision, distanceErrorPct, pointsOnly, meta); + return Arrays.asList( + indexed, + ignoreMalformed, + ignoreZValue, + coerce, + orientation, + strategy, + tree, + treeLevels, + precision, + distanceErrorPct, + pointsOnly, + meta + ); } public Builder coerce(boolean coerce) { @@ -254,14 +293,20 @@ private void setupFieldTypeDeprecatedParameters(GeoShapeFieldType ft) { private void setupPrefixTrees(GeoShapeFieldType ft) { SpatialPrefixTree prefixTree; if (ft.tree().equals(PrefixTrees.GEOHASH)) { - prefixTree = new GeohashPrefixTree(ShapeBuilder.SPATIAL_CONTEXT, - getLevels(ft.treeLevels(), ft.precisionInMeters(), Defaults.GEOHASH_TREE_LEVELS, true)); + prefixTree = new GeohashPrefixTree( + ShapeBuilder.SPATIAL_CONTEXT, + getLevels(ft.treeLevels(), ft.precisionInMeters(), Defaults.GEOHASH_TREE_LEVELS, true) + ); } else if (ft.tree().equals(PrefixTrees.LEGACY_QUADTREE)) { - prefixTree = new QuadPrefixTree(ShapeBuilder.SPATIAL_CONTEXT, - getLevels(ft.treeLevels(), ft.precisionInMeters(), Defaults.QUADTREE_LEVELS, false)); + prefixTree = new QuadPrefixTree( + ShapeBuilder.SPATIAL_CONTEXT, + getLevels(ft.treeLevels(), ft.precisionInMeters(), Defaults.QUADTREE_LEVELS, false) + ); } else if (ft.tree().equals(PrefixTrees.QUADTREE)) { - prefixTree = new PackedQuadPrefixTree(ShapeBuilder.SPATIAL_CONTEXT, - getLevels(ft.treeLevels(), ft.precisionInMeters(), Defaults.QUADTREE_LEVELS, false)); + prefixTree = new PackedQuadPrefixTree( + ShapeBuilder.SPATIAL_CONTEXT, + getLevels(ft.treeLevels(), ft.precisionInMeters(), Defaults.QUADTREE_LEVELS, false) + ); } else { throw new IllegalArgumentException("Unknown prefix tree type [" + ft.tree() + "]"); } @@ -284,8 +329,13 @@ private void setupPrefixTrees(GeoShapeFieldType ft) { } private GeoShapeFieldType buildFieldType(LegacyGeoShapeParser parser, MapperBuilderContext context) { - GeoShapeFieldType ft = - new GeoShapeFieldType(context.buildFullName(name), indexed.get(), orientation.get().value(), parser, meta.get()); + GeoShapeFieldType ft = new GeoShapeFieldType( + context.buildFullName(name), + indexed.get(), + orientation.get().value(), + parser, + meta.get() + ); setupFieldTypeDeprecatedParameters(ft); setupPrefixTrees(ft); return ft; @@ -293,8 +343,14 @@ private GeoShapeFieldType buildFieldType(LegacyGeoShapeParser parser, MapperBuil private static int getLevels(int treeLevels, double precisionInMeters, int defaultLevels, boolean geoHash) { if (treeLevels > 0 || precisionInMeters >= 0) { - return Math.max(treeLevels, precisionInMeters >= 0 ? (geoHash ? GeoUtils.geoHashLevelsForPrecision(precisionInMeters) - : GeoUtils.quadTreeLevelsForPrecision(precisionInMeters)) : 0); + return Math.max( + treeLevels, + precisionInMeters >= 0 + ? (geoHash + ? GeoUtils.geoHashLevelsForPrecision(precisionInMeters) + : GeoUtils.quadTreeLevelsForPrecision(precisionInMeters)) + : 0 + ); } return defaultLevels; } @@ -307,9 +363,7 @@ public LegacyGeoShapeFieldMapper build(MapperBuilderContext context) { } LegacyGeoShapeParser parser = new LegacyGeoShapeParser(); GeoShapeFieldType ft = buildFieldType(parser, context); - return new LegacyGeoShapeFieldMapper(name, ft, - multiFieldsBuilder.build(this, context), copyTo.build(), - parser, this); + return new LegacyGeoShapeFieldMapper(name, ft, multiFieldsBuilder.build(this, context), copyTo.build(), parser, this); } } @@ -318,18 +372,18 @@ public LegacyGeoShapeFieldMapper build(MapperBuilderContext context) { boolean ignoreMalformedByDefault = IGNORE_MALFORMED_SETTING.get(parserContext.getSettings()); boolean coerceByDefault = COERCE_SETTING.get(parserContext.getSettings()); FieldMapper.Builder builder = new LegacyGeoShapeFieldMapper.Builder( - name, - parserContext.indexVersionCreated(), - ignoreMalformedByDefault, - coerceByDefault); + name, + parserContext.indexVersionCreated(), + ignoreMalformedByDefault, + coerceByDefault + ); builder.parse(name, parserContext, node); return builder; }; private static class LegacyGeoShapeParser extends Parser> { - private LegacyGeoShapeParser() { - } + private LegacyGeoShapeParser() {} @Override public void parse( @@ -368,8 +422,13 @@ public static final class GeoShapeFieldType extends AbstractShapeGeometryFieldTy private final LegacyGeoShapeQueryProcessor queryProcessor; - private GeoShapeFieldType(String name, boolean indexed, Orientation orientation, - LegacyGeoShapeParser parser, Map meta) { + private GeoShapeFieldType( + String name, + boolean indexed, + Orientation orientation, + LegacyGeoShapeParser parser, + Map meta + ) { super(name, indexed, false, false, parser, orientation, meta); this.queryProcessor = new LegacyGeoShapeQueryProcessor(this); } @@ -384,8 +443,13 @@ public Query geoShapeQuery(Geometry shape, String fieldName, ShapeRelation relat } @Override - public Query geoShapeQuery(Geometry shape, String fieldName, SpatialStrategy strategy, ShapeRelation relation, - SearchExecutionContext context) { + public Query geoShapeQuery( + Geometry shape, + String fieldName, + SpatialStrategy strategy, + ShapeRelation relation, + SearchExecutionContext context + ) { return queryProcessor.geoShapeQuery(shape, fieldName, strategy, relation, context); } @@ -420,6 +484,7 @@ public boolean pointsOnly() { public void setPointsOnly(boolean pointsOnly) { this.pointsOnly = pointsOnly; } + public int treeLevels() { return treeLevels; } @@ -475,13 +540,26 @@ public PrefixTreeStrategy resolvePrefixTreeStrategy(String strategyName) { private final Version indexCreatedVersion; private final Builder builder; - public LegacyGeoShapeFieldMapper(String simpleName, MappedFieldType mappedFieldType, - MultiFields multiFields, CopyTo copyTo, - LegacyGeoShapeParser parser, - Builder builder) { - super(simpleName, mappedFieldType, Collections.singletonMap(mappedFieldType.name(), Lucene.KEYWORD_ANALYZER), - builder.ignoreMalformed.get(), builder.coerce.get(), builder.ignoreZValue.get(), builder.orientation.get(), - multiFields, copyTo, parser); + public LegacyGeoShapeFieldMapper( + String simpleName, + MappedFieldType mappedFieldType, + MultiFields multiFields, + CopyTo copyTo, + LegacyGeoShapeParser parser, + Builder builder + ) { + super( + simpleName, + mappedFieldType, + Collections.singletonMap(mappedFieldType.name(), Lucene.KEYWORD_ANALYZER), + builder.ignoreMalformed.get(), + builder.coerce.get(), + builder.ignoreZValue.get(), + builder.orientation.get(), + multiFields, + copyTo, + parser + ); this.indexCreatedVersion = builder.indexCreatedVersion; this.builder = builder; } @@ -491,7 +569,7 @@ public GeoShapeFieldType fieldType() { return (GeoShapeFieldType) super.fieldType(); } - String strategy() { + public String strategy() { return fieldType().strategy().getStrategyName(); } @@ -505,15 +583,20 @@ protected void index(DocumentParserContext context, ShapeBuilder shapeB // index configured for pointsOnly if (shape instanceof XShapeCollection && ((XShapeCollection) shape).pointsOnly()) { // MULTIPOINT data: index each point separately - @SuppressWarnings("unchecked") List shapes = ((XShapeCollection) shape).getShapes(); + @SuppressWarnings("unchecked") + List shapes = ((XShapeCollection) shape).getShapes(); for (Shape s : shapes) { context.doc().addAll(Arrays.asList(fieldType().defaultPrefixTreeStrategy().createIndexableFields(s))); } return; } else if (shape instanceof Point == false) { - throw new MapperParsingException("[{" + fieldType().name() + "}] is configured for points only but a " - + ((shape instanceof JtsGeometry) ? ((JtsGeometry)shape).getGeom().getGeometryType() : shape.getClass()) - + " was found"); + throw new MapperParsingException( + "[{" + + fieldType().name() + + "}] is configured for points only but a " + + ((shape instanceof JtsGeometry) ? ((JtsGeometry) shape).getGeom().getGeometryType() : shape.getClass()) + + " was found" + ); } } context.doc().addAll(Arrays.asList(fieldType().defaultPrefixTreeStrategy().createIndexableFields(shape))); @@ -527,16 +610,20 @@ protected String contentType() { @Override public FieldMapper.Builder getMergeBuilder() { - return new Builder(simpleName(), indexCreatedVersion, - builder.ignoreMalformed.getDefaultValue().value(), builder.coerce.getDefaultValue().value()).init(this); + return new Builder( + simpleName(), + indexCreatedVersion, + builder.ignoreMalformed.getDefaultValue().value(), + builder.coerce.getDefaultValue().value() + ).init(this); } @Override protected void checkIncomingMergeType(FieldMapper mergeWith) { - if (mergeWith instanceof AbstractShapeGeometryFieldMapper - && (mergeWith instanceof LegacyGeoShapeFieldMapper) == false) { - throw new IllegalArgumentException("mapper [" + name() - + "] of type [geo_shape] cannot change strategy from [recursive] to [BKD]"); + if (mergeWith instanceof LegacyGeoShapeFieldMapper == false && CONTENT_TYPE.equals(mergeWith.typeName())) { + throw new IllegalArgumentException( + "mapper [" + name() + "] of type [geo_shape] cannot change strategy from [recursive] to [BKD]" + ); } super.checkIncomingMergeType(mergeWith); } diff --git a/server/src/main/java/org/elasticsearch/common/geo/parsers/CoordinateNode.java b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/parsers/CoordinateNode.java similarity index 98% rename from server/src/main/java/org/elasticsearch/common/geo/parsers/CoordinateNode.java rename to modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/parsers/CoordinateNode.java index 58ee7b9b4fc02..efc08c7a75182 100644 --- a/server/src/main/java/org/elasticsearch/common/geo/parsers/CoordinateNode.java +++ b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/parsers/CoordinateNode.java @@ -5,12 +5,12 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -package org.elasticsearch.common.geo.parsers; +package org.elasticsearch.legacygeo.parsers; -import org.locationtech.jts.geom.Coordinate; import org.elasticsearch.ElasticsearchException; import org.elasticsearch.common.xcontent.ToXContentObject; import org.elasticsearch.common.xcontent.XContentBuilder; +import org.locationtech.jts.geom.Coordinate; import java.io.IOException; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/common/geo/parsers/GeoJsonParser.java b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/parsers/GeoJsonParser.java similarity index 88% rename from server/src/main/java/org/elasticsearch/common/geo/parsers/GeoJsonParser.java rename to modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/parsers/GeoJsonParser.java index 3608609212e16..9afc9f2ed77c1 100644 --- a/server/src/main/java/org/elasticsearch/common/geo/parsers/GeoJsonParser.java +++ b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/parsers/GeoJsonParser.java @@ -5,19 +5,19 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -package org.elasticsearch.common.geo.parsers; +package org.elasticsearch.legacygeo.parsers; import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.geo.GeoPoint; -import org.elasticsearch.common.geo.GeoShapeType; import org.elasticsearch.common.geo.Orientation; -import org.elasticsearch.common.geo.builders.CircleBuilder; -import org.elasticsearch.common.geo.builders.GeometryCollectionBuilder; -import org.elasticsearch.common.geo.builders.ShapeBuilder; import org.elasticsearch.common.unit.DistanceUnit; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentSubParser; import org.elasticsearch.index.mapper.AbstractShapeGeometryFieldMapper; +import org.elasticsearch.legacygeo.GeoShapeType; +import org.elasticsearch.legacygeo.builders.CircleBuilder; +import org.elasticsearch.legacygeo.builders.GeometryCollectionBuilder; +import org.elasticsearch.legacygeo.builders.ShapeBuilder; import org.locationtech.jts.geom.Coordinate; import java.io.IOException; @@ -37,9 +37,7 @@ abstract class GeoJsonParser { CoordinateNode coordinateNode = null; GeometryCollectionBuilder geometryCollections = null; - Orientation orientation = (shapeMapper == null) - ? Orientation.RIGHT - : shapeMapper.orientation(); + Orientation orientation = (shapeMapper == null) ? Orientation.RIGHT : shapeMapper.orientation(); boolean coerce = shapeMapper != null && shapeMapper.coerce(); boolean ignoreZValue = shapeMapper == null || shapeMapper.ignoreZValue(); @@ -55,8 +53,12 @@ abstract class GeoJsonParser { subParser.nextToken(); final GeoShapeType type = GeoShapeType.forName(subParser.text()); if (shapeType != null && shapeType.equals(type) == false) { - malformedException = ShapeParser.FIELD_TYPE + " already parsed as [" - + shapeType + "] cannot redefine as [" + type + "]"; + malformedException = ShapeParser.FIELD_TYPE + + " already parsed as [" + + shapeType + + "] cannot redefine as [" + + type + + "]"; } else { shapeType = type; } @@ -64,16 +66,14 @@ abstract class GeoJsonParser { subParser.nextToken(); CoordinateNode tempNode = parseCoordinates(subParser, ignoreZValue); if (coordinateNode != null && tempNode.numDimensions() != coordinateNode.numDimensions()) { - throw new ElasticsearchParseException("Exception parsing coordinates: " + - "number of dimensions do not match"); + throw new ElasticsearchParseException("Exception parsing coordinates: " + "number of dimensions do not match"); } coordinateNode = tempNode; } else if (ShapeParser.FIELD_GEOMETRIES.match(fieldName, subParser.getDeprecationHandler())) { if (shapeType == null) { shapeType = GeoShapeType.GEOMETRYCOLLECTION; } else if (shapeType.equals(GeoShapeType.GEOMETRYCOLLECTION) == false) { - malformedException = "cannot have [" + ShapeParser.FIELD_GEOMETRIES + "] with type set to [" - + shapeType + "]"; + malformedException = "cannot have [" + ShapeParser.FIELD_GEOMETRIES + "] with type set to [" + shapeType + "]"; } subParser.nextToken(); geometryCollections = parseGeometries(subParser, shapeMapper); @@ -81,8 +81,7 @@ abstract class GeoJsonParser { if (shapeType == null) { shapeType = GeoShapeType.CIRCLE; } else if (shapeType.equals(GeoShapeType.CIRCLE) == false) { - malformedException = "cannot have [" + CircleBuilder.FIELD_RADIUS + "] with type set to [" - + shapeType + "]"; + malformedException = "cannot have [" + CircleBuilder.FIELD_RADIUS + "] with type set to [" + shapeType + "]"; } subParser.nextToken(); radius = DistanceUnit.Distance.parseDistance(subParser.text()); @@ -110,8 +109,7 @@ abstract class GeoJsonParser { } else if (geometryCollections == null && GeoShapeType.GEOMETRYCOLLECTION == shapeType) { throw new ElasticsearchParseException("geometries not included"); } else if (radius != null && GeoShapeType.CIRCLE != shapeType) { - throw new ElasticsearchParseException("field [{}] is supported for [{}] only", CircleBuilder.FIELD_RADIUS, - CircleBuilder.TYPE); + throw new ElasticsearchParseException("field [{}] is supported for [{}] only", CircleBuilder.FIELD_RADIUS, CircleBuilder.TYPE); } if (shapeType.equals(GeoShapeType.GEOMETRYCOLLECTION)) { @@ -141,9 +139,9 @@ private static CoordinateNode parseCoordinates(XContentParser parser, boolean ig XContentParser.Token token = parser.nextToken(); // Base cases - if (token != XContentParser.Token.START_ARRAY && - token != XContentParser.Token.END_ARRAY && - token != XContentParser.Token.VALUE_NULL) { + if (token != XContentParser.Token.START_ARRAY + && token != XContentParser.Token.END_ARRAY + && token != XContentParser.Token.VALUE_NULL) { return new CoordinateNode(parseCoordinate(parser, ignoreZValue)); } else if (token == XContentParser.Token.VALUE_NULL) { throw new IllegalArgumentException("coordinates cannot contain NULL values)"); @@ -192,8 +190,7 @@ private static Coordinate parseCoordinate(XContentParser parser, boolean ignoreZ * @return Geometry[] geometries of the GeometryCollection * @throws IOException Thrown if an error occurs while reading from the XContentParser */ - static GeometryCollectionBuilder parseGeometries(XContentParser parser, AbstractShapeGeometryFieldMapper mapper) throws - IOException { + static GeometryCollectionBuilder parseGeometries(XContentParser parser, AbstractShapeGeometryFieldMapper mapper) throws IOException { if (parser.currentToken() != XContentParser.Token.START_ARRAY) { throw new ElasticsearchParseException("geometries must be an array of geojson objects"); } diff --git a/server/src/main/java/org/elasticsearch/common/geo/parsers/GeoWKTParser.java b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/parsers/GeoWKTParser.java similarity index 79% rename from server/src/main/java/org/elasticsearch/common/geo/parsers/GeoWKTParser.java rename to modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/parsers/GeoWKTParser.java index cf9e853add472..24479b4bfd993 100644 --- a/server/src/main/java/org/elasticsearch/common/geo/parsers/GeoWKTParser.java +++ b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/parsers/GeoWKTParser.java @@ -5,25 +5,25 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -package org.elasticsearch.common.geo.parsers; +package org.elasticsearch.legacygeo.parsers; import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.geo.GeoPoint; -import org.elasticsearch.common.geo.GeoShapeType; -import org.elasticsearch.common.geo.builders.CoordinatesBuilder; -import org.elasticsearch.common.geo.builders.EnvelopeBuilder; -import org.elasticsearch.common.geo.builders.GeometryCollectionBuilder; -import org.elasticsearch.common.geo.builders.LineStringBuilder; -import org.elasticsearch.common.geo.builders.MultiLineStringBuilder; -import org.elasticsearch.common.geo.builders.MultiPointBuilder; -import org.elasticsearch.common.geo.builders.MultiPolygonBuilder; -import org.elasticsearch.common.geo.builders.PointBuilder; -import org.elasticsearch.common.geo.builders.PolygonBuilder; -import org.elasticsearch.common.geo.builders.ShapeBuilder; import org.elasticsearch.common.geo.Orientation; import org.elasticsearch.common.logging.Loggers; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.mapper.AbstractShapeGeometryFieldMapper; +import org.elasticsearch.legacygeo.GeoShapeType; +import org.elasticsearch.legacygeo.builders.CoordinatesBuilder; +import org.elasticsearch.legacygeo.builders.EnvelopeBuilder; +import org.elasticsearch.legacygeo.builders.GeometryCollectionBuilder; +import org.elasticsearch.legacygeo.builders.LineStringBuilder; +import org.elasticsearch.legacygeo.builders.MultiLineStringBuilder; +import org.elasticsearch.legacygeo.builders.MultiPointBuilder; +import org.elasticsearch.legacygeo.builders.MultiPolygonBuilder; +import org.elasticsearch.legacygeo.builders.PointBuilder; +import org.elasticsearch.legacygeo.builders.PolygonBuilder; +import org.elasticsearch.legacygeo.builders.ShapeBuilder; import org.locationtech.jts.geom.Coordinate; import java.io.IOException; @@ -53,19 +53,21 @@ public class GeoWKTParser { private GeoWKTParser() {} public static ShapeBuilder parse(XContentParser parser, final AbstractShapeGeometryFieldMapper shapeMapper) - throws IOException, ElasticsearchParseException { + throws IOException, ElasticsearchParseException { return parseExpectedType(parser, null, shapeMapper); } - public static ShapeBuilder parseExpectedType(XContentParser parser, final GeoShapeType shapeType) - throws IOException, ElasticsearchParseException { + public static ShapeBuilder parseExpectedType(XContentParser parser, final GeoShapeType shapeType) throws IOException, + ElasticsearchParseException { return parseExpectedType(parser, shapeType, null); } /** throws an exception if the parsed geometry type does not match the expected shape type */ - public static ShapeBuilder parseExpectedType(XContentParser parser, final GeoShapeType shapeType, - final AbstractShapeGeometryFieldMapper shapeMapper) - throws IOException, ElasticsearchParseException { + public static ShapeBuilder parseExpectedType( + XContentParser parser, + final GeoShapeType shapeType, + final AbstractShapeGeometryFieldMapper shapeMapper + ) throws IOException, ElasticsearchParseException { try (StringReader reader = new StringReader(parser.text())) { boolean coerce = shapeMapper != null && shapeMapper.coerce(); boolean ignoreZValue = shapeMapper == null || shapeMapper.ignoreZValue(); @@ -88,9 +90,12 @@ private GeoWKTParser() {} } /** parse geometry from the stream tokenizer */ - private static ShapeBuilder parseGeometry(StreamTokenizer stream, GeoShapeType shapeType, final boolean ignoreZValue, - final boolean coerce) - throws IOException, ElasticsearchParseException { + private static ShapeBuilder parseGeometry( + StreamTokenizer stream, + GeoShapeType shapeType, + final boolean ignoreZValue, + final boolean coerce + ) throws IOException, ElasticsearchParseException { final GeoShapeType type = GeoShapeType.forName(nextWord(stream)); if (shapeType != null && shapeType != GeoShapeType.GEOMETRYCOLLECTION) { if (type.wktName().equals(shapeType.wktName()) == false) { @@ -134,8 +139,8 @@ private static EnvelopeBuilder parseBBox(StreamTokenizer stream) throws IOExcept return new EnvelopeBuilder(new Coordinate(minLon, maxLat), new Coordinate(maxLon, minLat)); } - private static PointBuilder parsePoint(StreamTokenizer stream, final boolean ignoreZValue, final boolean coerce) - throws IOException, ElasticsearchParseException { + private static PointBuilder parsePoint(StreamTokenizer stream, final boolean ignoreZValue, final boolean coerce) throws IOException, + ElasticsearchParseException { if (nextEmptyOrOpen(stream).equals(EMPTY)) { return null; } @@ -148,7 +153,7 @@ private static PointBuilder parsePoint(StreamTokenizer stream, final boolean ign } private static List parseCoordinateList(StreamTokenizer stream, final boolean ignoreZValue, final boolean coerce) - throws IOException, ElasticsearchParseException { + throws IOException, ElasticsearchParseException { CoordinatesBuilder coordinates = new CoordinatesBuilder(); boolean isOpenParen = false; if (isNumberNext(stream) || (isOpenParen = nextWord(stream).equals(LPAREN))) { @@ -171,8 +176,8 @@ private static List parseCoordinateList(StreamTokenizer stream, fina return coordinates.build(); } - private static Coordinate parseCoordinate(StreamTokenizer stream, final boolean ignoreZValue, final boolean coerce) - throws IOException, ElasticsearchParseException { + private static Coordinate parseCoordinate(StreamTokenizer stream, final boolean ignoreZValue, final boolean coerce) throws IOException, + ElasticsearchParseException { final double lon = nextNumber(stream); final double lat = nextNumber(stream); Double z = null; @@ -183,7 +188,7 @@ private static Coordinate parseCoordinate(StreamTokenizer stream, final boolean } private static MultiPointBuilder parseMultiPoint(StreamTokenizer stream, final boolean ignoreZValue, final boolean coerce) - throws IOException, ElasticsearchParseException { + throws IOException, ElasticsearchParseException { String token = nextEmptyOrOpen(stream); if (token.equals(EMPTY)) { return new MultiPointBuilder(); @@ -191,8 +196,8 @@ private static MultiPointBuilder parseMultiPoint(StreamTokenizer stream, final b return new MultiPointBuilder(parseCoordinateList(stream, ignoreZValue, coerce)); } - private static LineStringBuilder parseLine(StreamTokenizer stream, final boolean ignoreZValue, final boolean coerce) - throws IOException, ElasticsearchParseException { + private static LineStringBuilder parseLine(StreamTokenizer stream, final boolean ignoreZValue, final boolean coerce) throws IOException, + ElasticsearchParseException { String token = nextEmptyOrOpen(stream); if (token.equals(EMPTY)) { return null; @@ -203,7 +208,7 @@ private static LineStringBuilder parseLine(StreamTokenizer stream, final boolean // A LinearRing is closed LineString with 4 or more positions. The first and last positions // are equivalent (they represent equivalent points). private static LineStringBuilder parseLinearRing(StreamTokenizer stream, final boolean ignoreZValue, final boolean coerce) - throws IOException, ElasticsearchParseException { + throws IOException, ElasticsearchParseException { String token = nextEmptyOrOpen(stream); if (token.equals(EMPTY)) { return null; @@ -220,14 +225,13 @@ private static LineStringBuilder parseLinearRing(StreamTokenizer stream, final b } } if (coordinates.size() < 4) { - throw new ElasticsearchParseException("invalid number of points in LinearRing (found [{}] - must be >= 4)", - coordinates.size()); + throw new ElasticsearchParseException("invalid number of points in LinearRing (found [{}] - must be >= 4)", coordinates.size()); } return new LineStringBuilder(coordinates); } private static MultiLineStringBuilder parseMultiLine(StreamTokenizer stream, final boolean ignoreZValue, final boolean coerce) - throws IOException, ElasticsearchParseException { + throws IOException, ElasticsearchParseException { String token = nextEmptyOrOpen(stream); if (token.equals(EMPTY)) { return new MultiLineStringBuilder(); @@ -240,13 +244,12 @@ private static MultiLineStringBuilder parseMultiLine(StreamTokenizer stream, fin return builder; } - private static PolygonBuilder parsePolygon(StreamTokenizer stream, final boolean ignoreZValue, final boolean coerce) - throws IOException, ElasticsearchParseException { + private static PolygonBuilder parsePolygon(StreamTokenizer stream, final boolean ignoreZValue, final boolean coerce) throws IOException, + ElasticsearchParseException { if (nextEmptyOrOpen(stream).equals(EMPTY)) { return null; } - PolygonBuilder builder = new PolygonBuilder(parseLinearRing(stream, ignoreZValue, coerce), - Orientation.RIGHT); + PolygonBuilder builder = new PolygonBuilder(parseLinearRing(stream, ignoreZValue, coerce), Orientation.RIGHT); while (nextCloserOrComma(stream).equals(COMMA)) { builder.hole(parseLinearRing(stream, ignoreZValue, coerce)); } @@ -254,7 +257,7 @@ private static PolygonBuilder parsePolygon(StreamTokenizer stream, final boolean } private static MultiPolygonBuilder parseMultiPolygon(StreamTokenizer stream, final boolean ignoreZValue, final boolean coerce) - throws IOException, ElasticsearchParseException { + throws IOException, ElasticsearchParseException { if (nextEmptyOrOpen(stream).equals(EMPTY)) { return null; } @@ -265,14 +268,17 @@ private static MultiPolygonBuilder parseMultiPolygon(StreamTokenizer stream, fin return builder; } - private static GeometryCollectionBuilder parseGeometryCollection(StreamTokenizer stream, final boolean ignoreZValue, - final boolean coerce) - throws IOException, ElasticsearchParseException { + private static GeometryCollectionBuilder parseGeometryCollection( + StreamTokenizer stream, + final boolean ignoreZValue, + final boolean coerce + ) throws IOException, ElasticsearchParseException { if (nextEmptyOrOpen(stream).equals(EMPTY)) { return null; } GeometryCollectionBuilder builder = new GeometryCollectionBuilder().shape( - parseGeometry(stream, GeoShapeType.GEOMETRYCOLLECTION, ignoreZValue, coerce)); + parseGeometry(stream, GeoShapeType.GEOMETRYCOLLECTION, ignoreZValue, coerce) + ); while (nextCloserOrComma(stream).equals(COMMA)) { builder.shape(parseGeometry(stream, null, ignoreZValue, coerce)); } @@ -285,9 +291,12 @@ private static String nextWord(StreamTokenizer stream) throws ElasticsearchParse case StreamTokenizer.TT_WORD: final String word = stream.sval; return word.equalsIgnoreCase(EMPTY) ? EMPTY : word; - case '(': return LPAREN; - case ')': return RPAREN; - case ',': return COMMA; + case '(': + return LPAREN; + case ')': + return RPAREN; + case ',': + return COMMA; } throw new ElasticsearchParseException("expected word but found: " + tokenString(stream), stream.lineno()); } @@ -309,10 +318,14 @@ private static double nextNumber(StreamTokenizer stream) throws IOException, Ela private static String tokenString(StreamTokenizer stream) { switch (stream.ttype) { - case StreamTokenizer.TT_WORD: return stream.sval; - case StreamTokenizer.TT_EOF: return EOF; - case StreamTokenizer.TT_EOL: return EOL; - case StreamTokenizer.TT_NUMBER: return NUMBER; + case StreamTokenizer.TT_WORD: + return stream.sval; + case StreamTokenizer.TT_EOF: + return EOF; + case StreamTokenizer.TT_EOL: + return EOL; + case StreamTokenizer.TT_NUMBER: + return NUMBER; } return "'" + (char) stream.ttype + "'"; } @@ -328,8 +341,10 @@ private static String nextEmptyOrOpen(StreamTokenizer stream) throws IOException if (next.equals(EMPTY) || next.equals(LPAREN)) { return next; } - throw new ElasticsearchParseException("expected " + EMPTY + " or " + LPAREN - + " but found: " + tokenString(stream), stream.lineno()); + throw new ElasticsearchParseException( + "expected " + EMPTY + " or " + LPAREN + " but found: " + tokenString(stream), + stream.lineno() + ); } private static String nextCloser(StreamTokenizer stream) throws IOException, ElasticsearchParseException { @@ -351,15 +366,19 @@ private static String nextCloserOrComma(StreamTokenizer stream) throws IOExcepti if (token.equals(COMMA) || token.equals(RPAREN)) { return token; } - throw new ElasticsearchParseException("expected " + COMMA + " or " + RPAREN - + " but found: " + tokenString(stream), stream.lineno()); + throw new ElasticsearchParseException( + "expected " + COMMA + " or " + RPAREN + " but found: " + tokenString(stream), + stream.lineno() + ); } /** next word in the stream */ private static void checkEOF(StreamTokenizer stream) throws ElasticsearchParseException, IOException { if (stream.nextToken() != StreamTokenizer.TT_EOF) { - throw new ElasticsearchParseException("expected end of WKT string but found additional text: " - + tokenString(stream), stream.lineno()); + throw new ElasticsearchParseException( + "expected end of WKT string but found additional text: " + tokenString(stream), + stream.lineno() + ); } } } diff --git a/server/src/main/java/org/elasticsearch/common/geo/parsers/ShapeParser.java b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/parsers/ShapeParser.java similarity index 86% rename from server/src/main/java/org/elasticsearch/common/geo/parsers/ShapeParser.java rename to modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/parsers/ShapeParser.java index 56f2fe3ff5205..a8d26a19d4733 100644 --- a/server/src/main/java/org/elasticsearch/common/geo/parsers/ShapeParser.java +++ b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/parsers/ShapeParser.java @@ -5,18 +5,18 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -package org.elasticsearch.common.geo.parsers; +package org.elasticsearch.legacygeo.parsers; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.geo.builders.ShapeBuilder; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.common.xcontent.ParseField; import org.elasticsearch.common.xcontent.XContent; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.support.MapXContentParser; import org.elasticsearch.index.mapper.AbstractGeometryFieldMapper; import org.elasticsearch.index.mapper.AbstractShapeGeometryFieldMapper; +import org.elasticsearch.legacygeo.builders.ShapeBuilder; import java.io.IOException; import java.util.Collections; @@ -46,11 +46,12 @@ public interface ShapeParser { if (geometryMapper instanceof AbstractShapeGeometryFieldMapper == false) { throw new IllegalArgumentException("geometry must be a shape type"); } - shapeMapper = (AbstractShapeGeometryFieldMapper) geometryMapper; + shapeMapper = (AbstractShapeGeometryFieldMapper) geometryMapper; } if (parser.currentToken() == XContentParser.Token.VALUE_NULL) { return null; - } if (parser.currentToken() == XContentParser.Token.START_OBJECT) { + } + if (parser.currentToken() == XContentParser.Token.START_OBJECT) { return GeoJsonParser.parse(parser, shapeMapper); } else if (parser.currentToken() == XContentParser.Token.VALUE_STRING) { return GeoWKTParser.parse(parser, shapeMapper); @@ -70,8 +71,14 @@ public interface ShapeParser { } static ShapeBuilder parse(Object value) throws IOException { - try (XContentParser parser = new MapXContentParser(NamedXContentRegistry.EMPTY, LoggingDeprecationHandler.INSTANCE, - Collections.singletonMap("value", value), null)) { + try ( + XContentParser parser = new MapXContentParser( + NamedXContentRegistry.EMPTY, + LoggingDeprecationHandler.INSTANCE, + Collections.singletonMap("value", value), + null + ) + ) { parser.nextToken(); // start object parser.nextToken(); // field name parser.nextToken(); // field value diff --git a/server/src/main/java/org/elasticsearch/index/query/LegacyGeoShapeQueryProcessor.java b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/query/LegacyGeoShapeQueryProcessor.java similarity index 81% rename from server/src/main/java/org/elasticsearch/index/query/LegacyGeoShapeQueryProcessor.java rename to modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/query/LegacyGeoShapeQueryProcessor.java index 2df07efaa7ecf..5ea5c76fbcf3f 100644 --- a/server/src/main/java/org/elasticsearch/index/query/LegacyGeoShapeQueryProcessor.java +++ b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/query/LegacyGeoShapeQueryProcessor.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.index.query; +package org.elasticsearch.legacygeo.query; import org.apache.lucene.search.BooleanClause; import org.apache.lucene.search.BooleanQuery; @@ -16,19 +16,9 @@ import org.apache.lucene.spatial.query.SpatialArgs; import org.apache.lucene.spatial.query.SpatialOperation; import org.elasticsearch.ElasticsearchException; +import org.elasticsearch.common.geo.Orientation; import org.elasticsearch.common.geo.ShapeRelation; import org.elasticsearch.common.geo.SpatialStrategy; -import org.elasticsearch.common.geo.builders.CircleBuilder; -import org.elasticsearch.common.geo.builders.EnvelopeBuilder; -import org.elasticsearch.common.geo.builders.GeometryCollectionBuilder; -import org.elasticsearch.common.geo.builders.LineStringBuilder; -import org.elasticsearch.common.geo.builders.MultiLineStringBuilder; -import org.elasticsearch.common.geo.builders.MultiPointBuilder; -import org.elasticsearch.common.geo.builders.MultiPolygonBuilder; -import org.elasticsearch.common.geo.builders.PointBuilder; -import org.elasticsearch.common.geo.builders.PolygonBuilder; -import org.elasticsearch.common.geo.builders.ShapeBuilder; -import org.elasticsearch.common.geo.Orientation; import org.elasticsearch.common.unit.DistanceUnit; import org.elasticsearch.geometry.Circle; import org.elasticsearch.geometry.Geometry; @@ -42,7 +32,19 @@ import org.elasticsearch.geometry.Point; import org.elasticsearch.geometry.Polygon; import org.elasticsearch.geometry.Rectangle; -import org.elasticsearch.index.mapper.LegacyGeoShapeFieldMapper; +import org.elasticsearch.index.query.ExistsQueryBuilder; +import org.elasticsearch.index.query.SearchExecutionContext; +import org.elasticsearch.legacygeo.builders.CircleBuilder; +import org.elasticsearch.legacygeo.builders.EnvelopeBuilder; +import org.elasticsearch.legacygeo.builders.GeometryCollectionBuilder; +import org.elasticsearch.legacygeo.builders.LineStringBuilder; +import org.elasticsearch.legacygeo.builders.MultiLineStringBuilder; +import org.elasticsearch.legacygeo.builders.MultiPointBuilder; +import org.elasticsearch.legacygeo.builders.MultiPolygonBuilder; +import org.elasticsearch.legacygeo.builders.PointBuilder; +import org.elasticsearch.legacygeo.builders.PolygonBuilder; +import org.elasticsearch.legacygeo.builders.ShapeBuilder; +import org.elasticsearch.legacygeo.mapper.LegacyGeoShapeFieldMapper; import org.locationtech.jts.geom.Coordinate; import org.locationtech.spatial4j.shape.Shape; @@ -51,7 +53,7 @@ import static org.elasticsearch.search.SearchService.ALLOW_EXPENSIVE_QUERIES; -public class LegacyGeoShapeQueryProcessor { +public class LegacyGeoShapeQueryProcessor { private final LegacyGeoShapeFieldMapper.GeoShapeFieldType shapeFieldType; @@ -59,11 +61,19 @@ public LegacyGeoShapeQueryProcessor(LegacyGeoShapeFieldMapper.GeoShapeFieldType this.shapeFieldType = shapeFieldType; } - public Query geoShapeQuery(Geometry shape, String fieldName, SpatialStrategy strategy, - ShapeRelation relation, SearchExecutionContext context) { + public Query geoShapeQuery( + Geometry shape, + String fieldName, + SpatialStrategy strategy, + ShapeRelation relation, + SearchExecutionContext context + ) { if (context.allowExpensiveQueries() == false) { - throw new ElasticsearchException("[geo-shape] queries on [PrefixTree geo shapes] cannot be executed when '" - + ALLOW_EXPENSIVE_QUERIES.getKey() + "' is set to false."); + throw new ElasticsearchException( + "[geo-shape] queries on [PrefixTree geo shapes] cannot be executed when '" + + ALLOW_EXPENSIVE_QUERIES.getKey() + + "' is set to false." + ); } SpatialStrategy spatialStrategy = shapeFieldType.strategy(); @@ -175,9 +185,11 @@ private static Shape buildS4J(Geometry geometry) { @Override public ShapeBuilder visit(Polygon polygon) { - PolygonBuilder polygonBuilder = - new PolygonBuilder((LineStringBuilder) visit((Line) polygon.getPolygon()), - Orientation.RIGHT, false); + PolygonBuilder polygonBuilder = new PolygonBuilder( + (LineStringBuilder) visit((Line) polygon.getPolygon()), + Orientation.RIGHT, + false + ); for (int i = 0; i < polygon.getNumberOfHoles(); i++) { polygonBuilder.hole((LineStringBuilder) visit((Line) polygon.getHole(i))); } @@ -186,8 +198,10 @@ private static Shape buildS4J(Geometry geometry) { @Override public ShapeBuilder visit(Rectangle rectangle) { - return new EnvelopeBuilder(new Coordinate(rectangle.getMinX(), rectangle.getMaxY()), - new Coordinate(rectangle.getMaxX(), rectangle.getMinY())); + return new EnvelopeBuilder( + new Coordinate(rectangle.getMinX(), rectangle.getMaxY()), + new Coordinate(rectangle.getMaxX(), rectangle.getMinY()) + ); } }); return shapeBuilder; diff --git a/server/src/test/java/org/elasticsearch/common/geo/BaseGeoParsingTestCase.java b/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/BaseGeoParsingTestCase.java similarity index 84% rename from server/src/test/java/org/elasticsearch/common/geo/BaseGeoParsingTestCase.java rename to modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/BaseGeoParsingTestCase.java index 601ef74594454..dcbb4ca73a308 100644 --- a/server/src/test/java/org/elasticsearch/common/geo/BaseGeoParsingTestCase.java +++ b/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/BaseGeoParsingTestCase.java @@ -5,15 +5,15 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -package org.elasticsearch.common.geo; +package org.elasticsearch.legacygeo; -import org.elasticsearch.common.geo.parsers.ShapeParser; +import org.elasticsearch.common.geo.GeometryParser; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.geometry.utils.GeographyValidator; import org.elasticsearch.index.mapper.GeoShapeIndexer; +import org.elasticsearch.legacygeo.parsers.ShapeParser; +import org.elasticsearch.legacygeo.test.ElasticsearchGeoAssertions; import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.hamcrest.ElasticsearchGeoAssertions; import org.locationtech.jts.geom.Geometry; import org.locationtech.jts.geom.GeometryFactory; import org.locationtech.spatial4j.shape.Shape; @@ -26,19 +26,26 @@ import java.util.Arrays; import java.util.List; -import static org.elasticsearch.common.geo.builders.ShapeBuilder.SPATIAL_CONTEXT; +import static org.elasticsearch.legacygeo.builders.ShapeBuilder.SPATIAL_CONTEXT; /** Base class for all geo parsing tests */ abstract class BaseGeoParsingTestCase extends ESTestCase { protected static final GeometryFactory GEOMETRY_FACTORY = SPATIAL_CONTEXT.getGeometryFactory(); public abstract void testParsePoint() throws IOException, ParseException; + public abstract void testParseMultiPoint() throws IOException, ParseException; + public abstract void testParseLineString() throws IOException, ParseException; + public abstract void testParseMultiLineString() throws IOException, ParseException; + public abstract void testParsePolygon() throws IOException, ParseException; + public abstract void testParseMultiPolygon() throws IOException, ParseException; + public abstract void testParseEnvelope() throws IOException, ParseException; + public abstract void testParseGeometryCollection() throws IOException, ParseException; protected void assertValidException(XContentBuilder builder, Class expectedException) throws IOException { @@ -62,13 +69,6 @@ protected void assertGeometryEquals(Object expected, XContentBuilder geoJson, bo } } - protected void assertGeometryEquals(org.elasticsearch.geometry.Geometry expected, XContentBuilder geoJson) throws IOException { - try (XContentParser parser = createParser(geoJson)) { - parser.nextToken(); - assertEquals(expected, GeoJson.fromXContent(GeographyValidator.instance(false), false, true, parser)); - } - } - protected ShapeCollection shapeCollection(Shape... shapes) { return new ShapeCollection<>(Arrays.asList(shapes), SPATIAL_CONTEXT); } diff --git a/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/GeoJsonShapeParserTests.java b/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/GeoJsonShapeParserTests.java new file mode 100644 index 0000000000000..25960d80434a0 --- /dev/null +++ b/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/GeoJsonShapeParserTests.java @@ -0,0 +1,2293 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.legacygeo; + +import org.elasticsearch.ElasticsearchParseException; +import org.elasticsearch.Version; +import org.elasticsearch.cluster.metadata.IndexMetadata; +import org.elasticsearch.common.Strings; +import org.elasticsearch.common.UUIDs; +import org.elasticsearch.common.geo.GeoUtils; +import org.elasticsearch.common.geo.GeometryParser; +import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.geometry.Geometry; +import org.elasticsearch.geometry.GeometryCollection; +import org.elasticsearch.geometry.Line; +import org.elasticsearch.geometry.MultiLine; +import org.elasticsearch.geometry.MultiPoint; +import org.elasticsearch.index.mapper.GeoShapeIndexer; +import org.elasticsearch.index.mapper.MapperBuilderContext; +import org.elasticsearch.legacygeo.mapper.LegacyGeoShapeFieldMapper; +import org.elasticsearch.legacygeo.parsers.ShapeParser; +import org.elasticsearch.legacygeo.test.ElasticsearchGeoAssertions; +import org.elasticsearch.test.VersionUtils; +import org.locationtech.jts.geom.Coordinate; +import org.locationtech.jts.geom.LineString; +import org.locationtech.jts.geom.LinearRing; +import org.locationtech.jts.geom.MultiLineString; +import org.locationtech.jts.geom.MultiPolygon; +import org.locationtech.jts.geom.Point; +import org.locationtech.jts.geom.Polygon; +import org.locationtech.spatial4j.exception.InvalidShapeException; +import org.locationtech.spatial4j.shape.Circle; +import org.locationtech.spatial4j.shape.Rectangle; +import org.locationtech.spatial4j.shape.Shape; +import org.locationtech.spatial4j.shape.ShapeCollection; +import org.locationtech.spatial4j.shape.jts.JtsPoint; + +import java.io.IOException; +import java.text.ParseException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import static org.elasticsearch.legacygeo.builders.ShapeBuilder.SPATIAL_CONTEXT; + +/** + * Tests for {@code GeoJSONShapeParser} + */ +public class GeoJsonShapeParserTests extends BaseGeoParsingTestCase { + + @Override + public void testParsePoint() throws IOException, ParseException { + XContentBuilder pointGeoJson = XContentFactory.jsonBuilder() + .startObject() + .field("type", "Point") + .startArray("coordinates") + .value(100.0) + .value(0.0) + .endArray() + .endObject(); + Point expected = GEOMETRY_FACTORY.createPoint(new Coordinate(100.0, 0.0)); + assertGeometryEquals(new JtsPoint(expected, SPATIAL_CONTEXT), pointGeoJson, true); + assertGeometryEquals(new org.elasticsearch.geometry.Point(100d, 0d), pointGeoJson, false); + } + + @Override + public void testParseLineString() throws IOException, ParseException { + XContentBuilder lineGeoJson = XContentFactory.jsonBuilder() + .startObject() + .field("type", "LineString") + .startArray("coordinates") + .startArray() + .value(100.0) + .value(0.0) + .endArray() + .startArray() + .value(101.0) + .value(1.0) + .endArray() + .endArray() + .endObject(); + + List lineCoordinates = new ArrayList<>(); + lineCoordinates.add(new Coordinate(100, 0)); + lineCoordinates.add(new Coordinate(101, 1)); + + try (XContentParser parser = createParser(lineGeoJson)) { + parser.nextToken(); + Shape shape = ShapeParser.parse(parser).buildS4J(); + ElasticsearchGeoAssertions.assertLineString(shape, true); + } + + try (XContentParser parser = createParser(lineGeoJson)) { + parser.nextToken(); + ElasticsearchGeoAssertions.assertLineString(parse(parser), false); + } + } + + @Override + public void testParseMultiLineString() throws IOException, ParseException { + XContentBuilder multilinesGeoJson = XContentFactory.jsonBuilder() + .startObject() + .field("type", "MultiLineString") + .startArray("coordinates") + .startArray() + .startArray() + .value(100.0) + .value(0.0) + .endArray() + .startArray() + .value(101.0) + .value(1.0) + .endArray() + .endArray() + .startArray() + .startArray() + .value(102.0) + .value(2.0) + .endArray() + .startArray() + .value(103.0) + .value(3.0) + .endArray() + .endArray() + .endArray() + .endObject(); + + MultiLineString expected = GEOMETRY_FACTORY.createMultiLineString( + new LineString[] { + GEOMETRY_FACTORY.createLineString(new Coordinate[] { new Coordinate(100, 0), new Coordinate(101, 1), }), + GEOMETRY_FACTORY.createLineString(new Coordinate[] { new Coordinate(102, 2), new Coordinate(103, 3), }), } + ); + assertGeometryEquals(jtsGeom(expected), multilinesGeoJson, true); + assertGeometryEquals( + new MultiLine( + Arrays.asList( + new Line(new double[] { 100d, 101d }, new double[] { 0d, 1d }), + new Line(new double[] { 102d, 103d }, new double[] { 2d, 3d }) + ) + ), + multilinesGeoJson, + false + ); + } + + public void testParseCircle() throws IOException, ParseException { + XContentBuilder multilinesGeoJson = XContentFactory.jsonBuilder() + .startObject() + .field("type", "circle") + .startArray("coordinates") + .value(100.0) + .value(0.0) + .endArray() + .field("radius", "100m") + .endObject(); + + Circle expected = SPATIAL_CONTEXT.makeCircle(100.0, 0.0, 360 * 100 / GeoUtils.EARTH_EQUATOR); + assertGeometryEquals(expected, multilinesGeoJson, true); + } + + public void testParseMultiDimensionShapes() throws IOException { + // multi dimension point + XContentBuilder pointGeoJson = XContentFactory.jsonBuilder() + .startObject() + .field("type", "Point") + .startArray("coordinates") + .value(100.0) + .value(0.0) + .value(15.0) + .value(18.0) + .endArray() + .endObject(); + + XContentParser parser = createParser(pointGeoJson); + parser.nextToken(); + ElasticsearchGeoAssertions.assertValidException(parser, ElasticsearchParseException.class); + assertNull(parser.nextToken()); + + // multi dimension linestring + XContentBuilder lineGeoJson = XContentFactory.jsonBuilder() + .startObject() + .field("type", "LineString") + .startArray("coordinates") + .startArray() + .value(100.0) + .value(0.0) + .value(15.0) + .endArray() + .startArray() + .value(101.0) + .value(1.0) + .value(18.0) + .value(19.0) + .endArray() + .endArray() + .endObject(); + + parser = createParser(lineGeoJson); + parser.nextToken(); + ElasticsearchGeoAssertions.assertValidException(parser, ElasticsearchParseException.class); + assertNull(parser.nextToken()); + } + + @Override + public void testParseEnvelope() throws IOException, ParseException { + // test #1: envelope with expected coordinate order (TopLeft, BottomRight) + XContentBuilder multilinesGeoJson = XContentFactory.jsonBuilder() + .startObject() + .field("type", "envelope") + .startArray("coordinates") + .startArray() + .value(-50) + .value(30) + .endArray() + .startArray() + .value(50) + .value(-30) + .endArray() + .endArray() + .endObject(); + Rectangle expected = SPATIAL_CONTEXT.makeRectangle(-50, 50, -30, 30); + assertGeometryEquals(expected, multilinesGeoJson, true); + assertGeometryEquals(new org.elasticsearch.geometry.Rectangle(-50, 50, 30, -30), multilinesGeoJson, false); + + // test #2: envelope that spans dateline + multilinesGeoJson = XContentFactory.jsonBuilder() + .startObject() + .field("type", "envelope") + .startArray("coordinates") + .startArray() + .value(50) + .value(30) + .endArray() + .startArray() + .value(-50) + .value(-30) + .endArray() + .endArray() + .endObject(); + + expected = SPATIAL_CONTEXT.makeRectangle(50, -50, -30, 30); + assertGeometryEquals(expected, multilinesGeoJson, true); + assertGeometryEquals(new org.elasticsearch.geometry.Rectangle(50, -50, 30, -30), multilinesGeoJson, false); + + // test #3: "envelope" (actually a triangle) with invalid number of coordinates (TopRight, BottomLeft, BottomRight) + multilinesGeoJson = XContentFactory.jsonBuilder() + .startObject() + .field("type", "envelope") + .startArray("coordinates") + .startArray() + .value(50) + .value(30) + .endArray() + .startArray() + .value(-50) + .value(-30) + .endArray() + .startArray() + .value(50) + .value(-39) + .endArray() + .endArray() + .endObject(); + try (XContentParser parser = createParser(multilinesGeoJson)) { + parser.nextToken(); + ElasticsearchGeoAssertions.assertValidException(parser, ElasticsearchParseException.class); + assertNull(parser.nextToken()); + } + + // test #4: "envelope" with empty coordinates + multilinesGeoJson = XContentFactory.jsonBuilder() + .startObject() + .field("type", "envelope") + .startArray("coordinates") + .endArray() + .endObject(); + try (XContentParser parser = createParser(multilinesGeoJson)) { + parser.nextToken(); + ElasticsearchGeoAssertions.assertValidException(parser, ElasticsearchParseException.class); + assertNull(parser.nextToken()); + } + } + + @Override + public void testParsePolygon() throws IOException, ParseException { + XContentBuilder polygonGeoJson = XContentFactory.jsonBuilder() + .startObject() + .field("type", "Polygon") + .startArray("coordinates") + .startArray() + .startArray() + .value(100.0) + .value(1.0) + .endArray() + .startArray() + .value(101.0) + .value(1.0) + .endArray() + .startArray() + .value(101.0) + .value(0.0) + .endArray() + .startArray() + .value(100.0) + .value(0.0) + .endArray() + .startArray() + .value(100.0) + .value(1.0) + .endArray() + .endArray() + .endArray() + .endObject(); + + List shellCoordinates = new ArrayList<>(); + shellCoordinates.add(new Coordinate(100, 0)); + shellCoordinates.add(new Coordinate(101, 0)); + shellCoordinates.add(new Coordinate(101, 1)); + shellCoordinates.add(new Coordinate(100, 1)); + shellCoordinates.add(new Coordinate(100, 0)); + Coordinate[] coordinates = shellCoordinates.toArray(new Coordinate[shellCoordinates.size()]); + LinearRing shell = GEOMETRY_FACTORY.createLinearRing(coordinates); + Polygon expected = GEOMETRY_FACTORY.createPolygon(shell, null); + assertGeometryEquals(jtsGeom(expected), polygonGeoJson, true); + + org.elasticsearch.geometry.Polygon p = new org.elasticsearch.geometry.Polygon( + new org.elasticsearch.geometry.LinearRing(new double[] { 100d, 101d, 101d, 100d, 100d }, new double[] { 0d, 0d, 1d, 1d, 0d }) + ); + assertGeometryEquals(p, polygonGeoJson, false); + } + + public void testParse3DPolygon() throws IOException, ParseException { + XContentBuilder polygonGeoJson = XContentFactory.jsonBuilder() + .startObject() + .field("type", "Polygon") + .startArray("coordinates") + .startArray() + .startArray() + .value(100.0) + .value(1.0) + .value(10.0) + .endArray() + .startArray() + .value(101.0) + .value(1.0) + .value(10.0) + .endArray() + .startArray() + .value(101.0) + .value(0.0) + .value(10.0) + .endArray() + .startArray() + .value(100.0) + .value(0.0) + .value(10.0) + .endArray() + .startArray() + .value(100.0) + .value(1.0) + .value(10.0) + .endArray() + .endArray() + .endArray() + .endObject(); + + List shellCoordinates = new ArrayList<>(); + shellCoordinates.add(new Coordinate(100, 0, 10)); + shellCoordinates.add(new Coordinate(101, 0, 10)); + shellCoordinates.add(new Coordinate(101, 1, 10)); + shellCoordinates.add(new Coordinate(100, 1, 10)); + shellCoordinates.add(new Coordinate(100, 0, 10)); + Coordinate[] coordinates = shellCoordinates.toArray(new Coordinate[shellCoordinates.size()]); + + Version randomVersion = VersionUtils.randomIndexCompatibleVersion(random()); + Settings indexSettings = Settings.builder() + .put(IndexMetadata.SETTING_VERSION_CREATED, randomVersion) + .put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0) + .put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1) + .put(IndexMetadata.SETTING_INDEX_UUID, UUIDs.randomBase64UUID()) + .build(); + + LinearRing shell = GEOMETRY_FACTORY.createLinearRing(shellCoordinates.toArray(new Coordinate[shellCoordinates.size()])); + Polygon expected = GEOMETRY_FACTORY.createPolygon(shell, null); + final Version version = VersionUtils.randomPreviousCompatibleVersion(random(), Version.V_8_0_0); + final LegacyGeoShapeFieldMapper mapperBuilder = new LegacyGeoShapeFieldMapper.Builder("test", version, false, true).build( + MapperBuilderContext.ROOT + ); + try (XContentParser parser = createParser(polygonGeoJson)) { + parser.nextToken(); + ElasticsearchGeoAssertions.assertEquals(jtsGeom(expected), ShapeParser.parse(parser, mapperBuilder).buildS4J()); + } + + org.elasticsearch.geometry.Polygon p = new org.elasticsearch.geometry.Polygon( + new org.elasticsearch.geometry.LinearRing( + Arrays.stream(coordinates).mapToDouble(i -> i.x).toArray(), + Arrays.stream(coordinates).mapToDouble(i -> i.y).toArray() + ) + ); + assertGeometryEquals(p, polygonGeoJson, false); + } + + public void testInvalidDimensionalPolygon() throws IOException { + XContentBuilder polygonGeoJson = XContentFactory.jsonBuilder() + .startObject() + .field("type", "Polygon") + .startArray("coordinates") + .startArray() + .startArray() + .value(100.0) + .value(1.0) + .value(10.0) + .endArray() + .startArray() + .value(101.0) + .value(1.0) + .endArray() + .startArray() + .value(101.0) + .value(0.0) + .value(10.0) + .endArray() + .startArray() + .value(100.0) + .value(0.0) + .value(10.0) + .endArray() + .startArray() + .value(100.0) + .value(1.0) + .value(10.0) + .endArray() + .endArray() + .endArray() + .endObject(); + try (XContentParser parser = createParser(polygonGeoJson)) { + parser.nextToken(); + ElasticsearchGeoAssertions.assertValidException(parser, ElasticsearchParseException.class); + assertNull(parser.nextToken()); + } + } + + public void testParseInvalidPoint() throws IOException { + // test case 1: create an invalid point object with multipoint data format + XContentBuilder invalidPoint1 = XContentFactory.jsonBuilder() + .startObject() + .field("type", "point") + .startArray("coordinates") + .startArray() + .value(-74.011) + .value(40.753) + .endArray() + .endArray() + .endObject(); + try (XContentParser parser = createParser(invalidPoint1)) { + parser.nextToken(); + ElasticsearchGeoAssertions.assertValidException(parser, ElasticsearchParseException.class); + assertNull(parser.nextToken()); + } + + // test case 2: create an invalid point object with an empty number of coordinates + XContentBuilder invalidPoint2 = XContentFactory.jsonBuilder() + .startObject() + .field("type", "point") + .startArray("coordinates") + .endArray() + .endObject(); + try (XContentParser parser = createParser(invalidPoint2)) { + parser.nextToken(); + ElasticsearchGeoAssertions.assertValidException(parser, ElasticsearchParseException.class); + assertNull(parser.nextToken()); + } + } + + public void testParseInvalidMultipoint() throws IOException { + // test case 1: create an invalid multipoint object with single coordinate + XContentBuilder invalidMultipoint1 = XContentFactory.jsonBuilder() + .startObject() + .field("type", "multipoint") + .startArray("coordinates") + .value(-74.011) + .value(40.753) + .endArray() + .endObject(); + try (XContentParser parser = createParser(invalidMultipoint1)) { + parser.nextToken(); + ElasticsearchGeoAssertions.assertValidException(parser, ElasticsearchParseException.class); + assertNull(parser.nextToken()); + } + + // test case 2: create an invalid multipoint object with null coordinate + XContentBuilder invalidMultipoint2 = XContentFactory.jsonBuilder() + .startObject() + .field("type", "multipoint") + .startArray("coordinates") + .endArray() + .endObject(); + try (XContentParser parser = createParser(invalidMultipoint2)) { + parser.nextToken(); + ElasticsearchGeoAssertions.assertValidException(parser, ElasticsearchParseException.class); + assertNull(parser.nextToken()); + } + + // test case 3: create a valid formatted multipoint object with invalid number (0) of coordinates + XContentBuilder invalidMultipoint3 = XContentFactory.jsonBuilder() + .startObject() + .field("type", "multipoint") + .startArray("coordinates") + .startArray() + .endArray() + .endArray() + .endObject(); + try (XContentParser parser = createParser(invalidMultipoint3)) { + parser.nextToken(); + ElasticsearchGeoAssertions.assertValidException(parser, ElasticsearchParseException.class); + assertNull(parser.nextToken()); + } + } + + public void testParseInvalidMultiPolygon() throws IOException { + // test invalid multipolygon (an "accidental" polygon with inner rings outside outer ring) + String multiPolygonGeoJson = Strings.toString( + XContentFactory.jsonBuilder() + .startObject() + .field("type", "MultiPolygon") + .startArray("coordinates") + .startArray()// one poly (with two holes) + .startArray() + .startArray() + .value(102.0) + .value(2.0) + .endArray() + .startArray() + .value(103.0) + .value(2.0) + .endArray() + .startArray() + .value(103.0) + .value(3.0) + .endArray() + .startArray() + .value(102.0) + .value(3.0) + .endArray() + .startArray() + .value(102.0) + .value(2.0) + .endArray() + .endArray() + .startArray()// first hole + .startArray() + .value(100.0) + .value(0.0) + .endArray() + .startArray() + .value(101.0) + .value(0.0) + .endArray() + .startArray() + .value(101.0) + .value(1.0) + .endArray() + .startArray() + .value(100.0) + .value(1.0) + .endArray() + .startArray() + .value(100.0) + .value(0.0) + .endArray() + .endArray() + .startArray()// second hole + .startArray() + .value(100.2) + .value(0.8) + .endArray() + .startArray() + .value(100.2) + .value(0.2) + .endArray() + .startArray() + .value(100.8) + .value(0.2) + .endArray() + .startArray() + .value(100.8) + .value(0.8) + .endArray() + .startArray() + .value(100.2) + .value(0.8) + .endArray() + .endArray() + .endArray() + .endArray() + .endObject() + ); + + try (XContentParser parser = createParser(JsonXContent.jsonXContent, multiPolygonGeoJson)) { + parser.nextToken(); + ElasticsearchGeoAssertions.assertValidException(parser, InvalidShapeException.class); + assertNull(parser.nextToken()); + } + } + + public void testParseInvalidDimensionalMultiPolygon() throws IOException { + // test invalid multipolygon (an "accidental" polygon with inner rings outside outer ring) + String multiPolygonGeoJson = Strings.toString( + XContentFactory.jsonBuilder() + .startObject() + .field("type", "MultiPolygon") + .startArray("coordinates") + .startArray()// first poly (without holes) + .startArray() + .startArray() + .value(102.0) + .value(2.0) + .endArray() + .startArray() + .value(103.0) + .value(2.0) + .endArray() + .startArray() + .value(103.0) + .value(3.0) + .endArray() + .startArray() + .value(102.0) + .value(3.0) + .endArray() + .startArray() + .value(102.0) + .value(2.0) + .endArray() + .endArray() + .endArray() + .startArray()// second poly (with hole) + .startArray() + .startArray() + .value(100.0) + .value(0.0) + .endArray() + .startArray() + .value(101.0) + .value(0.0) + .endArray() + .startArray() + .value(101.0) + .value(1.0) + .endArray() + .startArray() + .value(100.0) + .value(1.0) + .endArray() + .startArray() + .value(100.0) + .value(0.0) + .endArray() + .endArray() + .startArray()// hole + .startArray() + .value(100.2) + .value(0.8) + .endArray() + .startArray() + .value(100.2) + .value(0.2) + .value(10.0) + .endArray() + .startArray() + .value(100.8) + .value(0.2) + .endArray() + .startArray() + .value(100.8) + .value(0.8) + .endArray() + .startArray() + .value(100.2) + .value(0.8) + .endArray() + .endArray() + .endArray() + .endArray() + .endObject() + ); + + try (XContentParser parser = createParser(JsonXContent.jsonXContent, multiPolygonGeoJson)) { + parser.nextToken(); + ElasticsearchGeoAssertions.assertValidException(parser, ElasticsearchParseException.class); + assertNull(parser.nextToken()); + } + } + + public void testParseOGCPolygonWithoutHoles() throws IOException, ParseException { + // test 1: ccw poly not crossing dateline + String polygonGeoJson = Strings.toString( + XContentFactory.jsonBuilder() + .startObject() + .field("type", "Polygon") + .startArray("coordinates") + .startArray() + .startArray() + .value(176.0) + .value(15.0) + .endArray() + .startArray() + .value(-177.0) + .value(10.0) + .endArray() + .startArray() + .value(-177.0) + .value(-10.0) + .endArray() + .startArray() + .value(176.0) + .value(-15.0) + .endArray() + .startArray() + .value(172.0) + .value(0.0) + .endArray() + .startArray() + .value(176.0) + .value(15.0) + .endArray() + .endArray() + .endArray() + .endObject() + ); + + try (XContentParser parser = createParser(JsonXContent.jsonXContent, polygonGeoJson)) { + parser.nextToken(); + Shape shape = ShapeParser.parse(parser).buildS4J(); + ElasticsearchGeoAssertions.assertPolygon(shape, true); + } + + try (XContentParser parser = createParser(JsonXContent.jsonXContent, polygonGeoJson)) { + parser.nextToken(); + ElasticsearchGeoAssertions.assertPolygon(parse(parser), false); + } + + // test 2: ccw poly crossing dateline + polygonGeoJson = Strings.toString( + XContentFactory.jsonBuilder() + .startObject() + .field("type", "Polygon") + .startArray("coordinates") + .startArray() + .startArray() + .value(-177.0) + .value(10.0) + .endArray() + .startArray() + .value(176.0) + .value(15.0) + .endArray() + .startArray() + .value(172.0) + .value(0.0) + .endArray() + .startArray() + .value(176.0) + .value(-15.0) + .endArray() + .startArray() + .value(-177.0) + .value(-10.0) + .endArray() + .startArray() + .value(-177.0) + .value(10.0) + .endArray() + .endArray() + .endArray() + .endObject() + ); + + try (XContentParser parser = createParser(JsonXContent.jsonXContent, polygonGeoJson)) { + parser.nextToken(); + Shape shape = ShapeParser.parse(parser).buildS4J(); + ElasticsearchGeoAssertions.assertMultiPolygon(shape, true); + } + + try (XContentParser parser = createParser(JsonXContent.jsonXContent, polygonGeoJson)) { + parser.nextToken(); + ElasticsearchGeoAssertions.assertMultiPolygon(parse(parser), false); + } + + // test 3: cw poly not crossing dateline + polygonGeoJson = Strings.toString( + XContentFactory.jsonBuilder() + .startObject() + .field("type", "Polygon") + .startArray("coordinates") + .startArray() + .startArray() + .value(176.0) + .value(15.0) + .endArray() + .startArray() + .value(180.0) + .value(10.0) + .endArray() + .startArray() + .value(180.0) + .value(-10.0) + .endArray() + .startArray() + .value(176.0) + .value(-15.0) + .endArray() + .startArray() + .value(172.0) + .value(0.0) + .endArray() + .startArray() + .value(176.0) + .value(15.0) + .endArray() + .endArray() + .endArray() + .endObject() + ); + + try (XContentParser parser = createParser(JsonXContent.jsonXContent, polygonGeoJson)) { + parser.nextToken(); + Shape shape = ShapeParser.parse(parser).buildS4J(); + ElasticsearchGeoAssertions.assertPolygon(shape, true); + } + + try (XContentParser parser = createParser(JsonXContent.jsonXContent, polygonGeoJson)) { + parser.nextToken(); + ElasticsearchGeoAssertions.assertPolygon(parse(parser), false); + } + + // test 4: cw poly crossing dateline + polygonGeoJson = Strings.toString( + XContentFactory.jsonBuilder() + .startObject() + .field("type", "Polygon") + .startArray("coordinates") + .startArray() + .startArray() + .value(176.0) + .value(15.0) + .endArray() + .startArray() + .value(184.0) + .value(15.0) + .endArray() + .startArray() + .value(184.0) + .value(0.0) + .endArray() + .startArray() + .value(176.0) + .value(-15.0) + .endArray() + .startArray() + .value(174.0) + .value(-10.0) + .endArray() + .startArray() + .value(176.0) + .value(15.0) + .endArray() + .endArray() + .endArray() + .endObject() + ); + + try (XContentParser parser = createParser(JsonXContent.jsonXContent, polygonGeoJson)) { + parser.nextToken(); + Shape shape = ShapeParser.parse(parser).buildS4J(); + ElasticsearchGeoAssertions.assertMultiPolygon(shape, true); + } + + try (XContentParser parser = createParser(JsonXContent.jsonXContent, polygonGeoJson)) { + parser.nextToken(); + ElasticsearchGeoAssertions.assertMultiPolygon(parse(parser), false); + } + } + + public void testParseOGCPolygonWithHoles() throws IOException, ParseException { + // test 1: ccw poly not crossing dateline + String polygonGeoJson = Strings.toString( + XContentFactory.jsonBuilder() + .startObject() + .field("type", "Polygon") + .startArray("coordinates") + .startArray() + .startArray() + .value(176.0) + .value(15.0) + .endArray() + .startArray() + .value(-177.0) + .value(10.0) + .endArray() + .startArray() + .value(-177.0) + .value(-10.0) + .endArray() + .startArray() + .value(176.0) + .value(-15.0) + .endArray() + .startArray() + .value(172.0) + .value(0.0) + .endArray() + .startArray() + .value(176.0) + .value(15.0) + .endArray() + .endArray() + .startArray() + .startArray() + .value(-172.0) + .value(8.0) + .endArray() + .startArray() + .value(174.0) + .value(10.0) + .endArray() + .startArray() + .value(-172.0) + .value(-8.0) + .endArray() + .startArray() + .value(-172.0) + .value(8.0) + .endArray() + .endArray() + .endArray() + .endObject() + ); + + try (XContentParser parser = createParser(JsonXContent.jsonXContent, polygonGeoJson)) { + parser.nextToken(); + Shape shape = ShapeParser.parse(parser).buildS4J(); + ElasticsearchGeoAssertions.assertPolygon(shape, true); + } + + try (XContentParser parser = createParser(JsonXContent.jsonXContent, polygonGeoJson)) { + parser.nextToken(); + ElasticsearchGeoAssertions.assertPolygon(parse(parser), false); + } + + // test 2: ccw poly crossing dateline + polygonGeoJson = Strings.toString( + XContentFactory.jsonBuilder() + .startObject() + .field("type", "Polygon") + .startArray("coordinates") + .startArray() + .startArray() + .value(-177.0) + .value(10.0) + .endArray() + .startArray() + .value(176.0) + .value(15.0) + .endArray() + .startArray() + .value(172.0) + .value(0.0) + .endArray() + .startArray() + .value(176.0) + .value(-15.0) + .endArray() + .startArray() + .value(-177.0) + .value(-10.0) + .endArray() + .startArray() + .value(-177.0) + .value(10.0) + .endArray() + .endArray() + .startArray() + .startArray() + .value(178.0) + .value(8.0) + .endArray() + .startArray() + .value(-178.0) + .value(8.0) + .endArray() + .startArray() + .value(-180.0) + .value(-8.0) + .endArray() + .startArray() + .value(178.0) + .value(8.0) + .endArray() + .endArray() + .endArray() + .endObject() + ); + + try (XContentParser parser = createParser(JsonXContent.jsonXContent, polygonGeoJson)) { + parser.nextToken(); + Shape shape = ShapeParser.parse(parser).buildS4J(); + ElasticsearchGeoAssertions.assertMultiPolygon(shape, true); + } + + try (XContentParser parser = createParser(JsonXContent.jsonXContent, polygonGeoJson)) { + parser.nextToken(); + ElasticsearchGeoAssertions.assertMultiPolygon(parse(parser), false); + } + + // test 3: cw poly not crossing dateline + polygonGeoJson = Strings.toString( + XContentFactory.jsonBuilder() + .startObject() + .field("type", "Polygon") + .startArray("coordinates") + .startArray() + .startArray() + .value(176.0) + .value(15.0) + .endArray() + .startArray() + .value(180.0) + .value(10.0) + .endArray() + .startArray() + .value(179.0) + .value(-10.0) + .endArray() + .startArray() + .value(176.0) + .value(-15.0) + .endArray() + .startArray() + .value(172.0) + .value(0.0) + .endArray() + .startArray() + .value(176.0) + .value(15.0) + .endArray() + .endArray() + .startArray() + .startArray() + .value(177.0) + .value(8.0) + .endArray() + .startArray() + .value(179.0) + .value(10.0) + .endArray() + .startArray() + .value(179.0) + .value(-8.0) + .endArray() + .startArray() + .value(177.0) + .value(8.0) + .endArray() + .endArray() + .endArray() + .endObject() + ); + + try (XContentParser parser = createParser(JsonXContent.jsonXContent, polygonGeoJson)) { + parser.nextToken(); + Shape shape = ShapeParser.parse(parser).buildS4J(); + ElasticsearchGeoAssertions.assertPolygon(shape, true); + } + + try (XContentParser parser = createParser(JsonXContent.jsonXContent, polygonGeoJson)) { + parser.nextToken(); + ElasticsearchGeoAssertions.assertPolygon(parse(parser), false); + } + + // test 4: cw poly crossing dateline + polygonGeoJson = Strings.toString( + XContentFactory.jsonBuilder() + .startObject() + .field("type", "Polygon") + .startArray("coordinates") + .startArray() + .startArray() + .value(183.0) + .value(10.0) + .endArray() + .startArray() + .value(183.0) + .value(-10.0) + .endArray() + .startArray() + .value(176.0) + .value(-15.0) + .endArray() + .startArray() + .value(172.0) + .value(0.0) + .endArray() + .startArray() + .value(176.0) + .value(15.0) + .endArray() + .startArray() + .value(183.0) + .value(10.0) + .endArray() + .endArray() + .startArray() + .startArray() + .value(178.0) + .value(8.0) + .endArray() + .startArray() + .value(182.0) + .value(8.0) + .endArray() + .startArray() + .value(180.0) + .value(-8.0) + .endArray() + .startArray() + .value(178.0) + .value(8.0) + .endArray() + .endArray() + .endArray() + .endObject() + ); + + try (XContentParser parser = createParser(JsonXContent.jsonXContent, polygonGeoJson)) { + parser.nextToken(); + Shape shape = ShapeParser.parse(parser).buildS4J(); + ElasticsearchGeoAssertions.assertMultiPolygon(shape, true); + } + + try (XContentParser parser = createParser(JsonXContent.jsonXContent, polygonGeoJson)) { + parser.nextToken(); + ElasticsearchGeoAssertions.assertMultiPolygon(parse(parser), false); + } + } + + public void testParseInvalidPolygon() throws IOException { + /** + * The following 3 test cases ensure proper error handling of invalid polygons + * per the GeoJSON specification + */ + // test case 1: create an invalid polygon with only 2 points + String invalidPoly = Strings.toString( + XContentFactory.jsonBuilder() + .startObject() + .field("type", "polygon") + .startArray("coordinates") + .startArray() + .startArray() + .value(-74.011) + .value(40.753) + .endArray() + .startArray() + .value(-75.022) + .value(41.783) + .endArray() + .endArray() + .endArray() + .endObject() + ); + try (XContentParser parser = createParser(JsonXContent.jsonXContent, invalidPoly)) { + parser.nextToken(); + ElasticsearchGeoAssertions.assertValidException(parser, ElasticsearchParseException.class); + assertNull(parser.nextToken()); + } + + // test case 2: create an invalid polygon with only 1 point + invalidPoly = Strings.toString( + XContentFactory.jsonBuilder() + .startObject() + .field("type", "polygon") + .startArray("coordinates") + .startArray() + .startArray() + .value(-74.011) + .value(40.753) + .endArray() + .endArray() + .endArray() + .endObject() + ); + + try (XContentParser parser = createParser(JsonXContent.jsonXContent, invalidPoly)) { + parser.nextToken(); + ElasticsearchGeoAssertions.assertValidException(parser, ElasticsearchParseException.class); + assertNull(parser.nextToken()); + } + + // test case 3: create an invalid polygon with 0 points + invalidPoly = Strings.toString( + XContentFactory.jsonBuilder() + .startObject() + .field("type", "polygon") + .startArray("coordinates") + .startArray() + .startArray() + .endArray() + .endArray() + .endArray() + .endObject() + ); + + try (XContentParser parser = createParser(JsonXContent.jsonXContent, invalidPoly)) { + parser.nextToken(); + ElasticsearchGeoAssertions.assertValidException(parser, ElasticsearchParseException.class); + assertNull(parser.nextToken()); + } + + // test case 4: create an invalid polygon with null value points + invalidPoly = Strings.toString( + XContentFactory.jsonBuilder() + .startObject() + .field("type", "polygon") + .startArray("coordinates") + .startArray() + .startArray() + .nullValue() + .nullValue() + .endArray() + .endArray() + .endArray() + .endObject() + ); + + try (XContentParser parser = createParser(JsonXContent.jsonXContent, invalidPoly)) { + parser.nextToken(); + ElasticsearchGeoAssertions.assertValidException(parser, IllegalArgumentException.class); + assertNull(parser.nextToken()); + } + + // test case 5: create an invalid polygon with 1 invalid LinearRing + invalidPoly = Strings.toString( + XContentFactory.jsonBuilder() + .startObject() + .field("type", "polygon") + .startArray("coordinates") + .nullValue() + .nullValue() + .endArray() + .endObject() + ); + + try (XContentParser parser = createParser(JsonXContent.jsonXContent, invalidPoly)) { + parser.nextToken(); + ElasticsearchGeoAssertions.assertValidException(parser, IllegalArgumentException.class); + assertNull(parser.nextToken()); + } + + // test case 6: create an invalid polygon with 0 LinearRings + invalidPoly = Strings.toString( + XContentFactory.jsonBuilder().startObject().field("type", "polygon").startArray("coordinates").endArray().endObject() + ); + + try (XContentParser parser = createParser(JsonXContent.jsonXContent, invalidPoly)) { + parser.nextToken(); + ElasticsearchGeoAssertions.assertValidException(parser, ElasticsearchParseException.class); + assertNull(parser.nextToken()); + } + + // test case 7: create an invalid polygon with 0 LinearRings + invalidPoly = Strings.toString( + XContentFactory.jsonBuilder() + .startObject() + .field("type", "polygon") + .startArray("coordinates") + .startArray() + .value(-74.011) + .value(40.753) + .endArray() + .endArray() + .endObject() + ); + + try (XContentParser parser = createParser(JsonXContent.jsonXContent, invalidPoly)) { + parser.nextToken(); + ElasticsearchGeoAssertions.assertValidException(parser, ElasticsearchParseException.class); + assertNull(parser.nextToken()); + } + } + + public void testParsePolygonWithHole() throws IOException, ParseException { + XContentBuilder polygonGeoJson = XContentFactory.jsonBuilder() + .startObject() + .field("type", "Polygon") + .startArray("coordinates") + .startArray() + .startArray() + .value(100.0) + .value(1.0) + .endArray() + .startArray() + .value(101.0) + .value(1.0) + .endArray() + .startArray() + .value(101.0) + .value(0.0) + .endArray() + .startArray() + .value(100.0) + .value(0.0) + .endArray() + .startArray() + .value(100.0) + .value(1.0) + .endArray() + .endArray() + .startArray() + .startArray() + .value(100.2) + .value(0.8) + .endArray() + .startArray() + .value(100.2) + .value(0.2) + .endArray() + .startArray() + .value(100.8) + .value(0.2) + .endArray() + .startArray() + .value(100.8) + .value(0.8) + .endArray() + .startArray() + .value(100.2) + .value(0.8) + .endArray() + .endArray() + .endArray() + .endObject(); + + // add 3d point to test ISSUE #10501 + List shellCoordinates = new ArrayList<>(); + shellCoordinates.add(new Coordinate(100, 0, 15.0)); + shellCoordinates.add(new Coordinate(101, 0)); + shellCoordinates.add(new Coordinate(101, 1)); + shellCoordinates.add(new Coordinate(100, 1, 10.0)); + shellCoordinates.add(new Coordinate(100, 0)); + + List holeCoordinates = new ArrayList<>(); + holeCoordinates.add(new Coordinate(100.2, 0.2)); + holeCoordinates.add(new Coordinate(100.8, 0.2)); + holeCoordinates.add(new Coordinate(100.8, 0.8)); + holeCoordinates.add(new Coordinate(100.2, 0.8)); + holeCoordinates.add(new Coordinate(100.2, 0.2)); + + LinearRing shell = GEOMETRY_FACTORY.createLinearRing(shellCoordinates.toArray(new Coordinate[shellCoordinates.size()])); + LinearRing[] holes = new LinearRing[1]; + holes[0] = GEOMETRY_FACTORY.createLinearRing(holeCoordinates.toArray(new Coordinate[holeCoordinates.size()])); + Polygon expected = GEOMETRY_FACTORY.createPolygon(shell, holes); + assertGeometryEquals(jtsGeom(expected), polygonGeoJson, true); + + org.elasticsearch.geometry.LinearRing hole = new org.elasticsearch.geometry.LinearRing( + new double[] { 100.8d, 100.8d, 100.2d, 100.2d, 100.8d }, + new double[] { 0.8d, 0.2d, 0.2d, 0.8d, 0.8d } + ); + org.elasticsearch.geometry.Polygon p = new org.elasticsearch.geometry.Polygon( + new org.elasticsearch.geometry.LinearRing(new double[] { 100d, 101d, 101d, 100d, 100d }, new double[] { 0d, 0d, 1d, 1d, 0d }), + Collections.singletonList(hole) + ); + assertGeometryEquals(p, polygonGeoJson, false); + } + + public void testParseSelfCrossingPolygon() throws IOException { + // test self crossing ccw poly not crossing dateline + String polygonGeoJson = Strings.toString( + XContentFactory.jsonBuilder() + .startObject() + .field("type", "Polygon") + .startArray("coordinates") + .startArray() + .startArray() + .value(176.0) + .value(15.0) + .endArray() + .startArray() + .value(-177.0) + .value(10.0) + .endArray() + .startArray() + .value(-177.0) + .value(-10.0) + .endArray() + .startArray() + .value(176.0) + .value(-15.0) + .endArray() + .startArray() + .value(-177.0) + .value(15.0) + .endArray() + .startArray() + .value(172.0) + .value(0.0) + .endArray() + .startArray() + .value(176.0) + .value(15.0) + .endArray() + .endArray() + .endArray() + .endObject() + ); + + try (XContentParser parser = createParser(JsonXContent.jsonXContent, polygonGeoJson)) { + parser.nextToken(); + ElasticsearchGeoAssertions.assertValidException(parser, InvalidShapeException.class); + assertNull(parser.nextToken()); + } + } + + @Override + public void testParseMultiPoint() throws IOException, ParseException { + XContentBuilder multiPointGeoJson = XContentFactory.jsonBuilder() + .startObject() + .field("type", "MultiPoint") + .startArray("coordinates") + .startArray() + .value(100.0) + .value(0.0) + .endArray() + .startArray() + .value(101.0) + .value(1.0) + .endArray() + .endArray() + .endObject(); + ShapeCollection expected = shapeCollection(SPATIAL_CONTEXT.makePoint(100, 0), SPATIAL_CONTEXT.makePoint(101, 1.0)); + assertGeometryEquals(expected, multiPointGeoJson, true); + + assertGeometryEquals( + new MultiPoint(Arrays.asList(new org.elasticsearch.geometry.Point(100, 0), new org.elasticsearch.geometry.Point(101, 1))), + multiPointGeoJson, + false + ); + } + + @Override + public void testParseMultiPolygon() throws IOException, ParseException { + // test #1: two polygons; one without hole, one with hole + XContentBuilder multiPolygonGeoJson = XContentFactory.jsonBuilder() + .startObject() + .field("type", "MultiPolygon") + .startArray("coordinates") + .startArray()// first poly (without holes) + .startArray() + .startArray() + .value(102.0) + .value(2.0) + .endArray() + .startArray() + .value(103.0) + .value(2.0) + .endArray() + .startArray() + .value(103.0) + .value(3.0) + .endArray() + .startArray() + .value(102.0) + .value(3.0) + .endArray() + .startArray() + .value(102.0) + .value(2.0) + .endArray() + .endArray() + .endArray() + .startArray()// second poly (with hole) + .startArray() + .startArray() + .value(100.0) + .value(0.0) + .endArray() + .startArray() + .value(101.0) + .value(0.0) + .endArray() + .startArray() + .value(101.0) + .value(1.0) + .endArray() + .startArray() + .value(100.0) + .value(1.0) + .endArray() + .startArray() + .value(100.0) + .value(0.0) + .endArray() + .endArray() + .startArray()// hole + .startArray() + .value(100.2) + .value(0.8) + .endArray() + .startArray() + .value(100.2) + .value(0.2) + .endArray() + .startArray() + .value(100.8) + .value(0.2) + .endArray() + .startArray() + .value(100.8) + .value(0.8) + .endArray() + .startArray() + .value(100.2) + .value(0.8) + .endArray() + .endArray() + .endArray() + .endArray() + .endObject(); + + List shellCoordinates = new ArrayList<>(); + shellCoordinates.add(new Coordinate(100, 0)); + shellCoordinates.add(new Coordinate(101, 0)); + shellCoordinates.add(new Coordinate(101, 1)); + shellCoordinates.add(new Coordinate(100, 1)); + shellCoordinates.add(new Coordinate(100, 0)); + + List holeCoordinates = new ArrayList<>(); + holeCoordinates.add(new Coordinate(100.2, 0.2)); + holeCoordinates.add(new Coordinate(100.8, 0.2)); + holeCoordinates.add(new Coordinate(100.8, 0.8)); + holeCoordinates.add(new Coordinate(100.2, 0.8)); + holeCoordinates.add(new Coordinate(100.2, 0.2)); + + LinearRing shell = GEOMETRY_FACTORY.createLinearRing(shellCoordinates.toArray(new Coordinate[shellCoordinates.size()])); + LinearRing[] holes = new LinearRing[1]; + holes[0] = GEOMETRY_FACTORY.createLinearRing(holeCoordinates.toArray(new Coordinate[holeCoordinates.size()])); + Polygon withHoles = GEOMETRY_FACTORY.createPolygon(shell, holes); + + shellCoordinates = new ArrayList<>(); + shellCoordinates.add(new Coordinate(102, 3)); + shellCoordinates.add(new Coordinate(103, 3)); + shellCoordinates.add(new Coordinate(103, 2)); + shellCoordinates.add(new Coordinate(102, 2)); + shellCoordinates.add(new Coordinate(102, 3)); + + shell = GEOMETRY_FACTORY.createLinearRing(shellCoordinates.toArray(new Coordinate[shellCoordinates.size()])); + Polygon withoutHoles = GEOMETRY_FACTORY.createPolygon(shell, null); + + Shape expected = shapeCollection(withoutHoles, withHoles); + + assertGeometryEquals(expected, multiPolygonGeoJson, true); + + org.elasticsearch.geometry.LinearRing hole = new org.elasticsearch.geometry.LinearRing( + new double[] { 100.8d, 100.8d, 100.2d, 100.2d, 100.8d }, + new double[] { 0.8d, 0.2d, 0.2d, 0.8d, 0.8d } + ); + + org.elasticsearch.geometry.MultiPolygon polygons = new org.elasticsearch.geometry.MultiPolygon( + Arrays.asList( + new org.elasticsearch.geometry.Polygon( + new org.elasticsearch.geometry.LinearRing( + new double[] { 103d, 103d, 102d, 102d, 103d }, + new double[] { 2d, 3d, 3d, 2d, 2d } + ) + ), + new org.elasticsearch.geometry.Polygon( + new org.elasticsearch.geometry.LinearRing( + new double[] { 101d, 101d, 100d, 100d, 101d }, + new double[] { 0d, 1d, 1d, 0d, 0d } + ), + Collections.singletonList(hole) + ) + ) + ); + + assertGeometryEquals(polygons, multiPolygonGeoJson, false); + + // test #2: multipolygon; one polygon with one hole + // this test converting the multipolygon from a ShapeCollection type + // to a simple polygon (jtsGeom) + multiPolygonGeoJson = XContentFactory.jsonBuilder() + .startObject() + .field("type", "MultiPolygon") + .startArray("coordinates") + .startArray() + .startArray() + .startArray() + .value(100.0) + .value(1.0) + .endArray() + .startArray() + .value(101.0) + .value(1.0) + .endArray() + .startArray() + .value(101.0) + .value(0.0) + .endArray() + .startArray() + .value(100.0) + .value(0.0) + .endArray() + .startArray() + .value(100.0) + .value(1.0) + .endArray() + .endArray() + .startArray() // hole + .startArray() + .value(100.2) + .value(0.8) + .endArray() + .startArray() + .value(100.2) + .value(0.2) + .endArray() + .startArray() + .value(100.8) + .value(0.2) + .endArray() + .startArray() + .value(100.8) + .value(0.8) + .endArray() + .startArray() + .value(100.2) + .value(0.8) + .endArray() + .endArray() + .endArray() + .endArray() + .endObject(); + + shellCoordinates = new ArrayList<>(); + shellCoordinates.add(new Coordinate(100, 1)); + shellCoordinates.add(new Coordinate(101, 1)); + shellCoordinates.add(new Coordinate(101, 0)); + shellCoordinates.add(new Coordinate(100, 0)); + shellCoordinates.add(new Coordinate(100, 1)); + + holeCoordinates = new ArrayList<>(); + holeCoordinates.add(new Coordinate(100.2, 0.8)); + holeCoordinates.add(new Coordinate(100.2, 0.2)); + holeCoordinates.add(new Coordinate(100.8, 0.2)); + holeCoordinates.add(new Coordinate(100.8, 0.8)); + holeCoordinates.add(new Coordinate(100.2, 0.8)); + + shell = GEOMETRY_FACTORY.createLinearRing(shellCoordinates.toArray(new Coordinate[shellCoordinates.size()])); + holes = new LinearRing[1]; + holes[0] = GEOMETRY_FACTORY.createLinearRing(holeCoordinates.toArray(new Coordinate[holeCoordinates.size()])); + withHoles = GEOMETRY_FACTORY.createPolygon(shell, holes); + + assertGeometryEquals(jtsGeom(withHoles), multiPolygonGeoJson, true); + + org.elasticsearch.geometry.LinearRing luceneHole = new org.elasticsearch.geometry.LinearRing( + new double[] { 100.8d, 100.8d, 100.2d, 100.2d, 100.8d }, + new double[] { 0.8d, 0.2d, 0.2d, 0.8d, 0.8d } + ); + + org.elasticsearch.geometry.Polygon lucenePolygons = (new org.elasticsearch.geometry.Polygon( + new org.elasticsearch.geometry.LinearRing(new double[] { 100d, 101d, 101d, 100d, 100d }, new double[] { 0d, 0d, 1d, 1d, 0d }), + Collections.singletonList(luceneHole) + )); + assertGeometryEquals(lucenePolygons, multiPolygonGeoJson, false); + } + + @Override + public void testParseGeometryCollection() throws IOException, ParseException { + XContentBuilder geometryCollectionGeoJson = XContentFactory.jsonBuilder() + .startObject() + .field("type", "GeometryCollection") + .startArray("geometries") + .startObject() + .field("type", "LineString") + .startArray("coordinates") + .startArray() + .value(100.0) + .value(0.0) + .endArray() + .startArray() + .value(101.0) + .value(1.0) + .endArray() + .endArray() + .endObject() + .startObject() + .field("type", "Point") + .startArray("coordinates") + .value(102.0) + .value(2.0) + .endArray() + .endObject() + .startObject() + .field("type", "Polygon") + .startArray("coordinates") + .startArray() + .startArray() + .value(-177.0) + .value(10.0) + .endArray() + .startArray() + .value(176.0) + .value(15.0) + .endArray() + .startArray() + .value(172.0) + .value(0.0) + .endArray() + .startArray() + .value(176.0) + .value(-15.0) + .endArray() + .startArray() + .value(-177.0) + .value(-10.0) + .endArray() + .startArray() + .value(-177.0) + .value(10.0) + .endArray() + .endArray() + .endArray() + .endObject() + .endArray() + .endObject(); + + ArrayList shellCoordinates1 = new ArrayList<>(); + shellCoordinates1.add(new Coordinate(180.0, -12.142857142857142)); + shellCoordinates1.add(new Coordinate(180.0, 12.142857142857142)); + shellCoordinates1.add(new Coordinate(176.0, 15.0)); + shellCoordinates1.add(new Coordinate(172.0, 0.0)); + shellCoordinates1.add(new Coordinate(176.0, -15)); + shellCoordinates1.add(new Coordinate(180.0, -12.142857142857142)); + + ArrayList shellCoordinates2 = new ArrayList<>(); + shellCoordinates2.add(new Coordinate(-180.0, 12.142857142857142)); + shellCoordinates2.add(new Coordinate(-180.0, -12.142857142857142)); + shellCoordinates2.add(new Coordinate(-177.0, -10.0)); + shellCoordinates2.add(new Coordinate(-177.0, 10.0)); + shellCoordinates2.add(new Coordinate(-180.0, 12.142857142857142)); + + Shape[] expected = new Shape[3]; + LineString expectedLineString = GEOMETRY_FACTORY.createLineString( + new Coordinate[] { new Coordinate(100, 0), new Coordinate(101, 1), } + ); + expected[0] = jtsGeom(expectedLineString); + Point expectedPoint = GEOMETRY_FACTORY.createPoint(new Coordinate(102.0, 2.0)); + expected[1] = new JtsPoint(expectedPoint, SPATIAL_CONTEXT); + LinearRing shell1 = GEOMETRY_FACTORY.createLinearRing(shellCoordinates1.toArray(new Coordinate[shellCoordinates1.size()])); + LinearRing shell2 = GEOMETRY_FACTORY.createLinearRing(shellCoordinates2.toArray(new Coordinate[shellCoordinates2.size()])); + MultiPolygon expectedMultiPoly = GEOMETRY_FACTORY.createMultiPolygon( + new Polygon[] { GEOMETRY_FACTORY.createPolygon(shell1), GEOMETRY_FACTORY.createPolygon(shell2) } + ); + expected[2] = jtsGeom(expectedMultiPoly); + + // equals returns true only if geometries are in the same order + assertGeometryEquals(shapeCollection(expected), geometryCollectionGeoJson, true); + + GeometryCollection geometryExpected = new GeometryCollection<>( + Arrays.asList( + new Line(new double[] { 100d, 101d }, new double[] { 0d, 1d }), + new org.elasticsearch.geometry.Point(102d, 2d), + new org.elasticsearch.geometry.MultiPolygon( + Arrays.asList( + new org.elasticsearch.geometry.Polygon( + new org.elasticsearch.geometry.LinearRing( + new double[] { 180d, 180d, 176d, 172d, 176d, 180d }, + new double[] { -12.142857142857142d, 12.142857142857142d, 15d, 0d, -15d, -12.142857142857142d } + ) + ), + new org.elasticsearch.geometry.Polygon( + new org.elasticsearch.geometry.LinearRing( + new double[] { -180d, -180d, -177d, -177d, -180d }, + new double[] { 12.142857142857142d, -12.142857142857142d, -10d, 10d, 12.142857142857142d } + ) + ) + ) + ) + ) + ); + assertGeometryEquals(geometryExpected, geometryCollectionGeoJson, false); + } + + public void testThatParserExtractsCorrectTypeAndCoordinatesFromArbitraryJson() throws IOException, ParseException { + XContentBuilder pointGeoJson = XContentFactory.jsonBuilder() + .startObject() + .startObject("crs") + .field("type", "name") + .startObject("properties") + .field("name", "urn:ogc:def:crs:OGC:1.3:CRS84") + .endObject() + .endObject() + .field("bbox", "foobar") + .field("type", "point") + .field("bubu", "foobar") + .startArray("coordinates") + .value(100.0) + .value(0.0) + .endArray() + .startObject("nested") + .startArray("coordinates") + .value(200.0) + .value(0.0) + .endArray() + .endObject() + .startObject("lala") + .field("type", "NotAPoint") + .endObject() + .endObject(); + Point expected = GEOMETRY_FACTORY.createPoint(new Coordinate(100.0, 0.0)); + assertGeometryEquals(new JtsPoint(expected, SPATIAL_CONTEXT), pointGeoJson, true); + + org.elasticsearch.geometry.Point expectedPt = new org.elasticsearch.geometry.Point(100, 0); + assertGeometryEquals(expectedPt, pointGeoJson, false); + } + + public void testParseOrientationOption() throws IOException, ParseException { + // test 1: valid ccw (right handed system) poly not crossing dateline (with 'right' field) + XContentBuilder polygonGeoJson = XContentFactory.jsonBuilder() + .startObject() + .field("type", "Polygon") + .field("orientation", "right") + .startArray("coordinates") + .startArray() + .startArray() + .value(176.0) + .value(15.0) + .endArray() + .startArray() + .value(-177.0) + .value(10.0) + .endArray() + .startArray() + .value(-177.0) + .value(-10.0) + .endArray() + .startArray() + .value(176.0) + .value(-15.0) + .endArray() + .startArray() + .value(172.0) + .value(0.0) + .endArray() + .startArray() + .value(176.0) + .value(15.0) + .endArray() + .endArray() + .startArray() + .startArray() + .value(-172.0) + .value(8.0) + .endArray() + .startArray() + .value(174.0) + .value(10.0) + .endArray() + .startArray() + .value(-172.0) + .value(-8.0) + .endArray() + .startArray() + .value(-172.0) + .value(8.0) + .endArray() + .endArray() + .endArray() + .endObject(); + + try (XContentParser parser = createParser(polygonGeoJson)) { + parser.nextToken(); + Shape shape = ShapeParser.parse(parser).buildS4J(); + ElasticsearchGeoAssertions.assertPolygon(shape, true); + } + + try (XContentParser parser = createParser(polygonGeoJson)) { + parser.nextToken(); + ElasticsearchGeoAssertions.assertPolygon(parse(parser), false); + } + + // test 2: valid ccw (right handed system) poly not crossing dateline (with 'ccw' field) + polygonGeoJson = XContentFactory.jsonBuilder() + .startObject() + .field("type", "Polygon") + .field("orientation", "ccw") + .startArray("coordinates") + .startArray() + .startArray() + .value(176.0) + .value(15.0) + .endArray() + .startArray() + .value(-177.0) + .value(10.0) + .endArray() + .startArray() + .value(-177.0) + .value(-10.0) + .endArray() + .startArray() + .value(176.0) + .value(-15.0) + .endArray() + .startArray() + .value(172.0) + .value(0.0) + .endArray() + .startArray() + .value(176.0) + .value(15.0) + .endArray() + .endArray() + .startArray() + .startArray() + .value(-172.0) + .value(8.0) + .endArray() + .startArray() + .value(174.0) + .value(10.0) + .endArray() + .startArray() + .value(-172.0) + .value(-8.0) + .endArray() + .startArray() + .value(-172.0) + .value(8.0) + .endArray() + .endArray() + .endArray() + .endObject(); + + try (XContentParser parser = createParser(polygonGeoJson)) { + parser.nextToken(); + Shape shape = ShapeParser.parse(parser).buildS4J(); + ElasticsearchGeoAssertions.assertPolygon(shape, true); + } + + try (XContentParser parser = createParser(polygonGeoJson)) { + parser.nextToken(); + ElasticsearchGeoAssertions.assertPolygon(parse(parser), false); + } + + // test 3: valid ccw (right handed system) poly not crossing dateline (with 'counterclockwise' field) + polygonGeoJson = XContentFactory.jsonBuilder() + .startObject() + .field("type", "Polygon") + .field("orientation", "counterclockwise") + .startArray("coordinates") + .startArray() + .startArray() + .value(176.0) + .value(15.0) + .endArray() + .startArray() + .value(-177.0) + .value(10.0) + .endArray() + .startArray() + .value(-177.0) + .value(-10.0) + .endArray() + .startArray() + .value(176.0) + .value(-15.0) + .endArray() + .startArray() + .value(172.0) + .value(0.0) + .endArray() + .startArray() + .value(176.0) + .value(15.0) + .endArray() + .endArray() + .startArray() + .startArray() + .value(-172.0) + .value(8.0) + .endArray() + .startArray() + .value(174.0) + .value(10.0) + .endArray() + .startArray() + .value(-172.0) + .value(-8.0) + .endArray() + .startArray() + .value(-172.0) + .value(8.0) + .endArray() + .endArray() + .endArray() + .endObject(); + + try (XContentParser parser = createParser(polygonGeoJson)) { + parser.nextToken(); + Shape shape = ShapeParser.parse(parser).buildS4J(); + ElasticsearchGeoAssertions.assertPolygon(shape, true); + } + + try (XContentParser parser = createParser(polygonGeoJson)) { + parser.nextToken(); + ElasticsearchGeoAssertions.assertPolygon(parse(parser), false); + } + + // test 4: valid cw (left handed system) poly crossing dateline (with 'left' field) + polygonGeoJson = XContentFactory.jsonBuilder() + .startObject() + .field("type", "Polygon") + .field("orientation", "left") + .startArray("coordinates") + .startArray() + .startArray() + .value(176.0) + .value(15.0) + .endArray() + .startArray() + .value(-177.0) + .value(10.0) + .endArray() + .startArray() + .value(-177.0) + .value(-10.0) + .endArray() + .startArray() + .value(176.0) + .value(-15.0) + .endArray() + .startArray() + .value(172.0) + .value(0.0) + .endArray() + .startArray() + .value(176.0) + .value(15.0) + .endArray() + .endArray() + .startArray() + .startArray() + .value(-178.0) + .value(8.0) + .endArray() + .startArray() + .value(178.0) + .value(8.0) + .endArray() + .startArray() + .value(180.0) + .value(-8.0) + .endArray() + .startArray() + .value(-178.0) + .value(8.0) + .endArray() + .endArray() + .endArray() + .endObject(); + + try (XContentParser parser = createParser(polygonGeoJson)) { + parser.nextToken(); + Shape shape = ShapeParser.parse(parser).buildS4J(); + ElasticsearchGeoAssertions.assertMultiPolygon(shape, true); + } + + try (XContentParser parser = createParser(polygonGeoJson)) { + parser.nextToken(); + ElasticsearchGeoAssertions.assertMultiPolygon(parse(parser), false); + } + + // test 5: valid cw multipoly (left handed system) poly crossing dateline (with 'cw' field) + polygonGeoJson = XContentFactory.jsonBuilder() + .startObject() + .field("type", "Polygon") + .field("orientation", "cw") + .startArray("coordinates") + .startArray() + .startArray() + .value(176.0) + .value(15.0) + .endArray() + .startArray() + .value(-177.0) + .value(10.0) + .endArray() + .startArray() + .value(-177.0) + .value(-10.0) + .endArray() + .startArray() + .value(176.0) + .value(-15.0) + .endArray() + .startArray() + .value(172.0) + .value(0.0) + .endArray() + .startArray() + .value(176.0) + .value(15.0) + .endArray() + .endArray() + .startArray() + .startArray() + .value(-178.0) + .value(8.0) + .endArray() + .startArray() + .value(178.0) + .value(8.0) + .endArray() + .startArray() + .value(180.0) + .value(-8.0) + .endArray() + .startArray() + .value(-178.0) + .value(8.0) + .endArray() + .endArray() + .endArray() + .endObject(); + + try (XContentParser parser = createParser(polygonGeoJson)) { + parser.nextToken(); + Shape shape = ShapeParser.parse(parser).buildS4J(); + ElasticsearchGeoAssertions.assertMultiPolygon(shape, true); + } + + try (XContentParser parser = createParser(polygonGeoJson)) { + parser.nextToken(); + ElasticsearchGeoAssertions.assertMultiPolygon(parse(parser), false); + } + + // test 6: valid cw multipoly (left handed system) poly crossing dateline (with 'clockwise' field) + polygonGeoJson = XContentFactory.jsonBuilder() + .startObject() + .field("type", "Polygon") + .field("orientation", "clockwise") + .startArray("coordinates") + .startArray() + .startArray() + .value(176.0) + .value(15.0) + .endArray() + .startArray() + .value(-177.0) + .value(10.0) + .endArray() + .startArray() + .value(-177.0) + .value(-10.0) + .endArray() + .startArray() + .value(176.0) + .value(-15.0) + .endArray() + .startArray() + .value(172.0) + .value(0.0) + .endArray() + .startArray() + .value(176.0) + .value(15.0) + .endArray() + .endArray() + .startArray() + .startArray() + .value(-178.0) + .value(8.0) + .endArray() + .startArray() + .value(178.0) + .value(8.0) + .endArray() + .startArray() + .value(180.0) + .value(-8.0) + .endArray() + .startArray() + .value(-178.0) + .value(8.0) + .endArray() + .endArray() + .endArray() + .endObject(); + + try (XContentParser parser = createParser(polygonGeoJson)) { + parser.nextToken(); + Shape shape = ShapeParser.parse(parser).buildS4J(); + ElasticsearchGeoAssertions.assertMultiPolygon(shape, true); + } + + try (XContentParser parser = createParser(polygonGeoJson)) { + parser.nextToken(); + ElasticsearchGeoAssertions.assertMultiPolygon(parse(parser), false); + } + } + + public void testParseInvalidShapes() throws IOException { + // single dimensions point + XContentBuilder tooLittlePointGeoJson = XContentFactory.jsonBuilder() + .startObject() + .field("type", "Point") + .startArray("coordinates") + .value(10.0) + .endArray() + .endObject(); + + try (XContentParser parser = createParser(tooLittlePointGeoJson)) { + parser.nextToken(); + ElasticsearchGeoAssertions.assertValidException(parser, ElasticsearchParseException.class); + assertNull(parser.nextToken()); + } + + // zero dimensions point + XContentBuilder emptyPointGeoJson = XContentFactory.jsonBuilder() + .startObject() + .field("type", "Point") + .startObject("coordinates") + .field("foo", "bar") + .endObject() + .endObject(); + + try (XContentParser parser = createParser(emptyPointGeoJson)) { + parser.nextToken(); + ElasticsearchGeoAssertions.assertValidException(parser, ElasticsearchParseException.class); + assertNull(parser.nextToken()); + } + } + + public void testParseInvalidGeometryCollectionShapes() throws IOException { + // single dimensions point + XContentBuilder invalidPoints = XContentFactory.jsonBuilder() + .startObject() + .startObject("foo") + .field("type", "geometrycollection") + .startArray("geometries") + .startObject() + .field("type", "polygon") + .startArray("coordinates") + .startArray() + .value("46.6022226498514") + .value("24.7237442867977") + .endArray() + .startArray() + .value("46.6031857243798") + .value("24.722968774929") + .endArray() + .endArray() // coordinates + .endObject() + .endArray() // geometries + .endObject() + .endObject(); + try (XContentParser parser = createParser(invalidPoints)) { + parser.nextToken(); // foo + parser.nextToken(); // start object + parser.nextToken(); // start object + ElasticsearchGeoAssertions.assertValidException(parser, ElasticsearchParseException.class); + assertEquals(XContentParser.Token.END_OBJECT, parser.nextToken()); // end of the document + assertNull(parser.nextToken()); // no more elements afterwards + } + } + + public Geometry parse(XContentParser parser) throws IOException, ParseException { + GeometryParser geometryParser = new GeometryParser(true, true, true); + GeoShapeIndexer indexer = new GeoShapeIndexer(true, "name"); + return indexer.prepareForIndexing(geometryParser.parse(parser)); + } +} diff --git a/server/src/test/java/org/elasticsearch/common/geo/GeoWKTShapeParserTests.java b/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/GeoWKTShapeParserTests.java similarity index 83% rename from server/src/test/java/org/elasticsearch/common/geo/GeoWKTShapeParserTests.java rename to modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/GeoWKTShapeParserTests.java index f71acedd94907..4b77f0bcc5033 100644 --- a/server/src/test/java/org/elasticsearch/common/geo/GeoWKTShapeParserTests.java +++ b/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/GeoWKTShapeParserTests.java @@ -5,24 +5,13 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -package org.elasticsearch.common.geo; +package org.elasticsearch.legacygeo; import org.apache.lucene.geo.GeoTestUtil; import org.elasticsearch.ElasticsearchException; import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.Version; -import org.elasticsearch.common.geo.builders.CoordinatesBuilder; -import org.elasticsearch.common.geo.builders.EnvelopeBuilder; -import org.elasticsearch.common.geo.builders.GeometryCollectionBuilder; -import org.elasticsearch.common.geo.builders.LineStringBuilder; -import org.elasticsearch.common.geo.builders.MultiLineStringBuilder; -import org.elasticsearch.common.geo.builders.MultiPointBuilder; -import org.elasticsearch.common.geo.builders.MultiPolygonBuilder; -import org.elasticsearch.common.geo.builders.PointBuilder; -import org.elasticsearch.common.geo.builders.PolygonBuilder; -import org.elasticsearch.common.geo.builders.ShapeBuilder; -import org.elasticsearch.common.geo.parsers.GeoWKTParser; -import org.elasticsearch.common.geo.parsers.ShapeParser; +import org.elasticsearch.common.geo.GeoPoint; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentParser; @@ -31,12 +20,23 @@ import org.elasticsearch.geometry.Line; import org.elasticsearch.geometry.MultiLine; import org.elasticsearch.geometry.MultiPoint; -import org.elasticsearch.index.mapper.GeoShapeFieldMapper; import org.elasticsearch.index.mapper.GeoShapeIndexer; -import org.elasticsearch.index.mapper.LegacyGeoShapeFieldMapper; import org.elasticsearch.index.mapper.MapperBuilderContext; +import org.elasticsearch.legacygeo.builders.CoordinatesBuilder; +import org.elasticsearch.legacygeo.builders.EnvelopeBuilder; +import org.elasticsearch.legacygeo.builders.GeometryCollectionBuilder; +import org.elasticsearch.legacygeo.builders.LineStringBuilder; +import org.elasticsearch.legacygeo.builders.MultiLineStringBuilder; +import org.elasticsearch.legacygeo.builders.MultiPointBuilder; +import org.elasticsearch.legacygeo.builders.MultiPolygonBuilder; +import org.elasticsearch.legacygeo.builders.PointBuilder; +import org.elasticsearch.legacygeo.builders.PolygonBuilder; +import org.elasticsearch.legacygeo.builders.ShapeBuilder; +import org.elasticsearch.legacygeo.mapper.LegacyGeoShapeFieldMapper; +import org.elasticsearch.legacygeo.parsers.GeoWKTParser; +import org.elasticsearch.legacygeo.parsers.ShapeParser; +import org.elasticsearch.legacygeo.test.RandomShapeGenerator; import org.elasticsearch.test.VersionUtils; -import org.elasticsearch.test.geo.RandomShapeGenerator; import org.locationtech.jts.geom.Coordinate; import org.locationtech.jts.geom.LineString; import org.locationtech.jts.geom.LinearRing; @@ -56,7 +56,7 @@ import java.util.Collections; import java.util.List; -import static org.elasticsearch.common.geo.builders.ShapeBuilder.SPATIAL_CONTEXT; +import static org.elasticsearch.legacygeo.builders.ShapeBuilder.SPATIAL_CONTEXT; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.hasToString; @@ -65,8 +65,7 @@ */ public class GeoWKTShapeParserTests extends BaseGeoParsingTestCase { - private static XContentBuilder toWKTContent(ShapeBuilder builder, boolean generateMalformed) - throws IOException { + private static XContentBuilder toWKTContent(ShapeBuilder builder, boolean generateMalformed) throws IOException { String wkt = builder.toWKT(); if (generateMalformed) { // malformed - extra paren @@ -173,7 +172,7 @@ public void testParseMultiLineString() throws IOException, ParseException { MultiLineStringBuilder builder = new MultiLineStringBuilder(); for (int j = 0; j < numLineStrings; ++j) { List lsc = randomLineStringCoords(); - Coordinate [] coords = lsc.toArray(new Coordinate[lsc.size()]); + Coordinate[] coords = lsc.toArray(new Coordinate[lsc.size()]); lineStrings.add(GEOMETRY_FACTORY.createLineString(coords)); builder.linestring(new LineStringBuilder(lsc)); } @@ -181,8 +180,7 @@ public void testParseMultiLineString() throws IOException, ParseException { List lines = new ArrayList<>(lineStrings.size()); for (int j = 0; j < lineStrings.size(); ++j) { Coordinate[] c = lineStrings.get(j).getCoordinates(); - lines.add(new Line(Arrays.stream(c).mapToDouble(i->i.x).toArray(), Arrays.stream(c).mapToDouble(i->i.y).toArray() - )); + lines.add(new Line(Arrays.stream(c).mapToDouble(i -> i.x).toArray(), Arrays.stream(c).mapToDouble(i -> i.y).toArray())); } Geometry expectedGeom; if (lines.isEmpty()) { @@ -195,8 +193,7 @@ public void testParseMultiLineString() throws IOException, ParseException { assertExpected(expectedGeom, builder, false); assertMalformed(builder); - MultiLineString expected = GEOMETRY_FACTORY.createMultiLineString( - lineStrings.toArray(new LineString[lineStrings.size()])); + MultiLineString expected = GEOMETRY_FACTORY.createMultiLineString(lineStrings.toArray(new LineString[lineStrings.size()])); assumeTrue("JTS test path cannot handle empty multilinestrings", numLineStrings > 1); assertExpected(jtsGeom(expected), builder, true); } @@ -204,7 +201,8 @@ public void testParseMultiLineString() throws IOException, ParseException { @Override public void testParsePolygon() throws IOException, ParseException { PolygonBuilder builder = PolygonBuilder.class.cast( - RandomShapeGenerator.createShape(random(), RandomShapeGenerator.ShapeType.POLYGON)); + RandomShapeGenerator.createShape(random(), RandomShapeGenerator.ShapeType.POLYGON) + ); Coordinate[] coords = builder.coordinates()[0][0]; LinearRing shell = GEOMETRY_FACTORY.createLinearRing(coords); @@ -253,20 +251,20 @@ public void testParsePolygonWithHole() throws IOException, ParseException { PolygonBuilder polygonWithHole = new PolygonBuilder(new CoordinatesBuilder().coordinates(shellCoordinates)); polygonWithHole.hole(new LineStringBuilder(holeCoordinates)); - LinearRing shell = GEOMETRY_FACTORY.createLinearRing( - shellCoordinates.toArray(new Coordinate[shellCoordinates.size()])); + LinearRing shell = GEOMETRY_FACTORY.createLinearRing(shellCoordinates.toArray(new Coordinate[shellCoordinates.size()])); LinearRing[] holes = new LinearRing[1]; - holes[0] = GEOMETRY_FACTORY.createLinearRing( - holeCoordinates.toArray(new Coordinate[holeCoordinates.size()])); + holes[0] = GEOMETRY_FACTORY.createLinearRing(holeCoordinates.toArray(new Coordinate[holeCoordinates.size()])); Polygon expected = GEOMETRY_FACTORY.createPolygon(shell, holes); assertExpected(jtsGeom(expected), polygonWithHole, true); - org.elasticsearch.geometry.LinearRing hole = - new org.elasticsearch.geometry.LinearRing( - new double[] {100.2d, 100.8d, 100.8d, 100.2d, 100.2d}, new double[] {0.8d, 0.8d, 0.2d, 0.2d, 0.8d}); - org.elasticsearch.geometry.Polygon p = - new org.elasticsearch.geometry.Polygon(new org.elasticsearch.geometry.LinearRing( - new double[] {101d, 101d, 100d, 100d, 101d}, new double[] {0d, 1d, 1d, 0d, 0d}), Collections.singletonList(hole)); + org.elasticsearch.geometry.LinearRing hole = new org.elasticsearch.geometry.LinearRing( + new double[] { 100.2d, 100.8d, 100.8d, 100.2d, 100.2d }, + new double[] { 0.8d, 0.8d, 0.2d, 0.2d, 0.8d } + ); + org.elasticsearch.geometry.Polygon p = new org.elasticsearch.geometry.Polygon( + new org.elasticsearch.geometry.LinearRing(new double[] { 101d, 101d, 100d, 100d, 101d }, new double[] { 0d, 1d, 1d, 0d, 0d }), + Collections.singletonList(hole) + ); assertExpected(p, polygonWithHole, false); assertMalformed(polygonWithHole); } @@ -294,14 +292,13 @@ public void testParseMixedDimensionPolyWithHole() throws IOException, ParseExcep XContentParser parser = createParser(xContentBuilder); parser.nextToken(); - final GeoShapeFieldMapper mapperBuilder = new GeoShapeFieldMapper.Builder("test", false, true) - .ignoreZValue(false) - .build(MapperBuilderContext.ROOT); + final LegacyGeoShapeFieldMapper mapperBuilder = new LegacyGeoShapeFieldMapper.Builder("test", Version.CURRENT, false, true).build( + MapperBuilderContext.ROOT + ); // test store z disabled - ElasticsearchParseException e = expectThrows(ElasticsearchParseException.class, - () -> ShapeParser.parse(parser, mapperBuilder)); - assertThat(e, hasToString(containsString("but [ignore_z_value] parameter is [false]"))); + ElasticsearchException e = expectThrows(ElasticsearchException.class, () -> ShapeParser.parse(parser, mapperBuilder)); + assertThat(e, hasToString(containsString("coordinate dimensions do not match"))); } public void testParseMixedDimensionPolyWithHoleStoredZ() throws IOException { @@ -328,13 +325,12 @@ public void testParseMixedDimensionPolyWithHoleStoredZ() throws IOException { parser.nextToken(); final Version version = VersionUtils.randomPreviousCompatibleVersion(random(), Version.V_8_0_0); - final LegacyGeoShapeFieldMapper mapperBuilder = - new LegacyGeoShapeFieldMapper.Builder("test", version, false, true) - .build(MapperBuilderContext.ROOT); + final LegacyGeoShapeFieldMapper mapperBuilder = new LegacyGeoShapeFieldMapper.Builder("test", version, false, true).build( + MapperBuilderContext.ROOT + ); // test store z disabled - ElasticsearchException e = expectThrows(ElasticsearchException.class, - () -> ShapeParser.parse(parser, mapperBuilder)); + ElasticsearchException e = expectThrows(ElasticsearchException.class, () -> ShapeParser.parse(parser, mapperBuilder)); assertThat(e, hasToString(containsString("unable to add coordinate to CoordinateBuilder: coordinate dimensions do not match"))); } @@ -353,9 +349,9 @@ public void testParsePolyWithStoredZ() throws IOException { parser.nextToken(); final Version version = VersionUtils.randomPreviousCompatibleVersion(random(), Version.V_8_0_0); - final LegacyGeoShapeFieldMapper mapperBuilder = - new LegacyGeoShapeFieldMapper.Builder("test", version, false, true) - .build(MapperBuilderContext.ROOT); + final LegacyGeoShapeFieldMapper mapperBuilder = new LegacyGeoShapeFieldMapper.Builder("test", version, false, true).build( + MapperBuilderContext.ROOT + ); ShapeBuilder shapeBuilder = ShapeParser.parse(parser, mapperBuilder); assertEquals(shapeBuilder.numDimensions(), 3); @@ -369,16 +365,18 @@ public void testParseOpenPolygon() throws IOException { parser.nextToken(); final Version version = VersionUtils.randomPreviousCompatibleVersion(random(), Version.V_8_0_0); - final LegacyGeoShapeFieldMapper defaultMapperBuilder = - new LegacyGeoShapeFieldMapper.Builder("test", version, false, true) - .coerce(false).build(MapperBuilderContext.ROOT); - ElasticsearchParseException exception = expectThrows(ElasticsearchParseException.class, - () -> ShapeParser.parse(parser, defaultMapperBuilder)); + final LegacyGeoShapeFieldMapper defaultMapperBuilder = new LegacyGeoShapeFieldMapper.Builder("test", version, false, true).coerce( + false + ).build(MapperBuilderContext.ROOT); + ElasticsearchParseException exception = expectThrows( + ElasticsearchParseException.class, + () -> ShapeParser.parse(parser, defaultMapperBuilder) + ); assertEquals("invalid LinearRing found (coordinates are not closed)", exception.getMessage()); - final LegacyGeoShapeFieldMapper coercingMapperBuilder = - new LegacyGeoShapeFieldMapper.Builder("test", Version.CURRENT, false, true) - .coerce(true).build(MapperBuilderContext.ROOT); + final LegacyGeoShapeFieldMapper coercingMapperBuilder = new LegacyGeoShapeFieldMapper.Builder("test", Version.CURRENT, false, true) + .coerce(true) + .build(MapperBuilderContext.ROOT); ShapeBuilder shapeBuilder = ShapeParser.parse(parser, coercingMapperBuilder); assertNotNull(shapeBuilder); assertEquals("polygon ((100.0 5.0, 100.0 10.0, 90.0 10.0, 90.0 5.0, 100.0 5.0))", shapeBuilder.toWKT()); @@ -445,8 +443,10 @@ public void testUnexpectedShapeException() throws IOException { XContentBuilder builder = toWKTContent(new PointBuilder(-1, 2), false); XContentParser parser = createParser(builder); parser.nextToken(); - ElasticsearchParseException e = expectThrows(ElasticsearchParseException.class, - () -> GeoWKTParser.parseExpectedType(parser, GeoShapeType.POLYGON)); + ElasticsearchParseException e = expectThrows( + ElasticsearchParseException.class, + () -> GeoWKTParser.parseExpectedType(parser, GeoShapeType.POLYGON) + ); assertThat(e, hasToString(containsString("Expected geometry type [polygon] but found [point]"))); } } diff --git a/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/GeometryIOTests.java b/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/GeometryIOTests.java new file mode 100644 index 0000000000000..2d484c73526a5 --- /dev/null +++ b/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/GeometryIOTests.java @@ -0,0 +1,96 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.legacygeo; + +import org.elasticsearch.common.geo.GeometryIO; +import org.elasticsearch.common.io.stream.BytesStreamOutput; +import org.elasticsearch.common.io.stream.NamedWriteableAwareStreamInput; +import org.elasticsearch.common.io.stream.NamedWriteableRegistry; +import org.elasticsearch.common.io.stream.StreamInput; +import org.elasticsearch.geometry.Geometry; +import org.elasticsearch.geometry.GeometryCollection; +import org.elasticsearch.geometry.ShapeType; +import org.elasticsearch.legacygeo.builders.ShapeBuilder; +import org.elasticsearch.test.ESTestCase; + +import static org.elasticsearch.geo.GeometryTestUtils.randomGeometry; +import static org.elasticsearch.legacygeo.query.LegacyGeoShapeQueryProcessor.geometryToShapeBuilder; + +public class GeometryIOTests extends ESTestCase { + + public void testRandomSerialization() throws Exception { + for (int i = 0; i < randomIntBetween(1, 20); i++) { + boolean hasAlt = randomBoolean(); + Geometry geometry = randomGeometry(hasAlt); + if (shapeSupported(geometry) && randomBoolean()) { + // Shape builder conversion doesn't support altitude + ShapeBuilder shapeBuilder = geometryToShapeBuilder(geometry); + if (randomBoolean()) { + Geometry actual = shapeBuilder.buildGeometry(); + assertEquals(geometry, actual); + } + if (randomBoolean()) { + // Test ShapeBuilder -> Geometry Serialization + try (BytesStreamOutput out = new BytesStreamOutput()) { + out.writeNamedWriteable(shapeBuilder); + try (StreamInput in = out.bytes().streamInput()) { + Geometry actual = GeometryIO.readGeometry(in); + assertEquals(geometry, actual); + assertEquals(0, in.available()); + } + } + } else { + // Test Geometry -> ShapeBuilder Serialization + try (BytesStreamOutput out = new BytesStreamOutput()) { + GeometryIO.writeGeometry(out, geometry); + try (StreamInput in = out.bytes().streamInput()) { + try (StreamInput nin = new NamedWriteableAwareStreamInput(in, this.writableRegistry())) { + ShapeBuilder actual = nin.readNamedWriteable(ShapeBuilder.class); + assertEquals(shapeBuilder, actual); + assertEquals(0, in.available()); + } + } + } + } + // Test Geometry -> Geometry + try (BytesStreamOutput out = new BytesStreamOutput()) { + GeometryIO.writeGeometry(out, geometry); + ; + try (StreamInput in = out.bytes().streamInput()) { + Geometry actual = GeometryIO.readGeometry(in); + assertEquals(geometry, actual); + assertEquals(0, in.available()); + } + } + + } + } + } + + private boolean shapeSupported(Geometry geometry) { + if (geometry.hasZ()) { + return false; + } + + if (geometry.type() == ShapeType.GEOMETRYCOLLECTION) { + GeometryCollection collection = (GeometryCollection) geometry; + for (Geometry g : collection) { + if (shapeSupported(g) == false) { + return false; + } + } + } + return true; + } + + @Override + protected NamedWriteableRegistry writableRegistry() { + return new NamedWriteableRegistry(GeoShapeType.getShapeWriteables()); + } +} diff --git a/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/ShapeBuilderTests.java b/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/ShapeBuilderTests.java new file mode 100644 index 0000000000000..c2dec52d636a4 --- /dev/null +++ b/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/ShapeBuilderTests.java @@ -0,0 +1,805 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.legacygeo; + +import org.elasticsearch.geometry.LinearRing; +import org.elasticsearch.index.mapper.GeoShapeIndexer; +import org.elasticsearch.legacygeo.builders.CircleBuilder; +import org.elasticsearch.legacygeo.builders.CoordinatesBuilder; +import org.elasticsearch.legacygeo.builders.EnvelopeBuilder; +import org.elasticsearch.legacygeo.builders.LineStringBuilder; +import org.elasticsearch.legacygeo.builders.MultiLineStringBuilder; +import org.elasticsearch.legacygeo.builders.PointBuilder; +import org.elasticsearch.legacygeo.builders.PolygonBuilder; +import org.elasticsearch.legacygeo.builders.ShapeBuilder; +import org.elasticsearch.legacygeo.test.ElasticsearchGeoAssertions; +import org.elasticsearch.test.ESTestCase; +import org.locationtech.jts.geom.Coordinate; +import org.locationtech.jts.geom.LineString; +import org.locationtech.jts.geom.Polygon; +import org.locationtech.spatial4j.exception.InvalidShapeException; +import org.locationtech.spatial4j.shape.Circle; +import org.locationtech.spatial4j.shape.Point; +import org.locationtech.spatial4j.shape.Rectangle; +import org.locationtech.spatial4j.shape.impl.PointImpl; + +import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.not; + +/** + * Tests for {@link ShapeBuilder} + */ +public class ShapeBuilderTests extends ESTestCase { + + public void testNewPoint() { + PointBuilder pb = new PointBuilder().coordinate(-100, 45); + Point point = pb.buildS4J(); + assertEquals(-100D, point.getX(), 0.0d); + assertEquals(45D, point.getY(), 0.0d); + org.elasticsearch.geometry.Point geoPoint = pb.buildGeometry(); + assertEquals(-100D, geoPoint.getX(), 0.0d); + assertEquals(45D, geoPoint.getY(), 0.0d); + } + + public void testNewRectangle() { + EnvelopeBuilder eb = new EnvelopeBuilder(new Coordinate(-45, 30), new Coordinate(45, -30)); + Rectangle rectangle = eb.buildS4J(); + assertEquals(-45D, rectangle.getMinX(), 0.0d); + assertEquals(-30D, rectangle.getMinY(), 0.0d); + assertEquals(45D, rectangle.getMaxX(), 0.0d); + assertEquals(30D, rectangle.getMaxY(), 0.0d); + + org.elasticsearch.geometry.Rectangle luceneRectangle = eb.buildGeometry(); + assertEquals(-45D, luceneRectangle.getMinX(), 0.0d); + assertEquals(-30D, luceneRectangle.getMinY(), 0.0d); + assertEquals(45D, luceneRectangle.getMaxX(), 0.0d); + assertEquals(30D, luceneRectangle.getMaxY(), 0.0d); + } + + public void testNewPolygon() { + PolygonBuilder pb = new PolygonBuilder( + new CoordinatesBuilder().coordinate(-45, 30).coordinate(45, 30).coordinate(45, -30).coordinate(-45, -30).coordinate(-45, 30) + ); + + Polygon poly = pb.toPolygonS4J(); + LineString exterior = poly.getExteriorRing(); + assertEquals(exterior.getCoordinateN(0), new Coordinate(-45, 30)); + assertEquals(exterior.getCoordinateN(1), new Coordinate(45, 30)); + assertEquals(exterior.getCoordinateN(2), new Coordinate(45, -30)); + assertEquals(exterior.getCoordinateN(3), new Coordinate(-45, -30)); + + LinearRing polygon = pb.toPolygonGeometry().getPolygon(); + assertEquals(polygon.getY(0), 30, 0d); + assertEquals(polygon.getX(0), -45, 0d); + assertEquals(polygon.getY(1), 30, 0d); + assertEquals(polygon.getX(1), 45, 0d); + assertEquals(polygon.getY(2), -30, 0d); + assertEquals(polygon.getX(2), 45, 0d); + assertEquals(polygon.getY(3), -30, 0d); + assertEquals(polygon.getX(3), -45, 0d); + } + + public void testNewPolygon_coordinate() { + PolygonBuilder pb = new PolygonBuilder( + new CoordinatesBuilder().coordinate(new Coordinate(-45, 30)) + .coordinate(new Coordinate(45, 30)) + .coordinate(new Coordinate(45, -30)) + .coordinate(new Coordinate(-45, -30)) + .coordinate(new Coordinate(-45, 30)) + ); + + Polygon poly = pb.toPolygonS4J(); + LineString exterior = poly.getExteriorRing(); + assertEquals(exterior.getCoordinateN(0), new Coordinate(-45, 30)); + assertEquals(exterior.getCoordinateN(1), new Coordinate(45, 30)); + assertEquals(exterior.getCoordinateN(2), new Coordinate(45, -30)); + assertEquals(exterior.getCoordinateN(3), new Coordinate(-45, -30)); + + LinearRing polygon = pb.toPolygonGeometry().getPolygon(); + assertEquals(polygon.getY(0), 30, 0d); + assertEquals(polygon.getX(0), -45, 0d); + assertEquals(polygon.getY(1), 30, 0d); + assertEquals(polygon.getX(1), 45, 0d); + assertEquals(polygon.getY(2), -30, 0d); + assertEquals(polygon.getX(2), 45, 0d); + assertEquals(polygon.getY(3), -30, 0d); + assertEquals(polygon.getX(3), -45, 0d); + } + + public void testNewPolygon_coordinates() { + PolygonBuilder pb = new PolygonBuilder( + new CoordinatesBuilder().coordinates( + new Coordinate(-45, 30), + new Coordinate(45, 30), + new Coordinate(45, -30), + new Coordinate(-45, -30), + new Coordinate(-45, 30) + ) + ); + + Polygon poly = pb.toPolygonS4J(); + LineString exterior = poly.getExteriorRing(); + assertEquals(exterior.getCoordinateN(0), new Coordinate(-45, 30)); + assertEquals(exterior.getCoordinateN(1), new Coordinate(45, 30)); + assertEquals(exterior.getCoordinateN(2), new Coordinate(45, -30)); + assertEquals(exterior.getCoordinateN(3), new Coordinate(-45, -30)); + + LinearRing polygon = pb.toPolygonGeometry().getPolygon(); + assertEquals(polygon.getY(0), 30, 0d); + assertEquals(polygon.getX(0), -45, 0d); + assertEquals(polygon.getY(1), 30, 0d); + assertEquals(polygon.getX(1), 45, 0d); + assertEquals(polygon.getY(2), -30, 0d); + assertEquals(polygon.getX(2), 45, 0d); + assertEquals(polygon.getY(3), -30, 0d); + assertEquals(polygon.getX(3), -45, 0d); + } + + public void testLineStringBuilder() { + // Building a simple LineString + LineStringBuilder lsb = new LineStringBuilder( + new CoordinatesBuilder().coordinate(-130.0, 55.0) + .coordinate(-130.0, -40.0) + .coordinate(-15.0, -40.0) + .coordinate(-20.0, 50.0) + .coordinate(-45.0, 50.0) + .coordinate(-45.0, -15.0) + .coordinate(-110.0, -15.0) + .coordinate(-110.0, 55.0) + ); + + lsb.buildS4J(); + buildGeometry(lsb); + + // Building a linestring that needs to be wrapped + lsb = new LineStringBuilder( + new CoordinatesBuilder().coordinate(100.0, 50.0) + .coordinate(110.0, -40.0) + .coordinate(240.0, -40.0) + .coordinate(230.0, 60.0) + .coordinate(200.0, 60.0) + .coordinate(200.0, -30.0) + .coordinate(130.0, -30.0) + .coordinate(130.0, 60.0) + ); + + lsb.buildS4J(); + buildGeometry(lsb); + + // Building a lineString on the dateline + lsb = new LineStringBuilder( + new CoordinatesBuilder().coordinate(-180.0, 80.0).coordinate(-180.0, 40.0).coordinate(-180.0, -40.0).coordinate(-180.0, -80.0) + ); + + lsb.buildS4J(); + buildGeometry(lsb); + + // Building a lineString on the dateline + lsb = new LineStringBuilder( + new CoordinatesBuilder().coordinate(180.0, 80.0).coordinate(180.0, 40.0).coordinate(180.0, -40.0).coordinate(180.0, -80.0) + ); + + lsb.buildS4J(); + buildGeometry(lsb); + } + + public void testMultiLineString() { + MultiLineStringBuilder mlsb = new MultiLineStringBuilder().linestring( + new LineStringBuilder( + new CoordinatesBuilder().coordinate(-100.0, 50.0).coordinate(50.0, 50.0).coordinate(50.0, 20.0).coordinate(-100.0, 20.0) + ) + ) + .linestring( + new LineStringBuilder( + new CoordinatesBuilder().coordinate(-100.0, 20.0).coordinate(50.0, 20.0).coordinate(50.0, 0.0).coordinate(-100.0, 0.0) + ) + ); + mlsb.buildS4J(); + buildGeometry(mlsb); + + // LineString that needs to be wrapped + new MultiLineStringBuilder().linestring( + new LineStringBuilder( + new CoordinatesBuilder().coordinate(150.0, 60.0).coordinate(200.0, 60.0).coordinate(200.0, 40.0).coordinate(150.0, 40.0) + ) + ) + .linestring( + new LineStringBuilder( + new CoordinatesBuilder().coordinate(150.0, 20.0).coordinate(200.0, 20.0).coordinate(200.0, 0.0).coordinate(150.0, 0.0) + ) + ); + + mlsb.buildS4J(); + buildGeometry(mlsb); + } + + public void testPolygonSelfIntersection() { + PolygonBuilder newPolygon = new PolygonBuilder( + new CoordinatesBuilder().coordinate(-40.0, 50.0).coordinate(40.0, 50.0).coordinate(-40.0, -50.0).coordinate(40.0, -50.0).close() + ); + Exception e = expectThrows(InvalidShapeException.class, () -> newPolygon.buildS4J()); + assertThat(e.getMessage(), containsString("Cannot determine orientation: signed area equal to 0")); + } + + /** note: only supported by S4J at the moment */ + public void testGeoCircle() { + double earthCircumference = 40075016.69; + Circle circle = new CircleBuilder().center(0, 0).radius("100m").buildS4J(); + assertEquals((360 * 100) / earthCircumference, circle.getRadius(), 0.00000001); + assertEquals(new PointImpl(0, 0, ShapeBuilder.SPATIAL_CONTEXT), circle.getCenter()); + circle = new CircleBuilder().center(+180, 0).radius("100m").buildS4J(); + assertEquals((360 * 100) / earthCircumference, circle.getRadius(), 0.00000001); + assertEquals(new PointImpl(180, 0, ShapeBuilder.SPATIAL_CONTEXT), circle.getCenter()); + circle = new CircleBuilder().center(-180, 0).radius("100m").buildS4J(); + assertEquals((360 * 100) / earthCircumference, circle.getRadius(), 0.00000001); + assertEquals(new PointImpl(-180, 0, ShapeBuilder.SPATIAL_CONTEXT), circle.getCenter()); + circle = new CircleBuilder().center(0, 90).radius("100m").buildS4J(); + assertEquals((360 * 100) / earthCircumference, circle.getRadius(), 0.00000001); + assertEquals(new PointImpl(0, 90, ShapeBuilder.SPATIAL_CONTEXT), circle.getCenter()); + circle = new CircleBuilder().center(0, -90).radius("100m").buildS4J(); + assertEquals((360 * 100) / earthCircumference, circle.getRadius(), 0.00000001); + assertEquals(new PointImpl(0, -90, ShapeBuilder.SPATIAL_CONTEXT), circle.getCenter()); + double randomLat = (randomDouble() * 180) - 90; + double randomLon = (randomDouble() * 360) - 180; + double randomRadius = randomIntBetween(1, (int) earthCircumference / 4); + circle = new CircleBuilder().center(randomLon, randomLat).radius(randomRadius + "m").buildS4J(); + assertEquals((360 * randomRadius) / earthCircumference, circle.getRadius(), 0.00000001); + assertEquals(new PointImpl(randomLon, randomLat, ShapeBuilder.SPATIAL_CONTEXT), circle.getCenter()); + } + + public void testPolygonWrapping() { + PolygonBuilder pb = new PolygonBuilder( + new CoordinatesBuilder().coordinate(-150.0, 65.0) + .coordinate(-250.0, 65.0) + .coordinate(-250.0, -65.0) + .coordinate(-150.0, -65.0) + .close() + ); + + ElasticsearchGeoAssertions.assertMultiPolygon(pb.buildS4J(), true); + ElasticsearchGeoAssertions.assertMultiPolygon(buildGeometry(pb), false); + } + + public void testLineStringWrapping() { + LineStringBuilder lsb = new LineStringBuilder( + new CoordinatesBuilder().coordinate(-150.0, 65.0) + .coordinate(-250.0, 65.0) + .coordinate(-250.0, -65.0) + .coordinate(-150.0, -65.0) + .close() + ); + + ElasticsearchGeoAssertions.assertMultiLineString(lsb.buildS4J(), true); + ElasticsearchGeoAssertions.assertMultiLineString(buildGeometry(lsb), false); + } + + public void testDatelineOGC() { + // tests that the following shape (defined in counterclockwise OGC order) + // https://gist.github.com/anonymous/7f1bb6d7e9cd72f5977c crosses the dateline + // expected results: 3 polygons, 1 with a hole + + // a giant c shape + PolygonBuilder builder = new PolygonBuilder( + new CoordinatesBuilder().coordinate(174, 0) + .coordinate(-176, 0) + .coordinate(-176, 3) + .coordinate(177, 3) + .coordinate(177, 5) + .coordinate(-176, 5) + .coordinate(-176, 8) + .coordinate(174, 8) + .coordinate(174, 0) + ); + + // 3/4 of an embedded 'c', crossing dateline once + builder.hole( + new LineStringBuilder( + new CoordinatesBuilder().coordinate(175, 1) + .coordinate(175, 7) + .coordinate(-178, 7) + .coordinate(-178, 6) + .coordinate(176, 6) + .coordinate(176, 2) + .coordinate(179, 2) + .coordinate(179, 1) + .coordinate(175, 1) + ) + ); + + // embedded hole right of the dateline + builder.hole( + new LineStringBuilder( + new CoordinatesBuilder().coordinate(-179, 1).coordinate(-179, 2).coordinate(-177, 2).coordinate(-177, 1).coordinate(-179, 1) + ) + ); + + ElasticsearchGeoAssertions.assertMultiPolygon(builder.close().buildS4J(), true); + ElasticsearchGeoAssertions.assertMultiPolygon(buildGeometry(builder.close()), false); + } + + public void testDateline() { + // tests that the following shape (defined in clockwise non-OGC order) + // https://gist.github.com/anonymous/7f1bb6d7e9cd72f5977c crosses the dateline + // expected results: 3 polygons, 1 with a hole + + // a giant c shape + PolygonBuilder builder = new PolygonBuilder( + new CoordinatesBuilder().coordinate(-186, 0) + .coordinate(-176, 0) + .coordinate(-176, 3) + .coordinate(-183, 3) + .coordinate(-183, 5) + .coordinate(-176, 5) + .coordinate(-176, 8) + .coordinate(-186, 8) + .coordinate(-186, 0) + ); + + // 3/4 of an embedded 'c', crossing dateline once + builder.hole( + new LineStringBuilder( + new CoordinatesBuilder().coordinate(-185, 1) + .coordinate(-181, 1) + .coordinate(-181, 2) + .coordinate(-184, 2) + .coordinate(-184, 6) + .coordinate(-178, 6) + .coordinate(-178, 7) + .coordinate(-185, 7) + .coordinate(-185, 1) + ) + ); + + // embedded hole right of the dateline + builder.hole( + new LineStringBuilder( + new CoordinatesBuilder().coordinate(-179, 1).coordinate(-177, 1).coordinate(-177, 2).coordinate(-179, 2).coordinate(-179, 1) + ) + ); + + ElasticsearchGeoAssertions.assertMultiPolygon(builder.close().buildS4J(), true); + ElasticsearchGeoAssertions.assertMultiPolygon(buildGeometry(builder.close()), false); + } + + public void testComplexShapeWithHole() { + PolygonBuilder builder = new PolygonBuilder( + new CoordinatesBuilder().coordinate(-85.0018514, 37.1311314) + .coordinate(-85.0016645, 37.1315293) + .coordinate(-85.0016246, 37.1317069) + .coordinate(-85.0016526, 37.1318183) + .coordinate(-85.0017119, 37.1319196) + .coordinate(-85.0019371, 37.1321182) + .coordinate(-85.0019972, 37.1322115) + .coordinate(-85.0019942, 37.1323234) + .coordinate(-85.0019543, 37.1324336) + .coordinate(-85.001906, 37.1324985) + .coordinate(-85.001834, 37.1325497) + .coordinate(-85.0016965, 37.1325907) + .coordinate(-85.0016011, 37.1325873) + .coordinate(-85.0014816, 37.1325353) + .coordinate(-85.0011755, 37.1323509) + .coordinate(-85.000955, 37.1322802) + .coordinate(-85.0006241, 37.1322529) + .coordinate(-85.0000002, 37.1322307) + .coordinate(-84.9994, 37.1323001) + .coordinate(-84.999109, 37.1322864) + .coordinate(-84.998934, 37.1322415) + .coordinate(-84.9988639, 37.1321888) + .coordinate(-84.9987841, 37.1320944) + .coordinate(-84.9987208, 37.131954) + .coordinate(-84.998736, 37.1316611) + .coordinate(-84.9988091, 37.131334) + .coordinate(-84.9989283, 37.1311337) + .coordinate(-84.9991943, 37.1309198) + .coordinate(-84.9993573, 37.1308459) + .coordinate(-84.9995888, 37.1307924) + .coordinate(-84.9998746, 37.130806) + .coordinate(-85.0000002, 37.1308358) + .coordinate(-85.0004984, 37.1310658) + .coordinate(-85.0008008, 37.1311625) + .coordinate(-85.0009461, 37.1311684) + .coordinate(-85.0011373, 37.1311515) + .coordinate(-85.0016455, 37.1310491) + .coordinate(-85.0018514, 37.1311314) + ); + + builder.hole( + new LineStringBuilder( + new CoordinatesBuilder().coordinate(-85.0000002, 37.1317672) + .coordinate(-85.0001983, 37.1317538) + .coordinate(-85.0003378, 37.1317582) + .coordinate(-85.0004697, 37.131792) + .coordinate(-85.0008048, 37.1319439) + .coordinate(-85.0009342, 37.1319838) + .coordinate(-85.0010184, 37.1319463) + .coordinate(-85.0010618, 37.13184) + .coordinate(-85.0010057, 37.1315102) + .coordinate(-85.000977, 37.1314403) + .coordinate(-85.0009182, 37.1313793) + .coordinate(-85.0005366, 37.1312209) + .coordinate(-85.000224, 37.1311466) + .coordinate(-85.000087, 37.1311356) + .coordinate(-85.0000002, 37.1311433) + .coordinate(-84.9995021, 37.1312336) + .coordinate(-84.9993308, 37.1312859) + .coordinate(-84.9992567, 37.1313252) + .coordinate(-84.9991868, 37.1314277) + .coordinate(-84.9991593, 37.1315381) + .coordinate(-84.9991841, 37.1316527) + .coordinate(-84.9992329, 37.1317117) + .coordinate(-84.9993527, 37.1317788) + .coordinate(-84.9994931, 37.1318061) + .coordinate(-84.9996815, 37.1317979) + .coordinate(-85.0000002, 37.1317672) + ) + ); + ElasticsearchGeoAssertions.assertPolygon(builder.close().buildS4J(), true); + ElasticsearchGeoAssertions.assertPolygon(buildGeometry(builder.close()), false); + } + + public void testShapeWithHoleAtEdgeEndPoints() { + PolygonBuilder builder = new PolygonBuilder( + new CoordinatesBuilder().coordinate(-4, 2) + .coordinate(4, 2) + .coordinate(6, 0) + .coordinate(4, -2) + .coordinate(-4, -2) + .coordinate(-6, 0) + .coordinate(-4, 2) + ); + + builder.hole( + new LineStringBuilder( + new CoordinatesBuilder().coordinate(4, 1).coordinate(4, -1).coordinate(-4, -1).coordinate(-4, 1).coordinate(4, 1) + ) + ); + ElasticsearchGeoAssertions.assertPolygon(builder.close().buildS4J(), true); + ElasticsearchGeoAssertions.assertPolygon(buildGeometry(builder.close()), false); + } + + public void testShapeWithPointOnDateline() { + PolygonBuilder builder = new PolygonBuilder( + new CoordinatesBuilder().coordinate(180, 0).coordinate(176, 4).coordinate(176, -4).coordinate(180, 0) + ); + ElasticsearchGeoAssertions.assertPolygon(builder.close().buildS4J(), true); + ElasticsearchGeoAssertions.assertPolygon(buildGeometry(builder.close()), false); + } + + public void testShapeWithEdgeAlongDateline() { + // test case 1: test the positive side of the dateline + PolygonBuilder builder = new PolygonBuilder( + new CoordinatesBuilder().coordinate(180, 0).coordinate(176, 4).coordinate(180, -4).coordinate(180, 0) + ); + + ElasticsearchGeoAssertions.assertPolygon(builder.close().buildS4J(), true); + ElasticsearchGeoAssertions.assertPolygon(buildGeometry(builder.close()), false); + + // test case 2: test the negative side of the dateline + builder = new PolygonBuilder( + new CoordinatesBuilder().coordinate(-176, 4).coordinate(-180, 0).coordinate(-180, -4).coordinate(-176, 4) + ); + + ElasticsearchGeoAssertions.assertPolygon(builder.close().buildS4J(), true); + ElasticsearchGeoAssertions.assertPolygon(buildGeometry(builder.close()), false); + } + + public void testShapeWithBoundaryHoles() { + // test case 1: test the positive side of the dateline + PolygonBuilder builder = new PolygonBuilder( + new CoordinatesBuilder().coordinate(-177, 10) + .coordinate(176, 15) + .coordinate(172, 0) + .coordinate(176, -15) + .coordinate(-177, -10) + .coordinate(-177, 10) + ); + builder.hole( + new LineStringBuilder( + new CoordinatesBuilder().coordinate(176, 10).coordinate(180, 5).coordinate(180, -5).coordinate(176, -10).coordinate(176, 10) + ) + ); + + ElasticsearchGeoAssertions.assertMultiPolygon(builder.close().buildS4J(), true); + ElasticsearchGeoAssertions.assertMultiPolygon(buildGeometry(builder.close()), false); + + // test case 2: test the negative side of the dateline + builder = new PolygonBuilder( + new CoordinatesBuilder().coordinate(-176, 15) + .coordinate(179, 10) + .coordinate(179, -10) + .coordinate(-176, -15) + .coordinate(-172, 0) + .close() + ); + builder.hole( + new LineStringBuilder( + new CoordinatesBuilder().coordinate(-176, 10) + .coordinate(-176, -10) + .coordinate(-180, -5) + .coordinate(-180, 5) + .coordinate(-176, 10) + .close() + ) + ); + + ElasticsearchGeoAssertions.assertMultiPolygon(builder.close().buildS4J(), true); + ElasticsearchGeoAssertions.assertMultiPolygon(buildGeometry(builder.close()), false); + } + + public void testShapeWithHoleTouchingAtDateline() throws Exception { + PolygonBuilder builder = new PolygonBuilder( + new CoordinatesBuilder().coordinate(-180, 90) + .coordinate(-180, -90) + .coordinate(180, -90) + .coordinate(180, 90) + .coordinate(-180, 90) + ); + builder.hole( + new LineStringBuilder( + new CoordinatesBuilder().coordinate(180.0, -16.14) + .coordinate(178.53, -16.64) + .coordinate(178.49, -16.82) + .coordinate(178.73, -17.02) + .coordinate(178.86, -16.86) + .coordinate(180.0, -16.14) + ) + ); + + ElasticsearchGeoAssertions.assertPolygon(builder.close().buildS4J(), true); + ElasticsearchGeoAssertions.assertPolygon(buildGeometry(builder.close()), false); + } + + public void testShapeWithTangentialHole() { + // test a shape with one tangential (shared) vertex (should pass) + PolygonBuilder builder = new PolygonBuilder( + new CoordinatesBuilder().coordinate(179, 10) + .coordinate(168, 15) + .coordinate(164, 0) + .coordinate(166, -15) + .coordinate(179, -10) + .coordinate(179, 10) + ); + builder.hole( + new LineStringBuilder( + new CoordinatesBuilder().coordinate(-177, 10) + .coordinate(-178, -10) + .coordinate(-180, -5) + .coordinate(-180, 5) + .coordinate(-177, 10) + ) + ); + + ElasticsearchGeoAssertions.assertMultiPolygon(builder.close().buildS4J(), true); + ElasticsearchGeoAssertions.assertMultiPolygon(buildGeometry(builder.close()), false); + } + + public void testShapeWithInvalidTangentialHole() { + // test a shape with one invalid tangential (shared) vertex (should throw exception) + PolygonBuilder builder = new PolygonBuilder( + new CoordinatesBuilder().coordinate(179, 10) + .coordinate(168, 15) + .coordinate(164, 0) + .coordinate(166, -15) + .coordinate(179, -10) + .coordinate(179, 10) + ); + builder.hole( + new LineStringBuilder( + new CoordinatesBuilder().coordinate(164, 0).coordinate(175, 10).coordinate(175, 5).coordinate(179, -10).coordinate(164, 0) + ) + ); + Exception e; + + e = expectThrows(InvalidShapeException.class, () -> builder.close().buildS4J()); + assertThat(e.getMessage(), containsString("interior cannot share more than one point with the exterior")); + e = expectThrows(IllegalArgumentException.class, () -> buildGeometry(builder.close())); + assertThat(e.getMessage(), containsString("interior cannot share more than one point with the exterior")); + } + + public void testBoundaryShapeWithTangentialHole() { + // test a shape with one tangential (shared) vertex for each hole (should pass) + PolygonBuilder builder = new PolygonBuilder( + new CoordinatesBuilder().coordinate(-177, 10) + .coordinate(176, 15) + .coordinate(172, 0) + .coordinate(176, -15) + .coordinate(-177, -10) + .coordinate(-177, 10) + ); + builder.hole( + new LineStringBuilder( + new CoordinatesBuilder().coordinate(-177, 10) + .coordinate(-178, -10) + .coordinate(-180, -5) + .coordinate(-180, 5) + .coordinate(-177, 10) + ) + ); + builder.hole( + new LineStringBuilder(new CoordinatesBuilder().coordinate(172, 0).coordinate(176, 10).coordinate(176, -5).coordinate(172, 0)) + ); + ElasticsearchGeoAssertions.assertMultiPolygon(builder.close().buildS4J(), true); + ElasticsearchGeoAssertions.assertMultiPolygon(buildGeometry(builder.close()), false); + } + + public void testBoundaryShapeWithInvalidTangentialHole() { + // test shape with two tangential (shared) vertices (should throw exception) + PolygonBuilder builder = new PolygonBuilder( + new CoordinatesBuilder().coordinate(-177, 10) + .coordinate(176, 15) + .coordinate(172, 0) + .coordinate(176, -15) + .coordinate(-177, -10) + .coordinate(-177, 10) + ); + builder.hole( + new LineStringBuilder( + new CoordinatesBuilder().coordinate(-177, 10) + .coordinate(172, 0) + .coordinate(180, -5) + .coordinate(176, -10) + .coordinate(-177, 10) + ) + ); + Exception e; + e = expectThrows(InvalidShapeException.class, () -> builder.close().buildS4J()); + assertThat(e.getMessage(), containsString("interior cannot share more than one point with the exterior")); + e = expectThrows(IllegalArgumentException.class, () -> buildGeometry(builder.close())); + assertThat(e.getMessage(), containsString("interior cannot share more than one point with the exterior")); + } + + /** + * Test an enveloping polygon around the max mercator bounds + */ + public void testBoundaryShape() { + PolygonBuilder builder = new PolygonBuilder( + new CoordinatesBuilder().coordinate(-180, 90).coordinate(180, 90).coordinate(180, -90).coordinate(-180, 90) + ); + + ElasticsearchGeoAssertions.assertPolygon(builder.close().buildS4J(), true); + ElasticsearchGeoAssertions.assertPolygon(buildGeometry(builder.close()), false); + } + + public void testShapeWithAlternateOrientation() { + // cw: should produce a multi polygon spanning hemispheres + PolygonBuilder builder = new PolygonBuilder( + new CoordinatesBuilder().coordinate(180, 0).coordinate(176, 4).coordinate(-176, 4).coordinate(180, 0) + ); + + ElasticsearchGeoAssertions.assertPolygon(builder.close().buildS4J(), true); + ElasticsearchGeoAssertions.assertPolygon(buildGeometry(builder.close()), false); + + // cw: geo core will convert to ccw across the dateline + builder = new PolygonBuilder(new CoordinatesBuilder().coordinate(180, 0).coordinate(-176, 4).coordinate(176, 4).coordinate(180, 0)); + + ElasticsearchGeoAssertions.assertMultiPolygon(builder.close().buildS4J(), true); + ElasticsearchGeoAssertions.assertMultiPolygon(buildGeometry(builder.close()), false); + } + + public void testShapeWithConsecutiveDuplicatePoints() { + PolygonBuilder builder = new PolygonBuilder( + new CoordinatesBuilder().coordinate(180, 0).coordinate(176, 4).coordinate(176, 4).coordinate(-176, 4).coordinate(180, 0) + ); + + // duplicated points are removed + PolygonBuilder expected = new PolygonBuilder( + new CoordinatesBuilder().coordinate(180, 0).coordinate(176, 4).coordinate(-176, 4).coordinate(180, 0) + ); + + assertEquals(buildGeometry(expected.close()), buildGeometry(builder.close())); + assertEquals(expected.close().buildS4J(), builder.close().buildS4J()); + } + + public void testShapeWithCoplanarVerticalPoints() throws Exception { + PolygonBuilder builder = new PolygonBuilder( + new CoordinatesBuilder().coordinate(180, -36) + .coordinate(180, 90) + .coordinate(-180, 90) + .coordinate(-180, 79) + .coordinate(16, 58) + .coordinate(8, 13) + .coordinate(-180, 74) + .coordinate(-180, -85) + .coordinate(-180, -90) + .coordinate(180, -90) + .coordinate(180, -85) + .coordinate(26, 6) + .coordinate(33, 62) + .coordinate(180, -36) + ); + + // coplanar points on vertical edge are removed. + PolygonBuilder expected = new PolygonBuilder( + new CoordinatesBuilder().coordinate(180, -36) + .coordinate(180, 90) + .coordinate(-180, 90) + .coordinate(-180, 79) + .coordinate(16, 58) + .coordinate(8, 13) + .coordinate(-180, 74) + .coordinate(-180, -90) + .coordinate(180, -90) + .coordinate(180, -85) + .coordinate(26, 6) + .coordinate(33, 62) + .coordinate(180, -36) + ); + + assertEquals(buildGeometry(expected.close()), buildGeometry(builder.close())); + assertEquals(expected.close().buildS4J(), builder.close().buildS4J()); + + } + + public void testPolygon3D() { + String expected = "{\n" + + " \"type\" : \"polygon\",\n" + + " \"orientation\" : \"right\",\n" + + " \"coordinates\" : [\n" + + " [\n" + + " [\n" + + " -45.0,\n" + + " 30.0,\n" + + " 100.0\n" + + " ],\n" + + " [\n" + + " 45.0,\n" + + " 30.0,\n" + + " 75.0\n" + + " ],\n" + + " [\n" + + " 45.0,\n" + + " -30.0,\n" + + " 77.0\n" + + " ],\n" + + " [\n" + + " -45.0,\n" + + " -30.0,\n" + + " 101.0\n" + + " ],\n" + + " [\n" + + " -45.0,\n" + + " 30.0,\n" + + " 110.0\n" + + " ]\n" + + " ]\n" + + " ]\n" + + "}"; + + PolygonBuilder pb = new PolygonBuilder( + new CoordinatesBuilder().coordinate(new Coordinate(-45, 30, 100)) + .coordinate(new Coordinate(45, 30, 75)) + .coordinate(new Coordinate(45, -30, 77)) + .coordinate(new Coordinate(-45, -30, 101)) + .coordinate(new Coordinate(-45, 30, 110)) + ); + + assertEquals(expected, pb.toString()); + } + + public void testInvalidSelfCrossingPolygon() { + PolygonBuilder builder = new PolygonBuilder( + new CoordinatesBuilder().coordinate(0, 0) + .coordinate(0, 2) + .coordinate(1, 1.9) + .coordinate(0.5, 1.8) + .coordinate(1.5, 1.8) + .coordinate(1, 1.9) + .coordinate(2, 2) + .coordinate(2, 0) + .coordinate(0, 0) + ); + Exception e = expectThrows(InvalidShapeException.class, () -> builder.close().buildS4J()); + assertThat(e.getMessage(), containsString("Self-intersection at or near point [")); + assertThat(e.getMessage(), not(containsString("NaN"))); + } + + public Object buildGeometry(ShapeBuilder builder) { + return new GeoShapeIndexer(true, "name").prepareForIndexing(builder.buildGeometry()); + } +} diff --git a/server/src/test/java/org/elasticsearch/common/geo/builders/AbstractShapeBuilderTestCase.java b/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/builders/AbstractShapeBuilderTestCase.java similarity index 95% rename from server/src/test/java/org/elasticsearch/common/geo/builders/AbstractShapeBuilderTestCase.java rename to modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/builders/AbstractShapeBuilderTestCase.java index 1ff958faf947c..c55e2120e639f 100644 --- a/server/src/test/java/org/elasticsearch/common/geo/builders/AbstractShapeBuilderTestCase.java +++ b/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/builders/AbstractShapeBuilderTestCase.java @@ -6,10 +6,8 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.geo.builders; +package org.elasticsearch.legacygeo.builders; -import org.elasticsearch.common.geo.GeoShapeType; -import org.elasticsearch.common.geo.parsers.ShapeParser; import org.elasticsearch.common.io.stream.NamedWriteable; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable.Reader; @@ -18,6 +16,8 @@ import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.legacygeo.GeoShapeType; +import org.elasticsearch.legacygeo.parsers.ShapeParser; import org.elasticsearch.test.ESTestCase; import org.junit.AfterClass; import org.junit.BeforeClass; @@ -26,7 +26,7 @@ import static org.elasticsearch.test.EqualsHashCodeTestUtils.checkEqualsAndHashCode; -public abstract class AbstractShapeBuilderTestCase> extends ESTestCase { +public abstract class AbstractShapeBuilderTestCase> extends ESTestCase { private static final int NUMBER_OF_TESTBUILDERS = 20; private static NamedWriteableRegistry namedWriteableRegistry; diff --git a/server/src/test/java/org/elasticsearch/common/geo/builders/CircleBuilderTests.java b/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/builders/CircleBuilderTests.java similarity index 95% rename from server/src/test/java/org/elasticsearch/common/geo/builders/CircleBuilderTests.java rename to modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/builders/CircleBuilderTests.java index c2323f4a1be19..72ab85016aac6 100644 --- a/server/src/test/java/org/elasticsearch/common/geo/builders/CircleBuilderTests.java +++ b/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/builders/CircleBuilderTests.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.geo.builders; +package org.elasticsearch.legacygeo.builders; import org.elasticsearch.common.unit.DistanceUnit; import org.locationtech.jts.geom.Coordinate; @@ -32,14 +32,14 @@ static CircleBuilder mutate(CircleBuilder original) throws IOException { if (randomBoolean()) { if (original.center().x > 0.0 || original.center().y > 0.0) { - mutation.center(new Coordinate(original.center().x/2, original.center().y/2)); + mutation.center(new Coordinate(original.center().x / 2, original.center().y / 2)); } else { // original center was 0.0, 0.0 mutation.center(randomDouble() + 0.1, randomDouble() + 0.1); } } else if (randomBoolean()) { if (radius > 0) { - radius = radius/2; + radius = radius / 2; } else { radius = randomDouble() + 0.1; } diff --git a/server/src/test/java/org/elasticsearch/common/geo/builders/EnvelopeBuilderTests.java b/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/builders/EnvelopeBuilderTests.java similarity index 64% rename from server/src/test/java/org/elasticsearch/common/geo/builders/EnvelopeBuilderTests.java rename to modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/builders/EnvelopeBuilderTests.java index 8944d90ec82c3..65b4dcefca26d 100644 --- a/server/src/test/java/org/elasticsearch/common/geo/builders/EnvelopeBuilderTests.java +++ b/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/builders/EnvelopeBuilderTests.java @@ -6,11 +6,10 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.geo.builders; +package org.elasticsearch.legacygeo.builders; +import org.elasticsearch.legacygeo.test.RandomShapeGenerator; import org.locationtech.jts.geom.Coordinate; - -import org.elasticsearch.test.geo.RandomShapeGenerator; import org.locationtech.spatial4j.shape.Rectangle; import java.io.IOException; @@ -39,31 +38,40 @@ static EnvelopeBuilder mutate(EnvelopeBuilder original) throws IOException { EnvelopeBuilder mutation = copyShape(original); // move one corner to the middle of original switch (randomIntBetween(0, 3)) { - case 0: - mutation = new EnvelopeBuilder( + case 0: + mutation = new EnvelopeBuilder( new Coordinate(randomDoubleBetween(-180.0, original.bottomRight().x, true), original.topLeft().y), - original.bottomRight()); - break; - case 1: - mutation = new EnvelopeBuilder(new Coordinate(original.topLeft().x, randomDoubleBetween(original.bottomRight().y, 90.0, true)), - original.bottomRight()); - break; - case 2: - mutation = new EnvelopeBuilder(original.topLeft(), - new Coordinate(randomDoubleBetween(original.topLeft().x, 180.0, true), original.bottomRight().y)); - break; - case 3: - mutation = new EnvelopeBuilder(original.topLeft(), - new Coordinate(original.bottomRight().x, randomDoubleBetween(-90.0, original.topLeft().y, true))); - break; + original.bottomRight() + ); + break; + case 1: + mutation = new EnvelopeBuilder( + new Coordinate(original.topLeft().x, randomDoubleBetween(original.bottomRight().y, 90.0, true)), + original.bottomRight() + ); + break; + case 2: + mutation = new EnvelopeBuilder( + original.topLeft(), + new Coordinate(randomDoubleBetween(original.topLeft().x, 180.0, true), original.bottomRight().y) + ); + break; + case 3: + mutation = new EnvelopeBuilder( + original.topLeft(), + new Coordinate(original.bottomRight().x, randomDoubleBetween(-90.0, original.topLeft().y, true)) + ); + break; } return mutation; } static EnvelopeBuilder createRandomShape() { Rectangle box = RandomShapeGenerator.xRandomRectangle(random(), RandomShapeGenerator.xRandomPoint(random())); - EnvelopeBuilder envelope = new EnvelopeBuilder(new Coordinate(box.getMinX(), box.getMaxY()), - new Coordinate(box.getMaxX(), box.getMinY())); + EnvelopeBuilder envelope = new EnvelopeBuilder( + new Coordinate(box.getMinX(), box.getMaxY()), + new Coordinate(box.getMaxX(), box.getMinY()) + ); return envelope; } } diff --git a/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/builders/GeometryCollectionBuilderTests.java b/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/builders/GeometryCollectionBuilderTests.java new file mode 100644 index 0000000000000..3989eb75df571 --- /dev/null +++ b/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/builders/GeometryCollectionBuilderTests.java @@ -0,0 +1,96 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.legacygeo.builders; + +import org.elasticsearch.legacygeo.test.RandomShapeGenerator; + +import java.io.IOException; + +public class GeometryCollectionBuilderTests extends AbstractShapeBuilderTestCase { + + @Override + protected GeometryCollectionBuilder createTestShapeBuilder() { + GeometryCollectionBuilder geometryCollection = new GeometryCollectionBuilder(); + int shapes = randomIntBetween(0, 8); + for (int i = 0; i < shapes; i++) { + switch (randomIntBetween(0, 7)) { + case 0: + geometryCollection.shape(PointBuilderTests.createRandomShape()); + break; + case 1: + geometryCollection.shape(CircleBuilderTests.createRandomShape()); + break; + case 2: + geometryCollection.shape(EnvelopeBuilderTests.createRandomShape()); + break; + case 3: + geometryCollection.shape(LineStringBuilderTests.createRandomShape()); + break; + case 4: + geometryCollection.shape(MultiLineStringBuilderTests.createRandomShape()); + break; + case 5: + geometryCollection.shape(MultiPolygonBuilderTests.createRandomShape()); + break; + case 6: + geometryCollection.shape(MultiPointBuilderTests.createRandomShape()); + break; + case 7: + geometryCollection.shape(PolygonBuilderTests.createRandomShape()); + break; + } + } + return geometryCollection; + } + + @Override + protected GeometryCollectionBuilder createMutation(GeometryCollectionBuilder original) throws IOException { + return mutate(original); + } + + static GeometryCollectionBuilder mutate(GeometryCollectionBuilder original) throws IOException { + GeometryCollectionBuilder mutation = copyShape(original); + if (mutation.shapes.size() > 0) { + int shapePosition = randomIntBetween(0, mutation.shapes.size() - 1); + ShapeBuilder shapeToChange = mutation.shapes.get(shapePosition); + switch (shapeToChange.type()) { + case POINT: + shapeToChange = PointBuilderTests.mutate((PointBuilder) shapeToChange); + break; + case CIRCLE: + shapeToChange = CircleBuilderTests.mutate((CircleBuilder) shapeToChange); + break; + case ENVELOPE: + shapeToChange = EnvelopeBuilderTests.mutate((EnvelopeBuilder) shapeToChange); + break; + case LINESTRING: + shapeToChange = LineStringBuilderTests.mutate((LineStringBuilder) shapeToChange); + break; + case MULTILINESTRING: + shapeToChange = MultiLineStringBuilderTests.mutate((MultiLineStringBuilder) shapeToChange); + break; + case MULTIPOLYGON: + shapeToChange = MultiPolygonBuilderTests.mutate((MultiPolygonBuilder) shapeToChange); + break; + case MULTIPOINT: + shapeToChange = MultiPointBuilderTests.mutate((MultiPointBuilder) shapeToChange); + break; + case POLYGON: + shapeToChange = PolygonBuilderTests.mutate((PolygonBuilder) shapeToChange); + break; + case GEOMETRYCOLLECTION: + throw new UnsupportedOperationException("GeometryCollection should not be nested inside each other"); + } + mutation.shapes.set(shapePosition, shapeToChange); + } else { + mutation.shape(RandomShapeGenerator.createShape(random())); + } + return mutation; + } +} diff --git a/server/src/test/java/org/elasticsearch/common/geo/builders/LineStringBuilderTests.java b/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/builders/LineStringBuilderTests.java similarity index 93% rename from server/src/test/java/org/elasticsearch/common/geo/builders/LineStringBuilderTests.java rename to modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/builders/LineStringBuilderTests.java index f2b9d153337f1..86af9ece0cf15 100644 --- a/server/src/test/java/org/elasticsearch/common/geo/builders/LineStringBuilderTests.java +++ b/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/builders/LineStringBuilderTests.java @@ -6,10 +6,10 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.geo.builders; +package org.elasticsearch.legacygeo.builders; -import org.elasticsearch.test.geo.RandomShapeGenerator; -import org.elasticsearch.test.geo.RandomShapeGenerator.ShapeType; +import org.elasticsearch.legacygeo.test.RandomShapeGenerator; +import org.elasticsearch.legacygeo.test.RandomShapeGenerator.ShapeType; import org.locationtech.jts.geom.Coordinate; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/common/geo/builders/MultiLineStringBuilderTests.java b/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/builders/MultiLineStringBuilderTests.java similarity index 92% rename from server/src/test/java/org/elasticsearch/common/geo/builders/MultiLineStringBuilderTests.java rename to modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/builders/MultiLineStringBuilderTests.java index 97e3c766e8ee1..a222cfe9e6b41 100644 --- a/server/src/test/java/org/elasticsearch/common/geo/builders/MultiLineStringBuilderTests.java +++ b/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/builders/MultiLineStringBuilderTests.java @@ -6,11 +6,11 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.geo.builders; +package org.elasticsearch.legacygeo.builders; +import org.elasticsearch.legacygeo.test.RandomShapeGenerator; +import org.elasticsearch.legacygeo.test.RandomShapeGenerator.ShapeType; import org.locationtech.jts.geom.Coordinate; -import org.elasticsearch.test.geo.RandomShapeGenerator; -import org.elasticsearch.test.geo.RandomShapeGenerator.ShapeType; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/common/geo/builders/MultiPointBuilderTests.java b/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/builders/MultiPointBuilderTests.java similarity index 90% rename from server/src/test/java/org/elasticsearch/common/geo/builders/MultiPointBuilderTests.java rename to modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/builders/MultiPointBuilderTests.java index e67c3fc916a33..d6484c42c6256 100644 --- a/server/src/test/java/org/elasticsearch/common/geo/builders/MultiPointBuilderTests.java +++ b/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/builders/MultiPointBuilderTests.java @@ -6,13 +6,12 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.geo.builders; +package org.elasticsearch.legacygeo.builders; +import org.elasticsearch.legacygeo.test.RandomShapeGenerator; +import org.elasticsearch.legacygeo.test.RandomShapeGenerator.ShapeType; import org.locationtech.jts.geom.Coordinate; -import org.elasticsearch.test.geo.RandomShapeGenerator; -import org.elasticsearch.test.geo.RandomShapeGenerator.ShapeType; - import java.io.IOException; import java.util.List; @@ -57,7 +56,7 @@ static MultiPointBuilder mutate(MultiPointBuilder original) throws IOException { } } } else { - coordinates = new Coordinate[]{new Coordinate(1.0, 1.0)}; + coordinates = new Coordinate[] { new Coordinate(1.0, 1.0) }; } return MultiPointBuilder.class.cast(mutation.coordinates(coordinates)); } diff --git a/server/src/test/java/org/elasticsearch/common/geo/builders/MultiPolygonBuilderTests.java b/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/builders/MultiPolygonBuilderTests.java similarity index 51% rename from server/src/test/java/org/elasticsearch/common/geo/builders/MultiPolygonBuilderTests.java rename to modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/builders/MultiPolygonBuilderTests.java index 33e90ce1873c8..b6ec2313dfc1e 100644 --- a/server/src/test/java/org/elasticsearch/common/geo/builders/MultiPolygonBuilderTests.java +++ b/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/builders/MultiPolygonBuilderTests.java @@ -6,11 +6,11 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.geo.builders; +package org.elasticsearch.legacygeo.builders; import org.elasticsearch.common.geo.Orientation; -import org.elasticsearch.test.geo.RandomShapeGenerator; -import org.elasticsearch.test.geo.RandomShapeGenerator.ShapeType; +import org.elasticsearch.legacygeo.test.RandomShapeGenerator; +import org.elasticsearch.legacygeo.test.RandomShapeGenerator.ShapeType; import org.locationtech.spatial4j.exception.InvalidShapeException; import java.io.IOException; @@ -59,82 +59,79 @@ static MultiPolygonBuilder createRandomShape() { public void testInvalidPolygonBuilders() { try { // self intersection polygon - new PolygonBuilder(new CoordinatesBuilder() - .coordinate(-10, -10) - .coordinate(10, 10) - .coordinate(-10, 10) - .coordinate(10, -10) - .close()) - .buildS4J(); + new PolygonBuilder( + new CoordinatesBuilder().coordinate(-10, -10).coordinate(10, 10).coordinate(-10, 10).coordinate(10, -10).close() + ).buildS4J(); fail("Self intersection not detected"); - } catch (InvalidShapeException e) { - } + } catch (InvalidShapeException e) {} // polygon with hole - new PolygonBuilder(new CoordinatesBuilder() - .coordinate(-10, -10).coordinate(-10, 10).coordinate(10, 10).coordinate(10, -10).close()) - .hole(new LineStringBuilder(new CoordinatesBuilder().coordinate(-5, -5).coordinate(-5, 5).coordinate(5, 5) - .coordinate(5, -5).close())) + new PolygonBuilder(new CoordinatesBuilder().coordinate(-10, -10).coordinate(-10, 10).coordinate(10, 10).coordinate(10, -10).close()) + .hole( + new LineStringBuilder( + new CoordinatesBuilder().coordinate(-5, -5).coordinate(-5, 5).coordinate(5, 5).coordinate(5, -5).close() + ) + ) .buildS4J(); try { // polygon with overlapping hole - new PolygonBuilder(new CoordinatesBuilder() - .coordinate(-10, -10).coordinate(-10, 10).coordinate(10, 10).coordinate(10, -10).close()) - .hole(new LineStringBuilder(new CoordinatesBuilder() - .coordinate(-5, -5).coordinate(-5, 11).coordinate(5, 11).coordinate(5, -5).close())) - .buildS4J(); + new PolygonBuilder( + new CoordinatesBuilder().coordinate(-10, -10).coordinate(-10, 10).coordinate(10, 10).coordinate(10, -10).close() + ).hole( + new LineStringBuilder( + new CoordinatesBuilder().coordinate(-5, -5).coordinate(-5, 11).coordinate(5, 11).coordinate(5, -5).close() + ) + ).buildS4J(); fail("Self intersection not detected"); - } catch (InvalidShapeException e) { - } + } catch (InvalidShapeException e) {} try { // polygon with intersection holes - new PolygonBuilder(new CoordinatesBuilder() - .coordinate(-10, -10).coordinate(-10, 10).coordinate(10, 10).coordinate(10, -10).close()) - .hole(new LineStringBuilder(new CoordinatesBuilder().coordinate(-5, -5).coordinate(-5, 5).coordinate(5, 5) - .coordinate(5, -5).close())) - .hole(new LineStringBuilder(new CoordinatesBuilder().coordinate(-5, -6).coordinate(5, -6).coordinate(5, -4) - .coordinate(-5, -4).close())) + new PolygonBuilder( + new CoordinatesBuilder().coordinate(-10, -10).coordinate(-10, 10).coordinate(10, 10).coordinate(10, -10).close() + ).hole( + new LineStringBuilder( + new CoordinatesBuilder().coordinate(-5, -5).coordinate(-5, 5).coordinate(5, 5).coordinate(5, -5).close() + ) + ) + .hole( + new LineStringBuilder( + new CoordinatesBuilder().coordinate(-5, -6).coordinate(5, -6).coordinate(5, -4).coordinate(-5, -4).close() + ) + ) .buildS4J(); fail("Intersection of holes not detected"); - } catch (InvalidShapeException e) { - } + } catch (InvalidShapeException e) {} try { // Common line in polygon - new PolygonBuilder(new CoordinatesBuilder() - .coordinate(-10, -10) - .coordinate(-10, 10) - .coordinate(-5, 10) - .coordinate(-5, -5) - .coordinate(-5, 20) - .coordinate(10, 20) - .coordinate(10, -10) - .close()) - .buildS4J(); + new PolygonBuilder( + new CoordinatesBuilder().coordinate(-10, -10) + .coordinate(-10, 10) + .coordinate(-5, 10) + .coordinate(-5, -5) + .coordinate(-5, 20) + .coordinate(10, 20) + .coordinate(10, -10) + .close() + ).buildS4J(); fail("Self intersection not detected"); - } catch (InvalidShapeException e) { - } + } catch (InvalidShapeException e) {} // Multipolygon: polygon with hole and polygon within the whole - new MultiPolygonBuilder() - .polygon(new PolygonBuilder( - new CoordinatesBuilder().coordinate(-10, -10) - .coordinate(-10, 10) - .coordinate(10, 10) - .coordinate(10, -10).close()) - .hole(new LineStringBuilder( - new CoordinatesBuilder().coordinate(-5, -5) - .coordinate(-5, 5) - .coordinate(5, 5) - .coordinate(5, -5).close()))) - .polygon(new PolygonBuilder( - new CoordinatesBuilder() - .coordinate(-4, -4) - .coordinate(-4, 4) - .coordinate(4, 4) - .coordinate(4, -4).close())) + new MultiPolygonBuilder().polygon( + new PolygonBuilder( + new CoordinatesBuilder().coordinate(-10, -10).coordinate(-10, 10).coordinate(10, 10).coordinate(10, -10).close() + ).hole( + new LineStringBuilder( + new CoordinatesBuilder().coordinate(-5, -5).coordinate(-5, 5).coordinate(5, 5).coordinate(5, -5).close() + ) + ) + ) + .polygon( + new PolygonBuilder(new CoordinatesBuilder().coordinate(-4, -4).coordinate(-4, 4).coordinate(4, 4).coordinate(4, -4).close()) + ) .buildS4J(); } } diff --git a/server/src/test/java/org/elasticsearch/common/geo/builders/PointBuilderTests.java b/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/builders/PointBuilderTests.java similarity index 85% rename from server/src/test/java/org/elasticsearch/common/geo/builders/PointBuilderTests.java rename to modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/builders/PointBuilderTests.java index bffe25cc17426..132927831fb40 100644 --- a/server/src/test/java/org/elasticsearch/common/geo/builders/PointBuilderTests.java +++ b/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/builders/PointBuilderTests.java @@ -6,11 +6,11 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.geo.builders; +package org.elasticsearch.legacygeo.builders; +import org.elasticsearch.legacygeo.test.RandomShapeGenerator; +import org.elasticsearch.legacygeo.test.RandomShapeGenerator.ShapeType; import org.locationtech.jts.geom.Coordinate; -import org.elasticsearch.test.geo.RandomShapeGenerator; -import org.elasticsearch.test.geo.RandomShapeGenerator.ShapeType; import java.io.IOException; @@ -34,5 +34,4 @@ static PointBuilder createRandomShape() { return (PointBuilder) RandomShapeGenerator.createShape(random(), ShapeType.POINT); } - } diff --git a/server/src/test/java/org/elasticsearch/common/geo/builders/PolygonBuilderTests.java b/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/builders/PolygonBuilderTests.java similarity index 72% rename from server/src/test/java/org/elasticsearch/common/geo/builders/PolygonBuilderTests.java rename to modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/builders/PolygonBuilderTests.java index baaf1ccbeba5f..35b98df7a397d 100644 --- a/server/src/test/java/org/elasticsearch/common/geo/builders/PolygonBuilderTests.java +++ b/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/builders/PolygonBuilderTests.java @@ -6,12 +6,12 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.geo.builders; +package org.elasticsearch.legacygeo.builders; -import org.locationtech.jts.geom.Coordinate; import org.elasticsearch.common.geo.Orientation; -import org.elasticsearch.test.geo.RandomShapeGenerator; -import org.elasticsearch.test.geo.RandomShapeGenerator.ShapeType; +import org.elasticsearch.legacygeo.test.RandomShapeGenerator; +import org.elasticsearch.legacygeo.test.RandomShapeGenerator.ShapeType; +import org.locationtech.jts.geom.Coordinate; import org.locationtech.spatial4j.exception.InvalidShapeException; import org.locationtech.spatial4j.shape.jts.JtsGeometry; @@ -70,8 +70,10 @@ static PolygonBuilder mutatePolygonBuilder(PolygonBuilder pb) { * This is done so we don't have to expose a setter for orientation in the actual class */ private static PolygonBuilder polyWithOposingOrientation(PolygonBuilder pb) { - PolygonBuilder mutation = new PolygonBuilder(pb.shell(), - pb.orientation() == Orientation.LEFT ? Orientation.RIGHT : Orientation.LEFT); + PolygonBuilder mutation = new PolygonBuilder( + pb.shell(), + pb.orientation() == Orientation.LEFT ? Orientation.RIGHT : Orientation.LEFT + ); for (LineStringBuilder hole : pb.holes()) { mutation.hole(hole); } @@ -87,30 +89,39 @@ static PolygonBuilder createRandomShape() { } public void testCoerceShell() { - try{ - new PolygonBuilder(new LineStringBuilder(new CoordinatesBuilder().coordinate(0.0, 0.0) - .coordinate(1.0, 0.0).coordinate(1.0, 1.0).build()), Orientation.RIGHT); + try { + new PolygonBuilder( + new LineStringBuilder(new CoordinatesBuilder().coordinate(0.0, 0.0).coordinate(1.0, 0.0).coordinate(1.0, 1.0).build()), + Orientation.RIGHT + ); fail("should raise validation exception"); } catch (IllegalArgumentException e) { assertEquals("invalid number of points in LinearRing (found [3] - must be >= 4)", e.getMessage()); } - PolygonBuilder pb = new PolygonBuilder(new LineStringBuilder(new CoordinatesBuilder().coordinate(0.0, 0.0) - .coordinate(1.0, 0.0).coordinate(1.0, 1.0).build()), Orientation.RIGHT, true); + PolygonBuilder pb = new PolygonBuilder( + new LineStringBuilder(new CoordinatesBuilder().coordinate(0.0, 0.0).coordinate(1.0, 0.0).coordinate(1.0, 1.0).build()), + Orientation.RIGHT, + true + ); assertThat("Shell should have been closed via coerce", pb.shell().coordinates(false).length, equalTo(4)); } public void testCoerceHole() { - PolygonBuilder pb = new PolygonBuilder(new CoordinatesBuilder().coordinate(0.0, 0.0) - .coordinate(2.0, 0.0).coordinate(2.0, 2.0).coordinate(0.0, 0.0)); - try{ - pb.hole(new LineStringBuilder(new CoordinatesBuilder().coordinate(0.0,0.0).coordinate(1.0,0.0).coordinate(1.0,1.0).build())); + PolygonBuilder pb = new PolygonBuilder( + new CoordinatesBuilder().coordinate(0.0, 0.0).coordinate(2.0, 0.0).coordinate(2.0, 2.0).coordinate(0.0, 0.0) + ); + try { + pb.hole(new LineStringBuilder(new CoordinatesBuilder().coordinate(0.0, 0.0).coordinate(1.0, 0.0).coordinate(1.0, 1.0).build())); fail("should raise validation exception"); } catch (IllegalArgumentException e) { assertEquals("invalid number of points in LinearRing (found [3] - must be >= 4)", e.getMessage()); } - pb.hole(new LineStringBuilder(new CoordinatesBuilder().coordinate(0.0,0.0).coordinate(1.0,0.0).coordinate(1.0,1.0).build()), true); + pb.hole( + new LineStringBuilder(new CoordinatesBuilder().coordinate(0.0, 0.0).coordinate(1.0, 0.0).coordinate(1.0, 1.0).build()), + true + ); assertThat("hole should have been closed via coerce", pb.holes().get(0).coordinates(false).length, equalTo(4)); } @@ -140,26 +151,43 @@ public void testWidePolygonWithConfusingOrientation() { // ES to believe that it crosses the dateline and "fixing" it in a way // that self-intersects. - PolygonBuilder pb = new PolygonBuilder(new CoordinatesBuilder() - .coordinate(10, -20).coordinate(100, 0).coordinate(-100, 0).coordinate(20, -45).coordinate(40, -60).close()); + PolygonBuilder pb = new PolygonBuilder( + new CoordinatesBuilder().coordinate(10, -20) + .coordinate(100, 0) + .coordinate(-100, 0) + .coordinate(20, -45) + .coordinate(40, -60) + .close() + ); pb.buildS4J(); // Should not throw an exception } public void testPolygonWithUndefinedOrientationDueToCollinearPoints() { - PolygonBuilder pb = new PolygonBuilder(new CoordinatesBuilder() - .coordinate(0.0, 0.0).coordinate(1.0, 1.0).coordinate(-1.0, -1.0).close()); + PolygonBuilder pb = new PolygonBuilder( + new CoordinatesBuilder().coordinate(0.0, 0.0).coordinate(1.0, 1.0).coordinate(-1.0, -1.0).close() + ); InvalidShapeException e = expectThrows(InvalidShapeException.class, pb::buildS4J); assertEquals("Cannot determine orientation: signed area equal to 0", e.getMessage()); } public void testCrossingDateline() { - PolygonBuilder pb = new PolygonBuilder(new CoordinatesBuilder() - .coordinate(170, -10).coordinate(-170, -10).coordinate(-170, 10).coordinate(170, 10).coordinate(170, -10)); + PolygonBuilder pb = new PolygonBuilder( + new CoordinatesBuilder().coordinate(170, -10) + .coordinate(-170, -10) + .coordinate(-170, 10) + .coordinate(170, 10) + .coordinate(170, -10) + ); JtsGeometry geometry = pb.buildS4J(); assertTrue(geometry.getGeom() instanceof org.locationtech.jts.geom.MultiPolygon); - pb = new PolygonBuilder(new CoordinatesBuilder() - .coordinate(180, -10).coordinate(-170, -5).coordinate(-170, 15).coordinate(170, -15).coordinate(180, -10)); + pb = new PolygonBuilder( + new CoordinatesBuilder().coordinate(180, -10) + .coordinate(-170, -5) + .coordinate(-170, 15) + .coordinate(170, -15) + .coordinate(180, -10) + ); geometry = pb.buildS4J(); assertTrue(geometry.getGeom() instanceof org.locationtech.jts.geom.MultiPolygon); } diff --git a/server/src/test/java/org/elasticsearch/index/mapper/LegacyGeoShapeFieldMapperTests.java b/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/mapper/LegacyGeoShapeFieldMapperTests.java similarity index 89% rename from server/src/test/java/org/elasticsearch/index/mapper/LegacyGeoShapeFieldMapperTests.java rename to modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/mapper/LegacyGeoShapeFieldMapperTests.java index 29faa11c443c4..5f2eaaba3d117 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/LegacyGeoShapeFieldMapperTests.java +++ b/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/mapper/LegacyGeoShapeFieldMapperTests.java @@ -5,7 +5,7 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -package org.elasticsearch.index.mapper; +package org.elasticsearch.legacygeo.mapper; import org.apache.lucene.index.IndexableField; import org.apache.lucene.spatial.prefix.PrefixTreeStrategy; @@ -14,7 +14,6 @@ import org.apache.lucene.spatial.prefix.tree.QuadPrefixTree; import org.elasticsearch.ElasticsearchException; import org.elasticsearch.Version; -import org.elasticsearch.core.CheckedConsumer; import org.elasticsearch.common.Strings; import org.elasticsearch.common.geo.GeoUtils; import org.elasticsearch.common.geo.Orientation; @@ -22,10 +21,18 @@ import org.elasticsearch.common.geo.SpatialStrategy; import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.core.CheckedConsumer; import org.elasticsearch.geometry.Point; +import org.elasticsearch.index.mapper.DocumentMapper; +import org.elasticsearch.index.mapper.MappedFieldType; +import org.elasticsearch.index.mapper.Mapper; +import org.elasticsearch.index.mapper.MapperParsingException; +import org.elasticsearch.index.mapper.MapperService; +import org.elasticsearch.index.mapper.MapperTestCase; +import org.elasticsearch.index.mapper.ParsedDocument; import org.elasticsearch.index.query.SearchExecutionContext; +import org.elasticsearch.legacygeo.test.TestLegacyGeoShapeFieldMapperPlugin; import org.elasticsearch.plugins.Plugin; -import org.elasticsearch.test.TestLegacyGeoShapeFieldMapperPlugin; import org.elasticsearch.test.VersionUtils; import java.io.IOException; @@ -64,12 +71,10 @@ protected boolean supportsStoredFields() { @Override protected void registerParameters(ParameterChecker checker) throws IOException { - checker.registerConflictCheck("strategy", - fieldMapping(this::minimalMapping), - fieldMapping(b -> { - b.field("type", "geo_shape"); - b.field("strategy", "term"); - })); + checker.registerConflictCheck("strategy", fieldMapping(this::minimalMapping), fieldMapping(b -> { + b.field("type", "geo_shape"); + b.field("strategy", "term"); + })); checker.registerConflictCheck("tree", b -> b.field("tree", "geohash")); checker.registerConflictCheck("tree_levels", b -> b.field("tree_levels", 5)); @@ -89,7 +94,7 @@ protected void registerParameters(ParameterChecker checker) throws IOException { }); checker.registerUpdateCheck(b -> b.field("coerce", true), m -> { LegacyGeoShapeFieldMapper gpfm = (LegacyGeoShapeFieldMapper) m; - assertTrue(gpfm.coerce.value()); + assertTrue(gpfm.coerce()); }); // TODO - distance_error_pct ends up being subsumed into a calculated value, how to test checker.registerUpdateCheck(b -> b.field("distance_error_pct", 0.8), m -> {}); @@ -147,15 +152,11 @@ public void testDefaultConfiguration() throws IOException { assertEquals(Strings.toString(mapping), mapper.mappingSource().toString()); LegacyGeoShapeFieldMapper geoShapeFieldMapper = (LegacyGeoShapeFieldMapper) fieldMapper; - assertThat(geoShapeFieldMapper.fieldType().tree(), - equalTo(LegacyGeoShapeFieldMapper.Defaults.TREE)); + assertThat(geoShapeFieldMapper.fieldType().tree(), equalTo(LegacyGeoShapeFieldMapper.Defaults.TREE)); assertThat(geoShapeFieldMapper.fieldType().treeLevels(), equalTo(0)); - assertThat(geoShapeFieldMapper.fieldType().pointsOnly(), - equalTo(LegacyGeoShapeFieldMapper.Defaults.POINTS_ONLY)); - assertThat(geoShapeFieldMapper.fieldType().distanceErrorPct(), - equalTo(LegacyGeoShapeFieldMapper.Defaults.DISTANCE_ERROR_PCT)); - assertThat(geoShapeFieldMapper.fieldType().orientation(), - equalTo(Orientation.RIGHT)); + assertThat(geoShapeFieldMapper.fieldType().pointsOnly(), equalTo(LegacyGeoShapeFieldMapper.Defaults.POINTS_ONLY)); + assertThat(geoShapeFieldMapper.fieldType().distanceErrorPct(), equalTo(LegacyGeoShapeFieldMapper.Defaults.DISTANCE_ERROR_PCT)); + assertThat(geoShapeFieldMapper.fieldType().orientation(), equalTo(Orientation.RIGHT)); assertFieldWarnings("strategy"); } @@ -168,7 +169,7 @@ public void testOrientationParsing() throws IOException { ); Mapper fieldMapper = mapper.mappers().getMapper("field"); assertThat(fieldMapper, instanceOf(LegacyGeoShapeFieldMapper.class)); - Orientation orientation = ((LegacyGeoShapeFieldMapper)fieldMapper).fieldType().orientation(); + Orientation orientation = ((LegacyGeoShapeFieldMapper) fieldMapper).fieldType().orientation(); assertThat(orientation, equalTo(Orientation.CLOCKWISE)); assertThat(orientation, equalTo(Orientation.LEFT)); assertThat(orientation, equalTo(Orientation.CW)); @@ -179,7 +180,7 @@ public void testOrientationParsing() throws IOException { ); fieldMapper = mapper.mappers().getMapper("field"); assertThat(fieldMapper, instanceOf(LegacyGeoShapeFieldMapper.class)); - orientation = ((LegacyGeoShapeFieldMapper)fieldMapper).fieldType().orientation(); + orientation = ((LegacyGeoShapeFieldMapper) fieldMapper).fieldType().orientation(); assertThat(orientation, equalTo(Orientation.COUNTER_CLOCKWISE)); assertThat(orientation, equalTo(Orientation.RIGHT)); assertThat(orientation, equalTo(Orientation.CCW)); @@ -195,16 +196,14 @@ public void testCoerceParsing() throws IOException { ); Mapper fieldMapper = mapper.mappers().getMapper("field"); assertThat(fieldMapper, instanceOf(LegacyGeoShapeFieldMapper.class)); - boolean coerce = ((LegacyGeoShapeFieldMapper)fieldMapper).coerce(); + boolean coerce = ((LegacyGeoShapeFieldMapper) fieldMapper).coerce(); assertThat(coerce, equalTo(true)); // explicit false coerce test - mapper = createDocumentMapper( - fieldMapping(b -> b.field("type", "geo_shape").field("tree", "quadtree").field("coerce", false)) - ); + mapper = createDocumentMapper(fieldMapping(b -> b.field("type", "geo_shape").field("tree", "quadtree").field("coerce", false))); fieldMapper = mapper.mappers().getMapper("field"); assertThat(fieldMapper, instanceOf(LegacyGeoShapeFieldMapper.class)); - coerce = ((LegacyGeoShapeFieldMapper)fieldMapper).coerce(); + coerce = ((LegacyGeoShapeFieldMapper) fieldMapper).coerce(); assertThat(coerce, equalTo(false)); assertFieldWarnings("tree", "strategy"); } @@ -218,7 +217,7 @@ public void testIgnoreZValue() throws IOException { ); Mapper fieldMapper = mapper.mappers().getMapper("field"); assertThat(fieldMapper, instanceOf(LegacyGeoShapeFieldMapper.class)); - boolean ignoreZValue = ((LegacyGeoShapeFieldMapper)fieldMapper).ignoreZValue(); + boolean ignoreZValue = ((LegacyGeoShapeFieldMapper) fieldMapper).ignoreZValue(); assertThat(ignoreZValue, equalTo(true)); // explicit false accept_z_value test @@ -227,7 +226,7 @@ public void testIgnoreZValue() throws IOException { ); fieldMapper = mapper.mappers().getMapper("field"); assertThat(fieldMapper, instanceOf(LegacyGeoShapeFieldMapper.class)); - ignoreZValue = ((LegacyGeoShapeFieldMapper)fieldMapper).ignoreZValue(); + ignoreZValue = ((LegacyGeoShapeFieldMapper) fieldMapper).ignoreZValue(); assertThat(ignoreZValue, equalTo(false)); assertFieldWarnings("strategy", "tree"); } @@ -241,7 +240,7 @@ public void testIgnoreMalformedParsing() throws IOException { ); Mapper fieldMapper = mapper.mappers().getMapper("field"); assertThat(fieldMapper, instanceOf(LegacyGeoShapeFieldMapper.class)); - boolean ignoreMalformed = ((LegacyGeoShapeFieldMapper)fieldMapper).ignoreMalformed(); + boolean ignoreMalformed = ((LegacyGeoShapeFieldMapper) fieldMapper).ignoreMalformed(); assertThat(ignoreMalformed, equalTo(true)); // explicit false ignore_malformed test @@ -250,7 +249,7 @@ public void testIgnoreMalformedParsing() throws IOException { ); fieldMapper = mapper.mappers().getMapper("field"); assertThat(fieldMapper, instanceOf(LegacyGeoShapeFieldMapper.class)); - ignoreMalformed = ((LegacyGeoShapeFieldMapper)fieldMapper).ignoreMalformed(); + ignoreMalformed = ((LegacyGeoShapeFieldMapper) fieldMapper).ignoreMalformed(); assertThat(ignoreMalformed, equalTo(false)); assertFieldWarnings("tree", "strategy"); } @@ -479,11 +478,21 @@ public void testGeoShapeMapperMerge() throws Exception { LegacyGeoShapeFieldMapper geoShapeFieldMapper = (LegacyGeoShapeFieldMapper) fieldMapper; assertThat(geoShapeFieldMapper.fieldType().orientation(), equalTo(Orientation.CCW)); - Exception e = expectThrows(IllegalArgumentException.class, () -> merge(mapperService, fieldMapping(b -> b.field("type", "geo_shape") - .field("tree", "quadtree") - .field("strategy", "term").field("precision", "1km") - .field("tree_levels", 26).field("distance_error_pct", 26) - .field("orientation", "cw")))); + Exception e = expectThrows( + IllegalArgumentException.class, + () -> merge( + mapperService, + fieldMapping( + b -> b.field("type", "geo_shape") + .field("tree", "quadtree") + .field("strategy", "term") + .field("precision", "1km") + .field("tree_levels", 26) + .field("distance_error_pct", 26) + .field("orientation", "cw") + ) + ) + ); assertThat(e.getMessage(), containsString("Cannot update parameter [strategy] from [recursive] to [term]")); assertThat(e.getMessage(), containsString("Cannot update parameter [tree] from [geohash] to [quadtree]")); assertThat(e.getMessage(), containsString("Cannot update parameter [tree_levels] from [8] to [26]")); @@ -502,12 +511,18 @@ public void testGeoShapeMapperMerge() throws Exception { assertThat(geoShapeFieldMapper.fieldType().orientation(), equalTo(Orientation.CCW)); // correct mapping - merge(mapperService, fieldMapping(b -> b.field("type", "geo_shape") - .field("tree", "geohash") - .field("strategy", "recursive") - .field("precision", "1m") - .field("tree_levels", 8).field("distance_error_pct", 0.001) - .field("orientation", "cw"))); + merge( + mapperService, + fieldMapping( + b -> b.field("type", "geo_shape") + .field("tree", "geohash") + .field("strategy", "recursive") + .field("precision", "1m") + .field("tree_levels", 8) + .field("distance_error_pct", 0.001) + .field("orientation", "cw") + ) + ); fieldMapper = mapperService.documentMapper().mappers().getMapper("field"); assertThat(fieldMapper, instanceOf(LegacyGeoShapeFieldMapper.class)); @@ -608,29 +623,32 @@ public void testDisallowExpensiveQueries() throws IOException { assertThat(fieldMapper, instanceOf(LegacyGeoShapeFieldMapper.class)); LegacyGeoShapeFieldMapper geoShapeFieldMapper = (LegacyGeoShapeFieldMapper) fieldMapper; - ElasticsearchException e = expectThrows(ElasticsearchException.class, - () -> geoShapeFieldMapper.fieldType().geoShapeQuery( - new Point(-10, 10), "location", SpatialStrategy.TERM, ShapeRelation.INTERSECTS, searchExecutionContext)); - assertEquals("[geo-shape] queries on [PrefixTree geo shapes] cannot be executed when " + - "'search.allow_expensive_queries' is set to false.", e.getMessage()); + ElasticsearchException e = expectThrows( + ElasticsearchException.class, + () -> geoShapeFieldMapper.fieldType() + .geoShapeQuery(new Point(-10, 10), "location", SpatialStrategy.TERM, ShapeRelation.INTERSECTS, searchExecutionContext) + ); + assertEquals( + "[geo-shape] queries on [PrefixTree geo shapes] cannot be executed when " + "'search.allow_expensive_queries' is set to false.", + e.getMessage() + ); assertFieldWarnings("tree", "strategy"); } @Override protected String[] getParseMinimalWarnings() { - return new String[]{"Parameter [strategy] is deprecated and will be removed in a future version"}; + return new String[] { "Parameter [strategy] is deprecated and will be removed in a future version" }; } @Override protected String[] getParseMaximalWarnings() { - return new String[]{ + return new String[] { "Parameter [strategy] is deprecated and will be removed in a future version", "Parameter [tree] is deprecated and will be removed in a future version", "Parameter [tree_levels] is deprecated and will be removed in a future version", "Parameter [precision] is deprecated and will be removed in a future version", "Parameter [distance_error_pct] is deprecated and will be removed in a future version", - "Parameter [points_only] is deprecated and will be removed in a future version" - }; + "Parameter [points_only] is deprecated and will be removed in a future version" }; } public void testGeoShapeArrayParsing() throws Exception { @@ -650,7 +668,7 @@ public void testGeoShapeArrayParsing() throws Exception { } protected void assertSearchable(MappedFieldType fieldType) { - //always searchable even if it uses TextSearchInfo.NONE + // always searchable even if it uses TextSearchInfo.NONE assertTrue(fieldType.isSearchable()); } diff --git a/server/src/test/java/org/elasticsearch/index/mapper/LegacyGeoShapeFieldTypeTests.java b/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/mapper/LegacyGeoShapeFieldTypeTests.java similarity index 89% rename from server/src/test/java/org/elasticsearch/index/mapper/LegacyGeoShapeFieldTypeTests.java rename to modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/mapper/LegacyGeoShapeFieldTypeTests.java index 5c797b9f64c68..68c5ae8af3874 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/LegacyGeoShapeFieldTypeTests.java +++ b/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/mapper/LegacyGeoShapeFieldTypeTests.java @@ -5,11 +5,14 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -package org.elasticsearch.index.mapper; +package org.elasticsearch.legacygeo.mapper; import org.elasticsearch.Version; import org.elasticsearch.common.geo.SpatialStrategy; -import org.elasticsearch.index.mapper.LegacyGeoShapeFieldMapper.GeoShapeFieldType; +import org.elasticsearch.index.mapper.FieldTypeTestCase; +import org.elasticsearch.index.mapper.MappedFieldType; +import org.elasticsearch.index.mapper.MapperBuilderContext; +import org.elasticsearch.legacygeo.mapper.LegacyGeoShapeFieldMapper.GeoShapeFieldType; import org.elasticsearch.test.VersionUtils; import java.io.IOException; @@ -33,11 +36,10 @@ public void testSetStrategyName() { public void testFetchSourceValue() throws IOException { Version version = VersionUtils.randomPreviousCompatibleVersion(random(), Version.V_8_0_0); - MappedFieldType mapper = new LegacyGeoShapeFieldMapper.Builder("field", version, false, true) - .build(MapperBuilderContext.ROOT).fieldType(); + MappedFieldType mapper = new LegacyGeoShapeFieldMapper.Builder("field", version, false, true).build(MapperBuilderContext.ROOT) + .fieldType(); - Map jsonLineString = Map.of("type", "LineString", "coordinates", - List.of(List.of(42.0, 27.1), List.of(30.0, 50.0))); + Map jsonLineString = Map.of("type", "LineString", "coordinates", List.of(List.of(42.0, 27.1), List.of(30.0, 50.0))); Map jsonPoint = Map.of("type", "Point", "coordinates", List.of(14.0, 15.0)); Map jsonMalformed = Map.of("type", "LineString", "coordinates", "foo"); String wktLineString = "LINESTRING (42.0 27.1, 30.0 50.0)"; diff --git a/server/src/test/java/org/elasticsearch/search/geo/LegacyGeoShapeQueryTests.java b/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/search/LegacyGeoShapeQueryTests.java similarity index 61% rename from server/src/test/java/org/elasticsearch/search/geo/LegacyGeoShapeQueryTests.java rename to modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/search/LegacyGeoShapeQueryTests.java index 05cff23acb691..4a802b5b7c420 100644 --- a/server/src/test/java/org/elasticsearch/search/geo/LegacyGeoShapeQueryTests.java +++ b/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/search/LegacyGeoShapeQueryTests.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.search.geo; +package org.elasticsearch.legacygeo.search; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.common.Strings; @@ -18,10 +18,11 @@ import org.elasticsearch.geometry.Geometry; import org.elasticsearch.geometry.MultiPoint; import org.elasticsearch.geometry.Point; -import org.elasticsearch.index.mapper.LegacyGeoShapeFieldMapper; import org.elasticsearch.index.mapper.MapperParsingException; +import org.elasticsearch.legacygeo.mapper.LegacyGeoShapeFieldMapper; +import org.elasticsearch.legacygeo.test.TestLegacyGeoShapeFieldMapperPlugin; import org.elasticsearch.plugins.Plugin; -import org.elasticsearch.test.TestLegacyGeoShapeFieldMapperPlugin; +import org.elasticsearch.search.geo.GeoShapeQueryTestCase; import java.io.IOException; import java.util.Collection; @@ -38,19 +39,19 @@ public class LegacyGeoShapeQueryTests extends GeoShapeQueryTestCase { private static final String[] PREFIX_TREES = new String[] { LegacyGeoShapeFieldMapper.PrefixTrees.GEOHASH, - LegacyGeoShapeFieldMapper.PrefixTrees.QUADTREE - }; + LegacyGeoShapeFieldMapper.PrefixTrees.QUADTREE }; @Override protected Collection> getPlugins() { return Collections.singleton(TestLegacyGeoShapeFieldMapperPlugin.class); } - @Override protected void createMapping(String indexName, String fieldName, Settings settings) throws Exception { - final XContentBuilder xcb = XContentFactory.jsonBuilder().startObject() - .startObject("properties").startObject(fieldName) + final XContentBuilder xcb = XContentFactory.jsonBuilder() + .startObject() + .startObject("properties") + .startObject(fieldName) .field("type", "geo_shape") .field("tree", randomFrom(PREFIX_TREES)) .endObject() @@ -65,58 +66,72 @@ protected boolean forbidPrivateIndexSettings() { } public void testPointsOnlyExplicit() throws Exception { - String mapping = Strings.toString(XContentFactory.jsonBuilder().startObject() - .startObject("properties").startObject(defaultGeoFieldName) - .field("type", "geo_shape") - .field("tree", randomBoolean() ? "quadtree" : "geohash") - .field("tree_levels", "6") - .field("distance_error_pct", "0.01") - .field("points_only", true) - .endObject() - .endObject().endObject()); + String mapping = Strings.toString( + XContentFactory.jsonBuilder() + .startObject() + .startObject("properties") + .startObject(defaultGeoFieldName) + .field("type", "geo_shape") + .field("tree", randomBoolean() ? "quadtree" : "geohash") + .field("tree_levels", "6") + .field("distance_error_pct", "0.01") + .field("points_only", true) + .endObject() + .endObject() + .endObject() + ); client().admin().indices().prepareCreate("geo_points_only").setMapping(mapping).get(); ensureGreen(); // MULTIPOINT MultiPoint multiPoint = GeometryTestUtils.randomMultiPoint(false); - client().prepareIndex("geo_points_only").setId("1") + client().prepareIndex("geo_points_only") + .setId("1") .setSource(GeoJson.toXContent(multiPoint, jsonBuilder().startObject().field(defaultGeoFieldName), null).endObject()) - .setRefreshPolicy(IMMEDIATE).get(); + .setRefreshPolicy(IMMEDIATE) + .get(); // POINT - Point point = GeometryTestUtils.randomPoint(false); - client().prepareIndex("geo_points_only").setId("2") + Point point = GeometryTestUtils.randomPoint(false); + client().prepareIndex("geo_points_only") + .setId("2") .setSource(GeoJson.toXContent(point, jsonBuilder().startObject().field(defaultGeoFieldName), null).endObject()) - .setRefreshPolicy(IMMEDIATE).get(); + .setRefreshPolicy(IMMEDIATE) + .get(); // test that point was inserted - SearchResponse response = client().prepareSearch("geo_points_only") - .setQuery(matchAllQuery()) - .get(); + SearchResponse response = client().prepareSearch("geo_points_only").setQuery(matchAllQuery()).get(); assertEquals(2, response.getHits().getTotalHits().value); } public void testPointsOnly() throws Exception { - String mapping = Strings.toString(XContentFactory.jsonBuilder().startObject() - .startObject("properties").startObject(defaultGeoFieldName) - .field("type", "geo_shape") - .field("tree", randomBoolean() ? "quadtree" : "geohash") - .field("tree_levels", "6") - .field("distance_error_pct", "0.01") - .field("points_only", true) - .endObject() - .endObject().endObject()); + String mapping = Strings.toString( + XContentFactory.jsonBuilder() + .startObject() + .startObject("properties") + .startObject(defaultGeoFieldName) + .field("type", "geo_shape") + .field("tree", randomBoolean() ? "quadtree" : "geohash") + .field("tree_levels", "6") + .field("distance_error_pct", "0.01") + .field("points_only", true) + .endObject() + .endObject() + .endObject() + ); client().admin().indices().prepareCreate("geo_points_only").setMapping(mapping).get(); ensureGreen(); Geometry geometry = GeometryTestUtils.randomGeometry(false); try { - client().prepareIndex("geo_points_only").setId("1") + client().prepareIndex("geo_points_only") + .setId("1") .setSource(GeoJson.toXContent(geometry, jsonBuilder().startObject().field(defaultGeoFieldName), null).endObject()) - .setRefreshPolicy(IMMEDIATE).get(); + .setRefreshPolicy(IMMEDIATE) + .get(); } catch (MapperParsingException e) { // Random geometry generator created something other than a POINT type, verify the correct exception is thrown assertThat(e.getMessage(), containsString("is configured for points only")); @@ -124,37 +139,40 @@ public void testPointsOnly() throws Exception { } // test that point was inserted - SearchResponse response = - client().prepareSearch("geo_points_only").setQuery(geoIntersectionQuery(defaultGeoFieldName, geometry)).get(); + SearchResponse response = client().prepareSearch("geo_points_only") + .setQuery(geoIntersectionQuery(defaultGeoFieldName, geometry)) + .get(); assertEquals(1, response.getHits().getTotalHits().value); } public void testFieldAlias() throws IOException { - String mapping = Strings.toString(XContentFactory.jsonBuilder() - .startObject() - .startObject("properties") - .startObject(defaultGeoFieldName) - .field("type", "geo_shape") - .field("tree", randomBoolean() ? "quadtree" : "geohash") - .endObject() - .startObject("alias") - .field("type", "alias") - .field("path", defaultGeoFieldName) - .endObject() - .endObject() - .endObject()); + String mapping = Strings.toString( + XContentFactory.jsonBuilder() + .startObject() + .startObject("properties") + .startObject(defaultGeoFieldName) + .field("type", "geo_shape") + .field("tree", randomBoolean() ? "quadtree" : "geohash") + .endObject() + .startObject("alias") + .field("type", "alias") + .field("path", defaultGeoFieldName) + .endObject() + .endObject() + .endObject() + ); client().admin().indices().prepareCreate(defaultIndexName).setMapping(mapping).get(); ensureGreen(); MultiPoint multiPoint = GeometryTestUtils.randomMultiPoint(false); - client().prepareIndex(defaultIndexName).setId("1") + client().prepareIndex(defaultIndexName) + .setId("1") .setSource(GeoJson.toXContent(multiPoint, jsonBuilder().startObject().field(defaultGeoFieldName), null).endObject()) - .setRefreshPolicy(IMMEDIATE).get(); - - SearchResponse response = client().prepareSearch(defaultIndexName) - .setQuery(geoShapeQuery("alias", multiPoint)) + .setRefreshPolicy(IMMEDIATE) .get(); + + SearchResponse response = client().prepareSearch(defaultIndexName).setQuery(geoShapeQuery("alias", multiPoint)).get(); assertEquals(1, response.getHits().getTotalHits().value); } } diff --git a/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/search/LegacyGeoUtilsTests.java b/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/search/LegacyGeoUtilsTests.java new file mode 100644 index 0000000000000..59178d821825d --- /dev/null +++ b/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/search/LegacyGeoUtilsTests.java @@ -0,0 +1,86 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.legacygeo.search; + +import org.apache.lucene.spatial.prefix.tree.Cell; +import org.apache.lucene.spatial.prefix.tree.GeohashPrefixTree; +import org.apache.lucene.spatial.prefix.tree.QuadPrefixTree; +import org.elasticsearch.common.geo.GeoUtils; +import org.elasticsearch.test.ESTestCase; +import org.locationtech.spatial4j.context.SpatialContext; +import org.locationtech.spatial4j.distance.DistanceUtils; + +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.lessThanOrEqualTo; + +public class LegacyGeoUtilsTests extends ESTestCase { + + public void testPrefixTreeCellSizes() { + assertThat(GeoUtils.EARTH_SEMI_MAJOR_AXIS, equalTo(DistanceUtils.EARTH_EQUATORIAL_RADIUS_KM * 1000)); + assertThat(GeoUtils.quadTreeCellWidth(0), lessThanOrEqualTo(GeoUtils.EARTH_EQUATOR)); + + SpatialContext spatialContext = new SpatialContext(true); + + GeohashPrefixTree geohashPrefixTree = new GeohashPrefixTree(spatialContext, GeohashPrefixTree.getMaxLevelsPossible() / 2); + Cell gNode = geohashPrefixTree.getWorldCell(); + + for (int i = 0; i < geohashPrefixTree.getMaxLevels(); i++) { + double width = GeoUtils.geoHashCellWidth(i); + double height = GeoUtils.geoHashCellHeight(i); + double size = GeoUtils.geoHashCellSize(i); + double degrees = 360.0 * width / GeoUtils.EARTH_EQUATOR; + int level = GeoUtils.quadTreeLevelsForPrecision(size); + + assertThat(GeoUtils.quadTreeCellWidth(level), lessThanOrEqualTo(width)); + assertThat(GeoUtils.quadTreeCellHeight(level), lessThanOrEqualTo(height)); + assertThat(GeoUtils.geoHashLevelsForPrecision(size), equalTo(geohashPrefixTree.getLevelForDistance(degrees))); + + assertThat( + "width at level " + i, + gNode.getShape().getBoundingBox().getWidth(), + equalTo(360.d * width / GeoUtils.EARTH_EQUATOR) + ); + assertThat( + "height at level " + i, + gNode.getShape().getBoundingBox().getHeight(), + equalTo(180.d * height / GeoUtils.EARTH_POLAR_DISTANCE) + ); + + gNode = gNode.getNextLevelCells(null).next(); + } + + QuadPrefixTree quadPrefixTree = new QuadPrefixTree(spatialContext); + Cell qNode = quadPrefixTree.getWorldCell(); + for (int i = 0; i < quadPrefixTree.getMaxLevels(); i++) { + + double degrees = 360.0 / (1L << i); + double width = GeoUtils.quadTreeCellWidth(i); + double height = GeoUtils.quadTreeCellHeight(i); + double size = GeoUtils.quadTreeCellSize(i); + int level = GeoUtils.quadTreeLevelsForPrecision(size); + + assertThat(GeoUtils.quadTreeCellWidth(level), lessThanOrEqualTo(width)); + assertThat(GeoUtils.quadTreeCellHeight(level), lessThanOrEqualTo(height)); + assertThat(GeoUtils.quadTreeLevelsForPrecision(size), equalTo(quadPrefixTree.getLevelForDistance(degrees))); + + assertThat( + "width at level " + i, + qNode.getShape().getBoundingBox().getWidth(), + equalTo(360.d * width / GeoUtils.EARTH_EQUATOR) + ); + assertThat( + "height at level " + i, + qNode.getShape().getBoundingBox().getHeight(), + equalTo(180.d * height / GeoUtils.EARTH_POLAR_DISTANCE) + ); + + qNode = qNode.getNextLevelCells(null).next(); + } + } +} diff --git a/server/src/test/java/org/elasticsearch/test/hamcrest/ElasticsearchGeoAssertions.java b/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/test/ElasticsearchGeoAssertions.java similarity index 74% rename from server/src/test/java/org/elasticsearch/test/hamcrest/ElasticsearchGeoAssertions.java rename to modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/test/ElasticsearchGeoAssertions.java index a86dc0ef87aa2..b37ac93159d7a 100644 --- a/server/src/test/java/org/elasticsearch/test/hamcrest/ElasticsearchGeoAssertions.java +++ b/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/test/ElasticsearchGeoAssertions.java @@ -6,15 +6,15 @@ * Side Public License, v 1. */ -package org.elasticsearch.test.hamcrest; +package org.elasticsearch.legacygeo.test; import org.elasticsearch.common.geo.GeoDistance; import org.elasticsearch.common.geo.GeoPoint; -import org.elasticsearch.common.geo.parsers.ShapeParser; import org.elasticsearch.common.unit.DistanceUnit; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.geometry.Line; import org.elasticsearch.geometry.MultiLine; +import org.elasticsearch.legacygeo.parsers.ShapeParser; import org.hamcrest.Matcher; import org.junit.Assert; import org.locationtech.jts.geom.Coordinate; @@ -40,13 +40,13 @@ public class ElasticsearchGeoAssertions { - private static int top(Coordinate...points) { + private static int top(Coordinate... points) { int top = 0; for (int i = 1; i < points.length; i++) { - if(points[i].y < points[top].y) { + if (points[i].y < points[top].y) { top = i; - } else if(points[i].y == points[top].y) { - if(points[i].x <= points[top].x) { + } else if (points[i].y == points[top].y) { + if (points[i].x <= points[top].x) { top = i; } } @@ -54,20 +54,20 @@ private static int top(Coordinate...points) { return top; } - private static int prev(int top, Coordinate...points) { + private static int prev(int top, Coordinate... points) { for (int i = 1; i < points.length; i++) { int p = (top + points.length - i) % points.length; - if((points[p].x != points[top].x) || (points[p].y != points[top].y)) { + if ((points[p].x != points[top].x) || (points[p].y != points[top].y)) { return p; } } return -1; } - private static int next(int top, Coordinate...points) { + private static int next(int top, Coordinate... points) { for (int i = 1; i < points.length; i++) { int n = (top + i) % points.length; - if((points[n].x != points[top].x) || (points[n].y != points[top].y)) { + if ((points[n].x != points[top].x) || (points[n].y != points[top].y)) { return n; } } @@ -85,16 +85,16 @@ private static Coordinate[] fixedOrderedRing(Coordinate[] points, boolean direct final int prev = prev(top, points); final boolean orientation = points[next].x < points[prev].x; - if(orientation != direction) { + if (orientation != direction) { List asList = Arrays.asList(points); Collections.reverse(asList); return fixedOrderedRing(asList, direction); } else { - if(top>0) { + if (top > 0) { Coordinate[] aligned = new Coordinate[points.length]; - System.arraycopy(points, top, aligned, 0, points.length-top-1); - System.arraycopy(points, 0, aligned, points.length-top-1, top); - aligned[aligned.length-1] = aligned[0]; + System.arraycopy(points, top, aligned, 0, points.length - top - 1); + System.arraycopy(points, 0, aligned, points.length - top - 1, top); + aligned[aligned.length - 1] = aligned[0]; return aligned; } else { return points; @@ -108,13 +108,13 @@ public static void assertEquals(Coordinate c1, Coordinate c2) { } private static boolean isRing(Coordinate[] c) { - return (c[0].x == c[c.length-1].x) && (c[0].y == c[c.length-1].y); + return (c[0].x == c[c.length - 1].x) && (c[0].y == c[c.length - 1].y); } public static void assertEquals(Coordinate[] c1, Coordinate[] c2) { Assert.assertEquals(c1.length, c2.length); - if(isRing(c1) && isRing(c2)) { + if (isRing(c1) && isRing(c2)) { c1 = fixedOrderedRing(c1, true); c2 = fixedOrderedRing(c2, true); } @@ -157,7 +157,7 @@ public static void assertEquals(MultiPolygon p1, MultiPolygon p2) { } public static void assertEquals(Geometry s1, Geometry s2) { - if(s1 instanceof LineString && s2 instanceof LineString) { + if (s1 instanceof LineString && s2 instanceof LineString) { assertEquals((LineString) s1, (LineString) s2); } else if (s1 instanceof Polygon && s2 instanceof Polygon) { @@ -173,8 +173,9 @@ public static void assertEquals(Geometry s1, Geometry s2) { assertEquals((MultiLineString) s1, (MultiLineString) s2); } else { - throw new RuntimeException("equality of shape types not supported [" + s1.getClass().getName() + " and " + - s2.getClass().getName() + "]"); + throw new RuntimeException( + "equality of shape types not supported [" + s1.getClass().getName() + " and " + s2.getClass().getName() + "]" + ); } } @@ -190,9 +191,9 @@ public static void assertEquals(ShapeCollection s1, ShapeCollection s2) { } public static void assertEquals(Object s1, Object s2) { - if(s1 instanceof JtsGeometry && s2 instanceof JtsGeometry) { + if (s1 instanceof JtsGeometry && s2 instanceof JtsGeometry) { assertEquals((JtsGeometry) s1, (JtsGeometry) s2); - } else if(s1 instanceof JtsPoint && s2 instanceof JtsPoint) { + } else if (s1 instanceof JtsPoint && s2 instanceof JtsPoint) { JtsPoint p1 = (JtsPoint) s1; JtsPoint p2 = (JtsPoint) s2; Assert.assertEquals(p1, p2); @@ -203,76 +204,78 @@ public static void assertEquals(Object s1, Object s2) { } else if (s1 instanceof RectangleImpl && s2 instanceof RectangleImpl) { Assert.assertEquals(s1, s2); } else if (s1 instanceof org.apache.lucene.geo.Line[] && s2 instanceof org.apache.lucene.geo.Line[]) { - Assert.assertArrayEquals((org.apache.lucene.geo.Line[])s1, (org.apache.lucene.geo.Line[])s2); - } else if (s1 instanceof org.apache.lucene.geo.Polygon[] && s2 instanceof org.apache.lucene.geo.Polygon[]) { + Assert.assertArrayEquals((org.apache.lucene.geo.Line[]) s1, (org.apache.lucene.geo.Line[]) s2); + } else if (s1 instanceof org.apache.lucene.geo.Polygon[] && s2 instanceof org.apache.lucene.geo.Polygon[]) { Assert.assertArrayEquals((org.apache.lucene.geo.Polygon[]) s1, (org.apache.lucene.geo.Polygon[]) s2); } else if ((s1 instanceof org.apache.lucene.geo.Line && s2 instanceof org.apache.lucene.geo.Line) || (s1 instanceof org.apache.lucene.geo.Polygon && s2 instanceof org.apache.lucene.geo.Polygon) || (s1 instanceof org.apache.lucene.geo.Rectangle && s2 instanceof org.apache.lucene.geo.Rectangle) || (s1 instanceof GeoPoint && s2 instanceof GeoPoint)) { - Assert.assertEquals(s1, s2); - } else if (s1 instanceof Object[] && s2 instanceof Object[]) { - Assert.assertArrayEquals((Object[]) s1, (Object[]) s2); - } else if (s1 instanceof org.elasticsearch.geometry.Geometry && s2 instanceof org.elasticsearch.geometry.Geometry) { - Assert.assertEquals(s1, s2); - } else { - //We want to know the type of the shape because we test shape equality in a special way... - //... in particular we test that one ring is equivalent to another ring even if the points are rotated or reversed. - throw new RuntimeException( - "equality of shape types not supported [" + s1.getClass().getName() + " and " + s2.getClass().getName() + "]"); - } + Assert.assertEquals(s1, s2); + } else if (s1 instanceof Object[] && s2 instanceof Object[]) { + Assert.assertArrayEquals((Object[]) s1, (Object[]) s2); + } else if (s1 instanceof org.elasticsearch.geometry.Geometry && s2 instanceof org.elasticsearch.geometry.Geometry) { + Assert.assertEquals(s1, s2); + } else { + // We want to know the type of the shape because we test shape equality in a special way... + // ... in particular we test that one ring is equivalent to another ring even if the points are rotated or reversed. + throw new RuntimeException( + "equality of shape types not supported [" + s1.getClass().getName() + " and " + s2.getClass().getName() + "]" + ); + } } @Deprecated private static Geometry unwrapJTS(Object shape) { assertThat(shape, instanceOf(JtsGeometry.class)); - return ((JtsGeometry)shape).getGeom(); + return ((JtsGeometry) shape).getGeom(); } public static void assertMultiPolygon(Object shape, boolean useJTS) { if (useJTS) { - assertTrue("expected MultiPolygon but found " + unwrapJTS(shape).getClass().getName(), - unwrapJTS(shape) instanceof MultiPolygon); + assertTrue( + "expected MultiPolygon but found " + unwrapJTS(shape).getClass().getName(), + unwrapJTS(shape) instanceof MultiPolygon + ); } else { - assertTrue("expected Polygon[] but found " + shape.getClass().getName(), - shape instanceof org.elasticsearch.geometry.MultiPolygon); + assertTrue( + "expected Polygon[] but found " + shape.getClass().getName(), + shape instanceof org.elasticsearch.geometry.MultiPolygon + ); } } public static void assertPolygon(Object shape, boolean useJTS) { if (useJTS) { - assertTrue("expected Polygon but found " - + unwrapJTS(shape).getClass().getName(), unwrapJTS(shape) instanceof Polygon); + assertTrue("expected Polygon but found " + unwrapJTS(shape).getClass().getName(), unwrapJTS(shape) instanceof Polygon); } else { - assertTrue("expected Polygon but found " + shape.getClass().getName(), - shape instanceof org.elasticsearch.geometry.Polygon); + assertTrue("expected Polygon but found " + shape.getClass().getName(), shape instanceof org.elasticsearch.geometry.Polygon); } } public static void assertLineString(Object shape, boolean useJTS) { if (useJTS) { - assertTrue("expected LineString but found " - + unwrapJTS(shape).getClass().getName(), unwrapJTS(shape) instanceof LineString); + assertTrue("expected LineString but found " + unwrapJTS(shape).getClass().getName(), unwrapJTS(shape) instanceof LineString); } else { - assertTrue("expected Line but found " + shape.getClass().getName(), - shape instanceof Line); + assertTrue("expected Line but found " + shape.getClass().getName(), shape instanceof Line); } } public static void assertMultiLineString(Object shape, boolean useJTS) { if (useJTS) { - assertTrue("expected MultiLineString but found " - + unwrapJTS(shape).getClass().getName(), unwrapJTS(shape) instanceof MultiLineString); + assertTrue( + "expected MultiLineString but found " + unwrapJTS(shape).getClass().getName(), + unwrapJTS(shape) instanceof MultiLineString + ); } else { - assertTrue("expected Line[] but found " + shape.getClass().getName(), - shape instanceof MultiLine); + assertTrue("expected Line[] but found " + shape.getClass().getName(), shape instanceof MultiLine); } } public static void assertDistance(String geohash1, String geohash2, Matcher match) { GeoPoint p1 = new GeoPoint(geohash1); GeoPoint p2 = new GeoPoint(geohash2); - assertDistance(p1.lat(), p1.lon(), p2.lat(),p2.lon(), match); + assertDistance(p1.lat(), p1.lon(), p2.lat(), p2.lon(), match); } public static void assertDistance(double lat1, double lon1, double lat2, double lon2, Matcher match) { @@ -288,8 +291,10 @@ public static void assertValidException(XContentParser parser, Class expected ShapeParser.parse(parser).buildS4J(); Assert.fail("process completed successfully when " + expectedException.getName() + " expected"); } catch (Exception e) { - assertTrue("expected " + expectedException.getName() + " but found " + e.getClass().getName(), - e.getClass().equals(expectedException)); + assertTrue( + "expected " + expectedException.getName() + " but found " + e.getClass().getName(), + e.getClass().equals(expectedException) + ); } } } diff --git a/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/test/RandomGeoGenerator.java b/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/test/RandomGeoGenerator.java new file mode 100644 index 0000000000000..d70c07f0e9eac --- /dev/null +++ b/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/test/RandomGeoGenerator.java @@ -0,0 +1,85 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.legacygeo.test; + +import org.elasticsearch.common.geo.GeoPoint; + +import java.util.Random; + +/** + * Random geo generation utilities for randomized {@code geo_point} type testing + * does not depend on jts or spatial4j. Use {@link org.elasticsearch.legacygeo.test.RandomShapeGenerator} + * to create random OGC compliant shapes. + */ +public class RandomGeoGenerator { + + public static void randomPoint(Random r, double[] pt) { + final double[] min = { -180, -90 }; + final double[] max = { 180, 90 }; + randomPointIn(r, min[0], min[1], max[0], max[1], pt); + } + + public static void randomPointIn( + Random r, + final double minLon, + final double minLat, + final double maxLon, + final double maxLat, + double[] pt + ) { + assert pt != null && pt.length == 2; + + // normalize min and max + double[] min = { normalizeLongitude(minLon), normalizeLatitude(minLat) }; + double[] max = { normalizeLongitude(maxLon), normalizeLatitude(maxLat) }; + final double[] tMin = new double[2]; + final double[] tMax = new double[2]; + tMin[0] = Math.min(min[0], max[0]); + tMax[0] = Math.max(min[0], max[0]); + tMin[1] = Math.min(min[1], max[1]); + tMax[1] = Math.max(min[1], max[1]); + + pt[0] = tMin[0] + r.nextDouble() * (tMax[0] - tMin[0]); + pt[1] = tMin[1] + r.nextDouble() * (tMax[1] - tMin[1]); + } + + public static GeoPoint randomPoint(Random r) { + return randomPointIn(r, -180, -90, 180, 90); + } + + public static GeoPoint randomPointIn(Random r, final double minLon, final double minLat, final double maxLon, final double maxLat) { + double[] pt = new double[2]; + randomPointIn(r, minLon, minLat, maxLon, maxLat, pt); + return new GeoPoint(pt[1], pt[0]); + } + + /** Puts latitude in range of -90 to 90. */ + private static double normalizeLatitude(double latitude) { + if (latitude >= -90 && latitude <= 90) { + return latitude; // common case, and avoids slight double precision shifting + } + double off = Math.abs((latitude + 90) % 360); + return (off <= 180 ? off : 360 - off) - 90; + } + + /** Puts longitude in range of -180 to +180. */ + private static double normalizeLongitude(double longitude) { + if (longitude >= -180 && longitude <= 180) { + return longitude; // common case, and avoids slight double precision shifting + } + double off = (longitude + 180) % 360; + if (off < 0) { + return 180 + off; + } else if (off == 0 && longitude > 0) { + return 180; + } else { + return -180 + off; + } + } +} diff --git a/server/src/test/java/org/elasticsearch/test/geo/RandomShapeGenerator.java b/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/test/RandomShapeGenerator.java similarity index 89% rename from server/src/test/java/org/elasticsearch/test/geo/RandomShapeGenerator.java rename to modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/test/RandomShapeGenerator.java index 5587bbc65037d..37d1a5a0eee27 100644 --- a/server/src/test/java/org/elasticsearch/test/geo/RandomShapeGenerator.java +++ b/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/test/RandomShapeGenerator.java @@ -6,22 +6,23 @@ * Side Public License, v 1. */ -package org.elasticsearch.test.geo; +package org.elasticsearch.legacygeo.test; import com.carrotsearch.randomizedtesting.generators.RandomNumbers; + +import org.elasticsearch.ElasticsearchException; +import org.elasticsearch.legacygeo.builders.CoordinatesBuilder; +import org.elasticsearch.legacygeo.builders.GeometryCollectionBuilder; +import org.elasticsearch.legacygeo.builders.LineStringBuilder; +import org.elasticsearch.legacygeo.builders.MultiLineStringBuilder; +import org.elasticsearch.legacygeo.builders.MultiPointBuilder; +import org.elasticsearch.legacygeo.builders.PointBuilder; +import org.elasticsearch.legacygeo.builders.PolygonBuilder; +import org.elasticsearch.legacygeo.builders.ShapeBuilder; +import org.junit.Assert; import org.locationtech.jts.algorithm.ConvexHull; import org.locationtech.jts.geom.Coordinate; import org.locationtech.jts.geom.Geometry; -import org.elasticsearch.ElasticsearchException; -import org.elasticsearch.common.geo.builders.CoordinatesBuilder; -import org.elasticsearch.common.geo.builders.GeometryCollectionBuilder; -import org.elasticsearch.common.geo.builders.LineStringBuilder; -import org.elasticsearch.common.geo.builders.MultiLineStringBuilder; -import org.elasticsearch.common.geo.builders.MultiPointBuilder; -import org.elasticsearch.common.geo.builders.PointBuilder; -import org.elasticsearch.common.geo.builders.PolygonBuilder; -import org.elasticsearch.common.geo.builders.ShapeBuilder; -import org.junit.Assert; import org.locationtech.spatial4j.context.jts.JtsSpatialContext; import org.locationtech.spatial4j.distance.DistanceUtils; import org.locationtech.spatial4j.exception.InvalidShapeException; @@ -44,7 +45,12 @@ public class RandomShapeGenerator extends RandomGeoGenerator { protected static boolean ST_VALIDATE = true; public enum ShapeType { - POINT, MULTIPOINT, LINESTRING, MULTILINESTRING, POLYGON; + POINT, + MULTIPOINT, + LINESTRING, + MULTILINESTRING, + POLYGON; + private static final ShapeType[] types = values(); public static ShapeType randomType(Random r) { @@ -84,8 +90,7 @@ public static GeometryCollectionBuilder createGeometryCollectionNear(Random r, P return createGeometryCollection(r, nearPoint, null, 0); } - public static GeometryCollectionBuilder createGeometryCollectionNear(Random r, Point nearPoint, int size) throws - InvalidShapeException { + public static GeometryCollectionBuilder createGeometryCollectionNear(Random r, Point nearPoint, int size) throws InvalidShapeException { return createGeometryCollection(r, nearPoint, null, size); } @@ -93,13 +98,13 @@ public static GeometryCollectionBuilder createGeometryCollectionWithin(Random r, return createGeometryCollection(r, null, within, 0); } - public static GeometryCollectionBuilder createGeometryCollectionWithin(Random r, Rectangle within, int size) throws - InvalidShapeException { + public static GeometryCollectionBuilder createGeometryCollectionWithin(Random r, Rectangle within, int size) + throws InvalidShapeException { return createGeometryCollection(r, null, within, size); } protected static GeometryCollectionBuilder createGeometryCollection(Random r, Point nearPoint, Rectangle bounds, int numGeometries) - throws InvalidShapeException { + throws InvalidShapeException { if (numGeometries <= 0) { // cap geometry collection at 4 shapes (to save test time) numGeometries = RandomNumbers.randomIntBetween(r, 2, 4); @@ -114,7 +119,7 @@ protected static GeometryCollectionBuilder createGeometryCollection(Random r, Po } GeometryCollectionBuilder gcb = new GeometryCollectionBuilder(); - for (int i=0; i builder = createShapeWithin(r, bounds); // due to world wrapping, and the possibility for ambiguous polygons, the random shape generation could bail with // a null shape. We catch that situation here, and only increment the counter when a valid shape is returned. @@ -130,7 +135,7 @@ protected static GeometryCollectionBuilder createGeometryCollection(Random r, Po private static ShapeBuilder createShape(Random r, Point nearPoint, Rectangle within, ShapeType st) throws InvalidShapeException { ShapeBuilder shape; - short i=0; + short i = 0; do { shape = createShape(r, nearPoint, within, st, ST_VALIDATE); if (shape != null) { @@ -150,8 +155,8 @@ protected static GeometryCollectionBuilder createGeometryCollection(Random r, Po * @param st Create a random shape of the provided type * @return the ShapeBuilder for a random shape */ - private static ShapeBuilder createShape(Random r, Point nearPoint, Rectangle within, ShapeType st, boolean validate) throws - InvalidShapeException { + private static ShapeBuilder createShape(Random r, Point nearPoint, Rectangle within, ShapeType st, boolean validate) + throws InvalidShapeException { if (st == null) { st = ShapeType.randomType(r); @@ -176,7 +181,7 @@ protected static GeometryCollectionBuilder createGeometryCollection(Random r, Po // (n^2-n)/2 and computing the relation intersection matrix will become NP-Hard int numPoints = RandomNumbers.randomIntBetween(r, 3, 10); CoordinatesBuilder coordinatesBuilder = new CoordinatesBuilder(); - for (int i=0; i getMappers() { diff --git a/server/build.gradle b/server/build.gradle index 078d492569be2..9468d37eb6660 100644 --- a/server/build.gradle +++ b/server/build.gradle @@ -43,7 +43,6 @@ dependencies { api "org.apache.lucene:lucene-queries:${versions.lucene}" api "org.apache.lucene:lucene-queryparser:${versions.lucene}" api "org.apache.lucene:lucene-sandbox:${versions.lucene}" - api "org.apache.lucene:lucene-spatial-extras:${versions.lucene}" api "org.apache.lucene:lucene-spatial3d:${versions.lucene}" api "org.apache.lucene:lucene-suggest:${versions.lucene}" @@ -59,10 +58,6 @@ dependencies { // precentil ranks aggregation api 'org.hdrhistogram:HdrHistogram:2.1.9' - // lucene spatial - api "org.locationtech.spatial4j:spatial4j:${versions.spatial4j}", optional - api "org.locationtech.jts:jts-core:${versions.jts}", optional - // logging api "org.apache.logging.log4j:log4j-api:${versions.log4j}" api "org.apache.logging.log4j:log4j-core:${versions.log4j}", optional @@ -163,7 +158,6 @@ tasks.named("thirdPartyAudit").configure { 'com.fasterxml.jackson.dataformat.xml.JacksonXmlModule', 'com.fasterxml.jackson.dataformat.xml.XmlMapper', 'com.fasterxml.jackson.dataformat.xml.util.DefaultXmlPrettyPrinter', - 'com.fasterxml.jackson.databind.node.ObjectNode', 'org.fusesource.jansi.Ansi', 'org.fusesource.jansi.AnsiRenderer$Code', 'com.lmax.disruptor.BlockingWaitStrategy', @@ -231,20 +225,6 @@ tasks.named("thirdPartyAudit").configure { 'org.zeromq.ZMQ$Context', 'org.zeromq.ZMQ$Socket', 'org.zeromq.ZMQ', - - // from org.locationtech.spatial4j.io.GeoJSONReader (spatial4j) - 'org.noggit.JSONParser', - - // from lucene-spatial - 'com.fasterxml.jackson.databind.JsonSerializer', - 'com.fasterxml.jackson.databind.JsonDeserializer', - 'com.fasterxml.jackson.databind.node.ArrayNode', - 'com.google.common.geometry.S2Cell', - 'com.google.common.geometry.S2CellId', - 'com.google.common.geometry.S2Projections', - 'com.google.common.geometry.S2Point', - 'com.google.common.geometry.S2$Metric', - 'com.google.common.geometry.S2LatLng' ) ignoreMissingClasses 'javax.xml.bind.DatatypeConverter' } diff --git a/server/src/main/java/org/elasticsearch/common/geo/GeoUtils.java b/server/src/main/java/org/elasticsearch/common/geo/GeoUtils.java index 661e78bf682ff..728bc410bcfb9 100644 --- a/server/src/main/java/org/elasticsearch/common/geo/GeoUtils.java +++ b/server/src/main/java/org/elasticsearch/common/geo/GeoUtils.java @@ -8,8 +8,6 @@ package org.elasticsearch.common.geo; -import org.apache.lucene.spatial.prefix.tree.GeohashPrefixTree; -import org.apache.lucene.spatial.prefix.tree.QuadPrefixTree; import org.apache.lucene.util.SloppyMath; import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.unit.DistanceUnit; @@ -66,6 +64,9 @@ public class GeoUtils { /** rounding error for quantized latitude and longitude values */ public static final double TOLERANCE = 1E-6; + private static final int QUAD_MAX_LEVELS_POSSIBLE = 50; + private static final int GEOHASH_MAX_LEVELS_POSSIBLE = 24; + /** Returns true if latitude is actually a valid latitude value.*/ public static boolean isValidLatitude(double latitude) { if (Double.isNaN(latitude) || Double.isInfinite(latitude) || latitude < GeoUtils.MIN_LAT || latitude > GeoUtils.MAX_LAT) { @@ -158,7 +159,7 @@ public static double quadTreeCellSize(int level) { public static int quadTreeLevelsForPrecision(double meters) { assert meters >= 0; if(meters == 0) { - return QuadPrefixTree.MAX_LEVELS_POSSIBLE; + return QUAD_MAX_LEVELS_POSSIBLE; } else { final double ratio = 1+(EARTH_POLAR_DISTANCE / EARTH_EQUATOR); // cell ratio final double width = Math.sqrt((meters*meters)/(ratio*ratio)); // convert to cell width @@ -188,7 +189,7 @@ public static int geoHashLevelsForPrecision(double meters) { assert meters >= 0; if(meters == 0) { - return GeohashPrefixTree.getMaxLevelsPossible(); + return GEOHASH_MAX_LEVELS_POSSIBLE; } else { final double ratio = 1+(EARTH_POLAR_DISTANCE / EARTH_EQUATOR); // cell ratio final double width = Math.sqrt((meters*meters)/(ratio*ratio)); // convert to cell width diff --git a/server/src/main/java/org/elasticsearch/index/mapper/AbstractShapeGeometryFieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/AbstractShapeGeometryFieldMapper.java index 36506ae08448c..cc123dc7bddb9 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/AbstractShapeGeometryFieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/AbstractShapeGeometryFieldMapper.java @@ -16,7 +16,7 @@ import java.util.function.Function; /** - * Base class for {@link GeoShapeFieldMapper} and {@link LegacyGeoShapeFieldMapper} + * Base class for {@link GeoShapeFieldMapper} */ public abstract class AbstractShapeGeometryFieldMapper extends AbstractGeometryFieldMapper { diff --git a/server/src/main/java/org/elasticsearch/index/query/QueryBuilders.java b/server/src/main/java/org/elasticsearch/index/query/QueryBuilders.java index d8d872a773523..6cd5647ff1fad 100644 --- a/server/src/main/java/org/elasticsearch/index/query/QueryBuilders.java +++ b/server/src/main/java/org/elasticsearch/index/query/QueryBuilders.java @@ -12,7 +12,6 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.geo.GeoPoint; import org.elasticsearch.common.geo.ShapeRelation; -import org.elasticsearch.common.geo.builders.ShapeBuilder; import org.elasticsearch.geometry.Geometry; import org.elasticsearch.index.query.DistanceFeatureQueryBuilder.Origin; import org.elasticsearch.index.query.MoreLikeThisQueryBuilder.Item; @@ -640,14 +639,6 @@ public static GeoShapeQueryBuilder geoShapeQuery(String name, Geometry shape) th return new GeoShapeQueryBuilder(name, shape); } - /** - * @deprecated use {@link #geoShapeQuery(String, Geometry)} instead - */ - @Deprecated - public static GeoShapeQueryBuilder geoShapeQuery(String name, ShapeBuilder shape) throws IOException { - return new GeoShapeQueryBuilder(name, shape.buildGeometry()); - } - public static GeoShapeQueryBuilder geoShapeQuery(String name, String indexedShapeId) { return new GeoShapeQueryBuilder(name, indexedShapeId); } @@ -664,16 +655,6 @@ public static GeoShapeQueryBuilder geoIntersectionQuery(String name, Geometry sh return builder; } - /** - * @deprecated use {@link #geoIntersectionQuery(String, Geometry)} instead - */ - @Deprecated - public static GeoShapeQueryBuilder geoIntersectionQuery(String name, ShapeBuilder shape) throws IOException { - GeoShapeQueryBuilder builder = geoShapeQuery(name, shape); - builder.relation(ShapeRelation.INTERSECTS); - return builder; - } - public static GeoShapeQueryBuilder geoIntersectionQuery(String name, String indexedShapeId) { GeoShapeQueryBuilder builder = geoShapeQuery(name, indexedShapeId); builder.relation(ShapeRelation.INTERSECTS); @@ -692,16 +673,6 @@ public static GeoShapeQueryBuilder geoWithinQuery(String name, Geometry shape) t return builder; } - /** - * @deprecated use {@link #geoWithinQuery(String, Geometry)} instead - */ - @Deprecated - public static GeoShapeQueryBuilder geoWithinQuery(String name, ShapeBuilder shape) throws IOException { - GeoShapeQueryBuilder builder = geoShapeQuery(name, shape); - builder.relation(ShapeRelation.WITHIN); - return builder; - } - public static GeoShapeQueryBuilder geoWithinQuery(String name, String indexedShapeId) { GeoShapeQueryBuilder builder = geoShapeQuery(name, indexedShapeId); builder.relation(ShapeRelation.WITHIN); @@ -720,16 +691,6 @@ public static GeoShapeQueryBuilder geoDisjointQuery(String name, Geometry shape) return builder; } - /** - * @deprecated use {@link #geoDisjointQuery(String, Geometry)} instead - */ - @Deprecated - public static GeoShapeQueryBuilder geoDisjointQuery(String name, ShapeBuilder shape) throws IOException { - GeoShapeQueryBuilder builder = geoShapeQuery(name, shape); - builder.relation(ShapeRelation.DISJOINT); - return builder; - } - public static GeoShapeQueryBuilder geoDisjointQuery(String name, String indexedShapeId) { GeoShapeQueryBuilder builder = geoShapeQuery(name, indexedShapeId); builder.relation(ShapeRelation.DISJOINT); diff --git a/server/src/main/java/org/elasticsearch/search/SearchModule.java b/server/src/main/java/org/elasticsearch/search/SearchModule.java index b8e223879c79c..a9f4c8024c377 100644 --- a/server/src/main/java/org/elasticsearch/search/SearchModule.java +++ b/server/src/main/java/org/elasticsearch/search/SearchModule.java @@ -11,8 +11,6 @@ import org.apache.lucene.search.BooleanQuery; import org.elasticsearch.common.CheckedBiConsumer; import org.elasticsearch.common.NamedRegistry; -import org.elasticsearch.common.geo.GeoShapeType; -import org.elasticsearch.common.geo.ShapesAvailability; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.NamedWriteableRegistry.Entry; import org.elasticsearch.common.io.stream.StreamOutput; @@ -303,7 +301,6 @@ public SearchModule(Settings settings, List plugins) { registerPipelineAggregations(plugins); registerFetchSubPhases(plugins); registerSearchExts(plugins); - registerShapes(); registerIntervalsSourceProviders(); requestCacheKeyDifferentiator = registerRequestCacheKeyDifferentiator(plugins); namedWriteables.addAll(SortValue.namedWriteables()); @@ -602,12 +599,6 @@ private void registerPipelineAggregation(PipelineAggregationSpec spec) { } } - private void registerShapes() { - if (ShapesAvailability.JTS_AVAILABLE && ShapesAvailability.SPATIAL4J_AVAILABLE) { - namedWriteables.addAll(GeoShapeType.getShapeWriteables()); - } - } - private void registerRescorers(List plugins) { registerRescorer(new RescorerSpec<>(QueryRescorerBuilder.NAME, QueryRescorerBuilder::new, QueryRescorerBuilder::fromXContent)); registerFromPlugin(plugins, SearchPlugin::getRescorers, this::registerRescorer); @@ -842,10 +833,7 @@ private void registerQueryParsers(List plugins) { DistanceFeatureQueryBuilder::fromXContent)); registerQuery( new QuerySpec<>(MatchBoolPrefixQueryBuilder.NAME, MatchBoolPrefixQueryBuilder::new, MatchBoolPrefixQueryBuilder::fromXContent)); - - if (ShapesAvailability.JTS_AVAILABLE && ShapesAvailability.SPATIAL4J_AVAILABLE) { - registerQuery(new QuerySpec<>(GeoShapeQueryBuilder.NAME, GeoShapeQueryBuilder::new, GeoShapeQueryBuilder::fromXContent)); - } + registerQuery(new QuerySpec<>(GeoShapeQueryBuilder.NAME, GeoShapeQueryBuilder::new, GeoShapeQueryBuilder::fromXContent)); registerFromPlugin(plugins, SearchPlugin::getQueries, this::registerQuery); diff --git a/server/src/test/java/org/elasticsearch/common/geo/GeoJsonParserTests.java b/server/src/test/java/org/elasticsearch/common/geo/GeoJsonParserTests.java index 287e150e98add..57504c7c0da78 100644 --- a/server/src/test/java/org/elasticsearch/common/geo/GeoJsonParserTests.java +++ b/server/src/test/java/org/elasticsearch/common/geo/GeoJsonParserTests.java @@ -26,6 +26,7 @@ import org.elasticsearch.geometry.Polygon; import org.elasticsearch.geometry.Rectangle; import org.elasticsearch.geometry.utils.GeographyValidator; +import org.elasticsearch.test.ESTestCase; import java.io.IOException; import java.text.ParseException; @@ -36,9 +37,8 @@ /** * Tests for {@code GeoJSONShapeParser} */ -public class GeoJsonParserTests extends BaseGeoParsingTestCase { +public class GeoJsonParserTests extends ESTestCase { - @Override public void testParsePoint() throws IOException { XContentBuilder pointGeoJson = XContentFactory.jsonBuilder() .startObject() @@ -49,7 +49,6 @@ public void testParsePoint() throws IOException { assertGeometryEquals(expected, pointGeoJson); } - @Override public void testParseLineString() throws IOException { XContentBuilder lineGeoJson = XContentFactory.jsonBuilder() .startObject() @@ -67,7 +66,6 @@ public void testParseLineString() throws IOException { } } - @Override public void testParseMultiLineString() throws IOException { XContentBuilder multilinesGeoJson = XContentFactory.jsonBuilder() .startObject() @@ -138,7 +136,6 @@ public void testParseMultiDimensionShapes() throws IOException { } } - @Override public void testParseEnvelope() throws IOException { // test #1: envelope with expected coordinate order (TopLeft, BottomRight) XContentBuilder multilinesGeoJson = XContentFactory.jsonBuilder().startObject().field("type", randomBoolean() ? "envelope" : "bbox") @@ -189,7 +186,6 @@ public void testParseEnvelope() throws IOException { } } - @Override public void testParsePolygon() throws IOException { XContentBuilder polygonGeoJson = XContentFactory.jsonBuilder() .startObject() @@ -516,7 +512,6 @@ public void testParsePolygonWithHole() throws IOException { assertGeometryEquals(p, polygonGeoJson); } - @Override public void testParseMultiPoint() throws IOException { XContentBuilder multiPointGeoJson = XContentFactory.jsonBuilder() .startObject() @@ -532,7 +527,6 @@ public void testParseMultiPoint() throws IOException { new Point(101, 1))), multiPointGeoJson); } - @Override public void testParseMultiPolygon() throws IOException { // two polygons; one without hole, one with hole XContentBuilder multiPolygonGeoJson = XContentFactory.jsonBuilder() @@ -580,7 +574,6 @@ public void testParseMultiPolygon() throws IOException { assertGeometryEquals(polygons, multiPolygonGeoJson); } - @Override public void testParseGeometryCollection() throws IOException { XContentBuilder geometryCollectionGeoJson = XContentFactory.jsonBuilder() .startObject() @@ -641,7 +634,7 @@ public void testThatParserExtractsCorrectTypeAndCoordinatesFromArbitraryJson() t .endObject(); Point expectedPt = new Point(100, 0); - assertGeometryEquals(expectedPt, pointGeoJson, false); + assertGeometryEquals(expectedPt, pointGeoJson); } public void testParseOrientationOption() throws IOException { @@ -763,4 +756,11 @@ public void testParseInvalidGeometryCollectionShapes() throws IOException { assertNull(parser.nextToken()); // no more elements afterwards } } + + private void assertGeometryEquals(org.elasticsearch.geometry.Geometry expected, XContentBuilder geoJson) throws IOException { + try (XContentParser parser = createParser(geoJson)) { + parser.nextToken(); + assertEquals(expected, GeoJson.fromXContent(GeographyValidator.instance(false), false, true, parser)); + } + } } diff --git a/server/src/test/java/org/elasticsearch/common/geo/GeoJsonShapeParserTests.java b/server/src/test/java/org/elasticsearch/common/geo/GeoJsonShapeParserTests.java deleted file mode 100644 index 4750c18d34578..0000000000000 --- a/server/src/test/java/org/elasticsearch/common/geo/GeoJsonShapeParserTests.java +++ /dev/null @@ -1,1421 +0,0 @@ -/* - * 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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -package org.elasticsearch.common.geo; - -import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.Version; -import org.elasticsearch.cluster.metadata.IndexMetadata; -import org.elasticsearch.common.Strings; -import org.elasticsearch.common.UUIDs; -import org.elasticsearch.common.geo.parsers.ShapeParser; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; -import org.elasticsearch.geometry.Geometry; -import org.elasticsearch.geometry.GeometryCollection; -import org.elasticsearch.geometry.Line; -import org.elasticsearch.geometry.MultiLine; -import org.elasticsearch.geometry.MultiPoint; -import org.elasticsearch.index.mapper.GeoShapeIndexer; -import org.elasticsearch.index.mapper.LegacyGeoShapeFieldMapper; -import org.elasticsearch.index.mapper.MapperBuilderContext; -import org.elasticsearch.test.VersionUtils; -import org.elasticsearch.test.hamcrest.ElasticsearchGeoAssertions; -import org.locationtech.jts.geom.Coordinate; -import org.locationtech.jts.geom.LineString; -import org.locationtech.jts.geom.LinearRing; -import org.locationtech.jts.geom.MultiLineString; -import org.locationtech.jts.geom.MultiPolygon; -import org.locationtech.jts.geom.Point; -import org.locationtech.jts.geom.Polygon; -import org.locationtech.spatial4j.exception.InvalidShapeException; -import org.locationtech.spatial4j.shape.Circle; -import org.locationtech.spatial4j.shape.Rectangle; -import org.locationtech.spatial4j.shape.Shape; -import org.locationtech.spatial4j.shape.ShapeCollection; -import org.locationtech.spatial4j.shape.jts.JtsPoint; - -import java.io.IOException; -import java.text.ParseException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - -import static org.elasticsearch.common.geo.builders.ShapeBuilder.SPATIAL_CONTEXT; - - -/** - * Tests for {@code GeoJSONShapeParser} - */ -public class GeoJsonShapeParserTests extends BaseGeoParsingTestCase { - - @Override - public void testParsePoint() throws IOException, ParseException { - XContentBuilder pointGeoJson = XContentFactory.jsonBuilder() - .startObject() - .field("type", "Point") - .startArray("coordinates").value(100.0).value(0.0).endArray() - .endObject(); - Point expected = GEOMETRY_FACTORY.createPoint(new Coordinate(100.0, 0.0)); - assertGeometryEquals(new JtsPoint(expected, SPATIAL_CONTEXT), pointGeoJson, true); - assertGeometryEquals(new org.elasticsearch.geometry.Point(100d, 0d), pointGeoJson, false); - } - - @Override - public void testParseLineString() throws IOException, ParseException { - XContentBuilder lineGeoJson = XContentFactory.jsonBuilder() - .startObject() - .field("type", "LineString") - .startArray("coordinates") - .startArray().value(100.0).value(0.0).endArray() - .startArray().value(101.0).value(1.0).endArray() - .endArray() - .endObject(); - - List lineCoordinates = new ArrayList<>(); - lineCoordinates.add(new Coordinate(100, 0)); - lineCoordinates.add(new Coordinate(101, 1)); - - try (XContentParser parser = createParser(lineGeoJson)) { - parser.nextToken(); - Shape shape = ShapeParser.parse(parser).buildS4J(); - ElasticsearchGeoAssertions.assertLineString(shape, true); - } - - try (XContentParser parser = createParser(lineGeoJson)) { - parser.nextToken(); - ElasticsearchGeoAssertions.assertLineString(parse(parser), false); - } - } - - @Override - public void testParseMultiLineString() throws IOException, ParseException { - XContentBuilder multilinesGeoJson = XContentFactory.jsonBuilder() - .startObject() - .field("type", "MultiLineString") - .startArray("coordinates") - .startArray() - .startArray().value(100.0).value(0.0).endArray() - .startArray().value(101.0).value(1.0).endArray() - .endArray() - .startArray() - .startArray().value(102.0).value(2.0).endArray() - .startArray().value(103.0).value(3.0).endArray() - .endArray() - .endArray() - .endObject(); - - MultiLineString expected = GEOMETRY_FACTORY.createMultiLineString(new LineString[]{ - GEOMETRY_FACTORY.createLineString(new Coordinate[]{ - new Coordinate(100, 0), - new Coordinate(101, 1), - }), - GEOMETRY_FACTORY.createLineString(new Coordinate[]{ - new Coordinate(102, 2), - new Coordinate(103, 3), - }), - }); - assertGeometryEquals(jtsGeom(expected), multilinesGeoJson, true); - assertGeometryEquals(new MultiLine(Arrays.asList( - new Line(new double[] {100d, 101d}, new double[] {0d, 1d}), - new Line(new double[] {102d, 103d}, new double[] {2d, 3d}))), - multilinesGeoJson, false); - } - - public void testParseCircle() throws IOException, ParseException { - XContentBuilder multilinesGeoJson = XContentFactory.jsonBuilder() - .startObject() - .field("type", "circle") - .startArray("coordinates").value(100.0).value(0.0).endArray() - .field("radius", "100m") - .endObject(); - - Circle expected = SPATIAL_CONTEXT.makeCircle(100.0, 0.0, 360 * 100 / GeoUtils.EARTH_EQUATOR); - assertGeometryEquals(expected, multilinesGeoJson, true); - } - - public void testParseMultiDimensionShapes() throws IOException { - // multi dimension point - XContentBuilder pointGeoJson = XContentFactory.jsonBuilder() - .startObject() - .field("type", "Point") - .startArray("coordinates").value(100.0).value(0.0).value(15.0).value(18.0).endArray() - .endObject(); - - XContentParser parser = createParser(pointGeoJson); - parser.nextToken(); - ElasticsearchGeoAssertions.assertValidException(parser, ElasticsearchParseException.class); - assertNull(parser.nextToken()); - - // multi dimension linestring - XContentBuilder lineGeoJson = XContentFactory.jsonBuilder() - .startObject() - .field("type", "LineString") - .startArray("coordinates") - .startArray().value(100.0).value(0.0).value(15.0).endArray() - .startArray().value(101.0).value(1.0).value(18.0).value(19.0).endArray() - .endArray() - .endObject(); - - parser = createParser(lineGeoJson); - parser.nextToken(); - ElasticsearchGeoAssertions.assertValidException(parser, ElasticsearchParseException.class); - assertNull(parser.nextToken()); - } - - @Override - public void testParseEnvelope() throws IOException, ParseException { - // test #1: envelope with expected coordinate order (TopLeft, BottomRight) - XContentBuilder multilinesGeoJson = XContentFactory.jsonBuilder().startObject().field("type", "envelope") - .startArray("coordinates") - .startArray().value(-50).value(30).endArray() - .startArray().value(50).value(-30).endArray() - .endArray() - .endObject(); - Rectangle expected = SPATIAL_CONTEXT.makeRectangle(-50, 50, -30, 30); - assertGeometryEquals(expected, multilinesGeoJson, true); - assertGeometryEquals(new org.elasticsearch.geometry.Rectangle(-50, 50, 30, -30), - multilinesGeoJson, false); - - // test #2: envelope that spans dateline - multilinesGeoJson = XContentFactory.jsonBuilder().startObject().field("type", "envelope") - .startArray("coordinates") - .startArray().value(50).value(30).endArray() - .startArray().value(-50).value(-30).endArray() - .endArray() - .endObject(); - - expected = SPATIAL_CONTEXT.makeRectangle(50, -50, -30, 30); - assertGeometryEquals(expected, multilinesGeoJson, true); - assertGeometryEquals(new org.elasticsearch.geometry.Rectangle(50, -50, 30, -30), - multilinesGeoJson, false); - - // test #3: "envelope" (actually a triangle) with invalid number of coordinates (TopRight, BottomLeft, BottomRight) - multilinesGeoJson = XContentFactory.jsonBuilder().startObject().field("type", "envelope") - .startArray("coordinates") - .startArray().value(50).value(30).endArray() - .startArray().value(-50).value(-30).endArray() - .startArray().value(50).value(-39).endArray() - .endArray() - .endObject(); - try (XContentParser parser = createParser(multilinesGeoJson)) { - parser.nextToken(); - ElasticsearchGeoAssertions.assertValidException(parser, ElasticsearchParseException.class); - assertNull(parser.nextToken()); - } - - // test #4: "envelope" with empty coordinates - multilinesGeoJson = XContentFactory.jsonBuilder().startObject().field("type", "envelope") - .startArray("coordinates") - .endArray() - .endObject(); - try (XContentParser parser = createParser(multilinesGeoJson)) { - parser.nextToken(); - ElasticsearchGeoAssertions.assertValidException(parser, ElasticsearchParseException.class); - assertNull(parser.nextToken()); - } - } - - @Override - public void testParsePolygon() throws IOException, ParseException { - XContentBuilder polygonGeoJson = XContentFactory.jsonBuilder() - .startObject() - .field("type", "Polygon") - .startArray("coordinates") - .startArray() - .startArray().value(100.0).value(1.0).endArray() - .startArray().value(101.0).value(1.0).endArray() - .startArray().value(101.0).value(0.0).endArray() - .startArray().value(100.0).value(0.0).endArray() - .startArray().value(100.0).value(1.0).endArray() - .endArray() - .endArray() - .endObject(); - - List shellCoordinates = new ArrayList<>(); - shellCoordinates.add(new Coordinate(100, 0)); - shellCoordinates.add(new Coordinate(101, 0)); - shellCoordinates.add(new Coordinate(101, 1)); - shellCoordinates.add(new Coordinate(100, 1)); - shellCoordinates.add(new Coordinate(100, 0)); - Coordinate[] coordinates = shellCoordinates.toArray(new Coordinate[shellCoordinates.size()]); - LinearRing shell = GEOMETRY_FACTORY.createLinearRing(coordinates); - Polygon expected = GEOMETRY_FACTORY.createPolygon(shell, null); - assertGeometryEquals(jtsGeom(expected), polygonGeoJson, true); - - org.elasticsearch.geometry.Polygon p = new org.elasticsearch.geometry.Polygon( - new org.elasticsearch.geometry.LinearRing( - new double[] {100d, 101d, 101d, 100d, 100d}, new double[] {0d, 0d, 1d, 1d, 0d} - )); - assertGeometryEquals(p, polygonGeoJson, false); - } - - public void testParse3DPolygon() throws IOException, ParseException { - XContentBuilder polygonGeoJson = XContentFactory.jsonBuilder() - .startObject() - .field("type", "Polygon") - .startArray("coordinates") - .startArray() - .startArray().value(100.0).value(1.0).value(10.0).endArray() - .startArray().value(101.0).value(1.0).value(10.0).endArray() - .startArray().value(101.0).value(0.0).value(10.0).endArray() - .startArray().value(100.0).value(0.0).value(10.0).endArray() - .startArray().value(100.0).value(1.0).value(10.0).endArray() - .endArray() - .endArray() - .endObject(); - - List shellCoordinates = new ArrayList<>(); - shellCoordinates.add(new Coordinate(100, 0, 10)); - shellCoordinates.add(new Coordinate(101, 0, 10)); - shellCoordinates.add(new Coordinate(101, 1, 10)); - shellCoordinates.add(new Coordinate(100, 1, 10)); - shellCoordinates.add(new Coordinate(100, 0, 10)); - Coordinate[] coordinates = shellCoordinates.toArray(new Coordinate[shellCoordinates.size()]); - - Version randomVersion = VersionUtils.randomIndexCompatibleVersion(random()); - Settings indexSettings = Settings.builder() - .put(IndexMetadata.SETTING_VERSION_CREATED, randomVersion) - .put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0) - .put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1) - .put(IndexMetadata.SETTING_INDEX_UUID, UUIDs.randomBase64UUID()).build(); - - LinearRing shell = GEOMETRY_FACTORY.createLinearRing(shellCoordinates.toArray(new Coordinate[shellCoordinates.size()])); - Polygon expected = GEOMETRY_FACTORY.createPolygon(shell, null); - final Version version = VersionUtils.randomPreviousCompatibleVersion(random(), Version.V_8_0_0); - final LegacyGeoShapeFieldMapper mapperBuilder = - new LegacyGeoShapeFieldMapper.Builder("test", version, false, true) - .build(MapperBuilderContext.ROOT); - try (XContentParser parser = createParser(polygonGeoJson)) { - parser.nextToken(); - ElasticsearchGeoAssertions.assertEquals(jtsGeom(expected), ShapeParser.parse(parser, mapperBuilder).buildS4J()); - } - - org.elasticsearch.geometry.Polygon p = new org.elasticsearch.geometry.Polygon(new org.elasticsearch.geometry.LinearRing( - Arrays.stream(coordinates).mapToDouble(i->i.x).toArray(), Arrays.stream(coordinates).mapToDouble(i->i.y).toArray() - )); - assertGeometryEquals(p, polygonGeoJson, false); - } - - public void testInvalidDimensionalPolygon() throws IOException { - XContentBuilder polygonGeoJson = XContentFactory.jsonBuilder() - .startObject() - .field("type", "Polygon") - .startArray("coordinates") - .startArray() - .startArray().value(100.0).value(1.0).value(10.0).endArray() - .startArray().value(101.0).value(1.0).endArray() - .startArray().value(101.0).value(0.0).value(10.0).endArray() - .startArray().value(100.0).value(0.0).value(10.0).endArray() - .startArray().value(100.0).value(1.0).value(10.0).endArray() - .endArray() - .endArray() - .endObject(); - try (XContentParser parser = createParser(polygonGeoJson)) { - parser.nextToken(); - ElasticsearchGeoAssertions.assertValidException(parser, ElasticsearchParseException.class); - assertNull(parser.nextToken()); - } - } - - public void testParseInvalidPoint() throws IOException { - // test case 1: create an invalid point object with multipoint data format - XContentBuilder invalidPoint1 = XContentFactory.jsonBuilder() - .startObject() - .field("type", "point") - .startArray("coordinates") - .startArray().value(-74.011).value(40.753).endArray() - .endArray() - .endObject(); - try (XContentParser parser = createParser(invalidPoint1)) { - parser.nextToken(); - ElasticsearchGeoAssertions.assertValidException(parser, ElasticsearchParseException.class); - assertNull(parser.nextToken()); - } - - // test case 2: create an invalid point object with an empty number of coordinates - XContentBuilder invalidPoint2 = XContentFactory.jsonBuilder() - .startObject() - .field("type", "point") - .startArray("coordinates") - .endArray() - .endObject(); - try (XContentParser parser = createParser(invalidPoint2)) { - parser.nextToken(); - ElasticsearchGeoAssertions.assertValidException(parser, ElasticsearchParseException.class); - assertNull(parser.nextToken()); - } - } - - public void testParseInvalidMultipoint() throws IOException { - // test case 1: create an invalid multipoint object with single coordinate - XContentBuilder invalidMultipoint1 = XContentFactory.jsonBuilder() - .startObject() - .field("type", "multipoint") - .startArray("coordinates").value(-74.011).value(40.753).endArray() - .endObject(); - try (XContentParser parser = createParser(invalidMultipoint1)) { - parser.nextToken(); - ElasticsearchGeoAssertions.assertValidException(parser, ElasticsearchParseException.class); - assertNull(parser.nextToken()); - } - - // test case 2: create an invalid multipoint object with null coordinate - XContentBuilder invalidMultipoint2 = XContentFactory.jsonBuilder() - .startObject() - .field("type", "multipoint") - .startArray("coordinates") - .endArray() - .endObject(); - try (XContentParser parser = createParser(invalidMultipoint2)) { - parser.nextToken(); - ElasticsearchGeoAssertions.assertValidException(parser, ElasticsearchParseException.class); - assertNull(parser.nextToken()); - } - - // test case 3: create a valid formatted multipoint object with invalid number (0) of coordinates - XContentBuilder invalidMultipoint3 = XContentFactory.jsonBuilder() - .startObject() - .field("type", "multipoint") - .startArray("coordinates") - .startArray().endArray() - .endArray() - .endObject(); - try (XContentParser parser = createParser(invalidMultipoint3)) { - parser.nextToken(); - ElasticsearchGeoAssertions.assertValidException(parser, ElasticsearchParseException.class); - assertNull(parser.nextToken()); - } - } - - public void testParseInvalidMultiPolygon() throws IOException { - // test invalid multipolygon (an "accidental" polygon with inner rings outside outer ring) - String multiPolygonGeoJson = Strings.toString(XContentFactory.jsonBuilder().startObject().field("type", "MultiPolygon") - .startArray("coordinates") - .startArray()//one poly (with two holes) - .startArray() - .startArray().value(102.0).value(2.0).endArray() - .startArray().value(103.0).value(2.0).endArray() - .startArray().value(103.0).value(3.0).endArray() - .startArray().value(102.0).value(3.0).endArray() - .startArray().value(102.0).value(2.0).endArray() - .endArray() - .startArray()// first hole - .startArray().value(100.0).value(0.0).endArray() - .startArray().value(101.0).value(0.0).endArray() - .startArray().value(101.0).value(1.0).endArray() - .startArray().value(100.0).value(1.0).endArray() - .startArray().value(100.0).value(0.0).endArray() - .endArray() - .startArray()//second hole - .startArray().value(100.2).value(0.8).endArray() - .startArray().value(100.2).value(0.2).endArray() - .startArray().value(100.8).value(0.2).endArray() - .startArray().value(100.8).value(0.8).endArray() - .startArray().value(100.2).value(0.8).endArray() - .endArray() - .endArray() - .endArray() - .endObject()); - - try (XContentParser parser = createParser(JsonXContent.jsonXContent, multiPolygonGeoJson)) { - parser.nextToken(); - ElasticsearchGeoAssertions.assertValidException(parser, InvalidShapeException.class); - assertNull(parser.nextToken()); - } - } - - public void testParseInvalidDimensionalMultiPolygon() throws IOException { - // test invalid multipolygon (an "accidental" polygon with inner rings outside outer ring) - String multiPolygonGeoJson = Strings.toString(XContentFactory.jsonBuilder() - .startObject() - .field("type", "MultiPolygon") - .startArray("coordinates") - .startArray()//first poly (without holes) - .startArray() - .startArray().value(102.0).value(2.0).endArray() - .startArray().value(103.0).value(2.0).endArray() - .startArray().value(103.0).value(3.0).endArray() - .startArray().value(102.0).value(3.0).endArray() - .startArray().value(102.0).value(2.0).endArray() - .endArray() - .endArray() - .startArray()//second poly (with hole) - .startArray() - .startArray().value(100.0).value(0.0).endArray() - .startArray().value(101.0).value(0.0).endArray() - .startArray().value(101.0).value(1.0).endArray() - .startArray().value(100.0).value(1.0).endArray() - .startArray().value(100.0).value(0.0).endArray() - .endArray() - .startArray()//hole - .startArray().value(100.2).value(0.8).endArray() - .startArray().value(100.2).value(0.2).value(10.0).endArray() - .startArray().value(100.8).value(0.2).endArray() - .startArray().value(100.8).value(0.8).endArray() - .startArray().value(100.2).value(0.8).endArray() - .endArray() - .endArray() - .endArray() - .endObject()); - - try (XContentParser parser = createParser(JsonXContent.jsonXContent, multiPolygonGeoJson)) { - parser.nextToken(); - ElasticsearchGeoAssertions.assertValidException(parser, ElasticsearchParseException.class); - assertNull(parser.nextToken()); - } - } - - - public void testParseOGCPolygonWithoutHoles() throws IOException, ParseException { - // test 1: ccw poly not crossing dateline - String polygonGeoJson = Strings.toString(XContentFactory.jsonBuilder().startObject().field("type", "Polygon") - .startArray("coordinates") - .startArray() - .startArray().value(176.0).value(15.0).endArray() - .startArray().value(-177.0).value(10.0).endArray() - .startArray().value(-177.0).value(-10.0).endArray() - .startArray().value(176.0).value(-15.0).endArray() - .startArray().value(172.0).value(0.0).endArray() - .startArray().value(176.0).value(15.0).endArray() - .endArray() - .endArray() - .endObject()); - - try (XContentParser parser = createParser(JsonXContent.jsonXContent, polygonGeoJson)) { - parser.nextToken(); - Shape shape = ShapeParser.parse(parser).buildS4J(); - ElasticsearchGeoAssertions.assertPolygon(shape, true); - } - - try (XContentParser parser = createParser(JsonXContent.jsonXContent, polygonGeoJson)) { - parser.nextToken(); - ElasticsearchGeoAssertions.assertPolygon(parse(parser), false); - } - - // test 2: ccw poly crossing dateline - polygonGeoJson = Strings.toString(XContentFactory.jsonBuilder().startObject().field("type", "Polygon") - .startArray("coordinates") - .startArray() - .startArray().value(-177.0).value(10.0).endArray() - .startArray().value(176.0).value(15.0).endArray() - .startArray().value(172.0).value(0.0).endArray() - .startArray().value(176.0).value(-15.0).endArray() - .startArray().value(-177.0).value(-10.0).endArray() - .startArray().value(-177.0).value(10.0).endArray() - .endArray() - .endArray() - .endObject()); - - try (XContentParser parser = createParser(JsonXContent.jsonXContent, polygonGeoJson)) { - parser.nextToken(); - Shape shape = ShapeParser.parse(parser).buildS4J(); - ElasticsearchGeoAssertions.assertMultiPolygon(shape, true); - } - - try (XContentParser parser = createParser(JsonXContent.jsonXContent, polygonGeoJson)) { - parser.nextToken(); - ElasticsearchGeoAssertions.assertMultiPolygon(parse(parser), false); - } - - // test 3: cw poly not crossing dateline - polygonGeoJson = Strings.toString(XContentFactory.jsonBuilder().startObject().field("type", "Polygon") - .startArray("coordinates") - .startArray() - .startArray().value(176.0).value(15.0).endArray() - .startArray().value(180.0).value(10.0).endArray() - .startArray().value(180.0).value(-10.0).endArray() - .startArray().value(176.0).value(-15.0).endArray() - .startArray().value(172.0).value(0.0).endArray() - .startArray().value(176.0).value(15.0).endArray() - .endArray() - .endArray() - .endObject()); - - try (XContentParser parser = createParser(JsonXContent.jsonXContent, polygonGeoJson)) { - parser.nextToken(); - Shape shape = ShapeParser.parse(parser).buildS4J(); - ElasticsearchGeoAssertions.assertPolygon(shape, true); - } - - try (XContentParser parser = createParser(JsonXContent.jsonXContent, polygonGeoJson)) { - parser.nextToken(); - ElasticsearchGeoAssertions.assertPolygon(parse(parser), false); - } - - // test 4: cw poly crossing dateline - polygonGeoJson = Strings.toString(XContentFactory.jsonBuilder().startObject().field("type", "Polygon") - .startArray("coordinates") - .startArray() - .startArray().value(176.0).value(15.0).endArray() - .startArray().value(184.0).value(15.0).endArray() - .startArray().value(184.0).value(0.0).endArray() - .startArray().value(176.0).value(-15.0).endArray() - .startArray().value(174.0).value(-10.0).endArray() - .startArray().value(176.0).value(15.0).endArray() - .endArray() - .endArray() - .endObject()); - - try (XContentParser parser = createParser(JsonXContent.jsonXContent, polygonGeoJson)) { - parser.nextToken(); - Shape shape = ShapeParser.parse(parser).buildS4J(); - ElasticsearchGeoAssertions.assertMultiPolygon(shape, true); - } - - try (XContentParser parser = createParser(JsonXContent.jsonXContent, polygonGeoJson)) { - parser.nextToken(); - ElasticsearchGeoAssertions.assertMultiPolygon(parse(parser), false); - } - } - - public void testParseOGCPolygonWithHoles() throws IOException, ParseException { - // test 1: ccw poly not crossing dateline - String polygonGeoJson = Strings.toString(XContentFactory.jsonBuilder().startObject().field("type", "Polygon") - .startArray("coordinates") - .startArray() - .startArray().value(176.0).value(15.0).endArray() - .startArray().value(-177.0).value(10.0).endArray() - .startArray().value(-177.0).value(-10.0).endArray() - .startArray().value(176.0).value(-15.0).endArray() - .startArray().value(172.0).value(0.0).endArray() - .startArray().value(176.0).value(15.0).endArray() - .endArray() - .startArray() - .startArray().value(-172.0).value(8.0).endArray() - .startArray().value(174.0).value(10.0).endArray() - .startArray().value(-172.0).value(-8.0).endArray() - .startArray().value(-172.0).value(8.0).endArray() - .endArray() - .endArray() - .endObject()); - - try (XContentParser parser = createParser(JsonXContent.jsonXContent, polygonGeoJson)) { - parser.nextToken(); - Shape shape = ShapeParser.parse(parser).buildS4J(); - ElasticsearchGeoAssertions.assertPolygon(shape, true); - } - - try (XContentParser parser = createParser(JsonXContent.jsonXContent, polygonGeoJson)) { - parser.nextToken(); - ElasticsearchGeoAssertions.assertPolygon(parse(parser), false); - } - - // test 2: ccw poly crossing dateline - polygonGeoJson = Strings.toString(XContentFactory.jsonBuilder().startObject().field("type", "Polygon") - .startArray("coordinates") - .startArray() - .startArray().value(-177.0).value(10.0).endArray() - .startArray().value(176.0).value(15.0).endArray() - .startArray().value(172.0).value(0.0).endArray() - .startArray().value(176.0).value(-15.0).endArray() - .startArray().value(-177.0).value(-10.0).endArray() - .startArray().value(-177.0).value(10.0).endArray() - .endArray() - .startArray() - .startArray().value(178.0).value(8.0).endArray() - .startArray().value(-178.0).value(8.0).endArray() - .startArray().value(-180.0).value(-8.0).endArray() - .startArray().value(178.0).value(8.0).endArray() - .endArray() - .endArray() - .endObject()); - - try (XContentParser parser = createParser(JsonXContent.jsonXContent, polygonGeoJson)) { - parser.nextToken(); - Shape shape = ShapeParser.parse(parser).buildS4J(); - ElasticsearchGeoAssertions.assertMultiPolygon(shape, true); - } - - try (XContentParser parser = createParser(JsonXContent.jsonXContent, polygonGeoJson)) { - parser.nextToken(); - ElasticsearchGeoAssertions.assertMultiPolygon(parse(parser), false); - } - - // test 3: cw poly not crossing dateline - polygonGeoJson = Strings.toString(XContentFactory.jsonBuilder().startObject().field("type", "Polygon") - .startArray("coordinates") - .startArray() - .startArray().value(176.0).value(15.0).endArray() - .startArray().value(180.0).value(10.0).endArray() - .startArray().value(179.0).value(-10.0).endArray() - .startArray().value(176.0).value(-15.0).endArray() - .startArray().value(172.0).value(0.0).endArray() - .startArray().value(176.0).value(15.0).endArray() - .endArray() - .startArray() - .startArray().value(177.0).value(8.0).endArray() - .startArray().value(179.0).value(10.0).endArray() - .startArray().value(179.0).value(-8.0).endArray() - .startArray().value(177.0).value(8.0).endArray() - .endArray() - .endArray() - .endObject()); - - try (XContentParser parser = createParser(JsonXContent.jsonXContent, polygonGeoJson)) { - parser.nextToken(); - Shape shape = ShapeParser.parse(parser).buildS4J(); - ElasticsearchGeoAssertions.assertPolygon(shape, true); - } - - try (XContentParser parser = createParser(JsonXContent.jsonXContent, polygonGeoJson)) { - parser.nextToken(); - ElasticsearchGeoAssertions.assertPolygon(parse(parser), false); - } - - // test 4: cw poly crossing dateline - polygonGeoJson = Strings.toString(XContentFactory.jsonBuilder().startObject().field("type", "Polygon") - .startArray("coordinates") - .startArray() - .startArray().value(183.0).value(10.0).endArray() - .startArray().value(183.0).value(-10.0).endArray() - .startArray().value(176.0).value(-15.0).endArray() - .startArray().value(172.0).value(0.0).endArray() - .startArray().value(176.0).value(15.0).endArray() - .startArray().value(183.0).value(10.0).endArray() - .endArray() - .startArray() - .startArray().value(178.0).value(8.0).endArray() - .startArray().value(182.0).value(8.0).endArray() - .startArray().value(180.0).value(-8.0).endArray() - .startArray().value(178.0).value(8.0).endArray() - .endArray() - .endArray() - .endObject()); - - try (XContentParser parser = createParser(JsonXContent.jsonXContent, polygonGeoJson)) { - parser.nextToken(); - Shape shape = ShapeParser.parse(parser).buildS4J(); - ElasticsearchGeoAssertions.assertMultiPolygon(shape, true); - } - - try (XContentParser parser = createParser(JsonXContent.jsonXContent, polygonGeoJson)) { - parser.nextToken(); - ElasticsearchGeoAssertions.assertMultiPolygon(parse(parser), false); - } - } - - public void testParseInvalidPolygon() throws IOException { - /** - * The following 3 test cases ensure proper error handling of invalid polygons - * per the GeoJSON specification - */ - // test case 1: create an invalid polygon with only 2 points - String invalidPoly = Strings.toString(XContentFactory.jsonBuilder().startObject().field("type", "polygon") - .startArray("coordinates") - .startArray() - .startArray().value(-74.011).value(40.753).endArray() - .startArray().value(-75.022).value(41.783).endArray() - .endArray() - .endArray() - .endObject()); - try (XContentParser parser = createParser(JsonXContent.jsonXContent, invalidPoly)) { - parser.nextToken(); - ElasticsearchGeoAssertions.assertValidException(parser, ElasticsearchParseException.class); - assertNull(parser.nextToken()); - } - - // test case 2: create an invalid polygon with only 1 point - invalidPoly = Strings.toString(XContentFactory.jsonBuilder().startObject().field("type", "polygon") - .startArray("coordinates") - .startArray() - .startArray().value(-74.011).value(40.753).endArray() - .endArray() - .endArray() - .endObject()); - - try (XContentParser parser = createParser(JsonXContent.jsonXContent, invalidPoly)) { - parser.nextToken(); - ElasticsearchGeoAssertions.assertValidException(parser, ElasticsearchParseException.class); - assertNull(parser.nextToken()); - } - - // test case 3: create an invalid polygon with 0 points - invalidPoly = Strings.toString(XContentFactory.jsonBuilder().startObject().field("type", "polygon") - .startArray("coordinates") - .startArray() - .startArray().endArray() - .endArray() - .endArray() - .endObject()); - - try (XContentParser parser = createParser(JsonXContent.jsonXContent, invalidPoly)) { - parser.nextToken(); - ElasticsearchGeoAssertions.assertValidException(parser, ElasticsearchParseException.class); - assertNull(parser.nextToken()); - } - - // test case 4: create an invalid polygon with null value points - invalidPoly = Strings.toString(XContentFactory.jsonBuilder().startObject().field("type", "polygon") - .startArray("coordinates") - .startArray() - .startArray().nullValue().nullValue().endArray() - .endArray() - .endArray() - .endObject()); - - try (XContentParser parser = createParser(JsonXContent.jsonXContent, invalidPoly)) { - parser.nextToken(); - ElasticsearchGeoAssertions.assertValidException(parser, IllegalArgumentException.class); - assertNull(parser.nextToken()); - } - - // test case 5: create an invalid polygon with 1 invalid LinearRing - invalidPoly = Strings.toString(XContentFactory.jsonBuilder().startObject().field("type", "polygon") - .startArray("coordinates") - .nullValue().nullValue() - .endArray() - .endObject()); - - try (XContentParser parser = createParser(JsonXContent.jsonXContent, invalidPoly)) { - parser.nextToken(); - ElasticsearchGeoAssertions.assertValidException(parser, IllegalArgumentException.class); - assertNull(parser.nextToken()); - } - - // test case 6: create an invalid polygon with 0 LinearRings - invalidPoly = Strings.toString(XContentFactory.jsonBuilder().startObject().field("type", "polygon") - .startArray("coordinates").endArray() - .endObject()); - - try (XContentParser parser = createParser(JsonXContent.jsonXContent, invalidPoly)) { - parser.nextToken(); - ElasticsearchGeoAssertions.assertValidException(parser, ElasticsearchParseException.class); - assertNull(parser.nextToken()); - } - - // test case 7: create an invalid polygon with 0 LinearRings - invalidPoly = Strings.toString(XContentFactory.jsonBuilder().startObject().field("type", "polygon") - .startArray("coordinates") - .startArray().value(-74.011).value(40.753).endArray() - .endArray() - .endObject()); - - try (XContentParser parser = createParser(JsonXContent.jsonXContent, invalidPoly)) { - parser.nextToken(); - ElasticsearchGeoAssertions.assertValidException(parser, ElasticsearchParseException.class); - assertNull(parser.nextToken()); - } - } - - public void testParsePolygonWithHole() throws IOException, ParseException { - XContentBuilder polygonGeoJson = XContentFactory.jsonBuilder() - .startObject() - .field("type", "Polygon") - .startArray("coordinates") - .startArray() - .startArray().value(100.0).value(1.0).endArray() - .startArray().value(101.0).value(1.0).endArray() - .startArray().value(101.0).value(0.0).endArray() - .startArray().value(100.0).value(0.0).endArray() - .startArray().value(100.0).value(1.0).endArray() - .endArray() - .startArray() - .startArray().value(100.2).value(0.8).endArray() - .startArray().value(100.2).value(0.2).endArray() - .startArray().value(100.8).value(0.2).endArray() - .startArray().value(100.8).value(0.8).endArray() - .startArray().value(100.2).value(0.8).endArray() - .endArray() - .endArray() - .endObject(); - - // add 3d point to test ISSUE #10501 - List shellCoordinates = new ArrayList<>(); - shellCoordinates.add(new Coordinate(100, 0, 15.0)); - shellCoordinates.add(new Coordinate(101, 0)); - shellCoordinates.add(new Coordinate(101, 1)); - shellCoordinates.add(new Coordinate(100, 1, 10.0)); - shellCoordinates.add(new Coordinate(100, 0)); - - List holeCoordinates = new ArrayList<>(); - holeCoordinates.add(new Coordinate(100.2, 0.2)); - holeCoordinates.add(new Coordinate(100.8, 0.2)); - holeCoordinates.add(new Coordinate(100.8, 0.8)); - holeCoordinates.add(new Coordinate(100.2, 0.8)); - holeCoordinates.add(new Coordinate(100.2, 0.2)); - - LinearRing shell = GEOMETRY_FACTORY.createLinearRing( - shellCoordinates.toArray(new Coordinate[shellCoordinates.size()])); - LinearRing[] holes = new LinearRing[1]; - holes[0] = GEOMETRY_FACTORY.createLinearRing( - holeCoordinates.toArray(new Coordinate[holeCoordinates.size()])); - Polygon expected = GEOMETRY_FACTORY.createPolygon(shell, holes); - assertGeometryEquals(jtsGeom(expected), polygonGeoJson, true); - - org.elasticsearch.geometry.LinearRing hole = - new org.elasticsearch.geometry.LinearRing( - new double[] {100.8d, 100.8d, 100.2d, 100.2d, 100.8d}, new double[] {0.8d, 0.2d, 0.2d, 0.8d, 0.8d}); - org.elasticsearch.geometry.Polygon p = - new org.elasticsearch.geometry.Polygon(new org.elasticsearch.geometry.LinearRing( - new double[] {100d, 101d, 101d, 100d, 100d}, new double[] {0d, 0d, 1d, 1d, 0d}), Collections.singletonList(hole)); - assertGeometryEquals(p, polygonGeoJson, false); - } - - public void testParseSelfCrossingPolygon() throws IOException { - // test self crossing ccw poly not crossing dateline - String polygonGeoJson = Strings.toString(XContentFactory.jsonBuilder().startObject().field("type", "Polygon") - .startArray("coordinates") - .startArray() - .startArray().value(176.0).value(15.0).endArray() - .startArray().value(-177.0).value(10.0).endArray() - .startArray().value(-177.0).value(-10.0).endArray() - .startArray().value(176.0).value(-15.0).endArray() - .startArray().value(-177.0).value(15.0).endArray() - .startArray().value(172.0).value(0.0).endArray() - .startArray().value(176.0).value(15.0).endArray() - .endArray() - .endArray() - .endObject()); - - try (XContentParser parser = createParser(JsonXContent.jsonXContent, polygonGeoJson)) { - parser.nextToken(); - ElasticsearchGeoAssertions.assertValidException(parser, InvalidShapeException.class); - assertNull(parser.nextToken()); - } - } - - @Override - public void testParseMultiPoint() throws IOException, ParseException { - XContentBuilder multiPointGeoJson = XContentFactory.jsonBuilder() - .startObject() - .field("type", "MultiPoint") - .startArray("coordinates") - .startArray().value(100.0).value(0.0).endArray() - .startArray().value(101.0).value(1.0).endArray() - .endArray() - .endObject(); - ShapeCollection expected = shapeCollection( - SPATIAL_CONTEXT.makePoint(100, 0), - SPATIAL_CONTEXT.makePoint(101, 1.0)); - assertGeometryEquals(expected, multiPointGeoJson, true); - - assertGeometryEquals(new MultiPoint(Arrays.asList( - new org.elasticsearch.geometry.Point(100, 0), - new org.elasticsearch.geometry.Point(101, 1))), multiPointGeoJson, false); - } - - @Override - public void testParseMultiPolygon() throws IOException, ParseException { - // test #1: two polygons; one without hole, one with hole - XContentBuilder multiPolygonGeoJson = XContentFactory.jsonBuilder() - .startObject() - .field("type", "MultiPolygon") - .startArray("coordinates") - .startArray()//first poly (without holes) - .startArray() - .startArray().value(102.0).value(2.0).endArray() - .startArray().value(103.0).value(2.0).endArray() - .startArray().value(103.0).value(3.0).endArray() - .startArray().value(102.0).value(3.0).endArray() - .startArray().value(102.0).value(2.0).endArray() - .endArray() - .endArray() - .startArray()//second poly (with hole) - .startArray() - .startArray().value(100.0).value(0.0).endArray() - .startArray().value(101.0).value(0.0).endArray() - .startArray().value(101.0).value(1.0).endArray() - .startArray().value(100.0).value(1.0).endArray() - .startArray().value(100.0).value(0.0).endArray() - .endArray() - .startArray()//hole - .startArray().value(100.2).value(0.8).endArray() - .startArray().value(100.2).value(0.2).endArray() - .startArray().value(100.8).value(0.2).endArray() - .startArray().value(100.8).value(0.8).endArray() - .startArray().value(100.2).value(0.8).endArray() - .endArray() - .endArray() - .endArray() - .endObject(); - - List shellCoordinates = new ArrayList<>(); - shellCoordinates.add(new Coordinate(100, 0)); - shellCoordinates.add(new Coordinate(101, 0)); - shellCoordinates.add(new Coordinate(101, 1)); - shellCoordinates.add(new Coordinate(100, 1)); - shellCoordinates.add(new Coordinate(100, 0)); - - List holeCoordinates = new ArrayList<>(); - holeCoordinates.add(new Coordinate(100.2, 0.2)); - holeCoordinates.add(new Coordinate(100.8, 0.2)); - holeCoordinates.add(new Coordinate(100.8, 0.8)); - holeCoordinates.add(new Coordinate(100.2, 0.8)); - holeCoordinates.add(new Coordinate(100.2, 0.2)); - - LinearRing shell = GEOMETRY_FACTORY.createLinearRing(shellCoordinates.toArray(new Coordinate[shellCoordinates.size()])); - LinearRing[] holes = new LinearRing[1]; - holes[0] = GEOMETRY_FACTORY.createLinearRing(holeCoordinates.toArray(new Coordinate[holeCoordinates.size()])); - Polygon withHoles = GEOMETRY_FACTORY.createPolygon(shell, holes); - - shellCoordinates = new ArrayList<>(); - shellCoordinates.add(new Coordinate(102, 3)); - shellCoordinates.add(new Coordinate(103, 3)); - shellCoordinates.add(new Coordinate(103, 2)); - shellCoordinates.add(new Coordinate(102, 2)); - shellCoordinates.add(new Coordinate(102, 3)); - - shell = GEOMETRY_FACTORY.createLinearRing(shellCoordinates.toArray(new Coordinate[shellCoordinates.size()])); - Polygon withoutHoles = GEOMETRY_FACTORY.createPolygon(shell, null); - - Shape expected = shapeCollection(withoutHoles, withHoles); - - assertGeometryEquals(expected, multiPolygonGeoJson, true); - - org.elasticsearch.geometry.LinearRing hole = new org.elasticsearch.geometry.LinearRing( - new double[] {100.8d, 100.8d, 100.2d, 100.2d, 100.8d}, new double[] {0.8d, 0.2d, 0.2d, 0.8d, 0.8d}); - - org.elasticsearch.geometry.MultiPolygon polygons = new org.elasticsearch.geometry.MultiPolygon(Arrays.asList( - new org.elasticsearch.geometry.Polygon(new org.elasticsearch.geometry.LinearRing( - new double[] {103d, 103d, 102d, 102d, 103d}, new double[] {2d, 3d, 3d, 2d, 2d})), - new org.elasticsearch.geometry.Polygon(new org.elasticsearch.geometry.LinearRing( - new double[] {101d, 101d, 100d, 100d, 101d}, new double[] {0d, 1d, 1d, 0d, 0d}), Collections.singletonList(hole)))); - - assertGeometryEquals(polygons, multiPolygonGeoJson, false); - - // test #2: multipolygon; one polygon with one hole - // this test converting the multipolygon from a ShapeCollection type - // to a simple polygon (jtsGeom) - multiPolygonGeoJson = XContentFactory.jsonBuilder() - .startObject() - .field("type", "MultiPolygon") - .startArray("coordinates") - .startArray() - .startArray() - .startArray().value(100.0).value(1.0).endArray() - .startArray().value(101.0).value(1.0).endArray() - .startArray().value(101.0).value(0.0).endArray() - .startArray().value(100.0).value(0.0).endArray() - .startArray().value(100.0).value(1.0).endArray() - .endArray() - .startArray() // hole - .startArray().value(100.2).value(0.8).endArray() - .startArray().value(100.2).value(0.2).endArray() - .startArray().value(100.8).value(0.2).endArray() - .startArray().value(100.8).value(0.8).endArray() - .startArray().value(100.2).value(0.8).endArray() - .endArray() - .endArray() - .endArray() - .endObject(); - - shellCoordinates = new ArrayList<>(); - shellCoordinates.add(new Coordinate(100, 1)); - shellCoordinates.add(new Coordinate(101, 1)); - shellCoordinates.add(new Coordinate(101, 0)); - shellCoordinates.add(new Coordinate(100, 0)); - shellCoordinates.add(new Coordinate(100, 1)); - - holeCoordinates = new ArrayList<>(); - holeCoordinates.add(new Coordinate(100.2, 0.8)); - holeCoordinates.add(new Coordinate(100.2, 0.2)); - holeCoordinates.add(new Coordinate(100.8, 0.2)); - holeCoordinates.add(new Coordinate(100.8, 0.8)); - holeCoordinates.add(new Coordinate(100.2, 0.8)); - - shell = GEOMETRY_FACTORY.createLinearRing(shellCoordinates.toArray(new Coordinate[shellCoordinates.size()])); - holes = new LinearRing[1]; - holes[0] = GEOMETRY_FACTORY.createLinearRing(holeCoordinates.toArray(new Coordinate[holeCoordinates.size()])); - withHoles = GEOMETRY_FACTORY.createPolygon(shell, holes); - - assertGeometryEquals(jtsGeom(withHoles), multiPolygonGeoJson, true); - - org.elasticsearch.geometry.LinearRing luceneHole = - new org.elasticsearch.geometry.LinearRing( - new double[] {100.8d, 100.8d, 100.2d, 100.2d, 100.8d}, new double[] {0.8d, 0.2d, 0.2d, 0.8d, 0.8d}); - - org.elasticsearch.geometry.Polygon lucenePolygons = (new org.elasticsearch.geometry.Polygon( - new org.elasticsearch.geometry.LinearRing( - new double[] {100d, 101d, 101d, 100d, 100d}, new double[] {0d, 0d, 1d, 1d, 0d}), Collections.singletonList(luceneHole))); - assertGeometryEquals(lucenePolygons, multiPolygonGeoJson, false); - } - - @Override - public void testParseGeometryCollection() throws IOException, ParseException { - XContentBuilder geometryCollectionGeoJson = XContentFactory.jsonBuilder() - .startObject() - .field("type", "GeometryCollection") - .startArray("geometries") - .startObject() - .field("type", "LineString") - .startArray("coordinates") - .startArray().value(100.0).value(0.0).endArray() - .startArray().value(101.0).value(1.0).endArray() - .endArray() - .endObject() - .startObject() - .field("type", "Point") - .startArray("coordinates").value(102.0).value(2.0).endArray() - .endObject() - .startObject() - .field("type", "Polygon") - .startArray("coordinates") - .startArray() - .startArray().value(-177.0).value(10.0).endArray() - .startArray().value(176.0).value(15.0).endArray() - .startArray().value(172.0).value(0.0).endArray() - .startArray().value(176.0).value(-15.0).endArray() - .startArray().value(-177.0).value(-10.0).endArray() - .startArray().value(-177.0).value(10.0).endArray() - .endArray() - .endArray() - .endObject() - .endArray() - .endObject(); - - ArrayList shellCoordinates1 = new ArrayList<>(); - shellCoordinates1.add(new Coordinate(180.0, -12.142857142857142)); - shellCoordinates1.add(new Coordinate(180.0, 12.142857142857142)); - shellCoordinates1.add(new Coordinate(176.0, 15.0)); - shellCoordinates1.add(new Coordinate(172.0, 0.0)); - shellCoordinates1.add(new Coordinate(176.0, -15)); - shellCoordinates1.add(new Coordinate(180.0, -12.142857142857142)); - - ArrayList shellCoordinates2 = new ArrayList<>(); - shellCoordinates2.add(new Coordinate(-180.0, 12.142857142857142)); - shellCoordinates2.add(new Coordinate(-180.0, -12.142857142857142)); - shellCoordinates2.add(new Coordinate(-177.0, -10.0)); - shellCoordinates2.add(new Coordinate(-177.0, 10.0)); - shellCoordinates2.add(new Coordinate(-180.0, 12.142857142857142)); - - Shape[] expected = new Shape[3]; - LineString expectedLineString = GEOMETRY_FACTORY.createLineString(new Coordinate[]{ - new Coordinate(100, 0), - new Coordinate(101, 1), - }); - expected[0] = jtsGeom(expectedLineString); - Point expectedPoint = GEOMETRY_FACTORY.createPoint(new Coordinate(102.0, 2.0)); - expected[1] = new JtsPoint(expectedPoint, SPATIAL_CONTEXT); - LinearRing shell1 = GEOMETRY_FACTORY.createLinearRing( - shellCoordinates1.toArray(new Coordinate[shellCoordinates1.size()])); - LinearRing shell2 = GEOMETRY_FACTORY.createLinearRing( - shellCoordinates2.toArray(new Coordinate[shellCoordinates2.size()])); - MultiPolygon expectedMultiPoly = GEOMETRY_FACTORY.createMultiPolygon( - new Polygon[] { - GEOMETRY_FACTORY.createPolygon(shell1), - GEOMETRY_FACTORY.createPolygon(shell2) - } - ); - expected[2] = jtsGeom(expectedMultiPoly); - - - //equals returns true only if geometries are in the same order - assertGeometryEquals(shapeCollection(expected), geometryCollectionGeoJson, true); - - GeometryCollection geometryExpected = new GeometryCollection<> (Arrays.asList( - new Line(new double[] {100d, 101d}, new double[] {0d, 1d}), - new org.elasticsearch.geometry.Point(102d, 2d), - new org.elasticsearch.geometry.MultiPolygon(Arrays.asList( - new org.elasticsearch.geometry.Polygon(new org.elasticsearch.geometry.LinearRing( - new double[] {180d, 180d, 176d, 172d, 176d, 180d}, - new double[] {-12.142857142857142d, 12.142857142857142d, 15d, 0d, -15d, -12.142857142857142d} - )), - new org.elasticsearch.geometry.Polygon(new org.elasticsearch.geometry.LinearRing( - new double[] {-180d, -180d, -177d, -177d, -180d}, - new double[] {12.142857142857142d, -12.142857142857142d, -10d, 10d, 12.142857142857142d} - )) - )) - )); - assertGeometryEquals(geometryExpected, geometryCollectionGeoJson, false); - } - - public void testThatParserExtractsCorrectTypeAndCoordinatesFromArbitraryJson() throws IOException, ParseException { - XContentBuilder pointGeoJson = XContentFactory.jsonBuilder() - .startObject() - .startObject("crs") - .field("type", "name") - .startObject("properties") - .field("name", "urn:ogc:def:crs:OGC:1.3:CRS84") - .endObject() - .endObject() - .field("bbox", "foobar") - .field("type", "point") - .field("bubu", "foobar") - .startArray("coordinates").value(100.0).value(0.0).endArray() - .startObject("nested").startArray("coordinates").value(200.0).value(0.0).endArray().endObject() - .startObject("lala").field("type", "NotAPoint").endObject() - .endObject(); - Point expected = GEOMETRY_FACTORY.createPoint(new Coordinate(100.0, 0.0)); - assertGeometryEquals(new JtsPoint(expected, SPATIAL_CONTEXT), pointGeoJson, true); - - org.elasticsearch.geometry.Point expectedPt = new org.elasticsearch.geometry.Point(100, 0); - assertGeometryEquals(expectedPt, pointGeoJson, false); - } - - public void testParseOrientationOption() throws IOException, ParseException { - // test 1: valid ccw (right handed system) poly not crossing dateline (with 'right' field) - XContentBuilder polygonGeoJson = XContentFactory.jsonBuilder() - .startObject() - .field("type", "Polygon") - .field("orientation", "right") - .startArray("coordinates") - .startArray() - .startArray().value(176.0).value(15.0).endArray() - .startArray().value(-177.0).value(10.0).endArray() - .startArray().value(-177.0).value(-10.0).endArray() - .startArray().value(176.0).value(-15.0).endArray() - .startArray().value(172.0).value(0.0).endArray() - .startArray().value(176.0).value(15.0).endArray() - .endArray() - .startArray() - .startArray().value(-172.0).value(8.0).endArray() - .startArray().value(174.0).value(10.0).endArray() - .startArray().value(-172.0).value(-8.0).endArray() - .startArray().value(-172.0).value(8.0).endArray() - .endArray() - .endArray() - .endObject(); - - try (XContentParser parser = createParser(polygonGeoJson)) { - parser.nextToken(); - Shape shape = ShapeParser.parse(parser).buildS4J(); - ElasticsearchGeoAssertions.assertPolygon(shape, true); - } - - try (XContentParser parser = createParser(polygonGeoJson)) { - parser.nextToken(); - ElasticsearchGeoAssertions.assertPolygon(parse(parser), false); - } - - // test 2: valid ccw (right handed system) poly not crossing dateline (with 'ccw' field) - polygonGeoJson = XContentFactory.jsonBuilder() - .startObject() - .field("type", "Polygon") - .field("orientation", "ccw") - .startArray("coordinates") - .startArray() - .startArray().value(176.0).value(15.0).endArray() - .startArray().value(-177.0).value(10.0).endArray() - .startArray().value(-177.0).value(-10.0).endArray() - .startArray().value(176.0).value(-15.0).endArray() - .startArray().value(172.0).value(0.0).endArray() - .startArray().value(176.0).value(15.0).endArray() - .endArray() - .startArray() - .startArray().value(-172.0).value(8.0).endArray() - .startArray().value(174.0).value(10.0).endArray() - .startArray().value(-172.0).value(-8.0).endArray() - .startArray().value(-172.0).value(8.0).endArray() - .endArray() - .endArray() - .endObject(); - - try (XContentParser parser = createParser(polygonGeoJson)) { - parser.nextToken(); - Shape shape = ShapeParser.parse(parser).buildS4J(); - ElasticsearchGeoAssertions.assertPolygon(shape, true); - } - - try (XContentParser parser = createParser(polygonGeoJson)) { - parser.nextToken(); - ElasticsearchGeoAssertions.assertPolygon(parse(parser), false); - } - - // test 3: valid ccw (right handed system) poly not crossing dateline (with 'counterclockwise' field) - polygonGeoJson = XContentFactory.jsonBuilder() - .startObject() - .field("type", "Polygon") - .field("orientation", "counterclockwise") - .startArray("coordinates") - .startArray() - .startArray().value(176.0).value(15.0).endArray() - .startArray().value(-177.0).value(10.0).endArray() - .startArray().value(-177.0).value(-10.0).endArray() - .startArray().value(176.0).value(-15.0).endArray() - .startArray().value(172.0).value(0.0).endArray() - .startArray().value(176.0).value(15.0).endArray() - .endArray() - .startArray() - .startArray().value(-172.0).value(8.0).endArray() - .startArray().value(174.0).value(10.0).endArray() - .startArray().value(-172.0).value(-8.0).endArray() - .startArray().value(-172.0).value(8.0).endArray() - .endArray() - .endArray() - .endObject(); - - try (XContentParser parser = createParser(polygonGeoJson)) { - parser.nextToken(); - Shape shape = ShapeParser.parse(parser).buildS4J(); - ElasticsearchGeoAssertions.assertPolygon(shape, true); - } - - try (XContentParser parser = createParser(polygonGeoJson)) { - parser.nextToken(); - ElasticsearchGeoAssertions.assertPolygon(parse(parser), false); - } - - // test 4: valid cw (left handed system) poly crossing dateline (with 'left' field) - polygonGeoJson = XContentFactory.jsonBuilder() - .startObject() - .field("type", "Polygon") - .field("orientation", "left") - .startArray("coordinates") - .startArray() - .startArray().value(176.0).value(15.0).endArray() - .startArray().value(-177.0).value(10.0).endArray() - .startArray().value(-177.0).value(-10.0).endArray() - .startArray().value(176.0).value(-15.0).endArray() - .startArray().value(172.0).value(0.0).endArray() - .startArray().value(176.0).value(15.0).endArray() - .endArray() - .startArray() - .startArray().value(-178.0).value(8.0).endArray() - .startArray().value(178.0).value(8.0).endArray() - .startArray().value(180.0).value(-8.0).endArray() - .startArray().value(-178.0).value(8.0).endArray() - .endArray() - .endArray() - .endObject(); - - try (XContentParser parser = createParser(polygonGeoJson)) { - parser.nextToken(); - Shape shape = ShapeParser.parse(parser).buildS4J(); - ElasticsearchGeoAssertions.assertMultiPolygon(shape, true); - } - - try (XContentParser parser = createParser(polygonGeoJson)) { - parser.nextToken(); - ElasticsearchGeoAssertions.assertMultiPolygon(parse(parser), false); - } - - // test 5: valid cw multipoly (left handed system) poly crossing dateline (with 'cw' field) - polygonGeoJson = XContentFactory.jsonBuilder() - .startObject() - .field("type", "Polygon") - .field("orientation", "cw") - .startArray("coordinates") - .startArray() - .startArray().value(176.0).value(15.0).endArray() - .startArray().value(-177.0).value(10.0).endArray() - .startArray().value(-177.0).value(-10.0).endArray() - .startArray().value(176.0).value(-15.0).endArray() - .startArray().value(172.0).value(0.0).endArray() - .startArray().value(176.0).value(15.0).endArray() - .endArray() - .startArray() - .startArray().value(-178.0).value(8.0).endArray() - .startArray().value(178.0).value(8.0).endArray() - .startArray().value(180.0).value(-8.0).endArray() - .startArray().value(-178.0).value(8.0).endArray() - .endArray() - .endArray() - .endObject(); - - try (XContentParser parser = createParser(polygonGeoJson)) { - parser.nextToken(); - Shape shape = ShapeParser.parse(parser).buildS4J(); - ElasticsearchGeoAssertions.assertMultiPolygon(shape, true); - } - - try (XContentParser parser = createParser(polygonGeoJson)) { - parser.nextToken(); - ElasticsearchGeoAssertions.assertMultiPolygon(parse(parser), false); - } - - // test 6: valid cw multipoly (left handed system) poly crossing dateline (with 'clockwise' field) - polygonGeoJson = XContentFactory.jsonBuilder() - .startObject() - .field("type", "Polygon") - .field("orientation", "clockwise") - .startArray("coordinates") - .startArray() - .startArray().value(176.0).value(15.0).endArray() - .startArray().value(-177.0).value(10.0).endArray() - .startArray().value(-177.0).value(-10.0).endArray() - .startArray().value(176.0).value(-15.0).endArray() - .startArray().value(172.0).value(0.0).endArray() - .startArray().value(176.0).value(15.0).endArray() - .endArray() - .startArray() - .startArray().value(-178.0).value(8.0).endArray() - .startArray().value(178.0).value(8.0).endArray() - .startArray().value(180.0).value(-8.0).endArray() - .startArray().value(-178.0).value(8.0).endArray() - .endArray() - .endArray() - .endObject(); - - try (XContentParser parser = createParser(polygonGeoJson)) { - parser.nextToken(); - Shape shape = ShapeParser.parse(parser).buildS4J(); - ElasticsearchGeoAssertions.assertMultiPolygon(shape, true); - } - - try (XContentParser parser = createParser(polygonGeoJson)) { - parser.nextToken(); - ElasticsearchGeoAssertions.assertMultiPolygon(parse(parser), false); - } - } - - public void testParseInvalidShapes() throws IOException { - // single dimensions point - XContentBuilder tooLittlePointGeoJson = XContentFactory.jsonBuilder() - .startObject() - .field("type", "Point") - .startArray("coordinates").value(10.0).endArray() - .endObject(); - - try (XContentParser parser = createParser(tooLittlePointGeoJson)) { - parser.nextToken(); - ElasticsearchGeoAssertions.assertValidException(parser, ElasticsearchParseException.class); - assertNull(parser.nextToken()); - } - - // zero dimensions point - XContentBuilder emptyPointGeoJson = XContentFactory.jsonBuilder() - .startObject() - .field("type", "Point") - .startObject("coordinates").field("foo", "bar").endObject() - .endObject(); - - try (XContentParser parser = createParser(emptyPointGeoJson)) { - parser.nextToken(); - ElasticsearchGeoAssertions.assertValidException(parser, ElasticsearchParseException.class); - assertNull(parser.nextToken()); - } - } - - public void testParseInvalidGeometryCollectionShapes() throws IOException { - // single dimensions point - XContentBuilder invalidPoints = XContentFactory.jsonBuilder() - .startObject() - .startObject("foo") - .field("type", "geometrycollection") - .startArray("geometries") - .startObject() - .field("type", "polygon") - .startArray("coordinates") - .startArray().value("46.6022226498514").value("24.7237442867977").endArray() - .startArray().value("46.6031857243798").value("24.722968774929").endArray() - .endArray() // coordinates - .endObject() - .endArray() // geometries - .endObject() - .endObject(); - try (XContentParser parser = createParser(invalidPoints)) { - parser.nextToken(); // foo - parser.nextToken(); // start object - parser.nextToken(); // start object - ElasticsearchGeoAssertions.assertValidException(parser, ElasticsearchParseException.class); - assertEquals(XContentParser.Token.END_OBJECT, parser.nextToken()); // end of the document - assertNull(parser.nextToken()); // no more elements afterwards - } - } - - public Geometry parse(XContentParser parser) throws IOException, ParseException { - GeometryParser geometryParser = new GeometryParser(true, true, true); - GeoShapeIndexer indexer = new GeoShapeIndexer(true, "name"); - return indexer.prepareForIndexing(geometryParser.parse(parser)); - } -} diff --git a/server/src/test/java/org/elasticsearch/common/geo/GeometryIOTests.java b/server/src/test/java/org/elasticsearch/common/geo/GeometryIOTests.java index 96dba312020ba..fe73c27618be3 100644 --- a/server/src/test/java/org/elasticsearch/common/geo/GeometryIOTests.java +++ b/server/src/test/java/org/elasticsearch/common/geo/GeometryIOTests.java @@ -8,18 +8,12 @@ package org.elasticsearch.common.geo; -import org.elasticsearch.common.geo.builders.ShapeBuilder; import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.common.io.stream.NamedWriteableAwareStreamInput; -import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.geometry.Geometry; -import org.elasticsearch.geometry.GeometryCollection; -import org.elasticsearch.geometry.ShapeType; import org.elasticsearch.test.ESTestCase; import static org.elasticsearch.geo.GeometryTestUtils.randomGeometry; -import static org.elasticsearch.index.query.LegacyGeoShapeQueryProcessor.geometryToShapeBuilder; public class GeometryIOTests extends ESTestCase { @@ -27,69 +21,16 @@ public void testRandomSerialization() throws Exception { for (int i = 0; i < randomIntBetween(1, 20); i++) { boolean hasAlt = randomBoolean(); Geometry geometry = randomGeometry(hasAlt); - if (shapeSupported(geometry) && randomBoolean()) { - // Shape builder conversion doesn't support altitude - ShapeBuilder shapeBuilder = geometryToShapeBuilder(geometry); - if (randomBoolean()) { - Geometry actual = shapeBuilder.buildGeometry(); + // Test Geometry -> Geometry + try (BytesStreamOutput out = new BytesStreamOutput()) { + GeometryIO.writeGeometry(out, geometry); + ; + try (StreamInput in = out.bytes().streamInput()) { + Geometry actual = GeometryIO.readGeometry(in); assertEquals(geometry, actual); - } - if (randomBoolean()) { - // Test ShapeBuilder -> Geometry Serialization - try (BytesStreamOutput out = new BytesStreamOutput()) { - out.writeNamedWriteable(shapeBuilder); - try (StreamInput in = out.bytes().streamInput()) { - Geometry actual = GeometryIO.readGeometry(in); - assertEquals(geometry, actual); - assertEquals(0, in.available()); - } - } - } else { - // Test Geometry -> ShapeBuilder Serialization - try (BytesStreamOutput out = new BytesStreamOutput()) { - GeometryIO.writeGeometry(out, geometry); - try (StreamInput in = out.bytes().streamInput()) { - try (StreamInput nin = new NamedWriteableAwareStreamInput(in, this.writableRegistry())) { - ShapeBuilder actual = nin.readNamedWriteable(ShapeBuilder.class); - assertEquals(shapeBuilder, actual); - assertEquals(0, in.available()); - } - } - } - } - // Test Geometry -> Geometry - try (BytesStreamOutput out = new BytesStreamOutput()) { - GeometryIO.writeGeometry(out, geometry); - ; - try (StreamInput in = out.bytes().streamInput()) { - Geometry actual = GeometryIO.readGeometry(in); - assertEquals(geometry, actual); - assertEquals(0, in.available()); - } - } - - } - } - } - - private boolean shapeSupported(Geometry geometry) { - if (geometry.hasZ()) { - return false; - } - - if (geometry.type() == ShapeType.GEOMETRYCOLLECTION) { - GeometryCollection collection = (GeometryCollection) geometry; - for (Geometry g : collection) { - if (shapeSupported(g) == false) { - return false; + assertEquals(0, in.available()); } } } - return true; - } - - @Override - protected NamedWriteableRegistry writableRegistry() { - return new NamedWriteableRegistry(GeoShapeType.getShapeWriteables()); } } diff --git a/server/src/test/java/org/elasticsearch/common/geo/ShapeBuilderTests.java b/server/src/test/java/org/elasticsearch/common/geo/ShapeBuilderTests.java deleted file mode 100644 index 94c85db2e366b..0000000000000 --- a/server/src/test/java/org/elasticsearch/common/geo/ShapeBuilderTests.java +++ /dev/null @@ -1,842 +0,0 @@ -/* - * 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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -package org.elasticsearch.common.geo; - -import org.elasticsearch.common.geo.builders.CircleBuilder; -import org.elasticsearch.common.geo.builders.CoordinatesBuilder; -import org.elasticsearch.common.geo.builders.EnvelopeBuilder; -import org.elasticsearch.common.geo.builders.LineStringBuilder; -import org.elasticsearch.common.geo.builders.MultiLineStringBuilder; -import org.elasticsearch.common.geo.builders.PointBuilder; -import org.elasticsearch.common.geo.builders.PolygonBuilder; -import org.elasticsearch.common.geo.builders.ShapeBuilder; -import org.elasticsearch.geometry.LinearRing; -import org.elasticsearch.index.mapper.GeoShapeIndexer; -import org.elasticsearch.test.ESTestCase; -import org.locationtech.jts.geom.Coordinate; -import org.locationtech.jts.geom.LineString; -import org.locationtech.jts.geom.Polygon; -import org.locationtech.spatial4j.exception.InvalidShapeException; -import org.locationtech.spatial4j.shape.Circle; -import org.locationtech.spatial4j.shape.Point; -import org.locationtech.spatial4j.shape.Rectangle; -import org.locationtech.spatial4j.shape.impl.PointImpl; - -import static org.elasticsearch.test.hamcrest.ElasticsearchGeoAssertions.assertMultiLineString; -import static org.elasticsearch.test.hamcrest.ElasticsearchGeoAssertions.assertMultiPolygon; -import static org.elasticsearch.test.hamcrest.ElasticsearchGeoAssertions.assertPolygon; -import static org.hamcrest.Matchers.containsString; -import static org.hamcrest.Matchers.not; - -/** - * Tests for {@link ShapeBuilder} - */ -public class ShapeBuilderTests extends ESTestCase { - - public void testNewPoint() { - PointBuilder pb = new PointBuilder().coordinate(-100, 45); - Point point = pb.buildS4J(); - assertEquals(-100D, point.getX(), 0.0d); - assertEquals(45D, point.getY(), 0.0d); - org.elasticsearch.geometry.Point geoPoint = pb.buildGeometry(); - assertEquals(-100D, geoPoint.getX(), 0.0d); - assertEquals(45D, geoPoint.getY(), 0.0d); - } - - public void testNewRectangle() { - EnvelopeBuilder eb = new EnvelopeBuilder(new Coordinate(-45, 30), new Coordinate(45, -30)); - Rectangle rectangle = eb.buildS4J(); - assertEquals(-45D, rectangle.getMinX(), 0.0d); - assertEquals(-30D, rectangle.getMinY(), 0.0d); - assertEquals(45D, rectangle.getMaxX(), 0.0d); - assertEquals(30D, rectangle.getMaxY(), 0.0d); - - org.elasticsearch.geometry.Rectangle luceneRectangle = eb.buildGeometry(); - assertEquals(-45D, luceneRectangle.getMinX(), 0.0d); - assertEquals(-30D, luceneRectangle.getMinY(), 0.0d); - assertEquals(45D, luceneRectangle.getMaxX(), 0.0d); - assertEquals(30D, luceneRectangle.getMaxY(), 0.0d); - } - - public void testNewPolygon() { - PolygonBuilder pb = new PolygonBuilder(new CoordinatesBuilder() - .coordinate(-45, 30) - .coordinate(45, 30) - .coordinate(45, -30) - .coordinate(-45, -30) - .coordinate(-45, 30)); - - Polygon poly = pb.toPolygonS4J(); - LineString exterior = poly.getExteriorRing(); - assertEquals(exterior.getCoordinateN(0), new Coordinate(-45, 30)); - assertEquals(exterior.getCoordinateN(1), new Coordinate(45, 30)); - assertEquals(exterior.getCoordinateN(2), new Coordinate(45, -30)); - assertEquals(exterior.getCoordinateN(3), new Coordinate(-45, -30)); - - LinearRing polygon = pb.toPolygonGeometry().getPolygon(); - assertEquals(polygon.getY(0), 30, 0d); - assertEquals(polygon.getX(0), -45, 0d); - assertEquals(polygon.getY(1), 30, 0d); - assertEquals(polygon.getX(1), 45, 0d); - assertEquals(polygon.getY(2), -30, 0d); - assertEquals(polygon.getX(2), 45, 0d); - assertEquals(polygon.getY(3), -30, 0d); - assertEquals(polygon.getX(3), -45, 0d); - } - - public void testNewPolygon_coordinate() { - PolygonBuilder pb = new PolygonBuilder(new CoordinatesBuilder() - .coordinate(new Coordinate(-45, 30)) - .coordinate(new Coordinate(45, 30)) - .coordinate(new Coordinate(45, -30)) - .coordinate(new Coordinate(-45, -30)) - .coordinate(new Coordinate(-45, 30))); - - Polygon poly = pb.toPolygonS4J(); - LineString exterior = poly.getExteriorRing(); - assertEquals(exterior.getCoordinateN(0), new Coordinate(-45, 30)); - assertEquals(exterior.getCoordinateN(1), new Coordinate(45, 30)); - assertEquals(exterior.getCoordinateN(2), new Coordinate(45, -30)); - assertEquals(exterior.getCoordinateN(3), new Coordinate(-45, -30)); - - LinearRing polygon = pb.toPolygonGeometry().getPolygon(); - assertEquals(polygon.getY(0), 30, 0d); - assertEquals(polygon.getX(0), -45, 0d); - assertEquals(polygon.getY(1), 30, 0d); - assertEquals(polygon.getX(1), 45, 0d); - assertEquals(polygon.getY(2), -30, 0d); - assertEquals(polygon.getX(2), 45, 0d); - assertEquals(polygon.getY(3), -30, 0d); - assertEquals(polygon.getX(3), -45, 0d); - } - - public void testNewPolygon_coordinates() { - PolygonBuilder pb = new PolygonBuilder(new CoordinatesBuilder() - .coordinates(new Coordinate(-45, 30), new Coordinate(45, 30), - new Coordinate(45, -30), new Coordinate(-45, -30), new Coordinate(-45, 30)) - ); - - Polygon poly = pb.toPolygonS4J(); - LineString exterior = poly.getExteriorRing(); - assertEquals(exterior.getCoordinateN(0), new Coordinate(-45, 30)); - assertEquals(exterior.getCoordinateN(1), new Coordinate(45, 30)); - assertEquals(exterior.getCoordinateN(2), new Coordinate(45, -30)); - assertEquals(exterior.getCoordinateN(3), new Coordinate(-45, -30)); - - LinearRing polygon = pb.toPolygonGeometry().getPolygon(); - assertEquals(polygon.getY(0), 30, 0d); - assertEquals(polygon.getX(0), -45, 0d); - assertEquals(polygon.getY(1), 30, 0d); - assertEquals(polygon.getX(1), 45, 0d); - assertEquals(polygon.getY(2), -30, 0d); - assertEquals(polygon.getX(2), 45, 0d); - assertEquals(polygon.getY(3), -30, 0d); - assertEquals(polygon.getX(3), -45, 0d); - } - - public void testLineStringBuilder() { - // Building a simple LineString - LineStringBuilder lsb = new LineStringBuilder(new CoordinatesBuilder() - .coordinate(-130.0, 55.0) - .coordinate(-130.0, -40.0) - .coordinate(-15.0, -40.0) - .coordinate(-20.0, 50.0) - .coordinate(-45.0, 50.0) - .coordinate(-45.0, -15.0) - .coordinate(-110.0, -15.0) - .coordinate(-110.0, 55.0)); - - lsb.buildS4J(); - buildGeometry(lsb); - - // Building a linestring that needs to be wrapped - lsb = new LineStringBuilder(new CoordinatesBuilder() - .coordinate(100.0, 50.0) - .coordinate(110.0, -40.0) - .coordinate(240.0, -40.0) - .coordinate(230.0, 60.0) - .coordinate(200.0, 60.0) - .coordinate(200.0, -30.0) - .coordinate(130.0, -30.0) - .coordinate(130.0, 60.0)); - - lsb.buildS4J(); - buildGeometry(lsb); - - // Building a lineString on the dateline - lsb = new LineStringBuilder(new CoordinatesBuilder() - .coordinate(-180.0, 80.0) - .coordinate(-180.0, 40.0) - .coordinate(-180.0, -40.0) - .coordinate(-180.0, -80.0)); - - lsb.buildS4J(); - buildGeometry(lsb); - - // Building a lineString on the dateline - lsb = new LineStringBuilder(new CoordinatesBuilder() - .coordinate(180.0, 80.0) - .coordinate(180.0, 40.0) - .coordinate(180.0, -40.0) - .coordinate(180.0, -80.0)); - - lsb.buildS4J(); - buildGeometry(lsb); - } - - public void testMultiLineString() { - MultiLineStringBuilder mlsb = new MultiLineStringBuilder() - .linestring(new LineStringBuilder(new CoordinatesBuilder() - .coordinate(-100.0, 50.0) - .coordinate(50.0, 50.0) - .coordinate(50.0, 20.0) - .coordinate(-100.0, 20.0) - ) - ) - .linestring(new LineStringBuilder(new CoordinatesBuilder() - .coordinate(-100.0, 20.0) - .coordinate(50.0, 20.0) - .coordinate(50.0, 0.0) - .coordinate(-100.0, 0.0) - ) - ); - mlsb.buildS4J(); - buildGeometry(mlsb); - - // LineString that needs to be wrapped - new MultiLineStringBuilder() - .linestring(new LineStringBuilder(new CoordinatesBuilder() - .coordinate(150.0, 60.0) - .coordinate(200.0, 60.0) - .coordinate(200.0, 40.0) - .coordinate(150.0, 40.0) - ) - ) - .linestring(new LineStringBuilder(new CoordinatesBuilder() - .coordinate(150.0, 20.0) - .coordinate(200.0, 20.0) - .coordinate(200.0, 0.0) - .coordinate(150.0, 0.0) - ) - ); - - mlsb.buildS4J(); - buildGeometry(mlsb); - } - - public void testPolygonSelfIntersection() { - PolygonBuilder newPolygon = new PolygonBuilder(new CoordinatesBuilder() - .coordinate(-40.0, 50.0) - .coordinate(40.0, 50.0) - .coordinate(-40.0, -50.0) - .coordinate(40.0, -50.0).close()); - Exception e = expectThrows(InvalidShapeException.class, () -> newPolygon.buildS4J()); - assertThat(e.getMessage(), containsString("Cannot determine orientation: signed area equal to 0")); - } - - /** note: only supported by S4J at the moment */ - public void testGeoCircle() { - double earthCircumference = 40075016.69; - Circle circle = new CircleBuilder().center(0, 0).radius("100m").buildS4J(); - assertEquals((360 * 100) / earthCircumference, circle.getRadius(), 0.00000001); - assertEquals(new PointImpl(0, 0, ShapeBuilder.SPATIAL_CONTEXT), circle.getCenter()); - circle = new CircleBuilder().center(+180, 0).radius("100m").buildS4J(); - assertEquals((360 * 100) / earthCircumference, circle.getRadius(), 0.00000001); - assertEquals(new PointImpl(180, 0, ShapeBuilder.SPATIAL_CONTEXT), circle.getCenter()); - circle = new CircleBuilder().center(-180, 0).radius("100m").buildS4J(); - assertEquals((360 * 100) / earthCircumference, circle.getRadius(), 0.00000001); - assertEquals(new PointImpl(-180, 0, ShapeBuilder.SPATIAL_CONTEXT), circle.getCenter()); - circle = new CircleBuilder().center(0, 90).radius("100m").buildS4J(); - assertEquals((360 * 100) / earthCircumference, circle.getRadius(), 0.00000001); - assertEquals(new PointImpl(0, 90, ShapeBuilder.SPATIAL_CONTEXT), circle.getCenter()); - circle = new CircleBuilder().center(0, -90).radius("100m").buildS4J(); - assertEquals((360 * 100) / earthCircumference, circle.getRadius(), 0.00000001); - assertEquals(new PointImpl(0, -90, ShapeBuilder.SPATIAL_CONTEXT), circle.getCenter()); - double randomLat = (randomDouble() * 180) - 90; - double randomLon = (randomDouble() * 360) - 180; - double randomRadius = randomIntBetween(1, (int) earthCircumference / 4); - circle = new CircleBuilder().center(randomLon, randomLat).radius(randomRadius + "m").buildS4J(); - assertEquals((360 * randomRadius) / earthCircumference, circle.getRadius(), 0.00000001); - assertEquals(new PointImpl(randomLon, randomLat, ShapeBuilder.SPATIAL_CONTEXT), circle.getCenter()); - } - - public void testPolygonWrapping() { - PolygonBuilder pb = new PolygonBuilder(new CoordinatesBuilder() - .coordinate(-150.0, 65.0) - .coordinate(-250.0, 65.0) - .coordinate(-250.0, -65.0) - .coordinate(-150.0, -65.0) - .close()); - - assertMultiPolygon(pb.buildS4J(), true); - assertMultiPolygon(buildGeometry(pb), false); - } - - public void testLineStringWrapping() { - LineStringBuilder lsb = new LineStringBuilder(new CoordinatesBuilder() - .coordinate(-150.0, 65.0) - .coordinate(-250.0, 65.0) - .coordinate(-250.0, -65.0) - .coordinate(-150.0, -65.0) - .close()); - - assertMultiLineString(lsb.buildS4J(), true); - assertMultiLineString(buildGeometry(lsb), false); - } - - public void testDatelineOGC() { - // tests that the following shape (defined in counterclockwise OGC order) - // https://gist.github.com/anonymous/7f1bb6d7e9cd72f5977c crosses the dateline - // expected results: 3 polygons, 1 with a hole - - // a giant c shape - PolygonBuilder builder = new PolygonBuilder(new CoordinatesBuilder() - .coordinate(174,0) - .coordinate(-176,0) - .coordinate(-176,3) - .coordinate(177,3) - .coordinate(177,5) - .coordinate(-176,5) - .coordinate(-176,8) - .coordinate(174,8) - .coordinate(174,0) - ); - - // 3/4 of an embedded 'c', crossing dateline once - builder.hole(new LineStringBuilder(new CoordinatesBuilder() - .coordinate(175, 1) - .coordinate(175, 7) - .coordinate(-178, 7) - .coordinate(-178, 6) - .coordinate(176, 6) - .coordinate(176, 2) - .coordinate(179, 2) - .coordinate(179,1) - .coordinate(175, 1) - )); - - // embedded hole right of the dateline - builder.hole(new LineStringBuilder(new CoordinatesBuilder() - .coordinate(-179, 1) - .coordinate(-179, 2) - .coordinate(-177, 2) - .coordinate(-177,1) - .coordinate(-179,1) - )); - - assertMultiPolygon(builder.close().buildS4J(), true); - assertMultiPolygon(buildGeometry(builder.close()), false); - } - - public void testDateline() { - // tests that the following shape (defined in clockwise non-OGC order) - // https://gist.github.com/anonymous/7f1bb6d7e9cd72f5977c crosses the dateline - // expected results: 3 polygons, 1 with a hole - - // a giant c shape - PolygonBuilder builder = new PolygonBuilder(new CoordinatesBuilder() - .coordinate(-186,0) - .coordinate(-176,0) - .coordinate(-176,3) - .coordinate(-183,3) - .coordinate(-183,5) - .coordinate(-176,5) - .coordinate(-176,8) - .coordinate(-186,8) - .coordinate(-186,0) - ); - - // 3/4 of an embedded 'c', crossing dateline once - builder.hole(new LineStringBuilder(new CoordinatesBuilder() - .coordinate(-185,1) - .coordinate(-181,1) - .coordinate(-181,2) - .coordinate(-184,2) - .coordinate(-184,6) - .coordinate(-178,6) - .coordinate(-178,7) - .coordinate(-185,7) - .coordinate(-185,1) - )); - - // embedded hole right of the dateline - builder.hole(new LineStringBuilder(new CoordinatesBuilder() - .coordinate(-179,1) - .coordinate(-177,1) - .coordinate(-177,2) - .coordinate(-179,2) - .coordinate(-179,1) - )); - - assertMultiPolygon(builder.close().buildS4J(), true); - assertMultiPolygon(buildGeometry(builder.close()), false); - } - - public void testComplexShapeWithHole() { - PolygonBuilder builder = new PolygonBuilder(new CoordinatesBuilder() - .coordinate(-85.0018514,37.1311314) - .coordinate(-85.0016645,37.1315293) - .coordinate(-85.0016246,37.1317069) - .coordinate(-85.0016526,37.1318183) - .coordinate(-85.0017119,37.1319196) - .coordinate(-85.0019371,37.1321182) - .coordinate(-85.0019972,37.1322115) - .coordinate(-85.0019942,37.1323234) - .coordinate(-85.0019543,37.1324336) - .coordinate(-85.001906,37.1324985) - .coordinate(-85.001834,37.1325497) - .coordinate(-85.0016965,37.1325907) - .coordinate(-85.0016011,37.1325873) - .coordinate(-85.0014816,37.1325353) - .coordinate(-85.0011755,37.1323509) - .coordinate(-85.000955,37.1322802) - .coordinate(-85.0006241,37.1322529) - .coordinate(-85.0000002,37.1322307) - .coordinate(-84.9994,37.1323001) - .coordinate(-84.999109,37.1322864) - .coordinate(-84.998934,37.1322415) - .coordinate(-84.9988639,37.1321888) - .coordinate(-84.9987841,37.1320944) - .coordinate(-84.9987208,37.131954) - .coordinate(-84.998736,37.1316611) - .coordinate(-84.9988091,37.131334) - .coordinate(-84.9989283,37.1311337) - .coordinate(-84.9991943,37.1309198) - .coordinate(-84.9993573,37.1308459) - .coordinate(-84.9995888,37.1307924) - .coordinate(-84.9998746,37.130806) - .coordinate(-85.0000002,37.1308358) - .coordinate(-85.0004984,37.1310658) - .coordinate(-85.0008008,37.1311625) - .coordinate(-85.0009461,37.1311684) - .coordinate(-85.0011373,37.1311515) - .coordinate(-85.0016455,37.1310491) - .coordinate(-85.0018514,37.1311314) - ); - - builder.hole(new LineStringBuilder(new CoordinatesBuilder() - .coordinate(-85.0000002,37.1317672) - .coordinate(-85.0001983,37.1317538) - .coordinate(-85.0003378,37.1317582) - .coordinate(-85.0004697,37.131792) - .coordinate(-85.0008048,37.1319439) - .coordinate(-85.0009342,37.1319838) - .coordinate(-85.0010184,37.1319463) - .coordinate(-85.0010618,37.13184) - .coordinate(-85.0010057,37.1315102) - .coordinate(-85.000977,37.1314403) - .coordinate(-85.0009182,37.1313793) - .coordinate(-85.0005366,37.1312209) - .coordinate(-85.000224,37.1311466) - .coordinate(-85.000087,37.1311356) - .coordinate(-85.0000002,37.1311433) - .coordinate(-84.9995021,37.1312336) - .coordinate(-84.9993308,37.1312859) - .coordinate(-84.9992567,37.1313252) - .coordinate(-84.9991868,37.1314277) - .coordinate(-84.9991593,37.1315381) - .coordinate(-84.9991841,37.1316527) - .coordinate(-84.9992329,37.1317117) - .coordinate(-84.9993527,37.1317788) - .coordinate(-84.9994931,37.1318061) - .coordinate(-84.9996815,37.1317979) - .coordinate(-85.0000002,37.1317672) - ) - ); - assertPolygon(builder.close().buildS4J(), true); - assertPolygon(buildGeometry(builder.close()), false); - } - - public void testShapeWithHoleAtEdgeEndPoints() { - PolygonBuilder builder = new PolygonBuilder(new CoordinatesBuilder() - .coordinate(-4, 2) - .coordinate(4, 2) - .coordinate(6, 0) - .coordinate(4, -2) - .coordinate(-4, -2) - .coordinate(-6, 0) - .coordinate(-4, 2) - ); - - builder.hole(new LineStringBuilder(new CoordinatesBuilder() - .coordinate(4, 1) - .coordinate(4, -1) - .coordinate(-4, -1) - .coordinate(-4, 1) - .coordinate(4, 1) - )); - assertPolygon(builder.close().buildS4J(), true); - assertPolygon(buildGeometry(builder.close()), false); - } - - public void testShapeWithPointOnDateline() { - PolygonBuilder builder = new PolygonBuilder(new CoordinatesBuilder() - .coordinate(180, 0) - .coordinate(176, 4) - .coordinate(176, -4) - .coordinate(180, 0) - ); - assertPolygon(builder.close().buildS4J(), true); - assertPolygon(buildGeometry(builder.close()), false); - } - - public void testShapeWithEdgeAlongDateline() { - // test case 1: test the positive side of the dateline - PolygonBuilder builder = new PolygonBuilder(new CoordinatesBuilder() - .coordinate(180, 0) - .coordinate(176, 4) - .coordinate(180, -4) - .coordinate(180, 0) - ); - - assertPolygon(builder.close().buildS4J(), true); - assertPolygon(buildGeometry(builder.close()), false); - - // test case 2: test the negative side of the dateline - builder = new PolygonBuilder(new CoordinatesBuilder() - .coordinate(-176, 4) - .coordinate(-180, 0) - .coordinate(-180, -4) - .coordinate(-176, 4) - ); - - assertPolygon(builder.close().buildS4J(), true); - assertPolygon(buildGeometry(builder.close()), false); - } - - public void testShapeWithBoundaryHoles() { - // test case 1: test the positive side of the dateline - PolygonBuilder builder = new PolygonBuilder(new CoordinatesBuilder() - .coordinate(-177, 10) - .coordinate(176, 15) - .coordinate(172, 0) - .coordinate(176, -15) - .coordinate(-177, -10) - .coordinate(-177, 10) - ); - builder.hole(new LineStringBuilder(new CoordinatesBuilder() - .coordinate(176, 10) - .coordinate(180, 5) - .coordinate(180, -5) - .coordinate(176, -10) - .coordinate(176, 10) - )); - - assertMultiPolygon(builder.close().buildS4J(), true); - assertMultiPolygon(buildGeometry(builder.close()), false); - - // test case 2: test the negative side of the dateline - builder = new PolygonBuilder( - new CoordinatesBuilder() - .coordinate(-176, 15) - .coordinate(179, 10) - .coordinate(179, -10) - .coordinate(-176, -15) - .coordinate(-172, 0) - .close() - ); - builder.hole(new LineStringBuilder( - new CoordinatesBuilder() - .coordinate(-176, 10) - .coordinate(-176, -10) - .coordinate(-180, -5) - .coordinate(-180, 5) - .coordinate(-176, 10) - .close() - )); - - assertMultiPolygon(builder.close().buildS4J(), true); - assertMultiPolygon(buildGeometry(builder.close()), false); - } - - public void testShapeWithHoleTouchingAtDateline() throws Exception { - PolygonBuilder builder = new PolygonBuilder(new CoordinatesBuilder() - .coordinate(-180, 90) - .coordinate(-180, -90) - .coordinate(180, -90) - .coordinate(180, 90) - .coordinate(-180, 90) - ); - builder.hole(new LineStringBuilder(new CoordinatesBuilder() - .coordinate(180.0, -16.14) - .coordinate(178.53, -16.64) - .coordinate(178.49, -16.82) - .coordinate(178.73, -17.02) - .coordinate(178.86, -16.86) - .coordinate(180.0, -16.14) - )); - - assertPolygon(builder.close().buildS4J(), true); - assertPolygon(buildGeometry(builder.close()), false); - } - - public void testShapeWithTangentialHole() { - // test a shape with one tangential (shared) vertex (should pass) - PolygonBuilder builder = new PolygonBuilder(new CoordinatesBuilder() - .coordinate(179, 10) - .coordinate(168, 15) - .coordinate(164, 0) - .coordinate(166, -15) - .coordinate(179, -10) - .coordinate(179, 10) - ); - builder.hole(new LineStringBuilder(new CoordinatesBuilder() - .coordinate(-177, 10) - .coordinate(-178, -10) - .coordinate(-180, -5) - .coordinate(-180, 5) - .coordinate(-177, 10) - )); - - assertMultiPolygon(builder.close().buildS4J(), true); - assertMultiPolygon(buildGeometry(builder.close()), false); - } - - public void testShapeWithInvalidTangentialHole() { - // test a shape with one invalid tangential (shared) vertex (should throw exception) - PolygonBuilder builder = new PolygonBuilder(new CoordinatesBuilder() - .coordinate(179, 10) - .coordinate(168, 15) - .coordinate(164, 0) - .coordinate(166, -15) - .coordinate(179, -10) - .coordinate(179, 10) - ); - builder.hole(new LineStringBuilder(new CoordinatesBuilder() - .coordinate(164, 0) - .coordinate(175, 10) - .coordinate(175, 5) - .coordinate(179, -10) - .coordinate(164, 0) - )); - Exception e; - - e = expectThrows(InvalidShapeException.class, () -> builder.close().buildS4J()); - assertThat(e.getMessage(), containsString("interior cannot share more than one point with the exterior")); - e = expectThrows(IllegalArgumentException.class, () -> buildGeometry(builder.close())); - assertThat(e.getMessage(), containsString("interior cannot share more than one point with the exterior")); - } - - public void testBoundaryShapeWithTangentialHole() { - // test a shape with one tangential (shared) vertex for each hole (should pass) - PolygonBuilder builder = new PolygonBuilder(new CoordinatesBuilder() - .coordinate(-177, 10) - .coordinate(176, 15) - .coordinate(172, 0) - .coordinate(176, -15) - .coordinate(-177, -10) - .coordinate(-177, 10) - ); - builder.hole(new LineStringBuilder(new CoordinatesBuilder() - .coordinate(-177, 10) - .coordinate(-178, -10) - .coordinate(-180, -5) - .coordinate(-180, 5) - .coordinate(-177, 10) - )); - builder.hole(new LineStringBuilder(new CoordinatesBuilder() - .coordinate(172, 0) - .coordinate(176, 10) - .coordinate(176, -5) - .coordinate(172, 0) - )); - assertMultiPolygon(builder.close().buildS4J(), true); - assertMultiPolygon(buildGeometry(builder.close()), false); - } - - public void testBoundaryShapeWithInvalidTangentialHole() { - // test shape with two tangential (shared) vertices (should throw exception) - PolygonBuilder builder = new PolygonBuilder(new CoordinatesBuilder() - .coordinate(-177, 10) - .coordinate(176, 15) - .coordinate(172, 0) - .coordinate(176, -15) - .coordinate(-177, -10) - .coordinate(-177, 10) - ); - builder.hole(new LineStringBuilder(new CoordinatesBuilder() - .coordinate(-177, 10) - .coordinate(172, 0) - .coordinate(180, -5) - .coordinate(176, -10) - .coordinate(-177, 10) - )); - Exception e; - e = expectThrows(InvalidShapeException.class, () -> builder.close().buildS4J()); - assertThat(e.getMessage(), containsString("interior cannot share more than one point with the exterior")); - e = expectThrows(IllegalArgumentException.class, () -> buildGeometry(builder.close())); - assertThat(e.getMessage(), containsString("interior cannot share more than one point with the exterior")); - } - - /** - * Test an enveloping polygon around the max mercator bounds - */ - public void testBoundaryShape() { - PolygonBuilder builder = new PolygonBuilder(new CoordinatesBuilder() - .coordinate(-180, 90) - .coordinate(180, 90) - .coordinate(180, -90) - .coordinate(-180, 90) - ); - - assertPolygon(builder.close().buildS4J(), true); - assertPolygon(buildGeometry(builder.close()), false); - } - - public void testShapeWithAlternateOrientation() { - // cw: should produce a multi polygon spanning hemispheres - PolygonBuilder builder = new PolygonBuilder(new CoordinatesBuilder() - .coordinate(180, 0) - .coordinate(176, 4) - .coordinate(-176, 4) - .coordinate(180, 0) - ); - - assertPolygon(builder.close().buildS4J(), true); - assertPolygon(buildGeometry(builder.close()), false); - - // cw: geo core will convert to ccw across the dateline - builder = new PolygonBuilder(new CoordinatesBuilder() - .coordinate(180, 0) - .coordinate(-176, 4) - .coordinate(176, 4) - .coordinate(180, 0) - ); - - assertMultiPolygon(builder.close().buildS4J(), true); - assertMultiPolygon(buildGeometry(builder.close()), false); - } - - public void testShapeWithConsecutiveDuplicatePoints() { - PolygonBuilder builder = new PolygonBuilder(new CoordinatesBuilder() - .coordinate(180, 0) - .coordinate(176, 4) - .coordinate(176, 4) - .coordinate(-176, 4) - .coordinate(180, 0) - ); - - // duplicated points are removed - PolygonBuilder expected = new PolygonBuilder(new CoordinatesBuilder() - .coordinate(180, 0) - .coordinate(176, 4) - .coordinate(-176, 4) - .coordinate(180, 0) - ); - - assertEquals(buildGeometry(expected.close()), buildGeometry(builder.close())); - assertEquals(expected.close().buildS4J(), builder.close().buildS4J()); - } - - public void testShapeWithCoplanarVerticalPoints() throws Exception { - PolygonBuilder builder = new PolygonBuilder(new CoordinatesBuilder() - .coordinate(180, -36) - .coordinate(180, 90) - .coordinate(-180, 90) - .coordinate(-180, 79) - .coordinate(16, 58) - .coordinate(8, 13) - .coordinate(-180, 74) - .coordinate(-180, -85) - .coordinate(-180, -90) - .coordinate(180, -90) - .coordinate(180, -85) - .coordinate(26, 6) - .coordinate(33, 62) - .coordinate(180, -36) - ); - - //coplanar points on vertical edge are removed. - PolygonBuilder expected = new PolygonBuilder(new CoordinatesBuilder() - .coordinate(180, -36) - .coordinate(180, 90) - .coordinate(-180, 90) - .coordinate(-180, 79) - .coordinate(16, 58) - .coordinate(8, 13) - .coordinate(-180, 74) - .coordinate(-180, -90) - .coordinate(180, -90) - .coordinate(180, -85) - .coordinate(26, 6) - .coordinate(33, 62) - .coordinate(180, -36) - ); - - assertEquals(buildGeometry(expected.close()), buildGeometry(builder.close())); - assertEquals(expected.close().buildS4J(), builder.close().buildS4J()); - - } - - public void testPolygon3D() { - String expected = "{\n" + - " \"type\" : \"polygon\",\n" + - " \"orientation\" : \"right\",\n" + - " \"coordinates\" : [\n" + - " [\n" + - " [\n" + - " -45.0,\n" + - " 30.0,\n" + - " 100.0\n" + - " ],\n" + - " [\n" + - " 45.0,\n" + - " 30.0,\n" + - " 75.0\n" + - " ],\n" + - " [\n" + - " 45.0,\n" + - " -30.0,\n" + - " 77.0\n" + - " ],\n" + - " [\n" + - " -45.0,\n" + - " -30.0,\n" + - " 101.0\n" + - " ],\n" + - " [\n" + - " -45.0,\n" + - " 30.0,\n" + - " 110.0\n" + - " ]\n" + - " ]\n" + - " ]\n" + - "}"; - - PolygonBuilder pb = new PolygonBuilder(new CoordinatesBuilder() - .coordinate(new Coordinate(-45, 30, 100)) - .coordinate(new Coordinate(45, 30, 75)) - .coordinate(new Coordinate(45, -30, 77)) - .coordinate(new Coordinate(-45, -30, 101)) - .coordinate(new Coordinate(-45, 30, 110))); - - assertEquals(expected, pb.toString()); - } - - public void testInvalidSelfCrossingPolygon() { - PolygonBuilder builder = new PolygonBuilder(new CoordinatesBuilder() - .coordinate(0, 0) - .coordinate(0, 2) - .coordinate(1, 1.9) - .coordinate(0.5, 1.8) - .coordinate(1.5, 1.8) - .coordinate(1, 1.9) - .coordinate(2, 2) - .coordinate(2, 0) - .coordinate(0, 0) - ); - Exception e = expectThrows(InvalidShapeException.class, () -> builder.close().buildS4J()); - assertThat(e.getMessage(), containsString("Self-intersection at or near point [")); - assertThat(e.getMessage(), not(containsString("NaN"))); - } - - public Object buildGeometry(ShapeBuilder builder) { - return new GeoShapeIndexer(true, "name").prepareForIndexing(builder.buildGeometry()); - } -} diff --git a/server/src/test/java/org/elasticsearch/common/geo/builders/GeometryCollectionBuilderTests.java b/server/src/test/java/org/elasticsearch/common/geo/builders/GeometryCollectionBuilderTests.java deleted file mode 100644 index 5548ac8d62faf..0000000000000 --- a/server/src/test/java/org/elasticsearch/common/geo/builders/GeometryCollectionBuilderTests.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * 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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -package org.elasticsearch.common.geo.builders; - -import org.elasticsearch.test.geo.RandomShapeGenerator; - -import java.io.IOException; - -public class GeometryCollectionBuilderTests extends AbstractShapeBuilderTestCase { - - @Override - protected GeometryCollectionBuilder createTestShapeBuilder() { - GeometryCollectionBuilder geometryCollection = new GeometryCollectionBuilder(); - int shapes = randomIntBetween(0, 8); - for (int i = 0; i < shapes; i++) { - switch (randomIntBetween(0, 7)) { - case 0: - geometryCollection.shape(PointBuilderTests.createRandomShape()); - break; - case 1: - geometryCollection.shape(CircleBuilderTests.createRandomShape()); - break; - case 2: - geometryCollection.shape(EnvelopeBuilderTests.createRandomShape()); - break; - case 3: - geometryCollection.shape(LineStringBuilderTests.createRandomShape()); - break; - case 4: - geometryCollection.shape(MultiLineStringBuilderTests.createRandomShape()); - break; - case 5: - geometryCollection.shape(MultiPolygonBuilderTests.createRandomShape()); - break; - case 6: - geometryCollection.shape(MultiPointBuilderTests.createRandomShape()); - break; - case 7: - geometryCollection.shape(PolygonBuilderTests.createRandomShape()); - break; - } - } - return geometryCollection; - } - - @Override - protected GeometryCollectionBuilder createMutation(GeometryCollectionBuilder original) throws IOException { - return mutate(original); - } - - static GeometryCollectionBuilder mutate(GeometryCollectionBuilder original) throws IOException { - GeometryCollectionBuilder mutation = copyShape(original); - if (mutation.shapes.size() > 0) { - int shapePosition = randomIntBetween(0, mutation.shapes.size() - 1); - ShapeBuilder shapeToChange = mutation.shapes.get(shapePosition); - switch (shapeToChange.type()) { - case POINT: - shapeToChange = PointBuilderTests.mutate((PointBuilder) shapeToChange); - break; - case CIRCLE: - shapeToChange = CircleBuilderTests.mutate((CircleBuilder) shapeToChange); - break; - case ENVELOPE: - shapeToChange = EnvelopeBuilderTests.mutate((EnvelopeBuilder) shapeToChange); - break; - case LINESTRING: - shapeToChange = LineStringBuilderTests.mutate((LineStringBuilder) shapeToChange); - break; - case MULTILINESTRING: - shapeToChange = MultiLineStringBuilderTests.mutate((MultiLineStringBuilder) shapeToChange); - break; - case MULTIPOLYGON: - shapeToChange = MultiPolygonBuilderTests.mutate((MultiPolygonBuilder) shapeToChange); - break; - case MULTIPOINT: - shapeToChange = MultiPointBuilderTests.mutate((MultiPointBuilder) shapeToChange); - break; - case POLYGON: - shapeToChange = PolygonBuilderTests.mutate((PolygonBuilder) shapeToChange); - break; - case GEOMETRYCOLLECTION: - throw new UnsupportedOperationException("GeometryCollection should not be nested inside each other"); - } - mutation.shapes.set(shapePosition, shapeToChange); - } else { - mutation.shape(RandomShapeGenerator.createShape(random())); - } - return mutation; - } -} diff --git a/server/src/test/java/org/elasticsearch/index/search/geo/GeoUtilsTests.java b/server/src/test/java/org/elasticsearch/index/search/geo/GeoUtilsTests.java index ca78d9077ca87..df0d3fbf55aec 100644 --- a/server/src/test/java/org/elasticsearch/index/search/geo/GeoUtilsTests.java +++ b/server/src/test/java/org/elasticsearch/index/search/geo/GeoUtilsTests.java @@ -8,9 +8,6 @@ package org.elasticsearch.index.search.geo; -import org.apache.lucene.spatial.prefix.tree.Cell; -import org.apache.lucene.spatial.prefix.tree.GeohashPrefixTree; -import org.apache.lucene.spatial.prefix.tree.QuadPrefixTree; import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.geo.GeoPoint; import org.elasticsearch.common.geo.GeoUtils; @@ -19,8 +16,6 @@ import org.elasticsearch.common.xcontent.XContentParser.Token; import org.elasticsearch.geometry.utils.Geohash; import org.elasticsearch.test.ESTestCase; -import org.locationtech.spatial4j.context.SpatialContext; -import org.locationtech.spatial4j.distance.DistanceUtils; import java.io.IOException; @@ -617,56 +612,7 @@ public void testParseGeoPointInvalidType() throws IOException { } } - public void testPrefixTreeCellSizes() { - assertThat(GeoUtils.EARTH_SEMI_MAJOR_AXIS, equalTo(DistanceUtils.EARTH_EQUATORIAL_RADIUS_KM * 1000)); - assertThat(GeoUtils.quadTreeCellWidth(0), lessThanOrEqualTo(GeoUtils.EARTH_EQUATOR)); - SpatialContext spatialContext = new SpatialContext(true); - - GeohashPrefixTree geohashPrefixTree = new GeohashPrefixTree(spatialContext, GeohashPrefixTree.getMaxLevelsPossible() / 2); - Cell gNode = geohashPrefixTree.getWorldCell(); - - for (int i = 0; i < geohashPrefixTree.getMaxLevels(); i++) { - double width = GeoUtils.geoHashCellWidth(i); - double height = GeoUtils.geoHashCellHeight(i); - double size = GeoUtils.geoHashCellSize(i); - double degrees = 360.0 * width / GeoUtils.EARTH_EQUATOR; - int level = GeoUtils.quadTreeLevelsForPrecision(size); - - assertThat(GeoUtils.quadTreeCellWidth(level), lessThanOrEqualTo(width)); - assertThat(GeoUtils.quadTreeCellHeight(level), lessThanOrEqualTo(height)); - assertThat(GeoUtils.geoHashLevelsForPrecision(size), equalTo(geohashPrefixTree.getLevelForDistance(degrees))); - - assertThat("width at level " + i, - gNode.getShape().getBoundingBox().getWidth(), equalTo(360.d * width / GeoUtils.EARTH_EQUATOR)); - assertThat("height at level " + i, gNode.getShape().getBoundingBox().getHeight(), equalTo(180.d * height - / GeoUtils.EARTH_POLAR_DISTANCE)); - - gNode = gNode.getNextLevelCells(null).next(); - } - - QuadPrefixTree quadPrefixTree = new QuadPrefixTree(spatialContext); - Cell qNode = quadPrefixTree.getWorldCell(); - for (int i = 0; i < quadPrefixTree.getMaxLevels(); i++) { - - double degrees = 360.0 / (1L << i); - double width = GeoUtils.quadTreeCellWidth(i); - double height = GeoUtils.quadTreeCellHeight(i); - double size = GeoUtils.quadTreeCellSize(i); - int level = GeoUtils.quadTreeLevelsForPrecision(size); - - assertThat(GeoUtils.quadTreeCellWidth(level), lessThanOrEqualTo(width)); - assertThat(GeoUtils.quadTreeCellHeight(level), lessThanOrEqualTo(height)); - assertThat(GeoUtils.quadTreeLevelsForPrecision(size), equalTo(quadPrefixTree.getLevelForDistance(degrees))); - - assertThat("width at level " + i, - qNode.getShape().getBoundingBox().getWidth(), equalTo(360.d * width / GeoUtils.EARTH_EQUATOR)); - assertThat("height at level " + i, qNode.getShape().getBoundingBox().getHeight(), equalTo(180.d * height - / GeoUtils.EARTH_POLAR_DISTANCE)); - - qNode = qNode.getNextLevelCells(null).next(); - } - } public void testParseGeoPointGeohashPositions() throws IOException { assertNormalizedPoint(parseGeohash("drt5", diff --git a/server/src/test/java/org/elasticsearch/test/geo/RandomGeoGenerator.java b/server/src/test/java/org/elasticsearch/test/geo/RandomGeoGenerator.java index 7f91436d69a72..e43836ecb9b06 100644 --- a/server/src/test/java/org/elasticsearch/test/geo/RandomGeoGenerator.java +++ b/server/src/test/java/org/elasticsearch/test/geo/RandomGeoGenerator.java @@ -14,8 +14,7 @@ /** * Random geo generation utilities for randomized {@code geo_point} type testing - * does not depend on jts or spatial4j. Use {@link org.elasticsearch.test.geo.RandomShapeGenerator} - * to create random OGC compliant shapes. + * does not depend on jts or spatial4j. */ public class RandomGeoGenerator { diff --git a/x-pack/plugin/security/build.gradle b/x-pack/plugin/security/build.gradle index 3d78c8362c83a..6893988c109df 100644 --- a/x-pack/plugin/security/build.gradle +++ b/x-pack/plugin/security/build.gradle @@ -20,6 +20,7 @@ dependencies { testImplementation project(path: xpackModule('monitoring')) testImplementation project(path: xpackModule('spatial')) + testImplementation project(path: ':modules:legacy-geo') testImplementation project(path: ':modules:percolator') testImplementation project(path: xpackModule('sql:sql-action')) testImplementation project(path: ':modules:analysis-common') diff --git a/x-pack/plugin/spatial/build.gradle b/x-pack/plugin/spatial/build.gradle index 64457e8200520..ffbfdff0cc1bb 100644 --- a/x-pack/plugin/spatial/build.gradle +++ b/x-pack/plugin/spatial/build.gradle @@ -7,10 +7,11 @@ esplugin { name 'spatial' description 'A plugin for Basic Spatial features' classname 'org.elasticsearch.xpack.spatial.SpatialPlugin' - extendedPlugins = ['x-pack-core'] + extendedPlugins = ['x-pack-core', 'legacy-geo'] } dependencies { + compileOnly project(path: ':modules:legacy-geo') compileOnly project(path: xpackModule('core')) testImplementation(testArtifact(project(xpackModule('core')))) testImplementation project(path: xpackModule('vector-tile')) diff --git a/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/index/mapper/GeoShapeWithDocValuesFieldMapper.java b/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/index/mapper/GeoShapeWithDocValuesFieldMapper.java index 94c029a88926b..a1cd1af686d8d 100644 --- a/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/index/mapper/GeoShapeWithDocValuesFieldMapper.java +++ b/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/index/mapper/GeoShapeWithDocValuesFieldMapper.java @@ -31,7 +31,6 @@ import org.elasticsearch.index.mapper.GeoShapeIndexer; import org.elasticsearch.index.mapper.GeoShapeParser; import org.elasticsearch.index.mapper.GeoShapeQueryable; -import org.elasticsearch.index.mapper.LegacyGeoShapeFieldMapper; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.mapper.Mapper; import org.elasticsearch.index.mapper.MapperBuilderContext; @@ -39,6 +38,7 @@ import org.elasticsearch.index.mapper.MappingParserContext; import org.elasticsearch.index.query.QueryShardException; import org.elasticsearch.index.query.SearchExecutionContext; +import org.elasticsearch.legacygeo.mapper.LegacyGeoShapeFieldMapper; import org.elasticsearch.search.lookup.SearchLookup; import org.elasticsearch.xpack.spatial.index.fielddata.plain.AbstractLatLonShapeIndexFieldData; import org.elasticsearch.xpack.spatial.search.aggregations.support.GeoShapeValuesSourceType; @@ -285,7 +285,7 @@ public GeoShapeWithDocValuesFieldType fieldType() { @Override protected void checkIncomingMergeType(FieldMapper mergeWith) { - if (mergeWith instanceof LegacyGeoShapeFieldMapper) { + if (mergeWith instanceof GeoShapeWithDocValuesFieldMapper == false && CONTENT_TYPE.equals(mergeWith.typeName())) { throw new IllegalArgumentException("mapper [" + name() + "] of type [geo_shape] cannot change strategy from [BKD] to [recursive]"); } diff --git a/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/index/query/LegacyGeoShapeWithDocValuesQueryTests.java b/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/index/query/LegacyGeoShapeWithDocValuesQueryTests.java index 25e58f8856dee..8f8020c5ab1b9 100644 --- a/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/index/query/LegacyGeoShapeWithDocValuesQueryTests.java +++ b/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/index/query/LegacyGeoShapeWithDocValuesQueryTests.java @@ -18,8 +18,8 @@ import org.elasticsearch.geometry.Geometry; import org.elasticsearch.geometry.MultiPoint; import org.elasticsearch.geometry.Point; -import org.elasticsearch.index.mapper.LegacyGeoShapeFieldMapper; import org.elasticsearch.index.mapper.MapperParsingException; +import org.elasticsearch.legacygeo.mapper.LegacyGeoShapeFieldMapper; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.search.geo.GeoShapeQueryTestCase; import org.elasticsearch.test.VersionUtils; diff --git a/x-pack/plugin/sql/qa/server/build.gradle b/x-pack/plugin/sql/qa/server/build.gradle index 00e9b214d24e6..42ebf1e2f4c54 100644 --- a/x-pack/plugin/sql/qa/server/build.gradle +++ b/x-pack/plugin/sql/qa/server/build.gradle @@ -100,6 +100,7 @@ subprojects { // spatial dependency testRuntimeOnly project(path: xpackModule('spatial')) + testRuntimeOnly project(path: ':modules:legacy-geo') testRuntimeOnly "org.slf4j:slf4j-api:1.7.25" } diff --git a/x-pack/plugin/vector-tile/build.gradle b/x-pack/plugin/vector-tile/build.gradle index 3ce757288a9ce..bbd661241dc2f 100644 --- a/x-pack/plugin/vector-tile/build.gradle +++ b/x-pack/plugin/vector-tile/build.gradle @@ -31,6 +31,7 @@ dependencies { compileOnly project(path: xpackModule('core')) compileOnly project(path: xpackModule('spatial')) testImplementation(testArtifact(project(xpackModule('core')))) + compileOnly "org.locationtech.jts:jts-core:${versions.jts}" api "com.wdtinc:mapbox-vector-tile:3.1.0" api "com.google.protobuf:protobuf-java:3.14.0" runtimeOnly("org.slf4j:slf4j-api:${versions.slf4j}") From 3651dbc938967a461f2b66374f68187d402e0385 Mon Sep 17 00:00:00 2001 From: Jim Ferenczi Date: Wed, 6 Oct 2021 10:46:33 +0200 Subject: [PATCH 184/250] Propagate original indices in NodeTermsEnumRequest (#77776) This fix ensures that we provide the original list of indices as part of the node-level terms enum request. Closes #77508 --- .../action/NodeTermsEnumRequest.java | 48 ++++++++++++------- .../action/TransportTermsEnumAction.java | 29 ++++++----- .../test/terms_enum/10_basic.yml | 41 ++++++++++++++++ .../test/multi_cluster/120_terms_enum.yml | 40 ++++++++++++++++ .../test/remote_cluster/10_basic.yml | 13 +++++ 5 files changed, 139 insertions(+), 32 deletions(-) diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/termsenum/action/NodeTermsEnumRequest.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/termsenum/action/NodeTermsEnumRequest.java index 08fe633a3fedb..2b69547beaf9e 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/termsenum/action/NodeTermsEnumRequest.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/termsenum/action/NodeTermsEnumRequest.java @@ -6,7 +6,9 @@ */ package org.elasticsearch.xpack.core.termsenum.action; +import org.elasticsearch.Version; import org.elasticsearch.action.IndicesRequest; +import org.elasticsearch.action.OriginalIndices; import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -26,22 +28,26 @@ */ public class NodeTermsEnumRequest extends TransportRequest implements IndicesRequest { - private String field; - private String string; - private String searchAfter; - private long taskStartedTimeMillis; - private long nodeStartedTimeMillis; - private boolean caseInsensitive; - private int size; - private long timeout; + private final String field; + private final String string; + private final String searchAfter; + private final long taskStartedTimeMillis; + private final boolean caseInsensitive; + private final int size; + private final long timeout; private final QueryBuilder indexFilter; - private Set shardIds; - private String nodeId; + private final Set shardIds; + private final String nodeId; + private final OriginalIndices originalIndices; + + private long nodeStartedTimeMillis; - public NodeTermsEnumRequest(final String nodeId, + public NodeTermsEnumRequest(OriginalIndices originalIndices, + final String nodeId, final Set shardIds, TermsEnumRequest request, long taskStartTimeMillis) { + this.originalIndices = originalIndices; this.field = request.field(); this.string = request.string(); this.searchAfter = request.searchAfter(); @@ -70,6 +76,15 @@ public NodeTermsEnumRequest(StreamInput in) throws IOException { for (int i = 0; i < numShards; i++) { shardIds.add(new ShardId(in)); } + if (in.getVersion().onOrAfter(Version.V_8_0_0)) { + originalIndices = OriginalIndices.readOriginalIndices(in); + } else { + String[] indicesNames = shardIds.stream() + .map(ShardId::getIndexName) + .distinct() + .toArray(String[]::new); + this.originalIndices = new OriginalIndices(indicesNames, null); + } } @Override @@ -92,6 +107,9 @@ public void writeTo(StreamOutput out) throws IOException { for (ShardId shardId : shardIds) { shardId.writeTo(out); } + if (out.getVersion().onOrAfter(Version.V_8_0_0)) { + OriginalIndices.writeOriginalIndices(originalIndices, out); + } } public String field() { @@ -152,16 +170,12 @@ public QueryBuilder indexFilter() { @Override public String[] indices() { - HashSet indicesNames = new HashSet<>(); - for (ShardId shardId : shardIds) { - indicesNames.add(shardId.getIndexName()); - } - return indicesNames.toArray(new String[0]); + return originalIndices.indices(); } @Override public IndicesOptions indicesOptions() { - return null; + return originalIndices.indicesOptions(); } public boolean remove(ShardId shardId) { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/termsenum/action/TransportTermsEnumAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/termsenum/action/TransportTermsEnumAction.java index f88f01f5927c8..c0a203815bf18 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/termsenum/action/TransportTermsEnumAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/termsenum/action/TransportTermsEnumAction.java @@ -124,7 +124,7 @@ public TransportTermsEnumAction( this.scriptService = scriptService; this.licenseState = licenseState; this.settings = settings; - this.remoteClusterService = searchTransportService.getRemoteClusterService();; + this.remoteClusterService = searchTransportService.getRemoteClusterService(); transportService.registerRequestHandler( transportShardAction, @@ -140,7 +140,8 @@ protected void doExecute(Task task, TermsEnumRequest request, ActionListener shardIds, TermsEnumRequest request, long taskStartMillis) { @@ -149,14 +150,14 @@ protected NodeTermsEnumRequest newNodeRequest(final String nodeId, // final ClusterState clusterState = clusterService.state(); // final Set indicesAndAliases = indexNameExpressionResolver.resolveExpressions(clusterState, request.indices()); // final AliasFilter aliasFilter = searchService.buildAliasFilter(clusterState, shard.getIndexName(), indicesAndAliases); - return new NodeTermsEnumRequest(nodeId, shardIds, request, taskStartMillis); + return new NodeTermsEnumRequest(originalIndices, nodeId, shardIds, request, taskStartMillis); } protected NodeTermsEnumResponse readShardResponse(StreamInput in) throws IOException { return new NodeTermsEnumResponse(in); } - protected Map> getNodeBundles(ClusterState clusterState, TermsEnumRequest request, String[] concreteIndices) { + protected Map> getNodeBundles(ClusterState clusterState, String[] concreteIndices) { // Group targeted shards by nodeId Map> fastNodeBundles = new HashMap<>(); for (String indexName : concreteIndices) { @@ -166,9 +167,7 @@ protected Map> getNodeBundles(ClusterState clusterState, Te GroupShardsIterator shards = clusterService.operationRouting() .searchShards(clusterState, singleIndex, null, null); - Iterator shardsForIndex = shards.iterator(); - while (shardsForIndex.hasNext()) { - ShardIterator copiesOfShard = shardsForIndex.next(); + for (ShardIterator copiesOfShard : shards) { ShardRouting selectedCopyOfShard = null; for (ShardRouting copy : copiesOfShard) { // Pick the first active node with a copy of the shard @@ -181,7 +180,7 @@ protected Map> getNodeBundles(ClusterState clusterState, Te break; } String nodeId = selectedCopyOfShard.currentNodeId(); - Set bundle = null; + final Set bundle; if (fastNodeBundles.containsKey(nodeId)) { bundle = fastNodeBundles.get(nodeId); } else { @@ -392,7 +391,7 @@ protected NodeTermsEnumResponse dataNodeOperation(NodeTermsEnumRequest request, if (termsList.size() >= shard_size) { break; } - }; + } } catch (Exception e) { error = ExceptionsHelper.stackTrace(e); @@ -418,7 +417,7 @@ private boolean canAccess( if (indexAccessControl != null) { final boolean dls = indexAccessControl.getDocumentPermissions().hasDocumentLevelPermissions(); - if ( dls && licenseChecker.get()) { + if (dls && licenseChecker.get()) { // Check to see if any of the roles defined for the current user rewrite to match_all SecurityContext securityContext = new SecurityContext(clusterService.getSettings(), threadContext); @@ -469,12 +468,12 @@ protected class AsyncBroadcastAction { private final Task task; private final TermsEnumRequest request; private ActionListener listener; - private final ClusterState clusterState; private final DiscoveryNodes nodes; private final int expectedOps; private final AtomicInteger counterOps = new AtomicInteger(); private final AtomicReferenceArray atomicResponses; private final Map> nodeBundles; + private final OriginalIndices localIndices; private final Map remoteClusterIndices; protected AsyncBroadcastAction(Task task, TermsEnumRequest request, ActionListener listener) { @@ -482,7 +481,7 @@ protected AsyncBroadcastAction(Task task, TermsEnumRequest request, ActionListen this.request = request; this.listener = listener; - clusterState = clusterService.state(); + ClusterState clusterState = clusterService.state(); ClusterBlockException blockException = checkGlobalBlock(clusterState, request); if (blockException != null) { @@ -490,7 +489,7 @@ protected AsyncBroadcastAction(Task task, TermsEnumRequest request, ActionListen } this.remoteClusterIndices = remoteClusterService.groupIndices(request.indicesOptions(), request.indices()); - OriginalIndices localIndices = remoteClusterIndices.remove(RemoteClusterAware.LOCAL_CLUSTER_GROUP_KEY); + this.localIndices = remoteClusterIndices.remove(RemoteClusterAware.LOCAL_CLUSTER_GROUP_KEY); // update to concrete indices String[] concreteIndices = localIndices == null ? new String[0] : @@ -502,7 +501,7 @@ protected AsyncBroadcastAction(Task task, TermsEnumRequest request, ActionListen nodes = clusterState.nodes(); logger.trace("resolving shards based on cluster state version [{}]", clusterState.version()); - nodeBundles = getNodeBundles(clusterState, request, concreteIndices); + nodeBundles = getNodeBundles(clusterState, concreteIndices); expectedOps = nodeBundles.size() + remoteClusterIndices.size(); atomicResponses = new AtomicReferenceArray<>(expectedOps); @@ -557,7 +556,7 @@ protected void performOperation(final String nodeId, final Set shardIds onNodeFailure(nodeId, opsIndex, null); } else { try { - final NodeTermsEnumRequest nodeRequest = newNodeRequest(nodeId, shardIds, request, task.getStartTime()); + final NodeTermsEnumRequest nodeRequest = newNodeRequest(localIndices, nodeId, shardIds, request, task.getStartTime()); nodeRequest.setParentTask(clusterService.localNode().getId(), task.getId()); DiscoveryNode node = nodes.get(nodeId); if (node == null) { diff --git a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/terms_enum/10_basic.yml b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/terms_enum/10_basic.yml index 7fdfd4ec55511..4390fdf252cf3 100644 --- a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/terms_enum/10_basic.yml +++ b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/terms_enum/10_basic.yml @@ -38,6 +38,16 @@ setup: ] } + - do: + security.put_role: + name: "dls_alias_role" + body: > + { + "indices": [ + { "names": ["alias_security"], "privileges": ["read"], "query": "{\"term\": {\"ck\": \"const\"}}" } + ] + } + - do: security.put_role: name: "dls_none_role" @@ -57,6 +67,16 @@ setup: "full_name" : "user with access to all docs in test_security index (using DLS)" } + - do: + security.put_user: + username: "dls_alias_user" + body: > + { + "password" : "x-pack-test-password", + "roles" : [ "dls_alias_role" ], + "full_name" : "user with access to all docs in test_security index (using DLS)" + } + - do: security.put_role: name: "dls_some_role" @@ -143,6 +163,8 @@ setup: indices.create: index: test_security body: + aliases: + alias_security: {} settings: index: number_of_shards: 1 @@ -198,6 +220,16 @@ teardown: security.delete_role: name: "dls_all_role" ignore: 404 + + - do: + security.delete_user: + username: "dls_alias_user" + ignore: 404 + + - do: + security.delete_role: + name: "dls_alias_role" + ignore: 404 - do: security.delete_role: name: "dls_none_role" @@ -289,6 +321,7 @@ teardown: index: test_k body: {"field": "foo"} - length: {terms: 1} + --- "Test search after keyword field": - do: @@ -389,6 +422,7 @@ teardown: terms_enum: index: test_* body: {"field": "foo", "string":"b", "timeout": "2m"} + --- "Test security": @@ -406,6 +440,13 @@ teardown: body: {"field": "foo", "string":"b"} - length: {terms: 1} + - do: + headers: { Authorization: "Basic ZGxzX2FsaWFzX3VzZXI6eC1wYWNrLXRlc3QtcGFzc3dvcmQ=" } # dls_alias_user sees all docs through the alias + terms_enum: + index: alias_security + body: { "field": "foo", "string": "b" } + - length: { terms: 1 } + - do: headers: { Authorization: "Basic ZGxzX3NvbWVfdXNlcjp4LXBhY2stdGVzdC1wYXNzd29yZA==" } # dls_some_user sees selected docs terms_enum: diff --git a/x-pack/qa/multi-cluster-search-security/src/test/resources/rest-api-spec/test/multi_cluster/120_terms_enum.yml b/x-pack/qa/multi-cluster-search-security/src/test/resources/rest-api-spec/test/multi_cluster/120_terms_enum.yml index c8b3be89b7d24..107cb488e8034 100644 --- a/x-pack/qa/multi-cluster-search-security/src/test/resources/rest-api-spec/test/multi_cluster/120_terms_enum.yml +++ b/x-pack/qa/multi-cluster-search-security/src/test/resources/rest-api-spec/test/multi_cluster/120_terms_enum.yml @@ -21,6 +21,20 @@ setup: ] } + - do: + security.put_role: + name: "terms_enum_alias_role" + body: > + { + "cluster": ["all"], + "indices": [ + { + "names": ["my_remote_cluster:terms_enum_alias"], + "privileges": ["read"] + } + ] + } + - do: security.put_user: username: "joe_all" @@ -30,6 +44,15 @@ setup: "roles" : [ "terms_enum_all_role" ] } + - do: + security.put_user: + username: "joe_alias" + body: > + { + "password": "s3krit-password", + "roles" : [ "terms_enum_alias_role" ] + } + - do: security.put_role: name: "terms_enum_none_role" @@ -82,6 +105,10 @@ teardown: security.delete_user: username: "joe_all" ignore: 404 + - do: + security.delete_user: + username: "joe_alias" + ignore: 404 - do: security.delete_user: username: "joe_none" @@ -94,6 +121,10 @@ teardown: security.delete_role: name: "terms_enum_all_role" ignore: 404 + - do: + security.delete_role: + name: "terms_enum_alias_role" + ignore: 404 - do: security.delete_role: name: "terms_enum_none_role" @@ -123,6 +154,15 @@ teardown: - match: { terms.0: "zar" } - match: { complete: true } + - do: + headers: { Authorization: "Basic am9lX2FsaWFzOnMza3JpdC1wYXNzd29yZA==" } # joe_alias can see all docs through alias + terms_enum: + index: my_remote_cluster:terms_enum_alias + body: { "field": "foo", "search_after": "foobar" } + - length: { terms: 1 } + - match: { terms.0: "zar" } + - match: { complete: true } + - do: headers: { Authorization: "Basic am9lX25vbmU6czNrcml0LXBhc3N3b3Jk" } # joe_none can't see docs terms_enum: diff --git a/x-pack/qa/multi-cluster-search-security/src/test/resources/rest-api-spec/test/remote_cluster/10_basic.yml b/x-pack/qa/multi-cluster-search-security/src/test/resources/rest-api-spec/test/remote_cluster/10_basic.yml index b8feed5c68d7f..4f6fb2c388f03 100644 --- a/x-pack/qa/multi-cluster-search-security/src/test/resources/rest-api-spec/test/remote_cluster/10_basic.yml +++ b/x-pack/qa/multi-cluster-search-security/src/test/resources/rest-api-spec/test/remote_cluster/10_basic.yml @@ -79,6 +79,17 @@ setup: ] } + - do: + security.put_role: + name: "terms_enum_alias_role" + body: > + { + "cluster": ["monitor"], + "indices": [ + { "names": ["terms_enum_alias"], "privileges": ["read"], "query": "{\"term\": {\"ck\": \"const\"}}" } + ] + } + - do: security.put_role: name: "terms_enum_none_role" @@ -373,6 +384,8 @@ setup: indices.create: index: terms_enum_index body: + aliases: + terms_enum_alias: {} settings: index: number_of_shards: 1 From 7b36bead74e27aaeff1832f39e110918df2f907f Mon Sep 17 00:00:00 2001 From: Henning Andersen <33268011+henningandersen@users.noreply.github.com> Date: Wed, 6 Oct 2021 10:49:39 +0200 Subject: [PATCH 185/250] Fix CrossClusterSearchLeakIT scroll size 0 (#78685) The test would provoke a scroll of size 0, fixed to always use minimum 1 as size for scrolls. Closes #78673 --- .../org/elasticsearch/search/ccs/CrossClusterSearchLeakIT.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/ccs/CrossClusterSearchLeakIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/ccs/CrossClusterSearchLeakIT.java index 2774f8f6d4459..cdee5449885b7 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/ccs/CrossClusterSearchLeakIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/ccs/CrossClusterSearchLeakIT.java @@ -66,7 +66,6 @@ private int indexDocs(Client client, String field, String index) { *
  • scroll vs no scroll
  • * */ - @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/78673") public void testSearch() throws Exception { assertAcked(client(LOCAL_CLUSTER).admin().indices().prepareCreate("demo") .setMapping("f", "type=keyword") @@ -105,7 +104,7 @@ public void testSearch() throws Exception { searchRequest.allowPartialSearchResults(false); boolean scroll = randomBoolean(); searchRequest.source(new SearchSourceBuilder().query(new MatchAllQueryBuilder()) - .aggregation(terms("f").field("f").size(docs + between(scroll ? 1 : 0, 10))).size(between(0, 1000))); + .aggregation(terms("f").field("f").size(docs + between(0, 10))).size(between(scroll ? 1 : 0, 1000))); if (scroll) { searchRequest.scroll("30s"); } From bde03900ebea403a0964e4098ffad3bc2631d96c Mon Sep 17 00:00:00 2001 From: Andrei Stefan Date: Wed, 6 Oct 2021 14:42:30 +0300 Subject: [PATCH 186/250] Mute HttpExporterResourceTests.testTemplateCheckBlocksAfterSuccessfulVersion (#78749) --- .../monitoring/exporter/http/HttpExporterResourceTests.java | 1 + 1 file changed, 1 insertion(+) diff --git a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/http/HttpExporterResourceTests.java b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/http/HttpExporterResourceTests.java index 97a35d42f1367..d2d3953653b2b 100644 --- a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/http/HttpExporterResourceTests.java +++ b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/http/HttpExporterResourceTests.java @@ -119,6 +119,7 @@ public void testInvalidVersionBlocks() { verifyNoMoreInteractions(client); } + @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/78736") public void testTemplateCheckBlocksAfterSuccessfulVersion() { final Exception exception = failureGetException(); final boolean firstSucceeds = randomBoolean(); From 316488573c9f366bf26d8e6231fc7a38281d7c25 Mon Sep 17 00:00:00 2001 From: Armin Braun Date: Wed, 6 Oct 2021 14:15:55 +0200 Subject: [PATCH 187/250] Speed up toXContent Collection Serialization in some Spots (#78742) Found this when benchmarking large cluster states. When serializing collections we'd mostly not take any advantage of what we know about the collection contents (like we do in `StreamOutput`). This PR adds a couple of helpers to the x-content-builder similar to what we have on `StreamOutput` to allow for faster serializing by avoiding the writer lookup and some self-reference checks. --- .../client/GeoIpStatsResponse.java | 2 +- .../ccr/PutAutoFollowPatternRequest.java | 4 +- .../client/enrich/PutPolicyRequest.java | 4 +- .../indices/PutIndexTemplateRequest.java | 2 +- .../client/ml/EvaluateDataFrameRequest.java | 2 +- .../client/ml/GetDatafeedRequest.java | 2 +- .../client/ml/GetJobRequest.java | 2 +- .../client/ml/UpdateFilterRequest.java | 4 +- .../client/ml/calendars/Calendar.java | 2 +- .../common/xcontent/XContentBuilder.java | 85 +++++++++++++++++++ .../indices/resolve/ResolveIndexAction.java | 6 +- .../post/SimulateIndexTemplateResponse.java | 2 +- .../action/fieldcaps/FieldCapabilities.java | 8 +- .../fieldcaps/FieldCapabilitiesFailure.java | 2 +- .../fieldcaps/FieldCapabilitiesResponse.java | 4 +- .../action/get/MultiGetRequest.java | 2 +- .../coordination/CoordinationMetadata.java | 2 +- .../metadata/ComposableIndexTemplate.java | 4 +- .../cluster/metadata/DataStream.java | 2 +- .../cluster/metadata/DataStreamAlias.java | 2 +- .../cluster/metadata/DataStreamMetadata.java | 6 +- .../cluster/metadata/IndexMetadata.java | 3 +- .../metadata/IndexTemplateMetadata.java | 2 +- .../cluster/metadata/ItemUsage.java | 6 +- .../cluster/metadata/Manifest.java | 2 +- .../cluster/routing/UnassignedInfo.java | 2 +- .../common/settings/Setting.java | 2 +- .../repositories/RepositoryData.java | 6 +- .../BucketSortPipelineAggregationBuilder.java | 2 +- .../search/builder/SearchSourceBuilder.java | 2 +- .../transport/TransportInfo.java | 2 +- .../core/action/DataStreamsStatsAction.java | 2 +- .../core/action/GetDataStreamAction.java | 2 +- .../core/action/ReloadAnalyzersResponse.java | 4 +- .../xpack/core/ilm/AllocateAction.java | 6 +- .../ilm/IndexLifecycleFeatureSetUsage.java | 2 +- .../core/ilm/IndexLifecycleMetadata.java | 2 +- .../core/ilm/LifecyclePolicyMetadata.java | 2 +- .../elasticsearch/xpack/core/ilm/Phase.java | 2 +- .../core/ilm/WaitForFollowShardTasksStep.java | 2 +- .../RemoveIndexLifecyclePolicyAction.java | 2 +- .../core/rollup/action/RollableIndexCaps.java | 2 +- .../core/rollup/action/RollupJobCaps.java | 2 +- .../xpack/core/rollup/job/MetricConfig.java | 2 +- .../core/security/authz/RoleDescriptor.java | 4 +- .../xpack/ilm/history/ILMHistoryItem.java | 2 +- .../xpack/rollup/action/RollupIndexCaps.java | 2 +- .../rollup/v2/TransportRollupAction.java | 2 +- .../audit/logfile/LoggingAuditTrail.java | 2 +- .../actions/email/EmailActionTests.java | 3 +- 50 files changed, 151 insertions(+), 74 deletions(-) diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/GeoIpStatsResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/GeoIpStatsResponse.java index 625c3aee775cf..3721e002836c9 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/GeoIpStatsResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/GeoIpStatsResponse.java @@ -156,7 +156,7 @@ public Map getDatabases() { @Override public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { builder.startObject(); - builder.field("files_in_temp", filesInTemp); + builder.stringListField("files_in_temp", filesInTemp); builder.field("databases", databases.entrySet().stream() .sorted(Map.Entry.comparingByKey()) .map(Map.Entry::getValue) diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ccr/PutAutoFollowPatternRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ccr/PutAutoFollowPatternRequest.java index b11b20db6963b..4c95a804904bb 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ccr/PutAutoFollowPatternRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ccr/PutAutoFollowPatternRequest.java @@ -74,9 +74,9 @@ public void setFollowIndexNamePattern(String followIndexNamePattern) { public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { builder.startObject(); builder.field(PutFollowRequest.REMOTE_CLUSTER_FIELD.getPreferredName(), remoteCluster); - builder.field(LEADER_PATTERNS_FIELD.getPreferredName(), leaderIndexPatterns); + builder.stringListField(LEADER_PATTERNS_FIELD.getPreferredName(), leaderIndexPatterns); if (leaderIndexExclusionPatterns.isEmpty() == false) { - builder.field(LEADER_EXCLUSION_PATTERNS_FIELD.getPreferredName(), leaderIndexExclusionPatterns); + builder.stringListField(LEADER_EXCLUSION_PATTERNS_FIELD.getPreferredName(), leaderIndexExclusionPatterns); } if (followIndexNamePattern != null) { builder.field(FOLLOW_PATTERN_FIELD.getPreferredName(), followIndexNamePattern); diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/enrich/PutPolicyRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/enrich/PutPolicyRequest.java index 19e816b5bed75..d98d126ada428 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/enrich/PutPolicyRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/enrich/PutPolicyRequest.java @@ -96,12 +96,12 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws { builder.startObject(type); { - builder.field(NamedPolicy.INDICES_FIELD.getPreferredName(), indices); + builder.stringListField(NamedPolicy.INDICES_FIELD.getPreferredName(), indices); if (query != null) { builder.field(NamedPolicy.QUERY_FIELD.getPreferredName(), asMap(query, XContentType.JSON)); } builder.field(NamedPolicy.MATCH_FIELD_FIELD.getPreferredName(), matchField); - builder.field(NamedPolicy.ENRICH_FIELDS_FIELD.getPreferredName(), enrichFields); + builder.stringListField(NamedPolicy.ENRICH_FIELDS_FIELD.getPreferredName(), enrichFields); } builder.endObject(); } diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/PutIndexTemplateRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/PutIndexTemplateRequest.java index 1fabdb6229f1a..b2eea60b4471d 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/PutIndexTemplateRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/PutIndexTemplateRequest.java @@ -401,7 +401,7 @@ public final PutIndexTemplateRequest masterNodeTimeout(String timeout) { @Override public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { - builder.field("index_patterns", indexPatterns); + builder.stringListField("index_patterns", indexPatterns); builder.field("order", order); if (version != null) { builder.field("version", version); diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/EvaluateDataFrameRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/EvaluateDataFrameRequest.java index e1be003e87979..003bd58b0231b 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/EvaluateDataFrameRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/EvaluateDataFrameRequest.java @@ -118,7 +118,7 @@ public Optional validate() { @Override public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { builder.startObject(); - builder.array(INDEX.getPreferredName(), indices.toArray()); + builder.stringListField(INDEX.getPreferredName(), indices); if (queryConfig != null) { builder.field(QUERY.getPreferredName(), queryConfig.getQuery()); } diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetDatafeedRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetDatafeedRequest.java index 1028ab00b3abd..8b8de4a1eb903 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetDatafeedRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetDatafeedRequest.java @@ -133,7 +133,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws builder.startObject(); if (datafeedIds.isEmpty() == false) { - builder.field(DATAFEED_IDS.getPreferredName(), datafeedIds); + builder.stringListField(DATAFEED_IDS.getPreferredName(), datafeedIds); } if (allowNoMatch != null) { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetJobRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetJobRequest.java index 87a2d6cdd8da1..5ff9a9c608e4d 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetJobRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetJobRequest.java @@ -133,7 +133,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws builder.startObject(); if (jobIds.isEmpty() == false) { - builder.field(JOB_IDS.getPreferredName(), jobIds); + builder.stringListField(JOB_IDS.getPreferredName(), jobIds); } if (allowNoMatch != null) { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/UpdateFilterRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/UpdateFilterRequest.java index ed07b27f4fb90..0aadf67cff615 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/UpdateFilterRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/UpdateFilterRequest.java @@ -102,10 +102,10 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws builder.field(MlFilter.DESCRIPTION.getPreferredName(), description); } if (addItems != null) { - builder.field(ADD_ITEMS.getPreferredName(), addItems); + builder.stringListField(ADD_ITEMS.getPreferredName(), addItems); } if (removeItems != null) { - builder.field(REMOVE_ITEMS.getPreferredName(), removeItems); + builder.stringListField(REMOVE_ITEMS.getPreferredName(), removeItems); } builder.endObject(); return builder; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/calendars/Calendar.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/calendars/Calendar.java index 487fc825e610c..8d79d4686e3d4 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/calendars/Calendar.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/calendars/Calendar.java @@ -75,7 +75,7 @@ public String getDescription() { public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { builder.startObject(); builder.field(ID.getPreferredName(), id); - builder.field(JOB_IDS.getPreferredName(), jobIds); + builder.stringListField(JOB_IDS.getPreferredName(), jobIds); if (description != null) { builder.field(DESCRIPTION.getPreferredName(), description); } diff --git a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/XContentBuilder.java b/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/XContentBuilder.java index 4c464a1de2cd3..a9c62a646d3be 100644 --- a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/XContentBuilder.java +++ b/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/XContentBuilder.java @@ -25,8 +25,10 @@ import java.util.Arrays; import java.util.Base64; import java.util.Calendar; +import java.util.Collection; import java.util.Collections; import java.util.Date; +import java.util.EnumSet; import java.util.GregorianCalendar; import java.util.HashMap; import java.util.IdentityHashMap; @@ -921,6 +923,58 @@ private XContentBuilder value(ToXContent value, ToXContent.Params params) throws // Maps & Iterable ////////////////////////////////// + public XContentBuilder stringListField(String name, Collection values) throws IOException { + field(name); + if (values == null) { + return nullValue(); + } + startArray(); + for (String value : values) { + value(value); + } + endArray(); + return this; + } + + public XContentBuilder xContentList(String name, Collection values) throws IOException { + field(name); + if (values == null) { + return nullValue(); + } + startArray(); + for (ToXContent value : values) { + value(value); + } + endArray(); + return this; + } + + public XContentBuilder xContentList(String name, ToXContent... values) throws IOException { + field(name); + if (values == null) { + return nullValue(); + } + startArray(); + for (ToXContent value : values) { + value(value); + } + endArray(); + return this; + } + + public XContentBuilder enumSet(String name, EnumSet values) throws IOException { + field(name); + if (values == null) { + return nullValue(); + } + startArray(); + for (Enum value : values) { + value(value); + } + endArray(); + return this; + } + public XContentBuilder field(String name, Map values) throws IOException { return field(name).map(values); } @@ -929,6 +983,32 @@ public XContentBuilder map(Map values) throws IOException { return map(values, true, true); } + public XContentBuilder stringStringMap(String name, Map values) throws IOException { + field(name); + if (values == null) { + return nullValue(); + } + startObject(); + for (Map.Entry value : values.entrySet()) { + field(value.getKey()); + value(value.getValue()); + } + return endObject(); + } + + public XContentBuilder xContentValuesMap(String name, Map values) throws IOException { + field(name); + if (values == null) { + return nullValue(); + } + startObject(); + for (Map.Entry value : values.entrySet()) { + field(value.getKey()); + value(value.getValue()); + } + return endObject(); + } + /** writes a map without the start object and end object headers */ public XContentBuilder mapContents(Map values) throws IOException { return map(values, true, false); @@ -1026,6 +1106,11 @@ public XContentBuilder percentageField(String rawFieldName, String readableField return this; } + public XContentBuilder field(String name, Enum value) throws IOException { + field(name); + return value(value == null ? null : value.toString()); + } + //////////////////////////////////////////////////////////////////////////// // Raw fields ////////////////////////////////// diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/resolve/ResolveIndexAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/resolve/ResolveIndexAction.java index 5143e6c9dab42..9a111642f01d4 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/resolve/ResolveIndexAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/resolve/ResolveIndexAction.java @@ -405,9 +405,9 @@ public void writeTo(StreamOutput out) throws IOException { @Override public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { builder.startObject(); - builder.field(INDICES_FIELD.getPreferredName(), indices); - builder.field(ALIASES_FIELD.getPreferredName(), aliases); - builder.field(DATA_STREAMS_FIELD.getPreferredName(), dataStreams); + builder.xContentList(INDICES_FIELD.getPreferredName(), indices); + builder.xContentList(ALIASES_FIELD.getPreferredName(), aliases); + builder.xContentList(DATA_STREAMS_FIELD.getPreferredName(), dataStreams); builder.endObject(); return builder; } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/template/post/SimulateIndexTemplateResponse.java b/server/src/main/java/org/elasticsearch/action/admin/indices/template/post/SimulateIndexTemplateResponse.java index 1e2484a88bbc6..6f8a561199184 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/template/post/SimulateIndexTemplateResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/template/post/SimulateIndexTemplateResponse.java @@ -87,7 +87,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws for (Map.Entry> entry : overlappingTemplates.entrySet()) { builder.startObject(); builder.field(NAME.getPreferredName(), entry.getKey()); - builder.field(INDEX_PATTERNS.getPreferredName(), entry.getValue()); + builder.stringListField(INDEX_PATTERNS.getPreferredName(), entry.getValue()); builder.endObject(); } builder.endArray(); diff --git a/server/src/main/java/org/elasticsearch/action/fieldcaps/FieldCapabilities.java b/server/src/main/java/org/elasticsearch/action/fieldcaps/FieldCapabilities.java index 048a0e4898154..14e9e70428651 100644 --- a/server/src/main/java/org/elasticsearch/action/fieldcaps/FieldCapabilities.java +++ b/server/src/main/java/org/elasticsearch/action/fieldcaps/FieldCapabilities.java @@ -125,13 +125,13 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws builder.field(SEARCHABLE_FIELD.getPreferredName(), isSearchable); builder.field(AGGREGATABLE_FIELD.getPreferredName(), isAggregatable); if (indices != null) { - builder.field(INDICES_FIELD.getPreferredName(), indices); + builder.array(INDICES_FIELD.getPreferredName(), indices); } if (nonSearchableIndices != null) { - builder.field(NON_SEARCHABLE_INDICES_FIELD.getPreferredName(), nonSearchableIndices); + builder.array(NON_SEARCHABLE_INDICES_FIELD.getPreferredName(), nonSearchableIndices); } if (nonAggregatableIndices != null) { - builder.field(NON_AGGREGATABLE_INDICES_FIELD.getPreferredName(), nonAggregatableIndices); + builder.array(NON_AGGREGATABLE_INDICES_FIELD.getPreferredName(), nonAggregatableIndices); } if (meta.isEmpty() == false) { builder.startObject("meta"); @@ -140,7 +140,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws for (Map.Entry> entry : entries) { List values = new ArrayList<>(entry.getValue()); values.sort(String::compareTo); // provide predictable order - builder.field(entry.getKey(), values); + builder.stringListField(entry.getKey(), values); } builder.endObject(); } diff --git a/server/src/main/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesFailure.java b/server/src/main/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesFailure.java index d91a963775c77..c436a6ef59413 100644 --- a/server/src/main/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesFailure.java +++ b/server/src/main/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesFailure.java @@ -46,7 +46,7 @@ public FieldCapabilitiesFailure(StreamInput in) throws IOException { public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { builder.startObject(); { - builder.field(INDICES_FIELD.getPreferredName(), indices); + builder.stringListField(INDICES_FIELD.getPreferredName(), indices); builder.startObject(FAILURE_FIELD.getPreferredName()); { ElasticsearchException.generateFailureXContent(builder, params, exception, true); diff --git a/server/src/main/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesResponse.java b/server/src/main/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesResponse.java index 4cb626607224c..8442e707b74d6 100644 --- a/server/src/main/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesResponse.java +++ b/server/src/main/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesResponse.java @@ -151,11 +151,11 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws throw new IllegalStateException("cannot serialize non-merged response"); } builder.startObject(); - builder.field(INDICES_FIELD.getPreferredName(), indices); + builder.array(INDICES_FIELD.getPreferredName(), indices); builder.field(FIELDS_FIELD.getPreferredName(), responseMap); if (this.failures.size() > 0) { builder.field(FAILED_INDICES_FIELD.getPreferredName(), getFailedIndices().length); - builder.field(FAILURES_FIELD.getPreferredName(), failures); + builder.xContentList(FAILURES_FIELD.getPreferredName(), failures); } builder.endObject(); return builder; diff --git a/server/src/main/java/org/elasticsearch/action/get/MultiGetRequest.java b/server/src/main/java/org/elasticsearch/action/get/MultiGetRequest.java index f0736230ee133..52bbab56dd96c 100644 --- a/server/src/main/java/org/elasticsearch/action/get/MultiGetRequest.java +++ b/server/src/main/java/org/elasticsearch/action/get/MultiGetRequest.java @@ -192,7 +192,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws builder.field(INDEX.getPreferredName(), index); builder.field(ID.getPreferredName(), id); builder.field(ROUTING.getPreferredName(), routing); - builder.field(STORED_FIELDS.getPreferredName(), storedFields); + builder.array(STORED_FIELDS.getPreferredName(), storedFields); builder.field(VERSION.getPreferredName(), version); builder.field(VERSION_TYPE.getPreferredName(), VersionType.toString(versionType)); builder.field(SOURCE.getPreferredName(), fetchSourceContext); diff --git a/server/src/main/java/org/elasticsearch/cluster/coordination/CoordinationMetadata.java b/server/src/main/java/org/elasticsearch/cluster/coordination/CoordinationMetadata.java index b7cb9371414f8..5065342558282 100644 --- a/server/src/main/java/org/elasticsearch/cluster/coordination/CoordinationMetadata.java +++ b/server/src/main/java/org/elasticsearch/cluster/coordination/CoordinationMetadata.java @@ -115,7 +115,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws .field(TERM_PARSE_FIELD.getPreferredName(), term) .field(LAST_COMMITTED_CONFIGURATION_FIELD.getPreferredName(), lastCommittedConfiguration) .field(LAST_ACCEPTED_CONFIGURATION_FIELD.getPreferredName(), lastAcceptedConfiguration) - .field(VOTING_CONFIG_EXCLUSIONS_FIELD.getPreferredName(), votingConfigExclusions); + .xContentList(VOTING_CONFIG_EXCLUSIONS_FIELD.getPreferredName(), votingConfigExclusions); } public static CoordinationMetadata fromXContent(XContentParser parser) throws IOException { diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/ComposableIndexTemplate.java b/server/src/main/java/org/elasticsearch/cluster/metadata/ComposableIndexTemplate.java index 0f76a98bfd17f..99dc022ab6992 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/ComposableIndexTemplate.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/ComposableIndexTemplate.java @@ -199,12 +199,12 @@ public void writeTo(StreamOutput out) throws IOException { @Override public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { builder.startObject(); - builder.field(INDEX_PATTERNS.getPreferredName(), this.indexPatterns); + builder.stringListField(INDEX_PATTERNS.getPreferredName(), this.indexPatterns); if (this.template != null) { builder.field(TEMPLATE.getPreferredName(), this.template); } if (this.componentTemplates != null) { - builder.field(COMPOSED_OF.getPreferredName(), this.componentTemplates); + builder.stringListField(COMPOSED_OF.getPreferredName(), this.componentTemplates); } if (this.priority != null) { builder.field(PRIORITY.getPreferredName(), priority); diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/DataStream.java b/server/src/main/java/org/elasticsearch/cluster/metadata/DataStream.java index d6e074f481635..2c826074b43a3 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/DataStream.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/DataStream.java @@ -401,7 +401,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws builder.startObject(); builder.field(NAME_FIELD.getPreferredName(), name); builder.field(TIMESTAMP_FIELD_FIELD.getPreferredName(), timeStampField); - builder.field(INDICES_FIELD.getPreferredName(), indices); + builder.xContentList(INDICES_FIELD.getPreferredName(), indices); builder.field(GENERATION_FIELD.getPreferredName(), generation); if (metadata != null) { builder.field(METADATA_FIELD.getPreferredName(), metadata); diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/DataStreamAlias.java b/server/src/main/java/org/elasticsearch/cluster/metadata/DataStreamAlias.java index 5cc4555cb18ed..1276ccddda69f 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/DataStreamAlias.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/DataStreamAlias.java @@ -275,7 +275,7 @@ public static DataStreamAlias fromXContent(XContentParser parser) throws IOExcep @Override public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { builder.startObject(name); - builder.field(DATA_STREAMS_FIELD.getPreferredName(), dataStreams); + builder.stringListField(DATA_STREAMS_FIELD.getPreferredName(), dataStreams); if (writeDataStream != null) { builder.field(WRITE_DATA_STREAM_FIELD.getPreferredName(), writeDataStream); } diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/DataStreamMetadata.java b/server/src/main/java/org/elasticsearch/cluster/metadata/DataStreamMetadata.java index 611e7a78e7064..d3df1a692f16e 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/DataStreamMetadata.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/DataStreamMetadata.java @@ -121,11 +121,7 @@ public static DataStreamMetadata fromXContent(XContentParser parser) throws IOEx @Override public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { - builder.startObject(DATA_STREAM.getPreferredName()); - for (Map.Entry dataStream : dataStreams.entrySet()) { - builder.field(dataStream.getKey(), dataStream.getValue()); - } - builder.endObject(); + builder.xContentValuesMap(DATA_STREAM.getPreferredName(), dataStreams); builder.startObject(DATA_STREAM_ALIASES.getPreferredName()); for (Map.Entry dataStream : dataStreamAliases.entrySet()) { dataStream.getValue().toXContent(builder, params); diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/IndexMetadata.java b/server/src/main/java/org/elasticsearch/cluster/metadata/IndexMetadata.java index 98f8dea776ace..022771ccd9ca1 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/IndexMetadata.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/IndexMetadata.java @@ -1396,8 +1396,7 @@ public static void toXContent(IndexMetadata indexMetadata, XContentBuilder build } for (ObjectObjectCursor cursor : indexMetadata.customData) { - builder.field(cursor.key); - builder.map(cursor.value); + builder.stringStringMap(cursor.key, cursor.value); } if (context != Metadata.XContentContext.API) { diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/IndexTemplateMetadata.java b/server/src/main/java/org/elasticsearch/cluster/metadata/IndexTemplateMetadata.java index 60a1473e97fe0..785fa69e5adee 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/IndexTemplateMetadata.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/IndexTemplateMetadata.java @@ -377,7 +377,7 @@ private static void toInnerXContent(IndexTemplateMetadata indexTemplateMetadata, if (indexTemplateMetadata.version() != null) { builder.field("version", indexTemplateMetadata.version()); } - builder.field("index_patterns", indexTemplateMetadata.patterns()); + builder.stringListField("index_patterns", indexTemplateMetadata.patterns()); builder.startObject("settings"); indexTemplateMetadata.settings().toXContent(builder, params); diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/ItemUsage.java b/server/src/main/java/org/elasticsearch/cluster/metadata/ItemUsage.java index 993ae141e3466..8d3008b6ca162 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/ItemUsage.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/ItemUsage.java @@ -77,13 +77,13 @@ public Set getComposableTemplates() { public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { builder.startObject(); if (this.indices != null) { - builder.field("indices", this.indices); + builder.stringListField("indices", this.indices); } if (this.dataStreams != null) { - builder.field("data_streams", this.dataStreams); + builder.stringListField("data_streams", this.dataStreams); } if (this.composableTemplates != null) { - builder.field("composable_templates", this.composableTemplates); + builder.stringListField("composable_templates", this.composableTemplates); } builder.endObject(); return builder; diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/Manifest.java b/server/src/main/java/org/elasticsearch/cluster/metadata/Manifest.java index c7640b61ba4fd..d13c56dbb8252 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/Manifest.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/Manifest.java @@ -135,7 +135,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws builder.field(CURRENT_TERM_PARSE_FIELD.getPreferredName(), currentTerm); builder.field(CLUSTER_STATE_VERSION_PARSE_FIELD.getPreferredName(), clusterStateVersion); builder.field(GENERATION_PARSE_FIELD.getPreferredName(), globalGeneration); - builder.array(INDEX_GENERATIONS_PARSE_FIELD.getPreferredName(), indexEntryList().toArray()); + builder.xContentList(INDEX_GENERATIONS_PARSE_FIELD.getPreferredName(), indexEntryList()); return builder; } diff --git a/server/src/main/java/org/elasticsearch/cluster/routing/UnassignedInfo.java b/server/src/main/java/org/elasticsearch/cluster/routing/UnassignedInfo.java index bc36fb5abfc3f..aaa22320d1a7f 100644 --- a/server/src/main/java/org/elasticsearch/cluster/routing/UnassignedInfo.java +++ b/server/src/main/java/org/elasticsearch/cluster/routing/UnassignedInfo.java @@ -515,7 +515,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws builder.field("failed_attempts", failedAllocations); } if (failedNodeIds.isEmpty() == false) { - builder.field("failed_nodes", failedNodeIds); + builder.stringListField("failed_nodes", failedNodeIds); } builder.field("delayed", delayed); String details = getDetails(); diff --git a/server/src/main/java/org/elasticsearch/common/settings/Setting.java b/server/src/main/java/org/elasticsearch/common/settings/Setting.java index e8a2144e9e4a5..01d75211e3ed1 100644 --- a/server/src/main/java/org/elasticsearch/common/settings/Setting.java +++ b/server/src/main/java/org/elasticsearch/common/settings/Setting.java @@ -572,7 +572,7 @@ public final boolean match(String toTest) { public final XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { builder.startObject(); builder.field("key", getKey()); - builder.field("properties", properties); + builder.enumSet("properties", properties); builder.field("is_group_setting", isGroupSetting()); builder.field("default", defaultValue.apply(Settings.EMPTY)); builder.endObject(); diff --git a/server/src/main/java/org/elasticsearch/repositories/RepositoryData.java b/server/src/main/java/org/elasticsearch/repositories/RepositoryData.java index 0a41ccace73be..43de0e37030d8 100644 --- a/server/src/main/java/org/elasticsearch/repositories/RepositoryData.java +++ b/server/src/main/java/org/elasticsearch/repositories/RepositoryData.java @@ -743,11 +743,7 @@ public XContentBuilder snapshotsToXContent(final XContentBuilder builder, final } builder.endArray(); if (shouldWriteShardGens) { - builder.startArray(SHARD_GENERATIONS); - for (ShardGeneration gen : shardGenerations.getGens(indexId)) { - builder.value(gen); - } - builder.endArray(); + builder.xContentList(SHARD_GENERATIONS, shardGenerations.getGens(indexId)); } builder.endObject(); } diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/BucketSortPipelineAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/BucketSortPipelineAggregationBuilder.java index 7684e0d4484ba..2c1a4a0e95967 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/BucketSortPipelineAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/BucketSortPipelineAggregationBuilder.java @@ -149,7 +149,7 @@ protected void validate(ValidationContext context) { @Override protected XContentBuilder internalXContent(XContentBuilder builder, Params params) throws IOException { - builder.field(SearchSourceBuilder.SORT_FIELD.getPreferredName(), sorts); + builder.xContentList(SearchSourceBuilder.SORT_FIELD.getPreferredName(), sorts); builder.field(FROM.getPreferredName(), from); if (size != null) { builder.field(SIZE.getPreferredName(), size); diff --git a/server/src/main/java/org/elasticsearch/search/builder/SearchSourceBuilder.java b/server/src/main/java/org/elasticsearch/search/builder/SearchSourceBuilder.java index 360e6e41925aa..2d77f1a438f15 100644 --- a/server/src/main/java/org/elasticsearch/search/builder/SearchSourceBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/builder/SearchSourceBuilder.java @@ -1425,7 +1425,7 @@ public XContentBuilder innerToXContent(XContentBuilder builder, Params params) t } if (stats != null) { - builder.field(STATS_FIELD.getPreferredName(), stats); + builder.stringListField(STATS_FIELD.getPreferredName(), stats); } if (extBuilders != null && extBuilders.isEmpty() == false) { diff --git a/server/src/main/java/org/elasticsearch/transport/TransportInfo.java b/server/src/main/java/org/elasticsearch/transport/TransportInfo.java index e952a563d333d..4608f4c116a12 100644 --- a/server/src/main/java/org/elasticsearch/transport/TransportInfo.java +++ b/server/src/main/java/org/elasticsearch/transport/TransportInfo.java @@ -102,7 +102,7 @@ private String formatPublishAddressString(String propertyName, TransportAddress @Override public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { builder.startObject(Fields.TRANSPORT); - builder.array(Fields.BOUND_ADDRESS, (Object[]) address.boundAddresses()); + builder.xContentList(Fields.BOUND_ADDRESS, address.boundAddresses()); builder.field(Fields.PUBLISH_ADDRESS, formatPublishAddressString("transport.publish_address", address.publishAddress())); builder.startObject(Fields.PROFILES); if (profileAddresses != null && profileAddresses.size() > 0) { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/DataStreamsStatsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/DataStreamsStatsAction.java index ba03c56f2598a..ef7a56c830e5c 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/DataStreamsStatsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/DataStreamsStatsAction.java @@ -83,7 +83,7 @@ protected void addCustomXContentFields(XContentBuilder builder, Params params) t builder.field("data_stream_count", dataStreamCount); builder.field("backing_indices", backingIndices); builder.humanReadableField("total_store_size_bytes", "total_store_size", totalStoreSize); - builder.array("data_streams", (Object[]) dataStreams); + builder.xContentList("data_streams", dataStreams); } public int getDataStreamCount() { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/GetDataStreamAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/GetDataStreamAction.java index c1c6d7c98fe2c..317a062be1e25 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/GetDataStreamAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/GetDataStreamAction.java @@ -169,7 +169,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws builder.startObject(); builder.field(DataStream.NAME_FIELD.getPreferredName(), dataStream.getName()); builder.field(DataStream.TIMESTAMP_FIELD_FIELD.getPreferredName(), dataStream.getTimeStampField()); - builder.field(DataStream.INDICES_FIELD.getPreferredName(), dataStream.getIndices()); + builder.xContentList(DataStream.INDICES_FIELD.getPreferredName(), dataStream.getIndices()); builder.field(DataStream.GENERATION_FIELD.getPreferredName(), dataStream.getGeneration()); if (dataStream.getMetadata() != null) { builder.field(DataStream.METADATA_FIELD.getPreferredName(), dataStream.getMetadata()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/ReloadAnalyzersResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/ReloadAnalyzersResponse.java index 957bd27183182..654aac16ccbe2 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/ReloadAnalyzersResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/ReloadAnalyzersResponse.java @@ -66,8 +66,8 @@ protected void addCustomXContentFields(XContentBuilder builder, Params params) t builder.startObject(); ReloadDetails value = indexDetails.getValue(); builder.field(INDEX_FIELD.getPreferredName(), value.getIndexName()); - builder.field(RELOADED_ANALYZERS_FIELD.getPreferredName(), value.getReloadedAnalyzers()); - builder.field(RELOADED_NODE_IDS_FIELD.getPreferredName(), value.getReloadedIndicesNodes()); + builder.stringListField(RELOADED_ANALYZERS_FIELD.getPreferredName(), value.getReloadedAnalyzers()); + builder.stringListField(RELOADED_NODE_IDS_FIELD.getPreferredName(), value.getReloadedIndicesNodes()); builder.endObject(); } builder.endArray(); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/AllocateAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/AllocateAction.java index 0154d55de91cd..1472197b8136e 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/AllocateAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/AllocateAction.java @@ -143,9 +143,9 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws if (totalShardsPerNode != null) { builder.field(TOTAL_SHARDS_PER_NODE_FIELD.getPreferredName(), totalShardsPerNode); } - builder.field(INCLUDE_FIELD.getPreferredName(), include); - builder.field(EXCLUDE_FIELD.getPreferredName(), exclude); - builder.field(REQUIRE_FIELD.getPreferredName(), require); + builder.stringStringMap(INCLUDE_FIELD.getPreferredName(), include); + builder.stringStringMap(EXCLUDE_FIELD.getPreferredName(), exclude); + builder.stringStringMap(REQUIRE_FIELD.getPreferredName(), require); builder.endObject(); return builder; } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/IndexLifecycleFeatureSetUsage.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/IndexLifecycleFeatureSetUsage.java index 26e544915b7fc..ee118827932ca 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/IndexLifecycleFeatureSetUsage.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/IndexLifecycleFeatureSetUsage.java @@ -64,7 +64,7 @@ public IndexLifecycleFeatureSetUsage(List policyStats) { protected void innerXContent(XContentBuilder builder, Params params) throws IOException { if (policyStats != null) { builder.field("policy_count", policyStats.size()); - builder.field("policy_stats", policyStats); + builder.xContentList("policy_stats", policyStats); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/IndexLifecycleMetadata.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/IndexLifecycleMetadata.java index d36e61535efd2..fa3f2efe0de21 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/IndexLifecycleMetadata.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/IndexLifecycleMetadata.java @@ -95,7 +95,7 @@ public Diff diff(Custom previousState) { @Override public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { - builder.field(POLICIES_FIELD.getPreferredName(), policyMetadatas); + builder.xContentValuesMap(POLICIES_FIELD.getPreferredName(), policyMetadatas); builder.field(OPERATION_MODE_FIELD.getPreferredName(), operationMode); return builder; } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/LifecyclePolicyMetadata.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/LifecyclePolicyMetadata.java index 79ea7fb235ecc..407bca34b68ad 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/LifecyclePolicyMetadata.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/LifecyclePolicyMetadata.java @@ -101,7 +101,7 @@ public String getModifiedDateString() { public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { builder.startObject(); builder.field(POLICY.getPreferredName(), policy); - builder.field(HEADERS.getPreferredName(), headers); + builder.stringStringMap(HEADERS.getPreferredName(), headers); builder.field(VERSION.getPreferredName(), version); builder.field(MODIFIED_DATE.getPreferredName(), modifiedDate); builder.field(MODIFIED_DATE_STRING.getPreferredName(), getModifiedDateString()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/Phase.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/Phase.java index c1c8d489fd1b1..faadc712218cb 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/Phase.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/Phase.java @@ -148,7 +148,7 @@ public Map getActions() { public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { builder.startObject(); builder.field(MIN_AGE.getPreferredName(), minimumAge.getStringRep()); - builder.field(ACTIONS_FIELD.getPreferredName(), actions); + builder.xContentValuesMap(ACTIONS_FIELD.getPreferredName(), actions); builder.endObject(); return builder; } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/WaitForFollowShardTasksStep.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/WaitForFollowShardTasksStep.java index 3ca6166187af7..85860ff41ee78 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/WaitForFollowShardTasksStep.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/WaitForFollowShardTasksStep.java @@ -94,7 +94,7 @@ List getShardFollowTaskInfos() { @Override public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { builder.startObject(); - builder.field(SHARD_FOLLOW_TASKS.getPreferredName(), shardFollowTaskInfos); + builder.xContentList(SHARD_FOLLOW_TASKS.getPreferredName(), shardFollowTaskInfos); String message; if (shardFollowTaskInfos.size() > 0) { message = "Waiting for [" + shardFollowTaskInfos.size() + "] shard follow tasks to be in sync"; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/action/RemoveIndexLifecyclePolicyAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/action/RemoveIndexLifecyclePolicyAction.java index 1dcf205ca79c9..e9987b2dff8aa 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/action/RemoveIndexLifecyclePolicyAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/action/RemoveIndexLifecyclePolicyAction.java @@ -72,7 +72,7 @@ public boolean hasFailures() { public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { builder.startObject(); builder.field(HAS_FAILURES_FIELD.getPreferredName(), hasFailures()); - builder.field(FAILED_INDEXES_FIELD.getPreferredName(), failedIndexes); + builder.stringListField(FAILED_INDEXES_FIELD.getPreferredName(), failedIndexes); builder.endObject(); return builder; } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/RollableIndexCaps.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/RollableIndexCaps.java index 50f1746c32fb2..e73bfe9d32d80 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/RollableIndexCaps.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/RollableIndexCaps.java @@ -64,7 +64,7 @@ public void writeTo(StreamOutput out) throws IOException { public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { builder.startObject(indexName); { - builder.field(ROLLUP_JOBS.getPreferredName(), jobCaps); + builder.xContentList(ROLLUP_JOBS.getPreferredName(), jobCaps); } builder.endObject(); return builder; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/RollupJobCaps.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/RollupJobCaps.java index ea87eb0b1ca12..4de41df47050f 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/RollupJobCaps.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/RollupJobCaps.java @@ -107,7 +107,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws builder.startObject(FIELDS.getPreferredName()); { for (Map.Entry fieldCap : fieldCapLookup.entrySet()) { - builder.array(fieldCap.getKey(), fieldCap.getValue()); + builder.xContentList(fieldCap.getKey(), fieldCap.getValue()); } } builder.endObject(); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/job/MetricConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/job/MetricConfig.java index e1109f948e167..7d705e71cbc66 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/job/MetricConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/job/MetricConfig.java @@ -139,7 +139,7 @@ public XContentBuilder toXContent(final XContentBuilder builder, final Params pa builder.startObject(); { builder.field(FIELD, field); - builder.field(METRICS, metrics); + builder.stringListField(METRICS, metrics); } return builder.endObject(); } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/RoleDescriptor.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/RoleDescriptor.java index ae214c5c5f88c..5bf5693232bdb 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/RoleDescriptor.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/RoleDescriptor.java @@ -246,8 +246,8 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params, boolea builder.field(Fields.GLOBAL.getPreferredName()); ConfigurableClusterPrivileges.toXContent(builder, params, Arrays.asList(configurableClusterPrivileges)); } - builder.array(Fields.INDICES.getPreferredName(), (Object[]) indicesPrivileges); - builder.array(Fields.APPLICATIONS.getPreferredName(), (Object[]) applicationPrivileges); + builder.xContentList(Fields.INDICES.getPreferredName(), indicesPrivileges); + builder.xContentList(Fields.APPLICATIONS.getPreferredName(), applicationPrivileges); if (runAs != null) { builder.array(Fields.RUN_AS.getPreferredName(), runAs); } diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/history/ILMHistoryItem.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/history/ILMHistoryItem.java index 70e80973e67b4..fb9fe22921e29 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/history/ILMHistoryItem.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/history/ILMHistoryItem.java @@ -82,7 +82,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws } builder.field(SUCCESS.getPreferredName(), success); if (executionState != null) { - builder.field(EXECUTION_STATE.getPreferredName(), executionState.asMap()); + builder.stringStringMap(EXECUTION_STATE.getPreferredName(), executionState.asMap()); } if (errorDetails != null) { builder.field(ERROR.getPreferredName(), errorDetails); diff --git a/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/action/RollupIndexCaps.java b/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/action/RollupIndexCaps.java index 390743f0584d8..ca55aa2ea5284 100644 --- a/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/action/RollupIndexCaps.java +++ b/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/action/RollupIndexCaps.java @@ -184,7 +184,7 @@ public void writeTo(StreamOutput out) throws IOException { @Override public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { builder.startObject(rollupIndexName); - builder.field(ROLLUP_JOBS.getPreferredName(), jobCaps); + builder.xContentList(ROLLUP_JOBS.getPreferredName(), jobCaps); builder.endObject(); return builder; } diff --git a/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/v2/TransportRollupAction.java b/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/v2/TransportRollupAction.java index eceb906ccb4f0..31d1125a91fa2 100644 --- a/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/v2/TransportRollupAction.java +++ b/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/v2/TransportRollupAction.java @@ -316,7 +316,7 @@ private static XContentBuilder getProperties(XContentBuilder builder, RollupActi String defaultMetric = metrics.contains("value_count") ? "value_count" : metrics.get(0); builder.startObject(metricConfig.getField()) .field("type", AggregateDoubleMetricFieldMapper.CONTENT_TYPE) - .array(AggregateDoubleMetricFieldMapper.Names.METRICS, metrics.toArray()) + .stringListField(AggregateDoubleMetricFieldMapper.Names.METRICS, metrics) .field(AggregateDoubleMetricFieldMapper.Names.DEFAULT_METRIC, defaultMetric) .endObject(); } diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/audit/logfile/LoggingAuditTrail.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/audit/logfile/LoggingAuditTrail.java index 3fa2c5a047f84..6ebfacfad0481 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/audit/logfile/LoggingAuditTrail.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/audit/logfile/LoggingAuditTrail.java @@ -1067,7 +1067,7 @@ private void withRoleDescriptor(XContentBuilder builder, RoleDescriptor roleDesc } builder.endArray(); // the toXContent method of the {@code RoleDescriptor.ApplicationResourcePrivileges) does a good job - builder.array(RoleDescriptor.Fields.APPLICATIONS.getPreferredName(), (Object[]) roleDescriptor.getApplicationPrivileges()); + builder.xContentList(RoleDescriptor.Fields.APPLICATIONS.getPreferredName(), roleDescriptor.getApplicationPrivileges()); builder.array(RoleDescriptor.Fields.RUN_AS.getPreferredName(), roleDescriptor.getRunAs()); if (roleDescriptor.getMetadata() != null && false == roleDescriptor.getMetadata().isEmpty()) { // JSON building for the metadata might fail when encountering unknown class types. diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/email/EmailActionTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/email/EmailActionTests.java index 7fe8c83136144..5783aa6cdb38c 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/email/EmailActionTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/email/EmailActionTests.java @@ -15,6 +15,7 @@ import org.elasticsearch.common.settings.ClusterSettings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.ToXContent; +import org.elasticsearch.common.xcontent.ToXContentObject; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.json.JsonXContent; @@ -211,7 +212,7 @@ public void testParser() throws Exception { .field("from", "from@domain") .field("priority", priority.name()); if (dataAttachment != null) { - builder.field("attach_data", dataAttachment); + builder.field("attach_data", (ToXContentObject) dataAttachment); } else if (randomBoolean()) { dataAttachment = org.elasticsearch.xpack.watcher.notification.email.DataAttachment.DEFAULT; builder.field("attach_data", true); From 253c53d4ec6dcd76cbc82d94deef16e958d00303 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Fern=C3=A1ndez=20Casta=C3=B1o?= Date: Wed, 6 Oct 2021 14:29:31 +0200 Subject: [PATCH 188/250] Mute bwc test for backporting #77695 to 7.x (#78752) --- build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 44ca1d8db708c..5ba4352b7cd59 100644 --- a/build.gradle +++ b/build.gradle @@ -140,9 +140,9 @@ tasks.register("verifyVersions") { * after the backport of the backcompat code is complete. */ -boolean bwc_tests_enabled = true +boolean bwc_tests_enabled = false // place a PR link here when committing bwc changes: -String bwc_tests_disabled_issue = "" +String bwc_tests_disabled_issue = "https://github.com/elastic/elasticsearch/pull/77695" /* * FIPS 140-2 behavior was fixed in 7.11.0. Before that there is no way to run elasticsearch in a * JVM that is properly configured to be in fips mode with BCFIPS. For now we need to disable From ea27dd4ec1c22dc28fc41abb832b652b0a775797 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Fern=C3=A1ndez=20Casta=C3=B1o?= Date: Wed, 6 Oct 2021 15:31:37 +0200 Subject: [PATCH 189/250] Re-enable BWC tests and adjust versions after #77695 backport to 7.x (#78753) --- build.gradle | 4 ++-- .../java/org/elasticsearch/index/store/StoreFileMetadata.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index 5ba4352b7cd59..44ca1d8db708c 100644 --- a/build.gradle +++ b/build.gradle @@ -140,9 +140,9 @@ tasks.register("verifyVersions") { * after the backport of the backcompat code is complete. */ -boolean bwc_tests_enabled = false +boolean bwc_tests_enabled = true // place a PR link here when committing bwc changes: -String bwc_tests_disabled_issue = "https://github.com/elastic/elasticsearch/pull/77695" +String bwc_tests_disabled_issue = "" /* * FIPS 140-2 behavior was fixed in 7.11.0. Before that there is no way to run elasticsearch in a * JVM that is properly configured to be in fips mode with BCFIPS. For now we need to disable diff --git a/server/src/main/java/org/elasticsearch/index/store/StoreFileMetadata.java b/server/src/main/java/org/elasticsearch/index/store/StoreFileMetadata.java index a571391e7a1e4..f1e157a617c7b 100644 --- a/server/src/main/java/org/elasticsearch/index/store/StoreFileMetadata.java +++ b/server/src/main/java/org/elasticsearch/index/store/StoreFileMetadata.java @@ -28,7 +28,7 @@ public class StoreFileMetadata implements Writeable { public static final BytesRef UNAVAILABLE_WRITER_UUID = new BytesRef(); - private static final org.elasticsearch.Version WRITER_UUID_MIN_VERSION = org.elasticsearch.Version.V_8_0_0; + private static final org.elasticsearch.Version WRITER_UUID_MIN_VERSION = org.elasticsearch.Version.V_7_16_0; private final String name; From c4f5d41fe78c549733d324b43b9f6e61ab3135f8 Mon Sep 17 00:00:00 2001 From: Samuel Nelson Date: Thu, 7 Oct 2021 02:37:30 +1300 Subject: [PATCH 190/250] [DOCS] Update ESS support for `stack.templates.enabled` (#78732) The documentation indicates that `stack.templates.enabled` can be used in Elasticsearch Service, but it is not part of the settings allowlist in ESS. This PR makes the documentation match the state of the allowlist. --- docs/reference/modules/indices/index_management.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference/modules/indices/index_management.asciidoc b/docs/reference/modules/indices/index_management.asciidoc index cda08db2b9eb1..8ff7778b21ef2 100644 --- a/docs/reference/modules/indices/index_management.asciidoc +++ b/docs/reference/modules/indices/index_management.asciidoc @@ -34,7 +34,7 @@ Specifies the hosts that can be <>. // end::reindex-remote-whitelist[] [[stack-templates-enabled]] -`stack.templates.enabled` {ess-icon}:: +`stack.templates.enabled`:: + -- (<>) From 8af3bc1acad41eec0a024e8b00b278c9dcce3321 Mon Sep 17 00:00:00 2001 From: Lukas Wegmann Date: Wed, 6 Oct 2021 16:25:25 +0200 Subject: [PATCH 191/250] backwards compatible deserialization of SqlQueryResponse and fix SQL bwc tests (#78467) * make deserialization of SqlQueryResponse backwards compatible and fix SQL bwc tests * address comments * reenable tests --- x-pack/plugin/sql/qa/mixed-node/build.gradle | 3 +- .../xpack/sql/qa/mixed_node/SqlCompatIT.java | 24 +++++++++++-- .../xpack/sql/qa/mixed_node/SqlSearchIT.java | 35 +++++++++++++------ .../xpack/sql/action/SqlQueryResponse.java | 29 +++++++++------ 4 files changed, 65 insertions(+), 26 deletions(-) diff --git a/x-pack/plugin/sql/qa/mixed-node/build.gradle b/x-pack/plugin/sql/qa/mixed-node/build.gradle index 2c3a20edcf4a0..12ced73d25210 100644 --- a/x-pack/plugin/sql/qa/mixed-node/build.gradle +++ b/x-pack/plugin/sql/qa/mixed-node/build.gradle @@ -21,8 +21,7 @@ testClusters.configureEach { tasks.named("integTest").configure{ enabled = false} // A bug (https://github.com/elastic/elasticsearch/issues/68439) limits us to perform tests with versions from 7.10.3 onwards - -BuildParams.bwcVersions.withWireCompatiple(v -> v.onOrAfter("7.10.0") && +BuildParams.bwcVersions.withWireCompatiple(v -> v.onOrAfter("7.10.3") && v != VersionProperties.getElasticsearchVersion()) { bwcVersion, baseName -> def baseCluster = testClusters.register(baseName) { diff --git a/x-pack/plugin/sql/qa/mixed-node/src/test/java/org/elasticsearch/xpack/sql/qa/mixed_node/SqlCompatIT.java b/x-pack/plugin/sql/qa/mixed-node/src/test/java/org/elasticsearch/xpack/sql/qa/mixed_node/SqlCompatIT.java index 0759f1b4ce24d..1b8864e5ff58b 100644 --- a/x-pack/plugin/sql/qa/mixed-node/src/test/java/org/elasticsearch/xpack/sql/qa/mixed_node/SqlCompatIT.java +++ b/x-pack/plugin/sql/qa/mixed-node/src/test/java/org/elasticsearch/xpack/sql/qa/mixed_node/SqlCompatIT.java @@ -12,6 +12,9 @@ import org.elasticsearch.client.Request; import org.elasticsearch.client.Response; import org.elasticsearch.client.RestClient; +import org.elasticsearch.common.Strings; +import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.core.internal.io.IOUtils; @@ -123,8 +126,8 @@ private List runOrderByNullsLastQuery(RestClient queryClient) throws IO indexDocs.setJsonEntity(bulk.toString()); client().performRequest(indexDocs); - Request query = new Request("GET", "_sql"); - query.setJsonEntity("{\"query\":\"SELECT int FROM test GROUP BY 1 ORDER BY 1 NULLS LAST\"}"); + Request query = new Request("POST", "_sql"); + query.setJsonEntity(sqlQueryEntityWithOptionalMode("SELECT int FROM test GROUP BY 1 ORDER BY 1 NULLS LAST", bwcVersion)); Response queryResponse = queryClient.performRequest(query); assertEquals(200, queryResponse.getStatusLine().getStatusCode()); @@ -135,4 +138,21 @@ private List runOrderByNullsLastQuery(RestClient queryClient) throws IO return rows.stream().map(row -> (Integer) row.get(0)).collect(Collectors.toList()); } + public static String sqlQueryEntityWithOptionalMode(String query, Version bwcVersion) throws IOException { + XContentBuilder json = XContentFactory.jsonBuilder().startObject(); + json.field("query", query); + if (bwcVersion.before(Version.V_7_12_0)) { + // a bug previous to 7.12 caused a NullPointerException when accessing displaySize in ColumnInfo. The bug has been addressed in + // https://github.com/elastic/elasticsearch/pull/68802/files + // #diff-2faa4e2df98a4636300a19d9d890a1bd7174e9b20dd3a8589d2c78a3d9e5cbc0L110 + // as a workaround, use JDBC (driver) mode in versions prior to 7.12 + json.field("mode", "jdbc"); + json.field("binary_format", false); + json.field("version", bwcVersion.toString()); + } + json.endObject(); + + return Strings.toString(json); + } + } diff --git a/x-pack/plugin/sql/qa/mixed-node/src/test/java/org/elasticsearch/xpack/sql/qa/mixed_node/SqlSearchIT.java b/x-pack/plugin/sql/qa/mixed-node/src/test/java/org/elasticsearch/xpack/sql/qa/mixed_node/SqlSearchIT.java index 284a758a508e2..026da06c46eba 100644 --- a/x-pack/plugin/sql/qa/mixed-node/src/test/java/org/elasticsearch/xpack/sql/qa/mixed_node/SqlSearchIT.java +++ b/x-pack/plugin/sql/qa/mixed-node/src/test/java/org/elasticsearch/xpack/sql/qa/mixed_node/SqlSearchIT.java @@ -38,7 +38,6 @@ import static java.util.Collections.unmodifiableMap; import static org.elasticsearch.xpack.ql.TestUtils.buildNodeAndVersions; import static org.elasticsearch.xpack.ql.TestUtils.readResource; -import static org.elasticsearch.xpack.ql.execution.search.QlSourceBuilder.SWITCH_TO_FIELDS_API_VERSION; public class SqlSearchIT extends ESRestTestCase { @@ -56,9 +55,7 @@ public class SqlSearchIT extends ESRestTestCase { private static List newNodes; private static List bwcNodes; private static Version bwcVersion; - private static Version newVersion; private static boolean isBwcNodeBeforeFieldsApiInQL; - private static boolean isBwcNodeBeforeFieldsApiInES; @Before public void createIndex() throws IOException { @@ -68,9 +65,7 @@ public void createIndex() throws IOException { newNodes = new ArrayList<>(nodes.getNewNodes()); bwcNodes = new ArrayList<>(nodes.getBWCNodes()); bwcVersion = nodes.getBWCNodes().get(0).getVersion(); - newVersion = nodes.getNewNodes().get(0).getVersion(); isBwcNodeBeforeFieldsApiInQL = bwcVersion.before(FIELDS_API_QL_INTRODUCTION); - isBwcNodeBeforeFieldsApiInES = bwcVersion.before(SWITCH_TO_FIELDS_API_VERSION); String mappings = readResource(SqlSearchIT.class.getResourceAsStream("/all_field_types.json")); createIndex( @@ -142,7 +137,7 @@ public void testAllTypesWithRequestToUpgradedNodes() throws Exception { (builder, fieldValues) -> { Float randomFloat = randomFloat(); builder.append(","); - if (isBwcNodeBeforeFieldsApiInQL && isBwcNodeBeforeFieldsApiInES) { + if (isBwcNodeBeforeFieldsApiInQL) { builder.append("\"geo_point_field\":{\"lat\":\"37.386483\", \"lon\":\"-122.083843\"},"); fieldValues.put("geo_point_field", "POINT (-122.08384302444756 37.38648299127817)"); builder.append("\"float_field\":" + randomFloat + ","); @@ -256,20 +251,38 @@ private void assertAllTypesWithNodes(Map expectedResponse, List< ) { @SuppressWarnings("unchecked") List> columns = (List>) expectedResponse.get("columns"); + String intervalYearMonth = "INTERVAL '150' YEAR AS interval_year, "; String intervalDayTime = "INTERVAL '163' MINUTE AS interval_minute, "; - // get all fields names from the expected response built earlier, skipping the intervals as they execute locally // and not taken from the index itself - String fieldsList = columns.stream().map(m -> (String) m.get("name")).filter(str -> str.startsWith("interval") == false) - .collect(Collectors.toList()).stream().collect(Collectors.joining(", ")); + String fieldsList = columns.stream() + .map(m -> (String) m.get("name")) + .filter(str -> str.startsWith("interval") == false) + .collect(Collectors.toList()) + .stream() + .collect(Collectors.joining(", ")); String query = "SELECT " + intervalYearMonth + intervalDayTime + fieldsList + " FROM " + index + " ORDER BY id"; + Request request = new Request("POST", "_sql"); - request.setJsonEntity("{\"query\":\"" + query + "\"}"); - assertBusy(() -> { assertResponse(expectedResponse, runSql(client, request)); }); + request.setJsonEntity(SqlCompatIT.sqlQueryEntityWithOptionalMode(query, bwcVersion)); + assertBusy(() -> { + assertResponse(expectedResponse, dropDisplaySizes(runSql(client, request))); + }); } } + private Map dropDisplaySizes(Map response) { + // in JDBC mode, display_size will be part of the response, so remove it because it's not part of the expected response + @SuppressWarnings("unchecked") + List> columns = (List>) response.get("columns"); + List> columnsWithoutDisplaySizes = columns.stream() + .peek(column -> column.remove("display_size")) + .collect(Collectors.toList()); + response.put("columns", columnsWithoutDisplaySizes); + return response; + } + private void assertResponse(Map expected, Map actual) { if (false == expected.equals(actual)) { NotEqualMessageBuilder message = new NotEqualMessageBuilder(); diff --git a/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlQueryResponse.java b/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlQueryResponse.java index bfbd110688eb9..c7780841bf416 100644 --- a/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlQueryResponse.java +++ b/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlQueryResponse.java @@ -6,19 +6,14 @@ */ package org.elasticsearch.xpack.sql.action; -import java.io.IOException; -import java.time.ZonedDateTime; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - +import org.elasticsearch.Version; import org.elasticsearch.action.ActionResponse; -import org.elasticsearch.core.Nullable; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.xcontent.ToXContentObject; import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.core.Nullable; import org.elasticsearch.xpack.ql.async.QlStatusResponse; import org.elasticsearch.xpack.sql.proto.ColumnInfo; import org.elasticsearch.xpack.sql.proto.Mode; @@ -26,6 +21,12 @@ import org.elasticsearch.xpack.sql.proto.SqlVersion; import org.elasticsearch.xpack.sql.proto.StringUtils; +import java.io.IOException; +import java.time.ZonedDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + import static java.util.Collections.unmodifiableList; import static org.elasticsearch.Version.CURRENT; import static org.elasticsearch.xpack.sql.action.AbstractSqlQueryRequest.CURSOR; @@ -81,10 +82,16 @@ public SqlQueryResponse(StreamInput in) throws IOException { } } this.rows = unmodifiableList(rows); - columnar = in.readBoolean(); - asyncExecutionId = in.readOptionalString(); - isPartial = in.readBoolean(); - isRunning = in.readBoolean(); + if (in.getVersion().onOrAfter(Version.V_7_14_0)) { + columnar = in.readBoolean(); + asyncExecutionId = in.readOptionalString(); + isPartial = in.readBoolean(); + isRunning = in.readBoolean(); + } else { + asyncExecutionId = null; + isPartial = false; + isRunning = false; + } } public SqlQueryResponse( From 14e8e2b96a302d0c99bec8b4446b7f0b966b1b4f Mon Sep 17 00:00:00 2001 From: Jim Ferenczi Date: Wed, 6 Oct 2021 16:51:18 +0200 Subject: [PATCH 192/250] adapt version after backport (#78748) --- .../xpack/core/termsenum/action/NodeTermsEnumRequest.java | 4 ++-- .../resources/rest-api-spec/test/terms_enum/10_basic.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/termsenum/action/NodeTermsEnumRequest.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/termsenum/action/NodeTermsEnumRequest.java index 2b69547beaf9e..044968d62da9a 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/termsenum/action/NodeTermsEnumRequest.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/termsenum/action/NodeTermsEnumRequest.java @@ -76,7 +76,7 @@ public NodeTermsEnumRequest(StreamInput in) throws IOException { for (int i = 0; i < numShards; i++) { shardIds.add(new ShardId(in)); } - if (in.getVersion().onOrAfter(Version.V_8_0_0)) { + if (in.getVersion().onOrAfter(Version.V_7_15_1)) { originalIndices = OriginalIndices.readOriginalIndices(in); } else { String[] indicesNames = shardIds.stream() @@ -107,7 +107,7 @@ public void writeTo(StreamOutput out) throws IOException { for (ShardId shardId : shardIds) { shardId.writeTo(out); } - if (out.getVersion().onOrAfter(Version.V_8_0_0)) { + if (out.getVersion().onOrAfter(Version.V_7_15_1)) { OriginalIndices.writeOriginalIndices(originalIndices, out); } } diff --git a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/terms_enum/10_basic.yml b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/terms_enum/10_basic.yml index 4390fdf252cf3..9e6adf86b63ec 100644 --- a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/terms_enum/10_basic.yml +++ b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/terms_enum/10_basic.yml @@ -1,8 +1,8 @@ --- setup: - skip: - version: " - 7.9.99" - reason: TODO temporary version skip while we wait for backport to 7.x of search_after properties + version: " - 7.15.0" + reason: original indices are propagated correctly in 7.15.1 features: headers - do: cluster.health: From ef42ec600bc879ed282170a25c93336a5c36b7c2 Mon Sep 17 00:00:00 2001 From: James Rodewig <40268737+jrodewig@users.noreply.github.com> Date: Wed, 6 Oct 2021 10:53:39 -0400 Subject: [PATCH 193/250] Mute testNothingToDelete (#78766) --- .../xpack/monitoring/cleaner/AbstractIndicesCleanerTestCase.java | 1 + 1 file changed, 1 insertion(+) diff --git a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/cleaner/AbstractIndicesCleanerTestCase.java b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/cleaner/AbstractIndicesCleanerTestCase.java index 42452cc6fc7ea..37d8f7824fda1 100644 --- a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/cleaner/AbstractIndicesCleanerTestCase.java +++ b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/cleaner/AbstractIndicesCleanerTestCase.java @@ -40,6 +40,7 @@ public void setup() { cleanerService.setGlobalRetention(TimeValue.MAX_VALUE); } + @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/78737") public void testNothingToDelete() throws Exception { CleanerService.Listener listener = getListener(); listener.onCleanUpIndices(days(0)); From f2580daad6fa425fe8c5e432b45965607eb185eb Mon Sep 17 00:00:00 2001 From: Jim Ferenczi Date: Wed, 6 Oct 2021 18:19:03 +0200 Subject: [PATCH 194/250] Speed up ordinal lookups in composite aggregation (#78313) This change is an optimization on top of #, that sorts ordinals to perform lookups. The sorting ensures that we don't do the de-compression of blocks in the dictionary of terms more than necessary. In the worst case today, we can decompress the same block for each lookup term per segment, while this change requires only one decompression. This commit also creates the doc values lookup once per request per segment. This is useful when inverted lists are used to shortcut the collection since terms are already sorted in the dictionary. --- .../bucket/composite/OrdinalValuesSource.java | 145 ++++++++++++------ .../composite/CompositeAggregatorTests.java | 11 +- 2 files changed, 110 insertions(+), 46 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/OrdinalValuesSource.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/OrdinalValuesSource.java index ba469d346f26a..d7c4ecc8d6c2e 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/OrdinalValuesSource.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/OrdinalValuesSource.java @@ -25,6 +25,12 @@ import org.elasticsearch.search.aggregations.LeafBucketCollector; import java.io.IOException; +import java.io.UncheckedIOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import java.util.function.LongConsumer; import static org.apache.lucene.index.SortedSetDocValues.NO_MORE_ORDS; @@ -50,6 +56,9 @@ class OrdinalValuesSource extends SingleDimensionValuesSource { private final LongConsumer breakerConsumer; // track how much bytes are stored in the values array private final CheckedFunction docValuesFunc; + // doc-values lookup, cached by LeafReaderContext ordinal + private final Map dvsLookup = new HashMap<>(); + private SortedSetDocValues lookup; // current ordinals lookup private int leafReaderOrd = -1; // current LeafReaderContext ordinal @@ -245,22 +254,32 @@ BytesRef toComparable(int slot) throws IOException { LeafBucketCollector getLeafCollector(LeafReaderContext context, LeafBucketCollector next) throws IOException { final boolean leafReaderContextChanged = context.ord != leafReaderOrd; assert leafReaderContextChanged == false || invariant(); // for performance reasons only check invariant upon change - final SortedSetDocValues dvs = docValuesFunc.apply(context); if (leafReaderContextChanged) { - remapOrdinals(lookup, dvs); + // use a separate instance for ordinal and term lookups, that is cached per segment + // to speed up sorted collections that call getLeafCollector once per term (see above) + final SortedSetDocValues newLookup = dvsLookup.computeIfAbsent(context.ord, k -> { + try { + return docValuesFunc.apply(context); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + }); + remapOrdinals(lookup, newLookup); + lookup = newLookup; leafReaderOrd = context.ord; } - lookup = dvs; + + // and creates a SortedSetDocValues to iterate over the values + final SortedSetDocValues it = docValuesFunc.apply(context); assert leafReaderContextChanged == false || invariant(); // for performance reasons only check invariant upon change return new LeafBucketCollector() { @Override public void collect(int doc, long bucket) throws IOException { // caller of getLeafCollector ensures that collection happens before requesting a new leaf collector // this is important as ordinals only make sense in the context of the current lookup - assert dvs == lookup; - if (dvs.advanceExact(doc)) { + if (it.advanceExact(doc)) { long ord; - while ((ord = dvs.nextOrd()) != NO_MORE_ORDS) { + while ((ord = it.nextOrd()) != NO_MORE_ORDS) { currentValueOrd = ord; currentValueUnmapped = null; next.collect(doc, bucket); @@ -283,38 +302,51 @@ LeafBucketCollector getLeafCollector(Comparable value, LeafReaderConte throw new IllegalArgumentException("Expected BytesRef, got " + value.getClass()); } BytesRef term = (BytesRef) value; - final SortedSetDocValues dvs = docValuesFunc.apply(context); if (leafReaderContextChanged) { - remapOrdinals(lookup, dvs); - leafReaderOrd = context.ord; + // use a separate instance for ordinal and term lookups, that is cached per segment + // to speed up sorted collections that call getLeafCollector once per term + final SortedSetDocValues newLookup = dvsLookup.computeIfAbsent(context.ord, k -> { + try { + return docValuesFunc.apply(context); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + }); + remapOrdinals(lookup, newLookup); + lookup = newLookup; } - lookup = dvs; + currentValueOrd = lookup.lookupTerm(term); + currentValueUnmapped = null; + leafReaderOrd = context.ord; + assert currentValueOrd >= 0; assert leafReaderContextChanged == false || invariant(); // for performance reasons only check invariant upon change - return new LeafBucketCollector() { - boolean currentValueIsSet = false; + return next; + } - @Override - public void collect(int doc, long bucket) throws IOException { - // caller of getLeafCollector ensures that collection happens before requesting a new leaf collector - // this is important as ordinals only make sense in the context of the current lookup - assert dvs == lookup; - if (currentValueIsSet == false) { - if (dvs.advanceExact(doc)) { - long ord; - while ((ord = dvs.nextOrd()) != NO_MORE_ORDS) { - if (term.equals(dvs.lookupOrd(ord))) { - currentValueIsSet = true; - currentValueOrd = ord; - currentValueUnmapped = null; - break; - } - } - } - } - assert currentValueIsSet; - next.collect(doc, bucket); + private static class Slot implements Comparable { + final int index; + final long ord; + final BytesRef unmapped; + + private Slot(int index, long ord, BytesRef unmapped) { + assert ord >= 0 || unmapped != null; + this.index = index; + this.ord = ord; + this.unmapped = unmapped; + } + + @Override + public int compareTo(Slot other) { + if (ord < 0 && ord == other.ord) { + assert unmapped != null && other.unmapped != null; + // compare by original term if both ordinals are insertion points (negative value) + return unmapped.compareTo(other.unmapped); } - }; + long norm1 = ord < 0 ? -ord - 1 : ord; + long norm2 = other.ord < 0 ? -other.ord - 1 : other.ord; + int cmp = Long.compare(norm1, norm2); + return cmp == 0 ? Long.compare(ord, other.ord) : cmp; + } } /** @@ -322,24 +354,49 @@ public void collect(int doc, long bucket) throws IOException { * in that case remember the term so that future remapping steps can accurately be done. */ private void remapOrdinals(SortedSetDocValues oldMapping, SortedSetDocValues newMapping) throws IOException { + // speed up the lookups by sorting ordinals first + List sorted = new ArrayList<>(); for (int i = 0; i < numSlots; i++) { - final long oldOrd = valuesOrd.get(i); - if (oldOrd != Long.MIN_VALUE) { - final long newOrd; - if (oldOrd >= 0) { - final BytesRef newVal = oldMapping.lookupOrd(oldOrd); - newOrd = newMapping.lookupTerm(newVal); + long ord = valuesOrd.get(i); + if (ord != Long.MIN_VALUE) { + sorted.add(new Slot(i, ord, ord < 0 ? valuesUnmapped.get(i) : null)); + } + } + Collections.sort(sorted); + + long lastOldOrd = Long.MIN_VALUE; + long lastNewOrd = Long.MIN_VALUE; + BytesRef lastUnmapped = null; + for (Slot slot : sorted) { + final long index = slot.index; + final long oldOrd = slot.ord; + final BytesRef unmapped = slot.unmapped; + final long newOrd; + if (oldOrd >= 0) { + if (lastOldOrd == oldOrd) { + newOrd = lastNewOrd; if (newOrd < 0) { - setValueWithBreaking(i, BytesRef.deepCopyOf(newVal)); + setValueWithBreaking(index, lastUnmapped); } } else { - newOrd = newMapping.lookupTerm(valuesUnmapped.get(i)); - if (newOrd >= 0) { - setValueWithBreaking(i, null); + final BytesRef newVal = oldMapping.lookupOrd(oldOrd); + newOrd = newMapping.lookupTerm(newVal); + if (newOrd < 0) { + setValueWithBreaking(index, BytesRef.deepCopyOf(newVal)); } } - valuesOrd.set(i, newOrd); + } else { + // the original term is missing in the dictionary + assert unmapped != null; + newOrd = newMapping.lookupTerm(unmapped); + if (newOrd >= 0) { + setValueWithBreaking(index, null); + } } + lastOldOrd = oldOrd; + lastNewOrd = newOrd; + lastUnmapped = valuesUnmapped.get(index); + valuesOrd.set(index, newOrd); } if (currentValueOrd != null) { diff --git a/server/src/test/java/org/elasticsearch/search/aggregations/bucket/composite/CompositeAggregatorTests.java b/server/src/test/java/org/elasticsearch/search/aggregations/bucket/composite/CompositeAggregatorTests.java index 23b0ace7e6168..3b1b0198a898e 100644 --- a/server/src/test/java/org/elasticsearch/search/aggregations/bucket/composite/CompositeAggregatorTests.java +++ b/server/src/test/java/org/elasticsearch/search/aggregations/bucket/composite/CompositeAggregatorTests.java @@ -22,6 +22,7 @@ import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriterConfig; +import org.apache.lucene.index.NoMergePolicy; import org.apache.lucene.index.RandomIndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.search.DocValuesFieldExistsQuery; @@ -2836,6 +2837,9 @@ private void executeTestCase( config.setIndexSort(indexSort); config.setCodec(TestUtil.getDefaultCodec()); } + if (forceMerge == false) { + config.setMergePolicy(NoMergePolicy.INSTANCE); + } try (RandomIndexWriter indexWriter = new RandomIndexWriter(random(), directory, config)) { Document document = new Document(); int id = 0; @@ -2843,10 +2847,13 @@ private void executeTestCase( document.clear(); addToDocument(id, document, fields); indexWriter.addDocument(document); + if (frequently()) { + indexWriter.commit(); + } id++; } - if (forceMerge || rarely()) { - // forceMerge randomly or if the collector-per-leaf testing stuff would break the tests. + if (forceMerge) { + // forceMerge if the collector-per-leaf testing stuff would break the tests. indexWriter.forceMerge(1); } else { if (dataset.size() > 0) { From 874cb0a7cc5d05669f75715685cdc7d33e999aee Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Wed, 6 Oct 2021 09:57:28 -0700 Subject: [PATCH 195/250] Remove Joda rounding (#78721) Joda based rounding was moved to tests many years ago, and it is unused outside of tests. This commit removes the uses in tests and the Joda rounding code. --- .../common/RoundingBenchmark.java | 118 -- .../elasticsearch/common/RoundingTests.java | 1203 ----------------- .../common/RoundingWireTests.java | 40 - .../common/rounding/DateTimeUnit.java | 61 - .../common/rounding/DateTimeUnitTests.java | 51 - .../common/rounding/Rounding.java | 416 ------ .../common/rounding/RoundingDuelTests.java | 47 - .../rounding/TimeZoneRoundingTests.java | 780 ----------- 8 files changed, 2716 deletions(-) delete mode 100644 benchmarks/src/main/java/org/elasticsearch/common/RoundingBenchmark.java delete mode 100644 server/src/test/java/org/elasticsearch/common/RoundingTests.java delete mode 100644 server/src/test/java/org/elasticsearch/common/RoundingWireTests.java delete mode 100644 server/src/test/java/org/elasticsearch/common/rounding/DateTimeUnit.java delete mode 100644 server/src/test/java/org/elasticsearch/common/rounding/DateTimeUnitTests.java delete mode 100644 server/src/test/java/org/elasticsearch/common/rounding/Rounding.java delete mode 100644 server/src/test/java/org/elasticsearch/common/rounding/RoundingDuelTests.java delete mode 100644 server/src/test/java/org/elasticsearch/common/rounding/TimeZoneRoundingTests.java diff --git a/benchmarks/src/main/java/org/elasticsearch/common/RoundingBenchmark.java b/benchmarks/src/main/java/org/elasticsearch/common/RoundingBenchmark.java deleted file mode 100644 index 0dac070377dd4..0000000000000 --- a/benchmarks/src/main/java/org/elasticsearch/common/RoundingBenchmark.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * 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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -package org.elasticsearch.common; - -import org.elasticsearch.common.time.DateFormatter; -import org.elasticsearch.core.TimeValue; -import org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramAggregationBuilder; -import org.openjdk.jmh.annotations.Benchmark; -import org.openjdk.jmh.annotations.BenchmarkMode; -import org.openjdk.jmh.annotations.Fork; -import org.openjdk.jmh.annotations.Measurement; -import org.openjdk.jmh.annotations.Mode; -import org.openjdk.jmh.annotations.OutputTimeUnit; -import org.openjdk.jmh.annotations.Param; -import org.openjdk.jmh.annotations.Scope; -import org.openjdk.jmh.annotations.Setup; -import org.openjdk.jmh.annotations.State; -import org.openjdk.jmh.annotations.Warmup; -import org.openjdk.jmh.infra.Blackhole; - -import java.time.ZoneId; -import java.util.concurrent.TimeUnit; -import java.util.function.Supplier; - -@Fork(2) -@Warmup(iterations = 10) -@Measurement(iterations = 5) -@BenchmarkMode(Mode.AverageTime) -@OutputTimeUnit(TimeUnit.NANOSECONDS) -@State(Scope.Benchmark) -public class RoundingBenchmark { - private static final DateFormatter FORMATTER = DateFormatter.forPattern("date_optional_time"); - - @Param( - { - "2000-01-01 to 2020-01-01", // A super long range - "2000-10-01 to 2000-11-01", // A whole month which is pretty believable - "2000-10-29 to 2000-10-30", // A date right around daylight savings time. - "2000-06-01 to 2000-06-02" // A date fully in one time zone. Should be much faster than above. - } - ) - public String range; - - @Param({ "java time", "es" }) - public String rounder; - - @Param({ "UTC", "America/New_York" }) - public String zone; - - @Param({ "calendar year", "calendar hour", "10d", "5d", "1h" }) - public String interval; - - @Param({ "1", "10000", "1000000", "100000000" }) - public int count; - - private long min; - private long max; - private long[] dates; - private Supplier rounderBuilder; - - @Setup - public void buildDates() { - String[] r = range.split(" to "); - min = FORMATTER.parseMillis(r[0]); - max = FORMATTER.parseMillis(r[1]); - dates = new long[count]; - long date = min; - long diff = (max - min) / dates.length; - for (int i = 0; i < dates.length; i++) { - if (date >= max) { - throw new IllegalStateException("made a bad date [" + date + "]"); - } - dates[i] = date; - date += diff; - } - Rounding.Builder roundingBuilder; - if (interval.startsWith("calendar ")) { - roundingBuilder = Rounding.builder( - DateHistogramAggregationBuilder.DATE_FIELD_UNITS.get(interval.substring("calendar ".length())) - ); - } else { - roundingBuilder = Rounding.builder(TimeValue.parseTimeValue(interval, "interval")); - } - Rounding rounding = roundingBuilder.timeZone(ZoneId.of(zone)).build(); - switch (rounder) { - case "java time": - rounderBuilder = rounding::prepareJavaTime; - break; - case "es": - rounderBuilder = () -> rounding.prepare(min, max); - break; - default: - throw new IllegalArgumentException("Expectd rounder to be [java time] or [es]"); - } - } - - @Benchmark - public void round(Blackhole bh) { - Rounding.Prepared rounder = rounderBuilder.get(); - for (int i = 0; i < dates.length; i++) { - bh.consume(rounder.round(dates[i])); - } - } - - @Benchmark - public void nextRoundingValue(Blackhole bh) { - Rounding.Prepared rounder = rounderBuilder.get(); - for (int i = 0; i < dates.length; i++) { - bh.consume(rounder.nextRoundingValue(dates[i])); - } - } -} diff --git a/server/src/test/java/org/elasticsearch/common/RoundingTests.java b/server/src/test/java/org/elasticsearch/common/RoundingTests.java deleted file mode 100644 index c5591b2cc2ebf..0000000000000 --- a/server/src/test/java/org/elasticsearch/common/RoundingTests.java +++ /dev/null @@ -1,1203 +0,0 @@ -/* - * 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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -package org.elasticsearch.common; - -import org.elasticsearch.core.Tuple; -import org.elasticsearch.common.rounding.DateTimeUnit; -import org.elasticsearch.common.time.DateFormatter; -import org.elasticsearch.common.time.DateFormatters; -import org.elasticsearch.core.TimeValue; -import org.elasticsearch.test.ESTestCase; -import org.hamcrest.Description; -import org.hamcrest.Matcher; -import org.hamcrest.TypeSafeMatcher; - -import java.time.Instant; -import java.time.ZoneId; -import java.time.ZoneOffset; -import java.time.ZonedDateTime; -import java.time.format.DateTimeFormatter; -import java.time.temporal.TemporalAccessor; -import java.time.zone.ZoneOffsetTransition; -import java.time.zone.ZoneOffsetTransitionRule; -import java.time.zone.ZoneRules; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.concurrent.TimeUnit; - -import static java.util.stream.Collectors.toList; -import static org.hamcrest.Matchers.closeTo; -import static org.hamcrest.Matchers.equalTo; -import static org.hamcrest.Matchers.greaterThan; -import static org.hamcrest.Matchers.greaterThanOrEqualTo; -import static org.hamcrest.Matchers.lessThan; -import static org.hamcrest.Matchers.lessThanOrEqualTo; - -public class RoundingTests extends ESTestCase { - - public void testUTCTimeUnitRounding() { - Rounding tzRounding = Rounding.builder(Rounding.DateTimeUnit.MONTH_OF_YEAR).build(); - ZoneId tz = ZoneOffset.UTC; - assertThat(tzRounding.round(time("2009-02-03T01:01:01")), isDate(time("2009-02-01T00:00:00.000Z"), tz)); - assertThat(tzRounding.nextRoundingValue(time("2009-02-01T00:00:00.000Z")), isDate(time("2009-03-01T00:00:00.000Z"), tz)); - - tzRounding = Rounding.builder(Rounding.DateTimeUnit.WEEK_OF_WEEKYEAR).build(); - assertThat(tzRounding.round(time("2012-01-10T01:01:01")), isDate(time("2012-01-09T00:00:00.000Z"), tz)); - assertThat(tzRounding.nextRoundingValue(time("2012-01-09T00:00:00.000Z")), isDate(time("2012-01-16T00:00:00.000Z"), tz)); - - tzRounding = Rounding.builder(Rounding.DateTimeUnit.QUARTER_OF_YEAR).build(); - assertThat(tzRounding.round(time("2012-01-10T01:01:01")), isDate(time("2012-01-01T00:00:00.000Z"), tz)); - assertThat(tzRounding.nextRoundingValue(time("2012-01-09T00:00:00.000Z")), isDate(time("2012-04-01T00:00:00.000Z"), tz)); - - tzRounding = Rounding.builder(Rounding.DateTimeUnit.HOUR_OF_DAY).build(); - assertThat(tzRounding.round(time("2012-01-10T01:01:01")), isDate(time("2012-01-10T01:00:00.000Z"), tz)); - assertThat(tzRounding.nextRoundingValue(time("2012-01-09T00:00:00.000Z")), isDate(time("2012-01-09T01:00:00.000Z"), tz)); - - tzRounding = Rounding.builder(Rounding.DateTimeUnit.DAY_OF_MONTH).build(); - assertThat(tzRounding.round(time("2012-01-10T01:01:01")), isDate(time("2012-01-10T00:00:00.000Z"), tz)); - assertThat(tzRounding.nextRoundingValue(time("2012-01-09T00:00:00.000Z")), isDate(time("2012-01-10T00:00:00.000Z"), tz)); - - tzRounding = Rounding.builder(Rounding.DateTimeUnit.YEAR_OF_CENTURY).build(); - assertThat(tzRounding.round(time("2012-01-10T01:01:01")), isDate(time("2012-01-01T00:00:00.000Z"), tz)); - assertThat(tzRounding.nextRoundingValue(time("2012-01-09T00:00:00.000Z")), isDate(time("2013-01-01T00:00:00.000Z"), tz)); - - tzRounding = Rounding.builder(Rounding.DateTimeUnit.MINUTES_OF_HOUR).build(); - assertThat(tzRounding.round(time("2012-01-10T01:01:01")), isDate(time("2012-01-10T01:01:00.000Z"), tz)); - assertThat(tzRounding.nextRoundingValue(time("2012-01-09T00:00:00.000Z")), isDate(time("2012-01-09T00:01:00.000Z"), tz)); - - tzRounding = Rounding.builder(Rounding.DateTimeUnit.SECOND_OF_MINUTE).build(); - assertThat(tzRounding.round(time("2012-01-10T01:01:01")), isDate(time("2012-01-10T01:01:01.000Z"), tz)); - assertThat(tzRounding.nextRoundingValue(time("2012-01-09T00:00:00.000Z")), isDate(time("2012-01-09T00:00:01.000Z"), tz)); - } - - public void testUTCIntervalRounding() { - Rounding tzRounding = Rounding.builder(TimeValue.timeValueHours(12)).build(); - ZoneId tz = ZoneOffset.UTC; - assertThat(tzRounding.round(time("2009-02-03T01:01:01")), isDate(time("2009-02-03T00:00:00.000Z"), tz)); - assertThat(tzRounding.nextRoundingValue(time("2009-02-03T00:00:00.000Z")), isDate(time("2009-02-03T12:00:00.000Z"), tz)); - assertThat(tzRounding.round(time("2009-02-03T13:01:01")), isDate(time("2009-02-03T12:00:00.000Z"), tz)); - assertThat(tzRounding.nextRoundingValue(time("2009-02-03T12:00:00.000Z")), isDate(time("2009-02-04T00:00:00.000Z"), tz)); - - tzRounding = Rounding.builder(TimeValue.timeValueHours(48)).build(); - assertThat(tzRounding.round(time("2009-02-03T01:01:01")), isDate(time("2009-02-03T00:00:00.000Z"), tz)); - assertThat(tzRounding.nextRoundingValue(time("2009-02-03T00:00:00.000Z")), isDate(time("2009-02-05T00:00:00.000Z"), tz)); - assertThat(tzRounding.round(time("2009-02-05T13:01:01")), isDate(time("2009-02-05T00:00:00.000Z"), tz)); - assertThat(tzRounding.nextRoundingValue(time("2009-02-05T00:00:00.000Z")), isDate(time("2009-02-07T00:00:00.000Z"), tz)); - } - - /** - * test TimeIntervalRounding, (interval < 12h) with time zone shift - */ - public void testTimeIntervalRounding() { - ZoneId tz = ZoneOffset.ofHours(-1); - Rounding tzRounding = Rounding.builder(TimeValue.timeValueHours(6)).timeZone(tz).build(); - assertThat(tzRounding.round(time("2009-02-03T00:01:01")), isDate(time("2009-02-02T19:00:00.000Z"), tz)); - assertThat(tzRounding.nextRoundingValue(time("2009-02-02T19:00:00.000Z")), isDate(time("2009-02-03T01:00:00.000Z"), tz)); - - assertThat(tzRounding.round(time("2009-02-03T13:01:01")), isDate(time("2009-02-03T13:00:00.000Z"), tz)); - assertThat(tzRounding.nextRoundingValue(time("2009-02-03T13:00:00.000Z")), isDate(time("2009-02-03T19:00:00.000Z"), tz)); - } - - /** - * test DayIntervalRounding, (interval >= 12h) with time zone shift - */ - public void testDayIntervalRounding() { - ZoneId tz = ZoneOffset.ofHours(-8); - Rounding tzRounding = Rounding.builder(TimeValue.timeValueHours(12)).timeZone(tz).build(); - assertThat(tzRounding.round(time("2009-02-03T00:01:01")), isDate(time("2009-02-02T20:00:00.000Z"), tz)); - assertThat(tzRounding.nextRoundingValue(time("2009-02-02T20:00:00.000Z")), isDate(time("2009-02-03T08:00:00.000Z"), tz)); - - assertThat(tzRounding.round(time("2009-02-03T13:01:01")), isDate(time("2009-02-03T08:00:00.000Z"), tz)); - assertThat(tzRounding.nextRoundingValue(time("2009-02-03T08:00:00.000Z")), isDate(time("2009-02-03T20:00:00.000Z"), tz)); - } - - public void testDayRounding() { - int timezoneOffset = -2; - Rounding tzRounding = Rounding.builder(Rounding.DateTimeUnit.DAY_OF_MONTH) - .timeZone(ZoneOffset.ofHours(timezoneOffset)).build(); - assertThat(tzRounding.round(0), equalTo(0L - TimeValue.timeValueHours(24 + timezoneOffset).millis())); - assertThat(tzRounding.nextRoundingValue(0L - TimeValue.timeValueHours(24 + timezoneOffset).millis()), equalTo(TimeValue - .timeValueHours(-timezoneOffset).millis())); - - ZoneId tz = ZoneId.of("-08:00"); - tzRounding = Rounding.builder(Rounding.DateTimeUnit.DAY_OF_MONTH).timeZone(tz).build(); - assertThat(tzRounding.round(time("2012-04-01T04:15:30Z")), isDate(time("2012-03-31T08:00:00Z"), tz)); - - tzRounding = Rounding.builder(Rounding.DateTimeUnit.MONTH_OF_YEAR).timeZone(tz).build(); - assertThat(tzRounding.round(time("2012-04-01T04:15:30Z")), equalTo(time("2012-03-01T08:00:00Z"))); - - // date in Feb-3rd, but still in Feb-2nd in -02:00 timezone - tz = ZoneId.of("-02:00"); - tzRounding = Rounding.builder(Rounding.DateTimeUnit.DAY_OF_MONTH).timeZone(tz).build(); - assertThat(tzRounding.round(time("2009-02-03T01:01:01")), isDate(time("2009-02-02T02:00:00"), tz)); - assertThat(tzRounding.nextRoundingValue(time("2009-02-02T02:00:00")), isDate(time("2009-02-03T02:00:00"), tz)); - - // date in Feb-3rd, also in -02:00 timezone - tzRounding = Rounding.builder(Rounding.DateTimeUnit.DAY_OF_MONTH).timeZone(tz).build(); - assertThat(tzRounding.round(time("2009-02-03T02:01:01")), isDate(time("2009-02-03T02:00:00"), tz)); - assertThat(tzRounding.nextRoundingValue(time("2009-02-03T02:00:00")), isDate(time("2009-02-04T02:00:00"), tz)); - } - - public void testTimeRounding() { - // hour unit - ZoneId tz = ZoneOffset.ofHours(-2); - Rounding tzRounding = Rounding.builder(Rounding.DateTimeUnit.HOUR_OF_DAY).timeZone(tz).build(); - assertThat(tzRounding.round(0), equalTo(0L)); - assertThat(tzRounding.nextRoundingValue(0L), equalTo(TimeValue.timeValueHours(1L).getMillis())); - - assertThat(tzRounding.round(time("2009-02-03T01:01:01")), isDate(time("2009-02-03T01:00:00"), tz)); - assertThat(tzRounding.nextRoundingValue(time("2009-02-03T01:00:00")), isDate(time("2009-02-03T02:00:00"), tz)); - } - - public void testTimeUnitRoundingDST() { - Rounding tzRounding; - // testing savings to non savings switch - ZoneId cet = ZoneId.of("CET"); - tzRounding = Rounding.builder(Rounding.DateTimeUnit.HOUR_OF_DAY).timeZone(cet).build(); - assertThat(tzRounding.round(time("2014-10-26T01:01:01", cet)), isDate(time("2014-10-26T01:00:00+02:00"), cet)); - assertThat(tzRounding.nextRoundingValue(time("2014-10-26T01:00:00", cet)),isDate(time("2014-10-26T02:00:00+02:00"), cet)); - assertThat(tzRounding.nextRoundingValue(time("2014-10-26T02:00:00", cet)), isDate(time("2014-10-26T02:00:00+01:00"), cet)); - - // testing non savings to savings switch - tzRounding = Rounding.builder(Rounding.DateTimeUnit.HOUR_OF_DAY).timeZone(cet).build(); - assertThat(tzRounding.round(time("2014-03-30T01:01:01", cet)), isDate(time("2014-03-30T01:00:00+01:00"), cet)); - assertThat(tzRounding.nextRoundingValue(time("2014-03-30T01:00:00", cet)), isDate(time("2014-03-30T03:00:00", cet), cet)); - assertThat(tzRounding.nextRoundingValue(time("2014-03-30T03:00:00", cet)), isDate(time("2014-03-30T04:00:00", cet), cet)); - - // testing non savings to savings switch (America/Chicago) - ZoneId chg = ZoneId.of("America/Chicago"); - Rounding tzRounding_utc = Rounding.builder(Rounding.DateTimeUnit.HOUR_OF_DAY) - .timeZone(ZoneOffset.UTC).build(); - assertThat(tzRounding.round(time("2014-03-09T03:01:01", chg)), isDate(time("2014-03-09T03:00:00", chg), chg)); - - Rounding tzRounding_chg = Rounding.builder(Rounding.DateTimeUnit.HOUR_OF_DAY).timeZone(chg).build(); - assertThat(tzRounding_chg.round(time("2014-03-09T03:01:01", chg)), isDate(time("2014-03-09T03:00:00", chg), chg)); - - // testing savings to non savings switch 2013 (America/Chicago) - assertThat(tzRounding_utc.round(time("2013-11-03T06:01:01", chg)), isDate(time("2013-11-03T06:00:00", chg), chg)); - assertThat(tzRounding_chg.round(time("2013-11-03T06:01:01", chg)), isDate(time("2013-11-03T06:00:00", chg), chg)); - - // testing savings to non savings switch 2014 (America/Chicago) - assertThat(tzRounding_utc.round(time("2014-11-02T06:01:01", chg)), isDate(time("2014-11-02T06:00:00", chg), chg)); - assertThat(tzRounding_chg.round(time("2014-11-02T06:01:01", chg)), isDate(time("2014-11-02T06:00:00", chg), chg)); - } - - public void testOffsetRounding() { - long twoHours = TimeUnit.HOURS.toMillis(2); - long oneDay = TimeUnit.DAYS.toMillis(1); - Rounding rounding = Rounding.builder(Rounding.DateTimeUnit.DAY_OF_MONTH).offset(twoHours).build(); - assertThat(rounding.round(0), equalTo(-oneDay + twoHours)); - assertThat(rounding.round(twoHours), equalTo(twoHours)); - assertThat(rounding.nextRoundingValue(-oneDay), equalTo(-oneDay + twoHours)); - assertThat(rounding.nextRoundingValue(0), equalTo(twoHours)); - assertThat(rounding.withoutOffset().round(0), equalTo(0L)); - assertThat(rounding.withoutOffset().nextRoundingValue(0), equalTo(oneDay)); - - rounding = Rounding.builder(Rounding.DateTimeUnit.DAY_OF_MONTH).offset(-twoHours).build(); - assertThat(rounding.round(0), equalTo(-twoHours)); - assertThat(rounding.round(oneDay - twoHours), equalTo(oneDay - twoHours)); - assertThat(rounding.nextRoundingValue(-oneDay), equalTo(-twoHours)); - assertThat(rounding.nextRoundingValue(0), equalTo(oneDay - twoHours)); - assertThat(rounding.withoutOffset().round(0), equalTo(0L)); - assertThat(rounding.withoutOffset().nextRoundingValue(0), equalTo(oneDay)); - - rounding = Rounding.builder(Rounding.DateTimeUnit.DAY_OF_MONTH).timeZone(ZoneId.of("America/New_York")).offset(-twoHours).build(); - assertThat(rounding.round(time("2020-11-01T09:00:00")), equalTo(time("2020-11-01T02:00:00"))); - } - - /** - * Randomized test on TimeUnitRounding. Test uses random - * {@link DateTimeUnit} and {@link ZoneId} and often (50% of the time) - * chooses test dates that are exactly on or close to offset changes (e.g. - * DST) in the chosen time zone. - * - * It rounds the test date down and up and performs various checks on the - * rounding unit interval that is defined by this. Assumptions tested are - * described in - * {@link #assertInterval(long, long, long, Rounding, ZoneId)} - */ - public void testRandomTimeUnitRounding() { - for (int i = 0; i < 1000; ++i) { - Rounding.DateTimeUnit unit = randomFrom(Rounding.DateTimeUnit.values()); - ZoneId tz = randomZone(); - long[] bounds = randomDateBounds(unit); - assertUnitRoundingSameAsJavaUtilTimeImplementation(unit, tz, bounds[0], bounds[1]); - } - } - - /** - * This test chooses a date in the middle of the transition, so that we can test - * if the transition which is before the minLookup, but still should be applied - * is not skipped - */ - public void testRoundingAroundDST() { - Rounding.DateTimeUnit unit = Rounding.DateTimeUnit.DAY_OF_MONTH; - ZoneId tz = ZoneId.of("Canada/Newfoundland"); - long minLookup = 688618001000L; // 1991-10-28T02:46:41.527Z - long maxLookup = 688618001001L; // +1sec - // there is a Transition[Overlap at 1991-10-27T00:01-02:30 to -03:30] ” - assertUnitRoundingSameAsJavaUtilTimeImplementation(unit, tz, minLookup, maxLookup); - } - - private void assertUnitRoundingSameAsJavaUtilTimeImplementation(Rounding.DateTimeUnit unit, ZoneId tz, long start, long end) { - Rounding rounding = new Rounding.TimeUnitRounding(unit, tz); - Rounding.Prepared prepared = rounding.prepare(start, end); - - // Check that rounding is internally consistent and consistent with nextRoundingValue - long date = dateBetween(start, end); - long unitMillis = unit.getField().getBaseUnit().getDuration().toMillis(); - // FIXME this was copy pasted from the other impl and not used. breaks the nasty date actually gets assigned - if (randomBoolean()) { - nastyDate(date, tz, unitMillis); - } - final long roundedDate = prepared.round(date); - final long nextRoundingValue = prepared.nextRoundingValue(roundedDate); - - assertInterval(roundedDate, date, nextRoundingValue, rounding, tz); - - // check correct unit interval width for units smaller than a day, they should be fixed size except for transitions - if (unitMillis <= 86400 * 1000) { - // if the interval defined didn't cross timezone offset transition, it should cover unitMillis width - int offsetRounded = tz.getRules().getOffset(Instant.ofEpochMilli(roundedDate - 1)).getTotalSeconds(); - int offsetNextValue = tz.getRules().getOffset(Instant.ofEpochMilli(nextRoundingValue + 1)).getTotalSeconds(); - if (offsetRounded == offsetNextValue) { - assertThat("unit interval width not as expected for [" + unit + "], [" + tz + "] at " - + Instant.ofEpochMilli(roundedDate), nextRoundingValue - roundedDate, equalTo(unitMillis)); - } - } - - // Round a whole bunch of dates and make sure they line up with the known good java time implementation - Rounding.Prepared javaTimeRounding = rounding.prepareJavaTime(); - for (int d = 0; d < 1000; d++) { - date = dateBetween(start, end); - long javaRounded = javaTimeRounding.round(date); - long esRounded = prepared.round(date); - if (javaRounded != esRounded) { - fail("Expected [" + rounding + "] to round [" + Instant.ofEpochMilli(date) + "] to [" - + Instant.ofEpochMilli(javaRounded) + "] but instead rounded to [" + Instant.ofEpochMilli(esRounded) + "]"); - } - long javaNextRoundingValue = javaTimeRounding.nextRoundingValue(date); - long esNextRoundingValue = prepared.nextRoundingValue(date); - if (javaNextRoundingValue != esNextRoundingValue) { - fail("Expected [" + rounding + "] to round [" + Instant.ofEpochMilli(date) + "] to [" - + Instant.ofEpochMilli(esRounded) + "] and nextRoundingValue to be [" - + Instant.ofEpochMilli(javaNextRoundingValue) + "] but instead was to [" - + Instant.ofEpochMilli(esNextRoundingValue) + "]"); - } - } - } - - /** - * To be even more nasty, go to a transition in the selected time zone. - * In one third of the cases stay there, otherwise go half a unit back or forth - */ - private static long nastyDate(long initialDate, ZoneId timezone, long unitMillis) { - ZoneOffsetTransition transition = timezone.getRules().nextTransition(Instant.ofEpochMilli(initialDate)); - long date = initialDate; - if (transition != null) { - date = transition.getInstant().toEpochMilli(); - } - if (randomBoolean()) { - return date + (randomLong() % unitMillis); // positive and negative offset possible - } else { - return date; - } - } - - /** - * test DST end with interval rounding - * CET: 25 October 2015, 03:00:00 clocks were turned backward 1 hour to 25 October 2015, 02:00:00 local standard time - */ - public void testTimeIntervalCET_DST_End() { - long interval = TimeUnit.MINUTES.toMillis(20); - ZoneId tz = ZoneId.of("CET"); - Rounding rounding = new Rounding.TimeIntervalRounding(interval, tz); - - assertThat(rounding.round(time("2015-10-25T01:55:00+02:00")), isDate(time("2015-10-25T01:40:00+02:00"), tz)); - assertThat(rounding.round(time("2015-10-25T02:15:00+02:00")), isDate(time("2015-10-25T02:00:00+02:00"), tz)); - assertThat(rounding.round(time("2015-10-25T02:35:00+02:00")), isDate(time("2015-10-25T02:20:00+02:00"), tz)); - assertThat(rounding.round(time("2015-10-25T02:55:00+02:00")), isDate(time("2015-10-25T02:40:00+02:00"), tz)); - // after DST shift - assertThat(rounding.round(time("2015-10-25T02:15:00+01:00")), isDate(time("2015-10-25T02:00:00+01:00"), tz)); - assertThat(rounding.round(time("2015-10-25T02:35:00+01:00")), isDate(time("2015-10-25T02:20:00+01:00"), tz)); - assertThat(rounding.round(time("2015-10-25T02:55:00+01:00")), isDate(time("2015-10-25T02:40:00+01:00"), tz)); - assertThat(rounding.round(time("2015-10-25T03:15:00+01:00")), isDate(time("2015-10-25T03:00:00+01:00"), tz)); - } - - /** - * test DST start with interval rounding - * CET: 27 March 2016, 02:00:00 clocks were turned forward 1 hour to 27 March 2016, 03:00:00 local daylight time - */ - public void testTimeIntervalCET_DST_Start() { - long interval = TimeUnit.MINUTES.toMillis(20); - ZoneId tz = ZoneId.of("CET"); - Rounding rounding = new Rounding.TimeIntervalRounding(interval, tz); - // test DST start - assertThat(rounding.round(time("2016-03-27T01:55:00+01:00")), isDate(time("2016-03-27T01:40:00+01:00"), tz)); - assertThat(rounding.round(time("2016-03-27T02:00:00+01:00")), isDate(time("2016-03-27T03:00:00+02:00"), tz)); - assertThat(rounding.round(time("2016-03-27T03:15:00+02:00")), isDate(time("2016-03-27T03:00:00+02:00"), tz)); - assertThat(rounding.round(time("2016-03-27T03:35:00+02:00")), isDate(time("2016-03-27T03:20:00+02:00"), tz)); - } - - /** - * test DST start with offset not fitting interval, e.g. Asia/Kathmandu - * adding 15min on 1986-01-01T00:00:00 the interval from - * 1986-01-01T00:15:00+05:45 to 1986-01-01T00:20:00+05:45 to only be 5min - * long - */ - public void testTimeInterval_Kathmandu_DST_Start() { - long interval = TimeUnit.MINUTES.toMillis(20); - ZoneId tz = ZoneId.of("Asia/Kathmandu"); - Rounding rounding = new Rounding.TimeIntervalRounding(interval, tz); - assertThat(rounding.round(time("1985-12-31T23:55:00+05:30")), isDate(time("1985-12-31T23:40:00+05:30"), tz)); - assertThat(rounding.round(time("1986-01-01T00:16:00+05:45")), isDate(time("1986-01-01T00:15:00+05:45"), tz)); - assertThat(time("1986-01-01T00:15:00+05:45") - time("1985-12-31T23:40:00+05:30"), equalTo(TimeUnit.MINUTES.toMillis(20))); - assertThat(rounding.round(time("1986-01-01T00:26:00+05:45")), isDate(time("1986-01-01T00:20:00+05:45"), tz)); - assertThat(time("1986-01-01T00:20:00+05:45") - time("1986-01-01T00:15:00+05:45"), equalTo(TimeUnit.MINUTES.toMillis(5))); - assertThat(rounding.round(time("1986-01-01T00:46:00+05:45")), isDate(time("1986-01-01T00:40:00+05:45"), tz)); - assertThat(time("1986-01-01T00:40:00+05:45") - time("1986-01-01T00:20:00+05:45"), equalTo(TimeUnit.MINUTES.toMillis(20))); - } - - /** - * Special test for intervals that don't fit evenly into rounding interval. - * In this case, when interval crosses DST transition point, rounding in local - * time can land in a DST gap which results in wrong UTC rounding values. - */ - public void testIntervalRounding_NotDivisibleInteval() { - long interval = TimeUnit.MINUTES.toMillis(14); - ZoneId tz = ZoneId.of("CET"); - Rounding rounding = new Rounding.TimeIntervalRounding(interval, tz); - - assertThat(rounding.round(time("2016-03-27T01:41:00+01:00")), isDate(time("2016-03-27T01:30:00+01:00"), tz)); - assertThat(rounding.round(time("2016-03-27T01:51:00+01:00")), isDate(time("2016-03-27T01:44:00+01:00"), tz)); - assertThat(rounding.round(time("2016-03-27T01:59:00+01:00")), isDate(time("2016-03-27T01:58:00+01:00"), tz)); - assertThat(rounding.round(time("2016-03-27T03:05:00+02:00")), isDate(time("2016-03-27T03:00:00+02:00"), tz)); - assertThat(rounding.round(time("2016-03-27T03:12:00+02:00")), isDate(time("2016-03-27T03:08:00+02:00"), tz)); - assertThat(rounding.round(time("2016-03-27T03:25:00+02:00")), isDate(time("2016-03-27T03:22:00+02:00"), tz)); - assertThat(rounding.round(time("2016-03-27T03:39:00+02:00")), isDate(time("2016-03-27T03:36:00+02:00"), tz)); - } - - /** - * Test for half day rounding intervals scrossing DST. - */ - public void testIntervalRounding_HalfDay_DST() { - long interval = TimeUnit.HOURS.toMillis(12); - ZoneId tz = ZoneId.of("CET"); - Rounding rounding = new Rounding.TimeIntervalRounding(interval, tz); - - assertThat(rounding.round(time("2016-03-26T01:00:00+01:00")), isDate(time("2016-03-26T00:00:00+01:00"), tz)); - assertThat(rounding.round(time("2016-03-26T13:00:00+01:00")), isDate(time("2016-03-26T12:00:00+01:00"), tz)); - assertThat(rounding.round(time("2016-03-27T01:00:00+01:00")), isDate(time("2016-03-27T00:00:00+01:00"), tz)); - assertThat(rounding.round(time("2016-03-27T13:00:00+02:00")), isDate(time("2016-03-27T12:00:00+02:00"), tz)); - assertThat(rounding.round(time("2016-03-28T01:00:00+02:00")), isDate(time("2016-03-28T00:00:00+02:00"), tz)); - assertThat(rounding.round(time("2016-03-28T13:00:00+02:00")), isDate(time("2016-03-28T12:00:00+02:00"), tz)); - } - - public void testRandomTimeIntervalRounding() { - for (int i = 0; i < 1000; i++) { - int unitCount = randomIntBetween(1, 365); - TimeUnit unit = randomFrom(TimeUnit.MINUTES, TimeUnit.HOURS, TimeUnit.DAYS); - long interval = unit.toMillis(unitCount); - ZoneId tz = randomZone(); - Rounding rounding = new Rounding.TimeIntervalRounding(interval, tz); - long mainDate = randomDate(); - if (randomBoolean()) { - mainDate = nastyDate(mainDate, tz, interval); - } - long min = mainDate - 2 * interval; - long max = mainDate + 2 * interval; - - /* - * Prepare a rounding with two extra intervals of range because - * in the tests far below we call round(round(min) - 1). The first - * round might spit out a time below min - interval if min is near - * a daylight savings time transition. So we request an extra big - * range just in case. - */ - Rounding.Prepared prepared = rounding.prepare(min - 2 * interval, max); - - // Round a whole bunch of dates and make sure they line up with the known good java time implementation - Rounding.Prepared javaTimeRounding = rounding.prepareJavaTime(); - for (int d = 0; d < 1000; d++) { - long date = dateBetween(min, max); - long javaRounded = javaTimeRounding.round(date); - long esRounded = prepared.round(date); - if (javaRounded != esRounded) { - fail("Expected [" + unitCount + " " + unit + " in " + tz + "] to round [" + Instant.ofEpochMilli(date) + "] to [" - + Instant.ofEpochMilli(javaRounded) + "] but instead rounded to [" + Instant.ofEpochMilli(esRounded) + "]"); - } - long javaNextRoundingValue = javaTimeRounding.nextRoundingValue(date); - long esNextRoundingValue = prepared.nextRoundingValue(date); - if (javaNextRoundingValue != esNextRoundingValue) { - fail("Expected [" + unitCount + " " + unit + " in " + tz + "] to round [" + Instant.ofEpochMilli(date) + "] to [" - + Instant.ofEpochMilli(esRounded) + "] and nextRoundingValue to be [" - + Instant.ofEpochMilli(javaNextRoundingValue) + "] but instead was to [" - + Instant.ofEpochMilli(esNextRoundingValue) + "]"); - } - } - - // check two intervals around date - long previousRoundedValue = Long.MIN_VALUE; - for (long date = min; date < max; date += interval / 2) { - try { - final long roundedDate = rounding.round(date); - final long nextRoundingValue = prepared.nextRoundingValue(roundedDate); - assertThat("Rounding should be idempotent", roundedDate, equalTo(prepared.round(roundedDate))); - assertThat("Rounded value smaller or equal than unrounded", roundedDate, lessThanOrEqualTo(date)); - assertThat("Values smaller than rounded value should round further down", prepared.round(roundedDate - 1), - lessThan(roundedDate)); - assertThat("Rounding should be >= previous rounding value", roundedDate, greaterThanOrEqualTo(previousRoundedValue)); - assertThat("NextRounding value should be greater than date", nextRoundingValue, greaterThan(roundedDate)); - assertThat("NextRounding value rounds to itself", nextRoundingValue, - isDate(rounding.round(nextRoundingValue), tz)); - - if (tz.getRules().isFixedOffset()) { - assertThat("NextRounding value should be interval from rounded value", nextRoundingValue - roundedDate, - equalTo(interval)); - } - previousRoundedValue = roundedDate; - } catch (AssertionError e) { - ZonedDateTime dateTime = ZonedDateTime.ofInstant(Instant.ofEpochMilli(date), tz); - ZonedDateTime previousRoundedValueDate = ZonedDateTime.ofInstant(Instant.ofEpochMilli(previousRoundedValue), tz); - logger.error("Rounding error at {}/{}, timezone {}, interval: {} previousRoundedValue {}/{}", dateTime, date, - tz, interval, previousRoundedValueDate, previousRoundedValue); - throw e; - } - } - } - } - - /** - * Check a {@link Rounding.Prepared#nextRoundingValue} that was difficult - * to build well with the java.time APIs. - */ - public void testHardNextRoundingValue() { - Rounding rounding = new Rounding.TimeIntervalRounding(960000, ZoneId.of("Europe/Minsk")); - long rounded = rounding.prepareForUnknown().round(877824908400L); - long next = rounding.prepareForUnknown().nextRoundingValue(rounded); - assertThat(next, greaterThan(rounded)); - } - - /** - * Check a {@link Rounding.Prepared#nextRoundingValue} that was difficult - * to build well with the java.time APIs. - */ - public void testOtherHardNextRoundingValue() { - Rounding rounding = new Rounding.TimeIntervalRounding(480000, ZoneId.of("Portugal")); - long rounded = rounding.prepareJavaTime().round(972780720000L); - long next = rounding.prepareJavaTime().nextRoundingValue(rounded); - assertThat(next, greaterThan(rounded)); - } - - /** - * Check a {@link Rounding.Prepared#nextRoundingValue} that was difficult - * to build well our janky Newton's Method/binary search hybrid. - */ - public void testHardNewtonsMethod() { - ZoneId tz = ZoneId.of("Asia/Jerusalem"); - Rounding rounding = new Rounding.TimeIntervalRounding(19800000, tz); - assertThat(rounding.prepareJavaTime().nextRoundingValue(1824929914182L), isDate(time("2027-10-31T01:30:00", tz), tz)); - } - - /** - * Check a {@link Rounding.Prepared#nextRoundingValue} that was difficult - * to build well with the java.time APIs. - */ - public void testOtherHardNewtonsMethod() { - ZoneId tz = ZoneId.of("America/Glace_Bay"); - Rounding rounding = new Rounding.TimeIntervalRounding(13800000, tz); - assertThat(rounding.prepareJavaTime().nextRoundingValue(1383463147373L), isDate(time("2013-11-03T03:40:00", tz), tz)); - } - - /** - * Test that rounded values are always greater or equal to last rounded value if date is increasing. - * The example covers an interval around 2011-10-30T02:10:00+01:00, time zone CET, interval: 2700000ms - */ - public void testIntervalRoundingMonotonic_CET() { - long interval = TimeUnit.MINUTES.toMillis(45); - ZoneId tz = ZoneId.of("CET"); - Rounding rounding = new Rounding.TimeIntervalRounding(interval, tz); - List> expectedDates = new ArrayList<>(); - // first date is the date to be rounded, second the expected result - expectedDates.add(new Tuple<>("2011-10-30T01:40:00.000+02:00", "2011-10-30T01:30:00.000+02:00")); - expectedDates.add(new Tuple<>("2011-10-30T02:02:30.000+02:00", "2011-10-30T01:30:00.000+02:00")); - expectedDates.add(new Tuple<>("2011-10-30T02:25:00.000+02:00", "2011-10-30T02:15:00.000+02:00")); - expectedDates.add(new Tuple<>("2011-10-30T02:47:30.000+02:00", "2011-10-30T02:15:00.000+02:00")); - expectedDates.add(new Tuple<>("2011-10-30T02:10:00.000+01:00", "2011-10-30T02:15:00.000+02:00")); - expectedDates.add(new Tuple<>("2011-10-30T02:32:30.000+01:00", "2011-10-30T02:15:00.000+01:00")); - expectedDates.add(new Tuple<>("2011-10-30T02:55:00.000+01:00", "2011-10-30T02:15:00.000+01:00")); - expectedDates.add(new Tuple<>("2011-10-30T03:17:30.000+01:00", "2011-10-30T03:00:00.000+01:00")); - - long previousDate = Long.MIN_VALUE; - for (Tuple dates : expectedDates) { - final long roundedDate = rounding.round(time(dates.v1())); - assertThat(dates.toString(), roundedDate, isDate(time(dates.v2()), tz)); - assertThat(dates.toString(), roundedDate, greaterThanOrEqualTo(previousDate)); - previousDate = roundedDate; - } - // here's what this means for interval widths - assertEquals(TimeUnit.MINUTES.toMillis(45), time("2011-10-30T02:15:00.000+02:00") - time("2011-10-30T01:30:00.000+02:00")); - assertEquals(TimeUnit.MINUTES.toMillis(60), time("2011-10-30T02:15:00.000+01:00") - time("2011-10-30T02:15:00.000+02:00")); - assertEquals(TimeUnit.MINUTES.toMillis(45), time("2011-10-30T03:00:00.000+01:00") - time("2011-10-30T02:15:00.000+01:00")); - } - - /** - * special test for DST switch from #9491 - */ - public void testAmbiguousHoursAfterDSTSwitch() { - Rounding tzRounding; - final ZoneId tz = ZoneId.of("Asia/Jerusalem"); - tzRounding = Rounding.builder(Rounding.DateTimeUnit.HOUR_OF_DAY).timeZone(tz).build(); - assertThat(tzRounding.round(time("2014-10-26T00:30:00+03:00")), isDate(time("2014-10-26T00:00:00+03:00"), tz)); - assertThat(tzRounding.round(time("2014-10-26T01:30:00+03:00")), isDate(time("2014-10-26T01:00:00+03:00"), tz)); - // the utc date for "2014-10-25T03:00:00+03:00" and "2014-10-25T03:00:00+02:00" is the same, local time turns back 1h here - assertThat(time("2014-10-26T03:00:00+03:00"), isDate(time("2014-10-26T02:00:00+02:00"), tz)); - assertThat(tzRounding.round(time("2014-10-26T01:30:00+02:00")), isDate(time("2014-10-26T01:00:00+02:00"), tz)); - assertThat(tzRounding.round(time("2014-10-26T02:30:00+02:00")), isDate(time("2014-10-26T02:00:00+02:00"), tz)); - - // Day interval - tzRounding = Rounding.builder(Rounding.DateTimeUnit.DAY_OF_MONTH).timeZone(tz).build(); - assertThat(tzRounding.round(time("2014-11-11T17:00:00", tz)), isDate(time("2014-11-11T00:00:00", tz), tz)); - // DST on - assertThat(tzRounding.round(time("2014-08-11T17:00:00", tz)), isDate(time("2014-08-11T00:00:00", tz), tz)); - // Day of switching DST on -> off - assertThat(tzRounding.round(time("2014-10-26T17:00:00", tz)), isDate(time("2014-10-26T00:00:00", tz), tz)); - // Day of switching DST off -> on - assertThat(tzRounding.round(time("2015-03-27T17:00:00", tz)), isDate(time("2015-03-27T00:00:00", tz), tz)); - - // Month interval - tzRounding = Rounding.builder(Rounding.DateTimeUnit.MONTH_OF_YEAR).timeZone(tz).build(); - assertThat(tzRounding.round(time("2014-11-11T17:00:00", tz)), isDate(time("2014-11-01T00:00:00", tz), tz)); - // DST on - assertThat(tzRounding.round(time("2014-10-10T17:00:00", tz)), isDate(time("2014-10-01T00:00:00", tz), tz)); - - // Year interval - tzRounding = Rounding.builder(Rounding.DateTimeUnit.YEAR_OF_CENTURY).timeZone(tz).build(); - assertThat(tzRounding.round(time("2014-11-11T17:00:00", tz)), isDate(time("2014-01-01T00:00:00", tz), tz)); - - // Two timestamps in same year and different timezone offset ("Double buckets" issue - #9491) - tzRounding = Rounding.builder(Rounding.DateTimeUnit.YEAR_OF_CENTURY).timeZone(tz).build(); - assertThat(tzRounding.round(time("2014-11-11T17:00:00", tz)), - isDate(tzRounding.round(time("2014-08-11T17:00:00", tz)), tz)); - } - - /** - * test for #10025, strict local to UTC conversion can cause joda exceptions - * on DST start - */ - public void testLenientConversionDST() { - ZoneId tz = ZoneId.of("America/Sao_Paulo"); - - long start = time("2014-10-18T20:50:00.000", tz); - long end = time("2014-10-19T01:00:00.000", tz); - Rounding tzRounding = new Rounding.TimeUnitRounding(Rounding.DateTimeUnit.MINUTES_OF_HOUR, tz); - Rounding dayTzRounding = new Rounding.TimeIntervalRounding(60000, tz); - for (long time = start; time < end; time = time + 60000) { - assertThat(tzRounding.nextRoundingValue(time), greaterThan(time)); - assertThat(dayTzRounding.nextRoundingValue(time), greaterThan(time)); - } - } - - public void testEdgeCasesTransition() { - { - // standard +/-1 hour DST transition, CET - ZoneId tz = ZoneId.of("CET"); - Rounding rounding = new Rounding.TimeUnitRounding(Rounding.DateTimeUnit.HOUR_OF_DAY, tz); - - // 29 Mar 2015 - Daylight Saving Time Started - // at 02:00:00 clocks were turned forward 1 hour to 03:00:00 - assertInterval(time("2015-03-29T00:00:00.000+01:00"), time("2015-03-29T01:00:00.000+01:00"), rounding, 60, tz); - assertInterval(time("2015-03-29T01:00:00.000+01:00"), time("2015-03-29T03:00:00.000+02:00"), rounding, 60, tz); - assertInterval(time("2015-03-29T03:00:00.000+02:00"), time("2015-03-29T04:00:00.000+02:00"), rounding, 60, tz); - - // 25 Oct 2015 - Daylight Saving Time Ended - // at 03:00:00 clocks were turned backward 1 hour to 02:00:00 - assertInterval(time("2015-10-25T01:00:00.000+02:00"), time("2015-10-25T02:00:00.000+02:00"), rounding, 60, tz); - assertInterval(time("2015-10-25T02:00:00.000+02:00"), time("2015-10-25T02:00:00.000+01:00"), rounding, 60, tz); - assertInterval(time("2015-10-25T02:00:00.000+01:00"), time("2015-10-25T03:00:00.000+01:00"), rounding, 60, tz); - } - - { - // time zone "Asia/Kathmandu" - // 1 Jan 1986 - Time Zone Change (IST → NPT), at 00:00:00 clocks were turned forward 00:15 minutes - // - // hour rounding is stable before 1985-12-31T23:00:00.000 and after 1986-01-01T01:00:00.000+05:45 - // the interval between is 105 minutes long because the hour after transition starts at 00:15 - // which is not a round value for hourly rounding - ZoneId tz = ZoneId.of("Asia/Kathmandu"); - Rounding rounding = new Rounding.TimeUnitRounding(Rounding.DateTimeUnit.HOUR_OF_DAY, tz); - - assertInterval(time("1985-12-31T22:00:00.000+05:30"), time("1985-12-31T23:00:00.000+05:30"), rounding, 60, tz); - assertInterval(time("1985-12-31T23:00:00.000+05:30"), time("1986-01-01T01:00:00.000+05:45"), rounding, 105, tz); - assertInterval(time("1986-01-01T01:00:00.000+05:45"), time("1986-01-01T02:00:00.000+05:45"), rounding, 60, tz); - } - - { - // time zone "Australia/Lord_Howe" - // 3 Mar 1991 - Daylight Saving Time Ended - // at 02:00:00 clocks were turned backward 0:30 hours to Sunday, 3 March 1991, 01:30:00 - ZoneId tz = ZoneId.of("Australia/Lord_Howe"); - Rounding rounding = new Rounding.TimeUnitRounding(Rounding.DateTimeUnit.HOUR_OF_DAY, tz); - - assertInterval(time("1991-03-03T00:00:00.000+11:00"), time("1991-03-03T01:00:00.000+11:00"), rounding, 60, tz); - assertInterval(time("1991-03-03T01:00:00.000+11:00"), time("1991-03-03T02:00:00.000+10:30"), rounding, 90, tz); - assertInterval(time("1991-03-03T02:00:00.000+10:30"), time("1991-03-03T03:00:00.000+10:30"), rounding, 60, tz); - - // 27 Oct 1991 - Daylight Saving Time Started - // at 02:00:00 clocks were turned forward 0:30 hours to 02:30:00 - assertInterval(time("1991-10-27T00:00:00.000+10:30"), time("1991-10-27T01:00:00.000+10:30"), rounding, 60, tz); - // the interval containing the switch time is 90 minutes long - assertInterval(time("1991-10-27T01:00:00.000+10:30"), time("1991-10-27T03:00:00.000+11:00"), rounding, 90, tz); - assertInterval(time("1991-10-27T03:00:00.000+11:00"), time("1991-10-27T04:00:00.000+11:00"), rounding, 60, tz); - } - - { - // time zone "Pacific/Chatham" - // 5 Apr 2015 - Daylight Saving Time Ended - // at 03:45:00 clocks were turned backward 1 hour to 02:45:00 - ZoneId tz = ZoneId.of("Pacific/Chatham"); - Rounding rounding = new Rounding.TimeUnitRounding(Rounding.DateTimeUnit.HOUR_OF_DAY, tz); - - assertInterval(time("2015-04-05T02:00:00.000+13:45"), time("2015-04-05T03:00:00.000+13:45"), rounding, 60, tz); - assertInterval(time("2015-04-05T03:00:00.000+13:45"), time("2015-04-05T03:00:00.000+12:45"), rounding, 60, tz); - assertInterval(time("2015-04-05T03:00:00.000+12:45"), time("2015-04-05T04:00:00.000+12:45"), rounding, 60, tz); - - // 27 Sep 2015 - Daylight Saving Time Started - // at 02:45:00 clocks were turned forward 1 hour to 03:45:00 - - assertInterval(time("2015-09-27T01:00:00.000+12:45"), time("2015-09-27T02:00:00.000+12:45"), rounding, 60, tz); - assertInterval(time("2015-09-27T02:00:00.000+12:45"), time("2015-09-27T04:00:00.000+13:45"), rounding, 60, tz); - assertInterval(time("2015-09-27T04:00:00.000+13:45"), time("2015-09-27T05:00:00.000+13:45"), rounding, 60, tz); - } - } - - public void testDST_Europe_Rome() { - // time zone "Europe/Rome", rounding to days. Rome had two midnights on the day the clocks went back in 1978, and - // timeZone.convertLocalToUTC() gives the later of the two because Rome is east of UTC, whereas we want the earlier. - - ZoneId tz = ZoneId.of("Europe/Rome"); - Rounding rounding = new Rounding.TimeUnitRounding(Rounding.DateTimeUnit.DAY_OF_MONTH, tz); - - { - long timeBeforeFirstMidnight = time("1978-09-30T23:59:00+02:00"); - long floor = rounding.round(timeBeforeFirstMidnight); - assertThat(floor, isDate(time("1978-09-30T00:00:00+02:00"), tz)); - } - - { - long timeBetweenMidnights = time("1978-10-01T00:30:00+02:00"); - long floor = rounding.round(timeBetweenMidnights); - assertThat(floor, isDate(time("1978-10-01T00:00:00+02:00"), tz)); - } - - { - long timeAfterSecondMidnight = time("1978-10-01T00:30:00+01:00"); - long floor = rounding.round(timeAfterSecondMidnight); - assertThat(floor, isDate(time("1978-10-01T00:00:00+02:00"), tz)); - - long prevFloor = rounding.round(floor - 1); - assertThat(prevFloor, lessThan(floor)); - assertThat(prevFloor, isDate(time("1978-09-30T00:00:00+02:00"), tz)); - } - } - - /** - * Test for a time zone whose days overlap because the clocks are set back across midnight at the end of DST. - */ - public void testDST_America_St_Johns() { - // time zone "America/St_Johns", rounding to days. - ZoneId tz = ZoneId.of("America/St_Johns"); - Rounding rounding = new Rounding.TimeUnitRounding(Rounding.DateTimeUnit.DAY_OF_MONTH, tz); - - // 29 October 2006 - Daylight Saving Time ended, changing the UTC offset from -02:30 to -03:30. - // This happened at 02:31 UTC, 00:01 local time, so the clocks were set back 1 hour to 23:01 on the 28th. - // This means that 2006-10-29 has _two_ midnights, one in the -02:30 offset and one in the -03:30 offset. - // Only the first of these is considered "rounded". Moreover, the extra time between 23:01 and 23:59 - // should be considered as part of the 28th even though it comes after midnight on the 29th. - - { - // Times before the first midnight should be rounded up to the first midnight. - long timeBeforeFirstMidnight = time("2006-10-28T23:30:00.000-02:30"); - long floor = rounding.round(timeBeforeFirstMidnight); - assertThat(floor, isDate(time("2006-10-28T00:00:00.000-02:30"), tz)); - long ceiling = rounding.nextRoundingValue(timeBeforeFirstMidnight); - assertThat(ceiling, isDate(time("2006-10-29T00:00:00.000-02:30"), tz)); - assertInterval(floor, timeBeforeFirstMidnight, ceiling, rounding, tz); - } - - { - // Times between the two midnights which are on the later day should be rounded down to the later day's midnight. - long timeBetweenMidnights = time("2006-10-29T00:00:30.000-02:30"); - // (this is halfway through the last minute before the clocks changed, in which local time was ambiguous) - - long floor = rounding.round(timeBetweenMidnights); - assertThat(floor, isDate(time("2006-10-29T00:00:00.000-02:30"), tz)); - - long ceiling = rounding.nextRoundingValue(timeBetweenMidnights); - assertThat(ceiling, isDate(time("2006-10-30T00:00:00.000-03:30"), tz)); - - assertInterval(floor, timeBetweenMidnights, ceiling, rounding, tz); - } - - { - // Times between the two midnights which are on the earlier day should be rounded down to the earlier day's midnight. - long timeBetweenMidnights = time("2006-10-28T23:30:00.000-03:30"); - // (this is halfway through the hour after the clocks changed, in which local time was ambiguous) - - long floor = rounding.round(timeBetweenMidnights); - assertThat(floor, isDate(time("2006-10-28T00:00:00.000-02:30"), tz)); - - long ceiling = rounding.nextRoundingValue(timeBetweenMidnights); - assertThat(ceiling, isDate(time("2006-10-29T00:00:00.000-02:30"), tz)); - - assertInterval(floor, timeBetweenMidnights, ceiling, rounding, tz); - } - - { - // Times after the second midnight should be rounded down to the first midnight. - long timeAfterSecondMidnight = time("2006-10-29T06:00:00.000-03:30"); - long floor = rounding.round(timeAfterSecondMidnight); - assertThat(floor, isDate(time("2006-10-29T00:00:00.000-02:30"), tz)); - long ceiling = rounding.nextRoundingValue(timeAfterSecondMidnight); - assertThat(ceiling, isDate(time("2006-10-30T00:00:00.000-03:30"), tz)); - assertInterval(floor, timeAfterSecondMidnight, ceiling, rounding, tz); - } - } - - /** - * Tests for DST transitions that cause the rounding to jump "backwards" because they round - * from one back to the previous day. Usually these rounding start before - */ - public void testForwardsBackwardsTimeZones() { - for (String zoneId : JAVA_ZONE_IDS) { - ZoneId tz = ZoneId.of(zoneId); - ZoneRules rules = tz.getRules(); - for (ZoneOffsetTransition transition : rules.getTransitions()) { - checkForForwardsBackwardsTransition(tz, transition); - } - int firstYear; - if (rules.getTransitions().isEmpty()) { - // Pick an arbitrary year to start the range - firstYear = 1999; - } else { - ZoneOffsetTransition lastTransition = rules.getTransitions().get(rules.getTransitions().size() - 1); - firstYear = lastTransition.getDateTimeAfter().getYear() + 1; - } - // Pick an arbitrary year to end the range too - int lastYear = 2050; - int year = randomFrom(firstYear, lastYear); - for (ZoneOffsetTransitionRule transitionRule : rules.getTransitionRules()) { - ZoneOffsetTransition transition = transitionRule.createTransition(year); - checkForForwardsBackwardsTransition(tz, transition); - } - } - } - - private void checkForForwardsBackwardsTransition(ZoneId tz, ZoneOffsetTransition transition) { - if (transition.getDateTimeBefore().getYear() < 1950) { - // We don't support transitions far in the past at all - return; - } - if (false == transition.isOverlap()) { - // Only overlaps cause the array rounding to have trouble - return; - } - if (transition.getDateTimeBefore().getDayOfMonth() == transition.getDateTimeAfter().getDayOfMonth()) { - // Only when the rounding changes the day - return; - } - if (transition.getDateTimeBefore().getMinute() == 0) { - // But roundings that change *at* midnight are safe because they don't "jump" to the next day. - return; - } - logger.info( - "{} from {}{} to {}{}", - tz, - transition.getDateTimeBefore(), - transition.getOffsetBefore(), - transition.getDateTimeAfter(), - transition.getOffsetAfter() - ); - long millisSinceEpoch = TimeUnit.SECONDS.toMillis(transition.toEpochSecond()); - long twoHours = TimeUnit.HOURS.toMillis(2); - assertUnitRoundingSameAsJavaUtilTimeImplementation( - Rounding.DateTimeUnit.DAY_OF_MONTH, - tz, - millisSinceEpoch - twoHours, - millisSinceEpoch + twoHours - ); - } - - /** - * tests for dst transition with overlaps and day roundings. - */ - public void testDST_END_Edgecases() { - // First case, dst happens at 1am local time, switching back one hour. - // We want the overlapping hour to count for the next day, making it a 25h interval - - ZoneId tz = ZoneId.of("Atlantic/Azores"); - Rounding.DateTimeUnit timeUnit = Rounding.DateTimeUnit.DAY_OF_MONTH; - Rounding rounding = new Rounding.TimeUnitRounding(timeUnit, tz); - - // Sunday, 29 October 2000, 01:00:00 clocks were turned backward 1 hour - // to Sunday, 29 October 2000, 00:00:00 local standard time instead - // which means there were two midnights that day. - - long midnightBeforeTransition = time("2000-10-29T00:00:00", tz); - long midnightOfTransition = time("2000-10-29T00:00:00-01:00"); - assertEquals(60L * 60L * 1000L, midnightOfTransition - midnightBeforeTransition); - long nextMidnight = time("2000-10-30T00:00:00", tz); - - assertInterval(midnightBeforeTransition, nextMidnight, rounding, 25 * 60, tz); - - assertThat(rounding.round(time("2000-10-29T06:00:00-01:00")), isDate(time("2000-10-29T00:00:00Z"), tz)); - - // Second case, dst happens at 0am local time, switching back one hour to 23pm local time. - // We want the overlapping hour to count for the previous day here - - tz = ZoneId.of("America/Lima"); - rounding = new Rounding.TimeUnitRounding(timeUnit, tz); - - // Sunday, 1 April 1990, 00:00:00 clocks were turned backward 1 hour to - // Saturday, 31 March 1990, 23:00:00 local standard time instead - - midnightBeforeTransition = time("1990-03-31T00:00:00.000-04:00"); - nextMidnight = time("1990-04-01T00:00:00.000-05:00"); - assertInterval(midnightBeforeTransition, nextMidnight, rounding, 25 * 60, tz); - - // make sure the next interval is 24h long again - long midnightAfterTransition = time("1990-04-01T00:00:00.000-05:00"); - nextMidnight = time("1990-04-02T00:00:00.000-05:00"); - assertInterval(midnightAfterTransition, nextMidnight, rounding, 24 * 60, tz); - } - - public void testBeforeOverlapLarge() { - // Moncton has a perfectly normal hour long Daylight Savings time. - ZoneId tz = ZoneId.of("America/Moncton"); - Rounding rounding = Rounding.builder(Rounding.DateTimeUnit.HOUR_OF_DAY).timeZone(tz).build(); - assertThat(rounding.round(time("2003-10-26T03:43:35.079Z")), isDate(time("2003-10-26T03:00:00Z"), tz)); - } - - public void testBeforeOverlapSmall() { - /* - * Lord Howe is fun because Daylight Savings time is only 30 minutes - * so we round HOUR_OF_DAY differently. - */ - ZoneId tz = ZoneId.of("Australia/Lord_Howe"); - Rounding rounding = Rounding.builder(Rounding.DateTimeUnit.HOUR_OF_DAY).timeZone(tz).build(); - assertThat(rounding.round(time("2018-03-31T15:25:15.148Z")), isDate(time("2018-03-31T14:00:00Z"), tz)); - } - - public void testQuarterOfYear() { - /* - * If we're not careful with how we look up local time offsets we can - * end up not loading the offsets far enough back to round this time - * to QUARTER_OF_YEAR properly. - */ - ZoneId tz = ZoneId.of("Asia/Baghdad"); - Rounding rounding = Rounding.builder(Rounding.DateTimeUnit.QUARTER_OF_YEAR).timeZone(tz).build(); - assertThat(rounding.round(time("2006-12-31T13:21:44.308Z")), isDate(time("2006-09-30T20:00:00Z"), tz)); - } - - public void testPrepareLongRangeRoundsToMidnight() { - ZoneId tz = ZoneId.of("America/New_York"); - long min = time("01980-01-01T00:00:00Z"); - long max = time("10000-01-01T00:00:00Z"); - Rounding rounding = Rounding.builder(Rounding.DateTimeUnit.QUARTER_OF_YEAR).timeZone(tz).build(); - assertThat(rounding.round(time("2006-12-31T13:21:44.308Z")), isDate(time("2006-10-01T04:00:00Z"), tz)); - assertThat(rounding.round(time("9000-12-31T13:21:44.308Z")), isDate(time("9000-10-01T04:00:00Z"), tz)); - - Rounding.Prepared prepared = rounding.prepare(min, max); - assertThat(prepared.round(time("2006-12-31T13:21:44.308Z")), isDate(time("2006-10-01T04:00:00Z"), tz)); - assertThat(prepared.round(time("9000-12-31T13:21:44.308Z")), isDate(time("9000-10-01T04:00:00Z"), tz)); - } - - public void testPrepareLongRangeRoundsNotToMidnight() { - ZoneId tz = ZoneId.of("Australia/Lord_Howe"); - long min = time("01980-01-01T00:00:00Z"); - long max = time("10000-01-01T00:00:00Z"); - Rounding rounding = Rounding.builder(Rounding.DateTimeUnit.HOUR_OF_DAY).timeZone(tz).build(); - assertThat(rounding.round(time("2018-03-31T15:25:15.148Z")), isDate(time("2018-03-31T14:00:00Z"), tz)); - assertThat(rounding.round(time("9000-03-31T15:25:15.148Z")), isDate(time("9000-03-31T15:00:00Z"), tz)); - - Rounding.Prepared prepared = rounding.prepare(min, max); - assertThat(prepared.round(time("2018-03-31T15:25:15.148Z")), isDate(time("2018-03-31T14:00:00Z"), tz)); - assertThat(prepared.round(time("9000-03-31T15:25:15.148Z")), isDate(time("9000-03-31T15:00:00Z"), tz)); - } - - /** - * Example of when we round past when local clocks were wound forward. - */ - public void testIntervalBeforeGap() { - ZoneId tz = ZoneId.of("Africa/Cairo"); - Rounding rounding = Rounding.builder(TimeValue.timeValueDays(257)).timeZone(tz).build(); - assertThat(rounding.round(time("1969-07-08T09:00:14.599Z")), isDate(time("1969-04-18T22:00:00Z"), tz)); - } - - /** - * Example of when we round past when local clocks were wound backwards, - * and then past the time they were wound forwards before - * that. So, we jumped back a long, long way. - */ - public void testIntervalTwoTransitions() { - ZoneId tz = ZoneId.of("America/Detroit"); - Rounding rounding = Rounding.builder(TimeValue.timeValueDays(279)).timeZone(tz).build(); - assertThat(rounding.round(time("1982-11-10T02:51:22.662Z")), isDate(time("1982-03-23T05:00:00Z"), tz)); - } - - public void testFixedIntervalRoundingSize() { - Rounding unitRounding = Rounding.builder(TimeValue.timeValueHours(10)).build(); - Rounding.Prepared prepared = unitRounding.prepare(time("2010-01-01T00:00:00.000Z"), time("2020-01-01T00:00:00.000Z")); - assertThat(prepared.roundingSize(time("2015-01-01T00:00:00.000Z"), Rounding.DateTimeUnit.SECOND_OF_MINUTE), - closeTo(36000.0, 0.000001)); - assertThat(prepared.roundingSize(time("2015-01-01T00:00:00.000Z"), Rounding.DateTimeUnit.MINUTES_OF_HOUR), - closeTo(600.0, 0.000001)); - assertThat(prepared.roundingSize(time("2015-01-01T00:00:00.000Z"), Rounding.DateTimeUnit.HOUR_OF_DAY), - closeTo(10.0, 0.000001)); - assertThat(prepared.roundingSize(time("2015-01-01T00:00:00.000Z"), Rounding.DateTimeUnit.DAY_OF_MONTH), - closeTo(10.0 / 24.0, 0.000001)); - assertThat(prepared.roundingSize(time("2015-01-01T00:00:00.000Z"), Rounding.DateTimeUnit.WEEK_OF_WEEKYEAR), - closeTo(10.0 / 168.0, 0.000001)); - IllegalArgumentException ex = expectThrows(IllegalArgumentException.class, - () -> prepared.roundingSize(time("2015-01-01T00:00:00.000Z"), Rounding.DateTimeUnit.MONTH_OF_YEAR)); - assertThat(ex.getMessage(), equalTo("Cannot use month-based rate unit [month] with fixed interval based histogram, " + - "only week, day, hour, minute and second are supported for this histogram")); - ex = expectThrows(IllegalArgumentException.class, - () -> prepared.roundingSize(time("2015-01-01T00:00:00.000Z"), Rounding.DateTimeUnit.QUARTER_OF_YEAR)); - assertThat(ex.getMessage(), equalTo("Cannot use month-based rate unit [quarter] with fixed interval based histogram, " + - "only week, day, hour, minute and second are supported for this histogram")); - ex = expectThrows(IllegalArgumentException.class, - () -> prepared.roundingSize(time("2015-01-01T00:00:00.000Z"), Rounding.DateTimeUnit.YEAR_OF_CENTURY)); - assertThat(ex.getMessage(), equalTo("Cannot use month-based rate unit [year] with fixed interval based histogram, " + - "only week, day, hour, minute and second are supported for this histogram")); - } - - public void testMillisecondsBasedUnitCalendarRoundingSize() { - Rounding unitRounding = Rounding.builder(Rounding.DateTimeUnit.HOUR_OF_DAY).build(); - Rounding.Prepared prepared = unitRounding.prepare(time("2010-01-01T00:00:00.000Z"), time("2020-01-01T00:00:00.000Z")); - assertThat(prepared.roundingSize(time("2015-01-01T00:00:00.000Z"), Rounding.DateTimeUnit.SECOND_OF_MINUTE), - closeTo(3600.0, 0.000001)); - assertThat(prepared.roundingSize(Rounding.DateTimeUnit.SECOND_OF_MINUTE), - closeTo(3600.0, 0.000001)); - assertThat(prepared.roundingSize(time("2015-01-01T00:00:00.000Z"), Rounding.DateTimeUnit.MINUTES_OF_HOUR), - closeTo(60.0, 0.000001)); - assertThat(prepared.roundingSize(Rounding.DateTimeUnit.MINUTES_OF_HOUR), - closeTo(60.0, 0.000001)); - assertThat(prepared.roundingSize(time("2015-01-01T00:00:00.000Z"), Rounding.DateTimeUnit.HOUR_OF_DAY), - closeTo(1.0, 0.000001)); - assertThat(prepared.roundingSize(Rounding.DateTimeUnit.HOUR_OF_DAY), - closeTo(1.0, 0.000001)); - assertThat(prepared.roundingSize(time("2015-01-01T00:00:00.000Z"), Rounding.DateTimeUnit.DAY_OF_MONTH), - closeTo(1 / 24.0, 0.000001)); - assertThat(prepared.roundingSize(Rounding.DateTimeUnit.DAY_OF_MONTH), - closeTo(1 / 24.0, 0.000001)); - assertThat(prepared.roundingSize(time("2015-01-01T00:00:00.000Z"), Rounding.DateTimeUnit.WEEK_OF_WEEKYEAR), - closeTo(1 / 168.0, 0.000001)); - assertThat(prepared.roundingSize(Rounding.DateTimeUnit.WEEK_OF_WEEKYEAR), - closeTo(1 / 168.0, 0.000001)); - IllegalArgumentException ex = expectThrows(IllegalArgumentException.class, - () -> prepared.roundingSize(time("2015-01-01T00:00:00.000Z"), Rounding.DateTimeUnit.MONTH_OF_YEAR)); - assertThat(ex.getMessage(), equalTo("Cannot use month-based rate unit [month] with non-month based calendar interval " + - "histogram [hour] only week, day, hour, minute and second are supported for this histogram")); - ex = expectThrows(IllegalArgumentException.class, - () -> prepared.roundingSize(Rounding.DateTimeUnit.MONTH_OF_YEAR)); - assertThat(ex.getMessage(), equalTo("Cannot use month-based rate unit [month] with non-month based calendar interval " + - "histogram [hour] only week, day, hour, minute and second are supported for this histogram")); - ex = expectThrows(IllegalArgumentException.class, - () -> prepared.roundingSize(time("2015-01-01T00:00:00.000Z"), Rounding.DateTimeUnit.QUARTER_OF_YEAR)); - assertThat(ex.getMessage(), equalTo("Cannot use month-based rate unit [quarter] with non-month based calendar interval " + - "histogram [hour] only week, day, hour, minute and second are supported for this histogram")); - ex = expectThrows(IllegalArgumentException.class, - () -> prepared.roundingSize(Rounding.DateTimeUnit.QUARTER_OF_YEAR)); - assertThat(ex.getMessage(), equalTo("Cannot use month-based rate unit [quarter] with non-month based calendar interval " + - "histogram [hour] only week, day, hour, minute and second are supported for this histogram")); - ex = expectThrows(IllegalArgumentException.class, - () -> prepared.roundingSize(time("2015-01-01T00:00:00.000Z"), Rounding.DateTimeUnit.YEAR_OF_CENTURY)); - assertThat(ex.getMessage(), equalTo("Cannot use month-based rate unit [year] with non-month based calendar interval " + - "histogram [hour] only week, day, hour, minute and second are supported for this histogram")); - ex = expectThrows(IllegalArgumentException.class, - () -> prepared.roundingSize(Rounding.DateTimeUnit.YEAR_OF_CENTURY)); - assertThat(ex.getMessage(), equalTo("Cannot use month-based rate unit [year] with non-month based calendar interval " + - "histogram [hour] only week, day, hour, minute and second are supported for this histogram")); - } - - public void testNonMillisecondsBasedUnitCalendarRoundingSize() { - Rounding unitRounding = Rounding.builder(Rounding.DateTimeUnit.QUARTER_OF_YEAR).build(); - Rounding.Prepared prepared = unitRounding.prepare(time("2010-01-01T00:00:00.000Z"), time("2020-01-01T00:00:00.000Z")); - long firstQuarter = prepared.round(time("2015-01-01T00:00:00.000Z")); - // Ratio based - assertThat(prepared.roundingSize(firstQuarter, Rounding.DateTimeUnit.MONTH_OF_YEAR), closeTo(3.0, 0.000001)); - assertThat(prepared.roundingSize(firstQuarter, Rounding.DateTimeUnit.QUARTER_OF_YEAR), closeTo(1.0, 0.000001)); - assertThat(prepared.roundingSize(firstQuarter, Rounding.DateTimeUnit.YEAR_OF_CENTURY), closeTo(0.25, 0.000001)); - assertThat(prepared.roundingSize(Rounding.DateTimeUnit.MONTH_OF_YEAR), closeTo(3.0, 0.000001)); - assertThat(prepared.roundingSize(Rounding.DateTimeUnit.QUARTER_OF_YEAR), closeTo(1.0, 0.000001)); - assertThat(prepared.roundingSize(Rounding.DateTimeUnit.YEAR_OF_CENTURY), closeTo(0.25, 0.000001)); - // Real interval based - assertThat(prepared.roundingSize(firstQuarter, Rounding.DateTimeUnit.SECOND_OF_MINUTE), closeTo(7776000.0, 0.000001)); - assertThat(prepared.roundingSize(firstQuarter, Rounding.DateTimeUnit.MINUTES_OF_HOUR), closeTo(129600.0, 0.000001)); - assertThat(prepared.roundingSize(firstQuarter, Rounding.DateTimeUnit.HOUR_OF_DAY), closeTo(2160.0, 0.000001)); - assertThat(prepared.roundingSize(firstQuarter, Rounding.DateTimeUnit.DAY_OF_MONTH), closeTo(90.0, 0.000001)); - long thirdQuarter = prepared.round(time("2015-07-01T00:00:00.000Z")); - assertThat(prepared.roundingSize(thirdQuarter, Rounding.DateTimeUnit.DAY_OF_MONTH), closeTo(92.0, 0.000001)); - assertThat(prepared.roundingSize(thirdQuarter, Rounding.DateTimeUnit.HOUR_OF_DAY), closeTo(2208.0, 0.000001)); - IllegalArgumentException ex = expectThrows(IllegalArgumentException.class, - () -> prepared.roundingSize(Rounding.DateTimeUnit.SECOND_OF_MINUTE)); - assertThat(ex.getMessage(), equalTo("Cannot use non month-based rate unit [second] with calendar interval histogram " + - "[quarter] only month, quarter and year are supported for this histogram")); - } - - public void testFixedRoundingPoints() { - Rounding rounding = Rounding.builder(Rounding.DateTimeUnit.QUARTER_OF_YEAR).build(); - assertFixedRoundingPoints( - rounding.prepare(time("2020-01-01T00:00:00"), time("2021-01-01T00:00:00")), - "2020-01-01T00:00:00", - "2020-04-01T00:00:00", - "2020-07-01T00:00:00", - "2020-10-01T00:00:00", - "2021-01-01T00:00:00" - ); - rounding = Rounding.builder(Rounding.DateTimeUnit.DAY_OF_MONTH).build(); - assertFixedRoundingPoints( - rounding.prepare(time("2020-01-01T00:00:00"), time("2020-01-06T00:00:00")), - "2020-01-01T00:00:00", - "2020-01-02T00:00:00", - "2020-01-03T00:00:00", - "2020-01-04T00:00:00", - "2020-01-05T00:00:00", - "2020-01-06T00:00:00" - ); - } - - private void assertFixedRoundingPoints(Rounding.Prepared prepared, String... expected) { - assertThat( - Arrays.stream(prepared.fixedRoundingPoints()).mapToObj(Instant::ofEpochMilli).collect(toList()), - equalTo(Arrays.stream(expected).map(RoundingTests::time).map(Instant::ofEpochMilli).collect(toList())) - ); - } - - private void assertInterval(long rounded, long nextRoundingValue, Rounding rounding, int minutes, - ZoneId tz) { - assertInterval(rounded, dateBetween(rounded, nextRoundingValue), nextRoundingValue, rounding, tz); - long millisPerMinute = 60_000; - assertEquals(millisPerMinute * minutes, nextRoundingValue - rounded); - } - - /** - * perform a number on assertions and checks on {@link org.elasticsearch.common.Rounding.TimeUnitRounding} intervals - * @param rounded the expected low end of the rounding interval - * @param unrounded a date in the interval to be checked for rounding - * @param nextRoundingValue the expected upper end of the rounding interval - * @param rounding the rounding instance - */ - private void assertInterval(long rounded, long unrounded, long nextRoundingValue, Rounding rounding, ZoneId tz) { - assertThat("rounding should be idempotent", rounding.round(rounded), isDate(rounded, tz)); - assertThat("rounded value smaller or equal than unrounded", rounded, lessThanOrEqualTo(unrounded)); - assertThat("values less than rounded should round further down", rounding.round(rounded - 1), lessThan(rounded)); - assertThat("nextRounding value should be a rounded date", rounding.round(nextRoundingValue), isDate(nextRoundingValue, tz)); - assertThat("values above nextRounding should round down there", rounding.round(nextRoundingValue + 1), - isDate(nextRoundingValue, tz)); - - if (isTimeWithWellDefinedRounding(tz, unrounded)) { - assertThat("nextRounding value should be greater than date" + rounding, nextRoundingValue, greaterThan(unrounded)); - - long dateBetween = dateBetween(rounded, nextRoundingValue); - long roundingDateBetween = rounding.round(dateBetween); - ZonedDateTime zonedDateBetween = ZonedDateTime.ofInstant(Instant.ofEpochMilli(dateBetween), tz); - assertThat("dateBetween [" + zonedDateBetween + "/" + dateBetween + "] should round down to roundedDate [" + - Instant.ofEpochMilli(roundingDateBetween) + "]", roundingDateBetween, isDate(rounded, tz)); - assertThat("dateBetween [" + zonedDateBetween + "] should round up to nextRoundingValue", - rounding.nextRoundingValue(dateBetween), isDate(nextRoundingValue, tz)); - } - } - - private static boolean isTimeWithWellDefinedRounding(ZoneId tz, long t) { - if (tz.getId().equals("America/St_Johns") - || tz.getId().equals("America/Goose_Bay") - || tz.getId().equals("America/Moncton") - || tz.getId().equals("Canada/Newfoundland")) { - - // Clocks went back at 00:01 between 1987 and 2010, causing overlapping days. - // These timezones are otherwise uninteresting, so just skip this period. - - return t <= time("1987-10-01T00:00:00Z") - || t >= time("2010-12-01T00:00:00Z"); - } - - if (tz.getId().equals("Antarctica/Casey")) { - - // Clocks went back 3 hours at 02:00 on 2010-03-05, causing overlapping days. - - return t <= time("2010-03-03T00:00:00Z") - || t >= time("2010-03-07T00:00:00Z"); - } - if (tz.getId().equals("Pacific/Guam") || tz.getId().equals("Pacific/Saipan")) { - // Clocks went back at 00:01 in 1969, causing overlapping days. - return t <= time("1969-01-25T00:00:00Z") - || t >= time("1969-01-26T00:00:00Z"); - } - - return true; - } - - private static long randomDate() { - return Math.abs(randomLong() % (2 * (long) 10e11)); // 1970-01-01T00:00:00Z - 2033-05-18T05:33:20.000+02:00 - } - - private static long[] randomDateBounds(Rounding.DateTimeUnit unit) { - long b1 = randomDate(); - if (randomBoolean()) { - // Sometimes use a fairly close date - return new long[] {b1, b1 + unit.extraLocalOffsetLookup() * between(1, 40)}; - } - // Otherwise use a totally random date - long b2 = randomValueOtherThan(b1, RoundingTests::randomDate); - if (b1 < b2) { - return new long[] {b1, b2}; - } - return new long[] {b2, b1}; - } - private static long dateBetween(long lower, long upper) { - long dateBetween = randomLongBetween(lower, upper - 1); - assert lower <= dateBetween && dateBetween < upper; - return dateBetween; - } - - private static long time(String time) { - return time(time, ZoneOffset.UTC); - } - - private static long time(String time, ZoneId zone) { - TemporalAccessor accessor = DateFormatter.forPattern("date_optional_time").withZone(zone).parse(time); - return DateFormatters.from(accessor).toInstant().toEpochMilli(); - } - - private static Matcher isDate(final long expected, ZoneId tz) { - return new TypeSafeMatcher() { - @Override - public boolean matchesSafely(final Long item) { - return expected == item; - } - - @Override - public void describeTo(Description description) { - ZonedDateTime zonedDateTime = ZonedDateTime.ofInstant(Instant.ofEpochMilli(expected), tz); - description.appendText(DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(zonedDateTime) + " [" + expected + "] "); - } - - @Override - protected void describeMismatchSafely(final Long actual, final Description mismatchDescription) { - ZonedDateTime zonedDateTime = ZonedDateTime.ofInstant(Instant.ofEpochMilli(actual), tz); - mismatchDescription.appendText(" was ") - .appendValue(DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(zonedDateTime) + " [" + actual + "]"); - } - }; - } - -} diff --git a/server/src/test/java/org/elasticsearch/common/RoundingWireTests.java b/server/src/test/java/org/elasticsearch/common/RoundingWireTests.java deleted file mode 100644 index 5c0808809e788..0000000000000 --- a/server/src/test/java/org/elasticsearch/common/RoundingWireTests.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -package org.elasticsearch.common; - -import org.elasticsearch.common.Rounding.DateTimeUnit; -import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.core.TimeValue; -import org.elasticsearch.test.AbstractWireSerializingTestCase; - -public class RoundingWireTests extends AbstractWireSerializingTestCase { - @Override - protected Rounding createTestInstance() { - Rounding.Builder builder; - if (randomBoolean()) { - builder = Rounding.builder(randomFrom(DateTimeUnit.values())); - } else { - // The time value's millisecond component must be > 0 so we're limited in the suffixes we can use. - final var tv = randomTimeValue(1, 1000, "d", "h", "ms", "s", "m"); - builder = Rounding.builder(TimeValue.parseTimeValue(tv, "test")); - } - if (randomBoolean()) { - builder.timeZone(randomZone()); - } - if (randomBoolean()) { - builder.offset(randomLong()); - } - return builder.build(); - } - - @Override - protected Reader instanceReader() { - return Rounding::read; - } -} diff --git a/server/src/test/java/org/elasticsearch/common/rounding/DateTimeUnit.java b/server/src/test/java/org/elasticsearch/common/rounding/DateTimeUnit.java deleted file mode 100644 index 7bd53f52979b7..0000000000000 --- a/server/src/test/java/org/elasticsearch/common/rounding/DateTimeUnit.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * 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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ -package org.elasticsearch.common.rounding; - -import org.elasticsearch.ElasticsearchException; -import org.elasticsearch.common.joda.Joda; -import org.joda.time.DateTimeField; -import org.joda.time.DateTimeZone; -import org.joda.time.chrono.ISOChronology; - -import java.util.function.Function; - -public enum DateTimeUnit { - - WEEK_OF_WEEKYEAR( (byte) 1, tz -> ISOChronology.getInstance(tz).weekOfWeekyear()), - YEAR_OF_CENTURY( (byte) 2, tz -> ISOChronology.getInstance(tz).yearOfCentury()), - QUARTER( (byte) 3, tz -> Joda.QuarterOfYear.getField(ISOChronology.getInstance(tz))), - MONTH_OF_YEAR( (byte) 4, tz -> ISOChronology.getInstance(tz).monthOfYear()), - DAY_OF_MONTH( (byte) 5, tz -> ISOChronology.getInstance(tz).dayOfMonth()), - HOUR_OF_DAY( (byte) 6, tz -> ISOChronology.getInstance(tz).hourOfDay()), - MINUTES_OF_HOUR( (byte) 7, tz -> ISOChronology.getInstance(tz).minuteOfHour()), - SECOND_OF_MINUTE( (byte) 8, tz -> ISOChronology.getInstance(tz).secondOfMinute()); - - private final byte id; - private final Function fieldFunction; - - DateTimeUnit(byte id, Function fieldFunction) { - this.id = id; - this.fieldFunction = fieldFunction; - } - - public byte id() { - return id; - } - - /** - * @return the {@link DateTimeField} for the provided {@link DateTimeZone} for this time unit - */ - public DateTimeField field(DateTimeZone tz) { - return fieldFunction.apply(tz); - } - - public static DateTimeUnit resolve(byte id) { - switch (id) { - case 1: return WEEK_OF_WEEKYEAR; - case 2: return YEAR_OF_CENTURY; - case 3: return QUARTER; - case 4: return MONTH_OF_YEAR; - case 5: return DAY_OF_MONTH; - case 6: return HOUR_OF_DAY; - case 7: return MINUTES_OF_HOUR; - case 8: return SECOND_OF_MINUTE; - default: throw new ElasticsearchException("Unknown date time unit id [" + id + "]"); - } - } -} diff --git a/server/src/test/java/org/elasticsearch/common/rounding/DateTimeUnitTests.java b/server/src/test/java/org/elasticsearch/common/rounding/DateTimeUnitTests.java deleted file mode 100644 index 0aaf9fa5f1f8b..0000000000000 --- a/server/src/test/java/org/elasticsearch/common/rounding/DateTimeUnitTests.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ -package org.elasticsearch.common.rounding; - -import org.elasticsearch.test.ESTestCase; - -import static org.elasticsearch.common.rounding.DateTimeUnit.DAY_OF_MONTH; -import static org.elasticsearch.common.rounding.DateTimeUnit.HOUR_OF_DAY; -import static org.elasticsearch.common.rounding.DateTimeUnit.MINUTES_OF_HOUR; -import static org.elasticsearch.common.rounding.DateTimeUnit.MONTH_OF_YEAR; -import static org.elasticsearch.common.rounding.DateTimeUnit.QUARTER; -import static org.elasticsearch.common.rounding.DateTimeUnit.SECOND_OF_MINUTE; -import static org.elasticsearch.common.rounding.DateTimeUnit.WEEK_OF_WEEKYEAR; -import static org.elasticsearch.common.rounding.DateTimeUnit.YEAR_OF_CENTURY; - -public class DateTimeUnitTests extends ESTestCase { - - /** - * test that we don't accidentally change enum ids - */ - public void testEnumIds() { - assertEquals(1, WEEK_OF_WEEKYEAR.id()); - assertEquals(WEEK_OF_WEEKYEAR, DateTimeUnit.resolve((byte) 1)); - - assertEquals(2, YEAR_OF_CENTURY.id()); - assertEquals(YEAR_OF_CENTURY, DateTimeUnit.resolve((byte) 2)); - - assertEquals(3, QUARTER.id()); - assertEquals(QUARTER, DateTimeUnit.resolve((byte) 3)); - - assertEquals(4, MONTH_OF_YEAR.id()); - assertEquals(MONTH_OF_YEAR, DateTimeUnit.resolve((byte) 4)); - - assertEquals(5, DAY_OF_MONTH.id()); - assertEquals(DAY_OF_MONTH, DateTimeUnit.resolve((byte) 5)); - - assertEquals(6, HOUR_OF_DAY.id()); - assertEquals(HOUR_OF_DAY, DateTimeUnit.resolve((byte) 6)); - - assertEquals(7, MINUTES_OF_HOUR.id()); - assertEquals(MINUTES_OF_HOUR, DateTimeUnit.resolve((byte) 7)); - - assertEquals(8, SECOND_OF_MINUTE.id()); - assertEquals(SECOND_OF_MINUTE, DateTimeUnit.resolve((byte) 8)); - } -} diff --git a/server/src/test/java/org/elasticsearch/common/rounding/Rounding.java b/server/src/test/java/org/elasticsearch/common/rounding/Rounding.java deleted file mode 100644 index ec9d52e4172db..0000000000000 --- a/server/src/test/java/org/elasticsearch/common/rounding/Rounding.java +++ /dev/null @@ -1,416 +0,0 @@ -/* - * 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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ -package org.elasticsearch.common.rounding; - -import org.elasticsearch.ElasticsearchException; -import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.core.TimeValue; -import org.joda.time.DateTimeField; -import org.joda.time.DateTimeZone; -import org.joda.time.IllegalInstantException; - -import java.io.IOException; -import java.util.Objects; - -/** - * A strategy for rounding long values. - * - * Use the java based Rounding class where applicable - */ -@Deprecated -public abstract class Rounding implements Writeable { - - public abstract byte id(); - - /** - * Rounds the given value. - */ - public abstract long round(long value); - - /** - * Given the rounded value (which was potentially generated by {@link #round(long)}, returns the next rounding value. For example, with - * interval based rounding, if the interval is 3, {@code nextRoundValue(6) = 9 }. - * - * @param value The current rounding value - * @return The next rounding value; - */ - public abstract long nextRoundingValue(long value); - - @Override - public abstract boolean equals(Object obj); - - @Override - public abstract int hashCode(); - - public static Builder builder(DateTimeUnit unit) { - return new Builder(unit); - } - - public static Builder builder(TimeValue interval) { - return new Builder(interval); - } - - public static class Builder { - - private final DateTimeUnit unit; - private final long interval; - - private DateTimeZone timeZone = DateTimeZone.UTC; - - public Builder(DateTimeUnit unit) { - this.unit = unit; - this.interval = -1; - } - - public Builder(TimeValue interval) { - this.unit = null; - if (interval.millis() < 1) - throw new IllegalArgumentException("Zero or negative time interval not supported"); - this.interval = interval.millis(); - } - - public Builder timeZone(DateTimeZone timeZone) { - if (timeZone == null) { - throw new IllegalArgumentException("Setting null as timezone is not supported"); - } - this.timeZone = timeZone; - return this; - } - - public Rounding build() { - Rounding timeZoneRounding; - if (unit != null) { - timeZoneRounding = new TimeUnitRounding(unit, timeZone); - } else { - timeZoneRounding = new TimeIntervalRounding(interval, timeZone); - } - return timeZoneRounding; - } - } - - static class TimeUnitRounding extends Rounding { - - static final byte ID = 1; - - private final DateTimeUnit unit; - private final DateTimeField field; - private final DateTimeZone timeZone; - private final boolean unitRoundsToMidnight; - - TimeUnitRounding(DateTimeUnit unit, DateTimeZone timeZone) { - this.unit = unit; - this.field = unit.field(timeZone); - unitRoundsToMidnight = this.field.getDurationField().getUnitMillis() > 60L * 60L * 1000L; - this.timeZone = timeZone; - } - - TimeUnitRounding(StreamInput in) throws IOException { - unit = DateTimeUnit.resolve(in.readByte()); - timeZone = DateTimeZone.forID(in.readString()); - field = unit.field(timeZone); - unitRoundsToMidnight = field.getDurationField().getUnitMillis() > 60L * 60L * 1000L; - } - - @Override - public byte id() { - return ID; - } - - /** - * @return The latest timestamp T which is strictly before utcMillis - * and such that timeZone.getOffset(T) != timeZone.getOffset(utcMillis). - * If there is no such T, returns Long.MAX_VALUE. - */ - private long previousTransition(long utcMillis) { - final int offsetAtInputTime = timeZone.getOffset(utcMillis); - do { - // Some timezones have transitions that do not change the offset, so we have to - // repeatedly call previousTransition until a nontrivial transition is found. - - long previousTransition = timeZone.previousTransition(utcMillis); - if (previousTransition == utcMillis) { - // There are no earlier transitions - return Long.MAX_VALUE; - } - assert previousTransition < utcMillis; // Progress was made - utcMillis = previousTransition; - } while (timeZone.getOffset(utcMillis) == offsetAtInputTime); - - return utcMillis; - } - - @Override - public long round(long utcMillis) { - - // field.roundFloor() works as long as the offset doesn't change. It is worth getting this case out of the way first, as - // the calculations for fixing things near to offset changes are a little expensive and are unnecessary in the common case - // of working in UTC. - if (timeZone.isFixed()) { - return field.roundFloor(utcMillis); - } - - // When rounding to hours we consider any local time of the form 'xx:00:00' as rounded, even though this gives duplicate - // bucket names for the times when the clocks go back. Shorter units behave similarly. However, longer units round down to - // midnight, and on the days where there are two midnights we would rather pick the earlier one, so that buckets are - // uniquely identified by the date. - if (unitRoundsToMidnight) { - final long anyLocalStartOfDay = field.roundFloor(utcMillis); - // `anyLocalStartOfDay` is _supposed_ to be the Unix timestamp for the start of the day in question in the current time - // zone. Mostly this just means "midnight", which is fine, and on days with no local midnight it's the first time that - // does occur on that day which is also ok. However, on days with >1 local midnight this is _one_ of the midnights, but - // may not be the first. Check whether this is happening, and fix it if so. - - final long previousTransition = previousTransition(anyLocalStartOfDay); - - if (previousTransition == Long.MAX_VALUE) { - // No previous transitions, so there can't be another earlier local midnight. - return anyLocalStartOfDay; - } - - final long currentOffset = timeZone.getOffset(anyLocalStartOfDay); - final long previousOffset = timeZone.getOffset(previousTransition); - assert currentOffset != previousOffset; - - // NB we only assume interference from one previous transition. It's theoretically possible to have two transitions in - // quick succession, both of which have a midnight in them, but this doesn't appear to happen in the TZDB so (a) it's - // pointless to implement and (b) it won't be tested. I recognise that this comment is tempting fate and will likely - // cause this very situation to occur in the near future, and eagerly look forward to fixing this using a loop over - // previous transitions when it happens. - - final long alsoLocalStartOfDay = anyLocalStartOfDay + currentOffset - previousOffset; - // `alsoLocalStartOfDay` is the Unix timestamp for the start of the day in question if the previous offset were in - // effect. - - if (alsoLocalStartOfDay <= previousTransition) { - // Therefore the previous offset _is_ in effect at `alsoLocalStartOfDay`, and it's earlier than anyLocalStartOfDay, - // so this is the answer to use. - return alsoLocalStartOfDay; - } - else { - // The previous offset is not in effect at `alsoLocalStartOfDay`, so the current offset must be. - return anyLocalStartOfDay; - } - - } else { - do { - long rounded = field.roundFloor(utcMillis); - - // field.roundFloor() mostly works as long as the offset hasn't changed in [rounded, utcMillis], so look at where - // the offset most recently changed. - - final long previousTransition = previousTransition(utcMillis); - - if (previousTransition == Long.MAX_VALUE || previousTransition < rounded) { - // The offset did not change in [rounded, utcMillis], so roundFloor() worked as expected. - return rounded; - } - - // The offset _did_ change in [rounded, utcMillis]. Put differently, this means that none of the times in - // [previousTransition+1, utcMillis] were rounded, so the rounded time must be <= previousTransition. This means - // it's sufficient to try and round previousTransition down. - assert previousTransition < utcMillis; - utcMillis = previousTransition; - } while (true); - } - } - - @Override - public long nextRoundingValue(long utcMillis) { - long floor = round(utcMillis); - // add one unit and round to get to next rounded value - long next = round(field.add(floor, 1)); - if (next == floor) { - // in rare case we need to add more than one unit - next = round(field.add(floor, 2)); - } - return next; - } - - @Override - public void writeTo(StreamOutput out) throws IOException { - out.writeByte(unit.id()); - out.writeString(timeZone.getID()); - } - - @Override - public int hashCode() { - return Objects.hash(unit, timeZone); - } - - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - TimeUnitRounding other = (TimeUnitRounding) obj; - return Objects.equals(unit, other.unit) && Objects.equals(timeZone, other.timeZone); - } - - @Override - public String toString() { - return "[" + timeZone + "][" + unit + "]"; - } - } - - static class TimeIntervalRounding extends Rounding { - - static final byte ID = 2; - - private final long interval; - private final DateTimeZone timeZone; - - TimeIntervalRounding(long interval, DateTimeZone timeZone) { - if (interval < 1) - throw new IllegalArgumentException("Zero or negative time interval not supported"); - this.interval = interval; - this.timeZone = timeZone; - } - - TimeIntervalRounding(StreamInput in) throws IOException { - interval = in.readVLong(); - timeZone = DateTimeZone.forID(in.readString()); - } - - @Override - public byte id() { - return ID; - } - - @Override - public long round(long utcMillis) { - long timeLocal = timeZone.convertUTCToLocal(utcMillis); - long rounded = roundKey(timeLocal, interval) * interval; - long roundedUTC; - if (isInDSTGap(rounded) == false) { - roundedUTC = timeZone.convertLocalToUTC(rounded, true, utcMillis); - // check if we crossed DST transition, in this case we want the - // last rounded value before the transition - long transition = timeZone.previousTransition(utcMillis); - if (transition != utcMillis && transition > roundedUTC) { - roundedUTC = round(transition - 1); - } - } else { - /* - * Edge case where the rounded local time is illegal and landed - * in a DST gap. In this case, we choose 1ms tick after the - * transition date. We don't want the transition date itself - * because those dates, when rounded themselves, fall into the - * previous interval. This would violate the invariant that the - * rounding operation should be idempotent. - */ - roundedUTC = timeZone.previousTransition(utcMillis) + 1; - } - return roundedUTC; - } - - private static long roundKey(long value, long interval) { - if (value < 0) { - return (value - interval + 1) / interval; - } else { - return value / interval; - } - } - - /** - * Determine whether the local instant is a valid instant in the given - * time zone. The logic for this is taken from - * {@link DateTimeZone#convertLocalToUTC(long, boolean)} for the - * `strict` mode case, but instead of throwing an - * {@link IllegalInstantException}, which is costly, we want to return a - * flag indicating that the value is illegal in that time zone. - */ - private boolean isInDSTGap(long instantLocal) { - if (timeZone.isFixed()) { - return false; - } - // get the offset at instantLocal (first estimate) - int offsetLocal = timeZone.getOffset(instantLocal); - // adjust instantLocal using the estimate and recalc the offset - int offset = timeZone.getOffset(instantLocal - offsetLocal); - // if the offsets differ, we must be near a DST boundary - if (offsetLocal != offset) { - // determine if we are in the DST gap - long nextLocal = timeZone.nextTransition(instantLocal - offsetLocal); - if (nextLocal == (instantLocal - offsetLocal)) { - nextLocal = Long.MAX_VALUE; - } - long nextAdjusted = timeZone.nextTransition(instantLocal - offset); - if (nextAdjusted == (instantLocal - offset)) { - nextAdjusted = Long.MAX_VALUE; - } - if (nextLocal != nextAdjusted) { - // we are in the DST gap - return true; - } - } - return false; - } - - @Override - public long nextRoundingValue(long time) { - long timeLocal = time; - timeLocal = timeZone.convertUTCToLocal(time); - long next = timeLocal + interval; - return timeZone.convertLocalToUTC(next, false); - } - - @Override - public void writeTo(StreamOutput out) throws IOException { - out.writeVLong(interval); - out.writeString(timeZone.getID()); - } - - @Override - public int hashCode() { - return Objects.hash(interval, timeZone); - } - - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - TimeIntervalRounding other = (TimeIntervalRounding) obj; - return Objects.equals(interval, other.interval) && Objects.equals(timeZone, other.timeZone); - } - } - - public static class Streams { - - public static void write(Rounding rounding, StreamOutput out) throws IOException { - out.writeByte(rounding.id()); - rounding.writeTo(out); - } - - public static Rounding read(StreamInput in) throws IOException { - Rounding rounding; - byte id = in.readByte(); - switch (id) { - case TimeUnitRounding.ID: - rounding = new TimeUnitRounding(in); - break; - case TimeIntervalRounding.ID: - rounding = new TimeIntervalRounding(in); - break; - default: - throw new ElasticsearchException("unknown rounding id [" + id + "]"); - } - return rounding; - } - - } - -} diff --git a/server/src/test/java/org/elasticsearch/common/rounding/RoundingDuelTests.java b/server/src/test/java/org/elasticsearch/common/rounding/RoundingDuelTests.java deleted file mode 100644 index df0b0b7ea1c84..0000000000000 --- a/server/src/test/java/org/elasticsearch/common/rounding/RoundingDuelTests.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * 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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -package org.elasticsearch.common.rounding; - -import org.elasticsearch.core.TimeValue; -import org.elasticsearch.test.ESTestCase; -import org.joda.time.DateTimeZone; - -import java.time.ZoneOffset; - -import static org.hamcrest.Matchers.is; - -public class RoundingDuelTests extends ESTestCase { - - // dont include nano/micro seconds as rounding would become zero then and throw an exception - private static final String[] ALLOWED_TIME_SUFFIXES = new String[]{"d", "h", "ms", "s", "m"}; - - public void testDuellingImplementations() { - org.elasticsearch.common.Rounding.DateTimeUnit randomDateTimeUnit = - randomFrom(org.elasticsearch.common.Rounding.DateTimeUnit.values()); - org.elasticsearch.common.Rounding.Prepared rounding; - Rounding roundingJoda; - - if (randomBoolean()) { - rounding = org.elasticsearch.common.Rounding.builder(randomDateTimeUnit).timeZone(ZoneOffset.UTC).build().prepareForUnknown(); - DateTimeUnit dateTimeUnit = DateTimeUnit.resolve(randomDateTimeUnit.getId()); - roundingJoda = Rounding.builder(dateTimeUnit).timeZone(DateTimeZone.UTC).build(); - } else { - TimeValue interval = timeValue(); - rounding = org.elasticsearch.common.Rounding.builder(interval).timeZone(ZoneOffset.UTC).build().prepareForUnknown(); - roundingJoda = Rounding.builder(interval).timeZone(DateTimeZone.UTC).build(); - } - - long roundValue = randomLong(); - assertThat(roundingJoda.round(roundValue), is(rounding.round(roundValue))); - } - - static TimeValue timeValue() { - return TimeValue.parseTimeValue(randomIntBetween(1, 1000) + randomFrom(ALLOWED_TIME_SUFFIXES), "settingName"); - } -} diff --git a/server/src/test/java/org/elasticsearch/common/rounding/TimeZoneRoundingTests.java b/server/src/test/java/org/elasticsearch/common/rounding/TimeZoneRoundingTests.java deleted file mode 100644 index 613cd2a26412e..0000000000000 --- a/server/src/test/java/org/elasticsearch/common/rounding/TimeZoneRoundingTests.java +++ /dev/null @@ -1,780 +0,0 @@ -/* - * 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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -package org.elasticsearch.common.rounding; - -import org.elasticsearch.core.Tuple; -import org.elasticsearch.common.rounding.Rounding.TimeIntervalRounding; -import org.elasticsearch.common.rounding.Rounding.TimeUnitRounding; -import org.elasticsearch.core.TimeValue; -import org.elasticsearch.test.ESTestCase; -import org.hamcrest.Description; -import org.hamcrest.Matcher; -import org.hamcrest.TypeSafeMatcher; -import org.joda.time.DateTime; -import org.joda.time.DateTimeConstants; -import org.joda.time.DateTimeZone; -import org.joda.time.format.DateTimeFormat; -import org.joda.time.format.DateTimeFormatter; -import org.joda.time.format.ISODateTimeFormat; - -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.TimeUnit; - -import static org.hamcrest.Matchers.equalTo; -import static org.hamcrest.Matchers.greaterThan; -import static org.hamcrest.Matchers.greaterThanOrEqualTo; -import static org.hamcrest.Matchers.lessThan; -import static org.hamcrest.Matchers.lessThanOrEqualTo; -import static org.hamcrest.Matchers.startsWith; - -public class TimeZoneRoundingTests extends ESTestCase { - - public void testUTCTimeUnitRounding() { - Rounding tzRounding = Rounding.builder(DateTimeUnit.MONTH_OF_YEAR).build(); - DateTimeZone tz = DateTimeZone.UTC; - assertThat(tzRounding.round(time("2009-02-03T01:01:01")), isDate(time("2009-02-01T00:00:00.000Z"), tz)); - assertThat(tzRounding.nextRoundingValue(time("2009-02-01T00:00:00.000Z")), isDate(time("2009-03-01T00:00:00.000Z"), tz)); - - tzRounding = Rounding.builder(DateTimeUnit.WEEK_OF_WEEKYEAR).build(); - assertThat(tzRounding.round(time("2012-01-10T01:01:01")), isDate(time("2012-01-09T00:00:00.000Z"), tz)); - assertThat(tzRounding.nextRoundingValue(time("2012-01-09T00:00:00.000Z")), isDate(time("2012-01-16T00:00:00.000Z"), tz)); - - tzRounding = Rounding.builder(DateTimeUnit.QUARTER).build(); - assertThat(tzRounding.round(time("2012-01-10T01:01:01")), isDate(time("2012-01-01T00:00:00.000Z"), tz)); - assertThat(tzRounding.nextRoundingValue(time("2012-01-09T00:00:00.000Z")), isDate(time("2012-04-01T00:00:00.000Z"), tz)); - - tzRounding = Rounding.builder(DateTimeUnit.HOUR_OF_DAY).build(); - assertThat(tzRounding.round(time("2012-01-10T01:01:01")), isDate(time("2012-01-10T01:00:00.000Z"), tz)); - assertThat(tzRounding.nextRoundingValue(time("2012-01-09T00:00:00.000Z")), isDate(time("2012-01-09T01:00:00.000Z"), tz)); - - tzRounding = Rounding.builder(DateTimeUnit.DAY_OF_MONTH).build(); - assertThat(tzRounding.round(time("2012-01-10T01:01:01")), isDate(time("2012-01-10T00:00:00.000Z"), tz)); - assertThat(tzRounding.nextRoundingValue(time("2012-01-09T00:00:00.000Z")), isDate(time("2012-01-10T00:00:00.000Z"), tz)); - - tzRounding = Rounding.builder(DateTimeUnit.YEAR_OF_CENTURY).build(); - assertThat(tzRounding.round(time("2012-01-10T01:01:01")), isDate(time("2012-01-01T00:00:00.000Z"), tz)); - assertThat(tzRounding.nextRoundingValue(time("2012-01-09T00:00:00.000Z")), isDate(time("2013-01-01T00:00:00.000Z"), tz)); - - tzRounding = Rounding.builder(DateTimeUnit.MINUTES_OF_HOUR).build(); - assertThat(tzRounding.round(time("2012-01-10T01:01:01")), isDate(time("2012-01-10T01:01:00.000Z"), tz)); - assertThat(tzRounding.nextRoundingValue(time("2012-01-09T00:00:00.000Z")), isDate(time("2012-01-09T00:01:00.000Z"), tz)); - - tzRounding = Rounding.builder(DateTimeUnit.SECOND_OF_MINUTE).build(); - assertThat(tzRounding.round(time("2012-01-10T01:01:01")), isDate(time("2012-01-10T01:01:01.000Z"), tz)); - assertThat(tzRounding.nextRoundingValue(time("2012-01-09T00:00:00.000Z")), isDate(time("2012-01-09T00:00:01.000Z"), tz)); - } - - public void testUTCIntervalRounding() { - Rounding tzRounding = Rounding.builder(TimeValue.timeValueHours(12)).build(); - DateTimeZone tz = DateTimeZone.UTC; - assertThat(tzRounding.round(time("2009-02-03T01:01:01")), isDate(time("2009-02-03T00:00:00.000Z"), tz)); - assertThat(tzRounding.nextRoundingValue(time("2009-02-03T00:00:00.000Z")), isDate(time("2009-02-03T12:00:00.000Z"), tz)); - assertThat(tzRounding.round(time("2009-02-03T13:01:01")), isDate(time("2009-02-03T12:00:00.000Z"), tz)); - assertThat(tzRounding.nextRoundingValue(time("2009-02-03T12:00:00.000Z")), isDate(time("2009-02-04T00:00:00.000Z"), tz)); - - tzRounding = Rounding.builder(TimeValue.timeValueHours(48)).build(); - assertThat(tzRounding.round(time("2009-02-03T01:01:01")), isDate(time("2009-02-03T00:00:00.000Z"), tz)); - assertThat(tzRounding.nextRoundingValue(time("2009-02-03T00:00:00.000Z")), isDate(time("2009-02-05T00:00:00.000Z"), tz)); - assertThat(tzRounding.round(time("2009-02-05T13:01:01")), isDate(time("2009-02-05T00:00:00.000Z"), tz)); - assertThat(tzRounding.nextRoundingValue(time("2009-02-05T00:00:00.000Z")), isDate(time("2009-02-07T00:00:00.000Z"), tz)); - } - - /** - * test TimeIntervalRounding, (interval < 12h) with time zone shift - */ - public void testTimeIntervalRounding() { - DateTimeZone tz = DateTimeZone.forOffsetHours(-1); - Rounding tzRounding = Rounding.builder(TimeValue.timeValueHours(6)).timeZone(tz).build(); - assertThat(tzRounding.round(time("2009-02-03T00:01:01")), isDate(time("2009-02-02T19:00:00.000Z"), tz)); - assertThat(tzRounding.nextRoundingValue(time("2009-02-02T19:00:00.000Z")), isDate(time("2009-02-03T01:00:00.000Z"), tz)); - - assertThat(tzRounding.round(time("2009-02-03T13:01:01")), isDate(time("2009-02-03T13:00:00.000Z"), tz)); - assertThat(tzRounding.nextRoundingValue(time("2009-02-03T13:00:00.000Z")), isDate(time("2009-02-03T19:00:00.000Z"), tz)); - } - - /** - * test DayIntervalRounding, (interval >= 12h) with time zone shift - */ - public void testDayIntervalRounding() { - DateTimeZone tz = DateTimeZone.forOffsetHours(-8); - Rounding tzRounding = Rounding.builder(TimeValue.timeValueHours(12)).timeZone(tz).build(); - assertThat(tzRounding.round(time("2009-02-03T00:01:01")), isDate(time("2009-02-02T20:00:00.000Z"), tz)); - assertThat(tzRounding.nextRoundingValue(time("2009-02-02T20:00:00.000Z")), isDate(time("2009-02-03T08:00:00.000Z"), tz)); - - assertThat(tzRounding.round(time("2009-02-03T13:01:01")), isDate(time("2009-02-03T08:00:00.000Z"), tz)); - assertThat(tzRounding.nextRoundingValue(time("2009-02-03T08:00:00.000Z")), isDate(time("2009-02-03T20:00:00.000Z"), tz)); - } - - public void testDayRounding() { - int timezoneOffset = -2; - Rounding tzRounding = Rounding.builder(DateTimeUnit.DAY_OF_MONTH).timeZone(DateTimeZone.forOffsetHours(timezoneOffset)) - .build(); - assertThat(tzRounding.round(0), equalTo(0L - TimeValue.timeValueHours(24 + timezoneOffset).millis())); - assertThat(tzRounding.nextRoundingValue(0L - TimeValue.timeValueHours(24 + timezoneOffset).millis()), equalTo(TimeValue - .timeValueHours(-timezoneOffset).millis())); - - DateTimeZone tz = DateTimeZone.forID("-08:00"); - tzRounding = Rounding.builder(DateTimeUnit.DAY_OF_MONTH).timeZone(tz).build(); - assertThat(tzRounding.round(time("2012-04-01T04:15:30Z")), isDate(time("2012-03-31T08:00:00Z"), tz)); - - tzRounding = Rounding.builder(DateTimeUnit.MONTH_OF_YEAR).timeZone(tz).build(); - assertThat(tzRounding.round(time("2012-04-01T04:15:30Z")), equalTo(time("2012-03-01T08:00:00Z"))); - - // date in Feb-3rd, but still in Feb-2nd in -02:00 timezone - tz = DateTimeZone.forID("-02:00"); - tzRounding = Rounding.builder(DateTimeUnit.DAY_OF_MONTH).timeZone(tz).build(); - assertThat(tzRounding.round(time("2009-02-03T01:01:01")), isDate(time("2009-02-02T02:00:00"), tz)); - assertThat(tzRounding.nextRoundingValue(time("2009-02-02T02:00:00")), isDate(time("2009-02-03T02:00:00"), tz)); - - // date in Feb-3rd, also in -02:00 timezone - tzRounding = Rounding.builder(DateTimeUnit.DAY_OF_MONTH).timeZone(tz).build(); - assertThat(tzRounding.round(time("2009-02-03T02:01:01")), isDate(time("2009-02-03T02:00:00"), tz)); - assertThat(tzRounding.nextRoundingValue(time("2009-02-03T02:00:00")), isDate(time("2009-02-04T02:00:00"), tz)); - } - - public void testTimeRounding() { - // hour unit - DateTimeZone tz = DateTimeZone.forOffsetHours(-2); - Rounding tzRounding = Rounding.builder(DateTimeUnit.HOUR_OF_DAY).timeZone(tz).build(); - assertThat(tzRounding.round(0), equalTo(0L)); - assertThat(tzRounding.nextRoundingValue(0L), equalTo(TimeValue.timeValueHours(1L).getMillis())); - - assertThat(tzRounding.round(time("2009-02-03T01:01:01")), isDate(time("2009-02-03T01:00:00"), tz)); - assertThat(tzRounding.nextRoundingValue(time("2009-02-03T01:00:00")), isDate(time("2009-02-03T02:00:00"), tz)); - } - - public void testTimeUnitRoundingDST() { - Rounding tzRounding; - // testing savings to non savings switch - DateTimeZone cet = DateTimeZone.forID("CET"); - tzRounding = Rounding.builder(DateTimeUnit.HOUR_OF_DAY).timeZone(cet).build(); - assertThat(tzRounding.round(time("2014-10-26T01:01:01", cet)), isDate(time("2014-10-26T01:00:00+02:00"), cet)); - assertThat(tzRounding.nextRoundingValue(time("2014-10-26T01:00:00", cet)),isDate(time("2014-10-26T02:00:00+02:00"), cet)); - assertThat(tzRounding.nextRoundingValue(time("2014-10-26T02:00:00", cet)), isDate(time("2014-10-26T02:00:00+01:00"), cet)); - - // testing non savings to savings switch - tzRounding = Rounding.builder(DateTimeUnit.HOUR_OF_DAY).timeZone(cet).build(); - assertThat(tzRounding.round(time("2014-03-30T01:01:01", cet)), isDate(time("2014-03-30T01:00:00+01:00"), cet)); - assertThat(tzRounding.nextRoundingValue(time("2014-03-30T01:00:00", cet)), isDate(time("2014-03-30T03:00:00", cet), cet)); - assertThat(tzRounding.nextRoundingValue(time("2014-03-30T03:00:00", cet)), isDate(time("2014-03-30T04:00:00", cet), cet)); - - // testing non savings to savings switch (America/Chicago) - DateTimeZone chg = DateTimeZone.forID("America/Chicago"); - Rounding tzRounding_utc = Rounding.builder(DateTimeUnit.HOUR_OF_DAY).timeZone(DateTimeZone.UTC).build(); - assertThat(tzRounding.round(time("2014-03-09T03:01:01", chg)), isDate(time("2014-03-09T03:00:00", chg), chg)); - - Rounding tzRounding_chg = Rounding.builder(DateTimeUnit.HOUR_OF_DAY).timeZone(chg).build(); - assertThat(tzRounding_chg.round(time("2014-03-09T03:01:01", chg)), isDate(time("2014-03-09T03:00:00", chg), chg)); - - // testing savings to non savings switch 2013 (America/Chicago) - assertThat(tzRounding_utc.round(time("2013-11-03T06:01:01", chg)), isDate(time("2013-11-03T06:00:00", chg), chg)); - assertThat(tzRounding_chg.round(time("2013-11-03T06:01:01", chg)), isDate(time("2013-11-03T06:00:00", chg), chg)); - - // testing savings to non savings switch 2014 (America/Chicago) - assertThat(tzRounding_utc.round(time("2014-11-02T06:01:01", chg)), isDate(time("2014-11-02T06:00:00", chg), chg)); - assertThat(tzRounding_chg.round(time("2014-11-02T06:01:01", chg)), isDate(time("2014-11-02T06:00:00", chg), chg)); - } - - /** - * Randomized test on TimeUnitRounding. Test uses random - * {@link DateTimeUnit} and {@link DateTimeZone} and often (50% of the time) - * chooses test dates that are exactly on or close to offset changes (e.g. - * DST) in the chosen time zone. - * - * It rounds the test date down and up and performs various checks on the - * rounding unit interval that is defined by this. Assumptions tested are - * described in - * {@link #assertInterval(long, long, long, Rounding, DateTimeZone)} - */ - public void testRoundingRandom() { - for (int i = 0; i < 1000; ++i) { - DateTimeUnit timeUnit = randomTimeUnit(); - DateTimeZone tz = randomDateTimeZone(); - Rounding rounding = new Rounding.TimeUnitRounding(timeUnit, tz); - long date = Math.abs(randomLong() % (2 * (long) 10e11)); // 1970-01-01T00:00:00Z - 2033-05-18T05:33:20.000+02:00 - long unitMillis = timeUnit.field(tz).getDurationField().getUnitMillis(); - if (randomBoolean()) { - nastyDate(date, tz, unitMillis); - } - final long roundedDate = rounding.round(date); - final long nextRoundingValue = rounding.nextRoundingValue(roundedDate); - - assertInterval(roundedDate, date, nextRoundingValue, rounding, tz); - - // check correct unit interval width for units smaller than a day, they should be fixed size except for transitions - if (unitMillis <= DateTimeConstants.MILLIS_PER_DAY) { - // if the interval defined didn't cross timezone offset transition, it should cover unitMillis width - if (tz.getOffset(roundedDate - 1) == tz.getOffset(nextRoundingValue + 1)) { - assertThat("unit interval width not as expected for [" + timeUnit + "], [" + tz + "] at " - + new DateTime(roundedDate), nextRoundingValue - roundedDate, equalTo(unitMillis)); - } - } - } - } - - /** - * To be even more nasty, go to a transition in the selected time zone. - * In one third of the cases stay there, otherwise go half a unit back or forth - */ - private static long nastyDate(long initialDate, DateTimeZone timezone, long unitMillis) { - long date = timezone.nextTransition(initialDate); - if (randomBoolean()) { - return date + (randomLong() % unitMillis); // positive and negative offset possible - } else { - return date; - } - } - - /** - * test DST end with interval rounding - * CET: 25 October 2015, 03:00:00 clocks were turned backward 1 hour to 25 October 2015, 02:00:00 local standard time - */ - public void testTimeIntervalCET_DST_End() { - long interval = TimeUnit.MINUTES.toMillis(20); - DateTimeZone tz = DateTimeZone.forID("CET"); - Rounding rounding = new TimeIntervalRounding(interval, tz); - - assertThat(rounding.round(time("2015-10-25T01:55:00+02:00")), isDate(time("2015-10-25T01:40:00+02:00"), tz)); - assertThat(rounding.round(time("2015-10-25T02:15:00+02:00")), isDate(time("2015-10-25T02:00:00+02:00"), tz)); - assertThat(rounding.round(time("2015-10-25T02:35:00+02:00")), isDate(time("2015-10-25T02:20:00+02:00"), tz)); - assertThat(rounding.round(time("2015-10-25T02:55:00+02:00")), isDate(time("2015-10-25T02:40:00+02:00"), tz)); - // after DST shift - assertThat(rounding.round(time("2015-10-25T02:15:00+01:00")), isDate(time("2015-10-25T02:00:00+01:00"), tz)); - assertThat(rounding.round(time("2015-10-25T02:35:00+01:00")), isDate(time("2015-10-25T02:20:00+01:00"), tz)); - assertThat(rounding.round(time("2015-10-25T02:55:00+01:00")), isDate(time("2015-10-25T02:40:00+01:00"), tz)); - assertThat(rounding.round(time("2015-10-25T03:15:00+01:00")), isDate(time("2015-10-25T03:00:00+01:00"), tz)); - } - - /** - * test DST start with interval rounding - * CET: 27 March 2016, 02:00:00 clocks were turned forward 1 hour to 27 March 2016, 03:00:00 local daylight time - */ - public void testTimeIntervalCET_DST_Start() { - long interval = TimeUnit.MINUTES.toMillis(20); - DateTimeZone tz = DateTimeZone.forID("CET"); - Rounding rounding = new TimeIntervalRounding(interval, tz); - // test DST start - assertThat(rounding.round(time("2016-03-27T01:55:00+01:00")), isDate(time("2016-03-27T01:40:00+01:00"), tz)); - assertThat(rounding.round(time("2016-03-27T02:00:00+01:00")), isDate(time("2016-03-27T03:00:00+02:00"), tz)); - assertThat(rounding.round(time("2016-03-27T03:15:00+02:00")), isDate(time("2016-03-27T03:00:00+02:00"), tz)); - assertThat(rounding.round(time("2016-03-27T03:35:00+02:00")), isDate(time("2016-03-27T03:20:00+02:00"), tz)); - } - - /** - * test DST start with offset not fitting interval, e.g. Asia/Kathmandu - * adding 15min on 1986-01-01T00:00:00 the interval from - * 1986-01-01T00:15:00+05:45 to 1986-01-01T00:20:00+05:45 to only be 5min - * long - */ - public void testTimeInterval_Kathmandu_DST_Start() { - long interval = TimeUnit.MINUTES.toMillis(20); - DateTimeZone tz = DateTimeZone.forID("Asia/Kathmandu"); - Rounding rounding = new TimeIntervalRounding(interval, tz); - assertThat(rounding.round(time("1985-12-31T23:55:00+05:30")), isDate(time("1985-12-31T23:40:00+05:30"), tz)); - assertThat(rounding.round(time("1986-01-01T00:16:00+05:45")), isDate(time("1986-01-01T00:15:00+05:45"), tz)); - assertThat(time("1986-01-01T00:15:00+05:45") - time("1985-12-31T23:40:00+05:30"), equalTo(TimeUnit.MINUTES.toMillis(20))); - assertThat(rounding.round(time("1986-01-01T00:26:00+05:45")), isDate(time("1986-01-01T00:20:00+05:45"), tz)); - assertThat(time("1986-01-01T00:20:00+05:45") - time("1986-01-01T00:15:00+05:45"), equalTo(TimeUnit.MINUTES.toMillis(5))); - assertThat(rounding.round(time("1986-01-01T00:46:00+05:45")), isDate(time("1986-01-01T00:40:00+05:45"), tz)); - assertThat(time("1986-01-01T00:40:00+05:45") - time("1986-01-01T00:20:00+05:45"), equalTo(TimeUnit.MINUTES.toMillis(20))); - } - - /** - * Special test for intervals that don't fit evenly into rounding interval. - * In this case, when interval crosses DST transition point, rounding in local - * time can land in a DST gap which results in wrong UTC rounding values. - */ - public void testIntervalRounding_NotDivisibleInteval() { - DateTimeZone tz = DateTimeZone.forID("CET"); - long interval = TimeUnit.MINUTES.toMillis(14); - Rounding rounding = new Rounding.TimeIntervalRounding(interval, tz); - - assertThat(rounding.round(time("2016-03-27T01:41:00+01:00")), isDate(time("2016-03-27T01:30:00+01:00"), tz)); - assertThat(rounding.round(time("2016-03-27T01:51:00+01:00")), isDate(time("2016-03-27T01:44:00+01:00"), tz)); - assertThat(rounding.round(time("2016-03-27T01:59:00+01:00")), isDate(time("2016-03-27T01:58:00+01:00"), tz)); - assertThat(rounding.round(time("2016-03-27T03:05:00+02:00")), isDate(time("2016-03-27T03:00:00+02:00"), tz)); - assertThat(rounding.round(time("2016-03-27T03:12:00+02:00")), isDate(time("2016-03-27T03:08:00+02:00"), tz)); - assertThat(rounding.round(time("2016-03-27T03:25:00+02:00")), isDate(time("2016-03-27T03:22:00+02:00"), tz)); - assertThat(rounding.round(time("2016-03-27T03:39:00+02:00")), isDate(time("2016-03-27T03:36:00+02:00"), tz)); - } - - /** - * Test for half day rounding intervals scrossing DST. - */ - public void testIntervalRounding_HalfDay_DST() { - DateTimeZone tz = DateTimeZone.forID("CET"); - long interval = TimeUnit.HOURS.toMillis(12); - Rounding rounding = new Rounding.TimeIntervalRounding(interval, tz); - - assertThat(rounding.round(time("2016-03-26T01:00:00+01:00")), isDate(time("2016-03-26T00:00:00+01:00"), tz)); - assertThat(rounding.round(time("2016-03-26T13:00:00+01:00")), isDate(time("2016-03-26T12:00:00+01:00"), tz)); - assertThat(rounding.round(time("2016-03-27T01:00:00+01:00")), isDate(time("2016-03-27T00:00:00+01:00"), tz)); - assertThat(rounding.round(time("2016-03-27T13:00:00+02:00")), isDate(time("2016-03-27T12:00:00+02:00"), tz)); - assertThat(rounding.round(time("2016-03-28T01:00:00+02:00")), isDate(time("2016-03-28T00:00:00+02:00"), tz)); - assertThat(rounding.round(time("2016-03-28T13:00:00+02:00")), isDate(time("2016-03-28T12:00:00+02:00"), tz)); - } - - /** - * randomized test on {@link TimeIntervalRounding} with random interval and time zone offsets - */ - public void testIntervalRoundingRandom() { - for (int i = 0; i < 1000; i++) { - TimeUnit unit = randomFrom(new TimeUnit[] {TimeUnit.MINUTES, TimeUnit.HOURS, TimeUnit.DAYS}); - long interval = unit.toMillis(randomIntBetween(1, 365)); - DateTimeZone tz = randomDateTimeZone(); - Rounding rounding = new Rounding.TimeIntervalRounding(interval, tz); - long mainDate = Math.abs(randomLong() % (2 * (long) 10e11)); // 1970-01-01T00:00:00Z - 2033-05-18T05:33:20.000+02:00 - if (randomBoolean()) { - mainDate = nastyDate(mainDate, tz, interval); - } - // check two intervals around date - long previousRoundedValue = Long.MIN_VALUE; - for (long date = mainDate - 2 * interval; date < mainDate + 2 * interval; date += interval / 2) { - try { - final long roundedDate = rounding.round(date); - final long nextRoundingValue = rounding.nextRoundingValue(roundedDate); - assertThat("Rounding should be idempotent", roundedDate, equalTo(rounding.round(roundedDate))); - assertThat("Rounded value smaller or equal than unrounded", roundedDate, lessThanOrEqualTo(date)); - assertThat("Values smaller than rounded value should round further down", rounding.round(roundedDate - 1), - lessThan(roundedDate)); - assertThat("Rounding should be >= previous rounding value", roundedDate, greaterThanOrEqualTo(previousRoundedValue)); - - if (tz.isFixed()) { - assertThat("NextRounding value should be greater than date", nextRoundingValue, greaterThan(roundedDate)); - assertThat("NextRounding value should be interval from rounded value", nextRoundingValue - roundedDate, - equalTo(interval)); - assertThat("NextRounding value should be a rounded date", nextRoundingValue, - equalTo(rounding.round(nextRoundingValue))); - } - previousRoundedValue = roundedDate; - } catch (AssertionError e) { - logger.error("Rounding error at {}, timezone {}, interval: {},", new DateTime(date, tz), tz, interval); - throw e; - } - } - } - } - - /** - * Test that rounded values are always greater or equal to last rounded value if date is increasing. - * The example covers an interval around 2011-10-30T02:10:00+01:00, time zone CET, interval: 2700000ms - */ - public void testIntervalRoundingMonotonic_CET() { - long interval = TimeUnit.MINUTES.toMillis(45); - DateTimeZone tz = DateTimeZone.forID("CET"); - Rounding rounding = new Rounding.TimeIntervalRounding(interval, tz); - List> expectedDates = new ArrayList<>(); - // first date is the date to be rounded, second the expected result - expectedDates.add(new Tuple<>("2011-10-30T01:40:00.000+02:00", "2011-10-30T01:30:00.000+02:00")); - expectedDates.add(new Tuple<>("2011-10-30T02:02:30.000+02:00", "2011-10-30T01:30:00.000+02:00")); - expectedDates.add(new Tuple<>("2011-10-30T02:25:00.000+02:00", "2011-10-30T02:15:00.000+02:00")); - expectedDates.add(new Tuple<>("2011-10-30T02:47:30.000+02:00", "2011-10-30T02:15:00.000+02:00")); - expectedDates.add(new Tuple<>("2011-10-30T02:10:00.000+01:00", "2011-10-30T02:15:00.000+02:00")); - expectedDates.add(new Tuple<>("2011-10-30T02:32:30.000+01:00", "2011-10-30T02:15:00.000+01:00")); - expectedDates.add(new Tuple<>("2011-10-30T02:55:00.000+01:00", "2011-10-30T02:15:00.000+01:00")); - expectedDates.add(new Tuple<>("2011-10-30T03:17:30.000+01:00", "2011-10-30T03:00:00.000+01:00")); - - long previousDate = Long.MIN_VALUE; - for (Tuple dates : expectedDates) { - final long roundedDate = rounding.round(time(dates.v1())); - assertThat(roundedDate, isDate(time(dates.v2()), tz)); - assertThat(roundedDate, greaterThanOrEqualTo(previousDate)); - previousDate = roundedDate; - } - // here's what this means for interval widths - assertEquals(TimeUnit.MINUTES.toMillis(45), time("2011-10-30T02:15:00.000+02:00") - time("2011-10-30T01:30:00.000+02:00")); - assertEquals(TimeUnit.MINUTES.toMillis(60), time("2011-10-30T02:15:00.000+01:00") - time("2011-10-30T02:15:00.000+02:00")); - assertEquals(TimeUnit.MINUTES.toMillis(45), time("2011-10-30T03:00:00.000+01:00") - time("2011-10-30T02:15:00.000+01:00")); - } - - /** - * special test for DST switch from #9491 - */ - public void testAmbiguousHoursAfterDSTSwitch() { - Rounding tzRounding; - final DateTimeZone tz = DateTimeZone.forID("Asia/Jerusalem"); - tzRounding = Rounding.builder(DateTimeUnit.HOUR_OF_DAY).timeZone(tz).build(); - assertThat(tzRounding.round(time("2014-10-26T00:30:00+03:00")), isDate(time("2014-10-26T00:00:00+03:00"), tz)); - assertThat(tzRounding.round(time("2014-10-26T01:30:00+03:00")), isDate(time("2014-10-26T01:00:00+03:00"), tz)); - // the utc date for "2014-10-25T03:00:00+03:00" and "2014-10-25T03:00:00+02:00" is the same, local time turns back 1h here - assertThat(time("2014-10-26T03:00:00+03:00"), isDate(time("2014-10-26T02:00:00+02:00"), tz)); - assertThat(tzRounding.round(time("2014-10-26T01:30:00+02:00")), isDate(time("2014-10-26T01:00:00+02:00"), tz)); - assertThat(tzRounding.round(time("2014-10-26T02:30:00+02:00")), isDate(time("2014-10-26T02:00:00+02:00"), tz)); - - // Day interval - tzRounding = Rounding.builder(DateTimeUnit.DAY_OF_MONTH).timeZone(tz).build(); - assertThat(tzRounding.round(time("2014-11-11T17:00:00", tz)), isDate(time("2014-11-11T00:00:00", tz), tz)); - // DST on - assertThat(tzRounding.round(time("2014-08-11T17:00:00", tz)), isDate(time("2014-08-11T00:00:00", tz), tz)); - // Day of switching DST on -> off - assertThat(tzRounding.round(time("2014-10-26T17:00:00", tz)), isDate(time("2014-10-26T00:00:00", tz), tz)); - // Day of switching DST off -> on - assertThat(tzRounding.round(time("2015-03-27T17:00:00", tz)), isDate(time("2015-03-27T00:00:00", tz), tz)); - - // Month interval - tzRounding = Rounding.builder(DateTimeUnit.MONTH_OF_YEAR).timeZone(tz).build(); - assertThat(tzRounding.round(time("2014-11-11T17:00:00", tz)), isDate(time("2014-11-01T00:00:00", tz), tz)); - // DST on - assertThat(tzRounding.round(time("2014-10-10T17:00:00", tz)), isDate(time("2014-10-01T00:00:00", tz), tz)); - - // Year interval - tzRounding = Rounding.builder(DateTimeUnit.YEAR_OF_CENTURY).timeZone(tz).build(); - assertThat(tzRounding.round(time("2014-11-11T17:00:00", tz)), isDate(time("2014-01-01T00:00:00", tz), tz)); - - // Two timestamps in same year and different timezone offset ("Double buckets" issue - #9491) - tzRounding = Rounding.builder(DateTimeUnit.YEAR_OF_CENTURY).timeZone(tz).build(); - assertThat(tzRounding.round(time("2014-11-11T17:00:00", tz)), - isDate(tzRounding.round(time("2014-08-11T17:00:00", tz)), tz)); - } - - /** - * test for #10025, strict local to UTC conversion can cause joda exceptions - * on DST start - */ - public void testLenientConversionDST() { - DateTimeZone tz = DateTimeZone.forID("America/Sao_Paulo"); - long start = time("2014-10-18T20:50:00.000", tz); - long end = time("2014-10-19T01:00:00.000", tz); - Rounding tzRounding = new Rounding.TimeUnitRounding(DateTimeUnit.MINUTES_OF_HOUR, tz); - Rounding dayTzRounding = new Rounding.TimeIntervalRounding(60000, tz); - for (long time = start; time < end; time = time + 60000) { - assertThat(tzRounding.nextRoundingValue(time), greaterThan(time)); - assertThat(dayTzRounding.nextRoundingValue(time), greaterThan(time)); - } - } - - public void testEdgeCasesTransition() { - { - // standard +/-1 hour DST transition, CET - DateTimeUnit timeUnit = DateTimeUnit.HOUR_OF_DAY; - DateTimeZone tz = DateTimeZone.forID("CET"); - Rounding rounding = new Rounding.TimeUnitRounding(timeUnit, tz); - - // 29 Mar 2015 - Daylight Saving Time Started - // at 02:00:00 clocks were turned forward 1 hour to 03:00:00 - assertInterval(time("2015-03-29T00:00:00.000+01:00"), time("2015-03-29T01:00:00.000+01:00"), rounding, 60, tz); - assertInterval(time("2015-03-29T01:00:00.000+01:00"), time("2015-03-29T03:00:00.000+02:00"), rounding, 60, tz); - assertInterval(time("2015-03-29T03:00:00.000+02:00"), time("2015-03-29T04:00:00.000+02:00"), rounding, 60, tz); - - // 25 Oct 2015 - Daylight Saving Time Ended - // at 03:00:00 clocks were turned backward 1 hour to 02:00:00 - assertInterval(time("2015-10-25T01:00:00.000+02:00"), time("2015-10-25T02:00:00.000+02:00"), rounding, 60, tz); - assertInterval(time("2015-10-25T02:00:00.000+02:00"), time("2015-10-25T02:00:00.000+01:00"), rounding, 60, tz); - assertInterval(time("2015-10-25T02:00:00.000+01:00"), time("2015-10-25T03:00:00.000+01:00"), rounding, 60, tz); - } - - { - // time zone "Asia/Kathmandu" - // 1 Jan 1986 - Time Zone Change (IST → NPT), at 00:00:00 clocks were turned forward 00:15 minutes - // - // hour rounding is stable before 1985-12-31T23:00:00.000 and after 1986-01-01T01:00:00.000+05:45 - // the interval between is 105 minutes long because the hour after transition starts at 00:15 - // which is not a round value for hourly rounding - DateTimeUnit timeUnit = DateTimeUnit.HOUR_OF_DAY; - DateTimeZone tz = DateTimeZone.forID("Asia/Kathmandu"); - Rounding rounding = new Rounding.TimeUnitRounding(timeUnit, tz); - - assertInterval(time("1985-12-31T22:00:00.000+05:30"), time("1985-12-31T23:00:00.000+05:30"), rounding, 60, tz); - assertInterval(time("1985-12-31T23:00:00.000+05:30"), time("1986-01-01T01:00:00.000+05:45"), rounding, 105, tz); - assertInterval(time("1986-01-01T01:00:00.000+05:45"), time("1986-01-01T02:00:00.000+05:45"), rounding, 60, tz); - } - - { - // time zone "Australia/Lord_Howe" - // 3 Mar 1991 - Daylight Saving Time Ended - // at 02:00:00 clocks were turned backward 0:30 hours to Sunday, 3 March 1991, 01:30:00 - DateTimeUnit timeUnit = DateTimeUnit.HOUR_OF_DAY; - DateTimeZone tz = DateTimeZone.forID("Australia/Lord_Howe"); - Rounding rounding = new Rounding.TimeUnitRounding(timeUnit, tz); - - assertInterval(time("1991-03-03T00:00:00.000+11:00"), time("1991-03-03T01:00:00.000+11:00"), rounding, 60, tz); - assertInterval(time("1991-03-03T01:00:00.000+11:00"), time("1991-03-03T02:00:00.000+10:30"), rounding, 90, tz); - assertInterval(time("1991-03-03T02:00:00.000+10:30"), time("1991-03-03T03:00:00.000+10:30"), rounding, 60, tz); - - // 27 Oct 1991 - Daylight Saving Time Started - // at 02:00:00 clocks were turned forward 0:30 hours to 02:30:00 - assertInterval(time("1991-10-27T00:00:00.000+10:30"), time("1991-10-27T01:00:00.000+10:30"), rounding, 60, tz); - // the interval containing the switch time is 90 minutes long - assertInterval(time("1991-10-27T01:00:00.000+10:30"), time("1991-10-27T03:00:00.000+11:00"), rounding, 90, tz); - assertInterval(time("1991-10-27T03:00:00.000+11:00"), time("1991-10-27T04:00:00.000+11:00"), rounding, 60, tz); - } - - { - // time zone "Pacific/Chatham" - // 5 Apr 2015 - Daylight Saving Time Ended - // at 03:45:00 clocks were turned backward 1 hour to 02:45:00 - DateTimeUnit timeUnit = DateTimeUnit.HOUR_OF_DAY; - DateTimeZone tz = DateTimeZone.forID("Pacific/Chatham"); - Rounding rounding = new Rounding.TimeUnitRounding(timeUnit, tz); - - assertInterval(time("2015-04-05T02:00:00.000+13:45"), time("2015-04-05T03:00:00.000+13:45"), rounding, 60, tz); - assertInterval(time("2015-04-05T03:00:00.000+13:45"), time("2015-04-05T03:00:00.000+12:45"), rounding, 60, tz); - assertInterval(time("2015-04-05T03:00:00.000+12:45"), time("2015-04-05T04:00:00.000+12:45"), rounding, 60, tz); - - // 27 Sep 2015 - Daylight Saving Time Started - // at 02:45:00 clocks were turned forward 1 hour to 03:45:00 - - assertInterval(time("2015-09-27T01:00:00.000+12:45"), time("2015-09-27T02:00:00.000+12:45"), rounding, 60, tz); - assertInterval(time("2015-09-27T02:00:00.000+12:45"), time("2015-09-27T04:00:00.000+13:45"), rounding, 60, tz); - assertInterval(time("2015-09-27T04:00:00.000+13:45"), time("2015-09-27T05:00:00.000+13:45"), rounding, 60, tz); - } - } - - public void testDST_Europe_Rome() { - // time zone "Europe/Rome", rounding to days. Rome had two midnights on the day the clocks went back in 1978, and - // timeZone.convertLocalToUTC() gives the later of the two because Rome is east of UTC, whereas we want the earlier. - - DateTimeUnit timeUnit = DateTimeUnit.DAY_OF_MONTH; - DateTimeZone tz = DateTimeZone.forID("Europe/Rome"); - Rounding rounding = new TimeUnitRounding(timeUnit, tz); - - { - long timeBeforeFirstMidnight = time("1978-09-30T23:59:00+02:00"); - long floor = rounding.round(timeBeforeFirstMidnight); - assertThat(floor, isDate(time("1978-09-30T00:00:00+02:00"), tz)); - } - - { - long timeBetweenMidnights = time("1978-10-01T00:30:00+02:00"); - long floor = rounding.round(timeBetweenMidnights); - assertThat(floor, isDate(time("1978-10-01T00:00:00+02:00"), tz)); - } - - { - long timeAfterSecondMidnight = time("1978-10-01T00:30:00+01:00"); - long floor = rounding.round(timeAfterSecondMidnight); - assertThat(floor, isDate(time("1978-10-01T00:00:00+02:00"), tz)); - - long prevFloor = rounding.round(floor - 1); - assertThat(prevFloor, lessThan(floor)); - assertThat(prevFloor, isDate(time("1978-09-30T00:00:00+02:00"), tz)); - } - } - - /** - * Test for a time zone whose days overlap because the clocks are set back across midnight at the end of DST. - */ - public void testDST_America_St_Johns() { - // time zone "America/St_Johns", rounding to days. - DateTimeUnit timeUnit = DateTimeUnit.DAY_OF_MONTH; - DateTimeZone tz = DateTimeZone.forID("America/St_Johns"); - Rounding rounding = new TimeUnitRounding(timeUnit, tz); - - // 29 October 2006 - Daylight Saving Time ended, changing the UTC offset from -02:30 to -03:30. - // This happened at 02:31 UTC, 00:01 local time, so the clocks were set back 1 hour to 23:01 on the 28th. - // This means that 2006-10-29 has _two_ midnights, one in the -02:30 offset and one in the -03:30 offset. - // Only the first of these is considered "rounded". Moreover, the extra time between 23:01 and 23:59 - // should be considered as part of the 28th even though it comes after midnight on the 29th. - - { - // Times before the first midnight should be rounded up to the first midnight. - long timeBeforeFirstMidnight = time("2006-10-28T23:30:00.000-02:30"); - long floor = rounding.round(timeBeforeFirstMidnight); - assertThat(floor, isDate(time("2006-10-28T00:00:00.000-02:30"), tz)); - long ceiling = rounding.nextRoundingValue(timeBeforeFirstMidnight); - assertThat(ceiling, isDate(time("2006-10-29T00:00:00.000-02:30"), tz)); - assertInterval(floor, timeBeforeFirstMidnight, ceiling, rounding, tz); - } - - { - // Times between the two midnights which are on the later day should be rounded down to the later day's midnight. - long timeBetweenMidnights = time("2006-10-29T00:00:30.000-02:30"); - // (this is halfway through the last minute before the clocks changed, in which local time was ambiguous) - - long floor = rounding.round(timeBetweenMidnights); - assertThat(floor, isDate(time("2006-10-29T00:00:00.000-02:30"), tz)); - - long ceiling = rounding.nextRoundingValue(timeBetweenMidnights); - assertThat(ceiling, isDate(time("2006-10-30T00:00:00.000-03:30"), tz)); - - assertInterval(floor, timeBetweenMidnights, ceiling, rounding, tz); - } - - { - // Times between the two midnights which are on the earlier day should be rounded down to the earlier day's midnight. - long timeBetweenMidnights = time("2006-10-28T23:30:00.000-03:30"); - // (this is halfway through the hour after the clocks changed, in which local time was ambiguous) - - long floor = rounding.round(timeBetweenMidnights); - assertThat(floor, isDate(time("2006-10-28T00:00:00.000-02:30"), tz)); - - long ceiling = rounding.nextRoundingValue(timeBetweenMidnights); - assertThat(ceiling, isDate(time("2006-10-29T00:00:00.000-02:30"), tz)); - - assertInterval(floor, timeBetweenMidnights, ceiling, rounding, tz); - } - - { - // Times after the second midnight should be rounded down to the first midnight. - long timeAfterSecondMidnight = time("2006-10-29T06:00:00.000-03:30"); - long floor = rounding.round(timeAfterSecondMidnight); - assertThat(floor, isDate(time("2006-10-29T00:00:00.000-02:30"), tz)); - long ceiling = rounding.nextRoundingValue(timeAfterSecondMidnight); - assertThat(ceiling, isDate(time("2006-10-30T00:00:00.000-03:30"), tz)); - assertInterval(floor, timeAfterSecondMidnight, ceiling, rounding, tz); - } - } - - /** - * tests for dst transition with overlaps and day roundings. - */ - public void testDST_END_Edgecases() { - // First case, dst happens at 1am local time, switching back one hour. - // We want the overlapping hour to count for the next day, making it a 25h interval - - DateTimeUnit timeUnit = DateTimeUnit.DAY_OF_MONTH; - DateTimeZone tz = DateTimeZone.forID("Atlantic/Azores"); - Rounding rounding = new Rounding.TimeUnitRounding(timeUnit, tz); - - // Sunday, 29 October 2000, 01:00:00 clocks were turned backward 1 hour - // to Sunday, 29 October 2000, 00:00:00 local standard time instead - // which means there were two midnights that day. - - long midnightBeforeTransition = time("2000-10-29T00:00:00", tz); - long midnightOfTransition = time("2000-10-29T00:00:00-01:00"); - assertEquals(60L * 60L * 1000L, midnightOfTransition - midnightBeforeTransition); - long nextMidnight = time("2000-10-30T00:00:00", tz); - - assertInterval(midnightBeforeTransition, nextMidnight, rounding, 25 * 60, tz); - - assertThat(rounding.round(time("2000-10-29T06:00:00-01:00")), isDate(time("2000-10-29T00:00:00Z"), tz)); - - // Second case, dst happens at 0am local time, switching back one hour to 23pm local time. - // We want the overlapping hour to count for the previous day here - - tz = DateTimeZone.forID("America/Lima"); - rounding = new Rounding.TimeUnitRounding(timeUnit, tz); - - // Sunday, 1 April 1990, 00:00:00 clocks were turned backward 1 hour to - // Saturday, 31 March 1990, 23:00:00 local standard time instead - - midnightBeforeTransition = time("1990-03-31T00:00:00.000-04:00"); - nextMidnight = time("1990-04-01T00:00:00.000-05:00"); - assertInterval(midnightBeforeTransition, nextMidnight, rounding, 25 * 60, tz); - - // make sure the next interval is 24h long again - long midnightAfterTransition = time("1990-04-01T00:00:00.000-05:00"); - nextMidnight = time("1990-04-02T00:00:00.000-05:00"); - assertInterval(midnightAfterTransition, nextMidnight, rounding, 24 * 60, tz); - } - - /** - * Test that time zones are correctly parsed. There is a bug with - * Joda 2.9.4 (see https://github.com/JodaOrg/joda-time/issues/373) - */ - public void testsTimeZoneParsing() { - final DateTime expected = new DateTime(2016, 11, 10, 5, 37, 59, randomDateTimeZone()); - - // Formatter used to print and parse the sample date. - // Printing the date works but parsing it back fails - // with Joda 2.9.4 - DateTimeFormatter formatter = DateTimeFormat.forPattern("YYYY-MM-dd'T'HH:mm:ss " + randomFrom("ZZZ", "[ZZZ]", "'['ZZZ']'")); - - String dateTimeAsString = formatter.print(expected); - assertThat(dateTimeAsString, startsWith("2016-11-10T05:37:59 ")); - - DateTime parsedDateTime = formatter.parseDateTime(dateTimeAsString); - assertThat(parsedDateTime.getZone(), equalTo(expected.getZone())); - } - - private static void assertInterval(long rounded, long nextRoundingValue, Rounding rounding, int minutes, - DateTimeZone tz) { - assertInterval(rounded, dateBetween(rounded, nextRoundingValue), nextRoundingValue, rounding, tz); - assertEquals(DateTimeConstants.MILLIS_PER_MINUTE * minutes, nextRoundingValue - rounded); - } - - /** - * perform a number on assertions and checks on {@link TimeUnitRounding} intervals - * @param rounded the expected low end of the rounding interval - * @param unrounded a date in the interval to be checked for rounding - * @param nextRoundingValue the expected upper end of the rounding interval - * @param rounding the rounding instance - */ - private static void assertInterval(long rounded, long unrounded, long nextRoundingValue, Rounding rounding, DateTimeZone tz) { - assertThat("rounding should be idempotent ", rounding.round(rounded), isDate(rounded, tz)); - assertThat("rounded value smaller or equal than unrounded" + rounding, rounded, lessThanOrEqualTo(unrounded)); - assertThat("values less than rounded should round further down" + rounding, rounding.round(rounded - 1), lessThan(rounded)); - assertThat("nextRounding value should be a rounded date", rounding.round(nextRoundingValue), isDate(nextRoundingValue, tz)); - assertThat("values above nextRounding should round down there", rounding.round(nextRoundingValue + 1), - isDate(nextRoundingValue, tz)); - - if (isTimeWithWellDefinedRounding(tz, unrounded)) { - assertThat("nextRounding value should be greater than date" + rounding, nextRoundingValue, greaterThan(unrounded)); - - long dateBetween = dateBetween(rounded, nextRoundingValue); - assertThat("dateBetween [" + new DateTime(dateBetween, tz) + "] should round down to roundedDate", - rounding.round(dateBetween), isDate(rounded, tz)); - assertThat("dateBetween [" + new DateTime(dateBetween, tz) + "] should round up to nextRoundingValue", - rounding.nextRoundingValue(dateBetween), isDate(nextRoundingValue, tz)); - } - } - - private static boolean isTimeWithWellDefinedRounding(DateTimeZone tz, long t) { - if (tz.getID().equals("America/St_Johns") - || tz.getID().equals("America/Goose_Bay") - || tz.getID().equals("America/Moncton") - || tz.getID().equals("Canada/Newfoundland")) { - - // Clocks went back at 00:01 between 1987 and 2010, causing overlapping days. - // These timezones are otherwise uninteresting, so just skip this period. - - return t <= time("1987-10-01T00:00:00Z") - || t >= time("2010-12-01T00:00:00Z"); - } - - if (tz.getID().equals("Antarctica/Casey")) { - - // Clocks went back 3 hours at 02:00 on 2010-03-05, causing overlapping days. - - return t <= time("2010-03-03T00:00:00Z") - || t >= time("2010-03-07T00:00:00Z"); - } - - return true; - } - - private static long dateBetween(long lower, long upper) { - long dateBetween = randomLongBetween(lower, upper - 1); - assert lower <= dateBetween && dateBetween < upper; - return dateBetween; - } - - private static DateTimeUnit randomTimeUnit() { - byte id = (byte) randomIntBetween(1, 8); - return DateTimeUnit.resolve(id); - } - - private static long time(String time) { - return time(time, DateTimeZone.UTC); - } - - private static long time(String time, DateTimeZone zone) { - return ISODateTimeFormat.dateOptionalTimeParser().withZone(zone).parseMillis(time); - } - - private static Matcher isDate(final long expected, DateTimeZone tz) { - return new TypeSafeMatcher() { - @Override - public boolean matchesSafely(final Long item) { - return expected == item.longValue(); - } - - @Override - public void describeTo(Description description) { - description.appendText(new DateTime(expected, tz) + " [" + expected + "] "); - } - - @Override - protected void describeMismatchSafely(final Long actual, final Description mismatchDescription) { - mismatchDescription.appendText(" was ").appendValue(new DateTime(actual, tz) + " [" + actual + "]"); - } - }; - } -} From ae8d5342d83db26714f7cf02c255e949a3bc66cd Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Wed, 6 Oct 2021 09:57:59 -0700 Subject: [PATCH 196/250] Remove joda uses from client (#78641) Joda has been deprecated internally for many years, but a few uses of joda classes were left in the high level rest client. This commit changes them to use Java time classes, which matches what the backend uses internally for these classes. --- .../job/config/DateHistogramGroupConfig.java | 10 +++++----- .../client/watcher/QueuedWatch.java | 18 +++++++++--------- .../client/watcher/WatchExecutionSnapshot.java | 18 +++++++++--------- .../java/org/elasticsearch/client/CrudIT.java | 11 +++++++---- .../org/elasticsearch/client/TransformIT.java | 2 +- .../client/ml/job/process/DataCountsTests.java | 12 ++++++++---- .../watcher/WatcherStatsResponseTests.java | 11 +++++++---- 7 files changed, 46 insertions(+), 36 deletions(-) diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/rollup/job/config/DateHistogramGroupConfig.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/rollup/job/config/DateHistogramGroupConfig.java index cbd1ab078619a..54383e7bfdabf 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/rollup/job/config/DateHistogramGroupConfig.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/rollup/job/config/DateHistogramGroupConfig.java @@ -9,17 +9,17 @@ import org.elasticsearch.client.Validatable; import org.elasticsearch.client.ValidationException; -import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.xcontent.ConstructingObjectParser; +import org.elasticsearch.common.xcontent.ParseField; import org.elasticsearch.common.xcontent.ToXContentObject; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.core.Nullable; +import org.elasticsearch.core.TimeValue; import org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramInterval; -import org.joda.time.DateTimeZone; import java.io.IOException; +import java.time.ZoneId; import java.util.Collections; import java.util.HashSet; import java.util.Objects; @@ -179,7 +179,7 @@ public DateHistogramGroupConfig(final String field, final DateHistogramInterval * The {@code field} and {@code interval} are required to compute the date histogram for the rolled up documents. * The {@code delay} is optional and can be set to {@code null}. It defines how long to wait before rolling up new documents. * The {@code timeZone} is optional and can be set to {@code null}. When configured, the time zone value is resolved using - * ({@link DateTimeZone#forID(String)} and must match a time zone identifier provided by the Joda Time library. + * ({@link ZoneId#of(String)} and must match a time zone identifier provided by the Joda Time library. *

    * @param field the name of the date field to use for the date histogram (required) * @param interval the interval to use for the date histogram (required) diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/QueuedWatch.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/QueuedWatch.java index d5a1f1c9be65f..3c61a38c758dd 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/QueuedWatch.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/QueuedWatch.java @@ -8,10 +8,10 @@ package org.elasticsearch.client.watcher; -import org.elasticsearch.common.xcontent.ParseField; import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.joda.time.DateTime; +import org.elasticsearch.common.xcontent.ParseField; +import java.time.ZonedDateTime; import java.util.Objects; public class QueuedWatch { @@ -21,8 +21,8 @@ public class QueuedWatch { new ConstructingObjectParser<>("watcher_stats_node", true, (args, c) -> new QueuedWatch( (String) args[0], (String) args[1], - DateTime.parse((String) args[2]), - DateTime.parse((String) args[3]) + ZonedDateTime.parse((String) args[2]), + ZonedDateTime.parse((String) args[3]) )); static { @@ -35,10 +35,10 @@ public class QueuedWatch { private final String watchId; private final String watchRecordId; - private final DateTime triggeredTime; - private final DateTime executionTime; + private final ZonedDateTime triggeredTime; + private final ZonedDateTime executionTime; - public QueuedWatch(String watchId, String watchRecordId, DateTime triggeredTime, DateTime executionTime) { + public QueuedWatch(String watchId, String watchRecordId, ZonedDateTime triggeredTime, ZonedDateTime executionTime) { this.watchId = watchId; this.watchRecordId = watchRecordId; this.triggeredTime = triggeredTime; @@ -53,11 +53,11 @@ public String getWatchRecordId() { return watchRecordId; } - public DateTime getTriggeredTime() { + public ZonedDateTime getTriggeredTime() { return triggeredTime; } - public DateTime getExecutionTime() { + public ZonedDateTime getExecutionTime() { return executionTime; } diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/WatchExecutionSnapshot.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/WatchExecutionSnapshot.java index 16afc35d8782c..c212347a3504d 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/WatchExecutionSnapshot.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/WatchExecutionSnapshot.java @@ -8,10 +8,10 @@ package org.elasticsearch.client.watcher; -import org.elasticsearch.common.xcontent.ParseField; import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.joda.time.DateTime; +import org.elasticsearch.common.xcontent.ParseField; +import java.time.ZonedDateTime; import java.util.Arrays; import java.util.List; import java.util.Locale; @@ -23,8 +23,8 @@ public class WatchExecutionSnapshot { new ConstructingObjectParser<>("watcher_stats_node", true, (args, c) -> new WatchExecutionSnapshot( (String) args[0], (String) args[1], - DateTime.parse((String) args[2]), - DateTime.parse((String) args[3]), + ZonedDateTime.parse((String) args[2]), + ZonedDateTime.parse((String) args[3]), ExecutionPhase.valueOf(((String) args[4]).toUpperCase(Locale.ROOT)), args[5] == null ? null : ((List) args[5]).toArray(new String[0]), args[6] == null ? null : ((List) args[6]).toArray(new String[0]) @@ -42,13 +42,13 @@ public class WatchExecutionSnapshot { private final String watchId; private final String watchRecordId; - private final DateTime triggeredTime; - private final DateTime executionTime; + private final ZonedDateTime triggeredTime; + private final ZonedDateTime executionTime; private final ExecutionPhase phase; private final String[] executedActions; private final String[] executionStackTrace; - public WatchExecutionSnapshot(String watchId, String watchRecordId, DateTime triggeredTime, DateTime executionTime, + public WatchExecutionSnapshot(String watchId, String watchRecordId, ZonedDateTime triggeredTime, ZonedDateTime executionTime, ExecutionPhase phase, String[] executedActions, String[] executionStackTrace) { this.watchId = watchId; this.watchRecordId = watchRecordId; @@ -67,11 +67,11 @@ public String getWatchRecordId() { return watchRecordId; } - public DateTime getTriggeredTime() { + public ZonedDateTime getTriggeredTime() { return triggeredTime; } - public DateTime getExecutionTime() { + public ZonedDateTime getExecutionTime() { return executionTime; } diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/CrudIT.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/CrudIT.java index 27e04881d5896..3da1e41de2ea5 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/CrudIT.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/CrudIT.java @@ -48,15 +48,17 @@ import org.elasticsearch.script.Script; import org.elasticsearch.script.ScriptType; import org.elasticsearch.search.fetch.subphase.FetchSourceContext; -import org.joda.time.DateTime; -import org.joda.time.DateTimeZone; -import org.joda.time.format.DateTimeFormat; import java.io.IOException; +import java.time.LocalTime; +import java.time.ZoneOffset; +import java.time.ZonedDateTime; +import java.time.format.DateTimeFormatter; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; +import java.util.Locale; import java.util.Map; import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; @@ -923,7 +925,8 @@ private void validateBulkResponses(int nbItems, boolean[] errors, BulkResponse b public void testUrlEncode() throws IOException { String indexPattern = ""; String expectedIndex = "logstash-" + - DateTimeFormat.forPattern("YYYY.MM.dd").print(new DateTime(DateTimeZone.UTC).monthOfYear().roundFloorCopy()); + DateTimeFormatter.ofPattern("uuuu.MM.dd", Locale.ROOT) + .format(ZonedDateTime.now(ZoneOffset.UTC).withDayOfMonth(1).with(LocalTime.MIN)); { IndexRequest indexRequest = new IndexRequest(indexPattern).id("id#1"); indexRequest.source("field", "value"); diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/TransformIT.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/TransformIT.java index 689a9ddbc108c..e06fdb2f56f76 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/TransformIT.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/TransformIT.java @@ -53,10 +53,10 @@ import org.elasticsearch.search.aggregations.AggregatorFactories; import org.elasticsearch.search.builder.SearchSourceBuilder; import org.elasticsearch.search.sort.SortOrder; -import org.joda.time.Instant; import org.junit.After; import java.io.IOException; +import java.time.Instant; import java.util.ArrayList; import java.util.HashMap; import java.util.List; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/process/DataCountsTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/process/DataCountsTests.java index 8e78ec3ed6aa3..baaafe7bd53ff 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/process/DataCountsTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/process/DataCountsTests.java @@ -9,20 +9,24 @@ import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; -import org.joda.time.DateTime; import java.time.Instant; +import java.time.ZonedDateTime; +import java.util.Date; public class DataCountsTests extends AbstractXContentTestCase { + private static Date randomDate() { + return Date.from(ZonedDateTime.now(randomZone()).toInstant()); + } + public static DataCounts createTestInstance(String jobId) { return new DataCounts(jobId, randomIntBetween(1, 1_000_000), randomIntBetween(1, 1_000_000), randomIntBetween(1, 1_000_000), randomIntBetween(1, 1_000_000), randomIntBetween(1, 1_000_000), randomIntBetween(1, 1_000_000), randomIntBetween(1, 1_000_000), randomIntBetween(1, 1_000_000), randomIntBetween(1, 1_000_000), randomIntBetween(1, 1_000_000), - new DateTime(randomDateTimeZone()).toDate(), new DateTime(randomDateTimeZone()).toDate(), - new DateTime(randomDateTimeZone()).toDate(), new DateTime(randomDateTimeZone()).toDate(), - new DateTime(randomDateTimeZone()).toDate(), randomBoolean() ? null : Instant.now()); + randomDate(), randomDate(), randomDate(), randomDate(), randomDate(), + randomBoolean() ? null : Instant.now()); } @Override diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/watcher/WatcherStatsResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/watcher/WatcherStatsResponseTests.java index f29ba51113273..1771e29162980 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/watcher/WatcherStatsResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/watcher/WatcherStatsResponseTests.java @@ -12,10 +12,11 @@ import org.elasticsearch.client.NodesResponseHeaderTestUtils; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.test.ESTestCase; -import org.joda.time.DateTime; -import org.joda.time.DateTimeZone; import java.io.IOException; +import java.time.Instant; +import java.time.ZoneOffset; +import java.time.ZonedDateTime; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -142,7 +143,8 @@ protected WatcherStatsResponse createTestInstance() { } } snapshots.add(new WatchExecutionSnapshot(randomAlphaOfLength(10), randomAlphaOfLength(10), - new DateTime(randomInt(), DateTimeZone.UTC), new DateTime(randomInt(), DateTimeZone.UTC), + ZonedDateTime.ofInstant(Instant.ofEpochMilli(randomInt()), ZoneOffset.UTC), + ZonedDateTime.ofInstant(Instant.ofEpochMilli(randomInt()), ZoneOffset.UTC), randomFrom(ExecutionPhase.values()), actions, stackTrace)); } } @@ -153,7 +155,8 @@ protected WatcherStatsResponse createTestInstance() { queuedWatches = new ArrayList<>(queuedWatchCount); for (int j=0; j Date: Wed, 6 Oct 2021 09:59:19 -0700 Subject: [PATCH 197/250] Remove uses of Joda from most server tests (#78654) Joda was deprecated internally many years ago, but there still exist some tests that used it to format dates. This commit converts most tests in server that need date parsing or printing to use Java time. --- .../search/fields/SearchFieldsIT.java | 17 ++- .../aggregation/AggregationProfilerIT.java | 2 +- .../DateMathExpressionResolverTests.java | 59 +++++----- .../common/io/stream/BytesStreamsTests.java | 13 ++- .../common/xcontent/BaseXContentTestCase.java | 102 +++--------------- .../index/mapper/DateFieldTypeTests.java | 28 ++--- .../index/mapper/RangeFieldTypeTests.java | 31 +++--- .../DistanceFeatureQueryBuilderTests.java | 3 +- .../index/query/RangeQueryBuilderTests.java | 30 +++--- .../FunctionScoreQueryBuilderTests.java | 8 +- .../bucket/DateScriptMocksPlugin.java | 20 ++-- .../bucket/range/InternalDateRangeTests.java | 14 +-- 12 files changed, 136 insertions(+), 191 deletions(-) diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/fields/SearchFieldsIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/fields/SearchFieldsIT.java index 5ee11e0e9a657..34af1f1a26216 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/fields/SearchFieldsIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/fields/SearchFieldsIT.java @@ -35,13 +35,11 @@ import org.elasticsearch.search.sort.SortOrder; import org.elasticsearch.test.ESIntegTestCase; import org.elasticsearch.test.InternalSettingsPlugin; -import org.joda.time.DateTime; -import org.joda.time.DateTimeZone; -import org.joda.time.format.DateTimeFormat; import java.time.Instant; import java.time.ZoneOffset; import java.time.ZonedDateTime; +import java.time.format.DateTimeFormatter; import java.util.ArrayList; import java.util.Arrays; import java.util.Base64; @@ -50,6 +48,7 @@ import java.util.HashMap; import java.util.HashSet; import java.util.List; +import java.util.Locale; import java.util.Map; import java.util.Set; import java.util.concurrent.ExecutionException; @@ -921,10 +920,10 @@ public void testDocValueFieldsWithFieldAlias() throws Exception { assertAcked(prepareCreate("test").setMapping(mapping)); ensureGreen("test"); - DateTime date = new DateTime(1990, 12, 29, 0, 0, DateTimeZone.UTC); - org.joda.time.format.DateTimeFormatter formatter = DateTimeFormat.forPattern("yyyy-MM-dd"); + ZonedDateTime date = ZonedDateTime.of(1990, 12, 29, 0, 0, 0, 0, ZoneOffset.UTC); + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("uuuu-MM-dd", Locale.ROOT); - indexDoc("test", "1", "text_field", "foo", "date_field", formatter.print(date)); + indexDoc("test", "1", "text_field", "foo", "date_field", formatter.format(date)); refresh("test"); SearchRequestBuilder builder = client().prepareSearch().setQuery(matchAllQuery()) @@ -984,10 +983,10 @@ public void testWildcardDocValueFieldsWithFieldAlias() throws Exception { assertAcked(prepareCreate("test").setMapping(mapping)); ensureGreen("test"); - DateTime date = new DateTime(1990, 12, 29, 0, 0, DateTimeZone.UTC); - org.joda.time.format.DateTimeFormatter formatter = DateTimeFormat.forPattern("yyyy-MM-dd"); + ZonedDateTime date = ZonedDateTime.of(1990, 12, 29, 0, 0, 0, 0, ZoneOffset.UTC); + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("uuuu-MM-dd", Locale.ROOT); - indexDoc("test", "1", "text_field", "foo", "date_field", formatter.print(date)); + indexDoc("test", "1", "text_field", "foo", "date_field", formatter.format(date)); refresh("test"); SearchRequestBuilder builder = client().prepareSearch().setQuery(matchAllQuery()) diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/profile/aggregation/AggregationProfilerIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/profile/aggregation/AggregationProfilerIT.java index 0937832f0bea5..1be4f21f82935 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/profile/aggregation/AggregationProfilerIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/profile/aggregation/AggregationProfilerIT.java @@ -25,9 +25,9 @@ import org.elasticsearch.search.profile.ProfileResult; import org.elasticsearch.search.profile.SearchProfileShardResult; import org.elasticsearch.test.ESIntegTestCase; -import org.joda.time.Instant; import java.io.IOException; +import java.time.Instant; import java.util.ArrayList; import java.util.List; import java.util.Map; diff --git a/server/src/test/java/org/elasticsearch/cluster/metadata/DateMathExpressionResolverTests.java b/server/src/test/java/org/elasticsearch/cluster/metadata/DateMathExpressionResolverTests.java index af53179b8475c..9fe9f4d222c6c 100644 --- a/server/src/test/java/org/elasticsearch/cluster/metadata/DateMathExpressionResolverTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/metadata/DateMathExpressionResolverTests.java @@ -16,18 +16,20 @@ import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver.DateMathExpressionResolver; import org.elasticsearch.indices.SystemIndices.SystemIndexAccessLevel; import org.elasticsearch.test.ESTestCase; -import org.joda.time.DateTime; -import org.joda.time.DateTimeZone; -import org.joda.time.format.DateTimeFormat; +import java.time.Instant; +import java.time.ZoneId; +import java.time.ZoneOffset; +import java.time.ZonedDateTime; +import java.time.format.DateTimeFormatter; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; +import java.util.Locale; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; -import static org.joda.time.DateTimeZone.UTC; public class DateMathExpressionResolverTests extends ESTestCase { @@ -37,6 +39,15 @@ public class DateMathExpressionResolverTests extends ESTestCase { SystemIndexAccessLevel.NONE ); + private static ZonedDateTime dateFromMillis(long millis) { + return ZonedDateTime.ofInstant(Instant.ofEpochMilli(millis), ZoneOffset.UTC); + } + + private static String formatDate(String pattern, ZonedDateTime zonedDateTime) { + DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern(pattern, Locale.ROOT); + return dateFormatter.format(zonedDateTime); + } + public void testNormal() throws Exception { int numIndexExpressions = randomIntBetween(1, 9); List indexExpressions = new ArrayList<>(numIndexExpressions); @@ -55,11 +66,11 @@ public void testExpression() throws Exception { List result = expressionResolver.resolve(context, indexExpressions); assertThat(result.size(), equalTo(3)); assertThat(result.get(0), - equalTo(".marvel-" + DateTimeFormat.forPattern("YYYY.MM.dd").print(new DateTime(context.getStartTime(), UTC)))); + equalTo(".marvel-" + formatDate("uuuu.MM.dd", dateFromMillis(context.getStartTime())))); assertThat(result.get(1), - equalTo(".watch_history-" + DateTimeFormat.forPattern("YYYY.MM.dd").print(new DateTime(context.getStartTime(), UTC)))); + equalTo(".watch_history-" + formatDate("uuuu.MM.dd", dateFromMillis(context.getStartTime())))); assertThat(result.get(2), - equalTo("logstash-" + DateTimeFormat.forPattern("YYYY.MM.dd").print(new DateTime(context.getStartTime(), UTC)))); + equalTo("logstash-" + formatDate("uuuu.MM.dd", dateFromMillis(context.getStartTime())))); } public void testEmpty() throws Exception { @@ -77,30 +88,30 @@ public void testExpression_MultiParts() throws Exception { List result = expressionResolver.resolve(context, Arrays.asList("<.text1-{now/d}-text2-{now/M}>")); assertThat(result.size(), equalTo(1)); assertThat(result.get(0), equalTo(".text1-" - + DateTimeFormat.forPattern("YYYY.MM.dd").print(new DateTime(context.getStartTime(), UTC)) + + formatDate("uuuu.MM.dd", dateFromMillis(context.getStartTime())) + "-text2-" - + DateTimeFormat.forPattern("YYYY.MM.dd").print(new DateTime(context.getStartTime(), UTC).withDayOfMonth(1)))); + + formatDate("uuuu.MM.dd", dateFromMillis(context.getStartTime()).withDayOfMonth(1)))); } public void testExpression_CustomFormat() throws Exception { List results = expressionResolver.resolve(context, Arrays.asList("<.marvel-{now/d{yyyy.MM.dd}}>")); assertThat(results.size(), equalTo(1)); assertThat(results.get(0), - equalTo(".marvel-" + DateTimeFormat.forPattern("yyyy.MM.dd").print(new DateTime(context.getStartTime(), UTC)))); + equalTo(".marvel-" + formatDate("uuuu.MM.dd", dateFromMillis(context.getStartTime())))); } public void testExpression_EscapeStatic() throws Exception { List result = expressionResolver.resolve(context, Arrays.asList("<.mar\\{v\\}el-{now/d}>")); assertThat(result.size(), equalTo(1)); assertThat(result.get(0), - equalTo(".mar{v}el-" + DateTimeFormat.forPattern("yyyy.MM.dd").print(new DateTime(context.getStartTime(), UTC)))); + equalTo(".mar{v}el-" + formatDate("uuuu.MM.dd", dateFromMillis(context.getStartTime())))); } public void testExpression_EscapeDateFormat() throws Exception { List result = expressionResolver.resolve(context, Arrays.asList("<.marvel-{now/d{'\\{year\\}'yyyy}}>")); assertThat(result.size(), equalTo(1)); assertThat(result.get(0), - equalTo(".marvel-" + DateTimeFormat.forPattern("'{year}'yyyy").print(new DateTime(context.getStartTime(), UTC)))); + equalTo(".marvel-" + formatDate("'{year}'yyyy", dateFromMillis(context.getStartTime())))); } public void testExpression_MixedArray() throws Exception { @@ -110,39 +121,39 @@ public void testExpression_MixedArray() throws Exception { assertThat(result.size(), equalTo(4)); assertThat(result.get(0), equalTo("name1")); assertThat(result.get(1), - equalTo(".marvel-" + DateTimeFormat.forPattern("yyyy.MM.dd").print(new DateTime(context.getStartTime(), UTC)))); + equalTo(".marvel-" + formatDate("uuuu.MM.dd", dateFromMillis(context.getStartTime())))); assertThat(result.get(2), equalTo("name2")); assertThat(result.get(3), equalTo(".logstash-" + - DateTimeFormat.forPattern("yyyy.MM").print(new DateTime(context.getStartTime(), UTC).withDayOfMonth(1)))); + formatDate("uuuu.MM", dateFromMillis(context.getStartTime()).withDayOfMonth(1)))); } public void testExpression_CustomTimeZoneInIndexName() throws Exception { - DateTimeZone timeZone; + ZoneId timeZone; int hoursOffset; int minutesOffset = 0; if (randomBoolean()) { hoursOffset = randomIntBetween(-12, 14); - timeZone = DateTimeZone.forOffsetHours(hoursOffset); + timeZone = ZoneOffset.ofHours(hoursOffset); } else { hoursOffset = randomIntBetween(-11, 13); minutesOffset = randomIntBetween(0, 59); - timeZone = DateTimeZone.forOffsetHoursMinutes(hoursOffset, minutesOffset); + timeZone = ZoneOffset.ofHoursMinutes(hoursOffset, minutesOffset); } - DateTime now; + ZonedDateTime now; if (hoursOffset >= 0) { // rounding to next day 00:00 - now = DateTime.now(UTC).plusHours(hoursOffset).plusMinutes(minutesOffset) - .withHourOfDay(0).withMinuteOfHour(0).withSecondOfMinute(0); + now = ZonedDateTime.now(ZoneOffset.UTC).plusHours(hoursOffset).plusMinutes(minutesOffset) + .withHour(0).withMinute(0).withSecond(0); } else { // rounding to today 00:00 - now = DateTime.now(UTC).withHourOfDay(0).withMinuteOfHour(0).withSecondOfMinute(0); + now = ZonedDateTime.now(ZoneOffset.UTC).withHour(0).withMinute(0).withSecond(0); } - Context context = new Context(this.context.getState(), this.context.getOptions(), now.getMillis(), + Context context = new Context(this.context.getState(), this.context.getOptions(), now.toInstant().toEpochMilli(), SystemIndexAccessLevel.NONE, name -> false, name -> false); - List results = expressionResolver.resolve(context, Arrays.asList("<.marvel-{now/d{yyyy.MM.dd|" + timeZone.getID() + "}}>")); + List results = expressionResolver.resolve(context, Arrays.asList("<.marvel-{now/d{yyyy.MM.dd|" + timeZone.getId() + "}}>")); assertThat(results.size(), equalTo(1)); logger.info("timezone: [{}], now [{}], name: [{}]", timeZone, now, results.get(0)); - assertThat(results.get(0), equalTo(".marvel-" + DateTimeFormat.forPattern("yyyy.MM.dd").print(now.withZone(timeZone)))); + assertThat(results.get(0), equalTo(".marvel-" + formatDate("uuuu.MM.dd", now.withZoneSameInstant(timeZone)))); } public void testExpressionInvalidUnescaped() throws Exception { diff --git a/server/src/test/java/org/elasticsearch/common/io/stream/BytesStreamsTests.java b/server/src/test/java/org/elasticsearch/common/io/stream/BytesStreamsTests.java index be4ba4d1b37cd..5eb1ab545ffb4 100644 --- a/server/src/test/java/org/elasticsearch/common/io/stream/BytesStreamsTests.java +++ b/server/src/test/java/org/elasticsearch/common/io/stream/BytesStreamsTests.java @@ -19,11 +19,10 @@ import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.PageCacheRecycler; import org.elasticsearch.test.ESTestCase; -import org.joda.time.DateTime; -import org.joda.time.DateTimeZone; import java.io.EOFException; import java.io.IOException; +import java.time.Instant; import java.time.OffsetTime; import java.time.ZoneId; import java.time.ZonedDateTime; @@ -298,10 +297,10 @@ public void testSimpleStreams() throws Exception { out.writeOptionalBytesReference(new BytesArray("test")); out.writeOptionalDouble(null); out.writeOptionalDouble(1.2); - out.writeTimeZone(DateTimeZone.forID("CET")); - out.writeOptionalTimeZone(DateTimeZone.getDefault()); + out.writeZoneId(ZoneId.of("CET")); + out.writeOptionalZoneId(ZoneId.systemDefault()); out.writeOptionalTimeZone(null); - out.writeGenericValue(new DateTime(123456, DateTimeZone.forID("America/Los_Angeles"))); + out.writeGenericValue(ZonedDateTime.ofInstant(Instant.ofEpochMilli(123456), ZoneId.of("America/Los_Angeles"))); final OffsetTime offsetNow = OffsetTime.now(randomZone()); out.writeGenericValue(offsetNow); final byte[] bytes = BytesReference.toBytes(out.bytes()); @@ -333,8 +332,8 @@ public void testSimpleStreams() throws Exception { assertThat(in.readOptionalBytesReference(), equalTo(new BytesArray("test"))); assertNull(in.readOptionalDouble()); assertThat(in.readOptionalDouble(), closeTo(1.2, 0.0001)); - assertEquals(DateTimeZone.forID("CET"), in.readTimeZone()); - assertEquals(DateTimeZone.getDefault(), in.readOptionalTimeZone()); + assertEquals(ZoneId.of("CET"), in.readZoneId()); + assertEquals(ZoneId.systemDefault(), in.readOptionalZoneId()); assertNull(in.readOptionalTimeZone()); Object dt = in.readGenericValue(); assertThat(dt, instanceOf(ZonedDateTime.class)); diff --git a/server/src/test/java/org/elasticsearch/common/xcontent/BaseXContentTestCase.java b/server/src/test/java/org/elasticsearch/common/xcontent/BaseXContentTestCase.java index 6904ae36d5439..98953cbaea3e6 100644 --- a/server/src/test/java/org/elasticsearch/common/xcontent/BaseXContentTestCase.java +++ b/server/src/test/java/org/elasticsearch/common/xcontent/BaseXContentTestCase.java @@ -19,20 +19,14 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.geo.GeoPoint; -import org.elasticsearch.core.PathUtils; import org.elasticsearch.common.text.Text; import org.elasticsearch.common.unit.DistanceUnit; import org.elasticsearch.common.util.CollectionUtils; import org.elasticsearch.common.xcontent.XContentParser.Token; +import org.elasticsearch.core.PathUtils; import org.elasticsearch.test.ESTestCase; import org.hamcrest.Matcher; import org.hamcrest.Matchers; -import org.joda.time.DateTime; -import org.joda.time.DateTimeZone; -import org.joda.time.Instant; -import org.joda.time.ReadableInstant; -import org.joda.time.format.DateTimeFormatter; -import org.joda.time.format.ISODateTimeFormat; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; @@ -53,14 +47,15 @@ import java.time.Year; import java.time.ZoneOffset; import java.time.ZonedDateTime; +import java.time.format.DateTimeFormatter; import java.util.ArrayList; import java.util.Arrays; import java.util.Calendar; import java.util.Collections; import java.util.Date; +import java.util.GregorianCalendar; import java.util.HashMap; import java.util.List; -import java.util.Locale; import java.util.Map; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; @@ -402,78 +397,21 @@ public void testText() throws Exception { } } - public void testReadableInstant() throws Exception { - assertResult("{'instant':null}", () -> builder().startObject().timeField("instant", (ReadableInstant) null).endObject()); - assertResult("{'instant':null}", () -> builder().startObject().field("instant").timeValue((ReadableInstant) null).endObject()); - - final DateTime t1 = new DateTime(2016, 1, 1, 0, 0, DateTimeZone.UTC); - - String expected = "{'t1':'2016-01-01T00:00:00.000Z'}"; - assertResult(expected, () -> builder().startObject().timeField("t1", t1).endObject()); - assertResult(expected, () -> builder().startObject().field("t1").timeValue(t1).endObject()); - - final DateTime t2 = new DateTime(2016, 12, 25, 7, 59, 42, 213, DateTimeZone.UTC); - - expected = "{'t2':'2016-12-25T07:59:42.213Z'}"; - assertResult(expected, () -> builder().startObject().timeField("t2", t2).endObject()); - assertResult(expected, () -> builder().startObject().field("t2").timeValue(t2).endObject()); - - final DateTimeFormatter formatter = randomFrom(ISODateTimeFormat.basicDate(), ISODateTimeFormat.dateTimeNoMillis()); - final DateTime t3 = DateTime.now(); - - expected = "{'t3':'" + formatter.print(t3) + "'}"; - assertResult(expected, () -> builder().startObject().timeField("t3", formatter.print(t3)).endObject()); - assertResult(expected, () -> builder().startObject().field("t3").value(formatter.print(t3)).endObject()); - - final DateTime t4 = new DateTime(randomDateTimeZone()); - - expected = "{'t4':'" + formatter.print(t4) + "'}"; - assertResult(expected, () -> builder().startObject().timeField("t4", formatter.print(t4)).endObject()); - assertResult(expected, () -> builder().startObject().field("t4").value(formatter.print(t4)).endObject()); - - long date = Math.abs(randomLong() % (2 * (long) 10e11)); // 1970-01-01T00:00:00Z - 2033-05-18T05:33:20.000+02:00 - final DateTime t5 = new DateTime(date, randomDateTimeZone()); - - expected = "{'t5':'" + XContentElasticsearchExtension.DEFAULT_DATE_PRINTER.print(t5) + "'}"; - assertResult(expected, () -> builder().startObject().timeField("t5", t5).endObject()); - assertResult(expected, () -> builder().startObject().field("t5").timeValue(t5).endObject()); - - expected = "{'t5':'" + formatter.print(t5) + "'}"; - assertResult(expected, () -> builder().startObject().timeField("t5", formatter.print(t5)).endObject()); - assertResult(expected, () -> builder().startObject().field("t5").value(formatter.print(t5)).endObject()); - - Instant i1 = new Instant(1451606400000L); // 2016-01-01T00:00:00.000Z - expected = "{'i1':'2016-01-01T00:00:00.000Z'}"; - assertResult(expected, () -> builder().startObject().timeField("i1", i1).endObject()); - assertResult(expected, () -> builder().startObject().field("i1").timeValue(i1).endObject()); - - Instant i2 = new Instant(1482652782213L); // 2016-12-25T07:59:42.213Z - expected = "{'i2':'" + formatter.print(i2) + "'}"; - assertResult(expected, () -> builder().startObject().timeField("i2", formatter.print(i2)).endObject()); - assertResult(expected, () -> builder().startObject().field("i2").value(formatter.print(i2)).endObject()); - } - public void testDate() throws Exception { assertResult("{'date':null}", () -> builder().startObject().timeField("date", (Date) null).endObject()); assertResult("{'date':null}", () -> builder().startObject().field("date").timeValue((Date) null).endObject()); - final Date d1 = new DateTime(2016, 1, 1, 0, 0, DateTimeZone.UTC).toDate(); + final Date d1 = Date.from(ZonedDateTime.of(2016, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC).toInstant()); assertResult("{'d1':'2016-01-01T00:00:00.000Z'}", () -> builder().startObject().timeField("d1", d1).endObject()); assertResult("{'d1':'2016-01-01T00:00:00.000Z'}", () -> builder().startObject().field("d1").timeValue(d1).endObject()); - final Date d2 = new DateTime(2016, 12, 25, 7, 59, 42, 213, DateTimeZone.UTC).toDate(); + final Date d2 = Date.from(ZonedDateTime.of(2016, 12, 25, 7, 59, 42, 213000000, ZoneOffset.UTC).toInstant()); assertResult("{'d2':'2016-12-25T07:59:42.213Z'}", () -> builder().startObject().timeField("d2", d2).endObject()); assertResult("{'d2':'2016-12-25T07:59:42.213Z'}", () -> builder().startObject().field("d2").timeValue(d2).endObject()); - - final DateTimeFormatter formatter = randomFrom(ISODateTimeFormat.basicDate(), ISODateTimeFormat.dateTimeNoMillis()); - final Date d3 = DateTime.now().toDate(); - - String expected = "{'d3':'" + formatter.print(d3.getTime()) + "'}"; - assertResult(expected, () -> builder().startObject().field("d3").value(formatter.print(d3.getTime())).endObject()); } public void testDateField() throws Exception { - final Date d = new DateTime(2016, 1, 1, 0, 0, DateTimeZone.UTC).toDate(); + final Date d = Date.from(ZonedDateTime.of(2016, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC).toInstant()); assertResult("{'date_in_millis':1451606400000}", () -> builder() .startObject() @@ -487,7 +425,7 @@ public void testDateField() throws Exception { } public void testCalendar() throws Exception { - Calendar calendar = new DateTime(2016, 1, 1, 0, 0, DateTimeZone.UTC).toCalendar(Locale.ROOT); + Calendar calendar = GregorianCalendar.from(ZonedDateTime.of(2016, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC)); assertResult("{'calendar':'2016-01-01T00:00:00.000Z'}", () -> builder() .startObject() .field("calendar") @@ -653,17 +591,13 @@ public void testObjects() throws Exception { final String paths = Constants.WINDOWS ? "{'objects':['a\\\\b\\\\c','d\\\\e']}" : "{'objects':['a/b/c','d/e']}"; objects.put(paths, new Object[]{PathUtils.get("a", "b", "c"), PathUtils.get("d", "e")}); - final DateTimeFormatter formatter = XContentElasticsearchExtension.DEFAULT_DATE_PRINTER; - final Date d1 = new DateTime(2016, 1, 1, 0, 0, DateTimeZone.UTC).toDate(); - final Date d2 = new DateTime(2015, 1, 1, 0, 0, DateTimeZone.UTC).toDate(); - objects.put("{'objects':['" + formatter.print(d1.getTime()) + "','" + formatter.print(d2.getTime()) + "']}", new Object[]{d1, d2}); + final DateTimeFormatter formatter = DateTimeFormatter.ISO_INSTANT; + final Date d1 = Date.from(ZonedDateTime.of(2016, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC).toInstant()); + final Date d2 = Date.from(ZonedDateTime.of(2015, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC).toInstant()); + objects.put("{'objects':['2016-01-01T00:00:00.000Z','2015-01-01T00:00:00.000Z']}", new Object[]{d1, d2}); - final DateTime dt1 = DateTime.now(); - final DateTime dt2 = new DateTime(2016, 12, 25, 7, 59, 42, 213, DateTimeZone.UTC); - objects.put("{'objects':['" + formatter.print(dt1) + "','2016-12-25T07:59:42.213Z']}", new Object[]{dt1, dt2}); - - final Calendar c1 = new DateTime(2012, 7, 7, 10, 23, DateTimeZone.UTC).toCalendar(Locale.ROOT); - final Calendar c2 = new DateTime(2014, 11, 16, 19, 36, DateTimeZone.UTC).toCalendar(Locale.ROOT); + final Calendar c1 = GregorianCalendar.from(ZonedDateTime.of(2012, 7, 7, 10, 23, 0, 0, ZoneOffset.UTC)); + final Calendar c2 = GregorianCalendar.from(ZonedDateTime.of(2014, 11, 16, 19, 36, 0, 0, ZoneOffset.UTC)); objects.put("{'objects':['2012-07-07T10:23:00.000Z','2014-11-16T19:36:00.000Z']}", new Object[]{c1, c2}); final ToXContent x1 = (builder, params) -> builder.startObject().field("f1", "v1").field("f2", 2).array("f3", 3, 4, 5).endObject(); @@ -701,14 +635,10 @@ public void testObject() throws Exception { final String path = Constants.WINDOWS ? "{'object':'a\\\\b\\\\c'}" : "{'object':'a/b/c'}"; object.put(path, PathUtils.get("a", "b", "c")); - final DateTimeFormatter formatter = XContentElasticsearchExtension.DEFAULT_DATE_PRINTER; - final Date d1 = new DateTime(2016, 1, 1, 0, 0, DateTimeZone.UTC).toDate(); - object.put("{'object':'" + formatter.print(d1.getTime()) + "'}", d1); - - final DateTime d2 = DateTime.now(); - object.put("{'object':'" + formatter.print(d2) + "'}", d2); + final Date d1 = Date.from(ZonedDateTime.of(2016, 1, 1, 0, 0, 0,0, ZoneOffset.UTC).toInstant()); + object.put("{'object':'" + "2016-01-01T00:00:00.000Z" + "'}", d1); - final Calendar c1 = new DateTime(2010, 1, 1, 0, 0, DateTimeZone.UTC).toCalendar(Locale.ROOT); + final Calendar c1 = GregorianCalendar.from(ZonedDateTime.of(2010, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC)); object.put("{'object':'2010-01-01T00:00:00.000Z'}", c1); final ToXContent x1 = (builder, params) -> builder.startObject().field("f1", "v1").field("f2", 2).array("f3", 3, 4, 5).endObject(); diff --git a/server/src/test/java/org/elasticsearch/index/mapper/DateFieldTypeTests.java b/server/src/test/java/org/elasticsearch/index/mapper/DateFieldTypeTests.java index 72ae9f6976d84..c1b971b3deb92 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/DateFieldTypeTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/DateFieldTypeTests.java @@ -38,10 +38,10 @@ import org.elasticsearch.index.query.DateRangeIncludingNowQuery; import org.elasticsearch.index.query.QueryRewriteContext; import org.elasticsearch.index.query.SearchExecutionContext; -import org.joda.time.DateTimeZone; import java.io.IOException; import java.time.Instant; +import java.time.ZoneId; import java.time.ZoneOffset; import java.util.Collections; import java.util.List; @@ -85,8 +85,8 @@ public void isFieldWithinRangeTestCase(DateFieldType ft) throws IOException { DateMathParser alternateFormat = DateFieldMapper.DEFAULT_DATE_TIME_FORMATTER.toDateMathParser(); doTestIsFieldWithinQuery(ft, reader, null, null); doTestIsFieldWithinQuery(ft, reader, null, alternateFormat); - doTestIsFieldWithinQuery(ft, reader, DateTimeZone.UTC, null); - doTestIsFieldWithinQuery(ft, reader, DateTimeZone.UTC, alternateFormat); + doTestIsFieldWithinQuery(ft, reader, ZoneOffset.UTC, null); + doTestIsFieldWithinQuery(ft, reader, ZoneOffset.UTC, alternateFormat); QueryRewriteContext context = new QueryRewriteContext(xContentRegistry(), writableRegistry(), null, () -> nowInMillis); @@ -99,28 +99,28 @@ public void isFieldWithinRangeTestCase(DateFieldType ft) throws IOException { } private void doTestIsFieldWithinQuery(DateFieldType ft, DirectoryReader reader, - DateTimeZone zone, DateMathParser alternateFormat) throws IOException { + ZoneId zone, DateMathParser alternateFormat) throws IOException { QueryRewriteContext context = new QueryRewriteContext(xContentRegistry(), writableRegistry(), null, () -> nowInMillis); assertEquals(Relation.INTERSECTS, ft.isFieldWithinQuery(reader, "2015-10-09", "2016-01-02", - randomBoolean(), randomBoolean(), null, null, context)); + randomBoolean(), randomBoolean(), zone, null, context)); assertEquals(Relation.INTERSECTS, ft.isFieldWithinQuery(reader, "2016-01-02", "2016-06-20", - randomBoolean(), randomBoolean(), null, null, context)); + randomBoolean(), randomBoolean(), zone, null, context)); assertEquals(Relation.INTERSECTS, ft.isFieldWithinQuery(reader, "2016-01-02", "2016-02-12", - randomBoolean(), randomBoolean(), null, null, context)); + randomBoolean(), randomBoolean(), zone, null, context)); assertEquals(Relation.DISJOINT, ft.isFieldWithinQuery(reader, "2014-01-02", "2015-02-12", - randomBoolean(), randomBoolean(), null, null, context)); + randomBoolean(), randomBoolean(), zone, null, context)); assertEquals(Relation.DISJOINT, ft.isFieldWithinQuery(reader, "2016-05-11", "2016-08-30", - randomBoolean(), randomBoolean(), null, null, context)); + randomBoolean(), randomBoolean(), zone, null, context)); assertEquals(Relation.WITHIN, ft.isFieldWithinQuery(reader, "2015-09-25", "2016-05-29", - randomBoolean(), randomBoolean(), null, null, context)); + randomBoolean(), randomBoolean(), zone, null, context)); assertEquals(Relation.WITHIN, ft.isFieldWithinQuery(reader, "2015-10-12", "2016-04-03", - true, true, null, null, context)); + true, true, zone, null, context)); assertEquals(Relation.INTERSECTS, ft.isFieldWithinQuery(reader, "2015-10-12", "2016-04-03", - false, false, null, null, context)); + false, false, zone, null, context)); assertEquals(Relation.INTERSECTS, ft.isFieldWithinQuery(reader, "2015-10-12", "2016-04-03", - false, true, null, null, context)); + false, true, zone, null, context)); assertEquals(Relation.INTERSECTS, ft.isFieldWithinQuery(reader, "2015-10-12", "2016-04-03", - true, false, null, null, context)); + true, false, zone, null, context)); } public void testValueFormat() { diff --git a/server/src/test/java/org/elasticsearch/index/mapper/RangeFieldTypeTests.java b/server/src/test/java/org/elasticsearch/index/mapper/RangeFieldTypeTests.java index 9d213292ddb0d..1149eea891459 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/RangeFieldTypeTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/RangeFieldTypeTests.java @@ -29,14 +29,16 @@ import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.mapper.DateFieldMapper.DateFieldType; import org.elasticsearch.index.mapper.RangeFieldMapper.RangeFieldType; -import org.elasticsearch.index.query.SearchExecutionContext; import org.elasticsearch.index.query.QueryShardException; +import org.elasticsearch.index.query.SearchExecutionContext; import org.elasticsearch.test.IndexSettingsModule; -import org.joda.time.DateTime; import org.junit.Before; import java.io.IOException; import java.net.InetAddress; +import java.time.Instant; +import java.time.ZoneOffset; +import java.time.ZonedDateTime; import java.util.Collections; import java.util.List; import java.util.Map; @@ -100,8 +102,8 @@ public void testRangeQueryIntersectsAdjacentValues() throws Exception { } case DATE: { long fromValue = randomInt(); - from = new DateTime(fromValue); - to = new DateTime(fromValue + 1); + from = ZonedDateTime.ofInstant(Instant.ofEpochMilli(fromValue), ZoneOffset.UTC); + to = ZonedDateTime.ofInstant(Instant.ofEpochMilli(fromValue + 1), ZoneOffset.UTC); break; } case INTEGER: { @@ -157,8 +159,8 @@ public void testFromLargerToErrors() throws Exception { } case DATE: { long fromValue = randomInt(); - from = new DateTime(fromValue); - to = new DateTime(fromValue - 1); + from = ZonedDateTime.ofInstant(Instant.ofEpochMilli(fromValue), ZoneOffset.UTC); + to = ZonedDateTime.ofInstant(Instant.ofEpochMilli(fromValue - 1), ZoneOffset.UTC); break; } case INTEGER: { @@ -284,7 +286,7 @@ public void testDateVsDateRangeBounds() { private Query getExpectedRangeQuery(ShapeRelation relation, Object from, Object to, boolean includeLower, boolean includeUpper) { switch (type) { case DATE: - return getDateRangeQuery(relation, (DateTime)from, (DateTime)to, includeLower, includeUpper); + return getDateRangeQuery(relation, (ZonedDateTime)from, (ZonedDateTime)to, includeLower, includeUpper); case INTEGER: return getIntRangeQuery(relation, (int)from, (int)to, includeLower, includeUpper); case LONG: @@ -298,9 +300,10 @@ private Query getExpectedRangeQuery(ShapeRelation relation, Object from, Object } } - private Query getDateRangeQuery(ShapeRelation relation, DateTime from, DateTime to, boolean includeLower, boolean includeUpper) { - long[] lower = new long[] {from.getMillis() + (includeLower ? 0 : 1)}; - long[] upper = new long[] {to.getMillis() - (includeUpper ? 0 : 1)}; + private Query getDateRangeQuery(ShapeRelation relation, ZonedDateTime from, ZonedDateTime to, + boolean includeLower, boolean includeUpper) { + long[] lower = new long[] {from.toInstant().toEpochMilli() + (includeLower ? 0 : 1)}; + long[] upper = new long[] {to.toInstant().toEpochMilli() - (includeUpper ? 0 : 1)}; Query indexQuery; BinaryDocValuesRangeQuery.QueryType queryType; if (relation == ShapeRelation.WITHIN) { @@ -313,8 +316,8 @@ private Query getDateRangeQuery(ShapeRelation relation, DateTime from, DateTime indexQuery = LongRange.newIntersectsQuery("field", lower, upper); queryType = BinaryDocValuesRangeQuery.QueryType.INTERSECTS; } - Query dvQuery = RangeType.DATE.dvRangeQuery("field", queryType, from.getMillis(), - to.getMillis(), includeLower, includeUpper); + Query dvQuery = RangeType.DATE.dvRangeQuery("field", queryType, from.toInstant().toEpochMilli(), + to.toInstant().toEpochMilli(), includeLower, includeUpper); return new IndexOrDocValuesQuery(indexQuery, dvQuery); } @@ -425,7 +428,7 @@ private Object nextFrom() throws Exception { case INTEGER: return (int)(random().nextInt() * 0.5 - DISTANCE); case DATE: - return DateTime.now(); + return ZonedDateTime.now(ZoneOffset.UTC); case LONG: return (long)(random().nextLong() * 0.5 - DISTANCE); case FLOAT: @@ -442,7 +445,7 @@ private Object nextTo(Object from) throws Exception { case INTEGER: return (Integer)from + DISTANCE; case DATE: - return DateTime.now().plusDays(DISTANCE); + return ZonedDateTime.now(ZoneOffset.UTC).plusDays(DISTANCE); case LONG: return (Long)from + DISTANCE; case DOUBLE: diff --git a/server/src/test/java/org/elasticsearch/index/query/DistanceFeatureQueryBuilderTests.java b/server/src/test/java/org/elasticsearch/index/query/DistanceFeatureQueryBuilderTests.java index 958106debfb91..0ef30cc129b7c 100644 --- a/server/src/test/java/org/elasticsearch/index/query/DistanceFeatureQueryBuilderTests.java +++ b/server/src/test/java/org/elasticsearch/index/query/DistanceFeatureQueryBuilderTests.java @@ -20,7 +20,6 @@ import org.elasticsearch.index.mapper.DateFieldMapper.DateFieldType; import org.elasticsearch.index.query.DistanceFeatureQueryBuilder.Origin; import org.elasticsearch.test.AbstractQueryTestCase; -import org.joda.time.DateTime; import java.io.IOException; import java.time.Instant; @@ -41,7 +40,7 @@ protected DistanceFeatureQueryBuilder doCreateTestQueryBuilder() { break; case DATE_FIELD_NAME: long randomDateMills = randomLongBetween(0, 2_000_000_000_000L); - origin = randomBoolean() ? new Origin(randomDateMills) : new Origin(new DateTime(randomDateMills).toString()); + origin = randomBoolean() ? new Origin(randomDateMills) : new Origin(Instant.ofEpochMilli(randomDateMills).toString()); pivot = randomTimeValue(1, 1000, "d", "h", "ms", "s", "m"); break; default: // DATE_NANOS_FIELD_NAME diff --git a/server/src/test/java/org/elasticsearch/index/query/RangeQueryBuilderTests.java b/server/src/test/java/org/elasticsearch/index/query/RangeQueryBuilderTests.java index 96e595c3b6f08..75cc1bfb2b9f7 100644 --- a/server/src/test/java/org/elasticsearch/index/query/RangeQueryBuilderTests.java +++ b/server/src/test/java/org/elasticsearch/index/query/RangeQueryBuilderTests.java @@ -29,8 +29,6 @@ import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.mapper.MappedFieldType.Relation; import org.elasticsearch.test.AbstractQueryTestCase; -import org.joda.time.DateTime; -import org.joda.time.chrono.ISOChronology; import java.io.IOException; import java.time.Instant; @@ -257,8 +255,8 @@ public void testDateRangeQueryFormat() throws IOException { assertThat(parsedQuery, instanceOf(PointRangeQuery.class)); assertEquals(LongPoint.newRangeQuery(DATE_FIELD_NAME, - DateTime.parse("2012-01-01T00:00:00.000+00").getMillis(), - DateTime.parse("2030-01-01T00:00:00.000+00").getMillis() - 1), + ZonedDateTime.parse("2012-01-01T00:00:00.000+00").toInstant().toEpochMilli(), + ZonedDateTime.parse("2030-01-01T00:00:00.000+00").toInstant().toEpochMilli() - 1), parsedQuery); // Test Invalid format @@ -288,8 +286,8 @@ public void testDateRangeBoundaries() throws IOException { parsedQuery = ((IndexOrDocValuesQuery) parsedQuery).getIndexQuery(); assertThat(parsedQuery, instanceOf(PointRangeQuery.class)); assertEquals(LongPoint.newRangeQuery(DATE_FIELD_NAME, - DateTime.parse("2014-11-01T00:00:00.000+00").getMillis(), - DateTime.parse("2014-12-08T23:59:59.999+00").getMillis()), + ZonedDateTime.parse("2014-11-01T00:00:00.000+00").toInstant().toEpochMilli(), + ZonedDateTime.parse("2014-12-08T23:59:59.999+00").toInstant().toEpochMilli()), parsedQuery); query = "{\n" + @@ -305,8 +303,8 @@ public void testDateRangeBoundaries() throws IOException { parsedQuery = ((IndexOrDocValuesQuery) parsedQuery).getIndexQuery(); assertThat(parsedQuery, instanceOf(PointRangeQuery.class)); assertEquals(LongPoint.newRangeQuery(DATE_FIELD_NAME, - DateTime.parse("2014-11-30T23:59:59.999+00").getMillis() + 1, - DateTime.parse("2014-12-08T00:00:00.000+00").getMillis() - 1), + ZonedDateTime.parse("2014-11-30T23:59:59.999+00").toInstant().toEpochMilli() + 1, + ZonedDateTime.parse("2014-12-08T00:00:00.000+00").toInstant().toEpochMilli() - 1), parsedQuery); } @@ -387,8 +385,8 @@ protected MappedFieldType.Relation getRelation(QueryRewriteContext queryRewriteC return Relation.WITHIN; } }; - DateTime queryFromValue = new DateTime(2015, 1, 1, 0, 0, 0, ISOChronology.getInstanceUTC()); - DateTime queryToValue = new DateTime(2016, 1, 1, 0, 0, 0, ISOChronology.getInstanceUTC()); + ZonedDateTime queryFromValue = ZonedDateTime.of(2015, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC); + ZonedDateTime queryToValue = ZonedDateTime.of(2016, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC); query.from(queryFromValue); query.to(queryToValue); SearchExecutionContext searchExecutionContext = createSearchExecutionContext(); @@ -422,8 +420,8 @@ protected MappedFieldType.Relation getRelation(QueryRewriteContext queryRewriteC return Relation.WITHIN; } }; - DateTime queryFromValue = new DateTime(2015, 1, 1, 0, 0, 0, ISOChronology.getInstanceUTC()); - DateTime queryToValue = new DateTime(2016, 1, 1, 0, 0, 0, ISOChronology.getInstanceUTC()); + ZonedDateTime queryFromValue = ZonedDateTime.of(2015, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC); + ZonedDateTime queryToValue = ZonedDateTime.of(2016, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC); query.from(queryFromValue); query.to(queryToValue); query.timeZone(randomZone().getId()); @@ -447,8 +445,8 @@ protected MappedFieldType.Relation getRelation(QueryRewriteContext queryRewriteC return Relation.DISJOINT; } }; - DateTime queryFromValue = new DateTime(2015, 1, 1, 0, 0, 0, ISOChronology.getInstanceUTC()); - DateTime queryToValue = new DateTime(2016, 1, 1, 0, 0, 0, ISOChronology.getInstanceUTC()); + ZonedDateTime queryFromValue = ZonedDateTime.of(2015, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC); + ZonedDateTime queryToValue = ZonedDateTime.of(2016, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC); query.from(queryFromValue); query.to(queryToValue); SearchExecutionContext searchExecutionContext = createSearchExecutionContext(); @@ -464,8 +462,8 @@ protected MappedFieldType.Relation getRelation(QueryRewriteContext queryRewriteC return Relation.INTERSECTS; } }; - DateTime queryFromValue = new DateTime(2015, 1, 1, 0, 0, 0, ISOChronology.getInstanceUTC()); - DateTime queryToValue = new DateTime(2016, 1, 1, 0, 0, 0, ISOChronology.getInstanceUTC()); + ZonedDateTime queryFromValue = ZonedDateTime.of(2015, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC); + ZonedDateTime queryToValue = ZonedDateTime.of(2016, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC); query.from(queryFromValue); query.to(queryToValue); SearchExecutionContext searchExecutionContext = createSearchExecutionContext(); diff --git a/server/src/test/java/org/elasticsearch/index/query/functionscore/FunctionScoreQueryBuilderTests.java b/server/src/test/java/org/elasticsearch/index/query/functionscore/FunctionScoreQueryBuilderTests.java index c484635c8acb6..95bd2b0eef61c 100644 --- a/server/src/test/java/org/elasticsearch/index/query/functionscore/FunctionScoreQueryBuilderTests.java +++ b/server/src/test/java/org/elasticsearch/index/query/functionscore/FunctionScoreQueryBuilderTests.java @@ -54,10 +54,11 @@ import org.elasticsearch.test.TestGeoShapeFieldMapperPlugin; import org.hamcrest.CoreMatchers; import org.hamcrest.Matcher; -import org.joda.time.DateTime; -import org.joda.time.DateTimeZone; import java.io.IOException; +import java.time.Instant; +import java.time.ZoneOffset; +import java.time.ZonedDateTime; import java.util.Arrays; import java.util.Collection; import java.util.Collections; @@ -230,7 +231,8 @@ private static DecayFunctionBuilder createRandomDecayFunction() { offset = randomFrom(DistanceUnit.values()).toString(randomDouble()); break; case DATE_FIELD_NAME: - origin = new DateTime(System.currentTimeMillis() - randomIntBetween(0, 1000000), DateTimeZone.UTC).toString(); + origin = ZonedDateTime.ofInstant( + Instant.ofEpochMilli(System.currentTimeMillis() - randomIntBetween(0, 1000000)), ZoneOffset.UTC).toString(); scale = randomTimeValue(1, 1000, "d", "h", "ms", "s", "m"); offset = randomPositiveTimeValue(); break; diff --git a/server/src/test/java/org/elasticsearch/search/aggregations/bucket/DateScriptMocksPlugin.java b/server/src/test/java/org/elasticsearch/search/aggregations/bucket/DateScriptMocksPlugin.java index 13a9906ec2d39..c4fe9315e6461 100644 --- a/server/src/test/java/org/elasticsearch/search/aggregations/bucket/DateScriptMocksPlugin.java +++ b/server/src/test/java/org/elasticsearch/search/aggregations/bucket/DateScriptMocksPlugin.java @@ -10,9 +10,10 @@ import org.elasticsearch.script.MockScriptPlugin; import org.elasticsearch.search.lookup.LeafDocLookup; -import org.joda.time.DateTime; -import org.joda.time.DateTimeZone; +import java.time.Instant; +import java.time.ZoneOffset; +import java.time.ZonedDateTime; import java.util.HashMap; import java.util.Map; import java.util.function.Function; @@ -37,18 +38,21 @@ public Map, Object>> pluginScripts() { String fieldname = (String) params.get("fieldname"); return docLookup.get(fieldname); }); - scripts.put( - DOUBLE_PLUS_ONE_MONTH, - params -> new DateTime(Double.valueOf((double) params.get("_value")).longValue(), DateTimeZone.UTC).plusMonths(1).getMillis() - ); - scripts.put(LONG_PLUS_ONE_MONTH, params -> new DateTime((long) params.get("_value"), DateTimeZone.UTC).plusMonths(1).getMillis()); + scripts.put(DOUBLE_PLUS_ONE_MONTH, params -> { + Instant instant = Instant.ofEpochMilli(Double.valueOf((double) params.get("_value")).longValue()); + return ZonedDateTime.ofInstant(instant, ZoneOffset.UTC).plusMonths(1).toInstant().toEpochMilli(); + }); + scripts.put(LONG_PLUS_ONE_MONTH, params -> { + Instant instant = Instant.ofEpochMilli((long) params.get("_value")); + return ZonedDateTime.ofInstant(instant, ZoneOffset.UTC).plusMonths(1).toInstant().toEpochMilli(); + }); return scripts; } @Override protected Map, Object>> nonDeterministicPluginScripts() { Map, Object>> scripts = new HashMap<>(); - scripts.put(CURRENT_DATE, params -> new DateTime().getMillis()); + scripts.put(CURRENT_DATE, params -> ZonedDateTime.now().toInstant().toEpochMilli()); return scripts; } } diff --git a/server/src/test/java/org/elasticsearch/search/aggregations/bucket/range/InternalDateRangeTests.java b/server/src/test/java/org/elasticsearch/search/aggregations/bucket/range/InternalDateRangeTests.java index cf1fee78fb8a5..ac7e0f54ac0ca 100644 --- a/server/src/test/java/org/elasticsearch/search/aggregations/bucket/range/InternalDateRangeTests.java +++ b/server/src/test/java/org/elasticsearch/search/aggregations/bucket/range/InternalDateRangeTests.java @@ -13,9 +13,9 @@ import org.elasticsearch.search.aggregations.InternalAggregations; import org.elasticsearch.search.aggregations.InternalMultiBucketAggregation; import org.elasticsearch.search.aggregations.ParsedMultiBucketAggregation; -import org.joda.time.DateTime; -import org.joda.time.DateTimeZone; +import java.time.ZoneOffset; +import java.time.ZonedDateTime; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -33,7 +33,7 @@ public void setUp() throws Exception { super.setUp(); format = randomNumericDocValueFormat(); - Function interval = randomFrom( + Function interval = randomFrom( dateTime -> dateTime.plusSeconds(1), dateTime -> dateTime.plusMinutes(1), dateTime -> dateTime.plusHours(1), @@ -45,13 +45,13 @@ public void setUp() throws Exception { final int numRanges = randomNumberOfBuckets(); final List> listOfRanges = new ArrayList<>(numRanges); - DateTime date = new DateTime(DateTimeZone.UTC); - double start = date.getMillis(); + ZonedDateTime date = ZonedDateTime.now(ZoneOffset.UTC); + double start = date.toInstant().toEpochMilli(); double end = 0; for (int i = 0; i < numRanges; i++) { - double from = date.getMillis(); + double from = date.toInstant().toEpochMilli(); date = interval.apply(date); - double to = date.getMillis(); + double to = date.toInstant().toEpochMilli(); if (to > end) { end = to; } From 57a501cecf64b4cbb3b73bea86d462045016c15a Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Wed, 6 Oct 2021 09:59:56 -0700 Subject: [PATCH 198/250] Remove uses of Joda from xpack tests (#78660) Joda was deprecated internally many years ago, but there still exist some tests that use it to format dates. This commit converts tests in xpack that need date parsing or printing to use Java time. --- .../job/RollupIndexerIndexingTests.java | 36 ++++++++++--------- .../audit/index/IndexNameResolver.java | 14 ++++---- .../authz/IndicesAndAliasesResolverTests.java | 15 ++++---- .../authz/store/CompositeRolesStoreTests.java | 5 +-- .../integration/TransformIntegTestCase.java | 2 +- .../integration/TransformRestTestCase.java | 2 +- 6 files changed, 40 insertions(+), 34 deletions(-) diff --git a/x-pack/plugin/rollup/src/test/java/org/elasticsearch/xpack/rollup/job/RollupIndexerIndexingTests.java b/x-pack/plugin/rollup/src/test/java/org/elasticsearch/xpack/rollup/job/RollupIndexerIndexingTests.java index bbf471cc5f522..ce6aad81bface 100644 --- a/x-pack/plugin/rollup/src/test/java/org/elasticsearch/xpack/rollup/job/RollupIndexerIndexingTests.java +++ b/x-pack/plugin/rollup/src/test/java/org/elasticsearch/xpack/rollup/job/RollupIndexerIndexingTests.java @@ -59,12 +59,12 @@ import org.elasticsearch.xpack.core.rollup.job.MetricConfig; import org.elasticsearch.xpack.core.rollup.job.RollupJob; import org.elasticsearch.xpack.core.rollup.job.RollupJobConfig; -import org.joda.time.DateTime; -import org.joda.time.DateTimeZone; import org.junit.Before; import java.io.IOException; import java.time.ZoneId; +import java.time.ZoneOffset; +import java.time.ZonedDateTime; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -137,7 +137,7 @@ public void testSimpleDateHisto() throws Exception { "the_histo.date_histogram._count", 2, "the_histo.date_histogram.time_zone", - DateTimeZone.UTC.toString(), + "UTC", // TODO: the default is hardcoded from Joda, we should change this "_rollup.id", job.getId() ) @@ -158,7 +158,7 @@ public void testSimpleDateHisto() throws Exception { "the_histo.date_histogram._count", 1, "the_histo.date_histogram.time_zone", - DateTimeZone.UTC.toString(), + "UTC", // TODO: the default is hardcoded from Joda, we should change this "_rollup.id", job.getId() ) @@ -221,7 +221,7 @@ public void testDateHistoAndMetrics() throws Exception { "counter.sum.value", 50.0, "the_histo.date_histogram.time_zone", - DateTimeZone.UTC.toString(), + "UTC", // TODO: the default is hardcoded from Joda, we should change this "_rollup.id", job.getId() ) @@ -252,7 +252,7 @@ public void testDateHistoAndMetrics() throws Exception { "counter.sum.value", 141.0, "the_histo.date_histogram.time_zone", - DateTimeZone.UTC.toString(), + "UTC", // TODO: the default is hardcoded from Joda, we should change this "_rollup.id", job.getId() ) @@ -283,7 +283,7 @@ public void testDateHistoAndMetrics() throws Exception { "counter.sum.value", 275.0, "the_histo.date_histogram.time_zone", - DateTimeZone.UTC.toString(), + "UTC", // TODO: the default is hardcoded from Joda, we should change this "_rollup.id", job.getId() ) @@ -314,7 +314,7 @@ public void testDateHistoAndMetrics() throws Exception { "counter.sum.value", 270.0, "the_histo.date_histogram.time_zone", - DateTimeZone.UTC.toString(), + "UTC", // TODO: the default is hardcoded from Joda, we should change this "_rollup.id", job.getId() ) @@ -345,7 +345,7 @@ public void testDateHistoAndMetrics() throws Exception { "counter.sum.value", 440.0, "the_histo.date_histogram.time_zone", - DateTimeZone.UTC.toString(), + "UTC", // TODO: the default is hardcoded from Joda, we should change this "_rollup.id", job.getId() ) @@ -398,7 +398,7 @@ public void testSimpleDateHistoWithDelay() throws Exception { "the_histo.date_histogram._count", 2, "the_histo.date_histogram.time_zone", - DateTimeZone.UTC.toString(), + "UTC", // TODO: the default is hardcoded from Joda, we should change this "_rollup.id", job.getId() ) @@ -419,7 +419,7 @@ public void testSimpleDateHistoWithDelay() throws Exception { "the_histo.date_histogram._count", 2, "the_histo.date_histogram.time_zone", - DateTimeZone.UTC.toString(), + "UTC", // TODO: the default is hardcoded from Joda, we should change this "_rollup.id", job.getId() ) @@ -440,7 +440,7 @@ public void testSimpleDateHistoWithDelay() throws Exception { "the_histo.date_histogram._count", 1, "the_histo.date_histogram.time_zone", - DateTimeZone.UTC.toString(), + "UTC", // TODO: the default is hardcoded from Joda, we should change this "_rollup.id", job.getId() ) @@ -493,7 +493,7 @@ public void testSimpleDateHistoWithOverlappingDelay() throws Exception { "the_histo.date_histogram._count", 3, "the_histo.date_histogram.time_zone", - DateTimeZone.UTC.toString(), + "UTC", // TODO: the default is hardcoded from Joda, we should change this "_rollup.id", job.getId() ) @@ -514,7 +514,7 @@ public void testSimpleDateHistoWithOverlappingDelay() throws Exception { "the_histo.date_histogram._count", 4, "the_histo.date_histogram.time_zone", - DateTimeZone.UTC.toString(), + "UTC", // TODO: the default is hardcoded from Joda, we should change this "_rollup.id", job.getId() ) @@ -538,7 +538,7 @@ public void testSimpleDateHistoWithTimeZone() throws Exception { ) ); - String timeZone = DateTimeZone.forOffsetHours(-3).getID(); + String timeZone = ZoneOffset.ofHours(-3).getId(); String rollupIndex = randomAlphaOfLengthBetween(5, 10); String field = "the_histo"; DateHistogramGroupConfig dateHistoConfig = new CalendarInterval(field, new DateHistogramInterval("1d"), null, timeZone); @@ -633,7 +633,11 @@ public void testRandomizedDateHisto() throws Exception { for (int i = 0; i < numDocs; i++) { // Make sure the timestamp is sufficiently in the past that we don't get bitten // by internal rounding, causing no docs to match - long timestamp = new DateTime().minusDays(2).minusHours(randomIntBetween(11, 100)).getMillis(); + long timestamp = ZonedDateTime.now(ZoneOffset.UTC) + .minusDays(2) + .minusHours(randomIntBetween(11, 100)) + .toInstant() + .toEpochMilli(); dataset.add(asMap(timestampField, timestamp, valueField, randomLongBetween(1, 100))); } executeTestCase(dataset, job, System.currentTimeMillis(), (resp) -> { diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/audit/index/IndexNameResolver.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/audit/index/IndexNameResolver.java index b4899197c340f..f9d5498ee5066 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/audit/index/IndexNameResolver.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/audit/index/IndexNameResolver.java @@ -6,9 +6,9 @@ */ package org.elasticsearch.xpack.security.audit.index; -import org.joda.time.DateTime; -import org.joda.time.format.DateTimeFormat; -import org.joda.time.format.DateTimeFormatter; +import java.time.ZonedDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Locale; public class IndexNameResolver { @@ -21,7 +21,7 @@ public enum Rollover { private final DateTimeFormatter formatter; Rollover(String format) { - this.formatter = DateTimeFormat.forPattern(format); + this.formatter = DateTimeFormatter.ofPattern(format, Locale.ROOT); } DateTimeFormatter formatter() { @@ -31,11 +31,11 @@ DateTimeFormatter formatter() { private IndexNameResolver() {} - public static String resolve(DateTime timestamp, Rollover rollover) { - return rollover.formatter().print(timestamp); + public static String resolve(ZonedDateTime timestamp, Rollover rollover) { + return rollover.formatter().format(timestamp); } - public static String resolve(String indexNamePrefix, DateTime timestamp, Rollover rollover) { + public static String resolve(String indexNamePrefix, ZonedDateTime timestamp, Rollover rollover) { return indexNamePrefix + resolve(timestamp, rollover); } } diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/IndicesAndAliasesResolverTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/IndicesAndAliasesResolverTests.java index 0973c7bc3e5af..5bdd59bed1f77 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/IndicesAndAliasesResolverTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/IndicesAndAliasesResolverTests.java @@ -70,19 +70,20 @@ import org.elasticsearch.xpack.core.security.user.XPackUser; import org.elasticsearch.xpack.security.authz.store.CompositeRolesStore; import org.elasticsearch.xpack.security.test.SecurityTestUtils; -import org.joda.time.DateTime; -import org.joda.time.DateTimeZone; -import org.joda.time.format.DateTimeFormat; import org.junit.Before; import java.time.Clock; import java.time.Duration; import java.time.Instant; +import java.time.ZoneOffset; +import java.time.ZonedDateTime; +import java.time.format.DateTimeFormatter; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.List; +import java.util.Locale; import java.util.Map; import java.util.Set; @@ -1418,8 +1419,8 @@ public void testUnauthorizedDateMathExpressionIgnoreUnavailableDisallowNoIndices } public void testUnauthorizedDateMathExpressionStrict() { - String expectedIndex = "datetime-" + DateTimeFormat.forPattern("YYYY.MM.dd").print( - new DateTime(DateTimeZone.UTC).monthOfYear().roundFloorCopy()); + String expectedIndex = "datetime-" + DateTimeFormatter.ofPattern("uuuu.MM.dd", Locale.ROOT).format( + ZonedDateTime.now(ZoneOffset.UTC).withDayOfMonth(1)); SearchRequest request = new SearchRequest(""); request.indicesOptions(IndicesOptions.fromOptions(false, randomBoolean(), randomBoolean(), randomBoolean())); IndexNotFoundException e = expectThrows(IndexNotFoundException.class, @@ -1460,8 +1461,8 @@ public void testMissingDateMathExpressionIgnoreUnavailableDisallowNoIndices() { } public void testMissingDateMathExpressionStrict() { - String expectedIndex = "foobar-" + DateTimeFormat.forPattern("YYYY.MM.dd").print( - new DateTime(DateTimeZone.UTC).monthOfYear().roundFloorCopy()); + String expectedIndex = "foobar-" + DateTimeFormatter.ofPattern("uuuu.MM.dd", Locale.ROOT).format( + ZonedDateTime.now(ZoneOffset.UTC).withDayOfMonth(1)); SearchRequest request = new SearchRequest(""); request.indicesOptions(IndicesOptions.fromOptions(false, randomBoolean(), randomBoolean(), randomBoolean())); IndexNotFoundException e = expectThrows(IndexNotFoundException.class, diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/store/CompositeRolesStoreTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/store/CompositeRolesStoreTests.java index c377e155a5573..f0533624ac927 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/store/CompositeRolesStoreTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/store/CompositeRolesStoreTests.java @@ -85,11 +85,12 @@ import org.elasticsearch.xpack.security.support.SecurityIndexManager; import org.elasticsearch.xpack.core.security.test.TestRestrictedIndices; import org.hamcrest.Matchers; -import org.joda.time.DateTime; import java.io.IOException; import java.time.Clock; import java.time.Instant; +import java.time.ZoneOffset; +import java.time.ZonedDateTime; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -1585,7 +1586,7 @@ public void writeTo(StreamOutput out) throws IOException { } private String getAuditLogName() { - final DateTime date = new DateTime().plusDays(randomIntBetween(1, 360)); + final ZonedDateTime date = ZonedDateTime.now(ZoneOffset.UTC).plusDays(randomIntBetween(1, 360)); final IndexNameResolver.Rollover rollover = randomFrom(IndexNameResolver.Rollover.values()); return IndexNameResolver.resolve(IndexAuditTrailField.INDEX_NAME_PREFIX, date, rollover); } diff --git a/x-pack/plugin/transform/qa/multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformIntegTestCase.java b/x-pack/plugin/transform/qa/multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformIntegTestCase.java index 3c68c33d44d2a..0707a0a9d69aa 100644 --- a/x-pack/plugin/transform/qa/multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformIntegTestCase.java +++ b/x-pack/plugin/transform/qa/multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformIntegTestCase.java @@ -65,10 +65,10 @@ import org.elasticsearch.search.builder.SearchSourceBuilder; import org.elasticsearch.search.sort.SortOrder; import org.elasticsearch.test.rest.ESRestTestCase; -import org.joda.time.Instant; import java.io.IOException; import java.nio.charset.StandardCharsets; +import java.time.Instant; import java.time.ZoneId; import java.util.Base64; import java.util.Collections; diff --git a/x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformRestTestCase.java b/x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformRestTestCase.java index 73015e9df90da..0b420d59b5342 100644 --- a/x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformRestTestCase.java +++ b/x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformRestTestCase.java @@ -23,11 +23,11 @@ import org.elasticsearch.test.rest.ESRestTestCase; import org.elasticsearch.xpack.core.transform.TransformField; import org.elasticsearch.xpack.core.transform.transforms.persistence.TransformInternalIndexConstants; -import org.joda.time.Instant; import org.junit.After; import org.junit.AfterClass; import java.io.IOException; +import java.time.Instant; import java.util.Arrays; import java.util.Collections; import java.util.List; From c766b5fec884697952efad139bc7e3d42f9fb02f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Fern=C3=A1ndez=20Casta=C3=B1o?= Date: Wed, 6 Oct 2021 19:03:20 +0200 Subject: [PATCH 199/250] Fix AzureBlobStore#convertStreamToByteBuffer chunking in Windows (#78772) Today we are using Math.ceil in order to calculate the number of chunks in the request. Since we cast the values to a double... there be dragons. This could cause issues depending on the platform. This commit uses good old integers to compute the number of parts. --- .../repositories/azure/AzureBlobStore.java | 6 ++++- .../azure/AzureBlobContainerRetriesTests.java | 23 +++++++++++++++++-- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/plugins/repository-azure/src/main/java/org/elasticsearch/repositories/azure/AzureBlobStore.java b/plugins/repository-azure/src/main/java/org/elasticsearch/repositories/azure/AzureBlobStore.java index 35482bbe93fa0..6c43acccd7036 100644 --- a/plugins/repository-azure/src/main/java/org/elasticsearch/repositories/azure/AzureBlobStore.java +++ b/plugins/repository-azure/src/main/java/org/elasticsearch/repositories/azure/AzureBlobStore.java @@ -547,7 +547,11 @@ public synchronized int read() throws IOException { // reclaim them (see MonoSendMany). Additionally, that very same operator requests // 128 elements (that's hardcoded) once it's subscribed (later on, it requests // by 64 elements), that's why we provide 64kb buffers. - return Flux.range(0, (int) Math.ceil((double) length / (double) chunkSize)) + + // length is at most 100MB so it's safe to cast back to an integer in this case + final int parts = (int) length / chunkSize; + final long remaining = length % chunkSize; + return Flux.range(0, remaining == 0 ? parts : parts + 1) .map(i -> i * chunkSize) .concatMap(pos -> Mono.fromCallable(() -> { long count = pos + chunkSize > length ? length - pos : chunkSize; diff --git a/plugins/repository-azure/src/test/java/org/elasticsearch/repositories/azure/AzureBlobContainerRetriesTests.java b/plugins/repository-azure/src/test/java/org/elasticsearch/repositories/azure/AzureBlobContainerRetriesTests.java index 0909fc7a5e237..5983acc16ec53 100644 --- a/plugins/repository-azure/src/test/java/org/elasticsearch/repositories/azure/AzureBlobContainerRetriesTests.java +++ b/plugins/repository-azure/src/test/java/org/elasticsearch/repositories/azure/AzureBlobContainerRetriesTests.java @@ -329,8 +329,11 @@ public void testWriteBlobWithRetries() throws Exception { public void testWriteLargeBlob() throws Exception { final int maxRetries = randomIntBetween(2, 5); - final byte[] data = randomBytes((int) ByteSizeUnit.MB.toBytes(10)); - int nbBlocks = (int) Math.ceil((double) data.length / (double) ByteSizeUnit.MB.toBytes(1)); + final byte[] data = randomBytes(ByteSizeUnit.MB.toIntBytes(10) + randomIntBetween(0, ByteSizeUnit.MB.toIntBytes(1))); + int nbBlocks = data.length / ByteSizeUnit.MB.toIntBytes(1); + if (data.length % ByteSizeUnit.MB.toIntBytes(1) != 0) { + nbBlocks += 1; + } final int nbErrors = 2; // we want all requests to fail at least once final AtomicInteger countDownUploads = new AtomicInteger(nbErrors * nbBlocks); @@ -378,6 +381,9 @@ public void testWriteLargeBlob() throws Exception { if (randomBoolean()) { Streams.readFully(exchange.getRequestBody()); AzureHttpHandler.sendError(exchange, randomFrom(RestStatus.INTERNAL_SERVER_ERROR, RestStatus.SERVICE_UNAVAILABLE)); + } else { + long contentLength = Long.parseLong(exchange.getRequestHeaders().getFirst("Content-Length")); + readFromInputStream(exchange.getRequestBody(), randomLongBetween(0, contentLength)); } exchange.close(); }); @@ -621,4 +627,17 @@ private String getEndpointForServer(HttpServer server, String accountName) { InetSocketAddress address = server.getAddress(); return "http://" + InetAddresses.toUriString(address.getAddress()) + ":" + address.getPort() + "/" + accountName; } + + private void readFromInputStream(InputStream inputStream, long bytesToRead) { + try { + long totalBytesRead = 0; + int bytesRead; + while ((bytesRead = inputStream.read()) != -1 && totalBytesRead < bytesToRead) { + totalBytesRead += bytesRead; + } + assertThat(totalBytesRead, equalTo(bytesToRead)); + } catch (IOException e) { + throw new RuntimeException(e); + } + } } From ddc1a0df2828e7d971c6df4a844a118aefc2ef35 Mon Sep 17 00:00:00 2001 From: Stef Nestor Date: Wed, 6 Oct 2021 11:44:12 -0600 Subject: [PATCH 200/250] [DOCS] Add prod warning to composite agg (#78723) The composite aggregation is considered expensive. Users should perform load testing before deploying it in production. Co-authored-by: James Rodewig <40268737+jrodewig@users.noreply.github.com> --- .../aggregations/bucket/composite-aggregation.asciidoc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/reference/aggregations/bucket/composite-aggregation.asciidoc b/docs/reference/aggregations/bucket/composite-aggregation.asciidoc index 2f052dcf76a3f..8f4f65ce3d216 100644 --- a/docs/reference/aggregations/bucket/composite-aggregation.asciidoc +++ b/docs/reference/aggregations/bucket/composite-aggregation.asciidoc @@ -4,6 +4,9 @@ Composite ++++ +WARNING: The composite aggregation is expensive. Load test your application +before deploying a composite aggregation in production. + A multi-bucket aggregation that creates composite buckets from different sources. Unlike the other `multi-bucket` aggregations, you can use the `composite` From c10082968e09ee5237414be6fd179e7c7c1031c5 Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Wed, 6 Oct 2021 10:48:03 -0700 Subject: [PATCH 201/250] Revert "Make NodeEnvironment.resolveIndexFolder singular (#72515)" (#78702) This reverts commit 7a05d72c765a789932c0fad34c0e20e3df2fe1bd. The revert had no merge conflicts. relates #78525 relates #71205 --- .../elasticsearch/env/NodeEnvironment.java | 43 +++++++++++-------- .../env/NodeEnvironmentTests.java | 3 +- .../gateway/DanglingIndicesStateTests.java | 7 +-- 3 files changed, 31 insertions(+), 22 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/env/NodeEnvironment.java b/server/src/main/java/org/elasticsearch/env/NodeEnvironment.java index 4f572db20a47b..5d8db2c384d12 100644 --- a/server/src/main/java/org/elasticsearch/env/NodeEnvironment.java +++ b/server/src/main/java/org/elasticsearch/env/NodeEnvironment.java @@ -1022,12 +1022,19 @@ public Set availableIndexFoldersForPath(final NodePath nodePath, Predica /** * Resolves all existing paths to indexFolderName in ${data.paths}/indices */ - public Path resolveIndexFolder(String indexFolderName) { + public Path[] resolveIndexFolder(String indexFolderName) { if (nodePaths == null || locks == null) { throw new IllegalStateException("node is not configured to store local location"); } assertEnvIsLocked(); - return nodePaths[0].indicesPath.resolve(indexFolderName); + List paths = new ArrayList<>(nodePaths.length); + for (NodePath nodePath : nodePaths) { + Path indexFolder = nodePath.indicesPath.resolve(indexFolderName); + if (Files.exists(indexFolder)) { + paths.add(indexFolder); + } + } + return paths.toArray(new Path[paths.size()]); } /** @@ -1290,22 +1297,22 @@ public static Path shardStatePathToDataPath(Path shardPath) { private void assertCanWrite() throws IOException { tryWriteTempFile(nodeDataPath()); for (String indexFolderName : this.availableIndexFolders()) { - // check index paths are writable - Path indexPath = this.resolveIndexFolder(indexFolderName); - Path indexStatePath = indexPath.resolve(MetadataStateFormat.STATE_DIR_NAME); - tryWriteTempFile(indexStatePath); - tryWriteTempFile(indexPath); - try (DirectoryStream stream = Files.newDirectoryStream(indexPath)) { - for (Path shardPath : stream) { - String fileName = shardPath.getFileName().toString(); - if (Files.isDirectory(shardPath) && fileName.chars().allMatch(Character::isDigit)) { - Path indexDir = shardPath.resolve(ShardPath.INDEX_FOLDER_NAME); - Path statePath = shardPath.resolve(MetadataStateFormat.STATE_DIR_NAME); - Path translogDir = shardPath.resolve(ShardPath.TRANSLOG_FOLDER_NAME); - tryWriteTempFile(indexDir); - tryWriteTempFile(translogDir); - tryWriteTempFile(statePath); - tryWriteTempFile(shardPath); + for (Path indexPath : this.resolveIndexFolder(indexFolderName)) { // check index paths are writable + Path indexStatePath = indexPath.resolve(MetadataStateFormat.STATE_DIR_NAME); + tryWriteTempFile(indexStatePath); + tryWriteTempFile(indexPath); + try (DirectoryStream stream = Files.newDirectoryStream(indexPath)) { + for (Path shardPath : stream) { + String fileName = shardPath.getFileName().toString(); + if (Files.isDirectory(shardPath) && fileName.chars().allMatch(Character::isDigit)) { + Path indexDir = shardPath.resolve(ShardPath.INDEX_FOLDER_NAME); + Path statePath = shardPath.resolve(MetadataStateFormat.STATE_DIR_NAME); + Path translogDir = shardPath.resolve(ShardPath.TRANSLOG_FOLDER_NAME); + tryWriteTempFile(indexDir); + tryWriteTempFile(translogDir); + tryWriteTempFile(statePath); + tryWriteTempFile(shardPath); + } } } } diff --git a/server/src/test/java/org/elasticsearch/env/NodeEnvironmentTests.java b/server/src/test/java/org/elasticsearch/env/NodeEnvironmentTests.java index 5cf9c24aa2529..8870b4f60ea8c 100644 --- a/server/src/test/java/org/elasticsearch/env/NodeEnvironmentTests.java +++ b/server/src/test/java/org/elasticsearch/env/NodeEnvironmentTests.java @@ -182,7 +182,8 @@ public void testResolveIndexFolders() throws Exception { } for (Map.Entry> actualIndexDataPathEntry : actualIndexDataPaths.entrySet()) { List actual = actualIndexDataPathEntry.getValue(); - assertThat(actual.get(0), equalTo(env.resolveIndexFolder(actualIndexDataPathEntry.getKey()))); + Path[] actualPaths = actual.toArray(new Path[actual.size()]); + assertThat(actualPaths, equalTo(env.resolveIndexFolder(actualIndexDataPathEntry.getKey()))); } assertTrue("LockedShards: " + env.lockedShards(), env.lockedShards().isEmpty()); env.close(); diff --git a/server/src/test/java/org/elasticsearch/gateway/DanglingIndicesStateTests.java b/server/src/test/java/org/elasticsearch/gateway/DanglingIndicesStateTests.java index 99534d8403bc9..ec9553c415df3 100644 --- a/server/src/test/java/org/elasticsearch/gateway/DanglingIndicesStateTests.java +++ b/server/src/test/java/org/elasticsearch/gateway/DanglingIndicesStateTests.java @@ -69,9 +69,10 @@ public void testInvalidIndexFolder() throws Exception { final Settings.Builder settings = Settings.builder().put(indexSettings).put(IndexMetadata.SETTING_INDEX_UUID, uuid); IndexMetadata dangledIndex = IndexMetadata.builder("test1").settings(settings).build(); metaStateService.writeIndex("test_write", dangledIndex); - Path path = env.resolveIndexFolder(uuid); - if (Files.exists(path)) { - Files.move(path, path.resolveSibling("invalidUUID"), StandardCopyOption.ATOMIC_MOVE); + for (Path path : env.resolveIndexFolder(uuid)) { + if (Files.exists(path)) { + Files.move(path, path.resolveSibling("invalidUUID"), StandardCopyOption.ATOMIC_MOVE); + } } final IllegalStateException e = expectThrows(IllegalStateException.class, danglingState::getDanglingIndices); From e74cc37ecbdba70aa43239db71aa519394267d70 Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Wed, 6 Oct 2021 10:52:38 -0700 Subject: [PATCH 202/250] Convert watcher license object to LicensedFeature (#78710) This commit moves the watcher license checks to use the new LicensedFeature class. --- .../license/XPackLicenseState.java | 2 -- .../xpack/core/watcher/WatcherConstants.java | 20 +++++++++++++ .../actions/throttler/ActionThrottler.java | 3 +- .../throttler/WatchThrottlerTests.java | 28 +++++++++---------- .../AbstractWatcherIntegrationTestCase.java | 3 +- .../watcher/WatcherInfoTransportAction.java | 3 +- .../watcher/WatcherUsageTransportAction.java | 10 +++---- .../actions/WatcherTransportAction.java | 3 +- .../WatcherInfoTransportActionTests.java | 9 +++--- 9 files changed, 52 insertions(+), 29 deletions(-) create mode 100644 x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/WatcherConstants.java diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/XPackLicenseState.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/XPackLicenseState.java index bc5dddd39e63c..1649c2bc6db2a 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/XPackLicenseState.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/XPackLicenseState.java @@ -49,8 +49,6 @@ public enum Feature { SECURITY_AUTHORIZATION_REALM(OperationMode.PLATINUM, true), SECURITY_AUTHORIZATION_ENGINE(OperationMode.PLATINUM, true), - WATCHER(OperationMode.STANDARD, true), - // TODO: should just check WATCHER directly? MONITORING_CLUSTER_ALERTS(OperationMode.STANDARD, true), MONITORING_UPDATE_RETENTION(OperationMode.STANDARD, false), diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/WatcherConstants.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/WatcherConstants.java new file mode 100644 index 0000000000000..f598bc5840d97 --- /dev/null +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/WatcherConstants.java @@ -0,0 +1,20 @@ +/* + * 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.core.watcher; + +import org.elasticsearch.license.License; +import org.elasticsearch.license.LicensedFeature; + +public class WatcherConstants { + + public static final LicensedFeature.Momentary WATCHER_FEATURE = + LicensedFeature.momentary(null, "watcher", License.OperationMode.STANDARD); + + // no construction + private WatcherConstants() {} +} diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/actions/throttler/ActionThrottler.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/actions/throttler/ActionThrottler.java index 99792f2f5cfdc..f5dfe118ee62c 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/actions/throttler/ActionThrottler.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/actions/throttler/ActionThrottler.java @@ -9,6 +9,7 @@ import org.elasticsearch.core.Nullable; import org.elasticsearch.core.TimeValue; import org.elasticsearch.license.XPackLicenseState; +import org.elasticsearch.xpack.core.watcher.WatcherConstants; import org.elasticsearch.xpack.core.watcher.execution.WatchExecutionContext; import java.time.Clock; @@ -39,7 +40,7 @@ public TimeValue throttlePeriod() { @Override public Result throttle(String actionId, WatchExecutionContext ctx) { - if (licenseState.checkFeature(XPackLicenseState.Feature.WATCHER) == false) { + if (WatcherConstants.WATCHER_FEATURE.check(licenseState) == false) { return Result.throttle(LICENSE, "watcher license does not allow action execution"); } if (periodThrottler != null) { diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/watcher/actions/throttler/WatchThrottlerTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/watcher/actions/throttler/WatchThrottlerTests.java index a679f74b6631c..7ad379664ddf9 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/watcher/actions/throttler/WatchThrottlerTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/watcher/actions/throttler/WatchThrottlerTests.java @@ -6,9 +6,9 @@ */ package org.elasticsearch.xpack.core.watcher.actions.throttler; -import org.elasticsearch.license.XPackLicenseState; -import org.elasticsearch.license.XPackLicenseState.Feature; +import org.elasticsearch.license.MockLicenseState; import org.elasticsearch.test.ESTestCase; +import org.elasticsearch.xpack.core.watcher.WatcherConstants; import org.elasticsearch.xpack.core.watcher.execution.WatchExecutionContext; import static org.hamcrest.Matchers.is; @@ -25,8 +25,8 @@ public void testThrottleDueToAck() throws Exception { when(periodThrottler.throttle("_action", ctx)).thenReturn(Throttler.Result.NO); Throttler.Result expectedResult = Throttler.Result.throttle(Throttler.Type.ACK, "_reason"); when(ackThrottler.throttle("_action", ctx)).thenReturn(expectedResult); - XPackLicenseState licenseState = mock(XPackLicenseState.class); - when(licenseState.checkFeature(Feature.WATCHER)).thenReturn(true); + MockLicenseState licenseState = mock(MockLicenseState.class); + when(licenseState.isAllowed(WatcherConstants.WATCHER_FEATURE)).thenReturn(true); ActionThrottler throttler = new ActionThrottler(periodThrottler, ackThrottler, licenseState); Throttler.Result result = throttler.throttle("_action", ctx); assertThat(result, notNullValue()); @@ -40,8 +40,8 @@ public void testThrottleDueToPeriod() throws Exception { Throttler.Result expectedResult = Throttler.Result.throttle(Throttler.Type.PERIOD, "_reason"); when(periodThrottler.throttle("_action", ctx)).thenReturn(expectedResult); when(ackThrottler.throttle("_action", ctx)).thenReturn(Throttler.Result.NO); - XPackLicenseState licenseState = mock(XPackLicenseState.class); - when(licenseState.checkFeature(Feature.WATCHER)).thenReturn(true); + MockLicenseState licenseState = mock(MockLicenseState.class); + when(licenseState.isAllowed(WatcherConstants.WATCHER_FEATURE)).thenReturn(true); ActionThrottler throttler = new ActionThrottler(periodThrottler, ackThrottler, licenseState); Throttler.Result result = throttler.throttle("_action", ctx); assertThat(result, notNullValue()); @@ -56,8 +56,8 @@ public void testThrottleDueAckAndPeriod() throws Exception { when(periodThrottler.throttle("_action", ctx)).thenReturn(periodResult); Throttler.Result ackResult = Throttler.Result.throttle(Throttler.Type.ACK, "_reason_ack"); when(ackThrottler.throttle("_action", ctx)).thenReturn(ackResult); - XPackLicenseState licenseState = mock(XPackLicenseState.class); - when(licenseState.checkFeature(Feature.WATCHER)).thenReturn(true); + MockLicenseState licenseState = mock(MockLicenseState.class); + when(licenseState.isAllowed(WatcherConstants.WATCHER_FEATURE)).thenReturn(true); ActionThrottler throttler = new ActionThrottler(periodThrottler, ackThrottler, licenseState); Throttler.Result result = throttler.throttle("_action", ctx); assertThat(result, notNullValue()); @@ -71,8 +71,8 @@ public void testNoThrottle() throws Exception { WatchExecutionContext ctx = mock(WatchExecutionContext.class); when(periodThrottler.throttle("_action", ctx)).thenReturn(Throttler.Result.NO); when(ackThrottler.throttle("_action", ctx)).thenReturn(Throttler.Result.NO); - XPackLicenseState licenseState = mock(XPackLicenseState.class); - when(licenseState.checkFeature(Feature.WATCHER)).thenReturn(true); + MockLicenseState licenseState = mock(MockLicenseState.class); + when(licenseState.isAllowed(WatcherConstants.WATCHER_FEATURE)).thenReturn(true); ActionThrottler throttler = new ActionThrottler(periodThrottler, ackThrottler, licenseState); Throttler.Result result = throttler.throttle("_action", ctx); assertThat(result, notNullValue()); @@ -84,8 +84,8 @@ public void testWithoutPeriod() throws Exception { WatchExecutionContext ctx = mock(WatchExecutionContext.class); Throttler.Result ackResult = mock(Throttler.Result.class); when(ackThrottler.throttle("_action", ctx)).thenReturn(ackResult); - XPackLicenseState licenseState = mock(XPackLicenseState.class); - when(licenseState.checkFeature(Feature.WATCHER)).thenReturn(true); + MockLicenseState licenseState = mock(MockLicenseState.class); + when(licenseState.isAllowed(WatcherConstants.WATCHER_FEATURE)).thenReturn(true); ActionThrottler throttler = new ActionThrottler(null, ackThrottler, licenseState); Throttler.Result result = throttler.throttle("_action", ctx); assertThat(result, notNullValue()); @@ -97,8 +97,8 @@ public void testThatRestrictedLicenseReturnsCorrectResult() throws Exception { WatchExecutionContext ctx = mock(WatchExecutionContext.class); Throttler.Result ackResult = mock(Throttler.Result.class); when(ackThrottler.throttle("_action", ctx)).thenReturn(ackResult); - XPackLicenseState licenseState = mock(XPackLicenseState.class); - when(licenseState.checkFeature(Feature.WATCHER)).thenReturn(false); + MockLicenseState licenseState = mock(MockLicenseState.class); + when(licenseState.isAllowed(WatcherConstants.WATCHER_FEATURE)).thenReturn(false); ActionThrottler throttler = new ActionThrottler(null, ackThrottler, licenseState); Throttler.Result result = throttler.throttle("_action", ctx); assertThat(result, notNullValue()); diff --git a/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/AbstractWatcherIntegrationTestCase.java b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/AbstractWatcherIntegrationTestCase.java index 0cd73be5d108a..28eab3e26cf36 100644 --- a/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/AbstractWatcherIntegrationTestCase.java +++ b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/AbstractWatcherIntegrationTestCase.java @@ -45,6 +45,7 @@ import org.elasticsearch.xpack.core.action.DeleteDataStreamAction; import org.elasticsearch.xpack.core.action.GetDataStreamAction; import org.elasticsearch.xpack.core.ssl.SSLService; +import org.elasticsearch.xpack.core.watcher.WatcherConstants; import org.elasticsearch.xpack.core.watcher.WatcherState; import org.elasticsearch.xpack.core.watcher.execution.ExecutionState; import org.elasticsearch.xpack.core.watcher.execution.TriggeredWatchStoreField; @@ -518,7 +519,7 @@ protected void startWatcher() throws Exception { protected void ensureLicenseEnabled() throws Exception { assertBusy(() -> { for (XPackLicenseState licenseState : internalCluster().getInstances(XPackLicenseState.class)) { - assertThat(licenseState.checkFeature(XPackLicenseState.Feature.WATCHER), is(true)); + assertThat(WatcherConstants.WATCHER_FEATURE.check(licenseState), is(true)); } }); } diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/WatcherInfoTransportAction.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/WatcherInfoTransportAction.java index 448c7fd85b148..460ae27a457ec 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/WatcherInfoTransportAction.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/WatcherInfoTransportAction.java @@ -15,6 +15,7 @@ import org.elasticsearch.xpack.core.XPackSettings; import org.elasticsearch.xpack.core.action.XPackInfoFeatureAction; import org.elasticsearch.xpack.core.action.XPackInfoFeatureTransportAction; +import org.elasticsearch.xpack.core.watcher.WatcherConstants; public class WatcherInfoTransportAction extends XPackInfoFeatureTransportAction { @@ -36,7 +37,7 @@ public String name() { @Override public boolean available() { - return licenseState.isAllowed(XPackLicenseState.Feature.WATCHER); + return WatcherConstants.WATCHER_FEATURE.checkWithoutTracking(licenseState); } @Override diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/WatcherUsageTransportAction.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/WatcherUsageTransportAction.java index dccbeda01c89c..4dfd927464dcd 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/WatcherUsageTransportAction.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/WatcherUsageTransportAction.java @@ -16,7 +16,6 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; import org.elasticsearch.license.XPackLicenseState; -import org.elasticsearch.license.XPackLicenseState.Feature; import org.elasticsearch.protocol.xpack.XPackUsageRequest; import org.elasticsearch.tasks.Task; import org.elasticsearch.threadpool.ThreadPool; @@ -25,6 +24,7 @@ import org.elasticsearch.xpack.core.action.XPackUsageFeatureAction; import org.elasticsearch.xpack.core.action.XPackUsageFeatureResponse; import org.elasticsearch.xpack.core.action.XPackUsageFeatureTransportAction; +import org.elasticsearch.xpack.core.watcher.WatcherConstants; import org.elasticsearch.xpack.core.watcher.WatcherFeatureSetUsage; import org.elasticsearch.xpack.core.watcher.common.stats.Counters; import org.elasticsearch.xpack.core.watcher.transport.actions.stats.WatcherStatsAction; @@ -70,14 +70,14 @@ protected void masterOperation(Task task, XPackUsageRequest request, ClusterStat .filter(Objects::nonNull) .collect(Collectors.toList()); Counters mergedCounters = Counters.merge(countersPerNode); - WatcherFeatureSetUsage usage = - new WatcherFeatureSetUsage(licenseState.isAllowed(Feature.WATCHER), true, mergedCounters.toNestedMap()); + WatcherFeatureSetUsage usage = new WatcherFeatureSetUsage( + WatcherConstants.WATCHER_FEATURE.checkWithoutTracking(licenseState), true, mergedCounters.toNestedMap()); listener.onResponse(new XPackUsageFeatureResponse(usage)); }, listener::onFailure)); } } else { - WatcherFeatureSetUsage usage = - new WatcherFeatureSetUsage(licenseState.isAllowed(Feature.WATCHER), false, Collections.emptyMap()); + WatcherFeatureSetUsage usage = new WatcherFeatureSetUsage( + WatcherConstants.WATCHER_FEATURE.checkWithoutTracking(licenseState), false, Collections.emptyMap()); listener.onResponse(new XPackUsageFeatureResponse(usage)); } } diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/WatcherTransportAction.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/WatcherTransportAction.java index a2452a57cd47d..e2333e8d09b3b 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/WatcherTransportAction.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/WatcherTransportAction.java @@ -18,6 +18,7 @@ import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.TransportService; import org.elasticsearch.xpack.core.XPackField; +import org.elasticsearch.xpack.core.watcher.WatcherConstants; abstract class WatcherTransportAction extends HandledTransportAction { @@ -36,7 +37,7 @@ protected String executor() { @Override protected final void doExecute(Task task, final Request request, ActionListener listener) { - if (licenseState.checkFeature(XPackLicenseState.Feature.WATCHER)) { + if (WatcherConstants.WATCHER_FEATURE.check(licenseState)) { doExecute(request, listener); } else { listener.onFailure(LicenseUtils.newComplianceException(XPackField.WATCHER)); diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/WatcherInfoTransportActionTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/WatcherInfoTransportActionTests.java index f7668972bf3d3..d7043fc71ba7a 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/WatcherInfoTransportActionTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/WatcherInfoTransportActionTests.java @@ -20,13 +20,14 @@ import org.elasticsearch.common.xcontent.ObjectPath; import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.license.XPackLicenseState; +import org.elasticsearch.license.MockLicenseState; import org.elasticsearch.tasks.Task; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.TransportService; import org.elasticsearch.xpack.core.XPackFeatureSet; import org.elasticsearch.xpack.core.action.XPackUsageFeatureResponse; +import org.elasticsearch.xpack.core.watcher.WatcherConstants; import org.elasticsearch.xpack.core.watcher.WatcherFeatureSetUsage; import org.elasticsearch.xpack.core.watcher.WatcherMetadata; import org.elasticsearch.xpack.core.watcher.common.stats.Counters; @@ -52,12 +53,12 @@ public class WatcherInfoTransportActionTests extends ESTestCase { - private XPackLicenseState licenseState; + private MockLicenseState licenseState; private Client client; @Before public void init() throws Exception { - licenseState = mock(XPackLicenseState.class); + licenseState = mock(MockLicenseState.class); client = mock(Client.class); ThreadPool threadPool = mock(ThreadPool.class); ThreadContext threadContext = new ThreadContext(Settings.EMPTY); @@ -69,7 +70,7 @@ public void testAvailable() { WatcherInfoTransportAction featureSet = new WatcherInfoTransportAction( mock(TransportService.class), mock(ActionFilters.class), Settings.EMPTY, licenseState); boolean available = randomBoolean(); - when(licenseState.isAllowed(XPackLicenseState.Feature.WATCHER)).thenReturn(available); + when(licenseState.isAllowed(WatcherConstants.WATCHER_FEATURE)).thenReturn(available); assertThat(featureSet.available(), is(available)); } From 4cb6d256824f1631e6d78847f73e6c98fd77b5c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Fern=C3=A1ndez=20Casta=C3=B1o?= Date: Wed, 6 Oct 2021 20:17:32 +0200 Subject: [PATCH 203/250] Fix AzureBlobContainerRetriesTests#testWriteLargeBlob (#78777) --- .../repositories/azure/AzureBlobContainerRetriesTests.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/plugins/repository-azure/src/test/java/org/elasticsearch/repositories/azure/AzureBlobContainerRetriesTests.java b/plugins/repository-azure/src/test/java/org/elasticsearch/repositories/azure/AzureBlobContainerRetriesTests.java index 5983acc16ec53..f1a50150b0282 100644 --- a/plugins/repository-azure/src/test/java/org/elasticsearch/repositories/azure/AzureBlobContainerRetriesTests.java +++ b/plugins/repository-azure/src/test/java/org/elasticsearch/repositories/azure/AzureBlobContainerRetriesTests.java @@ -631,9 +631,8 @@ private String getEndpointForServer(HttpServer server, String accountName) { private void readFromInputStream(InputStream inputStream, long bytesToRead) { try { long totalBytesRead = 0; - int bytesRead; - while ((bytesRead = inputStream.read()) != -1 && totalBytesRead < bytesToRead) { - totalBytesRead += bytesRead; + while (inputStream.read() != -1 && totalBytesRead < bytesToRead) { + totalBytesRead += 1; } assertThat(totalBytesRead, equalTo(bytesToRead)); } catch (IOException e) { From 764e451aab647a6d905792229f31cb06cebbddf2 Mon Sep 17 00:00:00 2001 From: Mayya Sharipova Date: Wed, 6 Oct 2021 14:46:40 -0400 Subject: [PATCH 204/250] Fix LongScriptFieldTypeTests with sorts (#78563) Disable sort optimization with points for comparators used in scripts, as they don't provide points. This is a temporary fix, for a permanent fix these comparators should implement `getPoints` once LUCENE-10154 is available. Closes #78315 --- .../fieldcomparator/DoubleValuesComparatorSource.java | 5 ++++- .../fieldcomparator/FloatValuesComparatorSource.java | 5 ++++- .../fieldcomparator/LongValuesComparatorSource.java | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/index/fielddata/fieldcomparator/DoubleValuesComparatorSource.java b/server/src/main/java/org/elasticsearch/index/fielddata/fieldcomparator/DoubleValuesComparatorSource.java index eed32a6126190..97d9707814e9d 100644 --- a/server/src/main/java/org/elasticsearch/index/fielddata/fieldcomparator/DoubleValuesComparatorSource.java +++ b/server/src/main/java/org/elasticsearch/index/fielddata/fieldcomparator/DoubleValuesComparatorSource.java @@ -74,7 +74,7 @@ public FieldComparator newComparator(String fieldname, int numHits, int sortP final double dMissingValue = (Double) missingObject(missingValue, reversed); // NOTE: it's important to pass null as a missing value in the constructor so that // the comparator doesn't check docsWithField since we replace missing values in select() - return new DoubleComparator(numHits, null, null, reversed, sortPos) { + DoubleComparator comparator = new DoubleComparator(numHits, null, null, reversed, sortPos) { @Override public LeafFieldComparator getLeafComparator(LeafReaderContext context) throws IOException { return new DoubleLeafComparator(context) { @@ -90,6 +90,9 @@ public void setScorer(Scorable scorer) { }; } }; + // TODO: when LUCENE-10154 is available, instead of disableSkipping this comparator should implement `getPointValue` + comparator.disableSkipping(); + return comparator; } @Override diff --git a/server/src/main/java/org/elasticsearch/index/fielddata/fieldcomparator/FloatValuesComparatorSource.java b/server/src/main/java/org/elasticsearch/index/fielddata/fieldcomparator/FloatValuesComparatorSource.java index 9906075587c1c..157eb475fa5fe 100644 --- a/server/src/main/java/org/elasticsearch/index/fielddata/fieldcomparator/FloatValuesComparatorSource.java +++ b/server/src/main/java/org/elasticsearch/index/fielddata/fieldcomparator/FloatValuesComparatorSource.java @@ -67,7 +67,7 @@ public FieldComparator newComparator(String fieldname, int numHits, int sortP final float fMissingValue = (Float) missingObject(missingValue, reversed); // NOTE: it's important to pass null as a missing value in the constructor so that // the comparator doesn't check docsWithField since we replace missing values in select() - return new FloatComparator(numHits, null, null, reversed, sortPos) { + FloatComparator comparator = new FloatComparator(numHits, null, null, reversed, sortPos) { @Override public LeafFieldComparator getLeafComparator(LeafReaderContext context) throws IOException { return new FloatLeafComparator(context) { @@ -78,6 +78,9 @@ protected NumericDocValues getNumericDocValues(LeafReaderContext context, String }; } }; + // TODO: when LUCENE-10154 is available, instead of disableSkipping this comparator should implement `getPointValue` + comparator.disableSkipping(); + return comparator; } @Override diff --git a/server/src/main/java/org/elasticsearch/index/fielddata/fieldcomparator/LongValuesComparatorSource.java b/server/src/main/java/org/elasticsearch/index/fielddata/fieldcomparator/LongValuesComparatorSource.java index d237819502006..57244b464bfbc 100644 --- a/server/src/main/java/org/elasticsearch/index/fielddata/fieldcomparator/LongValuesComparatorSource.java +++ b/server/src/main/java/org/elasticsearch/index/fielddata/fieldcomparator/LongValuesComparatorSource.java @@ -90,7 +90,7 @@ public FieldComparator newComparator(String fieldname, int numHits, int sortP final long lMissingValue = (Long) missingObject(missingValue, reversed); // NOTE: it's important to pass null as a missing value in the constructor so that // the comparator doesn't check docsWithField since we replace missing values in select() - return new LongComparator(numHits, null, null, reversed, sortPos) { + LongComparator comparator = new LongComparator(numHits, null, null, reversed, sortPos) { @Override public LeafFieldComparator getLeafComparator(LeafReaderContext context) throws IOException { return new LongLeafComparator(context) { @@ -101,6 +101,9 @@ protected NumericDocValues getNumericDocValues(LeafReaderContext context, String }; } }; + // TODO: when LUCENE-10154 is available, instead of disableSkipping this comparator should implement `getPointValue` + comparator.disableSkipping(); + return comparator; } @Override From 248b2293f9ace27799f2cd2357277de6721aa33a Mon Sep 17 00:00:00 2001 From: debadair Date: Wed, 6 Oct 2021 11:54:48 -0700 Subject: [PATCH 205/250] [DOCS] Add info about FIPS and Java 17 (#78580) * [DOCS] Updated breaking changes entry for Java 11. --- .../migration/migrate_8_0/packaging.asciidoc | 7 +++ docs/reference/upgrade.asciidoc | 44 ++++++++++++------- .../en/security/fips-140-compliance.asciidoc | 6 +++ x-pack/docs/en/security/fips-java17.asciidoc | 9 ++++ 4 files changed, 50 insertions(+), 16 deletions(-) create mode 100644 x-pack/docs/en/security/fips-java17.asciidoc diff --git a/docs/reference/migration/migrate_8_0/packaging.asciidoc b/docs/reference/migration/migrate_8_0/packaging.asciidoc index 2e5ef1146cf3b..554353215d098 100644 --- a/docs/reference/migration/migrate_8_0/packaging.asciidoc +++ b/docs/reference/migration/migrate_8_0/packaging.asciidoc @@ -16,6 +16,13 @@ line tools. *Impact* + Use Java 11 or higher. Attempts to run {es} 8.0 using earlier Java versions will fail. + +Note that there is not yet a FIPS-certified security module for Java 17 +that you can use when running Elasticsearch 8.0 in FIPS 140-2 mode. +If you run in FIPS 140-2 mode, you will either need to request an exception +from your security organization to upgrade to Elasticsearch 8.0, +or remain on Elasticsearch 7.x until Java 17 is certified. + ==== .JAVA_HOME is no longer supported. diff --git a/docs/reference/upgrade.asciidoc b/docs/reference/upgrade.asciidoc index ba760707202aa..82d8dd43bd0d6 100644 --- a/docs/reference/upgrade.asciidoc +++ b/docs/reference/upgrade.asciidoc @@ -3,6 +3,16 @@ [partintro] -- +ifeval::["{release-state}"!="released"] +[[upgrade-pre-release]] +IMPORTANT: This documentation is for a pre-release of {es} {minor-version}. +Upgrades from pre-release builds are not supported and +could result in errors or data loss. +If you upgrade from a released version to a pre-release verion for testing, +discard the contents of the cluster when you are done. +Do not attempt to upgrade to the final release. +endif::[] + {es} can usually be upgraded using a <> process so upgrading does not interrupt service. Rolling upgrades are supported: @@ -16,7 +26,7 @@ endif::[] [TIP] ==== -For rolling upgrades between major versions (e.g., 5.6 to 6.8), we recommend +For rolling upgrades between major versions, we recommend using the {kibana-ref}/upgrade-assistant.html[Kibana Upgrade Assistant]. The upgrade assistant identifies deprecated settings in your cluster and guides @@ -26,7 +36,9 @@ We also recommend checking your <> for any other functionality that may have changed. ==== -The following table shows the recommended upgrade paths to {version}. +[discrete] +[[upgrade-paths]] +=== Upgrade paths to {version} [cols="<1,3",options="header",] |==== @@ -69,12 +81,18 @@ To upgrade directly to {version} from 6.7 or earlier, you must shut down the cluster, install {version}, and restart. For more information, see <>. -[WARNING] -==== +[discrete] +[[upgrade-downgrade]] +=== Downgrades + In-place downgrades to earlier versions are *not* supported. To downgrade to an earlier version, <> taken prior to the version upgrade. -==== + + +[discrete] +[[upgrade-index-compatibility]] +=== Index compatibility {es} can read indices created in the previous major version. If you have indices created in 5.x or before, you must reindex or delete them @@ -87,17 +105,11 @@ When upgrading to a new version of {es}, you need to upgrade each of the products in your Elastic Stack. For more information, see the {stack-ref}/upgrading-elastic-stack.html[Elastic Stack Installation and Upgrade Guide]. -ifeval::["{release-state}"!="released"] -[[upgrade-pre-release]] -NOTE: This documentation is for {es} version {version}, which is not yet -released. You may run a pre-release build of {es} for testing, and you may -upgrade from an earlier released version to a pre-release build of {es} -{version} if permitted by the compatibility table above, but upgrading from a -pre-release build to another build (whether released or not) is unsupported. -Upgrading a pre-release build may result in errors or may appear to succeed -having silently lost some data. You should discard the contents of a cluster -running a pre-release build before using a different build. -endif::[] +[discrete] +[[upgrade-fips-java17]] +=== FIPS Compliance and Java 17 + +include::{xes-repo-dir}/security/fips-java17.asciidoc[] -- diff --git a/x-pack/docs/en/security/fips-140-compliance.asciidoc b/x-pack/docs/en/security/fips-140-compliance.asciidoc index 85f4f82843f2e..beea826b4d277 100644 --- a/x-pack/docs/en/security/fips-140-compliance.asciidoc +++ b/x-pack/docs/en/security/fips-140-compliance.asciidoc @@ -27,6 +27,12 @@ For {es}, adherence to FIPS 140-2 is ensured by [discrete] === Upgrade considerations +[IMPORTANT] +==== +include::fips-java17.asciidoc[] +==== + + If you plan to upgrade your existing cluster to a version that can be run in a FIPS 140-2 configured JVM, we recommend to first perform a rolling upgrade to the new version in your existing JVM and perform all necessary diff --git a/x-pack/docs/en/security/fips-java17.asciidoc b/x-pack/docs/en/security/fips-java17.asciidoc new file mode 100644 index 0000000000000..b5a99a70526ef --- /dev/null +++ b/x-pack/docs/en/security/fips-java17.asciidoc @@ -0,0 +1,9 @@ +{es} 8.0 requires Java 17 or later. +There is not yet a FIPS-certified security module for Java 17 +that you can use when running {es} 8.0 in FIPS 140-2 mode. +If you run in FIPS 140-2 mode, you will either need to request +an exception from your security organization to upgrade to {es} 8.0, +or remain on {es} 7.x until Java 17 is certified. +ifeval::["{release-state}"=="released"] +Alternatively, consider using {ess} in the FedRAMP-certified GovCloud region. +endif::[] \ No newline at end of file From 14456388076c9ab27375afc4238855cb5eb9c357 Mon Sep 17 00:00:00 2001 From: Keith Massey Date: Wed, 6 Oct 2021 14:05:21 -0500 Subject: [PATCH 206/250] Adding config so that some tests will break if over-the-wire encryption fails (#78409) Until recently, if a user configured over-the-wire encryption for repository-hdfs they would get an exception. That was fixed in an upgraded ticket in two ways: (1) jvm permissions were opened up for haddop2, and (2) support for the hadoop 3 hdfs client was added. This commit adds configuration to a couple of integration tests so that they fail if over-the-wire encryption is not working. Relates #76897 #76734 --- .../test/secure_hdfs_repository/20_repository_create.yml | 1 + .../rest-api-spec/test/secure_hdfs_repository/30_snapshot.yml | 1 + test/fixtures/hdfs2-fixture/src/main/java/hdfs/MiniHDFS.java | 1 + 3 files changed, 3 insertions(+) diff --git a/plugins/repository-hdfs/src/test/resources/rest-api-spec/test/secure_hdfs_repository/20_repository_create.yml b/plugins/repository-hdfs/src/test/resources/rest-api-spec/test/secure_hdfs_repository/20_repository_create.yml index 117d9a74d87d9..0db6f1b01abff 100644 --- a/plugins/repository-hdfs/src/test/resources/rest-api-spec/test/secure_hdfs_repository/20_repository_create.yml +++ b/plugins/repository-hdfs/src/test/resources/rest-api-spec/test/secure_hdfs_repository/20_repository_create.yml @@ -14,6 +14,7 @@ path: "/user/elasticsearch/test/repository_create" security: principal: "elasticsearch@BUILD.ELASTIC.CO" + conf.dfs.encrypt.data.transfer.cipher.suites: "AES/CTR/NoPadding" # Get repository - do: diff --git a/plugins/repository-hdfs/src/test/resources/rest-api-spec/test/secure_hdfs_repository/30_snapshot.yml b/plugins/repository-hdfs/src/test/resources/rest-api-spec/test/secure_hdfs_repository/30_snapshot.yml index 01b137279714a..365f0243a1f2b 100644 --- a/plugins/repository-hdfs/src/test/resources/rest-api-spec/test/secure_hdfs_repository/30_snapshot.yml +++ b/plugins/repository-hdfs/src/test/resources/rest-api-spec/test/secure_hdfs_repository/30_snapshot.yml @@ -15,6 +15,7 @@ path: "/user/elasticsearch/test/snapshot" security: principal: "elasticsearch@BUILD.ELASTIC.CO" + conf.dfs.encrypt.data.transfer.cipher.suites: "AES/CTR/NoPadding" # Create index - do: diff --git a/test/fixtures/hdfs2-fixture/src/main/java/hdfs/MiniHDFS.java b/test/fixtures/hdfs2-fixture/src/main/java/hdfs/MiniHDFS.java index ee993fec74eb4..0a26f5d82ac17 100644 --- a/test/fixtures/hdfs2-fixture/src/main/java/hdfs/MiniHDFS.java +++ b/test/fixtures/hdfs2-fixture/src/main/java/hdfs/MiniHDFS.java @@ -84,6 +84,7 @@ public static void main(String[] args) throws Exception { cfg.set(DFSConfigKeys.DFS_BLOCK_ACCESS_TOKEN_ENABLE_KEY, "true"); cfg.set(DFSConfigKeys.IGNORE_SECURE_PORTS_FOR_TESTING_KEY, "true"); cfg.set(DFSConfigKeys.DFS_ENCRYPT_DATA_TRANSFER_KEY, "true"); + cfg.set(DFSConfigKeys.DFS_ENCRYPT_DATA_TRANSFER_CIPHER_SUITES_KEY, "AES/CTR/NoPadding"); } UserGroupInformation.setConfiguration(cfg); From 038a82f86aa29d4911f081e3c0e358344092e5c7 Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Wed, 6 Oct 2021 12:07:59 -0700 Subject: [PATCH 207/250] Must date math test failure see https://github.com/elastic/elasticsearch/issues/78783 --- .../cluster/metadata/DateMathExpressionResolverTests.java | 1 + 1 file changed, 1 insertion(+) diff --git a/server/src/test/java/org/elasticsearch/cluster/metadata/DateMathExpressionResolverTests.java b/server/src/test/java/org/elasticsearch/cluster/metadata/DateMathExpressionResolverTests.java index 9fe9f4d222c6c..698464b718bde 100644 --- a/server/src/test/java/org/elasticsearch/cluster/metadata/DateMathExpressionResolverTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/metadata/DateMathExpressionResolverTests.java @@ -127,6 +127,7 @@ public void testExpression_MixedArray() throws Exception { formatDate("uuuu.MM", dateFromMillis(context.getStartTime()).withDayOfMonth(1)))); } + @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/78783") public void testExpression_CustomTimeZoneInIndexName() throws Exception { ZoneId timeZone; int hoursOffset; From dc1f278d218cd3e0eb03f0e9187fec6f1f78c3c3 Mon Sep 17 00:00:00 2001 From: Keith Massey Date: Wed, 6 Oct 2021 14:40:00 -0500 Subject: [PATCH 208/250] Revert "Adding config so that some tests will break if over-the-wire encryption fails (#78409)" (#78787) This commit reverts #78409 because #78409 intentionally fails the build when over-the-wire encryption fails. Unfortunately over-the-wire encryption is broken on the hadoop 2 client on java 9+, and we're still supporting the hadoop 2 client. Reverting that commit for now. --- .../test/secure_hdfs_repository/20_repository_create.yml | 1 - .../rest-api-spec/test/secure_hdfs_repository/30_snapshot.yml | 1 - test/fixtures/hdfs2-fixture/src/main/java/hdfs/MiniHDFS.java | 1 - 3 files changed, 3 deletions(-) diff --git a/plugins/repository-hdfs/src/test/resources/rest-api-spec/test/secure_hdfs_repository/20_repository_create.yml b/plugins/repository-hdfs/src/test/resources/rest-api-spec/test/secure_hdfs_repository/20_repository_create.yml index 0db6f1b01abff..117d9a74d87d9 100644 --- a/plugins/repository-hdfs/src/test/resources/rest-api-spec/test/secure_hdfs_repository/20_repository_create.yml +++ b/plugins/repository-hdfs/src/test/resources/rest-api-spec/test/secure_hdfs_repository/20_repository_create.yml @@ -14,7 +14,6 @@ path: "/user/elasticsearch/test/repository_create" security: principal: "elasticsearch@BUILD.ELASTIC.CO" - conf.dfs.encrypt.data.transfer.cipher.suites: "AES/CTR/NoPadding" # Get repository - do: diff --git a/plugins/repository-hdfs/src/test/resources/rest-api-spec/test/secure_hdfs_repository/30_snapshot.yml b/plugins/repository-hdfs/src/test/resources/rest-api-spec/test/secure_hdfs_repository/30_snapshot.yml index 365f0243a1f2b..01b137279714a 100644 --- a/plugins/repository-hdfs/src/test/resources/rest-api-spec/test/secure_hdfs_repository/30_snapshot.yml +++ b/plugins/repository-hdfs/src/test/resources/rest-api-spec/test/secure_hdfs_repository/30_snapshot.yml @@ -15,7 +15,6 @@ path: "/user/elasticsearch/test/snapshot" security: principal: "elasticsearch@BUILD.ELASTIC.CO" - conf.dfs.encrypt.data.transfer.cipher.suites: "AES/CTR/NoPadding" # Create index - do: diff --git a/test/fixtures/hdfs2-fixture/src/main/java/hdfs/MiniHDFS.java b/test/fixtures/hdfs2-fixture/src/main/java/hdfs/MiniHDFS.java index 0a26f5d82ac17..ee993fec74eb4 100644 --- a/test/fixtures/hdfs2-fixture/src/main/java/hdfs/MiniHDFS.java +++ b/test/fixtures/hdfs2-fixture/src/main/java/hdfs/MiniHDFS.java @@ -84,7 +84,6 @@ public static void main(String[] args) throws Exception { cfg.set(DFSConfigKeys.DFS_BLOCK_ACCESS_TOKEN_ENABLE_KEY, "true"); cfg.set(DFSConfigKeys.IGNORE_SECURE_PORTS_FOR_TESTING_KEY, "true"); cfg.set(DFSConfigKeys.DFS_ENCRYPT_DATA_TRANSFER_KEY, "true"); - cfg.set(DFSConfigKeys.DFS_ENCRYPT_DATA_TRANSFER_CIPHER_SUITES_KEY, "AES/CTR/NoPadding"); } UserGroupInformation.setConfiguration(cfg); From 69cf6794ec06cb81185fe1f19cca519d3edcd225 Mon Sep 17 00:00:00 2001 From: Rory Hunter Date: Wed, 6 Oct 2021 21:17:13 +0100 Subject: [PATCH 209/250] Add a system property to forcibly format everything (#78768) In order to make it easier to migrate to an automatically-formatted world, add a system property that causes Spotless to format every Java project, ignoring the exclusion list. --- .../src/main/groovy/elasticsearch.formatting.gradle | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build-tools-internal/src/main/groovy/elasticsearch.formatting.gradle b/build-tools-internal/src/main/groovy/elasticsearch.formatting.gradle index 205e5e3229394..7147f5e09610b 100644 --- a/build-tools-internal/src/main/groovy/elasticsearch.formatting.gradle +++ b/build-tools-internal/src/main/groovy/elasticsearch.formatting.gradle @@ -196,7 +196,8 @@ def projectPathsToExclude = [ subprojects { plugins.withType(ElasticsearchJavaPlugin).whenPluginAdded { - if (projectPathsToExclude.contains(project.path) == false) { + if (projectPathsToExclude.contains(project.path) == false || + providers.systemProperty("es.format.everything").forUseAtConfigurationTime().isPresent()) { project.apply plugin: "com.diffplug.spotless" From 78e30a608e7a94daa9b580dd75b429e1e3faede7 Mon Sep 17 00:00:00 2001 From: Nik Everett Date: Wed, 6 Oct 2021 16:40:07 -0400 Subject: [PATCH 210/250] TSDB: Fix template name in test We had a test that was periodically failing with a bad expected warning. It turns out I had written the wrong template name in the warning and the test didn't fail on the PR due to bad luck. Closes #78726 --- .../resources/rest-api-spec/test/data_stream/150_tsdb.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/150_tsdb.yml b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/150_tsdb.yml index 6acc35392a53d..3a4b18dfe1200 100644 --- a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/150_tsdb.yml +++ b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/150_tsdb.yml @@ -6,7 +6,7 @@ setup: - do: allowed_warnings: - - "index template [tsdbds-template1] has index patterns [simple-data-stream1] matching patterns from existing older templates [global] with patterns (global => [*]); this template [my-template1] will take precedence during new index creation" + - "index template [my-template1] has index patterns [k8s*] matching patterns from existing older templates [global] with patterns (global => [*]); this template [my-template1] will take precedence during new index creation" indices.put_index_template: name: my-template1 body: From 548bd30cefd37923737cdc0934b61b7c238c2c77 Mon Sep 17 00:00:00 2001 From: James Baiera Date: Wed, 6 Oct 2021 17:18:34 -0400 Subject: [PATCH 211/250] Add previously removed settings back for 8.0 (#78784) Some recent PR's removed some deprecated settings from master. This PR re-adds the settings with deprecation enabled so that clusters can still start when they are specified, even if their features have been removed. --- .../xpack/monitoring/Monitoring.java | 1 + .../MonitoringDeprecatedSettings.java | 41 +++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/MonitoringDeprecatedSettings.java diff --git a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/Monitoring.java b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/Monitoring.java index 50688b621c0ff..17efb21fb23d2 100644 --- a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/Monitoring.java +++ b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/Monitoring.java @@ -168,6 +168,7 @@ public List> getSettings() { settings.add(EnrichStatsCollector.STATS_TIMEOUT); settings.addAll(Exporters.getSettings()); settings.add(Monitoring.MIGRATION_DECOMMISSION_ALERTS); + settings.addAll(MonitoringDeprecatedSettings.getSettings()); return Collections.unmodifiableList(settings); } diff --git a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/MonitoringDeprecatedSettings.java b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/MonitoringDeprecatedSettings.java new file mode 100644 index 0000000000000..3b6a5370a5151 --- /dev/null +++ b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/MonitoringDeprecatedSettings.java @@ -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.monitoring; + +import org.elasticsearch.common.settings.Setting; +import org.elasticsearch.common.settings.Setting.Property; +import org.elasticsearch.core.TimeValue; + +import java.util.Arrays; +import java.util.List; + +/** + * A collection of settings that are marked as deprecated and soon to be removed. These settings have been moved here because the features + * that make use of them have been removed from the code. Their removals can be enacted after the standard deprecation period has completed. + */ +public final class MonitoringDeprecatedSettings { + private MonitoringDeprecatedSettings() {} + + // =================== + // Deprecated in 7.16: + public static final Setting.AffixSetting TEMPLATE_CREATE_LEGACY_VERSIONS_SETTING = + Setting.affixKeySetting("xpack.monitoring.exporters.","index.template.create_legacy_templates", + (key) -> Setting.boolSetting(key, true, Property.Dynamic, Property.NodeScope, Property.Deprecated)); + public static final Setting.AffixSetting USE_INGEST_PIPELINE_SETTING = + Setting.affixKeySetting("xpack.monitoring.exporters.","use_ingest", + key -> Setting.boolSetting(key, true, Property.Dynamic, Property.NodeScope, Property.Deprecated)); + public static final Setting.AffixSetting PIPELINE_CHECK_TIMEOUT_SETTING = + Setting.affixKeySetting("xpack.monitoring.exporters.","index.pipeline.master_timeout", + (key) -> Setting.timeSetting(key, TimeValue.MINUS_ONE, Property.Dynamic, Property.NodeScope, Property.Deprecated)); + // =================== + + public static List> getSettings() { + return Arrays.asList(TEMPLATE_CREATE_LEGACY_VERSIONS_SETTING, USE_INGEST_PIPELINE_SETTING, PIPELINE_CHECK_TIMEOUT_SETTING); + } + +} From 7e5e05540ffb88bc534a158ac379668c095da4ef Mon Sep 17 00:00:00 2001 From: James Rodewig <40268737+jrodewig@users.noreply.github.com> Date: Wed, 6 Oct 2021 17:55:11 -0400 Subject: [PATCH 212/250] [DOCS] Fix system index refs in restore tutorial (#78582) Fixes a couple of erroneous references related to system indices in the snapshot restore tutorial: * Calling the delete index API on `*` will only delete some system indices, such as the `.security`. It won't delete others, such as `.geoip_databases`. * Not all dot indices are system indices. Some are just hidden indices. Relates to #76929 --- .../snapshot-restore/restore-snapshot.asciidoc | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/docs/reference/snapshot-restore/restore-snapshot.asciidoc b/docs/reference/snapshot-restore/restore-snapshot.asciidoc index 26744fdbaeccb..eda412f0084e7 100644 --- a/docs/reference/snapshot-restore/restore-snapshot.asciidoc +++ b/docs/reference/snapshot-restore/restore-snapshot.asciidoc @@ -100,9 +100,10 @@ operation is complete. WARNING: If the <> cluster setting is `false`, don't use the <> to -target the `*` or `.*` wildcard expression. If you use {es}'s security features, -this will delete system indices required for authentication. To delete all -regular indices, use `*,-.*` instead. +target the `*` or `.*` wildcard pattern. If you use {es}'s security features, +this will delete system indices required for authentication. Instead, target the +`*,-.*` wildcard pattern to exclude these system indices and other index names +that begin with a dot (`.`). [source,console] ---- @@ -118,9 +119,10 @@ By default, a restore request attempts to restore all indices and data streams in the snapshot, including system indices. If your cluster already contains one or more of these system indices, the request will return an error. -To avoid this error, specify the indices and data streams to restore. To -exclude system indices, append the `-.*` wildcard pattern. To restore all -indices and data streams except system indices, use `*,-.*`. +To avoid this error, specify the indices and data streams to restore. To exclude +system indices and other index names that begin with a dot (`.`), append the +`-.*` wildcard pattern. To restore all indices and data streams except dot +indices, use `*,-.*`. [source,console] ---- @@ -323,8 +325,7 @@ PUT _cluster/settings ---- // TEST[setup:setup-snapshots] -. Delete all existing indices and data streams on the cluster, including all -system indices. +. Delete existing indices and data streams on the cluster. + [source,console] ---- From 4df15f5177054baf5370670e2d78287af6964c65 Mon Sep 17 00:00:00 2001 From: Keith Massey Date: Wed, 6 Oct 2021 17:19:04 -0500 Subject: [PATCH 213/250] Changing name of shards field in node/stats api to shard_stats (#78531) If the _nodes/stats API received a level=shards request parameter, then the response would have two "shards" fields, which would cause problems with json parsers. This commit renames the "shards" field that currently only contains "total_count" to "shard_stats". Relates #78311 #75433 --- docs/reference/cluster/nodes-stats.asciidoc | 4 +-- rest-api-spec/build.gradle | 3 ++ .../rest-api-spec/api/nodes.stats.json | 4 +-- .../test/nodes.stats/11_indices_metrics.yml | 30 +++++++++---------- .../admin/indices/stats/CommonStatsFlags.java | 2 +- .../index/shard/ShardCountStats.java | 2 +- 6 files changed, 24 insertions(+), 21 deletions(-) diff --git a/docs/reference/cluster/nodes-stats.asciidoc b/docs/reference/cluster/nodes-stats.asciidoc index b92f3403d8aa5..a2ba22578275f 100644 --- a/docs/reference/cluster/nodes-stats.asciidoc +++ b/docs/reference/cluster/nodes-stats.asciidoc @@ -960,11 +960,11 @@ Time in milliseconds recovery operations were delayed due to throttling. ======= -`shards`:: +`shards_stats`:: (object) Contains statistics about all shards assigned to the node. + -.Properties of `shards` +.Properties of `shard_stats` [%collapsible%open] ======= `total_count`:: diff --git a/rest-api-spec/build.gradle b/rest-api-spec/build.gradle index 48c87321e9aaa..c98869d84f471 100644 --- a/rest-api-spec/build.gradle +++ b/rest-api-spec/build.gradle @@ -81,6 +81,9 @@ tasks.named("yamlRestTestV7CompatTransform").configure { task -> task.skipTest("search.aggregation/20_terms/string profiler via global ordinals native implementation", "The profiler results aren't backwards compatible.") task.skipTest("search.aggregation/20_terms/string profiler via map", "The profiler results aren't backwards compatible.") task.skipTest("search.aggregation/20_terms/numeric profiler", "The profiler results aren't backwards compatible.") + task.skipTest("nodes.stats/11_indices_metrics/Metric - _all for indices shards", "Muted because we are intentionally making a breaking bugfix. Unmute when #78531 is backported") + task.skipTest("nodes.stats/11_indices_metrics/indices shards total count test", "Muted because we are intentionally making a breaking bugfix. Unmute when #78531 is backported") + task.skipTest("nodes.stats/11_indices_metrics/Metric - blank for indices shards", "Muted because we are intentionally making a breaking bugfix. Unmute when #78531 is backported") task.replaceValueInMatch("_type", "_doc") task.addAllowedWarningRegex("\\[types removal\\].*") diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/nodes.stats.json b/rest-api-spec/src/main/resources/rest-api-spec/api/nodes.stats.json index 7a13a6c1033c5..2e19fa1c35dfe 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/nodes.stats.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/nodes.stats.json @@ -128,7 +128,7 @@ "store", "warmer", "bulk", - "shards" + "shard_stats" ], "description":"Limit the information returned for `indices` metric to the specific index metrics. Isn't used if `indices` (or `all`) metric isn't specified." } @@ -177,7 +177,7 @@ "store", "warmer", "bulk", - "shards" + "shard_stats" ], "description":"Limit the information returned for `indices` metric to the specific index metrics. Isn't used if `indices` (or `all`) metric isn't specified." }, diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/nodes.stats/11_indices_metrics.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/nodes.stats/11_indices_metrics.yml index 1ef7e81bf16df..ba2b5fdb40a66 100644 --- a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/nodes.stats/11_indices_metrics.yml +++ b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/nodes.stats/11_indices_metrics.yml @@ -109,7 +109,7 @@ - is_false: nodes.$node_id.indices.segments - is_false: nodes.$node_id.indices.translog - is_false: nodes.$node_id.indices.recovery - - is_false: nodes.$node_id.indices.shards + - is_false: nodes.$node_id.indices.shard_stats --- "Metric - multi": @@ -167,7 +167,7 @@ - is_false: nodes.$node_id.indices.segments - is_false: nodes.$node_id.indices.translog - is_true: nodes.$node_id.indices.recovery - - is_false: nodes.$node_id.indices.shards + - is_false: nodes.$node_id.indices.shard_stats --- "Metric - _all include_segment_file_sizes": @@ -225,7 +225,7 @@ - is_true: nodes.$node_id.indices.segments - is_false: nodes.$node_id.indices.translog - is_false: nodes.$node_id.indices.recovery - - is_false: nodes.$node_id.indices.shards + - is_false: nodes.$node_id.indices.shard_stats - is_true: nodes.$node_id.indices.segments.file_sizes --- @@ -257,7 +257,7 @@ - is_true: nodes.$node_id.indices.segments - is_false: nodes.$node_id.indices.translog - is_false: nodes.$node_id.indices.recovery - - is_false: nodes.$node_id.indices.shards + - is_false: nodes.$node_id.indices.shard_stats --- "Metric - _all include_unloaded_segments": @@ -321,10 +321,10 @@ # null and cannot be tested here --- -"Metric - blank for indices shards": +"Metric - blank for indices shard_stats": - skip: features: [arbitrary_key] - version: " - 7.14.99" + version: " - 7.16.1" reason: "total shard count added in version 7.15.0" - do: nodes.info: {} @@ -334,14 +334,14 @@ - do: nodes.stats: {} - - is_true: nodes.$node_id.indices.shards - - match: { nodes.$node_id.indices.shards.total_count: 0 } + - is_true: nodes.$node_id.indices.shard_stats + - match: { nodes.$node_id.indices.shard_stats.total_count: 0 } --- -"Metric - _all for indices shards": +"Metric - _all for indices shard_stats": - skip: features: [arbitrary_key] - version: " - 7.14.99" + version: " - 7.16.1" reason: "total shard count added in version 7.15.0" - do: nodes.info: {} @@ -351,16 +351,16 @@ - do: nodes.stats: { metric: _all } - - is_true: nodes.$node_id.indices.shards - - match: { nodes.$node_id.indices.shards.total_count: 0 } + - is_true: nodes.$node_id.indices.shard_stats + - match: { nodes.$node_id.indices.shard_stats.total_count: 0 } --- -"indices shards total count test": +"indices shard_stats total count test": - skip: features: ["allowed_warnings", arbitrary_key] - version: " - 7.14.99" + version: " - 7.16.1" reason: "total shard count added in version 7.15.0" - do: @@ -387,4 +387,4 @@ - do: nodes.stats: { metric: _all } - - gte: { nodes.$node_id.indices.shards.total_count: 1 } + - gte: { nodes.$node_id.indices.shard_stats.total_count: 1 } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/stats/CommonStatsFlags.java b/server/src/main/java/org/elasticsearch/action/admin/indices/stats/CommonStatsFlags.java index fc1238a3d3486..31d507aac5e27 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/stats/CommonStatsFlags.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/stats/CommonStatsFlags.java @@ -214,7 +214,7 @@ public enum Flag { RequestCache("request_cache", 15), Recovery("recovery", 16), Bulk("bulk", 17), - Shards("shards", 18); + Shards("shard_stats", 18); private final String restName; private final int index; diff --git a/server/src/main/java/org/elasticsearch/index/shard/ShardCountStats.java b/server/src/main/java/org/elasticsearch/index/shard/ShardCountStats.java index 5ea65c35691ea..fe02534d9bf7d 100644 --- a/server/src/main/java/org/elasticsearch/index/shard/ShardCountStats.java +++ b/server/src/main/java/org/elasticsearch/index/shard/ShardCountStats.java @@ -56,7 +56,7 @@ public void writeTo(StreamOutput out) throws IOException { } static final class Fields { - static final String SHARDS = "shards"; + static final String SHARDS = "shard_stats"; static final String TOTAL_COUNT = "total_count"; } From d85195b6bf861f07dd5071ddff4048045be88623 Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Wed, 6 Oct 2021 15:37:52 -0700 Subject: [PATCH 214/250] Fix date math zone test to use negative minutes (#78796) Joda classes for timezones accepted positive minutes when a negative hours was used, but Java time expects negative minutes when negative hours are used. This commit fixes tests to ensure negative minutes are used with negative hours. closes #78783 --- .../cluster/metadata/DateMathExpressionResolverTests.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server/src/test/java/org/elasticsearch/cluster/metadata/DateMathExpressionResolverTests.java b/server/src/test/java/org/elasticsearch/cluster/metadata/DateMathExpressionResolverTests.java index 698464b718bde..41161d60486f2 100644 --- a/server/src/test/java/org/elasticsearch/cluster/metadata/DateMathExpressionResolverTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/metadata/DateMathExpressionResolverTests.java @@ -126,8 +126,7 @@ public void testExpression_MixedArray() throws Exception { assertThat(result.get(3), equalTo(".logstash-" + formatDate("uuuu.MM", dateFromMillis(context.getStartTime()).withDayOfMonth(1)))); } - - @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/78783") + public void testExpression_CustomTimeZoneInIndexName() throws Exception { ZoneId timeZone; int hoursOffset; @@ -138,6 +137,9 @@ public void testExpression_CustomTimeZoneInIndexName() throws Exception { } else { hoursOffset = randomIntBetween(-11, 13); minutesOffset = randomIntBetween(0, 59); + if (hoursOffset < 0) { + minutesOffset = -minutesOffset; + } timeZone = ZoneOffset.ofHoursMinutes(hoursOffset, minutesOffset); } ZonedDateTime now; From bfba7fa063260a52d53f10c8ebcfbb6592842089 Mon Sep 17 00:00:00 2001 From: Julie Tibshirani Date: Wed, 6 Oct 2021 17:15:27 -0700 Subject: [PATCH 215/250] Load knn vectors format with mmapfs (#78724) Before the format used niofs. The current knn vectors implementation is based on the HNSW algorithm, which is designed for the case where the graph and vectors are be held in memory. Switching to mmapfs from niofs made a huge difference in ANN benchmarks, speeding up some searches over 3x. --- .../org/elasticsearch/index/store/LuceneFilesExtensions.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/index/store/LuceneFilesExtensions.java b/server/src/main/java/org/elasticsearch/index/store/LuceneFilesExtensions.java index f3ae4ae2d85b4..7dd4ee0218582 100644 --- a/server/src/main/java/org/elasticsearch/index/store/LuceneFilesExtensions.java +++ b/server/src/main/java/org/elasticsearch/index/store/LuceneFilesExtensions.java @@ -69,8 +69,8 @@ public enum LuceneFilesExtensions { TVM("tvm", "Term Vector Metadata", true, false), TVX("tvx", "Term Vector Index", false, false), // kNN vectors format - VEC("vec", "Vector Data", false, false), - VEX("vex", "Vector Index", false, false), + VEC("vec", "Vector Data", false, true), + VEX("vex", "Vector Index", false, true), VEM("vem", "Vector Metadata", true, false); /** From 67e310e98999b72c136fac3bc372deff76fefab7 Mon Sep 17 00:00:00 2001 From: Rory Hunter Date: Thu, 7 Oct 2021 09:19:53 +0100 Subject: [PATCH 216/250] Improve Docker image caching and testing (#78552) Firstly: we tag our Docker images with various pieces of information, including a timestamp for when the image was built. However, this makes it impossible completely cache the image. When developing the Docker images, it's very tedious to completely rebuild an image for every single change. Therefore, provided we're not building a proper release build, we fix the build time to midnight so that the Docker build cache is usable. Secondly: the `DockerBuildTask` outputs a marker file to indicate that an image has been built, but that isn't enough for a meaningful up-to-date check by Gradle. Improve this by fetching the newly-built image's hash, and writing that to the output file. Thirdly: improve the Docker tests to make them more ergonomic, and also disable `ingest.geoip.downloader.enabled` by default. Fourthly: add missing test coverage for sourcing settings from env vars. --- .../internal/docker/DockerBuildTask.java | 32 ++- distribution/docker/build.gradle | 15 +- .../packaging/test/DockerTests.java | 188 +++++++++--------- .../test/KeystoreManagementTests.java | 49 ++--- .../packaging/util/docker/Docker.java | 19 +- .../packaging/util/docker/DockerRun.java | 38 ++-- 6 files changed, 195 insertions(+), 146 deletions(-) diff --git a/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/docker/DockerBuildTask.java b/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/docker/DockerBuildTask.java index e06253a3d9591..3449b4d9e40ee 100644 --- a/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/docker/DockerBuildTask.java +++ b/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/docker/DockerBuildTask.java @@ -29,10 +29,17 @@ import org.gradle.workers.WorkParameters; import org.gradle.workers.WorkerExecutor; -import javax.inject.Inject; +import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.nio.file.Files; import java.util.Arrays; +import java.util.List; +import javax.inject.Inject; +/** + * This task wraps up the details of building a Docker image, including adding a pull + * mechanism that can retry, and emitting the image SHA as a task output. + */ public class DockerBuildTask extends DefaultTask { private static final Logger LOGGER = Logging.getLogger(DockerBuildTask.class); @@ -167,6 +174,8 @@ public void execute() { parameters.getBaseImages().get().forEach(this::pullBaseImage); } + final List tags = parameters.getTags().get(); + LoggedExec.exec(execOperations, spec -> { spec.executable("docker"); @@ -176,17 +185,32 @@ public void execute() { spec.args("--no-cache"); } - parameters.getTags().get().forEach(tag -> spec.args("--tag", tag)); + tags.forEach(tag -> spec.args("--tag", tag)); parameters.getBuildArgs().get().forEach((k, v) -> spec.args("--build-arg", k + "=" + v)); }); + // Fetch the Docker image's hash, and write it to desk as the task's output. Doing this allows us + // to do proper up-to-date checks in Gradle. try { - parameters.getMarkerFile().getAsFile().get().createNewFile(); + final String checksum = getImageChecksum(tags.get(0)); + Files.writeString(parameters.getMarkerFile().getAsFile().get().toPath(), checksum + "\n"); } catch (IOException e) { - throw new RuntimeException("Failed to create marker file", e); + throw new RuntimeException("Failed to write marker file", e); } } + + private String getImageChecksum(String imageTag) { + final ByteArrayOutputStream stdout = new ByteArrayOutputStream(); + + execOperations.exec(spec -> { + spec.setCommandLine("docker", "inspect", "--format", "{{ .Id }}", imageTag); + spec.setStandardOutput(stdout); + spec.setIgnoreExitValue(false); + }); + + return stdout.toString().trim(); + } } interface Parameters extends WorkParameters { diff --git a/distribution/docker/build.gradle b/distribution/docker/build.gradle index 6d30753bef5b3..d807813626a4d 100644 --- a/distribution/docker/build.gradle +++ b/distribution/docker/build.gradle @@ -9,6 +9,7 @@ import org.elasticsearch.gradle.internal.docker.TransformLog4jConfigFilter import org.elasticsearch.gradle.internal.info.BuildParams import java.nio.file.Path +import java.time.temporal.ChronoUnit apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.test.fixtures' @@ -81,10 +82,17 @@ dependencies { ext.expansions = { Architecture architecture, DockerBase base -> def (major,minor) = VersionProperties.elasticsearch.split("\\.") + // We tag our Docker images with various pieces of information, including a timestamp + // for when the image was built. However, this makes it impossible completely cache + // the image. When developing the Docker images, it's very tedious to completely rebuild + // an image for every single change. Therefore, outside of CI, we fix the + // build time to midnight so that the Docker build cache is usable. + def buildDate = BuildParams.isCi() ? BuildParams.buildDate : BuildParams.buildDate.truncatedTo(ChronoUnit.DAYS) + return [ 'base_image' : base.image, 'bin_dir' : base == DockerBase.IRON_BANK ? 'scripts' : 'bin', - 'build_date' : BuildParams.buildDate, + 'build_date' : buildDate, 'config_dir' : base == DockerBase.IRON_BANK ? 'scripts' : 'config', 'git_revision' : BuildParams.gitRevision, 'license' : base == DockerBase.IRON_BANK ? 'Elastic License 1.0' : 'Elastic-License-2.0', @@ -341,6 +349,7 @@ void addBuildDockerImageTask(Architecture architecture, DockerBase base) { dockerContext.fileProvider(transformTask.map { Sync task -> task.getDestinationDir() }) + noCache = BuildParams.isCi tags = generateTags(base) if (base == DockerBase.IRON_BANK) { @@ -402,11 +411,11 @@ void addBuildEssDockerImageTask(Architecture architecture) { tasks.register(taskName("build", architecture, base, "DockerImage"), DockerBuildTask) { TaskProvider buildCloudTask = tasks.named(taskName("build", architecture, DockerBase.CLOUD, "DockerImage")) - dependsOn(buildCloudTask) - dependsOn(buildContextTask) + inputs.files(buildCloudTask) dockerContext.fileProvider(buildContextTask.map { it.getDestinationDir() }) + noCache = BuildParams.isCi baseImages = [] tags = generateTags(base) diff --git a/qa/os/src/test/java/org/elasticsearch/packaging/test/DockerTests.java b/qa/os/src/test/java/org/elasticsearch/packaging/test/DockerTests.java index 45689f0fed691..f6d5a4a845430 100644 --- a/qa/os/src/test/java/org/elasticsearch/packaging/test/DockerTests.java +++ b/qa/os/src/test/java/org/elasticsearch/packaging/test/DockerTests.java @@ -64,6 +64,7 @@ import static org.elasticsearch.packaging.util.docker.Docker.waitForElasticsearch; import static org.elasticsearch.packaging.util.docker.DockerFileMatcher.file; import static org.elasticsearch.packaging.util.docker.DockerRun.builder; +import static org.hamcrest.Matchers.allOf; import static org.hamcrest.Matchers.arrayContaining; import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.containsString; @@ -80,8 +81,13 @@ import static org.junit.Assume.assumeTrue; /** - * This class tests the Elasticsearch Docker images. We have more than one because we build - * an image with a custom, small base image, and an image based on RedHat's UBI. + * This class tests the Elasticsearch Docker images. We have several: + *
      + *
    • The default image with a custom, small base image
    • + *
    • A UBI-based image
    • + *
    • Another UBI image for Iron Bank
    • + *
    • Images for Cloud
    • + *
    */ public class DockerTests extends PackagingTestCase { private Path tempDir; @@ -95,10 +101,7 @@ public static void filterDistros() { @Before public void setupTest() throws IOException { - installation = runContainer( - distribution(), - builder().envVars(Map.of("ingest.geoip.downloader.enabled", "false", "ELASTIC_PASSWORD", PASSWORD)) - ); + installation = runContainer(distribution(), builder().envVar("ELASTIC_PASSWORD", PASSWORD)); tempDir = createTempDir(DockerTests.class.getSimpleName()); } @@ -129,7 +132,7 @@ public void test011SecurityEnabledStatus() throws Exception { */ public void test012SecurityCanBeDisabled() throws Exception { // restart container with security disabled - runContainer(distribution(), builder().envVars(Map.of("xpack.security.enabled", "false"))); + runContainer(distribution(), builder().envVar("xpack.security.enabled", "false")); waitForElasticsearch(installation); final int unauthStatusCode = ServerUtils.makeRequestAndGetStatus(Request.Get("http://localhost:9200"), null, null, null); assertThat(unauthStatusCode, equalTo(200)); @@ -155,7 +158,7 @@ public void test020PluginsListWithNoPlugins() { */ public void test021PluginsListWithPlugins() { assumeTrue( - "Only applies to non-Cloud images", + "Only applies to Cloud images", distribution.packaging == Packaging.DOCKER_CLOUD || distribution().packaging == Packaging.DOCKER_CLOUD_ESS ); @@ -214,7 +217,7 @@ public void test041AmazonCaCertsAreInTheKeystore() { /** * Check that when the keystore is created on startup, it is created with the correct permissions. */ - public void test042KeystorePermissionsAreCorrect() throws Exception { + public void test042KeystorePermissionsAreCorrect() { waitForElasticsearch(installation, USERNAME, PASSWORD); assertThat(installation.config("elasticsearch.keystore"), file(p660)); @@ -252,20 +255,11 @@ public void test070BindMountCustomPathConfAndJvmOptions() throws Exception { Files.setPosixFilePermissions(tempDir.resolve("log4j2.properties"), p644); // Restart the container - final Map volumes = Map.of(tempDir, Path.of("/usr/share/elasticsearch/config")); runContainer( distribution(), - builder().volumes(volumes) - .envVars( - Map.of( - "ES_JAVA_OPTS", - "-XX:-UseCompressedOops", - "ingest.geoip.downloader.enabled", - "false", - "ELASTIC_PASSWORD", - PASSWORD - ) - ) + builder().volume(tempDir, "/usr/share/elasticsearch/config") + .envVar("ES_JAVA_OPTS", "-XX:-UseCompressedOops") + .envVar("ELASTIC_PASSWORD", PASSWORD) ); waitForElasticsearch(installation, USERNAME, PASSWORD); @@ -292,11 +286,9 @@ public void test071BindMountCustomPathWithDifferentUID() throws Exception { mkDirWithPrivilegeEscalation(tempEsDataDir, 1500, 0); // Restart the container - final Map volumes = Map.of(tempEsDataDir.toAbsolutePath(), installation.data); - runContainer( distribution(), - builder().volumes(volumes).envVars(Map.of("ingest.geoip.downloader.enabled", "false", "ELASTIC_PASSWORD", PASSWORD)) + builder().volume(tempEsDataDir.toAbsolutePath(), installation.data).envVar("ELASTIC_PASSWORD", PASSWORD) ); waitForElasticsearch(installation, USERNAME, PASSWORD); @@ -341,18 +333,14 @@ public void test072RunEsAsDifferentUserAndGroup() throws Exception { chownWithPrivilegeEscalation(tempEsDataDir, "501:501"); chownWithPrivilegeEscalation(tempEsLogsDir, "501:501"); - // Define the bind mounts - final Map volumes = new HashMap<>(); - volumes.put(tempEsDataDir.toAbsolutePath(), installation.data); - volumes.put(tempEsConfigDir.toAbsolutePath(), installation.config); - volumes.put(tempEsLogsDir.toAbsolutePath(), installation.logs); - // Restart the container runContainer( distribution(), - builder().volumes(volumes) - .envVars(Map.of("ingest.geoip.downloader.enabled", "false", "ELASTIC_PASSWORD", PASSWORD)) + builder().envVar("ELASTIC_PASSWORD", PASSWORD) .uid(501, 501) + .volume(tempEsDataDir.toAbsolutePath(), installation.data) + .volume(tempEsConfigDir.toAbsolutePath(), installation.config) + .volume(tempEsLogsDir.toAbsolutePath(), installation.logs) ); waitForElasticsearch(installation, USERNAME, PASSWORD); @@ -362,14 +350,9 @@ public void test072RunEsAsDifferentUserAndGroup() throws Exception { * Check that it is possible to run Elasticsearch under a different user and group to the default, * without bind-mounting any directories, provided the container user is added to the `root` group. */ - public void test073RunEsAsDifferentUserAndGroupWithoutBindMounting() throws Exception { + public void test073RunEsAsDifferentUserAndGroupWithoutBindMounting() { // Restart the container - runContainer( - distribution(), - builder().envVars(Map.of("ingest.geoip.downloader.enabled", "false", "ELASTIC_PASSWORD", PASSWORD)) - .uid(501, 501) - .extraArgs("--group-add 0") - ); + runContainer(distribution(), builder().extraArgs("--group-add 0").uid(501, 501).envVar("ELASTIC_PASSWORD", PASSWORD)); waitForElasticsearch(installation, USERNAME, PASSWORD); } @@ -384,18 +367,17 @@ public void test080ConfigurePasswordThroughEnvironmentVariableFile() throws Exce // ELASTIC_PASSWORD_FILE Files.writeString(tempDir.resolve(passwordFilename), xpackPassword + "\n"); - Map envVars = Map.of("ELASTIC_PASSWORD_FILE", "/run/secrets/" + passwordFilename); - // File permissions need to be secured in order for the ES wrapper to accept // them for populating env var values Files.setPosixFilePermissions(tempDir.resolve(passwordFilename), p600); // But when running in Vagrant, also ensure ES can actually access the file chownWithPrivilegeEscalation(tempDir.resolve(passwordFilename), "1000:0"); - final Map volumes = Map.of(tempDir, Path.of("/run/secrets")); - // Restart the container - runContainer(distribution(), builder().volumes(volumes).envVars(envVars)); + runContainer( + distribution(), + builder().volume(tempDir, "/run/secrets").envVar("ELASTIC_PASSWORD_FILE", "/run/secrets/" + passwordFilename) + ); // If we configured security correctly, then this call will only work if we specify the correct credentials. try { @@ -432,18 +414,17 @@ public void test081SymlinksAreFollowedWithEnvironmentVariableFiles() throws Exce // it won't resolve inside the container. Files.createSymbolicLink(tempDir.resolve(symlinkFilename), Path.of(passwordFilename)); - Map envVars = Map.of("ELASTIC_PASSWORD_FILE", "/run/secrets/" + symlinkFilename); - // File permissions need to be secured in order for the ES wrapper to accept // them for populating env var values. The wrapper will resolve the symlink // and check the target's permissions. Files.setPosixFilePermissions(tempDir.resolve(passwordFilename), p600); - final Map volumes = Map.of(tempDir, Path.of("/run/secrets")); - // Restart the container - this will check that Elasticsearch started correctly, // and didn't fail to follow the symlink and check the file permissions - runContainer(distribution(), builder().volumes(volumes).envVars(envVars)); + runContainer( + distribution(), + builder().volume(tempDir, "/run/secrets").envVar("ELASTIC_PASSWORD_FILE", "/run/secrets/" + symlinkFilename) + ); } /** @@ -454,17 +435,16 @@ public void test082CannotUseEnvVarsAndFiles() throws Exception { Files.writeString(tempDir.resolve(passwordFilename), "other_hunter2\n"); - Map envVars = new HashMap<>(); - envVars.put("ELASTIC_PASSWORD", "hunter2"); - envVars.put("ELASTIC_PASSWORD_FILE", "/run/secrets/" + passwordFilename); - // File permissions need to be secured in order for the ES wrapper to accept // them for populating env var values Files.setPosixFilePermissions(tempDir.resolve(passwordFilename), p600); - final Map volumes = Map.of(tempDir, Path.of("/run/secrets")); - - final Result dockerLogs = runContainerExpectingFailure(distribution, builder().volumes(volumes).envVars(envVars)); + final Result dockerLogs = runContainerExpectingFailure( + distribution, + builder().volume(tempDir, "/run/secrets") + .envVar("ELASTIC_PASSWORD", "hunter2") + .envVar("ELASTIC_PASSWORD_FILE", "/run/secrets/" + passwordFilename) + ); assertThat( dockerLogs.stderr, @@ -481,15 +461,14 @@ public void test083EnvironmentVariablesUsingFilesHaveCorrectPermissions() throws Files.writeString(tempDir.resolve(passwordFilename), "hunter2\n"); - Map envVars = Map.of("ELASTIC_PASSWORD_FILE", "/run/secrets/" + passwordFilename); - // Set invalid file permissions Files.setPosixFilePermissions(tempDir.resolve(passwordFilename), p660); - final Map volumes = Map.of(tempDir, Path.of("/run/secrets")); - // Restart the container - final Result dockerLogs = runContainerExpectingFailure(distribution(), builder().volumes(volumes).envVars(envVars)); + final Result dockerLogs = runContainerExpectingFailure( + distribution(), + builder().volume(tempDir, "/run/secrets").envVar("ELASTIC_PASSWORD_FILE", "/run/secrets/" + passwordFilename) + ); assertThat( dockerLogs.stderr, @@ -518,15 +497,14 @@ public void test084SymlinkToFileWithInvalidPermissionsIsRejected() throws Except // it won't resolve inside the container. Files.createSymbolicLink(tempDir.resolve(symlinkFilename), Path.of(passwordFilename)); - Map envVars = Map.of("ELASTIC_PASSWORD_FILE", "/run/secrets/" + symlinkFilename); - // Set invalid permissions on the file that the symlink targets Files.setPosixFilePermissions(tempDir.resolve(passwordFilename), p775); - final Map volumes = Map.of(tempDir, Path.of("/run/secrets")); - // Restart the container - final Result dockerLogs = runContainerExpectingFailure(distribution(), builder().volumes(volumes).envVars(envVars)); + final Result dockerLogs = runContainerExpectingFailure( + distribution(), + builder().volume(tempDir, "/run/secrets").envVar("ELASTIC_PASSWORD_FILE", "/run/secrets/" + symlinkFilename) + ); assertThat( dockerLogs.stderr, @@ -545,7 +523,7 @@ public void test084SymlinkToFileWithInvalidPermissionsIsRejected() throws Except * `docker exec`, where the Docker image's entrypoint is not executed. */ public void test085EnvironmentVariablesAreRespectedUnderDockerExec() throws Exception { - installation = runContainer(distribution(), builder().envVars(Map.of("ELASTIC_PASSWORD", "hunter2"))); + installation = runContainer(distribution(), builder().envVar("ELASTIC_PASSWORD", "hunter2")); // The tool below requires a keystore, so ensure that ES is fully initialised before proceeding. waitForElasticsearch("green", null, installation, "elastic", "hunter2"); @@ -570,7 +548,7 @@ public void test085EnvironmentVariablesAreRespectedUnderDockerExec() throws Exce */ public void test086EnvironmentVariablesInSnakeCaseAreTranslated() { // Note the double-underscore in the var name here, which retains the underscore in translation - installation = runContainer(distribution(), builder().envVars(Map.of("ES_SETTING_XPACK_SECURITY_FIPS__MODE_ENABLED", "false"))); + installation = runContainer(distribution(), builder().envVar("ES_SETTING_XPACK_SECURITY_FIPS__MODE_ENABLED", "false")); final Optional commandLine = sh.run("bash -c 'COLUMNS=2000 ps ax'").stdout.lines() .filter(line -> line.contains("org.elasticsearch.bootstrap.Elasticsearch")) @@ -585,16 +563,18 @@ public void test086EnvironmentVariablesInSnakeCaseAreTranslated() { * Check that environment variables that do not match the criteria for translation to settings are ignored. */ public void test087EnvironmentVariablesInIncorrectFormatAreIgnored() { - final Map envVars = new HashMap<>(); - // No ES_SETTING_ prefix - envVars.put("XPACK_SECURITY_FIPS__MODE_ENABLED", "false"); - // Incomplete prefix - envVars.put("ES_XPACK_SECURITY_FIPS__MODE_ENABLED", "false"); - // Not underscore-separated - envVars.put("ES.XPACK.SECURITY.FIPS_MODE.ENABLED", "false"); - // Not uppercase - envVars.put("es_xpack_security_fips__mode_enabled", "false"); - installation = runContainer(distribution(), builder().envVars(envVars)); + installation = runContainer( + distribution(), + builder() + // No ES_SETTING_ prefix + .envVar("XPACK_SECURITY_FIPS__MODE_ENABLED", "false") + // Incomplete prefix + .envVar("ES_XPACK_SECURITY_FIPS__MODE_ENABLED", "false") + // Not underscore-separated + .envVar("ES.SETTING.XPACK.SECURITY.FIPS_MODE.ENABLED", "false") + // Not uppercase + .envVar("es_setting_xpack_security_fips__mode_enabled", "false") + ); final Optional commandLine = sh.run("bash -c 'COLUMNS=2000 ps ax'").stdout.lines() .filter(line -> line.contains("org.elasticsearch.bootstrap.Elasticsearch")) @@ -605,6 +585,32 @@ public void test087EnvironmentVariablesInIncorrectFormatAreIgnored() { assertThat(commandLine.get(), not(containsString("-Expack.security.fips_mode.enabled=false"))); } + /** + * Check that settings are applied when they are supplied as environment variables with names that: + *
      + *
    • Consist only of lowercase letters, numbers, underscores and hyphens
    • + *
    • Separated by periods
    • + *
    + */ + public void test088EnvironmentVariablesInDottedFormatArePassedThrough() { + // Note the double-underscore in the var name here, which retains the underscore in translation + installation = runContainer( + distribution(), + builder().envVar("xpack.security.fips_mode.enabled", "false").envVar("http.cors.allow-methods", "GET") + ); + + final Optional commandLine = sh.run("bash -c 'COLUMNS=2000 ps ax'").stdout.lines() + .filter(line -> line.contains("org.elasticsearch.bootstrap.Elasticsearch")) + .findFirst(); + + assertThat(commandLine.isPresent(), equalTo(true)); + + assertThat( + commandLine.get(), + allOf(containsString("-Expack.security.fips_mode.enabled=false"), containsString("-Ehttp.cors.allow-methods=GET")) + ); + } + /** * Check whether the elasticsearch-certutil tool has been shipped correctly, * and if present then it can execute. @@ -746,7 +752,7 @@ public void test110OrgOpencontainersLabels() throws Exception { /** * Check that the container logs contain the expected content for Elasticsearch itself. */ - public void test120DockerLogsIncludeElasticsearchLogs() throws Exception { + public void test120DockerLogsIncludeElasticsearchLogs() { waitForElasticsearch(installation, USERNAME, PASSWORD); final Result containerLogs = getContainerLogs(); @@ -757,11 +763,8 @@ public void test120DockerLogsIncludeElasticsearchLogs() throws Exception { /** * Check that it is possible to write logs to disk */ - public void test121CanUseStackLoggingConfig() throws Exception { - runContainer( - distribution(), - builder().envVars(Map.of("ES_LOG_STYLE", "file", "ingest.geoip.downloader.enabled", "false", "ELASTIC_PASSWORD", PASSWORD)) - ); + public void test121CanUseStackLoggingConfig() { + runContainer(distribution(), builder().envVar("ES_LOG_STYLE", "file").envVar("ELASTIC_PASSWORD", PASSWORD)); waitForElasticsearch(installation, USERNAME, PASSWORD); @@ -779,11 +782,8 @@ public void test121CanUseStackLoggingConfig() throws Exception { /** * Check that the default logging config can be explicitly selected. */ - public void test122CanUseDockerLoggingConfig() throws Exception { - runContainer( - distribution(), - builder().envVars(Map.of("ES_LOG_STYLE", "console", "ingest.geoip.downloader.enabled", "false", "ELASTIC_PASSWORD", PASSWORD)) - ); + public void test122CanUseDockerLoggingConfig() { + runContainer(distribution(), builder().envVar("ES_LOG_STYLE", "console").envVar("ELASTIC_PASSWORD", PASSWORD)); waitForElasticsearch(installation, USERNAME, PASSWORD); @@ -798,7 +798,7 @@ public void test122CanUseDockerLoggingConfig() throws Exception { * Check that an unknown logging config is rejected */ public void test123CannotUseUnknownLoggingConfig() { - final Result result = runContainerExpectingFailure(distribution(), builder().envVars(Map.of("ES_LOG_STYLE", "unknown"))); + final Result result = runContainerExpectingFailure(distribution(), builder().envVar("ES_LOG_STYLE", "unknown")); assertThat(result.stderr, containsString("ERROR: ES_LOG_STYLE set to [unknown]. Expected [console] or [file]")); } @@ -806,8 +806,8 @@ public void test123CannotUseUnknownLoggingConfig() { /** * Check that it when configuring logging to write to disk, the container can be restarted. */ - public void test124CanRestartContainerWithStackLoggingConfig() throws Exception { - runContainer(distribution(), builder().envVars(Map.of("ES_LOG_STYLE", "file", "ELASTIC_PASSWORD", PASSWORD))); + public void test124CanRestartContainerWithStackLoggingConfig() { + runContainer(distribution(), builder().envVar("ES_LOG_STYLE", "file").envVar("ELASTIC_PASSWORD", PASSWORD)); waitForElasticsearch(installation, USERNAME, PASSWORD); @@ -883,9 +883,7 @@ public void test150MachineDependentHeap() throws Exception { // Now run the container, being explicit about the available memory runContainer( distribution(), - builder().memory("942m") - .volumes(Map.of(jvmOptionsPath, containerJvmOptionsPath)) - .envVars(Map.of("ingest.geoip.downloader.enabled", "false", "ELASTIC_PASSWORD", PASSWORD)) + builder().memory("942m").volume(jvmOptionsPath, containerJvmOptionsPath).envVar("ELASTIC_PASSWORD", PASSWORD) ); waitForElasticsearch(installation, USERNAME, PASSWORD); diff --git a/qa/os/src/test/java/org/elasticsearch/packaging/test/KeystoreManagementTests.java b/qa/os/src/test/java/org/elasticsearch/packaging/test/KeystoreManagementTests.java index 8b090420213be..e286720007488 100644 --- a/qa/os/src/test/java/org/elasticsearch/packaging/test/KeystoreManagementTests.java +++ b/qa/os/src/test/java/org/elasticsearch/packaging/test/KeystoreManagementTests.java @@ -23,7 +23,6 @@ import java.nio.file.Path; import java.util.Arrays; import java.util.List; -import java.util.Map; import static org.elasticsearch.packaging.util.Archives.ARCHIVE_OWNER; import static org.elasticsearch.packaging.util.Archives.installArchive; @@ -67,7 +66,7 @@ public void test10InstallArchiveDistribution() throws Exception { verifyArchiveInstallation(installation, distribution()); final Installation.Executables bin = installation.executables(); - Shell.Result r = sh.runIgnoreExitCode(bin.keystoreTool.toString() + " has-passwd"); + Shell.Result r = sh.runIgnoreExitCode(bin.keystoreTool + " has-passwd"); assertFalse("has-passwd should fail", r.isSuccess()); assertThat("has-passwd should indicate missing keystore", r.stderr, containsString(ERROR_KEYSTORE_NOT_FOUND)); } @@ -82,7 +81,7 @@ public void test11InstallPackageDistribution() throws Exception { verifyPackageInstallation(installation, distribution, sh); final Installation.Executables bin = installation.executables(); - Shell.Result r = sh.runIgnoreExitCode(bin.keystoreTool.toString() + " has-passwd"); + Shell.Result r = sh.runIgnoreExitCode(bin.keystoreTool + " has-passwd"); assertFalse("has-passwd should fail", r.isSuccess()); assertThat("has-passwd should indicate unprotected keystore", r.stderr, containsString(ERROR_KEYSTORE_NOT_PASSWORD_PROTECTED)); Shell.Result r2 = bin.keystoreTool.run("list"); @@ -93,7 +92,7 @@ public void test11InstallPackageDistribution() throws Exception { public void test12InstallDockerDistribution() throws Exception { assumeTrue(distribution().isDocker()); - installation = Docker.runContainer(distribution(), builder().envVars(Map.of("ingest.geoip.downloader.enabled", "false"))); + installation = Docker.runContainer(distribution(), builder()); try { waitForPathToExist(installation.config("elasticsearch.keystore")); @@ -102,7 +101,7 @@ public void test12InstallDockerDistribution() throws Exception { } final Installation.Executables bin = installation.executables(); - Shell.Result r = sh.runIgnoreExitCode(bin.keystoreTool.toString() + " has-passwd"); + Shell.Result r = sh.runIgnoreExitCode(bin.keystoreTool + " has-passwd"); assertFalse("has-passwd should fail", r.isSuccess()); assertThat("has-passwd should indicate unprotected keystore", r.stdout, containsString(ERROR_KEYSTORE_NOT_PASSWORD_PROTECTED)); Shell.Result r2 = bin.keystoreTool.run("list"); @@ -270,16 +269,12 @@ public void test60DockerEnvironmentVariablePassword() throws Exception { Path localConfigDir = getMountedLocalConfDirWithKeystore(password, installation.config); // restart ES with password and mounted config dir containing password protected keystore - Map volumes = Map.of(localConfigDir.resolve("config"), installation.config); - Map envVars = Map.of( - "KEYSTORE_PASSWORD", - password, - "ingest.geoip.downloader.enabled", - "false", - "ELASTIC_PASSWORD", - PASSWORD + runContainer( + distribution(), + builder().volume(localConfigDir.resolve("config"), installation.config) + .envVar("KEYSTORE_PASSWORD", password) + .envVar("ELASTIC_PASSWORD", PASSWORD) ); - runContainer(distribution(), builder().volumes(volumes).envVars(envVars)); waitForElasticsearch(installation, USERNAME, PASSWORD); ServerUtils.runElasticsearchTests(USERNAME, PASSWORD); } @@ -304,18 +299,14 @@ public void test61DockerEnvironmentVariablePasswordFromFile() throws Exception { Path localConfigDir = getMountedLocalConfDirWithKeystore(password, installation.config); // restart ES with password and mounted config dir containing password protected keystore - Map volumes = Map.of(localConfigDir.resolve("config"), installation.config, tempDir, Path.of("/run/secrets")); - Map envVars = Map.of( - "KEYSTORE_PASSWORD_FILE", - "/run/secrets/" + passwordFilename, - "ingest.geoip.downloader.enabled", - "false", - "ELASTIC_PASSWORD", - PASSWORD + runContainer( + distribution(), + builder().volume(localConfigDir.resolve("config"), installation.config) + .volume(tempDir, "/run/secrets") + .envVar("KEYSTORE_PASSWORD_FILE", "/run/secrets/" + passwordFilename) + .envVar("ELASTIC_PASSWORD", PASSWORD) ); - runContainer(distribution(), builder().volumes(volumes).envVars(envVars)); - waitForElasticsearch(installation, USERNAME, PASSWORD); ServerUtils.runElasticsearchTests(USERNAME, PASSWORD); } finally { @@ -337,9 +328,10 @@ public void test62DockerEnvironmentVariableBadPassword() throws Exception { Path localConfigPath = getMountedLocalConfDirWithKeystore(password, installation.config); // restart ES with password and mounted config dir containing password protected keystore - Map volumes = Map.of(localConfigPath.resolve("config"), installation.config); - Map envVars = Map.of("KEYSTORE_PASSWORD", "wrong"); - Shell.Result r = runContainerExpectingFailure(distribution(), builder().volumes(volumes).envVars(envVars)); + Shell.Result r = runContainerExpectingFailure( + distribution(), + builder().volume(localConfigPath.resolve("config"), installation.config).envVar("KEYSTORE_PASSWORD", "wrong") + ); assertThat(r.stderr, containsString(ERROR_INCORRECT_PASSWORD)); } @@ -354,7 +346,6 @@ private Path getMountedLocalConfDirWithKeystore(String password, Path dockerKeys // Mount a temporary directory for copying the keystore Path dockerTemp = Path.of("/usr/tmp/keystore-tmp"); Path tempDirectory = createTempDir(KeystoreManagementTests.class.getSimpleName()); - Map volumes = Map.of(tempDirectory, dockerTemp); // It's very tricky to properly quote a pipeline that you're passing to // a docker exec command, so we're just going to put a small script in the @@ -367,7 +358,7 @@ private Path getMountedLocalConfDirWithKeystore(String password, Path dockerKeys Files.write(tempDirectory.resolve("set-pass.sh"), setPasswordScript); - runContainer(distribution(), builder().volumes(volumes)); + runContainer(distribution(), builder().volume(tempDirectory, dockerTemp)); try { waitForPathToExist(dockerTemp); waitForPathToExist(dockerKeystore); diff --git a/qa/os/src/test/java/org/elasticsearch/packaging/util/docker/Docker.java b/qa/os/src/test/java/org/elasticsearch/packaging/util/docker/Docker.java index ba014f4c5c474..ff4055997fbdf 100644 --- a/qa/os/src/test/java/org/elasticsearch/packaging/util/docker/Docker.java +++ b/qa/os/src/test/java/org/elasticsearch/packaging/util/docker/Docker.java @@ -463,6 +463,13 @@ public static void waitForElasticsearch(String status, String index, Installatio withLogging(() -> ServerUtils.waitForElasticsearch(status, index, installation, username, password, null)); } + /** + * Waits for the Elasticsearch cluster status to turn green. + * + * @param installation the installation to check + * @param username the username to authenticate with + * @param password the password to authenticate with + */ public static void waitForElasticsearch(Installation installation, String username, String password) { try { waitForElasticsearch("green", null, installation, username, password); @@ -517,6 +524,16 @@ public static JsonNode getJson(String path) throws Exception { return mapper.readTree(pluginsResponse); } + /** + * Fetches the resource from the specified {@code path} on {@code http://localhost:9200}, using + * the supplied authentication credentials. + * + * @param path the path to fetch + * @param user the user to authenticate with + * @param password the password to authenticate with + * @return a parsed JSON response + * @throws Exception if something goes wrong + */ public static JsonNode getJson(String path, String user, String password) throws Exception { path = Objects.requireNonNull(path, "path can not be null").trim(); if (path.isEmpty()) { @@ -585,7 +602,7 @@ public static void restartContainer() { sh.run("docker restart " + containerId); } - public static PosixFileAttributes getAttributes(Path path) throws FileNotFoundException { + static PosixFileAttributes getAttributes(Path path) throws FileNotFoundException { final Shell.Result result = dockerShell.runIgnoreExitCode("stat -c \"%U %G %A\" " + path); if (result.isSuccess() == false) { throw new FileNotFoundException(path + " does not exist"); diff --git a/qa/os/src/test/java/org/elasticsearch/packaging/util/docker/DockerRun.java b/qa/os/src/test/java/org/elasticsearch/packaging/util/docker/DockerRun.java index 87c18ee991e63..b92af7e3725cd 100644 --- a/qa/os/src/test/java/org/elasticsearch/packaging/util/docker/DockerRun.java +++ b/qa/os/src/test/java/org/elasticsearch/packaging/util/docker/DockerRun.java @@ -17,11 +17,14 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.Objects; +import static java.util.Objects.requireNonNull; import static org.elasticsearch.packaging.util.FileExistenceMatchers.fileExists; import static org.hamcrest.MatcherAssert.assertThat; +/** + * A utility class for constructing a {@code docker run} command line from Java. + */ public class DockerRun { private Distribution distribution; @@ -35,28 +38,37 @@ public class DockerRun { private DockerRun() {} public static DockerRun builder() { - return new DockerRun(); + // Disable this setting by default in the Docker tests + return new DockerRun().envVar("ingest.geoip.downloader.enabled", "false"); } public DockerRun distribution(Distribution distribution) { - this.distribution = Objects.requireNonNull(distribution); + this.distribution = requireNonNull(distribution); return this; } - public DockerRun envVars(Map envVars) { - if (envVars != null) { - this.envVars.putAll(envVars); - } + public DockerRun envVar(String key, String value) { + this.envVars.put(requireNonNull(key), requireNonNull(value)); return this; } - public DockerRun volumes(Map volumes) { - if (volumes != null) { - this.volumes.putAll(volumes); - } + public DockerRun volume(Path from, String to) { + this.volumes.put(requireNonNull(from), Path.of(requireNonNull(to))); return this; } + public DockerRun volume(Path from, Path to) { + this.volumes.put(requireNonNull(from), requireNonNull(to)); + return this; + } + + /** + * Sets the UID that the container is run with, and the GID too if specified. + * + * @param uid the UID to use, or {@code null} to use the image default + * @param gid the GID to use, or {@code null} to use the image default + * @return the current builder + */ public DockerRun uid(Integer uid, Integer gid) { if (uid == null) { if (gid != null) { @@ -69,9 +81,7 @@ public DockerRun uid(Integer uid, Integer gid) { } public DockerRun memory(String memoryLimit) { - if (memoryLimit != null) { - this.memory = memoryLimit; - } + this.memory = requireNonNull(memoryLimit); return this; } From 9e271001bc26b9b449c1c8e17e79f01d9bdc678f Mon Sep 17 00:00:00 2001 From: Tanguy Leroux Date: Thu, 7 Oct 2021 12:07:22 +0200 Subject: [PATCH 217/250] Fix SearchableSnapshotsBlobStoreCacheIntegTests.testBlobStoreCache (#78616) This test often fails on CI because it does not wait for the data node that hosts the .snapshot-blob-cache primary shard to process the cluster state update and triggers the clean up. Closes #78512 --- .../blob/SearchableSnapshotsBlobStoreCacheIntegTests.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/cache/blob/SearchableSnapshotsBlobStoreCacheIntegTests.java b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/cache/blob/SearchableSnapshotsBlobStoreCacheIntegTests.java index 8ff3b79164ded..3b07fb37eb8c4 100644 --- a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/cache/blob/SearchableSnapshotsBlobStoreCacheIntegTests.java +++ b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/cache/blob/SearchableSnapshotsBlobStoreCacheIntegTests.java @@ -58,6 +58,7 @@ import java.util.Collection; import java.util.List; import java.util.Locale; +import java.util.concurrent.TimeUnit; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount; @@ -327,8 +328,9 @@ public Settings onNodeStopped(String nodeName) throws Exception { logger.info("--> verifying number of documents in index [{}]", restoredAgainIndex); assertHitCount(client().prepareSearch(restoredAgainIndex).setSize(0).setTrackTotalHits(true).get(), numberOfDocs); - logger.info("--> deleting indices, maintenance service should clean up snapshot blob cache index"); + logger.info("--> deleting indices, maintenance service should clean up [{}] docs in system index", numberOfCachedBlobs); assertAcked(client().admin().indices().prepareDelete("restored-*")); + assertBusy(() -> { refreshSystemIndex(); assertHitCount( @@ -338,7 +340,7 @@ public Settings onNodeStopped(String nodeName) throws Exception { .get(), 0L ); - }); + }, 30L, TimeUnit.SECONDS); } private void checkNoBlobStoreAccess() { From dd4e4c3ab9b0f3bb43fb6ea119f31b441182f68e Mon Sep 17 00:00:00 2001 From: Rene Groeschke Date: Thu, 7 Oct 2021 13:01:24 +0200 Subject: [PATCH 218/250] Simplify build plugin license handling (#77009) - Use file property and conventions to avoid afterEvaluate hook - Simplify root build script - One little step closer to configuration cache compliance --- .../internal/conventions/GitInfoPlugin.java | 3 +- .../internal/conventions/LicensingPlugin.java | 17 ++--- .../internal/PublishPluginFuncTest.groovy | 8 +- .../gradle/internal/BuildPluginIT.java | 6 +- .../internal/test/TestClasspathUtils.java | 1 - .../src/main/groovy/elasticsearch.base.gradle | 14 ++++ .../gradle/internal/BuildPlugin.java | 75 +++++++++++++------ .../testKit/elasticsearch.build/build.gradle | 4 +- .../testKit/testingConventions/build.gradle | 4 +- .../plugin/PluginPropertiesExtension.java | 15 +++- .../test/GradleIntegrationTestCase.java | 1 + .../gradle/internal/test/TestUtils.java | 27 ------- build.gradle | 16 +--- client/rest-high-level/build.gradle | 2 +- client/rest/build.gradle | 4 +- client/sniffer/build.gradle | 4 +- client/test/build.gradle | 4 +- rest-api-spec/build.gradle | 2 +- x-pack/build.gradle | 8 +- x-pack/plugin/build.gradle | 17 ----- 20 files changed, 115 insertions(+), 117 deletions(-) create mode 100644 build-tools-internal/src/main/groovy/elasticsearch.base.gradle diff --git a/build-conventions/src/main/java/org/elasticsearch/gradle/internal/conventions/GitInfoPlugin.java b/build-conventions/src/main/java/org/elasticsearch/gradle/internal/conventions/GitInfoPlugin.java index dbc36e25dd751..db8002ba2afaa 100644 --- a/build-conventions/src/main/java/org/elasticsearch/gradle/internal/conventions/GitInfoPlugin.java +++ b/build-conventions/src/main/java/org/elasticsearch/gradle/internal/conventions/GitInfoPlugin.java @@ -15,7 +15,6 @@ import org.gradle.api.provider.Property; import org.gradle.api.provider.Provider; import org.gradle.api.provider.ProviderFactory; -import org.gradle.initialization.layout.BuildLayout; import javax.inject.Inject; import java.io.File; @@ -29,7 +28,7 @@ class GitInfoPlugin implements Plugin { private Property gitInfo; @Inject - public GitInfoPlugin(ProviderFactory factory, ObjectFactory objectFactory) { + GitInfoPlugin(ProviderFactory factory, ObjectFactory objectFactory) { this.factory = factory; this.objectFactory = objectFactory; } diff --git a/build-conventions/src/main/java/org/elasticsearch/gradle/internal/conventions/LicensingPlugin.java b/build-conventions/src/main/java/org/elasticsearch/gradle/internal/conventions/LicensingPlugin.java index 96b9419ea1828..d0c58fc8ed0cf 100644 --- a/build-conventions/src/main/java/org/elasticsearch/gradle/internal/conventions/LicensingPlugin.java +++ b/build-conventions/src/main/java/org/elasticsearch/gradle/internal/conventions/LicensingPlugin.java @@ -11,17 +11,15 @@ import org.gradle.api.Plugin; import org.gradle.api.Project; import org.gradle.api.provider.MapProperty; -import org.gradle.api.provider.Property; import org.gradle.api.provider.Provider; import org.gradle.api.provider.ProviderFactory; import javax.inject.Inject; import java.util.Map; -import java.util.concurrent.Callable; public class LicensingPlugin implements Plugin { - final static String ELASTIC_LICENSE_URL_PREFIX = "https://raw.githubusercontent.com/elastic/elasticsearch/"; - final static String ELASTIC_LICENSE_URL_POSTFIX = "/licenses/ELASTIC-LICENSE-2.0.txt"; + static final String ELASTIC_LICENSE_URL_PREFIX = "https://raw.githubusercontent.com/elastic/elasticsearch/"; + static final String ELASTIC_LICENSE_URL_POSTFIX = "/licenses/ELASTIC-LICENSE-2.0.txt"; private ProviderFactory providerFactory; @@ -34,24 +32,23 @@ public LicensingPlugin(ProviderFactory providerFactory) { public void apply(Project project) { Provider revision = project.getRootProject().getPlugins().apply(GitInfoPlugin.class).getRevision(); Provider licenseCommitProvider = providerFactory.provider(() -> - isSnapshotVersion(project) ? revision.get() : "v" + project.getVersion().toString() + isSnapshotVersion(project) ? revision.get() : "v" + project.getVersion() ); - MapProperty licensesProperty = project.getObjects().mapProperty(String.class, String.class); Provider projectLicenseURL = licenseCommitProvider.map(licenseCommit -> ELASTIC_LICENSE_URL_PREFIX + licenseCommit + ELASTIC_LICENSE_URL_POSTFIX); // But stick the Elastic license url in project.ext so we can get it if we need to switch to it project.getExtensions().getExtraProperties().set("elasticLicenseUrl", projectLicenseURL); - MapProperty convention = licensesProperty.convention( - providerFactory.provider((Callable>) () -> Map.of( + MapProperty licensesProperty = project.getObjects().mapProperty(String.class, String.class).convention( + providerFactory.provider(() -> Map.of( "Server Side Public License, v 1", "https://www.mongodb.com/licensing/server-side-public-license", "Elastic License 2.0", projectLicenseURL.get()) ) ); + // Default to the SSPL+Elastic dual license - project.getExtensions().getExtraProperties().set("licenseCommit", licenseCommitProvider); - project.getExtensions().getExtraProperties().set("projectLicenses", convention); + project.getExtensions().getExtraProperties().set("projectLicenses", licensesProperty); } private boolean isSnapshotVersion(Project project) { diff --git a/build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/internal/PublishPluginFuncTest.groovy b/build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/internal/PublishPluginFuncTest.groovy index 0b0ecb3d1ad5b..88627b1cd4c8b 100644 --- a/build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/internal/PublishPluginFuncTest.groovy +++ b/build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/internal/PublishPluginFuncTest.groovy @@ -277,8 +277,8 @@ class PublishPluginFuncTest extends AbstractGradleFuncTest { // requires elasticsearch artifact available tasks.named('bundlePlugin').configure { enabled = false } - licenseFile = file('license.txt') - noticeFile = file('notice.txt') + licenseFile.set(file('license.txt')) + noticeFile.set(file('notice.txt')) version = "1.0" group = 'org.acme' """ @@ -352,8 +352,8 @@ class PublishPluginFuncTest extends AbstractGradleFuncTest { // requires elasticsearch artifact available tasks.named('bundlePlugin').configure { enabled = false } - licenseFile = file('license.txt') - noticeFile = file('notice.txt') + licenseFile.set(file('license.txt')) + noticeFile.set(file('notice.txt')) version = "2.0" group = 'org.acme' """ diff --git a/build-tools-internal/src/integTest/java/org/elasticsearch/gradle/internal/BuildPluginIT.java b/build-tools-internal/src/integTest/java/org/elasticsearch/gradle/internal/BuildPluginIT.java index f57dfa4ca97bc..06288f6af10a4 100644 --- a/build-tools-internal/src/integTest/java/org/elasticsearch/gradle/internal/BuildPluginIT.java +++ b/build-tools-internal/src/integTest/java/org/elasticsearch/gradle/internal/BuildPluginIT.java @@ -8,6 +8,7 @@ package org.elasticsearch.gradle.internal; import org.apache.commons.io.IOUtils; +import org.elasticsearch.gradle.VersionProperties; import org.elasticsearch.gradle.internal.test.GradleIntegrationTestCase; import org.gradle.testkit.runner.BuildResult; import org.junit.Rule; @@ -47,8 +48,9 @@ public void testCheckTask() { public void testLicenseAndNotice() throws IOException { BuildResult result = getGradleRunner().withArguments("clean", "assemble").build(); assertTaskSuccessful(result, ":assemble"); - assertBuildFileExists(result, projectName(), "distributions/elasticsearch.build.jar"); - try (ZipFile zipFile = new ZipFile(new File(getBuildDir(projectName()), "distributions/elasticsearch.build.jar"))) { + String expectedFilePath = "distributions/elasticsearch.build.jar"; + assertBuildFileExists(result, projectName(), expectedFilePath); + try (ZipFile zipFile = new ZipFile(new File(getBuildDir(projectName()), expectedFilePath))) { ZipEntry licenseEntry = zipFile.getEntry("META-INF/LICENSE.txt"); ZipEntry noticeEntry = zipFile.getEntry("META-INF/NOTICE.txt"); assertNotNull("Jar does not have META-INF/LICENSE.txt", licenseEntry); diff --git a/build-tools-internal/src/integTest/java/org/elasticsearch/gradle/internal/test/TestClasspathUtils.java b/build-tools-internal/src/integTest/java/org/elasticsearch/gradle/internal/test/TestClasspathUtils.java index 537554a61d0e9..28dbb48e1a00f 100644 --- a/build-tools-internal/src/integTest/java/org/elasticsearch/gradle/internal/test/TestClasspathUtils.java +++ b/build-tools-internal/src/integTest/java/org/elasticsearch/gradle/internal/test/TestClasspathUtils.java @@ -10,7 +10,6 @@ import java.io.File; import java.io.IOException; - import net.bytebuddy.ByteBuddy; import net.bytebuddy.description.modifier.Ownership; import net.bytebuddy.description.modifier.Visibility; diff --git a/build-tools-internal/src/main/groovy/elasticsearch.base.gradle b/build-tools-internal/src/main/groovy/elasticsearch.base.gradle new file mode 100644 index 0000000000000..b65b6fca43b2c --- /dev/null +++ b/build-tools-internal/src/main/groovy/elasticsearch.base.gradle @@ -0,0 +1,14 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import org.elasticsearch.gradle.VersionProperties + +project.setDescription("Elasticsearch subproject " + project.getPath()); +// common maven publishing configuration +project.setGroup("org.elasticsearch"); +project.setVersion(VersionProperties.getElasticsearch()) \ No newline at end of file diff --git a/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/BuildPlugin.java b/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/BuildPlugin.java index 1f29ae13822ba..b8654741500dd 100644 --- a/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/BuildPlugin.java +++ b/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/BuildPlugin.java @@ -8,29 +8,46 @@ package org.elasticsearch.gradle.internal; -import org.codehaus.groovy.runtime.DefaultGroovyMethods; import org.elasticsearch.gradle.internal.info.GlobalBuildInfoPlugin; import org.elasticsearch.gradle.internal.precommit.InternalPrecommitTasks; -import org.elasticsearch.gradle.internal.precommit.JarHellPrecommitPlugin; -import org.elasticsearch.gradle.internal.precommit.SplitPackagesAuditPrecommitPlugin; -import org.gradle.api.GradleException; import org.gradle.api.InvalidUserDataException; import org.gradle.api.Plugin; import org.gradle.api.Project; +import org.gradle.api.file.ProjectLayout; +import org.gradle.api.file.RegularFileProperty; +import org.gradle.api.model.ObjectFactory; import org.gradle.api.plugins.ExtraPropertiesExtension; +import org.gradle.api.provider.ProviderFactory; import org.gradle.api.tasks.bundling.Jar; +import org.gradle.initialization.layout.BuildLayout; +import javax.inject.Inject; import java.io.File; /** * Encapsulates build configuration for elasticsearch projects. */ public class BuildPlugin implements Plugin { + + public static final String SSPL_LICENSE_PATH = "licenses/SSPL-1.0+ELASTIC-LICENSE-2.0.txt"; + + private final BuildLayout buildLayout; + private final ObjectFactory objectFactory; + private final ProviderFactory providerFactory; + private final ProjectLayout projectLayout; + + @Inject + BuildPlugin(BuildLayout buildLayout, ObjectFactory objectFactory, ProviderFactory providerFactory, ProjectLayout projectLayout){ + this.buildLayout = buildLayout; + this.objectFactory = objectFactory; + this.providerFactory = providerFactory; + this.projectLayout = projectLayout; + } + @Override public void apply(final Project project) { // make sure the global build info plugin is applied to the root project project.getRootProject().getPluginManager().apply(GlobalBuildInfoPlugin.class); - if (project.getPluginManager().hasPlugin("elasticsearch.standalone-rest-test")) { throw new InvalidUserDataException( "elasticsearch.standalone-test, " + "elasticsearch.standalone-rest-test, and elasticsearch.build are mutually exclusive" @@ -38,28 +55,34 @@ public void apply(final Project project) { } project.getPluginManager().apply("elasticsearch.java"); - configureLicenseAndNotice(project); project.getPluginManager().apply("elasticsearch.publish"); project.getPluginManager().apply(DependenciesInfoPlugin.class); project.getPluginManager().apply(DependenciesGraphPlugin.class); - InternalPrecommitTasks.create(project, true); + configureLicenseAndNotice(project); } - public static void configureLicenseAndNotice(final Project project) { + + public void configureLicenseAndNotice(final Project project) { final ExtraPropertiesExtension ext = project.getExtensions().getByType(ExtraPropertiesExtension.class); - ext.set("licenseFile", null); - ext.set("noticeFile", null); - // add license/notice files - project.afterEvaluate(p -> p.getTasks().withType(Jar.class).configureEach(jar -> { - if (ext.has("licenseFile") == false - || ext.get("licenseFile") == null - || ext.has("noticeFile") == false - || ext.get("noticeFile") == null) { - throw new GradleException("Must specify license and notice file for project " + p.getPath()); - } - final File licenseFile = DefaultGroovyMethods.asType(ext.get("licenseFile"), File.class); - final File noticeFile = DefaultGroovyMethods.asType(ext.get("noticeFile"), File.class); + RegularFileProperty licenseFileProperty = objectFactory.fileProperty(); + RegularFileProperty noticeFileProperty = objectFactory.fileProperty(); + ext.set("licenseFile", licenseFileProperty); + ext.set("noticeFile", noticeFileProperty); + + configureLicenseDefaultConvention(licenseFileProperty); + configureNoticeDefaultConvention(noticeFileProperty); + + updateJarTasksMetaInf(project); + } + + private void updateJarTasksMetaInf(Project project) { + final ExtraPropertiesExtension ext = project.getExtensions().getByType(ExtraPropertiesExtension.class); + project.getTasks().withType(Jar.class).configureEach(jar -> { + final RegularFileProperty licenseFileExtProperty = (RegularFileProperty) ext.get("licenseFile"); + final RegularFileProperty noticeFileExtProperty = (RegularFileProperty) ext.get("noticeFile"); + File licenseFile = licenseFileExtProperty.getAsFile().get(); + File noticeFile = noticeFileExtProperty.getAsFile().get(); jar.metaInf(spec -> { spec.from(licenseFile.getParent(), from -> { from.include(licenseFile.getName()); @@ -70,6 +93,16 @@ public static void configureLicenseAndNotice(final Project project) { from.rename(s -> "NOTICE.txt"); }); }); - })); + }); + } + + private void configureLicenseDefaultConvention(RegularFileProperty licenseFileProperty) { + File licenseFileDefault = new File(buildLayout.getRootDirectory(), SSPL_LICENSE_PATH); + licenseFileProperty.convention(projectLayout.file(providerFactory.provider(() -> licenseFileDefault))); + } + + private void configureNoticeDefaultConvention(RegularFileProperty noticeFileProperty) { + File noticeFileDefault = new File(buildLayout.getRootDirectory(), "NOTICE.txt"); + noticeFileProperty.convention(projectLayout.file(providerFactory.provider(() -> noticeFileDefault))); } } diff --git a/build-tools-internal/src/testKit/elasticsearch.build/build.gradle b/build-tools-internal/src/testKit/elasticsearch.build/build.gradle index 855d767448719..f1ae0d3b24e4d 100644 --- a/build-tools-internal/src/testKit/elasticsearch.build/build.gradle +++ b/build-tools-internal/src/testKit/elasticsearch.build/build.gradle @@ -5,8 +5,8 @@ plugins { apply plugin:'elasticsearch.build' -ext.licenseFile = file("LICENSE") -ext.noticeFile = file("NOTICE") +licenseFile.set(file("LICENSE")) +noticeFile.set(file("NOTICE")) dependencies { api "junit:junit:${versions.junit}" diff --git a/build-tools-internal/src/testKit/testingConventions/build.gradle b/build-tools-internal/src/testKit/testingConventions/build.gradle index 7e8b176481e54..c6a54668bcb5f 100644 --- a/build-tools-internal/src/testKit/testingConventions/build.gradle +++ b/build-tools-internal/src/testKit/testingConventions/build.gradle @@ -9,13 +9,11 @@ allprojects { repositories { mavenCentral() } + dependencies { testImplementation "junit:junit:4.12" } - ext.licenseFile = file("$buildDir/dummy/license") - ext.noticeFile = file("$buildDir/dummy/notice") - testingConventions.naming { // Reset default to no baseClass checks Tests { diff --git a/build-tools/src/main/java/org/elasticsearch/gradle/plugin/PluginPropertiesExtension.java b/build-tools/src/main/java/org/elasticsearch/gradle/plugin/PluginPropertiesExtension.java index 5575adaaf9eea..71cd1fd7c5e8e 100644 --- a/build-tools/src/main/java/org/elasticsearch/gradle/plugin/PluginPropertiesExtension.java +++ b/build-tools/src/main/java/org/elasticsearch/gradle/plugin/PluginPropertiesExtension.java @@ -9,6 +9,9 @@ package org.elasticsearch.gradle.plugin; import org.gradle.api.Project; +import org.gradle.api.file.RegularFile; +import org.gradle.api.file.RegularFileProperty; +import org.gradle.api.plugins.ExtraPropertiesExtension; import java.io.File; import java.util.ArrayList; @@ -138,7 +141,11 @@ public File getLicenseFile() { } public void setLicenseFile(File licenseFile) { - this.project.getExtensions().getExtraProperties().set("licenseFile", licenseFile); + ExtraPropertiesExtension extraProperties = this.project.getExtensions().getExtraProperties(); + RegularFileProperty regularFileProperty = extraProperties.has("licenseFile") ? + (RegularFileProperty)extraProperties.get("licenseFile") : + project.getObjects().fileProperty(); + regularFileProperty.set(licenseFile); this.licenseFile = licenseFile; } @@ -147,7 +154,11 @@ public File getNoticeFile() { } public void setNoticeFile(File noticeFile) { - this.project.getExtensions().getExtraProperties().set("noticeFile", noticeFile); + ExtraPropertiesExtension extraProperties = this.project.getExtensions().getExtraProperties(); + RegularFileProperty regularFileProperty = extraProperties.has("noticeFile") ? + (RegularFileProperty)extraProperties.get("noticeFile") : + project.getObjects().fileProperty(); + regularFileProperty.set(noticeFile); this.noticeFile = noticeFile; } diff --git a/build-tools/src/testFixtures/java/org/elasticsearch/gradle/internal/test/GradleIntegrationTestCase.java b/build-tools/src/testFixtures/java/org/elasticsearch/gradle/internal/test/GradleIntegrationTestCase.java index 58760d72c1c85..7d47088d4740b 100644 --- a/build-tools/src/testFixtures/java/org/elasticsearch/gradle/internal/test/GradleIntegrationTestCase.java +++ b/build-tools/src/testFixtures/java/org/elasticsearch/gradle/internal/test/GradleIntegrationTestCase.java @@ -70,6 +70,7 @@ protected GradleRunner getGradleRunner() { .withProjectDir(getProjectDir()) .withPluginClasspath() .withTestKitDir(testkit) + .forwardOutput() .withDebug(ManagementFactory.getRuntimeMXBean().getInputArguments().toString().indexOf("-agentlib:jdwp") > 0)); } diff --git a/build-tools/src/testFixtures/java/org/elasticsearch/gradle/internal/test/TestUtils.java b/build-tools/src/testFixtures/java/org/elasticsearch/gradle/internal/test/TestUtils.java index 8e69122048c00..11cf2a3d6a099 100644 --- a/build-tools/src/testFixtures/java/org/elasticsearch/gradle/internal/test/TestUtils.java +++ b/build-tools/src/testFixtures/java/org/elasticsearch/gradle/internal/test/TestUtils.java @@ -10,38 +10,11 @@ import java.io.File; import java.io.IOException; -import java.net.URISyntaxException; -import java.net.URL; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.nio.file.StandardCopyOption; import java.util.stream.Collectors; -import static org.junit.Assert.fail; public class TestUtils { - public static void setupJarJdkClasspath(File projectRoot) { - try { - URL originLocation = TestUtils.class.getClassLoader() - .loadClass("org.elasticsearch.jdk.JdkJarHellCheck") - .getProtectionDomain() - .getCodeSource() - .getLocation(); - File targetFile = new File( - projectRoot, - "sample_jars/build/testrepo/org/elasticsearch/elasticsearch-core/current/elasticsearch-core-current.jar" - ); - targetFile.getParentFile().mkdirs(); - Path originalPath = Paths.get(originLocation.toURI()); - Files.copy(originalPath, targetFile.toPath(), StandardCopyOption.REPLACE_EXISTING); - } catch (ClassNotFoundException | URISyntaxException | IOException e) { - e.printStackTrace(); - fail("Cannot setup jdk jar hell classpath"); - } - } - public static String normalizeString(String input, File projectRootDir) { try { String normalizedPathPrefix = projectRootDir.getCanonicalPath().replaceAll("\\\\", "/"); diff --git a/build.gradle b/build.gradle index 44ca1d8db708c..ae731b4e1d6e9 100644 --- a/build.gradle +++ b/build.gradle @@ -49,13 +49,6 @@ plugins { id "com.diffplug.spotless" version "5.15.1" apply false } -String licenseCommit -if (VersionProperties.elasticsearch.toString().endsWith('-SNAPSHOT')) { - licenseCommit = BuildParams.gitRevision ?: "master" // leniency for non git builds -} else { - licenseCommit = "v${version}" -} - /** * This is a convenient method for declaring test artifact dependencies provided by the internal * test artifact plugin. It replaces basically the longer dependency notation with explicit capability @@ -168,20 +161,13 @@ if (project.gradle.startParameter.taskNames.find { it.startsWith("checkPart") } } subprojects { - // common maven publishing configuration - group = 'org.elasticsearch' - version = VersionProperties.elasticsearch - description = "Elasticsearch subproject ${project.path}" + apply plugin: 'elasticsearch.base' } allprojects { // We disable this plugin for now till we shaked out the issues we see // e.g. see https://github.com/elastic/elasticsearch/issues/72169 // apply plugin:'elasticsearch.internal-test-rerun' - plugins.withType(BuildPlugin).whenPluginAdded { - project.licenseFile = project.rootProject.file('licenses/SSPL-1.0+ELASTIC-LICENSE-2.0.txt') - project.noticeFile = project.rootProject.file('NOTICE.txt') - } plugins.withType(InternalPluginBuildPlugin).whenPluginAdded { project.dependencies { diff --git a/client/rest-high-level/build.gradle b/client/rest-high-level/build.gradle index 37f51aa9dbbb2..d43cab006b724 100644 --- a/client/rest-high-level/build.gradle +++ b/client/rest-high-level/build.gradle @@ -20,7 +20,7 @@ group = 'org.elasticsearch.client' archivesBaseName = 'elasticsearch-rest-high-level-client' // HLRC is published under the Elastic License -ext.projectLicenses.set(['Elastic License 2.0': ext.elasticLicenseUrl.get()]) +projectLicenses.set(['Elastic License 2.0': ext.elasticLicenseUrl.get()]) restResources { //we need to copy the yaml spec so we can check naming (see RestHighlevelClientTests#testApiNamingConventions) diff --git a/client/rest/build.gradle b/client/rest/build.gradle index fc0069440f139..3fa58b997c9ef 100644 --- a/client/rest/build.gradle +++ b/client/rest/build.gradle @@ -29,8 +29,8 @@ group = 'org.elasticsearch.client' archivesBaseName = 'elasticsearch-rest-client' // LLRC is licenses under Apache 2.0 -ext.projectLicenses.set(['The Apache Software License, Version 2.0': 'http://www.apache.org/licenses/LICENSE-2.0']) -ext.licenseFile = rootProject.file('licenses/APACHE-LICENSE-2.0.txt') +projectLicenses.set(['The Apache Software License, Version 2.0': 'http://www.apache.org/licenses/LICENSE-2.0']) +licenseFile.set(rootProject.file('licenses/APACHE-LICENSE-2.0.txt')) dependencies { api "org.apache.httpcomponents:httpclient:${versions.httpclient}" diff --git a/client/sniffer/build.gradle b/client/sniffer/build.gradle index bd34d1a70b204..a04984ecb5937 100644 --- a/client/sniffer/build.gradle +++ b/client/sniffer/build.gradle @@ -28,8 +28,8 @@ group = 'org.elasticsearch.client' archivesBaseName = 'elasticsearch-rest-client-sniffer' // rest client sniffer is licenses under Apache 2.0 -ext.projectLicenses.set(['The Apache Software License, Version 2.0': 'http://www.apache.org/licenses/LICENSE-2.0']) -ext.licenseFile = rootProject.file('licenses/APACHE-LICENSE-2.0.txt') +projectLicenses.set(['The Apache Software License, Version 2.0': 'http://www.apache.org/licenses/LICENSE-2.0']) +licenseFile.set(rootProject.file('licenses/APACHE-LICENSE-2.0.txt')) dependencies { api project(":client:rest") diff --git a/client/test/build.gradle b/client/test/build.gradle index ee52a9b522269..ec36bfe796b0a 100644 --- a/client/test/build.gradle +++ b/client/test/build.gradle @@ -15,8 +15,8 @@ sourceCompatibility = JavaVersion.VERSION_1_8 group = "${group}.client.test" // rest client sniffer is licenses under Apache 2.0 -ext.projectLicenses.set(['The Apache Software License, Version 2.0': 'http://www.apache.org/licenses/LICENSE-2.0']) -ext.licenseFile = rootProject.file('licenses/APACHE-LICENSE-2.0.txt') +projectLicenses.set(['The Apache Software License, Version 2.0': 'http://www.apache.org/licenses/LICENSE-2.0']) +licenseFile.set(rootProject.file('licenses/APACHE-LICENSE-2.0.txt')) dependencies { api "org.apache.httpcomponents:httpcore:${versions.httpcore}" diff --git a/rest-api-spec/build.gradle b/rest-api-spec/build.gradle index c98869d84f471..73322bddd1df8 100644 --- a/rest-api-spec/build.gradle +++ b/rest-api-spec/build.gradle @@ -15,7 +15,7 @@ restResources { // REST API specifications are published under the Apache 2.0 License ext.projectLicenses.set(['The Apache Software License, Version 2.0': 'http://www.apache.org/licenses/LICENSE-2.0']) -ext.licenseFile = rootProject.file('licenses/APACHE-LICENSE-2.0.txt') +licenseFile.set(rootProject.file('licenses/APACHE-LICENSE-2.0.txt')) configurations { // configuration to make use by external yaml rest test plugin in our examples diff --git a/x-pack/build.gradle b/x-pack/build.gradle index e5b258ee8a53e..781a81bf70b19 100644 --- a/x-pack/build.gradle +++ b/x-pack/build.gradle @@ -36,10 +36,12 @@ subprojects { additionalLicense 'ELAST', 'Elastic License 2.0', '2.0; you may not use this file except in compliance with the Elastic License' } - project.getPluginManager().withPlugin("elasticsearch.licensing") { + project.pluginManager.withPlugin("elasticsearch.licensing") { ext.projectLicenses.set(['Elastic License 2.0': ext.elasticLicenseUrl.get()]) } - project.ext.licenseFile = rootProject.file('licenses/ELASTIC-LICENSE-2.0.txt') - project.ext.noticeFile = xpackRootProject.file('NOTICE.txt') + project.pluginManager.withPlugin("elasticsearch.build") { + project.ext.licenseFile.set(rootProject.file('licenses/ELASTIC-LICENSE-2.0.txt')) + project.ext.noticeFile.set(xpackRootProject.file('NOTICE.txt')) + } } diff --git a/x-pack/plugin/build.gradle b/x-pack/plugin/build.gradle index 59e7034103c5d..41c8a8479a952 100644 --- a/x-pack/plugin/build.gradle +++ b/x-pack/plugin/build.gradle @@ -30,23 +30,6 @@ artifacts { restXpackTests(new File(projectDir, "src/yamlRestTest/resources/rest-api-spec/test")) } -tasks.named("testJar").configure { - /* - * Stick the license and notice file in the jar. This isn't strictly - * needed because we don't publish it but it makes our super-paranoid - * tests happy. - */ - metaInf { - from(project.licenseFile.parent) { - include project.licenseFile.name - rename { 'LICENSE.txt' } - } - from(project.noticeFile.parent) { - include project.noticeFile.name - } - } -} - // location for keys and certificates File extraResourceDir = file("$buildDir/extra_resource") File nodeKey = file("$extraResourceDir/testnode.pem") From b07dbe52caca7ad86e6ee5a4ea75a181f9af22ac Mon Sep 17 00:00:00 2001 From: David Turner Date: Thu, 7 Oct 2021 12:02:20 +0100 Subject: [PATCH 219/250] Adjust /_cat/templates not to request all metadata (#78812) Today `GET /_cat/templates` retrieves the whole cluster metadata from the master, which includes all sorts of unnecessary junk and consumes significant resources. This commit reimplements these endpoints using `GetIndexTemplatesAction` and `GetComposableIndexTemplateAction` which are much more efficient. The docs for this API indicate that it accepts a comma-separated list of template names/patterns of the form `GET /_cat/templates/name1,name2` but in fact today it only accepts a single name or pattern. This commit also adds support for multiple names/patterns as the docs claim. --- .../test/cat.templates/20_matching.yml | 179 ++++++++++++++++++ .../rest/action/cat/RestTemplatesAction.java | 140 ++++++++++---- 2 files changed, 284 insertions(+), 35 deletions(-) create mode 100644 rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/cat.templates/20_matching.yml diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/cat.templates/20_matching.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/cat.templates/20_matching.yml new file mode 100644 index 0000000000000..0ee0cd3fb4af2 --- /dev/null +++ b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/cat.templates/20_matching.yml @@ -0,0 +1,179 @@ +setup: + - do: + indices.put_template: + name: test-legacy-1 + body: + order: 12 + version: 3 + index_patterns: foo* + + - do: + indices.put_template: + name: test-legacy-2 + body: + order: 45 + version: 6 + index_patterns: + - bar* + - baz* + + - do: + cluster.put_component_template: + name: test-component-template + body: + template: + settings: + number_of_shards: 1 + number_of_replicas: 0 + + - do: + indices.put_index_template: + name: test-composable-1 + body: + index_patterns: + - quux* + priority: 78 + version: 9 + composed_of: + - test-component-template + + - do: + indices.put_index_template: + name: test-composable-2 + body: + index_patterns: + - gruly* + priority: 99 + version: 1 + composed_of: + - test-component-template + +--- +"Matching all templates": + + - do: + cat.templates: + h: [name] + s: [name] + + - match: + $body: /test-composable-1\ntest-composable-2\ntest-legacy-1\ntest-legacy-2\n/ + + - do: + cat.templates: + name: "*" + h: [name] + s: [name] + + - match: + $body: /test-composable-1\ntest-composable-2\ntest-legacy-1\ntest-legacy-2\n/ + +--- +"Matching all templates with other patterns": + - skip: + version: " - 7.99.99" + reason: "support for multiple patterns added in 8.0.0" + + - do: + cat.templates: + name: "nonexistent*,*,other-name" + h: [name] + s: [name] + + - match: + $body: /test-composable-1\ntest-composable-2\ntest-legacy-1\ntest-legacy-2\n/ + +--- +"Matching no templates": + + - do: + cat.templates: + name: "nonexistent" + h: [name] + s: [name] + + - match: + $body: /^$/ + +--- +"Matching single names": + + - do: + cat.templates: + name: "test-legacy-1" + h: [name] + s: [name] + + - match: + $body: /^test-legacy-1\n$/ + + + - do: + cat.templates: + name: "test-composable-2" + h: [name] + s: [name] + + - match: + $body: /^test-composable-2\n$/ + +--- +"Matching single patterns": + + - do: + cat.templates: + name: "test-legacy-*" + h: [name] + s: [name] + + - match: + $body: /^test-legacy-1\ntest-legacy-2\n$/ + + + - do: + cat.templates: + name: "test-*-2" + h: [name] + s: [name] + + - match: + $body: /^test-composable-2\ntest-legacy-2\n$/ + +--- +"Matching lists of names": + - skip: + version: " - 7.99.99" + reason: "support for multiple patterns added in 8.0.0" + + - do: + cat.templates: + name: "test-legacy-1,test-composable-2" + h: [name] + s: [name] + + - match: + $body: /^test-composable-2\ntest-legacy-1\n$/ + +--- +"Matching names and wildcards": + - skip: + version: " - 7.99.99" + reason: "support for multiple patterns added in 8.0.0" + + - do: + cat.templates: + name: "test-legacy-1,test-composable-*" + h: [name] + s: [name] + + - match: + $body: /^test-composable-1\ntest-composable-2\ntest-legacy-1\n$/ + + - do: + cat.templates: + name: "test-legacy-*,test-composable-2" + h: [name] + s: [name] + + - match: + $body: /^test-composable-2\ntest-legacy-1\ntest-legacy-2\n$/ diff --git a/server/src/main/java/org/elasticsearch/rest/action/cat/RestTemplatesAction.java b/server/src/main/java/org/elasticsearch/rest/action/cat/RestTemplatesAction.java index c4785df10d310..ba24839e10f9c 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/cat/RestTemplatesAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/cat/RestTemplatesAction.java @@ -8,21 +8,27 @@ package org.elasticsearch.rest.action.cat; -import com.carrotsearch.hppc.cursors.ObjectObjectCursor; -import org.elasticsearch.action.admin.cluster.state.ClusterStateRequest; -import org.elasticsearch.action.admin.cluster.state.ClusterStateResponse; +import org.elasticsearch.action.ActionListener; +import org.elasticsearch.action.StepListener; +import org.elasticsearch.action.admin.indices.template.get.GetComposableIndexTemplateAction; +import org.elasticsearch.action.admin.indices.template.get.GetIndexTemplatesRequest; +import org.elasticsearch.action.admin.indices.template.get.GetIndexTemplatesResponse; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.cluster.metadata.IndexTemplateMetadata; import org.elasticsearch.cluster.metadata.ComposableIndexTemplate; -import org.elasticsearch.cluster.metadata.Metadata; +import org.elasticsearch.cluster.metadata.IndexTemplateMetadata; +import org.elasticsearch.common.Strings; import org.elasticsearch.common.Table; import org.elasticsearch.common.regex.Regex; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.RestResponse; import org.elasticsearch.rest.action.RestResponseListener; +import java.util.ArrayList; +import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Set; +import java.util.function.Predicate; import static org.elasticsearch.rest.RestRequest.Method.GET; @@ -47,18 +53,43 @@ protected void documentation(StringBuilder sb) { @Override protected RestChannelConsumer doCatRequest(final RestRequest request, NodeClient client) { - final String matchPattern = request.hasParam("name") ? request.param("name") : null; - final ClusterStateRequest clusterStateRequest = new ClusterStateRequest(); - clusterStateRequest.clear().metadata(true); - clusterStateRequest.local(request.paramAsBoolean("local", clusterStateRequest.local())); - clusterStateRequest.masterNodeTimeout(request.paramAsTime("master_timeout", clusterStateRequest.masterNodeTimeout())); - - return channel -> client.admin().cluster().state(clusterStateRequest, new RestResponseListener(channel) { - @Override - public RestResponse buildResponse(ClusterStateResponse clusterStateResponse) throws Exception { - return RestTable.buildResponse(buildTable(request, clusterStateResponse, matchPattern), channel); - } - }); + final String[] templateNames = Strings.splitStringByCommaToArray(request.param("name", "")); + + final GetIndexTemplatesRequest getIndexTemplatesRequest = new GetIndexTemplatesRequest(templateNames); + getIndexTemplatesRequest.local(request.paramAsBoolean("local", getIndexTemplatesRequest.local())); + getIndexTemplatesRequest.masterNodeTimeout(request.paramAsTime("master_timeout", getIndexTemplatesRequest.masterNodeTimeout())); + + final GetComposableIndexTemplateAction.Request getComposableTemplatesRequest + = new GetComposableIndexTemplateAction.Request(); + getComposableTemplatesRequest.local(request.paramAsBoolean("local", getComposableTemplatesRequest.local())); + getComposableTemplatesRequest.masterNodeTimeout( + request.paramAsTime("master_timeout", getComposableTemplatesRequest.masterNodeTimeout())); + + return channel -> { + + final StepListener getIndexTemplatesStep = new StepListener<>(); + client.admin().indices().getTemplates(getIndexTemplatesRequest, getIndexTemplatesStep); + + final StepListener getComposableTemplatesStep = new StepListener<>(); + client.execute(GetComposableIndexTemplateAction.INSTANCE, getComposableTemplatesRequest, getComposableTemplatesStep); + + final ActionListener tableListener = new RestResponseListener<>(channel) { + @Override + public RestResponse buildResponse(Table table) throws Exception { + return RestTable.buildResponse(table, channel); + } + }; + + getIndexTemplatesStep.whenComplete(getIndexTemplatesResponse -> + getComposableTemplatesStep.whenComplete(getComposableIndexTemplatesResponse -> + ActionListener.completeWith(tableListener, () -> buildTable( + request, + getIndexTemplatesResponse, + getComposableIndexTemplatesResponse, + templateNames) + ), tableListener::onFailure + ), tableListener::onFailure); + }; } @Override @@ -74,26 +105,30 @@ protected Table getTableWithHeader(RestRequest request) { return table; } - private Table buildTable(RestRequest request, ClusterStateResponse clusterStateResponse, String patternString) { - Table table = getTableWithHeader(request); - Metadata metadata = clusterStateResponse.getState().metadata(); - for (ObjectObjectCursor entry : metadata.templates()) { - IndexTemplateMetadata indexData = entry.value; - if (patternString == null || Regex.simpleMatch(patternString, indexData.name())) { - table.startRow(); - table.addCell(indexData.name()); - table.addCell("[" + String.join(", ", indexData.patterns()) + "]"); - table.addCell(indexData.getOrder()); - table.addCell(indexData.getVersion()); - table.addCell(""); - table.endRow(); - } + private Table buildTable( + RestRequest request, + GetIndexTemplatesResponse getIndexTemplatesResponse, + GetComposableIndexTemplateAction.Response getComposableIndexTemplatesResponse, + String[] requestedNames + ) { + final Predicate namePredicate = getNamePredicate(requestedNames); + + final Table table = getTableWithHeader(request); + for (IndexTemplateMetadata indexData : getIndexTemplatesResponse.getIndexTemplates()) { + assert namePredicate.test(indexData.getName()); + table.startRow(); + table.addCell(indexData.name()); + table.addCell("[" + String.join(", ", indexData.patterns()) + "]"); + table.addCell(indexData.getOrder()); + table.addCell(indexData.getVersion()); + table.addCell(""); + table.endRow(); } - for (Map.Entry entry : metadata.templatesV2().entrySet()) { - String name = entry.getKey(); - ComposableIndexTemplate template = entry.getValue(); - if (patternString == null || Regex.simpleMatch(patternString, name)) { + for (Map.Entry entry : getComposableIndexTemplatesResponse.indexTemplates().entrySet()) { + final String name = entry.getKey(); + if (namePredicate.test(name)) { + final ComposableIndexTemplate template = entry.getValue(); table.startRow(); table.addCell(name); table.addCell("[" + String.join(", ", template.indexPatterns()) + "]"); @@ -103,6 +138,41 @@ private Table buildTable(RestRequest request, ClusterStateResponse clusterStateR table.endRow(); } } + return table; } + + private Predicate getNamePredicate(String[] requestedNames) { + if (requestedNames.length == 0) { + return name -> true; + } + + final Set exactMatches = new HashSet<>(); + final List patterns = new ArrayList<>(); + for (String requestedName : requestedNames) { + if (Regex.isMatchAllPattern(requestedName)) { + return name -> true; + } else if (Regex.isSimpleMatchPattern(requestedName)) { + patterns.add(requestedName); + } else { + exactMatches.add(requestedName); + } + } + + if (patterns.isEmpty()) { + return exactMatches::contains; + } + + return name -> { + if (exactMatches.contains(name)) { + return true; + } + for (String pattern : patterns) { + if (Regex.simpleMatch(pattern, name)) { + return true; + } + } + return false; + }; + } } From b56d72a468743a82cd694a9f6825bc7bbe595eab Mon Sep 17 00:00:00 2001 From: Alan Woodward Date: Thu, 7 Oct 2021 12:11:25 +0100 Subject: [PATCH 220/250] Upgrade to lucene snapshot ba75dc5e6bf (#78817) Includes the following lucene changes: * LUCENE-10145: Speed up byte[] comparisons using VarHandles. * LUCENE-10143: Delegate primitive writes in RateLimitedIndexOutput * LUCENE-10182: No longer check dvGen. * LUCENE-10153: Speed up BKDWriter using VarHandles. * LUCENE-10150: override ByteBuffersDataInput readLong/readInt/readShort --- build-tools-internal/version.properties | 2 +- .../lucene-expressions-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 | 1 + .../lucene-expressions-9.0.0-snapshot-cb366d04d4a.jar.sha1 | 1 - ...lucene-spatial-extras-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 | 1 + ...lucene-spatial-extras-9.0.0-snapshot-cb366d04d4a.jar.sha1 | 1 - .../lucene-analysis-icu-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 | 1 + .../lucene-analysis-icu-9.0.0-snapshot-cb366d04d4a.jar.sha1 | 1 - ...ene-analysis-kuromoji-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 | 1 + ...ene-analysis-kuromoji-9.0.0-snapshot-cb366d04d4a.jar.sha1 | 1 - .../lucene-analysis-nori-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 | 1 + .../lucene-analysis-nori-9.0.0-snapshot-cb366d04d4a.jar.sha1 | 1 - ...ene-analysis-phonetic-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 | 1 + ...ene-analysis-phonetic-9.0.0-snapshot-cb366d04d4a.jar.sha1 | 1 - ...cene-analysis-smartcn-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 | 1 + ...cene-analysis-smartcn-9.0.0-snapshot-cb366d04d4a.jar.sha1 | 1 - ...cene-analysis-stempel-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 | 1 + ...cene-analysis-stempel-9.0.0-snapshot-cb366d04d4a.jar.sha1 | 1 - ...e-analysis-morfologik-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 | 1 + ...e-analysis-morfologik-9.0.0-snapshot-cb366d04d4a.jar.sha1 | 1 - ...ucene-analysis-common-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 | 1 + ...ucene-analysis-common-9.0.0-snapshot-cb366d04d4a.jar.sha1 | 1 - ...ucene-backward-codecs-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 | 1 + ...ucene-backward-codecs-9.0.0-snapshot-cb366d04d4a.jar.sha1 | 1 - .../licenses/lucene-core-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 | 1 + .../licenses/lucene-core-9.0.0-snapshot-cb366d04d4a.jar.sha1 | 1 - .../lucene-grouping-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 | 1 + .../lucene-grouping-9.0.0-snapshot-cb366d04d4a.jar.sha1 | 1 - .../lucene-highlighter-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 | 1 + .../lucene-highlighter-9.0.0-snapshot-cb366d04d4a.jar.sha1 | 1 - .../licenses/lucene-join-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 | 1 + .../licenses/lucene-join-9.0.0-snapshot-cb366d04d4a.jar.sha1 | 1 - .../lucene-memory-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 | 1 + .../lucene-memory-9.0.0-snapshot-cb366d04d4a.jar.sha1 | 1 - .../licenses/lucene-misc-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 | 1 + .../licenses/lucene-misc-9.0.0-snapshot-cb366d04d4a.jar.sha1 | 1 - .../lucene-queries-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 | 1 + .../lucene-queries-9.0.0-snapshot-cb366d04d4a.jar.sha1 | 1 - .../lucene-queryparser-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 | 1 + .../lucene-queryparser-9.0.0-snapshot-cb366d04d4a.jar.sha1 | 1 - .../lucene-sandbox-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 | 1 + .../lucene-sandbox-9.0.0-snapshot-cb366d04d4a.jar.sha1 | 1 - .../lucene-spatial3d-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 | 1 + .../lucene-spatial3d-9.0.0-snapshot-cb366d04d4a.jar.sha1 | 1 - .../lucene-suggest-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 | 1 + .../lucene-suggest-9.0.0-snapshot-cb366d04d4a.jar.sha1 | 1 - .../java/org/elasticsearch/lucene/util/CombinedBitSet.java | 5 +++++ .../security/authz/accesscontrol/MatchAllRoleBitSet.java | 5 +++++ .../licenses/lucene-core-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 | 1 + .../licenses/lucene-core-9.0.0-snapshot-cb366d04d4a.jar.sha1 | 1 - 49 files changed, 34 insertions(+), 24 deletions(-) create mode 100644 modules/lang-expression/licenses/lucene-expressions-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 delete mode 100644 modules/lang-expression/licenses/lucene-expressions-9.0.0-snapshot-cb366d04d4a.jar.sha1 create mode 100644 modules/legacy-geo/licenses/lucene-spatial-extras-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 delete mode 100644 modules/legacy-geo/licenses/lucene-spatial-extras-9.0.0-snapshot-cb366d04d4a.jar.sha1 create mode 100644 plugins/analysis-icu/licenses/lucene-analysis-icu-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 delete mode 100644 plugins/analysis-icu/licenses/lucene-analysis-icu-9.0.0-snapshot-cb366d04d4a.jar.sha1 create mode 100644 plugins/analysis-kuromoji/licenses/lucene-analysis-kuromoji-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 delete mode 100644 plugins/analysis-kuromoji/licenses/lucene-analysis-kuromoji-9.0.0-snapshot-cb366d04d4a.jar.sha1 create mode 100644 plugins/analysis-nori/licenses/lucene-analysis-nori-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 delete mode 100644 plugins/analysis-nori/licenses/lucene-analysis-nori-9.0.0-snapshot-cb366d04d4a.jar.sha1 create mode 100644 plugins/analysis-phonetic/licenses/lucene-analysis-phonetic-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 delete mode 100644 plugins/analysis-phonetic/licenses/lucene-analysis-phonetic-9.0.0-snapshot-cb366d04d4a.jar.sha1 create mode 100644 plugins/analysis-smartcn/licenses/lucene-analysis-smartcn-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 delete mode 100644 plugins/analysis-smartcn/licenses/lucene-analysis-smartcn-9.0.0-snapshot-cb366d04d4a.jar.sha1 create mode 100644 plugins/analysis-stempel/licenses/lucene-analysis-stempel-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 delete mode 100644 plugins/analysis-stempel/licenses/lucene-analysis-stempel-9.0.0-snapshot-cb366d04d4a.jar.sha1 create mode 100644 plugins/analysis-ukrainian/licenses/lucene-analysis-morfologik-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 delete mode 100644 plugins/analysis-ukrainian/licenses/lucene-analysis-morfologik-9.0.0-snapshot-cb366d04d4a.jar.sha1 create mode 100644 server/licenses/lucene-analysis-common-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 delete mode 100644 server/licenses/lucene-analysis-common-9.0.0-snapshot-cb366d04d4a.jar.sha1 create mode 100644 server/licenses/lucene-backward-codecs-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 delete mode 100644 server/licenses/lucene-backward-codecs-9.0.0-snapshot-cb366d04d4a.jar.sha1 create mode 100644 server/licenses/lucene-core-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 delete mode 100644 server/licenses/lucene-core-9.0.0-snapshot-cb366d04d4a.jar.sha1 create mode 100644 server/licenses/lucene-grouping-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 delete mode 100644 server/licenses/lucene-grouping-9.0.0-snapshot-cb366d04d4a.jar.sha1 create mode 100644 server/licenses/lucene-highlighter-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 delete mode 100644 server/licenses/lucene-highlighter-9.0.0-snapshot-cb366d04d4a.jar.sha1 create mode 100644 server/licenses/lucene-join-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 delete mode 100644 server/licenses/lucene-join-9.0.0-snapshot-cb366d04d4a.jar.sha1 create mode 100644 server/licenses/lucene-memory-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 delete mode 100644 server/licenses/lucene-memory-9.0.0-snapshot-cb366d04d4a.jar.sha1 create mode 100644 server/licenses/lucene-misc-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 delete mode 100644 server/licenses/lucene-misc-9.0.0-snapshot-cb366d04d4a.jar.sha1 create mode 100644 server/licenses/lucene-queries-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 delete mode 100644 server/licenses/lucene-queries-9.0.0-snapshot-cb366d04d4a.jar.sha1 create mode 100644 server/licenses/lucene-queryparser-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 delete mode 100644 server/licenses/lucene-queryparser-9.0.0-snapshot-cb366d04d4a.jar.sha1 create mode 100644 server/licenses/lucene-sandbox-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 delete mode 100644 server/licenses/lucene-sandbox-9.0.0-snapshot-cb366d04d4a.jar.sha1 create mode 100644 server/licenses/lucene-spatial3d-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 delete mode 100644 server/licenses/lucene-spatial3d-9.0.0-snapshot-cb366d04d4a.jar.sha1 create mode 100644 server/licenses/lucene-suggest-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 delete mode 100644 server/licenses/lucene-suggest-9.0.0-snapshot-cb366d04d4a.jar.sha1 create mode 100644 x-pack/plugin/sql/sql-action/licenses/lucene-core-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 delete mode 100644 x-pack/plugin/sql/sql-action/licenses/lucene-core-9.0.0-snapshot-cb366d04d4a.jar.sha1 diff --git a/build-tools-internal/version.properties b/build-tools-internal/version.properties index ed298c2d05826..e2036fc920f63 100644 --- a/build-tools-internal/version.properties +++ b/build-tools-internal/version.properties @@ -1,5 +1,5 @@ elasticsearch = 8.0.0 -lucene = 9.0.0-snapshot-cb366d04d4a +lucene = 9.0.0-snapshot-ba75dc5e6bf bundled_jdk_vendor = adoptium bundled_jdk = 17+35 diff --git a/modules/lang-expression/licenses/lucene-expressions-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 b/modules/lang-expression/licenses/lucene-expressions-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 new file mode 100644 index 0000000000000..2618c65c16a8a --- /dev/null +++ b/modules/lang-expression/licenses/lucene-expressions-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 @@ -0,0 +1 @@ +bcba5c75d867341e8de13ed960abe2fe425c28b6 \ No newline at end of file diff --git a/modules/lang-expression/licenses/lucene-expressions-9.0.0-snapshot-cb366d04d4a.jar.sha1 b/modules/lang-expression/licenses/lucene-expressions-9.0.0-snapshot-cb366d04d4a.jar.sha1 deleted file mode 100644 index 63d75948fbf93..0000000000000 --- a/modules/lang-expression/licenses/lucene-expressions-9.0.0-snapshot-cb366d04d4a.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -dbc1dfff091ee7e26ea702b2ce3000874f47498f \ No newline at end of file diff --git a/modules/legacy-geo/licenses/lucene-spatial-extras-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 b/modules/legacy-geo/licenses/lucene-spatial-extras-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 new file mode 100644 index 0000000000000..e266fe4cc804a --- /dev/null +++ b/modules/legacy-geo/licenses/lucene-spatial-extras-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 @@ -0,0 +1 @@ +6664f830615782d0a3f91f9d1bdb003e7f252cc1 \ No newline at end of file diff --git a/modules/legacy-geo/licenses/lucene-spatial-extras-9.0.0-snapshot-cb366d04d4a.jar.sha1 b/modules/legacy-geo/licenses/lucene-spatial-extras-9.0.0-snapshot-cb366d04d4a.jar.sha1 deleted file mode 100644 index 7f34200a94427..0000000000000 --- a/modules/legacy-geo/licenses/lucene-spatial-extras-9.0.0-snapshot-cb366d04d4a.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -0759098be3af1bf770cbc14673e14688262f4e11 \ No newline at end of file diff --git a/plugins/analysis-icu/licenses/lucene-analysis-icu-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 b/plugins/analysis-icu/licenses/lucene-analysis-icu-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 new file mode 100644 index 0000000000000..0e519ea94d9c8 --- /dev/null +++ b/plugins/analysis-icu/licenses/lucene-analysis-icu-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 @@ -0,0 +1 @@ +867be6eb541df21622eb235082a8e4208c54eee7 \ No newline at end of file diff --git a/plugins/analysis-icu/licenses/lucene-analysis-icu-9.0.0-snapshot-cb366d04d4a.jar.sha1 b/plugins/analysis-icu/licenses/lucene-analysis-icu-9.0.0-snapshot-cb366d04d4a.jar.sha1 deleted file mode 100644 index 8bcd9c616ef0d..0000000000000 --- a/plugins/analysis-icu/licenses/lucene-analysis-icu-9.0.0-snapshot-cb366d04d4a.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -e1904eff8c61f665ba58bf8d62b2bb2dacbb3382 \ No newline at end of file diff --git a/plugins/analysis-kuromoji/licenses/lucene-analysis-kuromoji-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 b/plugins/analysis-kuromoji/licenses/lucene-analysis-kuromoji-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 new file mode 100644 index 0000000000000..1990cd300b929 --- /dev/null +++ b/plugins/analysis-kuromoji/licenses/lucene-analysis-kuromoji-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 @@ -0,0 +1 @@ +a2785359a7f98243098cdfb1ca472fcf1acfacef \ No newline at end of file diff --git a/plugins/analysis-kuromoji/licenses/lucene-analysis-kuromoji-9.0.0-snapshot-cb366d04d4a.jar.sha1 b/plugins/analysis-kuromoji/licenses/lucene-analysis-kuromoji-9.0.0-snapshot-cb366d04d4a.jar.sha1 deleted file mode 100644 index 2b96563efe218..0000000000000 --- a/plugins/analysis-kuromoji/licenses/lucene-analysis-kuromoji-9.0.0-snapshot-cb366d04d4a.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -24ed585c98f61ccaec11116c2ce3ca0cf5ae66d6 \ No newline at end of file diff --git a/plugins/analysis-nori/licenses/lucene-analysis-nori-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 b/plugins/analysis-nori/licenses/lucene-analysis-nori-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 new file mode 100644 index 0000000000000..78484c05f06a6 --- /dev/null +++ b/plugins/analysis-nori/licenses/lucene-analysis-nori-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 @@ -0,0 +1 @@ +28956e99314340f6db98e8f95c5ef08547324935 \ No newline at end of file diff --git a/plugins/analysis-nori/licenses/lucene-analysis-nori-9.0.0-snapshot-cb366d04d4a.jar.sha1 b/plugins/analysis-nori/licenses/lucene-analysis-nori-9.0.0-snapshot-cb366d04d4a.jar.sha1 deleted file mode 100644 index 28300f0d1d035..0000000000000 --- a/plugins/analysis-nori/licenses/lucene-analysis-nori-9.0.0-snapshot-cb366d04d4a.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -0189fe890f93d36623cd4006ab080a3b324dcb84 \ No newline at end of file diff --git a/plugins/analysis-phonetic/licenses/lucene-analysis-phonetic-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 b/plugins/analysis-phonetic/licenses/lucene-analysis-phonetic-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 new file mode 100644 index 0000000000000..d5e21bad61775 --- /dev/null +++ b/plugins/analysis-phonetic/licenses/lucene-analysis-phonetic-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 @@ -0,0 +1 @@ +6c1ec0b5af458a39821e86c7b49df25560a055b3 \ No newline at end of file diff --git a/plugins/analysis-phonetic/licenses/lucene-analysis-phonetic-9.0.0-snapshot-cb366d04d4a.jar.sha1 b/plugins/analysis-phonetic/licenses/lucene-analysis-phonetic-9.0.0-snapshot-cb366d04d4a.jar.sha1 deleted file mode 100644 index 3fc095c5c03d2..0000000000000 --- a/plugins/analysis-phonetic/licenses/lucene-analysis-phonetic-9.0.0-snapshot-cb366d04d4a.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -88121f7c81bd5107b685ef16912435777739d17e \ No newline at end of file diff --git a/plugins/analysis-smartcn/licenses/lucene-analysis-smartcn-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 b/plugins/analysis-smartcn/licenses/lucene-analysis-smartcn-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 new file mode 100644 index 0000000000000..5aff83fc47315 --- /dev/null +++ b/plugins/analysis-smartcn/licenses/lucene-analysis-smartcn-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 @@ -0,0 +1 @@ +baf4f8ca0bb5c0cdec2f96e82492b175c6df0c3d \ No newline at end of file diff --git a/plugins/analysis-smartcn/licenses/lucene-analysis-smartcn-9.0.0-snapshot-cb366d04d4a.jar.sha1 b/plugins/analysis-smartcn/licenses/lucene-analysis-smartcn-9.0.0-snapshot-cb366d04d4a.jar.sha1 deleted file mode 100644 index 3f42a4ca4bcc1..0000000000000 --- a/plugins/analysis-smartcn/licenses/lucene-analysis-smartcn-9.0.0-snapshot-cb366d04d4a.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -6b774f3606fc70d7f8c01c60932a0e4718294f01 \ No newline at end of file diff --git a/plugins/analysis-stempel/licenses/lucene-analysis-stempel-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 b/plugins/analysis-stempel/licenses/lucene-analysis-stempel-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 new file mode 100644 index 0000000000000..f079864826e35 --- /dev/null +++ b/plugins/analysis-stempel/licenses/lucene-analysis-stempel-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 @@ -0,0 +1 @@ +4e7ca88f59f5df8caff2f3df1277831da315d2e2 \ No newline at end of file diff --git a/plugins/analysis-stempel/licenses/lucene-analysis-stempel-9.0.0-snapshot-cb366d04d4a.jar.sha1 b/plugins/analysis-stempel/licenses/lucene-analysis-stempel-9.0.0-snapshot-cb366d04d4a.jar.sha1 deleted file mode 100644 index b6f642f7cf161..0000000000000 --- a/plugins/analysis-stempel/licenses/lucene-analysis-stempel-9.0.0-snapshot-cb366d04d4a.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -0fc0ab42b9c90d90c9cd7148fc6a6969bc517117 \ No newline at end of file diff --git a/plugins/analysis-ukrainian/licenses/lucene-analysis-morfologik-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 b/plugins/analysis-ukrainian/licenses/lucene-analysis-morfologik-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 new file mode 100644 index 0000000000000..b7fbde8e78cfe --- /dev/null +++ b/plugins/analysis-ukrainian/licenses/lucene-analysis-morfologik-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 @@ -0,0 +1 @@ +b1eb11edd2e148534f2a589aee3268100c2fc6fe \ No newline at end of file diff --git a/plugins/analysis-ukrainian/licenses/lucene-analysis-morfologik-9.0.0-snapshot-cb366d04d4a.jar.sha1 b/plugins/analysis-ukrainian/licenses/lucene-analysis-morfologik-9.0.0-snapshot-cb366d04d4a.jar.sha1 deleted file mode 100644 index d21e08e4f74fa..0000000000000 --- a/plugins/analysis-ukrainian/licenses/lucene-analysis-morfologik-9.0.0-snapshot-cb366d04d4a.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -a1389ea87cd83283c5cb41ac90a799b6456e5bac \ No newline at end of file diff --git a/server/licenses/lucene-analysis-common-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 b/server/licenses/lucene-analysis-common-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 new file mode 100644 index 0000000000000..be869a71cb09f --- /dev/null +++ b/server/licenses/lucene-analysis-common-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 @@ -0,0 +1 @@ +d385289a04024b4caf3d37e786c5c1969d02e958 \ No newline at end of file diff --git a/server/licenses/lucene-analysis-common-9.0.0-snapshot-cb366d04d4a.jar.sha1 b/server/licenses/lucene-analysis-common-9.0.0-snapshot-cb366d04d4a.jar.sha1 deleted file mode 100644 index 3e86bfc735d35..0000000000000 --- a/server/licenses/lucene-analysis-common-9.0.0-snapshot-cb366d04d4a.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -f129302f69d5099200be36f9c8c728f0a218da0b \ No newline at end of file diff --git a/server/licenses/lucene-backward-codecs-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 b/server/licenses/lucene-backward-codecs-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 new file mode 100644 index 0000000000000..3d1814a5ec6d9 --- /dev/null +++ b/server/licenses/lucene-backward-codecs-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 @@ -0,0 +1 @@ +6092f1a9b667d8a0b5371936e1faeead7b4be9be \ No newline at end of file diff --git a/server/licenses/lucene-backward-codecs-9.0.0-snapshot-cb366d04d4a.jar.sha1 b/server/licenses/lucene-backward-codecs-9.0.0-snapshot-cb366d04d4a.jar.sha1 deleted file mode 100644 index ba6d94fdf4c6f..0000000000000 --- a/server/licenses/lucene-backward-codecs-9.0.0-snapshot-cb366d04d4a.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -abc08a2bcd04337d7bcd622b589c952012052af7 \ No newline at end of file diff --git a/server/licenses/lucene-core-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 b/server/licenses/lucene-core-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 new file mode 100644 index 0000000000000..d428340f07cee --- /dev/null +++ b/server/licenses/lucene-core-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 @@ -0,0 +1 @@ +d45264402a1ec05076f5e9cb7680115a6096cbcd \ No newline at end of file diff --git a/server/licenses/lucene-core-9.0.0-snapshot-cb366d04d4a.jar.sha1 b/server/licenses/lucene-core-9.0.0-snapshot-cb366d04d4a.jar.sha1 deleted file mode 100644 index 92d6556255420..0000000000000 --- a/server/licenses/lucene-core-9.0.0-snapshot-cb366d04d4a.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -0868575623351649afa11057defd5cf3191479e1 \ No newline at end of file diff --git a/server/licenses/lucene-grouping-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 b/server/licenses/lucene-grouping-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 new file mode 100644 index 0000000000000..6684cd003d207 --- /dev/null +++ b/server/licenses/lucene-grouping-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 @@ -0,0 +1 @@ +fcc3cc557fba5183b411a9d3e9639caf77ed72c7 \ No newline at end of file diff --git a/server/licenses/lucene-grouping-9.0.0-snapshot-cb366d04d4a.jar.sha1 b/server/licenses/lucene-grouping-9.0.0-snapshot-cb366d04d4a.jar.sha1 deleted file mode 100644 index 96cbfcf2d8d95..0000000000000 --- a/server/licenses/lucene-grouping-9.0.0-snapshot-cb366d04d4a.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -9302bd9d16186bfd0c1d33841885e041570bdaba \ No newline at end of file diff --git a/server/licenses/lucene-highlighter-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 b/server/licenses/lucene-highlighter-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 new file mode 100644 index 0000000000000..439cd22961f1b --- /dev/null +++ b/server/licenses/lucene-highlighter-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 @@ -0,0 +1 @@ +238a799fd7dceafc0933f823298f95e044d38a3e \ No newline at end of file diff --git a/server/licenses/lucene-highlighter-9.0.0-snapshot-cb366d04d4a.jar.sha1 b/server/licenses/lucene-highlighter-9.0.0-snapshot-cb366d04d4a.jar.sha1 deleted file mode 100644 index 92172f281e25b..0000000000000 --- a/server/licenses/lucene-highlighter-9.0.0-snapshot-cb366d04d4a.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -cc8ec53edb2cd14bfa0522a0e800979ef6eea6c9 \ No newline at end of file diff --git a/server/licenses/lucene-join-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 b/server/licenses/lucene-join-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 new file mode 100644 index 0000000000000..86d16d4c513df --- /dev/null +++ b/server/licenses/lucene-join-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 @@ -0,0 +1 @@ +1d7d8cc1c0c944a837cd89e0544ff980bb429ed9 \ No newline at end of file diff --git a/server/licenses/lucene-join-9.0.0-snapshot-cb366d04d4a.jar.sha1 b/server/licenses/lucene-join-9.0.0-snapshot-cb366d04d4a.jar.sha1 deleted file mode 100644 index cf8a33ec2a263..0000000000000 --- a/server/licenses/lucene-join-9.0.0-snapshot-cb366d04d4a.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -bf67e849438661b23fb8839b429f743cd77779d8 \ No newline at end of file diff --git a/server/licenses/lucene-memory-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 b/server/licenses/lucene-memory-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 new file mode 100644 index 0000000000000..5d2ff5dcf0205 --- /dev/null +++ b/server/licenses/lucene-memory-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 @@ -0,0 +1 @@ +99a0ef184c0e780651ea520adb6816158132ce13 \ No newline at end of file diff --git a/server/licenses/lucene-memory-9.0.0-snapshot-cb366d04d4a.jar.sha1 b/server/licenses/lucene-memory-9.0.0-snapshot-cb366d04d4a.jar.sha1 deleted file mode 100644 index f0e348637f895..0000000000000 --- a/server/licenses/lucene-memory-9.0.0-snapshot-cb366d04d4a.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -1325e5c28afa578dde285d207818a6d551f34516 \ No newline at end of file diff --git a/server/licenses/lucene-misc-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 b/server/licenses/lucene-misc-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 new file mode 100644 index 0000000000000..f30c4292dc94c --- /dev/null +++ b/server/licenses/lucene-misc-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 @@ -0,0 +1 @@ +f72ead45f81b31637e06a5154c2140b0c40f628c \ No newline at end of file diff --git a/server/licenses/lucene-misc-9.0.0-snapshot-cb366d04d4a.jar.sha1 b/server/licenses/lucene-misc-9.0.0-snapshot-cb366d04d4a.jar.sha1 deleted file mode 100644 index e89c66969e4da..0000000000000 --- a/server/licenses/lucene-misc-9.0.0-snapshot-cb366d04d4a.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -0f1b4983414859d9c938f4173732073b0937ede2 \ No newline at end of file diff --git a/server/licenses/lucene-queries-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 b/server/licenses/lucene-queries-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 new file mode 100644 index 0000000000000..8c0f48cde9221 --- /dev/null +++ b/server/licenses/lucene-queries-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 @@ -0,0 +1 @@ +2aedfbfbc37bb7fe06f6fd0e625f2bc230eb757d \ No newline at end of file diff --git a/server/licenses/lucene-queries-9.0.0-snapshot-cb366d04d4a.jar.sha1 b/server/licenses/lucene-queries-9.0.0-snapshot-cb366d04d4a.jar.sha1 deleted file mode 100644 index 7e935d7da3f45..0000000000000 --- a/server/licenses/lucene-queries-9.0.0-snapshot-cb366d04d4a.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -7fbc4b1510fe5c5ee146bf7678cb387c517cf08c \ No newline at end of file diff --git a/server/licenses/lucene-queryparser-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 b/server/licenses/lucene-queryparser-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 new file mode 100644 index 0000000000000..36d8f234dbf9d --- /dev/null +++ b/server/licenses/lucene-queryparser-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 @@ -0,0 +1 @@ +9e6725f996e1ab47719a3371b38bef9cdbe4dd8b \ No newline at end of file diff --git a/server/licenses/lucene-queryparser-9.0.0-snapshot-cb366d04d4a.jar.sha1 b/server/licenses/lucene-queryparser-9.0.0-snapshot-cb366d04d4a.jar.sha1 deleted file mode 100644 index e40c9d1533133..0000000000000 --- a/server/licenses/lucene-queryparser-9.0.0-snapshot-cb366d04d4a.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -99bdac7808c8cd25b27e7f50cc6ee39dbaea5a84 \ No newline at end of file diff --git a/server/licenses/lucene-sandbox-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 b/server/licenses/lucene-sandbox-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 new file mode 100644 index 0000000000000..2ce42e90f1ac7 --- /dev/null +++ b/server/licenses/lucene-sandbox-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 @@ -0,0 +1 @@ +a8cccdc6ebc93ce113732536730e2bc33828fe2a \ No newline at end of file diff --git a/server/licenses/lucene-sandbox-9.0.0-snapshot-cb366d04d4a.jar.sha1 b/server/licenses/lucene-sandbox-9.0.0-snapshot-cb366d04d4a.jar.sha1 deleted file mode 100644 index 77de9e9436399..0000000000000 --- a/server/licenses/lucene-sandbox-9.0.0-snapshot-cb366d04d4a.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -134d43a780e49ed23141a0dc1ae4c839d6af07d5 \ No newline at end of file diff --git a/server/licenses/lucene-spatial3d-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 b/server/licenses/lucene-spatial3d-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 new file mode 100644 index 0000000000000..6fe68ff9fb5b3 --- /dev/null +++ b/server/licenses/lucene-spatial3d-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 @@ -0,0 +1 @@ +4bf07ee8df37878dc31cfce7d5faeafae84d1cab \ No newline at end of file diff --git a/server/licenses/lucene-spatial3d-9.0.0-snapshot-cb366d04d4a.jar.sha1 b/server/licenses/lucene-spatial3d-9.0.0-snapshot-cb366d04d4a.jar.sha1 deleted file mode 100644 index bb121bb1c5e06..0000000000000 --- a/server/licenses/lucene-spatial3d-9.0.0-snapshot-cb366d04d4a.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -746c85a294596b2f40b1833196478277099cc1e4 \ No newline at end of file diff --git a/server/licenses/lucene-suggest-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 b/server/licenses/lucene-suggest-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 new file mode 100644 index 0000000000000..8d7a27560fefd --- /dev/null +++ b/server/licenses/lucene-suggest-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 @@ -0,0 +1 @@ +788a7e530a54673658bf54c92096a39d7fa734f1 \ No newline at end of file diff --git a/server/licenses/lucene-suggest-9.0.0-snapshot-cb366d04d4a.jar.sha1 b/server/licenses/lucene-suggest-9.0.0-snapshot-cb366d04d4a.jar.sha1 deleted file mode 100644 index f408f635bc2de..0000000000000 --- a/server/licenses/lucene-suggest-9.0.0-snapshot-cb366d04d4a.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -1221d3489409516b0b22921b4135532bae65b06a \ No newline at end of file diff --git a/server/src/main/java/org/elasticsearch/lucene/util/CombinedBitSet.java b/server/src/main/java/org/elasticsearch/lucene/util/CombinedBitSet.java index 247554e1298f7..10c320b6e4e91 100644 --- a/server/src/main/java/org/elasticsearch/lucene/util/CombinedBitSet.java +++ b/server/src/main/java/org/elasticsearch/lucene/util/CombinedBitSet.java @@ -105,4 +105,9 @@ public void clear(int i) { public void clear(int startIndex, int endIndex) { throw new UnsupportedOperationException("not implemented"); } + + @Override + public boolean getAndSet(int i) { + throw new UnsupportedOperationException("not implemented"); + } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/accesscontrol/MatchAllRoleBitSet.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/accesscontrol/MatchAllRoleBitSet.java index 2464105f3f000..aede83357cd98 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/accesscontrol/MatchAllRoleBitSet.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/accesscontrol/MatchAllRoleBitSet.java @@ -31,6 +31,11 @@ public void set(int i) { throw new UnsupportedOperationException(); } + @Override + public boolean getAndSet(int i) { + throw new UnsupportedOperationException(); + } + @Override public void clear(int i) { throw new UnsupportedOperationException(); diff --git a/x-pack/plugin/sql/sql-action/licenses/lucene-core-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 b/x-pack/plugin/sql/sql-action/licenses/lucene-core-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 new file mode 100644 index 0000000000000..d428340f07cee --- /dev/null +++ b/x-pack/plugin/sql/sql-action/licenses/lucene-core-9.0.0-snapshot-ba75dc5e6bf.jar.sha1 @@ -0,0 +1 @@ +d45264402a1ec05076f5e9cb7680115a6096cbcd \ No newline at end of file diff --git a/x-pack/plugin/sql/sql-action/licenses/lucene-core-9.0.0-snapshot-cb366d04d4a.jar.sha1 b/x-pack/plugin/sql/sql-action/licenses/lucene-core-9.0.0-snapshot-cb366d04d4a.jar.sha1 deleted file mode 100644 index 92d6556255420..0000000000000 --- a/x-pack/plugin/sql/sql-action/licenses/lucene-core-9.0.0-snapshot-cb366d04d4a.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -0868575623351649afa11057defd5cf3191479e1 \ No newline at end of file From 4d2427373be6f5efa96b1e15dfc4deba56db56ad Mon Sep 17 00:00:00 2001 From: Dan Hermann Date: Thu, 7 Oct 2021 06:49:57 -0500 Subject: [PATCH 221/250] Fix failing URLDecodeProcessorTests::testProcessor test (#78690) --- .../AbstractStringProcessorTestCase.java | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/AbstractStringProcessorTestCase.java b/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/AbstractStringProcessorTestCase.java index e1f2ecbdbdc45..4ad36e39919f8 100644 --- a/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/AbstractStringProcessorTestCase.java +++ b/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/AbstractStringProcessorTestCase.java @@ -38,8 +38,14 @@ protected Class expectedResultType() { public void testProcessor() throws Exception { IngestDocument ingestDocument = RandomDocumentPicks.randomIngestDocument(random()); - String fieldValue = RandomDocumentPicks.randomString(random()); - String fieldName = RandomDocumentPicks.addRandomField(random(), ingestDocument, modifyInput(fieldValue)); + String fieldValue; + String fieldName; + String modifiedFieldValue; + do { + fieldValue = RandomDocumentPicks.randomString(random()); + modifiedFieldValue = modifyInput(fieldValue); + fieldName = RandomDocumentPicks.addRandomField(random(), ingestDocument, modifiedFieldValue); + } while (isSupportedValue(modifiedFieldValue) == false); Processor processor = newProcessor(fieldName, randomBoolean(), fieldName); processor.execute(ingestDocument); assertThat(ingestDocument.getFieldValue(fieldName, expectedResultType()), equalTo(expectedResult(fieldValue))); @@ -48,8 +54,13 @@ public void testProcessor() throws Exception { List fieldValueList = new ArrayList<>(); List expectedList = new ArrayList<>(); for (int i = 0; i < numItems; i++) { - String randomString = RandomDocumentPicks.randomString(random()); - fieldValueList.add(modifyInput(randomString)); + String randomString; + String modifiedRandomString; + do { + randomString = RandomDocumentPicks.randomString(random()); + modifiedRandomString = modifyInput(randomString); + } while (isSupportedValue(modifiedRandomString) == false); + fieldValueList.add(modifiedRandomString); expectedList.add(expectedResult(randomString)); } String multiValueFieldName = RandomDocumentPicks.addRandomField(random(), ingestDocument, fieldValueList); From e5f4588318a56b8df59748e021fefdd6ccc36c5b Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Thu, 7 Oct 2021 14:25:53 +0200 Subject: [PATCH 222/250] Add cluster applier stats (#77552) Keep track of the time spent in each registered cluster state applier / listener and other cluster state applier activities. Also adjusted the discovery stats to include these time spent stats broken down by individual registered appliers / listeners and other cluster state applier activities. Also replaced the usage of `StopWatch` in `ClusterStateApplierService` with `ClusterApplierRecordingService.Recorder`. Relates to #77466 --- .../test/nodes.stats/30_discovery.yml | 22 +++ .../cluster/coordination/Coordinator.java | 4 +- .../cluster/service/ClusterApplier.java | 3 + .../ClusterApplierRecordingService.java | 185 ++++++++++++++++++ .../service/ClusterApplierService.java | 42 ++-- .../org/elasticsearch/common/util/Maps.java | 16 ++ .../discovery/DiscoveryStats.java | 22 ++- .../cluster/node/stats/NodeStatsTests.java | 15 +- .../coordination/NoOpClusterApplier.java | 7 + ...sterApplierRecordingServiceStatsTests.java | 35 ++++ .../ClusterApplierRecordingServiceTests.java | 105 ++++++++++ 11 files changed, 435 insertions(+), 21 deletions(-) create mode 100644 server/src/main/java/org/elasticsearch/cluster/service/ClusterApplierRecordingService.java create mode 100644 server/src/test/java/org/elasticsearch/cluster/service/ClusterApplierRecordingServiceStatsTests.java create mode 100644 server/src/test/java/org/elasticsearch/cluster/service/ClusterApplierRecordingServiceTests.java diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/nodes.stats/30_discovery.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/nodes.stats/30_discovery.yml index 7ea19acbabb48..1ddfc28c77f29 100644 --- a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/nodes.stats/30_discovery.yml +++ b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/nodes.stats/30_discovery.yml @@ -136,3 +136,25 @@ - is_true: nodes.$master.discovery.cluster_state_update.failure.completion_time - is_true: nodes.$master.discovery.cluster_state_update.failure.master_apply_time - is_true: nodes.$master.discovery.cluster_state_update.failure.notification_time + +--- +"Master cluster applier stats": + - skip: + features: [arbitrary_key] + version: "- 7.99.99" + reason: "not yet backported to 7.x branch" + + - do: + nodes.info: + node_id: _master + - set: + nodes._arbitrary_key_: master + + - do: + nodes.stats: + metric: [ discovery ] + + - is_true: nodes.$master.discovery.cluster_applier_stats.recordings + - is_true: nodes.$master.discovery.cluster_applier_stats.recordings.0.name + - gte: { nodes.$master.discovery.cluster_applier_stats.recordings.0.cumulative_execution_count: 1 } + - gte: { nodes.$master.discovery.cluster_applier_stats.recordings.0.cumulative_execution_time_millis: 1 } diff --git a/server/src/main/java/org/elasticsearch/cluster/coordination/Coordinator.java b/server/src/main/java/org/elasticsearch/cluster/coordination/Coordinator.java index 2a1501ea8eb7a..a58049da27e8e 100644 --- a/server/src/main/java/org/elasticsearch/cluster/coordination/Coordinator.java +++ b/server/src/main/java/org/elasticsearch/cluster/coordination/Coordinator.java @@ -794,8 +794,8 @@ public DiscoveryStats stats() { return new DiscoveryStats( new PendingClusterStateStats(0, 0, 0), publicationHandler.stats(), - getLocalNode().isMasterNode() ? masterService.getClusterStateUpdateStats() : null - ); + getLocalNode().isMasterNode() ? masterService.getClusterStateUpdateStats() : null, + clusterApplier.getStats()); } public void startInitialJoin() { diff --git a/server/src/main/java/org/elasticsearch/cluster/service/ClusterApplier.java b/server/src/main/java/org/elasticsearch/cluster/service/ClusterApplier.java index 743d0b3f7153e..e6abc8bca01ed 100644 --- a/server/src/main/java/org/elasticsearch/cluster/service/ClusterApplier.java +++ b/server/src/main/java/org/elasticsearch/cluster/service/ClusterApplier.java @@ -30,4 +30,7 @@ public interface ClusterApplier { * themselves, typically using a more specific logger and at a less dramatic log level. */ void onNewClusterState(String source, Supplier clusterStateSupplier, ActionListener listener); + + ClusterApplierRecordingService.Stats getStats(); + } diff --git a/server/src/main/java/org/elasticsearch/cluster/service/ClusterApplierRecordingService.java b/server/src/main/java/org/elasticsearch/cluster/service/ClusterApplierRecordingService.java new file mode 100644 index 0000000000000..499f32992e3c0 --- /dev/null +++ b/server/src/main/java/org/elasticsearch/cluster/service/ClusterApplierRecordingService.java @@ -0,0 +1,185 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ +package org.elasticsearch.cluster.service; + +import org.elasticsearch.cluster.service.ClusterApplierRecordingService.Stats.Recording; +import org.elasticsearch.common.io.stream.StreamInput; +import org.elasticsearch.common.io.stream.StreamOutput; +import org.elasticsearch.common.io.stream.Writeable; +import org.elasticsearch.common.metrics.MeanMetric; +import org.elasticsearch.common.util.Maps; +import org.elasticsearch.common.xcontent.ToXContentFragment; +import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.core.Releasable; +import org.elasticsearch.core.TimeValue; +import org.elasticsearch.core.Tuple; + +import java.io.IOException; +import java.util.Comparator; +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.function.LongSupplier; + +public final class ClusterApplierRecordingService { + + private final Map recordedActions = new HashMap<>(); + + synchronized Stats getStats() { + return new Stats( + recordedActions.entrySet().stream() + .sorted(Comparator.>comparingLong(o -> o.getValue().sum()).reversed()) + .collect(Maps.toUnmodifiableOrderedMap(Map.Entry::getKey, v -> new Recording(v.getValue().count(), v.getValue().sum()))) + ); + } + + synchronized void updateStats(Recorder recorder) { + Set seenActions = new HashSet<>(); + for (Tuple entry : recorder.recordings) { + String action = entry.v1(); + long timeSpentMS = entry.v2(); + + MeanMetric metric = recordedActions.computeIfAbsent(action, key -> new MeanMetric()); + metric.inc(timeSpentMS); + seenActions.add(action); + } + recordedActions.entrySet().removeIf(entry -> seenActions.contains(entry.getKey()) == false); + } + + static final class Recorder { + + private String currentAction; + private long startTimeMS; + private boolean recording; + private final List> recordings = new LinkedList<>(); + private final LongSupplier currentTimeSupplier; + + Recorder(LongSupplier currentTimeSupplier) { + this.currentTimeSupplier = currentTimeSupplier; + } + + Releasable record(String action) { + if (recording) { + throw new IllegalStateException("already recording"); + } + + this.recording = true; + this.currentAction = action; + this.startTimeMS = currentTimeSupplier.getAsLong(); + return this::stop; + } + + void stop() { + recording = false; + long timeSpentMS = currentTimeSupplier.getAsLong() - this.startTimeMS; + recordings.add(new Tuple<>(currentAction, timeSpentMS)); + } + + List> getRecordings() { + return recordings; + } + } + + public static class Stats implements Writeable, ToXContentFragment { + + private final Map recordings; + + public Stats(Map recordings) { + this.recordings = recordings; + } + + public Map getRecordings() { + return recordings; + } + + public Stats(StreamInput in) throws IOException { + this(in.readOrderedMap(StreamInput::readString, Recording::new)); + } + + @Override + public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { + builder.startObject("cluster_applier_stats"); + builder.startArray("recordings"); + for (Map.Entry entry : recordings.entrySet()) { + builder.startObject(); + builder.field("name", entry.getKey()); + String name = "cumulative_execution"; + builder.field(name + "_count", entry.getValue().count); + builder.humanReadableField(name + "_time_millis", name + "_time", TimeValue.timeValueMillis(entry.getValue().sum)); + builder.endObject(); + } + builder.endArray(); + builder.endObject(); + return builder; + } + + @Override + public void writeTo(StreamOutput out) throws IOException { + out.writeMap(recordings, StreamOutput::writeString, (out1, value) -> value.writeTo(out1)); + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + Stats stats = (Stats) o; + return Objects.equals(recordings, stats.recordings); + } + + @Override + public int hashCode() { + return Objects.hash(recordings); + } + + public static class Recording implements Writeable { + + private final long count; + private final long sum; + + public Recording(long count, long sum) { + this.count = count; + this.sum = sum; + } + + public Recording(StreamInput in) throws IOException { + this(in.readVLong(), in.readVLong()); + } + + @Override + public void writeTo(StreamOutput out) throws IOException { + out.writeVLong(count); + out.writeVLong(sum); + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + Recording recording = (Recording) o; + return count == recording.count && sum == recording.sum; + } + + @Override + public int hashCode() { + return Objects.hash(count, sum); + } + + @Override + public String toString() { + return "Recording{" + + "count=" + count + + ", sum=" + sum + + '}'; + } + } + } +} diff --git a/server/src/main/java/org/elasticsearch/cluster/service/ClusterApplierService.java b/server/src/main/java/org/elasticsearch/cluster/service/ClusterApplierService.java index 57700eb7a4f08..f1330d49a6bad 100644 --- a/server/src/main/java/org/elasticsearch/cluster/service/ClusterApplierService.java +++ b/server/src/main/java/org/elasticsearch/cluster/service/ClusterApplierService.java @@ -21,8 +21,8 @@ import org.elasticsearch.cluster.NodeConnectionsService; import org.elasticsearch.cluster.TimeoutClusterStateListener; import org.elasticsearch.cluster.node.DiscoveryNodes; +import org.elasticsearch.cluster.service.ClusterApplierRecordingService.Recorder; import org.elasticsearch.common.Priority; -import org.elasticsearch.common.StopWatch; import org.elasticsearch.common.component.AbstractLifecycleComponent; import org.elasticsearch.common.settings.ClusterSettings; import org.elasticsearch.common.settings.Setting; @@ -38,7 +38,6 @@ import org.elasticsearch.threadpool.Scheduler; import org.elasticsearch.threadpool.ThreadPool; -import java.util.Arrays; import java.util.Collection; import java.util.Map; import java.util.Objects; @@ -84,6 +83,8 @@ public class ClusterApplierService extends AbstractLifecycleComponent implements private final String nodeName; + private final ClusterApplierRecordingService recordingService; + private NodeConnectionsService nodeConnectionsService; public ClusterApplierService(String nodeName, Settings settings, ClusterSettings clusterSettings, ThreadPool threadPool) { @@ -91,6 +92,7 @@ public ClusterApplierService(String nodeName, Settings settings, ClusterSettings this.threadPool = threadPool; this.state = new AtomicReference<>(); this.nodeName = nodeName; + this.recordingService = new ClusterApplierRecordingService(); this.slowTaskLoggingThreshold = CLUSTER_SERVICE_SLOW_TASK_LOGGING_THRESHOLD_SETTING.get(settings); this.clusterSettings.addSettingsUpdateConsumer(CLUSTER_SERVICE_SLOW_TASK_LOGGING_THRESHOLD_SETTING, @@ -389,10 +391,10 @@ private void runTask(String source, Function updateF final ClusterState previousClusterState = state.get(); final long startTimeMillis = threadPool.relativeTimeInMillis(); - final StopWatch stopWatch = new StopWatch(); + final Recorder stopWatch = new Recorder(threadPool::rawRelativeTimeInMillis); final ClusterState newClusterState; try { - try (Releasable ignored = stopWatch.timing("running task [" + source + ']')) { + try (Releasable ignored = stopWatch.record("running task [" + source + ']')) { newClusterState = updateFunction.apply(previousClusterState); } } catch (Exception e) { @@ -448,7 +450,7 @@ private TimeValue getTimeSince(long startTimeMillis) { return TimeValue.timeValueMillis(Math.max(0, threadPool.relativeTimeInMillis() - startTimeMillis)); } - private void applyChanges(ClusterState previousClusterState, ClusterState newClusterState, String source, StopWatch stopWatch) { + private void applyChanges(ClusterState previousClusterState, ClusterState newClusterState, String source, Recorder stopWatch) { ClusterChangedEvent clusterChangedEvent = new ClusterChangedEvent(source, newClusterState, previousClusterState); // new cluster state, notify all listeners final DiscoveryNodes.Delta nodesDelta = clusterChangedEvent.nodesDelta(); @@ -465,7 +467,7 @@ private void applyChanges(ClusterState previousClusterState, ClusterState newClu } logger.trace("connecting to nodes of cluster state with version {}", newClusterState.version()); - try (Releasable ignored = stopWatch.timing("connecting to new nodes")) { + try (Releasable ignored = stopWatch.record("connecting to new nodes")) { connectToNodesAndWait(newClusterState); } @@ -473,7 +475,7 @@ private void applyChanges(ClusterState previousClusterState, ClusterState newClu if (clusterChangedEvent.state().blocks().disableStatePersistence() == false && clusterChangedEvent.metadataChanged()) { logger.debug("applying settings from cluster state with version {}", newClusterState.version()); final Settings incomingSettings = clusterChangedEvent.state().metadata().settings(); - try (Releasable ignored = stopWatch.timing("applying settings")) { + try (Releasable ignored = stopWatch.record("applying settings")) { clusterSettings.applySettings(incomingSettings); } } @@ -505,33 +507,35 @@ protected final void connectToNodesAsync(ClusterState newClusterState, Runnable nodeConnectionsService.connectToNodes(newClusterState.nodes(), onCompletion); } - private void callClusterStateAppliers(ClusterChangedEvent clusterChangedEvent, StopWatch stopWatch) { + private void callClusterStateAppliers(ClusterChangedEvent clusterChangedEvent, Recorder stopWatch) { callClusterStateAppliers(clusterChangedEvent, stopWatch, highPriorityStateAppliers); callClusterStateAppliers(clusterChangedEvent, stopWatch, normalPriorityStateAppliers); callClusterStateAppliers(clusterChangedEvent, stopWatch, lowPriorityStateAppliers); } - private static void callClusterStateAppliers(ClusterChangedEvent clusterChangedEvent, StopWatch stopWatch, + private static void callClusterStateAppliers(ClusterChangedEvent clusterChangedEvent, Recorder stopWatch, Collection clusterStateAppliers) { for (ClusterStateApplier applier : clusterStateAppliers) { logger.trace("calling [{}] with change to version [{}]", applier, clusterChangedEvent.state().version()); - try (Releasable ignored = stopWatch.timing("running applier [" + applier + "]")) { + final String name = applier.toString(); + try (Releasable ignored = stopWatch.record(name)) { applier.applyClusterState(clusterChangedEvent); } } } - private void callClusterStateListeners(ClusterChangedEvent clusterChangedEvent, StopWatch stopWatch) { + private void callClusterStateListeners(ClusterChangedEvent clusterChangedEvent, Recorder stopWatch) { callClusterStateListener(clusterChangedEvent, stopWatch, clusterStateListeners); callClusterStateListener(clusterChangedEvent, stopWatch, timeoutClusterStateListeners.keySet()); } - private void callClusterStateListener(ClusterChangedEvent clusterChangedEvent, StopWatch stopWatch, + private void callClusterStateListener(ClusterChangedEvent clusterChangedEvent, Recorder stopWatch, Collection listeners) { for (ClusterStateListener listener : listeners) { try { logger.trace("calling [{}] with change to version [{}]", listener, clusterChangedEvent.state().version()); - try (Releasable ignored = stopWatch.timing("notifying listener [" + listener + "]")) { + final String name = listener.toString(); + try (Releasable ignored = stopWatch.record(name)) { listener.clusterChanged(clusterChangedEvent); } } catch (Exception ex) { @@ -579,12 +583,13 @@ public void onResponse(Void unused) { } } - private void warnAboutSlowTaskIfNeeded(TimeValue executionTime, String source, StopWatch stopWatch) { + private void warnAboutSlowTaskIfNeeded(TimeValue executionTime, String source, Recorder recorder) { if (executionTime.getMillis() > slowTaskLoggingThreshold.getMillis()) { logger.warn("cluster state applier task [{}] took [{}] which is above the warn threshold of [{}]: {}", source, executionTime, - slowTaskLoggingThreshold, Arrays.stream(stopWatch.taskInfo()) - .map(ti -> '[' + ti.getTaskName() + "] took [" + ti.getTime().millis() + "ms]").collect(Collectors.joining(", "))); + slowTaskLoggingThreshold, recorder.getRecordings().stream() + .map(ti -> '[' + ti.v1() + "] took [" + ti.v2() + "ms]").collect(Collectors.joining(", "))); } + recordingService.updateStats(recorder); } private class NotifyTimeout implements Runnable { @@ -623,4 +628,9 @@ public void run() { protected boolean applicationMayFail() { return false; } + + @Override + public ClusterApplierRecordingService.Stats getStats() { + return recordingService.getStats(); + } } diff --git a/server/src/main/java/org/elasticsearch/common/util/Maps.java b/server/src/main/java/org/elasticsearch/common/util/Maps.java index 96b4334a9fc68..2757c224afa17 100644 --- a/server/src/main/java/org/elasticsearch/common/util/Maps.java +++ b/server/src/main/java/org/elasticsearch/common/util/Maps.java @@ -11,6 +11,7 @@ import java.util.Collection; import java.util.Collections; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.NavigableMap; @@ -18,6 +19,7 @@ import java.util.Set; import java.util.TreeMap; import java.util.function.Function; +import java.util.function.Supplier; import java.util.stream.Collector; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -208,4 +210,18 @@ private static Map flatten(List list, boolean ordered, S }, () -> new TreeMap()), Collections::unmodifiableNavigableMap); } + /** + * Returns a {@link Collector} that accumulates the input elements into a linked hash map and finishes the resulting set into an + * unmodifiable map. The resulting read-only view through the unmodifiable map is a linked hash map. + * + * @param the type of the input elements + * @return an unmodifiable {@link Map} where the underlying map has a consistent order + */ + public static Collector> toUnmodifiableOrderedMap(Function keyMapper, + Function valueMapper) { + return Collectors.collectingAndThen(Collectors.toMap(keyMapper, valueMapper, (v1, v2) -> { + throw new IllegalStateException("Duplicate key (attempted merging values " + v1 + " and " + v2 + ")"); + }, (Supplier>) LinkedHashMap::new), Collections::unmodifiableMap); + } + } diff --git a/server/src/main/java/org/elasticsearch/discovery/DiscoveryStats.java b/server/src/main/java/org/elasticsearch/discovery/DiscoveryStats.java index 0c991499cb527..d604d6075fa1c 100644 --- a/server/src/main/java/org/elasticsearch/discovery/DiscoveryStats.java +++ b/server/src/main/java/org/elasticsearch/discovery/DiscoveryStats.java @@ -9,6 +9,7 @@ package org.elasticsearch.discovery; import org.elasticsearch.Version; +import org.elasticsearch.cluster.service.ClusterApplierRecordingService; import org.elasticsearch.cluster.service.ClusterStateUpdateStats; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -25,15 +26,17 @@ public class DiscoveryStats implements Writeable, ToXContentFragment { private final PendingClusterStateStats queueStats; private final PublishClusterStateStats publishStats; private final ClusterStateUpdateStats clusterStateUpdateStats; + private final ClusterApplierRecordingService.Stats applierRecordingStats; public DiscoveryStats( PendingClusterStateStats queueStats, PublishClusterStateStats publishStats, - ClusterStateUpdateStats clusterStateUpdateStats - ) { + ClusterStateUpdateStats clusterStateUpdateStats, + ClusterApplierRecordingService.Stats applierRecordingStats) { this.queueStats = queueStats; this.publishStats = publishStats; this.clusterStateUpdateStats = clusterStateUpdateStats; + this.applierRecordingStats = applierRecordingStats; } public DiscoveryStats(StreamInput in) throws IOException { @@ -44,6 +47,11 @@ public DiscoveryStats(StreamInput in) throws IOException { } else { clusterStateUpdateStats = null; } + if (in.getVersion().onOrAfter(Version.V_8_0_0)) { + applierRecordingStats = in.readOptionalWriteable(ClusterApplierRecordingService.Stats::new); + } else { + applierRecordingStats = null; + } } @Override @@ -53,6 +61,9 @@ public void writeTo(StreamOutput out) throws IOException { if (out.getVersion().onOrAfter(Version.V_7_16_0)) { out.writeOptionalWriteable(clusterStateUpdateStats); } + if (out.getVersion().onOrAfter(Version.V_8_0_0)) { + out.writeOptionalWriteable(applierRecordingStats); + } } @Override @@ -67,6 +78,9 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws if (clusterStateUpdateStats != null) { clusterStateUpdateStats.toXContent(builder, params); } + if (applierRecordingStats != null) { + applierRecordingStats.toXContent(builder, params); + } builder.endObject(); return builder; } @@ -86,4 +100,8 @@ public PendingClusterStateStats getQueueStats() { public PublishClusterStateStats getPublishStats() { return publishStats; } + + public ClusterApplierRecordingService.Stats getApplierRecordingStats() { + return applierRecordingStats; + } } diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/node/stats/NodeStatsTests.java b/server/src/test/java/org/elasticsearch/action/admin/cluster/node/stats/NodeStatsTests.java index b6d90e9e15ed3..6ffa99fea2f7e 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/node/stats/NodeStatsTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/cluster/node/stats/NodeStatsTests.java @@ -11,9 +11,12 @@ import org.elasticsearch.cluster.coordination.PendingClusterStateStats; import org.elasticsearch.cluster.coordination.PublishClusterStateStats; import org.elasticsearch.cluster.node.DiscoveryNode; +import org.elasticsearch.cluster.service.ClusterApplierRecordingService; +import org.elasticsearch.cluster.service.ClusterApplierRecordingService.Stats.Recording; import org.elasticsearch.cluster.service.ClusterStateUpdateStats; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamInput; +import org.elasticsearch.core.Tuple; import org.elasticsearch.discovery.DiscoveryStats; import org.elasticsearch.http.HttpStats; import org.elasticsearch.indices.breaker.AllCircuitBreakerStats; @@ -573,6 +576,15 @@ public static NodeStats createNodeStats() { } scriptStats = new ScriptStats(stats); } + ClusterApplierRecordingService.Stats timeTrackerStats; + if (randomBoolean()) { + timeTrackerStats = new ClusterApplierRecordingService.Stats( + randomMap(2, 32, () -> new Tuple<>(randomAlphaOfLength(4), new Recording(randomNonNegativeLong(), randomNonNegativeLong()))) + ); + } else { + timeTrackerStats = null; + } + DiscoveryStats discoveryStats = frequently() ? new DiscoveryStats( randomBoolean() @@ -605,7 +617,8 @@ public static NodeStats createNodeStats() { randomNonNegativeLong(), randomNonNegativeLong(), randomNonNegativeLong()) - : null) + : null, + timeTrackerStats) : null; IngestStats ingestStats = null; if (frequently()) { diff --git a/server/src/test/java/org/elasticsearch/cluster/coordination/NoOpClusterApplier.java b/server/src/test/java/org/elasticsearch/cluster/coordination/NoOpClusterApplier.java index e76bb5ba94d55..8b8e0834d1f9b 100644 --- a/server/src/test/java/org/elasticsearch/cluster/coordination/NoOpClusterApplier.java +++ b/server/src/test/java/org/elasticsearch/cluster/coordination/NoOpClusterApplier.java @@ -10,7 +10,9 @@ import org.elasticsearch.action.ActionListener; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.service.ClusterApplier; +import org.elasticsearch.cluster.service.ClusterApplierRecordingService; +import java.util.Map; import java.util.function.Supplier; public class NoOpClusterApplier implements ClusterApplier { @@ -23,4 +25,9 @@ public void setInitialState(ClusterState initialState) { public void onNewClusterState(String source, Supplier clusterStateSupplier, ActionListener listener) { listener.onResponse(null); } + + @Override + public ClusterApplierRecordingService.Stats getStats() { + return new ClusterApplierRecordingService.Stats(Map.of()); + } } diff --git a/server/src/test/java/org/elasticsearch/cluster/service/ClusterApplierRecordingServiceStatsTests.java b/server/src/test/java/org/elasticsearch/cluster/service/ClusterApplierRecordingServiceStatsTests.java new file mode 100644 index 0000000000000..581beb8f873dc --- /dev/null +++ b/server/src/test/java/org/elasticsearch/cluster/service/ClusterApplierRecordingServiceStatsTests.java @@ -0,0 +1,35 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.cluster.service; + +import org.elasticsearch.cluster.service.ClusterApplierRecordingService.Stats; +import org.elasticsearch.cluster.service.ClusterApplierRecordingService.Stats.Recording; +import org.elasticsearch.common.io.stream.Writeable; +import org.elasticsearch.test.AbstractWireSerializingTestCase; + +import java.util.HashMap; +import java.util.Map; + +public class ClusterApplierRecordingServiceStatsTests extends AbstractWireSerializingTestCase { + + @Override + protected Writeable.Reader instanceReader() { + return Stats::new; + } + + @Override + protected Stats createTestInstance() { + int numRecordings = randomInt(256); + Map recordings = new HashMap<>(numRecordings); + for (int i = 0; i < numRecordings; i++) { + recordings.put(randomAlphaOfLength(16), new Recording(randomNonNegativeLong(), randomNonNegativeLong())); + } + return new Stats(recordings); + } +} diff --git a/server/src/test/java/org/elasticsearch/cluster/service/ClusterApplierRecordingServiceTests.java b/server/src/test/java/org/elasticsearch/cluster/service/ClusterApplierRecordingServiceTests.java new file mode 100644 index 0000000000000..fdcac4d3e54cc --- /dev/null +++ b/server/src/test/java/org/elasticsearch/cluster/service/ClusterApplierRecordingServiceTests.java @@ -0,0 +1,105 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.cluster.service; + +import org.elasticsearch.cluster.service.ClusterApplierRecordingService.Recorder; +import org.elasticsearch.cluster.service.ClusterApplierRecordingService.Stats.Recording; +import org.elasticsearch.core.Releasable; +import org.elasticsearch.core.Tuple; +import org.elasticsearch.test.ESTestCase; + +import java.util.Map; + +import static org.hamcrest.Matchers.contains; + +public class ClusterApplierRecordingServiceTests extends ESTestCase { + + public void testRecorder() { + long[] currentTime = new long[1]; + var recorder = new Recorder(() -> currentTime[0]); + { + Releasable releasable = recorder.record("action1"); + currentTime[0] = 5; + releasable.close(); + } + { + Releasable releasable = recorder.record("action2"); + currentTime[0] = 42; + releasable.close(); + } + { + Releasable releasable = recorder.record("action3"); + currentTime[0] = 45; + releasable.close(); + } + + var recordings = recorder.getRecordings(); + assertThat(recordings, contains(Tuple.tuple("action1", 5L), Tuple.tuple("action2", 37L), Tuple.tuple("action3", 3L))); + } + + public void testRecorderAlreadyRecording() { + var recorder = new Recorder(() -> 1L); + Releasable releasable = recorder.record("action1"); + expectThrows(IllegalStateException.class, () -> recorder.record("action2")); + } + + public void testRecordingServiceStats() { + var service = new ClusterApplierRecordingService(); + + { + long[] currentTime = new long[1]; + var recorder = new Recorder(() -> currentTime[0]); + try (var r = recorder.record("action1")) { + currentTime[0] = 5; + } + try (var r = recorder.record("action2")) { + currentTime[0] = 42; + } + try (var r = recorder.record("action3")) { + currentTime[0] = 45; + } + service.updateStats(recorder); + var stats = service.getStats(); + assertThat(stats.getRecordings().entrySet(), contains(Map.entry("action2", new Recording(1, 37)), + Map.entry("action1", new Recording(1, 5)), Map.entry("action3", new Recording(1, 3)))); + } + { + long[] currentTime = new long[1]; + var recorder = new Recorder(() -> currentTime[0]); + try (var r = recorder.record("action1")) { + currentTime[0] = 3; + } + try (var r = recorder.record("action2")) { + currentTime[0] = 35; + } + try (var r = recorder.record("action3")) { + currentTime[0] = 41; + } + service.updateStats(recorder); + var stats = service.getStats(); + assertThat(stats.getRecordings().entrySet(), contains(Map.entry("action2", new Recording(2, 69)), + Map.entry("action3", new Recording(2, 9)), Map.entry("action1", new Recording(2, 8)))); + } + { + long[] currentTime = new long[1]; + var recorder = new Recorder(() -> currentTime[0]); + try (var r = recorder.record("action1")) { + currentTime[0] = 2; + } + try (var r = recorder.record("action3")) { + currentTime[0] = 6; + } + service.updateStats(recorder); + var stats = service.getStats(); + assertThat(stats.getRecordings().entrySet(), contains(Map.entry("action3", new Recording(3, 13)), + Map.entry("action1", new Recording(3, 10)))); + } + } + +} From 9fb6888390005c2888dcd582d31d0c3efa529185 Mon Sep 17 00:00:00 2001 From: Adam Locke Date: Thu, 7 Oct 2021 08:44:00 -0400 Subject: [PATCH 223/250] [DOCS] Document default security in alpha2 (#78227) * [DOCS] Document default security in alpha2 * Updating steps for current environment * Edits, updates, and rewrites Co-authored-by: Elastic Machine --- .../configuring-stack-security.asciidoc | 201 ++++++++---------- x-pack/docs/en/security/index.asciidoc | 22 +- 2 files changed, 104 insertions(+), 119 deletions(-) diff --git a/x-pack/docs/en/security/configuring-stack-security.asciidoc b/x-pack/docs/en/security/configuring-stack-security.asciidoc index 4abddb79d70fc..02c2aa99cf8c2 100644 --- a/x-pack/docs/en/security/configuring-stack-security.asciidoc +++ b/x-pack/docs/en/security/configuring-stack-security.asciidoc @@ -5,28 +5,49 @@ beta::[This functionality is in alpha and is subject to change. The design and c Before you start {es} for the first time, run the `elasticsearch-security-config` tool. This tool generates certificates and keys for the transport and HTTP -layers of {es}, and writes the TLS configuration settings to `elasticsearch.yml`. +layers of {es}, and writes the Transport Layer Security (TLS) configuration +settings to `elasticsearch.yml`. These certificates allow you to connect a +{kib} instance to your secured {es} cluster and encrypt internode communication. + +When you start {es} for the first time, passwords are automatically generated +for the `elastic` and `kibana_system` users. Tools are available to reset these +passwords if you misplace them or need to rotate passwords. + +You can then use the +<> tool to +generate separate enrollment tokens for connecting a {kib} instance to your +secured {es} cluster and enrolling additional nodes. + +When you complete the enrollment process for {kib}, it applies the security +settings from your {es} cluster, authenticates to {es} with the `kibana_system` +user, and writes the security configuration to `kibana.yml`. A security +certificate is generated in the {kib} configuration directory. This +file establishes trust between {kib} and the {es} Certificate Authority (CA) for +the HTTP layer. [discrete] === Prerequisites -https://www.elastic.co/downloads/elasticsearch#preview-release[Download] the `elasticsearch 8.0.0-alpha1` package distribution for your +* https://www.elastic.co/downloads/elasticsearch#preview-release[Download] and +unpack the `elasticsearch 8.0.0-alpha2` package distribution for your environment. +* https://www.elastic.co/downloads/kibana#preview-release[Download] and unpack +the `kibana 8.0.0-alpha2` package distribution for your environment. [discrete] -=== Start {es} with security enabled - +[[stack-generate-certificates]] +=== Generate security certificates . Before starting {es} for the first time, run the `elasticsearch-security-config` tool from the directory where you downloaded the {es} package distribution: + [source,shell] ---- -./bin/elasticsearch-security-config +bin/elasticsearch-security-config ---- + The `elasticsearch-security-config` tool generates the following security -certificates and keys in `config/auto_config_on_`: +certificates and keys in `config/tls_auto_config_initial_node_`: + -- `http_ca.crt`:: @@ -40,152 +61,110 @@ Keystore that contains the key and certificate for the HTTP layer for this node. Keystore that contains the key and certificate for the transport layer for all the nodes in your cluster. -- -. Start {es}. -+ -[source,shell] ----- -./bin/elasticsearch ----- - -. In another terminal window, run the -<> utility from the directory -where you downloaded the {es} package distribution: +[discrete] +[[stack-start-with-security]] +=== Start {es} and enroll {kib} with security enabled +. From the installation directory, start {es}. Passwords for the `elastic` and +`kibana_system` users are generated and output to the terminal. + [source,shell] ---- -./bin/elasticsearch-setup-passwords auto +bin/elasticsearch ---- + -If you want to use your own passwords, run the command with the -`interactive` parameter instead of the `auto` parameter. Using this mode -steps you through password configuration for all of the built-in users. -+ -[source,shell] ----- -./bin/elasticsearch-setup-passwords interactive ----- +TIP: You might need to scroll back a bit in the terminal to view the passwords. -. Save the generated passwords. You'll need them to add the built-in user to -{kib}. +. Copy the generated passwords and save them in a secure location. The passwords +are shown only when you start {es} for the first time. + -NOTE: After you set a password for the `elastic` user, you cannot run the -`elasticsearch-setup-passwords` command a second time. If you forgot the -password for the `elastic` user or want to change it, use the -<> tool. +NOTE: If you need to reset the password for the `elastic` user, run the +<> tool. To +reset the password for the `kibana_system` user, run the +`elasticsearch-reset-kibana-system-password` tool. Both of these tools are +available in the {es} `/bin` directory. -. Make an authenticated call to your {es} cluster and enter the password for -the `elastic` user when prompted: +. Open a new terminal and verify that you can connect to your {es} cluster by +making an authenticated call. Enter the password for the `elastic` user when +prompted: + [source,shell] ---- -curl --cacert config/auto_config_on_/http_ca.crt \ --u elastic https://localhost:9200 +curl --cacert config/tls_auto_config_initial_node_/http_ca.crt \ +-u elastic https://localhost:9200 <1> ---- // NOTCONSOLE +<1> Ensure that you use `https` in your call, or the request will fail. + `--cacert`:: Path to the generated `http_ca.crt` certificate for the HTTP layer. -*Next*: <> - -[discrete] -[[add-kib-user]] -=== Configure {kib} to connect to {es} with a password - -With security enabled, users must log in to {kib} with a valid username and -password. - -You'll configure {kib} to use the built-in `kibana_system` user and the password -that you created earlier. {kib} performs some background tasks that require use -of the `kibana_system` user. - -This account is not meant for individual users and does not have permission to -log in to {kib} from a browser. Instead, you'll log in to {kib} as the `elastic` -superuser. - -. Add the `elasticsearch.username` setting to the `$KBN_PATH_CONF/kibana.yml` -file and set the value to the `kibana_system` user: +. In your new terminal, navigate to the directory where you installed {es}, and +run the <> tool +to generate an enrollment token for {kib}. + -[source,yaml] +[source,shell] ---- -elasticsearch.username: "kibana_system" +bin/elasticsearch-create-enrollment-token -s kibana ---- + -NOTE: The `$KBN_PATH_CONF` variable is the path for the {kib} -configuration files. If you installed {kib} using archive distributions -(`zip` or `tar.gz`), the variable defaults to `$KBN_HOME/config`. If you used -package distributions (Debian or RPM), the variable defaults to `/etc/kibana`. - -. From the directory where you installed {kib}, run the following commands -to create the {kib} keystore and add the secure settings: +Copy the enrollment token, which you'll use to enroll {kib} with your {es} +cluster. - a. Create the {kib} keystore: +. From the directory where you installed {kib}, start {kib} in interactive mode. + [source,shell] ---- -./bin/kibana-keystore create +bin/kibana --interactiveSetup.enabled=true ---- ++ +This command generates a unique link to enroll your {kib} instance with {es}. + + .. In your terminal, click the generated link to open {kib} in your browser. + + .. In your browser, paste the enrollment token that you copied and click the +button to connect your {kib} instance with {es}. + + .. Log in to {kib} as the `elastic` user with the password that was generated +when you started {es}. - b. Add the password for the `kibana_system` user to the {kib} keystore: +[discrete] +[[stack-enroll-nodes]] +=== Enroll additional nodes in your cluster +. In a separate terminal from where {es} is running, navigate to the directory +where you installed {es} and run the +<> tool +to generate an enrollment token for your additional nodes. + [source,shell] ---- -./bin/kibana-keystore add elasticsearch.password +bin/elasticsearch-create-enrollment-token -s node ---- + -When prompted, enter the password for the `kibana_system` user. +Copy the enrollment token, which you'll use to enroll additional nodes with +your {es} cluster. -. Restart {kib}. For example, if you installed {kib} with a `.tar.gz` package, run the following command from the {kib} directory: +. From the installation directory of your other node, run the +`elasticsearch-enroll-node` tool and pass your enrollment token with the +`--enrollment token` parameter. + [source,shell] ---- -./bin/kibana +bin/elasticsearch-enroll-node --enrollment token ---- -. Log in to {kib} as the `elastic` user. Use this superuser account to -{kibana-ref}/tutorial-secure-access-to-kibana.html[manage spaces, create new users, and assign roles]. If you're running {kib} locally, go to `http://localhost:5601` to view the login page. - -*Next*: <> - -[discrete] -[[encrypt-kibana-with-elasticsearch]] -=== Encrypt traffic between {kib} and {es} - -When you ran the `elasticsearch-security-config` tool, it -created an `http_ca.crt` file in `config/auto_config_on_`. -Use this file to configure {kib} to trust the {es} CA for the HTTP layer. +. Repeat the previous step for any additional nodes that you want to enroll. -1. Copy the `http_ca.crt` file to the {kib} configuration directory, as defined -by the `$KBN_PATH_CONF` path. - -2. Open `kibana.yml` and add the following line to specify the location of the -security certificate for the HTTP layer. -+ -[source,yaml] ----- -elasticsearch.ssl.certificateAuthorities: $KBN_PATH_CONF/http_ca.crt ----- - -3. Add the following line to specify the HTTPS URL for your {es} +. Start your new nodes, which {es} automatically enrolls into the existing cluster. + -[source,yaml] +[source,shell] ---- -elasticsearch.hosts: https://.com:9200 +bin/elasticsearch ---- -4. Restart {kib}. You can now connect to {kib} securely over HTTPS, such as -`https://localhost:5601`. - -.Connect to a secure monitoring cluster -**** -If the Elastic monitoring features are enabled and you configured a separate -{es} monitoring cluster, you can also configure {kib} to connect to -the monitoring cluster via HTTPS. The steps are the same, but each setting is -prefixed by `monitoring`. For example, `monitoring.ui.elasticsearch.hosts` and -`monitoring.ui.elasticsearch.ssl.truststore.path`. - -NOTE: You must create a separate `elasticsearch-ca.pem` security file for the -monitoring cluster. Refer to -<>. -**** +[discrete] +=== What's next? +Congratulations! You've successfully started the {stack} with security enabled. {es} +and {kib} are secured with TLS on the HTTP layer, and internode communication +is encrypted. If you want to enable HTTPS for web traffic, you +can <>. diff --git a/x-pack/docs/en/security/index.asciidoc b/x-pack/docs/en/security/index.asciidoc index d857eee896738..56e48abaad2cc 100644 --- a/x-pack/docs/en/security/index.asciidoc +++ b/x-pack/docs/en/security/index.asciidoc @@ -9,14 +9,20 @@ nodes that form the cluster, plus {ls} instances, {kib} instances, {beats} agents, and clients all communicating with the cluster. To keep your cluster safe, adhere to the <>. -<> or -<> to -secure {es} clusters and any clients that communicate with your clusters. You -can password protect access to your data as well as enable more advanced -security by configuring Transport Layer Security (TLS). This additional layer -provides confidentiality and integrity protection to your communications with -the {stack}. You can also implement additional security measures, such as -role-based access control, IP filtering, and auditing. +The first principle is to run {es} with security enabled. Configuring security +can be complicated, so we made it easy to +<> by +default. Run a single configuration command and then start {es} to enable the +{stack} security features. You can then connect a {kib} instance to your +secured {es} cluster and enroll additional nodes. You'll have password +protection, internode communication secured with Transport Layer Security (TLS), +and encrypted connections between {es} and {kib}. + +If you prefer to manage security on your own, you can +<> to secure {es} +clusters and any clients that communicate with your clusters. You can also +implement additional security measures, such as role-based access control, IP +filtering, and auditing. Enabling security protects {es} clusters by: From 877e72233a4192847b0629d01b89b4261d565427 Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Thu, 7 Oct 2021 15:02:45 +0200 Subject: [PATCH 224/250] Allow indices lookup to be built lazily (#78745) Overloaded the Metadata.Builder.build() method by adding a parameter that controls when to build indices lookup. By default the indices lookup is always build. When cluster state updates are batched in ilm, then built the indices lookup lazily. Because during batching only the final cluster state is used, then for the many intermediate cluster states we avoids building the indices lookup, which in a cluster with many indices can improve the performance of publishing cluster states significantly. Relates to #77466 --- .../cluster/metadata/Metadata.java | 52 +++++++++++++------ .../core/ilm/CopyExecutionStateStep.java | 2 +- .../xpack/core/ilm/CopySettingsStep.java | 2 +- .../core/ilm/GenerateSnapshotNameStep.java | 3 +- .../core/ilm/GenerateUniqueIndexNameStep.java | 2 +- .../core/ilm/InitializePolicyContextStep.java | 2 +- .../xpack/core/ilm/PhaseCacheManagement.java | 4 +- .../ReplaceDataStreamBackingIndexStep.java | 2 +- .../ilm/UpdateRolloverLifecycleDateStep.java | 2 +- .../xpack/ilm/IndexLifecycleRunner.java | 2 + .../xpack/ilm/IndexLifecycleTransition.java | 3 +- 11 files changed, 50 insertions(+), 26 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/Metadata.java b/server/src/main/java/org/elasticsearch/cluster/metadata/Metadata.java index b92a2fbb4538c..da7eb6d0f69b4 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/Metadata.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/Metadata.java @@ -189,7 +189,7 @@ public interface NonRestorableCustom extends Custom { private final String[] allClosedIndices; private final String[] visibleClosedIndices; - private final SortedMap indicesLookup; + private SortedMap indicesLookup; Metadata(String clusterUUID, boolean clusterUUIDCommitted, long version, CoordinationMetadata coordinationMetadata, Settings transientSettings, Settings persistentSettings, DiffableStringMap hashesOfConsistentSettings, @@ -304,6 +304,11 @@ public boolean equalsAliases(Metadata other) { } public SortedMap getIndicesLookup() { + if (indicesLookup != null) { + return indicesLookup; + } + DataStreamMetadata dataStreamMetadata = custom(DataStreamMetadata.TYPE); + indicesLookup = Collections.unmodifiableSortedMap(Builder.buildIndicesLookup(dataStreamMetadata, indices)); return indicesLookup; } @@ -1430,7 +1435,22 @@ public Builder generateClusterUuidIfNeeded() { return this; } + /** + * @return a new Metadata instance + */ public Metadata build() { + return build(true); + } + + /** + * @param builtIndicesLookupEagerly Controls whether indices lookup should be build as part of the execution of this method + * or after when needed. Almost all of the time indices lookup should be built eagerly, however + * in certain cases when Metdata instances are build that are not published and + * many indices have been defined then it makes sense to skip building indices lookup. + * + * @return a new Metadata instance + */ + public Metadata build(boolean builtIndicesLookupEagerly) { // TODO: We should move these datastructures to IndexNameExpressionResolver, this will give the following benefits: // 1) The datastructures will be rebuilt only when needed. Now during serializing we rebuild these datastructures // while these datastructures aren't even used. @@ -1514,9 +1534,15 @@ public Metadata build() { "were found [" + Strings.collectionToCommaDelimitedString(duplicates) + "]"); } - SortedMap indicesLookup = Collections.unmodifiableSortedMap(buildIndicesLookup()); + ImmutableOpenMap indices = this.indices.build(); + + SortedMap indicesLookup; + if (builtIndicesLookupEagerly) { + indicesLookup = Collections.unmodifiableSortedMap(buildIndicesLookup(dataStreamMetadata, indices)); + } else { + indicesLookup = null; + } - validateDataStreams(indicesLookup, (DataStreamMetadata) customs.get(DataStreamMetadata.TYPE)); // build all concrete indices arrays: // TODO: I think we can remove these arrays. it isn't worth the effort, for operations on all indices. @@ -1530,14 +1556,14 @@ public Metadata build() { String[] visibleClosedIndicesArray = visibleClosedIndices.toArray(Strings.EMPTY_ARRAY); return new Metadata(clusterUUID, clusterUUIDCommitted, version, coordinationMetadata, transientSettings, persistentSettings, - hashesOfConsistentSettings, indices.build(), templates.build(), customs.build(), allIndicesArray, visibleIndicesArray, + hashesOfConsistentSettings, indices, templates.build(), customs.build(), allIndicesArray, visibleIndicesArray, allOpenIndicesArray, visibleOpenIndicesArray, allClosedIndicesArray, visibleClosedIndicesArray, indicesLookup); } - private SortedMap buildIndicesLookup() { + static SortedMap buildIndicesLookup(DataStreamMetadata dataStreamMetadata, + ImmutableOpenMap indices) { SortedMap indicesLookup = new TreeMap<>(); Map indexToDataStreamLookup = new HashMap<>(); - DataStreamMetadata dataStreamMetadata = (DataStreamMetadata) this.customs.get(DataStreamMetadata.TYPE); // If there are no indices, then skip data streams. This happens only when metadata is read from disk if (dataStreamMetadata != null && indices.size() > 0) { Map> dataStreamToAliasLookup = new HashMap<>(); @@ -1579,9 +1605,7 @@ private SortedMap buildIndicesLookup() { } Map> aliasToIndices = new HashMap<>(); - for (var cursor : indices.values()) { - IndexMetadata indexMetadata = cursor.value; - + for (var indexMetadata : indices.values()) { IndexAbstraction.Index index; DataStream parent = indexToDataStreamLookup.get(indexMetadata.getIndex().getName()); if (parent != null) { @@ -1600,13 +1624,8 @@ private SortedMap buildIndicesLookup() { for (var aliasCursor : indexMetadata.getAliases()) { AliasMetadata aliasMetadata = aliasCursor.value; - aliasToIndices.compute(aliasMetadata.getAlias(), (aliasName, indices) -> { - if (indices == null) { - indices = new ArrayList<>(); - } - indices.add(indexMetadata); - return indices; - }); + List aliasIndices = aliasToIndices.computeIfAbsent(aliasMetadata.getAlias(), k -> new ArrayList<>()); + aliasIndices.add(indexMetadata); } } @@ -1616,6 +1635,7 @@ private SortedMap buildIndicesLookup() { assert existing == null : "duplicate for " + entry.getKey(); } + validateDataStreams(indicesLookup, dataStreamMetadata); return indicesLookup; } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/CopyExecutionStateStep.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/CopyExecutionStateStep.java index 74df72ebfe6a8..25a9290a4d469 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/CopyExecutionStateStep.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/CopyExecutionStateStep.java @@ -89,7 +89,7 @@ public ClusterState performAction(Index index, ClusterState clusterState) { .put(IndexMetadata.builder(targetIndexMetadata) .putCustom(ILM_CUSTOM_METADATA_KEY, relevantTargetCustomData.build().asMap())); - return ClusterState.builder(clusterState).metadata(newMetadata).build(); + return ClusterState.builder(clusterState).metadata(newMetadata.build(false)).build(); } @Override diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/CopySettingsStep.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/CopySettingsStep.java index 6f51ee2dd6097..c4bedc0eb7230 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/CopySettingsStep.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/CopySettingsStep.java @@ -87,7 +87,7 @@ public ClusterState performAction(Index index, ClusterState clusterState) { .put(IndexMetadata.builder(targetIndexMetadata) .settingsVersion(targetIndexMetadata.getSettingsVersion() + 1) .settings(settings)); - return ClusterState.builder(clusterState).metadata(newMetaData).build(); + return ClusterState.builder(clusterState).metadata(newMetaData.build(false)).build(); } @Override diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/GenerateSnapshotNameStep.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/GenerateSnapshotNameStep.java index 249b56c9a2b93..47492df01b123 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/GenerateSnapshotNameStep.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/GenerateSnapshotNameStep.java @@ -93,7 +93,8 @@ public ClusterState performAction(Index index, ClusterState clusterState) { return ClusterState.builder(clusterState) .metadata(Metadata.builder(clusterState.getMetadata()) .put(IndexMetadata.builder(indexMetaData) - .putCustom(ILM_CUSTOM_METADATA_KEY, newCustomData.build().asMap()))) + .putCustom(ILM_CUSTOM_METADATA_KEY, newCustomData.build().asMap())) + .build(false)) .build(); } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/GenerateUniqueIndexNameStep.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/GenerateUniqueIndexNameStep.java index af1e26767b72f..216cdee02efb6 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/GenerateUniqueIndexNameStep.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/GenerateUniqueIndexNameStep.java @@ -90,7 +90,7 @@ public ClusterState performAction(Index index, ClusterState clusterState) { IndexMetadata.Builder indexMetadataBuilder = IndexMetadata.builder(indexMetadata); indexMetadataBuilder.putCustom(ILM_CUSTOM_METADATA_KEY, newCustomData.build().asMap()); - newClusterStateBuilder.metadata(Metadata.builder(clusterState.getMetadata()).put(indexMetadataBuilder)); + newClusterStateBuilder.metadata(Metadata.builder(clusterState.getMetadata()).put(indexMetadataBuilder).build(false)); return newClusterStateBuilder.build(); } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/InitializePolicyContextStep.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/InitializePolicyContextStep.java index 7830b4449d556..d541106dae5d0 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/InitializePolicyContextStep.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/InitializePolicyContextStep.java @@ -68,7 +68,7 @@ public ClusterState performAction(Index index, ClusterState clusterState) { indexMetadataBuilder.putCustom(ILM_CUSTOM_METADATA_KEY, newCustomData.build().asMap()); newClusterStateBuilder.metadata( - Metadata.builder(clusterState.getMetadata()).put(indexMetadataBuilder) + Metadata.builder(clusterState.getMetadata()).put(indexMetadataBuilder).build(false) ); return newClusterStateBuilder.build(); } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/PhaseCacheManagement.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/PhaseCacheManagement.java index 601aab492d5b2..cd085e736f7b6 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/PhaseCacheManagement.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/PhaseCacheManagement.java @@ -51,7 +51,7 @@ public static ClusterState refreshPhaseDefinition(final ClusterState state, fina final IndexMetadata idxMeta = state.metadata().index(index); Metadata.Builder metadataBuilder = Metadata.builder(state.metadata()); refreshPhaseDefinition(metadataBuilder, idxMeta, updatedPolicy); - return ClusterState.builder(state).metadata(metadataBuilder).build(); + return ClusterState.builder(state).metadata(metadataBuilder.build(false)).build(); } /** @@ -109,7 +109,7 @@ public static ClusterState updateIndicesForPolicy(final ClusterState state, fina final LifecyclePolicyMetadata newPolicy, XPackLicenseState licenseState) { Metadata.Builder mb = Metadata.builder(state.metadata()); if (updateIndicesForPolicy(mb, state, xContentRegistry, client, oldPolicy, newPolicy, licenseState)) { - return ClusterState.builder(state).metadata(mb).build(); + return ClusterState.builder(state).metadata(mb.build(false)).build(); } return state; } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/ReplaceDataStreamBackingIndexStep.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/ReplaceDataStreamBackingIndexStep.java index c1fc7f85ba65b..89e49038b1dd7 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/ReplaceDataStreamBackingIndexStep.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/ReplaceDataStreamBackingIndexStep.java @@ -97,7 +97,7 @@ public ClusterState performAction(Index index, ClusterState clusterState) { Metadata.Builder newMetaData = Metadata.builder(clusterState.getMetadata()) .put(dataStream.getDataStream().replaceBackingIndex(index, targetIndexMetadata.getIndex())); - return ClusterState.builder(clusterState).metadata(newMetaData).build(); + return ClusterState.builder(clusterState).metadata(newMetaData.build(false)).build(); } @Override diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/UpdateRolloverLifecycleDateStep.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/UpdateRolloverLifecycleDateStep.java index 1aecedfdc5ae9..cc942fec2a453 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/UpdateRolloverLifecycleDateStep.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/UpdateRolloverLifecycleDateStep.java @@ -70,7 +70,7 @@ public ClusterState performAction(Index index, ClusterState currentState) { IndexMetadata.Builder newIndexMetadata = IndexMetadata.builder(indexMetadata); newIndexMetadata.putCustom(ILM_CUSTOM_METADATA_KEY, newLifecycleState.build().asMap()); return ClusterState.builder(currentState).metadata(Metadata.builder(currentState.metadata()) - .put(newIndexMetadata)).build(); + .put(newIndexMetadata).build(false)).build(); } private static String getRolloverTarget(Index index, ClusterState currentState) { diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycleRunner.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycleRunner.java index cb6f4a45faef3..4e8a137cce29c 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycleRunner.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycleRunner.java @@ -67,6 +67,8 @@ class IndexLifecycleRunner { builder.failure(task, e); } } + // Trigger indices lookup creation and related validation + state.metadata().getIndicesLookup(); return builder.build(state); }; diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycleTransition.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycleTransition.java index b738a5415201d..b0eae7d490286 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycleTransition.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycleTransition.java @@ -344,7 +344,8 @@ public static ClusterState.Builder newClusterStateWithLifecycleState(Index index ClusterState.Builder newClusterStateBuilder = ClusterState.builder(clusterState); newClusterStateBuilder.metadata(Metadata.builder(clusterState.getMetadata()) .put(IndexMetadata.builder(clusterState.getMetadata().index(index)) - .putCustom(ILM_CUSTOM_METADATA_KEY, lifecycleState.asMap()))); + .putCustom(ILM_CUSTOM_METADATA_KEY, lifecycleState.asMap())) + .build(false)); return newClusterStateBuilder; } From de97cb72cc274865bcc5b22454781819321dbe8b Mon Sep 17 00:00:00 2001 From: David Turner Date: Thu, 7 Oct 2021 14:02:45 +0100 Subject: [PATCH 225/250] Revert "Adjust /_cat/templates not to request all metadata (#78812)" This reverts commit b07dbe52caca7ad86e6ee5a4ea75a181f9af22ac. --- .../test/cat.templates/20_matching.yml | 179 ------------------ .../rest/action/cat/RestTemplatesAction.java | 140 ++++---------- 2 files changed, 35 insertions(+), 284 deletions(-) delete mode 100644 rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/cat.templates/20_matching.yml diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/cat.templates/20_matching.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/cat.templates/20_matching.yml deleted file mode 100644 index 0ee0cd3fb4af2..0000000000000 --- a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/cat.templates/20_matching.yml +++ /dev/null @@ -1,179 +0,0 @@ -setup: - - do: - indices.put_template: - name: test-legacy-1 - body: - order: 12 - version: 3 - index_patterns: foo* - - - do: - indices.put_template: - name: test-legacy-2 - body: - order: 45 - version: 6 - index_patterns: - - bar* - - baz* - - - do: - cluster.put_component_template: - name: test-component-template - body: - template: - settings: - number_of_shards: 1 - number_of_replicas: 0 - - - do: - indices.put_index_template: - name: test-composable-1 - body: - index_patterns: - - quux* - priority: 78 - version: 9 - composed_of: - - test-component-template - - - do: - indices.put_index_template: - name: test-composable-2 - body: - index_patterns: - - gruly* - priority: 99 - version: 1 - composed_of: - - test-component-template - ---- -"Matching all templates": - - - do: - cat.templates: - h: [name] - s: [name] - - - match: - $body: /test-composable-1\ntest-composable-2\ntest-legacy-1\ntest-legacy-2\n/ - - - do: - cat.templates: - name: "*" - h: [name] - s: [name] - - - match: - $body: /test-composable-1\ntest-composable-2\ntest-legacy-1\ntest-legacy-2\n/ - ---- -"Matching all templates with other patterns": - - skip: - version: " - 7.99.99" - reason: "support for multiple patterns added in 8.0.0" - - - do: - cat.templates: - name: "nonexistent*,*,other-name" - h: [name] - s: [name] - - - match: - $body: /test-composable-1\ntest-composable-2\ntest-legacy-1\ntest-legacy-2\n/ - ---- -"Matching no templates": - - - do: - cat.templates: - name: "nonexistent" - h: [name] - s: [name] - - - match: - $body: /^$/ - ---- -"Matching single names": - - - do: - cat.templates: - name: "test-legacy-1" - h: [name] - s: [name] - - - match: - $body: /^test-legacy-1\n$/ - - - - do: - cat.templates: - name: "test-composable-2" - h: [name] - s: [name] - - - match: - $body: /^test-composable-2\n$/ - ---- -"Matching single patterns": - - - do: - cat.templates: - name: "test-legacy-*" - h: [name] - s: [name] - - - match: - $body: /^test-legacy-1\ntest-legacy-2\n$/ - - - - do: - cat.templates: - name: "test-*-2" - h: [name] - s: [name] - - - match: - $body: /^test-composable-2\ntest-legacy-2\n$/ - ---- -"Matching lists of names": - - skip: - version: " - 7.99.99" - reason: "support for multiple patterns added in 8.0.0" - - - do: - cat.templates: - name: "test-legacy-1,test-composable-2" - h: [name] - s: [name] - - - match: - $body: /^test-composable-2\ntest-legacy-1\n$/ - ---- -"Matching names and wildcards": - - skip: - version: " - 7.99.99" - reason: "support for multiple patterns added in 8.0.0" - - - do: - cat.templates: - name: "test-legacy-1,test-composable-*" - h: [name] - s: [name] - - - match: - $body: /^test-composable-1\ntest-composable-2\ntest-legacy-1\n$/ - - - do: - cat.templates: - name: "test-legacy-*,test-composable-2" - h: [name] - s: [name] - - - match: - $body: /^test-composable-2\ntest-legacy-1\ntest-legacy-2\n$/ diff --git a/server/src/main/java/org/elasticsearch/rest/action/cat/RestTemplatesAction.java b/server/src/main/java/org/elasticsearch/rest/action/cat/RestTemplatesAction.java index ba24839e10f9c..c4785df10d310 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/cat/RestTemplatesAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/cat/RestTemplatesAction.java @@ -8,27 +8,21 @@ package org.elasticsearch.rest.action.cat; -import org.elasticsearch.action.ActionListener; -import org.elasticsearch.action.StepListener; -import org.elasticsearch.action.admin.indices.template.get.GetComposableIndexTemplateAction; -import org.elasticsearch.action.admin.indices.template.get.GetIndexTemplatesRequest; -import org.elasticsearch.action.admin.indices.template.get.GetIndexTemplatesResponse; +import com.carrotsearch.hppc.cursors.ObjectObjectCursor; +import org.elasticsearch.action.admin.cluster.state.ClusterStateRequest; +import org.elasticsearch.action.admin.cluster.state.ClusterStateResponse; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.cluster.metadata.ComposableIndexTemplate; import org.elasticsearch.cluster.metadata.IndexTemplateMetadata; -import org.elasticsearch.common.Strings; +import org.elasticsearch.cluster.metadata.ComposableIndexTemplate; +import org.elasticsearch.cluster.metadata.Metadata; import org.elasticsearch.common.Table; import org.elasticsearch.common.regex.Regex; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.RestResponse; import org.elasticsearch.rest.action.RestResponseListener; -import java.util.ArrayList; -import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Set; -import java.util.function.Predicate; import static org.elasticsearch.rest.RestRequest.Method.GET; @@ -53,43 +47,18 @@ protected void documentation(StringBuilder sb) { @Override protected RestChannelConsumer doCatRequest(final RestRequest request, NodeClient client) { - final String[] templateNames = Strings.splitStringByCommaToArray(request.param("name", "")); - - final GetIndexTemplatesRequest getIndexTemplatesRequest = new GetIndexTemplatesRequest(templateNames); - getIndexTemplatesRequest.local(request.paramAsBoolean("local", getIndexTemplatesRequest.local())); - getIndexTemplatesRequest.masterNodeTimeout(request.paramAsTime("master_timeout", getIndexTemplatesRequest.masterNodeTimeout())); - - final GetComposableIndexTemplateAction.Request getComposableTemplatesRequest - = new GetComposableIndexTemplateAction.Request(); - getComposableTemplatesRequest.local(request.paramAsBoolean("local", getComposableTemplatesRequest.local())); - getComposableTemplatesRequest.masterNodeTimeout( - request.paramAsTime("master_timeout", getComposableTemplatesRequest.masterNodeTimeout())); - - return channel -> { - - final StepListener getIndexTemplatesStep = new StepListener<>(); - client.admin().indices().getTemplates(getIndexTemplatesRequest, getIndexTemplatesStep); - - final StepListener getComposableTemplatesStep = new StepListener<>(); - client.execute(GetComposableIndexTemplateAction.INSTANCE, getComposableTemplatesRequest, getComposableTemplatesStep); - - final ActionListener
    tableListener = new RestResponseListener<>(channel) { - @Override - public RestResponse buildResponse(Table table) throws Exception { - return RestTable.buildResponse(table, channel); - } - }; - - getIndexTemplatesStep.whenComplete(getIndexTemplatesResponse -> - getComposableTemplatesStep.whenComplete(getComposableIndexTemplatesResponse -> - ActionListener.completeWith(tableListener, () -> buildTable( - request, - getIndexTemplatesResponse, - getComposableIndexTemplatesResponse, - templateNames) - ), tableListener::onFailure - ), tableListener::onFailure); - }; + final String matchPattern = request.hasParam("name") ? request.param("name") : null; + final ClusterStateRequest clusterStateRequest = new ClusterStateRequest(); + clusterStateRequest.clear().metadata(true); + clusterStateRequest.local(request.paramAsBoolean("local", clusterStateRequest.local())); + clusterStateRequest.masterNodeTimeout(request.paramAsTime("master_timeout", clusterStateRequest.masterNodeTimeout())); + + return channel -> client.admin().cluster().state(clusterStateRequest, new RestResponseListener(channel) { + @Override + public RestResponse buildResponse(ClusterStateResponse clusterStateResponse) throws Exception { + return RestTable.buildResponse(buildTable(request, clusterStateResponse, matchPattern), channel); + } + }); } @Override @@ -105,30 +74,26 @@ protected Table getTableWithHeader(RestRequest request) { return table; } - private Table buildTable( - RestRequest request, - GetIndexTemplatesResponse getIndexTemplatesResponse, - GetComposableIndexTemplateAction.Response getComposableIndexTemplatesResponse, - String[] requestedNames - ) { - final Predicate namePredicate = getNamePredicate(requestedNames); - - final Table table = getTableWithHeader(request); - for (IndexTemplateMetadata indexData : getIndexTemplatesResponse.getIndexTemplates()) { - assert namePredicate.test(indexData.getName()); - table.startRow(); - table.addCell(indexData.name()); - table.addCell("[" + String.join(", ", indexData.patterns()) + "]"); - table.addCell(indexData.getOrder()); - table.addCell(indexData.getVersion()); - table.addCell(""); - table.endRow(); + private Table buildTable(RestRequest request, ClusterStateResponse clusterStateResponse, String patternString) { + Table table = getTableWithHeader(request); + Metadata metadata = clusterStateResponse.getState().metadata(); + for (ObjectObjectCursor entry : metadata.templates()) { + IndexTemplateMetadata indexData = entry.value; + if (patternString == null || Regex.simpleMatch(patternString, indexData.name())) { + table.startRow(); + table.addCell(indexData.name()); + table.addCell("[" + String.join(", ", indexData.patterns()) + "]"); + table.addCell(indexData.getOrder()); + table.addCell(indexData.getVersion()); + table.addCell(""); + table.endRow(); + } } - for (Map.Entry entry : getComposableIndexTemplatesResponse.indexTemplates().entrySet()) { - final String name = entry.getKey(); - if (namePredicate.test(name)) { - final ComposableIndexTemplate template = entry.getValue(); + for (Map.Entry entry : metadata.templatesV2().entrySet()) { + String name = entry.getKey(); + ComposableIndexTemplate template = entry.getValue(); + if (patternString == null || Regex.simpleMatch(patternString, name)) { table.startRow(); table.addCell(name); table.addCell("[" + String.join(", ", template.indexPatterns()) + "]"); @@ -138,41 +103,6 @@ private Table buildTable( table.endRow(); } } - return table; } - - private Predicate getNamePredicate(String[] requestedNames) { - if (requestedNames.length == 0) { - return name -> true; - } - - final Set exactMatches = new HashSet<>(); - final List patterns = new ArrayList<>(); - for (String requestedName : requestedNames) { - if (Regex.isMatchAllPattern(requestedName)) { - return name -> true; - } else if (Regex.isSimpleMatchPattern(requestedName)) { - patterns.add(requestedName); - } else { - exactMatches.add(requestedName); - } - } - - if (patterns.isEmpty()) { - return exactMatches::contains; - } - - return name -> { - if (exactMatches.contains(name)) { - return true; - } - for (String pattern : patterns) { - if (Regex.simpleMatch(pattern, name)) { - return true; - } - } - return false; - }; - } } From f8793c6a0c4a4783a3bcdbdb5303a408e796ffb3 Mon Sep 17 00:00:00 2001 From: Henning Andersen <33268011+henningandersen@users.noreply.github.com> Date: Thu, 7 Oct 2021 17:18:22 +0200 Subject: [PATCH 226/250] Enable exit on out of memory error (#71542) Rather than rely on ElasticsearchUncaughtExceptionHandler, it is safer to use the JVM's built-in support for terminating the process on OOM. --- distribution/src/config/jvm.options | 4 ++++ test/external-modules/die-with-dignity/build.gradle | 3 +++ 2 files changed, 7 insertions(+) diff --git a/distribution/src/config/jvm.options b/distribution/src/config/jvm.options index 7a5422219e832..1e57ad6b3a542 100644 --- a/distribution/src/config/jvm.options +++ b/distribution/src/config/jvm.options @@ -71,6 +71,10 @@ # specified -XX:+HeapDumpOnOutOfMemoryError +# exit right after heap dump on out of memory error. Recommended to also use +# on java 8 for supported versions (8u92+). +9-:-XX:+ExitOnOutOfMemoryError + # specify an alternative path for heap dumps; ensure the directory exists and # has sufficient space @heap.dump.path@ diff --git a/test/external-modules/die-with-dignity/build.gradle b/test/external-modules/die-with-dignity/build.gradle index dc79a6f0275e1..3466b7bb24adc 100644 --- a/test/external-modules/die-with-dignity/build.gradle +++ b/test/external-modules/die-with-dignity/build.gradle @@ -22,6 +22,9 @@ tasks.named("javaRestTest").configure { testClusters.matching { it.name == "javaRestTest" }.configureEach { systemProperty "die.with.dignity.test", "true" + // disable exit on out of memory error to let DieWithDignityIT verify that OOM handling without that works (including OOMs that are not caused by + // memory like native threads. We leave it to the JVM to test that exit on OOM works via the flag. + jvmArgs '-XX:-ExitOnOutOfMemoryError' } tasks.named("test").configure { From bcd75c320397f5dba597a9e86d29fa11735abc27 Mon Sep 17 00:00:00 2001 From: Lisa Cawley Date: Thu, 7 Oct 2021 08:34:58 -0700 Subject: [PATCH 227/250] [DOCS] Fixes ML get scheduled events API (#78809) --- .../apis/get-calendar-event.asciidoc | 48 ++++++++++++++++--- 1 file changed, 42 insertions(+), 6 deletions(-) diff --git a/docs/reference/ml/anomaly-detection/apis/get-calendar-event.asciidoc b/docs/reference/ml/anomaly-detection/apis/get-calendar-event.asciidoc index a349f3c018c77..0c44376d33d10 100644 --- a/docs/reference/ml/anomaly-detection/apis/get-calendar-event.asciidoc +++ b/docs/reference/ml/anomaly-detection/apis/get-calendar-event.asciidoc @@ -26,8 +26,8 @@ Requires the `monitor_ml` cluster privilege. This privilege is included in the You can get scheduled event information for multiple calendars in a single API request by using a comma-separated list of ids or a wildcard expression. -You can get scheduled event information for all calendars by using `_all`, -by specifying `*` as the ``, or by omitting the ``. +You can get scheduled event information for all calendars by using `_all` or `*` +as the ``. For more information, see {ml-docs}/ml-ad-finding-anomalies.html#ml-ad-calendars[Calendars and scheduled events]. @@ -39,6 +39,28 @@ For more information, see (Required, string) include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=calendar-id] +[[ml-get-calendar-event-query-parms]] +== {api-query-parms-title} + +`end`:: + (Optional, string) Specifies to get events with timestamps earlier than this + time. + +`from`:: + (Optional, integer) Skips the specified number of events. Defaults to `0`. + +`job_id`:: + (Optional, string) Specifies to get events for a specific {anomaly-job} + identifier or job group. It must be used with a calendar identifier of `_all` + or `*`. + +`size`:: + (Optional, integer) Specifies the maximum number of events to obtain. Defaults + to `100`. + +`start`:: + (Optional, string) Specifies to get events with timestamps after this time. + [[ml-get-calendar-event-request-body]] == {api-request-body-title} @@ -47,17 +69,22 @@ include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=calendar-id] time. Defaults to unset, which means results are not limited to specific timestamps. -`from`:: +`job_id`:: + (Optional, string) Specifies to get events for a specific {anomaly-job} + identifier or job group. It must be used with a calendar identifier of `_all` + or `*`. + +`page.from`:: (Optional, integer) Skips the specified number of events. Defaults to `0`. -`size`:: +`page.size`:: (Optional, integer) Specifies the maximum number of events to obtain. Defaults to `100`. `start`:: (Optional, string) Specifies to get events with timestamps after this time. - Defaults to unset, which means results are not limited to - specific timestamps. + Defaults to unset, which means results are not limited to specific + timestamps. [[ml-get-calendar-event-results]] == {api-response-body-title} @@ -126,3 +153,12 @@ The API returns the following results: // TESTRESPONSE[s/LS8LJGEBMTCMA-qz49st/$body.$_path/] // TESTRESPONSE[s/Li8LJGEBMTCMA-qz49st/$body.$_path/] // TESTRESPONSE[s/Ly8LJGEBMTCMA-qz49st/$body.$_path/] + +The following example retrieves scheduled events that occur within a specific +period of time: + +[source,console] +-------------------------------------------------- +GET _ml/*/planned-outages/events?start=1635638400000&end=1635724800000 +-------------------------------------------------- +// TEST[skip:setup:calendar_outages_addevent] \ No newline at end of file From 5823ad695de79992d117e4e9ab8a6e3cd617831e Mon Sep 17 00:00:00 2001 From: David Turner Date: Thu, 7 Oct 2021 16:43:25 +0100 Subject: [PATCH 228/250] Adjust /_cat/templates not to request all metadata (#78829) Today `GET /_cat/templates` retrieves the whole cluster metadata from the master, which includes all sorts of unnecessary junk and consumes significant resources. This commit reimplements these endpoints using `GetIndexTemplatesAction` and `GetComposableIndexTemplateAction` which are much more efficient. The docs for this API indicate that it accepts a comma-separated list of template names/patterns of the form `GET /_cat/templates/name1,name2` but in fact today it only accepts a single name or pattern. This commit also adds support for multiple names/patterns as the docs claim. --- .../test/cat.templates/20_matching.yml | 186 ++++++++++++++++++ .../rest/action/cat/RestTemplatesAction.java | 140 +++++++++---- 2 files changed, 291 insertions(+), 35 deletions(-) create mode 100644 rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/cat.templates/20_matching.yml diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/cat.templates/20_matching.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/cat.templates/20_matching.yml new file mode 100644 index 0000000000000..9a0dfcffffdda --- /dev/null +++ b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/cat.templates/20_matching.yml @@ -0,0 +1,186 @@ +setup: + - skip: + features: + - "allowed_warnings_regex" + + - do: + indices.put_template: + name: test-legacy-1 + body: + order: 12 + version: 3 + index_patterns: foo* + + - do: + indices.put_template: + name: test-legacy-2 + body: + order: 45 + version: 6 + index_patterns: + - bar* + - baz* + + - do: + cluster.put_component_template: + name: test-component-template + body: + template: + settings: + number_of_shards: 1 + number_of_replicas: 0 + + - do: + indices.put_index_template: + name: test-composable-1 + body: + index_patterns: + - quux* + priority: 78 + version: 9 + composed_of: + - test-component-template + allowed_warnings_regex: + - ".*index template .* has index patterns .* matching patterns from existing older templates.*" + + - do: + indices.put_index_template: + name: test-composable-2 + body: + index_patterns: + - gruly* + priority: 99 + version: 1 + composed_of: + - test-component-template + allowed_warnings_regex: + - ".*index template .* has index patterns .* matching patterns from existing older templates.*" +--- +"Matching all templates": + + - do: + cat.templates: + h: [name] + s: [name] + + - match: + $body: /test-composable-1\ntest-composable-2\ntest-legacy-1\ntest-legacy-2\n/ + + - do: + cat.templates: + name: "*" + h: [name] + s: [name] + + - match: + $body: /test-composable-1\ntest-composable-2\ntest-legacy-1\ntest-legacy-2\n/ + +--- +"Matching all templates with other patterns": + - skip: + version: " - 7.99.99" + reason: "support for multiple patterns added in 8.0.0" + + - do: + cat.templates: + name: "nonexistent*,*,other-name" + h: [name] + s: [name] + + - match: + $body: /test-composable-1\ntest-composable-2\ntest-legacy-1\ntest-legacy-2\n/ + +--- +"Matching no templates": + + - do: + cat.templates: + name: "nonexistent" + h: [name] + s: [name] + + - match: + $body: /^$/ + +--- +"Matching single names": + + - do: + cat.templates: + name: "test-legacy-1" + h: [name] + s: [name] + + - match: + $body: /^test-legacy-1\n$/ + + + - do: + cat.templates: + name: "test-composable-2" + h: [name] + s: [name] + + - match: + $body: /^test-composable-2\n$/ + +--- +"Matching single patterns": + + - do: + cat.templates: + name: "test-legacy-*" + h: [name] + s: [name] + + - match: + $body: /^test-legacy-1\ntest-legacy-2\n$/ + + + - do: + cat.templates: + name: "test-*-2" + h: [name] + s: [name] + + - match: + $body: /^test-composable-2\ntest-legacy-2\n$/ + +--- +"Matching lists of names": + - skip: + version: " - 7.99.99" + reason: "support for multiple patterns added in 8.0.0" + + - do: + cat.templates: + name: "test-legacy-1,test-composable-2" + h: [name] + s: [name] + + - match: + $body: /^test-composable-2\ntest-legacy-1\n$/ + +--- +"Matching names and wildcards": + - skip: + version: " - 7.99.99" + reason: "support for multiple patterns added in 8.0.0" + + - do: + cat.templates: + name: "test-legacy-1,test-composable-*" + h: [name] + s: [name] + + - match: + $body: /^test-composable-1\ntest-composable-2\ntest-legacy-1\n$/ + + - do: + cat.templates: + name: "test-legacy-*,test-composable-2" + h: [name] + s: [name] + + - match: + $body: /^test-composable-2\ntest-legacy-1\ntest-legacy-2\n$/ diff --git a/server/src/main/java/org/elasticsearch/rest/action/cat/RestTemplatesAction.java b/server/src/main/java/org/elasticsearch/rest/action/cat/RestTemplatesAction.java index c4785df10d310..ba24839e10f9c 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/cat/RestTemplatesAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/cat/RestTemplatesAction.java @@ -8,21 +8,27 @@ package org.elasticsearch.rest.action.cat; -import com.carrotsearch.hppc.cursors.ObjectObjectCursor; -import org.elasticsearch.action.admin.cluster.state.ClusterStateRequest; -import org.elasticsearch.action.admin.cluster.state.ClusterStateResponse; +import org.elasticsearch.action.ActionListener; +import org.elasticsearch.action.StepListener; +import org.elasticsearch.action.admin.indices.template.get.GetComposableIndexTemplateAction; +import org.elasticsearch.action.admin.indices.template.get.GetIndexTemplatesRequest; +import org.elasticsearch.action.admin.indices.template.get.GetIndexTemplatesResponse; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.cluster.metadata.IndexTemplateMetadata; import org.elasticsearch.cluster.metadata.ComposableIndexTemplate; -import org.elasticsearch.cluster.metadata.Metadata; +import org.elasticsearch.cluster.metadata.IndexTemplateMetadata; +import org.elasticsearch.common.Strings; import org.elasticsearch.common.Table; import org.elasticsearch.common.regex.Regex; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.RestResponse; import org.elasticsearch.rest.action.RestResponseListener; +import java.util.ArrayList; +import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Set; +import java.util.function.Predicate; import static org.elasticsearch.rest.RestRequest.Method.GET; @@ -47,18 +53,43 @@ protected void documentation(StringBuilder sb) { @Override protected RestChannelConsumer doCatRequest(final RestRequest request, NodeClient client) { - final String matchPattern = request.hasParam("name") ? request.param("name") : null; - final ClusterStateRequest clusterStateRequest = new ClusterStateRequest(); - clusterStateRequest.clear().metadata(true); - clusterStateRequest.local(request.paramAsBoolean("local", clusterStateRequest.local())); - clusterStateRequest.masterNodeTimeout(request.paramAsTime("master_timeout", clusterStateRequest.masterNodeTimeout())); - - return channel -> client.admin().cluster().state(clusterStateRequest, new RestResponseListener(channel) { - @Override - public RestResponse buildResponse(ClusterStateResponse clusterStateResponse) throws Exception { - return RestTable.buildResponse(buildTable(request, clusterStateResponse, matchPattern), channel); - } - }); + final String[] templateNames = Strings.splitStringByCommaToArray(request.param("name", "")); + + final GetIndexTemplatesRequest getIndexTemplatesRequest = new GetIndexTemplatesRequest(templateNames); + getIndexTemplatesRequest.local(request.paramAsBoolean("local", getIndexTemplatesRequest.local())); + getIndexTemplatesRequest.masterNodeTimeout(request.paramAsTime("master_timeout", getIndexTemplatesRequest.masterNodeTimeout())); + + final GetComposableIndexTemplateAction.Request getComposableTemplatesRequest + = new GetComposableIndexTemplateAction.Request(); + getComposableTemplatesRequest.local(request.paramAsBoolean("local", getComposableTemplatesRequest.local())); + getComposableTemplatesRequest.masterNodeTimeout( + request.paramAsTime("master_timeout", getComposableTemplatesRequest.masterNodeTimeout())); + + return channel -> { + + final StepListener getIndexTemplatesStep = new StepListener<>(); + client.admin().indices().getTemplates(getIndexTemplatesRequest, getIndexTemplatesStep); + + final StepListener getComposableTemplatesStep = new StepListener<>(); + client.execute(GetComposableIndexTemplateAction.INSTANCE, getComposableTemplatesRequest, getComposableTemplatesStep); + + final ActionListener
    tableListener = new RestResponseListener<>(channel) { + @Override + public RestResponse buildResponse(Table table) throws Exception { + return RestTable.buildResponse(table, channel); + } + }; + + getIndexTemplatesStep.whenComplete(getIndexTemplatesResponse -> + getComposableTemplatesStep.whenComplete(getComposableIndexTemplatesResponse -> + ActionListener.completeWith(tableListener, () -> buildTable( + request, + getIndexTemplatesResponse, + getComposableIndexTemplatesResponse, + templateNames) + ), tableListener::onFailure + ), tableListener::onFailure); + }; } @Override @@ -74,26 +105,30 @@ protected Table getTableWithHeader(RestRequest request) { return table; } - private Table buildTable(RestRequest request, ClusterStateResponse clusterStateResponse, String patternString) { - Table table = getTableWithHeader(request); - Metadata metadata = clusterStateResponse.getState().metadata(); - for (ObjectObjectCursor entry : metadata.templates()) { - IndexTemplateMetadata indexData = entry.value; - if (patternString == null || Regex.simpleMatch(patternString, indexData.name())) { - table.startRow(); - table.addCell(indexData.name()); - table.addCell("[" + String.join(", ", indexData.patterns()) + "]"); - table.addCell(indexData.getOrder()); - table.addCell(indexData.getVersion()); - table.addCell(""); - table.endRow(); - } + private Table buildTable( + RestRequest request, + GetIndexTemplatesResponse getIndexTemplatesResponse, + GetComposableIndexTemplateAction.Response getComposableIndexTemplatesResponse, + String[] requestedNames + ) { + final Predicate namePredicate = getNamePredicate(requestedNames); + + final Table table = getTableWithHeader(request); + for (IndexTemplateMetadata indexData : getIndexTemplatesResponse.getIndexTemplates()) { + assert namePredicate.test(indexData.getName()); + table.startRow(); + table.addCell(indexData.name()); + table.addCell("[" + String.join(", ", indexData.patterns()) + "]"); + table.addCell(indexData.getOrder()); + table.addCell(indexData.getVersion()); + table.addCell(""); + table.endRow(); } - for (Map.Entry entry : metadata.templatesV2().entrySet()) { - String name = entry.getKey(); - ComposableIndexTemplate template = entry.getValue(); - if (patternString == null || Regex.simpleMatch(patternString, name)) { + for (Map.Entry entry : getComposableIndexTemplatesResponse.indexTemplates().entrySet()) { + final String name = entry.getKey(); + if (namePredicate.test(name)) { + final ComposableIndexTemplate template = entry.getValue(); table.startRow(); table.addCell(name); table.addCell("[" + String.join(", ", template.indexPatterns()) + "]"); @@ -103,6 +138,41 @@ private Table buildTable(RestRequest request, ClusterStateResponse clusterStateR table.endRow(); } } + return table; } + + private Predicate getNamePredicate(String[] requestedNames) { + if (requestedNames.length == 0) { + return name -> true; + } + + final Set exactMatches = new HashSet<>(); + final List patterns = new ArrayList<>(); + for (String requestedName : requestedNames) { + if (Regex.isMatchAllPattern(requestedName)) { + return name -> true; + } else if (Regex.isSimpleMatchPattern(requestedName)) { + patterns.add(requestedName); + } else { + exactMatches.add(requestedName); + } + } + + if (patterns.isEmpty()) { + return exactMatches::contains; + } + + return name -> { + if (exactMatches.contains(name)) { + return true; + } + for (String pattern : patterns) { + if (Regex.simpleMatch(pattern, name)) { + return true; + } + } + return false; + }; + } } From f16a6990bbc57d26939dad0b3f5b90c5c083f1a7 Mon Sep 17 00:00:00 2001 From: Rene Groeschke Date: Thu, 7 Oct 2021 18:00:21 +0200 Subject: [PATCH 229/250] Wrap VersionPropertiesLoader in a BuildService to decouple build logic projects (#78704) By using a BuildService we can decouple the configuration of projects but keep making expensive operations (e.g. parsing properties file or reading minimumJavaCompiler from file) only once per build. This bring us closer to decouple projects and get ultimatively configuration cache compliant. In general we will bring in more BuildServices for the main build to follow along that Pattern and ultimatevely remove usages of allprojects and subprojects in our build. --- build-conventions/build.gradle | 4 ++ .../VersionPropertiesBuildService.java | 67 +++++++++++++++++++ .../conventions/VersionPropertiesPlugin.java | 38 +++++++++++ build-tools-internal/build.gradle | 22 +++--- build-tools/build.gradle | 32 ++++----- build-tools/reaper/build.gradle | 7 ++ build.gradle | 1 + 7 files changed, 141 insertions(+), 30 deletions(-) create mode 100644 build-conventions/src/main/java/org/elasticsearch/gradle/internal/conventions/VersionPropertiesBuildService.java create mode 100644 build-conventions/src/main/java/org/elasticsearch/gradle/internal/conventions/VersionPropertiesPlugin.java diff --git a/build-conventions/build.gradle b/build-conventions/build.gradle index c6bfe397e58cf..a3c1dddf73e7d 100644 --- a/build-conventions/build.gradle +++ b/build-conventions/build.gradle @@ -45,6 +45,10 @@ gradlePlugin { id = 'elasticsearch.build-tools' implementationClass = 'org.elasticsearch.gradle.internal.conventions.BuildToolsConventionsPlugin' } + versions { + id = 'elasticsearch.versions' + implementationClass = 'org.elasticsearch.gradle.internal.conventions.VersionPropertiesPlugin' + } } } diff --git a/build-conventions/src/main/java/org/elasticsearch/gradle/internal/conventions/VersionPropertiesBuildService.java b/build-conventions/src/main/java/org/elasticsearch/gradle/internal/conventions/VersionPropertiesBuildService.java new file mode 100644 index 0000000000000..aa9a632637cf9 --- /dev/null +++ b/build-conventions/src/main/java/org/elasticsearch/gradle/internal/conventions/VersionPropertiesBuildService.java @@ -0,0 +1,67 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.gradle.internal.conventions; + +import org.apache.commons.io.FileUtils; +import org.gradle.api.GradleException; +import org.gradle.api.JavaVersion; +import org.gradle.api.file.RegularFileProperty; +import org.gradle.api.provider.ProviderFactory; +import org.gradle.api.services.BuildService; +import org.gradle.api.services.BuildServiceParameters; +import org.gradle.initialization.layout.BuildLayout; +import org.gradle.initialization.layout.BuildLayoutFactory; + +import javax.inject.Inject; +import java.io.File; +import java.io.IOException; +import java.util.Properties; +import java.util.function.Function; + +abstract class VersionPropertiesBuildService implements BuildService, AutoCloseable { + + private final Properties properties; + + @Inject + public VersionPropertiesBuildService(ProviderFactory providerFactory) { + File infoPath = getParameters().getInfoPath().getAsFile().get(); + try { + File propertiesInputFile = new File(infoPath, "version.properties"); + properties = VersionPropertiesLoader.loadBuildSrcVersion(propertiesInputFile, providerFactory); + properties.computeIfAbsent("minimumJava", s -> resolveMinimumJavaVersion(infoPath)); + } catch (IOException e) { + throw new GradleException("Cannot load VersionPropertiesBuildService", e); + } + } + + private JavaVersion resolveMinimumJavaVersion(File infoPath) { + final JavaVersion minimumJavaVersion; + File minimumJavaInfoSource = new File(infoPath, "src/main/resources/minimumCompilerVersion"); + try { + String versionString = FileUtils.readFileToString(minimumJavaInfoSource); + minimumJavaVersion = JavaVersion.toVersion(versionString); + } catch (IOException e) { + throw new GradleException("Cannot resolve minimum compiler version via VersionPropertiesBuildService", e); + } + return minimumJavaVersion; + } + + public Properties getProperties() { + return properties; + } + + @Override + public void close() throws Exception { + } + + public interface Params extends BuildServiceParameters { + RegularFileProperty getInfoPath(); + } + +} diff --git a/build-conventions/src/main/java/org/elasticsearch/gradle/internal/conventions/VersionPropertiesPlugin.java b/build-conventions/src/main/java/org/elasticsearch/gradle/internal/conventions/VersionPropertiesPlugin.java new file mode 100644 index 0000000000000..685a7a276434d --- /dev/null +++ b/build-conventions/src/main/java/org/elasticsearch/gradle/internal/conventions/VersionPropertiesPlugin.java @@ -0,0 +1,38 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.gradle.internal.conventions; + +import org.gradle.api.Plugin; +import org.gradle.api.Project; +import org.gradle.api.provider.Provider; +import org.gradle.initialization.layout.BuildLayout; + +import javax.inject.Inject; +import java.io.File; + +public class VersionPropertiesPlugin implements Plugin { + + private BuildLayout buildLayout; + + @Inject + VersionPropertiesPlugin(BuildLayout buildLayout) { + this.buildLayout = buildLayout; + } + + @Override + public void apply(Project project) { + // Register the service if not done yet + File infoPath = new File(buildLayout.getRootDirectory(), "build-tools-internal"); + Provider serviceProvider = project.getGradle().getSharedServices() + .registerIfAbsent("versions", VersionPropertiesBuildService.class, spec -> { + spec.getParameters().getInfoPath().set(infoPath); + }); + project.getExtensions().add("versions", serviceProvider.forUseAtConfigurationTime().get().getProperties()); + } +} diff --git a/build-tools-internal/build.gradle b/build-tools-internal/build.gradle index 83684976df81d..33046d6097c80 100644 --- a/build-tools-internal/build.gradle +++ b/build-tools-internal/build.gradle @@ -19,6 +19,7 @@ plugins { id 'groovy' id 'elasticsearch.build-tools' id 'elasticsearch.eclipse' + id 'elasticsearch.versions' } group = 'org.elasticsearch.gradle' @@ -26,8 +27,7 @@ group = 'org.elasticsearch.gradle' // we update the version property to reflect if we are building a snapshot or a release build // we write this back out below to load it in the Build.java which will be shown in rest main action // to indicate this being a snapshot build or a release build. -Properties props = VersionPropertiesLoader.loadBuildSrcVersion(project.file('version.properties'), project.getProviders()) -version = props.getProperty("elasticsearch") +version = versions.getProperty("elasticsearch") gradlePlugin { // We already configure publication and we don't need or want the one that comes @@ -169,7 +169,7 @@ gradlePlugin { * Java version * *****************************************************************************/ -def minCompilerJava = JavaVersion.toVersion(file('src/main/resources/minimumCompilerVersion').text) +def minCompilerJava = versions.get("minimumJava") targetCompatibility = minCompilerJava sourceCompatibility = minCompilerJava @@ -226,22 +226,22 @@ dependencies { api 'com.avast.gradle:gradle-docker-compose-plugin:0.14.0' api 'org.apache.maven:maven-model:3.6.2' api 'com.networknt:json-schema-validator:1.0.36' - api "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:${props.getProperty('jackson')}" + api "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:${versions.getProperty('jackson')}" api 'org.ow2.asm:asm:9.0' api 'org.ow2.asm:asm-tree:9.0' - api "org.apache.httpcomponents:httpclient:${props.getProperty('httpclient')}" - api "org.apache.httpcomponents:httpcore:${props.getProperty('httpcore')}" - compileOnly "com.puppycrawl.tools:checkstyle:${props.getProperty('checkstyle')}" + api "org.apache.httpcomponents:httpclient:${versions.getProperty('httpclient')}" + api "org.apache.httpcomponents:httpcore:${versions.getProperty('httpcore')}" + compileOnly "com.puppycrawl.tools:checkstyle:${versions.getProperty('checkstyle')}" runtimeOnly "org.elasticsearch.gradle:reaper:$version" - testImplementation "com.puppycrawl.tools:checkstyle:${props.getProperty('checkstyle')}" - testImplementation "junit:junit:${props.getProperty('junit')}" + testImplementation "com.puppycrawl.tools:checkstyle:${versions.getProperty('checkstyle')}" + testImplementation "junit:junit:${versions.getProperty('junit')}" testImplementation 'com.github.tomakehurst:wiremock-jre8-standalone:2.23.2' testImplementation 'org.mockito:mockito-core:1.9.5' - testImplementation "org.hamcrest:hamcrest:${props.getProperty('hamcrest')}" + testImplementation "org.hamcrest:hamcrest:${versions.getProperty('hamcrest')}" testImplementation testFixtures("org.elasticsearch.gradle:build-tools:$version") - integTestImplementation(platform("org.junit:junit-bom:${props.getProperty('junit5')}")) + integTestImplementation(platform("org.junit:junit-bom:${versions.getProperty('junit5')}")) integTestImplementation("org.junit.jupiter:junit-jupiter") { because 'allows to write and run Jupiter tests' } diff --git a/build-tools/build.gradle b/build-tools/build.gradle index ee2b54273c844..5ee1e777cb7d8 100644 --- a/build-tools/build.gradle +++ b/build-tools/build.gradle @@ -13,25 +13,16 @@ plugins { id 'java-test-fixtures' id 'elasticsearch.publish' id 'elasticsearch.build-tools' + id 'elasticsearch.eclipse' + id 'elasticsearch.versions' } description = "The elasticsearch build tools" -// we update the version property to reflect if we are building a snapshot or a release build -// we write this back out below to load it in the Build.java which will be shown in rest main action -// to indicate this being a snapshot build or a release build. -Properties props = VersionPropertiesLoader.loadBuildSrcVersion(project.file('../build-tools-internal/version.properties'), project.getProviders()) -def minRuntimeJava = JavaVersion.toVersion(file('../build-tools-internal/src/main/resources/minimumRuntimeVersion').text) - -allprojects { - group = "org.elasticsearch.gradle" - version = props.getProperty("elasticsearch") - - apply plugin: 'java' - apply plugin: 'elasticsearch.eclipse' - targetCompatibility = minRuntimeJava - sourceCompatibility = minRuntimeJava -} +group = "org.elasticsearch.gradle" +version = versions.getProperty("elasticsearch") +targetCompatibility = versions.get("minimumJava") +sourceCompatibility = versions.get("minimumJava") gradlePlugin { // We already configure publication and we don't need or want the one that comes @@ -69,10 +60,13 @@ gradlePlugin { } } +// we update the version property to reflect if we are building a snapshot or a release build +// we write this back out below to load it in the Build.java which will be shown in rest main action +// to indicate this being a snapshot build or a release build. def generateVersionProperties = tasks.register("generateVersionProperties", WriteProperties) { outputFile = "${buildDir}/version.properties" comment = 'Generated version properties' - properties(props) + properties(versions) } tasks.named("processResources").configure { @@ -118,8 +112,8 @@ dependencies { api 'org.apache.ant:ant:1.10.8' api 'commons-io:commons-io:2.2' - testFixturesApi "junit:junit:${props.getProperty('junit')}" - testFixturesApi "com.carrotsearch.randomizedtesting:randomizedtesting-runner:${props.getProperty('randomizedrunner')}" + testFixturesApi "junit:junit:${versions.getProperty('junit')}" + testFixturesApi "com.carrotsearch.randomizedtesting:randomizedtesting-runner:${versions.getProperty('randomizedrunner')}" testFixturesApi gradleApi() testFixturesApi gradleTestKit() testFixturesApi 'com.github.tomakehurst:wiremock-jre8-standalone:2.23.2' @@ -132,7 +126,7 @@ dependencies { because 'required as we rely on junit4 rules' } - integTestImplementation(platform("org.junit:junit-bom:${props.getProperty('junit5')}")) + integTestImplementation(platform("org.junit:junit-bom:${versions.getProperty('junit5')}")) integTestImplementation("org.junit.jupiter:junit-jupiter") { because 'allows to write and run Jupiter tests' } diff --git a/build-tools/reaper/build.gradle b/build-tools/reaper/build.gradle index 47f6d36cce2aa..90a82aac3eb95 100644 --- a/build-tools/reaper/build.gradle +++ b/build-tools/reaper/build.gradle @@ -1,7 +1,14 @@ plugins { id 'java' + id 'elasticsearch.eclipse' + id 'elasticsearch.versions' } +group = "org.elasticsearch.gradle" +version = versions.getProperty("elasticsearch") +targetCompatibility = versions.get("minimumJava") +sourceCompatibility = versions.get("minimumJava") + tasks.named("jar").configure { archiveFileName = "${project.name}.jar" manifest { diff --git a/build.gradle b/build.gradle index ae731b4e1d6e9..a6be800654390 100644 --- a/build.gradle +++ b/build.gradle @@ -46,6 +46,7 @@ plugins { id 'elasticsearch.internal-testclusters' id 'elasticsearch.run' id 'elasticsearch.release-tools' + id 'elasticsearch.versions' id "com.diffplug.spotless" version "5.15.1" apply false } From 6e875d0fa9be1345f1a6bc5337982d69363df470 Mon Sep 17 00:00:00 2001 From: Lee Hinman Date: Thu, 7 Oct 2021 10:07:46 -0600 Subject: [PATCH 230/250] Add node REPLACE shutdown implementation (#76247) * WIP, basic implementation * Pull `if` branch into a variable * Remove outdated javadoc * Remove map iteration, use target name instead of id (whoops) * Remove streaming from isReplacementSource * Simplify getReplacementName * Only calculate node shutdowns if canRemain==false and forceMove==false * Move canRebalance comment in BalancedShardsAllocator * Rename canForceDuringVacate -> canForceAllocateDuringReplace * Add comment to AwarenessAllocationDecider.canForceAllocateDuringReplace * Revert changes to ClusterRebalanceAllocationDecider * Change "no replacement" decision message in NodeReplacementAllocationDecider * Only construct shutdown map once in isReplacementSource * Make node shutdowns and target shutdowns available within RoutingAllocation * Add randomization for adding the filter that is overridden in test * Add integration test with replicas: 1 * Go nuts with the verbosity of allocation decisions * Also check NODE_C in unit test * Test with randomly assigned shard * Fix test for extra verbose decision messages * Remove canAllocate(IndexMetadat, RoutingNode, RoutingAllocation) overriding * Spotless :| * Implement 100% disk usage check during force-replace-allocate * Add rudimentary documentation for "replace" shutdown type * Use RoutingAllocation shutdown map in BalancedShardsAllocator * Add canForceAllocateDuringReplace to AllocationDeciders & add test * Switch from percentage to bytes in DiskThresholdDecider force check * Enhance docs with note about rollover, creation, & shrink * Clarify decision messages, add test for target-only allocation * Simplify NodeReplacementAllocationDecider.replacementOngoing * Start nodeC before nodeB in integration test * Spotleeeessssssss! You get me every time! * Remove outdated comment --- .../shutdown/apis/shutdown-put.asciidoc | 15 +- .../elasticsearch/cluster/ClusterModule.java | 4 +- .../metadata/SingleNodeShutdownMetadata.java | 3 +- .../routing/allocation/RoutingAllocation.java | 27 ++ .../allocator/BalancedShardsAllocator.java | 34 ++- .../allocation/decider/AllocationDecider.java | 18 ++ .../decider/AllocationDeciders.java | 19 ++ .../decider/AwarenessAllocationDecider.java | 8 + .../decider/DiskThresholdDecider.java | 27 ++ .../decider/EnableAllocationDecider.java | 4 +- .../decider/MaxRetryAllocationDecider.java | 5 + .../NodeReplacementAllocationDecider.java | 154 +++++++++++ .../decider/NodeVersionAllocationDecider.java | 5 + ...caAfterPrimaryActiveAllocationDecider.java | 5 + .../decider/ResizeAllocationDecider.java | 5 + .../RestoreInProgressAllocationDecider.java | 5 + .../decider/SameShardAllocationDecider.java | 5 + .../SnapshotInProgressAllocationDecider.java | 5 + .../decider/ThrottlingAllocationDecider.java | 5 + .../cluster/ClusterModuleTests.java | 2 + .../DiskThresholdDeciderUnitTests.java | 51 ++++ ...NodeReplacementAllocationDeciderTests.java | 237 ++++++++++++++++ .../cluster/ESAllocationTestCase.java | 4 + .../core/ilm/SetSingleNodeAllocateStep.java | 4 +- .../xpack/shutdown/NodeShutdownShardsIT.java | 259 +++++++++++++++++- ...TransportGetShutdownStatusActionTests.java | 61 +++-- 26 files changed, 928 insertions(+), 43 deletions(-) create mode 100644 server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/NodeReplacementAllocationDecider.java create mode 100644 server/src/test/java/org/elasticsearch/cluster/routing/allocation/decider/NodeReplacementAllocationDeciderTests.java diff --git a/docs/reference/shutdown/apis/shutdown-put.asciidoc b/docs/reference/shutdown/apis/shutdown-put.asciidoc index e4a5a3af73233..6d6c09fe93826 100644 --- a/docs/reference/shutdown/apis/shutdown-put.asciidoc +++ b/docs/reference/shutdown/apis/shutdown-put.asciidoc @@ -26,7 +26,7 @@ Migrates ongoing tasks and index shards to other nodes as needed to prepare a node to be restarted or shut down and removed from the cluster. This ensures that {es} can be stopped safely with minimal disruption to the cluster. -You must specify the type of shutdown: `restart` or `remove`. +You must specify the type of shutdown: `restart`, `remove`, or `replace`. If a node is already being prepared for shutdown, you can use this API to change the shutdown type. @@ -58,12 +58,16 @@ include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=timeoutparms] `type`:: (Required, string) -Valid values are `restart` and `remove`. +Valid values are `restart`, `remove`, or `replace`. Use `restart` when you need to temporarily shut down a node to perform an upgrade, make configuration changes, or perform other maintenance. Because the node is expected to rejoin the cluster, data is not migrated off of the node. Use `remove` when you need to permanently remove a node from the cluster. The node is not marked ready for shutdown until data is migrated off of the node +Use `replace` to do a 1:1 replacement of a node with another node. Certain allocation decisions will +be ignored (such as disk watermarks) in the interest of true replacement of the source node with the +target node. During a replace-type shutdown, rollover and index creation may result in unassigned +shards, and shrink may fail until the replacement is complete. `reason`:: (Required, string) @@ -76,6 +80,13 @@ it does not affect the shut down process. Only valid if `type` is `restart`. Controls how long {es} will wait for the node to restart and join the cluster before reassigning its shards to other nodes. This works the same as <> with the `index.unassigned.node_left.delayed_timeout` setting. If you specify both a restart allocation delay and an index-level allocation delay, the longer of the two is used. +`target_node_name`:: +(Optional, string) +Only valid if `type` is `replace`. Specifies the name of the node that is replacing the node being +shut down. Shards from the shut down node are only allowed to be allocated to the target node, and +no other data will be allocated to the target node. During relocation of data certain allocation +rules are ignored, such as disk watermarks or user attribute filtering rules. + [[put-shutdown-api-example]] ==== {api-examples-title} diff --git a/server/src/main/java/org/elasticsearch/cluster/ClusterModule.java b/server/src/main/java/org/elasticsearch/cluster/ClusterModule.java index a9678d2657e1b..3e068709f17df 100644 --- a/server/src/main/java/org/elasticsearch/cluster/ClusterModule.java +++ b/server/src/main/java/org/elasticsearch/cluster/ClusterModule.java @@ -38,6 +38,7 @@ import org.elasticsearch.cluster.routing.allocation.decider.EnableAllocationDecider; import org.elasticsearch.cluster.routing.allocation.decider.FilterAllocationDecider; import org.elasticsearch.cluster.routing.allocation.decider.MaxRetryAllocationDecider; +import org.elasticsearch.cluster.routing.allocation.decider.NodeReplacementAllocationDecider; import org.elasticsearch.cluster.routing.allocation.decider.NodeShutdownAllocationDecider; import org.elasticsearch.cluster.routing.allocation.decider.NodeVersionAllocationDecider; import org.elasticsearch.cluster.routing.allocation.decider.RebalanceOnlyWhenActiveAllocationDecider; @@ -49,7 +50,6 @@ import org.elasticsearch.cluster.routing.allocation.decider.SnapshotInProgressAllocationDecider; import org.elasticsearch.cluster.routing.allocation.decider.ThrottlingAllocationDecider; import org.elasticsearch.cluster.service.ClusterService; -import org.elasticsearch.common.xcontent.ParseField; import org.elasticsearch.common.inject.AbstractModule; import org.elasticsearch.common.io.stream.NamedWriteable; import org.elasticsearch.common.io.stream.NamedWriteableRegistry.Entry; @@ -60,6 +60,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.common.xcontent.ParseField; import org.elasticsearch.gateway.GatewayAllocator; import org.elasticsearch.indices.SystemIndices; import org.elasticsearch.ingest.IngestMetadata; @@ -202,6 +203,7 @@ public static Collection createAllocationDeciders(Settings se addAllocationDecider(deciders, new SnapshotInProgressAllocationDecider()); addAllocationDecider(deciders, new RestoreInProgressAllocationDecider()); addAllocationDecider(deciders, new NodeShutdownAllocationDecider()); + addAllocationDecider(deciders, new NodeReplacementAllocationDecider()); addAllocationDecider(deciders, new FilterAllocationDecider(settings, clusterSettings)); addAllocationDecider(deciders, new SameShardAllocationDecider(settings, clusterSettings)); addAllocationDecider(deciders, new DiskThresholdDecider(settings, clusterSettings)); diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/SingleNodeShutdownMetadata.java b/server/src/main/java/org/elasticsearch/cluster/metadata/SingleNodeShutdownMetadata.java index d2cf25f219303..ddd8e1bb2ad34 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/SingleNodeShutdownMetadata.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/SingleNodeShutdownMetadata.java @@ -12,6 +12,7 @@ import org.elasticsearch.Version; import org.elasticsearch.cluster.AbstractDiffable; import org.elasticsearch.cluster.Diffable; +import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.xcontent.ConstructingObjectParser; @@ -114,7 +115,7 @@ private SingleNodeShutdownMetadata( if (targetNodeName != null && type != Type.REPLACE) { throw new IllegalArgumentException(new ParameterizedMessage("target node name is only valid for REPLACE type shutdowns, " + "but was given type [{}] and target node name [{}]", type, targetNodeName).getFormattedMessage()); - } else if (targetNodeName == null && type == Type.REPLACE) { + } else if (Strings.hasText(targetNodeName) == false && type == Type.REPLACE) { throw new IllegalArgumentException("target node name is required for REPLACE type shutdowns"); } this.targetNodeName = targetNodeName; diff --git a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/RoutingAllocation.java b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/RoutingAllocation.java index 11200891051db..54b4d9d1da193 100644 --- a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/RoutingAllocation.java +++ b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/RoutingAllocation.java @@ -12,6 +12,7 @@ import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.RestoreInProgress; import org.elasticsearch.cluster.metadata.Metadata; +import org.elasticsearch.cluster.metadata.SingleNodeShutdownMetadata; import org.elasticsearch.cluster.node.DiscoveryNodes; import org.elasticsearch.cluster.routing.RoutingChangesObserver; import org.elasticsearch.cluster.routing.RoutingNodes; @@ -24,6 +25,7 @@ import org.elasticsearch.snapshots.RestoreService.RestoreInProgressUpdater; import org.elasticsearch.snapshots.SnapshotShardSizeInfo; +import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.Map; @@ -71,6 +73,9 @@ public class RoutingAllocation { nodesChangedObserver, indexMetadataUpdater, restoreInProgressUpdater ); + private final Map nodeShutdowns; + private final Map nodeReplacementTargets; + /** * Creates a new {@link RoutingAllocation} @@ -90,6 +95,14 @@ public RoutingAllocation(AllocationDeciders deciders, RoutingNodes routingNodes, this.clusterInfo = clusterInfo; this.shardSizeInfo = shardSizeInfo; this.currentNanoTime = currentNanoTime; + this.nodeShutdowns = metadata.nodeShutdowns(); + Map targetNameToShutdown = new HashMap<>(); + for (SingleNodeShutdownMetadata shutdown : this.nodeShutdowns.values()) { + if (shutdown.getType() == SingleNodeShutdownMetadata.Type.REPLACE) { + targetNameToShutdown.put(shutdown.getTargetNodeName(), shutdown); + } + } + this.nodeReplacementTargets = Collections.unmodifiableMap(targetNameToShutdown); } /** returns the nano time captured at the beginning of the allocation. used to make sure all time based decisions are aligned */ @@ -145,6 +158,20 @@ public SnapshotShardSizeInfo snapshotShardSizeInfo() { return shardSizeInfo; } + /** + * Returns the map of node id to shutdown metadata currently in the cluster + */ + public Map nodeShutdowns() { + return this.nodeShutdowns; + } + + /** + * Returns a map of target node name to replacement shutdown + */ + public Map replacementTargetShutdowns() { + return this.nodeReplacementTargets; + } + @SuppressWarnings("unchecked") public T custom(String key) { return (T) customs.get(key); diff --git a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/allocator/BalancedShardsAllocator.java b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/allocator/BalancedShardsAllocator.java index 0b223d0e69c3d..83366156a147e 100644 --- a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/allocator/BalancedShardsAllocator.java +++ b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/allocator/BalancedShardsAllocator.java @@ -14,6 +14,7 @@ import org.apache.lucene.util.IntroSorter; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.cluster.metadata.Metadata; +import org.elasticsearch.cluster.metadata.SingleNodeShutdownMetadata; import org.elasticsearch.cluster.routing.RoutingNode; import org.elasticsearch.cluster.routing.RoutingNodes; import org.elasticsearch.cluster.routing.ShardRouting; @@ -30,12 +31,12 @@ import org.elasticsearch.cluster.routing.allocation.decider.Decision; import org.elasticsearch.cluster.routing.allocation.decider.Decision.Type; import org.elasticsearch.cluster.routing.allocation.decider.DiskThresholdDecider; -import org.elasticsearch.core.Tuple; import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.settings.ClusterSettings; import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Setting.Property; import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.core.Tuple; import org.elasticsearch.gateway.PriorityComparator; import java.util.ArrayList; @@ -47,6 +48,7 @@ import java.util.List; import java.util.Map; import java.util.Set; +import java.util.function.BiFunction; import java.util.stream.StreamSupport; import static org.elasticsearch.cluster.routing.ShardRoutingState.RELOCATING; @@ -671,7 +673,6 @@ public MoveDecision decideMove(final ShardRouting shardRouting) { return MoveDecision.NOT_TAKEN; } - final boolean explain = allocation.debugDecision(); final ModelNode sourceNode = nodes.get(shardRouting.currentNodeId()); assert sourceNode != null && sourceNode.containsShard(shardRouting); RoutingNode routingNode = sourceNode.getRoutingNode(); @@ -687,6 +688,21 @@ public MoveDecision decideMove(final ShardRouting shardRouting) { * This is not guaranteed to be balanced after this operation we still try best effort to * allocate on the minimal eligible node. */ + MoveDecision moveDecision = decideMove(shardRouting, sourceNode, canRemain, this::decideCanAllocate); + if (moveDecision.canRemain() == false && moveDecision.forceMove() == false) { + final SingleNodeShutdownMetadata shutdown = allocation.nodeShutdowns().get(shardRouting.currentNodeId()); + final boolean shardsOnReplacedNode = shutdown != null && + shutdown.getType().equals(SingleNodeShutdownMetadata.Type.REPLACE); + if (shardsOnReplacedNode) { + return decideMove(shardRouting, sourceNode, canRemain, this::decideCanForceAllocateForVacate); + } + } + return moveDecision; + } + + private MoveDecision decideMove(ShardRouting shardRouting, ModelNode sourceNode, Decision remainDecision, + BiFunction decider) { + final boolean explain = allocation.debugDecision(); Type bestDecision = Type.NO; RoutingNode targetNode = null; final List nodeExplanationMap = explain ? new ArrayList<>() : null; @@ -694,8 +710,7 @@ public MoveDecision decideMove(final ShardRouting shardRouting) { for (ModelNode currentNode : sorter.modelNodes) { if (currentNode != sourceNode) { RoutingNode target = currentNode.getRoutingNode(); - // don't use canRebalance as we want hard filtering rules to apply. See #17698 - Decision allocationDecision = allocation.deciders().canAllocate(shardRouting, target, allocation); + Decision allocationDecision = decider.apply(shardRouting, target); if (explain) { nodeExplanationMap.add(new NodeAllocationResult( currentNode.getRoutingNode().node(), allocationDecision, ++weightRanking)); @@ -715,10 +730,19 @@ public MoveDecision decideMove(final ShardRouting shardRouting) { } } - return MoveDecision.cannotRemain(canRemain, AllocationDecision.fromDecisionType(bestDecision), + return MoveDecision.cannotRemain(remainDecision, AllocationDecision.fromDecisionType(bestDecision), targetNode != null ? targetNode.node() : null, nodeExplanationMap); } + private Decision decideCanAllocate(ShardRouting shardRouting, RoutingNode target) { + // don't use canRebalance as we want hard filtering rules to apply. See #17698 + return allocation.deciders().canAllocate(shardRouting, target, allocation); + } + + private Decision decideCanForceAllocateForVacate(ShardRouting shardRouting, RoutingNode target) { + return allocation.deciders().canForceAllocateDuringReplace(shardRouting, target, allocation); + } + /** * Builds the internal model from all shards in the given * {@link Iterable}. All shards in the {@link Iterable} must be assigned diff --git a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/AllocationDecider.java b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/AllocationDecider.java index af2a67b7d9b8d..5631fd2db78e0 100644 --- a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/AllocationDecider.java +++ b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/AllocationDecider.java @@ -104,4 +104,22 @@ public Decision canForceAllocatePrimary(ShardRouting shardRouting, RoutingNode n return decision; } } + + /** + * Returns a {@link Decision} whether the given shard can be forced to the + * given node in the event that the shard's source node is being replaced. + * This allows nodes using a replace-type node shutdown to + * override certain deciders in the interest of moving the shard away from + * a node that *must* be removed. + * + * It defaults to returning "YES" and must be overridden by deciders that + * opt-out to having their other NO decisions *not* overridden while vacating. + * + * The caller is responsible for first checking: + * - that a replacement is ongoing + * - the shard routing's current node is the source of the replacement + */ + public Decision canForceAllocateDuringReplace(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation) { + return Decision.YES; + } } diff --git a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/AllocationDeciders.java b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/AllocationDeciders.java index 7ea06bb119047..5f5f361ec5c19 100644 --- a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/AllocationDeciders.java +++ b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/AllocationDeciders.java @@ -212,6 +212,25 @@ public Decision canForceAllocatePrimary(ShardRouting shardRouting, RoutingNode n return ret; } + @Override + public Decision canForceAllocateDuringReplace(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation) { + Decision.Multi ret = new Decision.Multi(); + for (AllocationDecider allocationDecider : allocations) { + Decision decision = allocationDecider.canForceAllocateDuringReplace(shardRouting, node, allocation); + // short track if a NO is returned. + if (decision.type() == Decision.Type.NO) { + if (allocation.debugDecision() == false) { + return Decision.NO; + } else { + ret.add(decision); + } + } else { + addDecision(ret, decision, allocation); + } + } + return ret; + } + private void addDecision(Decision.Multi ret, Decision decision, RoutingAllocation allocation) { // We never add ALWAYS decisions and only add YES decisions when requested by debug mode (since Multi default is YES). if (decision != Decision.ALWAYS diff --git a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/AwarenessAllocationDecider.java b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/AwarenessAllocationDecider.java index d59e215161bb7..41093ec8da0b7 100644 --- a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/AwarenessAllocationDecider.java +++ b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/AwarenessAllocationDecider.java @@ -120,6 +120,14 @@ public Decision canAllocate(ShardRouting shardRouting, RoutingNode node, Routing return underCapacity(shardRouting, node, allocation, true); } + @Override + public Decision canForceAllocateDuringReplace(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation) { + // We need to meet the criteria for shard awareness even during a replacement so that all + // copies of a shard do not get allocated to the same host/rack/AZ, so this explicitly + // checks the awareness 'canAllocate' to ensure we don't violate that constraint. + return canAllocate(shardRouting, node, allocation); + } + @Override public Decision canRemain(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation) { return underCapacity(shardRouting, node, allocation, false); diff --git a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/DiskThresholdDecider.java b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/DiskThresholdDecider.java index 5f8bf439e2960..97b7d3a24d21f 100644 --- a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/DiskThresholdDecider.java +++ b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/DiskThresholdDecider.java @@ -317,6 +317,33 @@ public Decision canAllocate(ShardRouting shardRouting, RoutingNode node, Routing new ByteSizeValue(freeBytesAfterShard)); } + @Override + public Decision canForceAllocateDuringReplace(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation) { + ImmutableOpenMap usages = allocation.clusterInfo().getNodeMostAvailableDiskUsages(); + final Decision decision = earlyTerminate(allocation, usages); + if (decision != null) { + return decision; + } + + if (allocation.metadata().index(shardRouting.index()).ignoreDiskWatermarks()) { + return YES_DISK_WATERMARKS_IGNORED; + } + + final DiskUsageWithRelocations usage = getDiskUsage(node, allocation, usages, false); + final long shardSize = getExpectedShardSize(shardRouting, 0L, + allocation.clusterInfo(), allocation.snapshotShardSizeInfo(), allocation.metadata(), allocation.routingTable()); + assert shardSize >= 0 : shardSize; + final long freeBytesAfterShard = usage.getFreeBytes() - shardSize; + if (freeBytesAfterShard < 0) { + return Decision.single(Decision.Type.NO, NAME, + "unable to force allocate shard to [%s] during replacement, " + + "as allocating to this node would cause disk usage to exceed 100%% ([%s] bytes above available disk space)", + node.nodeId(), -freeBytesAfterShard); + } else { + return super.canForceAllocateDuringReplace(shardRouting, node, allocation); + } + } + private static final Decision YES_NOT_MOST_UTILIZED_DISK = Decision.single(Decision.Type.YES, NAME, "this shard is not allocated on the most utilized disk and can remain"); diff --git a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/EnableAllocationDecider.java b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/EnableAllocationDecider.java index 329775afaf0b7..455e26a1f6096 100644 --- a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/EnableAllocationDecider.java +++ b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/EnableAllocationDecider.java @@ -8,8 +8,6 @@ package org.elasticsearch.cluster.routing.allocation.decider; -import java.util.Locale; - import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.cluster.routing.RecoverySource; import org.elasticsearch.cluster.routing.RoutingNode; @@ -20,6 +18,8 @@ import org.elasticsearch.common.settings.Setting.Property; import org.elasticsearch.common.settings.Settings; +import java.util.Locale; + /** * This allocation decider allows shard allocations / rebalancing via the cluster wide settings * {@link #CLUSTER_ROUTING_ALLOCATION_ENABLE_SETTING} / {@link #CLUSTER_ROUTING_REBALANCE_ENABLE_SETTING} and the per index setting diff --git a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/MaxRetryAllocationDecider.java b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/MaxRetryAllocationDecider.java index ff76a1f3f1bdf..46c7b80f70536 100644 --- a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/MaxRetryAllocationDecider.java +++ b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/MaxRetryAllocationDecider.java @@ -73,4 +73,9 @@ public Decision canForceAllocatePrimary(ShardRouting shardRouting, RoutingNode n // if so, we don't want to force the primary allocation here return canAllocate(shardRouting, node, allocation); } + + @Override + public Decision canForceAllocateDuringReplace(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation) { + return canAllocate(shardRouting, node, allocation); + } } diff --git a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/NodeReplacementAllocationDecider.java b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/NodeReplacementAllocationDecider.java new file mode 100644 index 0000000000000..623838bd64b81 --- /dev/null +++ b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/NodeReplacementAllocationDecider.java @@ -0,0 +1,154 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.cluster.routing.allocation.decider; + +import org.elasticsearch.cluster.metadata.IndexMetadata; +import org.elasticsearch.cluster.metadata.SingleNodeShutdownMetadata; +import org.elasticsearch.cluster.node.DiscoveryNode; +import org.elasticsearch.cluster.routing.RoutingNode; +import org.elasticsearch.cluster.routing.ShardRouting; +import org.elasticsearch.cluster.routing.allocation.RoutingAllocation; + +import java.util.Map; +import java.util.Optional; + +public class NodeReplacementAllocationDecider extends AllocationDecider { + + public static final String NAME = "node_replacement"; + + static final Decision NO_REPLACEMENTS = Decision.single(Decision.Type.YES, NAME, + "neither the source nor target node are part of an ongoing node replacement (no replacements)"); + + @Override + public Decision canAllocate(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation) { + if (replacementOngoing(allocation) == false) { + return NO_REPLACEMENTS; + } else if (replacementFromSourceToTarget(allocation, shardRouting.currentNodeId(), node.node().getName())) { + return Decision.single(Decision.Type.YES, NAME, + "node [%s] is replacing node [%s], and may receive shards from it", shardRouting.currentNodeId(), node.nodeId()); + } else if (isReplacementSource(allocation, shardRouting.currentNodeId())) { + return Decision.single(Decision.Type.NO, NAME, + "node [%s] is being replaced, and its shards may only be allocated to the replacement target [%s]", + shardRouting.currentNodeId(), getReplacementName(allocation, shardRouting.currentNodeId())); + } else if (isReplacementSource(allocation, node.nodeId())) { + return Decision.single(Decision.Type.NO, NAME, + "node [%s] is being replaced by [%s], so no data may be allocated to it", + node.nodeId(), getReplacementName(allocation, node.nodeId()), shardRouting.currentNodeId()); + } else if (isReplacementTargetName(allocation, node.node().getName())) { + final SingleNodeShutdownMetadata shutdown = allocation.replacementTargetShutdowns().get(node.node().getName()); + return Decision.single(Decision.Type.NO, NAME, + "node [%s] is replacing the vacating node [%s], only data currently allocated to the source node " + + "may be allocated to it until the replacement is complete", + node.nodeId(), shutdown == null ? null : shutdown.getNodeId(), shardRouting.currentNodeId()); + } else { + return Decision.single(Decision.Type.YES, NAME, + "neither the source nor target node are part of an ongoing node replacement"); + } + } + + @Override + public Decision canRemain(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation) { + if (replacementOngoing(allocation) == false) { + return NO_REPLACEMENTS; + } else if (isReplacementSource(allocation, node.nodeId())) { + return Decision.single(Decision.Type.NO, NAME, + "node [%s] is being replaced by node [%s], so no data may remain on it", node.nodeId(), + getReplacementName(allocation, node.nodeId())); + } else { + return Decision.single(Decision.Type.YES, NAME, "node [%s] is not being replaced", node.nodeId()); + } + } + + @Override + public Decision shouldAutoExpandToNode(IndexMetadata indexMetadata, DiscoveryNode node, RoutingAllocation allocation) { + if (replacementOngoing(allocation) == false) { + return NO_REPLACEMENTS; + } else if (isReplacementTargetName(allocation, node.getName())) { + final SingleNodeShutdownMetadata shutdown = allocation.replacementTargetShutdowns().get(node.getName()); + return Decision.single(Decision.Type.NO, NAME, + "node [%s] is a node replacement target for node [%s], " + + "shards cannot auto expand to be on it until the replacement is complete", + node.getId(), shutdown == null ? null : shutdown.getNodeId()); + } else if (isReplacementSource(allocation, node.getId())) { + return Decision.single(Decision.Type.NO, NAME, + "node [%s] is being replaced by [%s], shards cannot auto expand to be on it", + node.getId(), getReplacementName(allocation, node.getId())); + } else { + return Decision.single(Decision.Type.YES, NAME, + "node is not part of a node replacement, so shards may be auto expanded onto it"); + } + } + + @Override + public Decision canForceAllocateDuringReplace(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation) { + if (replacementFromSourceToTarget(allocation, shardRouting.currentNodeId(), node.node().getName())) { + return Decision.single(Decision.Type.YES, NAME, + "node [%s] is being replaced by node [%s], and can be force vacated to the target", + shardRouting.currentNodeId(), node.nodeId()); + } else { + return Decision.single(Decision.Type.NO, NAME, + "shard is not on the source of a node replacement relocated to the replacement target"); + } + } + + /** + * Returns true if there are any node replacements ongoing in the cluster + */ + private static boolean replacementOngoing(RoutingAllocation allocation) { + return allocation.replacementTargetShutdowns().isEmpty() == false; + } + + /** + * Returns true if there is a replacement currently ongoing from the source to the target node id + */ + private static boolean replacementFromSourceToTarget(RoutingAllocation allocation, String sourceNodeId, String targetNodeName) { + if (replacementOngoing(allocation) == false) { + return false; + } + if (sourceNodeId == null || targetNodeName == null) { + return false; + } + final SingleNodeShutdownMetadata shutdown = allocation.nodeShutdowns().get(sourceNodeId); + return shutdown != null && + shutdown.getType().equals(SingleNodeShutdownMetadata.Type.REPLACE) && + shutdown.getNodeId().equals(sourceNodeId) && + shutdown.getTargetNodeName().equals(targetNodeName); + } + + /** + * Returns true if the given node id is the source (the replaced node) of an ongoing node replacement + */ + private static boolean isReplacementSource(RoutingAllocation allocation, String nodeId) { + if (nodeId == null || replacementOngoing(allocation) == false) { + return false; + } + final Map nodeShutdowns = allocation.nodeShutdowns(); + return nodeShutdowns.containsKey(nodeId) && nodeShutdowns.get(nodeId).getType().equals(SingleNodeShutdownMetadata.Type.REPLACE); + } + + /** + * Returns true if the given node name (not the id!) is the target (the replacing node) of an ongoing node replacement + */ + private static boolean isReplacementTargetName(RoutingAllocation allocation, String nodeName) { + if (nodeName == null || replacementOngoing(allocation) == false) { + return false; + } + return allocation.replacementTargetShutdowns().get(nodeName) != null; + } + + private static String getReplacementName(RoutingAllocation allocation, String nodeIdBeingReplaced) { + if (nodeIdBeingReplaced == null || replacementOngoing(allocation) == false) { + return null; + } + return Optional.ofNullable(allocation.nodeShutdowns().get(nodeIdBeingReplaced)) + .filter(shutdown -> shutdown.getType().equals(SingleNodeShutdownMetadata.Type.REPLACE)) + .map(SingleNodeShutdownMetadata::getTargetNodeName) + .orElse(null); + } +} diff --git a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/NodeVersionAllocationDecider.java b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/NodeVersionAllocationDecider.java index 9259361ee3c3b..f1fcb230de8f7 100644 --- a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/NodeVersionAllocationDecider.java +++ b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/NodeVersionAllocationDecider.java @@ -53,6 +53,11 @@ public Decision canAllocate(ShardRouting shardRouting, RoutingNode node, Routing } } + @Override + public Decision canForceAllocateDuringReplace(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation) { + return canAllocate(shardRouting, node, allocation); + } + private Decision isVersionCompatibleRelocatePrimary(final RoutingNodes routingNodes, final String sourceNodeId, final RoutingNode target, final RoutingAllocation allocation) { final RoutingNode source = routingNodes.node(sourceNodeId); diff --git a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/ReplicaAfterPrimaryActiveAllocationDecider.java b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/ReplicaAfterPrimaryActiveAllocationDecider.java index 4020f46ec0f8e..d395cd9020b1e 100644 --- a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/ReplicaAfterPrimaryActiveAllocationDecider.java +++ b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/ReplicaAfterPrimaryActiveAllocationDecider.java @@ -35,4 +35,9 @@ public Decision canAllocate(ShardRouting shardRouting, RoutingAllocation allocat } return allocation.decision(Decision.YES, NAME, "primary shard for this replica is already active"); } + + @Override + public Decision canForceAllocateDuringReplace(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation) { + return canAllocate(shardRouting, node, allocation); + } } diff --git a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/ResizeAllocationDecider.java b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/ResizeAllocationDecider.java index 292ed5c118928..b99b759efc1f4 100644 --- a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/ResizeAllocationDecider.java +++ b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/ResizeAllocationDecider.java @@ -71,4 +71,9 @@ public Decision canForceAllocatePrimary(ShardRouting shardRouting, RoutingNode n assert shardRouting.primary() : "must not call canForceAllocatePrimary on a non-primary shard " + shardRouting; return canAllocate(shardRouting, node, allocation); } + + @Override + public Decision canForceAllocateDuringReplace(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation) { + return canAllocate(shardRouting, node, allocation); + } } diff --git a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/RestoreInProgressAllocationDecider.java b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/RestoreInProgressAllocationDecider.java index 209e25fa20486..360340a419768 100644 --- a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/RestoreInProgressAllocationDecider.java +++ b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/RestoreInProgressAllocationDecider.java @@ -68,4 +68,9 @@ public Decision canForceAllocatePrimary(ShardRouting shardRouting, RoutingNode n assert shardRouting.primary() : "must not call canForceAllocatePrimary on a non-primary shard " + shardRouting; return canAllocate(shardRouting, node, allocation); } + + @Override + public Decision canForceAllocateDuringReplace(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation) { + return canAllocate(shardRouting, node, allocation); + } } diff --git a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/SameShardAllocationDecider.java b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/SameShardAllocationDecider.java index 1f3f995deaf0d..83bcdcd30130c 100644 --- a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/SameShardAllocationDecider.java +++ b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/SameShardAllocationDecider.java @@ -105,6 +105,11 @@ public Decision canAllocate(ShardRouting shardRouting, RoutingNode node, Routing return YES_NONE_HOLD_COPY; } + @Override + public Decision canForceAllocateDuringReplace(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation) { + return canAllocate(shardRouting, node, allocation); + } + private static Decision debugNoAlreadyAllocatedToHost(RoutingNode node, RoutingAllocation allocation, boolean checkNodeOnSameHostAddress) { String hostType = checkNodeOnSameHostAddress ? "address" : "name"; diff --git a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/SnapshotInProgressAllocationDecider.java b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/SnapshotInProgressAllocationDecider.java index 9561f7cb8ed19..34372238031d1 100644 --- a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/SnapshotInProgressAllocationDecider.java +++ b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/SnapshotInProgressAllocationDecider.java @@ -46,6 +46,11 @@ public Decision canAllocate(ShardRouting shardRouting, RoutingNode node, Routing return canMove(shardRouting, allocation); } + @Override + public Decision canForceAllocateDuringReplace(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation) { + return canAllocate(shardRouting, node, allocation); + } + private Decision canMove(ShardRouting shardRouting, RoutingAllocation allocation) { if (shardRouting.primary()) { // Only primary shards are snapshotted diff --git a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/ThrottlingAllocationDecider.java b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/ThrottlingAllocationDecider.java index 8c7bc6de7d6a1..f93494fde8d82 100644 --- a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/ThrottlingAllocationDecider.java +++ b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/ThrottlingAllocationDecider.java @@ -166,6 +166,11 @@ public Decision canAllocate(ShardRouting shardRouting, RoutingNode node, Routing } } + @Override + public Decision canForceAllocateDuringReplace(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation) { + return canAllocate(shardRouting, node, allocation); + } + /** * The shard routing passed to {@link #canAllocate(ShardRouting, RoutingNode, RoutingAllocation)} is not the initializing shard to this * node but: diff --git a/server/src/test/java/org/elasticsearch/cluster/ClusterModuleTests.java b/server/src/test/java/org/elasticsearch/cluster/ClusterModuleTests.java index b966d428ce0c6..5eb4479767f6d 100644 --- a/server/src/test/java/org/elasticsearch/cluster/ClusterModuleTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/ClusterModuleTests.java @@ -21,6 +21,7 @@ import org.elasticsearch.cluster.routing.allocation.decider.EnableAllocationDecider; import org.elasticsearch.cluster.routing.allocation.decider.FilterAllocationDecider; import org.elasticsearch.cluster.routing.allocation.decider.MaxRetryAllocationDecider; +import org.elasticsearch.cluster.routing.allocation.decider.NodeReplacementAllocationDecider; import org.elasticsearch.cluster.routing.allocation.decider.NodeShutdownAllocationDecider; import org.elasticsearch.cluster.routing.allocation.decider.NodeVersionAllocationDecider; import org.elasticsearch.cluster.routing.allocation.decider.RebalanceOnlyWhenActiveAllocationDecider; @@ -195,6 +196,7 @@ public void testAllocationDeciderOrder() { SnapshotInProgressAllocationDecider.class, RestoreInProgressAllocationDecider.class, NodeShutdownAllocationDecider.class, + NodeReplacementAllocationDecider.class, FilterAllocationDecider.class, SameShardAllocationDecider.class, DiskThresholdDecider.class, diff --git a/server/src/test/java/org/elasticsearch/cluster/routing/allocation/decider/DiskThresholdDeciderUnitTests.java b/server/src/test/java/org/elasticsearch/cluster/routing/allocation/decider/DiskThresholdDeciderUnitTests.java index 5830a4b952e96..298cd7aef8a66 100644 --- a/server/src/test/java/org/elasticsearch/cluster/routing/allocation/decider/DiskThresholdDeciderUnitTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/routing/allocation/decider/DiskThresholdDeciderUnitTests.java @@ -524,4 +524,55 @@ public void testDecidesYesIfWatermarksIgnored() { assertThat(decision.getExplanation(), containsString("disk watermarks are ignored on this index")); } + public void testCannotForceAllocateOver100PercentUsage() { + ClusterSettings nss = new ClusterSettings(Settings.EMPTY, ClusterSettings.BUILT_IN_CLUSTER_SETTINGS); + DiskThresholdDecider decider = new DiskThresholdDecider(Settings.EMPTY, nss); + + Metadata metadata = Metadata.builder() + .put(IndexMetadata.builder("test").settings(settings(Version.CURRENT)).numberOfShards(1).numberOfReplicas(1)) + .build(); + + final Index index = metadata.index("test").getIndex(); + + ShardRouting test_0 = ShardRouting.newUnassigned(new ShardId(index, 0), true, EmptyStoreRecoverySource.INSTANCE, + new UnassignedInfo(UnassignedInfo.Reason.INDEX_CREATED, "foo")); + DiscoveryNode node_0 = new DiscoveryNode("node_0", buildNewFakeTransportAddress(), Collections.emptyMap(), + new HashSet<>(DiscoveryNodeRole.roles()), Version.CURRENT); + DiscoveryNode node_1 = new DiscoveryNode("node_1", buildNewFakeTransportAddress(), Collections.emptyMap(), + new HashSet<>(DiscoveryNodeRole.roles()), Version.CURRENT); + + RoutingTable routingTable = RoutingTable.builder() + .addAsNew(metadata.index("test")) + .build(); + + ClusterState clusterState = ClusterState.builder(ClusterName.CLUSTER_NAME_SETTING.getDefault(Settings.EMPTY)) + .metadata(metadata).routingTable(routingTable).build(); + + clusterState = ClusterState.builder(clusterState).nodes(DiscoveryNodes.builder() + .add(node_0) + .add(node_1) + ).build(); + + // actual test -- after all that bloat :) + ImmutableOpenMap.Builder leastAvailableUsages = ImmutableOpenMap.builder(); + leastAvailableUsages.put("node_0", new DiskUsage("node_0", "node_0", "_na_", 100, 0)); // all full + ImmutableOpenMap.Builder mostAvailableUsage = ImmutableOpenMap.builder(); + mostAvailableUsage.put("node_0", new DiskUsage("node_0", "node_0", "_na_", 100, 0)); // all full + + ImmutableOpenMap.Builder shardSizes = ImmutableOpenMap.builder(); + // bigger than available space + final long shardSize = randomIntBetween(1, 10); + shardSizes.put("[test][0][p]", shardSize); + ClusterInfo clusterInfo = new ClusterInfo(leastAvailableUsages.build(), mostAvailableUsage.build(), + shardSizes.build(), null, ImmutableOpenMap.of(), ImmutableOpenMap.of()); + RoutingAllocation allocation = new RoutingAllocation(new AllocationDeciders(Collections.singleton(decider)), + clusterState.getRoutingNodes(), clusterState, clusterInfo, null, System.nanoTime()); + allocation.debugDecision(true); + Decision decision = decider.canForceAllocateDuringReplace(test_0, new RoutingNode("node_0", node_0), allocation); + assertEquals(Decision.Type.NO, decision.type()); + + assertThat(decision.getExplanation(), containsString( + "unable to force allocate shard to [node_0] during replacement, " + + "as allocating to this node would cause disk usage to exceed 100% ([" + shardSize + "] bytes above available disk space)")); + } } diff --git a/server/src/test/java/org/elasticsearch/cluster/routing/allocation/decider/NodeReplacementAllocationDeciderTests.java b/server/src/test/java/org/elasticsearch/cluster/routing/allocation/decider/NodeReplacementAllocationDeciderTests.java new file mode 100644 index 0000000000000..b31e40e4dfaf6 --- /dev/null +++ b/server/src/test/java/org/elasticsearch/cluster/routing/allocation/decider/NodeReplacementAllocationDeciderTests.java @@ -0,0 +1,237 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.cluster.routing.allocation.decider; + +import org.elasticsearch.Version; +import org.elasticsearch.cluster.ClusterState; +import org.elasticsearch.cluster.ESAllocationTestCase; +import org.elasticsearch.cluster.EmptyClusterInfoService; +import org.elasticsearch.cluster.metadata.IndexMetadata; +import org.elasticsearch.cluster.metadata.Metadata; +import org.elasticsearch.cluster.metadata.NodesShutdownMetadata; +import org.elasticsearch.cluster.metadata.SingleNodeShutdownMetadata; +import org.elasticsearch.cluster.node.DiscoveryNode; +import org.elasticsearch.cluster.node.DiscoveryNodeRole; +import org.elasticsearch.cluster.node.DiscoveryNodes; +import org.elasticsearch.cluster.routing.RecoverySource; +import org.elasticsearch.cluster.routing.RoutingNode; +import org.elasticsearch.cluster.routing.ShardRouting; +import org.elasticsearch.cluster.routing.UnassignedInfo; +import org.elasticsearch.cluster.routing.allocation.AllocationService; +import org.elasticsearch.cluster.routing.allocation.RoutingAllocation; +import org.elasticsearch.cluster.routing.allocation.allocator.BalancedShardsAllocator; +import org.elasticsearch.common.settings.ClusterSettings; +import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.index.shard.ShardId; +import org.elasticsearch.snapshots.EmptySnapshotsInfoService; +import org.elasticsearch.test.gateway.TestGatewayAllocator; + +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; + +import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.equalTo; + +public class NodeReplacementAllocationDeciderTests extends ESAllocationTestCase { + private static final DiscoveryNode NODE_A = newNode("node-a", "node-a", Collections.singleton(DiscoveryNodeRole.DATA_ROLE)); + private static final DiscoveryNode NODE_B = newNode("node-b", "node-b", Collections.singleton(DiscoveryNodeRole.DATA_ROLE)); + private static final DiscoveryNode NODE_C = newNode("node-c", "node-c", Collections.singleton(DiscoveryNodeRole.DATA_ROLE)); + private final ShardRouting shard = ShardRouting.newUnassigned( + new ShardId("myindex", "myindex", 0), + true, + RecoverySource.EmptyStoreRecoverySource.INSTANCE, + new UnassignedInfo(UnassignedInfo.Reason.INDEX_CREATED, "index created") + ); + private final ClusterSettings clusterSettings = new ClusterSettings(Settings.EMPTY, ClusterSettings.BUILT_IN_CLUSTER_SETTINGS); + private NodeReplacementAllocationDecider decider = new NodeReplacementAllocationDecider(); + private final AllocationDeciders allocationDeciders = new AllocationDeciders( + Arrays.asList( + decider, + new SameShardAllocationDecider(Settings.EMPTY, clusterSettings), + new ReplicaAfterPrimaryActiveAllocationDecider(), + new NodeShutdownAllocationDecider() + ) + ); + private final AllocationService service = new AllocationService( + allocationDeciders, + new TestGatewayAllocator(), + new BalancedShardsAllocator(Settings.EMPTY), + EmptyClusterInfoService.INSTANCE, + EmptySnapshotsInfoService.INSTANCE + ); + + private final String idxName = "test-idx"; + private final String idxUuid = "test-idx-uuid"; + private final IndexMetadata indexMetadata = IndexMetadata.builder(idxName) + .settings( + Settings.builder() + .put(IndexMetadata.SETTING_VERSION_CREATED, Version.CURRENT) + .put(IndexMetadata.SETTING_INDEX_UUID, idxUuid) + .put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1) + .put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0) + .build() + ) + .build(); + + public void testNoReplacements() { + ClusterState state = ClusterState.builder(ClusterState.EMPTY_STATE) + .nodes(DiscoveryNodes.builder() + .add(NODE_A) + .add(NODE_B) + .add(NODE_C) + .build()) + .build(); + + RoutingAllocation allocation = new RoutingAllocation(allocationDeciders, state.getRoutingNodes(), state, null, null, 0); + DiscoveryNode node = randomFrom(NODE_A, NODE_B, NODE_C); + RoutingNode routingNode = new RoutingNode(node.getId(), node, shard); + allocation.debugDecision(true); + + Decision decision = decider.canAllocate(shard, routingNode, allocation); + assertThat(decision.type(), equalTo(Decision.Type.YES)); + assertThat( + decision.getExplanation(), + equalTo(NodeReplacementAllocationDecider.NO_REPLACEMENTS.getExplanation()) + ); + + decision = decider.canRemain(shard, routingNode, allocation); + assertThat(decision.type(), equalTo(Decision.Type.YES)); + assertThat( + decision.getExplanation(), + equalTo(NodeReplacementAllocationDecider.NO_REPLACEMENTS.getExplanation()) + ); + } + + public void testCanForceAllocate() { + ClusterState state = prepareState(service.reroute(ClusterState.EMPTY_STATE, "initial state"), NODE_A.getId(), NODE_B.getName()); + RoutingAllocation allocation = new RoutingAllocation(allocationDeciders, state.getRoutingNodes(), state, null, null, 0); + RoutingNode routingNode = new RoutingNode(NODE_A.getId(), NODE_A, shard); + allocation.debugDecision(true); + + ShardRouting assignedShard = ShardRouting.newUnassigned( + new ShardId("myindex", "myindex", 0), + true, + RecoverySource.EmptyStoreRecoverySource.INSTANCE, + new UnassignedInfo(UnassignedInfo.Reason.INDEX_CREATED, "index created") + ); + assignedShard = assignedShard.initialize(NODE_A.getId(), null, 1); + assignedShard = assignedShard.moveToStarted(); + + Decision decision = decider.canForceAllocateDuringReplace(assignedShard, routingNode, allocation); + assertThat(decision.type(), equalTo(Decision.Type.NO)); + assertThat( + decision.getExplanation(), + equalTo("shard is not on the source of a node replacement relocated to the replacement target") + ); + + routingNode = new RoutingNode(NODE_B.getId(), NODE_B, assignedShard); + + decision = decider.canForceAllocateDuringReplace(assignedShard, routingNode, allocation); + assertThat(decision.type(), equalTo(Decision.Type.YES)); + assertThat(decision.getExplanation(), + equalTo("node [" + NODE_A.getId() + "] is being replaced by node [" + NODE_B.getId() + + "], and can be force vacated to the target")); + + routingNode = new RoutingNode(NODE_C.getId(), NODE_C, assignedShard); + + decision = decider.canForceAllocateDuringReplace(assignedShard, routingNode, allocation); + assertThat(decision.type(), equalTo(Decision.Type.NO)); + assertThat(decision.getExplanation(), + equalTo("shard is not on the source of a node replacement relocated to the replacement target")); + } + + public void testCannotRemainOnReplacedNode() { + ClusterState state = prepareState(service.reroute(ClusterState.EMPTY_STATE, "initial state"), NODE_A.getId(), NODE_B.getName()); + RoutingAllocation allocation = new RoutingAllocation(allocationDeciders, state.getRoutingNodes(), state, null, null, 0); + RoutingNode routingNode = new RoutingNode(NODE_A.getId(), NODE_A, shard); + allocation.debugDecision(true); + + Decision decision = decider.canRemain(shard, routingNode, allocation); + assertThat(decision.type(), equalTo(Decision.Type.NO)); + assertThat( + decision.getExplanation(), + equalTo("node [" + NODE_A.getId() + "] is being replaced by node [" + NODE_B.getId() + "], so no data may remain on it") + ); + + routingNode = new RoutingNode(NODE_B.getId(), NODE_B, shard); + + decision = decider.canRemain(shard, routingNode, allocation); + assertThat(decision.type(), equalTo(Decision.Type.YES)); + assertThat(decision.getExplanation(), equalTo("node [" + NODE_B.getId() + "] is not being replaced")); + + routingNode = new RoutingNode(NODE_C.getId(), NODE_C, shard); + + decision = decider.canRemain(shard, routingNode, allocation); + assertThat(decision.type(), equalTo(Decision.Type.YES)); + assertThat(decision.getExplanation(), equalTo("node [" + NODE_C.getId() + "] is not being replaced")); + } + + public void testCanAllocateToNeitherSourceNorTarget() { + ClusterState state = prepareState(service.reroute(ClusterState.EMPTY_STATE, "initial state"), NODE_A.getId(), NODE_B.getName()); + RoutingAllocation allocation = new RoutingAllocation(allocationDeciders, state.getRoutingNodes(), state, null, null, 0); + RoutingNode routingNode = new RoutingNode(NODE_A.getId(), NODE_A, shard); + allocation.debugDecision(true); + + ShardRouting testShard = this.shard; + if (randomBoolean()) { + testShard = shard.initialize(NODE_C.getId(), null, 1); + testShard = testShard.moveToStarted(); + } + Decision decision = decider.canAllocate(testShard, routingNode, allocation); + assertThat(decision.type(), equalTo(Decision.Type.NO)); + assertThat( + decision.getExplanation(), + equalTo("node [" + NODE_A.getId() + "] is being replaced by [" + NODE_B.getName() + + "], so no data may be allocated to it") + ); + + routingNode = new RoutingNode(NODE_B.getId(), NODE_B, testShard); + + decision = decider.canAllocate(testShard, routingNode, allocation); + assertThat(decision.type(), equalTo(Decision.Type.NO)); + assertThat( + decision.getExplanation(), + equalTo("node [" + NODE_B.getId() + + "] is replacing the vacating node [" + NODE_A.getId() + "], only data currently allocated " + + "to the source node may be allocated to it until the replacement is complete") + ); + + routingNode = new RoutingNode(NODE_C.getId(), NODE_C, testShard); + + decision = decider.canAllocate(testShard, routingNode, allocation); + assertThat(decision.getExplanation(), decision.type(), equalTo(Decision.Type.YES)); + assertThat( + decision.getExplanation(), + containsString("neither the source nor target node are part of an ongoing node replacement") + ); + } + + private ClusterState prepareState(ClusterState initialState, String sourceNodeId, String targetNodeName) { + final SingleNodeShutdownMetadata nodeShutdownMetadata = SingleNodeShutdownMetadata.builder() + .setNodeId(sourceNodeId) + .setTargetNodeName(targetNodeName) + .setType(SingleNodeShutdownMetadata.Type.REPLACE) + .setReason(this.getTestName()) + .setStartedAtMillis(1L) + .build(); + NodesShutdownMetadata nodesShutdownMetadata = new NodesShutdownMetadata(new HashMap<>()).putSingleNodeMetadata( + nodeShutdownMetadata + ); + return ClusterState.builder(initialState) + .nodes(DiscoveryNodes.builder() + .add(NODE_A) + .add(NODE_B) + .add(NODE_C) + .build()) + .metadata(Metadata.builder().put(IndexMetadata.builder(indexMetadata)) + .putCustom(NodesShutdownMetadata.TYPE, nodesShutdownMetadata)) + .build(); + } +} diff --git a/test/framework/src/main/java/org/elasticsearch/cluster/ESAllocationTestCase.java b/test/framework/src/main/java/org/elasticsearch/cluster/ESAllocationTestCase.java index 502e03a8c8e7d..1d6bc2b7b1dc6 100644 --- a/test/framework/src/main/java/org/elasticsearch/cluster/ESAllocationTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/cluster/ESAllocationTestCase.java @@ -128,6 +128,10 @@ protected static DiscoveryNode newNode(String nodeId, Set rol return new DiscoveryNode(nodeId, buildNewFakeTransportAddress(), emptyMap(), roles, Version.CURRENT); } + protected static DiscoveryNode newNode(String nodeName, String nodeId, Set roles) { + return new DiscoveryNode(nodeName, nodeId, buildNewFakeTransportAddress(), emptyMap(), roles, Version.CURRENT); + } + protected static DiscoveryNode newNode(String nodeId, Version version) { return new DiscoveryNode(nodeId, buildNewFakeTransportAddress(), emptyMap(), MASTER_DATA_ROLES, version); } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/SetSingleNodeAllocateStep.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/SetSingleNodeAllocateStep.java index 934c345be9c4d..decf1f6a598b7 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/SetSingleNodeAllocateStep.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/SetSingleNodeAllocateStep.java @@ -22,6 +22,7 @@ import org.elasticsearch.cluster.routing.allocation.decider.AllocationDeciders; import org.elasticsearch.cluster.routing.allocation.decider.Decision; import org.elasticsearch.cluster.routing.allocation.decider.FilterAllocationDecider; +import org.elasticsearch.cluster.routing.allocation.decider.NodeReplacementAllocationDecider; import org.elasticsearch.cluster.routing.allocation.decider.NodeShutdownAllocationDecider; import org.elasticsearch.cluster.routing.allocation.decider.NodeVersionAllocationDecider; import org.elasticsearch.cluster.routing.allocation.decider.ShardsLimitAllocationDecider; @@ -68,7 +69,8 @@ public void performAction(IndexMetadata indexMetadata, ClusterState clusterState new ClusterSettings(Settings.EMPTY, ClusterSettings.BUILT_IN_CLUSTER_SETTINGS)), new DataTierAllocationDecider(), new NodeVersionAllocationDecider(), - new NodeShutdownAllocationDecider() + new NodeShutdownAllocationDecider(), + new NodeReplacementAllocationDecider() )); final RoutingNodes routingNodes = clusterState.getRoutingNodes(); RoutingAllocation allocation = new RoutingAllocation(allocationDeciders, routingNodes, clusterState, null, diff --git a/x-pack/plugin/shutdown/src/internalClusterTest/java/org/elasticsearch/xpack/shutdown/NodeShutdownShardsIT.java b/x-pack/plugin/shutdown/src/internalClusterTest/java/org/elasticsearch/xpack/shutdown/NodeShutdownShardsIT.java index 7d68f47709e49..e0880c8ede6ee 100644 --- a/x-pack/plugin/shutdown/src/internalClusterTest/java/org/elasticsearch/xpack/shutdown/NodeShutdownShardsIT.java +++ b/x-pack/plugin/shutdown/src/internalClusterTest/java/org/elasticsearch/xpack/shutdown/NodeShutdownShardsIT.java @@ -9,6 +9,7 @@ import org.apache.logging.log4j.message.ParameterizedMessage; import org.elasticsearch.Build; +import org.elasticsearch.action.admin.cluster.allocation.ClusterAllocationExplainResponse; import org.elasticsearch.action.admin.cluster.node.info.NodeInfo; import org.elasticsearch.action.admin.cluster.node.info.NodesInfoResponse; import org.elasticsearch.action.index.IndexRequestBuilder; @@ -20,6 +21,7 @@ import org.elasticsearch.cluster.routing.ShardRouting; import org.elasticsearch.cluster.routing.ShardRoutingState; import org.elasticsearch.cluster.routing.UnassignedInfo; +import org.elasticsearch.cluster.routing.allocation.decider.Decision; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.test.ESIntegTestCase; @@ -28,8 +30,10 @@ import java.util.Arrays; import java.util.Collection; import java.util.List; +import java.util.stream.Collectors; import static org.elasticsearch.cluster.metadata.SingleNodeShutdownMetadata.Status.COMPLETE; +import static org.elasticsearch.cluster.metadata.SingleNodeShutdownMetadata.Status.STALLED; import static org.hamcrest.Matchers.equalTo; @ESIntegTestCase.ClusterScope(scope = ESIntegTestCase.Scope.TEST, numDataNodes = 0, numClientNodes = 0) @@ -172,7 +176,6 @@ public void testNotStalledIfAllShardsHaveACopyOnAnotherNode() throws Exception { ); AcknowledgedResponse putShutdownResponse = client().execute(PutShutdownNodeAction.INSTANCE, putShutdownRequest).get(); assertTrue(putShutdownResponse.isAcknowledged()); - assertBusy(() -> { GetShutdownStatusAction.Response getResp = client().execute( GetShutdownStatusAction.INSTANCE, @@ -183,6 +186,258 @@ public void testNotStalledIfAllShardsHaveACopyOnAnotherNode() throws Exception { }); } + public void testNodeReplacementOnlyAllowsShardsFromReplacedNode() throws Exception { + String nodeA = internalCluster().startNode(Settings.builder().put("node.name", "node-a")); + Settings.Builder nodeASettings = Settings.builder().put("index.number_of_shards", 3).put("index.number_of_replicas", 1); + createIndex("myindex", nodeASettings.build()); + final String nodeAId = getNodeId(nodeA); + final String nodeB = "node_t1"; // TODO: fix this to so it's actually overrideable + + // Mark the nodeA as being replaced + PutShutdownNodeAction.Request putShutdownRequest = new PutShutdownNodeAction.Request( + nodeAId, + SingleNodeShutdownMetadata.Type.REPLACE, + this.getTestName(), + null, + nodeB + ); + AcknowledgedResponse putShutdownResponse = client().execute(PutShutdownNodeAction.INSTANCE, putShutdownRequest).get(); + assertTrue(putShutdownResponse.isAcknowledged()); + + GetShutdownStatusAction.Response getResp = client().execute( + GetShutdownStatusAction.INSTANCE, + new GetShutdownStatusAction.Request(nodeAId) + ).get(); + + assertThat(getResp.getShutdownStatuses().get(0).migrationStatus().getStatus(), equalTo(STALLED)); + + internalCluster().startNode(Settings.builder().put("node.name", nodeB)); + final String nodeBId = getNodeId(nodeB); + + logger.info("--> NodeA: {} -- {}", nodeA, nodeAId); + logger.info("--> NodeB: {} -- {}", nodeB, nodeBId); + + assertBusy(() -> { + ClusterState state = client().admin().cluster().prepareState().clear().setRoutingTable(true).get().getState(); + int active = 0; + for (ShardRouting sr : state.routingTable().allShards("myindex")) { + if (sr.active()) { + active++; + assertThat( + "expected shard on nodeB (" + nodeBId + ") but it was on a different node", + sr.currentNodeId(), + equalTo(nodeBId) + ); + } + } + assertThat("expected all 3 of the primary shards to be allocated", active, equalTo(3)); + }); + + assertBusy(() -> { + GetShutdownStatusAction.Response shutdownStatus = client().execute( + GetShutdownStatusAction.INSTANCE, + new GetShutdownStatusAction.Request(nodeAId) + ).get(); + assertThat(shutdownStatus.getShutdownStatuses().get(0).migrationStatus().getStatus(), equalTo(COMPLETE)); + }); + + final String nodeC = internalCluster().startNode(); + + createIndex("other", Settings.builder().put("index.number_of_shards", 1).put("index.number_of_replicas", 1).build()); + + ensureYellow("other"); + + // Explain the replica for the "other" index + ClusterAllocationExplainResponse explainResponse = client().admin() + .cluster() + .prepareAllocationExplain() + .setIndex("other") + .setShard(0) + .setPrimary(false) + .get(); + + // Validate that the replica cannot be allocated to nodeB because it's the target of a node replacement + explainResponse.getExplanation() + .getShardAllocationDecision() + .getAllocateDecision() + .getNodeDecisions() + .stream() + .filter(nodeDecision -> nodeDecision.getNode().getId().equals(nodeBId)) + .findFirst() + .ifPresentOrElse(nodeAllocationResult -> { + assertThat(nodeAllocationResult.getCanAllocateDecision().type(), equalTo(Decision.Type.NO)); + assertTrue( + "expected decisions to mention node replacement: " + + nodeAllocationResult.getCanAllocateDecision() + .getDecisions() + .stream() + .map(Decision::getExplanation) + .collect(Collectors.joining(",")), + nodeAllocationResult.getCanAllocateDecision() + .getDecisions() + .stream() + .anyMatch( + decision -> decision.getExplanation().contains("is replacing the vacating node") + && decision.getExplanation().contains("may be allocated to it until the replacement is complete") + ) + ); + }, () -> fail("expected a 'NO' decision for nodeB but there was no explanation for that node")); + } + + public void testNodeReplacementOverridesFilters() throws Exception { + String nodeA = internalCluster().startNode(Settings.builder().put("node.name", "node-a")); + // Create an index and pin it to nodeA, when we replace it with nodeB, + // it'll move the data, overridding the `_name` allocation filter + Settings.Builder nodeASettings = Settings.builder() + .put("index.routing.allocation.require._name", nodeA) + .put("index.number_of_shards", 3) + .put("index.number_of_replicas", 0); + createIndex("myindex", nodeASettings.build()); + final String nodeAId = getNodeId(nodeA); + final String nodeB = "node_t2"; // TODO: fix this to so it's actually overrideable + + // Mark the nodeA as being replaced + PutShutdownNodeAction.Request putShutdownRequest = new PutShutdownNodeAction.Request( + nodeAId, + SingleNodeShutdownMetadata.Type.REPLACE, + this.getTestName(), + null, + nodeB + ); + AcknowledgedResponse putShutdownResponse = client().execute(PutShutdownNodeAction.INSTANCE, putShutdownRequest).get(); + assertTrue(putShutdownResponse.isAcknowledged()); + + GetShutdownStatusAction.Response getResp = client().execute( + GetShutdownStatusAction.INSTANCE, + new GetShutdownStatusAction.Request(nodeAId) + ).get(); + + assertThat(getResp.getShutdownStatuses().get(0).migrationStatus().getStatus(), equalTo(STALLED)); + + final String nodeC = internalCluster().startNode(); + internalCluster().startNode(Settings.builder().put("node.name", nodeB)); + final String nodeBId = getNodeId(nodeB); + + logger.info("--> NodeA: {} -- {}", nodeA, nodeAId); + logger.info("--> NodeB: {} -- {}", nodeB, nodeBId); + + assertBusy(() -> { + ClusterState state = client().admin().cluster().prepareState().clear().setRoutingTable(true).get().getState(); + for (ShardRouting sr : state.routingTable().allShards("myindex")) { + assertThat( + "expected shard on nodeB (" + nodeBId + ") but it was on a different node", + sr.currentNodeId(), + equalTo(nodeBId) + ); + } + }); + + assertBusy(() -> { + GetShutdownStatusAction.Response shutdownStatus = client().execute( + GetShutdownStatusAction.INSTANCE, + new GetShutdownStatusAction.Request(nodeAId) + ).get(); + assertThat(shutdownStatus.getShutdownStatuses().get(0).migrationStatus().getStatus(), equalTo(COMPLETE)); + }); + + createIndex("other", Settings.builder().put("index.number_of_shards", 1).put("index.number_of_replicas", 1).build()); + + ensureYellow("other"); + + // Explain the replica for the "other" index + ClusterAllocationExplainResponse explainResponse = client().admin() + .cluster() + .prepareAllocationExplain() + .setIndex("other") + .setShard(0) + .setPrimary(false) + .get(); + + // Validate that the replica cannot be allocated to nodeB because it's the target of a node replacement + explainResponse.getExplanation() + .getShardAllocationDecision() + .getAllocateDecision() + .getNodeDecisions() + .stream() + .filter(nodeDecision -> nodeDecision.getNode().getId().equals(nodeBId)) + .findFirst() + .ifPresentOrElse(nodeAllocationResult -> { + assertThat(nodeAllocationResult.getCanAllocateDecision().type(), equalTo(Decision.Type.NO)); + assertTrue( + "expected decisions to mention node replacement: " + + nodeAllocationResult.getCanAllocateDecision() + .getDecisions() + .stream() + .map(Decision::getExplanation) + .collect(Collectors.joining(",")), + nodeAllocationResult.getCanAllocateDecision() + .getDecisions() + .stream() + .anyMatch( + decision -> decision.getExplanation().contains("is replacing the vacating node") + && decision.getExplanation().contains("may be allocated to it until the replacement is complete") + ) + ); + }, () -> fail("expected a 'NO' decision for nodeB but there was no explanation for that node")); + } + + public void testNodeReplacementOnlyToTarget() throws Exception { + String nodeA = internalCluster().startNode( + Settings.builder().put("node.name", "node-a").put("cluster.routing.rebalance.enable", "none") + ); + Settings.Builder nodeASettings = Settings.builder().put("index.number_of_shards", 4).put("index.number_of_replicas", 0); + createIndex("myindex", nodeASettings.build()); + final String nodeAId = getNodeId(nodeA); + final String nodeB = "node_t1"; // TODO: fix this to so it's actually overrideable + final String nodeC = "node_t2"; // TODO: fix this to so it's actually overrideable + + // Mark the nodeA as being replaced + PutShutdownNodeAction.Request putShutdownRequest = new PutShutdownNodeAction.Request( + nodeAId, + SingleNodeShutdownMetadata.Type.REPLACE, + this.getTestName(), + null, + nodeB + ); + AcknowledgedResponse putShutdownResponse = client().execute(PutShutdownNodeAction.INSTANCE, putShutdownRequest).get(); + assertTrue(putShutdownResponse.isAcknowledged()); + + GetShutdownStatusAction.Response getResp = client().execute( + GetShutdownStatusAction.INSTANCE, + new GetShutdownStatusAction.Request(nodeAId) + ).get(); + + assertThat(getResp.getShutdownStatuses().get(0).migrationStatus().getStatus(), equalTo(STALLED)); + + internalCluster().startNode(Settings.builder().put("node.name", nodeB)); + internalCluster().startNode(Settings.builder().put("node.name", nodeC)); + final String nodeBId = getNodeId(nodeB); + final String nodeCId = getNodeId(nodeC); + + logger.info("--> NodeA: {} -- {}", nodeA, nodeAId); + logger.info("--> NodeB: {} -- {}", nodeB, nodeBId); + logger.info("--> NodeC: {} -- {}", nodeC, nodeCId); + + assertBusy(() -> { + ClusterState state = client().admin().cluster().prepareState().clear().setRoutingTable(true).get().getState(); + for (ShardRouting sr : state.routingTable().allShards("myindex")) { + assertThat( + "expected all shards for index to be on node B (" + nodeBId + ") but " + sr.toString() + " is on " + sr.currentNodeId(), + sr.currentNodeId(), + equalTo(nodeBId) + ); + } + }); + + assertBusy(() -> { + GetShutdownStatusAction.Response shutdownStatus = client().execute( + GetShutdownStatusAction.INSTANCE, + new GetShutdownStatusAction.Request(nodeAId) + ).get(); + assertThat(shutdownStatus.getShutdownStatuses().get(0).migrationStatus().getStatus(), equalTo(COMPLETE)); + }); + } + private void indexRandomData() throws Exception { int numDocs = scaledRandomIntBetween(100, 1000); IndexRequestBuilder[] builders = new IndexRequestBuilder[numDocs]; @@ -211,7 +466,7 @@ private String findIdOfNodeWithPrimaryShard(String indexName) { ); } - private String getNodeId(String nodeName) throws Exception { + private String getNodeId(String nodeName) { NodesInfoResponse nodes = client().admin().cluster().prepareNodesInfo().clear().get(); return nodes.getNodes() .stream() diff --git a/x-pack/plugin/shutdown/src/test/java/org/elasticsearch/xpack/shutdown/TransportGetShutdownStatusActionTests.java b/x-pack/plugin/shutdown/src/test/java/org/elasticsearch/xpack/shutdown/TransportGetShutdownStatusActionTests.java index b9c45e3f35265..4a9a3a6b900c2 100644 --- a/x-pack/plugin/shutdown/src/test/java/org/elasticsearch/xpack/shutdown/TransportGetShutdownStatusActionTests.java +++ b/x-pack/plugin/shutdown/src/test/java/org/elasticsearch/xpack/shutdown/TransportGetShutdownStatusActionTests.java @@ -30,6 +30,7 @@ import org.elasticsearch.cluster.routing.allocation.decider.AllocationDecider; import org.elasticsearch.cluster.routing.allocation.decider.AllocationDeciders; import org.elasticsearch.cluster.routing.allocation.decider.Decision; +import org.elasticsearch.cluster.routing.allocation.decider.NodeReplacementAllocationDecider; import org.elasticsearch.cluster.routing.allocation.decider.NodeShutdownAllocationDecider; import org.elasticsearch.common.collect.ImmutableOpenMap; import org.elasticsearch.common.settings.Settings; @@ -78,35 +79,37 @@ private void setup() { canRemain.set((r, n, a) -> { throw new UnsupportedOperationException("canRemain not initiated in this test"); }); clusterInfoService = EmptyClusterInfoService.INSTANCE; - allocationDeciders = new AllocationDeciders(List.of(new NodeShutdownAllocationDecider(), new AllocationDecider() { - @Override - public Decision canAllocate(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation) { - return canAllocate.get().test(shardRouting, node, allocation); - } - - @Override - public Decision canRebalance(ShardRouting shardRouting, RoutingAllocation allocation) { - // No behavior should change based on rebalance decisions - return Decision.NO; - } - - @Override - public Decision canRemain(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation) { - return canRemain.get().test(shardRouting, node, allocation); - } - - @Override - public Decision shouldAutoExpandToNode(IndexMetadata indexMetadata, DiscoveryNode node, RoutingAllocation allocation) { - // No behavior relevant to these tests should change based on auto expansion decisions - throw new UnsupportedOperationException(); - } - - @Override - public Decision canRebalance(RoutingAllocation allocation) { - // No behavior should change based on rebalance decisions - return Decision.NO; - } - })); + allocationDeciders = new AllocationDeciders( + List.of(new NodeShutdownAllocationDecider(), new NodeReplacementAllocationDecider(), new AllocationDecider() { + @Override + public Decision canAllocate(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation) { + return canAllocate.get().test(shardRouting, node, allocation); + } + + @Override + public Decision canRebalance(ShardRouting shardRouting, RoutingAllocation allocation) { + // No behavior should change based on rebalance decisions + return Decision.NO; + } + + @Override + public Decision canRemain(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation) { + return canRemain.get().test(shardRouting, node, allocation); + } + + @Override + public Decision shouldAutoExpandToNode(IndexMetadata indexMetadata, DiscoveryNode node, RoutingAllocation allocation) { + // No behavior relevant to these tests should change based on auto expansion decisions + throw new UnsupportedOperationException(); + } + + @Override + public Decision canRebalance(RoutingAllocation allocation) { + // No behavior should change based on rebalance decisions + return Decision.NO; + } + }) + ); snapshotsInfoService = () -> new SnapshotShardSizeInfo( new ImmutableOpenMap.Builder().build() ); From 90e340cb64b11bf68e084c11943146199e765322 Mon Sep 17 00:00:00 2001 From: Keith Massey Date: Thu, 7 Oct 2021 11:56:11 -0500 Subject: [PATCH 231/250] Un-ignoring tests after backporting fix (#78830) Un-ignoring compatibility tests after backporting #78531 Relates #78531 --- rest-api-spec/build.gradle | 3 --- .../test/nodes.stats/11_indices_metrics.yml | 12 ++++++------ 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/rest-api-spec/build.gradle b/rest-api-spec/build.gradle index 73322bddd1df8..0cef59a464047 100644 --- a/rest-api-spec/build.gradle +++ b/rest-api-spec/build.gradle @@ -81,9 +81,6 @@ tasks.named("yamlRestTestV7CompatTransform").configure { task -> task.skipTest("search.aggregation/20_terms/string profiler via global ordinals native implementation", "The profiler results aren't backwards compatible.") task.skipTest("search.aggregation/20_terms/string profiler via map", "The profiler results aren't backwards compatible.") task.skipTest("search.aggregation/20_terms/numeric profiler", "The profiler results aren't backwards compatible.") - task.skipTest("nodes.stats/11_indices_metrics/Metric - _all for indices shards", "Muted because we are intentionally making a breaking bugfix. Unmute when #78531 is backported") - task.skipTest("nodes.stats/11_indices_metrics/indices shards total count test", "Muted because we are intentionally making a breaking bugfix. Unmute when #78531 is backported") - task.skipTest("nodes.stats/11_indices_metrics/Metric - blank for indices shards", "Muted because we are intentionally making a breaking bugfix. Unmute when #78531 is backported") task.replaceValueInMatch("_type", "_doc") task.addAllowedWarningRegex("\\[types removal\\].*") diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/nodes.stats/11_indices_metrics.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/nodes.stats/11_indices_metrics.yml index ba2b5fdb40a66..999cbf6a5eb3f 100644 --- a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/nodes.stats/11_indices_metrics.yml +++ b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/nodes.stats/11_indices_metrics.yml @@ -324,8 +324,8 @@ "Metric - blank for indices shard_stats": - skip: features: [arbitrary_key] - version: " - 7.16.1" - reason: "total shard count added in version 7.15.0" + version: " - 7.15.0" + reason: "total shard count added in version 7.15.0, and fixed in 7.15.1" - do: nodes.info: {} - set: @@ -341,8 +341,8 @@ "Metric - _all for indices shard_stats": - skip: features: [arbitrary_key] - version: " - 7.16.1" - reason: "total shard count added in version 7.15.0" + version: " - 7.15.0" + reason: "total shard count added in version 7.15.0, and fixed in 7.15.1" - do: nodes.info: {} - set: @@ -360,8 +360,8 @@ - skip: features: ["allowed_warnings", arbitrary_key] - version: " - 7.16.1" - reason: "total shard count added in version 7.15.0" + version: " - 7.15.0" + reason: "total shard count added in version 7.15.0, and fixed in 7.15.1" - do: indices.create: From fe1fc5f7d3d020e7245e5143b8640c85ba30fb38 Mon Sep 17 00:00:00 2001 From: Lee Hinman Date: Thu, 7 Oct 2021 11:44:23 -0600 Subject: [PATCH 232/250] Add support for rest compatibility headers to the HLRC (#78490) This adds support for the headers necessary for REST version compatibility to the High Level Rest Client (HLRC). Compatibility mode can be turned on either with the .setAPICompatibilityMode(true) when creating the client, or by setting the ELASTIC_CLIENT_APIVERSIONING to true similar to our other Elasticsearch clients. Resolves #77859 --- .../client/RestHighLevelClient.java | 184 ++++++++++++++++-- .../client/RestHighLevelClientBuilder.java | 51 +++++ .../client/RestHighLevelClientTests.java | 90 ++++++++- .../elasticsearch/client/RequestOptions.java | 23 +++ .../org/elasticsearch/client/RestClient.java | 5 +- .../client/RestClientBuilder.java | 2 +- 6 files changed, 338 insertions(+), 17 deletions(-) create mode 100644 client/rest-high-level/src/main/java/org/elasticsearch/client/RestHighLevelClientBuilder.java diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/RestHighLevelClient.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/RestHighLevelClient.java index a742fcb0f1a0f..d511aab047bfe 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/RestHighLevelClient.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/RestHighLevelClient.java @@ -8,6 +8,7 @@ package org.elasticsearch.client; +import org.apache.http.Header; import org.apache.http.HttpEntity; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -67,17 +68,17 @@ import org.elasticsearch.client.core.TermVectorsRequest; import org.elasticsearch.client.core.TermVectorsResponse; import org.elasticsearch.client.tasks.TaskSubmissionResponse; -import org.elasticsearch.common.util.concurrent.FutureUtils; -import org.elasticsearch.core.CheckedConsumer; -import org.elasticsearch.core.CheckedFunction; -import org.elasticsearch.common.xcontent.ParseField; import org.elasticsearch.common.Strings; +import org.elasticsearch.common.util.concurrent.FutureUtils; import org.elasticsearch.common.util.concurrent.ListenableFuture; import org.elasticsearch.common.xcontent.ContextParser; import org.elasticsearch.common.xcontent.DeprecationHandler; import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.common.xcontent.ParseField; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.core.CheckedConsumer; +import org.elasticsearch.core.CheckedFunction; import org.elasticsearch.index.rankeval.RankEvalRequest; import org.elasticsearch.index.rankeval.RankEvalResponse; import org.elasticsearch.index.reindex.BulkByScrollResponse; @@ -130,18 +131,18 @@ import org.elasticsearch.search.aggregations.bucket.range.RangeAggregationBuilder; import org.elasticsearch.search.aggregations.bucket.sampler.InternalSampler; import org.elasticsearch.search.aggregations.bucket.sampler.ParsedSampler; +import org.elasticsearch.search.aggregations.bucket.terms.DoubleTerms; import org.elasticsearch.search.aggregations.bucket.terms.LongRareTerms; +import org.elasticsearch.search.aggregations.bucket.terms.LongTerms; +import org.elasticsearch.search.aggregations.bucket.terms.ParsedDoubleTerms; import org.elasticsearch.search.aggregations.bucket.terms.ParsedLongRareTerms; +import org.elasticsearch.search.aggregations.bucket.terms.ParsedLongTerms; import org.elasticsearch.search.aggregations.bucket.terms.ParsedSignificantLongTerms; import org.elasticsearch.search.aggregations.bucket.terms.ParsedSignificantStringTerms; import org.elasticsearch.search.aggregations.bucket.terms.ParsedStringRareTerms; +import org.elasticsearch.search.aggregations.bucket.terms.ParsedStringTerms; import org.elasticsearch.search.aggregations.bucket.terms.SignificantLongTerms; import org.elasticsearch.search.aggregations.bucket.terms.SignificantStringTerms; -import org.elasticsearch.search.aggregations.bucket.terms.DoubleTerms; -import org.elasticsearch.search.aggregations.bucket.terms.LongTerms; -import org.elasticsearch.search.aggregations.bucket.terms.ParsedDoubleTerms; -import org.elasticsearch.search.aggregations.bucket.terms.ParsedLongTerms; -import org.elasticsearch.search.aggregations.bucket.terms.ParsedStringTerms; import org.elasticsearch.search.aggregations.bucket.terms.StringRareTerms; import org.elasticsearch.search.aggregations.bucket.terms.StringTerms; import org.elasticsearch.search.aggregations.metrics.AvgAggregationBuilder; @@ -253,11 +254,16 @@ public class RestHighLevelClient implements Closeable { private static final Logger logger = LogManager.getLogger(RestHighLevelClient.class); + /** + * Environment variable determining whether to send the 7.x compatibility header + */ + public static final String API_VERSIONING_ENV_VARIABLE = "ELASTIC_CLIENT_APIVERSIONING"; // To be called using performClientRequest and performClientRequestAsync to ensure version compatibility check private final RestClient client; private final NamedXContentRegistry registry; private final CheckedConsumer doClose; + private final boolean useAPICompatibility; /** Do not access directly but through getVersionValidationFuture() */ private volatile ListenableFuture> versionValidationFuture; @@ -310,11 +316,28 @@ protected RestHighLevelClient(RestClientBuilder restClientBuilder, List doClose, List namedXContentEntries) { + this(restClient, doClose, namedXContentEntries, null); + } + + /** + * Creates a {@link RestHighLevelClient} given the low level {@link RestClient} that it should use to perform requests and + * a list of entries that allow to parse custom response sections added to Elasticsearch through plugins. + * This constructor can be called by subclasses in case an externally created low-level REST client needs to be provided. + * The consumer argument allows to control what needs to be done when the {@link #close()} method is called. + * Also subclasses can provide parsers for custom response sections added to Elasticsearch through plugins. + */ + protected RestHighLevelClient(RestClient restClient, CheckedConsumer doClose, + List namedXContentEntries, Boolean useAPICompatibility) { this.client = Objects.requireNonNull(restClient, "restClient must not be null"); this.doClose = Objects.requireNonNull(doClose, "doClose consumer must not be null"); this.registry = new NamedXContentRegistry( - Stream.of(getDefaultNamedXContents().stream(), getProvidedNamedXContents().stream(), namedXContentEntries.stream()) - .flatMap(Function.identity()).collect(toList())); + Stream.of(getDefaultNamedXContents().stream(), getProvidedNamedXContents().stream(), namedXContentEntries.stream()) + .flatMap(Function.identity()).collect(toList())); + if (useAPICompatibility == null && "true".equals(System.getenv(API_VERSIONING_ENV_VARIABLE))) { + this.useAPICompatibility = true; + } else { + this.useAPICompatibility = Boolean.TRUE.equals(useAPICompatibility); + } } /** @@ -2016,7 +2039,82 @@ protected static boolean convertExistsResponse(Response response) { return response.getStatusLine().getStatusCode() == 200; } + private enum EntityType { + JSON() { + @Override + public String header() { + return "application/json"; + } + @Override + public String compatibleHeader() { + return "application/vnd.elasticsearch+json; compatible-with=7"; + } + }, + NDJSON() { + @Override + public String header() { + return "application/x-ndjson"; + } + @Override + public String compatibleHeader() { + return "application/vnd.elasticsearch+x-ndjson; compatible-with=7"; + } + }, + STAR() { + @Override + public String header() { + return "application/*"; + } + @Override + public String compatibleHeader() { + return "application/vnd.elasticsearch+json; compatible-with=7"; + } + }, + YAML() { + @Override + public String header() { + return "application/yaml"; + } + @Override + public String compatibleHeader() { + return "application/vnd.elasticsearch+yaml; compatible-with=7"; + } + }, + SMILE() { + @Override + public String header() { + return "application/smile"; + } + @Override + public String compatibleHeader() { + return "application/vnd.elasticsearch+smile; compatible-with=7"; + } + }, + CBOR() { + @Override + public String header() { + return "application/cbor"; + } + @Override + public String compatibleHeader() { + return "application/vnd.elasticsearch+cbor; compatible-with=7"; + } + }; + + public abstract String header(); + public abstract String compatibleHeader(); + + @Override + public String toString() { + return header(); + } + } + private Cancellable performClientRequestAsync(Request request, ResponseListener listener) { + // Add compatibility request headers if compatibility mode has been enabled + if (this.useAPICompatibility) { + modifyRequestForCompatibility(request); + } ListenableFuture> versionCheck = getVersionValidationFuture(); @@ -2068,7 +2166,71 @@ public void onFailure(Exception e) { return result; }; + + /** + * Go through all the request's existing headers, looking for {@code headerName} headers and if they exist, + * changing them to use version compatibility. If no request headers are changed, modify the entity type header if appropriate + */ + boolean addCompatibilityFor(RequestOptions.Builder newOptions, Header entityHeader, String headerName) { + // Modify any existing "Content-Type" headers on the request to use the version compatibility, if available + boolean contentTypeModified = false; + for (Header header : new ArrayList<>(newOptions.getHeaders())) { + if (headerName.equalsIgnoreCase(header.getName()) == false) { + continue; + } + contentTypeModified = contentTypeModified || modifyHeader(newOptions, header, headerName); + } + + // If there were no request-specific headers, modify the request entity's header to be compatible + if (entityHeader != null && contentTypeModified == false) { + contentTypeModified = modifyHeader(newOptions, entityHeader, headerName); + } + + return contentTypeModified; + } + + /** + * Modify the given header to be version compatible, if necessary. + * Returns true if a modification was made, false otherwise. + */ + boolean modifyHeader(RequestOptions.Builder newOptions, Header header, String headerName) { + for (EntityType type : EntityType.values()) { + final String headerValue = header.getValue(); + if (headerValue.startsWith(type.header())) { + String newHeaderValue = headerValue.replace(type.header(), type.compatibleHeader()); + newOptions.removeHeader(header.getName()); + newOptions.addHeader(headerName, newHeaderValue); + return true; + } + } + return false; + } + + /** + * Make all necessary changes to support API compatibility for the given request. This includes + * modifying the "Content-Type" and "Accept" headers if present, or modifying the header based + * on the request's entity type. + */ + void modifyRequestForCompatibility(Request request) { + final Header entityHeader = request.getEntity() == null ? null : request.getEntity().getContentType(); + final RequestOptions.Builder newOptions = request.getOptions().toBuilder(); + + addCompatibilityFor(newOptions, entityHeader, "Content-Type"); + if (request.getOptions().containsHeader("Accept")) { + addCompatibilityFor(newOptions, entityHeader, "Accept"); + } else { + // There is no entity, and no existing accept header, but we still need one + // with compatibility, so use the compatible JSON (default output) format + newOptions.addHeader("Accept", EntityType.JSON.compatibleHeader()); + } + request.setOptions(newOptions); + } + private Response performClientRequest(Request request) throws IOException { + // Add compatibility request headers if compatibility mode has been enabled + if (this.useAPICompatibility) { + modifyRequestForCompatibility(request); + } Optional versionValidation; try { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/RestHighLevelClientBuilder.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/RestHighLevelClientBuilder.java new file mode 100644 index 0000000000000..df2724f1f1982 --- /dev/null +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/RestHighLevelClientBuilder.java @@ -0,0 +1,51 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.client; + +import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.core.CheckedConsumer; + +import java.io.IOException; +import java.util.Collections; +import java.util.List; + +/** + * Helper to build a {@link RestHighLevelClient}, allowing setting the low-level client that + * should be used as well as whether API compatibility should be used. + */ + +public class RestHighLevelClientBuilder { + private final RestClient restClient; + private CheckedConsumer closeHandler = RestClient::close; + private List namedXContentEntries = Collections.emptyList(); + private Boolean apiCompatibilityMode = null; + + public RestHighLevelClientBuilder(RestClient restClient) { + this.restClient = restClient; + } + + public RestHighLevelClientBuilder closeHandler(CheckedConsumer closeHandler) { + this.closeHandler = closeHandler; + return this; + } + + public RestHighLevelClientBuilder namedXContentEntries(List namedXContentEntries) { + this.namedXContentEntries = namedXContentEntries; + return this; + } + + public RestHighLevelClientBuilder setApiCompatibilityMode(Boolean enabled) { + this.apiCompatibilityMode = enabled; + return this; + } + + public RestHighLevelClient build() { + return new RestHighLevelClient(this.restClient, this.closeHandler, this.namedXContentEntries, this.apiCompatibilityMode); + } +} diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/RestHighLevelClientTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/RestHighLevelClientTests.java index 45384216bd0d5..4f7511684f493 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/RestHighLevelClientTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/RestHighLevelClientTests.java @@ -10,6 +10,7 @@ import com.fasterxml.jackson.core.JsonParseException; +import org.apache.http.Header; import org.apache.http.HttpEntity; import org.apache.http.HttpHost; import org.apache.http.HttpResponse; @@ -19,6 +20,8 @@ import org.apache.http.StatusLine; import org.apache.http.client.methods.HttpGet; import org.apache.http.entity.ContentType; +import org.apache.http.entity.StringEntity; +import org.apache.http.message.BasicHeader; import org.apache.http.message.BasicHttpResponse; import org.apache.http.message.BasicRequestLine; import org.apache.http.message.BasicStatusLine; @@ -88,9 +91,7 @@ import org.elasticsearch.client.transform.transforms.TimeRetentionPolicyConfig; import org.elasticsearch.client.transform.transforms.TimeSyncConfig; import org.elasticsearch.cluster.ClusterName; -import org.elasticsearch.core.CheckedFunction; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.core.Tuple; import org.elasticsearch.common.util.set.Sets; import org.elasticsearch.common.xcontent.NamedXContentRegistry; import org.elasticsearch.common.xcontent.ToXContent; @@ -100,6 +101,8 @@ import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.common.xcontent.cbor.CborXContent; import org.elasticsearch.common.xcontent.smile.SmileXContent; +import org.elasticsearch.core.CheckedFunction; +import org.elasticsearch.core.Tuple; import org.elasticsearch.index.rankeval.DiscountedCumulativeGain; import org.elasticsearch.index.rankeval.EvaluationMetric; import org.elasticsearch.index.rankeval.ExpectedReciprocalRank; @@ -139,6 +142,7 @@ import java.util.Set; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; +import java.util.function.Function; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -147,6 +151,7 @@ import static org.hamcrest.CoreMatchers.endsWith; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.instanceOf; +import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.hasItems; import static org.mockito.Matchers.any; import static org.mockito.Matchers.argThat; @@ -1226,6 +1231,87 @@ public void testCancellationForwarding() throws Exception { verify(cancellable, times(1)).cancel(); } + public void testModifyHeader() { + RequestOptions.Builder builder = RequestOptions.DEFAULT.toBuilder(); + assertTrue(restHighLevelClient.modifyHeader(builder, + new BasicHeader("Content-Type", "application/json; Charset=UTF-16"), "Content-Type")); + + assertThat(builder.getHeaders().stream().map(h -> h.getName() + "=>" + h.getValue()).collect(Collectors.joining(",")), + containsString("Content-Type=>application/vnd.elasticsearch+json; compatible-with=7; Charset=UTF-16")); + + builder = RequestOptions.DEFAULT.toBuilder(); + assertFalse(restHighLevelClient.modifyHeader(builder, new BasicHeader("Content-Type", "other"), "Content-Type")); + + assertThat(builder.getHeaders().stream().map(h -> h.getName() + "=>" + h.getValue()).collect(Collectors.joining(",")), + equalTo("")); + } + + public void testAddCompatibilityFor() { + RequestOptions.Builder builder = RequestOptions.DEFAULT.toBuilder(); + Header entityHeader = new BasicHeader("Content-Type", "application/json"); + String headerName = "Content-Type"; + + // No request headers, use entity header + assertTrue(restHighLevelClient.addCompatibilityFor(builder, entityHeader, headerName)); + assertThat(builder.getHeaders().stream().map(h -> h.getName() + "=>" + h.getValue()).collect(Collectors.joining(",")), + containsString("Content-Type=>application/vnd.elasticsearch+json; compatible-with=7")); + + // Request has a header, ignore entity header + builder = RequestOptions.DEFAULT.toBuilder().addHeader("Content-Type", "application/yaml Charset=UTF-32"); + assertTrue(restHighLevelClient.addCompatibilityFor(builder, entityHeader, headerName)); + assertThat(builder.getHeaders().stream().map(h -> h.getName() + "=>" + h.getValue()).collect(Collectors.joining(",")), + containsString("Content-Type=>application/vnd.elasticsearch+yaml; compatible-with=7 Charset=UTF-32")); + + // Request has no headers, and no entity, no changes + builder = RequestOptions.DEFAULT.toBuilder(); + assertFalse(restHighLevelClient.addCompatibilityFor(builder, null, headerName)); + assertThat(builder.getHeaders().stream().map(h -> h.getName() + "=>" + h.getValue()).collect(Collectors.joining(",")), + equalTo("")); + } + + public void testModifyForCompatibility() { + final Function allHeaders = r -> + r.getOptions().getHeaders().stream().map(h -> h.getName() + "=>" + h.getValue()).collect(Collectors.joining(",")); + + Request req = new Request("POST", "/"); + + restHighLevelClient.modifyRequestForCompatibility(req); + + assertThat(allHeaders.apply(req), containsString("")); + + // With an entity + req = new Request("POST", "/"); + req.setEntity(new StringEntity("{}", ContentType.APPLICATION_JSON)); + restHighLevelClient.modifyRequestForCompatibility(req); + + assertThat(allHeaders.apply(req), + containsString("Content-Type=>application/vnd.elasticsearch+json; compatible-with=7; charset=UTF-8," + + "Accept=>application/vnd.elasticsearch+json; compatible-with=7")); + + // With "Content-Type" headers already set + req = new Request("POST", "/"); + req.setEntity(new StringEntity("{}", ContentType.TEXT_PLAIN)); + req.setOptions(RequestOptions.DEFAULT.toBuilder().addHeader("Content-Type", "application/json; Charset=UTF-16")); + restHighLevelClient.modifyRequestForCompatibility(req); + + assertThat(allHeaders.apply(req), + containsString("Content-Type=>application/vnd.elasticsearch+json; compatible-with=7; Charset=UTF-16," + + "Accept=>application/vnd.elasticsearch+json; compatible-with=7")); + + // With "Content-Type" and "Accept" headers already set + req = new Request("POST", "/"); + req.setEntity(new StringEntity("{}", ContentType.TEXT_PLAIN)); + req.setOptions(RequestOptions.DEFAULT.toBuilder() + .addHeader("Content-Type", "application/json; Charset=UTF-16") + .addHeader("Accept", "application/yaml; Charset=UTF-32")); + restHighLevelClient.modifyRequestForCompatibility(req); + + assertThat(allHeaders.apply(req), + containsString("Content-Type=>application/vnd.elasticsearch+json; compatible-with=7; Charset=UTF-16," + + "Accept=>application/vnd.elasticsearch+yaml; compatible-with=7; Charset=UTF-32")); + + } + private static void assertSyncMethod(Method method, String apiName, List booleanReturnMethods) { //A few methods return a boolean rather than a response object if (apiName.equals("ping") || apiName.contains("exist") || booleanReturnMethods.contains(apiName)) { diff --git a/client/rest/src/main/java/org/elasticsearch/client/RequestOptions.java b/client/rest/src/main/java/org/elasticsearch/client/RequestOptions.java index c5303cb18e055..6ddd3fa557966 100644 --- a/client/rest/src/main/java/org/elasticsearch/client/RequestOptions.java +++ b/client/rest/src/main/java/org/elasticsearch/client/RequestOptions.java @@ -71,6 +71,13 @@ public List
    getHeaders() { return headers; } + /** + * Return true if the options contain the given header + */ + public boolean containsHeader(String name) { + return headers.stream().anyMatch(h -> name.equalsIgnoreCase(h.getName())); + } + public Map getParameters() { return parameters; } @@ -202,6 +209,22 @@ public Builder addHeader(String name, String value) { return this; } + /** + * Remove all headers with the given name. + */ + public Builder removeHeader(String name) { + Objects.requireNonNull(name, "header name cannot be null"); + this.headers.removeIf(h -> name.equalsIgnoreCase(h.getName())); + return this; + } + + /** + * Return all headers for the request + */ + public List
    getHeaders() { + return this.headers; + } + /** * Add the provided parameter to the request. */ diff --git a/client/rest/src/main/java/org/elasticsearch/client/RestClient.java b/client/rest/src/main/java/org/elasticsearch/client/RestClient.java index b684682c412b1..c6a4236e9f841 100644 --- a/client/rest/src/main/java/org/elasticsearch/client/RestClient.java +++ b/client/rest/src/main/java/org/elasticsearch/client/RestClient.java @@ -28,9 +28,9 @@ import org.apache.http.HttpResponse; import org.apache.http.client.AuthCache; import org.apache.http.client.ClientProtocolException; +import org.apache.http.client.config.RequestConfig; import org.apache.http.client.entity.GzipCompressingEntity; import org.apache.http.client.entity.GzipDecompressingEntity; -import org.apache.http.client.config.RequestConfig; import org.apache.http.client.methods.HttpEntityEnclosingRequestBase; import org.apache.http.client.methods.HttpHead; import org.apache.http.client.methods.HttpOptions; @@ -51,7 +51,6 @@ import org.apache.http.nio.protocol.HttpAsyncResponseConsumer; import org.apache.http.protocol.HTTP; -import javax.net.ssl.SSLHandshakeException; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.Closeable; @@ -81,6 +80,7 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; import java.util.zip.GZIPOutputStream; +import javax.net.ssl.SSLHandshakeException; import static java.nio.charset.StandardCharsets.UTF_8; import static java.util.Collections.singletonList; @@ -103,7 +103,6 @@ * Requests can be traced by enabling trace logging for "tracer". The trace logger outputs requests and responses in curl format. */ public class RestClient implements Closeable { - private static final Log logger = LogFactory.getLog(RestClient.class); private final CloseableHttpAsyncClient client; diff --git a/client/rest/src/main/java/org/elasticsearch/client/RestClientBuilder.java b/client/rest/src/main/java/org/elasticsearch/client/RestClientBuilder.java index ed3e7f392a773..27550663b0e3e 100644 --- a/client/rest/src/main/java/org/elasticsearch/client/RestClientBuilder.java +++ b/client/rest/src/main/java/org/elasticsearch/client/RestClientBuilder.java @@ -30,7 +30,6 @@ import org.apache.http.protocol.HttpContext; import org.apache.http.util.VersionInfo; -import javax.net.ssl.SSLContext; import java.io.IOException; import java.io.InputStream; import java.security.AccessController; @@ -40,6 +39,7 @@ import java.util.Locale; import java.util.Objects; import java.util.Properties; +import javax.net.ssl.SSLContext; /** * Helps creating a new {@link RestClient}. Allows to set the most common http client configuration options when internally From 631e06698302793d3016c146a4b47b911f82e90d Mon Sep 17 00:00:00 2001 From: Nikola Grcevski <6207777+grcevski@users.noreply.github.com> Date: Thu, 7 Oct 2021 13:59:43 -0400 Subject: [PATCH 233/250] [TEST] More MetadataStateFormat tests (#78577) - Add test about partial failure on multi-paths - Add test for deleteMetaState Co-authored-by: Henning Andersen <33268011+henningandersen@users.noreply.github.com> --- .../gateway/MetadataStateFormat.java | 7 +- .../gateway/MetadataStateFormatTests.java | 143 +++++++++++++++++- 2 files changed, 144 insertions(+), 6 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/gateway/MetadataStateFormat.java b/server/src/main/java/org/elasticsearch/gateway/MetadataStateFormat.java index cc37538eaf5d4..d17a7c02924fe 100644 --- a/server/src/main/java/org/elasticsearch/gateway/MetadataStateFormat.java +++ b/server/src/main/java/org/elasticsearch/gateway/MetadataStateFormat.java @@ -343,7 +343,7 @@ public void cleanupOldFiles(final long currentGeneration, Path... locations) { * @return maximum id of state file or -1 if no such files are found * @throws IOException if IOException occurs */ - private long findMaxGenerationId(final String prefix, Path... locations) throws IOException { + long findMaxGenerationId(final String prefix, Path... locations) throws IOException { long maxId = -1; for (Path dataLocation : locations) { final Path resolve = dataLocation.resolve(STATE_DIR_NAME); @@ -362,7 +362,7 @@ private long findMaxGenerationId(final String prefix, Path... locations) throws return maxId; } - private List findStateFilesByGeneration(final long generation, Path... locations) { + List findStateFilesByGeneration(final long generation, Path... locations) { List files = new ArrayList<>(); if (generation == -1) { return files; @@ -430,6 +430,9 @@ public Tuple loadLatestStateWithGeneration(Logger logger, NamedXContent long generation = findMaxGenerationId(prefix, dataLocations); T state = loadGeneration(logger, namedXContentRegistry, generation, dataLocations); + // It may not be possible to get into this state, if there's a bad state file the above + // call will throw ElasticsearchException. If there are no state files, we won't find a + // generation. if (generation > -1 && state == null) { throw new IllegalStateException("unable to find state files with generation id " + generation + " returned by findMaxGenerationId function, in data folders [" + diff --git a/server/src/test/java/org/elasticsearch/gateway/MetadataStateFormatTests.java b/server/src/test/java/org/elasticsearch/gateway/MetadataStateFormatTests.java index f28c53f1b9a6d..c40b4c4b8b3dc 100644 --- a/server/src/test/java/org/elasticsearch/gateway/MetadataStateFormatTests.java +++ b/server/src/test/java/org/elasticsearch/gateway/MetadataStateFormatTests.java @@ -16,6 +16,7 @@ import org.apache.lucene.store.MockDirectoryWrapper; import org.apache.lucene.store.NIOFSDirectory; import org.apache.lucene.util.LuceneTestCase; +import org.elasticsearch.ElasticsearchException; import org.elasticsearch.cluster.ClusterModule; import org.elasticsearch.cluster.metadata.Metadata; import org.elasticsearch.common.xcontent.NamedXContentRegistry; @@ -34,6 +35,7 @@ import java.nio.file.Path; import java.nio.file.StandardOpenOption; import java.util.HashSet; +import java.util.List; import java.util.Set; import java.util.stream.StreamSupport; @@ -344,6 +346,121 @@ public void testFailRandomlyAndReadAnyState() throws IOException { writeAndReadStateSuccessfully(format, paths); } + public void testInconsistentMultiPathState() throws IOException { + Path paths[] = new Path[3]; + for (int i = 0; i < paths.length; i++) { + paths[i] = createTempDir(); + } + Format format = new Format("foo-"); + + DummyState state = new DummyState(randomRealisticUnicodeOfCodepointLengthBetween(1, 100), randomInt(), randomLong(), + randomDouble(), randomBoolean()); + // Call write without clean-up to simulate multi-write transaction. + long genId = format.write(state, paths); + assertEquals(state, format.loadLatestState(logger, NamedXContentRegistry.EMPTY, paths)); + ensureOnlyOneStateFile(paths); + + for (Path path : paths) { + assertEquals(genId, format.findMaxGenerationId("foo-", path)); + } + assertEquals(0, format.findStateFilesByGeneration(-1, paths).size()); + assertEquals(paths.length, format.findStateFilesByGeneration(genId, paths).size()); + + Path badPath = paths[paths.length-1]; + + format.failOnPaths(badPath.resolve(MetadataStateFormat.STATE_DIR_NAME)); + format.failOnMethods(Format.FAIL_RENAME_TMP_FILE); + + DummyState newState = new DummyState(randomRealisticUnicodeOfCodepointLengthBetween(1, 100), randomInt(), randomLong(), + randomDouble(), randomBoolean()); + + expectThrows(WriteStateException.class, () -> format.write(newState, paths)); + long firstPathId = format.findMaxGenerationId("foo-", paths[0]); + assertEquals(firstPathId, format.findMaxGenerationId("foo-", paths[1])); + assertEquals(genId, format.findMaxGenerationId("foo-", badPath)); + assertEquals(genId, firstPathId-1); + + // Since at least one path has the latest generation, we should find the latest + // generation when we supply all paths. + long allPathsId = format.findMaxGenerationId("foo-", paths); + assertEquals(firstPathId, allPathsId); + + // Assert that we can find the new state since one path successfully wrote it. + assertEquals(newState, format.loadLatestState(logger, NamedXContentRegistry.EMPTY, paths)); + } + + public void testDeleteMetaState() throws IOException { + Path paths[] = new Path[3]; + for (int i = 0; i < paths.length; i++) { + paths[i] = createTempDir(); + } + Format format = new Format("foo-"); + + DummyState state = new DummyState(randomRealisticUnicodeOfCodepointLengthBetween(1, 100), randomInt(), randomLong(), + randomDouble(), randomBoolean()); + long genId = format.write(state, paths); + assertEquals(state, format.loadLatestState(logger, NamedXContentRegistry.EMPTY, paths)); + ensureOnlyOneStateFile(paths); + + for (Path path : paths) { + assertEquals(genId, format.findMaxGenerationId("foo-", path)); + } + assertEquals(0, format.findStateFilesByGeneration(-1, paths).size()); + assertEquals(paths.length, format.findStateFilesByGeneration(genId, paths).size()); + + Format.deleteMetaState(paths); + + assertEquals(0, format.findStateFilesByGeneration(genId, paths).size()); + + for (Path path : paths) { + assertEquals(false, Files.exists(path.resolve(MetadataStateFormat.STATE_DIR_NAME))); + } + + // We shouldn't find any state or state generations anymore + assertEquals(-1, format.findMaxGenerationId("foo-", paths)); + assertNull(format.loadLatestState(logger, NamedXContentRegistry.EMPTY, paths)); + } + + public void testCleanupOldFilesWithErrorPath() throws IOException { + Path paths[] = new Path[3]; + for (int i = 0; i < paths.length; i++) { + paths[i] = createTempDir(); + } + Format format = new Format("foo-"); + + DummyState state = new DummyState(randomRealisticUnicodeOfCodepointLengthBetween(1, 100), randomInt(), randomLong(), + randomDouble(), randomBoolean()); + long genId = format.write(state, paths); + assertEquals(state, format.loadLatestState(logger, NamedXContentRegistry.EMPTY, paths)); + ensureOnlyOneStateFile(paths); + + for (Path path : paths) { + assertEquals(genId, format.findMaxGenerationId("foo-", path)); + } + assertEquals(0, format.findStateFilesByGeneration(-1, paths).size()); + assertEquals(paths.length, format.findStateFilesByGeneration(genId, paths).size()); + + List stateFiles = format.findStateFilesByGeneration(genId, paths); + + final int badDirIndex = 1; + + format.failOnPaths(paths[badDirIndex].resolve(MetadataStateFormat.STATE_DIR_NAME)); + format.failOnMethods(Format.FAIL_DELETE_TMP_FILE); + + // Ensure clean-up old files doesn't fail with one bad dir. We pretend we want to + // keep a newer generation that doesn't exist (genId + 1). + format.cleanupOldFiles(genId + 1, paths); + + // We simulated failure on deleting one stale state file, there should be one that's remaining from the old state. + // We'll corrupt this remaining file and check to see if loading the state throws an exception. + // All other state files, including the first directory uncorrupted state files should be cleaned up. + corruptFile(stateFiles.get(badDirIndex), logger); + + assertThat(expectThrows(ElasticsearchException.class, + () -> format.loadLatestStateWithGeneration(logger, xContentRegistry(), paths)).getMessage(), + equalTo("java.io.IOException: failed to read " + stateFiles.get(badDirIndex))); + } + private static class Format extends MetadataStateFormat { private enum FailureMode { NO_FAILURES, @@ -353,6 +470,7 @@ private enum FailureMode { private FailureMode failureMode; private String[] failureMethods; + private Path[] failurePaths; static final String FAIL_CREATE_OUTPUT_FILE = "createOutput"; static final String FAIL_WRITE_TO_OUTPUT_FILE = "writeBytes"; @@ -361,6 +479,7 @@ private enum FailureMode { static final String FAIL_FSYNC_STATE_DIRECTORY = "syncMetaData"; static final String FAIL_DELETE_TMP_FILE = "deleteFile"; static final String FAIL_OPEN_STATE_FILE_WHEN_COPYING = "openInput"; + static final String FAIL_LIST_ALL = "listAll"; /** * Constructs a MetadataStateFormat object for storing/retrieving DummyState. @@ -392,10 +511,26 @@ public void failOnMethods(String... failureMethods) { this.failureMethods = failureMethods; } + public void failOnPaths(Path... paths) { + this.failurePaths = paths; + } + public void failRandomly() { this.failureMode = FailureMode.FAIL_RANDOMLY; } + private void throwDirectoryExceptionCheckPaths(Path dir) throws MockDirectoryWrapper.FakeIOException { + if (failurePaths != null) { + for (Path p : failurePaths) { + if (p.equals(dir)) { + throw new MockDirectoryWrapper.FakeIOException(); + } + } + } else { + throw new MockDirectoryWrapper.FakeIOException(); + } + } + @Override protected Directory newDirectory(Path dir) { MockDirectoryWrapper mock = newMockFSDirectory(dir); @@ -403,10 +538,10 @@ protected Directory newDirectory(Path dir) { final String failMethod = randomFrom(failureMethods); MockDirectoryWrapper.Failure fail = new MockDirectoryWrapper.Failure() { @Override - public void eval(MockDirectoryWrapper dir) throws IOException { + public void eval(MockDirectoryWrapper directory) throws IOException { for (StackTraceElement e : Thread.currentThread().getStackTrace()) { if (failMethod.equals(e.getMethodName())) { - throw new MockDirectoryWrapper.FakeIOException(); + throwDirectoryExceptionCheckPaths(dir); } } } @@ -415,9 +550,9 @@ public void eval(MockDirectoryWrapper dir) throws IOException { } else if (failureMode == FailureMode.FAIL_RANDOMLY) { MockDirectoryWrapper.Failure fail = new MockDirectoryWrapper.Failure() { @Override - public void eval(MockDirectoryWrapper dir) throws IOException { + public void eval(MockDirectoryWrapper directory) throws IOException { if (randomIntBetween(0, 20) == 0) { - throw new MockDirectoryWrapper.FakeIOException(); + throwDirectoryExceptionCheckPaths(dir); } } }; From 0a28c7cb914f70ed8083177013c99231e7493219 Mon Sep 17 00:00:00 2001 From: William Brafford Date: Thu, 7 Oct 2021 15:18:47 -0400 Subject: [PATCH 234/250] Implement GET API for System Feature Upgrades (#78642) * Implement and test get feature upgrade status API * Add integration test for feature upgrade endpoint * Use constant enum for statuses * Add unit tests for transport class methods --- .../org/elasticsearch/client/MigrationIT.java | 25 +++-- .../GetFeatureUpgradeStatusResponseTests.java | 17 +-- .../migration/apis/feature_upgrade.asciidoc | 79 ++++++++++++-- .../upgrades/FeatureUpgradeIT.java | 103 ++++++++++++++++++ .../system/indices/FeatureUpgradeApiIT.java | 70 ++++++++++++ .../GetFeatureUpgradeStatusResponse.java | 77 +++++++++---- ...ransportGetFeatureUpgradeStatusAction.java | 65 +++++++++-- .../GetFeatureUpgradeStatusResponseTests.java | 17 +-- ...ortGetFeatureUpgradeStatusActionTests.java | 101 +++++++++++++++++ 9 files changed, 490 insertions(+), 64 deletions(-) create mode 100644 qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/FeatureUpgradeIT.java create mode 100644 qa/system-indices/src/javaRestTest/java/org/elasticsearch/system/indices/FeatureUpgradeApiIT.java create mode 100644 server/src/test/java/org/elasticsearch/action/admin/cluster/migration/TransportGetFeatureUpgradeStatusActionTests.java diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/MigrationIT.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/MigrationIT.java index 219e41ade3980..06ee1c97039f6 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/MigrationIT.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/MigrationIT.java @@ -8,6 +8,7 @@ package org.elasticsearch.client; +import org.elasticsearch.Version; import org.elasticsearch.client.migration.DeprecationInfoRequest; import org.elasticsearch.client.migration.DeprecationInfoResponse; import org.elasticsearch.client.migration.GetFeatureUpgradeStatusRequest; @@ -18,8 +19,11 @@ import java.io.IOException; import java.util.Collections; +import java.util.Optional; import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.greaterThanOrEqualTo; +import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.nullValue; public class MigrationIT extends ESRestHighLevelClientTestCase { @@ -38,19 +42,24 @@ public void testGetDeprecationInfo() throws IOException { public void testGetFeatureUpgradeStatus() throws IOException { GetFeatureUpgradeStatusRequest request = new GetFeatureUpgradeStatusRequest(); GetFeatureUpgradeStatusResponse response = highLevelClient().migration().getFeatureUpgradeStatus(request, RequestOptions.DEFAULT); - assertThat(response.getUpgradeStatus(), equalTo("UPGRADE_NEEDED")); - assertThat(response.getFeatureUpgradeStatuses().size(), equalTo(1)); - GetFeatureUpgradeStatusResponse.FeatureUpgradeStatus status = response.getFeatureUpgradeStatuses().get(0); - assertThat(status.getUpgradeStatus(), equalTo("UPGRADE_NEEDED")); - assertThat(status.getMinimumIndexVersion(), equalTo("7.1.1")); - assertThat(status.getFeatureName(), equalTo("security")); - assertThat(status.getIndexVersions().size(), equalTo(1)); + assertThat(response.getUpgradeStatus(), equalTo("NO_UPGRADE_NEEDED")); + assertThat(response.getFeatureUpgradeStatuses().size(), greaterThanOrEqualTo(1)); + Optional optionalTasksStatus = response.getFeatureUpgradeStatuses().stream() + .filter(status -> "tasks".equals(status.getFeatureName())) + .findFirst(); + + assertThat(optionalTasksStatus.isPresent(), is(true)); + + GetFeatureUpgradeStatusResponse.FeatureUpgradeStatus tasksStatus = optionalTasksStatus.get(); + + assertThat(tasksStatus.getUpgradeStatus(), equalTo("NO_UPGRADE_NEEDED")); + assertThat(tasksStatus.getMinimumIndexVersion(), equalTo(Version.CURRENT.toString())); + assertThat(tasksStatus.getFeatureName(), equalTo("tasks")); } public void testPostFeatureUpgradeStatus() throws IOException { PostFeatureUpgradeRequest request = new PostFeatureUpgradeRequest(); PostFeatureUpgradeResponse response = highLevelClient().migration().postFeatureUpgrade(request, RequestOptions.DEFAULT); - // a test like this cannot test actual deprecations assertThat(response.isAccepted(), equalTo(true)); assertThat(response.getFeatures().size(), equalTo(1)); PostFeatureUpgradeResponse.Feature feature = response.getFeatures().get(0); diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/migration/GetFeatureUpgradeStatusResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/migration/GetFeatureUpgradeStatusResponseTests.java index 9c9c4ef32b514..e478a24442978 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/migration/GetFeatureUpgradeStatusResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/migration/GetFeatureUpgradeStatusResponseTests.java @@ -8,6 +8,7 @@ package org.elasticsearch.client.migration; +import org.elasticsearch.Version; import org.elasticsearch.client.AbstractResponseTestCase; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentType; @@ -37,14 +38,14 @@ protected org.elasticsearch.action.admin.cluster.migration.GetFeatureUpgradeStat randomList(5, () -> new org.elasticsearch.action.admin.cluster.migration.GetFeatureUpgradeStatusResponse.FeatureUpgradeStatus( randomAlphaOfLengthBetween(3, 20), - randomAlphaOfLengthBetween(5, 9), - randomAlphaOfLengthBetween(4, 16), + randomFrom(Version.CURRENT, Version.CURRENT.minimumCompatibilityVersion()), + randomFrom(org.elasticsearch.action.admin.cluster.migration.GetFeatureUpgradeStatusResponse.UpgradeStatus.values()), randomList(4, () -> new org.elasticsearch.action.admin.cluster.migration.GetFeatureUpgradeStatusResponse.IndexVersion( randomAlphaOfLengthBetween(3, 20), - randomAlphaOfLengthBetween(5, 9))) + randomFrom(Version.CURRENT, Version.CURRENT.minimumCompatibilityVersion()))) )), - randomAlphaOfLength(5) + randomFrom(org.elasticsearch.action.admin.cluster.migration.GetFeatureUpgradeStatusResponse.UpgradeStatus.values()) ); } @@ -58,7 +59,7 @@ protected void assertInstances( org.elasticsearch.action.admin.cluster.migration.GetFeatureUpgradeStatusResponse serverTestInstance, GetFeatureUpgradeStatusResponse clientInstance) { - assertThat(clientInstance.getUpgradeStatus(), equalTo(serverTestInstance.getUpgradeStatus())); + assertThat(clientInstance.getUpgradeStatus(), equalTo(serverTestInstance.getUpgradeStatus().toString())); assertNotNull(serverTestInstance.getFeatureUpgradeStatuses()); assertNotNull(clientInstance.getFeatureUpgradeStatuses()); @@ -71,8 +72,8 @@ protected void assertInstances( GetFeatureUpgradeStatusResponse.FeatureUpgradeStatus clientStatus = clientInstance.getFeatureUpgradeStatuses().get(i); assertThat(clientStatus.getFeatureName(), equalTo(serverTestStatus.getFeatureName())); - assertThat(clientStatus.getMinimumIndexVersion(), equalTo(serverTestStatus.getMinimumIndexVersion())); - assertThat(clientStatus.getUpgradeStatus(), equalTo(serverTestStatus.getUpgradeStatus())); + assertThat(clientStatus.getMinimumIndexVersion(), equalTo(serverTestStatus.getMinimumIndexVersion().toString())); + assertThat(clientStatus.getUpgradeStatus(), equalTo(serverTestStatus.getUpgradeStatus().toString())); assertThat(clientStatus.getIndexVersions(), hasSize(serverTestStatus.getIndexVersions().size())); @@ -82,7 +83,7 @@ protected void assertInstances( GetFeatureUpgradeStatusResponse.IndexVersion clientIndexVersion = clientStatus.getIndexVersions().get(j); assertThat(clientIndexVersion.getIndexName(), equalTo(serverIndexVersion.getIndexName())); - assertThat(clientIndexVersion.getVersion(), equalTo(serverIndexVersion.getVersion())); + assertThat(clientIndexVersion.getVersion(), equalTo(serverIndexVersion.getVersion().toString())); } } } diff --git a/docs/reference/migration/apis/feature_upgrade.asciidoc b/docs/reference/migration/apis/feature_upgrade.asciidoc index 7c50460e8b27d..88cd5d477f4d2 100644 --- a/docs/reference/migration/apis/feature_upgrade.asciidoc +++ b/docs/reference/migration/apis/feature_upgrade.asciidoc @@ -43,19 +43,80 @@ Example response: -------------------------------------------------- { "features" : [ + { + "feature_name" : "async_search", + "minimum_index_version" : "8.0.0", + "upgrade_status" : "NO_UPGRADE_NEEDED", + "indices" : [ ] + }, + { + "feature_name" : "enrich", + "minimum_index_version" : "8.0.0", + "upgrade_status" : "NO_UPGRADE_NEEDED", + "indices" : [ ] + }, + { + "feature_name" : "fleet", + "minimum_index_version" : "8.0.0", + "upgrade_status" : "NO_UPGRADE_NEEDED", + "indices" : [ ] + }, + { + "feature_name" : "geoip", + "minimum_index_version" : "8.0.0", + "upgrade_status" : "NO_UPGRADE_NEEDED", + "indices" : [ ] + }, + { + "feature_name" : "kibana", + "minimum_index_version" : "8.0.0", + "upgrade_status" : "NO_UPGRADE_NEEDED", + "indices" : [ ] + }, + { + "feature_name" : "logstash_management", + "minimum_index_version" : "8.0.0", + "upgrade_status" : "NO_UPGRADE_NEEDED", + "indices" : [ ] + }, + { + "feature_name" : "machine_learning", + "minimum_index_version" : "8.0.0", + "upgrade_status" : "NO_UPGRADE_NEEDED", + "indices" : [ ] + }, + { + "feature_name" : "searchable_snapshots", + "minimum_index_version" : "8.0.0", + "upgrade_status" : "NO_UPGRADE_NEEDED", + "indices" : [ ] + }, { "feature_name" : "security", - "minimum_index_version" : "7.1.1", - "upgrade_status" : "UPGRADE_NEEDED", - "indices" : [ - { - "index" : ".security-7", - "version" : "7.1.1" - } - ] + "minimum_index_version" : "8.0.0", + "upgrade_status" : "NO_UPGRADE_NEEDED", + "indices" : [ ] + }, + { + "feature_name" : "tasks", + "minimum_index_version" : "8.0.0", + "upgrade_status" : "NO_UPGRADE_NEEDED", + "indices" : [ ] + }, + { + "feature_name" : "transform", + "minimum_index_version" : "8.0.0", + "upgrade_status" : "NO_UPGRADE_NEEDED", + "indices" : [ ] + }, + { + "feature_name" : "watcher", + "minimum_index_version" : "8.0.0", + "upgrade_status" : "NO_UPGRADE_NEEDED", + "indices" : [ ] } ], - "upgrade_status" : "UPGRADE_NEEDED" + "upgrade_status" : "NO_UPGRADE_NEEDED" } -------------------------------------------------- diff --git a/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/FeatureUpgradeIT.java b/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/FeatureUpgradeIT.java new file mode 100644 index 0000000000000..8bba5325cec8d --- /dev/null +++ b/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/FeatureUpgradeIT.java @@ -0,0 +1,103 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.upgrades; + +import org.elasticsearch.Version; +import org.elasticsearch.client.Request; +import org.elasticsearch.client.ResponseException; +import org.elasticsearch.test.XContentTestUtils; + +import java.util.Collections; +import java.util.List; +import java.util.Map; + +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.is; + +public class FeatureUpgradeIT extends AbstractRollingTestCase { + + @SuppressWarnings("unchecked") + public void testGetFeatureUpgradeStatus() throws Exception { + + final String systemIndexWarning = "this request accesses system indices: [.tasks], but in a future major version, direct " + + "access to system indices will be prevented by default"; + if (CLUSTER_TYPE == ClusterType.OLD) { + // setup - put something in the tasks index + // create index + Request createTestIndex = new Request("PUT", "/feature_test_index_old"); + createTestIndex.setJsonEntity("{\"settings\": {\"index.number_of_replicas\": 0}}"); + client().performRequest(createTestIndex); + + Request bulk = new Request("POST", "/_bulk"); + bulk.addParameter("refresh", "true"); + bulk.setJsonEntity("{\"index\": {\"_index\": \"feature_test_index_old\"}}\n" + + "{\"f1\": \"v1\", \"f2\": \"v2\"}\n"); + client().performRequest(bulk); + + // start a async reindex job + Request reindex = new Request("POST", "/_reindex"); + reindex.setJsonEntity( + "{\n" + + " \"source\":{\n" + + " \"index\":\"feature_test_index_old\"\n" + + " },\n" + + " \"dest\":{\n" + + " \"index\":\"feature_test_index_reindex\"\n" + + " }\n" + + "}"); + reindex.addParameter("wait_for_completion", "false"); + Map response = entityAsMap(client().performRequest(reindex)); + String taskId = (String) response.get("task"); + + // wait for task + Request getTask = new Request("GET", "/_tasks/" + taskId); + getTask.addParameter("wait_for_completion", "true"); + client().performRequest(getTask); + + // make sure .tasks index exists + Request getTasksIndex = new Request("GET", "/.tasks"); + getTasksIndex.setOptions(expectVersionSpecificWarnings(v -> { + v.current(systemIndexWarning); + v.compatible(systemIndexWarning); + })); + getTasksIndex.addParameter("allow_no_indices", "false"); + + assertBusy(() -> { + try { + assertThat(client().performRequest(getTasksIndex).getStatusLine().getStatusCode(), is(200)); + } catch (ResponseException e) { + throw new AssertionError(".tasks index does not exist yet"); + } + }); + + } else if (CLUSTER_TYPE == ClusterType.UPGRADED) { + // check results + assertBusy(() -> { + Request clusterStateRequest = new Request("GET", "/_migration/system_features"); + XContentTestUtils.JsonMapView view = new XContentTestUtils.JsonMapView( + entityAsMap(client().performRequest(clusterStateRequest))); + + List> features = view.get("features"); + Map feature = features.stream() + .filter(e -> "tasks".equals(e.get("feature_name"))) + .findFirst() + .orElse(Collections.emptyMap()); + + assertThat(feature.size(), equalTo(4)); + assertThat(feature.get("minimum_index_version"), equalTo(UPGRADE_FROM_VERSION.toString())); + if (UPGRADE_FROM_VERSION.before(Version.CURRENT.minimumIndexCompatibilityVersion())) { + assertThat(feature.get("upgrade_status"), equalTo("UPGRADE_NEEDED")); + } else { + assertThat(feature.get("upgrade_status"), equalTo("NO_UPGRADE_NEEDED")); + } + }); + } + } + +} diff --git a/qa/system-indices/src/javaRestTest/java/org/elasticsearch/system/indices/FeatureUpgradeApiIT.java b/qa/system-indices/src/javaRestTest/java/org/elasticsearch/system/indices/FeatureUpgradeApiIT.java new file mode 100644 index 0000000000000..af9839a772a10 --- /dev/null +++ b/qa/system-indices/src/javaRestTest/java/org/elasticsearch/system/indices/FeatureUpgradeApiIT.java @@ -0,0 +1,70 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.system.indices; + +import org.elasticsearch.Version; +import org.elasticsearch.client.Request; +import org.elasticsearch.client.Response; +import org.elasticsearch.common.settings.SecureString; +import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.common.util.concurrent.ThreadContext; +import org.elasticsearch.test.XContentTestUtils; +import org.elasticsearch.test.rest.ESRestTestCase; +import org.junit.After; + +import java.util.Collections; +import java.util.List; +import java.util.Map; + +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.hasSize; +import static org.hamcrest.Matchers.instanceOf; +import static org.hamcrest.Matchers.is; + +public class FeatureUpgradeApiIT extends ESRestTestCase { + + static final String BASIC_AUTH_VALUE = basicAuthHeaderValue("rest_user", new SecureString("rest-user-password".toCharArray())); + + @After + public void resetFeatures() throws Exception { + client().performRequest(new Request("POST", "/_features/_reset")); + } + + @Override + protected Settings restClientSettings() { + return Settings.builder().put(ThreadContext.PREFIX + ".Authorization", BASIC_AUTH_VALUE).build(); + } + + public void testCreatingSystemIndex() throws Exception { + Response response = client().performRequest(new Request("PUT", "/_net_new_sys_index/_create")); + assertThat(response.getStatusLine().getStatusCode(), is(200)); + } + + @SuppressWarnings("unchecked") + public void testGetFeatureUpgradedStatuses() throws Exception { + client().performRequest(new Request("PUT", "/_net_new_sys_index/_create")); + Response response = client().performRequest(new Request("GET", "/_migration/system_features")); + assertThat(response.getStatusLine().getStatusCode(), is(200)); + XContentTestUtils.JsonMapView view = XContentTestUtils.createJsonMapView(response.getEntity().getContent()); + String upgradeStatus = view.get("upgrade_status"); + assertThat(upgradeStatus, equalTo("NO_UPGRADE_NEEDED")); + List> features = view.get("features"); + Map testFeature = features.stream() + .filter(feature -> "system indices qa".equals(feature.get("feature_name"))) + .findFirst() + .orElse(Collections.emptyMap()); + + assertThat(testFeature.size(), equalTo(4)); + assertThat(testFeature.get("minimum_index_version"), equalTo(Version.CURRENT.toString())); + assertThat(testFeature.get("upgrade_status"), equalTo("NO_UPGRADE_NEEDED")); + assertThat(testFeature.get("indices"), instanceOf(List.class)); + + assertThat((List) testFeature.get("indices"), hasSize(1)); + } +} diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/migration/GetFeatureUpgradeStatusResponse.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/migration/GetFeatureUpgradeStatusResponse.java index 63e0fd451fad4..3e46b4d4b6fa3 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/migration/GetFeatureUpgradeStatusResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/migration/GetFeatureUpgradeStatusResponse.java @@ -8,6 +8,7 @@ package org.elasticsearch.action.admin.cluster.migration; +import org.elasticsearch.Version; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -27,13 +28,13 @@ public class GetFeatureUpgradeStatusResponse extends ActionResponse implements ToXContentObject { private final List featureUpgradeStatuses; - private final String upgradeStatus; + private final UpgradeStatus upgradeStatus; /** * @param statuses A list of feature statuses * @param upgradeStatus Whether system features need to be upgraded */ - public GetFeatureUpgradeStatusResponse(List statuses, String upgradeStatus) { + public GetFeatureUpgradeStatusResponse(List statuses, UpgradeStatus upgradeStatus) { this.featureUpgradeStatuses = Objects.nonNull(statuses) ? statuses : Collections.emptyList(); this.upgradeStatus = upgradeStatus; } @@ -45,7 +46,7 @@ public GetFeatureUpgradeStatusResponse(List statuses, Stri public GetFeatureUpgradeStatusResponse(StreamInput in) throws IOException { super(in); this.featureUpgradeStatuses = in.readList(FeatureUpgradeStatus::new); - this.upgradeStatus = in.readString(); + this.upgradeStatus = in.readEnum(UpgradeStatus.class); } @Override @@ -64,14 +65,14 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws @Override public void writeTo(StreamOutput out) throws IOException { out.writeList(this.featureUpgradeStatuses); - out.writeString(upgradeStatus); + out.writeEnum(upgradeStatus); } public List getFeatureUpgradeStatuses() { return featureUpgradeStatuses; } - public String getUpgradeStatus() { + public UpgradeStatus getUpgradeStatus() { return upgradeStatus; } @@ -88,14 +89,28 @@ public int hashCode() { return Objects.hash(featureUpgradeStatuses, upgradeStatus); } + @Override + public String toString() { + return "GetFeatureUpgradeStatusResponse{" + + "featureUpgradeStatuses=" + featureUpgradeStatuses + + ", upgradeStatus='" + upgradeStatus + '\'' + + '}'; + } + + public enum UpgradeStatus { + UPGRADE_NEEDED, + NO_UPGRADE_NEEDED, + IN_PROGRESS + } + /** * A class for a particular feature, showing whether it needs to be upgraded and the earliest * Elasticsearch version used to create one of this feature's system indices. */ public static class FeatureUpgradeStatus implements Writeable, ToXContentObject { private final String featureName; - private final String minimumIndexVersion; - private final String upgradeStatus; + private final Version minimumIndexVersion; + private final UpgradeStatus upgradeStatus; private final List indexVersions; /** @@ -104,8 +119,8 @@ public static class FeatureUpgradeStatus implements Writeable, ToXContentObject * @param upgradeStatus Whether the feature needs to be upgraded * @param indexVersions A list of this feature's concrete indices and the Elasticsearch version that created them */ - public FeatureUpgradeStatus(String featureName, String minimumIndexVersion, - String upgradeStatus, List indexVersions) { + public FeatureUpgradeStatus(String featureName, Version minimumIndexVersion, + UpgradeStatus upgradeStatus, List indexVersions) { this.featureName = featureName; this.minimumIndexVersion = minimumIndexVersion; this.upgradeStatus = upgradeStatus; @@ -118,8 +133,8 @@ public FeatureUpgradeStatus(String featureName, String minimumIndexVersion, */ public FeatureUpgradeStatus(StreamInput in) throws IOException { this.featureName = in.readString(); - this.minimumIndexVersion = in.readString(); - this.upgradeStatus = in.readString(); + this.minimumIndexVersion = Version.readVersion(in); + this.upgradeStatus = in.readEnum(UpgradeStatus.class); this.indexVersions = in.readList(IndexVersion::new); } @@ -127,11 +142,11 @@ public String getFeatureName() { return this.featureName; } - public String getMinimumIndexVersion() { + public Version getMinimumIndexVersion() { return this.minimumIndexVersion; } - public String getUpgradeStatus() { + public UpgradeStatus getUpgradeStatus() { return this.upgradeStatus; } @@ -142,8 +157,8 @@ public List getIndexVersions() { @Override public void writeTo(StreamOutput out) throws IOException { out.writeString(this.featureName); - out.writeString(this.minimumIndexVersion); - out.writeString(this.upgradeStatus); + Version.writeVersion(this.minimumIndexVersion, out); + out.writeEnum(this.upgradeStatus); out.writeList(this.indexVersions); } @@ -151,7 +166,7 @@ public void writeTo(StreamOutput out) throws IOException { public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { builder.startObject(); builder.field("feature_name", this.featureName); - builder.field("minimum_index_version", this.minimumIndexVersion); + builder.field("minimum_index_version", this.minimumIndexVersion.toString()); builder.field("upgrade_status", this.upgradeStatus); builder.startArray("indices"); for (IndexVersion version : this.indexVersions) { @@ -177,6 +192,16 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash(featureName, minimumIndexVersion, upgradeStatus, indexVersions); } + + @Override + public String toString() { + return "FeatureUpgradeStatus{" + + "featureName='" + featureName + '\'' + + ", minimumIndexVersion='" + minimumIndexVersion + '\'' + + ", upgradeStatus='" + upgradeStatus + '\'' + + ", indexVersions=" + indexVersions + + '}'; + } } /** @@ -184,13 +209,13 @@ public int hashCode() { */ public static class IndexVersion implements Writeable, ToXContentObject { private final String indexName; - private final String version; + private final Version version; /** * @param indexName Name of the index * @param version Version of Elasticsearch that created the index */ - public IndexVersion(String indexName, String version) { + public IndexVersion(String indexName, Version version) { this.indexName = indexName; this.version = version; } @@ -201,28 +226,28 @@ public IndexVersion(String indexName, String version) { */ public IndexVersion(StreamInput in) throws IOException { this.indexName = in.readString(); - this.version = in.readString(); + this.version = Version.readVersion(in); } public String getIndexName() { return this.indexName; } - public String getVersion() { + public Version getVersion() { return this.version; } @Override public void writeTo(StreamOutput out) throws IOException { out.writeString(this.indexName); - out.writeString(this.version); + Version.writeVersion(this.version, out); } @Override public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { builder.startObject(); builder.field("index", this.indexName); - builder.field("version", this.version); + builder.field("version", this.version.toString()); builder.endObject(); return builder; } @@ -239,5 +264,13 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash(indexName, version); } + + @Override + public String toString() { + return "IndexVersion{" + + "indexName='" + indexName + '\'' + + ", version='" + version + '\'' + + '}'; + } } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/migration/TransportGetFeatureUpgradeStatusAction.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/migration/TransportGetFeatureUpgradeStatusAction.java index 77261d9463304..b8777d91437e1 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/migration/TransportGetFeatureUpgradeStatusAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/migration/TransportGetFeatureUpgradeStatusAction.java @@ -8,6 +8,7 @@ package org.elasticsearch.action.admin.cluster.migration; +import org.elasticsearch.Version; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.support.ActionFilters; import org.elasticsearch.action.support.master.TransportMasterNodeAction; @@ -22,8 +23,14 @@ import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.TransportService; -import java.util.ArrayList; +import java.util.Collection; import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import static org.elasticsearch.action.admin.cluster.migration.GetFeatureUpgradeStatusResponse.UpgradeStatus.NO_UPGRADE_NEEDED; +import static org.elasticsearch.action.admin.cluster.migration.GetFeatureUpgradeStatusResponse.UpgradeStatus.UPGRADE_NEEDED; /** * Transport class for the get feature upgrade status action @@ -60,16 +67,54 @@ public TransportGetFeatureUpgradeStatusAction( @Override protected void masterOperation(Task task, GetFeatureUpgradeStatusRequest request, ClusterState state, ActionListener listener) throws Exception { - List indexVersions = new ArrayList<>(); - indexVersions.add(new GetFeatureUpgradeStatusResponse.IndexVersion(".security-7", "7.1.1")); - List features = new ArrayList<>(); - features.add(new GetFeatureUpgradeStatusResponse.FeatureUpgradeStatus( - "security", - "7.1.1", - "UPGRADE_NEEDED", + + List features = systemIndices.getFeatures().entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .map(entry -> getFeatureUpgradeStatus(state, entry)) + .collect(Collectors.toList()); + + boolean isUpgradeNeeded = features.stream() + .map(GetFeatureUpgradeStatusResponse.FeatureUpgradeStatus::getMinimumIndexVersion) + .min(Version::compareTo) + .orElse(Version.CURRENT) + .before(Version.V_7_0_0); + + listener.onResponse(new GetFeatureUpgradeStatusResponse(features, isUpgradeNeeded ? UPGRADE_NEEDED : NO_UPGRADE_NEEDED)); + } + + // visible for testing + static GetFeatureUpgradeStatusResponse.FeatureUpgradeStatus getFeatureUpgradeStatus( + ClusterState state, Map.Entry entry) { + + String featureName = entry.getKey(); + SystemIndices.Feature feature = entry.getValue(); + + List indexVersions = getIndexVersions(state, feature); + + Version minimumVersion = indexVersions.stream() + .map(GetFeatureUpgradeStatusResponse.IndexVersion::getVersion) + .min(Version::compareTo) + .orElse(Version.CURRENT); + + return new GetFeatureUpgradeStatusResponse.FeatureUpgradeStatus( + featureName, + minimumVersion, + minimumVersion.before(Version.V_7_0_0) ? UPGRADE_NEEDED : NO_UPGRADE_NEEDED, indexVersions - )); - listener.onResponse(new GetFeatureUpgradeStatusResponse(features, "UPGRADE_NEEDED")); + ); + } + + // visible for testing + static List getIndexVersions(ClusterState state, SystemIndices.Feature feature) { + return Stream.of(feature.getIndexDescriptors(), feature.getAssociatedIndexDescriptors()) + .flatMap(Collection::stream) + .flatMap(descriptor -> descriptor.getMatchingIndices(state.metadata()).stream()) + .sorted(String::compareTo) + .map(index -> state.metadata().index(index)) + .map(indexMetadata -> new GetFeatureUpgradeStatusResponse.IndexVersion( + indexMetadata.getIndex().getName(), + indexMetadata.getCreationVersion())) + .collect(Collectors.toList()); } @Override diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/migration/GetFeatureUpgradeStatusResponseTests.java b/server/src/test/java/org/elasticsearch/action/admin/cluster/migration/GetFeatureUpgradeStatusResponseTests.java index 58483df600b72..7966c2171ee87 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/migration/GetFeatureUpgradeStatusResponseTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/cluster/migration/GetFeatureUpgradeStatusResponseTests.java @@ -8,12 +8,14 @@ package org.elasticsearch.action.admin.cluster.migration; +import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.test.AbstractWireSerializingTestCase; import java.io.IOException; import java.util.Collections; +import static org.elasticsearch.action.admin.cluster.migration.GetFeatureUpgradeStatusResponse.UpgradeStatus.UPGRADE_NEEDED; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.notNullValue; @@ -31,7 +33,7 @@ protected Writeable.Reader instanceReader() { protected GetFeatureUpgradeStatusResponse createTestInstance() { return new GetFeatureUpgradeStatusResponse( randomList(8, GetFeatureUpgradeStatusResponseTests::createFeatureStatus), - randomAlphaOfLengthBetween(4, 16) + randomFrom(org.elasticsearch.action.admin.cluster.migration.GetFeatureUpgradeStatusResponse.UpgradeStatus.values()) ); } @@ -41,13 +43,14 @@ protected GetFeatureUpgradeStatusResponse mutateInstance(GetFeatureUpgradeStatus randomList(8, () -> randomValueOtherThanMany(instance.getFeatureUpgradeStatuses()::contains, GetFeatureUpgradeStatusResponseTests::createFeatureStatus)), - randomValueOtherThan(instance.getUpgradeStatus(), () -> randomAlphaOfLengthBetween(4, 16)) - ); + randomValueOtherThan(instance.getUpgradeStatus(), () -> + randomFrom(org.elasticsearch.action.admin.cluster.migration.GetFeatureUpgradeStatusResponse.UpgradeStatus.values()))); + } /** If constructor is called with null for a list, we just use an empty list */ public void testConstructorHandlesNullLists() { - GetFeatureUpgradeStatusResponse response = new GetFeatureUpgradeStatusResponse(null, "status"); + GetFeatureUpgradeStatusResponse response = new GetFeatureUpgradeStatusResponse(null, UPGRADE_NEEDED); assertThat(response.getFeatureUpgradeStatuses(), notNullValue()); assertThat(response.getFeatureUpgradeStatuses(), equalTo(Collections.emptyList())); } @@ -55,8 +58,8 @@ public void testConstructorHandlesNullLists() { private static GetFeatureUpgradeStatusResponse.FeatureUpgradeStatus createFeatureStatus() { return new GetFeatureUpgradeStatusResponse.FeatureUpgradeStatus( randomAlphaOfLengthBetween(3, 20), - randomAlphaOfLengthBetween(5, 9), - randomAlphaOfLengthBetween(4, 16), + randomFrom(Version.CURRENT, Version.CURRENT.minimumCompatibilityVersion()), + randomFrom(org.elasticsearch.action.admin.cluster.migration.GetFeatureUpgradeStatusResponse.UpgradeStatus.values()), randomList(4, GetFeatureUpgradeStatusResponseTests::getIndexVersion) ); } @@ -64,7 +67,7 @@ private static GetFeatureUpgradeStatusResponse.FeatureUpgradeStatus createFeatur private static GetFeatureUpgradeStatusResponse.IndexVersion getIndexVersion() { return new GetFeatureUpgradeStatusResponse.IndexVersion( randomAlphaOfLengthBetween(3, 20), - randomAlphaOfLengthBetween(5, 9) + randomFrom(Version.CURRENT, Version.CURRENT.minimumCompatibilityVersion()) ); } } diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/migration/TransportGetFeatureUpgradeStatusActionTests.java b/server/src/test/java/org/elasticsearch/action/admin/cluster/migration/TransportGetFeatureUpgradeStatusActionTests.java new file mode 100644 index 0000000000000..5fb9cba2b4b18 --- /dev/null +++ b/server/src/test/java/org/elasticsearch/action/admin/cluster/migration/TransportGetFeatureUpgradeStatusActionTests.java @@ -0,0 +1,101 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +package org.elasticsearch.action.admin.cluster.migration; + +import org.elasticsearch.Version; +import org.elasticsearch.cluster.ClusterState; +import org.elasticsearch.cluster.metadata.IndexMetadata; +import org.elasticsearch.cluster.metadata.Metadata; +import org.elasticsearch.common.collect.ImmutableOpenMap; +import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.indices.SystemIndexDescriptor; +import org.elasticsearch.indices.SystemIndices; +import org.elasticsearch.test.ESTestCase; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import static org.elasticsearch.action.admin.cluster.migration.GetFeatureUpgradeStatusResponse.UpgradeStatus.NO_UPGRADE_NEEDED; +import static org.hamcrest.Matchers.equalTo; + +public class TransportGetFeatureUpgradeStatusActionTests extends ESTestCase { + + public static String TEST_SYSTEM_INDEX_PATTERN = ".test*"; + private static final ClusterState CLUSTER_STATE = getClusterState(); + private static final SystemIndices.Feature FEATURE = getFeature(); + + public void testGetFeatureStatus() { + GetFeatureUpgradeStatusResponse.FeatureUpgradeStatus status = + TransportGetFeatureUpgradeStatusAction.getFeatureUpgradeStatus( + CLUSTER_STATE, + Map.entry("test-feature", FEATURE)); + + assertThat(status.getUpgradeStatus(), equalTo(NO_UPGRADE_NEEDED)); + assertThat(status.getFeatureName(), equalTo("test-feature")); + assertThat(status.getMinimumIndexVersion(), equalTo(Version.V_7_0_0)); + assertThat(status.getIndexVersions().size(), equalTo(2)); // additional testing below + } + + public void testGetIndexVersion() { + List versions = + TransportGetFeatureUpgradeStatusAction.getIndexVersions(CLUSTER_STATE, FEATURE); + + assertThat(versions.size(), equalTo(2)); + + { + GetFeatureUpgradeStatusResponse.IndexVersion version = versions.get(0); + assertThat(version.getVersion(), equalTo(Version.CURRENT)); + assertThat(version.getIndexName(), equalTo(".test-index-1")); + } + { + GetFeatureUpgradeStatusResponse.IndexVersion version = versions.get(1); + assertThat(version.getVersion(), equalTo(Version.V_7_0_0)); + assertThat(version.getIndexName(), equalTo(".test-index-2")); + } + } + + private static SystemIndices.Feature getFeature() { + SystemIndexDescriptor descriptor = new SystemIndexDescriptor(TEST_SYSTEM_INDEX_PATTERN, "descriptor for tests"); + + List descriptors = new ArrayList<>(); + descriptors.add(descriptor); + + // system indices feature object + SystemIndices.Feature feature = new SystemIndices.Feature( + "test-feature", + "feature for tests", + descriptors); + return feature; + } + + private static ClusterState getClusterState() { + IndexMetadata indexMetadata1 = IndexMetadata.builder(".test-index-1") + .settings(Settings.builder().put("index.version.created", Version.CURRENT).build()) + .numberOfShards(1) + .numberOfReplicas(0) + .build(); + + IndexMetadata indexMetadata2 = IndexMetadata.builder(".test-index-2") + .settings(Settings.builder().put("index.version.created", Version.V_7_0_0).build()) + .numberOfShards(1) + .numberOfReplicas(0) + .build(); + + ClusterState clusterState = new ClusterState.Builder(ClusterState.EMPTY_STATE) + .metadata(new Metadata.Builder() + .indices(ImmutableOpenMap.builder() + .fPut(".test-index-1", indexMetadata1) + .fPut(".test-index-2", indexMetadata2) + .build()) + .build()) + .build(); + return clusterState; + } +} From df5dde5b3c1330f0df294d95325b6eca3b9c333c Mon Sep 17 00:00:00 2001 From: Lisa Cawley Date: Thu, 7 Oct 2021 12:22:11 -0700 Subject: [PATCH 235/250] [DOCS] Fixes ML get calendars API (#78808) --- .../apis/get-calendar.asciidoc | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/docs/reference/ml/anomaly-detection/apis/get-calendar.asciidoc b/docs/reference/ml/anomaly-detection/apis/get-calendar.asciidoc index 5b6ca1030f688..d96f18c61c78c 100644 --- a/docs/reference/ml/anomaly-detection/apis/get-calendar.asciidoc +++ b/docs/reference/ml/anomaly-detection/apis/get-calendar.asciidoc @@ -39,15 +39,29 @@ For more information, see (Required, string) include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=calendar-id] +[[ml-get-calendar-query-parms]] +== {api-query-parms-title} + +`from`:: + (Optional, integer) Skips the specified number of calendars. This parameter + is supported only when you omit the ``. Defaults to `0`. + +`size`:: + (Optional, integer) Specifies the maximum number of calendars to obtain. + This parameter is supported only when you omit the ``. Defaults + to `100`. + [[ml-get-calendar-request-body]] == {api-request-body-title} `page`.`from`:: - (Optional, integer) Skips the specified number of calendars. Defaults to `0`. + (Optional, integer) Skips the specified number of calendars. This object is + supported only when you omit the ``. Defaults to `0`. `page`.`size`:: (Optional, integer) Specifies the maximum number of calendars to obtain. - Defaults to `0`. + This object is supported only when you omit the ``. Defaults + to `100`. [[ml-get-calendar-results]] == {api-response-body-title} From f2360e85e8a2451afda9c0e60858ccbf3de2debd Mon Sep 17 00:00:00 2001 From: Asce Ma Date: Fri, 8 Oct 2021 04:13:19 +0800 Subject: [PATCH 236/250] Fix incorrect generic type in PolicyStepsRegistry (#78628) --- .../xpack/ilm/PolicyStepsRegistry.java | 42 +++++++++---------- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/PolicyStepsRegistry.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/PolicyStepsRegistry.java index 6871737324217..9753448a7ec89 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/PolicyStepsRegistry.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/PolicyStepsRegistry.java @@ -11,7 +11,6 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.client.Client; import org.elasticsearch.cluster.ClusterState; -import org.elasticsearch.cluster.Diff; import org.elasticsearch.cluster.DiffableUtils; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.cluster.metadata.Metadata; @@ -92,32 +91,29 @@ Map> getStepMap() { return stepMap; } - @SuppressWarnings({ "unchecked", "rawtypes" }) public void update(ClusterState clusterState) { final IndexLifecycleMetadata meta = clusterState.metadata().custom(IndexLifecycleMetadata.TYPE); - assert meta != null : "IndexLifecycleMetadata cannot be null when updating the policy steps registry"; - Diff> diff = DiffableUtils.diff(lifecyclePolicyMap, meta.getPolicyMetadatas(), - DiffableUtils.getStringKeySerializer(), - // Use a non-diffable value serializer. Otherwise actions in the same - // action and phase that are changed show up as diffs instead of upserts. - // We want to treat any change in the policy as an upsert so the map is - // correctly rebuilt - new DiffableUtils.NonDiffableValueSerializer() { - @Override - public void write(LifecyclePolicyMetadata value, StreamOutput out) { - // This is never called - throw new UnsupportedOperationException("should never be called"); - } + DiffableUtils.MapDiff> mapDiff = + DiffableUtils.diff(lifecyclePolicyMap, meta.getPolicyMetadatas(), DiffableUtils.getStringKeySerializer(), + // Use a non-diffable value serializer. Otherwise actions in the same + // action and phase that are changed show up as diffs instead of upserts. + // We want to treat any change in the policy as an upsert so the map is + // correctly rebuilt + new DiffableUtils.NonDiffableValueSerializer<>() { + @Override + public void write(LifecyclePolicyMetadata value, StreamOutput out) { + // This is never called + throw new UnsupportedOperationException("should never be called"); + } - @Override - public LifecyclePolicyMetadata read(StreamInput in, String key) { - // This is never called - throw new UnsupportedOperationException("should never be called"); - } - }); - DiffableUtils.MapDiff> mapDiff = (DiffableUtils.MapDiff) diff; + @Override + public LifecyclePolicyMetadata read(StreamInput in, String key) { + // This is never called + throw new UnsupportedOperationException("should never be called"); + } + }); for (String deletedPolicyName : mapDiff.getDeletes()) { lifecyclePolicyMap.remove(deletedPolicyName); @@ -128,7 +124,7 @@ public LifecyclePolicyMetadata read(StreamInput in, String key) { if (mapDiff.getUpserts().isEmpty() == false) { for (LifecyclePolicyMetadata policyMetadata : mapDiff.getUpserts().values()) { LifecyclePolicySecurityClient policyClient = new LifecyclePolicySecurityClient(client, ClientHelper.INDEX_LIFECYCLE_ORIGIN, - policyMetadata.getHeaders()); + policyMetadata.getHeaders()); lifecyclePolicyMap.put(policyMetadata.getName(), policyMetadata); List policyAsSteps = policyMetadata.getPolicy().toSteps(policyClient, licenseState); if (policyAsSteps.isEmpty() == false) { From 2fe2c800f6e78c248529cb9661a482b5c9e8c2d9 Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Thu, 7 Oct 2021 14:49:45 -0700 Subject: [PATCH 237/250] Revert "Make nodePaths() singular (#72514)" (#78801) This reverts commit 2dc796a747b6d8de043cccdecaefeb36bb124d14. The revert was mostly clean, but it required adjusting NodeEnvironment.upgradeLegacyNodeFolders to retain #74921. relates #78525 relates #71205 --- .../ElasticsearchNodeCommand.java | 8 +- .../elasticsearch/env/NodeEnvironment.java | 120 +++++++++--------- .../elasticsearch/index/shard/ShardPath.java | 82 +++++++++++- .../org/elasticsearch/monitor/fs/FsProbe.java | 15 ++- .../env/NodeEnvironmentTests.java | 2 +- .../RemoveCorruptedShardDataCommandTests.java | 6 +- ...ansportGetAutoscalingCapacityActionIT.java | 2 +- .../cache/full/PersistentCache.java | 44 ++++--- .../cache/full/PersistentCacheTests.java | 2 +- 9 files changed, 186 insertions(+), 95 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/cluster/coordination/ElasticsearchNodeCommand.java b/server/src/main/java/org/elasticsearch/cluster/coordination/ElasticsearchNodeCommand.java index 90bca9bc230b6..b7143186d5d59 100644 --- a/server/src/main/java/org/elasticsearch/cluster/coordination/ElasticsearchNodeCommand.java +++ b/server/src/main/java/org/elasticsearch/cluster/coordination/ElasticsearchNodeCommand.java @@ -43,6 +43,7 @@ import java.util.Arrays; import java.util.EnumSet; import java.util.Map; +import java.util.Objects; public abstract class ElasticsearchNodeCommand extends EnvironmentAwareCommand { private static final Logger logger = LogManager.getLogger(ElasticsearchNodeCommand.class); @@ -130,11 +131,12 @@ public static Tuple loadTermAndClusterState(PersistedCluster protected void processNodePaths(Terminal terminal, OptionSet options, Environment env) throws IOException, UserException { terminal.println(Terminal.Verbosity.VERBOSE, "Obtaining lock for node"); try (NodeEnvironment.NodeLock lock = new NodeEnvironment.NodeLock(logger, env, Files::exists)) { - final NodeEnvironment.NodePath dataPath = lock.getNodePath(); - if (dataPath == null) { + final Path[] dataPaths = + Arrays.stream(lock.getNodePaths()).filter(Objects::nonNull).map(p -> p.path).toArray(Path[]::new); + if (dataPaths.length == 0) { throw new ElasticsearchException(NO_NODE_FOLDER_FOUND_MSG); } - processNodePaths(terminal, new Path[] { dataPath.path }, options, env); + processNodePaths(terminal, dataPaths, options, env); } catch (LockObtainFailedException e) { throw new ElasticsearchException(FAILED_TO_OBTAIN_NODE_LOCK_MSG, e); } diff --git a/server/src/main/java/org/elasticsearch/env/NodeEnvironment.java b/server/src/main/java/org/elasticsearch/env/NodeEnvironment.java index 5d8db2c384d12..6147b1654bae4 100644 --- a/server/src/main/java/org/elasticsearch/env/NodeEnvironment.java +++ b/server/src/main/java/org/elasticsearch/env/NodeEnvironment.java @@ -220,8 +220,8 @@ public NodeLock(final Logger logger, } } - public NodePath getNodePath() { - return nodePaths[0]; + public NodePath[] getNodePaths() { + return nodePaths; } @Override @@ -352,71 +352,73 @@ private static boolean upgradeLegacyNodeFolders(Logger logger, Settings settings } // move contents from legacy path to new path + assert nodeLock.getNodePaths().length == legacyNodeLock.getNodePaths().length; try { final List> upgradeActions = new ArrayList<>(); - final NodePath legacyNodePath = legacyNodeLock.getNodePath(); - final NodePath nodePath = nodeLock.getNodePath(); - - // determine folders to move and check that there are no extra files/folders - final Set folderNames = new HashSet<>(); - final Set expectedFolderNames = new HashSet<>(Arrays.asList( - - // node state directory, containing MetadataStateFormat-based node metadata as well as cluster state - MetadataStateFormat.STATE_DIR_NAME, - - // indices - INDICES_FOLDER, - - // searchable snapshot cache Lucene index - SNAPSHOT_CACHE_FOLDER - )); - - final Set ignoredFileNames = new HashSet<>(Arrays.asList( - NODE_LOCK_FILENAME, - TEMP_FILE_NAME, - TEMP_FILE_NAME + ".tmp", - TEMP_FILE_NAME + ".final" - )); - - try (DirectoryStream stream = Files.newDirectoryStream(legacyNodePath.path)) { - for (Path subFolderPath : stream) { - final String fileName = subFolderPath.getFileName().toString(); - if (FileSystemUtils.isDesktopServicesStore(subFolderPath)) { - // ignore - } else if (FileSystemUtils.isAccessibleDirectory(subFolderPath, logger)) { - if (expectedFolderNames.contains(fileName) == false) { - throw new IllegalStateException("unexpected folder encountered during data folder upgrade: " + + for (int i = 0; i < legacyNodeLock.getNodePaths().length; i++) { + final NodePath legacyNodePath = legacyNodeLock.getNodePaths()[i]; + final NodePath nodePath = nodeLock.getNodePaths()[i]; + + // determine folders to move and check that there are no extra files/folders + final Set folderNames = new HashSet<>(); + final Set expectedFolderNames = new HashSet<>(Arrays.asList( + + // node state directory, containing MetadataStateFormat-based node metadata as well as cluster state + MetadataStateFormat.STATE_DIR_NAME, + + // indices + INDICES_FOLDER, + + // searchable snapshot cache Lucene index + SNAPSHOT_CACHE_FOLDER + )); + + final Set ignoredFileNames = new HashSet<>(Arrays.asList( + NODE_LOCK_FILENAME, + TEMP_FILE_NAME, + TEMP_FILE_NAME + ".tmp", + TEMP_FILE_NAME + ".final" + )); + + try (DirectoryStream stream = Files.newDirectoryStream(legacyNodePath.path)) { + for (Path subFolderPath : stream) { + final String fileName = subFolderPath.getFileName().toString(); + if (FileSystemUtils.isDesktopServicesStore(subFolderPath)) { + // ignore + } else if (FileSystemUtils.isAccessibleDirectory(subFolderPath, logger)) { + if (expectedFolderNames.contains(fileName) == false) { + throw new IllegalStateException("unexpected folder encountered during data folder upgrade: " + + subFolderPath); + } + final Path targetSubFolderPath = nodePath.path.resolve(fileName); + if (Files.exists(targetSubFolderPath)) { + throw new IllegalStateException("target folder already exists during data folder upgrade: " + + targetSubFolderPath); + } + folderNames.add(fileName); + } else if (ignoredFileNames.contains(fileName) == false) { + throw new IllegalStateException("unexpected file/folder encountered during data folder upgrade: " + subFolderPath); } - final Path targetSubFolderPath = nodePath.path.resolve(fileName); - if (Files.exists(targetSubFolderPath)) { - throw new IllegalStateException("target folder already exists during data folder upgrade: " + - targetSubFolderPath); - } - folderNames.add(fileName); - } else if (ignoredFileNames.contains(fileName) == false) { - throw new IllegalStateException("unexpected file/folder encountered during data folder upgrade: " + - subFolderPath); } } - } - assert Sets.difference(folderNames, expectedFolderNames).isEmpty() : - "expected indices and/or state dir folder but was " + folderNames; - - upgradeActions.add(() -> { - for (String folderName : folderNames) { - final Path sourceSubFolderPath = legacyNodePath.path.resolve(folderName); - final Path targetSubFolderPath = nodePath.path.resolve(folderName); - Files.move(sourceSubFolderPath, targetSubFolderPath, StandardCopyOption.ATOMIC_MOVE); - logger.info("data folder upgrade: moved from [{}] to [{}]", sourceSubFolderPath, targetSubFolderPath); - } - IOUtils.fsync(nodePath.path, true); - }); + assert Sets.difference(folderNames, expectedFolderNames).isEmpty() : + "expected indices and/or state dir folder but was " + folderNames; + upgradeActions.add(() -> { + for (String folderName : folderNames) { + final Path sourceSubFolderPath = legacyNodePath.path.resolve(folderName); + final Path targetSubFolderPath = nodePath.path.resolve(folderName); + Files.move(sourceSubFolderPath, targetSubFolderPath, StandardCopyOption.ATOMIC_MOVE); + logger.info("data folder upgrade: moved from [{}] to [{}]", sourceSubFolderPath, targetSubFolderPath); + } + IOUtils.fsync(nodePath.path, true); + }); + } // now do the actual upgrade. start by upgrading the node metadata file before moving anything, since a downgrade in an // intermediate state would be pretty disastrous - loadNodeMetadata(settings, logger, legacyNodeLock.getNodePath()); + loadNodeMetadata(settings, logger, legacyNodeLock.getNodePaths()); for (CheckedRunnable upgradeAction : upgradeActions) { upgradeAction.run(); } @@ -924,12 +926,12 @@ public String nodeId() { /** * Returns an array of all of the {@link NodePath}s. */ - public NodePath nodePath() { + public NodePath[] nodePaths() { assertEnvIsLocked(); if (nodePaths == null || locks == null) { throw new IllegalStateException("node is not configured to store local location"); } - return nodePaths[0]; + return nodePaths; } /** diff --git a/server/src/main/java/org/elasticsearch/index/shard/ShardPath.java b/server/src/main/java/org/elasticsearch/index/shard/ShardPath.java index ea8203556ccb2..c2b44c5e2bc3c 100644 --- a/server/src/main/java/org/elasticsearch/index/shard/ShardPath.java +++ b/server/src/main/java/org/elasticsearch/index/shard/ShardPath.java @@ -9,16 +9,20 @@ import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.util.Strings; +import org.elasticsearch.core.internal.io.IOUtils; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.core.internal.io.IOUtils; import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.env.ShardLock; import org.elasticsearch.index.IndexSettings; import java.io.IOException; +import java.math.BigInteger; +import java.nio.file.FileStore; import java.nio.file.Files; import java.nio.file.Path; +import java.util.Arrays; +import java.util.HashMap; import java.util.Map; import java.util.Objects; import java.util.function.Consumer; @@ -188,13 +192,85 @@ public static ShardPath selectNewPathForShard(NodeEnvironment env, ShardId shard if (indexSettings.hasCustomDataPath()) { dataPath = env.resolveCustomLocation(indexSettings.customDataPath(), shardId); - statePath = env.nodePath().resolve(shardId); + statePath = env.nodePaths()[0].resolve(shardId); } else { - dataPath = statePath = env.nodePath().resolve(shardId); + BigInteger totFreeSpace = BigInteger.ZERO; + for (NodeEnvironment.NodePath nodePath : env.nodePaths()) { + totFreeSpace = totFreeSpace.add(BigInteger.valueOf(nodePath.fileStore.getUsableSpace())); + } + + // TODO: this is a hack!! We should instead keep track of incoming (relocated) shards since we know + // how large they will be once they're done copying, instead of a silly guess for such cases: + + // Very rough heuristic of how much disk space we expect the shard will use over its lifetime, the max of current average + // shard size across the cluster and 5% of the total available free space on this node: + BigInteger estShardSizeInBytes = BigInteger.valueOf(avgShardSizeInBytes).max(totFreeSpace.divide(BigInteger.valueOf(20))); + + // TODO - do we need something more extensible? Yet, this does the job for now... + final NodeEnvironment.NodePath[] paths = env.nodePaths(); + + // If no better path is chosen, use the one with the most space by default + NodeEnvironment.NodePath bestPath = getPathWithMostFreeSpace(env); + + if (paths.length != 1) { + Map pathToShardCount = env.shardCountPerPath(shardId.getIndex()); + + // Compute how much space there is on each path + final Map pathsToSpace = new HashMap<>(paths.length); + for (NodeEnvironment.NodePath nodePath : paths) { + FileStore fileStore = nodePath.fileStore; + BigInteger usableBytes = BigInteger.valueOf(fileStore.getUsableSpace()); + pathsToSpace.put(nodePath, usableBytes); + } + + bestPath = Arrays.stream(paths) + // Filter out paths that have enough space + .filter((path) -> pathsToSpace.get(path).subtract(estShardSizeInBytes).compareTo(BigInteger.ZERO) > 0) + // Sort by the number of shards for this index + .sorted((p1, p2) -> { + int cmp = Long.compare(pathToShardCount.getOrDefault(p1, 0L), + pathToShardCount.getOrDefault(p2, 0L)); + if (cmp == 0) { + // if the number of shards is equal, tie-break with the number of total shards + cmp = Integer.compare(dataPathToShardCount.getOrDefault(p1.path, 0), + dataPathToShardCount.getOrDefault(p2.path, 0)); + if (cmp == 0) { + // if the number of shards is equal, tie-break with the usable bytes + cmp = pathsToSpace.get(p2).compareTo(pathsToSpace.get(p1)); + } + } + return cmp; + }) + // Return the first result + .findFirst() + // Or the existing best path if there aren't any that fit the criteria + .orElse(bestPath); + } + + statePath = bestPath.resolve(shardId); + dataPath = statePath; } return new ShardPath(indexSettings.hasCustomDataPath(), dataPath, statePath, shardId); } + static NodeEnvironment.NodePath getPathWithMostFreeSpace(NodeEnvironment env) throws IOException { + final NodeEnvironment.NodePath[] paths = env.nodePaths(); + NodeEnvironment.NodePath bestPath = null; + long maxUsableBytes = Long.MIN_VALUE; + for (NodeEnvironment.NodePath nodePath : paths) { + FileStore fileStore = nodePath.fileStore; + long usableBytes = fileStore.getUsableSpace(); // NB usable bytes doesn't account for reserved space (e.g. incoming recoveries) + assert usableBytes >= 0 : "usable bytes must be >= 0, got: " + usableBytes; + + if (bestPath == null || usableBytes > maxUsableBytes) { + // This path has been determined to be "better" based on the usable bytes + maxUsableBytes = usableBytes; + bestPath = nodePath; + } + } + return bestPath; + } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/server/src/main/java/org/elasticsearch/monitor/fs/FsProbe.java b/server/src/main/java/org/elasticsearch/monitor/fs/FsProbe.java index 9a444d945233c..d1ea03bd342f6 100644 --- a/server/src/main/java/org/elasticsearch/monitor/fs/FsProbe.java +++ b/server/src/main/java/org/elasticsearch/monitor/fs/FsProbe.java @@ -42,17 +42,22 @@ public FsInfo stats(FsInfo previous) throws IOException { if (nodeEnv.hasNodeFile() == false) { return new FsInfo(System.currentTimeMillis(), null, new FsInfo.Path[0]); } - NodePath dataLocation = nodeEnv.nodePath(); - FsInfo.Path pathInfo = getFSInfo(dataLocation); + NodePath[] dataLocations = nodeEnv.nodePaths(); + FsInfo.Path[] paths = new FsInfo.Path[dataLocations.length]; + for (int i = 0; i < dataLocations.length; i++) { + paths[i] = getFSInfo(dataLocations[i]); + } FsInfo.IoStats ioStats = null; if (Constants.LINUX) { Set> devicesNumbers = new HashSet<>(); - if (dataLocation.majorDeviceNumber != -1 && dataLocation.minorDeviceNumber != -1) { - devicesNumbers.add(Tuple.tuple(dataLocation.majorDeviceNumber, dataLocation.minorDeviceNumber)); + for (int i = 0; i < dataLocations.length; i++) { + if (dataLocations[i].majorDeviceNumber != -1 && dataLocations[i].minorDeviceNumber != -1) { + devicesNumbers.add(Tuple.tuple(dataLocations[i].majorDeviceNumber, dataLocations[i].minorDeviceNumber)); + } } ioStats = ioStats(devicesNumbers, previous); } - return new FsInfo(System.currentTimeMillis(), ioStats, new FsInfo.Path[] { pathInfo }); + return new FsInfo(System.currentTimeMillis(), ioStats, paths); } final FsInfo.IoStats ioStats(final Set> devicesNumbers, final FsInfo previous) { diff --git a/server/src/test/java/org/elasticsearch/env/NodeEnvironmentTests.java b/server/src/test/java/org/elasticsearch/env/NodeEnvironmentTests.java index 8870b4f60ea8c..e726f367b57d7 100644 --- a/server/src/test/java/org/elasticsearch/env/NodeEnvironmentTests.java +++ b/server/src/test/java/org/elasticsearch/env/NodeEnvironmentTests.java @@ -212,7 +212,7 @@ public void testDeleteSafe() throws Exception { SetOnce listener = new SetOnce<>(); env.deleteShardDirectorySafe(new ShardId(index, 1), idxSettings, listener::set); Path deletedPath = listener.get(); - assertThat(deletedPath, equalTo(env.nodePath().resolve(index).resolve("1"))); + assertThat(deletedPath, equalTo(env.nodePaths()[0].resolve(index).resolve("1"))); } path = env.indexPath(index); diff --git a/server/src/test/java/org/elasticsearch/index/shard/RemoveCorruptedShardDataCommandTests.java b/server/src/test/java/org/elasticsearch/index/shard/RemoveCorruptedShardDataCommandTests.java index d926da8fc44dc..e98d413c545d7 100644 --- a/server/src/test/java/org/elasticsearch/index/shard/RemoveCorruptedShardDataCommandTests.java +++ b/server/src/test/java/org/elasticsearch/index/shard/RemoveCorruptedShardDataCommandTests.java @@ -55,7 +55,9 @@ import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; +import java.util.Arrays; import java.util.Collections; +import java.util.Objects; import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -131,8 +133,8 @@ public void setup() throws IOException { clusterState = ClusterState.builder(ClusterName.DEFAULT).metadata(Metadata.builder().put(indexMetadata, false).build()).build(); try (NodeEnvironment.NodeLock lock = new NodeEnvironment.NodeLock(logger, environment, Files::exists)) { - final NodeEnvironment.NodePath dataPath = lock.getNodePath(); - try (PersistedClusterStateService.Writer writer = new PersistedClusterStateService(new Path[] { dataPath.path }, nodeId, + final Path[] dataPaths = Arrays.stream(lock.getNodePaths()).filter(Objects::nonNull).map(p -> p.path).toArray(Path[]::new); + try (PersistedClusterStateService.Writer writer = new PersistedClusterStateService(dataPaths, nodeId, xContentRegistry(), BigArrays.NON_RECYCLING_INSTANCE, new ClusterSettings(settings, ClusterSettings.BUILT_IN_CLUSTER_SETTINGS), () -> 0L).createWriter()) { writer.writeFullStateAndCommit(1L, clusterState); diff --git a/x-pack/plugin/autoscaling/src/internalClusterTest/java/org/elasticsearch/xpack/autoscaling/action/TransportGetAutoscalingCapacityActionIT.java b/x-pack/plugin/autoscaling/src/internalClusterTest/java/org/elasticsearch/xpack/autoscaling/action/TransportGetAutoscalingCapacityActionIT.java index 31f25e9eaf5a9..0e1372aa1d773 100644 --- a/x-pack/plugin/autoscaling/src/internalClusterTest/java/org/elasticsearch/xpack/autoscaling/action/TransportGetAutoscalingCapacityActionIT.java +++ b/x-pack/plugin/autoscaling/src/internalClusterTest/java/org/elasticsearch/xpack/autoscaling/action/TransportGetAutoscalingCapacityActionIT.java @@ -37,7 +37,7 @@ public class TransportGetAutoscalingCapacityActionIT extends AutoscalingIntegTes public void testCurrentCapacity() throws Exception { assertThat(capacity().results().keySet(), Matchers.empty()); long memory = OsProbe.getInstance().getTotalPhysicalMemorySize(); - long storage = internalCluster().getInstance(NodeEnvironment.class).nodePath().fileStore.getTotalSpace(); + long storage = internalCluster().getInstance(NodeEnvironment.class).nodePaths()[0].fileStore.getTotalSpace(); assertThat(memory, greaterThan(0L)); assertThat(storage, greaterThan(0L)); putAutoscalingPolicy("test"); diff --git a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/cache/full/PersistentCache.java b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/cache/full/PersistentCache.java index 80c2b111e15f8..13762838011c2 100644 --- a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/cache/full/PersistentCache.java +++ b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/cache/full/PersistentCache.java @@ -336,8 +336,10 @@ private static List createWriters(NodeEnvironment nodeEnvironm final List writers = new ArrayList<>(); boolean success = false; try { - final NodeEnvironment.NodePath nodePath = nodeEnvironment.nodePath(); - writers.add(createCacheIndexWriter(nodePath)); + final NodeEnvironment.NodePath[] nodePaths = nodeEnvironment.nodePaths(); + for (NodeEnvironment.NodePath nodePath : nodePaths) { + writers.add(createCacheIndexWriter(nodePath)); + } success = true; } catch (IOException e) { throw new UncheckedIOException("Failed to create persistent cache writers", e); @@ -393,10 +395,11 @@ static CacheIndexWriter createCacheIndexWriter(NodeEnvironment.NodePath nodePath static Map loadDocuments(NodeEnvironment nodeEnvironment) { final Map documents = new HashMap<>(); try { - NodeEnvironment.NodePath nodePath = nodeEnvironment.nodePath(); - final Path directoryPath = resolveCacheIndexFolder(nodePath); - if (Files.exists(directoryPath)) { - documents.putAll(loadDocuments(directoryPath)); + for (NodeEnvironment.NodePath nodePath : nodeEnvironment.nodePaths()) { + final Path directoryPath = resolveCacheIndexFolder(nodePath); + if (Files.exists(directoryPath)) { + documents.putAll(loadDocuments(directoryPath)); + } } } catch (IOException e) { throw new UncheckedIOException("Failed to load existing documents from persistent cache index", e); @@ -446,22 +449,23 @@ public static void cleanUp(Settings settings, NodeEnvironment nodeEnvironment) { throw new IllegalStateException("Cannot clean searchable snapshot caches: node is a data node"); } try { - NodeEnvironment.NodePath nodePath = nodeEnvironment.nodePath(); - for (String indexUUID : nodeEnvironment.availableIndexFoldersForPath(nodePath)) { - for (ShardId shardId : nodeEnvironment.findAllShardIds(new Index("_unknown_", indexUUID))) { - final Path shardDataPath = nodePath.resolve(shardId); - final ShardPath shardPath = new ShardPath(false, shardDataPath, shardDataPath, shardId); - final Path cacheDir = getShardCachePath(shardPath); - if (Files.isDirectory(cacheDir)) { - logger.debug("deleting searchable snapshot shard cache directory [{}]", cacheDir); - IOUtils.rm(cacheDir); + for (NodeEnvironment.NodePath nodePath : nodeEnvironment.nodePaths()) { + for (String indexUUID : nodeEnvironment.availableIndexFoldersForPath(nodePath)) { + for (ShardId shardId : nodeEnvironment.findAllShardIds(new Index("_unknown_", indexUUID))) { + final Path shardDataPath = nodePath.resolve(shardId); + final ShardPath shardPath = new ShardPath(false, shardDataPath, shardDataPath, shardId); + final Path cacheDir = getShardCachePath(shardPath); + if (Files.isDirectory(cacheDir)) { + logger.debug("deleting searchable snapshot shard cache directory [{}]", cacheDir); + IOUtils.rm(cacheDir); + } } } - } - final Path cacheIndexDir = resolveCacheIndexFolder(nodePath); - if (Files.isDirectory(cacheIndexDir)) { - logger.debug("deleting searchable snapshot lucene directory [{}]", cacheIndexDir); - IOUtils.rm(cacheIndexDir); + final Path cacheIndexDir = resolveCacheIndexFolder(nodePath); + if (Files.isDirectory(cacheIndexDir)) { + logger.debug("deleting searchable snapshot lucene directory [{}]", cacheIndexDir); + IOUtils.rm(cacheIndexDir); + } } } catch (IOException e) { throw new UncheckedIOException("Failed to clean up searchable snapshots cache", e); diff --git a/x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/cache/full/PersistentCacheTests.java b/x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/cache/full/PersistentCacheTests.java index 720a45a23e2a0..c79f39a88e92c 100644 --- a/x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/cache/full/PersistentCacheTests.java +++ b/x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/cache/full/PersistentCacheTests.java @@ -64,7 +64,7 @@ public class PersistentCacheTests extends AbstractSearchableSnapshotsTestCase { public void testCacheIndexWriter() throws Exception { - final NodeEnvironment.NodePath nodePath = nodeEnvironment.nodePath(); + final NodeEnvironment.NodePath nodePath = randomFrom(nodeEnvironment.nodePaths()); int docId = 0; final Map liveDocs = new HashMap<>(); From 8272438ecd1108ef18a1be13c0c227f32e4d5d9d Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Thu, 7 Oct 2021 16:00:34 -0700 Subject: [PATCH 238/250] Convert encrypted snapshot license object to LicensedFeature (#78731) This commit moves the encrypted snapshot license checks to use the new LicensedFeature class. --- .../org/elasticsearch/license/XPackLicenseState.java | 2 -- .../repositories/encrypted/EncryptedRepository.java | 4 +++- .../encrypted/EncryptedRepositoryPlugin.java | 10 +++++++++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/XPackLicenseState.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/XPackLicenseState.java index 1649c2bc6db2a..6bb843110743e 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/XPackLicenseState.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/XPackLicenseState.java @@ -52,8 +52,6 @@ public enum Feature { MONITORING_CLUSTER_ALERTS(OperationMode.STANDARD, true), MONITORING_UPDATE_RETENTION(OperationMode.STANDARD, false), - ENCRYPTED_SNAPSHOT(OperationMode.PLATINUM, true), - CCR(OperationMode.PLATINUM, true), MACHINE_LEARNING(OperationMode.PLATINUM, true), diff --git a/x-pack/plugin/repository-encrypted/src/main/java/org/elasticsearch/repositories/encrypted/EncryptedRepository.java b/x-pack/plugin/repository-encrypted/src/main/java/org/elasticsearch/repositories/encrypted/EncryptedRepository.java index f7277f91b6572..22a544a1c02cd 100644 --- a/x-pack/plugin/repository-encrypted/src/main/java/org/elasticsearch/repositories/encrypted/EncryptedRepository.java +++ b/x-pack/plugin/repository-encrypted/src/main/java/org/elasticsearch/repositories/encrypted/EncryptedRepository.java @@ -59,6 +59,8 @@ import javax.crypto.KeyGenerator; import javax.crypto.SecretKey; +import static org.elasticsearch.repositories.encrypted.EncryptedRepositoryPlugin.ENCRYPTED_SNAPSHOT_FEATURE; + public class EncryptedRepository extends BlobStoreRepository { static final Logger logger = LogManager.getLogger(EncryptedRepository.class); // the following constants are fixed by definition @@ -177,7 +179,7 @@ public RepositoryStats stats() { public Map adaptUserMetadata(Map userMetadata) { // because populating the snapshot metadata must be done before the actual snapshot is first initialized, // we take the opportunity to validate the license and abort if non-compliant - if (false == licenseStateSupplier.get().isAllowed(XPackLicenseState.Feature.ENCRYPTED_SNAPSHOT)) { + if (false == ENCRYPTED_SNAPSHOT_FEATURE.checkWithoutTracking(licenseStateSupplier.get())) { throw LicenseUtils.newComplianceException("encrypted snapshots"); } Map snapshotUserMetadata = new HashMap<>(); diff --git a/x-pack/plugin/repository-encrypted/src/main/java/org/elasticsearch/repositories/encrypted/EncryptedRepositoryPlugin.java b/x-pack/plugin/repository-encrypted/src/main/java/org/elasticsearch/repositories/encrypted/EncryptedRepositoryPlugin.java index cf370f2b16b79..0048158bf14a3 100644 --- a/x-pack/plugin/repository-encrypted/src/main/java/org/elasticsearch/repositories/encrypted/EncryptedRepositoryPlugin.java +++ b/x-pack/plugin/repository-encrypted/src/main/java/org/elasticsearch/repositories/encrypted/EncryptedRepositoryPlugin.java @@ -21,7 +21,9 @@ import org.elasticsearch.common.xcontent.NamedXContentRegistry; import org.elasticsearch.env.Environment; import org.elasticsearch.indices.recovery.RecoverySettings; +import org.elasticsearch.license.License; import org.elasticsearch.license.LicenseUtils; +import org.elasticsearch.license.LicensedFeature; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.plugins.RepositoryPlugin; @@ -40,6 +42,12 @@ public class EncryptedRepositoryPlugin extends Plugin implements RepositoryPlugin { + static final LicensedFeature.Momentary ENCRYPTED_SNAPSHOT_FEATURE = LicensedFeature.momentary( + null, + "encrypted-snapshot", + License.OperationMode.PLATINUM + ); + private static final Boolean ENCRYPTED_REPOSITORY_FEATURE_FLAG_REGISTERED; static { final String property = System.getProperty("es.encrypted_repository_feature_flag_registered"); @@ -154,7 +162,7 @@ public Repository create(RepositoryMetadata metadata, Function Date: Thu, 7 Oct 2021 18:03:47 -0600 Subject: [PATCH 239/250] Improve Node Shutdown Observability (#78727) * Increase node shutdown logging level when stalled * Add allocation explanation to STALLED response * Adjust logging levels per review * Include all SingleNodeShutdownMetadata fields in logs * Depluralize `node_shutdown_decisions` per review * Repluralize node_allocation_decisions when we're actually reading from the Allocation Explain API --- .../ShutdownShardMigrationStatus.java | 38 +++++++++++++++++-- .../metadata/SingleNodeShutdownMetadata.java | 28 ++++++++++++++ .../TransportDeleteShutdownNodeAction.java | 2 + .../TransportGetShutdownStatusAction.java | 24 ++++++------ .../TransportPutShutdownNodeAction.java | 21 ++++------ 5 files changed, 85 insertions(+), 28 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/ShutdownShardMigrationStatus.java b/server/src/main/java/org/elasticsearch/cluster/metadata/ShutdownShardMigrationStatus.java index bc8f93c0706af..988e6dde17eef 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/ShutdownShardMigrationStatus.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/ShutdownShardMigrationStatus.java @@ -8,6 +8,8 @@ package org.elasticsearch.cluster.metadata; +import org.elasticsearch.Version; +import org.elasticsearch.cluster.routing.allocation.ShardAllocationDecision; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -20,25 +22,42 @@ import java.util.Objects; public class ShutdownShardMigrationStatus implements Writeable, ToXContentObject { + private static final Version ALLOCATION_DECISION_ADDED_VERSION = Version.V_8_0_0; private final SingleNodeShutdownMetadata.Status status; private final long shardsRemaining; @Nullable private final String explanation; + @Nullable private final ShardAllocationDecision allocationDecision; public ShutdownShardMigrationStatus(SingleNodeShutdownMetadata.Status status, long shardsRemaining) { - this(status, shardsRemaining, null); + this(status, shardsRemaining, null, null); } public ShutdownShardMigrationStatus(SingleNodeShutdownMetadata.Status status, long shardsRemaining, @Nullable String explanation) { + this(status, shardsRemaining, explanation, null); + } + + public ShutdownShardMigrationStatus( + SingleNodeShutdownMetadata.Status status, + long shardsRemaining, + @Nullable String explanation, + @Nullable ShardAllocationDecision allocationDecision + ) { this.status = Objects.requireNonNull(status, "status must not be null"); this.shardsRemaining = shardsRemaining; this.explanation = explanation; + this.allocationDecision = allocationDecision; } public ShutdownShardMigrationStatus(StreamInput in) throws IOException { this.status = in.readEnum(SingleNodeShutdownMetadata.Status.class); this.shardsRemaining = in.readLong(); this.explanation = in.readOptionalString(); + if (in.getVersion().onOrAfter(ALLOCATION_DECISION_ADDED_VERSION)) { + this.allocationDecision = in.readOptionalWriteable(ShardAllocationDecision::new); + } else { + this.allocationDecision = null; + } } public long getShardsRemaining() { @@ -61,6 +80,13 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws if (Objects.nonNull(explanation)) { builder.field("explanation", explanation); } + if (Objects.nonNull(allocationDecision)) { + builder.startObject("node_allocation_decision"); + { + allocationDecision.toXContent(builder, params); + } + builder.endObject(); + } builder.endObject(); return builder; } @@ -70,6 +96,9 @@ public void writeTo(StreamOutput out) throws IOException { out.writeEnum(status); out.writeLong(shardsRemaining); out.writeOptionalString(explanation); + if (out.getVersion().onOrAfter(ALLOCATION_DECISION_ADDED_VERSION)) { + out.writeOptionalWriteable(allocationDecision); + } } @Override @@ -77,12 +106,15 @@ public boolean equals(Object o) { if (this == o) return true; if ((o instanceof ShutdownShardMigrationStatus) == false) return false; ShutdownShardMigrationStatus that = (ShutdownShardMigrationStatus) o; - return shardsRemaining == that.shardsRemaining && status == that.status && Objects.equals(explanation, that.explanation); + return shardsRemaining == that.shardsRemaining + && status == that.status + && Objects.equals(explanation, that.explanation) + && Objects.equals(allocationDecision, that.allocationDecision); } @Override public int hashCode() { - return Objects.hash(status, shardsRemaining, explanation); + return Objects.hash(status, shardsRemaining, explanation, allocationDecision); } @Override diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/SingleNodeShutdownMetadata.java b/server/src/main/java/org/elasticsearch/cluster/metadata/SingleNodeShutdownMetadata.java index ddd8e1bb2ad34..b1800ffb60a89 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/SingleNodeShutdownMetadata.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/SingleNodeShutdownMetadata.java @@ -256,6 +256,34 @@ public int hashCode() { ); } + @Override public String toString() { + final StringBuilder stringBuilder = new StringBuilder(); + stringBuilder + .append("{") + .append("nodeId=[") + .append(nodeId) + .append(']') + .append(", type=[") + .append(type) + .append("], reason=[") + .append(reason) + .append(']'); + if (allocationDelay != null) { + stringBuilder + .append(", allocationDelay=[") + .append(allocationDelay) + .append("]"); + } + if (targetNodeName != null) { + stringBuilder + .append(", targetNodeName=[") + .append(targetNodeName) + .append("]"); + } + stringBuilder.append("}"); + return stringBuilder.toString(); + } + public static Builder builder() { return new Builder(); } diff --git a/x-pack/plugin/shutdown/src/main/java/org/elasticsearch/xpack/shutdown/TransportDeleteShutdownNodeAction.java b/x-pack/plugin/shutdown/src/main/java/org/elasticsearch/xpack/shutdown/TransportDeleteShutdownNodeAction.java index 06777af114911..b45077830b3df 100644 --- a/x-pack/plugin/shutdown/src/main/java/org/elasticsearch/xpack/shutdown/TransportDeleteShutdownNodeAction.java +++ b/x-pack/plugin/shutdown/src/main/java/org/elasticsearch/xpack/shutdown/TransportDeleteShutdownNodeAction.java @@ -71,6 +71,8 @@ protected void masterOperation( public ClusterState execute(ClusterState currentState) throws Exception { NodesShutdownMetadata currentShutdownMetadata = currentState.metadata().custom(NodesShutdownMetadata.TYPE); + logger.info("removing shutdown record for node [{}]", request.getNodeId()); + return ClusterState.builder(currentState) .metadata( Metadata.builder(currentState.metadata()) diff --git a/x-pack/plugin/shutdown/src/main/java/org/elasticsearch/xpack/shutdown/TransportGetShutdownStatusAction.java b/x-pack/plugin/shutdown/src/main/java/org/elasticsearch/xpack/shutdown/TransportGetShutdownStatusAction.java index 81675b85d1af2..01fba0a336a63 100644 --- a/x-pack/plugin/shutdown/src/main/java/org/elasticsearch/xpack/shutdown/TransportGetShutdownStatusAction.java +++ b/x-pack/plugin/shutdown/src/main/java/org/elasticsearch/xpack/shutdown/TransportGetShutdownStatusAction.java @@ -262,17 +262,15 @@ static ShutdownShardMigrationStatus shardMigrationStatus( return hasShardCopyOnOtherNode == false; }) .peek(pair -> { - if (logger.isTraceEnabled()) { // don't serialize the decision unless we have to - logger.trace( - "node [{}] shutdown of type [{}] stalled: found shard [{}][{}] from index [{}] with negative decision: [{}]", - nodeId, - shutdownType, - pair.v1().getId(), - pair.v1().primary() ? "primary" : "replica", - pair.v1().shardId().getIndexName(), - Strings.toString(pair.v2()) - ); - } + logger.debug( + "node [{}] shutdown of type [{}] stalled: found shard [{}][{}] from index [{}] with negative decision: [{}]", + nodeId, + shutdownType, + pair.v1().getId(), + pair.v1().primary() ? "primary" : "replica", + pair.v1().shardId().getIndexName(), + Strings.toString(pair.v2()) + ); }) .findFirst(); @@ -287,6 +285,7 @@ static ShutdownShardMigrationStatus shardMigrationStatus( } else if (unmovableShard.isPresent()) { // We found a shard that can't be moved, so shard relocation is stalled. Blame the unmovable shard. ShardRouting shardRouting = unmovableShard.get().v1(); + ShardAllocationDecision decision = unmovableShard.get().v2(); return new ShutdownShardMigrationStatus( SingleNodeShutdownMetadata.Status.STALLED, @@ -296,7 +295,8 @@ static ShutdownShardMigrationStatus shardMigrationStatus( shardRouting.shardId().getId(), shardRouting.primary() ? "primary" : "replica", shardRouting.index().getName() - ).getFormattedMessage() + ).getFormattedMessage(), + decision ); } else { return new ShutdownShardMigrationStatus(SingleNodeShutdownMetadata.Status.IN_PROGRESS, totalRemainingShards); diff --git a/x-pack/plugin/shutdown/src/main/java/org/elasticsearch/xpack/shutdown/TransportPutShutdownNodeAction.java b/x-pack/plugin/shutdown/src/main/java/org/elasticsearch/xpack/shutdown/TransportPutShutdownNodeAction.java index 6d95c0eac8779..01b42a56c2fcb 100644 --- a/x-pack/plugin/shutdown/src/main/java/org/elasticsearch/xpack/shutdown/TransportPutShutdownNodeAction.java +++ b/x-pack/plugin/shutdown/src/main/java/org/elasticsearch/xpack/shutdown/TransportPutShutdownNodeAction.java @@ -69,19 +69,6 @@ public ClusterState execute(ClusterState currentState) { currentShutdownMetadata = new NodesShutdownMetadata(new HashMap<>()); } - // Verify that there's not already a shutdown metadata for this node - SingleNodeShutdownMetadata existingRecord = currentShutdownMetadata.getAllNodeMetadataMap().get(request.getNodeId()); - if (existingRecord != null) { - logger.info( - "updating existing shutdown record for node [{}] of type [{}] with reason [{}] with new type [{}] and reason [{}]", - existingRecord.getNodeId(), - existingRecord.getType(), - existingRecord.getReason(), - request.getType(), - request.getReason() - ); - } - final boolean nodeSeen = currentState.getNodes().nodeExists(request.getNodeId()); SingleNodeShutdownMetadata newNodeMetadata = SingleNodeShutdownMetadata.builder() @@ -94,6 +81,14 @@ public ClusterState execute(ClusterState currentState) { .setTargetNodeName(request.getTargetNodeName()) .build(); + // Verify that there's not already a shutdown metadata for this node + SingleNodeShutdownMetadata existingRecord = currentShutdownMetadata.getAllNodeMetadataMap().get(request.getNodeId()); + if (existingRecord != null) { + logger.info("updating existing shutdown record {} with new record {}", existingRecord, newNodeMetadata); + } else { + logger.info("creating shutdown record {}", newNodeMetadata); + } + return ClusterState.builder(currentState) .metadata( Metadata.builder(currentState.metadata()) From 3d6074b76e28c2cf9c13cdd4f53958270c056e91 Mon Sep 17 00:00:00 2001 From: Lisa Cawley Date: Thu, 7 Oct 2021 17:51:14 -0700 Subject: [PATCH 240/250] [DOCS] Fixes typo in calendar API example (#78867) --- .../ml/anomaly-detection/apis/get-calendar-event.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference/ml/anomaly-detection/apis/get-calendar-event.asciidoc b/docs/reference/ml/anomaly-detection/apis/get-calendar-event.asciidoc index 0c44376d33d10..4da5261760182 100644 --- a/docs/reference/ml/anomaly-detection/apis/get-calendar-event.asciidoc +++ b/docs/reference/ml/anomaly-detection/apis/get-calendar-event.asciidoc @@ -159,6 +159,6 @@ period of time: [source,console] -------------------------------------------------- -GET _ml/*/planned-outages/events?start=1635638400000&end=1635724800000 +GET _ml/calendars/planned-outages/events?start=1635638400000&end=1635724800000 -------------------------------------------------- // TEST[skip:setup:calendar_outages_addevent] \ No newline at end of file From 7cb2d059ae7ecbf59eff037b40039c4f844a945b Mon Sep 17 00:00:00 2001 From: Armin Braun Date: Fri, 8 Oct 2021 14:59:18 +0200 Subject: [PATCH 241/250] Store DataTier Preference directly on IndexMetadata (#78668) The data tier preference is very expensive to parse out of the setting string repeatedly for large number of indices when using it in the data tier allocation decider. => as done with other index settings relevant to allocation, this commit moves the data tier preference to a field in `IndexMetadata`. The required moving the `DataTier` class itself to `server`. In a follow-up we can look into making the setting a list setting to remove the duplication around turning the string value into a list in various places. --- .../cluster/metadata/IndexMetadata.java | 31 ++++- .../cluster/routing/allocation}/DataTier.java | 100 +++++++++++++-- .../SearchableSnapshotsSettings.java | 23 ++++ .../cluster/metadata/IndexMetadataTests.java | 23 ++++ ...bstractFrozenAutoscalingIntegTestCase.java | 2 +- .../storage/ReactiveStorageIT.java | 9 +- .../ReactiveStorageDeciderService.java | 10 +- .../xpack/autoscaling/util/FrozenUtils.java | 13 +- .../FrozenShardsDeciderServiceTests.java | 2 +- .../FrozenStorageDeciderServiceTests.java | 2 +- .../ReactiveStorageDeciderDecisionTests.java | 6 +- .../ReactiveStorageDeciderServiceTests.java | 6 +- .../autoscaling/util/FrozenUtilsTests.java | 9 +- ....java => DataTierAllocationDeciderIT.java} | 38 +++--- .../allocation/DataTierAllocationDecider.java | 117 ++++-------------- .../mapper/DataTierFieldMapper.java | 4 +- .../core/DataTiersUsageTransportAction.java | 4 +- .../elasticsearch/xpack/core/XPackPlugin.java | 3 +- .../core/ilm/DataTierMigrationRoutedStep.java | 16 ++- .../xpack/core/ilm/MigrateAction.java | 9 +- .../xpack/core/ilm/MountSnapshotStep.java | 5 +- .../xpack/core/ilm/WaitForDataTierStep.java | 4 +- .../MountSearchableSnapshotRequest.java | 2 +- .../SearchableSnapshotsConstants.java | 26 ---- .../IndexMetadataConversionTests.java | 8 +- .../DataTierAllocationDeciderTests.java | 73 ++++++----- .../mapper/DataTierFieldTypeTests.java | 4 +- .../xpack/core/DataTierTests.java | 9 +- .../core/DataTiersFeatureSetUsageTests.java | 1 + .../DataTiersUsageTransportActionTests.java | 6 +- .../ilm/DataTierMigrationRoutedStepTests.java | 4 +- .../xpack/core/ilm/MigrateActionTests.java | 16 +-- .../ilm/SearchableSnapshotActionTests.java | 2 +- .../core/ilm/WaitForDataTierStepTests.java | 2 +- .../SearchableSnapshotsConstantsTests.java | 12 +- .../datastreams/DataTierDataStreamIT.java | 7 +- .../xpack/MigrateToDataTiersIT.java | 12 +- .../actions/SearchableSnapshotActionIT.java | 6 +- .../xpack/ilm/actions/ShrinkActionIT.java | 4 +- .../xpack/ilm/DataTiersMigrationsTests.java | 4 +- ...adataMigrateToDataTiersRoutingService.java | 4 +- ...MigrateToDataTiersRoutingServiceTests.java | 2 +- .../FrozenSearchableSnapshotsIntegTests.java | 11 +- .../SearchableSnapshotsIntegTests.java | 7 +- .../SearchableSnapshotsResizeIntegTests.java | 5 +- .../SearchableSnapshotDataTierIntegTests.java | 14 +-- ...ableSnapshotsBlobStoreCacheIntegTests.java | 4 +- ...tiallyCachedShardAllocationIntegTests.java | 2 +- .../SearchableSnapshots.java | 8 +- ...archableSnapshotsUsageTransportAction.java | 3 +- ...ransportMountSearchableSnapshotAction.java | 12 +- ...rtSearchableSnapshotCacheStoresAction.java | 2 +- .../SearchableSnapshotAllocator.java | 2 +- .../cache/shared/FrozenCacheService.java | 2 +- .../store/SearchableSnapshotDirectory.java | 2 +- .../SearchableSnapshotAllocatorTests.java | 2 +- ...SearchableSnapshotDirectoryStatsTests.java | 14 +-- .../store/input/FrozenIndexInputTests.java | 4 +- ...bleSnapshotIndexMetadataUpgraderTests.java | 3 +- 59 files changed, 390 insertions(+), 347 deletions(-) rename {x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core => server/src/main/java/org/elasticsearch/cluster/routing/allocation}/DataTier.java (64%) rename x-pack/plugin/core/src/internalClusterTest/java/org/elasticsearch/xpack/cluster/routing/allocation/{DataTierIT.java => DataTierAllocationDeciderIT.java} (89%) diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/IndexMetadata.java b/server/src/main/java/org/elasticsearch/cluster/metadata/IndexMetadata.java index 022771ccd9ca1..b39ab956f4610 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/IndexMetadata.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/IndexMetadata.java @@ -24,6 +24,7 @@ import org.elasticsearch.cluster.block.ClusterBlockLevel; import org.elasticsearch.cluster.node.DiscoveryNodeFilters; import org.elasticsearch.cluster.routing.IndexRouting; +import org.elasticsearch.cluster.routing.allocation.DataTier; import org.elasticsearch.cluster.routing.allocation.IndexMetadataUpdater; import org.elasticsearch.cluster.routing.allocation.decider.DiskThresholdDecider; import org.elasticsearch.common.collect.ImmutableOpenIntMap; @@ -400,6 +401,9 @@ public static APIBlock readFrom(StreamInput input) throws IOException { private final boolean ignoreDiskWatermarks; + @Nullable // since we store null if DataTier.TIER_PREFERENCE_SETTING failed validation + private final List tierPreference; + private IndexMetadata( final Index index, final long version, @@ -429,7 +433,8 @@ private IndexMetadata( final IndexLongFieldRange timestampRange, final int priority, final long creationDate, - final boolean ignoreDiskWatermarks + final boolean ignoreDiskWatermarks, + @Nullable final List tierPreference ) { this.index = index; @@ -468,6 +473,7 @@ private IndexMetadata( this.priority = priority; this.creationDate = creationDate; this.ignoreDiskWatermarks = ignoreDiskWatermarks; + this.tierPreference = tierPreference; assert numberOfShards * routingFactor == routingNumShards : routingNumShards + " must be a multiple of " + numberOfShards; } @@ -574,6 +580,15 @@ public ImmutableOpenMap getAliases() { return this.aliases; } + public List getTierPreference() { + if (tierPreference == null) { + final List parsed = DataTier.parseTierList(DataTier.TIER_PREFERENCE_SETTING.get(settings)); + assert false : "the setting parsing should always throw if we didn't store a tier preference when building this instance"; + return parsed; + } + return tierPreference; + } + /** * Return the concrete mapping for this index or {@code null} if this index has no mappings at all. */ @@ -1311,6 +1326,17 @@ public IndexMetadata build() { final String uuid = settings.get(SETTING_INDEX_UUID, INDEX_UUID_NA_VALUE); + List tierPreference; + try { + tierPreference = DataTier.parseTierList(DataTier.TIER_PREFERENCE_SETTING.get(settings)); + } catch (Exception e) { + assert e instanceof IllegalArgumentException : e; + // BwC hack: the setting failed validation but it will be fixed in + // #IndexMetadataVerifier#convertSharedCacheTierPreference(IndexMetadata)} later so we just store a null + // to be able to build a temporary instance + tierPreference = null; + } + return new IndexMetadata( new Index(index, uuid), version, @@ -1340,7 +1366,8 @@ public IndexMetadata build() { timestampRange, IndexMetadata.INDEX_PRIORITY_SETTING.get(settings), settings.getAsLong(SETTING_CREATION_DATE, -1L), - DiskThresholdDecider.SETTING_IGNORE_DISK_WATERMARKS.get(settings) + DiskThresholdDecider.SETTING_IGNORE_DISK_WATERMARKS.get(settings), + tierPreference ); } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/DataTier.java b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/DataTier.java similarity index 64% rename from x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/DataTier.java rename to server/src/main/java/org/elasticsearch/cluster/routing/allocation/DataTier.java index 25ab37d16b51c..b605f6580a008 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/DataTier.java +++ b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/DataTier.java @@ -1,23 +1,31 @@ /* * 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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ -package org.elasticsearch.xpack.core; +package org.elasticsearch.cluster.routing.allocation; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.node.DiscoveryNodeRole; +import org.elasticsearch.common.Strings; +import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.index.IndexModule; import org.elasticsearch.index.shard.IndexSettingProvider; -import org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider; +import org.elasticsearch.snapshots.SearchableSnapshotsSettings; +import java.util.Collection; +import java.util.Iterator; import java.util.List; +import java.util.Map; import java.util.Set; +import java.util.function.Function; import java.util.stream.Collectors; /** @@ -25,9 +33,6 @@ * "hot", "warm", and "cold" tiers as node roles. In contains the * roles themselves as well as helpers for validation and determining if a node * has a tier configured. - * - * Related: - * {@link org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider} */ public class DataTier { @@ -39,6 +44,17 @@ public class DataTier { public static final Set ALL_DATA_TIERS = Set.of(DATA_CONTENT, DATA_HOT, DATA_WARM, DATA_COLD, DATA_FROZEN); + public static final String TIER_PREFERENCE = "index.routing.allocation.include._tier_preference"; + + public static final Setting TIER_PREFERENCE_SETTING = new Setting<>( + new Setting.SimpleKey(TIER_PREFERENCE), + DataTierSettingValidator::getDefaultTierPreference, + Function.identity(), + new DataTierSettingValidator(), + Setting.Property.Dynamic, + Setting.Property.IndexScope + ); + static { for (String tier : ALL_DATA_TIERS) { assert tier.equals(DATA_FROZEN) || tier.contains(DATA_FROZEN) == false @@ -59,8 +75,8 @@ public static boolean validTierName(String tierName) { /** * Based on the provided target tier it will return a comma separated list of preferred tiers. - * ie. if `data_cold` is the target tier, it will return `data_cold,data_warm,data_hot` - * This is usually used in conjunction with {@link DataTierAllocationDecider#TIER_PREFERENCE_SETTING} + * ie. if `data_cold` is the target tier, it will return `data_cold,data_warm,data_hot`. + * This is usually used in conjunction with {@link #TIER_PREFERENCE_SETTING}. */ public static String getPreferredTiersConfiguration(String targetTier) { int indexOfTargetTier = ORDERED_FROZEN_TO_HOT_TIERS.indexOf(targetTier); @@ -115,6 +131,15 @@ public static boolean isFrozenNode(final Set roles) { return roles.contains(DiscoveryNodeRole.DATA_FROZEN_NODE_ROLE) || roles.contains(DiscoveryNodeRole.DATA_ROLE); } + public static List parseTierList(String tiers) { + if (Strings.hasText(tiers) == false) { + // avoid parsing overhead in the null/empty string case + return List.of(); + } else { + return List.of(tiers.split(",")); + } + } + /** * This setting provider injects the setting allocating all newly created indices with * {@code index.routing.allocation.include._tier_preference: "data_hot"} for a data stream index @@ -128,9 +153,9 @@ public static class DefaultHotAllocationSettingProvider implements IndexSettingP @Override public Settings getAdditionalIndexSettings(String indexName, boolean isDataStreamIndex, Settings indexSettings) { Set settings = indexSettings.keySet(); - if (settings.contains(DataTierAllocationDecider.TIER_PREFERENCE)) { + if (settings.contains(TIER_PREFERENCE)) { // just a marker -- this null value will be removed or overridden by the template/request settings - return Settings.builder().putNull(DataTierAllocationDecider.TIER_PREFERENCE).build(); + return Settings.builder().putNull(TIER_PREFERENCE).build(); } else if (settings.stream().anyMatch(s -> s.startsWith(IndexMetadata.INDEX_ROUTING_REQUIRE_GROUP_PREFIX + ".")) || settings.stream().anyMatch(s -> s.startsWith(IndexMetadata.INDEX_ROUTING_EXCLUDE_GROUP_PREFIX + ".")) || settings.stream().anyMatch(s -> s.startsWith(IndexMetadata.INDEX_ROUTING_INCLUDE_GROUP_PREFIX + "."))) { @@ -142,11 +167,60 @@ public Settings getAdditionalIndexSettings(String indexName, boolean isDataStrea // tier if the index is part of a data stream, the "content" // tier if it is not. if (isDataStreamIndex) { - return Settings.builder().put(DataTierAllocationDecider.TIER_PREFERENCE, DATA_HOT).build(); + return Settings.builder().put(TIER_PREFERENCE, DATA_HOT).build(); + } else { + return Settings.builder().put(TIER_PREFERENCE, DATA_CONTENT).build(); + } + } + } + } + + private static final class DataTierSettingValidator implements Setting.Validator { + + private static final Collection> dependencies = List.of( + IndexModule.INDEX_STORE_TYPE_SETTING, + SearchableSnapshotsSettings.SNAPSHOT_PARTIAL_SETTING + ); + + public static String getDefaultTierPreference(Settings settings) { + if (SearchableSnapshotsSettings.isPartialSearchableSnapshotIndex(settings)) { + return DATA_FROZEN; + } else { + return ""; + } + } + + @Override + public void validate(String value) { + if (Strings.hasText(value)) { + for (String s : parseTierList(value)) { + if (validTierName(s) == false) { + throw new IllegalArgumentException( + "invalid tier names found in [" + value + "] allowed values are " + ALL_DATA_TIERS); + } + } + } + } + + @Override + public void validate(String value, Map, Object> settings, boolean exists) { + if (exists && value != null) { + if (SearchableSnapshotsSettings.isPartialSearchableSnapshotIndex(settings)) { + if (value.equals(DATA_FROZEN) == false) { + throw new IllegalArgumentException("only the [" + DATA_FROZEN + + "] tier preference may be used for partial searchable snapshots (got: [" + value + "])"); + } } else { - return Settings.builder().put(DataTierAllocationDecider.TIER_PREFERENCE, DATA_CONTENT).build(); + if (value.contains(DATA_FROZEN)) { + throw new IllegalArgumentException("[" + DATA_FROZEN + "] tier can only be used for partial searchable snapshots"); + } } } } + + @Override + public Iterator> settings() { + return dependencies.iterator(); + } } } diff --git a/server/src/main/java/org/elasticsearch/snapshots/SearchableSnapshotsSettings.java b/server/src/main/java/org/elasticsearch/snapshots/SearchableSnapshotsSettings.java index 46f8ac4816341..6dd99fdd7145b 100644 --- a/server/src/main/java/org/elasticsearch/snapshots/SearchableSnapshotsSettings.java +++ b/server/src/main/java/org/elasticsearch/snapshots/SearchableSnapshotsSettings.java @@ -8,14 +8,25 @@ package org.elasticsearch.snapshots; +import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Settings; +import java.util.Map; + import static org.elasticsearch.index.IndexModule.INDEX_STORE_TYPE_SETTING; public final class SearchableSnapshotsSettings { public static final String SEARCHABLE_SNAPSHOT_STORE_TYPE = "snapshot"; public static final String SEARCHABLE_SNAPSHOT_PARTIAL_SETTING_KEY = "index.store.snapshot.partial"; + + public static final Setting SNAPSHOT_PARTIAL_SETTING = Setting.boolSetting( + SEARCHABLE_SNAPSHOT_PARTIAL_SETTING_KEY, + false, + Setting.Property.IndexScope, + Setting.Property.PrivateIndex, + Setting.Property.NotCopyableOnResize + ); public static final String SEARCHABLE_SNAPSHOTS_REPOSITORY_NAME_SETTING_KEY = "index.store.snapshot.repository_name"; public static final String SEARCHABLE_SNAPSHOTS_REPOSITORY_UUID_SETTING_KEY = "index.store.snapshot.repository_uuid"; public static final String SEARCHABLE_SNAPSHOTS_SNAPSHOT_NAME_SETTING_KEY = "index.store.snapshot.snapshot_name"; @@ -31,4 +42,16 @@ public static boolean isSearchableSnapshotStore(Settings indexSettings) { public static boolean isPartialSearchableSnapshotIndex(Settings indexSettings) { return isSearchableSnapshotStore(indexSettings) && indexSettings.getAsBoolean(SEARCHABLE_SNAPSHOT_PARTIAL_SETTING_KEY, false); } + + /** + * Based on a map from setting to value, do the settings represent a partial searchable snapshot index? + * + * Both index.store.type and index.store.snapshot.partial must be supplied. + */ + public static boolean isPartialSearchableSnapshotIndex(Map, Object> indexSettings) { + assert indexSettings.containsKey(INDEX_STORE_TYPE_SETTING) : "must include store type in map"; + assert indexSettings.get(SNAPSHOT_PARTIAL_SETTING) != null : "partial setting must be non-null in map (has default value)"; + return SEARCHABLE_SNAPSHOT_STORE_TYPE.equals(indexSettings.get(INDEX_STORE_TYPE_SETTING)) + && (boolean) indexSettings.get(SNAPSHOT_PARTIAL_SETTING); + } } diff --git a/server/src/test/java/org/elasticsearch/cluster/metadata/IndexMetadataTests.java b/server/src/test/java/org/elasticsearch/cluster/metadata/IndexMetadataTests.java index 10c679224b875..b50d1a96930f7 100644 --- a/server/src/test/java/org/elasticsearch/cluster/metadata/IndexMetadataTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/metadata/IndexMetadataTests.java @@ -14,6 +14,7 @@ import org.elasticsearch.action.admin.indices.rollover.MaxPrimaryShardSizeCondition; import org.elasticsearch.action.admin.indices.rollover.MaxSizeCondition; import org.elasticsearch.action.admin.indices.rollover.RolloverInfo; +import org.elasticsearch.cluster.routing.allocation.DataTier; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.collect.ImmutableOpenMap; @@ -388,4 +389,26 @@ public void testIsHidden() { assertTrue(indexMetadata.isHidden()); // preserved if settings unchanged } + public void testGetTierPreference() { + final Settings indexSettings = indexSettingsWithDataTier("data_warm,data_cold"); + final IndexMetadata indexMetadata = IndexMetadata.builder("myindex").settings(indexSettings).build(); + assertThat(indexMetadata.getTierPreference(), is(DataTier.parseTierList(DataTier.TIER_PREFERENCE_SETTING.get(indexSettings)))); + assertThat(indexMetadata.getTierPreference(), is(List.of(DataTier.DATA_WARM, DataTier.DATA_COLD))); + + } + + public void testBuildsWithBrokenTierPreference() { + final Settings indexSettings = indexSettingsWithDataTier("broken_tier"); + final IndexMetadata indexMetadata = IndexMetadata.builder("myindex").settings(indexSettings).build(); + expectThrows(IllegalArgumentException.class, indexMetadata::getTierPreference); + } + + private static Settings indexSettingsWithDataTier(String dataTier) { + return Settings.builder() + .put(IndexMetadata.SETTING_VERSION_CREATED, Version.CURRENT) + .put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1) + .put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0) + .put(DataTier.TIER_PREFERENCE, dataTier) + .build(); + } } diff --git a/x-pack/plugin/autoscaling/src/internalClusterTest/java/org/elasticsearch/xpack/autoscaling/AbstractFrozenAutoscalingIntegTestCase.java b/x-pack/plugin/autoscaling/src/internalClusterTest/java/org/elasticsearch/xpack/autoscaling/AbstractFrozenAutoscalingIntegTestCase.java index f68d6370a999b..d814209abafda 100644 --- a/x-pack/plugin/autoscaling/src/internalClusterTest/java/org/elasticsearch/xpack/autoscaling/AbstractFrozenAutoscalingIntegTestCase.java +++ b/x-pack/plugin/autoscaling/src/internalClusterTest/java/org/elasticsearch/xpack/autoscaling/AbstractFrozenAutoscalingIntegTestCase.java @@ -10,6 +10,7 @@ import org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotResponse; import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.node.DiscoveryNodeRole; +import org.elasticsearch.cluster.routing.allocation.DataTier; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.ByteSizeUnit; @@ -22,7 +23,6 @@ import org.elasticsearch.xpack.autoscaling.action.PutAutoscalingPolicyAction; import org.elasticsearch.xpack.autoscaling.capacity.AutoscalingCapacity; import org.elasticsearch.xpack.autoscaling.shards.LocalStateAutoscalingAndSearchableSnapshots; -import org.elasticsearch.xpack.core.DataTier; import org.elasticsearch.xpack.core.searchablesnapshots.MountSearchableSnapshotAction; import org.elasticsearch.xpack.core.searchablesnapshots.MountSearchableSnapshotRequest; import org.elasticsearch.xpack.searchablesnapshots.cache.shared.FrozenCacheService; diff --git a/x-pack/plugin/autoscaling/src/internalClusterTest/java/org/elasticsearch/xpack/autoscaling/storage/ReactiveStorageIT.java b/x-pack/plugin/autoscaling/src/internalClusterTest/java/org/elasticsearch/xpack/autoscaling/storage/ReactiveStorageIT.java index 1216e153fc629..a1f7a5bb24841 100644 --- a/x-pack/plugin/autoscaling/src/internalClusterTest/java/org/elasticsearch/xpack/autoscaling/storage/ReactiveStorageIT.java +++ b/x-pack/plugin/autoscaling/src/internalClusterTest/java/org/elasticsearch/xpack/autoscaling/storage/ReactiveStorageIT.java @@ -16,6 +16,7 @@ import org.elasticsearch.cluster.InternalClusterInfoService; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.cluster.node.DiscoveryNodeRole; +import org.elasticsearch.cluster.routing.allocation.DataTier; import org.elasticsearch.common.settings.ClusterSettings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.node.Node; @@ -23,8 +24,6 @@ import org.elasticsearch.test.NodeRoles; import org.elasticsearch.xpack.autoscaling.action.GetAutoscalingCapacityAction; import org.elasticsearch.xpack.autoscaling.action.PutAutoscalingPolicyAction; -import org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider; -import org.elasticsearch.xpack.core.DataTier; import org.hamcrest.Matchers; import java.util.Arrays; @@ -118,7 +117,7 @@ private void testScaleFromEmptyWarm(boolean allocatable) throws Exception { .put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0) .put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 6) .put(INDEX_STORE_STATS_REFRESH_INTERVAL_SETTING.getKey(), "0ms") - .put(DataTierAllocationDecider.TIER_PREFERENCE, allocatable ? "data_hot" : "data_content") + .put(DataTier.TIER_PREFERENCE, allocatable ? "data_hot" : "data_content") .build() ).setWaitForActiveShards(allocatable ? ActiveShardCount.DEFAULT : ActiveShardCount.NONE) ); @@ -131,9 +130,7 @@ private void testScaleFromEmptyWarm(boolean allocatable) throws Exception { client().admin() .indices() .updateSettings( - new UpdateSettingsRequest(indexName).settings( - Settings.builder().put(DataTierAllocationDecider.TIER_PREFERENCE, "data_warm,data_hot") - ) + new UpdateSettingsRequest(indexName).settings(Settings.builder().put(DataTier.TIER_PREFERENCE, "data_warm,data_hot")) ) .actionGet() ); diff --git a/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/storage/ReactiveStorageDeciderService.java b/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/storage/ReactiveStorageDeciderService.java index 1e509cf9b9190..e4a268447874c 100644 --- a/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/storage/ReactiveStorageDeciderService.java +++ b/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/storage/ReactiveStorageDeciderService.java @@ -24,6 +24,7 @@ import org.elasticsearch.cluster.routing.RoutingTable; import org.elasticsearch.cluster.routing.ShardRouting; import org.elasticsearch.cluster.routing.ShardRoutingState; +import org.elasticsearch.cluster.routing.allocation.DataTier; import org.elasticsearch.cluster.routing.allocation.DiskThresholdSettings; import org.elasticsearch.cluster.routing.allocation.RoutingAllocation; import org.elasticsearch.cluster.routing.allocation.decider.AllocationDeciders; @@ -288,7 +289,7 @@ public boolean canRemainOnlyHighestTierPreference(ShardRouting shard, RoutingAll ) != Decision.NO; if (result && nodes.isEmpty() - && Strings.hasText(DataTierAllocationDecider.TIER_PREFERENCE_SETTING.get(indexMetadata(shard, allocation).getSettings()))) { + && Strings.hasText(DataTier.TIER_PREFERENCE_SETTING.get(indexMetadata(shard, allocation).getSettings()))) { // The data tier decider allows a shard to remain on a lower preference tier when no nodes exists on higher preference // tiers. // Here we ensure that if our policy governs the highest preference tier, we assume the shard needs to move to that tier @@ -391,10 +392,9 @@ private IndexMetadata indexMetadata(ShardRouting shard, RoutingAllocation alloca return allocation.metadata().getIndexSafe(shard.index()); } - private Optional highestPreferenceTier(String tierPreference, DiscoveryNodes nodes) { - String[] preferredTiers = DataTierAllocationDecider.parseTierList(tierPreference); - assert preferredTiers.length > 0; - return Optional.of(preferredTiers[0]); + private Optional highestPreferenceTier(List preferredTiers, DiscoveryNodes nodes) { + assert preferredTiers.isEmpty() == false; + return Optional.of(preferredTiers.get(0)); } public long maxShardSize() { diff --git a/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/util/FrozenUtils.java b/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/util/FrozenUtils.java index 6c090c50b703e..3946025c297fd 100644 --- a/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/util/FrozenUtils.java +++ b/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/util/FrozenUtils.java @@ -7,16 +7,17 @@ package org.elasticsearch.xpack.autoscaling.util; +import org.elasticsearch.cluster.routing.allocation.DataTier; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider; -import org.elasticsearch.xpack.core.DataTier; + +import java.util.List; public class FrozenUtils { public static boolean isFrozenIndex(Settings indexSettings) { - String tierPreference = DataTierAllocationDecider.TIER_PREFERENCE_SETTING.get(indexSettings); - String[] preferredTiers = DataTierAllocationDecider.parseTierList(tierPreference); - if (preferredTiers.length >= 1 && preferredTiers[0].equals(DataTier.DATA_FROZEN)) { - assert preferredTiers.length == 1 : "frozen tier preference must be frozen only"; + String tierPreference = DataTier.TIER_PREFERENCE_SETTING.get(indexSettings); + List preferredTiers = DataTier.parseTierList(tierPreference); + if (preferredTiers.isEmpty() == false && preferredTiers.get(0).equals(DataTier.DATA_FROZEN)) { + assert preferredTiers.size() == 1 : "frozen tier preference must be frozen only"; return true; } else { return false; diff --git a/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/shards/FrozenShardsDeciderServiceTests.java b/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/shards/FrozenShardsDeciderServiceTests.java index f9de618cd7da8..34f4ec007bbd9 100644 --- a/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/shards/FrozenShardsDeciderServiceTests.java +++ b/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/shards/FrozenShardsDeciderServiceTests.java @@ -11,6 +11,7 @@ import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.cluster.metadata.Metadata; +import org.elasticsearch.cluster.routing.allocation.DataTier; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.unit.ByteSizeValue; @@ -18,7 +19,6 @@ import org.elasticsearch.xpack.autoscaling.capacity.AutoscalingDeciderContext; import org.elasticsearch.xpack.autoscaling.capacity.AutoscalingDeciderResult; import org.elasticsearch.xpack.autoscaling.util.FrozenUtilsTests; -import org.elasticsearch.xpack.core.DataTier; import java.util.Objects; diff --git a/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/storage/FrozenStorageDeciderServiceTests.java b/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/storage/FrozenStorageDeciderServiceTests.java index 4c2900710235c..1b8082db46776 100644 --- a/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/storage/FrozenStorageDeciderServiceTests.java +++ b/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/storage/FrozenStorageDeciderServiceTests.java @@ -13,6 +13,7 @@ import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.cluster.metadata.Metadata; +import org.elasticsearch.cluster.routing.allocation.DataTier; import org.elasticsearch.common.collect.ImmutableOpenMap; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.ByteSizeValue; @@ -23,7 +24,6 @@ import org.elasticsearch.xpack.autoscaling.capacity.AutoscalingDeciderContext; import org.elasticsearch.xpack.autoscaling.capacity.AutoscalingDeciderResult; import org.elasticsearch.xpack.autoscaling.util.FrozenUtilsTests; -import org.elasticsearch.xpack.core.DataTier; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.nullValue; diff --git a/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/storage/ReactiveStorageDeciderDecisionTests.java b/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/storage/ReactiveStorageDeciderDecisionTests.java index 11addd6a847cf..84ab30ff9f175 100644 --- a/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/storage/ReactiveStorageDeciderDecisionTests.java +++ b/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/storage/ReactiveStorageDeciderDecisionTests.java @@ -25,6 +25,7 @@ import org.elasticsearch.cluster.routing.RoutingTable; import org.elasticsearch.cluster.routing.ShardRouting; import org.elasticsearch.cluster.routing.ShardRoutingState; +import org.elasticsearch.cluster.routing.allocation.DataTier; import org.elasticsearch.cluster.routing.allocation.DiskThresholdSettings; import org.elasticsearch.cluster.routing.allocation.RoutingAllocation; import org.elasticsearch.cluster.routing.allocation.allocator.BalancedShardsAllocator; @@ -47,7 +48,6 @@ import org.elasticsearch.xpack.autoscaling.capacity.AutoscalingDeciderContext; import org.elasticsearch.xpack.autoscaling.capacity.AutoscalingDeciderResult; import org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider; -import org.elasticsearch.xpack.core.DataTier; import org.junit.Before; import java.util.Collection; @@ -290,7 +290,7 @@ private IndexMetadata moveToCold(IndexMetadata imd) { overrideSetting( imd, builder, - DataTierAllocationDecider.TIER_PREFERENCE_SETTING, + DataTier.TIER_PREFERENCE_SETTING, randomFrom(DataTier.DATA_COLD, DataTier.DATA_COLD + "," + DataTier.DATA_HOT) ); return IndexMetadata.builder(imd).settings(builder).build(); @@ -591,7 +591,7 @@ public Long getShardSize(ShardRouting shardRouting) { } private static ClusterState addRandomIndices(int minShards, int maxShardCopies, ClusterState state) { - String[] tierSettingNames = new String[] { DataTierAllocationDecider.TIER_PREFERENCE }; + String[] tierSettingNames = new String[] { DataTier.TIER_PREFERENCE }; int shards = randomIntBetween(minShards, 20); Metadata.Builder builder = Metadata.builder(); RoutingTable.Builder routingTableBuilder = RoutingTable.builder(); diff --git a/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/storage/ReactiveStorageDeciderServiceTests.java b/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/storage/ReactiveStorageDeciderServiceTests.java index 479503e678dc3..8b32b0dd44482 100644 --- a/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/storage/ReactiveStorageDeciderServiceTests.java +++ b/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/storage/ReactiveStorageDeciderServiceTests.java @@ -27,6 +27,7 @@ import org.elasticsearch.cluster.routing.ShardRouting; import org.elasticsearch.cluster.routing.ShardRoutingState; import org.elasticsearch.cluster.routing.TestShardRouting; +import org.elasticsearch.cluster.routing.allocation.DataTier; import org.elasticsearch.cluster.routing.allocation.DiskThresholdSettings; import org.elasticsearch.cluster.routing.allocation.RoutingAllocation; import org.elasticsearch.cluster.routing.allocation.decider.AllocationDecider; @@ -52,7 +53,6 @@ import org.elasticsearch.snapshots.SnapshotShardSizeInfo; import org.elasticsearch.xpack.autoscaling.AutoscalingTestCase; import org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider; -import org.elasticsearch.xpack.core.DataTier; import java.util.Arrays; import java.util.Collection; @@ -513,7 +513,7 @@ public Decision canRemain(ShardRouting shardRouting, RoutingNode node, RoutingAl public ClusterState addPreference(IndexMetadata indexMetadata, ClusterState clusterState, String preference) { IndexMetadata indexMetadataWithPreference = IndexMetadata.builder(indexMetadata) - .settings(Settings.builder().put(indexMetadata.getSettings()).put(DataTierAllocationDecider.TIER_PREFERENCE, preference)) + .settings(Settings.builder().put(indexMetadata.getSettings()).put(DataTier.TIER_PREFERENCE, preference)) .build(); return ClusterState.builder(clusterState) @@ -552,7 +552,7 @@ public void testNeedsThisTier() { Metadata.Builder metaBuilder = Metadata.builder(); Settings.Builder settings = settings(Version.CURRENT); if (randomBoolean()) { - settings.put(DataTierAllocationDecider.TIER_PREFERENCE, randomBoolean() ? DataTier.DATA_HOT : "data_hot,data_warm"); + settings.put(DataTier.TIER_PREFERENCE, randomBoolean() ? DataTier.DATA_HOT : "data_hot,data_warm"); } IndexMetadata indexMetadata = IndexMetadata.builder(randomAlphaOfLength(5)) .settings(settings) diff --git a/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/util/FrozenUtilsTests.java b/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/util/FrozenUtilsTests.java index f6b8f4d9be346..01e4dbc77d9cc 100644 --- a/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/util/FrozenUtilsTests.java +++ b/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/util/FrozenUtilsTests.java @@ -11,12 +11,11 @@ import org.elasticsearch.Version; import org.elasticsearch.cluster.metadata.IndexMetadata; +import org.elasticsearch.cluster.routing.allocation.DataTier; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.index.IndexModule; +import org.elasticsearch.snapshots.SearchableSnapshotsSettings; import org.elasticsearch.xpack.autoscaling.AutoscalingTestCase; -import org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider; -import org.elasticsearch.xpack.core.DataTier; -import org.elasticsearch.xpack.core.searchablesnapshots.SearchableSnapshotsConstants; import java.util.Objects; @@ -42,11 +41,11 @@ public static String randomNonFrozenTierPreference() { public static Settings indexSettings(String tierPreference) { Settings.Builder settings = Settings.builder() .put(randomAlphaOfLength(10), randomLong()) - .put(DataTierAllocationDecider.TIER_PREFERENCE, tierPreference) + .put(DataTier.TIER_PREFERENCE, tierPreference) .put(IndexMetadata.SETTING_VERSION_CREATED, Version.CURRENT); // pass setting validator. if (Objects.equals(tierPreference, DataTier.DATA_FROZEN)) { - settings.put(SearchableSnapshotsConstants.SNAPSHOT_PARTIAL_SETTING.getKey(), true) + settings.put(SearchableSnapshotsSettings.SNAPSHOT_PARTIAL_SETTING.getKey(), true) .put(IndexModule.INDEX_STORE_TYPE_SETTING.getKey(), SEARCHABLE_SNAPSHOT_STORE_TYPE); } return settings.build(); diff --git a/x-pack/plugin/core/src/internalClusterTest/java/org/elasticsearch/xpack/cluster/routing/allocation/DataTierIT.java b/x-pack/plugin/core/src/internalClusterTest/java/org/elasticsearch/xpack/cluster/routing/allocation/DataTierAllocationDeciderIT.java similarity index 89% rename from x-pack/plugin/core/src/internalClusterTest/java/org/elasticsearch/xpack/cluster/routing/allocation/DataTierIT.java rename to x-pack/plugin/core/src/internalClusterTest/java/org/elasticsearch/xpack/cluster/routing/allocation/DataTierAllocationDeciderIT.java index daf632cc4e81f..f51817ea63544 100644 --- a/x-pack/plugin/core/src/internalClusterTest/java/org/elasticsearch/xpack/cluster/routing/allocation/DataTierIT.java +++ b/x-pack/plugin/core/src/internalClusterTest/java/org/elasticsearch/xpack/cluster/routing/allocation/DataTierAllocationDeciderIT.java @@ -17,7 +17,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.test.ESIntegTestCase; -import org.elasticsearch.xpack.core.DataTier; +import org.elasticsearch.cluster.routing.allocation.DataTier; import org.elasticsearch.xpack.core.DataTiersFeatureSetUsage; import org.elasticsearch.xpack.core.action.XPackUsageRequestBuilder; import org.elasticsearch.xpack.core.action.XPackUsageResponse; @@ -31,7 +31,7 @@ import static org.hamcrest.Matchers.greaterThanOrEqualTo; @ESIntegTestCase.ClusterScope(scope = ESIntegTestCase.Scope.TEST, numDataNodes = 0, numClientNodes = 0) -public class DataTierIT extends ESIntegTestCase { +public class DataTierAllocationDeciderIT extends ESIntegTestCase { private static final String index = "myindex"; @Override @@ -47,7 +47,7 @@ public void testDefaultIndexAllocateToContent() { client().admin().indices().prepareCreate(index).setWaitForActiveShards(0).get(); Settings idxSettings = client().admin().indices().prepareGetIndex().addIndices(index).get().getSettings().get(index); - assertThat(DataTierAllocationDecider.TIER_PREFERENCE_SETTING.get(idxSettings), equalTo(DataTier.DATA_CONTENT)); + assertThat(DataTier.TIER_PREFERENCE_SETTING.get(idxSettings), equalTo(DataTier.DATA_CONTENT)); // index should be red assertThat(client().admin().cluster().prepareHealth(index).get().getIndices().get(index).getStatus(), @@ -73,11 +73,11 @@ public void testOverrideDefaultAllocation() { client().admin().indices().prepareCreate(index) .setWaitForActiveShards(0) .setSettings(Settings.builder() - .put(DataTierAllocationDecider.TIER_PREFERENCE, DataTier.DATA_WARM)) + .put(DataTier.TIER_PREFERENCE, DataTier.DATA_WARM)) .get(); Settings idxSettings = client().admin().indices().prepareGetIndex().addIndices(index).get().getSettings().get(index); - assertThat(idxSettings.get(DataTierAllocationDecider.TIER_PREFERENCE), equalTo(DataTier.DATA_WARM)); + assertThat(idxSettings.get(DataTier.TIER_PREFERENCE), equalTo(DataTier.DATA_WARM)); // index should be yellow logger.info("--> waiting for {} to be yellow", index); @@ -92,13 +92,13 @@ public void testRequestSettingOverridesAllocation() { client().admin().indices().prepareCreate(index) .setWaitForActiveShards(0) .setSettings(Settings.builder() - .putNull(DataTierAllocationDecider.TIER_PREFERENCE)) + .putNull(DataTier.TIER_PREFERENCE)) .get(); Settings idxSettings = client().admin().indices().prepareGetIndex().addIndices(index).get().getSettings().get(index); - assertThat(DataTierAllocationDecider.TIER_PREFERENCE_SETTING.get(idxSettings), equalTo("")); + assertThat(DataTier.TIER_PREFERENCE_SETTING.get(idxSettings), equalTo("")); // Even the key shouldn't exist if it has been nulled out - assertFalse(idxSettings.keySet().toString(), idxSettings.keySet().contains(DataTierAllocationDecider.TIER_PREFERENCE)); + assertFalse(idxSettings.keySet().toString(), idxSettings.keySet().contains(DataTier.TIER_PREFERENCE)); // index should be yellow logger.info("--> waiting for {} to be yellow", index); @@ -114,9 +114,9 @@ public void testRequestSettingOverridesAllocation() { .get(); idxSettings = client().admin().indices().prepareGetIndex().addIndices(index).get().getSettings().get(index); - assertThat(DataTierAllocationDecider.TIER_PREFERENCE_SETTING.get(idxSettings), equalTo("")); + assertThat(DataTier.TIER_PREFERENCE_SETTING.get(idxSettings), equalTo("")); // The key should not be put in place since it was overridden - assertFalse(idxSettings.keySet().contains(DataTierAllocationDecider.TIER_PREFERENCE)); + assertFalse(idxSettings.keySet().contains(DataTier.TIER_PREFERENCE)); assertThat(idxSettings.get(IndexMetadata.INDEX_ROUTING_REQUIRE_GROUP_PREFIX + ".box"), equalTo("cold")); // index should be yellow @@ -137,7 +137,7 @@ public void testShrinkStaysOnTier() { .setSettings(Settings.builder() .put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 2) .put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0) - .put(DataTierAllocationDecider.TIER_PREFERENCE, "data_warm")) + .put(DataTier.TIER_PREFERENCE, "data_warm")) .get(); client().admin().indices().prepareAddBlock(IndexMetadata.APIBlock.READ_ONLY, index).get(); @@ -153,7 +153,7 @@ public void testShrinkStaysOnTier() { Settings idxSettings = client().admin().indices().prepareGetIndex().addIndices(index + "-shrunk") .get().getSettings().get(index + "-shrunk"); // It should inherit the setting of its originator - assertThat(DataTierAllocationDecider.TIER_PREFERENCE_SETTING.get(idxSettings), equalTo(DataTier.DATA_WARM)); + assertThat(DataTier.TIER_PREFERENCE_SETTING.get(idxSettings), equalTo(DataTier.DATA_WARM)); // Required or else the test cleanup fails because it can't delete the indices client().admin().indices().prepareUpdateSettings(index, index + "-shrunk") @@ -177,7 +177,7 @@ public void testTemplateOverridesDefaults() { client().admin().indices().prepareCreate(index).setWaitForActiveShards(0).get(); Settings idxSettings = client().admin().indices().prepareGetIndex().addIndices(index).get().getSettings().get(index); - assertThat(idxSettings.keySet().contains(DataTierAllocationDecider.TIER_PREFERENCE), equalTo(false)); + assertThat(idxSettings.keySet().contains(DataTier.TIER_PREFERENCE), equalTo(false)); // index should be yellow ensureYellow(index); @@ -185,7 +185,7 @@ public void testTemplateOverridesDefaults() { client().admin().indices().prepareDelete(index).get(); t = new Template(Settings.builder() - .putNull(DataTierAllocationDecider.TIER_PREFERENCE) + .putNull(DataTier.TIER_PREFERENCE) .build(), null, null); ct = new ComposableIndexTemplate.Builder().indexPatterns(Collections.singletonList(index)) .template(t).build(); @@ -195,7 +195,7 @@ public void testTemplateOverridesDefaults() { client().admin().indices().prepareCreate(index).setWaitForActiveShards(0).get(); idxSettings = client().admin().indices().prepareGetIndex().addIndices(index).get().getSettings().get(index); - assertThat(idxSettings.keySet().contains(DataTierAllocationDecider.TIER_PREFERENCE), equalTo(false)); + assertThat(idxSettings.keySet().contains(DataTier.TIER_PREFERENCE), equalTo(false)); ensureYellow(index); } @@ -207,7 +207,7 @@ public void testDataTierTelemetry() { client().admin().indices().prepareCreate(index) .setSettings(Settings.builder() - .put(DataTierAllocationDecider.TIER_PREFERENCE, "data_hot") + .put(DataTier.TIER_PREFERENCE, "data_hot") .put("index.number_of_shards", 2) .put("index.number_of_replicas", 0)) .setWaitForActiveShards(0) @@ -253,7 +253,7 @@ public void testIllegalOnFrozen() { () -> createIndex(index, Settings.builder() .put("index.number_of_shards", 1) .put("index.number_of_replicas", 0) - .put(DataTierAllocationDecider.TIER_PREFERENCE, DataTier.DATA_FROZEN) + .put(DataTier.TIER_PREFERENCE, DataTier.DATA_FROZEN) .build())); assertThat(e.getMessage(), equalTo("[data_frozen] tier can only be used for partial searchable snapshots")); @@ -261,7 +261,7 @@ public void testIllegalOnFrozen() { createIndex(index, Settings.builder() .put("index.number_of_shards", 1) .put("index.number_of_replicas", 0) - .put(DataTierAllocationDecider.TIER_PREFERENCE, initialTier) + .put(DataTier.TIER_PREFERENCE, initialTier) .build()); IllegalArgumentException e2 = expectThrows(IllegalArgumentException.class, () -> updatePreference(DataTier.DATA_FROZEN)); @@ -272,7 +272,7 @@ public void testIllegalOnFrozen() { private void updatePreference(String tier) { client().admin().indices().updateSettings(new UpdateSettingsRequest(index) - .settings(Map.of(DataTierAllocationDecider.TIER_PREFERENCE, tier))).actionGet(); + .settings(Map.of(DataTier.TIER_PREFERENCE, tier))).actionGet(); } private DataTiersFeatureSetUsage getUsage() { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/cluster/routing/allocation/DataTierAllocationDecider.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/cluster/routing/allocation/DataTierAllocationDecider.java index 648e7b44c86e3..9466d09a30d62 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/cluster/routing/allocation/DataTierAllocationDecider.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/cluster/routing/allocation/DataTierAllocationDecider.java @@ -17,23 +17,11 @@ import org.elasticsearch.cluster.routing.allocation.decider.AllocationDecider; import org.elasticsearch.cluster.routing.allocation.decider.Decision; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.settings.Setting; -import org.elasticsearch.common.settings.Setting.Property; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.index.IndexModule; -import org.elasticsearch.snapshots.SearchableSnapshotsSettings; -import org.elasticsearch.xpack.core.DataTier; -import org.elasticsearch.xpack.core.searchablesnapshots.SearchableSnapshotsConstants; - -import java.util.Collection; -import java.util.Iterator; +import org.elasticsearch.cluster.routing.allocation.DataTier; + import java.util.List; -import java.util.Map; import java.util.Optional; import java.util.Set; -import java.util.function.Function; - -import static org.elasticsearch.xpack.core.DataTier.DATA_FROZEN; /** * The {@code DataTierAllocationDecider} is a custom allocation decider that behaves similar to the @@ -44,65 +32,6 @@ public class DataTierAllocationDecider extends AllocationDecider { public static final String NAME = "data_tier"; - public static final String TIER_PREFERENCE = "index.routing.allocation.include._tier_preference"; - - private static final DataTierValidator VALIDATOR = new DataTierValidator(); - public static final Setting TIER_PREFERENCE_SETTING = new Setting<>(new Setting.SimpleKey(TIER_PREFERENCE), - DataTierValidator::getDefaultTierPreference, Function.identity(), VALIDATOR, Property.Dynamic, Property.IndexScope); - - private static void validateTierSetting(String setting) { - if (Strings.hasText(setting)) { - for (String s : setting.split(",")) { - if (DataTier.validTierName(s) == false) { - throw new IllegalArgumentException( - "invalid tier names found in [" + setting + "] allowed values are " + DataTier.ALL_DATA_TIERS); - } - } - } - } - - private static class DataTierValidator implements Setting.Validator { - - private static final Collection> dependencies = List.of( - IndexModule.INDEX_STORE_TYPE_SETTING, - SearchableSnapshotsConstants.SNAPSHOT_PARTIAL_SETTING - ); - - public static String getDefaultTierPreference(Settings settings) { - if (SearchableSnapshotsSettings.isPartialSearchableSnapshotIndex(settings)) { - return DATA_FROZEN; - } else { - return ""; - } - } - - @Override - public void validate(String value) { - validateTierSetting(value); - } - - @Override - public void validate(String value, Map, Object> settings, boolean exists) { - if (exists && value != null) { - if (SearchableSnapshotsConstants.isPartialSearchableSnapshotIndex(settings)) { - if (value.equals(DATA_FROZEN) == false) { - throw new IllegalArgumentException("only the [" + DATA_FROZEN + - "] tier preference may be used for partial searchable snapshots (got: [" + value + "])"); - } - } else { - if (value.contains(DATA_FROZEN)) { - throw new IllegalArgumentException("[" + DATA_FROZEN + "] tier can only be used for partial searchable snapshots"); - } - } - } - } - - @Override - public Iterator> settings() { - return dependencies.iterator(); - } - } - public DataTierAllocationDecider() { } @@ -135,7 +64,7 @@ public Decision shouldFilter(IndexMetadata indexMd, Set roles } public interface PreferredTierFunction { - Optional apply(String tierPreference, DiscoveryNodes nodes); + Optional apply(List tierPreference, DiscoveryNodes nodes); } public Decision shouldFilter(IndexMetadata indexMd, Set roles, @@ -150,23 +79,36 @@ public Decision shouldFilter(IndexMetadata indexMd, Set roles private Decision shouldIndexPreferTier(IndexMetadata indexMetadata, Set roles, PreferredTierFunction preferredTierFunction, RoutingAllocation allocation) { - Settings indexSettings = indexMetadata.getSettings(); - String tierPreference = TIER_PREFERENCE_SETTING.get(indexSettings); + List tierPreference = indexMetadata.getTierPreference(); - if (Strings.hasText(tierPreference)) { + if (tierPreference.isEmpty() == false) { Optional tier = preferredTierFunction.apply(tierPreference, allocation.nodes()); if (tier.isPresent()) { String tierName = tier.get(); if (allocationAllowed(tierName, roles)) { + if (allocation.debugDecision() == false) { + return Decision.YES; + } return allocation.decision(Decision.YES, NAME, - "index has a preference for tiers [%s] and node has tier [%s]", tierPreference, tierName); + "index has a preference for tiers [%s] and node has tier [%s]", String.join(",", tierPreference), tierName); } else { - return allocation.decision(Decision.NO, NAME, - "index has a preference for tiers [%s] and node does not meet the required [%s] tier", tierPreference, tierName); + if (allocation.debugDecision() == false) { + return Decision.NO; + } + return allocation.decision( + Decision.NO, + NAME, + "index has a preference for tiers [%s] and node does not meet the required [%s] tier", + String.join(",", tierPreference), + tierName + ); } } else { + if (allocation.debugDecision() == false) { + return Decision.NO; + } return allocation.decision(Decision.NO, NAME, "index has a preference for tiers [%s], " + - "but no nodes for any of those tiers are available in the cluster", tierPreference); + "but no nodes for any of those tiers are available in the cluster", String.join(",", tierPreference)); } } return null; @@ -178,8 +120,8 @@ private Decision shouldIndexPreferTier(IndexMetadata indexMetadata, Set}. */ - public static Optional preferredAvailableTier(String prioritizedTiers, DiscoveryNodes nodes) { - for (String tier : parseTierList(prioritizedTiers)) { + public static Optional preferredAvailableTier(List prioritizedTiers, DiscoveryNodes nodes) { + for (String tier : prioritizedTiers) { if (tierNodesPresent(tier, nodes)) { return Optional.of(tier); } @@ -187,15 +129,6 @@ public static Optional preferredAvailableTier(String prioritizedTiers, D return Optional.empty(); } - public static String[] parseTierList(String tiers) { - if (Strings.hasText(tiers) == false) { - // avoid parsing overhead in the null/empty string case - return Strings.EMPTY_ARRAY; - } else { - return tiers.split(","); - } - } - static boolean tierNodesPresent(String singleTier, DiscoveryNodes nodes) { assert singleTier.equals(DiscoveryNodeRole.DATA_ROLE.roleName()) || DataTier.validTierName(singleTier) : "tier " + singleTier + " is an invalid tier name"; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/cluster/routing/allocation/mapper/DataTierFieldMapper.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/cluster/routing/allocation/mapper/DataTierFieldMapper.java index 7b51e3360cdd6..fb77ae0f30463 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/cluster/routing/allocation/mapper/DataTierFieldMapper.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/cluster/routing/allocation/mapper/DataTierFieldMapper.java @@ -10,6 +10,7 @@ import org.apache.lucene.search.MatchAllDocsQuery; import org.apache.lucene.search.MatchNoDocsQuery; import org.apache.lucene.search.Query; +import org.elasticsearch.cluster.routing.allocation.DataTier; import org.elasticsearch.common.Strings; import org.elasticsearch.common.regex.Regex; import org.elasticsearch.common.settings.Settings; @@ -18,7 +19,6 @@ import org.elasticsearch.index.mapper.MetadataFieldMapper; import org.elasticsearch.index.mapper.ValueFetcher; import org.elasticsearch.index.query.SearchExecutionContext; -import org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider; import java.util.Collections; import java.util.List; @@ -89,7 +89,7 @@ public ValueFetcher valueFetcher(SearchExecutionContext context, String format) */ private String getTierPreference(SearchExecutionContext context) { Settings settings = context.getIndexSettings().getSettings(); - String value = DataTierAllocationDecider.TIER_PREFERENCE_SETTING.get(settings); + String value = DataTier.TIER_PREFERENCE_SETTING.get(settings); if (Strings.hasText(value) == false) { return null; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/DataTiersUsageTransportAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/DataTiersUsageTransportAction.java index faf49641524aa..5f0a228051004 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/DataTiersUsageTransportAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/DataTiersUsageTransportAction.java @@ -21,6 +21,7 @@ import org.elasticsearch.cluster.routing.RoutingNodes; import org.elasticsearch.cluster.routing.ShardRouting; import org.elasticsearch.cluster.routing.ShardRoutingState; +import org.elasticsearch.cluster.routing.allocation.DataTier; import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.Strings; import org.elasticsearch.common.collect.ImmutableOpenMap; @@ -32,7 +33,6 @@ import org.elasticsearch.tasks.Task; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.TransportService; -import org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider; import org.elasticsearch.xpack.core.action.XPackUsageFeatureAction; import org.elasticsearch.xpack.core.action.XPackUsageFeatureResponse; import org.elasticsearch.xpack.core.action.XPackUsageFeatureTransportAction; @@ -83,7 +83,7 @@ protected void masterOperation(Task task, XPackUsageRequest request, ClusterStat static Map tierIndices(ImmutableOpenMap indices) { Map indexByTier = new HashMap<>(); indices.forEach(entry -> { - String tierPref = entry.value.getSettings().get(DataTierAllocationDecider.TIER_PREFERENCE); + String tierPref = entry.value.getSettings().get(DataTier.TIER_PREFERENCE); if (Strings.hasText(tierPref)) { String[] tiers = tierPref.split(","); if (tiers.length > 0) { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/XPackPlugin.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/XPackPlugin.java index f276ead608e33..30cf991994688 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/XPackPlugin.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/XPackPlugin.java @@ -19,6 +19,7 @@ import org.elasticsearch.cluster.metadata.Metadata; import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.node.DiscoveryNodes; +import org.elasticsearch.cluster.routing.allocation.DataTier; import org.elasticsearch.cluster.routing.allocation.decider.AllocationDecider; import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.inject.Binder; @@ -384,7 +385,7 @@ public Optional getEngineFactory(IndexSettings indexSettings) { public List> getSettings() { List> settings = super.getSettings(); settings.add(SourceOnlySnapshotRepository.SOURCE_ONLY); - settings.add(DataTierAllocationDecider.TIER_PREFERENCE_SETTING); + settings.add(DataTier.TIER_PREFERENCE_SETTING); return settings; } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/DataTierMigrationRoutedStep.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/DataTierMigrationRoutedStep.java index b3f8ae321efc9..91f04f114986d 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/DataTierMigrationRoutedStep.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/DataTierMigrationRoutedStep.java @@ -12,7 +12,6 @@ import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.cluster.routing.allocation.decider.AllocationDeciders; -import org.elasticsearch.common.Strings; import org.elasticsearch.index.Index; import org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider; import org.elasticsearch.xpack.core.ilm.step.info.AllocationInfo; @@ -21,7 +20,6 @@ import java.util.Locale; import java.util.Optional; -import static org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider.TIER_PREFERENCE_SETTING; import static org.elasticsearch.xpack.core.ilm.AllocationRoutedStep.getPendingAllocations; import static org.elasticsearch.xpack.core.ilm.step.info.AllocationInfo.waitingForActiveShardsAllocationInfo; @@ -56,28 +54,28 @@ public Result isConditionMet(Index index, ClusterState clusterState) { logger.debug("[{}] lifecycle action for index [{}] executed but index no longer exists", getKey().getAction(), index.getName()); return new Result(false, null); } - String preferredTierConfiguration = TIER_PREFERENCE_SETTING.get(idxMeta.getSettings()); + List preferredTierConfiguration = idxMeta.getTierPreference(); Optional availableDestinationTier = DataTierAllocationDecider.preferredAvailableTier(preferredTierConfiguration, clusterState.getNodes()); if (ActiveShardCount.ALL.enoughShardsActive(clusterState, index.getName()) == false) { - if (Strings.isEmpty(preferredTierConfiguration)) { + if (preferredTierConfiguration.isEmpty()) { logger.debug("[{}] lifecycle action for index [{}] cannot make progress because not all shards are active", getKey().getAction(), index.getName()); } else { if (availableDestinationTier.isPresent()) { - logger.debug("[{}] migration of index [{}] to the [{}] tier preference cannot progress, as not all shards are active", + logger.debug("[{}] migration of index [{}] to the {} tier preference cannot progress, as not all shards are active", getKey().getAction(), index.getName(), preferredTierConfiguration); } else { logger.debug("[{}] migration of index [{}] to the next tier cannot progress as there is no available tier for the " + - "configured preferred tiers [{}] and not all shards are active", getKey().getAction(), index.getName(), + "configured preferred tiers {} and not all shards are active", getKey().getAction(), index.getName(), preferredTierConfiguration); } } return new Result(false, waitingForActiveShardsAllocationInfo(idxMeta.getNumberOfReplicas())); } - if (Strings.isEmpty(preferredTierConfiguration)) { + if (preferredTierConfiguration.isEmpty()) { logger.debug("index [{}] has no data tier routing preference setting configured and all its shards are active. considering " + "the [{}] step condition met and continuing to the next step", index.getName(), getKey().getName()); // the user removed the tier routing setting and all the shards are active so we'll cary on @@ -89,10 +87,10 @@ public Result isConditionMet(Index index, ClusterState clusterState) { if (allocationPendingAllShards > 0) { String statusMessage = availableDestinationTier.map( s -> String.format(Locale.ROOT, "[%s] lifecycle action [%s] waiting for [%s] shards to be moved to the [%s] tier (tier " + - "migration preference configuration is [%s])", index.getName(), getKey().getAction(), allocationPendingAllShards, s, + "migration preference configuration is %s)", index.getName(), getKey().getAction(), allocationPendingAllShards, s, preferredTierConfiguration) ).orElseGet( - () -> String.format(Locale.ROOT, "index [%s] has a preference for tiers [%s], but no nodes for any of those tiers are " + + () -> String.format(Locale.ROOT, "index [%s] has a preference for tiers %s, but no nodes for any of those tiers are " + "available in the cluster", index.getName(), preferredTierConfiguration)); logger.debug(statusMessage); return new Result(false, new AllocationInfo(idxMeta.getNumberOfReplicas(), allocationPendingAllShards, true, statusMessage)); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/MigrateAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/MigrateAction.java index 17a0f9ce720d4..8d629ee08ae90 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/MigrateAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/MigrateAction.java @@ -18,19 +18,18 @@ import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.snapshots.SearchableSnapshotsSettings; -import org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider; -import org.elasticsearch.xpack.core.DataTier; +import org.elasticsearch.cluster.routing.allocation.DataTier; import org.elasticsearch.xpack.core.ilm.Step.StepKey; import java.io.IOException; import java.util.List; import java.util.Objects; -import static org.elasticsearch.xpack.core.DataTier.getPreferredTiersConfiguration; +import static org.elasticsearch.cluster.routing.allocation.DataTier.getPreferredTiersConfiguration; /** * A {@link LifecycleAction} which enables or disables the automatic migration of data between - * {@link org.elasticsearch.xpack.core.DataTier}s. + * {@link DataTier}s. */ public class MigrateAction implements LifecycleAction { public static final String NAME = "migrate"; @@ -117,7 +116,7 @@ public List toSteps(Client client, String phase, StepKey nextStepKey) { }); UpdateSettingsStep updateMigrationSettingStep = new UpdateSettingsStep(migrationKey, migrationRoutedKey, client, Settings.builder() - .put(DataTierAllocationDecider.TIER_PREFERENCE, getPreferredTiersConfiguration(targetTier)) + .put(DataTier.TIER_PREFERENCE, getPreferredTiersConfiguration(targetTier)) .build()); DataTierMigrationRoutedStep migrationRoutedStep = new DataTierMigrationRoutedStep(migrationRoutedKey, nextStepKey); return List.of(conditionalSkipActionStep, updateMigrationSettingStep, migrationRoutedStep); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/MountSnapshotStep.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/MountSnapshotStep.java index 4dac280f856f1..3649798cd3e9d 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/MountSnapshotStep.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/MountSnapshotStep.java @@ -17,8 +17,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; import org.elasticsearch.rest.RestStatus; -import org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider; -import org.elasticsearch.xpack.core.DataTier; +import org.elasticsearch.cluster.routing.allocation.DataTier; import org.elasticsearch.xpack.core.searchablesnapshots.MountSearchableSnapshotAction; import org.elasticsearch.xpack.core.searchablesnapshots.MountSearchableSnapshotRequest; @@ -107,7 +106,7 @@ void performDuringNoSnapshot(IndexMetadata indexMetadata, ClusterState currentCl final Settings.Builder settingsBuilder = Settings.builder(); overrideTierPreference(this.getKey().getPhase()) - .ifPresent(override -> settingsBuilder.put(DataTierAllocationDecider.TIER_PREFERENCE, override)); + .ifPresent(override -> settingsBuilder.put(DataTier.TIER_PREFERENCE, override)); final MountSearchableSnapshotRequest mountSearchableSnapshotRequest = new MountSearchableSnapshotRequest(mountedIndexName, snapshotRepository, snapshotName, indexName, settingsBuilder.build(), diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/WaitForDataTierStep.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/WaitForDataTierStep.java index f84a8f277cfb0..5679b50191b41 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/WaitForDataTierStep.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/WaitForDataTierStep.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.core.ilm; import org.elasticsearch.cluster.ClusterState; +import org.elasticsearch.cluster.routing.allocation.DataTier; import org.elasticsearch.index.Index; import org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider; import org.elasticsearch.xpack.core.ilm.step.info.SingleMessageFieldInfo; @@ -32,7 +33,8 @@ public WaitForDataTierStep(StepKey key, StepKey nextStepKey, String tierPreferen @Override public Result isConditionMet(Index index, ClusterState clusterState) { - boolean present = DataTierAllocationDecider.preferredAvailableTier(tierPreference, clusterState.nodes()).isPresent(); + boolean present = DataTierAllocationDecider.preferredAvailableTier( + DataTier.parseTierList(tierPreference), clusterState.nodes()).isPresent(); SingleMessageFieldInfo info = present ? null : new SingleMessageFieldInfo("no nodes for tiers [" + tierPreference + "] available"); return new Result(present, info); } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/searchablesnapshots/MountSearchableSnapshotRequest.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/searchablesnapshots/MountSearchableSnapshotRequest.java index 9ed50dd2a1d8f..991945e861a63 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/searchablesnapshots/MountSearchableSnapshotRequest.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/searchablesnapshots/MountSearchableSnapshotRequest.java @@ -21,7 +21,7 @@ import org.elasticsearch.common.xcontent.ObjectParser; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.rest.RestRequest; -import org.elasticsearch.xpack.core.DataTier; +import org.elasticsearch.cluster.routing.allocation.DataTier; import java.io.IOException; import java.util.Arrays; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/searchablesnapshots/SearchableSnapshotsConstants.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/searchablesnapshots/SearchableSnapshotsConstants.java index 4b166216060da..8951060576a67 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/searchablesnapshots/SearchableSnapshotsConstants.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/searchablesnapshots/SearchableSnapshotsConstants.java @@ -6,15 +6,8 @@ */ package org.elasticsearch.xpack.core.searchablesnapshots; -import org.elasticsearch.common.settings.Setting; import org.elasticsearch.license.License; import org.elasticsearch.license.LicensedFeature; -import org.elasticsearch.snapshots.SearchableSnapshotsSettings; - -import java.util.Map; - -import static org.elasticsearch.index.IndexModule.INDEX_STORE_TYPE_SETTING; -import static org.elasticsearch.snapshots.SearchableSnapshotsSettings.SEARCHABLE_SNAPSHOT_PARTIAL_SETTING_KEY; public class SearchableSnapshotsConstants { @@ -24,23 +17,4 @@ public class SearchableSnapshotsConstants { public static final LicensedFeature.Momentary SEARCHABLE_SNAPSHOT_FEATURE = LicensedFeature.momentary(null, "searchable-snapshots", License.OperationMode.ENTERPRISE); - public static final Setting SNAPSHOT_PARTIAL_SETTING = Setting.boolSetting( - SEARCHABLE_SNAPSHOT_PARTIAL_SETTING_KEY, - false, - Setting.Property.IndexScope, - Setting.Property.PrivateIndex, - Setting.Property.NotCopyableOnResize - ); - - /** - * Based on a map from setting to value, do the settings represent a partial searchable snapshot index? - * - * Both index.store.type and index.store.snapshot.partial must be supplied. - */ - public static boolean isPartialSearchableSnapshotIndex(Map, Object> indexSettings) { - assert indexSettings.containsKey(INDEX_STORE_TYPE_SETTING) : "must include store type in map"; - assert indexSettings.get(SNAPSHOT_PARTIAL_SETTING) != null : "partial setting must be non-null in map (has default value)"; - return SearchableSnapshotsSettings.SEARCHABLE_SNAPSHOT_STORE_TYPE.equals(indexSettings.get(INDEX_STORE_TYPE_SETTING)) - && (boolean) indexSettings.get(SNAPSHOT_PARTIAL_SETTING); - } } diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/cluster/metadata/IndexMetadataConversionTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/cluster/metadata/IndexMetadataConversionTests.java index 9c71356a05e44..fa320d59c5910 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/cluster/metadata/IndexMetadataConversionTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/cluster/metadata/IndexMetadataConversionTests.java @@ -13,8 +13,8 @@ import org.elasticsearch.index.IndexModule; import org.elasticsearch.index.mapper.MapperRegistry; import org.elasticsearch.plugins.MapperPlugin; +import org.elasticsearch.snapshots.SearchableSnapshotsSettings; import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.xpack.core.searchablesnapshots.SearchableSnapshotsConstants; import java.util.Collections; @@ -33,7 +33,7 @@ public void testConvertSearchableSnapshotSettings() { // A full_copy searchable snapshot (settings should be untouched) src = newIndexMeta("foo", Settings.builder() .put(IndexModule.INDEX_STORE_TYPE_SETTING.getKey(), SEARCHABLE_SNAPSHOT_STORE_TYPE) - .put(SearchableSnapshotsConstants.SNAPSHOT_PARTIAL_SETTING.getKey(), false) + .put(SearchableSnapshotsSettings.SNAPSHOT_PARTIAL_SETTING.getKey(), false) .put("index.routing.allocation.include._tier", "data_hot") .put("index.routing.allocation.exclude._tier", "data_warm") .put("index.routing.allocation.require._tier", "data_hot") @@ -45,7 +45,7 @@ public void testConvertSearchableSnapshotSettings() { // A shared_cache searchable snapshot with valid settings (metadata should be untouched) src = newIndexMeta("foo", Settings.builder() .put(IndexModule.INDEX_STORE_TYPE_SETTING.getKey(), SEARCHABLE_SNAPSHOT_STORE_TYPE) - .put(SearchableSnapshotsConstants.SNAPSHOT_PARTIAL_SETTING.getKey(), false) + .put(SearchableSnapshotsSettings.SNAPSHOT_PARTIAL_SETTING.getKey(), false) .put("index.routing.allocation.include._tier_preference", "data_frozen") .build()); indexMetadata = service.convertSharedCacheTierPreference(src); @@ -54,7 +54,7 @@ public void testConvertSearchableSnapshotSettings() { // A shared_cache searchable snapshot (should have its settings converted) src = newIndexMeta("foo", Settings.builder() .put(IndexModule.INDEX_STORE_TYPE_SETTING.getKey(), SEARCHABLE_SNAPSHOT_STORE_TYPE) - .put(SearchableSnapshotsConstants.SNAPSHOT_PARTIAL_SETTING.getKey(), true) + .put(SearchableSnapshotsSettings.SNAPSHOT_PARTIAL_SETTING.getKey(), true) .put("index.routing.allocation.include._tier", "data_hot") .put("index.routing.allocation.exclude._tier", "data_warm") .put("index.routing.allocation.require._tier", "data_hot") diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/cluster/routing/allocation/DataTierAllocationDeciderTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/cluster/routing/allocation/DataTierAllocationDeciderTests.java index a5800a2dbb5af..3f1c12c55a39f 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/cluster/routing/allocation/DataTierAllocationDeciderTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/cluster/routing/allocation/DataTierAllocationDeciderTests.java @@ -38,8 +38,7 @@ import org.elasticsearch.snapshots.EmptySnapshotsInfoService; import org.elasticsearch.snapshots.SearchableSnapshotsSettings; import org.elasticsearch.test.gateway.TestGatewayAllocator; -import org.elasticsearch.xpack.core.DataTier; -import org.elasticsearch.xpack.core.searchablesnapshots.SearchableSnapshotsConstants; +import org.elasticsearch.cluster.routing.allocation.DataTier; import java.util.ArrayList; import java.util.Arrays; @@ -47,8 +46,8 @@ import java.util.List; import java.util.Optional; -import static org.elasticsearch.xpack.core.DataTier.DATA_COLD; -import static org.elasticsearch.xpack.core.DataTier.DATA_FROZEN; +import static org.elasticsearch.cluster.routing.allocation.DataTier.DATA_COLD; +import static org.elasticsearch.cluster.routing.allocation.DataTier.DATA_FROZEN; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; @@ -86,7 +85,7 @@ public void testIndexPrefer() { .put(IndexMetadata.SETTING_INDEX_UUID, "myindex") .put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1) .put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0) - .put(DataTierAllocationDecider.TIER_PREFERENCE, "data_warm,data_cold") + .put(DataTier.TIER_PREFERENCE, "data_warm,data_cold") .build())) .build()) .build(); @@ -121,7 +120,7 @@ public void testIndexPrefer() { .put(IndexMetadata.SETTING_INDEX_UUID, "myindex") .put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1) .put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0) - .put(DataTierAllocationDecider.TIER_PREFERENCE, "data_warm,data_cold") + .put(DataTier.TIER_PREFERENCE, "data_warm,data_cold") .build())) .build()) .build(); @@ -189,24 +188,32 @@ public void testTierNodesPresent() { public void testPreferredTierAvailable() { DiscoveryNodes nodes = DiscoveryNodes.builder().build(); - assertThat(DataTierAllocationDecider.preferredAvailableTier("data", nodes), equalTo(Optional.empty())); - assertThat(DataTierAllocationDecider.preferredAvailableTier("data_hot,data_warm", nodes), equalTo(Optional.empty())); - assertThat(DataTierAllocationDecider.preferredAvailableTier("data_warm,data_content", nodes), equalTo(Optional.empty())); - assertThat(DataTierAllocationDecider.preferredAvailableTier("data_cold", nodes), equalTo(Optional.empty())); + assertThat(DataTierAllocationDecider.preferredAvailableTier( + DataTier.parseTierList("data"), nodes), equalTo(Optional.empty())); + assertThat(DataTierAllocationDecider.preferredAvailableTier( + DataTier.parseTierList("data_hot,data_warm"), nodes), equalTo(Optional.empty())); + assertThat(DataTierAllocationDecider.preferredAvailableTier( + DataTier.parseTierList("data_warm,data_content"), nodes), equalTo(Optional.empty())); + assertThat(DataTierAllocationDecider.preferredAvailableTier( + DataTier.parseTierList("data_cold"), nodes), equalTo(Optional.empty())); nodes = DiscoveryNodes.builder() .add(WARM_NODE) .add(CONTENT_NODE) .build(); - assertThat(DataTierAllocationDecider.preferredAvailableTier("data", nodes), equalTo(Optional.empty())); - assertThat(DataTierAllocationDecider.preferredAvailableTier("data_hot,data_warm", nodes), equalTo(Optional.of("data_warm"))); - assertThat(DataTierAllocationDecider.preferredAvailableTier("data_warm,data_content", nodes), equalTo(Optional.of("data_warm"))); - assertThat(DataTierAllocationDecider.preferredAvailableTier("data_content,data_warm", nodes), equalTo(Optional.of("data_content"))); - assertThat(DataTierAllocationDecider.preferredAvailableTier("data_hot,data_content,data_warm", nodes), - equalTo(Optional.of("data_content"))); - assertThat(DataTierAllocationDecider.preferredAvailableTier("data_hot,data_cold,data_warm", nodes), - equalTo(Optional.of("data_warm"))); + assertThat(DataTierAllocationDecider.preferredAvailableTier( + DataTier.parseTierList("data"), nodes), equalTo(Optional.empty())); + assertThat(DataTierAllocationDecider.preferredAvailableTier( + DataTier.parseTierList("data_hot,data_warm"), nodes), equalTo(Optional.of("data_warm"))); + assertThat(DataTierAllocationDecider.preferredAvailableTier( + DataTier.parseTierList("data_warm,data_content"), nodes), equalTo(Optional.of("data_warm"))); + assertThat(DataTierAllocationDecider.preferredAvailableTier( + DataTier.parseTierList("data_content,data_warm"), nodes), equalTo(Optional.of("data_content"))); + assertThat(DataTierAllocationDecider.preferredAvailableTier( + DataTier.parseTierList("data_hot,data_content,data_warm"), nodes), equalTo(Optional.of("data_content"))); + assertThat(DataTierAllocationDecider.preferredAvailableTier( + DataTier.parseTierList("data_hot,data_cold,data_warm"), nodes), equalTo(Optional.of("data_warm"))); } public void testFrozenIllegalForRegularIndices() { @@ -217,7 +224,7 @@ public void testFrozenIllegalForRegularIndices() { Randomness.shuffle(tierList); String value = Strings.join(tierList, ","); - Setting setting = DataTierAllocationDecider.TIER_PREFERENCE_SETTING; + Setting setting = DataTier.TIER_PREFERENCE_SETTING; Settings.Builder builder = Settings.builder().put(setting.getKey(), value); if (randomBoolean()) { builder.put(IndexModule.INDEX_STORE_TYPE_SETTING.getKey(), SearchableSnapshotsSettings.SEARCHABLE_SNAPSHOT_STORE_TYPE); @@ -229,10 +236,10 @@ public void testFrozenIllegalForRegularIndices() { } public void testFrozenLegalForPartialSnapshot() { - Setting setting = DataTierAllocationDecider.TIER_PREFERENCE_SETTING; + Setting setting = DataTier.TIER_PREFERENCE_SETTING; Settings.Builder builder = Settings.builder().put(setting.getKey(), DATA_FROZEN); builder.put(IndexModule.INDEX_STORE_TYPE_SETTING.getKey(), SearchableSnapshotsSettings.SEARCHABLE_SNAPSHOT_STORE_TYPE); - builder.put(SearchableSnapshotsConstants.SNAPSHOT_PARTIAL_SETTING.getKey(), true); + builder.put(SearchableSnapshotsSettings.SNAPSHOT_PARTIAL_SETTING.getKey(), true); Settings settings = builder.build(); @@ -250,53 +257,53 @@ public void testNonFrozenIllegalForPartialSnapshot() { { String value = Strings.join(tierList, ","); - Settings.Builder builder = Settings.builder().put(DataTierAllocationDecider.TIER_PREFERENCE, value); + Settings.Builder builder = Settings.builder().put(DataTier.TIER_PREFERENCE, value); builder.put(IndexModule.INDEX_STORE_TYPE_SETTING.getKey(), SearchableSnapshotsSettings.SEARCHABLE_SNAPSHOT_STORE_TYPE); - builder.put(SearchableSnapshotsConstants.SNAPSHOT_PARTIAL_SETTING.getKey(), true); + builder.put(SearchableSnapshotsSettings.SNAPSHOT_PARTIAL_SETTING.getKey(), true); Settings settings = builder.build(); IllegalArgumentException e = expectThrows(IllegalArgumentException.class, - () -> DataTierAllocationDecider.TIER_PREFERENCE_SETTING.get(settings)); + () -> DataTier.TIER_PREFERENCE_SETTING.get(settings)); assertThat(e.getMessage(), containsString("only the [data_frozen] tier preference may be used for partial searchable snapshots")); } { - Settings.Builder builder = Settings.builder().put(DataTierAllocationDecider.TIER_PREFERENCE, ""); + Settings.Builder builder = Settings.builder().put(DataTier.TIER_PREFERENCE, ""); builder.put(IndexModule.INDEX_STORE_TYPE_SETTING.getKey(), SearchableSnapshotsSettings.SEARCHABLE_SNAPSHOT_STORE_TYPE); - builder.put(SearchableSnapshotsConstants.SNAPSHOT_PARTIAL_SETTING.getKey(), true); + builder.put(SearchableSnapshotsSettings.SNAPSHOT_PARTIAL_SETTING.getKey(), true); Settings settings = builder.build(); IllegalArgumentException e = expectThrows(IllegalArgumentException.class, - () -> DataTierAllocationDecider.TIER_PREFERENCE_SETTING.get(settings)); + () -> DataTier.TIER_PREFERENCE_SETTING.get(settings)); assertThat(e.getMessage(), containsString("only the [data_frozen] tier preference may be used for partial searchable snapshots")); } { - Settings.Builder builder = Settings.builder().put(DataTierAllocationDecider.TIER_PREFERENCE, " "); + Settings.Builder builder = Settings.builder().put(DataTier.TIER_PREFERENCE, " "); builder.put(IndexModule.INDEX_STORE_TYPE_SETTING.getKey(), SearchableSnapshotsSettings.SEARCHABLE_SNAPSHOT_STORE_TYPE); - builder.put(SearchableSnapshotsConstants.SNAPSHOT_PARTIAL_SETTING.getKey(), true); + builder.put(SearchableSnapshotsSettings.SNAPSHOT_PARTIAL_SETTING.getKey(), true); Settings settings = builder.build(); IllegalArgumentException e = expectThrows(IllegalArgumentException.class, - () -> DataTierAllocationDecider.TIER_PREFERENCE_SETTING.get(settings)); + () -> DataTier.TIER_PREFERENCE_SETTING.get(settings)); assertThat(e.getMessage(), containsString("only the [data_frozen] tier preference may be used for partial searchable snapshots")); } } public void testDefaultValueForPreference() { - assertThat(DataTierAllocationDecider.TIER_PREFERENCE_SETTING.get(Settings.EMPTY), equalTo("")); + assertThat(DataTier.TIER_PREFERENCE_SETTING.get(Settings.EMPTY), equalTo("")); Settings.Builder builder = Settings.builder(); builder.put(IndexModule.INDEX_STORE_TYPE_SETTING.getKey(), SearchableSnapshotsSettings.SEARCHABLE_SNAPSHOT_STORE_TYPE); - builder.put(SearchableSnapshotsConstants.SNAPSHOT_PARTIAL_SETTING.getKey(), true); + builder.put(SearchableSnapshotsSettings.SNAPSHOT_PARTIAL_SETTING.getKey(), true); Settings settings = builder.build(); - assertThat(DataTierAllocationDecider.TIER_PREFERENCE_SETTING.get(settings), equalTo(DATA_FROZEN)); + assertThat(DataTier.TIER_PREFERENCE_SETTING.get(settings), equalTo(DATA_FROZEN)); } } diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/cluster/routing/allocation/mapper/DataTierFieldTypeTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/cluster/routing/allocation/mapper/DataTierFieldTypeTests.java index 1150c9e30e5bb..e336d3b3e36ed 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/cluster/routing/allocation/mapper/DataTierFieldTypeTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/cluster/routing/allocation/mapper/DataTierFieldTypeTests.java @@ -11,6 +11,7 @@ import org.apache.lucene.search.MatchNoDocsQuery; import org.elasticsearch.Version; import org.elasticsearch.cluster.metadata.IndexMetadata; +import org.elasticsearch.cluster.routing.allocation.DataTier; import org.elasticsearch.common.regex.Regex; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.index.IndexSettings; @@ -20,7 +21,6 @@ import org.elasticsearch.index.query.QueryShardException; import org.elasticsearch.index.query.SearchExecutionContext; import org.elasticsearch.search.lookup.SourceLookup; -import org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider; import java.io.IOException; import java.util.Arrays; @@ -101,7 +101,7 @@ private SearchExecutionContext createContext() { Settings.builder() .put(IndexMetadata.SETTING_VERSION_CREATED, Version.CURRENT) // Tier can be an ordered list of preferences - starting with primary and followed by fallbacks. - .put(DataTierAllocationDecider.TIER_PREFERENCE, "data_warm,data_hot") + .put(DataTier.TIER_PREFERENCE, "data_warm,data_hot") ) .numberOfShards(1) .numberOfReplicas(0) diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/DataTierTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/DataTierTests.java index bfe7dda5175c1..976fc11829783 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/DataTierTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/DataTierTests.java @@ -11,6 +11,7 @@ import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.node.DiscoveryNodeRole; import org.elasticsearch.cluster.node.DiscoveryNodes; +import org.elasticsearch.cluster.routing.allocation.DataTier; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.node.NodeRoleSettings; @@ -25,10 +26,10 @@ import java.util.Set; import java.util.concurrent.atomic.AtomicInteger; -import static org.elasticsearch.xpack.core.DataTier.DATA_COLD; -import static org.elasticsearch.xpack.core.DataTier.DATA_HOT; -import static org.elasticsearch.xpack.core.DataTier.DATA_WARM; -import static org.elasticsearch.xpack.core.DataTier.getPreferredTiersConfiguration; +import static org.elasticsearch.cluster.routing.allocation.DataTier.DATA_COLD; +import static org.elasticsearch.cluster.routing.allocation.DataTier.DATA_HOT; +import static org.elasticsearch.cluster.routing.allocation.DataTier.DATA_WARM; +import static org.elasticsearch.cluster.routing.allocation.DataTier.getPreferredTiersConfiguration; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.Matchers.arrayContainingInAnyOrder; import static org.hamcrest.Matchers.hasItem; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/DataTiersFeatureSetUsageTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/DataTiersFeatureSetUsageTests.java index fee3e097f6a5e..1a2cc7c3f4980 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/DataTiersFeatureSetUsageTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/DataTiersFeatureSetUsageTests.java @@ -7,6 +7,7 @@ package org.elasticsearch.xpack.core; +import org.elasticsearch.cluster.routing.allocation.DataTier; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.test.AbstractWireSerializingTestCase; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/DataTiersUsageTransportActionTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/DataTiersUsageTransportActionTests.java index 6e47c0a77d4e1..a40bbb2d9ca0f 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/DataTiersUsageTransportActionTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/DataTiersUsageTransportActionTests.java @@ -28,6 +28,7 @@ import org.elasticsearch.cluster.routing.ShardRouting; import org.elasticsearch.cluster.routing.ShardRoutingState; import org.elasticsearch.cluster.routing.TestShardRouting; +import org.elasticsearch.cluster.routing.allocation.DataTier; import org.elasticsearch.common.collect.ImmutableOpenMap; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.PathUtils; @@ -40,7 +41,6 @@ import org.elasticsearch.indices.NodeIndicesStats; import org.elasticsearch.search.aggregations.metrics.TDigestState; import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider; import java.nio.file.Path; import java.util.ArrayList; @@ -697,9 +697,9 @@ private static IndexMetadata indexMetadata(String indexName, int numberOfShards, for (int idx = 1; idx < dataTierPrefs.length; idx++) { tierBuilder.append(',').append(dataTierPrefs[idx]); } - settingsBuilder.put(DataTierAllocationDecider.TIER_PREFERENCE, tierBuilder.toString()); + settingsBuilder.put(DataTier.TIER_PREFERENCE, tierBuilder.toString()); } else if (dataTierPrefs.length == 1) { - settingsBuilder.put(DataTierAllocationDecider.TIER_PREFERENCE, dataTierPrefs[0]); + settingsBuilder.put(DataTier.TIER_PREFERENCE, dataTierPrefs[0]); } return IndexMetadata.builder(indexName) diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/DataTierMigrationRoutedStepTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/DataTierMigrationRoutedStepTests.java index 3e8acf8ad14c6..6add879cba1b0 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/DataTierMigrationRoutedStepTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/DataTierMigrationRoutedStepTests.java @@ -19,7 +19,7 @@ import org.elasticsearch.cluster.routing.TestShardRouting; import org.elasticsearch.index.Index; import org.elasticsearch.index.shard.ShardId; -import org.elasticsearch.xpack.core.DataTier; +import org.elasticsearch.cluster.routing.allocation.DataTier; import org.elasticsearch.xpack.core.ilm.ClusterStateWaitStep.Result; import org.elasticsearch.xpack.core.ilm.Step.StepKey; import org.elasticsearch.xpack.core.ilm.step.info.AllocationInfo; @@ -28,7 +28,7 @@ import java.util.Set; import static java.util.Collections.emptyMap; -import static org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider.TIER_PREFERENCE; +import static org.elasticsearch.cluster.routing.allocation.DataTier.TIER_PREFERENCE; import static org.elasticsearch.xpack.core.ilm.CheckShrinkReadyStepTests.randomUnassignedInfo; import static org.elasticsearch.xpack.core.ilm.step.info.AllocationInfo.waitingForActiveShardsAllocationInfo; import static org.hamcrest.Matchers.is; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/MigrateActionTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/MigrateActionTests.java index 839689c879cf4..eb0aa03c13420 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/MigrateActionTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/MigrateActionTests.java @@ -11,9 +11,9 @@ import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.cluster.metadata.Metadata; +import org.elasticsearch.cluster.routing.allocation.DataTier; import org.elasticsearch.common.io.stream.Writeable.Reader; import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider; import org.elasticsearch.xpack.core.ilm.Step.StepKey; import java.io.IOException; @@ -21,14 +21,14 @@ import static org.elasticsearch.index.IndexModule.INDEX_STORE_TYPE_SETTING; import static org.elasticsearch.snapshots.SearchableSnapshotsSettings.SEARCHABLE_SNAPSHOT_STORE_TYPE; -import static org.elasticsearch.xpack.core.DataTier.DATA_COLD; -import static org.elasticsearch.xpack.core.DataTier.DATA_HOT; -import static org.elasticsearch.xpack.core.DataTier.DATA_WARM; +import static org.elasticsearch.cluster.routing.allocation.DataTier.DATA_COLD; +import static org.elasticsearch.cluster.routing.allocation.DataTier.DATA_HOT; +import static org.elasticsearch.cluster.routing.allocation.DataTier.DATA_WARM; import static org.elasticsearch.xpack.core.ilm.TimeseriesLifecycleType.COLD_PHASE; import static org.elasticsearch.xpack.core.ilm.TimeseriesLifecycleType.DELETE_PHASE; import static org.elasticsearch.xpack.core.ilm.TimeseriesLifecycleType.HOT_PHASE; import static org.elasticsearch.xpack.core.ilm.TimeseriesLifecycleType.WARM_PHASE; -import static org.elasticsearch.xpack.core.searchablesnapshots.SearchableSnapshotsConstants.SNAPSHOT_PARTIAL_SETTING; +import static org.elasticsearch.snapshots.SearchableSnapshotsSettings.SNAPSHOT_PARTIAL_SETTING; import static org.hamcrest.CoreMatchers.is; public class MigrateActionTests extends AbstractActionTestCase { @@ -89,19 +89,19 @@ public void testMigrateActionsConfiguresTierPreference() { { List steps = action.toSteps(null, HOT_PHASE, nextStepKey); UpdateSettingsStep firstStep = (UpdateSettingsStep) steps.get(1); - assertThat(DataTierAllocationDecider.TIER_PREFERENCE_SETTING.get(firstStep.getSettings()), + assertThat(DataTier.TIER_PREFERENCE_SETTING.get(firstStep.getSettings()), is(DATA_HOT)); } { List steps = action.toSteps(null, WARM_PHASE, nextStepKey); UpdateSettingsStep firstStep = (UpdateSettingsStep) steps.get(1); - assertThat(DataTierAllocationDecider.TIER_PREFERENCE_SETTING.get(firstStep.getSettings()), + assertThat(DataTier.TIER_PREFERENCE_SETTING.get(firstStep.getSettings()), is(DATA_WARM + "," + DATA_HOT)); } { List steps = action.toSteps(null, COLD_PHASE, nextStepKey); UpdateSettingsStep firstStep = (UpdateSettingsStep) steps.get(1); - assertThat(DataTierAllocationDecider.TIER_PREFERENCE_SETTING.get(firstStep.getSettings()), + assertThat(DataTier.TIER_PREFERENCE_SETTING.get(firstStep.getSettings()), is(DATA_COLD + "," + DATA_WARM + "," + DATA_HOT)); } } diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/SearchableSnapshotActionTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/SearchableSnapshotActionTests.java index 763073b7f3be6..c63254d3e0838 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/SearchableSnapshotActionTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/SearchableSnapshotActionTests.java @@ -8,7 +8,7 @@ import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.xpack.core.DataTier; +import org.elasticsearch.cluster.routing.allocation.DataTier; import org.elasticsearch.xpack.core.ilm.Step.StepKey; import org.elasticsearch.xpack.core.searchablesnapshots.MountSearchableSnapshotRequest; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/WaitForDataTierStepTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/WaitForDataTierStepTests.java index 20f1cfbddb625..502c925f2bd77 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/WaitForDataTierStepTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/WaitForDataTierStepTests.java @@ -15,7 +15,7 @@ import org.elasticsearch.cluster.node.DiscoveryNodes; import org.elasticsearch.common.Strings; import org.elasticsearch.common.UUIDs; -import org.elasticsearch.xpack.core.DataTier; +import org.elasticsearch.cluster.routing.allocation.DataTier; import java.util.Collection; import java.util.List; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/searchablesnapshots/SearchableSnapshotsConstantsTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/searchablesnapshots/SearchableSnapshotsConstantsTests.java index a5d6966ca9abb..26e3516d23571 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/searchablesnapshots/SearchableSnapshotsConstantsTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/searchablesnapshots/SearchableSnapshotsConstantsTests.java @@ -18,19 +18,19 @@ public class SearchableSnapshotsConstantsTests extends ESTestCase { public void testIsPartialSearchableSnapshotIndex() { - assertThat(SearchableSnapshotsConstants.isPartialSearchableSnapshotIndex( + assertThat(SearchableSnapshotsSettings.isPartialSearchableSnapshotIndex( Map.of(IndexModule.INDEX_STORE_TYPE_SETTING, SearchableSnapshotsSettings.SEARCHABLE_SNAPSHOT_STORE_TYPE, - SearchableSnapshotsConstants.SNAPSHOT_PARTIAL_SETTING, false)), + SearchableSnapshotsSettings.SNAPSHOT_PARTIAL_SETTING, false)), is(false)); - assertThat(SearchableSnapshotsConstants.isPartialSearchableSnapshotIndex( + assertThat(SearchableSnapshotsSettings.isPartialSearchableSnapshotIndex( Map.of(IndexModule.INDEX_STORE_TYPE_SETTING, "abc", - SearchableSnapshotsConstants.SNAPSHOT_PARTIAL_SETTING, randomBoolean())), + SearchableSnapshotsSettings.SNAPSHOT_PARTIAL_SETTING, randomBoolean())), is(false)); - assertThat(SearchableSnapshotsConstants.isPartialSearchableSnapshotIndex( + assertThat(SearchableSnapshotsSettings.isPartialSearchableSnapshotIndex( Map.of(IndexModule.INDEX_STORE_TYPE_SETTING, SearchableSnapshotsSettings.SEARCHABLE_SNAPSHOT_STORE_TYPE, - SearchableSnapshotsConstants.SNAPSHOT_PARTIAL_SETTING, true)), + SearchableSnapshotsSettings.SNAPSHOT_PARTIAL_SETTING, true)), is(true)); } } diff --git a/x-pack/plugin/data-streams/src/internalClusterTest/java/org/elasticsearch/xpack/datastreams/DataTierDataStreamIT.java b/x-pack/plugin/data-streams/src/internalClusterTest/java/org/elasticsearch/xpack/datastreams/DataTierDataStreamIT.java index ed163fbc6a7d1..619fcf7c3be01 100644 --- a/x-pack/plugin/data-streams/src/internalClusterTest/java/org/elasticsearch/xpack/datastreams/DataTierDataStreamIT.java +++ b/x-pack/plugin/data-streams/src/internalClusterTest/java/org/elasticsearch/xpack/datastreams/DataTierDataStreamIT.java @@ -10,11 +10,10 @@ import org.elasticsearch.action.admin.indices.template.put.PutComposableIndexTemplateAction; import org.elasticsearch.cluster.metadata.ComposableIndexTemplate; import org.elasticsearch.cluster.metadata.DataStream; +import org.elasticsearch.cluster.routing.allocation.DataTier; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.test.ESIntegTestCase; -import org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider; -import org.elasticsearch.xpack.core.DataTier; import org.elasticsearch.xpack.core.LocalStateCompositeXPackPlugin; import org.elasticsearch.xpack.core.action.DeleteDataStreamAction; @@ -60,7 +59,7 @@ public void testDefaultDataStreamAllocateToHot() { .get() .getSettings() .get(DataStream.getDefaultBackingIndexName(index, 1)); - assertThat(DataTierAllocationDecider.TIER_PREFERENCE_SETTING.get(idxSettings), equalTo(DataTier.DATA_HOT)); + assertThat(DataTier.TIER_PREFERENCE_SETTING.get(idxSettings), equalTo(DataTier.DATA_HOT)); logger.info("--> waiting for {} to be yellow", index); ensureYellow(index); @@ -74,7 +73,7 @@ public void testDefaultDataStreamAllocateToHot() { .get() .getSettings() .get(DataStream.getDefaultBackingIndexName(index, 2)); - assertThat(DataTierAllocationDecider.TIER_PREFERENCE_SETTING.get(idxSettings), equalTo(DataTier.DATA_HOT)); + assertThat(DataTier.TIER_PREFERENCE_SETTING.get(idxSettings), equalTo(DataTier.DATA_HOT)); client().execute(DeleteDataStreamAction.INSTANCE, new DeleteDataStreamAction.Request(new String[] { index })); } diff --git a/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/MigrateToDataTiersIT.java b/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/MigrateToDataTiersIT.java index 59ca2a95c7adb..ae3f3cb0d3d62 100644 --- a/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/MigrateToDataTiersIT.java +++ b/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/MigrateToDataTiersIT.java @@ -14,13 +14,13 @@ import org.elasticsearch.client.Response; import org.elasticsearch.client.ResponseException; import org.elasticsearch.cluster.metadata.IndexMetadata; +import org.elasticsearch.cluster.routing.allocation.DataTier; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.rest.action.admin.indices.RestPutIndexTemplateAction; import org.elasticsearch.test.rest.ESRestTestCase; import org.elasticsearch.xpack.cluster.action.MigrateToDataTiersResponse; -import org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider; import org.elasticsearch.xpack.core.ilm.AllocateAction; import org.elasticsearch.xpack.core.ilm.AllocationRoutedStep; import org.elasticsearch.xpack.core.ilm.DeleteAction; @@ -114,7 +114,7 @@ public void testMigrateToDataTiersAction() throws Exception { .put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1) .put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0) .put(LifecycleSettings.LIFECYCLE_NAME, policy) - .putNull(DataTierAllocationDecider.TIER_PREFERENCE) + .putNull(DataTier.TIER_PREFERENCE) .put(RolloverAction.LIFECYCLE_ROLLOVER_ALIAS, alias) ); @@ -136,7 +136,7 @@ public void testMigrateToDataTiersAction() throws Exception { createIndexWithSettings(client(), rolloverIndexPrefix + "-00000" + i, alias + i, Settings.builder() .put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1) .put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0) - .putNull(DataTierAllocationDecider.TIER_PREFERENCE) + .putNull(DataTier.TIER_PREFERENCE) .put(RolloverAction.LIFECYCLE_ROLLOVER_ALIAS, alias + i) ); } @@ -177,7 +177,7 @@ public void testMigrateToDataTiersAction() throws Exception { // let's assert the require.data:warm configuration the "indexWithDataWarmRouting" had was migrated to // _tier_preference:data_warm,data_hot Map indexSettings = getOnlyIndexSettings(client(), indexWithDataWarmRouting); - assertThat(indexSettings.get(DataTierAllocationDecider.TIER_PREFERENCE), is("data_warm,data_hot")); + assertThat(indexSettings.get(DataTier.TIER_PREFERENCE), is("data_warm,data_hot")); // let's retrieve the migrated policy and check it was migrated correctly - namely the warm phase should not contain any allocate // action anymore and the cold phase should contain an allocate action that only configures the number of replicas @@ -235,7 +235,7 @@ public void testMigrationDryRun() throws Exception { .put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1) .put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0) .put(LifecycleSettings.LIFECYCLE_NAME, policy) - .putNull(DataTierAllocationDecider.TIER_PREFERENCE) + .putNull(DataTier.TIER_PREFERENCE) .put(RolloverAction.LIFECYCLE_ROLLOVER_ALIAS, alias) ); @@ -284,7 +284,7 @@ public void testMigrationDryRun() throws Exception { // the index settings should not contain the _tier_preference Map indexSettings = getOnlyIndexSettings(client(), indexWithDataWarmRouting); - assertThat(indexSettings.get(DataTierAllocationDecider.TIER_PREFERENCE), nullValue()); + assertThat(indexSettings.get(DataTier.TIER_PREFERENCE), nullValue()); // let's check the ILM policy was not migrated - ie. the warm phase still contains the allocate action Request getPolicy = new Request("GET", "/_ilm/policy/" + policy); diff --git a/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ilm/actions/SearchableSnapshotActionIT.java b/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ilm/actions/SearchableSnapshotActionIT.java index e8897fcd03738..e95633d046821 100644 --- a/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ilm/actions/SearchableSnapshotActionIT.java +++ b/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ilm/actions/SearchableSnapshotActionIT.java @@ -15,6 +15,7 @@ import org.elasticsearch.cluster.metadata.DataStream; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.cluster.metadata.Template; +import org.elasticsearch.cluster.routing.allocation.DataTier; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; @@ -22,7 +23,6 @@ import org.elasticsearch.common.xcontent.XContentHelper; import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.test.rest.ESRestTestCase; -import org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider; import org.elasticsearch.xpack.core.ilm.DeleteAction; import org.elasticsearch.xpack.core.ilm.ForceMergeAction; import org.elasticsearch.xpack.core.ilm.FreezeAction; @@ -497,7 +497,7 @@ snapshotRepo, randomBoolean())) indexDocument(client(), dataStream, true); String firstGenIndex = DataStream.getDefaultBackingIndexName(dataStream, 1L); Map indexSettings = getIndexSettingsAsMap(firstGenIndex); - assertThat(indexSettings.get(DataTierAllocationDecider.TIER_PREFERENCE), is("data_hot")); + assertThat(indexSettings.get(DataTier.TIER_PREFERENCE), is("data_hot")); // rollover the data stream so searchable_snapshot can complete rolloverMaxOneDocCondition(client(), dataStream); @@ -512,7 +512,7 @@ snapshotRepo, randomBoolean())) Map hotIndexSettings = getIndexSettingsAsMap(restoredIndex); // searchable snapshots mounted in the hot phase should be pinned to hot nodes - assertThat(hotIndexSettings.get(DataTierAllocationDecider.TIER_PREFERENCE), + assertThat(hotIndexSettings.get(DataTier.TIER_PREFERENCE), is("data_hot")); } } diff --git a/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ilm/actions/ShrinkActionIT.java b/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ilm/actions/ShrinkActionIT.java index a187a74af0a84..22933a3b8c7ce 100644 --- a/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ilm/actions/ShrinkActionIT.java +++ b/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ilm/actions/ShrinkActionIT.java @@ -12,6 +12,7 @@ import org.elasticsearch.client.Request; import org.elasticsearch.client.ResponseException; import org.elasticsearch.cluster.metadata.IndexMetadata; +import org.elasticsearch.cluster.routing.allocation.DataTier; import org.elasticsearch.cluster.routing.allocation.decider.ShardsLimitAllocationDecider; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; @@ -20,7 +21,6 @@ import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.rest.action.admin.indices.RestPutIndexTemplateAction; import org.elasticsearch.test.rest.ESRestTestCase; -import org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider; import org.elasticsearch.xpack.core.ilm.CheckTargetShardsCountStep; import org.elasticsearch.xpack.core.ilm.LifecycleAction; import org.elasticsearch.xpack.core.ilm.LifecyclePolicy; @@ -208,7 +208,7 @@ public void testSetSingleNodeAllocationRetriesUntilItSucceeds() throws Exception createIndexWithSettings(client(), index, alias, Settings.builder() .put(SETTING_NUMBER_OF_SHARDS, numShards) .put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0) - .putNull(DataTierAllocationDecider.TIER_PREFERENCE)); + .putNull(DataTier.TIER_PREFERENCE)); ensureGreen(index); diff --git a/x-pack/plugin/ilm/src/internalClusterTest/java/org/elasticsearch/xpack/ilm/DataTiersMigrationsTests.java b/x-pack/plugin/ilm/src/internalClusterTest/java/org/elasticsearch/xpack/ilm/DataTiersMigrationsTests.java index aae84b3a625db..6b39068111972 100644 --- a/x-pack/plugin/ilm/src/internalClusterTest/java/org/elasticsearch/xpack/ilm/DataTiersMigrationsTests.java +++ b/x-pack/plugin/ilm/src/internalClusterTest/java/org/elasticsearch/xpack/ilm/DataTiersMigrationsTests.java @@ -13,11 +13,11 @@ import org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsRequest; import org.elasticsearch.cluster.node.DiscoveryNodeRole; import org.elasticsearch.cluster.routing.ShardRoutingState; +import org.elasticsearch.cluster.routing.allocation.DataTier; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.test.ESIntegTestCase; -import org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider; import org.elasticsearch.xpack.core.LocalStateCompositeXPackPlugin; import org.elasticsearch.xpack.core.XPackSettings; import org.elasticsearch.xpack.core.ilm.DataTierMigrationRoutedStep; @@ -190,7 +190,7 @@ public void testUserOptsOutOfTierMigration() throws Exception { assertReplicaIsUnassigned(); }, 30, TimeUnit.SECONDS); - Settings removeTierRoutingSetting = Settings.builder().putNull(DataTierAllocationDecider.TIER_PREFERENCE).build(); + Settings removeTierRoutingSetting = Settings.builder().putNull(DataTier.TIER_PREFERENCE).build(); UpdateSettingsRequest updateSettingsRequest = new UpdateSettingsRequest(managedIndex).settings(removeTierRoutingSetting); assertAcked(client().admin().indices().updateSettings(updateSettingsRequest).actionGet()); diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/cluster/metadata/MetadataMigrateToDataTiersRoutingService.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/cluster/metadata/MetadataMigrateToDataTiersRoutingService.java index 8989598e36fec..67d1ed5a4f1f7 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/cluster/metadata/MetadataMigrateToDataTiersRoutingService.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/cluster/metadata/MetadataMigrateToDataTiersRoutingService.java @@ -21,7 +21,7 @@ import org.elasticsearch.core.Nullable; import org.elasticsearch.core.Tuple; import org.elasticsearch.license.XPackLicenseState; -import org.elasticsearch.xpack.core.DataTier; +import org.elasticsearch.cluster.routing.allocation.DataTier; import org.elasticsearch.xpack.core.ilm.AllocateAction; import org.elasticsearch.xpack.core.ilm.IndexLifecycleMetadata; import org.elasticsearch.xpack.core.ilm.LifecycleAction; @@ -48,7 +48,7 @@ import static org.elasticsearch.cluster.metadata.IndexMetadata.INDEX_ROUTING_EXCLUDE_GROUP_SETTING; import static org.elasticsearch.cluster.metadata.IndexMetadata.INDEX_ROUTING_INCLUDE_GROUP_SETTING; import static org.elasticsearch.cluster.metadata.IndexMetadata.INDEX_ROUTING_REQUIRE_GROUP_SETTING; -import static org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider.TIER_PREFERENCE; +import static org.elasticsearch.cluster.routing.allocation.DataTier.TIER_PREFERENCE; import static org.elasticsearch.xpack.core.ilm.LifecycleExecutionState.ILM_CUSTOM_METADATA_KEY; import static org.elasticsearch.xpack.core.ilm.OperationMode.STOPPED; import static org.elasticsearch.xpack.core.ilm.PhaseCacheManagement.updateIndicesForPolicy; diff --git a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/cluster/metadata/MetadataMigrateToDataTiersRoutingServiceTests.java b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/cluster/metadata/MetadataMigrateToDataTiersRoutingServiceTests.java index dc52f3280fc50..b5ffe6af619cc 100644 --- a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/cluster/metadata/MetadataMigrateToDataTiersRoutingServiceTests.java +++ b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/cluster/metadata/MetadataMigrateToDataTiersRoutingServiceTests.java @@ -48,12 +48,12 @@ import static org.elasticsearch.cluster.metadata.IndexMetadata.INDEX_ROUTING_EXCLUDE_GROUP_SETTING; import static org.elasticsearch.cluster.metadata.IndexMetadata.INDEX_ROUTING_INCLUDE_GROUP_SETTING; import static org.elasticsearch.cluster.metadata.IndexMetadata.INDEX_ROUTING_REQUIRE_GROUP_SETTING; +import static org.elasticsearch.cluster.routing.allocation.DataTier.TIER_PREFERENCE; import static org.elasticsearch.xpack.cluster.metadata.MetadataMigrateToDataTiersRoutingService.allocateActionDefinesRoutingRules; import static org.elasticsearch.xpack.cluster.metadata.MetadataMigrateToDataTiersRoutingService.convertAttributeValueToTierPreference; import static org.elasticsearch.xpack.cluster.metadata.MetadataMigrateToDataTiersRoutingService.migrateIlmPolicies; import static org.elasticsearch.xpack.cluster.metadata.MetadataMigrateToDataTiersRoutingService.migrateIndices; import static org.elasticsearch.xpack.cluster.metadata.MetadataMigrateToDataTiersRoutingService.migrateToDataTiersRouting; -import static org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider.TIER_PREFERENCE; import static org.elasticsearch.xpack.core.ilm.LifecycleExecutionState.ILM_CUSTOM_METADATA_KEY; import static org.hamcrest.Matchers.empty; import static org.hamcrest.Matchers.is; diff --git a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/FrozenSearchableSnapshotsIntegTests.java b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/FrozenSearchableSnapshotsIntegTests.java index 1d3dc9224483b..3adbd1d3f69f3 100644 --- a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/FrozenSearchableSnapshotsIntegTests.java +++ b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/FrozenSearchableSnapshotsIntegTests.java @@ -25,6 +25,7 @@ import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.routing.ShardRouting; +import org.elasticsearch.cluster.routing.allocation.DataTier; import org.elasticsearch.cluster.routing.allocation.decider.Decision; import org.elasticsearch.cluster.routing.allocation.decider.DiskThresholdDecider; import org.elasticsearch.common.Priority; @@ -46,12 +47,10 @@ import org.elasticsearch.indices.IndicesService; import org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramInterval; import org.elasticsearch.search.aggregations.bucket.histogram.Histogram; +import org.elasticsearch.snapshots.SearchableSnapshotsSettings; import org.elasticsearch.snapshots.SnapshotInfo; -import org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider; -import org.elasticsearch.xpack.core.DataTier; import org.elasticsearch.xpack.core.searchablesnapshots.MountSearchableSnapshotAction; import org.elasticsearch.xpack.core.searchablesnapshots.MountSearchableSnapshotRequest; -import org.elasticsearch.xpack.core.searchablesnapshots.SearchableSnapshotsConstants; import org.elasticsearch.xpack.searchablesnapshots.action.SearchableSnapshotsStatsAction; import org.elasticsearch.xpack.searchablesnapshots.action.SearchableSnapshotsStatsRequest; @@ -299,8 +298,8 @@ public void testCreateAndRestorePartialSearchableSnapshot() throws Exception { assertTrue(SearchableSnapshots.SNAPSHOT_INDEX_ID_SETTING.exists(settings)); assertThat(IndexMetadata.INDEX_AUTO_EXPAND_REPLICAS_SETTING.get(settings).toString(), equalTo("false")); assertThat(IndexMetadata.INDEX_NUMBER_OF_REPLICAS_SETTING.get(settings), equalTo(expectedReplicas)); - assertThat(DataTierAllocationDecider.TIER_PREFERENCE_SETTING.get(settings), equalTo(expectedDataTiersPreference)); - assertTrue(SearchableSnapshotsConstants.SNAPSHOT_PARTIAL_SETTING.get(settings)); + assertThat(DataTier.TIER_PREFERENCE_SETTING.get(settings), equalTo(expectedDataTiersPreference)); + assertTrue(SearchableSnapshotsSettings.SNAPSHOT_PARTIAL_SETTING.get(settings)); assertTrue(DiskThresholdDecider.SETTING_IGNORE_DISK_WATERMARKS.get(settings)); assertThat(IndexSettings.INDEX_CHECK_ON_STARTUP.get(settings), equalTo(indexCheckOnStartup)); @@ -432,7 +431,7 @@ public void testCreateAndRestorePartialSearchableSnapshot() throws Exception { Settings.builder() .putNull(IndexModule.INDEX_STORE_TYPE_SETTING.getKey()) .putNull(IndexModule.INDEX_RECOVERY_TYPE_SETTING.getKey()) - .put(DataTierAllocationDecider.TIER_PREFERENCE, DataTier.DATA_HOT) + .put(DataTier.TIER_PREFERENCE, DataTier.DATA_HOT) .build() ) ); diff --git a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsIntegTests.java b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsIntegTests.java index 4db3e0c5e74ec..b4dda826f97f6 100644 --- a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsIntegTests.java +++ b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsIntegTests.java @@ -29,6 +29,7 @@ import org.elasticsearch.cluster.routing.ShardRouting; import org.elasticsearch.cluster.routing.allocation.AllocateUnassignedDecision; import org.elasticsearch.cluster.routing.allocation.AllocationDecision; +import org.elasticsearch.cluster.routing.allocation.DataTier; import org.elasticsearch.cluster.routing.allocation.NodeAllocationResult; import org.elasticsearch.cluster.routing.allocation.decider.Decision; import org.elasticsearch.common.Priority; @@ -49,8 +50,6 @@ import org.elasticsearch.snapshots.SnapshotId; import org.elasticsearch.snapshots.SnapshotInfo; import org.elasticsearch.snapshots.SnapshotsService; -import org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider; -import org.elasticsearch.xpack.core.DataTier; import org.elasticsearch.xpack.core.searchablesnapshots.MountSearchableSnapshotAction; import org.elasticsearch.xpack.core.searchablesnapshots.MountSearchableSnapshotRequest; import org.elasticsearch.xpack.core.searchablesnapshots.SearchableSnapshotShardStats; @@ -202,7 +201,7 @@ public void testCreateAndRestoreSearchableSnapshot() throws Exception { DataTier.ALL_DATA_TIERS.stream().filter(tier -> tier.equals(DataTier.DATA_FROZEN) == false).collect(Collectors.toSet()) ) ); - indexSettingsBuilder.put(DataTierAllocationDecider.TIER_PREFERENCE, expectedDataTiersPreference); + indexSettingsBuilder.put(DataTier.TIER_PREFERENCE, expectedDataTiersPreference); } else { expectedDataTiersPreference = MountSearchableSnapshotRequest.Storage.FULL_COPY.defaultDataTiersPreference(); } @@ -246,7 +245,7 @@ public void testCreateAndRestoreSearchableSnapshot() throws Exception { assertTrue(SearchableSnapshots.SNAPSHOT_INDEX_ID_SETTING.exists(settings)); assertThat(IndexMetadata.INDEX_AUTO_EXPAND_REPLICAS_SETTING.get(settings).toString(), equalTo("false")); assertThat(IndexMetadata.INDEX_NUMBER_OF_REPLICAS_SETTING.get(settings), equalTo(expectedReplicas)); - assertThat(DataTierAllocationDecider.TIER_PREFERENCE_SETTING.get(settings), equalTo(expectedDataTiersPreference)); + assertThat(DataTier.TIER_PREFERENCE_SETTING.get(settings), equalTo(expectedDataTiersPreference)); assertThat(IndexSettings.INDEX_CHECK_ON_STARTUP.get(settings), equalTo("false")); checkSoftDeletesNotEagerlyLoaded(restoredIndexName); diff --git a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsResizeIntegTests.java b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsResizeIntegTests.java index 334e49f03198f..193900329311e 100644 --- a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsResizeIntegTests.java +++ b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsResizeIntegTests.java @@ -8,12 +8,11 @@ package org.elasticsearch.xpack.searchablesnapshots; import org.elasticsearch.action.admin.indices.shrink.ResizeType; +import org.elasticsearch.cluster.routing.allocation.DataTier; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.index.IndexModule; import org.elasticsearch.repositories.fs.FsRepository; import org.elasticsearch.test.ESIntegTestCase; -import org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider; -import org.elasticsearch.xpack.core.DataTier; import org.junit.After; import org.junit.Before; @@ -120,7 +119,7 @@ public void testCloneSearchableSnapshotIndex() { Settings.builder() .putNull(IndexModule.INDEX_STORE_TYPE_SETTING.getKey()) .putNull(IndexModule.INDEX_RECOVERY_TYPE_SETTING.getKey()) - .put(DataTierAllocationDecider.TIER_PREFERENCE, DataTier.DATA_HOT) + .put(DataTier.TIER_PREFERENCE, DataTier.DATA_HOT) .put(INDEX_NUMBER_OF_REPLICAS_SETTING.getKey(), 0) .build() ) diff --git a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/allocation/SearchableSnapshotDataTierIntegTests.java b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/allocation/SearchableSnapshotDataTierIntegTests.java index 89e902ac94fb3..e02018797322c 100644 --- a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/allocation/SearchableSnapshotDataTierIntegTests.java +++ b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/allocation/SearchableSnapshotDataTierIntegTests.java @@ -8,10 +8,9 @@ package org.elasticsearch.xpack.searchablesnapshots.allocation; import org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsRequest; +import org.elasticsearch.cluster.routing.allocation.DataTier; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.test.ESIntegTestCase; -import org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider; -import org.elasticsearch.xpack.core.DataTier; import org.elasticsearch.xpack.core.searchablesnapshots.MountSearchableSnapshotRequest; import org.elasticsearch.xpack.searchablesnapshots.BaseFrozenSearchableSnapshotsIntegTestCase; @@ -24,9 +23,7 @@ public class SearchableSnapshotDataTierIntegTests extends BaseFrozenSearchableSn private static final String indexName = "test-index"; private static final String snapshotName = "test-snapshot"; private static final String mountedIndexName = "test-index-mounted"; - private static final Settings frozenSettings = Settings.builder() - .put(DataTierAllocationDecider.TIER_PREFERENCE, DataTier.DATA_FROZEN) - .build(); + private static final Settings frozenSettings = Settings.builder().put(DataTier.TIER_PREFERENCE, DataTier.DATA_FROZEN).build(); public void testPartialLegalOnFrozen() throws Exception { createRepository(repoName, "fs"); @@ -63,10 +60,7 @@ public void testFullIllegalOnFrozen() throws Exception { Settings mountSettings = randomFrom( Settings.EMPTY, Settings.builder() - .put( - DataTierAllocationDecider.TIER_PREFERENCE, - randomValueOtherThan(DataTier.DATA_FROZEN, () -> randomFrom(DataTier.ALL_DATA_TIERS)) - ) + .put(DataTier.TIER_PREFERENCE, randomValueOtherThan(DataTier.DATA_FROZEN, () -> randomFrom(DataTier.ALL_DATA_TIERS))) .build() ); mountSnapshot(repoName, snapshotName, indexName, mountedIndexName, mountSettings, MountSearchableSnapshotRequest.Storage.FULL_COPY); @@ -77,7 +71,7 @@ public void testFullIllegalOnFrozen() throws Exception { private void updatePreference(String tier) { client().admin() .indices() - .updateSettings(new UpdateSettingsRequest(mountedIndexName).settings(Map.of(DataTierAllocationDecider.TIER_PREFERENCE, tier))) + .updateSettings(new UpdateSettingsRequest(mountedIndexName).settings(Map.of(DataTier.TIER_PREFERENCE, tier))) .actionGet(); } } diff --git a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/cache/blob/SearchableSnapshotsBlobStoreCacheIntegTests.java b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/cache/blob/SearchableSnapshotsBlobStoreCacheIntegTests.java index 3b07fb37eb8c4..ec639c641a9a8 100644 --- a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/cache/blob/SearchableSnapshotsBlobStoreCacheIntegTests.java +++ b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/cache/blob/SearchableSnapshotsBlobStoreCacheIntegTests.java @@ -18,6 +18,7 @@ import org.elasticsearch.cluster.routing.IndexRoutingTable; import org.elasticsearch.cluster.routing.RoutingNode; import org.elasticsearch.cluster.routing.ShardRouting; +import org.elasticsearch.cluster.routing.allocation.DataTier; import org.elasticsearch.cluster.routing.allocation.RoutingAllocation; import org.elasticsearch.cluster.routing.allocation.decider.AllocationDecider; import org.elasticsearch.cluster.routing.allocation.decider.Decision; @@ -40,7 +41,6 @@ import org.elasticsearch.snapshots.SearchableSnapshotsSettings; import org.elasticsearch.snapshots.SnapshotId; import org.elasticsearch.test.InternalTestCluster; -import org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider; import org.elasticsearch.xpack.core.ClientHelper; import org.elasticsearch.xpack.core.searchablesnapshots.MountSearchableSnapshotRequest.Storage; import org.elasticsearch.xpack.core.searchablesnapshots.SearchableSnapshotShardStats; @@ -206,7 +206,7 @@ public void testBlobStoreCache() throws Exception { .indices() .prepareGetSettings(SNAPSHOT_BLOB_CACHE_INDEX) .get() - .getSetting(SNAPSHOT_BLOB_CACHE_INDEX, DataTierAllocationDecider.TIER_PREFERENCE), + .getSetting(SNAPSHOT_BLOB_CACHE_INDEX, DataTier.TIER_PREFERENCE), equalTo("data_content,data_hot") ); diff --git a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/cache/shared/PartiallyCachedShardAllocationIntegTests.java b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/cache/shared/PartiallyCachedShardAllocationIntegTests.java index b6d7047414bab..d95f840d916e7 100644 --- a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/cache/shared/PartiallyCachedShardAllocationIntegTests.java +++ b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/cache/shared/PartiallyCachedShardAllocationIntegTests.java @@ -49,11 +49,11 @@ import java.util.function.Function; import java.util.stream.Collectors; +import static org.elasticsearch.cluster.routing.allocation.DataTier.TIER_PREFERENCE; import static org.elasticsearch.cluster.routing.allocation.decider.EnableAllocationDecider.CLUSTER_ROUTING_REBALANCE_ENABLE_SETTING; import static org.elasticsearch.index.IndexSettings.INDEX_SOFT_DELETES_SETTING; import static org.elasticsearch.test.NodeRoles.onlyRole; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; -import static org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider.TIER_PREFERENCE; import static org.elasticsearch.xpack.searchablesnapshots.cache.shared.FrozenCacheService.SNAPSHOT_CACHE_SIZE_SETTING; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasItem; diff --git a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshots.java b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshots.java index a16f95d4d9766..f63df97f72cf2 100644 --- a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshots.java +++ b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshots.java @@ -22,6 +22,7 @@ import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.node.DiscoveryNodes; import org.elasticsearch.cluster.routing.RerouteService; +import org.elasticsearch.cluster.routing.allocation.DataTier; import org.elasticsearch.cluster.routing.allocation.ExistingShardsAllocator; import org.elasticsearch.cluster.routing.allocation.decider.AllocationDecider; import org.elasticsearch.cluster.service.ClusterService; @@ -73,13 +74,10 @@ import org.elasticsearch.threadpool.ScalingExecutorBuilder; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.watcher.ResourceWatcherService; -import org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider; -import org.elasticsearch.xpack.core.DataTier; import org.elasticsearch.xpack.core.XPackPlugin; import org.elasticsearch.xpack.core.action.XPackInfoFeatureAction; import org.elasticsearch.xpack.core.action.XPackUsageFeatureAction; import org.elasticsearch.xpack.core.searchablesnapshots.MountSearchableSnapshotAction; -import org.elasticsearch.xpack.core.searchablesnapshots.SearchableSnapshotsConstants; import org.elasticsearch.xpack.searchablesnapshots.action.ClearSearchableSnapshotsCacheAction; import org.elasticsearch.xpack.searchablesnapshots.action.SearchableSnapshotsInfoTransportAction; import org.elasticsearch.xpack.searchablesnapshots.action.SearchableSnapshotsStatsAction; @@ -299,7 +297,7 @@ public List> getSettings() { SNAPSHOT_CACHE_EXCLUDED_FILE_TYPES_SETTING, SNAPSHOT_UNCACHED_CHUNK_SIZE_SETTING, DELETE_SEARCHABLE_SNAPSHOT_ON_INDEX_DELETION, - SearchableSnapshotsConstants.SNAPSHOT_PARTIAL_SETTING, + SearchableSnapshotsSettings.SNAPSHOT_PARTIAL_SETTING, SNAPSHOT_BLOB_CACHE_METADATA_FILES_MAX_LENGTH_SETTING, CacheService.SNAPSHOT_CACHE_RANGE_SIZE_SETTING, CacheService.SNAPSHOT_CACHE_RECOVERY_RANGE_SIZE_SETTING, @@ -598,7 +596,7 @@ private Settings getIndexSettings() { .put(IndexMetadata.SETTING_AUTO_EXPAND_REPLICAS, "0-1") .put(IndexMetadata.SETTING_PRIORITY, "900") .put(IndexSettings.INDEX_TRANSLOG_DURABILITY_SETTING.getKey(), Translog.Durability.ASYNC) - .put(DataTierAllocationDecider.TIER_PREFERENCE, DATA_TIERS_CACHE_INDEX_PREFERENCE) + .put(DataTier.TIER_PREFERENCE, DATA_TIERS_CACHE_INDEX_PREFERENCE) .build(); } diff --git a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/action/SearchableSnapshotsUsageTransportAction.java b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/action/SearchableSnapshotsUsageTransportAction.java index c1212fb5f8a05..abc602bc91da6 100644 --- a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/action/SearchableSnapshotsUsageTransportAction.java +++ b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/action/SearchableSnapshotsUsageTransportAction.java @@ -24,7 +24,6 @@ import org.elasticsearch.xpack.core.action.XPackUsageFeatureResponse; import org.elasticsearch.xpack.core.action.XPackUsageFeatureTransportAction; import org.elasticsearch.xpack.core.searchablesnapshots.SearchableSnapshotFeatureSetUsage; -import org.elasticsearch.xpack.core.searchablesnapshots.SearchableSnapshotsConstants; import static org.elasticsearch.xpack.core.searchablesnapshots.SearchableSnapshotsConstants.SEARCHABLE_SNAPSHOT_FEATURE; @@ -63,7 +62,7 @@ protected void masterOperation( int numSharedCacheSnapIndices = 0; for (IndexMetadata indexMetadata : state.metadata()) { if (SearchableSnapshotsSettings.isSearchableSnapshotStore(indexMetadata.getSettings())) { - if (SearchableSnapshotsConstants.SNAPSHOT_PARTIAL_SETTING.get(indexMetadata.getSettings())) { + if (SearchableSnapshotsSettings.SNAPSHOT_PARTIAL_SETTING.get(indexMetadata.getSettings())) { numSharedCacheSnapIndices++; } else { numFullCopySnapIndices++; diff --git a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/action/TransportMountSearchableSnapshotAction.java b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/action/TransportMountSearchableSnapshotAction.java index ce8f9edd7f76a..f95d580124e03 100644 --- a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/action/TransportMountSearchableSnapshotAction.java +++ b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/action/TransportMountSearchableSnapshotAction.java @@ -19,6 +19,7 @@ import org.elasticsearch.cluster.block.ClusterBlockException; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; +import org.elasticsearch.cluster.routing.allocation.DataTier; import org.elasticsearch.cluster.routing.allocation.ExistingShardsAllocator; import org.elasticsearch.cluster.routing.allocation.decider.DiskThresholdDecider; import org.elasticsearch.cluster.service.ClusterService; @@ -35,14 +36,13 @@ import org.elasticsearch.repositories.RepositoriesService; import org.elasticsearch.repositories.Repository; import org.elasticsearch.repositories.RepositoryData; +import org.elasticsearch.snapshots.SearchableSnapshotsSettings; import org.elasticsearch.snapshots.SnapshotId; import org.elasticsearch.tasks.Task; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.TransportService; -import org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider; import org.elasticsearch.xpack.core.searchablesnapshots.MountSearchableSnapshotAction; import org.elasticsearch.xpack.core.searchablesnapshots.MountSearchableSnapshotRequest; -import org.elasticsearch.xpack.core.searchablesnapshots.SearchableSnapshotsConstants; import org.elasticsearch.xpack.searchablesnapshots.SearchableSnapshots; import org.elasticsearch.xpack.searchablesnapshots.allocation.SearchableSnapshotAllocator; @@ -71,9 +71,7 @@ public class TransportMountSearchableSnapshotAction extends TransportMasterNodeA MountSearchableSnapshotRequest, RestoreSnapshotResponse> { - private static final Collection> DATA_TIER_ALLOCATION_SETTINGS = List.of( - DataTierAllocationDecider.TIER_PREFERENCE_SETTING - ); + private static final Collection> DATA_TIER_ALLOCATION_SETTINGS = List.of(DataTier.TIER_PREFERENCE_SETTING); private final Client client; private final RepositoriesService repositoriesService; @@ -147,7 +145,7 @@ private static Settings buildIndexSettings( if (minNodeVersion.before(Version.V_7_12_0)) { throw new IllegalArgumentException("shared cache searchable snapshots require minimum node version " + Version.V_7_12_0); } - settings.put(SearchableSnapshotsConstants.SNAPSHOT_PARTIAL_SETTING.getKey(), true) + settings.put(SearchableSnapshotsSettings.SNAPSHOT_PARTIAL_SETTING.getKey(), true) .put(DiskThresholdDecider.SETTING_IGNORE_DISK_WATERMARKS.getKey(), true); // we cannot apply this setting during rolling upgrade. @@ -233,7 +231,7 @@ protected void masterOperation( .put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0) // can be overridden .put(IndexMetadata.SETTING_AUTO_EXPAND_REPLICAS, false) // can be overridden .put(IndexSettings.INDEX_CHECK_ON_STARTUP.getKey(), false) // can be overridden - .put(DataTierAllocationDecider.TIER_PREFERENCE, request.storage().defaultDataTiersPreference()) + .put(DataTier.TIER_PREFERENCE, request.storage().defaultDataTiersPreference()) .put(request.indexSettings()) .put( buildIndexSettings( diff --git a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/action/cache/TransportSearchableSnapshotCacheStoresAction.java b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/action/cache/TransportSearchableSnapshotCacheStoresAction.java index f5f7e02ae8a1e..5ac0decd23761 100644 --- a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/action/cache/TransportSearchableSnapshotCacheStoresAction.java +++ b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/action/cache/TransportSearchableSnapshotCacheStoresAction.java @@ -32,7 +32,7 @@ import java.util.List; import java.util.Optional; -import static org.elasticsearch.xpack.core.searchablesnapshots.SearchableSnapshotsConstants.SNAPSHOT_PARTIAL_SETTING; +import static org.elasticsearch.snapshots.SearchableSnapshotsSettings.SNAPSHOT_PARTIAL_SETTING; public class TransportSearchableSnapshotCacheStoresAction extends TransportNodesAction< TransportSearchableSnapshotCacheStoresAction.Request, diff --git a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/allocation/SearchableSnapshotAllocator.java b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/allocation/SearchableSnapshotAllocator.java index 3490cd6315529..9e46d7abe8361 100644 --- a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/allocation/SearchableSnapshotAllocator.java +++ b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/allocation/SearchableSnapshotAllocator.java @@ -64,7 +64,7 @@ import java.util.stream.StreamSupport; import static java.util.Collections.emptyList; -import static org.elasticsearch.xpack.core.searchablesnapshots.SearchableSnapshotsConstants.SNAPSHOT_PARTIAL_SETTING; +import static org.elasticsearch.snapshots.SearchableSnapshotsSettings.SNAPSHOT_PARTIAL_SETTING; import static org.elasticsearch.xpack.searchablesnapshots.SearchableSnapshots.SNAPSHOT_INDEX_ID_SETTING; import static org.elasticsearch.xpack.searchablesnapshots.SearchableSnapshots.SNAPSHOT_INDEX_NAME_SETTING; import static org.elasticsearch.xpack.searchablesnapshots.SearchableSnapshots.SNAPSHOT_REPOSITORY_NAME_SETTING; diff --git a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/cache/shared/FrozenCacheService.java b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/cache/shared/FrozenCacheService.java index 3ca5a09e0b0c6..95c3a72e736d7 100644 --- a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/cache/shared/FrozenCacheService.java +++ b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/cache/shared/FrozenCacheService.java @@ -15,6 +15,7 @@ import org.elasticsearch.action.StepListener; import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.node.DiscoveryNodeRole; +import org.elasticsearch.cluster.routing.allocation.DataTier; import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.SettingsException; @@ -34,7 +35,6 @@ import org.elasticsearch.monitor.fs.FsProbe; import org.elasticsearch.node.NodeRoleSettings; import org.elasticsearch.threadpool.ThreadPool; -import org.elasticsearch.xpack.core.DataTier; import org.elasticsearch.xpack.searchablesnapshots.cache.common.ByteRange; import org.elasticsearch.xpack.searchablesnapshots.cache.common.CacheKey; import org.elasticsearch.xpack.searchablesnapshots.cache.common.SparseFileTracker; diff --git a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/store/SearchableSnapshotDirectory.java b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/store/SearchableSnapshotDirectory.java index d1c3c65e78b83..23ae7722cfb09 100644 --- a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/store/SearchableSnapshotDirectory.java +++ b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/store/SearchableSnapshotDirectory.java @@ -88,7 +88,7 @@ import static org.elasticsearch.index.IndexModule.INDEX_STORE_TYPE_SETTING; import static org.elasticsearch.snapshots.SearchableSnapshotsSettings.SEARCHABLE_SNAPSHOT_STORE_TYPE; -import static org.elasticsearch.xpack.core.searchablesnapshots.SearchableSnapshotsConstants.SNAPSHOT_PARTIAL_SETTING; +import static org.elasticsearch.snapshots.SearchableSnapshotsSettings.SNAPSHOT_PARTIAL_SETTING; import static org.elasticsearch.xpack.searchablesnapshots.SearchableSnapshots.SNAPSHOT_BLOB_CACHE_METADATA_FILES_MAX_LENGTH_SETTING; import static org.elasticsearch.xpack.searchablesnapshots.SearchableSnapshots.SNAPSHOT_CACHE_ENABLED_SETTING; import static org.elasticsearch.xpack.searchablesnapshots.SearchableSnapshots.SNAPSHOT_CACHE_EXCLUDED_FILE_TYPES_SETTING; diff --git a/x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/allocation/SearchableSnapshotAllocatorTests.java b/x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/allocation/SearchableSnapshotAllocatorTests.java index bfc60dff44848..c9e220fe289ae 100644 --- a/x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/allocation/SearchableSnapshotAllocatorTests.java +++ b/x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/allocation/SearchableSnapshotAllocatorTests.java @@ -53,7 +53,7 @@ import java.util.function.UnaryOperator; import java.util.stream.Collectors; -import static org.elasticsearch.xpack.core.searchablesnapshots.SearchableSnapshotsConstants.SNAPSHOT_PARTIAL_SETTING; +import static org.elasticsearch.snapshots.SearchableSnapshotsSettings.SNAPSHOT_PARTIAL_SETTING; import static org.hamcrest.Matchers.empty; public class SearchableSnapshotAllocatorTests extends ESAllocationTestCase { diff --git a/x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/store/SearchableSnapshotDirectoryStatsTests.java b/x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/store/SearchableSnapshotDirectoryStatsTests.java index 8c2673955d151..515322b315b51 100644 --- a/x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/store/SearchableSnapshotDirectoryStatsTests.java +++ b/x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/store/SearchableSnapshotDirectoryStatsTests.java @@ -31,9 +31,9 @@ import org.elasticsearch.index.store.StoreFileMetadata; import org.elasticsearch.indices.recovery.RecoveryState; import org.elasticsearch.repositories.IndexId; +import org.elasticsearch.snapshots.SearchableSnapshotsSettings; import org.elasticsearch.snapshots.Snapshot; import org.elasticsearch.snapshots.SnapshotId; -import org.elasticsearch.xpack.core.searchablesnapshots.SearchableSnapshotsConstants; import org.elasticsearch.xpack.searchablesnapshots.AbstractSearchableSnapshotsTestCase; import org.elasticsearch.xpack.searchablesnapshots.cache.common.TestUtils; import org.elasticsearch.xpack.searchablesnapshots.cache.common.TestUtils.NoopBlobStoreCacheService; @@ -197,7 +197,7 @@ public void testDirectBytesReadsWithCache() throws Exception { createFrozenCacheService(ByteSizeValue.ZERO, randomFrozenCacheRangeSize()), Settings.builder() .put(SNAPSHOT_CACHE_ENABLED_SETTING.getKey(), true) - .put(SearchableSnapshotsConstants.SNAPSHOT_PARTIAL_SETTING.getKey(), true) + .put(SearchableSnapshotsSettings.SNAPSHOT_PARTIAL_SETTING.getKey(), true) .build(), (fileName, fileContent, directory) -> { assertThat(directory.getStats(fileName), nullValue()); @@ -553,7 +553,7 @@ private void executeTestCase(final TriConsumer Date: Fri, 8 Oct 2021 17:14:26 +0100 Subject: [PATCH 242/250] Fix split package org.elasticsearch.common.xcontent (#78831) Fix the split package org.elasticsearch.common.xcontent, between server and the x-content lib. Move the x-content lib exported package from org.elasticsearch.common.xcontent to org.elasticsearch.xcontent ( following the naming convention of similar libraries ). Removing split packages is a prerequisite to modularization. --- .../subphase/FetchSourcePhaseBenchmark.java | 12 ++++----- .../noop/action/bulk/RestNoopBulkAction.java | 2 +- .../client/GeoIpStatsResponse.java | 14 +++++----- .../client/GetAliasesResponse.java | 8 +++--- .../elasticsearch/client/LicenseClient.java | 12 ++++----- .../elasticsearch/client/NodesResponse.java | 4 +-- .../client/NodesResponseHeader.java | 10 +++---- .../client/RequestConverters.java | 14 +++++----- .../client/RestHighLevelClient.java | 12 ++++----- .../client/RestHighLevelClientBuilder.java | 2 +- .../TextStructureRequestConverters.java | 2 +- .../client/WatcherRequestConverters.java | 2 +- .../InferencePipelineAggregationBuilder.java | 10 +++---- .../client/analytics/ParsedInference.java | 14 +++++----- .../client/analytics/ParsedStringStats.java | 12 ++++----- .../client/analytics/ParsedTopMetrics.java | 12 ++++----- .../StringStatsAggregationBuilder.java | 4 +-- .../TopMetricsAggregationBuilder.java | 2 +- .../asyncsearch/AsyncSearchResponse.java | 16 ++++++------ .../client/ccr/AutoFollowStats.java | 4 +-- .../client/ccr/CcrStatsResponse.java | 6 ++--- .../client/ccr/FollowConfig.java | 10 +++---- .../client/ccr/FollowInfoResponse.java | 6 ++--- .../client/ccr/FollowStatsResponse.java | 2 +- .../client/ccr/ForgetFollowerRequest.java | 4 +-- .../ccr/GetAutoFollowPatternResponse.java | 8 +++--- .../client/ccr/IndicesFollowStats.java | 4 +-- .../ccr/PutAutoFollowPatternRequest.java | 6 ++--- .../client/ccr/PutFollowRequest.java | 6 ++--- .../client/ccr/PutFollowResponse.java | 6 ++--- .../client/ccr/ResumeFollowRequest.java | 4 +-- .../client/cluster/RemoteConnectionInfo.java | 10 +++---- .../client/cluster/RemoteInfoResponse.java | 2 +- .../elasticsearch/client/common/TimeUtil.java | 2 +- .../client/common/XContentSource.java | 6 ++--- .../client/core/AcknowledgedResponse.java | 8 +++--- .../client/core/BroadcastResponse.java | 6 ++--- .../client/core/CountRequest.java | 4 +-- .../client/core/CountResponse.java | 4 +-- .../client/core/GetSourceResponse.java | 2 +- .../client/core/IndexerJobStats.java | 2 +- .../client/core/MainResponse.java | 6 ++--- .../client/core/MultiTermVectorsRequest.java | 4 +-- .../client/core/MultiTermVectorsResponse.java | 8 +++--- .../elasticsearch/client/core/PageParams.java | 8 +++--- .../core/ShardsAcknowledgedResponse.java | 8 +++--- .../client/core/TermVectorsRequest.java | 4 +-- .../client/core/TermVectorsResponse.java | 10 +++---- .../client/enrich/ExecutePolicyResponse.java | 6 ++--- .../client/enrich/GetPolicyResponse.java | 6 ++--- .../client/enrich/NamedPolicy.java | 8 +++--- .../client/enrich/PutPolicyRequest.java | 8 +++--- .../client/enrich/StatsResponse.java | 6 ++--- .../client/eql/EqlSearchRequest.java | 6 ++--- .../client/eql/EqlSearchResponse.java | 16 ++++++------ .../client/eql/EqlStatsResponse.java | 6 ++--- .../client/feature/GetFeaturesResponse.java | 8 +++--- .../client/feature/ResetFeaturesResponse.java | 8 +++--- .../client/graph/Connection.java | 12 ++++----- .../client/graph/GraphExploreRequest.java | 4 +-- .../client/graph/GraphExploreResponse.java | 14 +++++----- .../org/elasticsearch/client/graph/Hop.java | 4 +-- .../elasticsearch/client/graph/Vertex.java | 14 +++++----- .../client/graph/VertexRequest.java | 4 +-- .../client/ilm/AllocateAction.java | 12 ++++----- .../client/ilm/DeleteAction.java | 10 +++---- .../client/ilm/ExplainLifecycleResponse.java | 10 +++---- .../client/ilm/ForceMergeAction.java | 10 +++---- .../client/ilm/FreezeAction.java | 8 +++--- .../ilm/GetLifecyclePolicyResponse.java | 8 +++--- .../ilm/IndexLifecycleExplainResponse.java | 12 ++++----- .../IndexLifecycleNamedXContentProvider.java | 4 +-- .../LifecycleManagementStatusResponse.java | 6 ++--- .../client/ilm/LifecyclePolicy.java | 10 +++---- .../client/ilm/LifecyclePolicyMetadata.java | 10 +++---- .../client/ilm/MigrateAction.java | 10 +++---- .../org/elasticsearch/client/ilm/Phase.java | 12 ++++----- .../client/ilm/PhaseExecutionInfo.java | 10 +++---- .../client/ilm/PutLifecyclePolicyRequest.java | 4 +-- .../client/ilm/ReadOnlyAction.java | 8 +++--- .../RemoveIndexLifecyclePolicyResponse.java | 6 ++--- .../client/ilm/RolloverAction.java | 12 ++++----- .../client/ilm/SearchableSnapshotAction.java | 12 ++++----- .../client/ilm/SetPriorityAction.java | 14 +++++----- .../client/ilm/ShrinkAction.java | 12 ++++----- .../client/ilm/UnfollowAction.java | 10 +++---- .../client/ilm/WaitForSnapshotAction.java | 12 ++++----- .../client/indices/AnalyzeRequest.java | 6 ++--- .../client/indices/AnalyzeResponse.java | 10 +++---- .../client/indices/CloseIndexResponse.java | 10 +++---- .../client/indices/CreateIndexRequest.java | 16 ++++++------ .../client/indices/CreateIndexResponse.java | 10 +++---- .../client/indices/DataStream.java | 6 ++--- .../indices/DataStreamsStatsResponse.java | 10 +++---- .../client/indices/DetailAnalyzeResponse.java | 10 +++---- .../GetComponentTemplatesResponse.java | 6 ++--- .../GetComposableIndexTemplatesResponse.java | 6 ++--- .../client/indices/GetDataStreamResponse.java | 2 +- .../indices/GetFieldMappingsResponse.java | 16 ++++++------ .../client/indices/GetIndexResponse.java | 4 +-- .../indices/GetIndexTemplatesResponse.java | 2 +- .../client/indices/GetMappingsResponse.java | 4 +-- .../client/indices/IndexTemplateMetadata.java | 8 +++--- .../indices/PutComponentTemplateRequest.java | 4 +-- .../PutComposableIndexTemplateRequest.java | 4 +-- .../indices/PutIndexTemplateRequest.java | 16 ++++++------ .../client/indices/PutMappingRequest.java | 10 +++---- .../indices/ReloadAnalyzersResponse.java | 8 +++--- .../client/indices/ResizeRequest.java | 4 +-- .../client/indices/ResizeResponse.java | 10 +++---- .../SimulateIndexTemplateResponse.java | 6 ++--- .../indices/rollover/RolloverRequest.java | 4 +-- .../indices/rollover/RolloverResponse.java | 8 +++--- .../license/GetBasicStatusResponse.java | 10 +++---- .../license/GetTrialStatusResponse.java | 10 +++---- .../client/license/PutLicenseResponse.java | 12 ++++----- .../client/license/StartBasicResponse.java | 12 ++++----- .../client/license/StartTrialResponse.java | 12 ++++----- .../migration/DeprecationInfoResponse.java | 6 ++--- .../GetFeatureUpgradeStatusResponse.java | 8 +++--- .../migration/PostFeatureUpgradeResponse.java | 8 +++--- .../client/ml/AbstractResultResponse.java | 8 +++--- .../client/ml/CloseJobRequest.java | 10 +++---- .../client/ml/CloseJobResponse.java | 10 +++---- .../client/ml/DeleteExpiredDataRequest.java | 4 +-- .../client/ml/DeleteExpiredDataResponse.java | 12 ++++----- .../client/ml/DeleteForecastRequest.java | 8 +++--- .../client/ml/DeleteJobResponse.java | 12 ++++----- .../client/ml/EstimateModelMemoryRequest.java | 4 +-- .../ml/EstimateModelMemoryResponse.java | 8 +++--- .../client/ml/EvaluateDataFrameRequest.java | 14 +++++----- .../client/ml/EvaluateDataFrameResponse.java | 10 +++---- .../ml/ExplainDataFrameAnalyticsResponse.java | 10 +++---- .../client/ml/FlushJobRequest.java | 8 +++--- .../client/ml/FlushJobResponse.java | 10 +++---- .../client/ml/ForecastJobRequest.java | 16 ++++++------ .../client/ml/ForecastJobResponse.java | 10 +++---- .../client/ml/GetBucketsRequest.java | 8 +++--- .../client/ml/GetBucketsResponse.java | 6 ++--- .../client/ml/GetCalendarEventsRequest.java | 8 +++--- .../client/ml/GetCalendarEventsResponse.java | 8 +++--- .../client/ml/GetCalendarsRequest.java | 6 ++--- .../client/ml/GetCalendarsResponse.java | 8 +++--- .../client/ml/GetCategoriesRequest.java | 8 +++--- .../client/ml/GetCategoriesResponse.java | 6 ++--- .../ml/GetDataFrameAnalyticsResponse.java | 8 +++--- .../ml/GetDataFrameAnalyticsStatsRequest.java | 2 +- .../GetDataFrameAnalyticsStatsResponse.java | 10 +++---- .../client/ml/GetDatafeedRequest.java | 8 +++--- .../client/ml/GetDatafeedResponse.java | 8 +++--- .../client/ml/GetDatafeedStatsRequest.java | 12 ++++----- .../client/ml/GetDatafeedStatsResponse.java | 8 +++--- .../client/ml/GetFiltersRequest.java | 6 ++--- .../client/ml/GetFiltersResponse.java | 8 +++--- .../client/ml/GetInfluencersRequest.java | 8 +++--- .../client/ml/GetInfluencersResponse.java | 6 ++--- .../client/ml/GetJobRequest.java | 8 +++--- .../client/ml/GetJobResponse.java | 8 +++--- .../client/ml/GetJobStatsRequest.java | 10 +++---- .../client/ml/GetJobStatsResponse.java | 8 +++--- .../client/ml/GetModelSnapshotsRequest.java | 8 +++--- .../client/ml/GetModelSnapshotsResponse.java | 6 ++--- .../client/ml/GetOverallBucketsRequest.java | 8 +++--- .../client/ml/GetOverallBucketsResponse.java | 6 ++--- .../client/ml/GetRecordsRequest.java | 8 +++--- .../client/ml/GetRecordsResponse.java | 6 ++--- .../client/ml/GetTrainedModelsResponse.java | 8 +++--- .../ml/GetTrainedModelsStatsResponse.java | 8 +++--- .../client/ml/MlInfoResponse.java | 2 +- .../client/ml/NodeAttributes.java | 10 +++---- .../client/ml/OpenJobRequest.java | 10 +++---- .../client/ml/OpenJobResponse.java | 10 +++---- .../client/ml/PostCalendarEventRequest.java | 8 +++--- .../client/ml/PostCalendarEventResponse.java | 10 +++---- .../client/ml/PostDataRequest.java | 10 +++---- .../client/ml/PostDataResponse.java | 8 +++--- .../client/ml/PreviewDatafeedRequest.java | 10 +++---- .../client/ml/PreviewDatafeedResponse.java | 14 +++++----- .../client/ml/PutCalendarRequest.java | 4 +-- .../client/ml/PutCalendarResponse.java | 6 ++--- .../ml/PutDataFrameAnalyticsRequest.java | 4 +-- .../ml/PutDataFrameAnalyticsResponse.java | 2 +- .../client/ml/PutDatafeedRequest.java | 4 +-- .../client/ml/PutDatafeedResponse.java | 6 ++--- .../client/ml/PutFilterRequest.java | 4 +-- .../client/ml/PutFilterResponse.java | 6 ++--- .../client/ml/PutJobRequest.java | 4 +-- .../client/ml/PutJobResponse.java | 6 ++--- .../client/ml/PutTrainedModelRequest.java | 6 ++--- .../client/ml/PutTrainedModelResponse.java | 6 ++--- .../client/ml/RevertModelSnapshotRequest.java | 8 +++--- .../ml/RevertModelSnapshotResponse.java | 10 +++---- .../client/ml/SetUpgradeModeRequest.java | 2 +- .../ml/StartDataFrameAnalyticsResponse.java | 8 +++--- .../client/ml/StartDatafeedRequest.java | 8 +++--- .../client/ml/StartDatafeedResponse.java | 10 +++---- .../ml/StopDataFrameAnalyticsRequest.java | 2 +- .../ml/StopDataFrameAnalyticsResponse.java | 10 +++---- .../client/ml/StopDatafeedRequest.java | 10 +++---- .../client/ml/StopDatafeedResponse.java | 10 +++---- .../ml/UpdateDataFrameAnalyticsRequest.java | 4 +-- .../client/ml/UpdateDatafeedRequest.java | 4 +-- .../client/ml/UpdateFilterRequest.java | 8 +++--- .../client/ml/UpdateJobRequest.java | 4 +-- .../client/ml/UpdateModelSnapshotRequest.java | 6 ++--- .../ml/UpdateModelSnapshotResponse.java | 12 ++++----- .../ml/UpgradeJobModelSnapshotRequest.java | 10 +++---- .../ml/UpgradeJobModelSnapshotResponse.java | 10 +++---- .../client/ml/calendars/Calendar.java | 8 +++--- .../client/ml/calendars/ScheduledEvent.java | 10 +++---- .../client/ml/datafeed/ChunkingConfig.java | 8 +++--- .../client/ml/datafeed/DatafeedConfig.java | 16 ++++++------ .../client/ml/datafeed/DatafeedState.java | 2 +- .../client/ml/datafeed/DatafeedStats.java | 10 +++---- .../ml/datafeed/DatafeedTimingStats.java | 14 +++++----- .../client/ml/datafeed/DatafeedUpdate.java | 16 ++++++------ .../ml/datafeed/DelayedDataCheckConfig.java | 8 +++--- .../client/ml/dataframe/Classification.java | 8 +++--- .../ml/dataframe/DataFrameAnalysis.java | 2 +- .../dataframe/DataFrameAnalyticsConfig.java | 12 ++++----- .../DataFrameAnalyticsConfigUpdate.java | 10 +++---- .../ml/dataframe/DataFrameAnalyticsDest.java | 10 +++---- .../dataframe/DataFrameAnalyticsSource.java | 10 +++---- .../ml/dataframe/DataFrameAnalyticsStats.java | 10 +++---- ...ataFrameAnalysisNamedXContentProvider.java | 2 +- .../client/ml/dataframe/OutlierDetection.java | 8 +++--- .../client/ml/dataframe/PhaseProgress.java | 8 +++--- .../client/ml/dataframe/QueryConfig.java | 6 ++--- .../client/ml/dataframe/Regression.java | 10 +++---- .../ml/dataframe/evaluation/Evaluation.java | 2 +- .../evaluation/EvaluationMetric.java | 2 +- .../MlEvaluationNamedXContentProvider.java | 4 +-- .../classification/AccuracyMetric.java | 14 +++++----- .../classification/AucRocMetric.java | 14 +++++----- .../classification/Classification.java | 12 ++++----- .../MulticlassConfusionMatrixMetric.java | 12 ++++----- .../classification/PerClassSingleValue.java | 10 +++---- .../classification/PrecisionMetric.java | 12 ++++----- .../classification/RecallMetric.java | 12 ++++----- .../evaluation/common/AucRocPoint.java | 12 ++++----- .../evaluation/common/AucRocResult.java | 14 +++++----- .../AbstractConfusionMatrixMetric.java | 6 ++--- .../outlierdetection/AucRocMetric.java | 10 +++---- .../ConfusionMatrixMetric.java | 14 +++++----- .../outlierdetection/OutlierDetection.java | 14 +++++----- .../outlierdetection/PrecisionMetric.java | 10 +++---- .../outlierdetection/RecallMetric.java | 10 +++---- .../evaluation/regression/HuberMetric.java | 12 ++++----- .../regression/MeanSquaredErrorMetric.java | 12 ++++----- .../MeanSquaredLogarithmicErrorMetric.java | 12 ++++----- .../evaluation/regression/RSquaredMetric.java | 12 ++++----- .../evaluation/regression/Regression.java | 14 +++++----- .../ml/dataframe/explain/FieldSelection.java | 8 +++--- .../dataframe/explain/MemoryEstimation.java | 12 ++++----- .../ml/dataframe/stats/AnalysisStats.java | 2 +- .../AnalysisStatsNamedXContentProvider.java | 2 +- .../classification/ClassificationStats.java | 10 +++---- .../stats/classification/Hyperparameters.java | 10 +++---- .../stats/classification/TimingStats.java | 8 +++--- .../stats/classification/ValidationLoss.java | 8 +++--- .../ml/dataframe/stats/common/DataCounts.java | 10 +++---- .../ml/dataframe/stats/common/FoldValues.java | 8 +++--- .../dataframe/stats/common/MemoryUsage.java | 10 +++---- .../OutlierDetectionStats.java | 10 +++---- .../stats/outlierdetection/Parameters.java | 10 +++---- .../stats/outlierdetection/TimingStats.java | 8 +++--- .../stats/regression/Hyperparameters.java | 10 +++---- .../stats/regression/RegressionStats.java | 10 +++---- .../stats/regression/TimingStats.java | 8 +++--- .../stats/regression/ValidationLoss.java | 8 +++--- .../InferenceToXContentCompressor.java | 10 +++---- .../MlInferenceNamedXContentProvider.java | 4 +-- .../ml/inference/NamedXContentObject.java | 2 +- .../inference/NamedXContentObjectHelper.java | 4 +-- .../ml/inference/TrainedModelConfig.java | 10 +++---- .../ml/inference/TrainedModelDefinition.java | 10 +++---- .../ml/inference/TrainedModelInput.java | 10 +++---- .../ml/inference/TrainedModelStats.java | 14 +++++----- .../preprocessing/CustomWordEmbedding.java | 12 ++++----- .../preprocessing/FrequencyEncoding.java | 10 +++---- .../ml/inference/preprocessing/Multi.java | 10 +++---- .../ml/inference/preprocessing/NGram.java | 8 +++--- .../preprocessing/OneHotEncoding.java | 10 +++---- .../preprocessing/TargetMeanEncoding.java | 10 +++---- .../inference/results/FeatureImportance.java | 18 ++++++------- .../ml/inference/results/TopClassEntry.java | 18 ++++++------- .../trainedmodel/ClassificationConfig.java | 12 ++++----- .../inference/trainedmodel/IndexLocation.java | 8 +++--- .../trainedmodel/InferenceStats.java | 10 +++---- .../trainedmodel/RegressionConfig.java | 12 ++++----- .../ml/inference/trainedmodel/TargetType.java | 2 +- .../trainedmodel/ensemble/Ensemble.java | 10 +++---- .../trainedmodel/ensemble/Exponent.java | 8 +++--- .../ensemble/LogisticRegression.java | 8 +++--- .../trainedmodel/ensemble/WeightedMode.java | 10 +++---- .../trainedmodel/ensemble/WeightedSum.java | 10 +++---- .../langident/LangIdentNeuralNetwork.java | 12 ++++----- .../trainedmodel/langident/LangNetLayer.java | 10 +++---- .../ml/inference/trainedmodel/tree/Tree.java | 8 +++--- .../inference/trainedmodel/tree/TreeNode.java | 10 +++---- .../client/ml/job/config/AnalysisConfig.java | 10 +++---- .../client/ml/job/config/AnalysisLimits.java | 12 ++++----- .../config/CategorizationAnalyzerConfig.java | 8 +++--- .../client/ml/job/config/DataDescription.java | 8 +++--- .../client/ml/job/config/DetectionRule.java | 8 +++--- .../client/ml/job/config/Detector.java | 8 +++--- .../client/ml/job/config/FilterRef.java | 8 +++--- .../client/ml/job/config/Job.java | 10 +++---- .../client/ml/job/config/JobUpdate.java | 10 +++---- .../client/ml/job/config/MlFilter.java | 8 +++--- .../client/ml/job/config/ModelPlotConfig.java | 8 +++--- .../client/ml/job/config/Operator.java | 2 +- .../PerPartitionCategorizationConfig.java | 10 +++---- .../client/ml/job/config/RuleCondition.java | 8 +++--- .../client/ml/job/config/RuleScope.java | 14 +++++----- .../client/ml/job/process/DataCounts.java | 10 +++---- .../client/ml/job/process/ModelSizeStats.java | 10 +++---- .../client/ml/job/process/ModelSnapshot.java | 10 +++---- .../client/ml/job/process/Quantiles.java | 10 +++---- .../client/ml/job/process/TimingStats.java | 14 +++++----- .../client/ml/job/results/AnomalyCause.java | 8 +++--- .../client/ml/job/results/AnomalyRecord.java | 10 +++---- .../client/ml/job/results/Bucket.java | 10 +++---- .../ml/job/results/BucketInfluencer.java | 10 +++---- .../ml/job/results/CategoryDefinition.java | 8 +++--- .../client/ml/job/results/Influence.java | 8 +++--- .../client/ml/job/results/Influencer.java | 10 +++---- .../client/ml/job/results/OverallBucket.java | 10 +++---- .../client/ml/job/results/Result.java | 2 +- .../client/ml/job/stats/ForecastStats.java | 10 +++---- .../client/ml/job/stats/JobStats.java | 10 +++---- .../client/ml/job/stats/SimpleStats.java | 8 +++--- .../client/rollup/GetRollupCapsResponse.java | 2 +- .../rollup/GetRollupIndexCapsResponse.java | 2 +- .../client/rollup/GetRollupJobResponse.java | 12 ++++----- .../client/rollup/PutRollupJobRequest.java | 4 +-- .../client/rollup/RollableIndexCaps.java | 10 +++---- .../client/rollup/RollupJobCaps.java | 12 ++++----- .../client/rollup/StartRollupJobResponse.java | 4 +-- .../client/rollup/StopRollupJobResponse.java | 4 +-- .../job/config/DateHistogramGroupConfig.java | 16 ++++++------ .../client/rollup/job/config/GroupConfig.java | 14 +++++----- .../job/config/HistogramGroupConfig.java | 12 ++++----- .../rollup/job/config/MetricConfig.java | 12 ++++----- .../rollup/job/config/RollupJobConfig.java | 16 ++++++------ .../rollup/job/config/TermsGroupConfig.java | 12 ++++----- .../CachesStatsResponse.java | 8 +++--- .../MountSnapshotRequest.java | 4 +-- .../client/security/AuthenticateResponse.java | 14 +++++----- .../security/ChangePasswordRequest.java | 4 +-- .../ClearPrivilegesCacheResponse.java | 4 +-- .../security/ClearRealmCacheResponse.java | 4 +-- .../security/ClearRolesCacheResponse.java | 4 +-- .../security/ClearSecurityCacheResponse.java | 4 +-- .../client/security/CreateApiKeyRequest.java | 4 +-- .../client/security/CreateApiKeyResponse.java | 10 +++---- .../CreateServiceAccountTokenResponse.java | 8 +++--- .../client/security/CreateTokenRequest.java | 4 +-- .../client/security/CreateTokenResponse.java | 10 +++---- .../DelegatePkiAuthenticationRequest.java | 4 +-- .../DelegatePkiAuthenticationResponse.java | 8 +++--- .../security/DeletePrivilegesResponse.java | 2 +- .../security/DeleteRoleMappingResponse.java | 8 +++--- .../client/security/DeleteRoleResponse.java | 8 +++--- .../DeleteServiceAccountTokenResponse.java | 4 +-- .../client/security/DeleteUserResponse.java | 4 +-- .../security/ExpressionRoleMapping.java | 12 ++++----- .../client/security/GetApiKeyRequest.java | 4 +-- .../client/security/GetApiKeyResponse.java | 8 +++--- .../GetBuiltinPrivilegesResponse.java | 8 +++--- .../security/GetPrivilegesResponse.java | 2 +- .../security/GetRoleMappingsResponse.java | 2 +- .../client/security/GetRolesResponse.java | 2 +- .../GetServiceAccountCredentialsResponse.java | 8 +++--- .../security/GetServiceAccountsResponse.java | 2 +- .../security/GetSslCertificatesResponse.java | 2 +- .../security/GetUserPrivilegesResponse.java | 8 +++--- .../client/security/GetUsersResponse.java | 12 ++++----- .../client/security/GrantApiKeyRequest.java | 6 ++--- .../client/security/HasPrivilegesRequest.java | 4 +-- .../security/HasPrivilegesResponse.java | 10 +++---- .../security/InvalidateApiKeyRequest.java | 4 +-- .../security/InvalidateApiKeyResponse.java | 10 +++---- .../security/InvalidateTokenRequest.java | 4 +-- .../security/InvalidateTokenResponse.java | 10 +++---- .../security/KibanaEnrollmentResponse.java | 8 +++--- .../security/NodeEnrollmentResponse.java | 6 ++--- .../client/security/PutPrivilegesRequest.java | 4 +-- .../security/PutPrivilegesResponse.java | 2 +- .../security/PutRoleMappingRequest.java | 4 +-- .../security/PutRoleMappingResponse.java | 8 +++--- .../client/security/PutRoleRequest.java | 4 +-- .../client/security/PutRoleResponse.java | 10 +++---- .../client/security/PutUserRequest.java | 4 +-- .../client/security/PutUserResponse.java | 8 +++--- .../client/security/QueryApiKeyRequest.java | 4 +-- .../client/security/QueryApiKeyResponse.java | 10 +++---- .../security/SecurityNodesResponse.java | 4 +-- ...erviceAccountCredentialsNodesResponse.java | 2 +- .../client/security/TemplateRoleName.java | 16 ++++++------ .../client/security/support/ApiKey.java | 12 ++++----- .../security/support/CertificateInfo.java | 8 +++--- .../expressiondsl/RoleMapperExpression.java | 2 +- .../CompositeRoleMapperExpression.java | 2 +- .../expressions/CompositeType.java | 2 +- .../ExceptRoleMapperExpression.java | 2 +- .../fields/FieldRoleMapperExpression.java | 2 +- .../parser/RoleMapperExpressionParser.java | 6 ++--- .../privileges/AbstractIndicesPrivileges.java | 14 +++++----- .../user/privileges/ApplicationPrivilege.java | 16 ++++++------ .../ApplicationResourcePrivileges.java | 14 +++++----- .../privileges/GlobalOperationPrivilege.java | 2 +- .../user/privileges/GlobalPrivileges.java | 12 ++++----- .../user/privileges/IndicesPrivileges.java | 14 +++++----- .../client/security/user/privileges/Role.java | 10 +++---- .../privileges/UserIndicesPrivileges.java | 8 +++--- ...xecuteSnapshotLifecyclePolicyResponse.java | 10 +++---- .../GetSnapshotLifecyclePolicyResponse.java | 6 ++--- .../GetSnapshotLifecycleStatsResponse.java | 6 ++--- .../PutSnapshotLifecyclePolicyRequest.java | 4 +-- .../client/slm/SnapshotInvocationRecord.java | 10 +++---- .../client/slm/SnapshotLifecyclePolicy.java | 10 +++---- .../slm/SnapshotLifecyclePolicyMetadata.java | 10 +++---- .../client/slm/SnapshotLifecycleStats.java | 12 ++++----- .../slm/SnapshotRetentionConfiguration.java | 10 +++---- .../client/tasks/CancelTasksResponse.java | 8 +++--- .../client/tasks/ElasticsearchException.java | 4 +-- .../client/tasks/GetTaskResponse.java | 8 +++--- .../elasticsearch/client/tasks/NodeData.java | 6 ++--- .../elasticsearch/client/tasks/TaskInfo.java | 6 ++--- .../client/tasks/TaskOperationFailure.java | 8 +++--- .../client/tasks/TaskSubmissionResponse.java | 6 ++--- .../textstructure/FindStructureRequest.java | 6 ++--- .../textstructure/FindStructureResponse.java | 6 ++--- .../structurefinder/FieldStats.java | 10 +++---- .../structurefinder/TextStructure.java | 10 +++---- .../transform/AcknowledgedTasksResponse.java | 8 +++--- .../transform/GetTransformResponse.java | 10 +++---- .../transform/GetTransformStatsResponse.java | 10 +++---- .../transform/PreviewTransformRequest.java | 6 ++--- .../transform/PreviewTransformResponse.java | 8 +++--- .../client/transform/PutTransformRequest.java | 4 +-- .../transform/StartTransformResponse.java | 4 +-- .../transform/StopTransformResponse.java | 4 +-- .../TransformNamedXContentProvider.java | 4 +-- .../transform/UpdateTransformRequest.java | 4 +-- .../transform/UpdateTransformResponse.java | 2 +- .../transform/transforms/DestConfig.java | 12 ++++----- .../transform/transforms/NodeAttributes.java | 10 +++---- .../transform/transforms/QueryConfig.java | 6 ++--- .../transforms/RetentionPolicyConfig.java | 2 +- .../transform/transforms/SettingsConfig.java | 14 +++++----- .../transform/transforms/SourceConfig.java | 12 ++++----- .../transform/transforms/SyncConfig.java | 2 +- .../transforms/TimeRetentionPolicyConfig.java | 12 ++++----- .../transform/transforms/TimeSyncConfig.java | 14 +++++----- .../transforms/TransformCheckpointStats.java | 8 +++--- .../TransformCheckpointingInfo.java | 8 +++--- .../transform/transforms/TransformConfig.java | 16 ++++++------ .../transforms/TransformConfigUpdate.java | 10 +++---- .../transforms/TransformIndexerPosition.java | 10 +++---- .../transforms/TransformIndexerStats.java | 8 +++--- .../transforms/TransformProgress.java | 8 +++--- .../transform/transforms/TransformStats.java | 12 ++++----- .../transforms/latest/LatestConfig.java | 12 ++++----- .../transforms/pivot/AggregationConfig.java | 6 ++--- .../pivot/DateHistogramGroupSource.java | 16 ++++++------ .../transforms/pivot/GeoTileGroupSource.java | 14 +++++----- .../transforms/pivot/GroupConfig.java | 6 ++--- .../pivot/HistogramGroupSource.java | 14 +++++----- .../transforms/pivot/PivotConfig.java | 14 +++++----- .../transforms/pivot/SingleGroupSource.java | 6 ++--- .../transforms/pivot/TermsGroupSource.java | 12 ++++----- .../client/watcher/AckWatchResponse.java | 6 ++--- .../client/watcher/ActionStatus.java | 4 +-- .../client/watcher/ActivateWatchResponse.java | 6 ++--- .../watcher/DeactivateWatchResponse.java | 6 ++--- .../client/watcher/DeleteWatchResponse.java | 6 ++--- .../client/watcher/ExecuteWatchRequest.java | 6 ++--- .../client/watcher/ExecuteWatchResponse.java | 18 ++++++------- .../client/watcher/GetWatchResponse.java | 10 +++---- .../client/watcher/PutWatchRequest.java | 2 +- .../client/watcher/PutWatchResponse.java | 6 ++--- .../client/watcher/QueuedWatch.java | 4 +-- .../watcher/WatchExecutionSnapshot.java | 4 +-- .../client/watcher/WatchStatus.java | 4 +-- .../client/watcher/WatchStatusDateParser.java | 2 +- .../client/watcher/WatcherStatsResponse.java | 6 ++--- .../client/xpack/XPackInfoResponse.java | 12 ++++----- .../client/xpack/XPackUsageResponse.java | 2 +- .../GeoIpStatsResponseTests.java | 2 +- .../client/AbstractRequestTestCase.java | 12 ++++----- .../client/AbstractResponseTestCase.java | 12 ++++----- .../elasticsearch/client/BulkProcessorIT.java | 6 ++--- .../client/BulkProcessorRetryIT.java | 2 +- .../BulkRequestWithGlobalParametersIT.java | 2 +- .../java/org/elasticsearch/client/CCRIT.java | 2 +- .../elasticsearch/client/ClusterClientIT.java | 2 +- .../java/org/elasticsearch/client/CrudIT.java | 6 ++--- .../CustomRestHighLevelClientTests.java | 2 +- .../client/ESRestHighLevelClientTestCase.java | 8 +++--- .../java/org/elasticsearch/client/EqlIT.java | 2 +- .../client/GetAliasesResponseTests.java | 4 +-- .../client/GraphRequestConvertersTests.java | 2 +- .../elasticsearch/client/IndicesClientIT.java | 6 ++--- .../client/IndicesRequestConvertersTests.java | 2 +- .../elasticsearch/client/IngestClientIT.java | 4 +-- .../client/IngestRequestConvertersTests.java | 2 +- .../org/elasticsearch/client/LicenseIT.java | 6 ++--- .../client/MLRequestConvertersTests.java | 12 ++++----- .../client/MachineLearningGetResultsIT.java | 2 +- .../client/MachineLearningIT.java | 8 +++--- .../client/NodesResponseHeaderTestUtils.java | 4 +-- .../org/elasticsearch/client/ReindexIT.java | 2 +- .../client/RequestConvertersTests.java | 10 +++---- .../client/RestHighLevelClientExtTests.java | 6 ++--- .../client/RestHighLevelClientTests.java | 16 ++++++------ .../org/elasticsearch/client/RollupIT.java | 2 +- .../org/elasticsearch/client/SearchIT.java | 8 +++--- .../client/SearchableSnapshotsIT.java | 2 +- .../org/elasticsearch/client/SnapshotIT.java | 2 +- .../elasticsearch/client/StoredScriptsIT.java | 2 +- .../org/elasticsearch/client/TasksIT.java | 2 +- .../org/elasticsearch/client/TransformIT.java | 6 ++--- .../TransformRequestConvertersTests.java | 6 ++--- .../elasticsearch/client/UpdateByQueryIT.java | 2 +- .../org/elasticsearch/client/WatcherIT.java | 4 +-- .../client/WatcherRequestConvertersTests.java | 2 +- .../client/XPackInfoResponseTests.java | 4 +-- .../client/analytics/AnalyticsAggsIT.java | 2 +- .../client/analytics/InferenceAggIT.java | 2 +- .../asyncsearch/AsyncSearchResponseTests.java | 4 +-- .../client/ccr/CcrStatsResponseTests.java | 4 +-- .../client/ccr/FollowConfigTests.java | 2 +- .../client/ccr/FollowInfoResponseTests.java | 4 +-- .../client/ccr/FollowStatsResponseTests.java | 4 +-- .../GetAutoFollowPatternResponseTests.java | 4 +-- .../ccr/PutAutoFollowPatternRequestTests.java | 2 +- .../client/ccr/PutFollowRequestTests.java | 2 +- .../client/ccr/PutFollowResponseTests.java | 4 +-- .../client/ccr/ResumeFollowRequestTests.java | 2 +- .../cluster/RemoteInfoResponseTests.java | 4 +-- .../core/AcknowledgedResponseTests.java | 6 ++--- .../client/core/BroadcastResponseTests.java | 4 +-- .../client/core/CountRequestTests.java | 4 +-- .../client/core/CountResponseTests.java | 4 +-- .../client/core/GetSourceResponseTests.java | 8 +++--- .../client/core/MainResponseTests.java | 4 +-- .../core/MultiTermVectorsResponseTests.java | 2 +- .../core/ShardsAcknowledgedResponseTests.java | 2 +- .../client/core/TermVectorsResponseTests.java | 2 +- .../core/tasks/GetTaskResponseTests.java | 4 +-- .../documentation/CRUDDocumentationIT.java | 8 +++--- .../ClusterClientDocumentationIT.java | 2 +- .../IndicesClientDocumentationIT.java | 6 ++--- .../IngestClientDocumentationIT.java | 2 +- .../MigrationDocumentationIT.java | 2 +- .../MlClientDocumentationIT.java | 6 ++--- .../documentation/RollupDocumentationIT.java | 2 +- .../documentation/SearchDocumentationIT.java | 4 +-- .../SearchableSnapshotsDocumentationIT.java | 2 +- .../SnapshotClientDocumentationIT.java | 2 +- .../StoredScriptsDocumentationIT.java | 6 ++--- .../TransformDocumentationIT.java | 4 +-- .../documentation/WatcherDocumentationIT.java | 4 +-- .../enrich/ExecutePolicyResponseTests.java | 4 +-- .../client/enrich/GetPolicyResponseTests.java | 6 ++--- .../client/enrich/PutPolicyRequestTests.java | 4 +-- .../client/enrich/StatsResponseTests.java | 4 +-- .../client/eql/EqlSearchRequestTests.java | 4 +-- .../client/eql/EqlSearchResponseTests.java | 10 +++---- .../client/eql/EqlStatsResponseTests.java | 4 +-- .../eql/EqlStatsResponseToXContent.java | 4 +-- .../graph/GraphExploreResponseTests.java | 4 +-- .../client/ilm/AllocateActionTests.java | 2 +- .../client/ilm/DeleteActionTests.java | 2 +- .../ilm/ExplainLifecycleResponseTests.java | 6 ++--- .../client/ilm/ForceMergeActionTests.java | 8 +++--- .../client/ilm/FreezeActionTests.java | 2 +- .../ilm/GetLifecyclePolicyResponseTests.java | 6 ++--- .../IndexLifecycleExplainResponseTests.java | 10 +++---- ...ifecycleManagementStatusResponseTests.java | 10 +++---- .../ilm/LifecyclePolicyMetadataTests.java | 6 ++--- .../client/ilm/LifecyclePolicyTests.java | 6 ++--- .../client/ilm/MigrateActionTests.java | 2 +- .../client/ilm/PhaseExecutionInfoTests.java | 6 ++--- .../elasticsearch/client/ilm/PhaseTests.java | 6 ++--- .../client/ilm/ReadOnlyActionTests.java | 2 +- ...moveIndexLifecyclePolicyResponseTests.java | 2 +- .../client/ilm/RolloverActionTests.java | 2 +- .../ilm/SearchableSnapshotActionTests.java | 2 +- .../client/ilm/SetPriorityActionTests.java | 2 +- .../client/ilm/ShrinkActionTests.java | 2 +- .../client/ilm/UnfollowActionTests.java | 2 +- .../ilm/WaitForSnapshotActionTests.java | 2 +- .../indices/AnalyzeGlobalRequestTests.java | 2 +- .../indices/AnalyzeIndexRequestTests.java | 2 +- .../client/indices/AnalyzeResponseTests.java | 4 +-- .../indices/CloseIndexResponseTests.java | 10 +++---- .../indices/CreateIndexRequestTests.java | 2 +- .../DataStreamsStatsResponseTests.java | 4 +-- .../GetComponentTemplatesResponseTests.java | 2 +- ...ComposableIndexTemplatesResponseTests.java | 2 +- .../indices/GetDataStreamResponseTests.java | 4 +-- .../GetFieldMappingsResponseTests.java | 2 +- .../client/indices/GetIndexResponseTests.java | 4 +-- .../GetIndexTemplatesResponseTests.java | 14 +++++----- .../indices/GetMappingsResponseTests.java | 4 +-- .../indices/PutIndexTemplateRequestTests.java | 6 ++--- .../indices/PutMappingRequestTests.java | 4 +-- .../indices/RandomCreateIndexGenerator.java | 4 +-- .../indices/ReloadAnalyzersResponseTests.java | 4 +-- .../client/indices/ResizeRequestTests.java | 2 +- .../client/indices/ResizeResponseTests.java | 4 +-- .../rollover/RolloverResponseTests.java | 2 +- .../license/GetBasicStatusResponseTests.java | 4 +-- .../license/GetTrialStatusResponseTests.java | 4 +-- .../license/PutLicenseResponseTests.java | 4 +-- .../license/StartBasicResponseTests.java | 4 +-- .../DeprecationInfoResponseTests.java | 2 +- .../GetFeatureUpgradeStatusResponseTests.java | 4 +-- .../PostFeatureUpgradeResponseTests.java | 4 +-- .../client/ml/CloseJobRequestTests.java | 2 +- .../client/ml/CloseJobResponseTests.java | 2 +- .../ml/DeleteExpiredDataRequestTests.java | 8 +++--- .../ml/DeleteExpiredDataResponseTests.java | 2 +- .../client/ml/DeleteForecastRequestTests.java | 2 +- .../client/ml/DeleteJobResponseTests.java | 2 +- .../ml/EvaluateDataFrameRequestTests.java | 4 +-- .../ml/EvaluateDataFrameResponseTests.java | 4 +-- ...xplainDataFrameAnalyticsResponseTests.java | 2 +- .../client/ml/FlushJobRequestTests.java | 2 +- .../client/ml/FlushJobResponseTests.java | 2 +- .../client/ml/ForecastJobRequestTests.java | 2 +- .../client/ml/ForecastJobResponseTests.java | 2 +- .../client/ml/GetBucketsRequestTests.java | 2 +- .../client/ml/GetBucketsResponseTests.java | 2 +- .../ml/GetCalendarEventsRequestTests.java | 2 +- .../ml/GetCalendarEventsResponseTests.java | 2 +- .../client/ml/GetCalendarsRequestTests.java | 2 +- .../client/ml/GetCalendarsResponseTests.java | 2 +- .../client/ml/GetCategoriesRequestTests.java | 2 +- .../client/ml/GetCategoriesResponseTests.java | 2 +- .../client/ml/GetDatafeedRequestTests.java | 2 +- .../client/ml/GetDatafeedResponseTests.java | 2 +- .../ml/GetDatafeedStatsRequestTests.java | 2 +- .../ml/GetDatafeedStatsResponseTests.java | 2 +- .../client/ml/GetFiltersRequestTests.java | 2 +- .../client/ml/GetFiltersResponseTests.java | 2 +- .../client/ml/GetInfluencersRequestTests.java | 2 +- .../ml/GetInfluencersResponseTests.java | 2 +- .../client/ml/GetJobRequestTests.java | 2 +- .../client/ml/GetJobResponseTests.java | 2 +- .../client/ml/GetJobStatsRequestTests.java | 2 +- .../client/ml/GetJobStatsResponseTests.java | 2 +- .../ml/GetModelSnapshotsRequestTests.java | 2 +- .../ml/GetModelSnapshotsResponseTests.java | 2 +- .../ml/GetOverallBucketsRequestTests.java | 2 +- .../ml/GetOverallBucketsResponseTests.java | 2 +- .../client/ml/GetRecordsRequestTests.java | 2 +- .../client/ml/GetRecordsResponseTests.java | 2 +- .../client/ml/MlInfoActionResponseTests.java | 4 +-- .../client/ml/NodeAttributesTests.java | 2 +- .../client/ml/OpenJobRequestTests.java | 2 +- .../client/ml/OpenJobResponseTests.java | 2 +- .../ml/PostCalendarEventRequestTests.java | 2 +- .../ml/PostCalendarEventResponseTests.java | 2 +- .../client/ml/PostDataRequestTests.java | 4 +-- .../client/ml/PostDataResponseTests.java | 2 +- .../ml/PreviewDatafeedRequestTests.java | 2 +- .../ml/PreviewDatafeedResponseTests.java | 4 +-- .../ml/PutCalendarActionResponseTests.java | 4 +-- .../client/ml/PutCalendarRequestTests.java | 2 +- .../client/ml/PutCalendarResponseTests.java | 2 +- .../ml/PutDataFrameAnalyticsRequestTests.java | 4 +-- .../client/ml/PutDatafeedRequestTests.java | 2 +- .../client/ml/PutDatafeedResponseTests.java | 2 +- .../client/ml/PutFilterRequestTests.java | 2 +- .../client/ml/PutFilterResponseTests.java | 2 +- .../client/ml/PutJobRequestTests.java | 2 +- .../client/ml/PutJobResponseTests.java | 2 +- .../ml/PutTrainedModelActionRequestTests.java | 4 +-- .../PutTrainedModelActionResponseTests.java | 4 +-- .../ml/RevertModelSnapshotRequestTests.java | 2 +- .../ml/RevertModelSnapshotResponseTests.java | 2 +- .../StartDataFrameAnalyticsResponseTests.java | 2 +- .../client/ml/StartDatafeedRequestTests.java | 2 +- .../client/ml/StartDatafeedResponseTests.java | 2 +- .../StopDataFrameAnalyticsResponseTests.java | 2 +- .../client/ml/StopDatafeedRequestTests.java | 2 +- .../client/ml/StopDatafeedResponseTests.java | 2 +- .../UpdateDataFrameAnalyticsRequestTests.java | 4 +-- .../client/ml/UpdateDatafeedRequestTests.java | 2 +- .../client/ml/UpdateFilterRequestTests.java | 2 +- .../client/ml/UpdateJobRequestTests.java | 2 +- .../ml/UpdateModelSnapshotRequestTests.java | 2 +- .../ml/UpdateModelSnapshotResponseTests.java | 2 +- .../UpgradeJobModelSnapshotRequestTests.java | 2 +- .../UpgradeJobModelSnapshotResponseTests.java | 2 +- .../client/ml/calendars/CalendarTests.java | 2 +- .../ml/calendars/ScheduledEventTests.java | 2 +- .../ml/datafeed/ChunkingConfigTests.java | 2 +- .../ml/datafeed/DatafeedConfigTests.java | 10 +++---- .../ml/datafeed/DatafeedStatsTests.java | 2 +- .../ml/datafeed/DatafeedTimingStatsTests.java | 8 +++--- .../ml/datafeed/DatafeedUpdateTests.java | 2 +- .../datafeed/DelayedDataCheckConfigTests.java | 2 +- .../ml/dataframe/ClassificationTests.java | 4 +-- .../DataFrameAnalyticsConfigTests.java | 4 +-- .../DataFrameAnalyticsConfigUpdateTests.java | 4 +-- .../DataFrameAnalyticsDestTests.java | 2 +- .../DataFrameAnalyticsSourceTests.java | 4 +-- .../DataFrameAnalyticsStatsTests.java | 4 +-- .../ml/dataframe/OutlierDetectionTests.java | 2 +- .../ml/dataframe/PhaseProgressTests.java | 2 +- .../client/ml/dataframe/QueryConfigTests.java | 4 +-- .../client/ml/dataframe/RegressionTests.java | 4 +-- .../AccuracyMetricResultTests.java | 4 +-- .../classification/AccuracyMetricTests.java | 4 +-- .../classification/AucRocMetricTests.java | 4 +-- .../classification/ClassificationTests.java | 4 +-- ...classConfusionMatrixMetricResultTests.java | 4 +-- .../MulticlassConfusionMatrixMetricTests.java | 4 +-- .../PerClassSingleValueTests.java | 2 +- .../PrecisionMetricResultTests.java | 4 +-- .../classification/PrecisionMetricTests.java | 4 +-- .../RecallMetricResultTests.java | 4 +-- .../classification/RecallMetricTests.java | 4 +-- .../evaluation/common/AucRocPointTests.java | 2 +- .../evaluation/common/AucRocResultTests.java | 2 +- .../outlierdetection/AucRocMetricTests.java | 4 +-- ...usionMatrixMetricConfusionMatrixTests.java | 2 +- .../ConfusionMatrixMetricResultTests.java | 2 +- .../OutlierDetectionTests.java | 4 +-- .../PrecisionMetricResultTests.java | 2 +- .../RecallMetricResultTests.java | 2 +- .../regression/HuberMetricResultTests.java | 4 +-- .../regression/HuberMetricTests.java | 4 +-- .../MeanSquaredErrorMetricResultTests.java | 4 +-- .../MeanSquaredErrorMetricTests.java | 4 +-- ...aredLogarithmicErrorMetricResultTests.java | 4 +-- ...eanSquaredLogarithmicErrorMetricTests.java | 4 +-- .../regression/RSquaredMetricResultTests.java | 4 +-- .../regression/RSquaredMetricTests.java | 4 +-- .../regression/RegressionTests.java | 4 +-- .../explain/FieldSelectionTests.java | 2 +- .../explain/MemoryEstimationTests.java | 2 +- .../ClassificationStatsTests.java | 2 +- .../classification/HyperparametersTests.java | 2 +- .../classification/TimingStatsTests.java | 2 +- .../classification/ValidationLossTests.java | 2 +- .../stats/common/DataCountsTests.java | 2 +- .../stats/common/FoldValuesTests.java | 2 +- .../stats/common/MemoryUsageTests.java | 2 +- .../OutlierDetectionStatsTests.java | 2 +- .../outlierdetection/ParametersTests.java | 2 +- .../outlierdetection/TimingStatsTests.java | 2 +- .../regression/HyperparametersTests.java | 2 +- .../regression/RegressionStatsTests.java | 2 +- .../stats/regression/TimingStatsTests.java | 2 +- .../stats/regression/ValidationLossTests.java | 2 +- .../ml/inference/IndexLocationTests.java | 2 +- .../InferenceToXContentCompressorTests.java | 6 ++--- .../NamedXContentObjectHelperTests.java | 12 ++++----- .../ml/inference/TrainedModelConfigTests.java | 4 +-- .../TrainedModelDefinitionTests.java | 4 +-- .../ml/inference/TrainedModelInputTests.java | 2 +- .../ml/inference/TrainedModelStatsTests.java | 8 +++--- .../CustomWordEmbeddingTests.java | 2 +- .../preprocessing/FrequencyEncodingTests.java | 2 +- .../inference/preprocessing/MultiTests.java | 4 +-- .../inference/preprocessing/NGramTests.java | 2 +- .../preprocessing/OneHotEncodingTests.java | 2 +- .../TargetMeanEncodingTests.java | 2 +- .../results/FeatureImportanceTests.java | 2 +- .../inference/results/TopClassEntryTests.java | 2 +- .../ClassificationConfigTests.java | 2 +- .../trainedmodel/InferenceStatsTests.java | 2 +- .../trainedmodel/RegressionConfigTests.java | 2 +- .../trainedmodel/ensemble/EnsembleTests.java | 4 +-- .../trainedmodel/ensemble/ExponentTests.java | 2 +- .../ensemble/LogisticRegressionTests.java | 2 +- .../ensemble/WeightedModeTests.java | 2 +- .../ensemble/WeightedSumTests.java | 2 +- .../LangIdentNeuralNetworkTests.java | 4 +-- .../langident/LangNetLayerTests.java | 2 +- .../trainedmodel/tree/TreeNodeTests.java | 2 +- .../trainedmodel/tree/TreeTests.java | 2 +- .../ml/job/config/AnalysisConfigTests.java | 4 +-- .../ml/job/config/AnalysisLimitsTests.java | 10 +++---- .../CategorizationAnalyzerConfigTests.java | 2 +- .../ml/job/config/DataDescriptionTests.java | 2 +- .../ml/job/config/DetectionRuleTests.java | 2 +- .../client/ml/job/config/DetectorTests.java | 2 +- .../client/ml/job/config/FilterRefTests.java | 2 +- .../client/ml/job/config/JobTests.java | 10 +++---- .../client/ml/job/config/JobUpdateTests.java | 2 +- .../client/ml/job/config/MlFilterTests.java | 2 +- .../ml/job/config/ModelPlotConfigTests.java | 2 +- ...PerPartitionCategorizationConfigTests.java | 2 +- .../ml/job/config/RuleConditionTests.java | 2 +- .../client/ml/job/config/RuleScopeTests.java | 2 +- .../ml/job/process/DataCountsTests.java | 2 +- .../ml/job/process/ModelSizeStatsTests.java | 2 +- .../ml/job/process/ModelSnapshotTests.java | 2 +- .../client/ml/job/process/QuantilesTests.java | 2 +- .../ml/job/process/TimingStatsTests.java | 8 +++--- .../ml/job/results/AnomalyCauseTests.java | 2 +- .../ml/job/results/AnomalyRecordTests.java | 2 +- .../ml/job/results/BucketInfluencerTests.java | 2 +- .../client/ml/job/results/BucketTests.java | 2 +- .../job/results/CategoryDefinitionTests.java | 2 +- .../client/ml/job/results/InfluenceTests.java | 2 +- .../ml/job/results/InfluencerTests.java | 4 +-- .../ml/job/results/OverallBucketTests.java | 2 +- .../ml/job/stats/ForecastStatsTests.java | 2 +- .../client/ml/job/stats/JobStatsTests.java | 2 +- .../client/ml/job/stats/SimpleStatsTests.java | 2 +- .../client/ml/util/PageParamsTests.java | 2 +- .../rollup/GetRollupCapsResponseTests.java | 4 +-- .../GetRollupIndexCapsResponseTests.java | 4 +-- .../rollup/GetRollupJobResponseTests.java | 4 +-- .../rollup/PutRollupJobRequestTests.java | 2 +- .../rollup/RollupCapsResponseTestCase.java | 4 +-- .../config/DateHistogramGroupConfigTests.java | 2 +- .../rollup/job/config/GroupConfigTests.java | 2 +- .../job/config/HistogramGroupConfigTests.java | 2 +- .../rollup/job/config/MetricConfigTests.java | 2 +- .../job/config/RollupJobConfigTests.java | 2 +- .../job/config/TermsGroupConfigTests.java | 2 +- .../security/AuthenticateResponseTests.java | 4 +-- .../ClearRealmCacheResponseTests.java | 8 +++--- .../ClearRolesCacheResponseTests.java | 8 +++--- .../security/CreateApiKeyRequestTests.java | 2 +- .../security/CreateApiKeyResponseTests.java | 6 ++--- ...reateServiceAccountTokenResponseTests.java | 4 +-- .../security/CreateTokenResponseTests.java | 6 ++--- ...DelegatePkiAuthenticationRequestTests.java | 2 +- ...elegatePkiAuthenticationResponseTests.java | 4 +-- .../DeleteRoleMappingResponseTests.java | 6 ++--- .../security/DeleteRoleResponseTests.java | 10 +++---- ...eleteServiceAccountTokenResponseTests.java | 4 +-- .../security/DeleteUserResponseTests.java | 10 +++---- .../security/ExpressionRoleMappingTests.java | 6 ++--- .../security/GetApiKeyResponseTests.java | 6 ++--- .../security/GetPrivilegesResponseTests.java | 6 ++--- .../GetRoleMappingsResponseTests.java | 6 ++--- .../security/GetRolesResponseTests.java | 6 ++--- ...erviceAccountCredentialsResponseTests.java | 4 +-- .../GetServiceAccountsResponseTests.java | 4 +-- .../GetSslCertificatesResponseTests.java | 2 +- .../GetUserPrivilegesResponseTests.java | 4 +-- .../security/GetUsersResponseTests.java | 6 ++--- .../security/GrantApiKeyRequestTests.java | 8 +++--- .../security/HasPrivilegesRequestTests.java | 2 +- .../security/HasPrivilegesResponseTests.java | 4 +-- .../InvalidateApiKeyResponseTests.java | 8 +++--- .../InvalidateTokenResponseTests.java | 10 +++---- .../KibanaEnrollmentResponseTests.java | 6 ++--- .../security/PutPrivilegesRequestTests.java | 6 ++--- .../security/PutPrivilegesResponseTests.java | 2 +- .../security/PutRoleMappingRequestTests.java | 6 ++--- .../client/security/PutRoleRequestTests.java | 2 +- .../client/security/PutUserRequestTests.java | 2 +- .../security/QueryApiKeyResponseTests.java | 4 +-- .../hlrc/HasPrivilegesResponseTests.java | 8 +++--- .../RoleMapperExpressionDslTests.java | 6 ++--- .../RoleMapperExpressionParserTests.java | 12 ++++----- .../privileges/ApplicationPrivilegeTests.java | 12 ++++----- .../ApplicationResourcePrivilegesTests.java | 2 +- .../privileges/GlobalPrivilegesTests.java | 2 +- .../privileges/IndicesPrivilegesTests.java | 2 +- .../snapshots/GetFeaturesResponseTests.java | 4 +-- .../snapshots/ResetFeaturesResponseTests.java | 4 +-- .../tasks/CancelTasksResponseTests.java | 6 ++--- .../tasks/ElasticsearchExceptionTests.java | 4 +-- .../tasks/TaskSubmissionResponseTests.java | 2 +- .../FindStructureRequestTests.java | 4 +-- .../FindStructureResponseTests.java | 2 +- .../structurefinder/FieldStatsTests.java | 2 +- .../structurefinder/TextStructureTests.java | 2 +- .../AcknowledgedTasksResponseTests.java | 6 ++--- .../transform/GetTransformResponseTests.java | 4 +-- .../GetTransformStatsResponseTests.java | 2 +- .../PreviewTransformRequestTests.java | 10 +++---- .../PreviewTransformResponseTests.java | 10 +++---- .../transform/PutTransformRequestTests.java | 4 +-- ...UpdateDataFrameTransformResponseTests.java | 4 +-- .../UpdateTransformRequestTests.java | 4 +-- .../hlrc/GetTransformStatsResponseTests.java | 4 +-- .../hlrc/PreviewTransformResponseTests.java | 4 +-- .../transform/transforms/DestConfigTests.java | 2 +- .../transforms/NodeAttributesTests.java | 2 +- .../transforms/QueryConfigTests.java | 4 +-- .../transforms/SettingsConfigTests.java | 12 ++++----- .../transforms/SourceConfigTests.java | 4 +-- .../TimeRetentionPolicyConfigTests.java | 2 +- .../transforms/TimeSyncConfigTests.java | 2 +- .../TransformCheckpointStatsTests.java | 2 +- .../TransformCheckpointingInfoTests.java | 2 +- .../transforms/TransformConfigTests.java | 4 +-- .../TransformConfigUpdateTests.java | 4 +-- .../TransformIndexerPositionTests.java | 2 +- .../TransformIndexerStatsTests.java | 2 +- .../transforms/TransformProgressTests.java | 2 +- .../transforms/TransformStatsTests.java | 4 +-- .../transforms/hlrc/SettingsConfigTests.java | 4 +-- .../hlrc/TimeRetentionPolicyConfigTests.java | 4 +-- .../transforms/hlrc/TimeSyncConfigTests.java | 4 +-- .../hlrc/TransformCheckpointStatsTests.java | 4 +-- .../hlrc/TransformCheckpointingInfoTests.java | 4 +-- .../hlrc/TransformIndexerPositionTests.java | 4 +-- .../hlrc/TransformIndexerStatsTests.java | 4 +-- .../hlrc/TransformProgressTests.java | 4 +-- .../transforms/hlrc/TransformStatsTests.java | 4 +-- .../transforms/latest/LatestConfigTests.java | 2 +- .../latest/hlrc/LatestConfigTests.java | 4 +-- .../pivot/AggregationConfigTests.java | 4 +-- .../pivot/DateHistogramGroupSourceTests.java | 2 +- .../pivot/GeoTileGroupSourceTests.java | 2 +- .../transforms/pivot/GroupConfigTests.java | 8 +++--- .../pivot/HistogramGroupSourceTests.java | 2 +- .../transforms/pivot/PivotConfigTests.java | 4 +-- .../pivot/TermsGroupSourceTests.java | 2 +- .../hlrc/DateHistogramGroupSourceTests.java | 10 +++---- .../pivot/hlrc/GeoTileGroupSourceTests.java | 4 +-- .../pivot/hlrc/HistogramGroupSourceTests.java | 4 +-- .../pivot/hlrc/TermsGroupSourceTests.java | 4 +-- .../client/watcher/AckWatchResponseTests.java | 12 ++++----- .../watcher/ActivateWatchResponseTests.java | 12 ++++----- .../watcher/DeactivateWatchResponseTests.java | 10 +++---- .../watcher/DeleteWatchResponseTests.java | 2 +- .../client/watcher/GetWatchResponseTests.java | 8 +++--- .../client/watcher/PutWatchResponseTests.java | 2 +- .../VerifyRepositoryResponseTests.java | 4 +-- .../watcher/WatchRequestValidationTests.java | 2 +- .../client/watcher/WatchStatusTests.java | 10 +++---- .../watcher/WatcherStatsResponseTests.java | 2 +- .../hlrc/DeleteWatchResponseTests.java | 4 +-- .../hlrc/ExecuteWatchResponseTests.java | 8 +++--- .../watcher/hlrc/PutWatchResponseTests.java | 4 +-- .../org/elasticsearch/geoip/GeoIpCli.java | 4 +-- .../elasticsearch/geoip/GeoIpCliTests.java | 8 +++--- .../smoketest/DocsClientYamlTestSuiteIT.java | 14 +++++----- .../xcontent/AbstractObjectParser.java | 7 ++--- .../xcontent/ConstructingObjectParser.java | 6 ++--- .../{common => }/xcontent/ContextParser.java | 2 +- .../xcontent/DeprecationHandler.java | 2 +- .../{common => }/xcontent/ErrorOnUnknown.java | 2 +- .../xcontent/FilterXContentParser.java | 2 +- .../xcontent/InstantiatingObjectParser.java | 2 +- .../{common => }/xcontent/MediaType.java | 2 +- .../xcontent/MediaTypeRegistry.java | 2 +- .../NamedObjectNotFoundException.java | 2 +- .../xcontent/NamedXContentRegistry.java | 2 +- .../{common => }/xcontent/ObjectParser.java | 16 ++++++------ .../{common => }/xcontent/ObjectPath.java | 2 +- .../{common => }/xcontent/ParseField.java | 2 +- .../xcontent/ParsedMediaType.java | 2 +- .../xcontent/ParserConstructor.java | 2 +- .../{common => }/xcontent/ToXContent.java | 2 +- .../xcontent/ToXContentFragment.java | 2 +- .../xcontent/ToXContentObject.java | 2 +- .../{common => }/xcontent/XContent.java | 4 +-- .../xcontent/XContentBuilder.java | 6 ++--- .../xcontent/XContentBuilderExtension.java | 2 +- .../xcontent/XContentFactory.java | 24 ++++++++--------- .../xcontent/XContentGenerator.java | 2 +- .../xcontent/XContentLocation.java | 2 +- .../xcontent/XContentParseException.java | 2 +- .../{common => }/xcontent/XContentParser.java | 2 +- .../xcontent/XContentSubParser.java | 2 +- .../{common => }/xcontent/XContentType.java | 12 ++++----- .../{common => }/xcontent/XContentUtils.java | 2 +- .../xcontent/cbor/CborXContent.java | 20 +++++++------- .../xcontent/cbor/CborXContentGenerator.java | 6 ++--- .../xcontent/cbor/CborXContentParser.java | 12 ++++----- .../xcontent/json/JsonXContent.java | 18 ++++++------- .../xcontent/json/JsonXContentGenerator.java | 18 ++++++------- .../xcontent/json/JsonXContentParser.java | 16 ++++++------ .../xcontent/smile/SmileXContent.java | 18 ++++++------- .../smile/SmileXContentGenerator.java | 6 ++--- .../xcontent/smile/SmileXContentParser.java | 12 ++++----- .../support/AbstractXContentParser.java | 10 +++---- .../xcontent/support/MapXContentParser.java | 12 ++++----- .../support/filtering/FilterPath.java | 12 ++++----- .../filtering/FilterPathBasedFilter.java | 2 +- .../xcontent/yaml/YamlXContent.java | 18 ++++++------- .../xcontent/yaml/YamlXContentGenerator.java | 6 ++--- .../xcontent/yaml/YamlXContentParser.java | 12 ++++----- .../ConstructingObjectParserTests.java | 10 +++---- .../InstantiatingObjectParserTests.java | 9 ++++--- .../xcontent/MapXContentParserTests.java | 9 ++++--- .../xcontent/ObjectParserTests.java | 9 ++++--- .../xcontent/ObjectPathTests.java | 3 ++- .../{common => xcontent}/ParseFieldTests.java | 8 +++--- .../xcontent/ParsedMediaTypeTests.java | 4 ++- .../{common => }/xcontent/SimpleStruct.java | 4 +-- .../xcontent/XContentParserTests.java | 4 +-- .../ArrayValuesSourceAggregationBuilder.java | 4 +-- .../matrix/ArrayValuesSourceParser.java | 4 +-- .../spi/MatrixStatsNamedXContentProvider.java | 6 ++--- .../matrix/stats/InternalMatrixStats.java | 2 +- .../stats/MatrixStatsAggregationBuilder.java | 4 +-- .../matrix/stats/MatrixStatsParser.java | 4 +-- .../matrix/stats/ParsedMatrixStats.java | 8 +++--- .../stats/InternalMatrixStatsTests.java | 6 ++--- .../ASCIIFoldingTokenFilterFactory.java | 2 +- .../analysis/common/CommonAnalysisPlugin.java | 2 +- .../common/FingerprintAnalyzerProvider.java | 2 +- .../common/HighlighterWithAnalyzersTests.java | 6 ++--- .../ingest/common/IngestRestartIT.java | 2 +- .../ingest/common/GrokProcessorGetAction.java | 4 +-- .../ingest/common/JsonProcessor.java | 8 +++--- .../ingest/common/ScriptProcessor.java | 10 +++---- .../common/GrokProcessorGetActionTests.java | 6 ++--- .../ingest/common/JsonProcessorTests.java | 6 ++--- .../common/ScriptProcessorFactoryTests.java | 2 +- .../ingest/geoip/UpdateDatabasesIT.java | 4 +-- .../ingest/geoip/GeoIpDownloaderIT.java | 6 ++--- .../ingest/geoip/GeoIpDownloaderStatsIT.java | 8 +++--- .../geoip/GeoIpProcessorNonIngestNodeIT.java | 6 ++--- .../ingest/geoip/GeoIpDownloader.java | 8 +++--- .../ingest/geoip/GeoIpTaskParams.java | 6 ++--- .../ingest/geoip/GeoIpTaskState.java | 14 +++++----- .../ingest/geoip/IngestGeoIpPlugin.java | 8 +++--- .../geoip/stats/GeoIpDownloaderStats.java | 8 +++--- .../stats/GeoIpDownloaderStatsAction.java | 4 +-- .../ingest/geoip/DatabaseRegistryTests.java | 4 +-- .../ingest/geoip/GeoIpDownloaderTests.java | 4 +-- .../GeoIpTaskStateSerializationTests.java | 2 +- .../GeoIpDownloaderStatsSerializingTests.java | 2 +- .../ingest/useragent/DeviceTypeParser.java | 8 +++--- .../ingest/useragent/UserAgentParser.java | 8 +++--- .../useragent/DeviceTypeParserTests.java | 8 +++--- .../kibana/KibanaSystemIndexIT.java | 2 +- .../script/expression/MoreExpressionIT.java | 6 ++--- .../script/expression/StoredExpressionIT.java | 2 +- .../mustache/MultiSearchTemplateIT.java | 2 +- .../script/mustache/SearchTemplateIT.java | 6 ++--- .../mustache/CustomMustacheFactory.java | 4 +-- .../mustache/MultiSearchTemplateRequest.java | 6 ++--- .../mustache/MultiSearchTemplateResponse.java | 8 +++--- .../RestRenderSearchTemplateAction.java | 2 +- .../mustache/RestSearchTemplateAction.java | 2 +- .../mustache/SearchTemplateRequest.java | 12 ++++----- .../mustache/SearchTemplateResponse.java | 10 +++---- .../TransportMultiSearchTemplateAction.java | 2 +- .../TransportSearchTemplateAction.java | 8 +++--- .../MultiSearchTemplateRequestTests.java | 2 +- .../MultiSearchTemplateResponseTests.java | 4 +-- .../mustache/MustacheScriptEngineTests.java | 4 +-- .../script/mustache/MustacheTests.java | 4 +-- .../RestMultiSearchTemplateActionTests.java | 2 +- .../SearchTemplateRequestXContentTests.java | 14 +++++----- .../mustache/SearchTemplateResponseTests.java | 10 +++---- .../painless/ContextApiSpecGenerator.java | 4 +-- .../painless/ContextGeneratorCommon.java | 4 +-- .../painless/JavadocExtractor.java | 6 ++--- .../painless/PainlessInfoJson.java | 6 ++--- .../painless/PainlessPlugin.java | 2 +- .../action/PainlessContextAction.java | 6 ++--- .../PainlessContextClassBindingInfo.java | 12 ++++----- .../action/PainlessContextClassInfo.java | 10 +++---- .../PainlessContextConstructorInfo.java | 12 ++++----- .../action/PainlessContextFieldInfo.java | 10 +++---- .../painless/action/PainlessContextInfo.java | 10 +++---- .../PainlessContextInstanceBindingInfo.java | 12 ++++----- .../action/PainlessContextMethodInfo.java | 12 ++++----- .../action/PainlessExecuteAction.java | 14 +++++----- .../org/elasticsearch/painless/api/Json.java | 10 +++---- .../toxcontent/UserTreeToXContent.java | 2 +- .../toxcontent/XContentBuilderWrapper.java | 4 +-- .../painless/ToXContentTests.java | 4 +-- .../painless/action/ContextInfoTests.java | 2 +- .../action/PainlessExecuteApiTests.java | 2 +- .../action/PainlessExecuteRequestTests.java | 10 +++---- .../action/PainlessExecuteResponseTests.java | 2 +- .../GeoBoundingBoxQueryLegacyGeoShapeIT.java | 4 +-- .../legacygeo/search/LegacyGeoShapeIT.java | 4 +-- .../legacygeo/builders/CircleBuilder.java | 4 +-- .../legacygeo/builders/EnvelopeBuilder.java | 2 +- .../builders/GeometryCollectionBuilder.java | 2 +- .../legacygeo/builders/LineStringBuilder.java | 2 +- .../builders/MultiLineStringBuilder.java | 2 +- .../legacygeo/builders/MultiPointBuilder.java | 2 +- .../builders/MultiPolygonBuilder.java | 2 +- .../legacygeo/builders/PointBuilder.java | 2 +- .../legacygeo/builders/PolygonBuilder.java | 2 +- .../legacygeo/builders/ShapeBuilder.java | 4 +-- .../mapper/LegacyGeoShapeFieldMapper.java | 2 +- .../legacygeo/parsers/CoordinateNode.java | 4 +-- .../legacygeo/parsers/GeoJsonParser.java | 4 +-- .../legacygeo/parsers/GeoWKTParser.java | 2 +- .../legacygeo/parsers/ShapeParser.java | 10 +++---- .../legacygeo/BaseGeoParsingTestCase.java | 4 +-- .../legacygeo/GeoJsonShapeParserTests.java | 8 +++--- .../legacygeo/GeoWKTShapeParserTests.java | 6 ++--- .../AbstractShapeBuilderTestCase.java | 10 +++---- .../LegacyGeoShapeFieldMapperTests.java | 4 +-- .../search/LegacyGeoShapeQueryTests.java | 6 ++--- .../test/ElasticsearchGeoAssertions.java | 2 +- .../mapper/MatchOnlyTextFieldMapperTests.java | 4 +-- .../TokenCountFieldMapperIntegrationIT.java | 2 +- .../mapper/extras/RankFeatureFieldMapper.java | 2 +- .../extras/RankFeatureQueryBuilder.java | 8 +++--- .../extras/RankFeaturesFieldMapper.java | 2 +- .../mapper/extras/ScaledFloatFieldMapper.java | 4 +-- .../index/mapper/extras/BWCTemplateTests.java | 2 +- .../extras/RankFeatureFieldMapperTests.java | 2 +- .../RankFeatureMetaFieldMapperTests.java | 4 +-- .../extras/RankFeaturesFieldMapperTests.java | 2 +- .../extras/ScaledFloatFieldMapperTests.java | 6 ++--- .../SearchAsYouTypeFieldMapperTests.java | 2 +- .../extras/TokenCountFieldMapperTests.java | 2 +- .../join/query/ChildQuerySearchIT.java | 2 +- .../elasticsearch/join/query/InnerHitsIT.java | 2 +- .../join/query/ParentChildTestCase.java | 4 +-- .../ChildrenAggregationBuilder.java | 4 +-- .../ChildrenToParentAggregator.java | 2 +- .../ParentAggregationBuilder.java | 4 +-- .../ParentToChildrenAggregator.java | 2 +- .../join/aggregations/ParsedChildren.java | 2 +- .../join/aggregations/ParsedParent.java | 2 +- .../join/mapper/ParentJoinFieldMapper.java | 4 +-- .../join/query/HasChildQueryBuilder.java | 6 ++--- .../join/query/HasParentQueryBuilder.java | 6 ++--- .../join/query/ParentIdQueryBuilder.java | 6 ++--- .../spi/ParentJoinNamedXContentProvider.java | 6 ++--- .../aggregations/InternalChildrenTests.java | 4 +-- .../aggregations/InternalParentTests.java | 4 +-- .../mapper/ParentJoinFieldMapperTests.java | 4 +-- .../join/query/HasChildQueryBuilderTests.java | 4 +-- .../query/HasParentQueryBuilderTests.java | 4 +-- .../join/query/ParentIdQueryBuilderTests.java | 4 +-- .../percolator/PercolatorQuerySearchIT.java | 10 +++---- .../percolator/PercolateQueryBuilder.java | 18 ++++++------- .../percolator/PercolatorFieldMapper.java | 4 +-- .../percolator/CandidateQueryTests.java | 2 +- .../PercolateQueryBuilderTests.java | 10 +++---- .../PercolateWithNestedQueryBuilderTests.java | 2 +- .../PercolatorFieldMapperTests.java | 8 +++--- .../PercolatorQuerySearchTests.java | 8 +++--- .../percolator/QueryBuilderStoreTests.java | 2 +- .../rankeval/DiscountedCumulativeGain.java | 12 ++++----- .../index/rankeval/EvalQueryQuality.java | 10 +++---- .../index/rankeval/EvaluationMetric.java | 2 +- .../rankeval/ExpectedReciprocalRank.java | 12 ++++----- .../index/rankeval/MeanReciprocalRank.java | 12 ++++----- .../index/rankeval/MetricDetail.java | 4 +-- .../index/rankeval/PrecisionAtK.java | 12 ++++----- .../RankEvalNamedXContentProvider.java | 4 +-- .../index/rankeval/RankEvalPlugin.java | 2 +- .../index/rankeval/RankEvalResponse.java | 10 +++---- .../index/rankeval/RankEvalSpec.java | 10 +++---- .../index/rankeval/RatedDocument.java | 10 +++---- .../index/rankeval/RatedRequest.java | 10 +++---- .../index/rankeval/RatedSearchHit.java | 14 +++++----- .../index/rankeval/RecallAtK.java | 12 ++++----- .../index/rankeval/RestRankEvalAction.java | 2 +- .../rankeval/TransportRankEvalAction.java | 6 ++--- .../DiscountedCumulativeGainTests.java | 14 +++++----- .../index/rankeval/EvalQueryQualityTests.java | 8 +++--- .../rankeval/ExpectedReciprocalRankTests.java | 14 +++++----- .../rankeval/MeanReciprocalRankTests.java | 14 +++++----- .../index/rankeval/PrecisionAtKTests.java | 14 +++++----- .../index/rankeval/RankEvalRequestTests.java | 2 +- .../index/rankeval/RankEvalResponseTests.java | 12 ++++----- .../index/rankeval/RankEvalSpecTests.java | 14 +++++----- .../index/rankeval/RatedDocumentTests.java | 12 ++++----- .../index/rankeval/RatedRequestsTests.java | 16 ++++++------ .../index/rankeval/RatedSearchHitTests.java | 6 ++--- .../index/rankeval/RecallAtKTests.java | 14 +++++----- .../TransportRankEvalActionTests.java | 2 +- ...rollDocumentsAfterConflictsIntegTests.java | 6 ++--- .../AbstractBaseReindexRestHandler.java | 2 +- .../AbstractBulkByQueryRestHandler.java | 6 ++--- ...kIndexByScrollResponseContentListener.java | 4 +-- .../elasticsearch/reindex/ReindexPlugin.java | 2 +- .../org/elasticsearch/reindex/Reindexer.java | 10 +++---- .../reindex/RestReindexAction.java | 2 +- .../reindex/remote/RemoteRequestBuilders.java | 8 +++--- .../reindex/remote/RemoteResponseParsers.java | 20 +++++++------- .../remote/RemoteScrollableHitSource.java | 8 +++--- .../reindex/AsyncBulkByScrollActionTests.java | 2 +- .../elasticsearch/reindex/CancelTests.java | 2 +- .../ReindexFromRemoteWithAuthTests.java | 2 +- .../reindex/RestDeleteByQueryActionTests.java | 2 +- .../reindex/RestReindexActionTests.java | 7 +++-- .../reindex/RestUpdateByQueryActionTests.java | 2 +- .../remote/RemoteResponseParsersTests.java | 9 +++---- .../repository/url/URLRepositoryPlugin.java | 2 +- .../repositories/url/URLRepository.java | 2 +- .../repositories/url/URLRepositoryTests.java | 2 +- .../RepositoryURLClientYamlTestSuiteIT.java | 6 ++--- .../RuntimeFieldsCommonPlugin.java | 2 +- .../elasticsearch/systemd/SystemdPlugin.java | 2 +- .../rest/Netty4HeadBodyIsEmptyIT.java | 4 +-- .../netty4/Netty4HttpServerTransport.java | 2 +- .../transport/netty4/Netty4Plugin.java | 2 +- .../ICUCollationKeywordFieldMapperIT.java | 6 ++--- .../icu/ICUCollationKeywordFieldMapper.java | 2 +- .../ICUCollationKeywordFieldMapperTests.java | 6 ++--- .../elasticsearch/cloud/gce/GCEFixture.java | 2 +- .../customsigheuristic/SimpleHeuristic.java | 2 +- .../SimpleHeuristicWireTests.java | 4 +-- .../customsuggester/CustomSuggestion.java | 4 +-- .../CustomSuggestionBuilder.java | 4 +-- .../rescore/ExampleRescoreBuilder.java | 4 +-- .../AnnotatedTextFieldMapperTests.java | 6 ++--- .../murmur3/Murmur3FieldMapperTests.java | 2 +- .../index/mapper/size/SizeMappingIT.java | 6 ++--- .../index/mapper/size/SizeMappingTests.java | 2 +- .../repositories/azure/AzureRepository.java | 2 +- .../azure/AzureRepositoryPlugin.java | 2 +- .../azure/AzureRepositorySettingsTests.java | 2 +- ...eCloudStorageBlobStoreRepositoryTests.java | 2 +- .../gcs/GoogleCloudStoragePlugin.java | 2 +- .../gcs/GoogleCloudStorageRepository.java | 2 +- .../gcs/GoogleCloudStorageServiceTests.java | 4 +-- .../repositories/gcs/TestUtils.java | 4 +-- .../repositories/hdfs/HdfsPlugin.java | 2 +- .../repositories/hdfs/HdfsRepository.java | 2 +- .../s3/S3BlobStoreRepositoryTests.java | 4 +-- .../repositories/s3/S3Repository.java | 2 +- .../repositories/s3/S3RepositoryPlugin.java | 2 +- .../s3/RepositoryCredentialsTests.java | 2 +- .../repositories/s3/S3RepositoryTests.java | 2 +- .../http/nio/NioHttpServerTransport.java | 2 +- .../transport/nio/NioTransportPlugin.java | 2 +- .../upgrades/SearchStatesIT.java | 8 +++--- ...rossClusterSearchUnavailableClusterIT.java | 4 +-- .../upgrades/FullClusterRestartIT.java | 8 +++--- .../upgrades/QueryBuilderBWCIT.java | 6 ++--- .../common/logging/JsonLoggerTests.java | 8 +++--- .../elasticsearch/backwards/IndexingIT.java | 6 ++--- .../org/elasticsearch/search/CCSDuelIT.java | 2 +- .../cluster/remote/test/RemoteClustersIT.java | 2 +- .../MultiVersionRepositoryAccessIT.java | 6 ++--- .../elasticsearch/upgrades/IndexingIT.java | 6 ++--- .../upgrades/SnapshotBasedRecoveryIT.java | 4 +-- .../elasticsearch/http/AutoCreateIndexIT.java | 4 +-- .../http/ClusterStateRestCancellationIT.java | 2 +- .../http/IndexingPressureRestIT.java | 2 +- .../http/SearchRestCancellationIT.java | 2 +- .../elasticsearch/http/SystemIndexRestIT.java | 4 +-- .../http/snapshots/RestGetSnapshotsIT.java | 8 +++--- .../system/indices/SystemIndicesQA.java | 4 +-- .../RestHighLevelClientEmployeeResource.java | 4 +-- .../org/elasticsearch/wildfly/WildflyIT.java | 8 +++--- server/build.gradle | 4 --- .../ClusterAllocationExplainIT.java | 10 +++---- .../admin/cluster/node/tasks/TasksIT.java | 2 +- .../admin/indices/create/CloneIndexIT.java | 2 +- .../admin/indices/create/CreateIndexIT.java | 2 +- .../indices/create/CreateSystemIndicesIT.java | 2 +- .../admin/indices/create/ShrinkIndexIT.java | 2 +- .../admin/indices/create/SplitIndexIT.java | 4 +-- .../diskusage/IndexDiskUsageAnalyzerIT.java | 4 +-- .../action/bulk/BulkIntegrationIT.java | 6 ++--- .../bulk/BulkProcessorClusterSettingsIT.java | 2 +- .../action/bulk/BulkWithUpdatesIT.java | 4 +-- .../action/ingest/AsyncIngestProcessorIT.java | 4 +-- .../action/search/TransportSearchIT.java | 4 +-- .../support/WaitActiveShardCountIT.java | 2 +- .../action/termvectors/GetTermVectorsIT.java | 6 ++--- .../elasticsearch/aliases/IndexAliasesIT.java | 2 +- .../aliases/NetNewSystemIndexAliasIT.java | 4 +-- .../broadcast/BroadcastActionsIT.java | 4 +-- .../elasticsearch/cluster/NoMasterNodeIT.java | 2 +- .../cluster/SimpleClusterStateIT.java | 6 ++--- .../cluster/SimpleDataNodesIT.java | 2 +- .../cluster/coordination/ZenDiscoveryIT.java | 6 ++--- .../metadata/TemplateUpgradeServiceIT.java | 2 +- .../cluster/routing/PrimaryAllocationIT.java | 2 +- .../ClusterDisruptionCleanSettingsIT.java | 2 +- .../discovery/ClusterDisruptionIT.java | 2 +- .../discovery/MasterDisruptionIT.java | 2 +- .../discovery/SnapshotDisruptionIT.java | 2 +- .../document/DocumentActionsIT.java | 6 ++--- .../elasticsearch/document/ShardInfoIT.java | 2 +- .../elasticsearch/env/NodeEnvironmentIT.java | 2 +- .../explain/ExplainActionIT.java | 2 +- .../gateway/GatewayIndexStateIT.java | 2 +- .../gateway/MetadataNodesIT.java | 2 +- .../gateway/QuorumGatewayIT.java | 2 +- .../gateway/RecoveryFromGatewayIT.java | 4 +-- .../org/elasticsearch/get/GetActionIT.java | 6 ++--- .../elasticsearch/index/FinalPipelineIT.java | 4 +-- .../index/IndexRequestBuilderIT.java | 2 +- .../org/elasticsearch/index/IndexSortIT.java | 4 +-- .../index/SettingsListenerIT.java | 2 +- .../index/engine/InternalEngineMergeIT.java | 2 +- .../index/engine/MaxDocsLimitIT.java | 2 +- .../index/fielddata/FieldDataLoadingIT.java | 2 +- .../mapper/CopyToMapperIntegrationIT.java | 6 ++--- .../index/mapper/DynamicMappingIT.java | 6 ++--- .../mapper/MultiFieldsIntegrationIT.java | 4 +-- .../index/seqno/GlobalCheckpointSyncIT.java | 2 +- .../shard/GlobalCheckpointListenersIT.java | 2 +- .../index/shard/IndexShardIT.java | 2 +- .../index/shard/SearchIdleIT.java | 2 +- .../index/store/ExceptionRetryIT.java | 4 +-- ...DateMathIndexExpressionsIntegrationIT.java | 2 +- .../indices/SystemIndexManagerIT.java | 2 +- .../indices/TestSystemIndexDescriptor.java | 4 +-- .../PreBuiltAnalyzerIntegrationIT.java | 4 +-- .../elasticsearch/indices/flush/FlushIT.java | 2 +- .../mapping/MalformedDynamicTemplateIT.java | 2 +- .../mapping/SimpleGetFieldMappingsIT.java | 10 +++---- .../indices/mapping/SimpleGetMappingsIT.java | 4 +-- .../mapping/UpdateMappingIntegrationIT.java | 4 +-- .../breaker/CircuitBreakerServiceIT.java | 2 +- .../RandomExceptionCircuitBreakerIT.java | 2 +- .../indices/recovery/IndexRecoveryIT.java | 2 +- .../SnapshotBasedIndexRecoveryIT.java | 2 +- .../plan/ShardSnapshotsServiceIT.java | 2 +- .../settings/UpdateNumberOfReplicasIT.java | 2 +- .../indices/state/OpenCloseIndexIT.java | 2 +- .../indices/stats/IndexStatsIT.java | 4 +-- .../template/ComposableTemplateIT.java | 4 +-- .../template/IndexTemplateBlocksIT.java | 2 +- .../template/SimpleIndexTemplateIT.java | 4 +-- .../elasticsearch/ingest/IngestClientIT.java | 6 ++--- ...gestProcessorNotInstalledOnAllNodesIT.java | 4 +-- .../org/elasticsearch/mget/SimpleMgetIT.java | 4 +-- ...PersistentTaskInitializationFailureIT.java | 2 +- .../elasticsearch/recovery/RelocationIT.java | 2 +- .../recovery/SimpleRecoveryIT.java | 2 +- .../elasticsearch/routing/AliasRoutingIT.java | 2 +- .../routing/SimpleRoutingIT.java | 2 +- .../elasticsearch/script/StoredScriptsIT.java | 2 +- .../search/aggregations/CombiIT.java | 2 +- .../search/aggregations/EquivalenceIT.java | 4 +-- .../aggregations/FiltersAggsRewriteIT.java | 6 ++--- .../search/aggregations/MetadataIT.java | 2 +- .../bucket/AdjacencyMatrixIT.java | 4 +-- .../aggregations/bucket/BooleanTermsIT.java | 2 +- .../aggregations/bucket/DateHistogramIT.java | 2 +- .../bucket/DateHistogramOffsetIT.java | 2 +- .../aggregations/bucket/DateRangeIT.java | 2 +- .../aggregations/bucket/DoubleTermsIT.java | 2 +- .../search/aggregations/bucket/FilterIT.java | 4 +-- .../search/aggregations/bucket/FiltersIT.java | 4 +-- .../aggregations/bucket/GeoDistanceIT.java | 4 +-- .../aggregations/bucket/GeoHashGridIT.java | 4 +-- .../search/aggregations/bucket/GlobalIT.java | 2 +- .../aggregations/bucket/HistogramIT.java | 2 +- .../aggregations/bucket/LongTermsIT.java | 2 +- .../aggregations/bucket/MinDocCountIT.java | 2 +- .../aggregations/bucket/NaNSortingIT.java | 4 +-- .../search/aggregations/bucket/NestedIT.java | 6 ++--- .../search/aggregations/bucket/RangeIT.java | 2 +- .../aggregations/bucket/ReverseNestedIT.java | 4 +-- .../aggregations/bucket/ShardReduceIT.java | 2 +- .../SignificantTermsSignificanceScoreIT.java | 8 +++--- .../bucket/TermsDocCountErrorIT.java | 2 +- .../bucket/TermsShardMinDocCountIT.java | 2 +- .../bucket/terms/RareTermsIT.java | 2 +- .../bucket/terms/StringTermsIT.java | 8 +++--- .../aggregations/metrics/CardinalityIT.java | 2 +- .../metrics/MedianAbsoluteDeviationIT.java | 2 +- .../metrics/ScriptedMetricIT.java | 4 +-- .../aggregations/metrics/TopHitsIT.java | 8 +++--- .../aggregations/metrics/ValueCountIT.java | 2 +- ...ketMetricsPipeLineAggregationTestCase.java | 6 ++--- .../aggregations/pipeline/BucketScriptIT.java | 8 +++--- .../pipeline/BucketSelectorIT.java | 6 ++--- .../aggregations/pipeline/BucketSortIT.java | 4 +-- .../pipeline/DateDerivativeIT.java | 2 +- .../aggregations/pipeline/DerivativeIT.java | 4 +-- .../pipeline/ExtendedStatsBucketIT.java | 2 +- .../aggregations/pipeline/SerialDiffIT.java | 2 +- .../search/basic/SearchWhileRelocatingIT.java | 2 +- .../basic/SearchWithRandomExceptionsIT.java | 2 +- .../basic/SearchWithRandomIOExceptionsIT.java | 2 +- .../basic/TransportSearchFailuresIT.java | 4 +-- .../basic/TransportTwoNodesSearchIT.java | 4 +-- .../search/fetch/FetchSubPhasePluginIT.java | 6 ++--- .../search/fetch/subphase/InnerHitsIT.java | 4 +-- .../fetch/subphase/MatchedQueriesIT.java | 2 +- .../highlight/HighlighterSearchIT.java | 6 ++--- .../search/fieldcaps/FieldCapabilitiesIT.java | 4 +-- .../search/fields/SearchFieldsIT.java | 8 +++--- .../functionscore/DecayFunctionScoreIT.java | 4 +-- .../functionscore/ExplainableScriptIT.java | 2 +- .../FunctionScoreFieldValueIT.java | 2 +- .../search/functionscore/FunctionScoreIT.java | 2 +- .../functionscore/FunctionScorePluginIT.java | 2 +- .../search/functionscore/QueryRescorerIT.java | 6 ++--- .../functionscore/RandomScoreFunctionIT.java | 2 +- .../geo/GeoBoundingBoxQueryGeoPointIT.java | 4 +-- .../geo/GeoBoundingBoxQueryGeoShapeIT.java | 4 +-- .../search/geo/GeoDistanceIT.java | 6 ++--- .../search/geo/GeoPointScriptDocValuesIT.java | 6 ++--- .../search/geo/GeoPolygonIT.java | 2 +- .../elasticsearch/search/geo/GeoShapeIT.java | 2 +- .../search/morelikethis/MoreLikeThisIT.java | 6 ++--- .../search/msearch/MultiSearchIT.java | 2 +- .../search/nested/SimpleNestedIT.java | 8 +++--- .../aggregation/AggregationProfilerIT.java | 2 +- .../elasticsearch/search/query/ExistsIT.java | 6 ++--- .../search/query/MultiMatchQueryIT.java | 4 +-- .../search/query/QueryStringIT.java | 6 ++--- .../search/query/SearchQueryIT.java | 8 +++--- .../search/query/SimpleQueryStringIT.java | 8 +++--- .../search/routing/SearchPreferenceIT.java | 2 +- .../scriptfilter/ScriptQuerySearchIT.java | 6 ++--- .../search/scroll/DuelScrollIT.java | 2 +- .../search/scroll/SearchScrollIT.java | 8 +++--- .../SearchScrollWithFailingNodesIT.java | 2 +- .../search/searchafter/SearchAfterIT.java | 4 +-- .../search/simple/SimpleSearchIT.java | 8 +++--- .../search/slice/SearchSliceIT.java | 6 ++--- .../search/sort/FieldSortIT.java | 8 +++--- .../search/sort/GeoDistanceIT.java | 8 +++--- .../search/sort/GeoDistanceSortBuilderIT.java | 4 +-- .../search/sort/SimpleSortIT.java | 2 +- .../suggest/CompletionSuggestSearchIT.java | 6 ++--- .../ContextCompletionSuggestSearchIT.java | 6 ++--- .../search/suggest/SuggestSearchIT.java | 4 +-- .../similarity/SimilarityIT.java | 2 +- .../snapshots/BlobStoreIncrementalityIT.java | 2 +- .../snapshots/CloneSnapshotIT.java | 2 +- .../CorruptedBlobStoreRepositoryIT.java | 2 +- .../snapshots/CustomMetadataSnapshotIT.java | 6 ++--- ...etadataLoadingDuringSnapshotRestoreIT.java | 2 +- .../RepositoryFilterUserMetadataIT.java | 2 +- .../snapshots/RestoreSnapshotIT.java | 2 +- .../SnapshotCustomPluginStateIT.java | 6 ++--- .../snapshots/SnapshotStressTestsIT.java | 2 +- .../threadpool/SimpleThreadPoolIT.java | 2 +- .../org/elasticsearch/update/UpdateIT.java | 4 +-- .../elasticsearch/update/UpdateNoopIT.java | 4 +-- .../validate/SimpleValidateQueryIT.java | 2 +- .../elasticsearch/ElasticsearchException.java | 10 +++---- .../main/java/org/elasticsearch/Version.java | 4 +-- .../elasticsearch/action/ActionResponse.java | 4 +-- .../action/DocWriteResponse.java | 4 +-- .../action/FailedNodeException.java | 2 +- .../action/ShardOperationFailedException.java | 2 +- .../action/TaskOperationFailure.java | 12 ++++----- .../ClusterAllocationExplainRequest.java | 6 ++--- .../ClusterAllocationExplanation.java | 4 +-- .../cluster/health/ClusterHealthResponse.java | 14 +++++----- .../GetFeatureUpgradeStatusResponse.java | 4 +-- .../migration/PostFeatureUpgradeResponse.java | 4 +-- .../cluster/node/info/NodesInfoResponse.java | 6 ++--- .../cluster/node/info/PluginsAndModules.java | 2 +- .../NodesReloadSecureSettingsResponse.java | 6 ++--- .../admin/cluster/node/stats/NodeStats.java | 4 +-- .../node/stats/NodesStatsResponse.java | 6 ++--- .../tasks/cancel/CancelTasksResponse.java | 6 ++--- .../node/tasks/get/GetTaskResponse.java | 4 +-- .../tasks/get/TransportGetTaskAction.java | 4 +-- .../node/tasks/list/ListTasksResponse.java | 12 ++++----- .../cluster/node/tasks/list/TaskGroup.java | 4 +-- .../admin/cluster/node/usage/NodeUsage.java | 4 +-- .../node/usage/NodesUsageResponse.java | 6 ++--- .../cluster/remote/RemoteInfoResponse.java | 4 +-- .../cleanup/CleanupRepositoryResponse.java | 10 +++---- .../get/GetRepositoriesResponse.java | 6 ++--- .../put/PutRepositoryRequest.java | 6 ++--- .../put/PutRepositoryRequestBuilder.java | 2 +- .../verify/VerifyRepositoryResponse.java | 10 +++---- .../reroute/ClusterRerouteResponse.java | 6 ++--- .../settings/ClusterGetSettingsResponse.java | 14 +++++----- .../ClusterUpdateSettingsRequest.java | 12 ++++----- .../ClusterUpdateSettingsRequestBuilder.java | 2 +- .../ClusterUpdateSettingsResponse.java | 10 +++---- .../shards/ClusterSearchShardsGroup.java | 4 +-- .../shards/ClusterSearchShardsResponse.java | 4 +-- .../snapshots/clone/CloneSnapshotRequest.java | 4 +-- .../create/CreateSnapshotRequest.java | 6 ++--- .../create/CreateSnapshotResponse.java | 10 +++---- .../GetSnapshottableFeaturesResponse.java | 4 +-- .../features/ResetFeatureStateResponse.java | 4 +-- .../snapshots/get/GetSnapshotsResponse.java | 12 ++++----- .../restore/RestoreSnapshotRequest.java | 6 ++--- .../RestoreSnapshotRequestBuilder.java | 2 +- .../restore/RestoreSnapshotResponse.java | 14 +++++----- .../status/SnapshotIndexShardStatus.java | 16 ++++++------ .../snapshots/status/SnapshotIndexStatus.java | 14 +++++----- .../snapshots/status/SnapshotShardsStats.java | 14 +++++----- .../snapshots/status/SnapshotStats.java | 8 +++--- .../snapshots/status/SnapshotStatus.java | 16 ++++++------ .../status/SnapshotsStatusResponse.java | 12 ++++----- .../admin/cluster/stats/AnalysisStats.java | 6 ++--- .../cluster/stats/ClusterStatsIndices.java | 4 +-- .../cluster/stats/ClusterStatsNodes.java | 4 +-- .../cluster/stats/ClusterStatsResponse.java | 6 ++--- .../admin/cluster/stats/FieldScriptStats.java | 4 +-- .../admin/cluster/stats/FieldStats.java | 2 +- .../cluster/stats/IndexFeatureStats.java | 4 +-- .../admin/cluster/stats/MappingStats.java | 4 +-- .../cluster/stats/RuntimeFieldStats.java | 4 +-- .../admin/cluster/stats/VersionStats.java | 6 ++--- .../GetScriptContextResponse.java | 8 +++--- .../GetScriptLanguageResponse.java | 4 +-- .../GetStoredScriptResponse.java | 14 +++++----- .../storedscripts/PutStoredScriptRequest.java | 6 ++--- .../PutStoredScriptRequestBuilder.java | 2 +- .../tasks/PendingClusterTasksResponse.java | 4 +-- .../action/admin/indices/alias/Alias.java | 14 +++++----- .../indices/alias/IndicesAliasesRequest.java | 24 ++++++++--------- .../admin/indices/analyze/AnalyzeAction.java | 12 ++++----- .../clear/ClearIndicesCacheResponse.java | 4 +-- .../indices/close/CloseIndexResponse.java | 4 +-- .../indices/create/CreateIndexRequest.java | 14 +++++----- .../create/CreateIndexRequestBuilder.java | 4 +-- .../indices/create/CreateIndexResponse.java | 12 ++++----- .../list/ListDanglingIndicesResponse.java | 4 +-- .../AnalyzeIndexDiskUsageResponse.java | 2 +- .../diskusage/IndexDiskUsageStats.java | 4 +-- .../admin/indices/flush/FlushResponse.java | 4 +-- .../forcemerge/ForceMergeResponse.java | 4 +-- .../admin/indices/get/GetIndexResponse.java | 4 +-- .../mapping/get/GetFieldMappingsResponse.java | 12 ++++----- .../mapping/get/GetMappingsResponse.java | 6 ++--- .../TransportGetFieldMappingsIndexAction.java | 4 +-- .../mapping/put/PutMappingRequest.java | 6 ++--- .../mapping/put/PutMappingRequestBuilder.java | 4 +-- .../admin/indices/open/OpenIndexResponse.java | 4 +-- .../readonly/AddIndexBlockResponse.java | 6 ++--- .../indices/recovery/RecoveryResponse.java | 2 +- .../indices/refresh/RefreshResponse.java | 4 +-- .../indices/resolve/ResolveIndexAction.java | 6 ++--- .../admin/indices/rollover/Condition.java | 2 +- .../indices/rollover/MaxAgeCondition.java | 4 +-- .../indices/rollover/MaxDocsCondition.java | 4 +-- .../MaxPrimaryShardSizeCondition.java | 4 +-- .../indices/rollover/MaxSizeCondition.java | 4 +-- .../admin/indices/rollover/RolloverInfo.java | 10 +++---- .../indices/rollover/RolloverRequest.java | 6 ++--- .../indices/rollover/RolloverResponse.java | 6 ++--- .../segments/IndicesSegmentResponse.java | 2 +- .../settings/get/GetSettingsResponse.java | 10 +++---- .../settings/put/UpdateSettingsRequest.java | 8 +++--- .../put/UpdateSettingsRequestBuilder.java | 2 +- .../shards/IndicesShardStoresResponse.java | 4 +-- .../admin/indices/shrink/ResizeRequest.java | 10 +++---- .../admin/indices/shrink/ResizeResponse.java | 4 +-- .../admin/indices/stats/CommonStats.java | 6 ++--- .../stats/FieldUsageShardResponse.java | 4 +-- .../stats/FieldUsageStatsResponse.java | 2 +- .../indices/stats/IndicesStatsResponse.java | 2 +- .../admin/indices/stats/ShardStats.java | 4 +-- .../get/GetComponentTemplateAction.java | 6 ++--- .../get/GetComposableIndexTemplateAction.java | 6 ++--- .../get/GetIndexTemplatesResponse.java | 6 ++--- .../post/SimulateIndexTemplateResponse.java | 6 ++--- .../TransportSimulateIndexTemplateAction.java | 2 +- .../post/TransportSimulateTemplateAction.java | 2 +- .../template/put/PutIndexTemplateRequest.java | 10 +++---- .../put/PutIndexTemplateRequestBuilder.java | 4 +-- .../validate/query/QueryExplanation.java | 14 +++++----- .../validate/query/ValidateQueryRequest.java | 4 +-- .../validate/query/ValidateQueryResponse.java | 12 ++++----- .../action/bulk/BulkItemResponse.java | 14 +++++----- .../action/bulk/BulkProcessor.java | 2 +- .../action/bulk/BulkRequest.java | 2 +- .../action/bulk/BulkRequestBuilder.java | 2 +- .../action/bulk/BulkRequestParser.java | 10 +++---- .../action/bulk/BulkResponse.java | 4 +-- .../action/bulk/TransportShardBulkAction.java | 4 +-- .../action/delete/DeleteResponse.java | 2 +- .../action/explain/ExplainRequest.java | 6 ++--- .../action/explain/ExplainResponse.java | 8 +++--- .../action/fieldcaps/FieldCapabilities.java | 10 +++---- .../fieldcaps/FieldCapabilitiesFailure.java | 10 +++---- .../fieldcaps/FieldCapabilitiesRequest.java | 4 +-- .../fieldcaps/FieldCapabilitiesResponse.java | 10 +++---- .../elasticsearch/action/get/GetResponse.java | 6 ++--- .../action/get/MultiGetRequest.java | 10 +++---- .../action/get/MultiGetResponse.java | 10 +++---- .../action/index/IndexRequest.java | 10 +++---- .../action/index/IndexRequestBuilder.java | 4 +-- .../action/index/IndexResponse.java | 2 +- .../action/ingest/GetPipelineResponse.java | 6 ++--- .../action/ingest/PutPipelineRequest.java | 6 ++--- .../ingest/PutPipelineRequestBuilder.java | 2 +- .../ingest/SimulateDocumentBaseResult.java | 10 +++---- .../action/ingest/SimulateDocumentResult.java | 2 +- .../ingest/SimulateDocumentVerboseResult.java | 10 +++---- .../ingest/SimulatePipelineRequest.java | 6 ++--- .../SimulatePipelineRequestBuilder.java | 2 +- .../ingest/SimulatePipelineResponse.java | 14 +++++----- .../ingest/SimulateProcessorResult.java | 14 +++++----- .../ingest/WriteableIngestDocument.java | 14 +++++----- .../action/main/MainResponse.java | 10 +++---- .../action/search/ClearScrollRequest.java | 6 ++--- .../action/search/ClearScrollResponse.java | 12 ++++----- .../search/ClosePointInTimeRequest.java | 8 +++--- .../action/search/MultiSearchRequest.java | 10 +++---- .../action/search/MultiSearchResponse.java | 14 +++++----- .../search/OpenPointInTimeResponse.java | 14 +++++----- .../search/RestClosePointInTimeAction.java | 2 +- .../search/SearchPhaseExecutionException.java | 2 +- .../action/search/SearchRequest.java | 2 +- .../action/search/SearchResponse.java | 10 +++---- .../action/search/SearchResponseSections.java | 4 +-- .../action/search/SearchScrollRequest.java | 6 ++--- .../action/search/ShardSearchFailure.java | 4 +-- .../DefaultShardOperationFailedException.java | 10 +++---- .../action/support/IndicesOptions.java | 12 ++++----- .../support/broadcast/BroadcastResponse.java | 12 ++++----- .../support/master/AcknowledgedResponse.java | 14 +++++----- .../master/ShardsAcknowledgedResponse.java | 10 +++---- .../replication/ReplicationResponse.java | 6 ++--- .../support/replication/ReplicationTask.java | 2 +- .../support/tasks/BaseTasksResponse.java | 4 +-- .../termvectors/MultiTermVectorsRequest.java | 2 +- .../termvectors/MultiTermVectorsResponse.java | 4 +-- .../termvectors/TermVectorsRequest.java | 10 +++---- .../TermVectorsRequestBuilder.java | 2 +- .../termvectors/TermVectorsResponse.java | 4 +-- .../action/update/TransportUpdateAction.java | 2 +- .../action/update/UpdateHelper.java | 4 +-- .../action/update/UpdateRequest.java | 16 ++++++------ .../action/update/UpdateRequestBuilder.java | 4 +-- .../action/update/UpdateResponse.java | 4 +-- .../client/ClusterAdminClient.java | 2 +- .../org/elasticsearch/client/Requests.java | 2 +- .../client/support/AbstractClient.java | 2 +- .../elasticsearch/cluster/ClusterInfo.java | 4 +-- .../elasticsearch/cluster/ClusterModule.java | 6 +++-- .../elasticsearch/cluster/ClusterState.java | 4 +-- .../org/elasticsearch/cluster/DiskUsage.java | 4 +-- .../cluster/RepositoryCleanupInProgress.java | 2 +- .../cluster/RestoreInProgress.java | 4 +-- .../cluster/SnapshotDeletionsInProgress.java | 2 +- .../cluster/SnapshotsInProgress.java | 4 +-- .../action/index/MappingUpdatedAction.java | 2 +- .../cluster/block/ClusterBlock.java | 4 +-- .../coordination/CoordinationMetadata.java | 10 +++---- .../cluster/coordination/Coordinator.java | 2 +- .../ElasticsearchNodeCommand.java | 6 ++--- .../PendingClusterStateStats.java | 5 ++-- .../PublishClusterStateStats.java | 4 +-- .../cluster/health/ClusterIndexHealth.java | 16 ++++++------ .../cluster/health/ClusterShardHealth.java | 12 ++++----- .../cluster/metadata/AliasMetadata.java | 10 +++---- .../cluster/metadata/AliasValidator.java | 8 +++--- .../cluster/metadata/ComponentTemplate.java | 10 +++---- .../metadata/ComponentTemplateMetadata.java | 8 +++--- .../metadata/ComposableIndexTemplate.java | 10 +++---- .../ComposableIndexTemplateMetadata.java | 8 +++--- .../cluster/metadata/DataStream.java | 10 +++---- .../cluster/metadata/DataStreamAlias.java | 14 +++++----- .../cluster/metadata/DataStreamMetadata.java | 8 +++--- .../cluster/metadata/IndexGraveyard.java | 12 ++++----- .../cluster/metadata/IndexMetadata.java | 10 +++---- .../metadata/IndexMetadataVerifier.java | 2 +- .../metadata/IndexTemplateMetadata.java | 10 +++---- .../cluster/metadata/ItemUsage.java | 4 +-- .../cluster/metadata/Manifest.java | 14 +++++----- .../cluster/metadata/MappingMetadata.java | 4 +-- .../cluster/metadata/Metadata.java | 14 +++++----- .../metadata/MetadataCreateIndexService.java | 2 +- .../metadata/MetadataIndexAliasesService.java | 2 +- .../MetadataIndexTemplateService.java | 10 +++---- .../metadata/NodesShutdownMetadata.java | 8 +++--- .../metadata/RepositoriesMetadata.java | 6 ++--- .../ShutdownPersistentTasksStatus.java | 4 +-- .../metadata/ShutdownPluginsStatus.java | 4 +-- .../ShutdownShardMigrationStatus.java | 4 +-- .../metadata/SingleNodeShutdownMetadata.java | 12 ++++----- .../cluster/metadata/Template.java | 14 +++++----- .../metadata/TemplateUpgradeService.java | 4 +-- .../cluster/node/DiscoveryNode.java | 4 +-- .../cluster/routing/AllocationId.java | 10 +++---- .../cluster/routing/RecoverySource.java | 6 ++--- .../cluster/routing/ShardRouting.java | 4 +-- .../cluster/routing/UnassignedInfo.java | 4 +-- .../AbstractAllocationDecision.java | 4 +-- .../AllocateUnassignedDecision.java | 2 +- .../routing/allocation/MoveDecision.java | 2 +- .../allocation/NodeAllocationResult.java | 6 ++--- .../allocation/RerouteExplanation.java | 5 ++-- .../allocation/RoutingExplanations.java | 5 ++-- .../allocation/ShardAllocationDecision.java | 4 +-- .../AbstractAllocateAllocationCommand.java | 10 +++---- ...AllocateEmptyPrimaryAllocationCommand.java | 6 ++--- .../AllocateReplicaAllocationCommand.java | 6 ++--- ...AllocateStalePrimaryAllocationCommand.java | 6 ++--- .../allocation/command/AllocationCommand.java | 2 +- .../command/AllocationCommands.java | 6 ++--- .../command/BasePrimaryAllocationCommand.java | 6 ++--- .../command/CancelAllocationCommand.java | 6 ++--- .../command/MoveAllocationCommand.java | 6 ++--- .../routing/allocation/decider/Decision.java | 8 +++--- .../ClusterApplierRecordingService.java | 4 +-- .../service/ClusterStateUpdateStats.java | 4 +-- .../common/FieldMemoryStats.java | 2 +- .../common/ParsingException.java | 6 ++--- .../org/elasticsearch/common/Strings.java | 6 ++--- .../breaker/CircuitBreakingException.java | 2 +- .../common/bytes/AbstractBytesReference.java | 2 +- .../common/bytes/BytesReference.java | 4 +-- .../bytes/ReleasableBytesReference.java | 2 +- .../common/compress/CompressedXContent.java | 8 +++--- .../common/compress/CompressorFactory.java | 2 +- .../common/compress/NotXContentException.java | 2 +- .../common/document/DocumentField.java | 6 ++--- .../common/geo/GeoBoundingBox.java | 8 +++--- .../org/elasticsearch/common/geo/GeoJson.java | 20 +++++++------- .../elasticsearch/common/geo/GeoPoint.java | 4 +-- .../elasticsearch/common/geo/GeoUtils.java | 10 +++---- .../common/geo/GeometryParser.java | 6 ++--- .../common/geo/GeometryParserFormat.java | 6 ++--- .../common/io/stream/StreamOutput.java | 2 +- .../common/network/NetworkModule.java | 6 ++--- .../common/settings/Setting.java | 14 +++++----- .../common/settings/Settings.java | 16 ++++++------ .../common/settings/SettingsFilter.java | 2 +- .../common/settings/SettingsModule.java | 6 ++--- .../org/elasticsearch/common/text/Text.java | 4 +-- .../common/time/WriteableZoneId.java | 4 +-- .../common/transport/TransportAddress.java | 4 +-- .../common/unit/ByteSizeValue.java | 4 +-- .../elasticsearch/common/unit/Fuzziness.java | 8 +++--- .../xcontent/LoggingDeprecationHandler.java | 3 +++ .../common/xcontent/ObjectParserHelper.java | 9 +++++-- .../xcontent/StatusToXContentObject.java | 1 + .../xcontent/SuggestingErrorOnUnknown.java | 1 + .../XContentElasticsearchExtension.java | 2 ++ .../common/xcontent/XContentHelper.java | 11 +++++++- .../common/xcontent/XContentParserUtils.java | 5 +++- .../discovery/DiscoveryStats.java | 4 +-- .../elasticsearch/env/NodeEnvironment.java | 2 +- .../org/elasticsearch/env/NodeMetadata.java | 10 +++---- .../gateway/MetaStateService.java | 2 +- .../gateway/MetadataStateFormat.java | 10 +++---- .../gateway/PersistedClusterStateService.java | 10 +++---- ...ransportNodesListGatewayStartedShards.java | 2 +- .../http/AbstractHttpServerTransport.java | 2 +- .../java/org/elasticsearch/http/HttpInfo.java | 2 +- .../org/elasticsearch/http/HttpStats.java | 4 +-- .../java/org/elasticsearch/index/Index.java | 10 +++---- .../org/elasticsearch/index/IndexModule.java | 2 +- .../org/elasticsearch/index/IndexService.java | 2 +- .../elasticsearch/index/SearchSlowLog.java | 2 +- .../index/analysis/NameOrDefinition.java | 8 +++--- .../index/bulk/stats/BulkStats.java | 6 ++--- .../index/cache/query/QueryCacheStats.java | 6 ++--- .../cache/request/RequestCacheStats.java | 4 +-- .../index/engine/CommitStats.java | 4 +-- .../index/engine/SegmentsStats.java | 4 +-- .../index/fielddata/FieldDataStats.java | 4 +-- .../elasticsearch/index/flush/FlushStats.java | 4 +-- .../elasticsearch/index/get/GetResult.java | 6 ++--- .../org/elasticsearch/index/get/GetStats.java | 4 +-- .../index/get/ShardGetService.java | 4 +-- .../mapper/AbstractGeometryFieldMapper.java | 4 +-- .../AbstractPointGeometryFieldMapper.java | 2 +- .../index/mapper/BinaryFieldMapper.java | 2 +- .../index/mapper/BooleanFieldMapper.java | 2 +- .../index/mapper/CompletionFieldMapper.java | 12 ++++----- .../index/mapper/CompositeRuntimeField.java | 2 +- .../DataStreamTimestampFieldMapper.java | 6 ++--- .../index/mapper/DocCountFieldMapper.java | 2 +- .../index/mapper/DocumentParser.java | 8 +++--- .../index/mapper/DocumentParserContext.java | 2 +- .../index/mapper/DynamicFieldsBuilder.java | 2 +- .../index/mapper/DynamicTemplate.java | 4 +-- .../index/mapper/FieldAliasMapper.java | 2 +- .../index/mapper/FieldMapper.java | 10 +++---- .../index/mapper/GeoPointFieldMapper.java | 4 +-- .../index/mapper/GeoShapeParser.java | 2 +- .../index/mapper/IpFieldMapper.java | 2 +- .../index/mapper/KeywordFieldMapper.java | 2 +- .../index/mapper/LeafRuntimeField.java | 2 +- .../elasticsearch/index/mapper/Mapper.java | 2 +- .../index/mapper/MapperService.java | 10 +++---- .../elasticsearch/index/mapper/Mapping.java | 10 +++---- .../index/mapper/MappingParser.java | 2 +- .../index/mapper/MetadataFieldMapper.java | 2 +- .../index/mapper/NestedObjectMapper.java | 2 +- .../index/mapper/NumberFieldMapper.java | 4 +-- .../index/mapper/ObjectMapper.java | 4 +-- .../index/mapper/ParsedDocument.java | 2 +- .../index/mapper/RangeFieldMapper.java | 2 +- .../elasticsearch/index/mapper/RangeType.java | 2 +- .../index/mapper/RootObjectMapper.java | 4 +-- .../index/mapper/RuntimeField.java | 2 +- .../index/mapper/SourceFieldMapper.java | 6 ++--- .../index/mapper/SourceToParse.java | 2 +- .../index/mapper/TextFieldMapper.java | 4 +-- .../flattened/FlattenedFieldMapper.java | 2 +- .../flattened/FlattenedFieldParser.java | 4 +-- .../elasticsearch/index/merge/MergeStats.java | 4 +-- .../query/AbstractGeometryQueryBuilder.java | 8 +++--- .../index/query/AbstractQueryBuilder.java | 12 ++++----- .../index/query/BaseTermQueryBuilder.java | 4 +-- .../index/query/BoolQueryBuilder.java | 8 +++--- .../index/query/BoostingQueryBuilder.java | 6 ++--- .../query/CombinedFieldsQueryBuilder.java | 10 +++---- .../index/query/CommonTermsQueryBuilder.java | 6 ++--- .../query/ConstantScoreQueryBuilder.java | 6 ++--- .../query/CoordinatorRewriteContext.java | 2 +- .../CoordinatorRewriteContextProvider.java | 2 +- .../index/query/DisMaxQueryBuilder.java | 6 ++--- .../query/DistanceFeatureQueryBuilder.java | 12 ++++----- .../index/query/ExistsQueryBuilder.java | 6 ++--- .../query/FieldMaskingSpanQueryBuilder.java | 6 ++--- .../index/query/FuzzyQueryBuilder.java | 6 ++--- .../query/GeoBoundingBoxQueryBuilder.java | 6 ++--- .../index/query/GeoDistanceQueryBuilder.java | 6 ++--- .../index/query/GeoPolygonQueryBuilder.java | 8 +++--- .../index/query/GeoShapeQueryBuilder.java | 6 ++--- .../index/query/IdsQueryBuilder.java | 10 +++---- .../index/query/InnerHitBuilder.java | 12 ++++----- .../index/query/IntervalQueryBuilder.java | 4 +-- .../index/query/IntervalsSourceProvider.java | 18 ++++++------- .../index/query/MatchAllQueryBuilder.java | 6 ++--- .../query/MatchBoolPrefixQueryBuilder.java | 4 +-- .../index/query/MatchNoneQueryBuilder.java | 4 +-- .../query/MatchPhrasePrefixQueryBuilder.java | 6 ++--- .../index/query/MatchPhraseQueryBuilder.java | 6 ++--- .../index/query/MatchQueryBuilder.java | 6 ++--- .../index/query/MoreLikeThisQueryBuilder.java | 14 +++++----- .../index/query/MultiMatchQueryBuilder.java | 8 +++--- .../index/query/NestedQueryBuilder.java | 6 ++--- .../index/query/PrefixQueryBuilder.java | 6 ++--- .../index/query/QueryBuilder.java | 2 +- .../index/query/QueryParser.java | 4 +-- .../index/query/QueryRewriteContext.java | 4 +-- .../index/query/QueryStringQueryBuilder.java | 6 ++--- .../index/query/RangeQueryBuilder.java | 6 ++--- .../index/query/RegexpQueryBuilder.java | 6 ++--- .../index/query/ScriptQueryBuilder.java | 4 +-- .../index/query/SearchExecutionContext.java | 4 +-- .../index/query/SimpleQueryStringBuilder.java | 6 ++--- .../query/SpanContainingQueryBuilder.java | 6 ++--- .../index/query/SpanFirstQueryBuilder.java | 6 ++--- .../query/SpanMultiTermQueryBuilder.java | 6 ++--- .../index/query/SpanNearQueryBuilder.java | 8 +++--- .../index/query/SpanNotQueryBuilder.java | 6 ++--- .../index/query/SpanOrQueryBuilder.java | 6 ++--- .../index/query/SpanQueryBuilder.java | 2 +- .../index/query/SpanTermQueryBuilder.java | 4 +-- .../index/query/SpanWithinQueryBuilder.java | 6 ++--- .../index/query/TermQueryBuilder.java | 6 ++--- .../index/query/TermsQueryBuilder.java | 4 +-- .../index/query/TermsSetQueryBuilder.java | 6 ++--- .../index/query/TypeQueryV7Builder.java | 8 +++--- .../index/query/WildcardQueryBuilder.java | 6 ++--- .../index/query/WrapperQueryBuilder.java | 8 +++--- .../functionscore/DecayFunctionBuilder.java | 8 +++--- .../functionscore/DecayFunctionParser.java | 8 +++--- .../FieldValueFactorFunctionBuilder.java | 4 +-- .../FunctionScoreQueryBuilder.java | 10 +++---- .../GaussDecayFunctionBuilder.java | 2 +- .../RandomScoreFunctionBuilder.java | 4 +-- .../functionscore/ScoreFunctionBuilder.java | 4 +-- .../functionscore/ScoreFunctionParser.java | 2 +- .../ScriptScoreFunctionBuilder.java | 4 +-- .../ScriptScoreQueryBuilder.java | 12 ++++----- .../query/functionscore/WeightBuilder.java | 2 +- .../index/query/support/QueryParsers.java | 4 +-- .../index/recovery/RecoveryStats.java | 4 +-- .../index/refresh/RefreshStats.java | 4 +-- .../index/reindex/BulkByScrollResponse.java | 12 ++++----- .../reindex/BulkByScrollResponseBuilder.java | 2 +- .../index/reindex/BulkByScrollTask.java | 18 ++++++------- .../reindex/ClientScrollableHitSource.java | 2 +- .../index/reindex/DeleteByQueryRequest.java | 4 +-- .../index/reindex/ReindexRequest.java | 12 ++++----- .../index/reindex/RemoteInfo.java | 16 ++++++------ .../index/reindex/ScrollableHitSource.java | 6 ++--- .../index/reindex/UpdateByQueryRequest.java | 4 +-- .../index/search/stats/FieldUsageStats.java | 6 ++--- .../index/search/stats/SearchStats.java | 6 ++--- .../index/seqno/ReplicationTracker.java | 2 +- .../index/seqno/RetentionLease.java | 14 +++++----- .../index/seqno/RetentionLeaseStats.java | 8 +++--- .../index/seqno/RetentionLeases.java | 16 ++++++------ .../elasticsearch/index/seqno/SeqNoStats.java | 4 +-- .../elasticsearch/index/shard/DocsStats.java | 4 +-- .../index/shard/IndexLongFieldRange.java | 6 ++--- .../index/shard/IndexingStats.java | 6 ++--- .../index/shard/PrimaryReplicaSyncer.java | 2 +- .../index/shard/ShardCountStats.java | 4 +-- .../elasticsearch/index/shard/ShardId.java | 4 +-- .../elasticsearch/index/shard/ShardPath.java | 2 +- .../index/shard/ShardStateMetadata.java | 6 ++--- .../BlobStoreIndexShardSnapshot.java | 8 +++--- .../BlobStoreIndexShardSnapshots.java | 8 +++--- .../index/stats/IndexingPressureStats.java | 4 +-- .../elasticsearch/index/store/StoreStats.java | 4 +-- .../index/translog/TranslogStats.java | 4 +-- .../translog/TruncateTranslogAction.java | 2 +- .../index/warmer/WarmerStats.java | 4 +-- .../elasticsearch/indices/IndicesModule.java | 4 +-- .../elasticsearch/indices/IndicesService.java | 8 +++--- .../indices/NodeIndicesStats.java | 4 +-- .../indices/SystemIndexDescriptor.java | 6 ++--- .../indices/SystemIndexManager.java | 2 +- .../elasticsearch/indices/TermsLookup.java | 12 ++++----- .../breaker/AllCircuitBreakerStats.java | 4 +-- .../indices/breaker/CircuitBreakerStats.java | 4 +-- .../indices/recovery/RecoveryState.java | 8 +++--- .../ingest/ConfigurationUtils.java | 10 +++---- .../org/elasticsearch/ingest/IngestInfo.java | 2 +- .../elasticsearch/ingest/IngestMetadata.java | 8 +++--- .../org/elasticsearch/ingest/IngestStats.java | 4 +-- .../ingest/PipelineConfiguration.java | 12 ++++----- .../elasticsearch/ingest/ProcessorInfo.java | 5 ++-- .../org/elasticsearch/monitor/fs/FsInfo.java | 6 ++--- .../elasticsearch/monitor/jvm/JvmInfo.java | 2 +- .../elasticsearch/monitor/jvm/JvmStats.java | 4 +-- .../org/elasticsearch/monitor/os/OsInfo.java | 2 +- .../org/elasticsearch/monitor/os/OsStats.java | 4 +-- .../monitor/process/ProcessInfo.java | 2 +- .../monitor/process/ProcessStats.java | 4 +-- .../node/AdaptiveSelectionStats.java | 4 +-- .../java/org/elasticsearch/node/Node.java | 2 +- .../elasticsearch/node/ReportingService.java | 2 +- .../persistent/PersistentTaskParams.java | 2 +- .../persistent/PersistentTaskState.java | 2 +- .../PersistentTasksCustomMetadata.java | 18 ++++++------- .../PersistentTasksNodeService.java | 2 +- .../elasticsearch/plugins/NetworkPlugin.java | 2 +- .../org/elasticsearch/plugins/Plugin.java | 4 +-- .../org/elasticsearch/plugins/PluginInfo.java | 4 +-- .../plugins/RepositoryPlugin.java | 2 +- .../elasticsearch/plugins/SearchPlugin.java | 8 +++--- .../plugins/spi/NamedXContentProvider.java | 2 +- .../elasticsearch/repositories/IndexId.java | 6 ++--- .../repositories/RepositoriesModule.java | 2 +- .../repositories/RepositoryCleanupResult.java | 8 +++--- .../repositories/RepositoryData.java | 4 +-- .../repositories/RepositoryInfo.java | 4 +-- .../repositories/RepositoryStatsSnapshot.java | 4 +-- .../repositories/ShardGeneration.java | 6 ++--- .../blobstore/BlobStoreRepository.java | 10 +++---- .../blobstore/ChecksumBlobStoreFormat.java | 12 ++++----- .../blobstore/MeteredBlobStoreRepository.java | 2 +- .../repositories/fs/FsRepository.java | 2 +- .../rest/AbstractRestChannel.java | 8 +++--- .../elasticsearch/rest/BytesRestResponse.java | 6 ++--- .../org/elasticsearch/rest/RestChannel.java | 4 +-- .../rest/RestCompatibleVersionHelper.java | 4 +-- .../elasticsearch/rest/RestController.java | 4 +-- .../org/elasticsearch/rest/RestHandler.java | 8 +++--- .../org/elasticsearch/rest/RestRequest.java | 12 ++++----- .../elasticsearch/rest/RestRequestFilter.java | 4 +-- .../DispatchingRestToXContentListener.java | 6 ++--- .../rest/action/RestActions.java | 10 +++---- .../rest/action/RestBuilderListener.java | 2 +- .../action/RestFieldCapabilitiesAction.java | 4 +-- .../rest/action/RestMainAction.java | 2 +- .../action/RestStatusToXContentListener.java | 2 +- .../rest/action/RestToXContentListener.java | 4 +-- .../RestClusterAllocationExplainAction.java | 6 ++--- .../cluster/RestClusterGetSettingsAction.java | 4 +-- .../cluster/RestClusterRerouteAction.java | 6 ++--- .../admin/cluster/RestClusterStateAction.java | 6 ++--- .../RestClusterUpdateSettingsAction.java | 2 +- .../admin/cluster/RestListTasksAction.java | 2 +- .../admin/cluster/RestNodesUsageAction.java | 2 +- .../cluster/RestPutRepositoryAction.java | 2 +- .../cluster/RestPutStoredScriptAction.java | 2 +- .../RestReloadSecureSettingsAction.java | 6 ++--- .../admin/indices/RestAnalyzeAction.java | 2 +- .../admin/indices/RestGetAliasesAction.java | 4 +-- .../indices/RestGetFieldMappingAction.java | 2 +- .../admin/indices/RestGetMappingAction.java | 4 +-- .../indices/RestIndexPutAliasAction.java | 2 +- .../indices/RestIndicesAliasesAction.java | 2 +- .../indices/RestIndicesShardStoresAction.java | 2 +- .../admin/indices/RestSyncedFlushAction.java | 2 +- .../indices/RestValidateQueryAction.java | 2 +- .../rest/action/cat/RestTable.java | 4 +-- .../action/document/RestGetSourceAction.java | 2 +- .../action/document/RestMultiGetAction.java | 2 +- .../document/RestTermVectorsAction.java | 2 +- .../action/ingest/RestPutPipelineAction.java | 2 +- .../ingest/RestSimulatePipelineAction.java | 2 +- .../rest/action/search/RestCountAction.java | 2 +- .../action/search/RestMultiSearchAction.java | 6 ++--- .../rest/action/search/RestSearchAction.java | 2 +- .../java/org/elasticsearch/script/Script.java | 26 +++++++++---------- .../script/ScriptContextInfo.java | 12 ++++----- .../script/ScriptContextStats.java | 4 +-- .../elasticsearch/script/ScriptException.java | 6 ++--- .../script/ScriptLanguagesInfo.java | 12 ++++----- .../elasticsearch/script/ScriptMetadata.java | 8 +++--- .../org/elasticsearch/script/ScriptStats.java | 4 +-- .../org/elasticsearch/script/ScriptType.java | 2 +- .../script/StoredScriptSource.java | 20 +++++++------- .../search/SearchExtBuilder.java | 2 +- .../org/elasticsearch/search/SearchHit.java | 24 ++++++++--------- .../org/elasticsearch/search/SearchHits.java | 6 ++--- .../elasticsearch/search/SearchModule.java | 6 ++--- .../search/SearchParseException.java | 4 +-- .../search/SearchSortValues.java | 6 ++--- .../AbstractAggregationBuilder.java | 2 +- .../search/aggregations/Aggregation.java | 6 ++--- .../aggregations/AggregationBuilder.java | 6 ++--- .../search/aggregations/Aggregations.java | 6 ++--- .../search/aggregations/Aggregator.java | 8 +++--- .../aggregations/AggregatorFactories.java | 10 +++---- .../aggregations/BaseAggregationBuilder.java | 2 +- .../search/aggregations/BucketOrder.java | 2 +- .../aggregations/InternalAggregation.java | 2 +- .../search/aggregations/InternalOrder.java | 6 ++--- .../MultiBucketConsumerService.java | 2 +- .../aggregations/ParsedAggregation.java | 12 ++++----- .../ParsedMultiBucketAggregation.java | 6 ++--- .../PipelineAggregationBuilder.java | 2 +- .../InternalSingleBucketAggregation.java | 2 +- .../bucket/MultiBucketsAggregation.java | 2 +- .../bucket/ParsedSingleBucketAggregation.java | 4 +-- .../AdjacencyMatrixAggregationBuilder.java | 8 +++--- .../adjacency/AdjacencyMatrixAggregator.java | 10 +++---- .../adjacency/InternalAdjacencyMatrix.java | 2 +- .../adjacency/ParsedAdjacencyMatrix.java | 4 +-- .../composite/CompositeAggregation.java | 2 +- .../CompositeAggregationBuilder.java | 8 +++--- .../CompositeValuesSourceBuilder.java | 4 +-- .../CompositeValuesSourceParserHelper.java | 12 ++++----- .../DateHistogramValuesSourceBuilder.java | 8 +++--- .../GeoTileGridValuesSourceBuilder.java | 8 +++--- .../HistogramValuesSourceBuilder.java | 6 ++--- .../bucket/composite/InternalComposite.java | 2 +- .../bucket/composite/ParsedComposite.java | 8 +++--- .../composite/TermsValuesSourceBuilder.java | 6 ++--- .../filter/FilterAggregationBuilder.java | 4 +-- .../filter/FiltersAggregationBuilder.java | 6 ++--- .../bucket/filter/FiltersAggregator.java | 6 ++--- .../bucket/filter/InternalFilters.java | 2 +- .../bucket/filter/ParsedFilter.java | 2 +- .../bucket/filter/ParsedFilters.java | 6 ++--- .../bucket/filter/QueryToFilterAdapter.java | 2 +- .../geogrid/GeoGridAggregationBuilder.java | 12 ++++----- .../GeoHashGridAggregationBuilder.java | 2 +- .../GeoTileGridAggregationBuilder.java | 2 +- .../bucket/geogrid/GeoTileUtils.java | 4 +-- .../bucket/geogrid/InternalGeoGrid.java | 2 +- .../bucket/geogrid/InternalGeoGridBucket.java | 2 +- .../bucket/geogrid/ParsedGeoGrid.java | 4 +-- .../bucket/geogrid/ParsedGeoGridBucket.java | 2 +- .../bucket/geogrid/ParsedGeoHashGrid.java | 4 +-- .../geogrid/ParsedGeoHashGridBucket.java | 2 +- .../bucket/geogrid/ParsedGeoTileGrid.java | 4 +-- .../geogrid/ParsedGeoTileGridBucket.java | 2 +- .../global/GlobalAggregationBuilder.java | 4 +-- .../bucket/global/ParsedGlobal.java | 2 +- .../AutoDateHistogramAggregationBuilder.java | 6 ++--- .../DateHistogramAggregationBuilder.java | 6 ++--- .../histogram/DateHistogramInterval.java | 4 +-- .../bucket/histogram/DateIntervalWrapper.java | 10 +++---- .../bucket/histogram/DoubleBounds.java | 14 +++++----- .../bucket/histogram/Histogram.java | 2 +- .../HistogramAggregationBuilder.java | 6 ++--- .../histogram/InternalAutoDateHistogram.java | 2 +- .../histogram/InternalDateHistogram.java | 2 +- .../bucket/histogram/InternalHistogram.java | 2 +- .../InternalVariableWidthHistogram.java | 2 +- .../bucket/histogram/LongBounds.java | 16 ++++++------ .../histogram/ParsedAutoDateHistogram.java | 8 +++--- .../bucket/histogram/ParsedDateHistogram.java | 6 ++--- .../bucket/histogram/ParsedHistogram.java | 4 +-- .../ParsedVariableWidthHistogram.java | 6 ++--- ...iableWidthHistogramAggregationBuilder.java | 6 ++--- .../missing/MissingAggregationBuilder.java | 4 +-- .../bucket/missing/ParsedMissing.java | 2 +- .../nested/NestedAggregationBuilder.java | 4 +-- .../bucket/nested/NestedAggregator.java | 2 +- .../bucket/nested/ParsedNested.java | 2 +- .../bucket/nested/ParsedReverseNested.java | 2 +- .../ReverseNestedAggregationBuilder.java | 4 +-- .../nested/ReverseNestedAggregator.java | 2 +- .../bucket/range/AbstractRangeBuilder.java | 2 +- .../range/DateRangeAggregationBuilder.java | 2 +- .../range/GeoDistanceAggregationBuilder.java | 10 +++---- .../bucket/range/InternalBinaryRange.java | 2 +- .../bucket/range/InternalRange.java | 2 +- .../range/IpRangeAggregationBuilder.java | 12 ++++----- .../bucket/range/ParsedBinaryRange.java | 6 ++--- .../bucket/range/ParsedDateRange.java | 4 +-- .../bucket/range/ParsedGeoDistance.java | 4 +-- .../bucket/range/ParsedRange.java | 6 ++--- .../bucket/range/RangeAggregationBuilder.java | 2 +- .../bucket/range/RangeAggregator.java | 16 ++++++------ .../DiversifiedAggregationBuilder.java | 4 +-- .../bucket/sampler/ParsedSampler.java | 2 +- .../sampler/SamplerAggregationBuilder.java | 4 +-- .../bucket/sampler/SamplerAggregator.java | 2 +- .../bucket/sampler/UnmappedSampler.java | 2 +- .../bucket/terms/AbstractInternalTerms.java | 2 +- .../bucket/terms/DoubleTerms.java | 2 +- .../GlobalOrdinalsStringTermsAggregator.java | 2 +- .../bucket/terms/IncludeExclude.java | 8 +++--- .../bucket/terms/InternalMappedRareTerms.java | 2 +- .../terms/InternalMappedSignificantTerms.java | 2 +- .../bucket/terms/InternalMappedTerms.java | 2 +- .../bucket/terms/InternalRareTerms.java | 2 +- .../terms/InternalSignificantTerms.java | 2 +- .../bucket/terms/InternalTerms.java | 4 +-- .../bucket/terms/LongRareTerms.java | 2 +- .../aggregations/bucket/terms/LongTerms.java | 2 +- .../bucket/terms/ParsedDoubleTerms.java | 6 ++--- .../bucket/terms/ParsedLongRareTerms.java | 6 ++--- .../bucket/terms/ParsedLongTerms.java | 6 ++--- .../bucket/terms/ParsedRareTerms.java | 6 ++--- .../terms/ParsedSignificantLongTerms.java | 6 ++--- .../terms/ParsedSignificantStringTerms.java | 6 ++--- .../bucket/terms/ParsedSignificantTerms.java | 8 +++--- .../bucket/terms/ParsedStringRareTerms.java | 6 ++--- .../bucket/terms/ParsedStringTerms.java | 6 ++--- .../bucket/terms/ParsedTerms.java | 6 ++--- .../terms/RareTermsAggregationBuilder.java | 6 ++--- .../terms/RareTermsAggregatorFactory.java | 2 +- .../bucket/terms/SignificantLongTerms.java | 2 +- .../bucket/terms/SignificantStringTerms.java | 2 +- .../SignificantTermsAggregationBuilder.java | 8 +++--- .../SignificantTermsAggregatorFactory.java | 2 +- .../SignificantTextAggregationBuilder.java | 8 +++--- .../bucket/terms/StringRareTerms.java | 2 +- .../bucket/terms/StringTerms.java | 2 +- .../bucket/terms/TermsAggregationBuilder.java | 6 ++--- .../bucket/terms/TermsAggregator.java | 4 +-- .../bucket/terms/TermsAggregatorFactory.java | 2 +- .../bucket/terms/UnmappedRareTerms.java | 2 +- .../terms/UnmappedSignificantTerms.java | 2 +- .../bucket/terms/UnmappedTerms.java | 2 +- .../bucket/terms/heuristic/ChiSquare.java | 4 +-- .../bucket/terms/heuristic/GND.java | 6 ++--- .../bucket/terms/heuristic/JLHScore.java | 4 +-- .../terms/heuristic/MutualInformation.java | 4 +-- .../heuristic/NXYSignificanceHeuristic.java | 8 +++--- .../terms/heuristic/PercentageScore.java | 6 ++--- .../terms/heuristic/ScriptHeuristic.java | 6 ++--- .../heuristic/SignificanceHeuristic.java | 2 +- .../SignificanceHeuristicBuilder.java | 2 +- .../AbstractInternalHDRPercentiles.java | 2 +- .../AbstractInternalTDigestPercentiles.java | 2 +- ...AbstractPercentilesAggregationBuilder.java | 6 ++--- .../metrics/AvgAggregationBuilder.java | 4 +-- .../CardinalityAggregationBuilder.java | 6 ++--- .../ExtendedStatsAggregationBuilder.java | 4 +-- .../metrics/ExtendedStatsAggregator.java | 2 +- .../metrics/GeoBoundsAggregationBuilder.java | 4 +-- .../metrics/GeoBoundsAggregator.java | 2 +- .../GeoCentroidAggregationBuilder.java | 4 +-- .../aggregations/metrics/InternalAvg.java | 2 +- .../metrics/InternalCardinality.java | 2 +- .../metrics/InternalExtendedStats.java | 2 +- .../metrics/InternalGeoBounds.java | 2 +- .../metrics/InternalGeoCentroid.java | 4 +-- .../aggregations/metrics/InternalMax.java | 2 +- .../InternalMedianAbsoluteDeviation.java | 2 +- .../aggregations/metrics/InternalMin.java | 2 +- .../metrics/InternalScriptedMetric.java | 2 +- .../aggregations/metrics/InternalStats.java | 2 +- .../aggregations/metrics/InternalSum.java | 2 +- .../aggregations/metrics/InternalTopHits.java | 2 +- .../metrics/InternalValueCount.java | 2 +- .../metrics/InternalWeightedAvg.java | 2 +- .../metrics/MaxAggregationBuilder.java | 4 +-- ...anAbsoluteDeviationAggregationBuilder.java | 6 ++--- .../metrics/MinAggregationBuilder.java | 4 +-- .../aggregations/metrics/ParsedAvg.java | 6 ++--- .../metrics/ParsedCardinality.java | 6 ++--- .../metrics/ParsedExtendedStats.java | 16 ++++++------ .../aggregations/metrics/ParsedGeoBounds.java | 10 +++---- .../metrics/ParsedGeoCentroid.java | 6 ++--- .../metrics/ParsedHDRPercentileRanks.java | 4 +-- .../metrics/ParsedHDRPercentiles.java | 4 +-- .../aggregations/metrics/ParsedMax.java | 6 ++--- .../ParsedMedianAbsoluteDeviation.java | 6 ++--- .../aggregations/metrics/ParsedMin.java | 6 ++--- .../metrics/ParsedPercentiles.java | 6 ++--- .../metrics/ParsedScriptedMetric.java | 10 +++---- ...dSingleValueNumericMetricsAggregation.java | 4 +-- .../aggregations/metrics/ParsedStats.java | 10 +++---- .../aggregations/metrics/ParsedSum.java | 6 ++--- .../metrics/ParsedTDigestPercentileRanks.java | 4 +-- .../metrics/ParsedTDigestPercentiles.java | 4 +-- .../aggregations/metrics/ParsedTopHits.java | 8 +++--- .../metrics/ParsedValueCount.java | 6 ++--- .../metrics/ParsedWeightedAvg.java | 6 ++--- .../PercentileRanksAggregationBuilder.java | 4 +-- .../PercentilesAggregationBuilder.java | 4 +-- .../metrics/PercentilesConfig.java | 4 +-- .../metrics/PercentilesMethod.java | 4 +-- .../ScriptedMetricAggregationBuilder.java | 8 +++--- .../metrics/StatsAggregationBuilder.java | 4 +-- .../metrics/SumAggregationBuilder.java | 4 +-- .../metrics/TopHitsAggregationBuilder.java | 4 +-- .../metrics/ValueCountAggregationBuilder.java | 4 +-- .../WeightedAvgAggregationBuilder.java | 8 +++--- .../AbstractPipelineAggregationBuilder.java | 4 +-- .../AvgBucketPipelineAggregationBuilder.java | 2 +- .../aggregations/pipeline/BucketHelpers.java | 4 +-- .../pipeline/BucketMetricsParser.java | 4 +-- ...cketMetricsPipelineAggregationBuilder.java | 2 +- ...ucketScriptPipelineAggregationBuilder.java | 10 +++---- ...ketSelectorPipelineAggregationBuilder.java | 4 +-- .../BucketSortPipelineAggregationBuilder.java | 12 ++++----- ...mulativeSumPipelineAggregationBuilder.java | 6 ++--- .../DerivativePipelineAggregationBuilder.java | 6 ++--- .../pipeline/ExtendedStatsBucketParser.java | 4 +-- ...StatsBucketPipelineAggregationBuilder.java | 2 +- .../pipeline/InternalBucketMetricValue.java | 4 +-- .../pipeline/InternalDerivative.java | 2 +- .../pipeline/InternalPercentilesBucket.java | 2 +- .../pipeline/InternalSimpleValue.java | 2 +- .../MaxBucketPipelineAggregationBuilder.java | 2 +- .../MinBucketPipelineAggregationBuilder.java | 2 +- .../MovFnPipelineAggregationBuilder.java | 12 ++++----- .../pipeline/ParsedBucketMetricValue.java | 6 ++--- .../pipeline/ParsedDerivative.java | 10 +++---- .../pipeline/ParsedExtendedStatsBucket.java | 4 +-- .../pipeline/ParsedPercentilesBucket.java | 6 ++--- .../pipeline/ParsedSimpleValue.java | 6 ++--- .../pipeline/ParsedStatsBucket.java | 4 +-- ...tilesBucketPipelineAggregationBuilder.java | 6 ++--- .../pipeline/PipelineAggregator.java | 4 +-- .../SerialDiffPipelineAggregationBuilder.java | 6 ++--- ...StatsBucketPipelineAggregationBuilder.java | 2 +- .../SumBucketPipelineAggregationBuilder.java | 2 +- .../aggregations/support/AggregationInfo.java | 2 +- .../MultiValuesSourceAggregationBuilder.java | 2 +- .../support/MultiValuesSourceFieldConfig.java | 10 +++---- .../support/MultiValuesSourceParseHelper.java | 8 +++--- .../aggregations/support/ValueType.java | 2 +- .../ValuesSourceAggregationBuilder.java | 10 +++---- .../search/builder/PointInTimeBuilder.java | 10 +++---- .../search/builder/SearchSourceBuilder.java | 12 ++++----- .../search/collapse/CollapseBuilder.java | 12 ++++----- .../search/fetch/FetchPhase.java | 2 +- .../search/fetch/StoredFieldsContext.java | 4 +-- .../fetch/subphase/FetchSourceContext.java | 8 +++--- .../fetch/subphase/FetchSourcePhase.java | 4 +-- .../search/fetch/subphase/FieldAndFormat.java | 14 +++++----- .../highlight/AbstractHighlighterBuilder.java | 12 ++++----- .../subphase/highlight/HighlightBuilder.java | 12 ++++----- .../subphase/highlight/HighlightField.java | 6 ++--- .../internal/InternalSearchResponse.java | 2 +- .../search/lookup/SourceLookup.java | 2 +- .../search/profile/ProfileResult.java | 14 +++++----- .../search/profile/SearchProfileResults.java | 6 ++--- .../profile/SearchProfileShardResult.java | 4 +-- .../AggregationProfileShardResult.java | 6 ++--- .../search/profile/query/CollectorResult.java | 10 +++---- .../query/QueryProfileShardResult.java | 6 ++--- .../search/rescore/QueryRescorerBuilder.java | 8 +++--- .../search/rescore/RescorerBuilder.java | 8 +++--- .../searchafter/SearchAfterBuilder.java | 10 +++---- .../search/slice/SliceBuilder.java | 10 +++---- .../search/sort/FieldSortBuilder.java | 12 ++++----- .../search/sort/GeoDistanceSortBuilder.java | 10 +++---- .../search/sort/NestedSortBuilder.java | 8 +++--- .../search/sort/ScoreSortBuilder.java | 8 +++--- .../search/sort/ScriptSortBuilder.java | 14 +++++----- .../search/sort/SortBuilder.java | 6 ++--- .../elasticsearch/search/sort/SortValue.java | 2 +- .../elasticsearch/search/suggest/Suggest.java | 10 +++---- .../search/suggest/SuggestBuilder.java | 8 +++--- .../search/suggest/SuggestionBuilder.java | 8 +++--- .../suggest/completion/CompletionStats.java | 4 +-- .../completion/CompletionSuggestion.java | 8 +++--- .../CompletionSuggestionBuilder.java | 16 ++++++------ .../suggest/completion/FuzzyOptions.java | 10 +++---- .../suggest/completion/RegexOptions.java | 10 +++---- .../context/CategoryContextMapping.java | 6 ++--- .../context/CategoryQueryContext.java | 12 ++++----- .../completion/context/ContextMapping.java | 12 ++++----- .../completion/context/ContextMappings.java | 4 +-- .../completion/context/GeoContextMapping.java | 6 ++--- .../completion/context/GeoQueryContext.java | 10 +++---- .../DirectCandidateGeneratorBuilder.java | 8 +++--- .../search/suggest/phrase/Laplace.java | 8 +++--- .../suggest/phrase/LinearInterpolation.java | 8 +++--- .../suggest/phrase/PhraseSuggester.java | 4 +-- .../suggest/phrase/PhraseSuggestion.java | 12 ++++----- .../phrase/PhraseSuggestionBuilder.java | 10 +++---- .../search/suggest/phrase/SmoothingModel.java | 7 +++-- .../search/suggest/phrase/StupidBackoff.java | 8 +++--- .../search/suggest/term/TermSuggestion.java | 12 ++++----- .../suggest/term/TermSuggestionBuilder.java | 4 +-- .../elasticsearch/snapshots/RestoreInfo.java | 10 +++---- .../snapshots/SnapshotFeatureInfo.java | 10 +++---- .../elasticsearch/snapshots/SnapshotId.java | 4 +-- .../elasticsearch/snapshots/SnapshotInfo.java | 16 ++++++------ .../snapshots/SnapshotShardFailure.java | 8 +++--- .../elasticsearch/tasks/RawTaskStatus.java | 2 +- .../java/org/elasticsearch/tasks/Task.java | 4 +-- .../java/org/elasticsearch/tasks/TaskId.java | 4 +-- .../org/elasticsearch/tasks/TaskInfo.java | 14 +++++----- .../org/elasticsearch/tasks/TaskResult.java | 16 ++++++------ .../tasks/TaskResultsService.java | 8 +++--- .../elasticsearch/threadpool/ThreadPool.java | 4 +-- .../threadpool/ThreadPoolInfo.java | 2 +- .../threadpool/ThreadPoolStats.java | 6 ++--- .../transport/ProxyConnectionStrategy.java | 2 +- .../transport/RemoteConnectionInfo.java | 4 +-- .../transport/SniffConnectionStrategy.java | 2 +- .../transport/TransportInfo.java | 2 +- .../transport/TransportStats.java | 4 +-- ...org.elasticsearch.xcontent.ErrorOnUnknown} | 0 ...csearch.xcontent.XContentBuilderExtension} | 0 .../ElasticsearchExceptionTests.java | 16 ++++++------ .../ExceptionSerializationTests.java | 2 +- .../action/DocWriteResponseTests.java | 8 +++--- .../ShardOperationFailedExceptionTests.java | 2 +- .../action/TaskOperationFailureTests.java | 2 +- .../ClusterAllocationExplainActionTests.java | 6 ++--- .../ClusterAllocationExplanationTests.java | 6 ++--- .../health/ClusterHealthResponsesTests.java | 4 +-- .../cluster/node/tasks/TestTaskPlugin.java | 4 +-- .../node/tasks/TransportTasksActionTests.java | 8 +++--- .../put/PutRepositoryRequestTests.java | 6 ++--- .../verify/VerifyRepositoryResponseTests.java | 2 +- .../reroute/ClusterRerouteRequestTests.java | 10 +++---- .../reroute/ClusterRerouteResponseTests.java | 6 ++--- .../ClusterGetSettingsResponseTests.java | 2 +- .../ClusterUpdateSettingsRequestTests.java | 8 +++--- .../ClusterUpdateSettingsResponseTests.java | 2 +- .../create/CreateSnapshotRequestTests.java | 12 ++++----- .../create/CreateSnapshotResponseTests.java | 2 +- .../get/GetSnapshotsResponseTests.java | 4 +-- .../restore/RestoreSnapshotRequestTests.java | 12 ++++----- .../restore/RestoreSnapshotResponseTests.java | 2 +- .../status/SnapshotIndexShardStatusTests.java | 2 +- .../status/SnapshotIndexStatusTests.java | 2 +- .../status/SnapshotShardsStatsTests.java | 2 +- .../snapshots/status/SnapshotStatsTests.java | 2 +- .../snapshots/status/SnapshotStatusTests.java | 2 +- .../status/SnapshotsStatusResponseTests.java | 2 +- .../cluster/stats/ClusterStatsNodesTests.java | 2 +- .../GetScriptContextResponseTests.java | 2 +- .../GetScriptLanguageResponseTests.java | 2 +- .../GetStoredScriptResponseTests.java | 4 +-- .../PutStoredScriptRequestTests.java | 6 ++--- .../ScriptContextInfoSerializingTests.java | 2 +- .../ScriptMethodInfoSerializingTests.java | 2 +- .../ScriptParameterInfoSerializingTests.java | 2 +- .../indices/alias/AliasActionsTests.java | 12 ++++----- .../alias/IndicesAliasesRequestTests.java | 6 ++--- .../indices/analyze/AnalyzeResponseTests.java | 6 ++--- .../clear/ClearIndicesCacheResponseTests.java | 2 +- .../close/CloseIndexResponseTests.java | 6 ++--- .../CreateIndexRequestBuilderTests.java | 6 ++--- .../create/CreateIndexRequestTests.java | 12 ++++----- .../create/CreateIndexResponseTests.java | 4 +-- .../indices/flush/FlushResponseTests.java | 2 +- .../forcemerge/ForceMergeResponseTests.java | 2 +- .../forcemerge/RestForceMergeActionTests.java | 6 ++--- .../get/GetFieldMappingsResponseTests.java | 8 +++--- .../mapping/put/PutMappingRequestTests.java | 2 +- .../indices/open/OpenIndexResponseTests.java | 2 +- .../indices/refresh/RefreshResponseTests.java | 2 +- .../resolve/ResolveIndexResponseTests.java | 4 +-- .../MetadataRolloverServiceTests.java | 2 +- .../rollover/RolloverRequestTests.java | 12 ++++----- .../segments/IndicesSegmentResponseTests.java | 6 ++--- .../get/GetSettingsResponseTests.java | 2 +- .../put/UpdateSettingsRequestTests.java | 4 +-- .../IndicesShardStoreResponseTests.java | 10 +++---- .../indices/shrink/ResizeRequestTests.java | 6 ++--- .../indices/shrink/ResizeResponseTests.java | 2 +- .../stats/IndicesStatsResponseTests.java | 4 +-- .../indices/stats/IndicesStatsTests.java | 4 +-- .../put/PutIndexTemplateRequestTests.java | 6 ++--- .../validate/query/QueryExplanationTests.java | 2 +- .../query/ValidateQueryResponseTests.java | 2 +- .../action/bulk/BulkItemResponseTests.java | 6 ++--- .../action/bulk/BulkProcessorTests.java | 2 +- .../action/bulk/BulkRequestModifierTests.java | 2 +- .../action/bulk/BulkRequestParserTests.java | 2 +- .../action/bulk/BulkRequestTests.java | 6 ++--- .../action/bulk/BulkResponseTests.java | 6 ++--- .../bulk/TransportBulkActionTookTests.java | 2 +- .../action/delete/DeleteResponseTests.java | 6 ++--- .../action/explain/ExplainResponseTests.java | 10 +++---- .../FieldCapabilitiesRequestTests.java | 8 +++--- .../FieldCapabilitiesResponseTests.java | 6 ++--- .../fieldcaps/FieldCapabilitiesTests.java | 2 +- .../MergedFieldCapabilitiesResponseTests.java | 10 +++---- .../action/get/GetResponseTests.java | 6 ++--- .../action/get/MultiGetRequestTests.java | 10 +++---- .../action/get/MultiGetResponseTests.java | 8 +++--- .../get/TransportMultiGetActionTests.java | 4 +-- .../index/IndexRequestBuilderTests.java | 6 ++--- .../action/index/IndexRequestTests.java | 2 +- .../action/index/IndexResponseTests.java | 6 ++--- .../ingest/GetPipelineResponseTests.java | 8 +++--- .../ingest/PutPipelineRequestTests.java | 6 ++--- .../SimulateDocumentBaseResultTests.java | 2 +- .../SimulateDocumentVerboseResultTests.java | 2 +- .../ingest/SimulatePipelineRequestTests.java | 2 +- .../ingest/SimulatePipelineResponseTests.java | 2 +- .../ingest/SimulateProcessorResultTests.java | 2 +- .../ingest/WriteableIngestDocumentTests.java | 10 +++---- .../action/main/MainResponseTests.java | 8 +++--- .../CanMatchPreFilterSearchPhaseTests.java | 2 +- .../search/ClearScrollRequestTests.java | 12 ++++----- .../search/MultiSearchRequestTests.java | 12 ++++----- .../search/MultiSearchResponseTests.java | 4 +-- .../SearchPhaseExecutionExceptionTests.java | 8 +++--- .../action/search/SearchResponseTests.java | 10 +++---- .../search/SearchScrollRequestTests.java | 12 ++++----- .../search/ShardSearchFailureTests.java | 6 ++--- ...ultShardOperationFailedExceptionTests.java | 8 +++--- .../action/support/IndicesOptionsTests.java | 14 +++++----- .../replication/ReplicationResponseTests.java | 6 ++--- .../AbstractTermVectorsTestCase.java | 4 +-- .../termvectors/GetTermVectorsTests.java | 4 +-- .../termvectors/TermVectorsUnitTests.java | 6 ++--- .../TransportMultiTermVectorsActionTests.java | 4 +-- .../action/update/UpdateRequestTests.java | 16 ++++++------ .../action/update/UpdateResponseTests.java | 6 ++--- .../client/AbstractClientHeadersTestCase.java | 2 +- .../cluster/ClusterStateTests.java | 6 ++--- .../SnapshotDeletionsInProgressTests.java | 6 ++--- .../CoordinationMetadataTests.java | 8 +++--- .../coordination/CoordinatorTests.java | 2 +- .../ElasticsearchNodeCommandTests.java | 8 +++--- .../health/ClusterIndexHealthTests.java | 4 +-- .../health/ClusterShardHealthTests.java | 2 +- .../cluster/metadata/AliasMetadataTests.java | 2 +- .../metadata/ComponentTemplateTests.java | 6 ++--- .../ComposableIndexTemplateTests.java | 2 +- .../metadata/DataStreamAliasTests.java | 4 +-- .../metadata/DataStreamMetadataTests.java | 2 +- .../metadata/DataStreamTemplateTests.java | 2 +- .../cluster/metadata/DataStreamTests.java | 2 +- .../cluster/metadata/IndexGraveyardTests.java | 8 +++--- .../cluster/metadata/IndexMetadataTests.java | 8 +++--- .../metadata/IndexTemplateMetadataTests.java | 14 +++++----- .../cluster/metadata/ManifestTests.java | 6 ++--- .../MetadataCreateIndexServiceTests.java | 4 +-- .../MetadataIndexTemplateServiceTests.java | 4 +-- .../cluster/metadata/MetadataTests.java | 6 ++--- .../metadata/NodesShutdownMetadataTests.java | 2 +- .../metadata/ToAndFromJsonMetadataTests.java | 6 ++--- .../cluster/node/DiscoveryNodeTests.java | 2 +- .../cluster/routing/AllocationIdTests.java | 6 ++--- .../allocation/AllocationCommandsTests.java | 6 ++--- .../ClusterSerializationTests.java | 2 +- .../elasticsearch/common/StringsTests.java | 4 +-- .../DeflateCompressedXContentTests.java | 8 +++--- .../common/geo/GeoBoundingBoxTests.java | 6 ++--- .../common/geo/GeoJsonParserTests.java | 10 +++---- .../common/geo/GeoJsonSerializationTests.java | 14 +++++----- .../common/geo/GeoUtilTests.java | 8 +++--- .../common/geo/GeometryIndexerTests.java | 6 ++--- .../common/geo/GeometryParserTests.java | 10 +++---- .../common/network/NetworkModuleTests.java | 2 +- .../common/settings/SettingsFilterTests.java | 4 +-- .../common/settings/SettingsTests.java | 8 +++--- .../common/unit/FuzzinessTests.java | 6 ++--- .../common/xcontent/BaseXContentTestCase.java | 15 ++++++++++- .../CompatibleNamedXContentRegistryTests.java | 7 +++++ .../common/xcontent/XContentFactoryTests.java | 3 +++ .../xcontent/XContentParserUtilsTests.java | 10 ++++++- .../common/xcontent/XContentTypeTests.java | 2 ++ .../builder/XContentBuilderTests.java | 12 ++++----- .../cbor/CborXContentParserTests.java | 5 ++-- .../xcontent/cbor/CborXContentTests.java | 4 +-- .../common/xcontent/cbor/JsonVsCborTests.java | 11 ++++---- .../xcontent/json/JsonXContentTests.java | 2 +- .../xcontent/smile/JsonVsSmileTests.java | 11 ++++---- .../xcontent/smile/SmileXContentTests.java | 4 +-- .../support/AbstractFilteringTestCase.java | 14 +++++----- .../xcontent/support/XContentHelperTests.java | 14 +++++----- .../support/XContentMapValuesTests.java | 12 ++++----- .../AbstractXContentFilteringTestCase.java | 15 ++++++----- .../filtering/CborXContentFilteringTests.java | 4 +-- .../FilterPathGeneratorFilteringTests.java | 1 + .../support/filtering/FilterPathTests.java | 1 + .../filtering/JsonXContentFilteringTests.java | 4 +-- .../SmileFilteringGeneratorTests.java | 4 +-- .../YamlFilteringGeneratorTests.java | 4 +-- .../xcontent/yaml/YamlXContentTests.java | 2 +- .../IncrementalClusterStateWriterTests.java | 6 ++--- .../gateway/MetadataStateFormatTests.java | 8 +++--- .../AbstractHttpServerTransportTests.java | 2 +- .../http/DefaultRestChannelTests.java | 4 +-- .../org/elasticsearch/http/HttpInfoTests.java | 6 ++--- .../index/IndexServiceTests.java | 8 +++--- .../org/elasticsearch/index/IndexTests.java | 8 +++--- .../index/IndexingSlowLogTests.java | 4 +-- .../index/analysis/PreBuiltAnalyzerTests.java | 4 +-- .../index/engine/InternalEngineTests.java | 2 +- .../fielddata/BinaryDVFieldDataTests.java | 6 ++--- .../index/get/DocumentFieldTests.java | 6 ++--- .../index/get/GetResultTests.java | 10 +++---- .../AbstractScriptFieldTypeTestCase.java | 8 +++--- .../index/mapper/BinaryFieldMapperTests.java | 2 +- .../index/mapper/BooleanFieldMapperTests.java | 6 ++--- .../mapper/BooleanScriptFieldTypeTests.java | 8 +++--- .../index/mapper/ByteFieldMapperTests.java | 2 +- .../mapper/CompletionFieldMapperTests.java | 10 +++---- .../mapper/CompositeRuntimeFieldTests.java | 4 +-- .../index/mapper/CopyToMapperTests.java | 12 ++++----- .../index/mapper/DateFieldMapperTests.java | 2 +- .../mapper/DateScriptFieldTypeTests.java | 2 +- .../index/mapper/DocumentParserTests.java | 8 +++--- .../index/mapper/DoubleFieldMapperTests.java | 2 +- .../index/mapper/DynamicMappingTests.java | 4 +-- .../index/mapper/DynamicTemplateTests.java | 6 ++--- .../index/mapper/DynamicTemplatesTests.java | 6 ++--- .../index/mapper/FieldAliasMapperTests.java | 2 +- .../mapper/FieldFilterMapperPluginTests.java | 2 +- .../mapper/FieldNamesFieldMapperTests.java | 4 +-- .../index/mapper/FloatFieldMapperTests.java | 2 +- .../mapper/GeoPointFieldMapperTests.java | 4 +-- .../mapper/GeoShapeFieldMapperTests.java | 4 +-- .../mapper/HalfFloatFieldMapperTests.java | 2 +- .../index/mapper/IntegerFieldMapperTests.java | 2 +- .../index/mapper/IpFieldMapperTests.java | 2 +- .../mapper/JavaMultiFieldMergeTests.java | 4 +-- .../index/mapper/KeywordFieldMapperTests.java | 2 +- .../index/mapper/LongFieldMapperTests.java | 4 +-- .../index/mapper/MapperServiceTests.java | 4 +-- .../index/mapper/MappingParserTests.java | 2 +- .../index/mapper/MultiFieldTests.java | 2 +- .../index/mapper/NestedObjectMapperTests.java | 6 ++--- .../mapper/NestedPathFieldMapperTests.java | 2 +- .../mapper/NullValueObjectMappingTests.java | 4 +-- .../index/mapper/NullValueTests.java | 6 ++--- .../index/mapper/NumberFieldMapperTests.java | 2 +- .../index/mapper/NumberFieldTypeTests.java | 4 +-- .../index/mapper/ObjectMapperTests.java | 4 +-- .../index/mapper/ParametrizedMapperTests.java | 6 ++--- .../mapper/PathMatchDynamicTemplateTests.java | 2 +- .../index/mapper/RangeFieldMapperTests.java | 6 ++--- .../index/mapper/ReloadableAnalyzerTests.java | 2 +- .../index/mapper/RootObjectMapperTests.java | 4 +-- .../index/mapper/RoutingFieldMapperTests.java | 4 +-- .../index/mapper/ShortFieldMapperTests.java | 2 +- .../index/mapper/SourceFieldMapperTests.java | 8 +++--- .../mapper/StoredNumericValuesTests.java | 4 +-- .../index/mapper/TestRuntimeField.java | 2 +- .../index/mapper/TextFieldMapperTests.java | 6 ++--- .../index/mapper/TypeParsersTests.java | 4 +-- .../index/mapper/UpdateMappingTests.java | 4 +-- .../flattened/FlattenedFieldMapperTests.java | 4 +-- .../flattened/FlattenedFieldParserTests.java | 8 +++--- .../flattened/FlattenedFieldSearchTests.java | 4 +-- .../query/AbstractQueryBuilderTests.java | 6 ++--- .../index/query/BoolQueryBuilderTests.java | 12 ++++----- .../CombineIntervalsSourceProviderTests.java | 2 +- .../CombinedFieldsQueryParsingTests.java | 2 +- ...sjunctionIntervalsSourceProviderTests.java | 2 +- .../FilterIntervalsSourceProviderTests.java | 2 +- .../FuzzyIntervalsSourceProviderTests.java | 2 +- .../query/GeoShapeQueryBuilderTests.java | 8 +++--- .../index/query/IdsQueryBuilderTests.java | 2 +- .../index/query/InnerHitBuilderTests.java | 12 ++++----- .../query/IntervalQueryBuilderTests.java | 4 +-- .../MatchIntervalsSourceProviderTests.java | 2 +- .../query/MoreLikeThisQueryBuilderTests.java | 10 +++---- .../PrefixIntervalsSourceProviderTests.java | 2 +- .../query/QueryStringQueryBuilderTests.java | 6 ++--- .../index/query/RangeQueryRewriteTests.java | 2 +- .../query/SearchExecutionContextTests.java | 4 +-- .../query/SpanFirstQueryBuilderTests.java | 4 +-- .../query/SpanMultiTermQueryBuilderTests.java | 4 +-- .../index/query/SpanNotQueryBuilderTests.java | 4 +-- .../index/query/TermsQueryBuilderTests.java | 6 ++--- .../WildcardIntervalsSourceProviderTests.java | 2 +- .../index/query/WrapperQueryBuilderTests.java | 2 +- .../FunctionScoreQueryBuilderTests.java | 6 ++--- .../index/query/plugin/DummyQueryBuilder.java | 4 +-- .../AbstractBulkByScrollRequestTestCase.java | 2 +- .../reindex/BulkByScrollResponseTests.java | 4 +-- ...ulkByScrollTaskStatusOrExceptionTests.java | 4 +-- .../reindex/BulkByScrollTaskStatusTests.java | 4 +-- .../index/reindex/BulkByScrollTaskTests.java | 6 ++--- .../reindex/DeleteByQueryRequestTests.java | 2 +- .../index/reindex/ReindexRequestTests.java | 10 +++---- .../reindex/UpdateByQueryRequestTests.java | 2 +- .../IndexLevelReplicationTests.java | 2 +- .../RecoveryDuringReplicationTests.java | 2 +- .../search/MultiMatchQueryParserTests.java | 2 +- .../index/search/NestedHelperTests.java | 4 +-- .../search/geo/GeoPointParsingTests.java | 6 ++--- .../index/search/geo/GeoUtilsTests.java | 8 +++--- .../search/nested/NestedSortingTests.java | 4 +-- ...ReplicationTrackerRetentionLeaseTests.java | 2 +- .../seqno/RetentionLeaseXContentTests.java | 2 +- .../index/seqno/RetentionLeasesTests.java | 2 +- .../seqno/RetentionLeasesXContentTests.java | 2 +- .../IndexLongFieldRangeXContentTests.java | 2 +- .../index/shard/IndexShardTests.java | 12 ++++----- .../shard/PrimaryReplicaSyncerTests.java | 8 +++--- .../index/shard/RefreshListenersTests.java | 2 +- .../index/shard/ShardGetServiceTests.java | 2 +- .../index/similarity/SimilarityTests.java | 4 +-- .../snapshots/blobstore/FileInfoTests.java | 12 ++++----- .../termvectors/TermVectorsServiceTests.java | 4 +-- .../index/translog/TranslogTests.java | 8 +++--- .../IndexingMemoryControllerTests.java | 2 +- .../indices/IndicesRequestCacheTests.java | 2 +- .../indices/NodeIndicesStatsTests.java | 2 +- .../indices/SystemIndexDescriptorTests.java | 2 +- .../indices/SystemIndexManagerTests.java | 4 +-- .../indices/TermsLookupTests.java | 4 +-- .../indices/analysis/AnalysisModuleTests.java | 2 +- .../indices/cluster/ClusterStateChanges.java | 2 +- .../PeerRecoveryTargetServiceTests.java | 2 +- .../recovery/RecoverySourceHandlerTests.java | 2 +- .../indices/recovery/RecoveryTests.java | 2 +- .../ingest/IngestMetadataTests.java | 10 +++---- .../ingest/IngestServiceTests.java | 6 ++--- .../ingest/PipelineConfigurationTests.java | 14 +++++----- .../org/elasticsearch/node/NodeTests.java | 16 ++++++------ .../nodesinfo/NodeInfoStreamingTests.java | 6 ++--- .../PersistentTasksCustomMetadataTests.java | 14 +++++----- .../persistent/TestPersistentTasksPlugin.java | 12 ++++----- .../spi/NamedXContentProviderTests.java | 4 +-- .../repositories/IndexIdTests.java | 8 +++--- .../repositories/RepositoriesModuleTests.java | 2 +- .../RepositoriesServiceTests.java | 2 +- .../repositories/RepositoryDataTests.java | 10 +++---- .../blobstore/BlobStoreRepositoryTests.java | 2 +- .../repositories/fs/FsRepositoryTests.java | 2 +- .../rest/BaseRestHandlerTests.java | 6 ++--- .../rest/BytesRestResponseTests.java | 6 ++--- .../RestCompatibleVersionHelperTests.java | 2 +- .../rest/RestControllerTests.java | 8 +++--- .../elasticsearch/rest/RestRequestTests.java | 6 ++--- .../rest/action/RestActionsTests.java | 10 +++---- .../rest/action/RestBuilderListenerTests.java | 2 +- .../rest/action/RestMainActionTests.java | 6 ++--- .../RestReloadSecureSettingsActionTests.java | 8 +++--- .../admin/indices/RestAnalyzeActionTests.java | 6 ++--- .../indices/RestCreateIndexActionTests.java | 6 ++--- .../indices/RestGetAliasesActionTests.java | 6 ++--- .../RestPutIndexTemplateActionTests.java | 6 ++--- .../indices/RestValidateQueryActionTests.java | 2 +- .../rest/action/cat/RestTableTests.java | 2 +- .../rest/action/cat/RestTasksActionTests.java | 2 +- .../action/document/RestBulkActionTests.java | 2 +- .../action/document/RestIndexActionTests.java | 2 +- .../document/RestMultiGetActionTests.java | 6 ++--- .../RestMultiTermVectorsActionTests.java | 6 ++--- .../document/RestTermVectorsActionTests.java | 6 ++--- .../document/RestUpdateActionTests.java | 2 +- .../action/search/RestExplainActionTests.java | 2 +- .../search/RestMultiSearchActionTests.java | 2 +- .../script/ScriptContextInfoTests.java | 12 ++++----- .../script/ScriptMetadataTests.java | 12 ++++----- .../script/ScriptServiceTests.java | 4 +-- .../script/ScriptStatsTests.java | 6 ++--- .../org/elasticsearch/script/ScriptTests.java | 10 +++---- .../script/StoredScriptSourceTests.java | 6 ++--- .../script/StoredScriptTests.java | 8 +++--- .../search/AbstractSearchTestCase.java | 6 ++--- .../search/ClearScrollResponseTests.java | 10 +++---- .../search/NestedIdentityTests.java | 12 ++++----- .../elasticsearch/search/SearchHitTests.java | 10 +++---- .../elasticsearch/search/SearchHitsTests.java | 10 +++---- .../search/SearchModuleTests.java | 8 +++--- .../search/SearchServiceTests.java | 4 +-- .../search/SearchSortValuesTests.java | 10 +++---- .../aggregations/AggregationsTests.java | 14 +++++----- .../AggregatorFactoriesBuilderTests.java | 4 +-- .../AggregatorFactoriesTests.java | 12 ++++----- .../aggregations/InternalOrderTests.java | 4 +-- .../aggregations/bucket/DateRangeTests.java | 6 ++--- .../aggregations/bucket/FiltersTests.java | 8 +++--- .../bucket/GeoDistanceRangeTests.java | 6 ++--- .../aggregations/bucket/RangeTests.java | 6 ++--- .../bucket/ShardSizeTestCase.java | 2 +- .../geogrid/GeoHashGridParserTests.java | 6 ++--- .../geogrid/GeoTileGridParserTests.java | 6 ++--- .../bucket/histogram/DoubleBoundsTests.java | 8 +++--- .../bucket/histogram/LongBoundsTests.java | 8 +++--- .../range/RangeAggregationBuilderTests.java | 4 +-- .../metrics/AbstractGeoTestCase.java | 8 +++--- .../metrics/AbstractPercentilesTestCase.java | 6 ++--- .../metrics/InternalStatsTests.java | 6 ++--- .../metrics/InternalTopHitsTests.java | 6 ++--- .../metrics/PercentilesTests.java | 6 ++--- .../aggregations/metrics/TopHitsTests.java | 6 ++--- .../WeightedAvgAggregationBuilderTests.java | 4 +-- .../pipeline/BucketHelpersTests.java | 2 +- .../pipeline/BucketScriptTests.java | 4 +-- .../pipeline/ExtendedStatsBucketTests.java | 4 +-- .../InternalPercentilesBucketTests.java | 6 ++--- .../pipeline/PercentilesBucketTests.java | 4 +-- .../support/IncludeExcludeTests.java | 12 ++++----- .../MultiValuesSourceFieldConfigTests.java | 4 +-- .../builder/PointInTimeBuilderTests.java | 2 +- .../builder/SearchSourceBuilderTests.java | 12 ++++----- .../search/collapse/CollapseBuilderTests.java | 4 +-- .../subphase/FetchSourceContextTests.java | 6 ++--- .../fetch/subphase/FetchSourcePhaseTests.java | 4 +-- .../fetch/subphase/FieldFetcherTests.java | 6 ++--- .../highlight/HighlightBuilderTests.java | 16 ++++++------ .../highlight/HighlightFieldTests.java | 12 ++++----- .../search/geo/GeoPointShapeQueryTests.java | 6 ++--- .../search/geo/GeoShapeQueryTests.java | 6 ++--- .../internal/ShardSearchRequestTests.java | 10 +++---- .../search/profile/ProfileResultTests.java | 8 +++--- .../profile/SearchProfileResultsTests.java | 2 +- .../AggregationProfileShardResultTests.java | 4 +-- .../profile/query/CollectorResultTests.java | 8 +++--- .../query/QueryProfileShardResultTests.java | 2 +- .../rescore/QueryRescorerBuilderTests.java | 18 ++++++------- .../scroll/RestClearScrollActionTests.java | 2 +- .../scroll/RestSearchScrollActionTests.java | 2 +- .../searchafter/SearchAfterBuilderTests.java | 10 +++---- .../search/slice/SliceBuilderTests.java | 8 +++--- .../search/sort/AbstractSortTestCase.java | 12 ++++----- .../search/sort/FieldSortBuilderTests.java | 6 ++--- .../sort/GeoDistanceSortBuilderTests.java | 8 +++--- .../search/sort/NestedSortBuilderTests.java | 12 ++++----- .../search/sort/ScoreSortBuilderTests.java | 4 +-- .../search/sort/ScriptSortBuilderTests.java | 6 ++--- .../search/sort/SortBuilderTests.java | 12 ++++----- .../search/sort/SortValueTests.java | 4 +-- .../AbstractSuggestionBuilderTestCase.java | 12 ++++----- .../CompletionSuggestionOptionTests.java | 6 ++--- .../search/suggest/SuggestBuilderTests.java | 12 ++++----- .../search/suggest/SuggestTests.java | 14 +++++----- .../search/suggest/SuggestionEntryTests.java | 6 ++--- .../search/suggest/SuggestionOptionTests.java | 6 ++--- .../search/suggest/SuggestionTests.java | 16 ++++++------ .../suggest/TermSuggestionOptionTests.java | 6 ++--- .../CategoryContextMappingTests.java | 12 ++++----- .../completion/CategoryQueryContextTests.java | 2 +- .../CompletionSuggesterBuilderTests.java | 2 +- .../completion/GeoContextMappingTests.java | 10 +++---- .../completion/GeoQueryContextTests.java | 8 +++--- .../completion/QueryContextTestCase.java | 8 +++--- .../phrase/DirectCandidateGeneratorTests.java | 14 +++++----- .../suggest/phrase/LaplaceModelTests.java | 2 +- .../phrase/LinearInterpolationModelTests.java | 2 +- .../phrase/SmoothingModelTestCase.java | 10 +++---- .../phrase/StupidBackoffModelTests.java | 2 +- .../term/TermSuggestionBuilderTests.java | 4 +-- .../snapshots/BlobStoreFormatTests.java | 8 +++--- ...epositoriesMetadataSerializationTests.java | 2 +- .../snapshots/SnapshotFeatureInfoTests.java | 2 +- .../SnapshotInfoBlobSerializationTests.java | 2 +- .../snapshots/SnapshotRequestsTests.java | 4 +-- .../snapshots/SnapshotResiliencyTests.java | 2 +- ...napshotShardFailureSerializationTests.java | 2 +- ...SnapshotsInProgressSerializationTests.java | 6 ++--- .../tasks/CancelTasksResponseTests.java | 4 +-- .../tasks/ListTasksResponseTests.java | 4 +-- .../elasticsearch/tasks/TaskInfoTests.java | 4 +-- .../elasticsearch/tasks/TaskResultTests.java | 10 +++---- .../SharedSignificantTermsTestMethods.java | 2 +- .../ThreadPoolSerializationTests.java | 6 ++--- .../threadpool/ThreadPoolStatsTests.java | 10 +++---- .../RemoteClusterConnectionTests.java | 4 +-- .../transport/TransportInfoTests.java | 6 ++--- .../DelayedShardAggregationBuilder.java | 6 ++--- .../RestDieWithDignityAction.java | 2 +- .../test/errorquery/ErrorQueryBuilder.java | 8 +++--- .../test/errorquery/IndexError.java | 12 ++++----- .../common/logging/JsonLogLine.java | 4 +-- .../common/logging/JsonLogsIntegTestCase.java | 2 +- .../common/logging/JsonLogsStream.java | 10 +++---- .../gateway/MockGatewayMetaState.java | 2 +- .../elasticsearch/index/MapperTestUtils.java | 2 +- .../index/RandomCreateIndexGenerator.java | 6 ++--- .../index/engine/EngineTestCase.java | 8 +++--- .../index/engine/TranslogHandler.java | 2 +- .../AbstractNumericFieldMapperTestCase.java | 2 +- .../index/mapper/MapperServiceTestCase.java | 10 +++---- .../index/mapper/MapperTestCase.java | 6 ++--- .../index/mapper/MetadataMapperTestCase.java | 2 +- .../mapper/TestDocumentParserContext.java | 2 +- .../ESIndexLevelReplicationTestCase.java | 2 +- .../index/shard/IndexShardTestCase.java | 2 +- .../blobstore/BlobStoreTestUtil.java | 6 ++--- .../search/RandomSearchRequestGenerator.java | 12 ++++----- .../aggregations/AggregatorTestCase.java | 4 +-- .../aggregations/BaseAggregationTestCase.java | 10 +++---- .../BasePipelineAggregationTestCase.java | 12 ++++----- ...ternalSingleBucketAggregationTestCase.java | 4 +-- ...AbstractSignificanceHeuristicTestCase.java | 14 +++++----- .../metrics/AbstractNumericTestCase.java | 2 +- .../geo/GeoBoundingBoxQueryIntegTestCase.java | 4 +-- .../geo/GeoPointShapeQueryTestCase.java | 6 ++--- .../search/geo/GeoShapeIntegTestCase.java | 8 +++--- .../search/geo/GeoShapeQueryTestCase.java | 12 ++++----- .../AbstractSnapshotIntegTestCase.java | 10 +++---- .../snapshots/mockstore/MockRepository.java | 2 +- .../AbstractBroadcastResponseTestCase.java | 6 ++--- .../test/AbstractBuilderTestCase.java | 2 +- ...AbstractDiffableSerializationTestCase.java | 2 +- .../test/AbstractQueryTestCase.java | 20 +++++++------- .../AbstractSchemaValidationTestCase.java | 6 ++--- .../test/AbstractSerializingTestCase.java | 12 ++++----- .../test/AbstractXContentTestCase.java | 12 ++++----- .../elasticsearch/test/BackgroundIndexer.java | 4 +-- .../elasticsearch/test/ESIntegTestCase.java | 12 ++++----- .../test/ESSingleNodeTestCase.java | 4 +-- .../org/elasticsearch/test/ESTestCase.java | 18 ++++++------- .../test/InternalAggregationTestCase.java | 12 ++++----- .../test/MockIndexEventListener.java | 2 +- .../org/elasticsearch/test/RandomObjects.java | 18 ++++++------- .../test/TestCustomMetadata.java | 4 +-- .../elasticsearch/test/XContentTestUtils.java | 20 +++++++------- .../hamcrest/ElasticsearchAssertions.java | 14 +++++----- .../test/rest/ESRestTestCase.java | 12 ++++----- .../test/rest/FakeRestRequest.java | 4 +-- .../yaml/ClientYamlTestExecutionContext.java | 6 ++--- .../rest/yaml/ClientYamlTestResponse.java | 10 +++---- .../rest/yaml/ESClientYamlSuiteTestCase.java | 2 +- .../test/rest/yaml/ObjectPath.java | 12 ++++----- .../elasticsearch/test/rest/yaml/Stash.java | 4 +-- .../ClientYamlSuiteRestApiParser.java | 8 +++--- .../restspec/ClientYamlSuiteRestSpec.java | 6 ++--- .../test/rest/yaml/section/Assertion.java | 2 +- .../yaml/section/ClientYamlTestSection.java | 4 +-- .../yaml/section/ClientYamlTestSuite.java | 8 +++--- .../rest/yaml/section/CloseToAssertion.java | 4 +-- .../rest/yaml/section/ContainsAssertion.java | 4 +-- .../test/rest/yaml/section/DoSection.java | 12 ++++----- .../rest/yaml/section/ExecutableSection.java | 8 +++--- .../yaml/section/GreaterThanAssertion.java | 4 +-- .../section/GreaterThanEqualToAssertion.java | 4 +-- .../rest/yaml/section/IsFalseAssertion.java | 4 +-- .../rest/yaml/section/IsTrueAssertion.java | 4 +-- .../rest/yaml/section/LengthAssertion.java | 4 +-- .../rest/yaml/section/LessThanAssertion.java | 4 +-- .../section/LessThanOrEqualToAssertion.java | 4 +-- .../rest/yaml/section/MatchAssertion.java | 4 +-- .../test/rest/yaml/section/ParserUtils.java | 2 +- .../test/rest/yaml/section/SetSection.java | 4 +-- .../test/rest/yaml/section/SetupSection.java | 2 +- .../test/rest/yaml/section/SkipSection.java | 2 +- .../rest/yaml/section/TeardownSection.java | 2 +- .../yaml/section/TransformAndSetSection.java | 4 +-- .../test/AbstractXContentTestCaseTests.java | 8 +++--- .../test/XContentTestUtilsTests.java | 14 +++++----- .../ElasticsearchAssertionsTests.java | 6 ++--- .../test/rest/yaml/ObjectPathTests.java | 6 ++--- ...entYamlSuiteRestApiParserFailingTests.java | 4 +-- .../ClientYamlSuiteRestApiParserTests.java | 2 +- .../restspec/ClientYamlSuiteRestApiTests.java | 4 +-- ...tClientYamlTestFragmentParserTestCase.java | 5 ++-- .../rest/yaml/section/AssertionTests.java | 8 +----- .../section/ClientYamlTestSectionTests.java | 4 +-- .../section/ClientYamlTestSuiteTests.java | 4 +-- .../rest/yaml/section/DoSectionTests.java | 6 ++--- .../yaml/section/MatchAssertionTests.java | 2 +- .../rest/yaml/section/SetSectionTests.java | 2 +- .../rest/yaml/section/SetupSectionTests.java | 2 +- .../rest/yaml/section/SkipSectionTests.java | 2 +- .../yaml/section/TeardownSectionTests.java | 2 +- .../section/TransformAndSetSectionTests.java | 2 +- .../test/test/ESTestCaseTests.java | 6 ++--- .../license/licensor/LicenseSigner.java | 8 +++--- .../licensor/tools/LicenseGeneratorTool.java | 8 +++--- .../tools/LicenseVerificationTool.java | 8 +++--- .../license/licensor/TestUtils.java | 10 +++---- .../tools/LicenseGenerationToolTests.java | 2 +- .../xpack/analytics/AnalyticsPlugin.java | 2 +- .../xpack/analytics/AnalyticsUsage.java | 2 +- .../boxplot/BoxplotAggregationBuilder.java | 4 +-- .../analytics/boxplot/InternalBoxplot.java | 2 +- ...CardinalityPipelineAggregationBuilder.java | 6 ++--- .../InternalSimpleLongValue.java | 2 +- .../mapper/HistogramFieldMapper.java | 6 ++--- ...PercentilesPipelineAggregationBuilder.java | 8 +++--- .../multiterms/InternalMultiTerms.java | 2 +- .../MultiTermsAggregationBuilder.java | 8 +++--- .../NormalizePipelineAggregationBuilder.java | 10 +++---- .../xpack/analytics/rate/InternalRate.java | 2 +- .../rate/RateAggregationBuilder.java | 6 ++--- .../stringstats/InternalStringStats.java | 4 +-- .../StringStatsAggregationBuilder.java | 6 ++--- .../topmetrics/InternalTopMetrics.java | 4 +-- .../TopMetricsAggregationBuilder.java | 14 +++++----- .../xpack/analytics/ttest/InternalTTest.java | 2 +- .../ttest/TTestAggregationBuilder.java | 8 +++--- .../TransportAnalyticsStatsActionTests.java | 10 +++---- .../HistogramPercentileAggregationTests.java | 4 +-- .../BoxplotAggregationBuilderTests.java | 6 ++--- .../boxplot/InternalBoxplotTests.java | 4 +-- .../mapper/HistogramFieldMapperTests.java | 2 +- .../multiterms/InternalMultiTermsTests.java | 4 +-- .../MultiTermsAggregationBuilderTests.java | 6 ++--- .../analytics/rate/InternalRateTests.java | 4 +-- .../rate/RateAggregationBuilderTests.java | 6 ++--- .../stringstats/InternalStringStatsTests.java | 4 +-- .../StringStatsAggregationBuilderTests.java | 10 +++---- .../topmetrics/InternalTopMetricsTests.java | 4 +-- .../TopMetricsAggregationBuilderTests.java | 10 +++---- .../analytics/ttest/InternalTTestTests.java | 4 +-- .../ttest/TTestAggregationBuilderTests.java | 6 ++--- .../query/DeprecatedQueryBuilder.java | 6 ++--- .../xpack/search/AsyncSearchSecurityIT.java | 10 +++---- .../search/AsyncSearchIntegTestCase.java | 2 +- .../xpack/search/BlockingQueryBuilder.java | 2 +- .../search/AsyncSearchResponseTests.java | 6 ++--- .../search/AsyncStatusResponseTests.java | 6 ++--- .../search/CancellingAggregationBuilder.java | 4 +-- .../RestSubmitAsyncSearchActionTests.java | 2 +- .../xpack/search/ThrowingQueryBuilder.java | 2 +- .../xpack/async/AsyncResultsIndexPlugin.java | 2 +- .../xpack/autoscaling/Autoscaling.java | 4 +-- .../autoscaling/AutoscalingMetadata.java | 8 +++--- .../action/GetAutoscalingCapacityAction.java | 4 +-- .../action/GetAutoscalingPolicyAction.java | 4 +-- .../action/PutAutoscalingPolicyAction.java | 4 +-- .../capacity/AutoscalingCapacity.java | 4 +-- .../capacity/AutoscalingDeciderResult.java | 4 +-- .../capacity/AutoscalingDeciderResults.java | 4 +-- .../FixedAutoscalingDeciderService.java | 2 +- .../FrozenExistenceDeciderService.java | 2 +- .../autoscaling/policy/AutoscalingPolicy.java | 10 +++---- .../policy/AutoscalingPolicyMetadata.java | 10 +++---- .../rest/RestPutAutoscalingPolicyHandler.java | 2 +- .../shards/FrozenShardsDeciderService.java | 2 +- .../storage/FrozenStorageDeciderService.java | 2 +- .../ProactiveStorageDeciderService.java | 2 +- .../ReactiveStorageDeciderService.java | 2 +- ...ingMetadataDiffableSerializationTests.java | 4 +-- .../autoscaling/AutoscalingTestCase.java | 2 +- ...utoscalingCapacityActionResponseTests.java | 4 +-- .../AutoscalingDeciderResultsTests.java | 12 ++++----- ...icyMetadataDiffableSerializationTests.java | 4 +-- .../AutoscalingPolicySerializingTests.java | 4 +-- .../xpack/ccr/FollowIndexIT.java | 2 +- .../elasticsearch/xpack/ccr/AutoFollowIT.java | 8 +++--- .../elasticsearch/xpack/ccr/XPackUsageIT.java | 2 +- .../xpack/ccr/ESCCRRestTestCase.java | 8 +++--- .../elasticsearch/xpack/ccr/CcrAliasesIT.java | 6 ++--- .../xpack/ccr/CcrRepositoryIT.java | 2 +- .../xpack/ccr/CcrRetentionLeaseIT.java | 2 +- .../xpack/ccr/CloseFollowerIndexIT.java | 2 +- .../elasticsearch/xpack/ccr/FollowInfoIT.java | 2 +- .../xpack/ccr/FollowStatsIT.java | 2 +- .../xpack/ccr/FollowerFailOverIT.java | 2 +- .../xpack/ccr/IndexFollowingIT.java | 6 ++--- .../xpack/ccr/LocalIndexFollowingIT.java | 6 ++--- .../ccr/PrimaryFollowerAllocationIT.java | 2 +- .../xpack/ccr/RestartIndexFollowingIT.java | 2 +- .../xpack/ccr/CCRInfoTransportAction.java | 2 +- .../java/org/elasticsearch/xpack/ccr/Ccr.java | 4 +-- .../xpack/ccr/action/CcrRequests.java | 2 +- .../ccr/rest/RestForgetFollowerAction.java | 2 +- .../rest/RestPutAutoFollowPatternAction.java | 2 +- .../xpack/ccr/rest/RestPutFollowAction.java | 2 +- .../ccr/rest/RestResumeFollowAction.java | 2 +- .../elasticsearch/xpack/CcrIntegTestCase.java | 4 +-- .../xpack/ccr/AutoFollowMetadataTests.java | 2 +- .../ccr/action/AutoFollowStatsTests.java | 2 +- .../ccr/action/FollowInfoResponseTests.java | 4 +-- .../ccr/action/FollowParametersTests.java | 4 +-- .../PutAutoFollowPatternRequestTests.java | 4 +-- .../action/PutFollowActionRequestTests.java | 4 +-- .../ResumeFollowActionRequestTests.java | 4 +-- .../ccr/action/ShardChangesActionTests.java | 2 +- .../xpack/ccr/action/ShardChangesTests.java | 2 +- .../ShardFollowNodeTaskStatusTests.java | 2 +- .../engine/FollowEngineIndexShardTests.java | 2 +- .../AutoFollowStatsMonitoringDocTests.java | 6 ++--- .../ccr/FollowStatsMonitoringDocTests.java | 6 ++--- .../sourceonly/SourceOnlySnapshotIT.java | 6 ++--- .../license/GetBasicStatusResponse.java | 4 +-- .../license/GetFeatureUsageResponse.java | 4 +-- .../license/GetTrialStatusResponse.java | 4 +-- .../org/elasticsearch/license/License.java | 14 +++++----- .../license/LicenseVerifier.java | 8 +++--- .../license/LicensesMetadata.java | 4 +-- .../org/elasticsearch/license/Licensing.java | 4 +-- .../license/PostStartBasicResponse.java | 4 +-- .../license/PutLicenseRequest.java | 2 +- .../license/PutLicenseRequestBuilder.java | 2 +- .../license/RestGetLicenseAction.java | 4 +-- .../license/RestPostStartTrialLicense.java | 2 +- .../license/SelfGeneratedLicense.java | 12 ++++----- .../protocol/xpack/XPackInfoResponse.java | 10 +++---- .../protocol/xpack/XPackUsageResponse.java | 2 +- .../protocol/xpack/graph/Connection.java | 12 ++++----- .../xpack/graph/GraphExploreRequest.java | 4 +-- .../xpack/graph/GraphExploreResponse.java | 14 +++++----- .../protocol/xpack/graph/Hop.java | 4 +-- .../protocol/xpack/graph/Vertex.java | 14 +++++----- .../protocol/xpack/graph/VertexRequest.java | 4 +-- .../xpack/license/PutLicenseResponse.java | 2 +- .../xpack/watcher/DeleteWatchResponse.java | 10 +++---- .../xpack/watcher/PutWatchRequest.java | 2 +- .../xpack/watcher/PutWatchResponse.java | 10 +++---- .../action/MigrateToDataTiersRequest.java | 6 ++--- .../action/MigrateToDataTiersResponse.java | 6 ++--- .../xpack/core/DataTiersFeatureSetUsage.java | 4 +-- .../xpack/core/XPackClientPlugin.java | 4 +-- .../xpack/core/XPackFeatureSet.java | 4 +-- .../elasticsearch/xpack/core/XPackPlugin.java | 2 +- .../action/AbstractGetResourcesResponse.java | 4 +-- .../AbstractTransportGetResourcesAction.java | 12 ++++----- .../core/action/DataStreamsStatsAction.java | 4 +-- .../core/action/GetDataStreamAction.java | 6 ++--- .../core/action/ReloadAnalyzersResponse.java | 10 +++---- .../action/SetResetModeActionRequest.java | 10 +++---- .../xpack/core/action/util/PageParams.java | 8 +++--- .../xpack/core/action/util/QueryPage.java | 8 +++--- .../analytics/AnalyticsFeatureSetUsage.java | 2 +- .../action/AnalyticsStatsAction.java | 4 +-- .../core/async/AsyncTaskIndexService.java | 14 +++++----- .../xpack/core/async/StoredAsyncResponse.java | 4 +-- .../xpack/core/ccr/AutoFollowMetadata.java | 10 +++---- .../xpack/core/ccr/AutoFollowStats.java | 10 +++---- .../core/ccr/ShardFollowNodeTaskStatus.java | 8 +++--- .../xpack/core/ccr/action/CcrStatsAction.java | 4 +-- .../core/ccr/action/FollowInfoAction.java | 6 ++--- .../core/ccr/action/FollowParameters.java | 10 +++---- .../core/ccr/action/FollowStatsAction.java | 4 +-- .../core/ccr/action/ForgetFollowerAction.java | 6 ++--- .../action/GetAutoFollowPatternAction.java | 4 +-- .../ccr/action/ImmutableFollowParameters.java | 6 ++--- .../action/PutAutoFollowPatternAction.java | 8 +++--- .../core/ccr/action/PutFollowAction.java | 10 +++---- .../core/ccr/action/ResumeFollowAction.java | 8 +++--- .../core/ccr/action/ShardFollowTask.java | 8 +++--- .../notifications/AbstractAuditMessage.java | 16 ++++++------ .../common/notifications/AbstractAuditor.java | 14 +++++----- .../xpack/core/common/time/TimeUtils.java | 4 +-- .../DataStreamFeatureSetUsage.java | 2 +- .../core/deprecation/DeprecationIssue.java | 4 +-- ...LoggingDeprecationAccumulationHandler.java | 4 +-- .../xpack/core/enrich/EnrichPolicy.java | 16 ++++++------ .../core/enrich/action/EnrichStatsAction.java | 6 ++--- .../action/ExecuteEnrichPolicyAction.java | 4 +-- .../action/ExecuteEnrichPolicyStatus.java | 2 +- .../enrich/action/GetEnrichPolicyAction.java | 4 +-- .../enrich/action/PutEnrichPolicyAction.java | 2 +- .../xpack/core/eql/EqlFeatureSetUsage.java | 2 +- .../frozen/FrozenIndicesFeatureSetUsage.java | 2 +- .../xpack/core/ilm/AllocateAction.java | 8 +++--- .../xpack/core/ilm/AsyncWaitStep.java | 2 +- .../ilm/CheckNotDataStreamWriteIndexStep.java | 6 ++--- .../xpack/core/ilm/CheckShrinkReadyStep.java | 8 +++--- .../xpack/core/ilm/ClusterStateWaitStep.java | 2 +- .../xpack/core/ilm/DeleteAction.java | 8 +++--- .../core/ilm/ExplainLifecycleResponse.java | 10 +++---- .../xpack/core/ilm/ForceMergeAction.java | 8 +++--- .../xpack/core/ilm/FreezeAction.java | 6 ++--- .../ilm/IndexLifecycleExplainResponse.java | 12 ++++----- .../ilm/IndexLifecycleFeatureSetUsage.java | 6 ++--- .../core/ilm/IndexLifecycleMetadata.java | 6 ++--- .../xpack/core/ilm/LifecycleAction.java | 2 +- .../xpack/core/ilm/LifecyclePolicy.java | 10 +++---- .../core/ilm/LifecyclePolicyMetadata.java | 12 ++++----- .../xpack/core/ilm/LifecyclePolicyUtils.java | 6 ++--- .../xpack/core/ilm/MigrateAction.java | 8 +++--- .../elasticsearch/xpack/core/ilm/Phase.java | 14 +++++----- .../xpack/core/ilm/PhaseCacheManagement.java | 8 +++--- .../xpack/core/ilm/PhaseExecutionInfo.java | 10 +++---- .../xpack/core/ilm/ReadOnlyAction.java | 6 ++--- .../xpack/core/ilm/RolloverAction.java | 10 +++---- .../xpack/core/ilm/RollupILMAction.java | 10 +++---- .../core/ilm/SearchableSnapshotAction.java | 8 +++--- .../xpack/core/ilm/SegmentCountStep.java | 8 +++--- .../xpack/core/ilm/SetPriorityAction.java | 10 +++---- .../xpack/core/ilm/ShrinkAction.java | 10 +++---- .../core/ilm/ShrunkShardsAllocatedStep.java | 8 +++--- .../core/ilm/ShrunkenIndexCheckStep.java | 8 +++--- .../elasticsearch/xpack/core/ilm/Step.java | 10 +++---- .../xpack/core/ilm/UnfollowAction.java | 6 ++--- .../core/ilm/WaitForActiveShardsStep.java | 6 ++--- .../core/ilm/WaitForFollowShardTasksStep.java | 6 ++--- .../xpack/core/ilm/WaitForIndexColorStep.java | 6 ++--- .../core/ilm/WaitForIndexingCompleteStep.java | 6 ++--- .../core/ilm/WaitForNoFollowersStep.java | 6 ++--- .../core/ilm/WaitForRolloverReadyStep.java | 4 +-- .../xpack/core/ilm/WaitForSnapshotAction.java | 8 +++--- .../xpack/core/ilm/WaitForSnapshotStep.java | 2 +- .../ilm/action/DeleteLifecycleAction.java | 2 +- .../core/ilm/action/GetLifecycleAction.java | 4 +-- .../core/ilm/action/GetStatusAction.java | 4 +-- .../core/ilm/action/MoveToStepAction.java | 10 +++---- .../core/ilm/action/PutLifecycleAction.java | 10 +++---- .../RemoveIndexLifecyclePolicyAction.java | 8 +++--- .../core/ilm/step/info/AllocationInfo.java | 10 +++---- .../ilm/step/info/SingleMessageFieldInfo.java | 6 ++--- .../core/index/query/PinnedQueryBuilder.java | 6 ++--- .../xpack/core/indexing/IndexerJobStats.java | 4 +-- .../xpack/core/indexing/IndexerState.java | 2 +- .../ml/MachineLearningFeatureSetUsage.java | 2 +- .../xpack/core/ml/MlMetadata.java | 10 +++---- .../xpack/core/ml/action/CloseJobAction.java | 10 +++---- .../CreateTrainedModelAllocationAction.java | 10 +++---- .../DeleteDataFrameAnalyticsAction.java | 2 +- .../core/ml/action/DeleteDatafeedAction.java | 6 ++--- .../ml/action/DeleteExpiredDataAction.java | 10 +++---- .../core/ml/action/DeleteFilterAction.java | 2 +- .../ml/action/DeleteTrainedModelAction.java | 4 +-- .../ml/action/EstimateModelMemoryAction.java | 10 +++---- .../ml/action/EvaluateDataFrameAction.java | 14 +++++----- .../ExplainDataFrameAnalyticsAction.java | 8 +++--- .../xpack/core/ml/action/FlushJobAction.java | 10 +++---- .../core/ml/action/ForecastJobAction.java | 12 ++++----- .../core/ml/action/GetBucketsAction.java | 10 +++---- .../ml/action/GetCalendarEventsAction.java | 10 +++---- .../core/ml/action/GetCalendarsAction.java | 8 +++--- .../core/ml/action/GetCategoriesAction.java | 10 +++---- .../action/GetDataFrameAnalyticsAction.java | 2 +- .../GetDataFrameAnalyticsStatsAction.java | 6 ++--- .../action/GetDatafeedRunningStateAction.java | 4 +-- .../core/ml/action/GetDatafeedsAction.java | 2 +- .../ml/action/GetDatafeedsStatsAction.java | 4 +-- .../ml/action/GetDeploymentStatsAction.java | 6 ++--- .../core/ml/action/GetInfluencersAction.java | 10 +++---- .../xpack/core/ml/action/GetJobsAction.java | 2 +- .../core/ml/action/GetJobsStatsAction.java | 4 +-- .../ml/action/GetModelSnapshotsAction.java | 10 +++---- .../ml/action/GetOverallBucketsAction.java | 10 +++---- .../core/ml/action/GetRecordsAction.java | 10 +++---- .../ml/action/GetTrainedModelsAction.java | 2 +- .../action/GetTrainedModelsStatsAction.java | 6 ++--- .../InferTrainedModelDeploymentAction.java | 10 +++---- .../core/ml/action/IsolateDatafeedAction.java | 8 +++--- .../xpack/core/ml/action/MlInfoAction.java | 4 +-- .../ml/action/NodeAcknowledgedResponse.java | 2 +- .../xpack/core/ml/action/OpenJobAction.java | 12 ++++----- .../ml/action/PostCalendarEventsAction.java | 10 +++---- .../xpack/core/ml/action/PostDataAction.java | 6 ++--- .../PreviewDataFrameAnalyticsAction.java | 12 ++++----- .../core/ml/action/PreviewDatafeedAction.java | 12 ++++----- .../core/ml/action/PutCalendarAction.java | 6 ++--- .../action/PutDataFrameAnalyticsAction.java | 6 ++--- .../core/ml/action/PutDatafeedAction.java | 6 ++--- .../xpack/core/ml/action/PutFilterAction.java | 6 ++--- .../xpack/core/ml/action/PutJobAction.java | 6 ++--- .../core/ml/action/PutTrainedModelAction.java | 6 ++--- .../PutTrainedModelDefinitionPartAction.java | 6 ++--- .../PutTrainedModelVocabularyAction.java | 6 ++--- .../ml/action/RevertModelSnapshotAction.java | 10 +++---- .../core/ml/action/SetUpgradeModeAction.java | 8 +++--- .../action/StartDataFrameAnalyticsAction.java | 12 ++++----- .../core/ml/action/StartDatafeedAction.java | 12 ++++----- .../StartTrainedModelDeploymentAction.java | 12 ++++----- .../action/StopDataFrameAnalyticsAction.java | 10 +++---- .../core/ml/action/StopDatafeedAction.java | 10 +++---- .../StopTrainedModelDeploymentAction.java | 6 ++--- .../UpdateDataFrameAnalyticsAction.java | 6 ++--- .../core/ml/action/UpdateDatafeedAction.java | 6 ++--- .../core/ml/action/UpdateFilterAction.java | 10 +++---- .../xpack/core/ml/action/UpdateJobAction.java | 6 ++--- .../ml/action/UpdateModelSnapshotAction.java | 10 +++---- .../core/ml/action/UpdateProcessAction.java | 2 +- .../action/UpgradeJobModelSnapshotAction.java | 10 +++---- .../ml/action/ValidateDetectorAction.java | 6 ++--- .../ml/action/ValidateJobConfigAction.java | 2 +- .../xpack/core/ml/annotations/Annotation.java | 10 +++---- .../xpack/core/ml/calendars/Calendar.java | 8 +++--- .../core/ml/calendars/ScheduledEvent.java | 8 +++--- .../xpack/core/ml/datafeed/AggProvider.java | 8 +++--- .../core/ml/datafeed/ChunkingConfig.java | 8 +++--- .../core/ml/datafeed/DatafeedConfig.java | 12 ++++----- .../ml/datafeed/DatafeedJobValidator.java | 2 +- .../xpack/core/ml/datafeed/DatafeedState.java | 10 +++---- .../core/ml/datafeed/DatafeedTimingStats.java | 14 +++++----- .../core/ml/datafeed/DatafeedUpdate.java | 12 ++++----- .../ml/datafeed/DelayedDataCheckConfig.java | 10 +++---- .../dataframe/DataFrameAnalyticsConfig.java | 14 +++++----- .../DataFrameAnalyticsConfigUpdate.java | 8 +++--- .../ml/dataframe/DataFrameAnalyticsDest.java | 8 +++--- .../dataframe/DataFrameAnalyticsSource.java | 12 ++++----- .../DataFrameAnalyticsTaskState.java | 8 +++--- .../dataframe/analyses/BoostedTreeParams.java | 10 +++---- .../ml/dataframe/analyses/Classification.java | 12 ++++----- .../dataframe/analyses/DataFrameAnalysis.java | 2 +- ...ataFrameAnalysisNamedXContentProvider.java | 2 +- .../dataframe/analyses/OutlierDetection.java | 8 +++--- .../ml/dataframe/analyses/Regression.java | 12 ++++----- .../ml/dataframe/evaluation/Evaluation.java | 2 +- .../evaluation/EvaluationFields.java | 2 +- .../evaluation/EvaluationMetric.java | 2 +- .../evaluation/EvaluationMetricResult.java | 2 +- .../MlEvaluationNamedXContentProvider.java | 4 +-- .../evaluation/classification/Accuracy.java | 12 ++++----- .../evaluation/classification/AucRoc.java | 8 +++--- .../classification/Classification.java | 8 +++--- .../MulticlassConfusionMatrix.java | 14 +++++----- .../classification/PerClassSingleValue.java | 10 +++---- .../evaluation/classification/Precision.java | 12 ++++----- .../evaluation/classification/Recall.java | 12 ++++----- .../evaluation/common/AbstractAucRoc.java | 6 ++--- .../AbstractConfusionMatrixMetric.java | 4 +-- .../evaluation/outlierdetection/AucRoc.java | 8 +++--- .../outlierdetection/ConfusionMatrix.java | 8 +++--- .../outlierdetection/OutlierDetection.java | 8 +++--- .../outlierdetection/Precision.java | 6 ++--- .../evaluation/outlierdetection/Recall.java | 6 ++--- .../ScoreByThresholdResult.java | 4 +-- .../evaluation/regression/Huber.java | 10 +++---- .../regression/MeanSquaredError.java | 8 +++--- .../MeanSquaredLogarithmicError.java | 10 +++---- .../evaluation/regression/RSquared.java | 8 +++--- .../evaluation/regression/Regression.java | 8 +++--- .../ml/dataframe/explain/FieldSelection.java | 8 +++--- .../dataframe/explain/MemoryEstimation.java | 12 ++++----- .../ml/dataframe/stats/AnalysisStats.java | 2 +- .../xpack/core/ml/dataframe/stats/Fields.java | 2 +- .../classification/ClassificationStats.java | 8 +++--- .../stats/classification/Hyperparameters.java | 12 ++++----- .../stats/classification/TimingStats.java | 10 +++---- .../stats/classification/ValidationLoss.java | 10 +++---- .../ml/dataframe/stats/common/DataCounts.java | 8 +++--- .../ml/dataframe/stats/common/FoldValues.java | 10 +++---- .../dataframe/stats/common/MemoryUsage.java | 10 +++---- .../OutlierDetectionStats.java | 8 +++--- .../stats/outlierdetection/Parameters.java | 12 ++++----- .../stats/outlierdetection/TimingStats.java | 10 +++---- .../stats/regression/Hyperparameters.java | 12 ++++----- .../stats/regression/RegressionStats.java | 8 +++--- .../stats/regression/TimingStats.java | 10 +++---- .../stats/regression/ValidationLoss.java | 10 +++---- .../InferenceToXContentCompressor.java | 12 ++++----- .../MlInferenceNamedXContentProvider.java | 4 +-- .../core/ml/inference/TrainedModelConfig.java | 12 ++++----- .../ml/inference/TrainedModelDefinition.java | 10 +++---- .../core/ml/inference/TrainedModelInput.java | 10 +++---- .../allocation/AllocationStatus.java | 10 +++---- .../allocation/RoutingStateAndReason.java | 10 +++---- .../allocation/TrainedModelAllocation.java | 10 +++---- .../persistence/InferenceIndexConstants.java | 2 +- .../preprocessing/CustomWordEmbedding.java | 10 +++---- .../preprocessing/FrequencyEncoding.java | 8 +++--- .../ml/inference/preprocessing/Multi.java | 8 +++--- .../ml/inference/preprocessing/NGram.java | 8 +++--- .../preprocessing/OneHotEncoding.java | 8 +++--- .../preprocessing/TargetMeanEncoding.java | 8 +++--- .../results/AbstractFeatureImportance.java | 4 +-- .../ClassificationFeatureImportance.java | 18 ++++++------- .../ClassificationInferenceResults.java | 2 +- .../ml/inference/results/FillMaskResults.java | 2 +- .../inference/results/InferenceResults.java | 2 +- .../core/ml/inference/results/NerResults.java | 4 +-- .../results/PyTorchPassThroughResults.java | 2 +- .../results/RawInferenceResults.java | 2 +- .../results/RegressionFeatureImportance.java | 8 +++--- .../results/RegressionInferenceResults.java | 2 +- .../results/TextEmbeddingResults.java | 2 +- .../ml/inference/results/TopClassEntry.java | 16 ++++++------ .../results/WarningInferenceResults.java | 4 +-- .../trainedmodel/BertTokenization.java | 8 +++--- .../trainedmodel/ClassificationConfig.java | 8 +++--- .../ClassificationConfigUpdate.java | 8 +++--- .../trainedmodel/FillMaskConfig.java | 6 ++--- .../trainedmodel/FillMaskConfigUpdate.java | 6 ++--- .../inference/trainedmodel/IndexLocation.java | 8 +++--- .../trainedmodel/InferenceStats.java | 10 +++---- .../ml/inference/trainedmodel/NerConfig.java | 6 ++--- .../trainedmodel/NerConfigUpdate.java | 6 ++--- .../ml/inference/trainedmodel/NlpConfig.java | 2 +- .../trainedmodel/NullInferenceConfig.java | 2 +- .../trainedmodel/PassThroughConfig.java | 6 ++--- .../trainedmodel/PassThroughConfigUpdate.java | 6 ++--- .../trainedmodel/RegressionConfig.java | 8 +++--- .../trainedmodel/RegressionConfigUpdate.java | 8 +++--- .../ml/inference/trainedmodel/TargetType.java | 2 +- .../TextClassificationConfig.java | 6 ++--- .../TextClassificationConfigUpdate.java | 6 ++--- .../trainedmodel/TextEmbeddingConfig.java | 6 ++--- .../TextEmbeddingConfigUpdate.java | 6 ++--- .../inference/trainedmodel/Tokenization.java | 6 ++--- .../trainedmodel/VocabularyConfig.java | 10 +++---- .../ZeroShotClassificationConfig.java | 8 +++--- .../ZeroShotClassificationConfigUpdate.java | 6 ++--- .../trainedmodel/ensemble/Ensemble.java | 8 +++--- .../trainedmodel/ensemble/Exponent.java | 8 +++--- .../ensemble/LogisticRegression.java | 8 +++--- .../trainedmodel/ensemble/WeightedMode.java | 8 +++--- .../trainedmodel/ensemble/WeightedSum.java | 8 +++--- .../inference/EnsembleInferenceModel.java | 8 +++--- .../inference/InferenceDefinition.java | 4 +-- .../inference/TreeInferenceModel.java | 10 +++---- .../langident/LangIdentNeuralNetwork.java | 10 +++---- .../trainedmodel/langident/LangNetLayer.java | 10 +++---- .../metadata/FeatureImportanceBaseline.java | 14 +++++----- .../metadata/Hyperparameters.java | 10 +++---- .../metadata/TotalFeatureImportance.java | 14 +++++----- .../metadata/TrainedModelMetadata.java | 10 +++---- .../ml/inference/trainedmodel/tree/Tree.java | 8 +++--- .../inference/trainedmodel/tree/TreeNode.java | 10 +++---- .../core/ml/job/config/AnalysisConfig.java | 10 +++---- .../core/ml/job/config/AnalysisLimits.java | 12 ++++----- .../xpack/core/ml/job/config/Blocked.java | 8 +++--- .../config/CategorizationAnalyzerConfig.java | 12 ++++----- .../core/ml/job/config/DataDescription.java | 8 +++--- .../core/ml/job/config/DetectionRule.java | 8 +++--- .../xpack/core/ml/job/config/Detector.java | 8 +++--- .../xpack/core/ml/job/config/FilterRef.java | 8 +++--- .../xpack/core/ml/job/config/Job.java | 10 +++---- .../core/ml/job/config/JobTaskState.java | 12 ++++----- .../xpack/core/ml/job/config/JobUpdate.java | 10 +++---- .../xpack/core/ml/job/config/MlFilter.java | 8 +++--- .../core/ml/job/config/ModelPlotConfig.java | 8 +++--- .../xpack/core/ml/job/config/Operator.java | 2 +- .../PerPartitionCategorizationConfig.java | 8 +++--- .../core/ml/job/config/RuleCondition.java | 8 +++--- .../xpack/core/ml/job/config/RuleScope.java | 14 +++++----- .../persistence/ElasticsearchMappings.java | 2 +- .../output/FlushAcknowledgement.java | 8 +++--- .../autodetect/state/CategorizerStats.java | 10 +++---- .../process/autodetect/state/DataCounts.java | 10 +++---- .../autodetect/state/ModelSizeStats.java | 10 +++---- .../autodetect/state/ModelSnapshot.java | 18 ++++++------- .../autodetect/state/ModelSnapshotField.java | 2 +- .../process/autodetect/state/Quantiles.java | 10 +++---- .../process/autodetect/state/TimingStats.java | 12 ++++----- .../core/ml/job/results/AnomalyCause.java | 8 +++--- .../core/ml/job/results/AnomalyRecord.java | 10 +++---- .../xpack/core/ml/job/results/Bucket.java | 10 +++---- .../core/ml/job/results/BucketInfluencer.java | 10 +++---- .../ml/job/results/CategoryDefinition.java | 8 +++--- .../xpack/core/ml/job/results/Forecast.java | 10 +++---- .../ml/job/results/ForecastRequestStats.java | 10 +++---- .../xpack/core/ml/job/results/GeoResults.java | 8 +++--- .../xpack/core/ml/job/results/Influence.java | 8 +++--- .../xpack/core/ml/job/results/Influencer.java | 10 +++---- .../xpack/core/ml/job/results/ModelPlot.java | 10 +++---- .../core/ml/job/results/OverallBucket.java | 6 ++--- .../xpack/core/ml/job/results/Result.java | 2 +- .../upgrade/SnapshotUpgradeTaskState.java | 8 +++--- .../AnomalyDetectionAuditMessage.java | 4 +-- .../DataFrameAnalyticsAuditMessage.java | 4 +-- .../notifications/InferenceAuditMessage.java | 4 +-- .../xpack/core/ml/stats/ForecastStats.java | 4 +-- .../xpack/core/ml/utils/ExceptionsHelper.java | 2 +- .../ExponentialAverageCalculationContext.java | 12 ++++----- .../xpack/core/ml/utils/MlIndexAndAlias.java | 8 +++--- .../xpack/core/ml/utils/MlParserUtils.java | 2 +- .../core/ml/utils/NamedXContentObject.java | 2 +- .../ml/utils/NamedXContentObjectHelper.java | 4 +-- .../xpack/core/ml/utils/PhaseProgress.java | 8 +++--- .../xpack/core/ml/utils/QueryProvider.java | 8 +++--- .../ml/utils/XContentObjectTransformer.java | 14 +++++----- .../monitoring/MonitoringFeatureSetUsage.java | 2 +- .../monitoring/action/MonitoringBulkDoc.java | 2 +- .../action/MonitoringBulkRequest.java | 2 +- .../action/MonitoringBulkRequestBuilder.java | 2 +- .../action/MonitoringBulkResponse.java | 4 +-- .../MonitoringMigrateAlertsResponse.java | 6 ++--- .../monitoring/exporter/MonitoringDoc.java | 4 +-- .../rest/action/RestXPackUsageAction.java | 2 +- .../xpack/core/rollup/RollupActionConfig.java | 12 ++++----- .../RollupActionDateHistogramGroupConfig.java | 16 ++++++------ .../core/rollup/RollupActionGroupConfig.java | 14 +++++----- .../xpack/core/rollup/RollupField.java | 2 +- .../rollup/action/DeleteRollupJobAction.java | 6 ++--- .../rollup/action/GetRollupCapsAction.java | 8 +++--- .../action/GetRollupIndexCapsAction.java | 8 +++--- .../rollup/action/GetRollupJobsAction.java | 8 +++--- .../rollup/action/PutRollupJobAction.java | 6 ++--- .../core/rollup/action/RollableIndexCaps.java | 6 ++--- .../core/rollup/action/RollupAction.java | 4 +-- .../rollup/action/RollupIndexerAction.java | 4 +-- .../core/rollup/action/RollupJobCaps.java | 8 +++--- .../rollup/action/StartRollupJobAction.java | 4 +-- .../rollup/action/StopRollupJobAction.java | 6 ++--- .../rollup/job/DateHistogramGroupConfig.java | 16 ++++++------ .../xpack/core/rollup/job/GroupConfig.java | 14 +++++----- .../core/rollup/job/HistogramGroupConfig.java | 12 ++++----- .../xpack/core/rollup/job/MetricConfig.java | 12 ++++----- .../rollup/job/RollupIndexerJobStats.java | 10 +++---- .../xpack/core/rollup/job/RollupJob.java | 8 +++--- .../core/rollup/job/RollupJobConfig.java | 16 ++++++------ .../core/rollup/job/RollupJobStatus.java | 14 +++++----- .../core/rollup/job/TermsGroupConfig.java | 12 ++++----- .../xpack/core/scheduler/Cron.java | 4 +-- .../search/action/AsyncSearchResponse.java | 2 +- .../search/action/AsyncStatusResponse.java | 2 +- .../MountSearchableSnapshotRequest.java | 12 ++++----- .../SearchableSnapshotFeatureSetUsage.java | 4 +-- .../SearchableSnapshotShardStats.java | 4 +-- .../core/security/CommandLineHttpClient.java | 2 +- .../xpack/core/security/EnrollmentToken.java | 16 ++++++------ .../xpack/core/security/HttpResponse.java | 2 +- .../xpack/core/security/SecurityContext.java | 4 +-- .../security/SecurityFeatureSetUsage.java | 2 +- .../xpack/core/security/action/ApiKey.java | 14 +++++----- .../action/ClearSecurityCacheResponse.java | 4 +-- .../action/CreateApiKeyRequestBuilder.java | 14 +++++----- .../security/action/CreateApiKeyResponse.java | 14 +++++----- .../DelegatePkiAuthenticationRequest.java | 14 +++++----- .../DelegatePkiAuthenticationResponse.java | 6 ++--- .../security/action/GetApiKeyResponse.java | 12 ++++----- .../action/InvalidateApiKeyResponse.java | 14 +++++----- .../action/apikey/QueryApiKeyResponse.java | 4 +-- .../enrollment/KibanaEnrollmentResponse.java | 4 +-- .../enrollment/NodeEnrollmentResponse.java | 8 +++--- ...dConnectPrepareAuthenticationResponse.java | 4 +-- .../ClearPrivilegesCacheResponse.java | 4 +-- .../privilege/DeletePrivilegesResponse.java | 4 +-- .../PutPrivilegesRequestBuilder.java | 6 ++--- .../privilege/PutPrivilegesResponse.java | 4 +-- .../action/realm/ClearRealmCacheResponse.java | 6 ++--- .../action/role/ClearRolesCacheResponse.java | 6 ++--- .../action/role/DeleteRoleResponse.java | 4 +-- .../action/role/PutRoleRequestBuilder.java | 2 +- .../security/action/role/PutRoleResponse.java | 4 +-- .../DeleteRoleMappingResponse.java | 4 +-- .../PutRoleMappingRequestBuilder.java | 2 +- .../rolemapping/PutRoleMappingResponse.java | 4 +-- .../CreateServiceAccountTokenResponse.java | 4 +-- .../DeleteServiceAccountTokenResponse.java | 4 +-- .../GetServiceAccountCredentialsResponse.java | 4 +-- .../service/GetServiceAccountResponse.java | 4 +-- .../action/service/ServiceAccountInfo.java | 4 +-- .../security/action/service/TokenInfo.java | 4 +-- .../action/token/CreateTokenResponse.java | 4 +-- .../action/token/InvalidateTokenResponse.java | 6 ++--- .../user/ChangePasswordRequestBuilder.java | 6 ++--- .../action/user/DeleteUserResponse.java | 4 +-- .../user/GetUserPrivilegesResponse.java | 4 +-- .../user/HasPrivilegesRequestBuilder.java | 2 +- .../action/user/HasPrivilegesResponse.java | 4 +-- .../action/user/PutUserRequestBuilder.java | 8 +++--- .../security/action/user/PutUserResponse.java | 4 +-- .../core/security/authc/Authentication.java | 4 +-- .../core/security/authc/TokenMetadata.java | 2 +- .../support/TokensInvalidationResult.java | 4 +-- .../support/mapper/ExpressionRoleMapping.java | 16 ++++++------ .../support/mapper/TemplateRoleName.java | 26 +++++++++---------- .../mapper/expressiondsl/AllExpression.java | 2 +- .../mapper/expressiondsl/AnyExpression.java | 2 +- .../expressiondsl/ExceptExpression.java | 2 +- .../expressiondsl/ExpressionParser.java | 9 ++++--- .../mapper/expressiondsl/FieldExpression.java | 4 +-- .../expressiondsl/RoleMapperExpression.java | 2 +- .../core/security/authz/RoleDescriptor.java | 16 ++++++------ .../accesscontrol/FieldSubsetReader.java | 4 +-- .../authz/permission/DocumentPermissions.java | 2 +- .../ApplicationPrivilegeDescriptor.java | 10 +++---- .../ConfigurableClusterPrivilege.java | 6 ++--- .../ConfigurableClusterPrivileges.java | 10 +++---- .../authz/support/DLSRoleQueryValidator.java | 10 +++---- .../SecurityQueryTemplateEvaluator.java | 6 ++--- .../support/MustacheTemplateEvaluator.java | 2 +- .../xpack/core/security/user/User.java | 6 ++--- .../core/security/xcontent/XContentUtils.java | 2 +- .../xpack/core/slm/SLMFeatureSetUsage.java | 2 +- .../core/slm/SnapshotInvocationRecord.java | 10 +++---- .../core/slm/SnapshotLifecycleMetadata.java | 6 ++--- .../core/slm/SnapshotLifecyclePolicy.java | 10 +++---- .../core/slm/SnapshotLifecyclePolicyItem.java | 8 +++--- .../slm/SnapshotLifecyclePolicyMetadata.java | 12 ++++----- .../core/slm/SnapshotLifecycleStats.java | 12 ++++----- .../slm/SnapshotRetentionConfiguration.java | 10 +++---- .../action/DeleteSnapshotLifecycleAction.java | 2 +- .../ExecuteSnapshotLifecycleAction.java | 4 +-- .../ExecuteSnapshotRetentionAction.java | 4 +-- .../core/slm/action/GetSLMStatusAction.java | 4 +-- .../action/GetSnapshotLifecycleAction.java | 4 +-- .../GetSnapshotLifecycleStatsAction.java | 4 +-- .../action/PutSnapshotLifecycleAction.java | 6 ++--- .../core/slm/history/SnapshotHistoryItem.java | 12 ++++----- .../slm/history/SnapshotHistoryStore.java | 6 ++--- .../SnapshotLifecycleTemplateRegistry.java | 2 +- .../spatial/action/SpatialStatsAction.java | 4 +-- .../xpack/core/sql/SqlFeatureSetUsage.java | 2 +- .../ssl/action/GetCertificateInfoAction.java | 4 +-- .../xpack/core/ssl/cert/CertificateInfo.java | 4 +-- .../rest/RestGetCertificateInfoAction.java | 2 +- .../core/template/IndexTemplateRegistry.java | 8 +++--- .../core/template/LifecyclePolicyConfig.java | 2 +- .../xpack/core/template/TemplateUtils.java | 10 +++---- .../core/termsenum/action/TermCount.java | 12 ++++----- .../termsenum/action/TermsEnumAction.java | 6 ++--- .../termsenum/action/TermsEnumRequest.java | 4 +-- .../termsenum/action/TermsEnumResponse.java | 10 +++---- .../termsenum/rest/RestTermsEnumAction.java | 8 +++--- .../action/FindStructureAction.java | 4 +-- .../structurefinder/FieldStats.java | 8 +++--- .../structurefinder/TextStructure.java | 10 +++---- .../transform/TransformFeatureSetUsage.java | 2 +- .../xpack/core/transform/TransformField.java | 2 +- .../core/transform/TransformMetadata.java | 8 +++--- .../TransformNamedXContentProvider.java | 2 +- .../transform/action/GetTransformAction.java | 6 ++--- .../action/GetTransformStatsAction.java | 4 +-- .../action/PreviewTransformAction.java | 16 ++++++------ .../transform/action/PutTransformAction.java | 2 +- .../action/StartTransformAction.java | 4 +-- .../transform/action/StopTransformAction.java | 4 +-- .../action/UpdateTransformAction.java | 6 ++--- .../compat/UpdateTransformActionPre78.java | 6 ++--- .../notifications/TransformAuditMessage.java | 4 +-- .../core/transform/transforms/DestConfig.java | 16 ++++++------ .../transform/transforms/NodeAttributes.java | 10 +++---- .../transform/transforms/QueryConfig.java | 14 +++++----- .../transforms/RetentionPolicyConfig.java | 4 +-- .../transform/transforms/SettingsConfig.java | 14 +++++----- .../transform/transforms/SourceConfig.java | 16 ++++++------ .../core/transform/transforms/SyncConfig.java | 2 +- .../transforms/TimeRetentionPolicyConfig.java | 12 ++++----- .../transform/transforms/TimeSyncConfig.java | 12 ++++----- .../transforms/TransformCheckpoint.java | 14 +++++----- .../transforms/TransformCheckpointStats.java | 10 +++---- .../TransformCheckpointingInfo.java | 12 ++++----- .../transform/transforms/TransformConfig.java | 18 ++++++------- .../transforms/TransformConfigUpdate.java | 6 ++--- .../TransformDestIndexSettings.java | 12 ++++----- .../transforms/TransformIndexerPosition.java | 14 +++++----- .../transforms/TransformIndexerStats.java | 10 +++---- .../transforms/TransformProgress.java | 10 +++---- .../transform/transforms/TransformState.java | 14 +++++----- .../transform/transforms/TransformStats.java | 16 ++++++------ .../transforms/TransformStoredDoc.java | 10 +++---- .../transforms/TransformTaskParams.java | 8 +++--- .../transforms/latest/LatestConfig.java | 14 +++++----- .../transforms/pivot/AggregationConfig.java | 14 +++++----- .../pivot/DateHistogramGroupSource.java | 14 +++++----- .../transforms/pivot/GeoTileGroupSource.java | 12 ++++----- .../transforms/pivot/GroupConfig.java | 12 ++++----- .../pivot/HistogramGroupSource.java | 10 +++---- .../transforms/pivot/PivotConfig.java | 14 +++++----- .../transforms/pivot/ScriptConfig.java | 12 ++++----- .../transforms/pivot/SingleGroupSource.java | 10 +++---- .../transforms/pivot/TermsGroupSource.java | 4 +-- .../core/watcher/WatcherFeatureSetUsage.java | 2 +- .../xpack/core/watcher/WatcherMetadata.java | 6 ++--- .../xpack/core/watcher/actions/Action.java | 8 +++--- .../core/watcher/actions/ActionFactory.java | 2 +- .../core/watcher/actions/ActionRegistry.java | 2 +- .../core/watcher/actions/ActionStatus.java | 8 +++--- .../core/watcher/actions/ActionWrapper.java | 8 +++--- .../watcher/actions/ActionWrapperField.java | 2 +- .../watcher/actions/ActionWrapperResult.java | 4 +-- .../watcher/actions/ExecutableAction.java | 4 +-- .../actions/throttler/ThrottlerField.java | 2 +- .../watcher/client/WatchSourceBuilder.java | 10 +++---- .../watcher/condition/AlwaysCondition.java | 2 +- .../core/watcher/condition/Condition.java | 4 +-- .../watcher/condition/ConditionFactory.java | 2 +- .../watcher/condition/ConditionRegistry.java | 2 +- .../core/watcher/execution/QueuedWatch.java | 4 +-- .../execution/WatchExecutionResult.java | 6 ++--- .../execution/WatchExecutionSnapshot.java | 4 +-- .../core/watcher/history/WatchRecord.java | 6 ++--- .../core/watcher/input/ExecutableInput.java | 4 +-- .../xpack/core/watcher/input/Input.java | 6 ++--- .../core/watcher/input/none/NoneInput.java | 4 +-- .../watcher/support/WatcherDateTimeUtils.java | 4 +-- .../core/watcher/support/WatcherUtils.java | 6 ++--- .../support/xcontent/WatcherParams.java | 2 +- .../xcontent/WatcherXContentParser.java | 4 +-- .../support/xcontent/XContentSource.java | 14 +++++----- .../transform/ExecutableTransform.java | 4 +-- .../core/watcher/transform/Transform.java | 6 ++--- .../watcher/transform/TransformFactory.java | 2 +- .../watcher/transform/TransformRegistry.java | 2 +- .../transform/chain/ChainTransform.java | 6 ++--- .../chain/ChainTransformFactory.java | 2 +- .../transport/actions/QueryWatchesAction.java | 20 +++++++------- .../actions/execute/ExecuteWatchRequest.java | 2 +- .../execute/ExecuteWatchRequestBuilder.java | 2 +- .../actions/execute/ExecuteWatchResponse.java | 14 +++++----- .../actions/get/GetWatchResponse.java | 4 +-- .../actions/put/PutWatchRequestBuilder.java | 2 +- .../actions/stats/WatcherStatsResponse.java | 4 +-- .../xpack/core/watcher/trigger/Trigger.java | 4 +-- .../core/watcher/trigger/TriggerEvent.java | 6 ++--- .../xpack/core/watcher/watch/Payload.java | 4 +-- .../xpack/core/watcher/watch/Watch.java | 4 +-- .../xpack/core/watcher/watch/WatchField.java | 2 +- .../xpack/core/watcher/watch/WatchStatus.java | 8 +++--- .../license/LicenseSerializationTests.java | 8 +++--- .../license/LicenseServiceTests.java | 8 +++--- .../elasticsearch/license/LicenseTests.java | 8 +++--- .../LicensesMetadataSerializationTests.java | 12 ++++----- .../license/LicensesTransportTests.java | 2 +- .../license/SelfGeneratedLicenseTests.java | 8 +++--- .../org/elasticsearch/license/TestUtils.java | 10 +++---- .../core/LocalStateCompositeXPackPlugin.java | 2 +- ...DelegatePkiAuthenticationRequestTests.java | 2 +- ...elegatePkiAuthenticationResponseTests.java | 8 +++--- .../action/ReloadAnalyzersResponseTests.java | 2 +- .../SetResetModeActionRequestTests.java | 2 +- .../core/action/util/PageParamsTests.java | 2 +- .../core/action/util/QueryPageTests.java | 6 ++--- .../core/ccr/action/ShardFollowTaskTests.java | 2 +- .../AbstractAuditMessageTests.java | 10 +++---- .../notifications/AbstractAuditorTests.java | 10 +++---- .../core/common/time/TimeUtilsTests.java | 6 ++--- .../deprecation/DeprecationIssueTests.java | 6 ++--- .../xpack/core/ilm/AllocateActionTests.java | 2 +- .../xpack/core/ilm/DeleteActionTests.java | 2 +- .../ilm/ExplainLifecycleResponseTests.java | 6 ++--- .../xpack/core/ilm/ForceMergeActionTests.java | 8 +++--- .../xpack/core/ilm/FreezeActionTests.java | 2 +- .../IndexLifecycleExplainResponseTests.java | 10 +++---- .../ilm/LifecyclePolicyMetadataTests.java | 6 ++--- .../xpack/core/ilm/LifecyclePolicyTests.java | 6 ++--- .../xpack/core/ilm/MigrateActionTests.java | 2 +- .../xpack/core/ilm/MockAction.java | 6 ++--- .../xpack/core/ilm/MockActionTests.java | 2 +- .../core/ilm/PhaseCacheManagementTests.java | 4 +-- .../core/ilm/PhaseExecutionInfoTests.java | 6 ++--- .../xpack/core/ilm/PhaseTests.java | 6 ++--- .../xpack/core/ilm/ReadOnlyActionTests.java | 2 +- .../xpack/core/ilm/RolloverActionTests.java | 2 +- .../xpack/core/ilm/RollupILMActionTests.java | 2 +- .../ilm/SearchableSnapshotActionTests.java | 2 +- .../core/ilm/SegmentCountStepInfoTests.java | 2 +- .../xpack/core/ilm/SegmentCountStepTests.java | 2 +- .../core/ilm/SetPriorityActionTests.java | 2 +- .../xpack/core/ilm/ShrinkActionTests.java | 2 +- .../ShrunkShardsAllocatedStepInfoTests.java | 2 +- .../ilm/ShrunkenIndexCheckStepInfoTests.java | 2 +- .../xpack/core/ilm/StepKeyTests.java | 2 +- .../xpack/core/ilm/UnfollowActionTests.java | 2 +- .../core/ilm/WaitForActiveShardsTests.java | 6 ++--- .../WaitForFollowShardTasksStepInfoTests.java | 4 +-- .../ilm/WaitForFollowShardTasksStepTests.java | 2 +- .../core/ilm/WaitForNoFollowersStepTests.java | 2 +- .../ilm/WaitForRolloverReadyStepTests.java | 2 +- .../core/ilm/WaitForSnapshotActionTests.java | 2 +- .../ilm/action/MoveToStepRequestTests.java | 2 +- .../ilm/action/PutLifecycleRequestTests.java | 6 ++--- ...moveIndexLifecyclePolicyResponseTests.java | 2 +- .../info/AllocationRoutedStepInfoTests.java | 2 +- .../indexing/AsyncTwoPhaseIndexerTests.java | 2 +- .../ml/AbstractBWCSerializationTestCase.java | 2 +- .../ml/action/CloseJobActionRequestTests.java | 2 +- ...nedModelAllocationActionResponseTests.java | 2 +- .../core/ml/action/DatafeedParamsTests.java | 2 +- .../EvaluateDataFrameActionRequestTests.java | 4 +-- ...DataFrameAnalyticsActionResponseTests.java | 2 +- .../action/ForecastJobActionRequestTests.java | 2 +- .../action/GetBucketActionRequestTests.java | 2 +- .../GetCalendarEventsActionRequestTests.java | 2 +- .../GetCalendarsActionRequestTests.java | 2 +- .../ml/action/GetCategoriesRequestTests.java | 2 +- ...DataFrameAnalyticsActionResponseTests.java | 2 +- ...rameAnalyticsStatsActionResponseTests.java | 2 +- .../GetDatafeedStatsActionResponseTests.java | 6 ++--- .../GetInfluencersActionRequestTests.java | 2 +- .../GetModelSnapshotsActionRequestTests.java | 2 +- .../GetOverallBucketsActionRequestTests.java | 2 +- .../action/GetRecordsActionRequestTests.java | 2 +- .../xpack/core/ml/action/JobParamsTests.java | 2 +- .../ml/action/OpenJobActionRequestTests.java | 2 +- .../PostCalendarEventActionRequestTests.java | 4 +-- .../ml/action/PostDataActionRequestTests.java | 2 +- .../PreviewDatafeedActionRequestTests.java | 2 +- .../action/PutCalendarActionRequestTests.java | 2 +- ...tDataFrameAnalyticsActionRequestTests.java | 4 +-- .../action/PutDatafeedActionRequestTests.java | 4 +-- .../action/PutFilterActionRequestTests.java | 2 +- .../action/PutFilterActionResponseTests.java | 2 +- .../PutTrainedModelActionRequestTests.java | 2 +- .../PutTrainedModelActionResponseTests.java | 2 +- ...RevertModelSnapshotActionRequestTests.java | 2 +- .../SetUpgradeModeActionRequestTests.java | 2 +- ...taFrameAnalyticsActionTaskParamsTests.java | 2 +- .../StartDataFrameAnalyticsRequestTests.java | 4 +-- .../StartDatafeedActionRequestTests.java | 2 +- ...artTrainedModelDeploymentRequestTests.java | 2 +- ...TrainedModelDeploymentTaskParamsTests.java | 2 +- .../StopDataFrameAnalyticsRequestTests.java | 4 +-- .../StopDatafeedActionRequestTests.java | 2 +- ...eDataFrameAnalyticsActionRequestTests.java | 4 +-- .../UpdateDatafeedActionRequestTests.java | 4 +-- .../UpdateFilterActionRequestTests.java | 2 +- ...UpdateModelSnapshotActionRequestTests.java | 2 +- .../UpgradeJobModelSnapshotRequestTests.java | 2 +- .../UpgradeJobModelSnapshotResponseTests.java | 2 +- .../ValidateDetectorActionRequestTests.java | 2 +- .../ValidateJobConfigActionRequestTests.java | 14 +++++----- .../core/ml/annotations/AnnotationTests.java | 2 +- .../core/ml/calendars/CalendarTests.java | 4 +-- .../ml/calendars/ScheduledEventTests.java | 4 +-- .../core/ml/datafeed/AggProviderTests.java | 10 +++---- .../AggProviderWireSerializationTests.java | 2 +- .../core/ml/datafeed/ChunkingConfigTests.java | 2 +- .../core/ml/datafeed/DatafeedConfigTests.java | 14 +++++----- .../ml/datafeed/DatafeedTimingStatsTests.java | 10 +++---- .../core/ml/datafeed/DatafeedUpdateTests.java | 12 ++++----- .../datafeed/DelayedDataCheckConfigTests.java | 2 +- .../DataFrameAnalyticsConfigTests.java | 20 +++++++------- .../DataFrameAnalyticsConfigUpdateTests.java | 2 +- .../DataFrameAnalyticsDestTests.java | 2 +- .../DataFrameAnalyticsSourceTests.java | 4 +-- .../DataFrameAnalyticsTaskStateTests.java | 2 +- .../analyses/BoostedTreeParamsTests.java | 4 +-- .../analyses/ClassificationTests.java | 14 +++++----- .../analyses/OutlierDetectionTests.java | 2 +- .../dataframe/analyses/RegressionTests.java | 14 +++++----- .../classification/AccuracyTests.java | 2 +- .../classification/AucRocTests.java | 2 +- .../classification/ClassificationTests.java | 6 ++--- .../MulticlassConfusionMatrixResultTests.java | 2 +- .../MulticlassConfusionMatrixTests.java | 2 +- .../PerClassSingleValueTests.java | 2 +- .../classification/PrecisionTests.java | 2 +- .../classification/RecallTests.java | 2 +- .../outlierdetection/AucRocTests.java | 2 +- .../ConfusionMatrixTests.java | 2 +- .../OutlierDetectionTests.java | 4 +-- .../outlierdetection/PrecisionTests.java | 2 +- .../outlierdetection/RecallTests.java | 2 +- .../evaluation/regression/HuberTests.java | 2 +- .../regression/MeanSquaredErrorTests.java | 2 +- .../MeanSquaredLogarithmicErrorTests.java | 2 +- .../evaluation/regression/RSquaredTests.java | 2 +- .../regression/RegressionTests.java | 4 +-- .../explain/FieldSelectionTests.java | 2 +- .../explain/MemoryEstimationTests.java | 2 +- .../ClassificationStatsTests.java | 4 +-- .../classification/HyperparametersTests.java | 2 +- .../classification/TimingStatsTests.java | 2 +- .../classification/ValidationLossTests.java | 4 +-- .../stats/common/DataCountsTests.java | 4 +-- .../stats/common/FoldValuesTests.java | 2 +- .../stats/common/MemoryUsageTests.java | 4 +-- .../OutlierDetectionStatsTests.java | 4 +-- .../outlierdetection/ParametersTests.java | 2 +- .../outlierdetection/TimingStatsTests.java | 2 +- .../regression/HyperparametersTests.java | 2 +- .../regression/RegressionStatsTests.java | 4 +-- .../stats/regression/TimingStatsTests.java | 2 +- .../stats/regression/ValidationLossTests.java | 4 +-- .../InferenceConfigItemTestCase.java | 4 +-- .../InferenceToXContentCompressorTests.java | 2 +- .../inference/NamedXContentObjectsTests.java | 12 ++++----- .../ml/inference/TrainedModelConfigTests.java | 14 +++++----- .../TrainedModelDefinitionTests.java | 10 +++---- .../ml/inference/TrainedModelInputTests.java | 2 +- .../allocation/AllocationStatusTests.java | 2 +- .../RoutingStateAndReasonTests.java | 2 +- .../TrainedModelAllocationTests.java | 2 +- .../CustomWordEmbeddingTests.java | 2 +- .../preprocessing/FrequencyEncodingTests.java | 2 +- .../inference/preprocessing/MultiTests.java | 2 +- .../inference/preprocessing/NGramTests.java | 2 +- .../preprocessing/OneHotEncodingTests.java | 2 +- .../preprocessing/PreProcessingTests.java | 2 +- .../TargetMeanEncodingTests.java | 2 +- .../NGramFeatureExtractorTests.java | 16 ++++++------ .../ClassificationFeatureImportanceTests.java | 2 +- .../results/InferenceResultsTestCase.java | 4 +-- .../RegressionFeatureImportanceTests.java | 2 +- .../inference/results/TopClassEntryTests.java | 2 +- .../trainedmodel/BertTokenizationTests.java | 2 +- .../ClassificationConfigTests.java | 2 +- .../ClassificationConfigUpdateTests.java | 2 +- .../trainedmodel/FillMaskConfigTests.java | 2 +- .../FillMaskConfigUpdateTests.java | 2 +- .../trainedmodel/IndexLocationTests.java | 2 +- .../trainedmodel/InferenceStatsTests.java | 4 +-- .../trainedmodel/NerConfigTests.java | 2 +- .../trainedmodel/NerConfigUpdateTests.java | 2 +- .../trainedmodel/PassThroughConfigTests.java | 2 +- .../PassThroughConfigUpdateTests.java | 2 +- .../trainedmodel/RegressionConfigTests.java | 2 +- .../RegressionConfigUpdateTests.java | 2 +- .../TextClassificationConfigTests.java | 2 +- .../TextClassificationConfigUpdateTests.java | 2 +- .../TextEmbeddingConfigTests.java | 2 +- .../TextEmbeddingConfigUpdateTests.java | 2 +- .../trainedmodel/VocabularyConfigTests.java | 2 +- .../ZeroShotClassificationConfigTests.java | 2 +- ...roShotClassificationConfigUpdateTests.java | 2 +- .../trainedmodel/ensemble/EnsembleTests.java | 4 +-- .../trainedmodel/ensemble/ExponentTests.java | 2 +- .../ensemble/LogisticRegressionTests.java | 2 +- .../ensemble/WeightedModeTests.java | 2 +- .../ensemble/WeightedSumTests.java | 2 +- .../EnsembleInferenceModelTests.java | 2 +- .../inference/InferenceDefinitionTests.java | 10 +++---- .../inference/InferenceModelTestUtils.java | 14 +++++----- .../inference/TreeInferenceModelTests.java | 2 +- .../LangIdentNeuralNetworkTests.java | 4 +-- .../langident/LangNetLayerTests.java | 2 +- .../langident/LanguageExamples.java | 16 ++++++------ .../FeatureImportanceBaselineTests.java | 2 +- .../metadata/HyperparametersTests.java | 2 +- .../metadata/TotalFeatureImportanceTests.java | 2 +- .../metadata/TrainedModelMetadataTests.java | 2 +- .../trainedmodel/tree/TreeNodeTests.java | 2 +- .../trainedmodel/tree/TreeTests.java | 2 +- .../ml/job/config/AnalysisConfigTests.java | 2 +- .../ml/job/config/AnalysisLimitsTests.java | 12 ++++----- .../core/ml/job/config/BlockedTests.java | 2 +- .../ml/job/config/DataDescriptionTests.java | 10 +++---- .../ml/job/config/DetectionRuleTests.java | 2 +- .../core/ml/job/config/DetectorTests.java | 2 +- .../core/ml/job/config/FilterRefTests.java | 2 +- .../xpack/core/ml/job/config/JobTests.java | 16 ++++++------ .../core/ml/job/config/JobUpdateTests.java | 2 +- .../core/ml/job/config/MlFilterTests.java | 4 +-- .../ml/job/config/ModelPlotConfigTests.java | 2 +- ...PerPartitionCategorizationConfigTests.java | 2 +- .../ml/job/config/RuleConditionTests.java | 2 +- .../state/CategorizerStatsTests.java | 2 +- .../autodetect/state/DataCountsTests.java | 2 +- .../autodetect/state/ModelSizeStatsTests.java | 4 +-- .../autodetect/state/ModelSnapshotTests.java | 4 +-- .../autodetect/state/QuantilesTests.java | 4 +-- .../autodetect/state/TimingStatsTests.java | 4 +-- .../ml/job/results/AnomalyCauseTests.java | 4 +-- .../ml/job/results/AnomalyRecordTests.java | 8 +++--- .../ml/job/results/BucketInfluencerTests.java | 4 +-- .../core/ml/job/results/GeoResultsTests.java | 4 +-- .../core/ml/job/results/InfluencerTests.java | 6 ++--- .../AnomalyDetectionAuditMessageTests.java | 2 +- .../DataFrameAnalyticsAuditMessageTests.java | 2 +- .../InferenceAuditMessageTests.java | 2 +- .../core/ml/stats/ForecastStatsTests.java | 9 +++---- ...nentialAverageCalculationContextTests.java | 2 +- .../utils/NamedXContentObjectHelperTests.java | 12 ++++----- .../core/ml/utils/PhaseProgressTests.java | 2 +- .../core/ml/utils/QueryProviderTests.java | 10 +++---- .../utils/XContentObjectTransformerTests.java | 12 ++++----- .../core/rollup/RollupActionConfigTests.java | 2 +- ...eHistogramGroupConfigSerializingTests.java | 2 +- ...llupActionGroupConfigSerializingTests.java | 2 +- ...eHistogramGroupConfigSerializingTests.java | 2 +- .../job/GroupConfigSerializingTests.java | 2 +- .../HistogramGroupConfigSerializingTests.java | 2 +- .../job/JobWrapperSerializingTests.java | 2 +- .../job/MetricConfigSerializingTests.java | 2 +- .../job/RollupIndexerJobStatsTests.java | 2 +- .../core/rollup/job/RollupJobConfigTests.java | 2 +- .../core/rollup/job/RollupJobStatusTests.java | 2 +- .../xpack/core/rollup/job/RollupJobTests.java | 2 +- .../job/TermsGroupConfigSerializingTests.java | 2 +- .../core/security/EnrollmentTokenTests.java | 5 ++-- .../core/security/action/ApiKeyTests.java | 6 ++--- .../CreateApiKeyRequestBuilderTests.java | 2 +- .../action/CreateApiKeyResponseTests.java | 2 +- .../action/GetApiKeyResponseTests.java | 6 ++--- .../action/InvalidateApiKeyResponseTests.java | 6 ++--- .../KibanaEnrollmentResponseTests.java | 6 ++--- .../NodeEnrollementResponseTests.java | 6 ++--- ...reateServiceAccountTokenResponseTests.java | 6 ++--- ...eleteServiceAccountTokenResponseTests.java | 6 ++--- ...erviceAccountCredentialsResponseTests.java | 6 ++--- .../GetServiceAccountResponseTests.java | 8 +++--- .../token/InvalidateTokenResponseTests.java | 6 ++--- .../support/mapper/TemplateRoleNameTests.java | 8 +++--- .../expressiondsl/ExpressionParserTests.java | 8 +++--- .../accesscontrol/FieldSubsetReaderTests.java | 2 +- .../permission/ClusterPermissionTests.java | 2 +- .../ApplicationPrivilegeDescriptorTests.java | 14 +++++----- .../ConfigurableClusterPrivilegesTests.java | 14 +++++----- .../ManageApplicationPrivilegesTests.java | 14 +++++----- .../support/DLSRoleQueryValidatorTests.java | 2 +- .../SecurityQueryTemplateEvaluatorTests.java | 6 ++--- .../security/test/TestRestrictedIndices.java | 4 +-- .../slm/SnapshotInvocationRecordTests.java | 2 +- .../slm/SnapshotLifecycleMetadataTests.java | 2 +- .../SnapshotLifecyclePolicyMetadataTests.java | 2 +- .../core/slm/SnapshotLifecycleStatsTests.java | 2 +- .../slm/history/SnapshotHistoryItemTests.java | 2 +- .../history/SnapshotHistoryStoreTests.java | 6 ++--- ...napshotLifecycleTemplateRegistryTests.java | 8 +++--- .../xpack/core/termsenum/TermCountTests.java | 2 +- .../core/termsenum/TermsEnumRequestTests.java | 6 ++--- .../termsenum/TermsEnumResponseTests.java | 2 +- .../action/RestTermsEnumActionTests.java | 4 +-- .../structurefinder/FieldStatsTests.java | 2 +- .../structurefinder/TextStructureTests.java | 4 +-- .../AbstractSerializingTransformTestCase.java | 8 +++--- .../MockDeprecatedAggregationBuilder.java | 4 +-- .../transform/MockDeprecatedQueryBuilder.java | 6 ++--- ...tractWireSerializingTransformTestCase.java | 2 +- .../GetTransformActionResponseTests.java | 6 ++--- .../PreviewTransformActionRequestTests.java | 6 ++--- .../PreviewTransformsActionResponseTests.java | 2 +- .../UpdateTransformsActionResponseTests.java | 2 +- .../TransformAuditMessageTests.java | 2 +- .../transform/transforms/DestConfigTests.java | 4 +-- .../transforms/NodeAttributeTests.java | 2 +- .../transforms/QueryConfigTests.java | 12 ++++----- .../transforms/SettingsConfigTests.java | 12 ++++----- .../transforms/SourceConfigTests.java | 2 +- .../TimeRetentionPolicyConfigTests.java | 2 +- .../transforms/TimeSyncConfigTests.java | 2 +- .../TransformCheckpointStatsTests.java | 2 +- .../transforms/TransformCheckpointTests.java | 6 ++--- .../TransformCheckpointingInfoTests.java | 2 +- .../transforms/TransformConfigTests.java | 12 ++++----- .../TransformConfigUpdateTests.java | 2 +- .../TransformDestIndexSettingsTests.java | 2 +- .../TransformIndexerPositionTests.java | 2 +- .../TransformIndexerStatsTests.java | 4 +-- .../transforms/TransformProgressTests.java | 2 +- .../transforms/TransformStateTests.java | 2 +- .../transforms/TransformStatsTests.java | 2 +- .../transforms/TransformStoredDocTests.java | 4 +-- .../transform/transforms/TransformTests.java | 2 +- .../transforms/latest/LatestConfigTests.java | 6 ++--- .../pivot/AggregationConfigTests.java | 12 ++++----- .../pivot/DateHistogramGroupSourceTests.java | 2 +- .../pivot/GeoTileGroupSourceTests.java | 2 +- .../transforms/pivot/GroupConfigTests.java | 12 ++++----- .../pivot/HistogramGroupSourceTests.java | 2 +- .../transforms/pivot/PivotConfigTests.java | 6 ++--- .../transforms/pivot/ScriptConfigTests.java | 14 +++++----- .../pivot/TermsGroupSourceTests.java | 4 +-- .../schema/TransformConfigTests.java | 4 +-- .../xcontent/WatcherXContentParserTests.java | 10 +++---- .../xpack/datastreams/DataStreamRestIT.java | 8 +++--- .../datastreams/DataStreamUpgradeRestIT.java | 2 +- .../datastreams/AutoCreateDataStreamIT.java | 4 +-- .../datastreams/DataStreamIT.java | 4 +-- .../datastreams/DataStreamMigrationIT.java | 2 +- .../datastreams/SystemDataStreamIT.java | 2 +- .../SystemDataStreamSnapshotIT.java | 2 +- .../datastreams/DataStreamsStatsTests.java | 2 +- .../DataStreamTimestampFieldMapperTests.java | 2 +- .../xpack/deprecation/DeprecationHttpIT.java | 4 +-- .../xpack/deprecation/MlDeprecationIT.java | 4 +-- .../TestDeprecatedQueryBuilder.java | 4 +-- .../TestDeprecationHeaderRestAction.java | 4 +-- .../xpack/deprecation/Deprecation.java | 2 +- .../xpack/deprecation/DeprecationChecker.java | 2 +- .../deprecation/DeprecationInfoAction.java | 4 +-- .../deprecation/MlDeprecationChecker.java | 2 +- .../TransportDeprecationInfoAction.java | 2 +- .../logging/DeprecationCacheResetAction.java | 4 +-- .../logging/DeprecationIndexingAppender.java | 2 +- .../DeprecationIndexingTemplateRegistry.java | 2 +- .../DeprecationInfoActionResponseTests.java | 4 +-- .../MlDeprecationCheckerTests.java | 2 +- .../test/enrich/CommonEnrichRestTestCase.java | 6 ++--- .../xpack/enrich/EnrichMultiNodeIT.java | 2 +- .../xpack/enrich/EnrichMetadata.java | 8 +++--- .../xpack/enrich/EnrichPlugin.java | 4 +-- .../EnrichPolicyMaintenanceService.java | 2 +- .../enrich/EnrichPolicyReindexPipeline.java | 4 +-- .../xpack/enrich/EnrichPolicyRunner.java | 8 +++--- .../action/EnrichShardMultiSearchAction.java | 12 ++++----- .../rest/RestPutEnrichPolicyAction.java | 2 +- .../xpack/enrich/BasicEnrichTests.java | 2 +- .../xpack/enrich/EnrichMetadataTests.java | 4 +-- .../EnrichPolicyMaintenanceServiceTests.java | 4 +-- .../xpack/enrich/EnrichPolicyRunnerTests.java | 8 +++--- .../xpack/enrich/EnrichPolicyTests.java | 10 +++---- .../xpack/enrich/EnrichPolicyUpdateTests.java | 2 +- .../xpack/enrich/EnrichResiliencyTests.java | 6 ++--- .../xpack/enrich/EnrichStoreCrudTests.java | 2 +- .../xpack/enrich/GeoMatchProcessorTests.java | 4 +-- .../xpack/enrich/MatchProcessorTests.java | 4 +-- .../EnrichShardMultiSearchActionTests.java | 4 +-- .../GetEnrichPolicyActionResponseTests.java | 4 +-- .../PutEnrichPolicyActionRequestTests.java | 2 +- ...ransportDeleteEnrichPolicyActionTests.java | 2 +- .../TransportGetEnrichPolicyActionTests.java | 2 +- .../enrich/EnrichCoordinatorDocTests.java | 6 ++--- .../enrich/ExecutingPolicyDocTests.java | 6 ++--- .../elasticsearch/test/eql/DataLoader.java | 10 +++---- .../test/eql/EqlRestTestCase.java | 2 +- .../test/eql/EqlRestValidationTestCase.java | 6 ++--- .../test/eql/stats/EqlUsageRestTestCase.java | 2 +- .../xpack/eql/qa/mixed_node/EqlSearchIT.java | 2 +- .../xpack/eql/AsyncEqlSecurityIT.java | 6 ++--- .../eql/action/AsyncEqlSearchActionIT.java | 2 +- .../xpack/eql/action/EqlCancellationIT.java | 2 +- .../eql/action/RestEqlCancellationIT.java | 2 +- .../xpack/eql/action/EqlSearchRequest.java | 14 +++++----- .../xpack/eql/action/EqlSearchResponse.java | 20 +++++++------- .../xpack/eql/plugin/EqlPlugin.java | 2 +- .../xpack/eql/plugin/EqlStatsResponse.java | 4 +-- .../xpack/eql/plugin/RestEqlSearchAction.java | 6 ++--- .../querydsl/container/QueryContainer.java | 6 ++--- .../eql/AbstractBWCSerializationTestCase.java | 2 +- .../eql/EqlInfoTransportActionTests.java | 2 +- .../eql/action/EqlRequestParserTests.java | 8 +++--- .../eql/action/EqlSearchRequestTests.java | 6 ++--- .../eql/action/EqlSearchResponseTests.java | 10 +++---- .../action/GetGlobalCheckpointsActionIT.java | 2 +- .../xpack/fleet/FleetSystemIndicesIT.java | 2 +- .../org/elasticsearch/xpack/fleet/Fleet.java | 8 +++--- .../xpack/fleet/FleetTemplateRegistry.java | 2 +- .../action/GetGlobalCheckpointsAction.java | 6 ++--- .../index/engine/frozen/FrozenIndexIT.java | 2 +- .../index/engine/frozen/FrozenIndexTests.java | 4 +-- .../graph/rest/action/RestGraphAction.java | 4 +-- .../rest/action/RestGraphActionTests.java | 2 +- .../idp/IdentityProviderAuthenticationIT.java | 4 +-- .../xpack/idp/IdpRestTestCase.java | 5 ++-- .../idp/ManageServiceProviderRestIT.java | 2 +- .../idp/WildcardServiceProviderRestIT.java | 4 +-- .../idp/action/SamlIdentityProviderTests.java | 6 ++--- .../xpack/idp/IdentityProviderPlugin.java | 2 +- .../DeleteSamlServiceProviderResponse.java | 4 +-- .../action/PutSamlServiceProviderRequest.java | 2 +- .../PutSamlServiceProviderResponse.java | 4 +-- .../RestDeleteSamlServiceProviderAction.java | 2 +- .../RestPutSamlServiceProviderAction.java | 4 +-- .../RestSamlInitiateSingleSignOnAction.java | 8 +++--- .../rest/action/RestSamlMetadataAction.java | 2 +- ...mlValidateAuthenticationRequestAction.java | 8 +++--- .../saml/sp/SamlServiceProviderDocument.java | 10 +++---- .../idp/saml/sp/SamlServiceProviderIndex.java | 10 +++---- .../idp/saml/sp/WildcardServiceProvider.java | 14 +++++----- .../sp/WildcardServiceProviderResolver.java | 10 +++---- .../saml/support/SamlAuthenticationState.java | 10 +++---- ...eleteSamlServiceProviderResponseTests.java | 2 +- .../PutSamlServiceProviderRequestTests.java | 6 ++--- .../sp/SamlServiceProviderDocumentTests.java | 8 +++--- .../WildcardServiceProviderResolverTests.java | 2 +- .../support/SamlAuthenticationStateTests.java | 8 +++--- .../xpack/ilm/CCRIndexLifecycleIT.java | 10 +++---- .../xpack/TimeSeriesRestDriver.java | 10 +++---- .../xpack/ilm/ChangePolicyforIndexIT.java | 4 +-- .../xpack/ilm/ExplainLifecycleIT.java | 4 +-- .../xpack/ilm/LifecycleLicenseIT.java | 6 ++--- .../xpack/ilm/TimeSeriesDataStreamsIT.java | 2 +- .../ilm/TimeSeriesLifecycleActionsIT.java | 8 +++--- .../actions/SearchableSnapshotActionIT.java | 6 ++--- .../xpack/ilm/actions/ShrinkActionIT.java | 6 ++--- .../xpack/slm/SnapshotLifecycleRestIT.java | 16 ++++++------ .../xpack/security/PermissionsIT.java | 8 +++--- .../IndexLifecycleInitialisationTests.java | 4 +-- .../xpack/ilm/UpdateSettingsStepTests.java | 2 +- ...adataMigrateToDataTiersRoutingService.java | 2 +- .../xpack/ilm/ExecuteStepsUpdateTask.java | 2 +- .../xpack/ilm/IndexLifecycle.java | 4 +-- .../xpack/ilm/IndexLifecycleRunner.java | 2 +- .../xpack/ilm/IndexLifecycleService.java | 2 +- .../xpack/ilm/IndexLifecycleTransition.java | 8 +++--- .../xpack/ilm/PolicyStepsRegistry.java | 10 +++---- .../xpack/ilm/SetStepInfoUpdateTask.java | 4 +-- .../ilm/action/RestMoveToStepAction.java | 2 +- .../ilm/action/RestPutLifecycleAction.java | 2 +- .../TransportExplainLifecycleAction.java | 8 +++--- .../TransportMigrateToDataTiersAction.java | 2 +- .../action/TransportPutLifecycleAction.java | 2 +- .../xpack/ilm/history/ILMHistoryItem.java | 8 +++--- .../xpack/ilm/history/ILMHistoryStore.java | 6 ++--- .../history/ILMHistoryTemplateRegistry.java | 2 +- .../xpack/slm/SnapshotLifecycleTask.java | 6 ++--- .../RestPutSnapshotLifecycleAction.java | 2 +- ...MigrateToDataTiersRoutingServiceTests.java | 6 ++--- .../ilm/ExecuteStepsUpdateTaskTests.java | 2 +- .../ilm/IndexLifecycleMetadataTests.java | 6 ++--- .../xpack/ilm/IndexLifecycleRunnerTests.java | 10 +++---- .../ilm/IndexLifecycleTransitionTests.java | 8 +++--- .../ilm/MoveToErrorStepUpdateTaskTests.java | 6 ++--- .../ilm/MoveToNextStepUpdateTaskTests.java | 2 +- .../xpack/ilm/PolicyStepsRegistryTests.java | 8 +++--- .../xpack/ilm/RandomStepInfo.java | 4 +-- .../xpack/ilm/SetStepInfoUpdateTaskTests.java | 8 +++--- .../TransportExplainLifecycleActionTests.java | 4 +-- .../ilm/history/ILMHistoryItemTests.java | 6 ++--- .../ilm/history/ILMHistoryStoreTests.java | 6 ++--- .../slm/SnapshotLifecyclePolicyTests.java | 2 +- .../xpack/slm/SnapshotLifecycleTaskTests.java | 2 +- .../test/rest/LogstashSystemIndexIT.java | 7 +++-- .../xpack/logstash/Logstash.java | 4 +-- .../xpack/logstash/Pipeline.java | 8 +++--- .../logstash/action/GetPipelineResponse.java | 4 +-- .../logstash/action/PutPipelineRequest.java | 2 +- .../rest/RestDeletePipelineAction.java | 2 +- .../logstash/rest/RestPutPipelineAction.java | 4 +-- .../action/PutPipelineRequestTests.java | 2 +- .../AggregateDoubleMetricFieldMapper.java | 4 +-- ...AggregateDoubleMetricFieldMapperTests.java | 4 +-- .../ConstantKeywordFieldMapperTests.java | 2 +- .../mapper/ConstantKeywordFieldMapper.java | 2 +- .../unsignedlong/UnsignedLongFieldMapper.java | 2 +- .../UnsignedLongFieldMapperTests.java | 2 +- .../xpack/unsignedlong/UnsignedLongTests.java | 2 +- .../xpack/versionfield/VersionFieldIT.java | 4 +-- .../VersionStringFieldMapper.java | 2 +- .../VersionStringFieldMapperTests.java | 6 ++--- .../versionfield/VersionStringFieldTests.java | 2 +- .../ml/integration/MlBasicMultiNodeIT.java | 4 +-- .../ml/integration/MlPluginDisabledIT.java | 4 +-- .../ml/integration/CategorizationIT.java | 10 +++---- .../ml/integration/ClassificationIT.java | 2 +- .../DataFrameAnalysisCustomFeatureIT.java | 2 +- .../ml/integration/DeleteExpiredDataIT.java | 8 +++--- .../xpack/ml/integration/DeleteJobIT.java | 6 ++--- .../ml/integration/InferenceIngestIT.java | 12 ++++----- .../MlNativeAutodetectIntegTestCase.java | 14 +++++----- .../ml/integration/MlNativeIntegTestCase.java | 2 +- .../integration/ModelSnapshotRetentionIT.java | 6 ++--- .../xpack/ml/integration/RegressionIT.java | 2 +- .../ml/integration/RevertModelSnapshotIT.java | 10 +++---- .../integration/RunDataFrameAnalyticsIT.java | 2 +- .../ml/integration/TestFeatureResetIT.java | 2 +- .../xpack/ml/integration/TrainedModelIT.java | 10 +++---- .../ml/transforms/PainlessDomainSplitIT.java | 2 +- .../license/MachineLearningLicensingIT.java | 2 +- .../ml/integration/AnomalyJobCRUDIT.java | 2 +- .../AutodetectResultProcessorIT.java | 6 ++--- .../integration/BasicDistributedJobsIT.java | 2 +- .../ChunkedTrainedModelRestorerIT.java | 6 ++--- .../integration/DataFrameAnalyticsCRUDIT.java | 2 +- .../ml/integration/JobResultsProviderIT.java | 8 +++--- .../ml/integration/MlAutoUpdateServiceIT.java | 2 +- .../ml/integration/MlConfigMigratorIT.java | 6 ++--- .../integration/MlDistributedFailureIT.java | 14 +++++----- .../integration/PyTorchStateStreamerIT.java | 6 ++--- .../TestFeatureLicenseTrackingIT.java | 2 +- .../integration/TrainedModelProviderIT.java | 6 ++--- .../ml/integration/UnusedStatsRemoverIT.java | 10 +++---- .../xpack/ml/MachineLearning.java | 4 +-- .../xpack/ml/MlConfigMigrator.java | 8 +++--- .../xpack/ml/MlIndexTemplateRegistry.java | 2 +- .../TransportGetDataFrameAnalyticsAction.java | 6 ++--- .../ml/action/TransportGetFiltersAction.java | 6 ++--- .../ml/action/TransportMlInfoAction.java | 2 +- .../TransportPostCalendarEventsAction.java | 6 ++--- .../TransportPreviewDatafeedAction.java | 2 +- .../ml/action/TransportPutCalendarAction.java | 6 ++--- .../TransportPutDataFrameAnalyticsAction.java | 4 +-- .../ml/action/TransportPutFilterAction.java | 6 ++--- .../TransportPutTrainedModelAction.java | 2 +- .../action/TransportStartDatafeedAction.java | 2 +- ...portStartTrainedModelDeploymentAction.java | 2 +- .../action/TransportUpdateFilterAction.java | 12 ++++----- .../TransportUpdateModelSnapshotAction.java | 6 ++--- .../CategorizeTextAggregationBuilder.java | 8 +++--- .../InternalCategorizationAggregation.java | 4 +-- .../BucketCorrelationAggregationBuilder.java | 10 +++---- .../CorrelationNamedContentProvider.java | 2 +- .../correlation/CountCorrelationFunction.java | 8 +++--- .../CountCorrelationIndicator.java | 10 +++---- .../xpack/ml/aggs/heuristic/PValueScore.java | 8 +++--- .../InferencePipelineAggregationBuilder.java | 12 ++++----- .../InternalInferenceAggregation.java | 2 +- .../BucketCountKSTestAggregationBuilder.java | 10 +++---- .../kstest/InternalKSTestAggregation.java | 2 +- .../ml/annotations/AnnotationPersister.java | 6 ++--- .../xpack/ml/autoscaling/MlScalingReason.java | 2 +- .../xpack/ml/datafeed/DatafeedJob.java | 2 +- .../xpack/ml/datafeed/DatafeedJobBuilder.java | 2 +- .../xpack/ml/datafeed/DatafeedManager.java | 6 ++--- .../DelayedDataDetectorFactory.java | 2 +- .../extractor/DataExtractorFactory.java | 2 +- .../AggregationDataExtractorFactory.java | 2 +- .../AggregationToJsonProcessor.java | 4 +-- ...positeAggregationDataExtractorFactory.java | 2 +- .../RollupDataExtractorFactory.java | 2 +- .../chunked/ChunkedDataExtractorFactory.java | 2 +- .../scroll/ScrollDataExtractorFactory.java | 2 +- .../scroll/SearchHitToJsonProcessor.java | 4 +-- .../persistence/DatafeedConfigProvider.java | 12 ++++----- .../ml/dataframe/DataFrameAnalyticsTask.java | 4 +-- .../xpack/ml/dataframe/StoredProgress.java | 8 +++--- .../DataFrameAnalyticsConfigProvider.java | 12 ++++----- .../AbstractNativeAnalyticsProcess.java | 4 +-- .../dataframe/process/AnalyticsBuilder.java | 6 ++--- .../process/AnalyticsProcessConfig.java | 4 +-- .../process/ChunkedTrainedModelPersister.java | 2 +- .../process/NativeAnalyticsProcess.java | 2 +- .../NativeAnalyticsProcessFactory.java | 2 +- .../NativeMemoryUsageEstimationProcess.java | 2 +- .../process/results/AnalyticsResult.java | 10 +++---- .../results/MemoryUsageEstimationResult.java | 12 ++++----- .../process/results/ModelMetadata.java | 12 ++++----- .../dataframe/process/results/RowResults.java | 10 +++---- .../results/TrainedModelDefinitionChunk.java | 12 ++++----- .../ml/dataframe/stats/StatsPersister.java | 4 +-- .../xpack/ml/dataframe/steps/FinalStep.java | 6 ++--- .../ml/inference/ModelAliasMetadata.java | 10 +++---- .../inference/TrainedModelStatsService.java | 6 ++--- .../TrainedModelAllocationMetadata.java | 4 +-- .../deployment/DeploymentManager.java | 8 +++--- .../inference/deployment/PyTorchResult.java | 12 ++++----- .../inference/modelsize/EnsembleSizeInfo.java | 12 ++++----- .../modelsize/FrequencyEncodingSize.java | 8 +++--- .../MlModelSizeNamedXContentProvider.java | 2 +- .../ml/inference/modelsize/ModelSizeInfo.java | 12 ++++----- .../modelsize/OneHotEncodingSize.java | 10 +++---- .../inference/modelsize/PreprocessorSize.java | 2 +- .../modelsize/TargetMeanEncodingSize.java | 8 +++--- .../ml/inference/modelsize/TreeSizeInfo.java | 14 +++++----- .../ml/inference/nlp/BertRequestBuilder.java | 4 +-- .../xpack/ml/inference/nlp/NlpTask.java | 2 +- .../xpack/ml/inference/nlp/Vocabulary.java | 8 +++--- .../nlp/tokenizers/WordPieceVocabulary.java | 10 +++---- .../ChunkedTrainedModelRestorer.java | 8 +++--- .../TrainedModelDefinitionDoc.java | 10 +++---- .../persistence/TrainedModelProvider.java | 16 ++++++------ .../pytorch/process/NativePyTorchProcess.java | 2 +- .../pytorch/process/PyTorchStateStreamer.java | 2 +- .../xpack/ml/job/JobManager.java | 8 +++--- .../persistence/BatchedBucketsIterator.java | 8 +++--- .../BatchedInfluencersIterator.java | 8 +++--- .../persistence/BatchedRecordsIterator.java | 8 +++--- .../ml/job/persistence/JobConfigProvider.java | 12 ++++----- .../persistence/JobDataCountsPersister.java | 6 ++--- .../JobRenormalizedResultsPersister.java | 6 ++--- .../job/persistence/JobResultsPersister.java | 6 ++--- .../job/persistence/JobResultsProvider.java | 14 +++++----- .../persistence/SearchAfterJobsIterator.java | 8 +++--- .../process/autodetect/AutodetectBuilder.java | 6 ++--- .../autodetect/AutodetectCommunicator.java | 4 +-- .../autodetect/AutodetectProcessManager.java | 4 +-- .../NativeAutodetectProcessFactory.java | 2 +- .../writer/AbstractDataToProcessWriter.java | 2 +- .../writer/AutodetectControlMsgWriter.java | 6 ++--- .../writer/DataToProcessWriter.java | 2 +- .../writer/JsonDataToProcessWriter.java | 8 +++--- .../writer/ScheduledEventToRuleWriter.java | 6 ++--- .../writer/XContentRecordReader.java | 2 +- .../BucketInfluencerNormalizable.java | 2 +- .../normalizer/BucketNormalizable.java | 2 +- .../normalizer/InfluencerNormalizable.java | 2 +- .../MultiplyingNormalizerProcess.java | 8 +++--- .../job/process/normalizer/Normalizable.java | 2 +- .../process/normalizer/NormalizerResult.java | 8 +++--- .../normalizer/RecordNormalizable.java | 2 +- .../output/NormalizerResultHandler.java | 10 +++---- .../ml/job/results/AutodetectResult.java | 10 +++---- .../job/retention/ExpiredResultsRemover.java | 8 +++--- .../upgrader/SnapshotUpgradeTaskParams.java | 6 ++--- .../ml/notifications/AbstractMlAuditor.java | 2 +- .../xpack/ml/process/ControllerResponse.java | 8 +++--- .../ml/process/IndexingStateProcessor.java | 8 +++--- .../xpack/ml/process/NativeController.java | 2 +- .../ml/process/ProcessResultsParser.java | 10 +++---- .../ml/process/logging/CppLogMessage.java | 10 +++---- .../process/logging/CppLogMessageHandler.java | 12 ++++----- .../calendar/RestGetCalendarEventsAction.java | 2 +- .../rest/calendar/RestGetCalendarsAction.java | 2 +- .../calendar/RestPostCalendarEventAction.java | 2 +- .../rest/calendar/RestPutCalendarAction.java | 2 +- .../rest/datafeeds/RestPutDatafeedAction.java | 2 +- .../datafeeds/RestStartDatafeedAction.java | 4 +-- .../datafeeds/RestStopDatafeedAction.java | 4 +-- .../datafeeds/RestUpdateDatafeedAction.java | 2 +- ...estPostDataFrameAnalyticsUpdateAction.java | 2 +- .../RestPutDataFrameAnalyticsAction.java | 2 +- .../ml/rest/filter/RestPutFilterAction.java | 2 +- .../rest/filter/RestUpdateFilterAction.java | 2 +- .../inference/RestGetTrainedModelsAction.java | 6 ++--- .../inference/RestPutTrainedModelAction.java | 2 +- ...stPutTrainedModelDefinitionPartAction.java | 2 +- .../RestPutTrainedModelVocabularyAction.java | 2 +- .../ml/rest/job/RestDeleteJobAction.java | 2 +- .../xpack/ml/rest/job/RestFlushJobAction.java | 2 +- .../ml/rest/job/RestForecastJobAction.java | 2 +- .../xpack/ml/rest/job/RestOpenJobAction.java | 2 +- .../ml/rest/job/RestPostJobUpdateAction.java | 2 +- .../xpack/ml/rest/job/RestPutJobAction.java | 2 +- .../xpack/ml/rest/job/RestResetJobAction.java | 2 +- .../RestGetModelSnapshotsAction.java | 2 +- .../RestRevertModelSnapshotAction.java | 2 +- .../RestUpdateModelSnapshotAction.java | 2 +- .../ml/rest/results/RestGetBucketsAction.java | 2 +- .../rest/results/RestGetCategoriesAction.java | 2 +- .../results/RestGetInfluencersAction.java | 2 +- .../results/RestGetOverallBucketsAction.java | 2 +- .../ml/rest/results/RestGetRecordsAction.java | 2 +- .../validate/RestValidateDetectorAction.java | 2 +- .../validate/RestValidateJobConfigAction.java | 2 +- .../ml/utils/persistence/MlParserUtils.java | 8 +++--- .../persistence/ResultsPersisterService.java | 6 ++--- ...chineLearningInfoTransportActionTests.java | 6 ++--- ...lConfigMigrationEligibilityCheckTests.java | 2 +- .../xpack/ml/MlConfigMigratorTests.java | 2 +- .../ml/MlDailyMaintenanceServiceTests.java | 2 +- .../ml/MlIndexTemplateRegistryTests.java | 4 +-- .../xpack/ml/MlMetadataTests.java | 4 +-- .../xpack/ml/MlSingleNodeTestCase.java | 2 +- ...sportGetTrainedModelsStatsActionTests.java | 6 ++--- .../TransportStartDatafeedActionTests.java | 2 +- ...nternalCategorizationAggregationTests.java | 4 +-- .../categorization/ParsedCategorization.java | 6 ++--- ...ketCorrelationAggregationBuilderTests.java | 2 +- .../CountCorrelationIndicatorTests.java | 2 +- .../ml/aggs/heuristic/PValueScoreTests.java | 2 +- ...erencePipelineAggregationBuilderTests.java | 3 +-- .../InternalInferenceAggregationTests.java | 4 +-- .../ml/aggs/inference/ParsedInference.java | 14 +++++----- .../annotations/AnnotationPersisterTests.java | 4 +-- .../xpack/ml/datafeed/DatafeedJobTests.java | 6 ++--- .../datafeed/DatafeedJobValidatorTests.java | 2 +- .../DelayedDataDetectorFactoryTests.java | 2 +- .../extractor/DataExtractorFactoryTests.java | 2 +- .../AggregationDataExtractorFactoryTests.java | 2 +- .../ChunkedDataExtractorFactoryTests.java | 2 +- .../DataFrameAnalyticsTaskTests.java | 8 +++--- .../ml/dataframe/DestinationIndexTests.java | 4 +-- .../ml/dataframe/StoredProgressTests.java | 2 +- .../DataFrameDataExtractorTests.java | 2 +- .../inference/InferenceRunnerTests.java | 4 +-- .../process/AnalyticsProcessConfigTests.java | 6 ++--- .../ChunkedTrainedModelPersisterTests.java | 2 +- .../process/results/AnalyticsResultTests.java | 6 ++--- .../MemoryUsageEstimationResultTests.java | 2 +- .../process/results/RowResultsTests.java | 2 +- .../TrainedModelAllocationMetadataTests.java | 2 +- .../deployment/PyTorchResultTests.java | 2 +- .../InferenceProcessorFactoryTests.java | 6 ++--- .../ModelLoadingServiceTests.java | 6 ++--- .../modelsize/EnsembleSizeInfoTests.java | 2 +- .../modelsize/FrequencyEncodingSizeTests.java | 2 +- .../modelsize/ModelSizeInfoTests.java | 8 +++--- .../modelsize/OneHotEncodingSizeTests.java | 2 +- .../modelsize/SizeEstimatorTestCase.java | 2 +- .../TargetMeanEncodingSizeTests.java | 2 +- .../modelsize/TreeSizeInfoTests.java | 2 +- .../nlp/BertRequestBuilderTests.java | 2 +- .../nlp/TextClassificationProcessorTests.java | 2 +- .../ZeroShotClassificationProcessorTests.java | 2 +- .../TrainedModelDefinitionDocTests.java | 4 +-- .../TrainedModelProviderTests.java | 2 +- .../LangIdentNeuralNetworkInferenceTests.java | 2 +- .../xpack/ml/job/JobManagerTests.java | 8 +++--- .../CategorizationAnalyzerConfigTests.java | 4 +-- .../ml/job/config/JobTaskStateTests.java | 2 +- .../persistence/JobResultsProviderTests.java | 8 +++--- .../ml/job/persistence/MockClientBuilder.java | 2 +- .../job/persistence/StateStreamerTests.java | 2 +- .../AutodetectCommunicatorTests.java | 4 +-- .../AutodetectProcessManagerTests.java | 4 +-- .../NativeAutodetectProcessTests.java | 2 +- .../output/FlushAcknowledgementTests.java | 2 +- .../params/ForecastParamsTests.java | 2 +- .../AbstractDataToProcessWriterTests.java | 2 +- .../writer/JsonDataToProcessWriterTests.java | 8 +++--- .../writer/XContentRecordReaderTests.java | 10 +++---- .../normalizer/NormalizerResultTests.java | 2 +- .../ml/job/results/AutodetectResultTests.java | 2 +- .../xpack/ml/job/results/BucketTests.java | 4 +-- .../job/results/CategoryDefinitionTests.java | 4 +-- .../results/ForecastRequestStatsTests.java | 4 +-- .../xpack/ml/job/results/ForecastTests.java | 4 +-- .../xpack/ml/job/results/InfluenceTests.java | 4 +-- .../xpack/ml/job/results/ModelPlotTests.java | 8 +++--- .../AbstractExpiredJobDataRemoverTests.java | 6 ++--- .../ExpiredModelSnapshotsRemoverTests.java | 2 +- .../ml/process/ControllerResponseTests.java | 2 +- .../ml/process/NativeControllerTests.java | 2 +- .../ml/process/ProcessResultsParserTests.java | 8 +++--- .../process/logging/CppLogMessageTests.java | 12 ++++----- .../RestStartDatafeedActionTests.java | 2 +- .../exporter/http/HttpExporterIT.java | 14 +++++----- .../monitoring/integration/MonitoringIT.java | 8 +++--- .../xpack/monitoring/Monitoring.java | 2 +- .../MonitoringTemplateRegistry.java | 2 +- .../action/TransportMonitoringBulkAction.java | 2 +- .../ccr/AutoFollowStatsMonitoringDoc.java | 2 +- .../ccr/FollowStatsMonitoringDoc.java | 2 +- .../cluster/ClusterStatsMonitoringDoc.java | 4 +-- .../enrich/EnrichCoordinatorDoc.java | 2 +- .../collector/enrich/ExecutingPolicyDoc.java | 2 +- .../indices/IndexRecoveryMonitoringDoc.java | 2 +- .../indices/IndexStatsMonitoringDoc.java | 2 +- .../indices/IndicesStatsMonitoringDoc.java | 2 +- .../collector/ml/JobStatsMonitoringDoc.java | 2 +- .../node/NodeStatsMonitoringDoc.java | 2 +- .../collector/shards/ShardMonitoringDoc.java | 2 +- .../exporter/BytesReferenceMonitoringDoc.java | 4 +-- .../monitoring/exporter/ExportException.java | 2 +- .../exporter/FilteredMonitoringDoc.java | 8 +++--- .../http/ClusterAlertHttpResource.java | 4 +-- .../exporter/http/HttpExportBulk.java | 8 +++--- .../http/HttpExportBulkResponseListener.java | 8 +++--- .../http/PublishableHttpResource.java | 2 +- .../exporter/http/TemplateHttpResource.java | 2 +- .../exporter/http/VersionHttpResource.java | 2 +- .../http/WatcherExistsHttpResource.java | 4 +-- .../monitoring/exporter/local/LocalBulk.java | 2 +- .../exporter/local/LocalExporter.java | 2 +- .../rest/action/RestMonitoringBulkAction.java | 2 +- .../RestMonitoringMigrateAlertsAction.java | 4 +-- .../MonitoringInfoTransportActionTests.java | 6 ++--- .../xpack/monitoring/MonitoringTestUtils.java | 2 +- .../action/MonitoringBulkDocTests.java | 2 +- .../action/MonitoringBulkRequestTests.java | 6 ++--- .../TransportMonitoringBulkActionTests.java | 4 +-- .../ClusterStatsMonitoringDocTests.java | 2 +- .../IndexRecoveryMonitoringDocTests.java | 2 +- .../indices/IndexStatsMonitoringDocTests.java | 8 +++--- .../IndicesStatsMonitoringDocTests.java | 2 +- .../ml/JobStatsMonitoringDocTests.java | 2 +- .../node/NodeStatsMonitoringDocTests.java | 6 ++--- .../shards/ShardsMonitoringDocTests.java | 2 +- .../BaseFilteredMonitoringDocTestCase.java | 4 +-- .../exporter/BaseMonitoringDocTestCase.java | 10 +++---- .../BytesReferenceMonitoringDocTests.java | 4 +-- .../exporter/ClusterAlertsUtilTests.java | 2 +- .../monitoring/exporter/ExportersTests.java | 2 +- .../http/ClusterAlertHttpResourceTests.java | 4 +-- .../HttpExportBulkResponseListenerTests.java | 12 ++++----- .../http/PublishableHttpResourceTests.java | 4 +-- .../local/LocalExporterIntegTests.java | 4 +-- .../LocalExporterResourceIntegTests.java | 8 +++--- .../action/RestMonitoringBulkActionTests.java | 10 +++---- ...estMonitoringMigrateAlertsActionTests.java | 2 +- .../xpack/ql/async/QlStatusResponse.java | 2 +- .../xpack/ql/util/StringUtils.java | 6 ++--- .../ql/action/QlStatusResponseTests.java | 6 ++--- .../ql/async/StoredAsyncResponseTests.java | 2 +- .../xpack/ql/type/TypesTests.java | 2 +- .../org/elasticsearch/xpack/ql/TestUtils.java | 2 +- .../action/RepositoriesMeteringResponse.java | 4 +-- .../RepositoriesNodeMeteringResponse.java | 6 ++--- .../encrypted/EncryptedRepository.java | 2 +- .../encrypted/EncryptedRepositoryPlugin.java | 2 +- .../encrypted/EncryptedRepositoryTests.java | 2 +- .../LocalStateEncryptedRepositoryPlugin.java | 2 +- .../elasticsearch/xpack/rollup/Rollup.java | 2 +- .../xpack/rollup/action/RollupIndexCaps.java | 18 ++++++------- .../action/TransportPutRollupJobAction.java | 4 +-- .../rest/RestDeleteRollupJobAction.java | 2 +- .../rollup/rest/RestGetRollupCapsAction.java | 2 +- .../rest/RestGetRollupIndexCapsAction.java | 2 +- .../rollup/rest/RestGetRollupJobsAction.java | 2 +- .../rollup/v2/TransportRollupAction.java | 6 ++--- .../action/PutJobActionRequestTests.java | 2 +- .../rollup/job/RollupIndexerStateTests.java | 2 +- .../v2/RollupActionSingleNodeTests.java | 4 +-- .../PinnedQueryBuilderIT.java | 2 +- .../PinnedQueryBuilder.java | 16 ++++++------ .../PinnedQueryBuilderTests.java | 8 +++--- ...pshotsCanMatchOnCoordinatorIntegTests.java | 2 +- .../SearchableSnapshotsIntegTests.java | 2 +- ...ableSnapshotsBlobStoreCacheIntegTests.java | 4 +-- ...tsBlobStoreCacheMaintenanceIntegTests.java | 4 +-- ...archableSnapshotsPrewarmingIntegTests.java | 2 +- ...SnapshotRecoveryStateIntegrationTests.java | 2 +- .../SearchableSnapshots.java | 6 ++--- .../SearchableSnapshotsStatsResponse.java | 2 +- ...rchableSnapshotsNodeCachesStatsAction.java | 6 ++--- .../cache/blob/BlobStoreCacheService.java | 6 ++--- .../cache/blob/CachedBlob.java | 4 +-- ...stractSearchableSnapshotsRestTestCase.java | 6 ++--- .../MountSearchableSnapshotRequestTests.java | 4 +-- .../SearchableSnapshotDirectoryTests.java | 2 +- .../security/cli/CertificateGenerateTool.java | 13 +++++----- .../xpack/security/cli/CertificateTool.java | 12 ++++----- .../operator/OperatorPrivilegesIT.java | 4 +-- .../xpack/security/QueryApiKeyIT.java | 2 +- .../xpack/security/apikey/ApiKeyRestIT.java | 2 +- .../authc/service/ServiceAccountIT.java | 6 ++--- .../integration/BulkUpdateTests.java | 2 +- .../ClusterPrivilegeIntegrationTests.java | 2 +- .../integration/DlsFlsRequestCacheTests.java | 2 +- .../DocumentLevelSecurityTests.java | 6 ++--- .../integration/FieldLevelSecurityTests.java | 6 ++--- .../MultipleIndicesPermissionsTests.java | 2 +- .../integration/SecurityClearScrollTests.java | 2 +- .../elasticsearch/license/LicensingTests.java | 2 +- .../authc/apikey/ApiKeySingleNodeTests.java | 2 +- .../xpack/security/Security.java | 6 ++--- .../action/TransportCreateApiKeyAction.java | 2 +- .../action/TransportGrantApiKeyAction.java | 2 +- .../action/role/TransportPutRoleAction.java | 2 +- .../user/TransportHasPrivilegesAction.java | 2 +- .../audit/logfile/LoggingAuditTrail.java | 6 ++--- .../xpack/security/authc/ApiKeyService.java | 22 ++++++++-------- .../xpack/security/authc/TokenService.java | 6 ++--- .../xpack/security/authc/UserToken.java | 4 +-- .../authc/esnative/NativeUsersStore.java | 2 +- .../tool/ResetBuiltinPasswordTool.java | 4 +-- .../esnative/tool/SetupPasswordTool.java | 4 +-- .../IndexServiceAccountTokenStore.java | 4 +-- .../authc/support/ApiKeyGenerator.java | 2 +- .../mapper/NativeRoleMappingStore.java | 12 ++++----- .../security/authz/store/FileRolesStore.java | 6 ++--- .../authz/store/NativePrivilegeStore.java | 12 ++++----- .../authz/store/NativeRolesStore.java | 8 +++--- .../ExternalEnrollmentTokenGenerator.java | 4 +-- .../operator/FileOperatorUsersStore.java | 16 ++++++------ .../security/rest/SecurityRestFilter.java | 4 +-- .../rest/action/RestAuthenticateAction.java | 4 +-- .../RestDelegatePkiAuthenticationAction.java | 4 +-- .../action/apikey/RestGetApiKeyAction.java | 2 +- .../action/apikey/RestGrantApiKeyAction.java | 6 ++--- .../apikey/RestInvalidateApiKeyAction.java | 8 +++--- .../action/apikey/RestQueryApiKeyAction.java | 10 +++---- .../enrollment/RestKibanaEnrollAction.java | 2 +- .../enrollment/RestNodeEnrollmentAction.java | 2 +- .../action/oauth2/RestGetTokenAction.java | 10 +++---- .../oauth2/RestInvalidateTokenAction.java | 8 +++--- .../RestOpenIdConnectAuthenticateAction.java | 8 +++--- .../oidc/RestOpenIdConnectLogoutAction.java | 8 +++--- ...nIdConnectPrepareAuthenticationAction.java | 8 +++--- .../privilege/RestDeletePrivilegesAction.java | 2 +- .../RestGetBuiltinPrivilegesAction.java | 2 +- .../privilege/RestGetPrivilegesAction.java | 2 +- .../privilege/RestPutPrivilegesAction.java | 2 +- .../action/role/RestDeleteRoleAction.java | 2 +- .../rest/action/role/RestGetRolesAction.java | 2 +- .../rest/action/role/RestPutRoleAction.java | 2 +- .../RestDeleteRoleMappingAction.java | 2 +- .../RestGetRoleMappingsAction.java | 2 +- .../rolemapping/RestPutRoleMappingAction.java | 2 +- .../saml/RestSamlAuthenticateAction.java | 8 +++--- .../saml/RestSamlCompleteLogoutAction.java | 8 +++--- .../saml/RestSamlInvalidateSessionAction.java | 8 +++--- .../action/saml/RestSamlLogoutAction.java | 8 +++--- .../RestSamlPrepareAuthenticationAction.java | 8 +++--- .../action/saml/RestSamlSpMetadataAction.java | 2 +- .../action/user/RestChangePasswordAction.java | 2 +- .../action/user/RestDeleteUserAction.java | 2 +- .../user/RestGetUserPrivilegesAction.java | 4 +-- .../rest/action/user/RestGetUsersAction.java | 2 +- .../action/user/RestHasPrivilegesAction.java | 6 ++--- .../rest/action/user/RestPutUserAction.java | 2 +- .../action/user/RestSetEnabledAction.java | 2 +- .../support/SecurityIndexManager.java | 2 +- .../filter/SecurityIpFilterRule.java | 4 +-- .../SecurityNetty4HttpServerTransport.java | 2 +- .../nio/SecurityNioHttpServerTransport.java | 2 +- .../test/SecurityIntegTestCase.java | 4 +-- .../PutPrivilegesRequestBuilderTests.java | 2 +- .../SecurityInfoTransportActionTests.java | 6 ++--- .../action/role/PutRoleBuilderTests.java | 2 +- .../role/TransportPutRoleActionTests.java | 4 +-- ...sportSamlInvalidateSessionActionTests.java | 6 ++--- .../ChangePasswordRequestBuilderTests.java | 4 +-- .../HasPrivilegesRequestBuilderTests.java | 2 +- .../user/PutUserRequestBuilderTests.java | 4 +-- .../logfile/LoggingAuditTrailFilterTests.java | 4 +-- .../audit/logfile/LoggingAuditTrailTests.java | 6 ++--- .../security/authc/ApiKeyServiceTests.java | 10 +++---- .../authc/AuthenticationServiceTests.java | 4 +-- .../security/authc/TokenServiceMock.java | 2 +- .../security/authc/TokenServiceTests.java | 6 ++--- .../authc/esnative/NativeUsersStoreTests.java | 2 +- .../esnative/tool/SetupPasswordToolTests.java | 8 +++--- .../IndexServiceAccountTokenStoreTests.java | 2 +- .../authc/support/ApiKeyGeneratorTests.java | 2 +- .../TokensInvalidationResultTests.java | 6 ++--- .../mapper/ExpressionRoleMappingTests.java | 12 ++++----- .../authz/AuthorizationServiceTests.java | 2 +- .../xpack/security/authz/RBACEngineTests.java | 2 +- .../security/authz/RoleDescriptorTests.java | 8 +++--- .../permission/FieldPermissionsTests.java | 2 +- .../authz/store/CompositeRolesStoreTests.java | 4 +-- .../authz/store/FileRolesStoreTests.java | 4 +-- .../store/NativePrivilegeStoreTests.java | 4 +-- .../authz/store/NativeRolesStoreTests.java | 6 ++--- ...ExternalEnrollmentTokenGeneratorTests.java | 10 +++---- .../ingest/SetSecurityUserProcessorTests.java | 2 +- .../operator/FileOperatorUsersStoreTests.java | 2 +- .../security/rest/RestRequestFilterTests.java | 6 ++--- .../rest/SecurityRestFilterTests.java | 8 +++--- ...SecurityRestFilterWarningHeadersTests.java | 4 +-- .../apikey/RestCreateApiKeyActionTests.java | 4 +-- .../apikey/RestGetApiKeyActionTests.java | 4 +-- .../RestInvalidateApiKeyActionTests.java | 4 +-- .../apikey/RestQueryApiKeyActionTests.java | 4 +-- .../oauth2/RestGetTokenActionTests.java | 8 +++--- .../RestInvalidateTokenActionTests.java | 8 +++--- ...viceAccountTokenStoreCacheActionTests.java | 2 +- .../RestGetUserPrivilegesActionTests.java | 4 +-- .../user/RestHasPrivilegesActionTests.java | 6 ++--- .../support/SecurityIndexManagerTests.java | 4 +-- .../xpack/shutdown/NodeShutdownIT.java | 6 ++--- .../xpack/shutdown/NodeShutdownTasksIT.java | 4 +-- .../shutdown/GetShutdownStatusAction.java | 4 +-- .../xpack/shutdown/PutShutdownNodeAction.java | 6 ++--- .../shutdown/RestPutShutdownNodeAction.java | 2 +- .../xpack/shutdown/ShutdownPlugin.java | 2 +- .../shutdown/SingleNodeShutdownStatus.java | 6 ++--- .../testkit/RepositoryAnalysisFailureIT.java | 2 +- .../testkit/RepositoryAnalysisSuccessIT.java | 2 +- .../blobstore/testkit/BlobAnalyzeAction.java | 6 ++--- .../testkit/RepositoryAnalyzeAction.java | 2 +- .../testkit/RepositoryPerformanceSummary.java | 4 +-- .../testkit/RestRepositoryAnalyzeAction.java | 2 +- .../testkit/SnapshotRepositoryTestKit.java | 2 +- ...undingBoxQueryGeoShapeWithDocValuesIT.java | 4 +-- ...BoxQueryLegacyGeoShapeWithDocValuesIT.java | 4 +-- .../search/GeoShapeScriptDocValuesIT.java | 6 ++--- .../search/GeoShapeWithDocValuesIT.java | 4 +-- .../GeoShapeWithDocValuesQueryTests.java | 6 ++--- .../search/LegacyGeoShapeWithDocValuesIT.java | 6 ++--- .../search/ShapeQueryOverPointTests.java | 4 +-- .../search/ShapeQueryOverShapeTests.java | 8 +++--- .../spatial/search/ShapeQueryTestCase.java | 8 +++--- .../xpack/spatial/SpatialPlugin.java | 2 +- .../xpack/spatial/SpatialUsage.java | 2 +- .../xpack/spatial/common/CartesianPoint.java | 14 +++++----- .../index/fielddata/GeoShapeValues.java | 4 +-- .../index/mapper/PointFieldMapper.java | 2 +- .../index/query/ShapeQueryBuilder.java | 4 +-- .../xpack/spatial/ingest/CircleProcessor.java | 14 +++++----- .../GeoLineAggregationBuilder.java | 8 +++--- .../search/aggregations/InternalGeoLine.java | 2 +- .../SpatialStatsTransportActionTests.java | 10 +++---- .../mapper/CartesianFieldMapperTests.java | 2 +- ...GeoShapeWithDocValuesFieldMapperTests.java | 8 +++--- .../index/mapper/PointFieldMapperTests.java | 4 +-- .../index/mapper/ShapeFieldMapperTests.java | 2 +- .../GeoShapeWithDocValuesQueryTests.java | 6 ++--- ...LegacyGeoShapeWithDocValuesQueryTests.java | 6 ++--- .../index/query/ShapeQueryBuilderTests.java | 8 +++--- .../spatial/ingest/CircleProcessorTests.java | 8 +++--- .../GeoLineAggregationBuilderTests.java | 2 +- .../aggregations/InternalGeoLineTests.java | 4 +-- .../xpack/spatial/util/GeoTestUtils.java | 14 +++++----- .../xpack/sql/jdbc/XContentSqlExtension.java | 4 +-- ...csearch.xcontent.XContentBuilderExtension} | 0 .../JdbcConfigurationDataSourceTests.java | 2 +- .../sql/jdbc/JdbcHttpClientRequestTests.java | 2 +- .../xpack/sql/jdbc/TypeConverterTests.java | 4 +-- .../xpack/sql/jdbc/VersionParityTests.java | 2 +- .../xpack/sql/qa/jdbc/FetchSizeTestCase.java | 4 +-- .../sql/qa/jdbc/JdbcIntegrationTestCase.java | 4 +-- .../xpack/sql/qa/jdbc/ResultSetTestCase.java | 4 +-- .../xpack/sql/qa/mixed_node/SqlCompatIT.java | 6 ++--- .../xpack/sql/qa/mixed_node/SqlSearchIT.java | 2 +- .../sql/qa/multi_node/RestSqlMultinodeIT.java | 4 +-- .../qa/security/RestSqlSecurityAsyncIT.java | 6 ++--- .../sql/qa/security/RestSqlSecurityIT.java | 4 +-- .../sql/qa/security/SqlSecurityTestCase.java | 4 +-- .../xpack/sql/qa/security/UserFunctionIT.java | 4 +-- .../sql/qa/CustomDateFormatTestCase.java | 4 +-- .../xpack/sql/qa/FieldExtractorTestCase.java | 4 +-- .../xpack/sql/qa/SqlProtocolTestCase.java | 10 +++---- .../sql/qa/cli/CliIntegrationTestCase.java | 4 +-- .../xpack/sql/qa/geo/GeoDataLoader.java | 4 +-- .../xpack/sql/qa/jdbc/DataLoader.java | 4 +-- .../sql/qa/jdbc/JdbcIntegrationTestCase.java | 4 +-- .../xpack/sql/qa/jdbc/SysColumnsTestCase.java | 4 +-- .../sql/qa/rest/BaseRestSqlTestCase.java | 4 +-- .../xpack/sql/qa/rest/RestSqlTestCase.java | 4 +-- .../sql/qa/rest/RestSqlUsageTestCase.java | 2 +- .../sql/action/AbstractSqlQueryRequest.java | 16 ++++++------ .../xpack/sql/action/AbstractSqlRequest.java | 2 +- .../sql/action/SqlClearCursorRequest.java | 10 +++---- .../sql/action/SqlClearCursorResponse.java | 2 +- .../xpack/sql/action/SqlQueryRequest.java | 8 +++--- .../xpack/sql/action/SqlQueryResponse.java | 4 +-- .../xpack/sql/action/SqlTranslateRequest.java | 6 ++--- .../sql/action/SqlTranslateResponse.java | 4 +-- .../action/SqlClearCursorRequestTests.java | 2 +- .../action/SqlClearCursorResponseTests.java | 2 +- .../sql/action/SqlQueryRequestTests.java | 10 +++---- .../sql/action/SqlQueryResponseTests.java | 8 +++--- .../sql/action/SqlRequestParsersTests.java | 10 +++---- .../sql/action/SqlTranslateRequestTests.java | 4 +-- .../xpack/sql/client/HttpClient.java | 12 ++++----- .../sql/client/HttpClientRequestTests.java | 2 +- .../xpack/sql/proto/AbstractSqlRequest.java | 2 +- .../xpack/sql/proto/ColumnInfo.java | 14 +++++----- .../xpack/sql/proto/MainResponse.java | 6 ++--- .../xpack/sql/proto/ProtoUtils.java | 8 +++--- .../sql/proto/SqlClearCursorRequest.java | 2 +- .../sql/proto/SqlClearCursorResponse.java | 8 +++--- .../xpack/sql/proto/SqlQueryRequest.java | 4 +-- .../xpack/sql/proto/SqlQueryResponse.java | 12 ++++----- .../xpack/sql/proto/SqlTypedParamValue.java | 16 ++++++------ .../xpack/sql/proto/ProtoUtilsTests.java | 8 +++--- .../sql/action/AsyncSqlSearchActionIT.java | 2 +- .../sql/action/RestSqlCancellationIT.java | 2 +- .../xpack/sql/action/SqlCancellationIT.java | 2 +- .../xpack/sql/execution/search/Querier.java | 2 +- .../search/extractor/FieldHitExtractor.java | 2 +- .../sql/expression/literal/geo/GeoShape.java | 10 +++---- .../expression/literal/interval/Interval.java | 4 +-- .../sql/plugin/RestSqlClearCursorAction.java | 2 +- .../xpack/sql/plugin/RestSqlQueryAction.java | 6 ++--- .../sql/plugin/RestSqlTranslateAction.java | 2 +- .../xpack/sql/plugin/SqlMediaTypeParser.java | 8 +++--- .../xpack/sql/plugin/SqlPlugin.java | 2 +- .../xpack/sql/plugin/SqlResponseListener.java | 6 ++--- .../xpack/sql/plugin/SqlStatsResponse.java | 4 +-- .../xpack/sql/plugin/TextFormat.java | 2 +- .../querydsl/container/QueryContainer.java | 6 ++--- .../sql/SqlInfoTransportActionTests.java | 2 +- .../search/extractor/TestBucket.java | 2 +- .../extractor/TestMultiValueAggregation.java | 2 +- .../extractor/TestSingleValueAggregation.java | 2 +- .../sql/plugin/SqlMediaTypeParserTests.java | 4 +-- .../xpack/sql/plugin/TextFormatTests.java | 2 +- .../xpack/stack/StackPlugin.java | 2 +- .../xpack/stack/StackTemplateRegistry.java | 2 +- .../stack/StackTemplateRegistryTests.java | 8 +++--- .../NdJsonTextStructureFinder.java | 8 +++--- .../NdJsonTextStructureFinderFactory.java | 8 +++--- .../transform/integration/TransformIT.java | 6 ++--- .../integration/TransformIntegTestCase.java | 14 +++++----- .../continuous/ContinuousTestCase.java | 2 +- .../continuous/TransformContinuousIT.java | 8 +++--- .../TransformConfigurationIndexIT.java | 4 +-- .../TransformGetAndGetStatsIT.java | 2 +- .../integration/TransformPivotRestIT.java | 4 +-- .../TransformPivotRestSpecialCasesIT.java | 4 +-- .../integration/TransformProgressIT.java | 6 ++--- .../integration/TransformRestTestCase.java | 4 +-- .../TransformTaskFailedStateIT.java | 4 +-- .../integration/TransformInternalIndexIT.java | 6 ++--- .../TransformConfigManagerTests.java | 6 ++--- .../xpack/transform/Transform.java | 4 +-- .../TransformUsageTransportAction.java | 2 +- .../action/TransportGetTransformAction.java | 6 ++--- .../TransportPreviewTransformAction.java | 10 +++---- ...TransportGetTransformActionDeprecated.java | 2 +- .../notifications/TransformAuditor.java | 4 +-- .../IndexBasedTransformConfigManager.java | 12 ++++----- .../persistence/TransformInternalIndex.java | 6 ++--- .../rest/action/RestPutTransformAction.java | 2 +- .../action/RestUpdateTransformAction.java | 2 +- .../RestPreviewTransformActionDeprecated.java | 2 +- .../RestPutTransformActionDeprecated.java | 2 +- .../RestUpdateTransformActionDeprecated.java | 2 +- .../transform/transforms/pivot/Pivot.java | 8 +++--- .../transform/TransformMetadataTests.java | 2 +- .../persistence/TransformIndexTests.java | 4 +-- .../RestDeleteTransformActionTests.java | 8 +++--- .../transforms/TransformNodesTests.java | 2 +- .../pivot/AggregationResultUtilsTests.java | 16 ++++++------ .../transforms/pivot/PivotTests.java | 10 +++---- .../vectortile/rest/VectorTileRequest.java | 6 ++--- .../vectortile/rest/VectorTileUtils.java | 4 +-- .../rest/VectorTileRequestTests.java | 8 +++--- .../mapper/SparseVectorFieldMapperTests.java | 4 +-- .../mapper/DenseVectorFieldMapper.java | 2 +- .../mapper/DenseVectorFieldMapperTests.java | 2 +- .../votingonly/VotingOnlyNodePluginTests.java | 2 +- .../votingonly/VotingOnlyNodePlugin.java | 2 +- .../SmokeTestWatcherTestSuiteIT.java | 6 ++--- .../MonitoringWithWatcherRestIT.java | 2 +- .../SmokeTestWatcherWithSecurityIT.java | 4 +-- .../actions/TimeThrottleIntegrationTests.java | 2 +- .../actions/email/EmailAttachmentTests.java | 6 ++--- .../throttler/ActionThrottleTests.java | 6 ++--- .../ArrayCompareConditionSearchTests.java | 6 ++--- .../CompareConditionSearchTests.java | 2 +- .../HistoryTemplateHttpMappingsTests.java | 2 +- ...HistoryTemplateTransformMappingsTests.java | 2 +- .../input/chain/ChainIntegrationTests.java | 4 +-- .../test/integration/BasicWatcherTests.java | 6 ++--- .../test/integration/BootStrapTests.java | 4 +-- .../ExecutionVarsIntegrationTests.java | 2 +- .../integration/HistoryIntegrationTests.java | 6 ++--- .../HttpSecretsIntegrationTests.java | 2 +- .../test/integration/WatchAckTests.java | 2 +- .../test/integration/WatchMetadataTests.java | 2 +- .../transform/TransformIntegrationTests.java | 2 +- .../action/activate/ActivateWatchTests.java | 6 ++--- .../action/delete/DeleteWatchTests.java | 2 +- .../watch/WatchStatusIntegrationTests.java | 2 +- .../elasticsearch/xpack/watcher/Watcher.java | 6 ++--- .../watcher/WatcherIndexingListener.java | 2 +- .../xpack/watcher/WatcherService.java | 2 +- .../watcher/actions/email/EmailAction.java | 6 ++--- .../actions/email/EmailActionFactory.java | 2 +- .../actions/index/ExecutableIndexAction.java | 6 ++--- .../watcher/actions/index/IndexAction.java | 6 ++--- .../actions/index/IndexActionFactory.java | 2 +- .../watcher/actions/jira/JiraAction.java | 6 ++--- .../actions/jira/JiraActionFactory.java | 2 +- .../actions/logging/LoggingAction.java | 6 ++--- .../actions/logging/LoggingActionFactory.java | 2 +- .../actions/pagerduty/PagerDutyAction.java | 6 ++--- .../pagerduty/PagerDutyActionFactory.java | 2 +- .../watcher/actions/slack/SlackAction.java | 6 ++--- .../actions/slack/SlackActionFactory.java | 2 +- .../actions/webhook/WebhookAction.java | 6 ++--- .../actions/webhook/WebhookActionFactory.java | 2 +- .../xpack/watcher/common/http/BasicAuth.java | 8 +++--- .../xpack/watcher/common/http/HttpClient.java | 4 +-- .../watcher/common/http/HttpContentType.java | 2 +- .../xpack/watcher/common/http/HttpProxy.java | 8 +++--- .../watcher/common/http/HttpRequest.java | 12 ++++----- .../common/http/HttpRequestTemplate.java | 8 +++--- .../watcher/common/http/HttpResponse.java | 10 +++---- .../watcher/common/text/TextTemplate.java | 8 +++--- .../common/text/TextTemplateEngine.java | 2 +- .../condition/AbstractCompareCondition.java | 4 +-- .../condition/ArrayCompareCondition.java | 8 +++--- .../watcher/condition/CompareCondition.java | 8 +++--- .../condition/InternalAlwaysCondition.java | 2 +- .../watcher/condition/NeverCondition.java | 4 +-- .../watcher/condition/ScriptCondition.java | 4 +-- .../watcher/execution/ExecutionService.java | 10 +++---- .../watcher/execution/TriggeredWatch.java | 10 +++---- .../execution/TriggeredWatchStore.java | 6 ++--- .../xpack/watcher/history/HistoryStore.java | 4 +-- .../xpack/watcher/input/InputFactory.java | 2 +- .../xpack/watcher/input/InputRegistry.java | 2 +- .../xpack/watcher/input/chain/ChainInput.java | 6 ++--- .../input/chain/ChainInputFactory.java | 2 +- .../input/http/ExecutableHttpInput.java | 6 ++--- .../xpack/watcher/input/http/HttpInput.java | 6 ++--- .../watcher/input/http/HttpInputFactory.java | 2 +- .../watcher/input/none/NoneInputFactory.java | 2 +- .../input/search/ExecutableSearchInput.java | 6 ++--- .../watcher/input/search/SearchInput.java | 6 ++--- .../input/search/SearchInputFactory.java | 4 +-- .../watcher/input/simple/SimpleInput.java | 4 +-- .../input/simple/SimpleInputFactory.java | 2 +- .../input/transform/TransformInput.java | 2 +- .../transform/TransformInputFactory.java | 2 +- .../notification/email/Attachment.java | 6 ++--- .../notification/email/DataAttachment.java | 10 +++---- .../watcher/notification/email/Email.java | 10 +++---- .../notification/email/EmailTemplate.java | 6 ++--- .../email/attachment/DataAttachment.java | 2 +- .../attachment/DataAttachmentParser.java | 4 +-- .../attachment/EmailAttachmentParser.java | 4 +-- .../email/attachment/EmailAttachments.java | 6 ++--- .../attachment/EmailAttachmentsParser.java | 2 +- .../HttpEmailAttachementParser.java | 4 +-- .../attachment/HttpRequestAttachment.java | 2 +- .../email/attachment/ReportingAttachment.java | 4 +-- .../attachment/ReportingAttachmentParser.java | 10 +++---- .../email/support/BodyPartSource.java | 2 +- .../notification/jira/JiraAccount.java | 10 +++---- .../watcher/notification/jira/JiraIssue.java | 12 ++++----- .../notification/pagerduty/IncidentEvent.java | 10 +++---- .../pagerduty/IncidentEventContext.java | 8 +++--- .../notification/pagerduty/SentEvent.java | 12 ++++----- .../notification/slack/SentMessages.java | 6 ++--- .../notification/slack/SlackAccount.java | 4 +-- .../notification/slack/message/Action.java | 10 +++---- .../slack/message/Attachment.java | 8 +++--- .../slack/message/DynamicAttachments.java | 8 +++--- .../notification/slack/message/Field.java | 8 +++--- .../slack/message/MessageElement.java | 4 +-- .../slack/message/SlackMessage.java | 8 +++--- .../rest/action/RestAckWatchAction.java | 2 +- .../rest/action/RestActivateWatchAction.java | 2 +- .../rest/action/RestDeleteWatchAction.java | 2 +- .../rest/action/RestExecuteWatchAction.java | 6 ++--- .../rest/action/RestGetWatchAction.java | 2 +- .../rest/action/RestPutWatchAction.java | 2 +- .../support/WatcherIndexTemplateRegistry.java | 2 +- .../support/XContentFilterKeysUtils.java | 8 +++--- .../search/WatcherSearchTemplateRequest.java | 10 +++---- .../search/WatcherSearchTemplateService.java | 6 ++--- .../transform/script/ScriptTransform.java | 4 +-- .../script/ScriptTransformFactory.java | 2 +- .../transform/search/SearchTransform.java | 6 ++--- .../search/SearchTransformFactory.java | 4 +-- .../actions/TransportAckWatchAction.java | 8 +++--- .../actions/TransportActivateWatchAction.java | 6 ++--- .../actions/TransportExecuteWatchAction.java | 6 ++--- .../actions/TransportGetWatchAction.java | 6 ++--- .../actions/TransportPutWatchAction.java | 6 ++--- .../actions/TransportQueryWatchesAction.java | 6 ++--- .../xpack/watcher/trigger/TriggerEngine.java | 2 +- .../xpack/watcher/trigger/TriggerService.java | 2 +- .../watcher/trigger/manual/ManualTrigger.java | 4 +-- .../trigger/manual/ManualTriggerEngine.java | 2 +- .../trigger/manual/ManualTriggerEvent.java | 4 +-- .../trigger/schedule/CronSchedule.java | 4 +-- .../trigger/schedule/DailySchedule.java | 6 ++--- .../trigger/schedule/HourlySchedule.java | 6 ++--- .../trigger/schedule/IntervalSchedule.java | 6 ++--- .../trigger/schedule/MonthlySchedule.java | 4 +-- .../watcher/trigger/schedule/Schedule.java | 4 +-- .../trigger/schedule/ScheduleRegistry.java | 2 +- .../trigger/schedule/ScheduleTrigger.java | 2 +- .../schedule/ScheduleTriggerEngine.java | 2 +- .../schedule/ScheduleTriggerEvent.java | 6 ++--- .../trigger/schedule/WeeklySchedule.java | 4 +-- .../trigger/schedule/YearlySchedule.java | 4 +-- .../trigger/schedule/support/DayTimes.java | 4 +-- .../trigger/schedule/support/MonthTimes.java | 4 +-- .../trigger/schedule/support/Times.java | 4 +-- .../trigger/schedule/support/WeekTimes.java | 4 +-- .../trigger/schedule/support/YearTimes.java | 4 +-- .../xpack/watcher/watch/WatchParser.java | 6 ++--- .../WatcherInfoTransportActionTests.java | 8 +++--- .../WatcherMetadataSerializationTests.java | 10 +++---- .../xpack/watcher/WatcherServiceTests.java | 2 +- .../watcher/actions/ActionWrapperTests.java | 8 +++--- .../actions/email/EmailActionTests.java | 12 ++++----- .../actions/index/IndexActionTests.java | 6 ++--- .../actions/jira/JiraActionFactoryTests.java | 6 ++--- .../watcher/actions/jira/JiraActionTests.java | 16 ++++++------ .../actions/logging/LoggingActionTests.java | 6 ++--- .../PagerDutyActionFactoryTests.java | 6 ++--- .../pagerduty/PagerDutyActionTests.java | 10 +++---- .../slack/SlackActionFactoryTests.java | 6 ++--- .../actions/slack/SlackActionTests.java | 10 +++---- .../actions/webhook/WebhookActionTests.java | 8 +++--- .../watcher/common/http/HttpClientTests.java | 2 +- .../watcher/common/http/HttpProxyTests.java | 16 ++++++------ .../common/http/HttpRequestTemplateTests.java | 10 +++---- .../watcher/common/http/HttpRequestTests.java | 12 ++++----- .../common/http/HttpResponseTests.java | 8 +++--- .../common/text/TextTemplateTests.java | 10 +++---- .../condition/AlwaysConditionTests.java | 6 ++--- .../condition/ArrayCompareConditionTests.java | 8 +++--- .../condition/CompareConditionTests.java | 8 +++--- .../condition/NeverConditionTests.java | 6 ++--- .../condition/ScriptConditionTests.java | 10 +++---- .../execution/ExecutionServiceTests.java | 12 ++++----- .../execution/TriggeredWatchStoreTests.java | 6 ++--- .../watcher/input/InputRegistryTests.java | 4 +-- .../watcher/input/chain/ChainInputTests.java | 12 ++++----- .../chain/ExecutableChainInputTests.java | 2 +- .../watcher/input/http/HttpInputTests.java | 18 ++++++------- .../input/simple/SimpleInputTests.java | 6 ++--- .../input/transform/TransformInputTests.java | 8 +++--- .../email/EmailTemplateTests.java | 8 +++--- .../notification/email/EmailTests.java | 8 +++--- .../attachment/DataAttachmentParserTests.java | 10 +++---- .../EmailAttachmentParsersTests.java | 10 +++---- .../HttpEmailAttachementParserTests.java | 8 +++--- .../ReportingAttachmentParserTests.java | 8 +++--- .../notification/jira/JiraIssueTests.java | 12 ++++----- .../pagerduty/IncidentEventTests.java | 8 +++--- .../pagerduty/PagerDutyAccountsTests.java | 2 +- .../pagerduty/SentEventTests.java | 12 ++++----- .../slack/message/SlackMessageTests.java | 12 ++++----- .../action/RestExecuteWatchActionTests.java | 4 +-- .../watcher/support/FilterXContentTests.java | 8 +++--- .../xpack/watcher/support/VariablesTests.java | 2 +- .../support/WatcherDateTimeUtilsTests.java | 6 ++--- .../WatcherIndexTemplateRegistryTests.java | 8 +++--- .../watcher/support/WatcherTemplateTests.java | 2 +- .../watcher/support/WatcherUtilsTests.java | 12 ++++----- .../WatcherSearchTemplateRequestTests.java | 4 +-- .../support/xcontent/XContentSourceTests.java | 12 ++++----- .../xpack/watcher/test/WatcherTestUtils.java | 8 +++--- .../WatcherExecutorServiceBenchmark.java | 2 +- .../bench/WatcherScheduleEngineBenchmark.java | 2 +- .../test/integration/SearchInputTests.java | 16 ++++++------ .../integration/SearchTransformTests.java | 6 ++--- .../transform/chain/ChainTransformTests.java | 8 +++--- .../script/ScriptTransformTests.java | 6 ++--- .../action/QueryWatchesRequestTests.java | 4 +-- .../action/QueryWatchesResponseTests.java | 14 +++++----- .../action/WatchRequestValidationTests.java | 2 +- .../execute/ExecuteWatchRequestTests.java | 2 +- .../put/PutWatchSerializationTests.java | 4 +-- .../TransportWatcherStatsActionTests.java | 8 +++--- .../trigger/ScheduleTriggerEngineMock.java | 2 +- .../trigger/schedule/CronScheduleTests.java | 8 +++--- .../trigger/schedule/DailyScheduleTests.java | 8 +++--- .../trigger/schedule/HourlyScheduleTests.java | 8 +++--- .../schedule/IntervalScheduleTests.java | 8 +++--- .../schedule/MonthlyScheduleTests.java | 8 +++--- .../schedule/ScheduleRegistryTests.java | 8 +++--- .../trigger/schedule/ScheduleTestCase.java | 4 +-- .../schedule/ScheduleTriggerEventTests.java | 6 ++--- .../trigger/schedule/WeeklyScheduleTests.java | 8 +++--- .../trigger/schedule/YearlyScheduleTests.java | 8 +++--- .../xpack/watcher/watch/WatchStatusTests.java | 8 +++--- .../xpack/watcher/watch/WatchTests.java | 12 ++++----- .../wildcard/mapper/WildcardFieldMapper.java | 2 +- .../mapper/WildcardFieldMapperTests.java | 2 +- .../xpack/restart/FullClusterRestartIT.java | 14 +++++----- .../kerberos/KerberosAuthenticationIT.java | 4 +-- .../GlobalCheckpointSyncActionIT.java | 4 +-- .../elasticsearch/multi_node/RollupIT.java | 8 +++--- .../authc/oidc/OpenIdConnectAuthIT.java | 6 ++--- ...gsWithPasswordProtectedKeystoreRestIT.java | 3 +-- .../AbstractMultiClusterUpgradeTestCase.java | 2 +- .../upgrades/CcrRollingUpgradeIT.java | 2 +- .../upgrades/MlJobSnapshotUpgradeIT.java | 4 +-- .../upgrades/RollupDateHistoUpgradeIT.java | 2 +- .../upgrades/TransformSurvivesUpgradeIT.java | 12 ++++----- .../test/CoreTestTranslater.java | 8 +++--- .../authc/saml/SamlAuthenticationIT.java | 6 ++--- .../xpack/test/rest/XPackRestTestHelper.java | 2 +- .../ldap/AbstractAdLdapRealmTestCase.java | 4 +-- 4956 files changed, 13760 insertions(+), 13710 deletions(-) rename libs/x-content/src/main/java/org/elasticsearch/{common => }/xcontent/AbstractObjectParser.java (98%) rename libs/x-content/src/main/java/org/elasticsearch/{common => }/xcontent/ConstructingObjectParser.java (99%) rename libs/x-content/src/main/java/org/elasticsearch/{common => }/xcontent/ContextParser.java (93%) rename libs/x-content/src/main/java/org/elasticsearch/{common => }/xcontent/DeprecationHandler.java (99%) rename libs/x-content/src/main/java/org/elasticsearch/{common => }/xcontent/ErrorOnUnknown.java (97%) rename libs/x-content/src/main/java/org/elasticsearch/{common => }/xcontent/FilterXContentParser.java (99%) rename libs/x-content/src/main/java/org/elasticsearch/{common => }/xcontent/InstantiatingObjectParser.java (99%) rename libs/x-content/src/main/java/org/elasticsearch/{common => }/xcontent/MediaType.java (97%) rename libs/x-content/src/main/java/org/elasticsearch/{common => }/xcontent/MediaTypeRegistry.java (98%) rename libs/x-content/src/main/java/org/elasticsearch/{common => }/xcontent/NamedObjectNotFoundException.java (95%) rename libs/x-content/src/main/java/org/elasticsearch/{common => }/xcontent/NamedXContentRegistry.java (99%) rename libs/x-content/src/main/java/org/elasticsearch/{common => }/xcontent/ObjectParser.java (98%) rename libs/x-content/src/main/java/org/elasticsearch/{common => }/xcontent/ObjectPath.java (97%) rename libs/x-content/src/main/java/org/elasticsearch/{common => }/xcontent/ParseField.java (99%) rename libs/x-content/src/main/java/org/elasticsearch/{common => }/xcontent/ParsedMediaType.java (99%) rename libs/x-content/src/main/java/org/elasticsearch/{common => }/xcontent/ParserConstructor.java (94%) rename libs/x-content/src/main/java/org/elasticsearch/{common => }/xcontent/ToXContent.java (98%) rename libs/x-content/src/main/java/org/elasticsearch/{common => }/xcontent/ToXContentFragment.java (95%) rename libs/x-content/src/main/java/org/elasticsearch/{common => }/xcontent/ToXContentObject.java (95%) rename libs/x-content/src/main/java/org/elasticsearch/{common => }/xcontent/XContent.java (97%) rename libs/x-content/src/main/java/org/elasticsearch/{common => }/xcontent/XContentBuilder.java (99%) rename libs/x-content/src/main/java/org/elasticsearch/{common => }/xcontent/XContentBuilderExtension.java (98%) rename libs/x-content/src/main/java/org/elasticsearch/{common => }/xcontent/XContentFactory.java (94%) rename libs/x-content/src/main/java/org/elasticsearch/{common => }/xcontent/XContentGenerator.java (99%) rename libs/x-content/src/main/java/org/elasticsearch/{common => }/xcontent/XContentLocation.java (96%) rename libs/x-content/src/main/java/org/elasticsearch/{common => }/xcontent/XContentParseException.java (97%) rename libs/x-content/src/main/java/org/elasticsearch/{common => }/xcontent/XContentParser.java (99%) rename libs/x-content/src/main/java/org/elasticsearch/{common => }/xcontent/XContentSubParser.java (99%) rename libs/x-content/src/main/java/org/elasticsearch/{common => }/xcontent/XContentType.java (96%) rename libs/x-content/src/main/java/org/elasticsearch/{common => }/xcontent/XContentUtils.java (97%) rename libs/x-content/src/main/java/org/elasticsearch/{common => }/xcontent/cbor/CborXContent.java (89%) rename libs/x-content/src/main/java/org/elasticsearch/{common => }/xcontent/cbor/CborXContentGenerator.java (85%) rename libs/x-content/src/main/java/org/elasticsearch/{common => }/xcontent/cbor/CborXContentParser.java (82%) rename libs/x-content/src/main/java/org/elasticsearch/{common => }/xcontent/json/JsonXContent.java (90%) rename libs/x-content/src/main/java/org/elasticsearch/{common => }/xcontent/json/JsonXContentGenerator.java (96%) rename libs/x-content/src/main/java/org/elasticsearch/{common => }/xcontent/json/JsonXContentParser.java (94%) rename libs/x-content/src/main/java/org/elasticsearch/{common => }/xcontent/smile/SmileXContent.java (91%) rename libs/x-content/src/main/java/org/elasticsearch/{common => }/xcontent/smile/SmileXContentGenerator.java (85%) rename libs/x-content/src/main/java/org/elasticsearch/{common => }/xcontent/smile/SmileXContentParser.java (82%) rename libs/x-content/src/main/java/org/elasticsearch/{common => }/xcontent/support/AbstractXContentParser.java (98%) rename libs/x-content/src/main/java/org/elasticsearch/{common => }/xcontent/support/MapXContentParser.java (97%) rename libs/x-content/src/main/java/org/elasticsearch/{common => }/xcontent/support/filtering/FilterPath.java (92%) rename libs/x-content/src/main/java/org/elasticsearch/{common => }/xcontent/support/filtering/FilterPathBasedFilter.java (98%) rename libs/x-content/src/main/java/org/elasticsearch/{common => }/xcontent/yaml/YamlXContent.java (90%) rename libs/x-content/src/main/java/org/elasticsearch/{common => }/xcontent/yaml/YamlXContentGenerator.java (85%) rename libs/x-content/src/main/java/org/elasticsearch/{common => }/xcontent/yaml/YamlXContentParser.java (80%) rename libs/x-content/src/test/java/org/elasticsearch/{common => }/xcontent/ConstructingObjectParserTests.java (99%) rename libs/x-content/src/test/java/org/elasticsearch/{common => }/xcontent/InstantiatingObjectParserTests.java (96%) rename libs/x-content/src/test/java/org/elasticsearch/{common => }/xcontent/MapXContentParserTests.java (96%) rename libs/x-content/src/test/java/org/elasticsearch/{common => }/xcontent/ObjectParserTests.java (99%) rename libs/x-content/src/test/java/org/elasticsearch/{common => }/xcontent/ObjectPathTests.java (96%) rename libs/x-content/src/test/java/org/elasticsearch/{common => xcontent}/ParseFieldTests.java (97%) rename libs/x-content/src/test/java/org/elasticsearch/{common => }/xcontent/ParsedMediaTypeTests.java (98%) rename libs/x-content/src/test/java/org/elasticsearch/{common => }/xcontent/SimpleStruct.java (94%) rename libs/x-content/src/test/java/org/elasticsearch/{common => }/xcontent/XContentParserTests.java (99%) rename server/src/main/resources/META-INF/services/{org.elasticsearch.common.xcontent.ErrorOnUnknown => org.elasticsearch.xcontent.ErrorOnUnknown} (100%) rename server/src/main/resources/META-INF/services/{org.elasticsearch.common.xcontent.XContentBuilderExtension => org.elasticsearch.xcontent.XContentBuilderExtension} (100%) rename x-pack/plugin/sql/jdbc/src/main/resources/META-INF/services/{org.elasticsearch.common.xcontent.XContentBuilderExtension => org.elasticsearch.xcontent.XContentBuilderExtension} (100%) diff --git a/benchmarks/src/main/java/org/elasticsearch/benchmark/search/fetch/subphase/FetchSourcePhaseBenchmark.java b/benchmarks/src/main/java/org/elasticsearch/benchmark/search/fetch/subphase/FetchSourcePhaseBenchmark.java index b313b0f57d3c2..776d2aa9fedfe 100644 --- a/benchmarks/src/main/java/org/elasticsearch/benchmark/search/fetch/subphase/FetchSourcePhaseBenchmark.java +++ b/benchmarks/src/main/java/org/elasticsearch/benchmark/search/fetch/subphase/FetchSourcePhaseBenchmark.java @@ -5,15 +5,15 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.Streams; import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.support.filtering.FilterPath; import org.elasticsearch.search.fetch.subphase.FetchSourceContext; import org.elasticsearch.search.fetch.subphase.FetchSourcePhase; import org.elasticsearch.search.lookup.SourceLookup; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.support.filtering.FilterPath; import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; import org.openjdk.jmh.annotations.Fork; diff --git a/client/client-benchmark-noop-api-plugin/src/main/java/org/elasticsearch/plugin/noop/action/bulk/RestNoopBulkAction.java b/client/client-benchmark-noop-api-plugin/src/main/java/org/elasticsearch/plugin/noop/action/bulk/RestNoopBulkAction.java index 2c258d23738f3..6ab689a267bdf 100644 --- a/client/client-benchmark-noop-api-plugin/src/main/java/org/elasticsearch/plugin/noop/action/bulk/RestNoopBulkAction.java +++ b/client/client-benchmark-noop-api-plugin/src/main/java/org/elasticsearch/plugin/noop/action/bulk/RestNoopBulkAction.java @@ -16,7 +16,7 @@ import org.elasticsearch.action.update.UpdateResponse; import org.elasticsearch.client.Requests; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BytesRestResponse; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/GeoIpStatsResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/GeoIpStatsResponse.java index 3721e002836c9..74d50b897d00b 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/GeoIpStatsResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/GeoIpStatsResponse.java @@ -8,12 +8,12 @@ package org.elasticsearch.client; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.Tuple; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collection; @@ -23,8 +23,8 @@ import java.util.function.Function; import java.util.stream.Collectors; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class GeoIpStatsResponse implements ToXContentObject { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/GetAliasesResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/GetAliasesResponse.java index f79196573ba5a..cc700bcba940d 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/GetAliasesResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/GetAliasesResponse.java @@ -11,10 +11,10 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.cluster.metadata.AliasMetadata; import org.elasticsearch.common.xcontent.StatusToXContentObject; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentParser.Token; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser.Token; import org.elasticsearch.rest.RestStatus; import java.io.IOException; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/LicenseClient.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/LicenseClient.java index b105bb992a8e4..4727990951576 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/LicenseClient.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/LicenseClient.java @@ -19,12 +19,12 @@ import org.elasticsearch.client.license.GetTrialStatusResponse; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.Streams; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.client.license.DeleteLicenseRequest; import org.elasticsearch.client.license.GetLicenseRequest; import org.elasticsearch.client.license.GetLicenseResponse; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/NodesResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/NodesResponse.java index f88422160010f..0ea0f111126aa 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/NodesResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/NodesResponse.java @@ -8,8 +8,8 @@ package org.elasticsearch.client; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; /** * Base class for responses that are node responses. These responses always contain the cluster diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/NodesResponseHeader.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/NodesResponseHeader.java index 2161e14e9d427..0cf0e9b6bc857 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/NodesResponseHeader.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/NodesResponseHeader.java @@ -10,11 +10,11 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.action.support.nodes.BaseNodesResponse; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.rest.action.RestActions; import java.io.IOException; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/RequestConverters.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/RequestConverters.java index e5a60c0a16f80..f9009cd6e184a 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/RequestConverters.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/RequestConverters.java @@ -55,14 +55,14 @@ import org.elasticsearch.common.lucene.uid.Versions; import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.CollectionUtils; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.VersionType; import org.elasticsearch.index.rankeval.RankEvalRequest; import org.elasticsearch.index.reindex.AbstractBulkByScrollRequest; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/RestHighLevelClient.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/RestHighLevelClient.java index d511aab047bfe..52e1412fa8b4b 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/RestHighLevelClient.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/RestHighLevelClient.java @@ -71,12 +71,6 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.util.concurrent.FutureUtils; import org.elasticsearch.common.util.concurrent.ListenableFuture; -import org.elasticsearch.common.xcontent.ContextParser; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.core.CheckedConsumer; import org.elasticsearch.core.CheckedFunction; import org.elasticsearch.index.rankeval.RankEvalRequest; @@ -200,6 +194,12 @@ import org.elasticsearch.search.suggest.phrase.PhraseSuggestionBuilder; import org.elasticsearch.search.suggest.term.TermSuggestion; import org.elasticsearch.search.suggest.term.TermSuggestionBuilder; +import org.elasticsearch.xcontent.ContextParser; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import java.io.Closeable; import java.io.IOException; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/RestHighLevelClientBuilder.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/RestHighLevelClientBuilder.java index df2724f1f1982..6357cc2851c32 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/RestHighLevelClientBuilder.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/RestHighLevelClientBuilder.java @@ -8,8 +8,8 @@ package org.elasticsearch.client; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; import org.elasticsearch.core.CheckedConsumer; +import org.elasticsearch.xcontent.NamedXContentRegistry; import java.io.IOException; import java.util.Collections; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/TextStructureRequestConverters.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/TextStructureRequestConverters.java index 79ab2cfe39a14..721955dfb5017 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/TextStructureRequestConverters.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/TextStructureRequestConverters.java @@ -18,7 +18,7 @@ import org.elasticsearch.client.textstructure.FindStructureRequest; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; final class TextStructureRequestConverters { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/WatcherRequestConverters.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/WatcherRequestConverters.java index c9869eb98f283..1d4bfcac23a0b 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/WatcherRequestConverters.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/WatcherRequestConverters.java @@ -25,7 +25,7 @@ import org.elasticsearch.client.watcher.StopWatchServiceRequest; import org.elasticsearch.client.watcher.WatcherStatsRequest; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/analytics/InferencePipelineAggregationBuilder.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/analytics/InferencePipelineAggregationBuilder.java index ebbb2a8fa7520..efec2ffa8cd0a 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/analytics/InferencePipelineAggregationBuilder.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/analytics/InferencePipelineAggregationBuilder.java @@ -9,11 +9,11 @@ package org.elasticsearch.client.analytics; import org.elasticsearch.client.ml.inference.trainedmodel.InferenceConfig; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.aggregations.PipelineAggregationBuilder; import org.elasticsearch.search.aggregations.pipeline.AbstractPipelineAggregationBuilder; import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator; @@ -24,7 +24,7 @@ import java.util.Objects; import java.util.TreeMap; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; /** * For building inference pipeline aggregations diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/analytics/ParsedInference.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/analytics/ParsedInference.java index 0ac53e09107bd..136b5db14dcad 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/analytics/ParsedInference.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/analytics/ParsedInference.java @@ -10,18 +10,18 @@ import org.elasticsearch.client.ml.inference.results.FeatureImportance; import org.elasticsearch.client.ml.inference.results.TopClassEntry; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.aggregations.ParsedAggregation; import java.io.IOException; import java.util.List; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * This class parses the superset of all possible fields that may be written by diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/analytics/ParsedStringStats.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/analytics/ParsedStringStats.java index 557e3aaa3f050..56600fc3ace18 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/analytics/ParsedStringStats.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/analytics/ParsedStringStats.java @@ -8,10 +8,10 @@ package org.elasticsearch.client.analytics; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.aggregations.ParsedAggregation; import java.io.IOException; @@ -19,8 +19,8 @@ import java.util.Map; import static java.util.Collections.unmodifiableMap; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * Results from the {@code string_stats} aggregation. diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/analytics/ParsedTopMetrics.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/analytics/ParsedTopMetrics.java index b9c2158204e88..232a8c1eab5d9 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/analytics/ParsedTopMetrics.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/analytics/ParsedTopMetrics.java @@ -8,11 +8,11 @@ package org.elasticsearch.client.analytics; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParserUtils; import org.elasticsearch.search.aggregations.ParsedAggregation; @@ -20,7 +20,7 @@ import java.util.List; import java.util.Map; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; /** * Results of the {@code top_metrics} aggregation. diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/analytics/StringStatsAggregationBuilder.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/analytics/StringStatsAggregationBuilder.java index 8a8915cce0530..f36bf2f5a3f7c 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/analytics/StringStatsAggregationBuilder.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/analytics/StringStatsAggregationBuilder.java @@ -8,10 +8,10 @@ package org.elasticsearch.client.analytics; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.query.QueryRewriteContext; import org.elasticsearch.search.aggregations.AbstractAggregationBuilder; import org.elasticsearch.search.aggregations.AggregationBuilder; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/analytics/TopMetricsAggregationBuilder.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/analytics/TopMetricsAggregationBuilder.java index 8cabb91942a0b..fd987adc4def2 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/analytics/TopMetricsAggregationBuilder.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/analytics/TopMetricsAggregationBuilder.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.query.QueryRewriteContext; import org.elasticsearch.search.aggregations.AbstractAggregationBuilder; import org.elasticsearch.search.aggregations.AggregationBuilder; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/asyncsearch/AsyncSearchResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/asyncsearch/AsyncSearchResponse.java index 2bd1fcb50ba25..3674a2112f750 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/asyncsearch/AsyncSearchResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/asyncsearch/AsyncSearchResponse.java @@ -10,18 +10,18 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentParser.Token; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser.Token; import java.io.IOException; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; import static org.elasticsearch.common.xcontent.XContentParserUtils.ensureExpectedToken; /** diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ccr/AutoFollowStats.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ccr/AutoFollowStats.java index f406dfe14045e..fcf6feadca0ba 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ccr/AutoFollowStats.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ccr/AutoFollowStats.java @@ -10,8 +10,8 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.common.util.Maps; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.Tuple; import java.util.AbstractMap; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ccr/CcrStatsResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ccr/CcrStatsResponse.java index f373cde1f8f44..cf9121b808584 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ccr/CcrStatsResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ccr/CcrStatsResponse.java @@ -8,9 +8,9 @@ package org.elasticsearch.client.ccr; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; public final class CcrStatsResponse { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ccr/FollowConfig.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ccr/FollowConfig.java index 234d5d3b70c88..d9a542f6f6da6 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ccr/FollowConfig.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ccr/FollowConfig.java @@ -8,14 +8,14 @@ package org.elasticsearch.client.ccr; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ccr/FollowInfoResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ccr/FollowInfoResponse.java index 025870737275e..fc4c542c1504a 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ccr/FollowInfoResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ccr/FollowInfoResponse.java @@ -8,9 +8,9 @@ package org.elasticsearch.client.ccr; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.util.List; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ccr/FollowStatsResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ccr/FollowStatsResponse.java index b42b48df38962..6123d8969cbf0 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ccr/FollowStatsResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ccr/FollowStatsResponse.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.ccr; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; public final class FollowStatsResponse { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ccr/ForgetFollowerRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ccr/ForgetFollowerRequest.java index 5b2ace214e018..cc85d8ee0c3cc 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ccr/ForgetFollowerRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ccr/ForgetFollowerRequest.java @@ -9,8 +9,8 @@ package org.elasticsearch.client.ccr; import org.elasticsearch.client.Validatable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ccr/GetAutoFollowPatternResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ccr/GetAutoFollowPatternResponse.java index 365f3648aeddf..5078e45f1db5d 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ccr/GetAutoFollowPatternResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ccr/GetAutoFollowPatternResponse.java @@ -11,10 +11,10 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.common.util.Maps; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.TimeValue; import java.util.AbstractMap; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ccr/IndicesFollowStats.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ccr/IndicesFollowStats.java index c1018820afb79..b68c5824563f0 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ccr/IndicesFollowStats.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ccr/IndicesFollowStats.java @@ -10,8 +10,8 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.common.util.Maps; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.Tuple; import java.util.AbstractMap; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ccr/PutAutoFollowPatternRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ccr/PutAutoFollowPatternRequest.java index 4c95a804904bb..c581896f42a7c 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ccr/PutAutoFollowPatternRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ccr/PutAutoFollowPatternRequest.java @@ -9,9 +9,9 @@ package org.elasticsearch.client.ccr; import org.elasticsearch.client.Validatable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Collections; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ccr/PutFollowRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ccr/PutFollowRequest.java index 43d17a9cca742..e144b7b28d6de 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ccr/PutFollowRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ccr/PutFollowRequest.java @@ -10,9 +10,9 @@ import org.elasticsearch.action.support.ActiveShardCount; import org.elasticsearch.client.Validatable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ccr/PutFollowResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ccr/PutFollowResponse.java index f27ed91d91889..26ec16ebbc2d9 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ccr/PutFollowResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ccr/PutFollowResponse.java @@ -8,9 +8,9 @@ package org.elasticsearch.client.ccr; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ccr/ResumeFollowRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ccr/ResumeFollowRequest.java index e10cd807bf97e..1af40af5d59ca 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ccr/ResumeFollowRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ccr/ResumeFollowRequest.java @@ -9,8 +9,8 @@ package org.elasticsearch.client.ccr; import org.elasticsearch.client.Validatable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/cluster/RemoteConnectionInfo.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/cluster/RemoteConnectionInfo.java index b0cd69b4917dc..078a0b5a7e305 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/cluster/RemoteConnectionInfo.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/cluster/RemoteConnectionInfo.java @@ -8,16 +8,16 @@ package org.elasticsearch.client.cluster; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.List; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * This class encapsulates all remote cluster information to be rendered on diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/cluster/RemoteInfoResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/cluster/RemoteInfoResponse.java index 74024562ddcc2..9aff43bf38719 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/cluster/RemoteInfoResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/cluster/RemoteInfoResponse.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.cluster; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/common/TimeUtil.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/common/TimeUtil.java index ccc9c93f3a6df..2dca391ceb00b 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/common/TimeUtil.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/common/TimeUtil.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.common; import org.elasticsearch.common.time.DateFormatters; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.time.Instant; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/common/XContentSource.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/common/XContentSource.java index 22ae8db21a107..e01e61fda5884 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/common/XContentSource.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/common/XContentSource.java @@ -8,9 +8,9 @@ package org.elasticsearch.client.common; -import org.elasticsearch.common.xcontent.ObjectPath; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentUtils; +import org.elasticsearch.xcontent.ObjectPath; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentUtils; import java.io.IOException; import java.util.List; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/core/AcknowledgedResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/core/AcknowledgedResponse.java index 64cd296da7505..cd8fb63c54613 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/core/AcknowledgedResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/core/AcknowledgedResponse.java @@ -8,15 +8,15 @@ package org.elasticsearch.client.core; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; import java.util.function.Function; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; public class AcknowledgedResponse { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/core/BroadcastResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/core/BroadcastResponse.java index 7d73f564f4c5c..702fc1c8c1c8a 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/core/BroadcastResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/core/BroadcastResponse.java @@ -9,9 +9,9 @@ package org.elasticsearch.client.core; import org.elasticsearch.action.support.DefaultShardOperationFailedException; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collection; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/core/CountRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/core/CountRequest.java index a1fd6f6aee2c5..f9a94d5c6d34f 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/core/CountRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/core/CountRequest.java @@ -11,8 +11,8 @@ import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.client.Validatable; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.search.builder.SearchSourceBuilder; import org.elasticsearch.search.internal.SearchContext; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/core/CountResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/core/CountResponse.java index 7ef14fc6dc1be..233e677ff9ce2 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/core/CountResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/core/CountResponse.java @@ -9,8 +9,8 @@ package org.elasticsearch.client.core; import org.elasticsearch.action.search.ShardSearchFailure; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.rest.RestStatus; import java.io.IOException; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/core/GetSourceResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/core/GetSourceResponse.java index 8fbc5e163e805..45469cf1d1fb8 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/core/GetSourceResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/core/GetSourceResponse.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.core; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Map; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/core/IndexerJobStats.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/core/IndexerJobStats.java index e777b4469edef..faf42ef76ba98 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/core/IndexerJobStats.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/core/IndexerJobStats.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.core; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/core/MainResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/core/MainResponse.java index fad4ff0d81216..fc55308d2c4d8 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/core/MainResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/core/MainResponse.java @@ -8,9 +8,9 @@ package org.elasticsearch.client.core; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/core/MultiTermVectorsRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/core/MultiTermVectorsRequest.java index c393ba091191f..cdd98bb12a56a 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/core/MultiTermVectorsRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/core/MultiTermVectorsRequest.java @@ -9,8 +9,8 @@ package org.elasticsearch.client.core; import org.elasticsearch.client.Validatable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.ArrayList; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/core/MultiTermVectorsResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/core/MultiTermVectorsResponse.java index 5496e1b6a0352..ed833d35072bb 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/core/MultiTermVectorsResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/core/MultiTermVectorsResponse.java @@ -9,14 +9,14 @@ package org.elasticsearch.client.core; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.util.List; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; public class MultiTermVectorsResponse { private final List responses; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/core/PageParams.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/core/PageParams.java index 7f1c4d6a25461..d86f884a8f71a 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/core/PageParams.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/core/PageParams.java @@ -8,10 +8,10 @@ package org.elasticsearch.client.core; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/core/ShardsAcknowledgedResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/core/ShardsAcknowledgedResponse.java index 66b746e0d6db7..5958b5741719a 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/core/ShardsAcknowledgedResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/core/ShardsAcknowledgedResponse.java @@ -7,13 +7,13 @@ */ package org.elasticsearch.client.core; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; public class ShardsAcknowledgedResponse extends AcknowledgedResponse { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/core/TermVectorsRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/core/TermVectorsRequest.java index e2f81aeac9453..38dc03fce7e14 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/core/TermVectorsRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/core/TermVectorsRequest.java @@ -11,8 +11,8 @@ import org.elasticsearch.client.Validatable; import org.elasticsearch.core.Nullable; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.io.InputStream; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/core/TermVectorsResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/core/TermVectorsResponse.java index 2bf433e4e32f8..738002f895608 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/core/TermVectorsResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/core/TermVectorsResponse.java @@ -9,17 +9,17 @@ package org.elasticsearch.client.core; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.util.Collections; import java.util.Comparator; import java.util.List; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class TermVectorsResponse { private final String index; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/enrich/ExecutePolicyResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/enrich/ExecutePolicyResponse.java index e514491acee18..6da3c69a924b4 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/enrich/ExecutePolicyResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/enrich/ExecutePolicyResponse.java @@ -7,9 +7,9 @@ */ package org.elasticsearch.client.enrich; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; public final class ExecutePolicyResponse { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/enrich/GetPolicyResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/enrich/GetPolicyResponse.java index 353252d41fa83..0e3b14375e9bc 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/enrich/GetPolicyResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/enrich/GetPolicyResponse.java @@ -7,9 +7,9 @@ */ package org.elasticsearch.client.enrich; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.List; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/enrich/NamedPolicy.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/enrich/NamedPolicy.java index 142b919bc2491..4971e57d0436c 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/enrich/NamedPolicy.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/enrich/NamedPolicy.java @@ -7,12 +7,12 @@ */ package org.elasticsearch.client.enrich; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.List; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/enrich/PutPolicyRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/enrich/PutPolicyRequest.java index d98d126ada428..f1b1e4ec7fdc1 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/enrich/PutPolicyRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/enrich/PutPolicyRequest.java @@ -10,11 +10,11 @@ import org.elasticsearch.client.Validatable; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.query.QueryBuilder; import java.io.IOException; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/enrich/StatsResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/enrich/StatsResponse.java index d50a6deec7895..9471dee878eee 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/enrich/StatsResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/enrich/StatsResponse.java @@ -7,9 +7,9 @@ */ package org.elasticsearch.client.enrich; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.tasks.TaskInfo; import java.util.List; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/eql/EqlSearchRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/eql/EqlSearchRequest.java index 73bca59e1be9a..d41ac63e2d485 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/eql/EqlSearchRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/eql/EqlSearchRequest.java @@ -11,9 +11,9 @@ import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.client.Validatable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.search.fetch.subphase.FieldAndFormat; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/eql/EqlSearchResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/eql/EqlSearchResponse.java index 4c192838bd2d7..d0d9623381d76 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/eql/EqlSearchResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/eql/EqlSearchResponse.java @@ -10,13 +10,13 @@ import org.apache.lucene.search.TotalHits; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.InstantiatingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.InstantiatingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParserUtils; import org.elasticsearch.index.get.GetResult; import org.elasticsearch.index.mapper.SourceFieldMapper; @@ -29,8 +29,8 @@ import java.util.Map; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class EqlSearchResponse { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/eql/EqlStatsResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/eql/EqlStatsResponse.java index 06b11847e5eb6..6278add6592e9 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/eql/EqlStatsResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/eql/EqlStatsResponse.java @@ -8,9 +8,9 @@ package org.elasticsearch.client.eql; import org.elasticsearch.client.NodesResponseHeader; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.List; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/feature/GetFeaturesResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/feature/GetFeaturesResponse.java index ece3db33507d3..81ce37f50b7f3 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/feature/GetFeaturesResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/feature/GetFeaturesResponse.java @@ -8,10 +8,10 @@ package org.elasticsearch.client.feature; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.util.List; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/feature/ResetFeaturesResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/feature/ResetFeaturesResponse.java index b633b49aa434b..24a8077c4bdae 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/feature/ResetFeaturesResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/feature/ResetFeaturesResponse.java @@ -10,10 +10,10 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.util.List; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/graph/Connection.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/graph/Connection.java index 73fe6d30df4a1..e143b31c64a60 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/graph/Connection.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/graph/Connection.java @@ -9,18 +9,18 @@ import com.carrotsearch.hppc.ObjectIntHashMap; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContent.Params; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContent.Params; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.client.graph.Vertex.VertexId; import java.io.IOException; import java.util.List; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; /** * A Connection links exactly two {@link Vertex} objects. The basis of a diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/graph/GraphExploreRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/graph/GraphExploreRequest.java index 8f1e13a384a8a..2e09cc6b3b8c2 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/graph/GraphExploreRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/graph/GraphExploreRequest.java @@ -13,8 +13,8 @@ import org.elasticsearch.client.ValidationException; import org.elasticsearch.common.Strings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.search.aggregations.bucket.sampler.SamplerAggregationBuilder; import org.elasticsearch.search.aggregations.bucket.terms.SignificantTerms; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/graph/GraphExploreResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/graph/GraphExploreResponse.java index 3ba899b7c10d4..9918717dcf0a9 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/graph/GraphExploreResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/graph/GraphExploreResponse.java @@ -11,12 +11,12 @@ import org.elasticsearch.action.ShardOperationFailedException; import org.elasticsearch.action.search.ShardSearchFailure; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.client.graph.Connection.ConnectionId; import org.elasticsearch.client.graph.Connection.UnresolvedConnection; import org.elasticsearch.client.graph.Vertex.VertexId; @@ -27,8 +27,8 @@ import java.util.List; import java.util.Map; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * Graph explore response holds a graph of {@link Vertex} and {@link Connection} objects diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/graph/Hop.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/graph/Hop.java index 8cb84bd7c8324..ec8bb81f6a057 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/graph/Hop.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/graph/Hop.java @@ -8,8 +8,8 @@ package org.elasticsearch.client.graph; import org.elasticsearch.client.ValidationException; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilders; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/graph/Vertex.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/graph/Vertex.java index 0c45643110e11..b643631b726f0 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/graph/Vertex.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/graph/Vertex.java @@ -7,17 +7,17 @@ */ package org.elasticsearch.client.graph; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * A vertex in a graph response represents a single term (a field and value pair) diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/graph/VertexRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/graph/VertexRequest.java index e6613f21ca5ba..8deba4d81a1e5 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/graph/VertexRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/graph/VertexRequest.java @@ -7,8 +7,8 @@ */ package org.elasticsearch.client.graph; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.client.graph.GraphExploreRequest.TermBoost; import java.io.IOException; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/AllocateAction.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/AllocateAction.java index b9ddeb6563f22..cc2ce1eaf64a5 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/AllocateAction.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/AllocateAction.java @@ -7,13 +7,13 @@ */ package org.elasticsearch.client.ilm; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collections; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/DeleteAction.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/DeleteAction.java index 2f36fd9e0c789..f4ab927c1d380 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/DeleteAction.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/DeleteAction.java @@ -8,11 +8,11 @@ package org.elasticsearch.client.ilm; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/ExplainLifecycleResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/ExplainLifecycleResponse.java index 82fc6ffc796e7..29ae430aae612 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/ExplainLifecycleResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/ExplainLifecycleResponse.java @@ -8,12 +8,12 @@ package org.elasticsearch.client.ilm; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.List; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/ForceMergeAction.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/ForceMergeAction.java index 2a72b8570a1eb..7e36c39a37ed3 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/ForceMergeAction.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/ForceMergeAction.java @@ -7,12 +7,12 @@ */ package org.elasticsearch.client.ilm; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/FreezeAction.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/FreezeAction.java index 1871c67e7155c..c68e8e56570c4 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/FreezeAction.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/FreezeAction.java @@ -8,10 +8,10 @@ package org.elasticsearch.client.ilm; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/GetLifecyclePolicyResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/GetLifecyclePolicyResponse.java index 42d8888cd401a..1c3c8ce34cd22 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/GetLifecyclePolicyResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/GetLifecyclePolicyResponse.java @@ -11,10 +11,10 @@ import com.carrotsearch.hppc.cursors.ObjectObjectCursor; import org.elasticsearch.common.collect.ImmutableOpenMap; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/IndexLifecycleExplainResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/IndexLifecycleExplainResponse.java index e530a0ce064d2..6ad9e104864bd 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/IndexLifecycleExplainResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/IndexLifecycleExplainResponse.java @@ -8,15 +8,15 @@ package org.elasticsearch.client.ilm; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/IndexLifecycleNamedXContentProvider.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/IndexLifecycleNamedXContentProvider.java index d999435072349..17a89ac08b0a4 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/IndexLifecycleNamedXContentProvider.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/IndexLifecycleNamedXContentProvider.java @@ -8,8 +8,8 @@ package org.elasticsearch.client.ilm; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.plugins.spi.NamedXContentProvider; import java.util.Arrays; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/LifecycleManagementStatusResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/LifecycleManagementStatusResponse.java index aa427efb87121..a2701ff0ec263 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/LifecycleManagementStatusResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/LifecycleManagementStatusResponse.java @@ -8,9 +8,9 @@ package org.elasticsearch.client.ilm; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/LifecyclePolicy.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/LifecyclePolicy.java index 9546c94c3b62a..3bb9f8c7c5880 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/LifecyclePolicy.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/LifecyclePolicy.java @@ -7,13 +7,13 @@ */ package org.elasticsearch.client.ilm; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.HashMap; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/LifecyclePolicyMetadata.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/LifecyclePolicyMetadata.java index b8f3280878f87..a9e1bc8c897b4 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/LifecyclePolicyMetadata.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/LifecyclePolicyMetadata.java @@ -8,11 +8,11 @@ package org.elasticsearch.client.ilm; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.time.Instant; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/MigrateAction.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/MigrateAction.java index b35124fef43b2..2d621d1996807 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/MigrateAction.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/MigrateAction.java @@ -7,12 +7,12 @@ */ package org.elasticsearch.client.ilm; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/Phase.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/Phase.java index 45340061b56f3..351a4f1ae2065 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/Phase.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/Phase.java @@ -7,14 +7,14 @@ */ package org.elasticsearch.client.ilm; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.List; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/PhaseExecutionInfo.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/PhaseExecutionInfo.java index 952a1daddac13..52dcbb228a4e6 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/PhaseExecutionInfo.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/PhaseExecutionInfo.java @@ -8,12 +8,12 @@ package org.elasticsearch.client.ilm; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/PutLifecyclePolicyRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/PutLifecyclePolicyRequest.java index 0d3b2e3a08e9e..e789f59ef607d 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/PutLifecyclePolicyRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/PutLifecyclePolicyRequest.java @@ -10,8 +10,8 @@ import org.elasticsearch.client.TimedRequest; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/ReadOnlyAction.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/ReadOnlyAction.java index ca96c035a36f1..32080899c1277 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/ReadOnlyAction.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/ReadOnlyAction.java @@ -8,10 +8,10 @@ package org.elasticsearch.client.ilm; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/RemoveIndexLifecyclePolicyResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/RemoveIndexLifecyclePolicyResponse.java index 5f223bcb6d2c8..6ac257970c76a 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/RemoveIndexLifecyclePolicyResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/RemoveIndexLifecyclePolicyResponse.java @@ -8,9 +8,9 @@ package org.elasticsearch.client.ilm; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.util.Collections; import java.util.List; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/RolloverAction.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/RolloverAction.java index ac008e97a0823..ed81975246eaa 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/RolloverAction.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/RolloverAction.java @@ -7,15 +7,15 @@ */ package org.elasticsearch.client.ilm; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/SearchableSnapshotAction.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/SearchableSnapshotAction.java index 551c77fbb3aa8..26551f7173b9f 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/SearchableSnapshotAction.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/SearchableSnapshotAction.java @@ -7,13 +7,13 @@ */ package org.elasticsearch.client.ilm; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/SetPriorityAction.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/SetPriorityAction.java index f378e7ac5f5c4..57574bbd0e508 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/SetPriorityAction.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/SetPriorityAction.java @@ -8,14 +8,14 @@ package org.elasticsearch.client.ilm; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/ShrinkAction.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/ShrinkAction.java index 1155e81b675b3..fdfabd617394e 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/ShrinkAction.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/ShrinkAction.java @@ -8,14 +8,14 @@ package org.elasticsearch.client.ilm; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/UnfollowAction.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/UnfollowAction.java index 7a51fd3e12f3f..aa73b427c3fba 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/UnfollowAction.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/UnfollowAction.java @@ -9,11 +9,11 @@ package org.elasticsearch.client.ilm; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/WaitForSnapshotAction.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/WaitForSnapshotAction.java index a9cb0efd1d87b..10f855c76b47e 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/WaitForSnapshotAction.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ilm/WaitForSnapshotAction.java @@ -8,13 +8,13 @@ package org.elasticsearch.client.ilm; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/AnalyzeRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/AnalyzeRequest.java index 280d3b9296ad7..5044286c89ec6 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/AnalyzeRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/AnalyzeRequest.java @@ -11,9 +11,9 @@ import org.elasticsearch.client.Validatable; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.ArrayList; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/AnalyzeResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/AnalyzeResponse.java index 995f492392b70..bcd8df71f0ae1 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/AnalyzeResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/AnalyzeResponse.java @@ -8,10 +8,10 @@ package org.elasticsearch.client.indices; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.HashMap; @@ -19,7 +19,7 @@ import java.util.Map; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class AnalyzeResponse { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/CloseIndexResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/CloseIndexResponse.java index 6c19a480ef558..413ab82c332b2 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/CloseIndexResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/CloseIndexResponse.java @@ -11,9 +11,9 @@ import org.elasticsearch.action.support.DefaultShardOperationFailedException; import org.elasticsearch.action.support.master.ShardsAcknowledgedResponse; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParserUtils; import java.util.List; @@ -21,8 +21,8 @@ import static java.util.Collections.emptyList; import static java.util.Collections.unmodifiableList; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; -import static org.elasticsearch.common.xcontent.ObjectParser.ValueType; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ObjectParser.ValueType; public class CloseIndexResponse extends ShardsAcknowledgedResponse { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/CreateIndexRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/CreateIndexRequest.java index ced6106a9e21e..3e979b26e1ac4 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/CreateIndexRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/CreateIndexRequest.java @@ -14,19 +14,19 @@ import org.elasticsearch.action.support.ActiveShardCount; import org.elasticsearch.client.TimedRequest; import org.elasticsearch.client.Validatable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.io.InputStream; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/CreateIndexResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/CreateIndexResponse.java index 045060df9d2f0..334813404c338 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/CreateIndexResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/CreateIndexResponse.java @@ -9,14 +9,14 @@ package org.elasticsearch.client.indices; import org.elasticsearch.action.support.master.ShardsAcknowledgedResponse; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; /** * A response for a create index action. diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/DataStream.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/DataStream.java index 64d69262f75cc..91ddf4466dfe4 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/DataStream.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/DataStream.java @@ -9,9 +9,9 @@ import org.elasticsearch.cluster.health.ClusterHealthStatus; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.List; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/DataStreamsStatsResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/DataStreamsStatsResponse.java index 1e854c019513d..394473ee9d33e 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/DataStreamsStatsResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/DataStreamsStatsResponse.java @@ -9,11 +9,11 @@ package org.elasticsearch.client.indices; import org.elasticsearch.client.core.BroadcastResponse; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.HashMap; @@ -21,7 +21,7 @@ import java.util.Map; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; public class DataStreamsStatsResponse extends BroadcastResponse { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/DetailAnalyzeResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/DetailAnalyzeResponse.java index 87f8738b73d35..914ab44f9207e 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/DetailAnalyzeResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/DetailAnalyzeResponse.java @@ -8,18 +8,18 @@ package org.elasticsearch.client.indices; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Arrays; import java.util.List; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class DetailAnalyzeResponse { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/GetComponentTemplatesResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/GetComponentTemplatesResponse.java index b0baab6574613..d4b04654e1143 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/GetComponentTemplatesResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/GetComponentTemplatesResponse.java @@ -8,9 +8,9 @@ package org.elasticsearch.client.indices; import org.elasticsearch.cluster.metadata.ComponentTemplate; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collections; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/GetComposableIndexTemplatesResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/GetComposableIndexTemplatesResponse.java index 5ee682551f56d..52a1899ce342c 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/GetComposableIndexTemplatesResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/GetComposableIndexTemplatesResponse.java @@ -8,9 +8,9 @@ package org.elasticsearch.client.indices; import org.elasticsearch.cluster.metadata.ComposableIndexTemplate; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collections; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/GetDataStreamResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/GetDataStreamResponse.java index a8db46a7d6da7..7477614e39738 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/GetDataStreamResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/GetDataStreamResponse.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.indices; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/GetFieldMappingsResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/GetFieldMappingsResponse.java index f4348981ce776..db56467968ab4 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/GetFieldMappingsResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/GetFieldMappingsResponse.java @@ -8,14 +8,14 @@ package org.elasticsearch.client.indices; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.mapper.Mapper; import java.io.IOException; @@ -23,8 +23,8 @@ import java.util.Map; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.common.xcontent.XContentParserUtils.ensureExpectedToken; /** Response object for {@link GetFieldMappingsRequest} API */ diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/GetIndexResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/GetIndexResponse.java index d8fabcfca8f26..a56777ad9e711 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/GetIndexResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/GetIndexResponse.java @@ -12,8 +12,8 @@ import org.elasticsearch.cluster.metadata.AliasMetadata; import org.elasticsearch.cluster.metadata.MappingMetadata; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentParser.Token; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser.Token; import org.elasticsearch.index.mapper.MapperService; import java.io.IOException; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/GetIndexTemplatesResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/GetIndexTemplatesResponse.java index a86c777f0030f..68495bf9fd872 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/GetIndexTemplatesResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/GetIndexTemplatesResponse.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.indices; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/GetMappingsResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/GetMappingsResponse.java index e14c4c2adc854..cec598844e049 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/GetMappingsResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/GetMappingsResponse.java @@ -9,8 +9,8 @@ package org.elasticsearch.client.indices; import org.elasticsearch.cluster.metadata.MappingMetadata; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParserUtils; import org.elasticsearch.index.mapper.MapperService; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/IndexTemplateMetadata.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/IndexTemplateMetadata.java index 3bd9d4b097e34..3733a712d3d4e 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/IndexTemplateMetadata.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/IndexTemplateMetadata.java @@ -11,11 +11,11 @@ import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.cluster.metadata.MappingMetadata; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.collect.ImmutableOpenMap; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.mapper.MapperService; import java.io.IOException; @@ -25,7 +25,7 @@ import java.util.Objects; import java.util.stream.Collectors; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class IndexTemplateMetadata { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/PutComponentTemplateRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/PutComponentTemplateRequest.java index 5948de5db63e0..0ca1993e89552 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/PutComponentTemplateRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/PutComponentTemplateRequest.java @@ -10,8 +10,8 @@ import org.elasticsearch.client.TimedRequest; import org.elasticsearch.cluster.metadata.ComponentTemplate; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/PutComposableIndexTemplateRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/PutComposableIndexTemplateRequest.java index 1a191b68e0d35..e683db04523fc 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/PutComposableIndexTemplateRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/PutComposableIndexTemplateRequest.java @@ -10,8 +10,8 @@ import org.elasticsearch.client.TimedRequest; import org.elasticsearch.cluster.metadata.ComposableIndexTemplate; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/PutIndexTemplateRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/PutIndexTemplateRequest.java index b2eea60b4471d..76f4e4d1ec136 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/PutIndexTemplateRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/PutIndexTemplateRequest.java @@ -15,15 +15,15 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.common.xcontent.support.XContentMapValues; import java.io.IOException; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/PutMappingRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/PutMappingRequest.java index 6171500fc561f..bd3cebcea06c6 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/PutMappingRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/PutMappingRequest.java @@ -14,11 +14,11 @@ import org.elasticsearch.client.TimedRequest; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.io.InputStream; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/ReloadAnalyzersResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/ReloadAnalyzersResponse.java index 5b736d523059e..197165fc0aede 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/ReloadAnalyzersResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/ReloadAnalyzersResponse.java @@ -8,10 +8,10 @@ package org.elasticsearch.client.indices; import org.elasticsearch.client.core.BroadcastResponse; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.Tuple; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.util.HashMap; import java.util.HashSet; @@ -19,7 +19,7 @@ import java.util.Map; import java.util.Set; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; /** * The response object that will be returned when reloading analyzers diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/ResizeRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/ResizeRequest.java index 157076ffaa304..75322a6cf5d86 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/ResizeRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/ResizeRequest.java @@ -14,8 +14,8 @@ import org.elasticsearch.client.ValidationException; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Collections; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/ResizeResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/ResizeResponse.java index 7eb8817447653..0cbda6e89585d 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/ResizeResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/ResizeResponse.java @@ -10,14 +10,14 @@ import org.elasticsearch.client.core.AcknowledgedResponse; import org.elasticsearch.client.core.ShardsAcknowledgedResponse; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; /** * The response from a {@link ResizeRequest} call diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/SimulateIndexTemplateResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/SimulateIndexTemplateResponse.java index 173774b15ee4f..13aed5d5fff1b 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/SimulateIndexTemplateResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/SimulateIndexTemplateResponse.java @@ -9,9 +9,9 @@ import org.elasticsearch.cluster.metadata.Template; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.List; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/rollover/RolloverRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/rollover/RolloverRequest.java index 29724ed2bd1c0..355337775e5ff 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/rollover/RolloverRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/rollover/RolloverRequest.java @@ -16,8 +16,8 @@ import org.elasticsearch.client.indices.CreateIndexRequest; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.HashMap; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/rollover/RolloverResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/rollover/RolloverResponse.java index 3f6fe4480ac00..11a51382c186d 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/rollover/RolloverResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/rollover/RolloverResponse.java @@ -9,14 +9,14 @@ package org.elasticsearch.client.indices.rollover; import org.elasticsearch.action.support.master.ShardsAcknowledgedResponse; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.util.Map; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; /** * Response object for {@link RolloverRequest} API diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/license/GetBasicStatusResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/license/GetBasicStatusResponse.java index 0576e99d2fa45..ebef8f1f176d5 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/license/GetBasicStatusResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/license/GetBasicStatusResponse.java @@ -8,14 +8,14 @@ package org.elasticsearch.client.license; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; /** * Response class for license get basic status API diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/license/GetTrialStatusResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/license/GetTrialStatusResponse.java index 07433cb9f944c..2ca498319ca30 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/license/GetTrialStatusResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/license/GetTrialStatusResponse.java @@ -8,14 +8,14 @@ package org.elasticsearch.client.license; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; /** * Response class for license get trial status API diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/license/PutLicenseResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/license/PutLicenseResponse.java index b48a864d5a3fe..6d7905d712bdc 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/license/PutLicenseResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/license/PutLicenseResponse.java @@ -8,11 +8,11 @@ package org.elasticsearch.client.license; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.Tuple; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.client.common.ProtocolUtils; import java.io.IOException; @@ -23,8 +23,8 @@ import java.util.Map; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public final class PutLicenseResponse { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/license/StartBasicResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/license/StartBasicResponse.java index 931ba6b056bd1..ff00763bd46ed 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/license/StartBasicResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/license/StartBasicResponse.java @@ -7,11 +7,11 @@ */ package org.elasticsearch.client.license; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.Tuple; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; @@ -21,8 +21,8 @@ import java.util.Map; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; import static org.elasticsearch.common.xcontent.XContentParserUtils.ensureExpectedToken; public class StartBasicResponse { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/license/StartTrialResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/license/StartTrialResponse.java index 466afbe7e4905..223a86cc641a6 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/license/StartTrialResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/license/StartTrialResponse.java @@ -8,11 +8,11 @@ package org.elasticsearch.client.license; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.Tuple; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; @@ -20,8 +20,8 @@ import java.util.List; import java.util.Map; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class StartTrialResponse { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/migration/DeprecationInfoResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/migration/DeprecationInfoResponse.java index 1548347eba8fc..5fc58d80e834a 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/migration/DeprecationInfoResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/migration/DeprecationInfoResponse.java @@ -9,9 +9,9 @@ package org.elasticsearch.client.migration; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/migration/GetFeatureUpgradeStatusResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/migration/GetFeatureUpgradeStatusResponse.java index 7b70dc41a83f2..e75d2c7ce2858 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/migration/GetFeatureUpgradeStatusResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/migration/GetFeatureUpgradeStatusResponse.java @@ -8,10 +8,10 @@ package org.elasticsearch.client.migration; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collections; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/migration/PostFeatureUpgradeResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/migration/PostFeatureUpgradeResponse.java index e1fb953787dfa..e8d18b62c1afb 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/migration/PostFeatureUpgradeResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/migration/PostFeatureUpgradeResponse.java @@ -9,10 +9,10 @@ package org.elasticsearch.client.migration; import org.elasticsearch.ElasticsearchException; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.Nullable; import java.util.Collections; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/AbstractResultResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/AbstractResultResponse.java index d149e7925e534..d49c9b3b65e5e 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/AbstractResultResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/AbstractResultResponse.java @@ -7,10 +7,10 @@ */ package org.elasticsearch.client.ml; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Collections; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/CloseJobRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/CloseJobRequest.java index 20aff8374ce13..6a79ad10997cb 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/CloseJobRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/CloseJobRequest.java @@ -8,13 +8,13 @@ package org.elasticsearch.client.ml; import org.elasticsearch.client.Validatable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.security.InvalidParameterException; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/CloseJobResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/CloseJobResponse.java index 9d6d3fd0694a0..b6ca8c5fef286 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/CloseJobResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/CloseJobResponse.java @@ -7,11 +7,11 @@ */ package org.elasticsearch.client.ml; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/DeleteExpiredDataRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/DeleteExpiredDataRequest.java index 1abe46391e5e5..434f64ea01e07 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/DeleteExpiredDataRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/DeleteExpiredDataRequest.java @@ -9,8 +9,8 @@ import org.elasticsearch.client.Validatable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/DeleteExpiredDataResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/DeleteExpiredDataResponse.java index c217eb21e80fa..1d2715f77b855 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/DeleteExpiredDataResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/DeleteExpiredDataResponse.java @@ -7,12 +7,12 @@ */ package org.elasticsearch.client.ml; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/DeleteForecastRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/DeleteForecastRequest.java index a8418622d56f2..fb9b8f5605cce 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/DeleteForecastRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/DeleteForecastRequest.java @@ -9,12 +9,12 @@ import org.elasticsearch.client.Validatable; import org.elasticsearch.client.ml.job.config.Job; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.ArrayList; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/DeleteJobResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/DeleteJobResponse.java index 8603dfa87633d..4c1a62e1de76a 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/DeleteJobResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/DeleteJobResponse.java @@ -8,12 +8,12 @@ package org.elasticsearch.client.ml; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.tasks.TaskId; import java.io.IOException; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/EstimateModelMemoryRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/EstimateModelMemoryRequest.java index 4dd789ce3c005..67dc9f8dd78b0 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/EstimateModelMemoryRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/EstimateModelMemoryRequest.java @@ -11,8 +11,8 @@ import org.elasticsearch.client.Validatable; import org.elasticsearch.client.ValidationException; import org.elasticsearch.client.ml.job.config.AnalysisConfig; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Collections; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/EstimateModelMemoryResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/EstimateModelMemoryResponse.java index b28376258c6b3..f16df0f6d59be 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/EstimateModelMemoryResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/EstimateModelMemoryResponse.java @@ -8,14 +8,14 @@ package org.elasticsearch.client.ml; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; public class EstimateModelMemoryResponse { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/EvaluateDataFrameRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/EvaluateDataFrameRequest.java index 003bd58b0231b..06db559dbc24e 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/EvaluateDataFrameRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/EvaluateDataFrameRequest.java @@ -13,11 +13,11 @@ import org.elasticsearch.client.ml.dataframe.QueryConfig; import org.elasticsearch.client.ml.dataframe.evaluation.Evaluation; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; @@ -27,8 +27,8 @@ import java.util.Objects; import java.util.Optional; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; import static org.elasticsearch.common.xcontent.XContentParserUtils.ensureExpectedToken; public class EvaluateDataFrameRequest implements ToXContentObject, Validatable { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/EvaluateDataFrameResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/EvaluateDataFrameResponse.java index 43e4f27c17bb7..a3561403c857f 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/EvaluateDataFrameResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/EvaluateDataFrameResponse.java @@ -10,11 +10,11 @@ import org.elasticsearch.client.ml.dataframe.evaluation.EvaluationMetric; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.NamedObjectNotFoundException; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedObjectNotFoundException; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.LinkedHashMap; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/ExplainDataFrameAnalyticsResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/ExplainDataFrameAnalyticsResponse.java index 46e22b82edab0..d460a2122bba0 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/ExplainDataFrameAnalyticsResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/ExplainDataFrameAnalyticsResponse.java @@ -9,11 +9,11 @@ import org.elasticsearch.client.ml.dataframe.explain.FieldSelection; import org.elasticsearch.client.ml.dataframe.explain.MemoryEstimation; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.List; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/FlushJobRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/FlushJobRequest.java index 22ccf8112d2a7..9c8623c18521a 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/FlushJobRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/FlushJobRequest.java @@ -9,10 +9,10 @@ import org.elasticsearch.client.Validatable; import org.elasticsearch.client.ml.job.config.Job; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/FlushJobResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/FlushJobResponse.java index 8d5241592e939..9a5cb28ecce1f 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/FlushJobResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/FlushJobResponse.java @@ -8,11 +8,11 @@ package org.elasticsearch.client.ml; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Date; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/ForecastJobRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/ForecastJobRequest.java index dbf6f4dfe410f..176808fce0a17 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/ForecastJobRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/ForecastJobRequest.java @@ -9,16 +9,16 @@ import org.elasticsearch.client.Validatable; import org.elasticsearch.client.ml.job.config.Job; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/ForecastJobResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/ForecastJobResponse.java index 319d5e78b1de5..75a529ea0ef24 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/ForecastJobResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/ForecastJobResponse.java @@ -7,11 +7,11 @@ */ package org.elasticsearch.client.ml; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetBucketsRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetBucketsRequest.java index 584756ad70c30..a8d8996b383ef 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetBucketsRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetBucketsRequest.java @@ -11,10 +11,10 @@ import org.elasticsearch.client.core.PageParams; import org.elasticsearch.client.ml.job.config.Job; import org.elasticsearch.client.ml.job.results.Result; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetBucketsResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetBucketsResponse.java index c6848312aa0a0..157abe9669a29 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetBucketsResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetBucketsResponse.java @@ -8,9 +8,9 @@ package org.elasticsearch.client.ml; import org.elasticsearch.client.ml.job.results.Bucket; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.List; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetCalendarEventsRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetCalendarEventsRequest.java index 3353bd0435e44..b866650ad6a4b 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetCalendarEventsRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetCalendarEventsRequest.java @@ -12,10 +12,10 @@ import org.elasticsearch.client.core.PageParams; import org.elasticsearch.client.ml.calendars.Calendar; import org.elasticsearch.client.ml.job.config.Job; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetCalendarEventsResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetCalendarEventsResponse.java index 1dbecb1b55d7b..de03a8605cb14 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetCalendarEventsResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetCalendarEventsResponse.java @@ -8,16 +8,16 @@ package org.elasticsearch.client.ml; import org.elasticsearch.client.ml.calendars.ScheduledEvent; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.List; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; /** * Contains a {@link List} of the found {@link ScheduledEvent} objects and the total count found diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetCalendarsRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetCalendarsRequest.java index 648a40d42e60f..4d51cda347db8 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetCalendarsRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetCalendarsRequest.java @@ -11,9 +11,9 @@ import org.elasticsearch.client.Validatable; import org.elasticsearch.client.core.PageParams; import org.elasticsearch.client.ml.calendars.Calendar; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetCalendarsResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetCalendarsResponse.java index fbda8d50844e8..031a3a4e6ab7c 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetCalendarsResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetCalendarsResponse.java @@ -9,16 +9,16 @@ package org.elasticsearch.client.ml; import org.elasticsearch.client.ml.calendars.Calendar; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.List; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; public class GetCalendarsResponse extends AbstractResultResponse { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetCategoriesRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetCategoriesRequest.java index 1287d4b01e7a8..94f2c28c3f6c2 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetCategoriesRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetCategoriesRequest.java @@ -11,10 +11,10 @@ import org.elasticsearch.client.core.PageParams; import org.elasticsearch.client.ml.job.config.Job; import org.elasticsearch.client.ml.job.results.CategoryDefinition; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetCategoriesResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetCategoriesResponse.java index a928bcc2657b3..a8c874787a9b0 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetCategoriesResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetCategoriesResponse.java @@ -8,9 +8,9 @@ package org.elasticsearch.client.ml; import org.elasticsearch.client.ml.job.results.CategoryDefinition; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.List; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetDataFrameAnalyticsResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetDataFrameAnalyticsResponse.java index 8621b907949dd..acf3592fae57f 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetDataFrameAnalyticsResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetDataFrameAnalyticsResponse.java @@ -9,14 +9,14 @@ package org.elasticsearch.client.ml; import org.elasticsearch.client.ml.dataframe.DataFrameAnalyticsConfig; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.util.List; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; public class GetDataFrameAnalyticsResponse { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetDataFrameAnalyticsStatsRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetDataFrameAnalyticsStatsRequest.java index 9e656b83060ca..50a71f5a4dc33 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetDataFrameAnalyticsStatsRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetDataFrameAnalyticsStatsRequest.java @@ -12,7 +12,7 @@ import org.elasticsearch.client.ValidationException; import org.elasticsearch.client.core.PageParams; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import java.util.Arrays; import java.util.List; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetDataFrameAnalyticsStatsResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetDataFrameAnalyticsStatsResponse.java index 226c0d1703f5a..d4377be4c19ed 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetDataFrameAnalyticsStatsResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetDataFrameAnalyticsStatsResponse.java @@ -13,16 +13,16 @@ import org.elasticsearch.client.ml.dataframe.DataFrameAnalyticsStats; import org.elasticsearch.client.transform.AcknowledgedTasksResponse; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.util.Collections; import java.util.List; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class GetDataFrameAnalyticsStatsResponse { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetDatafeedRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetDatafeedRequest.java index 8b8de4a1eb903..33ebc5fdfea63 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetDatafeedRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetDatafeedRequest.java @@ -9,10 +9,10 @@ import org.elasticsearch.client.Validatable; import org.elasticsearch.client.ml.datafeed.DatafeedConfig; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.ArrayList; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetDatafeedResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetDatafeedResponse.java index a073eadd32452..e80160c1144ab 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetDatafeedResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetDatafeedResponse.java @@ -8,17 +8,17 @@ package org.elasticsearch.client.ml; import org.elasticsearch.client.ml.datafeed.DatafeedConfig; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.List; import java.util.Objects; import java.util.stream.Collectors; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; /** * Contains a {@link List} of the found {@link DatafeedConfig} objects and the total count found diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetDatafeedStatsRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetDatafeedStatsRequest.java index 63b4989ad6d07..a451296410776 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetDatafeedStatsRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetDatafeedStatsRequest.java @@ -9,13 +9,13 @@ import org.elasticsearch.client.Validatable; import org.elasticsearch.client.ml.datafeed.DatafeedConfig; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.ArrayList; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetDatafeedStatsResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetDatafeedStatsResponse.java index f4f2cfae9f45e..06590e2ab9c85 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetDatafeedStatsResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetDatafeedStatsResponse.java @@ -8,16 +8,16 @@ package org.elasticsearch.client.ml; import org.elasticsearch.client.ml.datafeed.DatafeedStats; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.List; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; /** * Contains a {@link List} of the found {@link DatafeedStats} objects and the total count found diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetFiltersRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetFiltersRequest.java index 614eacc3b817a..2c79eb55624c5 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetFiltersRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetFiltersRequest.java @@ -10,9 +10,9 @@ import org.elasticsearch.client.Validatable; import org.elasticsearch.client.core.PageParams; import org.elasticsearch.client.ml.job.config.MlFilter; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetFiltersResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetFiltersResponse.java index 9c86ff7af9ee7..3b24454c84477 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetFiltersResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetFiltersResponse.java @@ -8,17 +8,17 @@ package org.elasticsearch.client.ml; import org.elasticsearch.client.ml.job.config.MlFilter; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.List; import java.util.Objects; import java.util.stream.Collectors; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; /** * Contains a {@link List} of the found {@link MlFilter} objects and the total count found diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetInfluencersRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetInfluencersRequest.java index f3ebf65acf78a..c82738a9050f4 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetInfluencersRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetInfluencersRequest.java @@ -10,10 +10,10 @@ import org.elasticsearch.client.Validatable; import org.elasticsearch.client.core.PageParams; import org.elasticsearch.client.ml.job.config.Job; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetInfluencersResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetInfluencersResponse.java index fad2c6c67ca68..536cd76d8488b 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetInfluencersResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetInfluencersResponse.java @@ -8,9 +8,9 @@ package org.elasticsearch.client.ml; import org.elasticsearch.client.ml.job.results.Influencer; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.List; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetJobRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetJobRequest.java index 5ff9a9c608e4d..2efa0ec71d9d9 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetJobRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetJobRequest.java @@ -9,10 +9,10 @@ import org.elasticsearch.client.Validatable; import org.elasticsearch.client.ml.job.config.Job; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.ArrayList; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetJobResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetJobResponse.java index c41cf85c4ab8e..1239867a321dc 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetJobResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetJobResponse.java @@ -8,17 +8,17 @@ package org.elasticsearch.client.ml; import org.elasticsearch.client.ml.job.config.Job; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.List; import java.util.Objects; import java.util.stream.Collectors; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; /** * Contains a {@link List} of the found {@link Job} objects and the total count found diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetJobStatsRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetJobStatsRequest.java index 58557da1db341..d74840f0da1c0 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetJobStatsRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetJobStatsRequest.java @@ -9,12 +9,12 @@ import org.elasticsearch.client.Validatable; import org.elasticsearch.client.ml.job.config.Job; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.ArrayList; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetJobStatsResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetJobStatsResponse.java index 3612cfb3636d5..655a6c24e0d5d 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetJobStatsResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetJobStatsResponse.java @@ -7,17 +7,17 @@ */ package org.elasticsearch.client.ml; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.client.ml.job.stats.JobStats; import java.io.IOException; import java.util.List; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; /** * Contains a {@link List} of the found {@link JobStats} objects and the total count found diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetModelSnapshotsRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetModelSnapshotsRequest.java index c125a1f154d8c..cbbc527bb0a42 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetModelSnapshotsRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetModelSnapshotsRequest.java @@ -10,10 +10,10 @@ import org.elasticsearch.client.Validatable; import org.elasticsearch.client.core.PageParams; import org.elasticsearch.client.ml.job.config.Job; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetModelSnapshotsResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetModelSnapshotsResponse.java index 359988519edd0..f8b4deceef69b 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetModelSnapshotsResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetModelSnapshotsResponse.java @@ -8,9 +8,9 @@ package org.elasticsearch.client.ml; import org.elasticsearch.client.ml.job.process.ModelSnapshot; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.List; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetOverallBucketsRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetOverallBucketsRequest.java index a6b06ed1f516d..2735c8f203997 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetOverallBucketsRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetOverallBucketsRequest.java @@ -9,12 +9,12 @@ import org.elasticsearch.client.Validatable; import org.elasticsearch.client.ml.job.config.Job; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Arrays; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetOverallBucketsResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetOverallBucketsResponse.java index 145cefb7e3b4b..f41f1ef2d45bf 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetOverallBucketsResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetOverallBucketsResponse.java @@ -8,9 +8,9 @@ package org.elasticsearch.client.ml; import org.elasticsearch.client.ml.job.results.OverallBucket; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.List; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetRecordsRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetRecordsRequest.java index ef4800384d96a..872725d7d3b8d 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetRecordsRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetRecordsRequest.java @@ -10,10 +10,10 @@ import org.elasticsearch.client.Validatable; import org.elasticsearch.client.core.PageParams; import org.elasticsearch.client.ml.job.config.Job; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetRecordsResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetRecordsResponse.java index f7ac416424414..226fcee6cdffd 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetRecordsResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetRecordsResponse.java @@ -8,9 +8,9 @@ package org.elasticsearch.client.ml; import org.elasticsearch.client.ml.job.results.AnomalyRecord; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.List; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetTrainedModelsResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetTrainedModelsResponse.java index a3a70f639e887..0548ff6c72dc9 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetTrainedModelsResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetTrainedModelsResponse.java @@ -9,14 +9,14 @@ package org.elasticsearch.client.ml; import org.elasticsearch.client.ml.inference.TrainedModelConfig; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.util.List; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; public class GetTrainedModelsResponse { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetTrainedModelsStatsResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetTrainedModelsStatsResponse.java index ea08e01701c10..a020c33493c22 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetTrainedModelsStatsResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/GetTrainedModelsStatsResponse.java @@ -9,14 +9,14 @@ package org.elasticsearch.client.ml; import org.elasticsearch.client.ml.inference.TrainedModelStats; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.util.List; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; public class GetTrainedModelsStatsResponse { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/MlInfoResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/MlInfoResponse.java index 49cb0a22baf95..6fa6c6eaaf6be 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/MlInfoResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/MlInfoResponse.java @@ -9,7 +9,7 @@ package org.elasticsearch.client.ml; import org.elasticsearch.client.Validatable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Map; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/NodeAttributes.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/NodeAttributes.java index 8c631d566d2ec..955510d87cade 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/NodeAttributes.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/NodeAttributes.java @@ -7,12 +7,12 @@ */ package org.elasticsearch.client.ml; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Collections; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/OpenJobRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/OpenJobRequest.java index bd2af4aafd846..74a8113936bfd 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/OpenJobRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/OpenJobRequest.java @@ -9,13 +9,13 @@ import org.elasticsearch.client.Validatable; import org.elasticsearch.client.ml.job.config.Job; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/OpenJobResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/OpenJobResponse.java index b60b84bb354db..a918719d37629 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/OpenJobResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/OpenJobResponse.java @@ -7,11 +7,11 @@ */ package org.elasticsearch.client.ml; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PostCalendarEventRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PostCalendarEventRequest.java index b48b2ec2deb6a..0918e98221bb2 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PostCalendarEventRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PostCalendarEventRequest.java @@ -10,10 +10,10 @@ import org.elasticsearch.client.Validatable; import org.elasticsearch.client.ml.calendars.Calendar; import org.elasticsearch.client.ml.calendars.ScheduledEvent; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Collections; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PostCalendarEventResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PostCalendarEventResponse.java index d9a2aaacc76a4..1ef8bd3c73852 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PostCalendarEventResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PostCalendarEventResponse.java @@ -8,11 +8,11 @@ package org.elasticsearch.client.ml; import org.elasticsearch.client.ml.calendars.ScheduledEvent; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.List; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PostDataRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PostDataRequest.java index 1adfade24b79a..2eb4c445aca26 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PostDataRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PostDataRequest.java @@ -9,13 +9,13 @@ import org.elasticsearch.client.Validatable; import org.elasticsearch.client.ml.job.config.Job; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.nio.ByteBuffer; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PostDataResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PostDataResponse.java index 3ba776bb72684..4d8c8886fd896 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PostDataResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PostDataResponse.java @@ -8,10 +8,10 @@ package org.elasticsearch.client.ml; import org.elasticsearch.client.ml.job.process.DataCounts; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PreviewDatafeedRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PreviewDatafeedRequest.java index 446c9e5da2340..7c869b26f7dfe 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PreviewDatafeedRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PreviewDatafeedRequest.java @@ -11,12 +11,12 @@ import org.elasticsearch.client.ml.datafeed.DatafeedConfig; import org.elasticsearch.client.ml.job.config.Job; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PreviewDatafeedResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PreviewDatafeedResponse.java index 3ac1fd7812f9e..32047300c9927 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PreviewDatafeedResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PreviewDatafeedResponse.java @@ -10,13 +10,13 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.io.InputStream; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PutCalendarRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PutCalendarRequest.java index 9581fb80374ce..7a45bc3163732 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PutCalendarRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PutCalendarRequest.java @@ -10,8 +10,8 @@ import org.elasticsearch.client.Validatable; import org.elasticsearch.client.ml.calendars.Calendar; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PutCalendarResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PutCalendarResponse.java index 46e727550720b..3e3170a954815 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PutCalendarResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PutCalendarResponse.java @@ -10,9 +10,9 @@ import org.elasticsearch.client.ml.calendars.Calendar; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PutDataFrameAnalyticsRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PutDataFrameAnalyticsRequest.java index bf76677208a40..33015ed97bf97 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PutDataFrameAnalyticsRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PutDataFrameAnalyticsRequest.java @@ -12,8 +12,8 @@ import org.elasticsearch.client.ValidationException; import org.elasticsearch.client.ml.dataframe.DataFrameAnalyticsConfig; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PutDataFrameAnalyticsResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PutDataFrameAnalyticsResponse.java index 0c1d0d0b8cc7a..7387de559c256 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PutDataFrameAnalyticsResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PutDataFrameAnalyticsResponse.java @@ -9,7 +9,7 @@ package org.elasticsearch.client.ml; import org.elasticsearch.client.ml.dataframe.DataFrameAnalyticsConfig; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PutDatafeedRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PutDatafeedRequest.java index a3bc01eb8cfbb..d079f1b0fc8d6 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PutDatafeedRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PutDatafeedRequest.java @@ -10,8 +10,8 @@ import org.elasticsearch.client.Validatable; import org.elasticsearch.client.ml.datafeed.DatafeedConfig; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PutDatafeedResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PutDatafeedResponse.java index a1c1f0c9c545b..6abaf8deb4be3 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PutDatafeedResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PutDatafeedResponse.java @@ -8,9 +8,9 @@ package org.elasticsearch.client.ml; import org.elasticsearch.client.ml.datafeed.DatafeedConfig; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PutFilterRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PutFilterRequest.java index cf0ed55837196..dd08f7a96c9b0 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PutFilterRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PutFilterRequest.java @@ -10,8 +10,8 @@ import org.elasticsearch.client.Validatable; import org.elasticsearch.client.ml.job.config.MlFilter; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PutFilterResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PutFilterResponse.java index 396fab6c6954a..48a850be7d228 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PutFilterResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PutFilterResponse.java @@ -8,9 +8,9 @@ package org.elasticsearch.client.ml; import org.elasticsearch.client.ml.job.config.MlFilter; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PutJobRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PutJobRequest.java index 7c1acd54fe536..04bfc4f3f9169 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PutJobRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PutJobRequest.java @@ -10,8 +10,8 @@ import org.elasticsearch.client.Validatable; import org.elasticsearch.client.ml.job.config.Job; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PutJobResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PutJobResponse.java index 32de4bd6574b4..532a6f54ba30a 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PutJobResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PutJobResponse.java @@ -8,9 +8,9 @@ package org.elasticsearch.client.ml; import org.elasticsearch.client.ml.job.config.Job; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PutTrainedModelRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PutTrainedModelRequest.java index 9a58e16ab3176..0ecf345deb722 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PutTrainedModelRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PutTrainedModelRequest.java @@ -10,9 +10,9 @@ import org.elasticsearch.client.Validatable; import org.elasticsearch.client.ml.inference.TrainedModelConfig; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PutTrainedModelResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PutTrainedModelResponse.java index d521a1bcd1f07..25cb73e582056 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PutTrainedModelResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/PutTrainedModelResponse.java @@ -8,9 +8,9 @@ package org.elasticsearch.client.ml; import org.elasticsearch.client.ml.inference.TrainedModelConfig; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/RevertModelSnapshotRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/RevertModelSnapshotRequest.java index 522e1de57adbe..30df3a6754a41 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/RevertModelSnapshotRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/RevertModelSnapshotRequest.java @@ -10,10 +10,10 @@ import org.elasticsearch.client.Validatable; import org.elasticsearch.client.ml.job.config.Job; import org.elasticsearch.client.ml.job.process.ModelSnapshot; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/RevertModelSnapshotResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/RevertModelSnapshotResponse.java index a93266420964a..6f196187c082f 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/RevertModelSnapshotResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/RevertModelSnapshotResponse.java @@ -8,11 +8,11 @@ package org.elasticsearch.client.ml; import org.elasticsearch.client.ml.job.process.ModelSnapshot; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/SetUpgradeModeRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/SetUpgradeModeRequest.java index 38199504aea4b..84a802ac6f381 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/SetUpgradeModeRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/SetUpgradeModeRequest.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.ml; import org.elasticsearch.client.Validatable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.TimeValue; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/StartDataFrameAnalyticsResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/StartDataFrameAnalyticsResponse.java index e989d4598518d..e29cee1184c64 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/StartDataFrameAnalyticsResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/StartDataFrameAnalyticsResponse.java @@ -8,10 +8,10 @@ package org.elasticsearch.client.ml; import org.elasticsearch.action.support.master.AcknowledgedResponse; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/StartDatafeedRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/StartDatafeedRequest.java index 86571e67fed9f..eddc257f5271b 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/StartDatafeedRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/StartDatafeedRequest.java @@ -9,11 +9,11 @@ import org.elasticsearch.client.Validatable; import org.elasticsearch.client.ml.datafeed.DatafeedConfig; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/StartDatafeedResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/StartDatafeedResponse.java index 47a16a95e0b83..a59efd100ed24 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/StartDatafeedResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/StartDatafeedResponse.java @@ -7,11 +7,11 @@ */ package org.elasticsearch.client.ml; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/StopDataFrameAnalyticsRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/StopDataFrameAnalyticsRequest.java index 8a186e8f5200f..4d3b1939a2d52 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/StopDataFrameAnalyticsRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/StopDataFrameAnalyticsRequest.java @@ -11,7 +11,7 @@ import org.elasticsearch.client.Validatable; import org.elasticsearch.client.ValidationException; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.TimeValue; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/StopDataFrameAnalyticsResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/StopDataFrameAnalyticsResponse.java index 05bbaab41ce7d..66b7cd9d6f3cb 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/StopDataFrameAnalyticsResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/StopDataFrameAnalyticsResponse.java @@ -7,11 +7,11 @@ */ package org.elasticsearch.client.ml; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/StopDatafeedRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/StopDatafeedRequest.java index c7296e8be6cce..d9c9dd4dc42e3 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/StopDatafeedRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/StopDatafeedRequest.java @@ -9,13 +9,13 @@ import org.elasticsearch.client.Validatable; import org.elasticsearch.client.ml.datafeed.DatafeedConfig; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.security.InvalidParameterException; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/StopDatafeedResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/StopDatafeedResponse.java index 4f83096190949..f67c54bb45a65 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/StopDatafeedResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/StopDatafeedResponse.java @@ -7,11 +7,11 @@ */ package org.elasticsearch.client.ml; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/UpdateDataFrameAnalyticsRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/UpdateDataFrameAnalyticsRequest.java index c034a18a7d911..f14d4b75687bd 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/UpdateDataFrameAnalyticsRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/UpdateDataFrameAnalyticsRequest.java @@ -12,8 +12,8 @@ import org.elasticsearch.client.ValidationException; import org.elasticsearch.client.ml.dataframe.DataFrameAnalyticsConfigUpdate; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/UpdateDatafeedRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/UpdateDatafeedRequest.java index 11678739d3d78..d2de264c75411 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/UpdateDatafeedRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/UpdateDatafeedRequest.java @@ -10,8 +10,8 @@ import org.elasticsearch.client.Validatable; import org.elasticsearch.client.ml.datafeed.DatafeedUpdate; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/UpdateFilterRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/UpdateFilterRequest.java index 0aadf67cff615..6bdc73871f557 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/UpdateFilterRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/UpdateFilterRequest.java @@ -9,11 +9,11 @@ import org.elasticsearch.client.Validatable; import org.elasticsearch.client.ml.job.config.MlFilter; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Collection; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/UpdateJobRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/UpdateJobRequest.java index 3da138fcf0842..aa46d5677c77d 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/UpdateJobRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/UpdateJobRequest.java @@ -10,8 +10,8 @@ import org.elasticsearch.client.Validatable; import org.elasticsearch.client.ml.job.config.JobUpdate; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/UpdateModelSnapshotRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/UpdateModelSnapshotRequest.java index cc6b78e2586fd..aaa85c3e2bf82 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/UpdateModelSnapshotRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/UpdateModelSnapshotRequest.java @@ -10,9 +10,9 @@ import org.elasticsearch.client.Validatable; import org.elasticsearch.client.ml.job.config.Job; import org.elasticsearch.client.ml.job.process.ModelSnapshot; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/UpdateModelSnapshotResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/UpdateModelSnapshotResponse.java index d4857834ce1df..e7115008021a0 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/UpdateModelSnapshotResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/UpdateModelSnapshotResponse.java @@ -8,12 +8,12 @@ package org.elasticsearch.client.ml; import org.elasticsearch.client.ml.job.process.ModelSnapshot; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/UpgradeJobModelSnapshotRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/UpgradeJobModelSnapshotRequest.java index 276ec826d583a..240916857f0c3 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/UpgradeJobModelSnapshotRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/UpgradeJobModelSnapshotRequest.java @@ -9,12 +9,12 @@ import org.elasticsearch.client.Validatable; import org.elasticsearch.client.ml.job.config.Job; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/UpgradeJobModelSnapshotResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/UpgradeJobModelSnapshotResponse.java index b47b19191afd6..c23da3b93bdf2 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/UpgradeJobModelSnapshotResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/UpgradeJobModelSnapshotResponse.java @@ -7,11 +7,11 @@ */ package org.elasticsearch.client.ml; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/calendars/Calendar.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/calendars/Calendar.java index 8d79d4686e3d4..006d708d22607 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/calendars/Calendar.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/calendars/Calendar.java @@ -8,10 +8,10 @@ package org.elasticsearch.client.ml.calendars; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Collections; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/calendars/ScheduledEvent.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/calendars/ScheduledEvent.java index 9a06d1529320f..af855eb442642 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/calendars/ScheduledEvent.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/calendars/ScheduledEvent.java @@ -9,11 +9,11 @@ import org.elasticsearch.client.common.TimeUtil; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/datafeed/ChunkingConfig.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/datafeed/ChunkingConfig.java index 4709a7109fafb..869719451e42a 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/datafeed/ChunkingConfig.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/datafeed/ChunkingConfig.java @@ -8,11 +8,11 @@ package org.elasticsearch.client.ml.datafeed; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Locale; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/datafeed/DatafeedConfig.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/datafeed/DatafeedConfig.java index da84c48ab4fd1..8199020ec4592 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/datafeed/DatafeedConfig.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/datafeed/DatafeedConfig.java @@ -9,18 +9,18 @@ import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.client.ml.job.config.Job; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.search.aggregations.AggregatorFactories; import org.elasticsearch.search.builder.SearchSourceBuilder; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/datafeed/DatafeedState.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/datafeed/DatafeedState.java index 2f95c5e011a52..d72b8e98a9430 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/datafeed/DatafeedState.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/datafeed/DatafeedState.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml.datafeed; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import java.util.Locale; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/datafeed/DatafeedStats.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/datafeed/DatafeedStats.java index 81c016d64c2ad..6fdd70f66d9b6 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/datafeed/DatafeedStats.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/datafeed/DatafeedStats.java @@ -9,11 +9,11 @@ import org.elasticsearch.client.ml.NodeAttributes; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Map; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/datafeed/DatafeedTimingStats.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/datafeed/DatafeedTimingStats.java index 901517ca45e15..229d69dfa7875 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/datafeed/DatafeedTimingStats.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/datafeed/DatafeedTimingStats.java @@ -8,18 +8,18 @@ package org.elasticsearch.client.ml.datafeed; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class DatafeedTimingStats implements ToXContentObject { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/datafeed/DatafeedUpdate.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/datafeed/DatafeedUpdate.java index 494b3e57bc81d..b0dc021c375f3 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/datafeed/DatafeedUpdate.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/datafeed/DatafeedUpdate.java @@ -8,18 +8,18 @@ package org.elasticsearch.client.ml.datafeed; import org.elasticsearch.action.support.IndicesOptions; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.search.aggregations.AggregatorFactories; import org.elasticsearch.search.builder.SearchSourceBuilder; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/datafeed/DelayedDataCheckConfig.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/datafeed/DelayedDataCheckConfig.java index e360547d2a296..7193baefd3911 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/datafeed/DelayedDataCheckConfig.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/datafeed/DelayedDataCheckConfig.java @@ -8,11 +8,11 @@ package org.elasticsearch.client.ml.datafeed; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/Classification.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/Classification.java index a074c04b79871..1e7be753bccfd 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/Classification.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/Classification.java @@ -10,11 +10,11 @@ import org.elasticsearch.client.ml.inference.NamedXContentObjectHelper; import org.elasticsearch.client.ml.inference.preprocessing.PreProcessor; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.List; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/DataFrameAnalysis.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/DataFrameAnalysis.java index 94a44a6ab49e6..e7c13da72880a 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/DataFrameAnalysis.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/DataFrameAnalysis.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.ml.dataframe; -import org.elasticsearch.common.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.ToXContentObject; public interface DataFrameAnalysis extends ToXContentObject { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/DataFrameAnalyticsConfig.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/DataFrameAnalyticsConfig.java index d833d05b4188b..5988905d4be6d 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/DataFrameAnalyticsConfig.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/DataFrameAnalyticsConfig.java @@ -11,14 +11,14 @@ import org.elasticsearch.Version; import org.elasticsearch.client.common.TimeUtil; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParserUtils; import org.elasticsearch.search.fetch.subphase.FetchSourceContext; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/DataFrameAnalyticsConfigUpdate.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/DataFrameAnalyticsConfigUpdate.java index d7f51374e4cf3..36696cca92387 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/DataFrameAnalyticsConfigUpdate.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/DataFrameAnalyticsConfigUpdate.java @@ -9,15 +9,15 @@ import org.elasticsearch.core.Nullable; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ObjectParser.ValueType.VALUE; +import static org.elasticsearch.xcontent.ObjectParser.ValueType.VALUE; public class DataFrameAnalyticsConfigUpdate implements ToXContentObject { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/DataFrameAnalyticsDest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/DataFrameAnalyticsDest.java index 2203c56016f9a..d447317caa2d2 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/DataFrameAnalyticsDest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/DataFrameAnalyticsDest.java @@ -9,12 +9,12 @@ package org.elasticsearch.client.ml.dataframe; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/DataFrameAnalyticsSource.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/DataFrameAnalyticsSource.java index 86fe2004c104f..e52399bdc1dcc 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/DataFrameAnalyticsSource.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/DataFrameAnalyticsSource.java @@ -9,12 +9,12 @@ package org.elasticsearch.client.ml.dataframe; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.builder.SearchSourceBuilder; import org.elasticsearch.search.fetch.subphase.FetchSourceContext; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/DataFrameAnalyticsStats.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/DataFrameAnalyticsStats.java index 6b21cbd736b54..58905ae9c8252 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/DataFrameAnalyticsStats.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/DataFrameAnalyticsStats.java @@ -13,18 +13,18 @@ import org.elasticsearch.client.ml.dataframe.stats.common.DataCounts; import org.elasticsearch.client.ml.dataframe.stats.common.MemoryUsage; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.inject.internal.ToStringBuilder; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParserUtils; import java.io.IOException; import java.util.List; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class DataFrameAnalyticsStats { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/MlDataFrameAnalysisNamedXContentProvider.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/MlDataFrameAnalysisNamedXContentProvider.java index 1376f5834b465..a67579da42863 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/MlDataFrameAnalysisNamedXContentProvider.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/MlDataFrameAnalysisNamedXContentProvider.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml.dataframe; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.plugins.spi.NamedXContentProvider; import java.util.Arrays; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/OutlierDetection.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/OutlierDetection.java index 6d8ab69b02b3c..a63662b338b89 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/OutlierDetection.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/OutlierDetection.java @@ -8,11 +8,11 @@ package org.elasticsearch.client.ml.dataframe; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Locale; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/PhaseProgress.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/PhaseProgress.java index 3b107c05016c8..9910cebbff305 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/PhaseProgress.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/PhaseProgress.java @@ -7,11 +7,11 @@ */ package org.elasticsearch.client.ml.dataframe; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.inject.internal.ToStringBuilder; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/QueryConfig.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/QueryConfig.java index fc4f33a8322ec..f07bbe9c5df40 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/QueryConfig.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/QueryConfig.java @@ -9,9 +9,9 @@ package org.elasticsearch.client.ml.dataframe; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.query.AbstractQueryBuilder; import org.elasticsearch.index.query.QueryBuilder; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/Regression.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/Regression.java index 5a17f25d36e5d..652583e8e801b 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/Regression.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/Regression.java @@ -10,18 +10,18 @@ import org.elasticsearch.client.ml.inference.NamedXContentObjectHelper; import org.elasticsearch.client.ml.inference.preprocessing.PreProcessor; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.List; import java.util.Locale; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class Regression implements DataFrameAnalysis { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/Evaluation.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/Evaluation.java index bb6ad799769db..e5f3189a5920f 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/Evaluation.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/Evaluation.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml.dataframe.evaluation; -import org.elasticsearch.common.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.ToXContentObject; /** * Defines an evaluation diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/EvaluationMetric.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/EvaluationMetric.java index 9565c04547a42..daa1051a92b9b 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/EvaluationMetric.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/EvaluationMetric.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml.dataframe.evaluation; -import org.elasticsearch.common.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.ToXContentObject; /** * Defines an evaluation metric diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/MlEvaluationNamedXContentProvider.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/MlEvaluationNamedXContentProvider.java index ec4e09f536b73..1fb2e7920a7e5 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/MlEvaluationNamedXContentProvider.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/MlEvaluationNamedXContentProvider.java @@ -21,8 +21,8 @@ import org.elasticsearch.client.ml.dataframe.evaluation.regression.MeanSquaredLogarithmicErrorMetric; import org.elasticsearch.client.ml.dataframe.evaluation.regression.RSquaredMetric; import org.elasticsearch.client.ml.dataframe.evaluation.regression.Regression; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.plugins.spi.NamedXContentProvider; import java.util.Arrays; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/AccuracyMetric.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/AccuracyMetric.java index a0276837c9260..d2c1babec4032 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/AccuracyMetric.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/AccuracyMetric.java @@ -8,19 +8,19 @@ package org.elasticsearch.client.ml.dataframe.evaluation.classification; import org.elasticsearch.client.ml.dataframe.evaluation.EvaluationMetric; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collections; import java.util.List; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; /** * {@link AccuracyMetric} is a metric that answers the following two questions: diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/AucRocMetric.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/AucRocMetric.java index 42dc677f3d2b2..b850b866415e2 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/AucRocMetric.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/AucRocMetric.java @@ -9,17 +9,17 @@ import org.elasticsearch.client.ml.dataframe.evaluation.EvaluationMetric; import org.elasticsearch.client.ml.dataframe.evaluation.common.AucRocResult; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * Area under the curve (AUC) of the receiver operating characteristic (ROC). diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/Classification.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/Classification.java index 2da5b0efe687e..89ab657493fdd 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/Classification.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/Classification.java @@ -10,10 +10,10 @@ import org.elasticsearch.client.ml.dataframe.evaluation.Evaluation; import org.elasticsearch.client.ml.dataframe.evaluation.EvaluationMetric; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Arrays; @@ -22,8 +22,8 @@ import java.util.Objects; import static org.elasticsearch.client.ml.dataframe.evaluation.MlEvaluationNamedXContentProvider.registeredMetricName; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * Evaluation of classification results. diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/MulticlassConfusionMatrixMetric.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/MulticlassConfusionMatrixMetric.java index 184a3e22199ca..3059ea463142c 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/MulticlassConfusionMatrixMetric.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/MulticlassConfusionMatrixMetric.java @@ -9,19 +9,19 @@ import org.elasticsearch.client.ml.dataframe.evaluation.EvaluationMetric; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collections; import java.util.List; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * Calculates the multiclass confusion matrix. diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/PerClassSingleValue.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/PerClassSingleValue.java index d6f90ff816302..824ef88f92c04 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/PerClassSingleValue.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/PerClassSingleValue.java @@ -7,15 +7,15 @@ */ package org.elasticsearch.client.ml.dataframe.evaluation.classification; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; public class PerClassSingleValue implements ToXContentObject { private static final ParseField CLASS_NAME = new ParseField("class_name"); diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/PrecisionMetric.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/PrecisionMetric.java index d4b416b0c89d1..9720a15c3863b 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/PrecisionMetric.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/PrecisionMetric.java @@ -8,18 +8,18 @@ package org.elasticsearch.client.ml.dataframe.evaluation.classification; import org.elasticsearch.client.ml.dataframe.evaluation.EvaluationMetric; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collections; import java.util.List; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; /** * {@link PrecisionMetric} is a metric that answers the question: diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/RecallMetric.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/RecallMetric.java index 509a9f8c6fcc9..81ca09ca245e9 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/RecallMetric.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/RecallMetric.java @@ -8,18 +8,18 @@ package org.elasticsearch.client.ml.dataframe.evaluation.classification; import org.elasticsearch.client.ml.dataframe.evaluation.EvaluationMetric; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collections; import java.util.List; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; /** * {@link RecallMetric} is a metric that answers the question: diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/common/AucRocPoint.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/common/AucRocPoint.java index 994154a285696..b63eb40be7329 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/common/AucRocPoint.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/common/AucRocPoint.java @@ -7,17 +7,17 @@ */ package org.elasticsearch.client.ml.dataframe.evaluation.common; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; public class AucRocPoint implements ToXContentObject { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/common/AucRocResult.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/common/AucRocResult.java index 456073f96504b..d3f06fd98c38f 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/common/AucRocResult.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/common/AucRocResult.java @@ -9,20 +9,20 @@ import org.elasticsearch.client.ml.dataframe.evaluation.EvaluationMetric; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collections; import java.util.List; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class AucRocResult implements EvaluationMetric.Result { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/outlierdetection/AbstractConfusionMatrixMetric.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/outlierdetection/AbstractConfusionMatrixMetric.java index 6642c5dca607a..e151f7bc6badb 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/outlierdetection/AbstractConfusionMatrixMetric.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/outlierdetection/AbstractConfusionMatrixMetric.java @@ -8,9 +8,9 @@ package org.elasticsearch.client.ml.dataframe.evaluation.outlierdetection; import org.elasticsearch.client.ml.dataframe.evaluation.EvaluationMetric; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.List; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/outlierdetection/AucRocMetric.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/outlierdetection/AucRocMetric.java index 40d1d59455452..71f4f8808774c 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/outlierdetection/AucRocMetric.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/outlierdetection/AucRocMetric.java @@ -9,15 +9,15 @@ import org.elasticsearch.client.ml.dataframe.evaluation.EvaluationMetric; import org.elasticsearch.client.ml.dataframe.evaluation.common.AucRocResult; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * Area under the curve (AUC) of the receiver operating characteristic (ROC). diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/outlierdetection/ConfusionMatrixMetric.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/outlierdetection/ConfusionMatrixMetric.java index 031b3bc665c6d..26d749602e5f6 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/outlierdetection/ConfusionMatrixMetric.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/outlierdetection/ConfusionMatrixMetric.java @@ -8,13 +8,13 @@ package org.elasticsearch.client.ml.dataframe.evaluation.outlierdetection; import org.elasticsearch.client.ml.dataframe.evaluation.EvaluationMetric; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Arrays; @@ -23,7 +23,7 @@ import java.util.Map; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; public class ConfusionMatrixMetric extends AbstractConfusionMatrixMetric { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/outlierdetection/OutlierDetection.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/outlierdetection/OutlierDetection.java index edb65bf3acde8..bb62dee96a791 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/outlierdetection/OutlierDetection.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/outlierdetection/OutlierDetection.java @@ -10,11 +10,11 @@ import org.elasticsearch.client.ml.dataframe.evaluation.Evaluation; import org.elasticsearch.client.ml.dataframe.evaluation.EvaluationMetric; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Arrays; @@ -23,8 +23,8 @@ import java.util.Objects; import static org.elasticsearch.client.ml.dataframe.evaluation.MlEvaluationNamedXContentProvider.registeredMetricName; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * Evaluation of outlier detection results. diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/outlierdetection/PrecisionMetric.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/outlierdetection/PrecisionMetric.java index 0c6ff07e85462..601ea0f7f44a0 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/outlierdetection/PrecisionMetric.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/outlierdetection/PrecisionMetric.java @@ -9,10 +9,10 @@ import org.elasticsearch.client.ml.dataframe.evaluation.EvaluationMetric; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Arrays; @@ -21,7 +21,7 @@ import java.util.Map; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; public class PrecisionMetric extends AbstractConfusionMatrixMetric { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/outlierdetection/RecallMetric.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/outlierdetection/RecallMetric.java index 9818165d33657..95080bd54cb6e 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/outlierdetection/RecallMetric.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/outlierdetection/RecallMetric.java @@ -9,10 +9,10 @@ import org.elasticsearch.client.ml.dataframe.evaluation.EvaluationMetric; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Arrays; @@ -21,7 +21,7 @@ import java.util.Map; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; public class RecallMetric extends AbstractConfusionMatrixMetric { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/regression/HuberMetric.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/regression/HuberMetric.java index 650e922b9842c..1e23b4d39b540 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/regression/HuberMetric.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/regression/HuberMetric.java @@ -10,16 +10,16 @@ import org.elasticsearch.client.ml.dataframe.Regression.LossFunction; import org.elasticsearch.client.ml.dataframe.evaluation.EvaluationMetric; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * Calculates the pseudo Huber loss function. diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/regression/MeanSquaredErrorMetric.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/regression/MeanSquaredErrorMetric.java index bc6840a1264c0..b590473126789 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/regression/MeanSquaredErrorMetric.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/regression/MeanSquaredErrorMetric.java @@ -9,16 +9,16 @@ import org.elasticsearch.client.ml.dataframe.Regression.LossFunction; import org.elasticsearch.client.ml.dataframe.evaluation.EvaluationMetric; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; /** * Calculates the mean squared error between two known numerical fields. diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/regression/MeanSquaredLogarithmicErrorMetric.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/regression/MeanSquaredLogarithmicErrorMetric.java index 9209fb5e9d91e..51a3424d1eff3 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/regression/MeanSquaredLogarithmicErrorMetric.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/regression/MeanSquaredLogarithmicErrorMetric.java @@ -10,16 +10,16 @@ import org.elasticsearch.client.ml.dataframe.Regression.LossFunction; import org.elasticsearch.client.ml.dataframe.evaluation.EvaluationMetric; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * Calculates the mean squared error between two known numerical fields. diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/regression/RSquaredMetric.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/regression/RSquaredMetric.java index 70acc8b3d5861..ccf877405c1fc 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/regression/RSquaredMetric.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/regression/RSquaredMetric.java @@ -8,16 +8,16 @@ package org.elasticsearch.client.ml.dataframe.evaluation.regression; import org.elasticsearch.client.ml.dataframe.evaluation.EvaluationMetric; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; /** * Calculates R-Squared between two known numerical fields. diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/regression/Regression.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/regression/Regression.java index c7c8d7aab876b..79bfbca24d5cc 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/regression/Regression.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/evaluation/regression/Regression.java @@ -10,11 +10,11 @@ import org.elasticsearch.client.ml.dataframe.evaluation.Evaluation; import org.elasticsearch.client.ml.dataframe.evaluation.EvaluationMetric; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Arrays; @@ -23,8 +23,8 @@ import java.util.Objects; import static org.elasticsearch.client.ml.dataframe.evaluation.MlEvaluationNamedXContentProvider.registeredMetricName; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * Evaluation of regression results. diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/explain/FieldSelection.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/explain/FieldSelection.java index 0085f6a6ca69f..ebc68e5283767 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/explain/FieldSelection.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/explain/FieldSelection.java @@ -8,10 +8,10 @@ package org.elasticsearch.client.ml.dataframe.explain; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Collections; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/explain/MemoryEstimation.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/explain/MemoryEstimation.java index b70a714f37777..71bdf4df321ef 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/explain/MemoryEstimation.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/explain/MemoryEstimation.java @@ -8,17 +8,17 @@ package org.elasticsearch.client.ml.dataframe.explain; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class MemoryEstimation implements ToXContentObject { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/AnalysisStats.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/AnalysisStats.java index 4f672239fe3bb..dcd21d6f6b3e1 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/AnalysisStats.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/AnalysisStats.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml.dataframe.stats; -import org.elasticsearch.common.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.ToXContentObject; /** * Statistics for the data frame analysis diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/AnalysisStatsNamedXContentProvider.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/AnalysisStatsNamedXContentProvider.java index 31b33d7e242bc..e8cd65b65a7a7 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/AnalysisStatsNamedXContentProvider.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/AnalysisStatsNamedXContentProvider.java @@ -10,7 +10,7 @@ import org.elasticsearch.client.ml.dataframe.stats.classification.ClassificationStats; import org.elasticsearch.client.ml.dataframe.stats.outlierdetection.OutlierDetectionStats; import org.elasticsearch.client.ml.dataframe.stats.regression.RegressionStats; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.plugins.spi.NamedXContentProvider; import java.util.Arrays; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/classification/ClassificationStats.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/classification/ClassificationStats.java index 55217a5a219b1..27b397a81858c 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/classification/ClassificationStats.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/classification/ClassificationStats.java @@ -9,11 +9,11 @@ import org.elasticsearch.client.common.TimeUtil; import org.elasticsearch.client.ml.dataframe.stats.AnalysisStats; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.time.Instant; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/classification/Hyperparameters.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/classification/Hyperparameters.java index 5e664ff8e45f9..ac30cf4e20017 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/classification/Hyperparameters.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/classification/Hyperparameters.java @@ -7,15 +7,15 @@ */ package org.elasticsearch.client.ml.dataframe.stats.classification; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class Hyperparameters implements ToXContentObject { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/classification/TimingStats.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/classification/TimingStats.java index 1fdee625e7a90..7dc2833b2b87f 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/classification/TimingStats.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/classification/TimingStats.java @@ -7,11 +7,11 @@ */ package org.elasticsearch.client.ml.dataframe.stats.classification; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/classification/ValidationLoss.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/classification/ValidationLoss.java index 981cb468eb0ae..21d42e37a8ca8 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/classification/ValidationLoss.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/classification/ValidationLoss.java @@ -8,10 +8,10 @@ package org.elasticsearch.client.ml.dataframe.stats.classification; import org.elasticsearch.client.ml.dataframe.stats.common.FoldValues; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.List; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/common/DataCounts.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/common/DataCounts.java index 8095ac801b480..638427a9500f3 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/common/DataCounts.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/common/DataCounts.java @@ -9,16 +9,16 @@ package org.elasticsearch.client.ml.dataframe.stats.common; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.inject.internal.ToStringBuilder; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class DataCounts implements ToXContentObject { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/common/FoldValues.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/common/FoldValues.java index 73418c78ae404..959d94c0306a8 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/common/FoldValues.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/common/FoldValues.java @@ -7,10 +7,10 @@ */ package org.elasticsearch.client.ml.dataframe.stats.common; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Arrays; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/common/MemoryUsage.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/common/MemoryUsage.java index 953c8d7e6de7b..cdc435283af62 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/common/MemoryUsage.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/common/MemoryUsage.java @@ -9,12 +9,12 @@ import org.elasticsearch.client.common.TimeUtil; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.inject.internal.ToStringBuilder; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.time.Instant; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/outlierdetection/OutlierDetectionStats.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/outlierdetection/OutlierDetectionStats.java index babed09fc8dc5..221d038c28069 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/outlierdetection/OutlierDetectionStats.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/outlierdetection/OutlierDetectionStats.java @@ -9,11 +9,11 @@ import org.elasticsearch.client.common.TimeUtil; import org.elasticsearch.client.ml.dataframe.stats.AnalysisStats; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.time.Instant; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/outlierdetection/Parameters.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/outlierdetection/Parameters.java index 4eff97a11eb13..ea2768621030a 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/outlierdetection/Parameters.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/outlierdetection/Parameters.java @@ -7,15 +7,15 @@ */ package org.elasticsearch.client.ml.dataframe.stats.outlierdetection; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class Parameters implements ToXContentObject { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/outlierdetection/TimingStats.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/outlierdetection/TimingStats.java index 79c8fcd4af717..11c07b23fbc00 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/outlierdetection/TimingStats.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/outlierdetection/TimingStats.java @@ -7,11 +7,11 @@ */ package org.elasticsearch.client.ml.dataframe.stats.outlierdetection; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/regression/Hyperparameters.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/regression/Hyperparameters.java index 457161b737545..d28922d6a4442 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/regression/Hyperparameters.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/regression/Hyperparameters.java @@ -7,15 +7,15 @@ */ package org.elasticsearch.client.ml.dataframe.stats.regression; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class Hyperparameters implements ToXContentObject { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/regression/RegressionStats.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/regression/RegressionStats.java index a2e63313e48d4..c8049fa966212 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/regression/RegressionStats.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/regression/RegressionStats.java @@ -9,11 +9,11 @@ import org.elasticsearch.client.common.TimeUtil; import org.elasticsearch.client.ml.dataframe.stats.AnalysisStats; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.time.Instant; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/regression/TimingStats.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/regression/TimingStats.java index 15950dc1c2f05..61d016afd3b93 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/regression/TimingStats.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/regression/TimingStats.java @@ -7,11 +7,11 @@ */ package org.elasticsearch.client.ml.dataframe.stats.regression; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/regression/ValidationLoss.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/regression/ValidationLoss.java index 977372d757279..b6d52a23f102f 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/regression/ValidationLoss.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/stats/regression/ValidationLoss.java @@ -8,10 +8,10 @@ package org.elasticsearch.client.ml.dataframe.stats.regression; import org.elasticsearch.client.ml.dataframe.stats.common.FoldValues; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.List; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/InferenceToXContentCompressor.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/InferenceToXContentCompressor.java index ff96bef078e7d..0cfcdbe2579ad 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/InferenceToXContentCompressor.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/InferenceToXContentCompressor.java @@ -13,12 +13,12 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.Streams; import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContentObject; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.io.InputStream; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/MlInferenceNamedXContentProvider.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/MlInferenceNamedXContentProvider.java index e6389dad1e886..1ad49046d5e70 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/MlInferenceNamedXContentProvider.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/MlInferenceNamedXContentProvider.java @@ -28,8 +28,8 @@ import org.elasticsearch.client.ml.inference.preprocessing.OneHotEncoding; import org.elasticsearch.client.ml.inference.preprocessing.PreProcessor; import org.elasticsearch.client.ml.inference.preprocessing.TargetMeanEncoding; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.plugins.spi.NamedXContentProvider; import java.util.ArrayList; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/NamedXContentObject.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/NamedXContentObject.java index d45ebac103662..1a6eb8afdac24 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/NamedXContentObject.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/NamedXContentObject.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml.inference; -import org.elasticsearch.common.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.ToXContentObject; /** * Simple interface for XContent Objects that are named. diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/NamedXContentObjectHelper.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/NamedXContentObjectHelper.java index b44e91ceeccf4..6c8a69a4aacd8 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/NamedXContentObjectHelper.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/NamedXContentObjectHelper.java @@ -7,8 +7,8 @@ */ package org.elasticsearch.client.ml.inference; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.List; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/TrainedModelConfig.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/TrainedModelConfig.java index 8c4d24789385a..c245c91acf704 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/TrainedModelConfig.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/TrainedModelConfig.java @@ -12,13 +12,13 @@ import org.elasticsearch.client.ml.inference.trainedmodel.InferenceConfig; import org.elasticsearch.client.ml.inference.trainedmodel.TrainedModelLocation; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.time.Instant; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/TrainedModelDefinition.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/TrainedModelDefinition.java index e28095037236b..d6f30fa7c22ad 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/TrainedModelDefinition.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/TrainedModelDefinition.java @@ -9,12 +9,12 @@ import org.elasticsearch.client.ml.inference.preprocessing.PreProcessor; import org.elasticsearch.client.ml.inference.trainedmodel.TrainedModel; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collections; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/TrainedModelInput.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/TrainedModelInput.java index 4341c0ad87745..95601e0ce0b59 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/TrainedModelInput.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/TrainedModelInput.java @@ -7,11 +7,11 @@ */ package org.elasticsearch.client.ml.inference; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Arrays; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/TrainedModelStats.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/TrainedModelStats.java index 09b5bbfd61e5b..0b5f5945ca451 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/TrainedModelStats.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/TrainedModelStats.java @@ -9,19 +9,19 @@ import org.elasticsearch.client.ml.inference.trainedmodel.InferenceStats; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.ingest.IngestStats; import java.io.IOException; import java.util.Map; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class TrainedModelStats implements ToXContentObject { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/preprocessing/CustomWordEmbedding.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/preprocessing/CustomWordEmbedding.java index 692c9167c5e40..6b9d8a6c3414b 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/preprocessing/CustomWordEmbedding.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/preprocessing/CustomWordEmbedding.java @@ -8,12 +8,12 @@ package org.elasticsearch.client.ml.inference.preprocessing; import org.elasticsearch.core.CheckedFunction; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/preprocessing/FrequencyEncoding.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/preprocessing/FrequencyEncoding.java index 5dca2124d43e9..3092c5d70d060 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/preprocessing/FrequencyEncoding.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/preprocessing/FrequencyEncoding.java @@ -7,11 +7,11 @@ */ package org.elasticsearch.client.ml.inference.preprocessing; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collections; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/preprocessing/Multi.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/preprocessing/Multi.java index 55648dbc19b69..965f2b94d5ac6 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/preprocessing/Multi.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/preprocessing/Multi.java @@ -14,11 +14,11 @@ import java.util.Objects; import org.elasticsearch.client.ml.inference.NamedXContentObjectHelper; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; /** * Multi-PreProcessor for chaining together multiple processors diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/preprocessing/NGram.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/preprocessing/NGram.java index 8304c0a37cf4c..574787f5720dc 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/preprocessing/NGram.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/preprocessing/NGram.java @@ -7,10 +7,10 @@ */ package org.elasticsearch.client.ml.inference.preprocessing; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/preprocessing/OneHotEncoding.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/preprocessing/OneHotEncoding.java index ecb12197a7aeb..84c83c50e9323 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/preprocessing/OneHotEncoding.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/preprocessing/OneHotEncoding.java @@ -7,11 +7,11 @@ */ package org.elasticsearch.client.ml.inference.preprocessing; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collections; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/preprocessing/TargetMeanEncoding.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/preprocessing/TargetMeanEncoding.java index 39d0f3ec8aed0..b51bfe2bdb521 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/preprocessing/TargetMeanEncoding.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/preprocessing/TargetMeanEncoding.java @@ -7,11 +7,11 @@ */ package org.elasticsearch.client.ml.inference.preprocessing; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collections; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/results/FeatureImportance.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/results/FeatureImportance.java index ad2c085aaf12c..cfeccf6399675 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/results/FeatureImportance.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/results/FeatureImportance.java @@ -8,21 +8,21 @@ package org.elasticsearch.client.ml.inference.results; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collections; import java.util.List; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class FeatureImportance implements ToXContentObject { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/results/TopClassEntry.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/results/TopClassEntry.java index 27765c1458cb4..2cff338a91c36 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/results/TopClassEntry.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/results/TopClassEntry.java @@ -8,19 +8,19 @@ package org.elasticsearch.client.ml.inference.results; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; public class TopClassEntry implements ToXContentObject { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/trainedmodel/ClassificationConfig.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/trainedmodel/ClassificationConfig.java index 401b4a3c25bd4..b8d31d3c3cdd8 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/trainedmodel/ClassificationConfig.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/trainedmodel/ClassificationConfig.java @@ -7,16 +7,16 @@ */ package org.elasticsearch.client.ml.inference.trainedmodel; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class ClassificationConfig implements InferenceConfig { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/trainedmodel/IndexLocation.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/trainedmodel/IndexLocation.java index 4be63fd9aa676..6704f4200bb0b 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/trainedmodel/IndexLocation.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/trainedmodel/IndexLocation.java @@ -8,10 +8,10 @@ package org.elasticsearch.client.ml.inference.trainedmodel; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/trainedmodel/InferenceStats.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/trainedmodel/InferenceStats.java index c78573e8598b5..094790718365f 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/trainedmodel/InferenceStats.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/trainedmodel/InferenceStats.java @@ -10,11 +10,11 @@ import org.elasticsearch.client.common.TimeUtil; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.time.Instant; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/trainedmodel/RegressionConfig.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/trainedmodel/RegressionConfig.java index bc49218487eba..1f3134bfc9785 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/trainedmodel/RegressionConfig.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/trainedmodel/RegressionConfig.java @@ -7,16 +7,16 @@ */ package org.elasticsearch.client.ml.inference.trainedmodel; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class RegressionConfig implements InferenceConfig { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/trainedmodel/TargetType.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/trainedmodel/TargetType.java index de2bae895423a..a3af7039e29d2 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/trainedmodel/TargetType.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/trainedmodel/TargetType.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml.inference.trainedmodel; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import java.util.Locale; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/trainedmodel/ensemble/Ensemble.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/trainedmodel/ensemble/Ensemble.java index 173b605bdcf84..79d8e2b66c7b5 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/trainedmodel/ensemble/Ensemble.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/trainedmodel/ensemble/Ensemble.java @@ -11,11 +11,11 @@ import org.elasticsearch.client.ml.inference.trainedmodel.TargetType; import org.elasticsearch.client.ml.inference.trainedmodel.TrainedModel; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Arrays; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/trainedmodel/ensemble/Exponent.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/trainedmodel/ensemble/Exponent.java index 283c80736de10..8b2bda648d2c4 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/trainedmodel/ensemble/Exponent.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/trainedmodel/ensemble/Exponent.java @@ -8,10 +8,10 @@ package org.elasticsearch.client.ml.inference.trainedmodel.ensemble; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.List; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/trainedmodel/ensemble/LogisticRegression.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/trainedmodel/ensemble/LogisticRegression.java index 5dc0a96c4ee2b..f4114c1de1df9 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/trainedmodel/ensemble/LogisticRegression.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/trainedmodel/ensemble/LogisticRegression.java @@ -8,10 +8,10 @@ package org.elasticsearch.client.ml.inference.trainedmodel.ensemble; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.List; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/trainedmodel/ensemble/WeightedMode.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/trainedmodel/ensemble/WeightedMode.java index 28f475c5816a9..c35a3de87cde3 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/trainedmodel/ensemble/WeightedMode.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/trainedmodel/ensemble/WeightedMode.java @@ -8,11 +8,11 @@ package org.elasticsearch.client.ml.inference.trainedmodel.ensemble; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.List; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/trainedmodel/ensemble/WeightedSum.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/trainedmodel/ensemble/WeightedSum.java index c15f12100a41e..ef106a3cd2195 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/trainedmodel/ensemble/WeightedSum.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/trainedmodel/ensemble/WeightedSum.java @@ -8,11 +8,11 @@ package org.elasticsearch.client.ml.inference.trainedmodel.ensemble; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.List; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/trainedmodel/langident/LangIdentNeuralNetwork.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/trainedmodel/langident/LangIdentNeuralNetwork.java index bebc4b9eb1e88..9f251ccf4db0c 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/trainedmodel/langident/LangIdentNeuralNetwork.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/trainedmodel/langident/LangIdentNeuralNetwork.java @@ -8,18 +8,18 @@ package org.elasticsearch.client.ml.inference.trainedmodel.langident; import org.elasticsearch.client.ml.inference.trainedmodel.TrainedModel; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collections; import java.util.List; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; /** * Shallow, fully connected, feed forward NN modeled after and ported from https://github.com/google/cld3 diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/trainedmodel/langident/LangNetLayer.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/trainedmodel/langident/LangNetLayer.java index d0b63171779db..c982c701e7b31 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/trainedmodel/langident/LangNetLayer.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/trainedmodel/langident/LangNetLayer.java @@ -7,17 +7,17 @@ */ package org.elasticsearch.client.ml.inference.trainedmodel.langident; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Arrays; import java.util.List; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; /** * Represents a single layer in the compressed Lang Net diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/trainedmodel/tree/Tree.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/trainedmodel/tree/Tree.java index 0a24c50102ad7..dabc8e3eba287 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/trainedmodel/tree/Tree.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/trainedmodel/tree/Tree.java @@ -10,11 +10,11 @@ import org.elasticsearch.client.ml.inference.trainedmodel.TargetType; import org.elasticsearch.client.ml.inference.trainedmodel.TrainedModel; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/trainedmodel/tree/TreeNode.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/trainedmodel/tree/TreeNode.java index 7b0007d2b25e9..5ad43e9a4283c 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/trainedmodel/tree/TreeNode.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/inference/trainedmodel/tree/TreeNode.java @@ -8,12 +8,12 @@ package org.elasticsearch.client.ml.inference.trainedmodel.tree; import org.elasticsearch.client.ml.job.config.Operator; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.List; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/config/AnalysisConfig.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/config/AnalysisConfig.java index 4d57094341f55..52e2e35f14910 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/config/AnalysisConfig.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/config/AnalysisConfig.java @@ -7,12 +7,12 @@ */ package org.elasticsearch.client.ml.job.config; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.ArrayList; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/config/AnalysisLimits.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/config/AnalysisLimits.java index 0f6357d91f573..27268f537a60b 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/config/AnalysisLimits.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/config/AnalysisLimits.java @@ -8,13 +8,13 @@ package org.elasticsearch.client.ml.job.config; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/config/CategorizationAnalyzerConfig.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/config/CategorizationAnalyzerConfig.java index e4b4672a0a000..a0cea26b7e338 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/config/CategorizationAnalyzerConfig.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/config/CategorizationAnalyzerConfig.java @@ -8,11 +8,11 @@ package org.elasticsearch.client.ml.job.config; import org.elasticsearch.action.admin.indices.analyze.AnalyzeAction; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.rest.action.admin.indices.RestAnalyzeAction; import java.io.IOException; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/config/DataDescription.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/config/DataDescription.java index 823d989aa4c16..c209241b2d071 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/config/DataDescription.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/config/DataDescription.java @@ -7,10 +7,10 @@ */ package org.elasticsearch.client.ml.job.config; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Locale; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/config/DetectionRule.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/config/DetectionRule.java index 6ae075946fbb9..8cf32dbcd97e2 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/config/DetectionRule.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/config/DetectionRule.java @@ -7,10 +7,10 @@ */ package org.elasticsearch.client.ml.job.config; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Arrays; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/config/Detector.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/config/Detector.java index 8be7de00d8a65..a187ae32e431a 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/config/Detector.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/config/Detector.java @@ -7,10 +7,10 @@ */ package org.elasticsearch.client.ml.job.config; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.ArrayList; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/config/FilterRef.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/config/FilterRef.java index d962d7d8a49f0..c8880fcdf6659 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/config/FilterRef.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/config/FilterRef.java @@ -7,10 +7,10 @@ */ package org.elasticsearch.client.ml.job.config; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Locale; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/config/Job.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/config/Job.java index f8d7b98a46bad..9515c6272dca2 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/config/Job.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/config/Job.java @@ -8,13 +8,13 @@ package org.elasticsearch.client.ml.job.config; import org.elasticsearch.client.common.TimeUtil; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.ArrayList; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/config/JobUpdate.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/config/JobUpdate.java index 0d3152d72885f..150a5a763c424 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/config/JobUpdate.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/config/JobUpdate.java @@ -8,12 +8,12 @@ package org.elasticsearch.client.ml.job.config; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.List; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/config/MlFilter.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/config/MlFilter.java index d8c86148e9884..0e85464fbbe1b 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/config/MlFilter.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/config/MlFilter.java @@ -8,10 +8,10 @@ package org.elasticsearch.client.ml.job.config; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Arrays; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/config/ModelPlotConfig.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/config/ModelPlotConfig.java index 76565c74dd791..5d6de1b389606 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/config/ModelPlotConfig.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/config/ModelPlotConfig.java @@ -7,10 +7,10 @@ */ package org.elasticsearch.client.ml.job.config; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/config/Operator.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/config/Operator.java index ddcbf2aa40e15..3d7ac2af70a66 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/config/Operator.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/config/Operator.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml.job.config; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import java.util.Locale; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/config/PerPartitionCategorizationConfig.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/config/PerPartitionCategorizationConfig.java index 6982d3ac62108..27f7dfb2d8134 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/config/PerPartitionCategorizationConfig.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/config/PerPartitionCategorizationConfig.java @@ -8,11 +8,11 @@ package org.elasticsearch.client.ml.job.config; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/config/RuleCondition.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/config/RuleCondition.java index 1c98b101033d5..ac68bc388d98b 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/config/RuleCondition.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/config/RuleCondition.java @@ -7,10 +7,10 @@ */ package org.elasticsearch.client.ml.job.config; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Locale; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/config/RuleScope.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/config/RuleScope.java index bebf02b6ae585..d8f812276ed3c 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/config/RuleScope.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/config/RuleScope.java @@ -8,13 +8,13 @@ package org.elasticsearch.client.ml.job.config; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ContextParser; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ContextParser; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collections; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/process/DataCounts.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/process/DataCounts.java index 3fd0abf80343a..61c185f6a6351 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/process/DataCounts.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/process/DataCounts.java @@ -9,11 +9,11 @@ import org.elasticsearch.client.common.TimeUtil; import org.elasticsearch.client.ml.job.config.Job; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.time.Instant; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/process/ModelSizeStats.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/process/ModelSizeStats.java index 1e52d8d9d67c3..b8cbac253d0ac 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/process/ModelSizeStats.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/process/ModelSizeStats.java @@ -11,11 +11,11 @@ import org.elasticsearch.client.ml.job.config.Job; import org.elasticsearch.client.ml.job.results.Result; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Date; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/process/ModelSnapshot.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/process/ModelSnapshot.java index 0f25e06fc9cb5..23ec2c753d09d 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/process/ModelSnapshot.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/process/ModelSnapshot.java @@ -10,11 +10,11 @@ import org.elasticsearch.Version; import org.elasticsearch.client.common.TimeUtil; import org.elasticsearch.client.ml.job.config.Job; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Date; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/process/Quantiles.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/process/Quantiles.java index 027349bbb2a89..fa818653076f2 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/process/Quantiles.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/process/Quantiles.java @@ -8,11 +8,11 @@ package org.elasticsearch.client.ml.job.process; import org.elasticsearch.client.ml.job.config.Job; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Date; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/process/TimingStats.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/process/TimingStats.java index e33411368328f..2f45aeadb4db0 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/process/TimingStats.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/process/TimingStats.java @@ -9,18 +9,18 @@ import org.elasticsearch.client.ml.job.config.Job; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * Stats that give more insight into timing of various operations performed as part of anomaly detection job. diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/results/AnomalyCause.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/results/AnomalyCause.java index b86f11a124997..e10bff962bd99 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/results/AnomalyCause.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/results/AnomalyCause.java @@ -9,11 +9,11 @@ import org.elasticsearch.client.ml.job.config.DetectorFunction; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.geo.GeoPoint; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Collections; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/results/AnomalyRecord.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/results/AnomalyRecord.java index 4bb1203684107..145aa00a4e2e0 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/results/AnomalyRecord.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/results/AnomalyRecord.java @@ -11,12 +11,12 @@ import org.elasticsearch.client.ml.job.config.DetectorFunction; import org.elasticsearch.client.ml.job.config.Job; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.geo.GeoPoint; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Collections; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/results/Bucket.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/results/Bucket.java index 6f857bbbdf21b..950a97f62a280 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/results/Bucket.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/results/Bucket.java @@ -9,11 +9,11 @@ import org.elasticsearch.client.common.TimeUtil; import org.elasticsearch.client.ml.job.config.Job; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.ArrayList; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/results/BucketInfluencer.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/results/BucketInfluencer.java index 7a391209ff9c4..a0862e2019385 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/results/BucketInfluencer.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/results/BucketInfluencer.java @@ -9,11 +9,11 @@ import org.elasticsearch.client.common.TimeUtil; import org.elasticsearch.client.ml.job.config.Job; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Date; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/results/CategoryDefinition.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/results/CategoryDefinition.java index e1bac3f1f58e0..6de5206c331aa 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/results/CategoryDefinition.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/results/CategoryDefinition.java @@ -8,10 +8,10 @@ package org.elasticsearch.client.ml.job.results; import org.elasticsearch.client.ml.job.config.Job; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.ArrayList; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/results/Influence.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/results/Influence.java index 444ef10aa2be9..2021ed8aefeb7 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/results/Influence.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/results/Influence.java @@ -7,10 +7,10 @@ */ package org.elasticsearch.client.ml.job.results; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Collections; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/results/Influencer.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/results/Influencer.java index a794c6126de78..bab4e83e66091 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/results/Influencer.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/results/Influencer.java @@ -9,11 +9,11 @@ import org.elasticsearch.client.common.TimeUtil; import org.elasticsearch.client.ml.job.config.Job; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Date; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/results/OverallBucket.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/results/OverallBucket.java index 3113e47f4ce93..253f8d7256030 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/results/OverallBucket.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/results/OverallBucket.java @@ -9,11 +9,11 @@ import org.elasticsearch.client.common.TimeUtil; import org.elasticsearch.client.ml.job.config.Job; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Collections; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/results/Result.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/results/Result.java index a0267a742e785..91b675fd4e190 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/results/Result.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/results/Result.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml.job.results; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; /** * Contains common attributes for results. diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/stats/ForecastStats.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/stats/ForecastStats.java index d977dd28148cc..ed98162fd5ab2 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/stats/ForecastStats.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/stats/ForecastStats.java @@ -7,11 +7,11 @@ */ package org.elasticsearch.client.ml.job.stats; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Collections; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/stats/JobStats.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/stats/JobStats.java index 1f0040dc80a34..60cb0cce15fe9 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/stats/JobStats.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/stats/JobStats.java @@ -13,12 +13,12 @@ import org.elasticsearch.client.ml.job.process.ModelSizeStats; import org.elasticsearch.client.ml.job.process.TimingStats; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.client.ml.NodeAttributes; import java.io.IOException; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/stats/SimpleStats.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/stats/SimpleStats.java index 2351bc4431d08..c984a9d77c394 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/stats/SimpleStats.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/stats/SimpleStats.java @@ -7,10 +7,10 @@ */ package org.elasticsearch.client.ml.job.stats; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/rollup/GetRollupCapsResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/rollup/GetRollupCapsResponse.java index 13cbd341b4568..a4f501307674b 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/rollup/GetRollupCapsResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/rollup/GetRollupCapsResponse.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.rollup; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collections; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/rollup/GetRollupIndexCapsResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/rollup/GetRollupIndexCapsResponse.java index 54b4212750dba..8dc64add9ac7a 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/rollup/GetRollupIndexCapsResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/rollup/GetRollupIndexCapsResponse.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.rollup; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collections; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/rollup/GetRollupJobResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/rollup/GetRollupJobResponse.java index 318807546473a..f0af42854120a 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/rollup/GetRollupJobResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/rollup/GetRollupJobResponse.java @@ -11,10 +11,10 @@ import org.elasticsearch.client.core.IndexerJobStats; import org.elasticsearch.client.core.IndexerState; import org.elasticsearch.client.rollup.job.config.RollupJobConfig; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.List; @@ -23,8 +23,8 @@ import static java.util.Collections.unmodifiableList; import static java.util.stream.Collectors.joining; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * Response from rollup's get jobs api. diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/rollup/PutRollupJobRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/rollup/PutRollupJobRequest.java index cd74b0c06c77a..130b226e66c95 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/rollup/PutRollupJobRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/rollup/PutRollupJobRequest.java @@ -10,8 +10,8 @@ import org.elasticsearch.client.Validatable; import org.elasticsearch.client.ValidationException; import org.elasticsearch.client.rollup.job.config.RollupJobConfig; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/rollup/RollableIndexCaps.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/rollup/RollableIndexCaps.java index 9d4e9588fcaf5..13c44b023f20b 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/rollup/RollableIndexCaps.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/rollup/RollableIndexCaps.java @@ -7,10 +7,10 @@ */ package org.elasticsearch.client.rollup; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Collections; @@ -19,7 +19,7 @@ import java.util.Objects; import java.util.stream.Collectors; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; /** * Represents the rollup capabilities of a non-rollup index. E.g. what values/aggregations diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/rollup/RollupJobCaps.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/rollup/RollupJobCaps.java index 63b604313e8d3..5d8957558556b 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/rollup/RollupJobCaps.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/rollup/RollupJobCaps.java @@ -7,13 +7,13 @@ */ package org.elasticsearch.client.rollup; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.Tuple; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/rollup/StartRollupJobResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/rollup/StartRollupJobResponse.java index 223752de25e47..a9f2d618f16fd 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/rollup/StartRollupJobResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/rollup/StartRollupJobResponse.java @@ -9,8 +9,8 @@ package org.elasticsearch.client.rollup; import org.elasticsearch.client.core.AcknowledgedResponse; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/rollup/StopRollupJobResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/rollup/StopRollupJobResponse.java index 4307d8d5f6b18..2134b7b989bd0 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/rollup/StopRollupJobResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/rollup/StopRollupJobResponse.java @@ -9,8 +9,8 @@ package org.elasticsearch.client.rollup; import org.elasticsearch.client.core.AcknowledgedResponse; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/rollup/job/config/DateHistogramGroupConfig.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/rollup/job/config/DateHistogramGroupConfig.java index 54383e7bfdabf..074f694a8e6a9 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/rollup/job/config/DateHistogramGroupConfig.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/rollup/job/config/DateHistogramGroupConfig.java @@ -9,11 +9,11 @@ import org.elasticsearch.client.Validatable; import org.elasticsearch.client.ValidationException; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.Nullable; import org.elasticsearch.core.TimeValue; import org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramInterval; @@ -26,9 +26,9 @@ import java.util.Optional; import java.util.Set; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; -import static org.elasticsearch.common.xcontent.ObjectParser.ValueType; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ObjectParser.ValueType; /** * The configuration object for the histograms in the rollup config diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/rollup/job/config/GroupConfig.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/rollup/job/config/GroupConfig.java index 7a2a61d82df83..ffcf1a8f69ab0 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/rollup/job/config/GroupConfig.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/rollup/job/config/GroupConfig.java @@ -10,18 +10,18 @@ import org.elasticsearch.client.Validatable; import org.elasticsearch.client.ValidationException; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; import java.util.Optional; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * The configuration object for the groups section in the rollup config. diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/rollup/job/config/HistogramGroupConfig.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/rollup/job/config/HistogramGroupConfig.java index e30914e58fde6..cdfd48fbe058d 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/rollup/job/config/HistogramGroupConfig.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/rollup/job/config/HistogramGroupConfig.java @@ -9,11 +9,11 @@ import org.elasticsearch.client.Validatable; import org.elasticsearch.client.ValidationException; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Arrays; @@ -21,7 +21,7 @@ import java.util.Objects; import java.util.Optional; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; /** * The configuration object for the histograms in the rollup config diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/rollup/job/config/MetricConfig.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/rollup/job/config/MetricConfig.java index ff274ad7a5626..371047f5d6026 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/rollup/job/config/MetricConfig.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/rollup/job/config/MetricConfig.java @@ -9,18 +9,18 @@ import org.elasticsearch.client.Validatable; import org.elasticsearch.client.ValidationException; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.List; import java.util.Objects; import java.util.Optional; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; /** * The configuration object for the metrics portion of a rollup job config diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/rollup/job/config/RollupJobConfig.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/rollup/job/config/RollupJobConfig.java index 70a0e2d195d3d..1ec9756be3224 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/rollup/job/config/RollupJobConfig.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/rollup/job/config/RollupJobConfig.java @@ -10,14 +10,14 @@ import org.elasticsearch.client.Validatable; import org.elasticsearch.client.ValidationException; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.regex.Regex; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collections; @@ -25,8 +25,8 @@ import java.util.Objects; import java.util.Optional; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * This class holds the configuration details of a rollup job, such as the groupings, metrics, what diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/rollup/job/config/TermsGroupConfig.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/rollup/job/config/TermsGroupConfig.java index 1519f7077dcbf..6166bf03913fa 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/rollup/job/config/TermsGroupConfig.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/rollup/job/config/TermsGroupConfig.java @@ -9,18 +9,18 @@ import org.elasticsearch.client.Validatable; import org.elasticsearch.client.ValidationException; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Arrays; import java.util.List; import java.util.Optional; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; /** * The configuration object for the histograms in the rollup config diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/searchable_snapshots/CachesStatsResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/searchable_snapshots/CachesStatsResponse.java index 7aa9968230852..6ef15eb64f40e 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/searchable_snapshots/CachesStatsResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/searchable_snapshots/CachesStatsResponse.java @@ -8,13 +8,13 @@ package org.elasticsearch.client.searchable_snapshots; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.util.List; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; public class CachesStatsResponse { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/searchable_snapshots/MountSnapshotRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/searchable_snapshots/MountSnapshotRequest.java index 1fe3717bf8327..78d9d6c4b0661 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/searchable_snapshots/MountSnapshotRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/searchable_snapshots/MountSnapshotRequest.java @@ -11,8 +11,8 @@ import org.elasticsearch.client.Validatable; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/AuthenticateResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/AuthenticateResponse.java index 69d5507e9f857..c56cf8f7cd522 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/AuthenticateResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/AuthenticateResponse.java @@ -9,11 +9,11 @@ package org.elasticsearch.client.security; import org.elasticsearch.client.security.user.User; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.Nullable; import java.io.IOException; @@ -21,8 +21,8 @@ import java.util.Map; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * The response for the authenticate call. The response contains two fields: a diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/ChangePasswordRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/ChangePasswordRequest.java index a6b48ad5c70f8..cc15459c0f255 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/ChangePasswordRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/ChangePasswordRequest.java @@ -11,8 +11,8 @@ import org.elasticsearch.client.Validatable; import org.elasticsearch.core.CharArrays; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Arrays; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/ClearPrivilegesCacheResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/ClearPrivilegesCacheResponse.java index da8da0d82d199..d0632e6fe30d2 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/ClearPrivilegesCacheResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/ClearPrivilegesCacheResponse.java @@ -9,8 +9,8 @@ package org.elasticsearch.client.security; import org.elasticsearch.client.NodesResponseHeader; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.List; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/ClearRealmCacheResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/ClearRealmCacheResponse.java index 05dc699fbc15e..26a3cd524c53a 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/ClearRealmCacheResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/ClearRealmCacheResponse.java @@ -9,8 +9,8 @@ package org.elasticsearch.client.security; import org.elasticsearch.client.NodesResponseHeader; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.List; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/ClearRolesCacheResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/ClearRolesCacheResponse.java index 36d7013a759f3..65c56ebbf8816 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/ClearRolesCacheResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/ClearRolesCacheResponse.java @@ -9,8 +9,8 @@ package org.elasticsearch.client.security; import org.elasticsearch.client.NodesResponseHeader; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.List; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/ClearSecurityCacheResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/ClearSecurityCacheResponse.java index 66a56358d95a2..5471cf4bb1498 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/ClearSecurityCacheResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/ClearSecurityCacheResponse.java @@ -9,8 +9,8 @@ package org.elasticsearch.client.security; import org.elasticsearch.client.NodesResponseHeader; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.List; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/CreateApiKeyRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/CreateApiKeyRequest.java index 5435bbb389b17..5e7f4eae28e8e 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/CreateApiKeyRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/CreateApiKeyRequest.java @@ -12,8 +12,8 @@ import org.elasticsearch.client.security.user.privileges.Role; import org.elasticsearch.core.Nullable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.List; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/CreateApiKeyResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/CreateApiKeyResponse.java index d9d36d56fbd80..92cf42e88b015 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/CreateApiKeyResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/CreateApiKeyResponse.java @@ -9,10 +9,10 @@ package org.elasticsearch.client.security; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.settings.SecureString; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.nio.charset.StandardCharsets; @@ -20,8 +20,8 @@ import java.util.Base64; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * Response for create API key diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/CreateServiceAccountTokenResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/CreateServiceAccountTokenResponse.java index d364d408c6934..76a0c72192b7e 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/CreateServiceAccountTokenResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/CreateServiceAccountTokenResponse.java @@ -8,15 +8,15 @@ package org.elasticsearch.client.security; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.settings.SecureString; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; /** * Response for creating a service account token. Contains the token's name and value for bearer authentication. diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/CreateTokenRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/CreateTokenRequest.java index e59ad314dd793..ca8cce781fa06 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/CreateTokenRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/CreateTokenRequest.java @@ -12,8 +12,8 @@ import org.elasticsearch.core.CharArrays; import org.elasticsearch.core.Nullable; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Arrays; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/CreateTokenResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/CreateTokenResponse.java index a97959ad83d58..617b5eeda4f86 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/CreateTokenResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/CreateTokenResponse.java @@ -8,16 +8,16 @@ package org.elasticsearch.client.security; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * Response when creating a new OAuth2 token in the Elasticsearch cluster. Contains an access token, the token's expiry, and an optional diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/DelegatePkiAuthenticationRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/DelegatePkiAuthenticationRequest.java index d8335220a0b47..5af713218d997 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/DelegatePkiAuthenticationRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/DelegatePkiAuthenticationRequest.java @@ -10,8 +10,8 @@ import org.elasticsearch.client.Validatable; import org.elasticsearch.client.ValidationException; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.security.cert.CertificateEncodingException; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/DelegatePkiAuthenticationResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/DelegatePkiAuthenticationResponse.java index 2e9fb805c36c7..58f35bd072dd7 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/DelegatePkiAuthenticationResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/DelegatePkiAuthenticationResponse.java @@ -8,15 +8,15 @@ package org.elasticsearch.client.security; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; public final class DelegatePkiAuthenticationResponse { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/DeletePrivilegesResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/DeletePrivilegesResponse.java index c8c875c48a282..8374a4a174215 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/DeletePrivilegesResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/DeletePrivilegesResponse.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.security; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/DeleteRoleMappingResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/DeleteRoleMappingResponse.java index 6ae4ed327ee74..f80b32fa054c6 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/DeleteRoleMappingResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/DeleteRoleMappingResponse.java @@ -8,14 +8,14 @@ package org.elasticsearch.client.security; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; /** * Response when deleting a role mapping. If the mapping is successfully diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/DeleteRoleResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/DeleteRoleResponse.java index bb7a5c9c90ae6..a356c8483697d 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/DeleteRoleResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/DeleteRoleResponse.java @@ -8,13 +8,13 @@ package org.elasticsearch.client.security; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; /** * Response for a role being deleted from the native realm diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/DeleteServiceAccountTokenResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/DeleteServiceAccountTokenResponse.java index 4497c5efe1158..c8c1dc161ca7c 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/DeleteServiceAccountTokenResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/DeleteServiceAccountTokenResponse.java @@ -9,8 +9,8 @@ package org.elasticsearch.client.security; import org.elasticsearch.client.core.AcknowledgedResponse; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/DeleteUserResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/DeleteUserResponse.java index 4cc301ad09655..b749885eef242 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/DeleteUserResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/DeleteUserResponse.java @@ -9,8 +9,8 @@ package org.elasticsearch.client.security; import org.elasticsearch.client.core.AcknowledgedResponse; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/ExpressionRoleMapping.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/ExpressionRoleMapping.java index 4d863dd9c3b2c..0fc062c4a6182 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/ExpressionRoleMapping.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/ExpressionRoleMapping.java @@ -10,18 +10,18 @@ import org.elasticsearch.client.security.support.expressiondsl.RoleMapperExpression; import org.elasticsearch.client.security.support.expressiondsl.parser.RoleMapperExpressionParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * A representation of a single role-mapping. diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/GetApiKeyRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/GetApiKeyRequest.java index ee166f3799e83..7c2e393223cf1 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/GetApiKeyRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/GetApiKeyRequest.java @@ -11,8 +11,8 @@ import org.elasticsearch.client.Validatable; import org.elasticsearch.core.Nullable; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/GetApiKeyResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/GetApiKeyResponse.java index 7720adc35cf67..80305b7a12260 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/GetApiKeyResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/GetApiKeyResponse.java @@ -9,16 +9,16 @@ package org.elasticsearch.client.security; import org.elasticsearch.client.security.support.ApiKey; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collections; import java.util.List; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * Response for get API keys.
    diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/GetBuiltinPrivilegesResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/GetBuiltinPrivilegesResponse.java index 0a02f742983e3..56e6f31d554f7 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/GetBuiltinPrivilegesResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/GetBuiltinPrivilegesResponse.java @@ -8,16 +8,16 @@ package org.elasticsearch.client.security; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collection; import java.util.Objects; import java.util.Set; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; /** * Get builtin privileges response diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/GetPrivilegesResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/GetPrivilegesResponse.java index 132fb08835841..919a2b0507508 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/GetPrivilegesResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/GetPrivilegesResponse.java @@ -9,7 +9,7 @@ package org.elasticsearch.client.security; import org.elasticsearch.client.security.user.privileges.ApplicationPrivilege; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParserUtils; import java.io.IOException; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/GetRoleMappingsResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/GetRoleMappingsResponse.java index e6f5e72689bd3..940fd18e8a849 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/GetRoleMappingsResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/GetRoleMappingsResponse.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.security; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParserUtils; import java.io.IOException; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/GetRolesResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/GetRolesResponse.java index 32336d410ad18..9fc368ef1bba4 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/GetRolesResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/GetRolesResponse.java @@ -10,7 +10,7 @@ import org.elasticsearch.client.security.user.privileges.Role; import org.elasticsearch.core.Tuple; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParserUtils; import java.io.IOException; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/GetServiceAccountCredentialsResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/GetServiceAccountCredentialsResponse.java index ea9daba79380b..e220113131b42 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/GetServiceAccountCredentialsResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/GetServiceAccountCredentialsResponse.java @@ -9,16 +9,16 @@ package org.elasticsearch.client.security; import org.elasticsearch.client.security.support.ServiceTokenInfo; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; import static org.elasticsearch.common.xcontent.XContentParserUtils.ensureExpectedToken; /** diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/GetServiceAccountsResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/GetServiceAccountsResponse.java index 1ad978ab42ae6..12e9ad04efcc4 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/GetServiceAccountsResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/GetServiceAccountsResponse.java @@ -10,7 +10,7 @@ import org.elasticsearch.client.security.support.ServiceAccountInfo; import org.elasticsearch.client.security.user.privileges.Role; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParserUtils; import java.io.IOException; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/GetSslCertificatesResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/GetSslCertificatesResponse.java index 5b0fc13f606f9..eaf51958571a6 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/GetSslCertificatesResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/GetSslCertificatesResponse.java @@ -9,7 +9,7 @@ package org.elasticsearch.client.security; import org.elasticsearch.client.security.support.CertificateInfo; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParserUtils; import java.io.IOException; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/GetUserPrivilegesResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/GetUserPrivilegesResponse.java index 275402188f03f..9b2667b7cdc15 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/GetUserPrivilegesResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/GetUserPrivilegesResponse.java @@ -12,9 +12,9 @@ import org.elasticsearch.client.security.user.privileges.ApplicationResourcePrivileges; import org.elasticsearch.client.security.user.privileges.GlobalPrivileges; import org.elasticsearch.client.security.user.privileges.UserIndicesPrivileges; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collection; @@ -23,7 +23,7 @@ import java.util.Objects; import java.util.Set; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; /** * The response for the {@link org.elasticsearch.client.SecurityClient#getUserPrivileges(RequestOptions)} API. diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/GetUsersResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/GetUsersResponse.java index ef50019eabc6b..99c1066d0934d 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/GetUsersResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/GetUsersResponse.java @@ -9,10 +9,10 @@ import org.elasticsearch.client.security.user.User; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentParser.Token; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser.Token; import org.elasticsearch.common.xcontent.XContentParserUtils; import java.io.IOException; @@ -25,8 +25,8 @@ import java.util.function.Function; import java.util.stream.Collectors; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * Response when requesting zero or more users. diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/GrantApiKeyRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/GrantApiKeyRequest.java index 732ea182a99e2..530424a02b525 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/GrantApiKeyRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/GrantApiKeyRequest.java @@ -10,9 +10,9 @@ import org.elasticsearch.client.Validatable; import org.elasticsearch.core.CharArrays; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Arrays; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/HasPrivilegesRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/HasPrivilegesRequest.java index f2d3c8b7a3772..bc8ecf46d1e68 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/HasPrivilegesRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/HasPrivilegesRequest.java @@ -12,8 +12,8 @@ import org.elasticsearch.client.security.user.privileges.ApplicationResourcePrivileges; import org.elasticsearch.client.security.user.privileges.IndicesPrivileges; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/HasPrivilegesResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/HasPrivilegesResponse.java index 8c27c7dfff808..10abb5d247f65 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/HasPrivilegesResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/HasPrivilegesResponse.java @@ -8,10 +8,10 @@ package org.elasticsearch.client.security; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collections; @@ -20,7 +20,7 @@ import java.util.Objects; import java.util.function.BiConsumer; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; /** * Response when checking whether the current user has a defined set of privileges. diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/InvalidateApiKeyRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/InvalidateApiKeyRequest.java index 13d7ee4c8d4c0..e675068007193 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/InvalidateApiKeyRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/InvalidateApiKeyRequest.java @@ -11,8 +11,8 @@ import org.elasticsearch.client.Validatable; import org.elasticsearch.core.Nullable; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Arrays; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/InvalidateApiKeyResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/InvalidateApiKeyResponse.java index 2c03294b6b31a..08f1741b2f6e1 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/InvalidateApiKeyResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/InvalidateApiKeyResponse.java @@ -10,17 +10,17 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collections; import java.util.List; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public final class InvalidateApiKeyResponse { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/InvalidateTokenRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/InvalidateTokenRequest.java index b78b9c2244038..edf8549c3a2ba 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/InvalidateTokenRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/InvalidateTokenRequest.java @@ -11,8 +11,8 @@ import org.elasticsearch.client.Validatable; import org.elasticsearch.core.Nullable; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/InvalidateTokenResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/InvalidateTokenResponse.java index 88cb8e2beb58e..5b1c5aec81092 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/InvalidateTokenResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/InvalidateTokenResponse.java @@ -10,9 +10,9 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParserUtils; import java.io.IOException; @@ -20,8 +20,8 @@ import java.util.List; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * Response when invalidating one or multiple OAuth2 access tokens and refresh tokens. Returns diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/KibanaEnrollmentResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/KibanaEnrollmentResponse.java index 56604d849ed1d..105a55fa0ec6e 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/KibanaEnrollmentResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/KibanaEnrollmentResponse.java @@ -9,14 +9,14 @@ package org.elasticsearch.client.security; import org.elasticsearch.common.settings.SecureString; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; public final class KibanaEnrollmentResponse { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/NodeEnrollmentResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/NodeEnrollmentResponse.java index adacaf0537bbe..f326eadf824ae 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/NodeEnrollmentResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/NodeEnrollmentResponse.java @@ -8,9 +8,9 @@ package org.elasticsearch.client.security; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collections; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/PutPrivilegesRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/PutPrivilegesRequest.java index 3ca1208dd4168..d494f4bb98d61 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/PutPrivilegesRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/PutPrivilegesRequest.java @@ -11,8 +11,8 @@ import org.elasticsearch.client.Validatable; import org.elasticsearch.client.security.user.privileges.ApplicationPrivilege; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Collections; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/PutPrivilegesResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/PutPrivilegesResponse.java index 9fc0e27ab5380..e1ed303975c7c 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/PutPrivilegesResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/PutPrivilegesResponse.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collections; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/PutRoleMappingRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/PutRoleMappingRequest.java index be7fd78ce1f92..bdeba45f55b6e 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/PutRoleMappingRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/PutRoleMappingRequest.java @@ -12,8 +12,8 @@ import org.elasticsearch.client.security.support.expressiondsl.RoleMapperExpression; import org.elasticsearch.core.Nullable; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Collections; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/PutRoleMappingResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/PutRoleMappingResponse.java index 86d153d711d19..32d8b0851c1b8 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/PutRoleMappingResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/PutRoleMappingResponse.java @@ -8,14 +8,14 @@ package org.elasticsearch.client.security; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; /** * Response when adding/updating a role mapping. Returns a boolean field for diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/PutRoleRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/PutRoleRequest.java index a574717eaf3d6..4c0220a5790bd 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/PutRoleRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/PutRoleRequest.java @@ -11,8 +11,8 @@ import org.elasticsearch.client.Validatable; import org.elasticsearch.client.security.user.privileges.Role; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/PutRoleResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/PutRoleResponse.java index 40f855c536b55..958f20e3e41b0 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/PutRoleResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/PutRoleResponse.java @@ -8,15 +8,15 @@ package org.elasticsearch.client.security; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentParser.Token; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser.Token; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; import static org.elasticsearch.common.xcontent.XContentParserUtils.ensureExpectedToken; import static org.elasticsearch.common.xcontent.XContentParserUtils.ensureFieldName; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/PutUserRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/PutUserRequest.java index 3dc124aecc619..67ec1b5a44139 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/PutUserRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/PutUserRequest.java @@ -13,8 +13,8 @@ import org.elasticsearch.client.security.user.User; import org.elasticsearch.core.CharArrays; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Arrays; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/PutUserResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/PutUserResponse.java index 68b0e7175b359..24ed7d3764dfb 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/PutUserResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/PutUserResponse.java @@ -8,14 +8,14 @@ package org.elasticsearch.client.security; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; /** * Response when adding a user to the native realm. Returns a diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/QueryApiKeyRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/QueryApiKeyRequest.java index 03b51388408cb..50bf38beb33de 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/QueryApiKeyRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/QueryApiKeyRequest.java @@ -10,8 +10,8 @@ import org.elasticsearch.client.Validatable; import org.elasticsearch.client.ValidationException; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.core.Nullable; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.search.searchafter.SearchAfterBuilder; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/QueryApiKeyResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/QueryApiKeyResponse.java index 811fc62976400..2ebdf7b515ea8 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/QueryApiKeyResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/QueryApiKeyResponse.java @@ -9,15 +9,15 @@ package org.elasticsearch.client.security; import org.elasticsearch.client.security.support.ApiKey; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.List; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public final class QueryApiKeyResponse { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/SecurityNodesResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/SecurityNodesResponse.java index 19068fc0b2a66..f969a0ec844de 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/SecurityNodesResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/SecurityNodesResponse.java @@ -10,8 +10,8 @@ import org.elasticsearch.client.NodesResponse; import org.elasticsearch.client.NodesResponseHeader; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; import java.util.List; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/ServiceAccountCredentialsNodesResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/ServiceAccountCredentialsNodesResponse.java index 8fb268d96e5ff..db74e62c44b55 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/ServiceAccountCredentialsNodesResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/ServiceAccountCredentialsNodesResponse.java @@ -10,7 +10,7 @@ import org.elasticsearch.client.NodesResponseHeader; import org.elasticsearch.client.security.support.ServiceTokenInfo; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParserUtils; import java.io.IOException; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/TemplateRoleName.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/TemplateRoleName.java index a9a2d75eff5e1..a3e9afea8b842 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/TemplateRoleName.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/TemplateRoleName.java @@ -8,22 +8,22 @@ package org.elasticsearch.client.security; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParserUtils; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.util.Locale; import java.util.Map; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * A role name that uses a dynamic template. diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/support/ApiKey.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/support/ApiKey.java index 65fa26edd3f23..4de32924c7684 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/support/ApiKey.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/support/ApiKey.java @@ -8,10 +8,10 @@ package org.elasticsearch.client.security.support; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.Nullable; import java.io.IOException; @@ -21,8 +21,8 @@ import java.util.Map; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * API key information diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/support/CertificateInfo.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/support/CertificateInfo.java index a47f5037a2149..7d59a3d8e1c87 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/support/CertificateInfo.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/support/CertificateInfo.java @@ -9,14 +9,14 @@ package org.elasticsearch.client.security.support; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; /** * Simple model of an X.509 certificate diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/support/expressiondsl/RoleMapperExpression.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/support/expressiondsl/RoleMapperExpression.java index c570922f5fa1c..01066a6cff1d2 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/support/expressiondsl/RoleMapperExpression.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/support/expressiondsl/RoleMapperExpression.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.security.support.expressiondsl; -import org.elasticsearch.common.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.ToXContentObject; /** * Implementations of this interface represent an expression used for user role mapping diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/support/expressiondsl/expressions/CompositeRoleMapperExpression.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/support/expressiondsl/expressions/CompositeRoleMapperExpression.java index c0e5f588c0fd8..e8d32dcf3a7e5 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/support/expressiondsl/expressions/CompositeRoleMapperExpression.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/support/expressiondsl/expressions/CompositeRoleMapperExpression.java @@ -9,7 +9,7 @@ package org.elasticsearch.client.security.support.expressiondsl.expressions; import org.elasticsearch.client.security.support.expressiondsl.RoleMapperExpression; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.List; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/support/expressiondsl/expressions/CompositeType.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/support/expressiondsl/expressions/CompositeType.java index 325ee9e994542..74aa03e53c061 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/support/expressiondsl/expressions/CompositeType.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/support/expressiondsl/expressions/CompositeType.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.security.support.expressiondsl.expressions; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import java.util.Collections; import java.util.HashMap; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/support/expressiondsl/expressions/ExceptRoleMapperExpression.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/support/expressiondsl/expressions/ExceptRoleMapperExpression.java index ef52e010f3e66..e347406148397 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/support/expressiondsl/expressions/ExceptRoleMapperExpression.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/support/expressiondsl/expressions/ExceptRoleMapperExpression.java @@ -9,7 +9,7 @@ package org.elasticsearch.client.security.support.expressiondsl.expressions; import org.elasticsearch.client.security.support.expressiondsl.RoleMapperExpression; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/support/expressiondsl/fields/FieldRoleMapperExpression.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/support/expressiondsl/fields/FieldRoleMapperExpression.java index 8820ca1c1249b..3693cfd325be5 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/support/expressiondsl/fields/FieldRoleMapperExpression.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/support/expressiondsl/fields/FieldRoleMapperExpression.java @@ -9,7 +9,7 @@ package org.elasticsearch.client.security.support.expressiondsl.fields; import org.elasticsearch.client.security.support.expressiondsl.RoleMapperExpression; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.List; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/support/expressiondsl/parser/RoleMapperExpressionParser.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/support/expressiondsl/parser/RoleMapperExpressionParser.java index 6075b418eda81..2d801faf20120 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/support/expressiondsl/parser/RoleMapperExpressionParser.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/support/expressiondsl/parser/RoleMapperExpressionParser.java @@ -16,8 +16,8 @@ import org.elasticsearch.client.security.support.expressiondsl.expressions.ExceptRoleMapperExpression; import org.elasticsearch.client.security.support.expressiondsl.fields.FieldRoleMapperExpression; import org.elasticsearch.core.CheckedFunction; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; @@ -40,7 +40,7 @@ public static RoleMapperExpression fromXContent(final XContentParser parser) thr /** * This function exists to be compatible with - * {@link org.elasticsearch.common.xcontent.ContextParser#parse(XContentParser, Object)} + * {@link org.elasticsearch.xcontent.ContextParser#parse(XContentParser, Object)} */ public static RoleMapperExpression parseObject(XContentParser parser, String id) throws IOException { return new RoleMapperExpressionParser().parse(id, parser); diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/user/privileges/AbstractIndicesPrivileges.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/user/privileges/AbstractIndicesPrivileges.java index bc36d458f3987..a437575c1a99e 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/user/privileges/AbstractIndicesPrivileges.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/user/privileges/AbstractIndicesPrivileges.java @@ -8,13 +8,13 @@ package org.elasticsearch.client.security.user.privileges; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.io.UncheckedIOException; @@ -23,7 +23,7 @@ import java.util.List; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public abstract class AbstractIndicesPrivileges { static final ParseField NAMES = new ParseField("names"); diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/user/privileges/ApplicationPrivilege.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/user/privileges/ApplicationPrivilege.java index d17722ca74865..81ae5c714ca8c 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/user/privileges/ApplicationPrivilege.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/user/privileges/ApplicationPrivilege.java @@ -9,13 +9,13 @@ package org.elasticsearch.client.security.user.privileges; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Arrays; @@ -24,8 +24,8 @@ import java.util.Map; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * Represents an application specific privilege. The application name, privilege name, diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/user/privileges/ApplicationResourcePrivileges.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/user/privileges/ApplicationResourcePrivileges.java index 754f9376ffdae..cb39d6bf152eb 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/user/privileges/ApplicationResourcePrivileges.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/user/privileges/ApplicationResourcePrivileges.java @@ -8,20 +8,20 @@ package org.elasticsearch.client.security.user.privileges; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.util.List; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; /** * Represents privileges over resources that are scoped under an application. diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/user/privileges/GlobalOperationPrivilege.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/user/privileges/GlobalOperationPrivilege.java index cbda241ea111f..2c88409f5f3a9 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/user/privileges/GlobalOperationPrivilege.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/user/privileges/GlobalOperationPrivilege.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.security.user.privileges; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collections; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/user/privileges/GlobalPrivileges.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/user/privileges/GlobalPrivileges.java index e7ebaad35109e..c52cb9de1c4cc 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/user/privileges/GlobalPrivileges.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/user/privileges/GlobalPrivileges.java @@ -8,11 +8,11 @@ package org.elasticsearch.client.security.user.privileges; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collection; @@ -23,7 +23,7 @@ import java.util.Set; import java.util.stream.Collectors; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * Represents global privileges. "Global Privilege" is a mantra for granular diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/user/privileges/IndicesPrivileges.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/user/privileges/IndicesPrivileges.java index 87a5916df4dde..11c27a93dca27 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/user/privileges/IndicesPrivileges.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/user/privileges/IndicesPrivileges.java @@ -9,20 +9,20 @@ package org.elasticsearch.client.security.user.privileges; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.util.Arrays; import java.util.List; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * Represents privileges over indices. There is a canonical set of privilege diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/user/privileges/Role.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/user/privileges/Role.java index d933e0319727b..c068e7c2df21d 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/user/privileges/Role.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/user/privileges/Role.java @@ -9,12 +9,12 @@ package org.elasticsearch.client.security.user.privileges; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.core.Tuple; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.XContentParser; import java.util.Arrays; import java.util.Collection; @@ -24,7 +24,7 @@ import java.util.Objects; import java.util.Set; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * Represents an aggregation of privileges. diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/user/privileges/UserIndicesPrivileges.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/user/privileges/UserIndicesPrivileges.java index 47e667e909e75..49cc303e0e4de 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/security/user/privileges/UserIndicesPrivileges.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/security/user/privileges/UserIndicesPrivileges.java @@ -9,8 +9,8 @@ package org.elasticsearch.client.security.user.privileges; import org.elasticsearch.client.security.GetUserPrivilegesResponse; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collection; @@ -18,8 +18,8 @@ import java.util.List; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * Represents an "index" privilege in the {@link GetUserPrivilegesResponse}. This differs from the diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/slm/ExecuteSnapshotLifecyclePolicyResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/slm/ExecuteSnapshotLifecyclePolicyResponse.java index a56dda04caeef..b3609fe4e2f06 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/slm/ExecuteSnapshotLifecyclePolicyResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/slm/ExecuteSnapshotLifecyclePolicyResponse.java @@ -8,11 +8,11 @@ package org.elasticsearch.client.slm; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/slm/GetSnapshotLifecyclePolicyResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/slm/GetSnapshotLifecyclePolicyResponse.java index d51933378ba2d..901eb4eb555f0 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/slm/GetSnapshotLifecyclePolicyResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/slm/GetSnapshotLifecyclePolicyResponse.java @@ -8,9 +8,9 @@ package org.elasticsearch.client.slm; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.HashMap; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/slm/GetSnapshotLifecycleStatsResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/slm/GetSnapshotLifecycleStatsResponse.java index 3c398d5d0ff7f..1a4971ec3b285 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/slm/GetSnapshotLifecycleStatsResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/slm/GetSnapshotLifecycleStatsResponse.java @@ -8,9 +8,9 @@ package org.elasticsearch.client.slm; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/slm/PutSnapshotLifecyclePolicyRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/slm/PutSnapshotLifecyclePolicyRequest.java index 8a1f1bb3746fb..8a0bb9c193725 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/slm/PutSnapshotLifecyclePolicyRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/slm/PutSnapshotLifecyclePolicyRequest.java @@ -9,8 +9,8 @@ package org.elasticsearch.client.slm; import org.elasticsearch.client.TimedRequest; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/slm/SnapshotInvocationRecord.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/slm/SnapshotInvocationRecord.java index 1ce427b3077d9..e04c841b4dc3e 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/slm/SnapshotInvocationRecord.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/slm/SnapshotInvocationRecord.java @@ -8,11 +8,11 @@ package org.elasticsearch.client.slm; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/slm/SnapshotLifecyclePolicy.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/slm/SnapshotLifecyclePolicy.java index 189ab4198dada..6066aa2c25c64 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/slm/SnapshotLifecyclePolicy.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/slm/SnapshotLifecyclePolicy.java @@ -9,12 +9,12 @@ package org.elasticsearch.client.slm; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Map; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/slm/SnapshotLifecyclePolicyMetadata.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/slm/SnapshotLifecyclePolicyMetadata.java index 59448a991e4b9..f7b9577404180 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/slm/SnapshotLifecyclePolicyMetadata.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/slm/SnapshotLifecyclePolicyMetadata.java @@ -9,12 +9,12 @@ package org.elasticsearch.client.slm; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.snapshots.SnapshotId; import java.io.IOException; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/slm/SnapshotLifecycleStats.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/slm/SnapshotLifecycleStats.java index 69f12b27212a3..6ea23dcc11df7 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/slm/SnapshotLifecycleStats.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/slm/SnapshotLifecycleStats.java @@ -8,14 +8,14 @@ package org.elasticsearch.client.slm; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collections; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/slm/SnapshotRetentionConfiguration.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/slm/SnapshotRetentionConfiguration.java index 4e6aa5bf2319c..85bb75b1cccdb 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/slm/SnapshotRetentionConfiguration.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/slm/SnapshotRetentionConfiguration.java @@ -9,13 +9,13 @@ package org.elasticsearch.client.slm; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/tasks/CancelTasksResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/tasks/CancelTasksResponse.java index 5f9b1ac2930e7..18146471967f6 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/tasks/CancelTasksResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/tasks/CancelTasksResponse.java @@ -7,14 +7,14 @@ */ package org.elasticsearch.client.tasks; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.List; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * cancel tasks response that contains diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/tasks/ElasticsearchException.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/tasks/ElasticsearchException.java index 31ef258251b46..b27b56920a69f 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/tasks/ElasticsearchException.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/tasks/ElasticsearchException.java @@ -6,8 +6,8 @@ * Side Public License, v 1. */ package org.elasticsearch.client.tasks; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/tasks/GetTaskResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/tasks/GetTaskResponse.java index 9825ecf727bff..f463db3549340 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/tasks/GetTaskResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/tasks/GetTaskResponse.java @@ -7,12 +7,12 @@ */ package org.elasticsearch.client.tasks; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.tasks.TaskInfo; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; public class GetTaskResponse { private final boolean completed; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/tasks/NodeData.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/tasks/NodeData.java index 6ffea2ecb8897..ff02fe2547604 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/tasks/NodeData.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/tasks/NodeData.java @@ -12,9 +12,9 @@ import java.util.List; import java.util.Map; import java.util.Objects; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentParser; class NodeData { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/tasks/TaskInfo.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/tasks/TaskInfo.java index 0d851efe67a4c..6d8187c7d4420 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/tasks/TaskInfo.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/tasks/TaskInfo.java @@ -7,9 +7,9 @@ */ package org.elasticsearch.client.tasks; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.util.HashMap; import java.util.Map; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/tasks/TaskOperationFailure.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/tasks/TaskOperationFailure.java index f2d494d8103eb..daea614163d57 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/tasks/TaskOperationFailure.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/tasks/TaskOperationFailure.java @@ -7,13 +7,13 @@ */ package org.elasticsearch.client.tasks; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; /** * client side counterpart of server side diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/tasks/TaskSubmissionResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/tasks/TaskSubmissionResponse.java index 7b46b9e934141..8e52ab46572d2 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/tasks/TaskSubmissionResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/tasks/TaskSubmissionResponse.java @@ -8,9 +8,9 @@ package org.elasticsearch.client.tasks; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/textstructure/FindStructureRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/textstructure/FindStructureRequest.java index 111c2aa912e75..cd65b8e53a0ad 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/textstructure/FindStructureRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/textstructure/FindStructureRequest.java @@ -10,12 +10,12 @@ import org.elasticsearch.client.Validatable; import org.elasticsearch.client.ValidationException; import org.elasticsearch.client.textstructure.structurefinder.TextStructure; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Arrays; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/textstructure/FindStructureResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/textstructure/FindStructureResponse.java index 9ffa467e9ed5b..681f49ccafd83 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/textstructure/FindStructureResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/textstructure/FindStructureResponse.java @@ -8,9 +8,9 @@ package org.elasticsearch.client.textstructure; import org.elasticsearch.client.textstructure.structurefinder.TextStructure; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/textstructure/structurefinder/FieldStats.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/textstructure/structurefinder/FieldStats.java index 34622072b2490..5b18414e609dd 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/textstructure/structurefinder/FieldStats.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/textstructure/structurefinder/FieldStats.java @@ -7,11 +7,11 @@ */ package org.elasticsearch.client.textstructure.structurefinder; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Collections; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/textstructure/structurefinder/TextStructure.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/textstructure/structurefinder/TextStructure.java index 80281c3ccba28..5bf5825e56d41 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/textstructure/structurefinder/TextStructure.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/textstructure/structurefinder/TextStructure.java @@ -7,11 +7,11 @@ */ package org.elasticsearch.client.textstructure.structurefinder; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collections; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/AcknowledgedTasksResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/AcknowledgedTasksResponse.java index 12fd0cddc4919..e991ab353f884 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/AcknowledgedTasksResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/AcknowledgedTasksResponse.java @@ -11,16 +11,16 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.action.TaskOperationFailure; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.TriFunction; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; import java.util.Collections; import java.util.List; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class AcknowledgedTasksResponse { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/GetTransformResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/GetTransformResponse.java index 36560373b2f4e..2ad3fbfc0ede4 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/GetTransformResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/GetTransformResponse.java @@ -10,15 +10,15 @@ import org.elasticsearch.client.transform.transforms.TransformConfig; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.util.List; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class GetTransformResponse { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/GetTransformStatsResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/GetTransformStatsResponse.java index c84ee5ec29db1..8db23a20ab1c2 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/GetTransformStatsResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/GetTransformStatsResponse.java @@ -12,16 +12,16 @@ import org.elasticsearch.action.TaskOperationFailure; import org.elasticsearch.client.transform.transforms.TransformStats; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.util.Collections; import java.util.List; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class GetTransformStatsResponse { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/PreviewTransformRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/PreviewTransformRequest.java index 792aee83781e4..68f5a87009565 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/PreviewTransformRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/PreviewTransformRequest.java @@ -11,9 +11,9 @@ import org.elasticsearch.client.Validatable; import org.elasticsearch.client.ValidationException; import org.elasticsearch.client.transform.transforms.TransformConfig; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/PreviewTransformResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/PreviewTransformResponse.java index 34164201c91c5..47a5602a2dda7 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/PreviewTransformResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/PreviewTransformResponse.java @@ -10,10 +10,10 @@ import org.elasticsearch.action.admin.indices.alias.Alias; import org.elasticsearch.client.indices.CreateIndexRequest; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collections; @@ -23,7 +23,7 @@ import java.util.Objects; import java.util.Set; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class PreviewTransformResponse { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/PutTransformRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/PutTransformRequest.java index 44c84f982e4dd..1af5c96088a3e 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/PutTransformRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/PutTransformRequest.java @@ -11,8 +11,8 @@ import org.elasticsearch.client.Validatable; import org.elasticsearch.client.ValidationException; import org.elasticsearch.client.transform.transforms.TransformConfig; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/StartTransformResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/StartTransformResponse.java index 45fc4b98c5586..ab5e5f2e097e8 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/StartTransformResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/StartTransformResponse.java @@ -11,8 +11,8 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.action.TaskOperationFailure; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.List; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/StopTransformResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/StopTransformResponse.java index b1d5b8f82024f..3f2a39fcc17ec 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/StopTransformResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/StopTransformResponse.java @@ -11,8 +11,8 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.action.TaskOperationFailure; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.List; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/TransformNamedXContentProvider.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/TransformNamedXContentProvider.java index 3181633d3fc45..8356aa57a1111 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/TransformNamedXContentProvider.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/TransformNamedXContentProvider.java @@ -12,8 +12,8 @@ import org.elasticsearch.client.transform.transforms.SyncConfig; import org.elasticsearch.client.transform.transforms.TimeRetentionPolicyConfig; import org.elasticsearch.client.transform.transforms.TimeSyncConfig; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.plugins.spi.NamedXContentProvider; import java.util.Arrays; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/UpdateTransformRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/UpdateTransformRequest.java index 8164666ff5707..39519bfe38cc8 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/UpdateTransformRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/UpdateTransformRequest.java @@ -11,8 +11,8 @@ import org.elasticsearch.client.Validatable; import org.elasticsearch.client.ValidationException; import org.elasticsearch.client.transform.transforms.TransformConfigUpdate; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/UpdateTransformResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/UpdateTransformResponse.java index 44e714bf64196..87a6451cccbd5 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/UpdateTransformResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/UpdateTransformResponse.java @@ -9,7 +9,7 @@ package org.elasticsearch.client.transform; import org.elasticsearch.client.transform.transforms.TransformConfig; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/DestConfig.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/DestConfig.java index 3bbcb48d74c1a..cc8c7b1353cbb 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/DestConfig.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/DestConfig.java @@ -8,16 +8,16 @@ package org.elasticsearch.client.transform.transforms; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * Configuration containing the destination index for the {@link TransformConfig} diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/NodeAttributes.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/NodeAttributes.java index f343b796e64d4..de5dd799acbb9 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/NodeAttributes.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/NodeAttributes.java @@ -7,12 +7,12 @@ */ package org.elasticsearch.client.transform.transforms; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Collections; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/QueryConfig.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/QueryConfig.java index 66edc5297a2bd..e9f491ed4b831 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/QueryConfig.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/QueryConfig.java @@ -8,9 +8,9 @@ package org.elasticsearch.client.transform.transforms; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.query.AbstractQueryBuilder; import org.elasticsearch.index.query.QueryBuilder; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/RetentionPolicyConfig.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/RetentionPolicyConfig.java index 9ad72c8db3f6f..68b7881856a56 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/RetentionPolicyConfig.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/RetentionPolicyConfig.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.transform.transforms; -import org.elasticsearch.common.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.ToXContentObject; public interface RetentionPolicyConfig extends ToXContentObject { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/SettingsConfig.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/SettingsConfig.java index 06e778ad335da..39efa7a9a7cf6 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/SettingsConfig.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/SettingsConfig.java @@ -8,17 +8,17 @@ package org.elasticsearch.client.transform.transforms; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class SettingsConfig implements ToXContentObject { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/SourceConfig.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/SourceConfig.java index b13571e55107a..1de9f1ea3286a 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/SourceConfig.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/SourceConfig.java @@ -8,10 +8,10 @@ package org.elasticsearch.client.transform.transforms; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.search.builder.SearchSourceBuilder; @@ -21,8 +21,8 @@ import java.util.Map; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/SyncConfig.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/SyncConfig.java index 9b1387b9d76cb..32768d7430029 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/SyncConfig.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/SyncConfig.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.transform.transforms; -import org.elasticsearch.common.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.ToXContentObject; public interface SyncConfig extends ToXContentObject { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/TimeRetentionPolicyConfig.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/TimeRetentionPolicyConfig.java index 3c0506720ee4d..ea133131b2211 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/TimeRetentionPolicyConfig.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/TimeRetentionPolicyConfig.java @@ -8,17 +8,17 @@ package org.elasticsearch.client.transform.transforms; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; public class TimeRetentionPolicyConfig implements RetentionPolicyConfig { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/TimeSyncConfig.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/TimeSyncConfig.java index b2f2c319bd71d..425fc88fcf664 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/TimeSyncConfig.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/TimeSyncConfig.java @@ -8,18 +8,18 @@ package org.elasticsearch.client.transform.transforms; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class TimeSyncConfig implements SyncConfig { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/TransformCheckpointStats.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/TransformCheckpointStats.java index 02c666600c764..cea61dd2124fc 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/TransformCheckpointStats.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/TransformCheckpointStats.java @@ -8,14 +8,14 @@ package org.elasticsearch.client.transform.transforms; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class TransformCheckpointStats { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/TransformCheckpointingInfo.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/TransformCheckpointingInfo.java index 768b6979ce5f0..7666294306136 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/TransformCheckpointingInfo.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/TransformCheckpointingInfo.java @@ -10,10 +10,10 @@ import org.elasticsearch.client.common.TimeUtil; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.time.Instant; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/TransformConfig.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/TransformConfig.java index f5039b286d6ea..159ab5b08200c 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/TransformConfig.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/TransformConfig.java @@ -13,21 +13,21 @@ import org.elasticsearch.client.transform.transforms.latest.LatestConfig; import org.elasticsearch.client.transform.transforms.pivot.PivotConfig; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.time.Instant; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class TransformConfig implements ToXContentObject { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/TransformConfigUpdate.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/TransformConfigUpdate.java index b685833a88f8c..b07c09cc3dc78 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/TransformConfigUpdate.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/TransformConfigUpdate.java @@ -11,15 +11,15 @@ import org.elasticsearch.core.Nullable; import org.elasticsearch.common.Strings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * This class holds the mutable configuration items for a transform diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/TransformIndexerPosition.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/TransformIndexerPosition.java index 6c4ec45fb994c..73f201130b010 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/TransformIndexerPosition.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/TransformIndexerPosition.java @@ -8,17 +8,17 @@ package org.elasticsearch.client.transform.transforms; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collections; import java.util.Map; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * Holds state of the cursors: diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/TransformIndexerStats.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/TransformIndexerStats.java index 6f0516226fc1a..6d585282984cd 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/TransformIndexerStats.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/TransformIndexerStats.java @@ -8,14 +8,14 @@ package org.elasticsearch.client.transform.transforms; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class TransformIndexerStats { public static final String NAME = "transform_indexer_stats"; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/TransformProgress.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/TransformProgress.java index e378a84372bd0..565779eae546c 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/TransformProgress.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/TransformProgress.java @@ -9,13 +9,13 @@ package org.elasticsearch.client.transform.transforms; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class TransformProgress { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/TransformStats.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/TransformStats.java index 3adbb1b4fb95b..2d7b2695e98d4 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/TransformStats.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/TransformStats.java @@ -8,17 +8,17 @@ package org.elasticsearch.client.transform.transforms; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Locale; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class TransformStats { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/latest/LatestConfig.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/latest/LatestConfig.java index b1ea11f19645f..0f4f1b852fd03 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/latest/LatestConfig.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/latest/LatestConfig.java @@ -8,18 +8,18 @@ package org.elasticsearch.client.transform.transforms.latest; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Arrays; import java.util.List; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; /** * Class describing how to compute latest doc for every unique key diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/pivot/AggregationConfig.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/pivot/AggregationConfig.java index 007e6c5489723..b5e4e48daac79 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/pivot/AggregationConfig.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/pivot/AggregationConfig.java @@ -8,9 +8,9 @@ package org.elasticsearch.client.transform.transforms.pivot; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.AggregatorFactories; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/pivot/DateHistogramGroupSource.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/pivot/DateHistogramGroupSource.java index 5607ba6e4e165..aedcae46fdce2 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/pivot/DateHistogramGroupSource.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/pivot/DateHistogramGroupSource.java @@ -8,14 +8,14 @@ package org.elasticsearch.client.transform.transforms.pivot; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.script.Script; import org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramInterval; @@ -28,7 +28,7 @@ import java.util.Objects; import java.util.Set; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * A grouping via a date histogram aggregation referencing a timefield diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/pivot/GeoTileGroupSource.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/pivot/GeoTileGroupSource.java index b985ff1ac1470..8b7645f161b16 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/pivot/GeoTileGroupSource.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/pivot/GeoTileGroupSource.java @@ -8,19 +8,19 @@ package org.elasticsearch.client.transform.transforms.pivot; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.geo.GeoBoundingBox; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.aggregations.bucket.geogrid.GeoTileUtils; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /* * A geotile_grid aggregation source for group_by diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/pivot/GroupConfig.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/pivot/GroupConfig.java index 5674d201319d3..27a0518b2eae7 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/pivot/GroupConfig.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/pivot/GroupConfig.java @@ -10,9 +10,9 @@ import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.HashMap; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/pivot/HistogramGroupSource.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/pivot/HistogramGroupSource.java index 010aff82803a3..bfc5543a9919e 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/pivot/HistogramGroupSource.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/pivot/HistogramGroupSource.java @@ -8,18 +8,18 @@ package org.elasticsearch.client.transform.transforms.pivot; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.script.Script; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * A grouping via a histogram aggregation referencing a numeric field diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/pivot/PivotConfig.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/pivot/PivotConfig.java index e043133c0a335..c4b838afa4da6 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/pivot/PivotConfig.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/pivot/PivotConfig.java @@ -8,18 +8,18 @@ package org.elasticsearch.client.transform.transforms.pivot; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.aggregations.AggregatorFactories; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * Class describing how to pivot data via {@link GroupConfig} and {@link AggregationConfig} objects diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/pivot/SingleGroupSource.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/pivot/SingleGroupSource.java index e45040d65318c..720460f17e6a8 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/pivot/SingleGroupSource.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/pivot/SingleGroupSource.java @@ -8,9 +8,9 @@ package org.elasticsearch.client.transform.transforms.pivot; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.script.Script; import java.io.IOException; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/pivot/TermsGroupSource.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/pivot/TermsGroupSource.java index 2d1780c0d4dcf..7d6d1479589a2 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/pivot/TermsGroupSource.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/transform/transforms/pivot/TermsGroupSource.java @@ -8,16 +8,16 @@ package org.elasticsearch.client.transform.transforms.pivot; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.script.Script; import java.io.IOException; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class TermsGroupSource extends SingleGroupSource implements ToXContentObject { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/AckWatchResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/AckWatchResponse.java index bf85345e37545..0fc9d183f0101 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/AckWatchResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/AckWatchResponse.java @@ -8,9 +8,9 @@ package org.elasticsearch.client.watcher; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/ActionStatus.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/ActionStatus.java index 75e498254e87a..860b783da0e1e 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/ActionStatus.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/ActionStatus.java @@ -10,8 +10,8 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.time.ZoneOffset; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/ActivateWatchResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/ActivateWatchResponse.java index 85b56c2b02bb2..e4327c1ffe285 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/ActivateWatchResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/ActivateWatchResponse.java @@ -8,9 +8,9 @@ package org.elasticsearch.client.watcher; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/DeactivateWatchResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/DeactivateWatchResponse.java index cfe6d6979aeb7..c64830206510a 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/DeactivateWatchResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/DeactivateWatchResponse.java @@ -7,9 +7,9 @@ */ package org.elasticsearch.client.watcher; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/DeleteWatchResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/DeleteWatchResponse.java index ed9de53e6e727..8a6755e009083 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/DeleteWatchResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/DeleteWatchResponse.java @@ -7,9 +7,9 @@ */ package org.elasticsearch.client.watcher; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/ExecuteWatchRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/ExecuteWatchRequest.java index 469f69c3722fa..fd6f1ba791434 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/ExecuteWatchRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/ExecuteWatchRequest.java @@ -12,9 +12,9 @@ import org.elasticsearch.core.Nullable; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.util.HashMap; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/ExecuteWatchResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/ExecuteWatchResponse.java index 724cd05662c21..d6ced03f96e8c 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/ExecuteWatchResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/ExecuteWatchResponse.java @@ -9,15 +9,15 @@ package org.elasticsearch.client.watcher; import org.elasticsearch.ElasticsearchException; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.XContentUtils; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentUtils; import java.io.IOException; import java.io.InputStream; @@ -58,7 +58,7 @@ public BytesReference getRecord() { /** * Returns the watch record as a map * - * Use {@link org.elasticsearch.common.xcontent.ObjectPath} to navigate through the data + * Use {@link org.elasticsearch.xcontent.ObjectPath} to navigate through the data */ @SuppressWarnings("unchecked") public Map getRecordAsMap() { diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/GetWatchResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/GetWatchResponse.java index 2d68c589a7ea4..2a37548a9a3fc 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/GetWatchResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/GetWatchResponse.java @@ -7,14 +7,14 @@ */ package org.elasticsearch.client.watcher; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.lucene.uid.Versions; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.util.Map; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/PutWatchRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/PutWatchRequest.java index 5e0a82e18b66f..11a79eb7dd83c 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/PutWatchRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/PutWatchRequest.java @@ -10,7 +10,7 @@ import org.elasticsearch.client.Validatable; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.seqno.SequenceNumbers; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/PutWatchResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/PutWatchResponse.java index 35469d1a625ff..55fa4ea6734e4 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/PutWatchResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/PutWatchResponse.java @@ -7,9 +7,9 @@ */ package org.elasticsearch.client.watcher; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.seqno.SequenceNumbers; import java.io.IOException; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/QueuedWatch.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/QueuedWatch.java index 3c61a38c758dd..33ae744b470be 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/QueuedWatch.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/QueuedWatch.java @@ -8,8 +8,8 @@ package org.elasticsearch.client.watcher; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ParseField; import java.time.ZonedDateTime; import java.util.Objects; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/WatchExecutionSnapshot.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/WatchExecutionSnapshot.java index c212347a3504d..57e0034da57c7 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/WatchExecutionSnapshot.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/WatchExecutionSnapshot.java @@ -8,8 +8,8 @@ package org.elasticsearch.client.watcher; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ParseField; import java.time.ZonedDateTime; import java.util.Arrays; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/WatchStatus.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/WatchStatus.java index f6c4c683f50af..396dcd622edfd 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/WatchStatus.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/WatchStatus.java @@ -10,8 +10,8 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.time.ZoneOffset; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/WatchStatusDateParser.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/WatchStatusDateParser.java index 96f1b832b953e..4da29a5f94b07 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/WatchStatusDateParser.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/WatchStatusDateParser.java @@ -11,7 +11,7 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.time.DateFormatter; import org.elasticsearch.common.time.DateFormatters; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.mapper.DateFieldMapper; import java.io.IOException; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/WatcherStatsResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/WatcherStatsResponse.java index e4f3d99034d7e..6ee23029fd09e 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/WatcherStatsResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/watcher/WatcherStatsResponse.java @@ -9,10 +9,10 @@ package org.elasticsearch.client.watcher; import org.elasticsearch.client.NodesResponseHeader; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.Tuple; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.List; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/xpack/XPackInfoResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/xpack/XPackInfoResponse.java index 8d4ccdc6417cc..31a145f39a6f5 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/xpack/XPackInfoResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/xpack/XPackInfoResponse.java @@ -9,10 +9,10 @@ import org.elasticsearch.client.license.LicenseStatus; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collections; @@ -24,8 +24,8 @@ import java.util.Set; import java.util.concurrent.TimeUnit; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class XPackInfoResponse { /** diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/xpack/XPackUsageResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/xpack/XPackUsageResponse.java index 2abffb72778f8..e7a5c5423d261 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/xpack/XPackUsageResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/xpack/XPackUsageResponse.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.xpack; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Map; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/GeoIpStatsResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/GeoIpStatsResponseTests.java index 48e25c935220f..b1418723ad633 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/GeoIpStatsResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/GeoIpStatsResponseTests.java @@ -9,7 +9,7 @@ package org.elasticsearch; import org.elasticsearch.client.GeoIpStatsResponse; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/AbstractRequestTestCase.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/AbstractRequestTestCase.java index 9eac547452f0f..f357d6b1561fe 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/AbstractRequestTestCase.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/AbstractRequestTestCase.java @@ -9,12 +9,12 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContent; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContent; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/AbstractResponseTestCase.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/AbstractResponseTestCase.java index d08de164e8d9d..9670159414608 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/AbstractResponseTestCase.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/AbstractResponseTestCase.java @@ -10,12 +10,12 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.collect.ImmutableOpenMap; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContent; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContent; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/BulkProcessorIT.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/BulkProcessorIT.java index ab10905e9b242..95fcea671bc04 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/BulkProcessorIT.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/BulkProcessorIT.java @@ -23,8 +23,8 @@ import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.search.SearchHit; import org.hamcrest.Matcher; @@ -39,7 +39,7 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.IntStream; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.fieldFromSource; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.hasId; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.hasProperty; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/BulkProcessorRetryIT.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/BulkProcessorRetryIT.java index 0b21abf8fbfda..4cb771b9f399b 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/BulkProcessorRetryIT.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/BulkProcessorRetryIT.java @@ -16,7 +16,7 @@ import org.elasticsearch.action.get.MultiGetRequest; import org.elasticsearch.action.index.IndexRequest; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.transport.RemoteTransportException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/BulkRequestWithGlobalParametersIT.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/BulkRequestWithGlobalParametersIT.java index fb09395701957..9f4cb54595597 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/BulkRequestWithGlobalParametersIT.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/BulkRequestWithGlobalParametersIT.java @@ -12,7 +12,7 @@ import org.elasticsearch.action.bulk.BulkResponse; import org.elasticsearch.action.index.IndexRequest; import org.elasticsearch.action.search.SearchRequest; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.search.SearchHit; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/CCRIT.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/CCRIT.java index 2459fe30b587f..30224e0151995 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/CCRIT.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/CCRIT.java @@ -41,7 +41,7 @@ import org.elasticsearch.client.indices.CreateIndexResponse; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.seqno.ReplicationTracker; import org.elasticsearch.test.rest.yaml.ObjectPath; import org.junit.Before; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ClusterClientIT.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ClusterClientIT.java index cb570348274e8..d6c21eb8eddad 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ClusterClientIT.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ClusterClientIT.java @@ -38,7 +38,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.indices.recovery.RecoverySettings; import org.elasticsearch.rest.RestStatus; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/CrudIT.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/CrudIT.java index 3da1e41de2ea5..c7deac68438cf 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/CrudIT.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/CrudIT.java @@ -39,9 +39,9 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.VersionType; import org.elasticsearch.index.get.GetResult; import org.elasticsearch.rest.RestStatus; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/CustomRestHighLevelClientTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/CustomRestHighLevelClientTests.java index e960a696672df..d65a2c6770695 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/CustomRestHighLevelClientTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/CustomRestHighLevelClientTests.java @@ -27,7 +27,7 @@ import org.elasticsearch.cluster.ClusterName; import org.elasticsearch.core.SuppressForbidden; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.RequestMatcher; import org.junit.Before; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ESRestHighLevelClientTestCase.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ESRestHighLevelClientTestCase.java index 80d68e5bc9bd0..9ffc28a017d44 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ESRestHighLevelClientTestCase.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ESRestHighLevelClientTestCase.java @@ -28,10 +28,10 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.core.internal.io.IOUtils; import org.elasticsearch.ingest.Pipeline; import org.elasticsearch.search.SearchHit; @@ -54,7 +54,7 @@ import java.util.stream.Collectors; import static java.util.Collections.singletonMap; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.empty; import static org.hamcrest.Matchers.greaterThan; import static org.hamcrest.Matchers.hasSize; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/EqlIT.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/EqlIT.java index 875ffc7ac1926..c7661ac28b5ef 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/EqlIT.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/EqlIT.java @@ -32,7 +32,7 @@ import java.util.Locale; import java.util.Map; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.anyOf; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.greaterThan; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/GetAliasesResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/GetAliasesResponseTests.java index 922c10d8089bf..b6c2493fd4c52 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/GetAliasesResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/GetAliasesResponseTests.java @@ -9,8 +9,8 @@ package org.elasticsearch.client; import org.elasticsearch.cluster.metadata.AliasMetadata; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.test.AbstractXContentTestCase; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/GraphRequestConvertersTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/GraphRequestConvertersTests.java index 438c92999548e..13a50c1382f61 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/GraphRequestConvertersTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/GraphRequestConvertersTests.java @@ -12,7 +12,7 @@ import org.elasticsearch.client.graph.GraphExploreRequest; import org.elasticsearch.client.graph.Hop; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.TermQueryBuilder; import org.elasticsearch.test.ESTestCase; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/IndicesClientIT.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/IndicesClientIT.java index 320bf46bee459..404e49fdb4d95 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/IndicesClientIT.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/IndicesClientIT.java @@ -96,9 +96,9 @@ import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.query.QueryBuilder; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/IndicesRequestConvertersTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/IndicesRequestConvertersTests.java index 56ee9162ef4b7..2410d14f637ba 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/IndicesRequestConvertersTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/IndicesRequestConvertersTests.java @@ -54,7 +54,7 @@ import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.CollectionUtils; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.junit.Assert; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/IngestClientIT.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/IngestClientIT.java index 48e5e3f1e05f6..a2b2c1bee628b 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/IngestClientIT.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/IngestClientIT.java @@ -20,8 +20,8 @@ import org.elasticsearch.action.support.master.AcknowledgedResponse; import org.elasticsearch.client.core.MainRequest; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.ingest.PipelineConfiguration; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/IngestRequestConvertersTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/IngestRequestConvertersTests.java index a32bf2617ed42..f3d3461cfadaf 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/IngestRequestConvertersTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/IngestRequestConvertersTests.java @@ -18,7 +18,7 @@ import org.elasticsearch.action.ingest.SimulatePipelineRequest; import org.elasticsearch.action.support.master.AcknowledgedRequest; import org.elasticsearch.common.bytes.BytesArray; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.junit.Assert; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/LicenseIT.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/LicenseIT.java index a43a8598c074d..d0423f893e8aa 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/LicenseIT.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/LicenseIT.java @@ -23,8 +23,8 @@ import org.elasticsearch.client.license.StartTrialRequest; import org.elasticsearch.client.license.StartTrialResponse; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.junit.After; import org.junit.BeforeClass; @@ -32,7 +32,7 @@ import java.util.List; import java.util.Map; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.CoreMatchers.containsString; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.notNullValue; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/MLRequestConvertersTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/MLRequestConvertersTests.java index edc5dca3273d2..30243e9413715 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/MLRequestConvertersTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/MLRequestConvertersTests.java @@ -99,12 +99,12 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.search.SearchModule; import org.elasticsearch.test.ESTestCase; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/MachineLearningGetResultsIT.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/MachineLearningGetResultsIT.java index cad4a89a7a95d..9363a4cf97fe6 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/MachineLearningGetResultsIT.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/MachineLearningGetResultsIT.java @@ -34,7 +34,7 @@ import org.elasticsearch.client.ml.job.results.Influencer; import org.elasticsearch.client.ml.job.results.OverallBucket; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.XContentTestUtils; import org.junit.After; import org.junit.Before; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/MachineLearningIT.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/MachineLearningIT.java index 2fed7d7894c30..03547d4bf0b3f 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/MachineLearningIT.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/MachineLearningIT.java @@ -176,10 +176,10 @@ import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.query.MatchAllQueryBuilder; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.rest.RestStatus; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/NodesResponseHeaderTestUtils.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/NodesResponseHeaderTestUtils.java index 5dd1192e187fa..14f52b11f4072 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/NodesResponseHeaderTestUtils.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/NodesResponseHeaderTestUtils.java @@ -8,8 +8,8 @@ package org.elasticsearch.client; import org.elasticsearch.ElasticsearchException; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ReindexIT.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ReindexIT.java index 6f172384f82c4..1e91a96b52bb3 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ReindexIT.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ReindexIT.java @@ -18,7 +18,7 @@ import org.elasticsearch.action.support.WriteRequest; import org.elasticsearch.client.tasks.TaskSubmissionResponse; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.query.IdsQueryBuilder; import org.elasticsearch.index.reindex.BulkByScrollResponse; import org.elasticsearch.index.reindex.DeleteByQueryAction; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/RequestConvertersTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/RequestConvertersTests.java index 38a2cd62a4002..8cd75c45683fc 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/RequestConvertersTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/RequestConvertersTests.java @@ -57,12 +57,12 @@ import org.elasticsearch.common.io.Streams; import org.elasticsearch.common.lucene.uid.Versions; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.VersionType; import org.elasticsearch.index.query.MatchAllQueryBuilder; import org.elasticsearch.index.query.QueryBuilders; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/RestHighLevelClientExtTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/RestHighLevelClientExtTests.java index c5f88a9c495e2..bca7f64e9c502 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/RestHighLevelClientExtTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/RestHighLevelClientExtTests.java @@ -11,9 +11,9 @@ import org.apache.http.HttpEntity; import org.apache.http.entity.ContentType; import org.apache.http.nio.entity.NStringEntity; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.ESTestCase; import org.junit.Before; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/RestHighLevelClientTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/RestHighLevelClientTests.java index 4f7511684f493..ff7b0d581f46f 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/RestHighLevelClientTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/RestHighLevelClientTests.java @@ -93,14 +93,6 @@ import org.elasticsearch.cluster.ClusterName; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.cbor.CborXContent; -import org.elasticsearch.common.xcontent.smile.SmileXContent; import org.elasticsearch.core.CheckedFunction; import org.elasticsearch.core.Tuple; import org.elasticsearch.index.rankeval.DiscountedCumulativeGain; @@ -122,6 +114,14 @@ import org.elasticsearch.test.RequestMatcher; import org.elasticsearch.test.rest.yaml.restspec.ClientYamlSuiteRestApi; import org.elasticsearch.test.rest.yaml.restspec.ClientYamlSuiteRestSpec; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.cbor.CborXContent; +import org.elasticsearch.xcontent.smile.SmileXContent; import org.hamcrest.Matchers; import org.junit.Before; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/RollupIT.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/RollupIT.java index 71eac01c48928..c659c487bfcd3 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/RollupIT.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/RollupIT.java @@ -60,7 +60,7 @@ import java.util.Map; import java.util.Set; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.closeTo; import static org.hamcrest.Matchers.either; import static org.hamcrest.Matchers.empty; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/SearchIT.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/SearchIT.java index 040004e822758..fe685799fda1b 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/SearchIT.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/SearchIT.java @@ -34,9 +34,9 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.query.MatchAllQueryBuilder; import org.elasticsearch.index.query.MatchQueryBuilder; import org.elasticsearch.index.query.QueryBuilder; @@ -90,7 +90,7 @@ import java.util.List; import java.util.Map; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertFirstHit; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSecondHit; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertToXContentEquivalent; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/SearchableSnapshotsIT.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/SearchableSnapshotsIT.java index 507308ca24160..5bb80056b2fa3 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/SearchableSnapshotsIT.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/SearchableSnapshotsIT.java @@ -27,7 +27,7 @@ import org.elasticsearch.client.searchable_snapshots.CachesStatsResponse; import org.elasticsearch.client.searchable_snapshots.MountSnapshotRequest; import org.elasticsearch.common.unit.ByteSizeUnit; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.repositories.fs.FsRepository; import org.elasticsearch.rest.RestStatus; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/SnapshotIT.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/SnapshotIT.java index 2caf20ffe8b3a..1f2ff9355b646 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/SnapshotIT.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/SnapshotIT.java @@ -30,7 +30,7 @@ import org.elasticsearch.action.support.master.AcknowledgedResponse; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.repositories.fs.FsRepository; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.snapshots.AbstractSnapshotIntegTestCase; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/StoredScriptsIT.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/StoredScriptsIT.java index 870b19030e367..c9a0c10d35ef6 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/StoredScriptsIT.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/StoredScriptsIT.java @@ -13,7 +13,7 @@ import org.elasticsearch.action.admin.cluster.storedscripts.GetStoredScriptResponse; import org.elasticsearch.action.admin.cluster.storedscripts.PutStoredScriptRequest; import org.elasticsearch.common.bytes.BytesArray; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.script.Script; import org.elasticsearch.script.StoredScriptSource; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/TasksIT.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/TasksIT.java index 0bc887ee51a13..5e0462c0cffec 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/TasksIT.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/TasksIT.java @@ -21,7 +21,7 @@ import org.elasticsearch.client.tasks.TaskId; import org.elasticsearch.client.tasks.TaskSubmissionResponse; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.reindex.ReindexRequest; import org.elasticsearch.rest.RestStatus; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/TransformIT.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/TransformIT.java index e06fdb2f56f76..5dce41530c838 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/TransformIT.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/TransformIT.java @@ -44,8 +44,8 @@ import org.elasticsearch.client.transform.transforms.pivot.PivotConfig; import org.elasticsearch.client.transform.transforms.pivot.TermsGroupSource; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.query.MatchAllQueryBuilder; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.search.SearchHit; @@ -64,7 +64,7 @@ import java.util.Map; import java.util.Optional; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.CoreMatchers.nullValue; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.empty; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/TransformRequestConvertersTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/TransformRequestConvertersTests.java index c6b4118df1508..69c15c56b4a79 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/TransformRequestConvertersTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/TransformRequestConvertersTests.java @@ -29,9 +29,9 @@ import org.elasticsearch.client.transform.transforms.TransformConfigUpdateTests; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.search.SearchModule; import org.elasticsearch.test.ESTestCase; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/UpdateByQueryIT.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/UpdateByQueryIT.java index 2f4b6541fbbde..0adb33eb9fe86 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/UpdateByQueryIT.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/UpdateByQueryIT.java @@ -17,7 +17,7 @@ import org.elasticsearch.action.support.WriteRequest; import org.elasticsearch.client.tasks.TaskSubmissionResponse; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.query.IdsQueryBuilder; import org.elasticsearch.index.reindex.BulkByScrollResponse; import org.elasticsearch.index.reindex.UpdateByQueryAction; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/WatcherIT.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/WatcherIT.java index 3344910a8a0be..e86fd45b5e073 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/WatcherIT.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/WatcherIT.java @@ -30,8 +30,8 @@ import org.elasticsearch.client.watcher.WatcherStatsResponse; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ObjectPath; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ObjectPath; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.rest.RestStatus; import java.util.Map; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/WatcherRequestConvertersTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/WatcherRequestConvertersTests.java index 64eb2a2d62eed..468d2cd843c44 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/WatcherRequestConvertersTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/WatcherRequestConvertersTests.java @@ -25,7 +25,7 @@ import org.elasticsearch.client.watcher.WatcherStatsRequest; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesArray; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import java.io.ByteArrayOutputStream; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/XPackInfoResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/XPackInfoResponseTests.java index 0f59a995d98a3..08e03b4689fcb 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/XPackInfoResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/XPackInfoResponseTests.java @@ -7,8 +7,8 @@ */ package org.elasticsearch.client; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.protocol.xpack.XPackInfoResponse; import org.elasticsearch.protocol.xpack.XPackInfoResponse.BuildInfo; import org.elasticsearch.protocol.xpack.XPackInfoResponse.FeatureSetsInfo; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/analytics/AnalyticsAggsIT.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/analytics/AnalyticsAggsIT.java index 0f2c7d6bd106a..c842c515b9202 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/analytics/AnalyticsAggsIT.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/analytics/AnalyticsAggsIT.java @@ -16,7 +16,7 @@ import org.elasticsearch.client.ESRestHighLevelClientTestCase; import org.elasticsearch.client.RequestOptions; import org.elasticsearch.client.indices.CreateIndexRequest; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.search.sort.FieldSortBuilder; import org.elasticsearch.search.sort.SortOrder; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/analytics/InferenceAggIT.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/analytics/InferenceAggIT.java index 2a38f58510cee..204012c90e0a7 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/analytics/InferenceAggIT.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/analytics/InferenceAggIT.java @@ -23,7 +23,7 @@ import org.elasticsearch.client.ml.inference.trainedmodel.RegressionConfig; import org.elasticsearch.client.ml.inference.trainedmodel.tree.Tree; import org.elasticsearch.client.ml.inference.trainedmodel.tree.TreeNode; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.search.aggregations.bucket.terms.ParsedTerms; import org.elasticsearch.search.aggregations.bucket.terms.Terms; import org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/asyncsearch/AsyncSearchResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/asyncsearch/AsyncSearchResponseTests.java index 7108a48d7f5e6..f888dc2120fdf 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/asyncsearch/AsyncSearchResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/asyncsearch/AsyncSearchResponseTests.java @@ -12,8 +12,8 @@ import org.elasticsearch.action.search.SearchResponse.Clusters; import org.elasticsearch.action.search.ShardSearchFailure; import org.elasticsearch.client.AbstractResponseTestCase; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.search.internal.InternalSearchResponse; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ccr/CcrStatsResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ccr/CcrStatsResponseTests.java index 425111d30b64e..25e38af215e2b 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ccr/CcrStatsResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ccr/CcrStatsResponseTests.java @@ -12,8 +12,8 @@ import org.elasticsearch.client.AbstractResponseTestCase; import org.elasticsearch.client.ccr.IndicesFollowStats.ShardFollowStats; import org.elasticsearch.core.Tuple; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.ccr.ShardFollowNodeTaskStatus; import org.elasticsearch.xpack.core.ccr.action.CcrStatsAction; import org.elasticsearch.xpack.core.ccr.action.FollowStatsAction; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ccr/FollowConfigTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ccr/FollowConfigTests.java index d14bfcbcfe35e..1d3c1b7b7f050 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ccr/FollowConfigTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ccr/FollowConfigTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContent; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ccr/FollowInfoResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ccr/FollowInfoResponseTests.java index cd10ee5001901..ddfce6f87ed70 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ccr/FollowInfoResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ccr/FollowInfoResponseTests.java @@ -11,8 +11,8 @@ import org.elasticsearch.client.AbstractResponseTestCase; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.ccr.action.FollowInfoAction; import org.elasticsearch.xpack.core.ccr.action.FollowParameters; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ccr/FollowStatsResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ccr/FollowStatsResponseTests.java index 61d6965c8d00c..fb12f9a529c33 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ccr/FollowStatsResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ccr/FollowStatsResponseTests.java @@ -12,8 +12,8 @@ import org.elasticsearch.client.AbstractResponseTestCase; import org.elasticsearch.client.ccr.IndicesFollowStats.ShardFollowStats; import org.elasticsearch.core.Tuple; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.ccr.ShardFollowNodeTaskStatus; import org.elasticsearch.xpack.core.ccr.action.FollowStatsAction; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ccr/GetAutoFollowPatternResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ccr/GetAutoFollowPatternResponseTests.java index 3e33482959408..1c3ddfe60e50e 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ccr/GetAutoFollowPatternResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ccr/GetAutoFollowPatternResponseTests.java @@ -13,8 +13,8 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.ccr.AutoFollowMetadata; import org.elasticsearch.xpack.core.ccr.action.GetAutoFollowPatternAction; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ccr/PutAutoFollowPatternRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ccr/PutAutoFollowPatternRequestTests.java index 7d2650f670be5..da2510a5145c4 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ccr/PutAutoFollowPatternRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ccr/PutAutoFollowPatternRequestTests.java @@ -11,7 +11,7 @@ import org.elasticsearch.client.AbstractRequestTestCase; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ccr.action.PutAutoFollowPatternAction; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ccr/PutFollowRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ccr/PutFollowRequestTests.java index fb4cc6051752f..4f0e06033caa4 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ccr/PutFollowRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ccr/PutFollowRequestTests.java @@ -12,7 +12,7 @@ import org.elasticsearch.client.AbstractRequestTestCase; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ccr.action.FollowParameters; import org.elasticsearch.xpack.core.ccr.action.PutFollowAction; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ccr/PutFollowResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ccr/PutFollowResponseTests.java index c64f35cd560e9..13d6798a819e6 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ccr/PutFollowResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ccr/PutFollowResponseTests.java @@ -9,8 +9,8 @@ package org.elasticsearch.client.ccr; import org.elasticsearch.client.AbstractResponseTestCase; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.ccr.action.PutFollowAction; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ccr/ResumeFollowRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ccr/ResumeFollowRequestTests.java index 73ae6cf2e0093..ba75f26d499e8 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ccr/ResumeFollowRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ccr/ResumeFollowRequestTests.java @@ -11,7 +11,7 @@ import org.elasticsearch.client.AbstractRequestTestCase; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ccr.action.ResumeFollowAction; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/cluster/RemoteInfoResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/cluster/RemoteInfoResponseTests.java index 2991930d80808..87f967e399921 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/cluster/RemoteInfoResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/cluster/RemoteInfoResponseTests.java @@ -10,8 +10,8 @@ import org.elasticsearch.client.AbstractResponseTestCase; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.transport.ProxyConnectionStrategy; import org.elasticsearch.transport.RemoteConnectionInfo; import org.elasticsearch.transport.SniffConnectionStrategy; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/core/AcknowledgedResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/core/AcknowledgedResponseTests.java index cccaaf8179bc8..a933294960587 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/core/AcknowledgedResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/core/AcknowledgedResponseTests.java @@ -8,9 +8,9 @@ package org.elasticsearch.client.core; import org.elasticsearch.client.AbstractResponseTestCase; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/core/BroadcastResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/core/BroadcastResponseTests.java index 417c45d017948..c7c0174f3098f 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/core/BroadcastResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/core/BroadcastResponseTests.java @@ -10,8 +10,8 @@ import org.elasticsearch.action.support.DefaultShardOperationFailedException; import org.elasticsearch.client.AbstractResponseTestCase; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.seqno.RetentionLeaseNotFoundException; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/core/CountRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/core/CountRequestTests.java index 35171dddaac60..eb21ea26254c5 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/core/CountRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/core/CountRequestTests.java @@ -12,8 +12,8 @@ import org.elasticsearch.client.AbstractRequestTestCase; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.ArrayUtils; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.query.MatchAllQueryBuilder; import org.elasticsearch.index.query.MatchQueryBuilder; import org.elasticsearch.index.query.QueryBuilder; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/core/CountResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/core/CountResponseTests.java index 6c5efc0f57af9..7f2500656d1cd 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/core/CountResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/core/CountResponseTests.java @@ -11,8 +11,8 @@ import org.elasticsearch.action.search.ShardSearchFailure; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.common.ParsingException; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.Index; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.rest.action.RestActions; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/core/GetSourceResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/core/GetSourceResponseTests.java index 6589c7c6e3f91..eb4452df98b33 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/core/GetSourceResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/core/GetSourceResponseTests.java @@ -11,11 +11,11 @@ import org.elasticsearch.client.AbstractResponseTestCase; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.io.InputStream; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/core/MainResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/core/MainResponseTests.java index 507bda6a77eb7..f9abea804322b 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/core/MainResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/core/MainResponseTests.java @@ -12,8 +12,8 @@ import org.elasticsearch.Version; import org.elasticsearch.client.AbstractResponseTestCase; import org.elasticsearch.cluster.ClusterName; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.VersionUtils; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/core/MultiTermVectorsResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/core/MultiTermVectorsResponseTests.java index eeab81fe83e23..e3a28c5aa3dd3 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/core/MultiTermVectorsResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/core/MultiTermVectorsResponseTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.core; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/core/ShardsAcknowledgedResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/core/ShardsAcknowledgedResponseTests.java index 9a3f378ecd4d3..b68794af99dbd 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/core/ShardsAcknowledgedResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/core/ShardsAcknowledgedResponseTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.core; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/core/TermVectorsResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/core/TermVectorsResponseTests.java index b9b2f53c92eb5..8cc842becd1d5 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/core/TermVectorsResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/core/TermVectorsResponseTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.core; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/core/tasks/GetTaskResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/core/tasks/GetTaskResponseTests.java index 202ad9e6bbe68..73b6dbecb8207 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/core/tasks/GetTaskResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/core/tasks/GetTaskResponseTests.java @@ -11,8 +11,8 @@ import org.elasticsearch.client.Requests; import org.elasticsearch.client.tasks.GetTaskResponse; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.tasks.RawTaskStatus; import org.elasticsearch.tasks.Task; import org.elasticsearch.tasks.TaskId; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/CRUDDocumentationIT.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/CRUDDocumentationIT.java index 3c00b40b7fdb4..0f1cc0e9db53b 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/CRUDDocumentationIT.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/CRUDDocumentationIT.java @@ -56,10 +56,10 @@ import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.VersionType; import org.elasticsearch.index.get.GetResult; import org.elasticsearch.index.query.MatchAllQueryBuilder; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/ClusterClientDocumentationIT.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/ClusterClientDocumentationIT.java index 981129a284a58..dd5d2df9aa017 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/ClusterClientDocumentationIT.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/ClusterClientDocumentationIT.java @@ -41,7 +41,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.indices.recovery.RecoverySettings; import org.elasticsearch.rest.RestStatus; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/IndicesClientDocumentationIT.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/IndicesClientDocumentationIT.java index 0869d9b5cb303..dd714574476a7 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/IndicesClientDocumentationIT.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/IndicesClientDocumentationIT.java @@ -90,9 +90,9 @@ import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilders; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/IngestClientDocumentationIT.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/IngestClientDocumentationIT.java index 139ccb2cdcc78..18958045ebcf1 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/IngestClientDocumentationIT.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/IngestClientDocumentationIT.java @@ -26,7 +26,7 @@ import org.elasticsearch.client.RestHighLevelClient; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.ingest.PipelineConfiguration; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/MigrationDocumentationIT.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/MigrationDocumentationIT.java index ab598a5782496..877caf3980d92 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/MigrationDocumentationIT.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/MigrationDocumentationIT.java @@ -21,7 +21,7 @@ import org.elasticsearch.client.RestHighLevelClient; import org.elasticsearch.cluster.health.ClusterHealthStatus; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.rest.RestStatus; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/MlClientDocumentationIT.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/MlClientDocumentationIT.java index 330f95a83dafe..7e80440e3bb78 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/MlClientDocumentationIT.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/MlClientDocumentationIT.java @@ -198,9 +198,9 @@ import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.query.MatchAllQueryBuilder; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.search.aggregations.AggregatorFactories; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/RollupDocumentationIT.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/RollupDocumentationIT.java index cb919d074e70f..c376ba03eaf00 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/RollupDocumentationIT.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/RollupDocumentationIT.java @@ -65,7 +65,7 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.closeTo; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasSize; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/SearchDocumentationIT.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/SearchDocumentationIT.java index 28e7cf69369c7..cf937f1f78a71 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/SearchDocumentationIT.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/SearchDocumentationIT.java @@ -48,8 +48,8 @@ import org.elasticsearch.common.document.DocumentField; import org.elasticsearch.common.text.Text; import org.elasticsearch.common.unit.Fuzziness; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.TimeValue; import org.elasticsearch.index.get.GetResult; import org.elasticsearch.index.query.MatchQueryBuilder; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/SearchableSnapshotsDocumentationIT.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/SearchableSnapshotsDocumentationIT.java index 37fc8194d4630..54622027d3760 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/SearchableSnapshotsDocumentationIT.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/SearchableSnapshotsDocumentationIT.java @@ -29,7 +29,7 @@ import org.elasticsearch.client.searchable_snapshots.MountSnapshotRequest; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.repositories.fs.FsRepository; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.snapshots.RestoreInfo; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/SnapshotClientDocumentationIT.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/SnapshotClientDocumentationIT.java index 22fd3a7c0095a..ed0e9b0ca941a 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/SnapshotClientDocumentationIT.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/SnapshotClientDocumentationIT.java @@ -41,7 +41,7 @@ import org.elasticsearch.core.Booleans; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.repositories.fs.FsRepository; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.snapshots.RestoreInfo; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/StoredScriptsDocumentationIT.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/StoredScriptsDocumentationIT.java index 1eab58fe0d434..88f2e49414ed5 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/StoredScriptsDocumentationIT.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/StoredScriptsDocumentationIT.java @@ -21,9 +21,9 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.script.Script; import org.elasticsearch.script.StoredScriptSource; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/TransformDocumentationIT.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/TransformDocumentationIT.java index 93058e4eb76ab..f5cc765f4cc24 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/TransformDocumentationIT.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/TransformDocumentationIT.java @@ -50,7 +50,7 @@ import org.elasticsearch.client.transform.transforms.pivot.PivotConfig; import org.elasticsearch.client.transform.transforms.pivot.TermsGroupSource; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.query.MatchAllQueryBuilder; import org.elasticsearch.search.aggregations.AggregationBuilders; import org.elasticsearch.search.aggregations.AggregatorFactories; @@ -62,7 +62,7 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasSize; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/WatcherDocumentationIT.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/WatcherDocumentationIT.java index 8d2f04b9563a2..a2a5d0680409e 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/WatcherDocumentationIT.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/WatcherDocumentationIT.java @@ -34,8 +34,8 @@ import org.elasticsearch.client.watcher.WatcherStatsResponse; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ObjectPath; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ObjectPath; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.client.watcher.DeleteWatchRequest; import org.elasticsearch.client.watcher.DeleteWatchResponse; import org.elasticsearch.client.watcher.PutWatchRequest; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/enrich/ExecutePolicyResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/enrich/ExecutePolicyResponseTests.java index 995c12b53f33e..eefb274a90e36 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/enrich/ExecutePolicyResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/enrich/ExecutePolicyResponseTests.java @@ -8,8 +8,8 @@ package org.elasticsearch.client.enrich; import org.elasticsearch.client.AbstractResponseTestCase; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.tasks.TaskId; import org.elasticsearch.xpack.core.enrich.action.ExecuteEnrichPolicyAction; import org.elasticsearch.xpack.core.enrich.action.ExecuteEnrichPolicyStatus; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/enrich/GetPolicyResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/enrich/GetPolicyResponseTests.java index 6d6bed496d70a..f97beac8b7e59 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/enrich/GetPolicyResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/enrich/GetPolicyResponseTests.java @@ -9,9 +9,9 @@ import org.elasticsearch.client.AbstractResponseTestCase; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.enrich.EnrichPolicy; import org.elasticsearch.xpack.core.enrich.action.GetEnrichPolicyAction; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/enrich/PutPolicyRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/enrich/PutPolicyRequestTests.java index ae10046ac9d94..622982b0a0f60 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/enrich/PutPolicyRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/enrich/PutPolicyRequestTests.java @@ -8,8 +8,8 @@ package org.elasticsearch.client.enrich; import org.elasticsearch.client.AbstractRequestTestCase; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.query.MatchAllQueryBuilder; import org.elasticsearch.test.EqualsHashCodeTestUtils; import org.elasticsearch.xpack.core.enrich.action.PutEnrichPolicyAction; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/enrich/StatsResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/enrich/StatsResponseTests.java index d02905915d90c..32256b4daed08 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/enrich/StatsResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/enrich/StatsResponseTests.java @@ -8,8 +8,8 @@ package org.elasticsearch.client.enrich; import org.elasticsearch.client.AbstractResponseTestCase; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.tasks.TaskId; import org.elasticsearch.tasks.TaskInfo; import org.elasticsearch.xpack.core.enrich.action.EnrichStatsAction; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/eql/EqlSearchRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/eql/EqlSearchRequestTests.java index 39238cd3ee5ac..72cd8bf6ae775 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/eql/EqlSearchRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/eql/EqlSearchRequestTests.java @@ -11,8 +11,8 @@ import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.client.AbstractRequestTestCase; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.search.SearchModule; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/eql/EqlSearchResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/eql/EqlSearchResponseTests.java index 9e4aa0dc9c7a1..0387a3a233cdf 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/eql/EqlSearchResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/eql/EqlSearchResponseTests.java @@ -13,11 +13,11 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.core.Tuple; import org.elasticsearch.common.document.DocumentField; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.search.lookup.SourceLookup; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.RandomObjects; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/eql/EqlStatsResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/eql/EqlStatsResponseTests.java index 2626ad12c66dd..5f7cd40794931 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/eql/EqlStatsResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/eql/EqlStatsResponseTests.java @@ -10,8 +10,8 @@ import org.elasticsearch.client.AbstractResponseTestCase; import org.elasticsearch.client.NodesResponseHeader; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.util.ArrayList; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/eql/EqlStatsResponseToXContent.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/eql/EqlStatsResponseToXContent.java index 73ea8a8b19c4c..dc004954b39bc 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/eql/EqlStatsResponseToXContent.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/eql/EqlStatsResponseToXContent.java @@ -10,8 +10,8 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.client.NodesResponseHeader; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.List; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/graph/GraphExploreResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/graph/GraphExploreResponseTests.java index 44ac272fe9556..9b8df87c311f8 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/graph/GraphExploreResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/graph/GraphExploreResponseTests.java @@ -11,8 +11,8 @@ import org.elasticsearch.action.ShardOperationFailedException; import org.elasticsearch.action.search.ShardSearchFailure; import org.elasticsearch.client.AbstractResponseTestCase; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.protocol.xpack.graph.Connection.ConnectionId; import org.junit.Assert; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/AllocateActionTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/AllocateActionTests.java index 930b6ffc14c65..5f417d62c6a11 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/AllocateActionTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/AllocateActionTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ilm; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.util.Collections; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/DeleteActionTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/DeleteActionTests.java index 7eed143caa574..a9107cbfa88aa 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/DeleteActionTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/DeleteActionTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ilm; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; public class DeleteActionTests extends AbstractXContentTestCase { diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/ExplainLifecycleResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/ExplainLifecycleResponseTests.java index 3fe1bcd48e065..b273aaf1a058a 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/ExplainLifecycleResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/ExplainLifecycleResponseTests.java @@ -8,10 +8,10 @@ package org.elasticsearch.client.ilm; import org.elasticsearch.cluster.ClusterModule; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.util.CollectionUtils; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/ForceMergeActionTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/ForceMergeActionTests.java index ca310ae680c4a..cc9bb001d2082 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/ForceMergeActionTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/ForceMergeActionTests.java @@ -8,11 +8,11 @@ package org.elasticsearch.client.ilm; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.DeprecationHandler; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/FreezeActionTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/FreezeActionTests.java index 744f57d500f91..4061a6a937f11 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/FreezeActionTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/FreezeActionTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ilm; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; public class FreezeActionTests extends AbstractXContentTestCase { diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/GetLifecyclePolicyResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/GetLifecyclePolicyResponseTests.java index 872687f866cf7..e79e6c3376507 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/GetLifecyclePolicyResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/GetLifecyclePolicyResponseTests.java @@ -9,10 +9,10 @@ package org.elasticsearch.client.ilm; import org.elasticsearch.cluster.ClusterModule; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.collect.ImmutableOpenMap; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/IndexLifecycleExplainResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/IndexLifecycleExplainResponseTests.java index ec2724fa14c59..e5a343e065a9b 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/IndexLifecycleExplainResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/IndexLifecycleExplainResponseTests.java @@ -9,14 +9,14 @@ package org.elasticsearch.client.ilm; import org.elasticsearch.cluster.ClusterModule; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.util.CollectionUtils; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/LifecycleManagementStatusResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/LifecycleManagementStatusResponseTests.java index 57ce3b6d2a93f..605f4a2045efb 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/LifecycleManagementStatusResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/LifecycleManagementStatusResponseTests.java @@ -8,11 +8,11 @@ package org.elasticsearch.client.ilm; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.hamcrest.CoreMatchers; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/LifecyclePolicyMetadataTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/LifecyclePolicyMetadataTests.java index d0bc104bb8c83..8891092b82d9c 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/LifecyclePolicyMetadataTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/LifecyclePolicyMetadataTests.java @@ -9,9 +9,9 @@ package org.elasticsearch.client.ilm; import org.elasticsearch.cluster.ClusterModule; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/LifecyclePolicyTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/LifecyclePolicyTests.java index e10a26a4f41c6..4bca3a0059c09 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/LifecyclePolicyTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/LifecyclePolicyTests.java @@ -8,11 +8,11 @@ package org.elasticsearch.client.ilm; import org.elasticsearch.cluster.ClusterModule; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.util.ArrayList; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/MigrateActionTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/MigrateActionTests.java index 6684a703a4026..18a3d306f8b1b 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/MigrateActionTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/MigrateActionTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ilm; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import org.elasticsearch.test.EqualsHashCodeTestUtils; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/PhaseExecutionInfoTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/PhaseExecutionInfoTests.java index 6e707dda69394..74ec5ab1783ed 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/PhaseExecutionInfoTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/PhaseExecutionInfoTests.java @@ -8,10 +8,10 @@ package org.elasticsearch.client.ilm; import org.elasticsearch.cluster.ClusterModule; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.util.CollectionUtils; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import org.junit.Before; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/PhaseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/PhaseTests.java index 62b24a8c7b11d..b7b7e2c7c4521 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/PhaseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/PhaseTests.java @@ -8,11 +8,11 @@ package org.elasticsearch.client.ilm; import org.elasticsearch.cluster.ClusterModule; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.CollectionUtils; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import org.junit.Before; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/ReadOnlyActionTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/ReadOnlyActionTests.java index 3020b5dc2ec76..aa718ff952a3b 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/ReadOnlyActionTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/ReadOnlyActionTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ilm; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; public class ReadOnlyActionTests extends AbstractXContentTestCase { diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/RemoveIndexLifecyclePolicyResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/RemoveIndexLifecyclePolicyResponseTests.java index 1ec9fd04d3251..d6f064b39b007 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/RemoveIndexLifecyclePolicyResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/RemoveIndexLifecyclePolicyResponseTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.ilm; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.EqualsHashCodeTestUtils; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/RolloverActionTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/RolloverActionTests.java index 6bb3a5247a2af..a0825d3725391 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/RolloverActionTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/RolloverActionTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; public class RolloverActionTests extends AbstractXContentTestCase { diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/SearchableSnapshotActionTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/SearchableSnapshotActionTests.java index ebc59d4ebaa18..b99c58794b0c5 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/SearchableSnapshotActionTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/SearchableSnapshotActionTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ilm; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/SetPriorityActionTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/SetPriorityActionTests.java index df4fc39fc0909..8939c180c3645 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/SetPriorityActionTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/SetPriorityActionTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ilm; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import org.elasticsearch.test.EqualsHashCodeTestUtils; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/ShrinkActionTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/ShrinkActionTests.java index 10b5cc6b0601c..03c2b9898ee09 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/ShrinkActionTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/ShrinkActionTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.ilm; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/UnfollowActionTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/UnfollowActionTests.java index 8c9128782c214..340afb53ac85f 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/UnfollowActionTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/UnfollowActionTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.ilm; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/WaitForSnapshotActionTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/WaitForSnapshotActionTests.java index 492b342563e02..6534230b696d8 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/WaitForSnapshotActionTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ilm/WaitForSnapshotActionTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ilm; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import static org.hamcrest.Matchers.is; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/AnalyzeGlobalRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/AnalyzeGlobalRequestTests.java index 6d0bb3fde7a28..09cb80a26862e 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/AnalyzeGlobalRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/AnalyzeGlobalRequestTests.java @@ -9,7 +9,7 @@ package org.elasticsearch.client.indices; import org.elasticsearch.action.admin.indices.analyze.AnalyzeAction; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Map; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/AnalyzeIndexRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/AnalyzeIndexRequestTests.java index 04b55a894eb46..d4978441719a4 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/AnalyzeIndexRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/AnalyzeIndexRequestTests.java @@ -9,7 +9,7 @@ package org.elasticsearch.client.indices; import org.elasticsearch.action.admin.indices.analyze.AnalyzeAction; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Map; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/AnalyzeResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/AnalyzeResponseTests.java index 97c03faf2a7ba..161d390dd0b5b 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/AnalyzeResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/AnalyzeResponseTests.java @@ -10,8 +10,8 @@ import org.elasticsearch.action.admin.indices.analyze.AnalyzeAction; import org.elasticsearch.client.AbstractResponseTestCase; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.RandomObjects; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/CloseIndexResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/CloseIndexResponseTests.java index 2342df711d884..233ee9486f45b 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/CloseIndexResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/CloseIndexResponseTests.java @@ -13,11 +13,11 @@ import org.elasticsearch.client.AbstractResponseTestCase; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContent; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContent; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.Index; import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.rest.RestStatus; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/CreateIndexRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/CreateIndexRequestTests.java index 9a52f613d493f..b83e9511d63ec 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/CreateIndexRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/CreateIndexRequestTests.java @@ -9,7 +9,7 @@ package org.elasticsearch.client.indices; import org.elasticsearch.action.admin.indices.alias.Alias; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/DataStreamsStatsResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/DataStreamsStatsResponseTests.java index 7eddf17801ba6..123c78b47428a 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/DataStreamsStatsResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/DataStreamsStatsResponseTests.java @@ -13,8 +13,8 @@ import org.elasticsearch.action.support.DefaultShardOperationFailedException; import org.elasticsearch.client.AbstractResponseTestCase; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.util.ArrayList; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/GetComponentTemplatesResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/GetComponentTemplatesResponseTests.java index b4f3df1909f0d..8099370e02fa9 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/GetComponentTemplatesResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/GetComponentTemplatesResponseTests.java @@ -13,7 +13,7 @@ import org.elasticsearch.cluster.metadata.Template; import org.elasticsearch.common.compress.CompressedXContent; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/GetComposableIndexTemplatesResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/GetComposableIndexTemplatesResponseTests.java index ad13c718306a5..b93af425dd932 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/GetComposableIndexTemplatesResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/GetComposableIndexTemplatesResponseTests.java @@ -9,7 +9,7 @@ package org.elasticsearch.client.indices; import org.elasticsearch.cluster.metadata.ComposableIndexTemplate; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/GetDataStreamResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/GetDataStreamResponseTests.java index 14bd2b742bf0a..74f60ae342dbd 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/GetDataStreamResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/GetDataStreamResponseTests.java @@ -12,8 +12,8 @@ import org.elasticsearch.cluster.metadata.DataStreamTestHelper; import org.elasticsearch.cluster.health.ClusterHealthStatus; import org.elasticsearch.cluster.metadata.DataStream; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.Index; import org.elasticsearch.xpack.core.action.GetDataStreamAction; import org.elasticsearch.xpack.core.action.GetDataStreamAction.Response.DataStreamInfo; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/GetFieldMappingsResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/GetFieldMappingsResponseTests.java index 41c6a2dc48f59..a707638a5eddf 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/GetFieldMappingsResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/GetFieldMappingsResponseTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.client.indices.GetFieldMappingsResponse.FieldMappingMetadata; import org.elasticsearch.common.bytes.BytesArray; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/GetIndexResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/GetIndexResponseTests.java index 2b02e4f54eaf4..731e186fe16a0 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/GetIndexResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/GetIndexResponseTests.java @@ -16,8 +16,8 @@ import org.elasticsearch.common.collect.ImmutableOpenMap; import org.elasticsearch.common.settings.IndexScopedSettings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.RandomCreateIndexGenerator; import org.elasticsearch.index.mapper.MapperService; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/GetIndexTemplatesResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/GetIndexTemplatesResponseTests.java index 26eb969f0ecb2..4cbc917bf72a3 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/GetIndexTemplatesResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/GetIndexTemplatesResponseTests.java @@ -14,14 +14,14 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.compress.CompressedXContent; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.mapper.MapperService; import org.elasticsearch.test.ESTestCase; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/GetMappingsResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/GetMappingsResponseTests.java index 0e967a7c4cf3f..2172f39930ca1 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/GetMappingsResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/GetMappingsResponseTests.java @@ -11,8 +11,8 @@ import org.elasticsearch.client.AbstractResponseTestCase; import org.elasticsearch.cluster.metadata.MappingMetadata; import org.elasticsearch.common.collect.ImmutableOpenMap; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.mapper.MapperService; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/PutIndexTemplateRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/PutIndexTemplateRequestTests.java index 7c08a52a293c5..3136797fa942e 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/PutIndexTemplateRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/PutIndexTemplateRequestTests.java @@ -10,10 +10,10 @@ import org.elasticsearch.action.admin.indices.alias.Alias; import org.elasticsearch.client.AbstractRequestTestCase; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/PutMappingRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/PutMappingRequestTests.java index cea9a17b9234a..b0d383cfe68f0 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/PutMappingRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/PutMappingRequestTests.java @@ -8,8 +8,8 @@ package org.elasticsearch.client.indices; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/RandomCreateIndexGenerator.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/RandomCreateIndexGenerator.java index c79312b24963e..181692440416b 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/RandomCreateIndexGenerator.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/RandomCreateIndexGenerator.java @@ -8,8 +8,8 @@ package org.elasticsearch.client.indices; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/ReloadAnalyzersResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/ReloadAnalyzersResponseTests.java index f32b810e5be48..483d2bef92869 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/ReloadAnalyzersResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/ReloadAnalyzersResponseTests.java @@ -10,8 +10,8 @@ import org.elasticsearch.action.support.DefaultShardOperationFailedException; import org.elasticsearch.client.AbstractResponseTestCase; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.seqno.RetentionLeaseNotFoundException; import org.elasticsearch.xpack.core.action.ReloadAnalyzersResponse.ReloadDetails; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/ResizeRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/ResizeRequestTests.java index c337701d6bd40..6edaf9a575c5e 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/ResizeRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/ResizeRequestTests.java @@ -11,7 +11,7 @@ import org.elasticsearch.action.admin.indices.alias.Alias; import org.elasticsearch.client.AbstractRequestTestCase; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Arrays; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/ResizeResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/ResizeResponseTests.java index 4c924faec8074..50448771f4152 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/ResizeResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/ResizeResponseTests.java @@ -9,8 +9,8 @@ package org.elasticsearch.client.indices; import org.elasticsearch.client.AbstractResponseTestCase; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/rollover/RolloverResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/rollover/RolloverResponseTests.java index ca0f966059350..5258cbe841917 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/rollover/RolloverResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/indices/rollover/RolloverResponseTests.java @@ -15,7 +15,7 @@ import org.elasticsearch.action.admin.indices.rollover.MaxSizeCondition; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/license/GetBasicStatusResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/license/GetBasicStatusResponseTests.java index e87aae7141ee2..cf6efd9f12c49 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/license/GetBasicStatusResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/license/GetBasicStatusResponseTests.java @@ -8,8 +8,8 @@ package org.elasticsearch.client.license; import org.elasticsearch.client.AbstractResponseTestCase; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/license/GetTrialStatusResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/license/GetTrialStatusResponseTests.java index b9df951322801..0f21119a62d53 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/license/GetTrialStatusResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/license/GetTrialStatusResponseTests.java @@ -8,8 +8,8 @@ package org.elasticsearch.client.license; import org.elasticsearch.client.AbstractResponseTestCase; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/license/PutLicenseResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/license/PutLicenseResponseTests.java index 15d81deef0b71..93807bc5e8fea 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/license/PutLicenseResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/license/PutLicenseResponseTests.java @@ -8,8 +8,8 @@ package org.elasticsearch.client.license; import org.elasticsearch.client.AbstractResponseTestCase; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.util.Arrays; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/license/StartBasicResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/license/StartBasicResponseTests.java index 547747c6df464..e84dddd775765 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/license/StartBasicResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/license/StartBasicResponseTests.java @@ -8,8 +8,8 @@ package org.elasticsearch.client.license; import org.elasticsearch.client.AbstractResponseTestCase; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.license.PostStartBasicResponse; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/migration/DeprecationInfoResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/migration/DeprecationInfoResponseTests.java index 40c8d0552c884..20082abcae268 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/migration/DeprecationInfoResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/migration/DeprecationInfoResponseTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.migration; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.core.Tuple; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.EqualsHashCodeTestUtils; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/migration/GetFeatureUpgradeStatusResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/migration/GetFeatureUpgradeStatusResponseTests.java index e478a24442978..f6483dd1651b5 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/migration/GetFeatureUpgradeStatusResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/migration/GetFeatureUpgradeStatusResponseTests.java @@ -10,8 +10,8 @@ import org.elasticsearch.Version; import org.elasticsearch.client.AbstractResponseTestCase; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.util.Collections; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/migration/PostFeatureUpgradeResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/migration/PostFeatureUpgradeResponseTests.java index 60a5764f982e3..270b9b5c7677a 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/migration/PostFeatureUpgradeResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/migration/PostFeatureUpgradeResponseTests.java @@ -10,8 +10,8 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.client.AbstractResponseTestCase; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.util.Collections; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/CloseJobRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/CloseJobRequestTests.java index 819521c9cc710..505b182965ece 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/CloseJobRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/CloseJobRequestTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.ml; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/CloseJobResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/CloseJobResponseTests.java index 14d026162e701..03f46c2bab94c 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/CloseJobResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/CloseJobResponseTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/DeleteExpiredDataRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/DeleteExpiredDataRequestTests.java index 46fe364ba6dbc..830c8e1bd3506 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/DeleteExpiredDataRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/DeleteExpiredDataRequestTests.java @@ -7,11 +7,11 @@ */ package org.elasticsearch.client.ml; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/DeleteExpiredDataResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/DeleteExpiredDataResponseTests.java index 52187fb2a5294..65f3cca00e74e 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/DeleteExpiredDataResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/DeleteExpiredDataResponseTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/DeleteForecastRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/DeleteForecastRequestTests.java index 4622c0a80422f..e99062f375991 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/DeleteForecastRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/DeleteForecastRequestTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.ml; import org.elasticsearch.client.ml.job.config.JobTests; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/DeleteJobResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/DeleteJobResponseTests.java index d8077f5aa8253..86ef499f7071d 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/DeleteJobResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/DeleteJobResponseTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.tasks.TaskId; import org.elasticsearch.test.AbstractXContentTestCase; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/EvaluateDataFrameRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/EvaluateDataFrameRequestTests.java index 3912e1db425de..f5e01d4f59dee 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/EvaluateDataFrameRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/EvaluateDataFrameRequestTests.java @@ -14,8 +14,8 @@ import org.elasticsearch.client.ml.dataframe.evaluation.outlierdetection.OutlierDetectionTests; import org.elasticsearch.client.ml.dataframe.evaluation.regression.RegressionTests; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.search.SearchModule; import org.elasticsearch.test.AbstractXContentTestCase; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/EvaluateDataFrameResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/EvaluateDataFrameResponseTests.java index 1e8abf170da1b..1db9a03b81658 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/EvaluateDataFrameResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/EvaluateDataFrameResponseTests.java @@ -20,8 +20,8 @@ import org.elasticsearch.client.ml.dataframe.evaluation.outlierdetection.ConfusionMatrixMetricResultTests; import org.elasticsearch.client.ml.dataframe.evaluation.outlierdetection.PrecisionMetricResultTests; import org.elasticsearch.client.ml.dataframe.evaluation.outlierdetection.RecallMetricResultTests; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/ExplainDataFrameAnalyticsResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/ExplainDataFrameAnalyticsResponseTests.java index 87df2a5a97015..751a83f26606f 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/ExplainDataFrameAnalyticsResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/ExplainDataFrameAnalyticsResponseTests.java @@ -11,7 +11,7 @@ import org.elasticsearch.client.ml.dataframe.explain.FieldSelectionTests; import org.elasticsearch.client.ml.dataframe.explain.MemoryEstimation; import org.elasticsearch.client.ml.dataframe.explain.MemoryEstimationTests; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/FlushJobRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/FlushJobRequestTests.java index 1aee9f66440c1..6137630589677 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/FlushJobRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/FlushJobRequestTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/FlushJobResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/FlushJobResponseTests.java index 2377d671f4556..88f659767c00a 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/FlushJobResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/FlushJobResponseTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/ForecastJobRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/ForecastJobRequestTests.java index fa67bca533b07..9b685bbba22ea 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/ForecastJobRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/ForecastJobRequestTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/ForecastJobResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/ForecastJobResponseTests.java index f26449c901c79..f4c7a9ed9f9cd 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/ForecastJobResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/ForecastJobResponseTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetBucketsRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetBucketsRequestTests.java index ded5e9a99f252..474bb67156ea4 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetBucketsRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetBucketsRequestTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.ml; import org.elasticsearch.client.core.PageParams; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetBucketsResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetBucketsResponseTests.java index 86ce42f8364e9..2beec198051a9 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetBucketsResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetBucketsResponseTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.client.ml.job.results.Bucket; import org.elasticsearch.client.ml.job.results.BucketTests; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetCalendarEventsRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetCalendarEventsRequestTests.java index 5377a127c2b18..e0a843b70ce51 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetCalendarEventsRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetCalendarEventsRequestTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.ml; import org.elasticsearch.client.core.PageParams; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; public class GetCalendarEventsRequestTests extends AbstractXContentTestCase { diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetCalendarEventsResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetCalendarEventsResponseTests.java index 9970dd034bd8e..b22bed91411cc 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetCalendarEventsResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetCalendarEventsResponseTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.client.ml.calendars.ScheduledEvent; import org.elasticsearch.client.ml.calendars.ScheduledEventTests; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetCalendarsRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetCalendarsRequestTests.java index 68bf716a6a8f6..4a3522fce0e49 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetCalendarsRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetCalendarsRequestTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.ml; import org.elasticsearch.client.core.PageParams; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; public class GetCalendarsRequestTests extends AbstractXContentTestCase { diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetCalendarsResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetCalendarsResponseTests.java index 9b1db2fa5d5b8..d9d303863d13f 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetCalendarsResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetCalendarsResponseTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.client.ml.calendars.Calendar; import org.elasticsearch.client.ml.calendars.CalendarTests; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetCategoriesRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetCategoriesRequestTests.java index a2f113ad8a8b9..e01a058e5cfc0 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetCategoriesRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetCategoriesRequestTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.ml; import org.elasticsearch.client.core.PageParams; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetCategoriesResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetCategoriesResponseTests.java index c6b71df030cd6..9391f0dde5d43 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetCategoriesResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetCategoriesResponseTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.client.ml.job.results.CategoryDefinition; import org.elasticsearch.client.ml.job.results.CategoryDefinitionTests; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetDatafeedRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetDatafeedRequestTests.java index 19e895fb1cccc..925c9ecf50b70 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetDatafeedRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetDatafeedRequestTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.ml; import org.elasticsearch.client.ml.datafeed.DatafeedConfigTests; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetDatafeedResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetDatafeedResponseTests.java index 4e72896281bf0..d5cf7e5ab297e 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetDatafeedResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetDatafeedResponseTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.client.ml.datafeed.DatafeedConfig; import org.elasticsearch.client.ml.datafeed.DatafeedConfigTests; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetDatafeedStatsRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetDatafeedStatsRequestTests.java index 8b2e62e4ddab9..78aff902af034 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetDatafeedStatsRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetDatafeedStatsRequestTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetDatafeedStatsResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetDatafeedStatsResponseTests.java index 15d995651f454..ba3d8c8dd0b37 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetDatafeedStatsResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetDatafeedStatsResponseTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.client.ml.datafeed.DatafeedStats; import org.elasticsearch.client.ml.datafeed.DatafeedStatsTests; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetFiltersRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetFiltersRequestTests.java index d9030f4de62e8..2698f88d1e561 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetFiltersRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetFiltersRequestTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetFiltersResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetFiltersResponseTests.java index ced7676e2d401..96eca1db18a6b 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetFiltersResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetFiltersResponseTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.client.ml.job.config.MlFilter; import org.elasticsearch.client.ml.job.config.MlFilterTests; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetInfluencersRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetInfluencersRequestTests.java index 4175762de85df..761f0cdb462b5 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetInfluencersRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetInfluencersRequestTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.ml; import org.elasticsearch.client.core.PageParams; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetInfluencersResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetInfluencersResponseTests.java index dbc9fbe8d52a8..8925801f076fc 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetInfluencersResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetInfluencersResponseTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.client.ml.job.results.Influencer; import org.elasticsearch.client.ml.job.results.InfluencerTests; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetJobRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetJobRequestTests.java index 9f1eb0ed614fc..56b68cc8cd17b 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetJobRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetJobRequestTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetJobResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetJobResponseTests.java index 1cf37514a6492..2b38adf5e6882 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetJobResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetJobResponseTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.client.ml.job.config.Job; import org.elasticsearch.client.ml.job.config.JobTests; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetJobStatsRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetJobStatsRequestTests.java index 7d1c9dc9507f5..1dd33986ba290 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetJobStatsRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetJobStatsRequestTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetJobStatsResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetJobStatsResponseTests.java index 7dd57369776ea..68dc33ac06c10 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetJobStatsResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetJobStatsResponseTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.client.ml.job.stats.JobStats; import org.elasticsearch.client.ml.job.stats.JobStatsTests; import org.elasticsearch.test.AbstractXContentTestCase; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetModelSnapshotsRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetModelSnapshotsRequestTests.java index e0cbc05e10f89..426a607fa6a3d 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetModelSnapshotsRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetModelSnapshotsRequestTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.ml; import org.elasticsearch.client.core.PageParams; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetModelSnapshotsResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetModelSnapshotsResponseTests.java index 38d49384b25fb..6b95214791f4e 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetModelSnapshotsResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetModelSnapshotsResponseTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.client.ml.job.process.ModelSnapshot; import org.elasticsearch.client.ml.job.process.ModelSnapshotTests; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetOverallBucketsRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetOverallBucketsRequestTests.java index 463549d622b49..597f6d3862912 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetOverallBucketsRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetOverallBucketsRequestTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.ml; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetOverallBucketsResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetOverallBucketsResponseTests.java index 56754c31878dd..80aaec33b8704 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetOverallBucketsResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetOverallBucketsResponseTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.client.ml.job.results.OverallBucket; import org.elasticsearch.client.ml.job.results.OverallBucketTests; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetRecordsRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetRecordsRequestTests.java index 5525e37b94c15..84125734898c3 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetRecordsRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetRecordsRequestTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.ml; import org.elasticsearch.client.core.PageParams; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetRecordsResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetRecordsResponseTests.java index 9f24fd2e93763..78669d09b6c27 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetRecordsResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/GetRecordsResponseTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.client.ml.job.results.AnomalyRecord; import org.elasticsearch.client.ml.job.results.AnomalyRecordTests; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/MlInfoActionResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/MlInfoActionResponseTests.java index 087887f2c58e8..5f6ae3ab4813e 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/MlInfoActionResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/MlInfoActionResponseTests.java @@ -8,8 +8,8 @@ package org.elasticsearch.client.ml; import org.elasticsearch.client.AbstractResponseTestCase; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.ml.action.MlInfoAction.Response; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/NodeAttributesTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/NodeAttributesTests.java index c3309a324c4e0..4df2d41ca9835 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/NodeAttributesTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/NodeAttributesTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/OpenJobRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/OpenJobRequestTests.java index 24890099c86db..cf6b4c5a0857c 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/OpenJobRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/OpenJobRequestTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.client.ml.job.config.JobTests; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/OpenJobResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/OpenJobResponseTests.java index 6db27e6e8b865..7d6e97add59ae 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/OpenJobResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/OpenJobResponseTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PostCalendarEventRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PostCalendarEventRequestTests.java index d57cd8894485f..1d678c41d05ef 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PostCalendarEventRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PostCalendarEventRequestTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.client.ml.calendars.ScheduledEvent; import org.elasticsearch.client.ml.calendars.ScheduledEventTests; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PostCalendarEventResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PostCalendarEventResponseTests.java index 9f0ff041e82c3..bfcfda7e6f097 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PostCalendarEventResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PostCalendarEventResponseTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.client.ml.calendars.ScheduledEvent; import org.elasticsearch.client.ml.calendars.ScheduledEventTests; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PostDataRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PostDataRequestTests.java index a830d80d0fae2..adf535fe47591 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PostDataRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PostDataRequestTests.java @@ -7,8 +7,8 @@ */ package org.elasticsearch.client.ml; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PostDataResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PostDataResponseTests.java index 45f91d82d174a..541decb78d07c 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PostDataResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PostDataResponseTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.ml; import org.elasticsearch.client.ml.job.process.DataCountsTests; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PreviewDatafeedRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PreviewDatafeedRequestTests.java index 31e3bc1c4bda8..b491ebced781d 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PreviewDatafeedRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PreviewDatafeedRequestTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.client.ml.datafeed.DatafeedConfigTests; import org.elasticsearch.client.ml.job.config.JobTests; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PreviewDatafeedResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PreviewDatafeedResponseTests.java index 379c59760ab06..091e7454214d5 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PreviewDatafeedResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PreviewDatafeedResponseTests.java @@ -12,8 +12,8 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PutCalendarActionResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PutCalendarActionResponseTests.java index 9bae28ac88a39..025861252ed81 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PutCalendarActionResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PutCalendarActionResponseTests.java @@ -9,8 +9,8 @@ import com.carrotsearch.randomizedtesting.generators.CodepointSetGenerator; import org.elasticsearch.client.AbstractResponseTestCase; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.ml.action.PutCalendarAction; import org.elasticsearch.xpack.core.ml.calendars.Calendar; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PutCalendarRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PutCalendarRequestTests.java index 6c7ff90ad2c14..6fa2fb108a0b8 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PutCalendarRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PutCalendarRequestTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.client.ml.calendars.Calendar; import org.elasticsearch.client.ml.calendars.CalendarTests; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PutCalendarResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PutCalendarResponseTests.java index f88a4e6bc69b1..c6b281d6ee6fd 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PutCalendarResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PutCalendarResponseTests.java @@ -9,7 +9,7 @@ package org.elasticsearch.client.ml; import org.elasticsearch.client.ml.calendars.CalendarTests; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PutDataFrameAnalyticsRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PutDataFrameAnalyticsRequestTests.java index 877bfadfcad52..da634d37058a4 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PutDataFrameAnalyticsRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PutDataFrameAnalyticsRequestTests.java @@ -13,8 +13,8 @@ import org.elasticsearch.client.ml.dataframe.DataFrameAnalyticsConfigTests; import org.elasticsearch.client.ml.dataframe.MlDataFrameAnalysisNamedXContentProvider; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.SearchModule; import org.elasticsearch.test.AbstractXContentTestCase; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PutDatafeedRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PutDatafeedRequestTests.java index 78e8f09029a80..c8a9676cbb5ea 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PutDatafeedRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PutDatafeedRequestTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.client.ml.datafeed.DatafeedConfig; import org.elasticsearch.client.ml.datafeed.DatafeedConfigTests; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PutDatafeedResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PutDatafeedResponseTests.java index b42008c3b97e1..d3d717782cd27 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PutDatafeedResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PutDatafeedResponseTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.ml; import org.elasticsearch.client.ml.datafeed.DatafeedConfigTests; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PutFilterRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PutFilterRequestTests.java index db4bf4e5172bd..fc334d4cb02ba 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PutFilterRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PutFilterRequestTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.client.ml.job.config.MlFilter; import org.elasticsearch.client.ml.job.config.MlFilterTests; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PutFilterResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PutFilterResponseTests.java index a72d473e12189..e3ce9efadaa95 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PutFilterResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PutFilterResponseTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.ml; import org.elasticsearch.client.ml.job.config.MlFilterTests; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PutJobRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PutJobRequestTests.java index b1a110f1cea2a..3529c9119b9d3 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PutJobRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PutJobRequestTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.client.ml.job.config.Job; import org.elasticsearch.client.ml.job.config.JobTests; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PutJobResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PutJobResponseTests.java index aa265778c2baf..a10e310ee32d3 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PutJobResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PutJobResponseTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.ml; import org.elasticsearch.client.ml.job.config.JobTests; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PutTrainedModelActionRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PutTrainedModelActionRequestTests.java index d5ed00220ca47..ead466a7f2bad 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PutTrainedModelActionRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PutTrainedModelActionRequestTests.java @@ -10,8 +10,8 @@ import org.elasticsearch.client.ml.inference.MlInferenceNamedXContentProvider; import org.elasticsearch.client.ml.inference.TrainedModelConfig; import org.elasticsearch.client.ml.inference.TrainedModelConfigTests; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PutTrainedModelActionResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PutTrainedModelActionResponseTests.java index 483a76a4a3630..25aa3aab8063b 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PutTrainedModelActionResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/PutTrainedModelActionResponseTests.java @@ -10,8 +10,8 @@ import org.elasticsearch.client.ml.inference.MlInferenceNamedXContentProvider; import org.elasticsearch.client.ml.inference.TrainedModelConfig; import org.elasticsearch.client.ml.inference.TrainedModelConfigTests; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/RevertModelSnapshotRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/RevertModelSnapshotRequestTests.java index 999db5b957b22..dd6633a16019f 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/RevertModelSnapshotRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/RevertModelSnapshotRequestTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/RevertModelSnapshotResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/RevertModelSnapshotResponseTests.java index 5437d1f5c9294..0c0f268e7ea67 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/RevertModelSnapshotResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/RevertModelSnapshotResponseTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.client.ml.job.process.ModelSnapshot; import org.elasticsearch.client.ml.job.process.ModelSnapshotTests; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/StartDataFrameAnalyticsResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/StartDataFrameAnalyticsResponseTests.java index 95ed03658eaf6..eb83d0affaab1 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/StartDataFrameAnalyticsResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/StartDataFrameAnalyticsResponseTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/StartDatafeedRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/StartDatafeedRequestTests.java index a7c48cffaeecc..79e80dae95766 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/StartDatafeedRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/StartDatafeedRequestTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.client.ml.datafeed.DatafeedConfigTests; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/StartDatafeedResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/StartDatafeedResponseTests.java index d54fc0eb4e1ec..30057eac354f1 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/StartDatafeedResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/StartDatafeedResponseTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/StopDataFrameAnalyticsResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/StopDataFrameAnalyticsResponseTests.java index 39626086cef9b..f7ba89de54d7f 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/StopDataFrameAnalyticsResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/StopDataFrameAnalyticsResponseTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/StopDatafeedRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/StopDatafeedRequestTests.java index 3da34be519bcb..7c5c3583ba019 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/StopDatafeedRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/StopDatafeedRequestTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.ml; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/StopDatafeedResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/StopDatafeedResponseTests.java index 1a3598f49bbfc..3b409599ef745 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/StopDatafeedResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/StopDatafeedResponseTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/UpdateDataFrameAnalyticsRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/UpdateDataFrameAnalyticsRequestTests.java index 69a11b0fdebd0..61443100f2b5c 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/UpdateDataFrameAnalyticsRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/UpdateDataFrameAnalyticsRequestTests.java @@ -13,8 +13,8 @@ import org.elasticsearch.client.ml.dataframe.DataFrameAnalyticsConfigUpdateTests; import org.elasticsearch.client.ml.dataframe.MlDataFrameAnalysisNamedXContentProvider; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.SearchModule; import org.elasticsearch.test.AbstractXContentTestCase; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/UpdateDatafeedRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/UpdateDatafeedRequestTests.java index bb8d8388d52b8..27a1de020b1fb 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/UpdateDatafeedRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/UpdateDatafeedRequestTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.client.ml.datafeed.DatafeedUpdate; import org.elasticsearch.client.ml.datafeed.DatafeedUpdateTests; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/UpdateFilterRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/UpdateFilterRequestTests.java index bf84188b5053d..3b2dc2fc42637 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/UpdateFilterRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/UpdateFilterRequestTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.util.ArrayList; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/UpdateJobRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/UpdateJobRequestTests.java index 4b9974b9329f0..c3a30a7fb5654 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/UpdateJobRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/UpdateJobRequestTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.client.ml.job.config.JobTests; import org.elasticsearch.client.ml.job.config.JobUpdate; import org.elasticsearch.client.ml.job.config.JobUpdateTests; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/UpdateModelSnapshotRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/UpdateModelSnapshotRequestTests.java index 7baaab3f75393..0c971c144407b 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/UpdateModelSnapshotRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/UpdateModelSnapshotRequestTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/UpdateModelSnapshotResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/UpdateModelSnapshotResponseTests.java index cca483e936bbd..43845a1d9292e 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/UpdateModelSnapshotResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/UpdateModelSnapshotResponseTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.client.ml.job.process.ModelSnapshot; import org.elasticsearch.client.ml.job.process.ModelSnapshotTests; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/UpgradeJobModelSnapshotRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/UpgradeJobModelSnapshotRequestTests.java index fef85fe1facdc..de71552778249 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/UpgradeJobModelSnapshotRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/UpgradeJobModelSnapshotRequestTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/UpgradeJobModelSnapshotResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/UpgradeJobModelSnapshotResponseTests.java index 5ef62cbbb7227..440d570459109 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/UpgradeJobModelSnapshotResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/UpgradeJobModelSnapshotResponseTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/calendars/CalendarTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/calendars/CalendarTests.java index 5f9bf8d7bf20c..783369a865701 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/calendars/CalendarTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/calendars/CalendarTests.java @@ -9,7 +9,7 @@ package org.elasticsearch.client.ml.calendars; import com.carrotsearch.randomizedtesting.generators.CodepointSetGenerator; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/calendars/ScheduledEventTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/calendars/ScheduledEventTests.java index 65f7f28b3433e..28dedbc322b7a 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/calendars/ScheduledEventTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/calendars/ScheduledEventTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.core.Nullable; import org.elasticsearch.common.time.DateUtils; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.util.Date; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/datafeed/ChunkingConfigTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/datafeed/ChunkingConfigTests.java index f66e7d75c8a52..72e2de0ee6f71 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/datafeed/ChunkingConfigTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/datafeed/ChunkingConfigTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.ml.datafeed; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.util.Arrays; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/datafeed/DatafeedConfigTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/datafeed/DatafeedConfigTests.java index 4a621f2e7f035..57723c63ea3cd 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/datafeed/DatafeedConfigTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/datafeed/DatafeedConfigTests.java @@ -10,11 +10,11 @@ import com.carrotsearch.randomizedtesting.generators.CodepointSetGenerator; import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.search.aggregations.AggregationBuilders; import org.elasticsearch.search.aggregations.AggregatorFactories; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/datafeed/DatafeedStatsTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/datafeed/DatafeedStatsTests.java index 526d8d625dff6..b582a5452e460 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/datafeed/DatafeedStatsTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/datafeed/DatafeedStatsTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.client.ml.NodeAttributes; import org.elasticsearch.client.ml.NodeAttributesTests; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/datafeed/DatafeedTimingStatsTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/datafeed/DatafeedTimingStatsTests.java index dc8d625c00bcb..e83cd82f16514 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/datafeed/DatafeedTimingStatsTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/datafeed/DatafeedTimingStatsTests.java @@ -7,10 +7,10 @@ */ package org.elasticsearch.client.ml.datafeed; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/datafeed/DatafeedUpdateTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/datafeed/DatafeedUpdateTests.java index 2cb8885e28997..fdaa20a30c6bf 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/datafeed/DatafeedUpdateTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/datafeed/DatafeedUpdateTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.search.aggregations.AggregationBuilders; import org.elasticsearch.search.aggregations.AggregatorFactories; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/datafeed/DelayedDataCheckConfigTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/datafeed/DelayedDataCheckConfigTests.java index 9c3bcd3f42e88..60511820e32f6 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/datafeed/DelayedDataCheckConfigTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/datafeed/DelayedDataCheckConfigTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.ml.datafeed; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import static org.hamcrest.Matchers.equalTo; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/ClassificationTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/ClassificationTests.java index 3df63ac0109f5..6ffc9cd4e4487 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/ClassificationTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/ClassificationTests.java @@ -11,8 +11,8 @@ import org.elasticsearch.client.ml.inference.preprocessing.FrequencyEncodingTests; import org.elasticsearch.client.ml.inference.preprocessing.OneHotEncodingTests; import org.elasticsearch.client.ml.inference.preprocessing.TargetMeanEncodingTests; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/DataFrameAnalyticsConfigTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/DataFrameAnalyticsConfigTests.java index 6714a07b67e2e..0b1d7bfc5bfac 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/DataFrameAnalyticsConfigTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/DataFrameAnalyticsConfigTests.java @@ -13,8 +13,8 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.SearchModule; import org.elasticsearch.search.fetch.subphase.FetchSourceContext; import org.elasticsearch.test.AbstractXContentTestCase; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/DataFrameAnalyticsConfigUpdateTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/DataFrameAnalyticsConfigUpdateTests.java index e4fe78a7c6db4..b1005e42b803a 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/DataFrameAnalyticsConfigUpdateTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/DataFrameAnalyticsConfigUpdateTests.java @@ -10,8 +10,8 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.SearchModule; import org.elasticsearch.test.AbstractXContentTestCase; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/DataFrameAnalyticsDestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/DataFrameAnalyticsDestTests.java index 385ed819d4814..9794270cee3ed 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/DataFrameAnalyticsDestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/DataFrameAnalyticsDestTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.ml.dataframe; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/DataFrameAnalyticsSourceTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/DataFrameAnalyticsSourceTests.java index 162e80acc9204..650aef9c13cbe 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/DataFrameAnalyticsSourceTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/DataFrameAnalyticsSourceTests.java @@ -9,8 +9,8 @@ package org.elasticsearch.client.ml.dataframe; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.SearchModule; import org.elasticsearch.search.fetch.subphase.FetchSourceContext; import org.elasticsearch.test.AbstractXContentTestCase; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/DataFrameAnalyticsStatsTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/DataFrameAnalyticsStatsTests.java index 52aac8a374baa..5242e44b45b9e 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/DataFrameAnalyticsStatsTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/DataFrameAnalyticsStatsTests.java @@ -16,8 +16,8 @@ import org.elasticsearch.client.ml.dataframe.stats.common.MemoryUsageTests; import org.elasticsearch.client.ml.dataframe.stats.outlierdetection.OutlierDetectionStatsTests; import org.elasticsearch.client.ml.dataframe.stats.regression.RegressionStatsTests; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/OutlierDetectionTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/OutlierDetectionTests.java index fdffbd9115523..03ebd0e7b7b5f 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/OutlierDetectionTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/OutlierDetectionTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.ml.dataframe; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/PhaseProgressTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/PhaseProgressTests.java index 6ed8e04962ca3..b188909c534e3 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/PhaseProgressTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/PhaseProgressTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml.dataframe; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/QueryConfigTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/QueryConfigTests.java index fd481ca0c38e4..895a99cbfa692 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/QueryConfigTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/QueryConfigTests.java @@ -9,8 +9,8 @@ package org.elasticsearch.client.ml.dataframe; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.query.MatchAllQueryBuilder; import org.elasticsearch.index.query.MatchNoneQueryBuilder; import org.elasticsearch.index.query.QueryBuilder; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/RegressionTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/RegressionTests.java index 525235b687490..bf1c2be41fdeb 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/RegressionTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/RegressionTests.java @@ -11,8 +11,8 @@ import org.elasticsearch.client.ml.inference.preprocessing.FrequencyEncodingTests; import org.elasticsearch.client.ml.inference.preprocessing.OneHotEncodingTests; import org.elasticsearch.client.ml.inference.preprocessing.TargetMeanEncodingTests; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/AccuracyMetricResultTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/AccuracyMetricResultTests.java index 47aa46c750d60..f7e698da598ab 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/AccuracyMetricResultTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/AccuracyMetricResultTests.java @@ -9,8 +9,8 @@ import org.elasticsearch.client.ml.dataframe.evaluation.MlEvaluationNamedXContentProvider; import org.elasticsearch.client.ml.dataframe.evaluation.classification.AccuracyMetric.Result; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/AccuracyMetricTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/AccuracyMetricTests.java index 470dd7717b9a2..2d845881fe7a4 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/AccuracyMetricTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/AccuracyMetricTests.java @@ -8,8 +8,8 @@ package org.elasticsearch.client.ml.dataframe.evaluation.classification; import org.elasticsearch.client.ml.dataframe.evaluation.MlEvaluationNamedXContentProvider; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/AucRocMetricTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/AucRocMetricTests.java index 191d5ed69ea6c..1ddf3363152c0 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/AucRocMetricTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/AucRocMetricTests.java @@ -8,8 +8,8 @@ package org.elasticsearch.client.ml.dataframe.evaluation.classification; import org.elasticsearch.client.ml.dataframe.evaluation.MlEvaluationNamedXContentProvider; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/ClassificationTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/ClassificationTests.java index 262638baa73af..e54ba37ff1f79 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/ClassificationTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/ClassificationTests.java @@ -9,8 +9,8 @@ import org.elasticsearch.client.ml.dataframe.evaluation.EvaluationMetric; import org.elasticsearch.client.ml.dataframe.evaluation.MlEvaluationNamedXContentProvider; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/MulticlassConfusionMatrixMetricResultTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/MulticlassConfusionMatrixMetricResultTests.java index 63a5a2257f98a..83150f30fbe39 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/MulticlassConfusionMatrixMetricResultTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/MulticlassConfusionMatrixMetricResultTests.java @@ -11,8 +11,8 @@ import org.elasticsearch.client.ml.dataframe.evaluation.classification.MulticlassConfusionMatrixMetric.ActualClass; import org.elasticsearch.client.ml.dataframe.evaluation.classification.MulticlassConfusionMatrixMetric.PredictedClass; import org.elasticsearch.client.ml.dataframe.evaluation.classification.MulticlassConfusionMatrixMetric.Result; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/MulticlassConfusionMatrixMetricTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/MulticlassConfusionMatrixMetricTests.java index 8163f5fa2110c..a7e6a9c017da1 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/MulticlassConfusionMatrixMetricTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/MulticlassConfusionMatrixMetricTests.java @@ -8,8 +8,8 @@ package org.elasticsearch.client.ml.dataframe.evaluation.classification; import org.elasticsearch.client.ml.dataframe.evaluation.MlEvaluationNamedXContentProvider; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/PerClassSingleValueTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/PerClassSingleValueTests.java index ceb3b6c9f7ea1..41c710ba75b96 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/PerClassSingleValueTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/PerClassSingleValueTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.ml.dataframe.evaluation.classification; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/PrecisionMetricResultTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/PrecisionMetricResultTests.java index 87fc69ae493dd..8fccc61e9e756 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/PrecisionMetricResultTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/PrecisionMetricResultTests.java @@ -9,8 +9,8 @@ import org.elasticsearch.client.ml.dataframe.evaluation.MlEvaluationNamedXContentProvider; import org.elasticsearch.client.ml.dataframe.evaluation.classification.PrecisionMetric.Result; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/PrecisionMetricTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/PrecisionMetricTests.java index 5eff280a33414..fa17f2f504e13 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/PrecisionMetricTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/PrecisionMetricTests.java @@ -8,8 +8,8 @@ package org.elasticsearch.client.ml.dataframe.evaluation.classification; import org.elasticsearch.client.ml.dataframe.evaluation.MlEvaluationNamedXContentProvider; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/RecallMetricResultTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/RecallMetricResultTests.java index 0a7d863123588..e0a562537d81a 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/RecallMetricResultTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/RecallMetricResultTests.java @@ -9,8 +9,8 @@ import org.elasticsearch.client.ml.dataframe.evaluation.MlEvaluationNamedXContentProvider; import org.elasticsearch.client.ml.dataframe.evaluation.classification.RecallMetric.Result; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/RecallMetricTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/RecallMetricTests.java index e1557dfdafeb3..d0173edcc74ab 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/RecallMetricTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/classification/RecallMetricTests.java @@ -8,8 +8,8 @@ package org.elasticsearch.client.ml.dataframe.evaluation.classification; import org.elasticsearch.client.ml.dataframe.evaluation.MlEvaluationNamedXContentProvider; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/common/AucRocPointTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/common/AucRocPointTests.java index f60a852072b55..20510509120ba 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/common/AucRocPointTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/common/AucRocPointTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml.dataframe.evaluation.common; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/common/AucRocResultTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/common/AucRocResultTests.java index 1233bae6d9448..36063b63fa29a 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/common/AucRocResultTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/common/AucRocResultTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.ml.dataframe.evaluation.common; import org.elasticsearch.client.ml.dataframe.evaluation.EvaluationMetric; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/outlierdetection/AucRocMetricTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/outlierdetection/AucRocMetricTests.java index 68b8f0a497f1e..5187263dbc852 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/outlierdetection/AucRocMetricTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/outlierdetection/AucRocMetricTests.java @@ -8,8 +8,8 @@ package org.elasticsearch.client.ml.dataframe.evaluation.outlierdetection; import org.elasticsearch.client.ml.dataframe.evaluation.MlEvaluationNamedXContentProvider; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/outlierdetection/ConfusionMatrixMetricConfusionMatrixTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/outlierdetection/ConfusionMatrixMetricConfusionMatrixTests.java index 260b54db77586..1609abd80dd4c 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/outlierdetection/ConfusionMatrixMetricConfusionMatrixTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/outlierdetection/ConfusionMatrixMetricConfusionMatrixTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml.dataframe.evaluation.outlierdetection; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/outlierdetection/ConfusionMatrixMetricResultTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/outlierdetection/ConfusionMatrixMetricResultTests.java index 165e8fc3cd4a9..677c09f813d1b 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/outlierdetection/ConfusionMatrixMetricResultTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/outlierdetection/ConfusionMatrixMetricResultTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml.dataframe.evaluation.outlierdetection; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/outlierdetection/OutlierDetectionTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/outlierdetection/OutlierDetectionTests.java index bc76039211716..dd52412e3133c 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/outlierdetection/OutlierDetectionTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/outlierdetection/OutlierDetectionTests.java @@ -9,8 +9,8 @@ import org.elasticsearch.client.ml.dataframe.evaluation.EvaluationMetric; import org.elasticsearch.client.ml.dataframe.evaluation.MlEvaluationNamedXContentProvider; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/outlierdetection/PrecisionMetricResultTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/outlierdetection/PrecisionMetricResultTests.java index 3bca95c1bcc14..9e1974f8cd545 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/outlierdetection/PrecisionMetricResultTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/outlierdetection/PrecisionMetricResultTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml.dataframe.evaluation.outlierdetection; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/outlierdetection/RecallMetricResultTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/outlierdetection/RecallMetricResultTests.java index 47243e57696b5..d28a8bed69309 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/outlierdetection/RecallMetricResultTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/outlierdetection/RecallMetricResultTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml.dataframe.evaluation.outlierdetection; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/regression/HuberMetricResultTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/regression/HuberMetricResultTests.java index 569f1f1a3e4c3..f2c6a0ccf7812 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/regression/HuberMetricResultTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/regression/HuberMetricResultTests.java @@ -8,8 +8,8 @@ package org.elasticsearch.client.ml.dataframe.evaluation.regression; import org.elasticsearch.client.ml.dataframe.evaluation.MlEvaluationNamedXContentProvider; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/regression/HuberMetricTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/regression/HuberMetricTests.java index fd3641e49057d..3998e7ca6ceba 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/regression/HuberMetricTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/regression/HuberMetricTests.java @@ -8,8 +8,8 @@ package org.elasticsearch.client.ml.dataframe.evaluation.regression; import org.elasticsearch.client.ml.dataframe.evaluation.MlEvaluationNamedXContentProvider; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/regression/MeanSquaredErrorMetricResultTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/regression/MeanSquaredErrorMetricResultTests.java index 27aed362c3158..d2c50fa37ce12 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/regression/MeanSquaredErrorMetricResultTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/regression/MeanSquaredErrorMetricResultTests.java @@ -8,8 +8,8 @@ package org.elasticsearch.client.ml.dataframe.evaluation.regression; import org.elasticsearch.client.ml.dataframe.evaluation.MlEvaluationNamedXContentProvider; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/regression/MeanSquaredErrorMetricTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/regression/MeanSquaredErrorMetricTests.java index fb9fb31a75b90..17a2d49ad7d5b 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/regression/MeanSquaredErrorMetricTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/regression/MeanSquaredErrorMetricTests.java @@ -8,8 +8,8 @@ package org.elasticsearch.client.ml.dataframe.evaluation.regression; import org.elasticsearch.client.ml.dataframe.evaluation.MlEvaluationNamedXContentProvider; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/regression/MeanSquaredLogarithmicErrorMetricResultTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/regression/MeanSquaredLogarithmicErrorMetricResultTests.java index d4a080420aa19..2907d21e7d72d 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/regression/MeanSquaredLogarithmicErrorMetricResultTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/regression/MeanSquaredLogarithmicErrorMetricResultTests.java @@ -8,8 +8,8 @@ package org.elasticsearch.client.ml.dataframe.evaluation.regression; import org.elasticsearch.client.ml.dataframe.evaluation.MlEvaluationNamedXContentProvider; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/regression/MeanSquaredLogarithmicErrorMetricTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/regression/MeanSquaredLogarithmicErrorMetricTests.java index bd51014eedee5..afdb12b3c7e58 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/regression/MeanSquaredLogarithmicErrorMetricTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/regression/MeanSquaredLogarithmicErrorMetricTests.java @@ -8,8 +8,8 @@ package org.elasticsearch.client.ml.dataframe.evaluation.regression; import org.elasticsearch.client.ml.dataframe.evaluation.MlEvaluationNamedXContentProvider; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/regression/RSquaredMetricResultTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/regression/RSquaredMetricResultTests.java index 58336854e700f..3e66d9945ff04 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/regression/RSquaredMetricResultTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/regression/RSquaredMetricResultTests.java @@ -8,8 +8,8 @@ package org.elasticsearch.client.ml.dataframe.evaluation.regression; import org.elasticsearch.client.ml.dataframe.evaluation.MlEvaluationNamedXContentProvider; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/regression/RSquaredMetricTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/regression/RSquaredMetricTests.java index 69ab7bb2e523f..9a252521ed5fb 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/regression/RSquaredMetricTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/regression/RSquaredMetricTests.java @@ -8,8 +8,8 @@ package org.elasticsearch.client.ml.dataframe.evaluation.regression; import org.elasticsearch.client.ml.dataframe.evaluation.MlEvaluationNamedXContentProvider; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/regression/RegressionTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/regression/RegressionTests.java index 60bece6acd7df..74208f20a8d8b 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/regression/RegressionTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/evaluation/regression/RegressionTests.java @@ -9,8 +9,8 @@ import org.elasticsearch.client.ml.dataframe.evaluation.EvaluationMetric; import org.elasticsearch.client.ml.dataframe.evaluation.MlEvaluationNamedXContentProvider; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/explain/FieldSelectionTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/explain/FieldSelectionTests.java index 015557f7521e8..d9fe7f32eaa53 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/explain/FieldSelectionTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/explain/FieldSelectionTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml.dataframe.explain; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/explain/MemoryEstimationTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/explain/MemoryEstimationTests.java index 6296a4333b14f..1daca9d6c9055 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/explain/MemoryEstimationTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/explain/MemoryEstimationTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.ml.dataframe.explain; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/stats/classification/ClassificationStatsTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/stats/classification/ClassificationStatsTests.java index 9688b51d88b15..a96e11caeb222 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/stats/classification/ClassificationStatsTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/stats/classification/ClassificationStatsTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml.dataframe.stats.classification; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/stats/classification/HyperparametersTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/stats/classification/HyperparametersTests.java index 480aae4bfdf36..21fb7483d5d46 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/stats/classification/HyperparametersTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/stats/classification/HyperparametersTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml.dataframe.stats.classification; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/stats/classification/TimingStatsTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/stats/classification/TimingStatsTests.java index b4d9876af3343..c66f8bbc6b6ed 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/stats/classification/TimingStatsTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/stats/classification/TimingStatsTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.ml.dataframe.stats.classification; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/stats/classification/ValidationLossTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/stats/classification/ValidationLossTests.java index afcecf4b434e4..37bd9ddc5c7c7 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/stats/classification/ValidationLossTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/stats/classification/ValidationLossTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.ml.dataframe.stats.classification; import org.elasticsearch.client.ml.dataframe.stats.common.FoldValuesTests; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/stats/common/DataCountsTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/stats/common/DataCountsTests.java index 84e96bddfe00d..b3ef85beaf4ba 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/stats/common/DataCountsTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/stats/common/DataCountsTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.ml.dataframe.stats.common; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/stats/common/FoldValuesTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/stats/common/FoldValuesTests.java index c001723d323b1..495156d4a1741 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/stats/common/FoldValuesTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/stats/common/FoldValuesTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml.dataframe.stats.common; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/stats/common/MemoryUsageTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/stats/common/MemoryUsageTests.java index 7ea1806ed4946..ef6b7740eb552 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/stats/common/MemoryUsageTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/stats/common/MemoryUsageTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml.dataframe.stats.common; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/stats/outlierdetection/OutlierDetectionStatsTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/stats/outlierdetection/OutlierDetectionStatsTests.java index 3ec79ee689e4d..684a76bc09b6c 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/stats/outlierdetection/OutlierDetectionStatsTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/stats/outlierdetection/OutlierDetectionStatsTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml.dataframe.stats.outlierdetection; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/stats/outlierdetection/ParametersTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/stats/outlierdetection/ParametersTests.java index 19a526d67b288..9aa393c93e4ec 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/stats/outlierdetection/ParametersTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/stats/outlierdetection/ParametersTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml.dataframe.stats.outlierdetection; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/stats/outlierdetection/TimingStatsTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/stats/outlierdetection/TimingStatsTests.java index 047f93fcda4dd..0f84c0d4cb56b 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/stats/outlierdetection/TimingStatsTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/stats/outlierdetection/TimingStatsTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.ml.dataframe.stats.outlierdetection; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/stats/regression/HyperparametersTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/stats/regression/HyperparametersTests.java index cc32240e85136..4b58e3fc2b748 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/stats/regression/HyperparametersTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/stats/regression/HyperparametersTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml.dataframe.stats.regression; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/stats/regression/RegressionStatsTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/stats/regression/RegressionStatsTests.java index f1bf24ec97e11..57794a9a0b5db 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/stats/regression/RegressionStatsTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/stats/regression/RegressionStatsTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml.dataframe.stats.regression; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/stats/regression/TimingStatsTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/stats/regression/TimingStatsTests.java index 7246434617068..a3785cac53f79 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/stats/regression/TimingStatsTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/stats/regression/TimingStatsTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.ml.dataframe.stats.regression; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/stats/regression/ValidationLossTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/stats/regression/ValidationLossTests.java index ba8e4742c2970..406399be3db93 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/stats/regression/ValidationLossTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/dataframe/stats/regression/ValidationLossTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.ml.dataframe.stats.regression; import org.elasticsearch.client.ml.dataframe.stats.common.FoldValuesTests; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/IndexLocationTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/IndexLocationTests.java index f64c70f2acc7c..b82ef4e4df2c0 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/IndexLocationTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/IndexLocationTests.java @@ -9,7 +9,7 @@ package org.elasticsearch.client.ml.inference; import org.elasticsearch.client.ml.inference.trainedmodel.IndexLocation; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/InferenceToXContentCompressorTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/InferenceToXContentCompressorTests.java index 39702b09d18a4..72ff4856a32cf 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/InferenceToXContentCompressorTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/InferenceToXContentCompressorTests.java @@ -9,10 +9,10 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/NamedXContentObjectHelperTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/NamedXContentObjectHelperTests.java index 92099c5131f13..e4d36a1cfe406 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/NamedXContentObjectHelperTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/NamedXContentObjectHelperTests.java @@ -7,14 +7,14 @@ */ package org.elasticsearch.client.ml.inference; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.search.SearchModule; import org.elasticsearch.test.ESTestCase; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/TrainedModelConfigTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/TrainedModelConfigTests.java index 3a26c7701411e..93ccbfe0b7bbb 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/TrainedModelConfigTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/TrainedModelConfigTests.java @@ -12,8 +12,8 @@ import org.elasticsearch.client.ml.inference.trainedmodel.RegressionConfigTests; import org.elasticsearch.client.ml.inference.trainedmodel.TargetType; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.SearchModule; import org.elasticsearch.test.AbstractXContentTestCase; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/TrainedModelDefinitionTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/TrainedModelDefinitionTests.java index eebf8f804ae73..5be1e97566ddb 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/TrainedModelDefinitionTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/TrainedModelDefinitionTests.java @@ -16,8 +16,8 @@ import org.elasticsearch.client.ml.inference.trainedmodel.ensemble.EnsembleTests; import org.elasticsearch.client.ml.inference.trainedmodel.tree.TreeTests; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.SearchModule; import org.elasticsearch.test.AbstractXContentTestCase; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/TrainedModelInputTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/TrainedModelInputTests.java index 5676a3f24c0b0..2ea43f6c962d4 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/TrainedModelInputTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/TrainedModelInputTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml.inference; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/TrainedModelStatsTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/TrainedModelStatsTests.java index f66c116664b1f..00361b3406875 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/TrainedModelStatsTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/TrainedModelStatsTests.java @@ -9,11 +9,11 @@ import org.elasticsearch.client.ml.inference.trainedmodel.InferenceStatsTests; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.ingest.IngestStats; import org.elasticsearch.test.AbstractXContentTestCase; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/preprocessing/CustomWordEmbeddingTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/preprocessing/CustomWordEmbeddingTests.java index ba6d3dfb155a2..9eecf3511873e 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/preprocessing/CustomWordEmbeddingTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/preprocessing/CustomWordEmbeddingTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml.inference.preprocessing; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/preprocessing/FrequencyEncodingTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/preprocessing/FrequencyEncodingTests.java index f42f8ae264757..98422e7b1a9db 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/preprocessing/FrequencyEncodingTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/preprocessing/FrequencyEncodingTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml.inference.preprocessing; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/preprocessing/MultiTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/preprocessing/MultiTests.java index e55c104c22c09..2f0192050a049 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/preprocessing/MultiTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/preprocessing/MultiTests.java @@ -8,8 +8,8 @@ package org.elasticsearch.client.ml.inference.preprocessing; import org.elasticsearch.client.ml.inference.MlInferenceNamedXContentProvider; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/preprocessing/NGramTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/preprocessing/NGramTests.java index 812f97ece2d23..f430de1ea282a 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/preprocessing/NGramTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/preprocessing/NGramTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml.inference.preprocessing; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/preprocessing/OneHotEncodingTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/preprocessing/OneHotEncodingTests.java index fdb64ba3af507..739163381f22d 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/preprocessing/OneHotEncodingTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/preprocessing/OneHotEncodingTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml.inference.preprocessing; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/preprocessing/TargetMeanEncodingTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/preprocessing/TargetMeanEncodingTests.java index 9ba7b66eaecab..cc4c1a00d00a9 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/preprocessing/TargetMeanEncodingTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/preprocessing/TargetMeanEncodingTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml.inference.preprocessing; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/results/FeatureImportanceTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/results/FeatureImportanceTests.java index 42b6fa6840b24..4fa2c8a92c876 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/results/FeatureImportanceTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/results/FeatureImportanceTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.ml.inference.results; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import org.elasticsearch.test.ESTestCase; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/results/TopClassEntryTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/results/TopClassEntryTests.java index 2d0b01efddcb6..7153b7bf39fb0 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/results/TopClassEntryTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/results/TopClassEntryTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.ml.inference.results; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/trainedmodel/ClassificationConfigTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/trainedmodel/ClassificationConfigTests.java index fa4343c8f0996..05470985c61f9 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/trainedmodel/ClassificationConfigTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/trainedmodel/ClassificationConfigTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.ml.inference.trainedmodel; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/trainedmodel/InferenceStatsTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/trainedmodel/InferenceStatsTests.java index 77c15319326e0..c1666fc850dd0 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/trainedmodel/InferenceStatsTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/trainedmodel/InferenceStatsTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.ml.inference.trainedmodel; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/trainedmodel/RegressionConfigTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/trainedmodel/RegressionConfigTests.java index 93232e8016c02..d130a01f3a9a9 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/trainedmodel/RegressionConfigTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/trainedmodel/RegressionConfigTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.ml.inference.trainedmodel; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/trainedmodel/ensemble/EnsembleTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/trainedmodel/ensemble/EnsembleTests.java index 0ab5b133675be..8505a1baf4397 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/trainedmodel/ensemble/EnsembleTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/trainedmodel/ensemble/EnsembleTests.java @@ -12,8 +12,8 @@ import org.elasticsearch.client.ml.inference.trainedmodel.TrainedModel; import org.elasticsearch.client.ml.inference.trainedmodel.tree.TreeTests; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.SearchModule; import org.elasticsearch.test.AbstractXContentTestCase; import org.elasticsearch.test.ESTestCase; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/trainedmodel/ensemble/ExponentTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/trainedmodel/ensemble/ExponentTests.java index a3dfebdd72ece..470bdf9aaa7c4 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/trainedmodel/ensemble/ExponentTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/trainedmodel/ensemble/ExponentTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml.inference.trainedmodel.ensemble; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import org.elasticsearch.test.ESTestCase; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/trainedmodel/ensemble/LogisticRegressionTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/trainedmodel/ensemble/LogisticRegressionTests.java index 4530a4fe6a527..779683c6f1ea2 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/trainedmodel/ensemble/LogisticRegressionTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/trainedmodel/ensemble/LogisticRegressionTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml.inference.trainedmodel.ensemble; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import org.elasticsearch.test.ESTestCase; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/trainedmodel/ensemble/WeightedModeTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/trainedmodel/ensemble/WeightedModeTests.java index 28ab26ad0b423..12059e98f5a31 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/trainedmodel/ensemble/WeightedModeTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/trainedmodel/ensemble/WeightedModeTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml.inference.trainedmodel.ensemble; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import org.elasticsearch.test.ESTestCase; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/trainedmodel/ensemble/WeightedSumTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/trainedmodel/ensemble/WeightedSumTests.java index 53d308095749a..88b482260f79c 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/trainedmodel/ensemble/WeightedSumTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/trainedmodel/ensemble/WeightedSumTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml.inference.trainedmodel.ensemble; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import org.elasticsearch.test.ESTestCase; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/trainedmodel/langident/LangIdentNeuralNetworkTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/trainedmodel/langident/LangIdentNeuralNetworkTests.java index 13955bb13d0a9..a6c14ad65b4e0 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/trainedmodel/langident/LangIdentNeuralNetworkTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/trainedmodel/langident/LangIdentNeuralNetworkTests.java @@ -7,8 +7,8 @@ */ package org.elasticsearch.client.ml.inference.trainedmodel.langident; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import org.elasticsearch.client.ml.inference.MlInferenceNamedXContentProvider; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/trainedmodel/langident/LangNetLayerTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/trainedmodel/langident/LangNetLayerTests.java index 6978ea3a354ac..126c336840f5d 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/trainedmodel/langident/LangNetLayerTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/trainedmodel/langident/LangNetLayerTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml.inference.trainedmodel.langident; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import org.elasticsearch.test.ESTestCase; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/trainedmodel/tree/TreeNodeTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/trainedmodel/tree/TreeNodeTests.java index d734461601be4..f2ccb705e0f93 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/trainedmodel/tree/TreeNodeTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/trainedmodel/tree/TreeNodeTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.ml.inference.trainedmodel.tree; import org.elasticsearch.client.ml.job.config.Operator; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/trainedmodel/tree/TreeTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/trainedmodel/tree/TreeTests.java index cd5beb7f104ee..37c1fa671420a 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/trainedmodel/tree/TreeTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/inference/trainedmodel/tree/TreeTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.ml.inference.trainedmodel.tree; import org.elasticsearch.client.ml.inference.trainedmodel.TargetType; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/config/AnalysisConfigTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/config/AnalysisConfigTests.java index 7f45425e7fea8..288a3402a7181 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/config/AnalysisConfigTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/config/AnalysisConfigTests.java @@ -9,8 +9,8 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.SearchModule; import org.elasticsearch.test.AbstractXContentTestCase; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/config/AnalysisLimitsTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/config/AnalysisLimitsTests.java index e38132f56ec09..b38130bb62e74 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/config/AnalysisLimitsTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/config/AnalysisLimitsTests.java @@ -7,11 +7,11 @@ */ package org.elasticsearch.client.ml.job.config; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/config/CategorizationAnalyzerConfigTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/config/CategorizationAnalyzerConfigTests.java index 572ee95be4ec8..9bb90eb8cbd8a 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/config/CategorizationAnalyzerConfigTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/config/CategorizationAnalyzerConfigTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml.job.config; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/config/DataDescriptionTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/config/DataDescriptionTests.java index 75d1ddadff769..259dddf263ce5 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/config/DataDescriptionTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/config/DataDescriptionTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml.job.config; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import static org.elasticsearch.client.ml.job.config.DataDescription.DataFormat; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/config/DetectionRuleTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/config/DetectionRuleTests.java index eeee16c290914..3315633c052a1 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/config/DetectionRuleTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/config/DetectionRuleTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml.job.config; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.util.ArrayList; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/config/DetectorTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/config/DetectorTests.java index 7da570831bcb3..5579f225ba7ca 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/config/DetectorTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/config/DetectorTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml.job.config; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.util.ArrayList; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/config/FilterRefTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/config/FilterRefTests.java index 4236c7190b295..f3c0936f78884 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/config/FilterRefTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/config/FilterRefTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml.job.config; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/config/JobTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/config/JobTests.java index 6f47e4fd98e83..56a748f1c20da 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/config/JobTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/config/JobTests.java @@ -10,11 +10,11 @@ import com.carrotsearch.randomizedtesting.generators.CodepointSetGenerator; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.search.SearchModule; import org.elasticsearch.test.AbstractXContentTestCase; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/config/JobUpdateTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/config/JobUpdateTests.java index 8731e83d7800c..91fe0d47d3213 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/config/JobUpdateTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/config/JobUpdateTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.ml.job.config; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.util.ArrayList; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/config/MlFilterTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/config/MlFilterTests.java index ae29b314f5723..83b5295ccc171 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/config/MlFilterTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/config/MlFilterTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml.job.config; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.util.SortedSet; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/config/ModelPlotConfigTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/config/ModelPlotConfigTests.java index 1b68b17efd798..f0117f74b3de6 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/config/ModelPlotConfigTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/config/ModelPlotConfigTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml.job.config; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; public class ModelPlotConfigTests extends AbstractXContentTestCase { diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/config/PerPartitionCategorizationConfigTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/config/PerPartitionCategorizationConfigTests.java index e782973bde75d..fc32469ad706c 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/config/PerPartitionCategorizationConfigTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/config/PerPartitionCategorizationConfigTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.ml.job.config; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; public class PerPartitionCategorizationConfigTests extends AbstractXContentTestCase { diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/config/RuleConditionTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/config/RuleConditionTests.java index 136644a39fb83..90a9f1a72313c 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/config/RuleConditionTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/config/RuleConditionTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml.job.config; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; public class RuleConditionTests extends AbstractXContentTestCase { diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/config/RuleScopeTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/config/RuleScopeTests.java index 08b634c1a26a9..518f19f1271e5 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/config/RuleScopeTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/config/RuleScopeTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml.job.config; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/process/DataCountsTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/process/DataCountsTests.java index baaafe7bd53ff..334444c98f2b4 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/process/DataCountsTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/process/DataCountsTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml.job.process; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.time.Instant; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/process/ModelSizeStatsTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/process/ModelSizeStatsTests.java index 7a14f43947645..83263bf5852e4 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/process/ModelSizeStatsTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/process/ModelSizeStatsTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.ml.job.process; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.util.Date; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/process/ModelSnapshotTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/process/ModelSnapshotTests.java index 19d6bd80fb349..f595881fe4b9c 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/process/ModelSnapshotTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/process/ModelSnapshotTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.Version; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.util.Date; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/process/QuantilesTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/process/QuantilesTests.java index 9799316ff032d..c3fed4fb124c4 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/process/QuantilesTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/process/QuantilesTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.ml.job.process; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.util.Date; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/process/TimingStatsTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/process/TimingStatsTests.java index 46d10624a891c..1015d14548b32 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/process/TimingStatsTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/process/TimingStatsTests.java @@ -7,10 +7,10 @@ */ package org.elasticsearch.client.ml.job.process; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/results/AnomalyCauseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/results/AnomalyCauseTests.java index a197504fcdbc3..6f8e4f75f7c9b 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/results/AnomalyCauseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/results/AnomalyCauseTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.client.ml.job.config.DetectorFunction; import org.elasticsearch.common.geo.GeoPoint; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.util.ArrayList; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/results/AnomalyRecordTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/results/AnomalyRecordTests.java index 1f14a53b02914..39896f24f6c69 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/results/AnomalyRecordTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/results/AnomalyRecordTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.client.ml.job.config.DetectorFunction; import org.elasticsearch.common.geo.GeoPoint; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.util.ArrayList; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/results/BucketInfluencerTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/results/BucketInfluencerTests.java index 59ab1f6e76ebb..1182b61327380 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/results/BucketInfluencerTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/results/BucketInfluencerTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml.job.results; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.util.Date; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/results/BucketTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/results/BucketTests.java index 33311159e3740..27468d6361cc9 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/results/BucketTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/results/BucketTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml.job.results; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.util.ArrayList; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/results/CategoryDefinitionTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/results/CategoryDefinitionTests.java index 5514b74f7612b..1301f7fb677d3 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/results/CategoryDefinitionTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/results/CategoryDefinitionTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml.job.results; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import org.elasticsearch.test.ESTestCase; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/results/InfluenceTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/results/InfluenceTests.java index 60cfe475801d8..cc8f91ad12968 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/results/InfluenceTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/results/InfluenceTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml.job.results; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.util.ArrayList; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/results/InfluencerTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/results/InfluencerTests.java index 1fd80fa8e5ca6..dbc8ca3ed7d8f 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/results/InfluencerTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/results/InfluencerTests.java @@ -9,8 +9,8 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/results/OverallBucketTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/results/OverallBucketTests.java index 5789d01adc294..0d403ef99d654 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/results/OverallBucketTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/results/OverallBucketTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml.job.results; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.util.ArrayList; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/stats/ForecastStatsTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/stats/ForecastStatsTests.java index f692763bf96d4..87e701e0e6434 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/stats/ForecastStatsTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/stats/ForecastStatsTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml.job.stats; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/stats/JobStatsTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/stats/JobStatsTests.java index 576960c89905e..900b96bef35d4 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/stats/JobStatsTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/stats/JobStatsTests.java @@ -16,7 +16,7 @@ import org.elasticsearch.client.ml.job.process.TimingStats; import org.elasticsearch.client.ml.job.process.TimingStatsTests; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.client.ml.job.config.JobState; import org.elasticsearch.client.ml.job.config.JobTests; import org.elasticsearch.test.AbstractXContentTestCase; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/stats/SimpleStatsTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/stats/SimpleStatsTests.java index f4a9702d18d28..a6d135b42b870 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/stats/SimpleStatsTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/job/stats/SimpleStatsTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.ml.job.stats; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/util/PageParamsTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/util/PageParamsTests.java index 628e6c14f1622..9eeac25d85298 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/util/PageParamsTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ml/util/PageParamsTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.ml.util; import org.elasticsearch.client.core.PageParams; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; public class PageParamsTests extends AbstractXContentTestCase { diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/rollup/GetRollupCapsResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/rollup/GetRollupCapsResponseTests.java index c834152c1b6b5..8165b2ba914a7 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/rollup/GetRollupCapsResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/rollup/GetRollupCapsResponseTests.java @@ -7,8 +7,8 @@ */ package org.elasticsearch.client.rollup; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Map; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/rollup/GetRollupIndexCapsResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/rollup/GetRollupIndexCapsResponseTests.java index fe4ce6b92227b..00b55ce576eab 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/rollup/GetRollupIndexCapsResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/rollup/GetRollupIndexCapsResponseTests.java @@ -7,8 +7,8 @@ */ package org.elasticsearch.client.rollup; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Map; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/rollup/GetRollupJobResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/rollup/GetRollupJobResponseTests.java index cfa676f47e3dd..6ec701d7a632b 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/rollup/GetRollupJobResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/rollup/GetRollupJobResponseTests.java @@ -14,8 +14,8 @@ import org.elasticsearch.client.rollup.GetRollupJobResponse.RollupIndexerJobStats; import org.elasticsearch.client.rollup.GetRollupJobResponse.RollupJobStatus; import org.elasticsearch.client.rollup.job.config.RollupJobConfigTests; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/rollup/PutRollupJobRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/rollup/PutRollupJobRequestTests.java index 576befa30a0d4..1c3e1fbdbed35 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/rollup/PutRollupJobRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/rollup/PutRollupJobRequestTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.client.rollup.job.config.RollupJobConfig; import org.elasticsearch.client.rollup.job.config.RollupJobConfigTests; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import org.junit.Before; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/rollup/RollupCapsResponseTestCase.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/rollup/RollupCapsResponseTestCase.java index 75b14ce5f2440..99376e45abcbb 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/rollup/RollupCapsResponseTestCase.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/rollup/RollupCapsResponseTestCase.java @@ -15,8 +15,8 @@ import org.elasticsearch.client.rollup.job.config.RollupJobConfigTests; import org.elasticsearch.client.rollup.job.config.TermsGroupConfig; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramAggregationBuilder; import org.elasticsearch.search.aggregations.bucket.histogram.HistogramAggregationBuilder; import org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/rollup/job/config/DateHistogramGroupConfigTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/rollup/job/config/DateHistogramGroupConfigTests.java index 4a98e284e1896..65e8273c65c2a 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/rollup/job/config/DateHistogramGroupConfigTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/rollup/job/config/DateHistogramGroupConfigTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.rollup.job.config; import org.elasticsearch.client.ValidationException; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramInterval; import org.elasticsearch.test.AbstractXContentTestCase; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/rollup/job/config/GroupConfigTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/rollup/job/config/GroupConfigTests.java index 61aeaef634ad0..3a4b67be3a425 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/rollup/job/config/GroupConfigTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/rollup/job/config/GroupConfigTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.rollup.job.config; import org.elasticsearch.client.ValidationException; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/rollup/job/config/HistogramGroupConfigTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/rollup/job/config/HistogramGroupConfigTests.java index ee9df1820c4d3..ed6391b5cf288 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/rollup/job/config/HistogramGroupConfigTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/rollup/job/config/HistogramGroupConfigTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.client.ValidationException; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/rollup/job/config/MetricConfigTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/rollup/job/config/MetricConfigTests.java index 7c6809b902c2c..19d6527ea5aa7 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/rollup/job/config/MetricConfigTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/rollup/job/config/MetricConfigTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.rollup.job.config; import org.elasticsearch.client.ValidationException; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/rollup/job/config/RollupJobConfigTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/rollup/job/config/RollupJobConfigTests.java index e7cc30f46dde3..0c15dca752a0f 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/rollup/job/config/RollupJobConfigTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/rollup/job/config/RollupJobConfigTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.client.ValidationException; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import org.elasticsearch.test.ESTestCase; import org.junit.Before; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/rollup/job/config/TermsGroupConfigTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/rollup/job/config/TermsGroupConfigTests.java index 93af32dfe8dd0..42fcc832d0d2c 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/rollup/job/config/TermsGroupConfigTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/rollup/job/config/TermsGroupConfigTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.client.ValidationException; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/AuthenticateResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/AuthenticateResponseTests.java index 873fd5b39a97b..8deec181ee0ec 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/AuthenticateResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/AuthenticateResponseTests.java @@ -9,8 +9,8 @@ package org.elasticsearch.client.security; import org.elasticsearch.client.security.user.User; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.EqualsHashCodeTestUtils; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/ClearRealmCacheResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/ClearRealmCacheResponseTests.java index 322d762c8d744..95d624b7f2288 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/ClearRealmCacheResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/ClearRealmCacheResponseTests.java @@ -10,10 +10,10 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/ClearRolesCacheResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/ClearRolesCacheResponseTests.java index 4c5628d019cd5..eb6c75c75596c 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/ClearRolesCacheResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/ClearRolesCacheResponseTests.java @@ -10,10 +10,10 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/CreateApiKeyRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/CreateApiKeyRequestTests.java index 589430d413400..0dcf2480a378b 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/CreateApiKeyRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/CreateApiKeyRequestTests.java @@ -14,7 +14,7 @@ import org.elasticsearch.client.security.user.privileges.Role.IndexPrivilegeName; import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.EqualsHashCodeTestUtils; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/CreateApiKeyResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/CreateApiKeyResponseTests.java index 7c4eae558e06b..9a14b9c1455ca 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/CreateApiKeyResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/CreateApiKeyResponseTests.java @@ -12,9 +12,9 @@ import org.elasticsearch.common.UUIDs; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.SecureString; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.EqualsHashCodeTestUtils; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/CreateServiceAccountTokenResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/CreateServiceAccountTokenResponseTests.java index e42132e3468e5..e33a3ccb8525b 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/CreateServiceAccountTokenResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/CreateServiceAccountTokenResponseTests.java @@ -10,8 +10,8 @@ import org.elasticsearch.client.AbstractResponseTestCase; import org.elasticsearch.common.settings.SecureString; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/CreateTokenResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/CreateTokenResponseTests.java index c4697858b7f4a..439cd43ce2d33 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/CreateTokenResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/CreateTokenResponseTests.java @@ -10,9 +10,9 @@ import org.elasticsearch.client.security.user.User; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/DelegatePkiAuthenticationRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/DelegatePkiAuthenticationRequestTests.java index adf2057c674b9..666a355d5569e 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/DelegatePkiAuthenticationRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/DelegatePkiAuthenticationRequestTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.client.AbstractRequestTestCase; import org.elasticsearch.client.ValidationException; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.io.InputStream; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/DelegatePkiAuthenticationResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/DelegatePkiAuthenticationResponseTests.java index 04d28d92a59c0..091205f64144b 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/DelegatePkiAuthenticationResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/DelegatePkiAuthenticationResponseTests.java @@ -11,8 +11,8 @@ import org.elasticsearch.Version; import org.elasticsearch.client.AbstractResponseTestCase; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.security.authc.Authentication; import org.elasticsearch.xpack.core.security.user.User; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/DeleteRoleMappingResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/DeleteRoleMappingResponseTests.java index 90fe2b47ddcd0..16a19eca08b29 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/DeleteRoleMappingResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/DeleteRoleMappingResponseTests.java @@ -8,9 +8,9 @@ package org.elasticsearch.client.security; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.EqualsHashCodeTestUtils; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/DeleteRoleResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/DeleteRoleResponseTests.java index 21e6c884c220c..3640a52cc2432 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/DeleteRoleResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/DeleteRoleResponseTests.java @@ -9,11 +9,11 @@ package org.elasticsearch.client.security; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/DeleteServiceAccountTokenResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/DeleteServiceAccountTokenResponseTests.java index 7258f6b2b2045..1750995346545 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/DeleteServiceAccountTokenResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/DeleteServiceAccountTokenResponseTests.java @@ -9,8 +9,8 @@ package org.elasticsearch.client.security; import org.elasticsearch.client.AbstractResponseTestCase; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/DeleteUserResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/DeleteUserResponseTests.java index b59e8755900a6..4e359264d0079 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/DeleteUserResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/DeleteUserResponseTests.java @@ -9,11 +9,11 @@ package org.elasticsearch.client.security; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/ExpressionRoleMappingTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/ExpressionRoleMappingTests.java index d83b89ba70cb8..ff9cfc4584298 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/ExpressionRoleMappingTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/ExpressionRoleMappingTests.java @@ -9,9 +9,9 @@ package org.elasticsearch.client.security; import org.elasticsearch.client.security.support.expressiondsl.fields.FieldRoleMapperExpression; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.EqualsHashCodeTestUtils; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/GetApiKeyResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/GetApiKeyResponseTests.java index ac538a5b400a1..1195c531900ab 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/GetApiKeyResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/GetApiKeyResponseTests.java @@ -10,9 +10,9 @@ import org.elasticsearch.client.security.support.ApiKey; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.EqualsHashCodeTestUtils; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/GetPrivilegesResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/GetPrivilegesResponseTests.java index f21272dd140d1..fc2421bb07726 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/GetPrivilegesResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/GetPrivilegesResponseTests.java @@ -9,9 +9,9 @@ package org.elasticsearch.client.security; import org.elasticsearch.client.security.user.privileges.ApplicationPrivilege; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.EqualsHashCodeTestUtils; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/GetRoleMappingsResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/GetRoleMappingsResponseTests.java index 4165c2e027d7c..1718de20da7a5 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/GetRoleMappingsResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/GetRoleMappingsResponseTests.java @@ -9,9 +9,9 @@ package org.elasticsearch.client.security; import org.elasticsearch.client.security.support.expressiondsl.fields.FieldRoleMapperExpression; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.EqualsHashCodeTestUtils; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/GetRolesResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/GetRolesResponseTests.java index f87e4f2e3fd92..d44e92fa9d9d5 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/GetRolesResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/GetRolesResponseTests.java @@ -10,9 +10,9 @@ import org.elasticsearch.client.security.user.privileges.IndicesPrivileges; import org.elasticsearch.client.security.user.privileges.Role; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.EqualsHashCodeTestUtils; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/GetServiceAccountCredentialsResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/GetServiceAccountCredentialsResponseTests.java index 5eafe7c04eed2..f0d02a1bbb423 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/GetServiceAccountCredentialsResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/GetServiceAccountCredentialsResponseTests.java @@ -15,8 +15,8 @@ import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.common.transport.TransportAddress; import org.elasticsearch.core.Tuple; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.security.action.service.GetServiceAccountCredentialsNodesResponse; import org.elasticsearch.xpack.core.security.action.service.TokenInfo; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/GetServiceAccountsResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/GetServiceAccountsResponseTests.java index 4b8fd544ccd40..36e4cbd957c11 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/GetServiceAccountsResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/GetServiceAccountsResponseTests.java @@ -13,8 +13,8 @@ import org.elasticsearch.client.security.user.privileges.IndicesPrivileges; import org.elasticsearch.client.security.user.privileges.Role; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.security.authz.RoleDescriptor; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/GetSslCertificatesResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/GetSslCertificatesResponseTests.java index 26560f1589bf7..db8a08d8ceb33 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/GetSslCertificatesResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/GetSslCertificatesResponseTests.java @@ -9,7 +9,7 @@ package org.elasticsearch.client.security; import org.elasticsearch.client.security.support.CertificateInfo; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.EqualsHashCodeTestUtils; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/GetUserPrivilegesResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/GetUserPrivilegesResponseTests.java index 228bd4b732998..7726364c8ab06 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/GetUserPrivilegesResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/GetUserPrivilegesResponseTests.java @@ -12,8 +12,8 @@ import org.elasticsearch.client.security.user.privileges.IndicesPrivileges; import org.elasticsearch.client.security.user.privileges.UserIndicesPrivileges; import org.elasticsearch.common.util.iterable.Iterables; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import java.util.Iterator; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/GetUsersResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/GetUsersResponseTests.java index 5657f4d10320f..21b7ce581612b 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/GetUsersResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/GetUsersResponseTests.java @@ -9,9 +9,9 @@ import org.elasticsearch.client.security.user.User; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.EqualsHashCodeTestUtils; import org.elasticsearch.test.XContentTestUtils; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/GrantApiKeyRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/GrantApiKeyRequestTests.java index f879f610ebfd1..12d75863ead97 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/GrantApiKeyRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/GrantApiKeyRequestTests.java @@ -14,10 +14,10 @@ import org.elasticsearch.client.security.user.privileges.Role.IndexPrivilegeName; import org.elasticsearch.common.Strings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.EqualsHashCodeTestUtils; import org.elasticsearch.test.XContentTestUtils; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/HasPrivilegesRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/HasPrivilegesRequestTests.java index 62c85a23f3f11..aac0701a4207e 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/HasPrivilegesRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/HasPrivilegesRequestTests.java @@ -12,7 +12,7 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.util.set.Sets; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.EqualsHashCodeTestUtils; import org.elasticsearch.test.XContentTestUtils; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/HasPrivilegesResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/HasPrivilegesResponseTests.java index c44ea982febbd..6c59e1869156c 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/HasPrivilegesResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/HasPrivilegesResponseTests.java @@ -8,8 +8,8 @@ package org.elasticsearch.client.security; import org.elasticsearch.common.collect.MapBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.EqualsHashCodeTestUtils; import org.hamcrest.Matchers; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/InvalidateApiKeyResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/InvalidateApiKeyResponseTests.java index 4d3271b2dbfd5..c99e6ddeae86f 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/InvalidateApiKeyResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/InvalidateApiKeyResponseTests.java @@ -11,10 +11,10 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.EqualsHashCodeTestUtils; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/InvalidateTokenResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/InvalidateTokenResponseTests.java index 1af6f47b56d41..b5b9225094dad 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/InvalidateTokenResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/InvalidateTokenResponseTests.java @@ -9,11 +9,11 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.hamcrest.Matchers; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/KibanaEnrollmentResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/KibanaEnrollmentResponseTests.java index 35d5453e798da..d34cc294cf9e2 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/KibanaEnrollmentResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/KibanaEnrollmentResponseTests.java @@ -10,9 +10,9 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.SecureString; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.EqualsHashCodeTestUtils; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/PutPrivilegesRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/PutPrivilegesRequestTests.java index 715bc7e26322f..825fbb4e40bca 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/PutPrivilegesRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/PutPrivilegesRequestTests.java @@ -11,9 +11,9 @@ import org.elasticsearch.client.security.user.privileges.ApplicationPrivilege; import org.elasticsearch.common.Strings; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.EqualsHashCodeTestUtils; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/PutPrivilegesResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/PutPrivilegesResponseTests.java index 9cd6c183945a6..acafd6ad8fb48 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/PutPrivilegesResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/PutPrivilegesResponseTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.security; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/PutRoleMappingRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/PutRoleMappingRequestTests.java index 873c49404d1d7..96d8555a83654 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/PutRoleMappingRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/PutRoleMappingRequestTests.java @@ -11,9 +11,9 @@ import org.elasticsearch.client.security.support.expressiondsl.RoleMapperExpression; import org.elasticsearch.client.security.support.expressiondsl.fields.FieldRoleMapperExpression; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.EqualsHashCodeTestUtils; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/PutRoleRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/PutRoleRequestTests.java index ac53536b8b3b8..2a454a0f5fd81 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/PutRoleRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/PutRoleRequestTests.java @@ -17,7 +17,7 @@ import org.elasticsearch.client.security.user.privileges.IndicesPrivilegesTests; import org.elasticsearch.client.security.user.privileges.Role; import org.elasticsearch.core.Tuple; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/PutUserRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/PutUserRequestTests.java index b0c2279da0d5e..b116d48cb4e3a 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/PutUserRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/PutUserRequestTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.client.security.user.User; import org.elasticsearch.common.Strings; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import java.util.Arrays; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/QueryApiKeyResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/QueryApiKeyResponseTests.java index 5dbfdac05db76..791c226971cef 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/QueryApiKeyResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/QueryApiKeyResponseTests.java @@ -10,8 +10,8 @@ import org.elasticsearch.client.AbstractResponseTestCase; import org.elasticsearch.client.security.support.ApiKey; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.time.Instant; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/hlrc/HasPrivilegesResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/hlrc/HasPrivilegesResponseTests.java index 48425211176b2..c13c5a7ec1326 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/hlrc/HasPrivilegesResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/hlrc/HasPrivilegesResponseTests.java @@ -13,10 +13,10 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.collect.MapBuilder; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.security.authz.permission.ResourcePrivileges; import org.junit.Assert; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/support/expressiondsl/RoleMapperExpressionDslTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/support/expressiondsl/RoleMapperExpressionDslTests.java index 5bf98c45bc521..26050b55291d1 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/support/expressiondsl/RoleMapperExpressionDslTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/support/expressiondsl/RoleMapperExpressionDslTests.java @@ -13,9 +13,9 @@ import org.elasticsearch.client.security.support.expressiondsl.expressions.ExceptRoleMapperExpression; import org.elasticsearch.client.security.support.expressiondsl.fields.FieldRoleMapperExpression; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/support/expressiondsl/parser/RoleMapperExpressionParserTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/support/expressiondsl/parser/RoleMapperExpressionParserTests.java index c61956bfda1a8..51585e54ca8a8 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/support/expressiondsl/parser/RoleMapperExpressionParserTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/support/expressiondsl/parser/RoleMapperExpressionParserTests.java @@ -12,12 +12,12 @@ import org.elasticsearch.client.security.support.expressiondsl.expressions.CompositeRoleMapperExpression; import org.elasticsearch.client.security.support.expressiondsl.fields.FieldRoleMapperExpression; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/user/privileges/ApplicationPrivilegeTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/user/privileges/ApplicationPrivilegeTests.java index 56f89d9c9a7b9..d7fe19edba4ac 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/user/privileges/ApplicationPrivilegeTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/user/privileges/ApplicationPrivilegeTests.java @@ -9,12 +9,12 @@ package org.elasticsearch.client.security.user.privileges; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/user/privileges/ApplicationResourcePrivilegesTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/user/privileges/ApplicationResourcePrivilegesTests.java index e03c9c021fc4b..5f2e02cf5978b 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/user/privileges/ApplicationResourcePrivilegesTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/user/privileges/ApplicationResourcePrivilegesTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.security.user.privileges; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/user/privileges/GlobalPrivilegesTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/user/privileges/GlobalPrivilegesTests.java index dca1ac3604d5c..b0c75d93d9fc8 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/user/privileges/GlobalPrivilegesTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/user/privileges/GlobalPrivilegesTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.security.user.privileges; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import org.elasticsearch.test.EqualsHashCodeTestUtils; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/user/privileges/IndicesPrivilegesTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/user/privileges/IndicesPrivilegesTests.java index 16ab856c3db2f..0b87ba020944d 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/security/user/privileges/IndicesPrivilegesTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/security/user/privileges/IndicesPrivilegesTests.java @@ -9,7 +9,7 @@ package org.elasticsearch.client.security.user.privileges; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/snapshots/GetFeaturesResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/snapshots/GetFeaturesResponseTests.java index 473587ea3d70b..689fce50b6120 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/snapshots/GetFeaturesResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/snapshots/GetFeaturesResponseTests.java @@ -10,8 +10,8 @@ import org.elasticsearch.client.AbstractResponseTestCase; import org.elasticsearch.client.feature.GetFeaturesResponse; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.util.Map; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/snapshots/ResetFeaturesResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/snapshots/ResetFeaturesResponseTests.java index d21f2a469f33d..25bd455546c50 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/snapshots/ResetFeaturesResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/snapshots/ResetFeaturesResponseTests.java @@ -12,8 +12,8 @@ import org.elasticsearch.action.admin.cluster.snapshots.features.ResetFeatureStateResponse; import org.elasticsearch.client.AbstractResponseTestCase; import org.elasticsearch.client.feature.ResetFeaturesResponse; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.util.Map; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/tasks/CancelTasksResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/tasks/CancelTasksResponseTests.java index 5d2855f73509d..50244a6306f1f 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/tasks/CancelTasksResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/tasks/CancelTasksResponseTests.java @@ -17,9 +17,9 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.transport.TransportAddress; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.tasks.Task; import org.elasticsearch.tasks.TaskId; import org.elasticsearch.tasks.TaskInfo; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/tasks/ElasticsearchExceptionTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/tasks/ElasticsearchExceptionTests.java index 6d8503d4691ac..45a2184d3aa88 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/tasks/ElasticsearchExceptionTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/tasks/ElasticsearchExceptionTests.java @@ -8,8 +8,8 @@ package org.elasticsearch.client.tasks; import org.elasticsearch.client.AbstractResponseTestCase; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.util.List; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/tasks/TaskSubmissionResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/tasks/TaskSubmissionResponseTests.java index 16b2bec3f2442..47dd8d4d29d76 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/tasks/TaskSubmissionResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/tasks/TaskSubmissionResponseTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.tasks; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/textstructure/FindStructureRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/textstructure/FindStructureRequestTests.java index 1d5ba6ffb9734..df0d5c6f02839 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/textstructure/FindStructureRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/textstructure/FindStructureRequestTests.java @@ -9,8 +9,8 @@ import org.elasticsearch.client.textstructure.structurefinder.TextStructure; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/textstructure/FindStructureResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/textstructure/FindStructureResponseTests.java index c2726c204bfcb..2975439c7b846 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/textstructure/FindStructureResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/textstructure/FindStructureResponseTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.textstructure; import org.elasticsearch.client.textstructure.structurefinder.TextStructureTests; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/textstructure/structurefinder/FieldStatsTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/textstructure/structurefinder/FieldStatsTests.java index 5befcbfc8046c..49981b3f5a7be 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/textstructure/structurefinder/FieldStatsTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/textstructure/structurefinder/FieldStatsTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.textstructure.structurefinder; import org.elasticsearch.client.textstructure.structurefinder.FieldStats; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.util.ArrayList; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/textstructure/structurefinder/TextStructureTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/textstructure/structurefinder/TextStructureTests.java index 07e27305c48ac..88f60ff1565a0 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/textstructure/structurefinder/TextStructureTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/textstructure/structurefinder/TextStructureTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.textstructure.structurefinder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.nio.charset.Charset; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/AcknowledgedTasksResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/AcknowledgedTasksResponseTests.java index bd571b27b835b..06320aadee305 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/AcknowledgedTasksResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/AcknowledgedTasksResponseTests.java @@ -10,9 +10,9 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.action.TaskOperationFailure; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/GetTransformResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/GetTransformResponseTests.java index 253546904c1ae..f35c4314b020b 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/GetTransformResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/GetTransformResponseTests.java @@ -11,8 +11,8 @@ import org.elasticsearch.client.transform.transforms.TransformConfig; import org.elasticsearch.client.transform.transforms.TransformConfigTests; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.search.SearchModule; import org.elasticsearch.test.ESTestCase; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/GetTransformStatsResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/GetTransformStatsResponseTests.java index ec4bf9bf207a0..e22b22c50b2d1 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/GetTransformStatsResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/GetTransformStatsResponseTests.java @@ -12,7 +12,7 @@ import org.elasticsearch.action.TaskOperationFailure; import org.elasticsearch.client.transform.transforms.TransformStats; import org.elasticsearch.client.transform.transforms.TransformStatsTests; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/PreviewTransformRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/PreviewTransformRequestTests.java index 3b6869aad7544..dc7416667e6db 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/PreviewTransformRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/PreviewTransformRequestTests.java @@ -16,11 +16,11 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.search.SearchModule; import org.elasticsearch.test.AbstractXContentTestCase; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/PreviewTransformResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/PreviewTransformResponseTests.java index 824459379727a..f7ab11c8868dd 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/PreviewTransformResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/PreviewTransformResponseTests.java @@ -12,11 +12,11 @@ import org.elasticsearch.client.indices.CreateIndexRequest; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/PutTransformRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/PutTransformRequestTests.java index 622bf9daff86a..fea96a57d2263 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/PutTransformRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/PutTransformRequestTests.java @@ -13,8 +13,8 @@ import org.elasticsearch.client.transform.transforms.TransformConfigTests; import org.elasticsearch.client.transform.transforms.pivot.PivotConfigTests; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.SearchModule; import org.elasticsearch.test.AbstractXContentTestCase; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/UpdateDataFrameTransformResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/UpdateDataFrameTransformResponseTests.java index 017d308d7d983..1ae24640165e7 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/UpdateDataFrameTransformResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/UpdateDataFrameTransformResponseTests.java @@ -10,8 +10,8 @@ import org.elasticsearch.client.transform.transforms.TransformConfigTests; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.search.SearchModule; import org.elasticsearch.test.ESTestCase; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/UpdateTransformRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/UpdateTransformRequestTests.java index 00f3b8d015558..8ab3f886f32a7 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/UpdateTransformRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/UpdateTransformRequestTests.java @@ -11,8 +11,8 @@ import org.elasticsearch.client.ValidationException; import org.elasticsearch.client.transform.transforms.TransformConfigUpdate; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.SearchModule; import org.elasticsearch.test.AbstractXContentTestCase; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/hlrc/GetTransformStatsResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/hlrc/GetTransformStatsResponseTests.java index bec11885f4191..bb4eac9022620 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/hlrc/GetTransformStatsResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/hlrc/GetTransformStatsResponseTests.java @@ -16,8 +16,8 @@ import org.elasticsearch.client.transform.transforms.hlrc.TransformCheckpointingInfoTests; import org.elasticsearch.client.transform.transforms.hlrc.TransformIndexerStatsTests; import org.elasticsearch.client.transform.transforms.hlrc.TransformStatsTests; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.transform.action.GetTransformStatsAction; import org.elasticsearch.xpack.core.transform.action.GetTransformStatsAction.Response; import org.elasticsearch.xpack.core.transform.transforms.NodeAttributes; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/hlrc/PreviewTransformResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/hlrc/PreviewTransformResponseTests.java index 2204a6770fba1..181c6797583b5 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/hlrc/PreviewTransformResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/hlrc/PreviewTransformResponseTests.java @@ -12,8 +12,8 @@ import org.elasticsearch.client.AbstractResponseTestCase; import org.elasticsearch.client.transform.PreviewTransformResponse; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.transform.action.PreviewTransformAction; import org.elasticsearch.xpack.core.transform.action.PreviewTransformAction.Response; import org.elasticsearch.xpack.core.transform.transforms.TransformDestIndexSettings; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/DestConfigTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/DestConfigTests.java index 2803ebff34c92..b451aadf1699a 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/DestConfigTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/DestConfigTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.transform.transforms; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/NodeAttributesTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/NodeAttributesTests.java index eb1b4b1f8a409..c73746a407f02 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/NodeAttributesTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/NodeAttributesTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.transform.transforms; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/QueryConfigTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/QueryConfigTests.java index 1719c9477bbe2..4f6578bfca558 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/QueryConfigTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/QueryConfigTests.java @@ -9,8 +9,8 @@ package org.elasticsearch.client.transform.transforms; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.query.MatchAllQueryBuilder; import org.elasticsearch.index.query.MatchNoneQueryBuilder; import org.elasticsearch.index.query.QueryBuilder; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/SettingsConfigTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/SettingsConfigTests.java index 30e1d63b9e877..c35b3cd1a3a2a 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/SettingsConfigTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/SettingsConfigTests.java @@ -10,12 +10,12 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.AbstractXContentTestCase; import org.elasticsearch.xpack.core.watcher.watch.Payload.XContent; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/SourceConfigTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/SourceConfigTests.java index d182c6be94d87..ea46e0aec9cb4 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/SourceConfigTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/SourceConfigTests.java @@ -9,8 +9,8 @@ package org.elasticsearch.client.transform.transforms; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.SearchModule; import org.elasticsearch.test.AbstractXContentTestCase; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/TimeRetentionPolicyConfigTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/TimeRetentionPolicyConfigTests.java index 1f11397b4037f..1e197d73006a3 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/TimeRetentionPolicyConfigTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/TimeRetentionPolicyConfigTests.java @@ -9,7 +9,7 @@ package org.elasticsearch.client.transform.transforms; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/TimeSyncConfigTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/TimeSyncConfigTests.java index d7dfe3a2cb03d..896081b663c2e 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/TimeSyncConfigTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/TimeSyncConfigTests.java @@ -9,7 +9,7 @@ package org.elasticsearch.client.transform.transforms; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/TransformCheckpointStatsTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/TransformCheckpointStatsTests.java index e85f0389db795..a3f86197a3380 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/TransformCheckpointStatsTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/TransformCheckpointStatsTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.transform.transforms; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/TransformCheckpointingInfoTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/TransformCheckpointingInfoTests.java index 6919320433f57..fcaa8edb67a49 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/TransformCheckpointingInfoTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/TransformCheckpointingInfoTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.transform.transforms; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/TransformConfigTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/TransformConfigTests.java index dbb294331f062..655f6d19aa2ad 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/TransformConfigTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/TransformConfigTests.java @@ -16,8 +16,8 @@ import org.elasticsearch.client.transform.transforms.pivot.PivotConfigTests; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.SearchModule; import org.elasticsearch.test.AbstractXContentTestCase; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/TransformConfigUpdateTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/TransformConfigUpdateTests.java index a60b008c831fd..4c137f88a6d7e 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/TransformConfigUpdateTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/TransformConfigUpdateTests.java @@ -11,8 +11,8 @@ import org.elasticsearch.client.transform.TransformNamedXContentProvider; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.SearchModule; import org.elasticsearch.test.AbstractXContentTestCase; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/TransformIndexerPositionTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/TransformIndexerPositionTests.java index 6e9ee17d1c331..f60fe652c061f 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/TransformIndexerPositionTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/TransformIndexerPositionTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.transform.transforms; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/TransformIndexerStatsTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/TransformIndexerStatsTests.java index beee811328923..39a13daea0f2d 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/TransformIndexerStatsTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/TransformIndexerStatsTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.transform.transforms; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/TransformProgressTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/TransformProgressTests.java index b7b4c40f9b97b..c76aeb02fcc20 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/TransformProgressTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/TransformProgressTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.transform.transforms; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/TransformStatsTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/TransformStatsTests.java index a45f6d6295975..ab61a31c98f28 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/TransformStatsTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/TransformStatsTests.java @@ -8,8 +8,8 @@ package org.elasticsearch.client.transform.transforms; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/hlrc/SettingsConfigTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/hlrc/SettingsConfigTests.java index a42f7e5ca6cea..5d1591f6bda0b 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/hlrc/SettingsConfigTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/hlrc/SettingsConfigTests.java @@ -10,8 +10,8 @@ import org.elasticsearch.client.AbstractResponseTestCase; import org.elasticsearch.client.transform.transforms.SettingsConfig; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/hlrc/TimeRetentionPolicyConfigTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/hlrc/TimeRetentionPolicyConfigTests.java index a379992494d6c..2e92224ab8fe4 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/hlrc/TimeRetentionPolicyConfigTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/hlrc/TimeRetentionPolicyConfigTests.java @@ -11,8 +11,8 @@ import org.elasticsearch.client.AbstractResponseTestCase; import org.elasticsearch.client.transform.transforms.TimeRetentionPolicyConfig; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/hlrc/TimeSyncConfigTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/hlrc/TimeSyncConfigTests.java index 126313547acb7..a04ce33832e69 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/hlrc/TimeSyncConfigTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/hlrc/TimeSyncConfigTests.java @@ -11,8 +11,8 @@ import org.elasticsearch.client.AbstractResponseTestCase; import org.elasticsearch.client.transform.transforms.TimeSyncConfig; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/hlrc/TransformCheckpointStatsTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/hlrc/TransformCheckpointStatsTests.java index 365571ef67082..635e6f723a6d0 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/hlrc/TransformCheckpointStatsTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/hlrc/TransformCheckpointStatsTests.java @@ -9,8 +9,8 @@ package org.elasticsearch.client.transform.transforms.hlrc; import org.elasticsearch.client.AbstractResponseTestCase; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.transform.transforms.TransformCheckpointStats; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/hlrc/TransformCheckpointingInfoTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/hlrc/TransformCheckpointingInfoTests.java index 28b20980d0559..11b1f03efaae2 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/hlrc/TransformCheckpointingInfoTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/hlrc/TransformCheckpointingInfoTests.java @@ -10,8 +10,8 @@ import org.elasticsearch.client.AbstractResponseTestCase; import org.elasticsearch.client.transform.transforms.TransformCheckpointingInfo; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.time.Instant; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/hlrc/TransformIndexerPositionTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/hlrc/TransformIndexerPositionTests.java index a1cc4f58dd69e..1502c091cde19 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/hlrc/TransformIndexerPositionTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/hlrc/TransformIndexerPositionTests.java @@ -9,8 +9,8 @@ package org.elasticsearch.client.transform.transforms.hlrc; import org.elasticsearch.client.AbstractResponseTestCase; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.transform.transforms.TransformIndexerPosition; import java.util.LinkedHashMap; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/hlrc/TransformIndexerStatsTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/hlrc/TransformIndexerStatsTests.java index 92a828c63d114..223734353ad0e 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/hlrc/TransformIndexerStatsTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/hlrc/TransformIndexerStatsTests.java @@ -10,8 +10,8 @@ import org.elasticsearch.client.AbstractResponseTestCase; import org.elasticsearch.client.transform.transforms.TransformIndexerStats; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/hlrc/TransformProgressTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/hlrc/TransformProgressTests.java index 5d03e35d4f5c1..618633cd2c50b 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/hlrc/TransformProgressTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/hlrc/TransformProgressTests.java @@ -9,8 +9,8 @@ package org.elasticsearch.client.transform.transforms.hlrc; import org.elasticsearch.client.AbstractResponseTestCase; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.transform.transforms.TransformProgress; import static org.hamcrest.Matchers.equalTo; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/hlrc/TransformStatsTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/hlrc/TransformStatsTests.java index b989b68aba13b..f7f4c1840c844 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/hlrc/TransformStatsTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/hlrc/TransformStatsTests.java @@ -16,8 +16,8 @@ import org.elasticsearch.client.transform.transforms.TransformIndexerStats; import org.elasticsearch.client.transform.transforms.TransformProgress; import org.elasticsearch.client.transform.transforms.TransformStats; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.util.HashMap; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/latest/LatestConfigTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/latest/LatestConfigTests.java index ddeede7e1d7fe..11895aeab2d3e 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/latest/LatestConfigTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/latest/LatestConfigTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.transform.transforms.latest; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/latest/hlrc/LatestConfigTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/latest/hlrc/LatestConfigTests.java index eeaf1d28ee88e..f5a7a94cfcf9a 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/latest/hlrc/LatestConfigTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/latest/hlrc/LatestConfigTests.java @@ -9,8 +9,8 @@ package org.elasticsearch.client.transform.transforms.latest.hlrc; import org.elasticsearch.client.AbstractResponseTestCase; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.transform.transforms.latest.LatestConfig; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/pivot/AggregationConfigTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/pivot/AggregationConfigTests.java index 75e4b9510943c..610d5c8c35301 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/pivot/AggregationConfigTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/pivot/AggregationConfigTests.java @@ -9,8 +9,8 @@ package org.elasticsearch.client.transform.transforms.pivot; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.SearchModule; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.AggregationBuilders; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/pivot/DateHistogramGroupSourceTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/pivot/DateHistogramGroupSourceTests.java index 84baa2b86f6b1..50762246c791e 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/pivot/DateHistogramGroupSourceTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/pivot/DateHistogramGroupSourceTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.transform.transforms.pivot; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.script.Script; import org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramInterval; import org.elasticsearch.test.AbstractXContentTestCase; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/pivot/GeoTileGroupSourceTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/pivot/GeoTileGroupSourceTests.java index 1927bc75db6b6..ee9983c524394 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/pivot/GeoTileGroupSourceTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/pivot/GeoTileGroupSourceTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.geo.GeoBoundingBox; import org.elasticsearch.common.geo.GeoPoint; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.geo.GeometryTestUtils; import org.elasticsearch.geometry.Rectangle; import org.elasticsearch.search.aggregations.bucket.geogrid.GeoTileUtils; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/pivot/GroupConfigTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/pivot/GroupConfigTests.java index 2c3cb8642af9d..75d6589d586cd 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/pivot/GroupConfigTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/pivot/GroupConfigTests.java @@ -9,10 +9,10 @@ package org.elasticsearch.client.transform.transforms.pivot; import org.elasticsearch.common.bytes.BytesArray; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/pivot/HistogramGroupSourceTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/pivot/HistogramGroupSourceTests.java index a464b636f2f1d..e3701d24b3e9e 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/pivot/HistogramGroupSourceTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/pivot/HistogramGroupSourceTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.transform.transforms.pivot; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.script.Script; import org.elasticsearch.test.AbstractXContentTestCase; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/pivot/PivotConfigTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/pivot/PivotConfigTests.java index f58d8be73a7de..eb89b4195ce9a 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/pivot/PivotConfigTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/pivot/PivotConfigTests.java @@ -9,8 +9,8 @@ package org.elasticsearch.client.transform.transforms.pivot; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.SearchModule; import org.elasticsearch.test.AbstractXContentTestCase; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/pivot/TermsGroupSourceTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/pivot/TermsGroupSourceTests.java index 7c50b38113bba..3c061f0bb1e7f 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/pivot/TermsGroupSourceTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/pivot/TermsGroupSourceTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.client.transform.transforms.pivot; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.script.Script; import org.elasticsearch.test.AbstractXContentTestCase; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/pivot/hlrc/DateHistogramGroupSourceTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/pivot/hlrc/DateHistogramGroupSourceTests.java index d64f8526fe141..83d76d14cd940 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/pivot/hlrc/DateHistogramGroupSourceTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/pivot/hlrc/DateHistogramGroupSourceTests.java @@ -10,12 +10,12 @@ import org.elasticsearch.client.AbstractResponseTestCase; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.script.Script; import org.elasticsearch.script.ScriptType; import org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramInterval; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/pivot/hlrc/GeoTileGroupSourceTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/pivot/hlrc/GeoTileGroupSourceTests.java index 304045cd943a3..fe556c8124d3b 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/pivot/hlrc/GeoTileGroupSourceTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/pivot/hlrc/GeoTileGroupSourceTests.java @@ -11,8 +11,8 @@ import org.elasticsearch.client.AbstractResponseTestCase; import org.elasticsearch.common.geo.GeoBoundingBox; import org.elasticsearch.common.geo.GeoPoint; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.geo.GeometryTestUtils; import org.elasticsearch.geometry.Rectangle; import org.elasticsearch.search.aggregations.bucket.geogrid.GeoTileUtils; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/pivot/hlrc/HistogramGroupSourceTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/pivot/hlrc/HistogramGroupSourceTests.java index ed1f9657a9032..21e9cf4adae62 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/pivot/hlrc/HistogramGroupSourceTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/pivot/hlrc/HistogramGroupSourceTests.java @@ -9,8 +9,8 @@ package org.elasticsearch.client.transform.transforms.pivot.hlrc; import org.elasticsearch.client.AbstractResponseTestCase; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.transform.transforms.pivot.HistogramGroupSource; import org.elasticsearch.xpack.core.transform.transforms.pivot.ScriptConfig; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/pivot/hlrc/TermsGroupSourceTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/pivot/hlrc/TermsGroupSourceTests.java index bca179facc6cd..36cafb6d5a1f4 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/pivot/hlrc/TermsGroupSourceTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/transforms/pivot/hlrc/TermsGroupSourceTests.java @@ -9,8 +9,8 @@ package org.elasticsearch.client.transform.transforms.pivot.hlrc; import org.elasticsearch.client.AbstractResponseTestCase; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.transform.transforms.pivot.ScriptConfig; import org.elasticsearch.xpack.core.transform.transforms.pivot.TermsGroupSource; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/watcher/AckWatchResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/watcher/AckWatchResponseTests.java index 940e347a91dd1..ffc64b652ab5e 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/watcher/AckWatchResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/watcher/AckWatchResponseTests.java @@ -9,12 +9,12 @@ package org.elasticsearch.client.watcher; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.XContentTestUtils; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/watcher/ActivateWatchResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/watcher/ActivateWatchResponseTests.java index 90df0c59503aa..2efdf6225b432 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/watcher/ActivateWatchResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/watcher/ActivateWatchResponseTests.java @@ -9,12 +9,12 @@ package org.elasticsearch.client.watcher; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.XContentTestUtils; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/watcher/DeactivateWatchResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/watcher/DeactivateWatchResponseTests.java index 6f3c9095b5ed6..be03357bf8c42 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/watcher/DeactivateWatchResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/watcher/DeactivateWatchResponseTests.java @@ -9,11 +9,11 @@ import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/watcher/DeleteWatchResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/watcher/DeleteWatchResponseTests.java index 4b92b493ea94b..ddce1148a264d 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/watcher/DeleteWatchResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/watcher/DeleteWatchResponseTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.watcher; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/watcher/GetWatchResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/watcher/GetWatchResponseTests.java index 2b7e379f83a3d..b9cd4d260e69e 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/watcher/GetWatchResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/watcher/GetWatchResponseTests.java @@ -11,10 +11,10 @@ import org.elasticsearch.client.AbstractResponseTestCase; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.time.DateUtils; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.watcher.actions.ActionStatus; import org.elasticsearch.xpack.core.watcher.execution.ExecutionState; import org.elasticsearch.xpack.core.watcher.support.xcontent.XContentSource; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/watcher/PutWatchResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/watcher/PutWatchResponseTests.java index ac79fd7c7a58f..cf2a9436b881b 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/watcher/PutWatchResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/watcher/PutWatchResponseTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.client.watcher; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/watcher/VerifyRepositoryResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/watcher/VerifyRepositoryResponseTests.java index 4a611a5d69180..ab35f693a6b64 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/watcher/VerifyRepositoryResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/watcher/VerifyRepositoryResponseTests.java @@ -9,8 +9,8 @@ package org.elasticsearch.client.watcher; import org.elasticsearch.action.admin.cluster.repositories.verify.VerifyRepositoryResponse; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/watcher/WatchRequestValidationTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/watcher/WatchRequestValidationTests.java index eea52555ceb72..842f14ae8483c 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/watcher/WatchRequestValidationTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/watcher/WatchRequestValidationTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.client.ValidationException; import org.elasticsearch.common.bytes.BytesArray; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import java.util.Optional; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/watcher/WatchStatusTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/watcher/WatchStatusTests.java index f7b392b1b4c84..cbfe634a32fc6 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/watcher/WatchStatusTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/watcher/WatchStatusTests.java @@ -9,11 +9,11 @@ package org.elasticsearch.client.watcher; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.XContentTestUtils; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/watcher/WatcherStatsResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/watcher/WatcherStatsResponseTests.java index 1771e29162980..57609d0bd2f70 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/watcher/WatcherStatsResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/watcher/WatcherStatsResponseTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.client.NodesResponseHeader; import org.elasticsearch.client.NodesResponseHeaderTestUtils; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/watcher/hlrc/DeleteWatchResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/watcher/hlrc/DeleteWatchResponseTests.java index d225ab0a9c01d..6897e512bfbc5 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/watcher/hlrc/DeleteWatchResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/watcher/hlrc/DeleteWatchResponseTests.java @@ -9,8 +9,8 @@ import org.elasticsearch.client.AbstractResponseTestCase; import org.elasticsearch.client.watcher.DeleteWatchResponse; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/watcher/hlrc/ExecuteWatchResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/watcher/hlrc/ExecuteWatchResponseTests.java index d54fd630d2577..eb1a7d15e366d 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/watcher/hlrc/ExecuteWatchResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/watcher/hlrc/ExecuteWatchResponseTests.java @@ -10,10 +10,10 @@ import org.elasticsearch.client.AbstractResponseTestCase; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.watcher.transport.actions.execute.ExecuteWatchResponse; import java.io.IOException; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/watcher/hlrc/PutWatchResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/watcher/hlrc/PutWatchResponseTests.java index 3577ca1207150..2234350fe8324 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/watcher/hlrc/PutWatchResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/watcher/hlrc/PutWatchResponseTests.java @@ -9,8 +9,8 @@ import org.elasticsearch.client.AbstractResponseTestCase; import org.elasticsearch.client.watcher.PutWatchResponse; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; diff --git a/distribution/tools/geoip-cli/src/main/java/org/elasticsearch/geoip/GeoIpCli.java b/distribution/tools/geoip-cli/src/main/java/org/elasticsearch/geoip/GeoIpCli.java index c4298313f6588..6eb3aa01fc71b 100644 --- a/distribution/tools/geoip-cli/src/main/java/org/elasticsearch/geoip/GeoIpCli.java +++ b/distribution/tools/geoip-cli/src/main/java/org/elasticsearch/geoip/GeoIpCli.java @@ -14,10 +14,10 @@ import org.elasticsearch.cli.Command; import org.elasticsearch.cli.Terminal; import org.elasticsearch.common.hash.MessageDigests; -import org.elasticsearch.common.xcontent.XContentGenerator; -import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.core.PathUtils; import org.elasticsearch.core.SuppressForbidden; +import org.elasticsearch.xcontent.XContentGenerator; +import org.elasticsearch.xcontent.XContentType; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; diff --git a/distribution/tools/geoip-cli/src/test/java/org/elasticsearch/geoip/GeoIpCliTests.java b/distribution/tools/geoip-cli/src/test/java/org/elasticsearch/geoip/GeoIpCliTests.java index 29b824561b529..766e078d26e0c 100644 --- a/distribution/tools/geoip-cli/src/test/java/org/elasticsearch/geoip/GeoIpCliTests.java +++ b/distribution/tools/geoip-cli/src/test/java/org/elasticsearch/geoip/GeoIpCliTests.java @@ -12,10 +12,10 @@ import org.apache.commons.compress.archivers.tar.TarArchiveInputStream; import org.apache.lucene.util.LuceneTestCase; import org.elasticsearch.cli.MockTerminal; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import java.io.BufferedInputStream; import java.io.IOException; diff --git a/docs/src/test/java/org/elasticsearch/smoketest/DocsClientYamlTestSuiteIT.java b/docs/src/test/java/org/elasticsearch/smoketest/DocsClientYamlTestSuiteIT.java index 516326502fd2c..061438f715bec 100644 --- a/docs/src/test/java/org/elasticsearch/smoketest/DocsClientYamlTestSuiteIT.java +++ b/docs/src/test/java/org/elasticsearch/smoketest/DocsClientYamlTestSuiteIT.java @@ -20,12 +20,12 @@ import org.elasticsearch.client.Request; import org.elasticsearch.client.RestClient; import org.elasticsearch.common.util.CollectionUtils; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentLocation; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentParser.Token; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentLocation; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser.Token; import org.elasticsearch.test.rest.ESRestTestCase; import org.elasticsearch.test.rest.yaml.ClientYamlDocsTestClient; import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate; @@ -48,7 +48,7 @@ import static java.util.Collections.emptyMap; import static java.util.Collections.singletonList; import static java.util.Collections.singletonMap; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; //The default 20 minutes timeout isn't always enough, but Darwin CI hosts are incredibly slow... @TimeoutSuite(millis = 40 * TimeUnits.MINUTE) diff --git a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/AbstractObjectParser.java b/libs/x-content/src/main/java/org/elasticsearch/xcontent/AbstractObjectParser.java similarity index 98% rename from libs/x-content/src/main/java/org/elasticsearch/common/xcontent/AbstractObjectParser.java rename to libs/x-content/src/main/java/org/elasticsearch/xcontent/AbstractObjectParser.java index 0c22e1252ecbc..8ec9e135acad1 100644 --- a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/AbstractObjectParser.java +++ b/libs/x-content/src/main/java/org/elasticsearch/xcontent/AbstractObjectParser.java @@ -6,11 +6,12 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.xcontent; +package org.elasticsearch.xcontent; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.CheckedFunction; -import org.elasticsearch.common.xcontent.ObjectParser.NamedObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.ObjectParser.NamedObjectParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; import java.io.IOException; import java.util.ArrayList; diff --git a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/ConstructingObjectParser.java b/libs/x-content/src/main/java/org/elasticsearch/xcontent/ConstructingObjectParser.java similarity index 99% rename from libs/x-content/src/main/java/org/elasticsearch/common/xcontent/ConstructingObjectParser.java rename to libs/x-content/src/main/java/org/elasticsearch/xcontent/ConstructingObjectParser.java index 7e65c9f858ae2..3a0f3b7056b4a 100644 --- a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/ConstructingObjectParser.java +++ b/libs/x-content/src/main/java/org/elasticsearch/xcontent/ConstructingObjectParser.java @@ -6,11 +6,11 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.xcontent; +package org.elasticsearch.xcontent; import org.elasticsearch.core.RestApiVersion; -import org.elasticsearch.common.xcontent.ObjectParser.NamedObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.ObjectParser.NamedObjectParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; import java.io.IOException; import java.util.ArrayList; diff --git a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/ContextParser.java b/libs/x-content/src/main/java/org/elasticsearch/xcontent/ContextParser.java similarity index 93% rename from libs/x-content/src/main/java/org/elasticsearch/common/xcontent/ContextParser.java rename to libs/x-content/src/main/java/org/elasticsearch/xcontent/ContextParser.java index aa198d3e22336..75b8bcc52e22a 100644 --- a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/ContextParser.java +++ b/libs/x-content/src/main/java/org/elasticsearch/xcontent/ContextParser.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.xcontent; +package org.elasticsearch.xcontent; import java.io.IOException; diff --git a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/DeprecationHandler.java b/libs/x-content/src/main/java/org/elasticsearch/xcontent/DeprecationHandler.java similarity index 99% rename from libs/x-content/src/main/java/org/elasticsearch/common/xcontent/DeprecationHandler.java rename to libs/x-content/src/main/java/org/elasticsearch/xcontent/DeprecationHandler.java index 5a01a27764ed2..17457b48bdd3c 100644 --- a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/DeprecationHandler.java +++ b/libs/x-content/src/main/java/org/elasticsearch/xcontent/DeprecationHandler.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.xcontent; +package org.elasticsearch.xcontent; import java.util.function.Supplier; diff --git a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/ErrorOnUnknown.java b/libs/x-content/src/main/java/org/elasticsearch/xcontent/ErrorOnUnknown.java similarity index 97% rename from libs/x-content/src/main/java/org/elasticsearch/common/xcontent/ErrorOnUnknown.java rename to libs/x-content/src/main/java/org/elasticsearch/xcontent/ErrorOnUnknown.java index dc25155e01777..8ffbdcb55a3f5 100644 --- a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/ErrorOnUnknown.java +++ b/libs/x-content/src/main/java/org/elasticsearch/xcontent/ErrorOnUnknown.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.xcontent; +package org.elasticsearch.xcontent; import java.util.ServiceLoader; diff --git a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/FilterXContentParser.java b/libs/x-content/src/main/java/org/elasticsearch/xcontent/FilterXContentParser.java similarity index 99% rename from libs/x-content/src/main/java/org/elasticsearch/common/xcontent/FilterXContentParser.java rename to libs/x-content/src/main/java/org/elasticsearch/xcontent/FilterXContentParser.java index f52e7da9e14ce..9803b3f621200 100644 --- a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/FilterXContentParser.java +++ b/libs/x-content/src/main/java/org/elasticsearch/xcontent/FilterXContentParser.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.xcontent; +package org.elasticsearch.xcontent; import org.elasticsearch.core.CheckedFunction; import org.elasticsearch.core.RestApiVersion; diff --git a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/InstantiatingObjectParser.java b/libs/x-content/src/main/java/org/elasticsearch/xcontent/InstantiatingObjectParser.java similarity index 99% rename from libs/x-content/src/main/java/org/elasticsearch/common/xcontent/InstantiatingObjectParser.java rename to libs/x-content/src/main/java/org/elasticsearch/xcontent/InstantiatingObjectParser.java index c2b467e67fb7d..8c23a71965e73 100644 --- a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/InstantiatingObjectParser.java +++ b/libs/x-content/src/main/java/org/elasticsearch/xcontent/InstantiatingObjectParser.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.xcontent; +package org.elasticsearch.xcontent; import java.io.IOException; import java.lang.reflect.Constructor; diff --git a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/MediaType.java b/libs/x-content/src/main/java/org/elasticsearch/xcontent/MediaType.java similarity index 97% rename from libs/x-content/src/main/java/org/elasticsearch/common/xcontent/MediaType.java rename to libs/x-content/src/main/java/org/elasticsearch/xcontent/MediaType.java index 5c7749d0fadf4..3e69a416dc581 100644 --- a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/MediaType.java +++ b/libs/x-content/src/main/java/org/elasticsearch/xcontent/MediaType.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.xcontent; +package org.elasticsearch.xcontent; import org.elasticsearch.core.Tuple; diff --git a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/MediaTypeRegistry.java b/libs/x-content/src/main/java/org/elasticsearch/xcontent/MediaTypeRegistry.java similarity index 98% rename from libs/x-content/src/main/java/org/elasticsearch/common/xcontent/MediaTypeRegistry.java rename to libs/x-content/src/main/java/org/elasticsearch/xcontent/MediaTypeRegistry.java index 43d68ef3a9a0b..d8a6cd796c933 100644 --- a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/MediaTypeRegistry.java +++ b/libs/x-content/src/main/java/org/elasticsearch/xcontent/MediaTypeRegistry.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.xcontent; +package org.elasticsearch.xcontent; import java.util.HashMap; import java.util.Locale; diff --git a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/NamedObjectNotFoundException.java b/libs/x-content/src/main/java/org/elasticsearch/xcontent/NamedObjectNotFoundException.java similarity index 95% rename from libs/x-content/src/main/java/org/elasticsearch/common/xcontent/NamedObjectNotFoundException.java rename to libs/x-content/src/main/java/org/elasticsearch/xcontent/NamedObjectNotFoundException.java index 98d6f98c63efb..c4cd944d436e1 100644 --- a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/NamedObjectNotFoundException.java +++ b/libs/x-content/src/main/java/org/elasticsearch/xcontent/NamedObjectNotFoundException.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.xcontent; +package org.elasticsearch.xcontent; /** * Thrown when {@link NamedXContentRegistry} cannot locate a named object to diff --git a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/NamedXContentRegistry.java b/libs/x-content/src/main/java/org/elasticsearch/xcontent/NamedXContentRegistry.java similarity index 99% rename from libs/x-content/src/main/java/org/elasticsearch/common/xcontent/NamedXContentRegistry.java rename to libs/x-content/src/main/java/org/elasticsearch/xcontent/NamedXContentRegistry.java index f3d93c509471c..1150207ebe712 100644 --- a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/NamedXContentRegistry.java +++ b/libs/x-content/src/main/java/org/elasticsearch/xcontent/NamedXContentRegistry.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.xcontent; +package org.elasticsearch.xcontent; import org.elasticsearch.core.CheckedFunction; import org.elasticsearch.core.RestApiVersion; diff --git a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/ObjectParser.java b/libs/x-content/src/main/java/org/elasticsearch/xcontent/ObjectParser.java similarity index 98% rename from libs/x-content/src/main/java/org/elasticsearch/common/xcontent/ObjectParser.java rename to libs/x-content/src/main/java/org/elasticsearch/xcontent/ObjectParser.java index 6f9421f72a5a9..f9aafcfb51f5a 100644 --- a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/ObjectParser.java +++ b/libs/x-content/src/main/java/org/elasticsearch/xcontent/ObjectParser.java @@ -5,7 +5,7 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -package org.elasticsearch.common.xcontent; +package org.elasticsearch.xcontent; import org.elasticsearch.core.Nullable; import org.elasticsearch.core.RestApiVersion; @@ -29,13 +29,13 @@ import java.util.function.Supplier; import static java.util.Objects.requireNonNull; -import static org.elasticsearch.common.xcontent.XContentParser.Token.START_ARRAY; -import static org.elasticsearch.common.xcontent.XContentParser.Token.START_OBJECT; -import static org.elasticsearch.common.xcontent.XContentParser.Token.VALUE_BOOLEAN; -import static org.elasticsearch.common.xcontent.XContentParser.Token.VALUE_EMBEDDED_OBJECT; -import static org.elasticsearch.common.xcontent.XContentParser.Token.VALUE_NULL; -import static org.elasticsearch.common.xcontent.XContentParser.Token.VALUE_NUMBER; -import static org.elasticsearch.common.xcontent.XContentParser.Token.VALUE_STRING; +import static org.elasticsearch.xcontent.XContentParser.Token.START_ARRAY; +import static org.elasticsearch.xcontent.XContentParser.Token.START_OBJECT; +import static org.elasticsearch.xcontent.XContentParser.Token.VALUE_BOOLEAN; +import static org.elasticsearch.xcontent.XContentParser.Token.VALUE_EMBEDDED_OBJECT; +import static org.elasticsearch.xcontent.XContentParser.Token.VALUE_NULL; +import static org.elasticsearch.xcontent.XContentParser.Token.VALUE_NUMBER; +import static org.elasticsearch.xcontent.XContentParser.Token.VALUE_STRING; /** * A declarative, stateless parser that turns XContent into setter calls. A single parser should be defined for each object being parsed, diff --git a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/ObjectPath.java b/libs/x-content/src/main/java/org/elasticsearch/xcontent/ObjectPath.java similarity index 97% rename from libs/x-content/src/main/java/org/elasticsearch/common/xcontent/ObjectPath.java rename to libs/x-content/src/main/java/org/elasticsearch/xcontent/ObjectPath.java index 5310caab2f45a..84b588b1d1a21 100644 --- a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/ObjectPath.java +++ b/libs/x-content/src/main/java/org/elasticsearch/xcontent/ObjectPath.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.xcontent; +package org.elasticsearch.xcontent; import java.lang.reflect.Array; import java.util.List; diff --git a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/ParseField.java b/libs/x-content/src/main/java/org/elasticsearch/xcontent/ParseField.java similarity index 99% rename from libs/x-content/src/main/java/org/elasticsearch/common/xcontent/ParseField.java rename to libs/x-content/src/main/java/org/elasticsearch/xcontent/ParseField.java index 4558cd4648606..10415f62eb62a 100644 --- a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/ParseField.java +++ b/libs/x-content/src/main/java/org/elasticsearch/xcontent/ParseField.java @@ -5,7 +5,7 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -package org.elasticsearch.common.xcontent; +package org.elasticsearch.xcontent; import org.elasticsearch.core.RestApiVersion; diff --git a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/ParsedMediaType.java b/libs/x-content/src/main/java/org/elasticsearch/xcontent/ParsedMediaType.java similarity index 99% rename from libs/x-content/src/main/java/org/elasticsearch/common/xcontent/ParsedMediaType.java rename to libs/x-content/src/main/java/org/elasticsearch/xcontent/ParsedMediaType.java index 506bdb023d4d0..dc414a48acc8f 100644 --- a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/ParsedMediaType.java +++ b/libs/x-content/src/main/java/org/elasticsearch/xcontent/ParsedMediaType.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.xcontent; +package org.elasticsearch.xcontent; import java.util.HashMap; import java.util.Locale; diff --git a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/ParserConstructor.java b/libs/x-content/src/main/java/org/elasticsearch/xcontent/ParserConstructor.java similarity index 94% rename from libs/x-content/src/main/java/org/elasticsearch/common/xcontent/ParserConstructor.java rename to libs/x-content/src/main/java/org/elasticsearch/xcontent/ParserConstructor.java index 1896ae1ed4e2e..3760f4cc258fa 100644 --- a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/ParserConstructor.java +++ b/libs/x-content/src/main/java/org/elasticsearch/xcontent/ParserConstructor.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.xcontent; +package org.elasticsearch.xcontent; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; diff --git a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/ToXContent.java b/libs/x-content/src/main/java/org/elasticsearch/xcontent/ToXContent.java similarity index 98% rename from libs/x-content/src/main/java/org/elasticsearch/common/xcontent/ToXContent.java rename to libs/x-content/src/main/java/org/elasticsearch/xcontent/ToXContent.java index 74a127424f7f2..5c769435fb9ab 100644 --- a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/ToXContent.java +++ b/libs/x-content/src/main/java/org/elasticsearch/xcontent/ToXContent.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.xcontent; +package org.elasticsearch.xcontent; import org.elasticsearch.core.Booleans; diff --git a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/ToXContentFragment.java b/libs/x-content/src/main/java/org/elasticsearch/xcontent/ToXContentFragment.java similarity index 95% rename from libs/x-content/src/main/java/org/elasticsearch/common/xcontent/ToXContentFragment.java rename to libs/x-content/src/main/java/org/elasticsearch/xcontent/ToXContentFragment.java index 89d72f5daee59..461194bb6ca54 100644 --- a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/ToXContentFragment.java +++ b/libs/x-content/src/main/java/org/elasticsearch/xcontent/ToXContentFragment.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.xcontent; +package org.elasticsearch.xcontent; /** * An interface allowing to transfer an object to "XContent" using an diff --git a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/ToXContentObject.java b/libs/x-content/src/main/java/org/elasticsearch/xcontent/ToXContentObject.java similarity index 95% rename from libs/x-content/src/main/java/org/elasticsearch/common/xcontent/ToXContentObject.java rename to libs/x-content/src/main/java/org/elasticsearch/xcontent/ToXContentObject.java index c7b674fc2ebec..ffb5c03f32b1c 100644 --- a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/ToXContentObject.java +++ b/libs/x-content/src/main/java/org/elasticsearch/xcontent/ToXContentObject.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.xcontent; +package org.elasticsearch.xcontent; /** * An interface allowing to transfer an object to "XContent" using an diff --git a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/XContent.java b/libs/x-content/src/main/java/org/elasticsearch/xcontent/XContent.java similarity index 97% rename from libs/x-content/src/main/java/org/elasticsearch/common/xcontent/XContent.java rename to libs/x-content/src/main/java/org/elasticsearch/xcontent/XContent.java index 5010ef0228a80..d40bedf38b39f 100644 --- a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/XContent.java +++ b/libs/x-content/src/main/java/org/elasticsearch/xcontent/XContent.java @@ -6,9 +6,9 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.xcontent; +package org.elasticsearch.xcontent; -import org.elasticsearch.common.xcontent.support.filtering.FilterPath; +import org.elasticsearch.xcontent.support.filtering.FilterPath; import org.elasticsearch.core.RestApiVersion; import java.io.IOException; diff --git a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/XContentBuilder.java b/libs/x-content/src/main/java/org/elasticsearch/xcontent/XContentBuilder.java similarity index 99% rename from libs/x-content/src/main/java/org/elasticsearch/common/xcontent/XContentBuilder.java rename to libs/x-content/src/main/java/org/elasticsearch/xcontent/XContentBuilder.java index a9c62a646d3be..6920e8b85c740 100644 --- a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/XContentBuilder.java +++ b/libs/x-content/src/main/java/org/elasticsearch/xcontent/XContentBuilder.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.xcontent; +package org.elasticsearch.xcontent; import org.elasticsearch.core.CheckedConsumer; import org.elasticsearch.core.RestApiVersion; @@ -1199,11 +1199,11 @@ public XContentGenerator generator() { return this.generator; } - static void ensureNameNotNull(String name) { + public static void ensureNameNotNull(String name) { ensureNotNull(name, "Field name cannot be null"); } - static void ensureNotNull(Object value, String message) { + public static void ensureNotNull(Object value, String message) { if (value == null) { throw new IllegalArgumentException(message); } diff --git a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/XContentBuilderExtension.java b/libs/x-content/src/main/java/org/elasticsearch/xcontent/XContentBuilderExtension.java similarity index 98% rename from libs/x-content/src/main/java/org/elasticsearch/common/xcontent/XContentBuilderExtension.java rename to libs/x-content/src/main/java/org/elasticsearch/xcontent/XContentBuilderExtension.java index c7148932cb52e..d6e6ba12342a9 100644 --- a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/XContentBuilderExtension.java +++ b/libs/x-content/src/main/java/org/elasticsearch/xcontent/XContentBuilderExtension.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.xcontent; +package org.elasticsearch.xcontent; import java.util.Map; import java.util.function.Function; diff --git a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/XContentFactory.java b/libs/x-content/src/main/java/org/elasticsearch/xcontent/XContentFactory.java similarity index 94% rename from libs/x-content/src/main/java/org/elasticsearch/common/xcontent/XContentFactory.java rename to libs/x-content/src/main/java/org/elasticsearch/xcontent/XContentFactory.java index 8204711df2981..02c4fe15ebfd2 100644 --- a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/XContentFactory.java +++ b/libs/x-content/src/main/java/org/elasticsearch/xcontent/XContentFactory.java @@ -6,28 +6,28 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.xcontent; +package org.elasticsearch.xcontent; import com.fasterxml.jackson.dataformat.cbor.CBORConstants; import com.fasterxml.jackson.dataformat.smile.SmileConstants; -import org.elasticsearch.common.xcontent.cbor.CborXContent; -import org.elasticsearch.common.xcontent.json.JsonXContent; -import org.elasticsearch.common.xcontent.smile.SmileXContent; -import org.elasticsearch.common.xcontent.yaml.YamlXContent; +import org.elasticsearch.xcontent.cbor.CborXContent; +import org.elasticsearch.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.smile.SmileXContent; +import org.elasticsearch.xcontent.yaml.YamlXContent; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; /** - * A one stop to use {@link org.elasticsearch.common.xcontent.XContent} and {@link XContentBuilder}. + * A one stop to use {@link org.elasticsearch.xcontent.XContent} and {@link XContentBuilder}. */ public class XContentFactory { - static final int GUESS_HEADER_LENGTH = 20; + public static final int GUESS_HEADER_LENGTH = 20; /** - * Returns a content builder using JSON format ({@link org.elasticsearch.common.xcontent.XContentType#JSON}. + * Returns a content builder using JSON format ({@link org.elasticsearch.xcontent.XContentType#JSON}. */ public static XContentBuilder jsonBuilder() throws IOException { return contentBuilder(XContentType.JSON); @@ -41,7 +41,7 @@ public static XContentBuilder jsonBuilder(OutputStream os) throws IOException { } /** - * Returns a content builder using SMILE format ({@link org.elasticsearch.common.xcontent.XContentType#SMILE}. + * Returns a content builder using SMILE format ({@link org.elasticsearch.xcontent.XContentType#SMILE}. */ public static XContentBuilder smileBuilder() throws IOException { return contentBuilder(XContentType.SMILE); @@ -55,7 +55,7 @@ public static XContentBuilder smileBuilder(OutputStream os) throws IOException { } /** - * Returns a content builder using YAML format ({@link org.elasticsearch.common.xcontent.XContentType#YAML}. + * Returns a content builder using YAML format ({@link org.elasticsearch.xcontent.XContentType#YAML}. */ public static XContentBuilder yamlBuilder() throws IOException { return contentBuilder(XContentType.YAML); @@ -69,7 +69,7 @@ public static XContentBuilder yamlBuilder(OutputStream os) throws IOException { } /** - * Returns a content builder using CBOR format ({@link org.elasticsearch.common.xcontent.XContentType#CBOR}. + * Returns a content builder using CBOR format ({@link org.elasticsearch.xcontent.XContentType#CBOR}. */ public static XContentBuilder cborBuilder() throws IOException { return contentBuilder(XContentType.CBOR); @@ -118,7 +118,7 @@ public static XContentBuilder contentBuilder(XContentType type) throws IOExcepti } /** - * Returns the {@link org.elasticsearch.common.xcontent.XContent} for the provided content type. + * Returns the {@link org.elasticsearch.xcontent.XContent} for the provided content type. */ public static XContent xContent(XContentType type) { if (type == null) { diff --git a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/XContentGenerator.java b/libs/x-content/src/main/java/org/elasticsearch/xcontent/XContentGenerator.java similarity index 99% rename from libs/x-content/src/main/java/org/elasticsearch/common/xcontent/XContentGenerator.java rename to libs/x-content/src/main/java/org/elasticsearch/xcontent/XContentGenerator.java index 35965356db59a..f4ecaebbb8a74 100644 --- a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/XContentGenerator.java +++ b/libs/x-content/src/main/java/org/elasticsearch/xcontent/XContentGenerator.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.xcontent; +package org.elasticsearch.xcontent; import org.elasticsearch.core.CheckedConsumer; diff --git a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/XContentLocation.java b/libs/x-content/src/main/java/org/elasticsearch/xcontent/XContentLocation.java similarity index 96% rename from libs/x-content/src/main/java/org/elasticsearch/common/xcontent/XContentLocation.java rename to libs/x-content/src/main/java/org/elasticsearch/xcontent/XContentLocation.java index 33ec4c1a68504..9c8ae28d05cce 100644 --- a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/XContentLocation.java +++ b/libs/x-content/src/main/java/org/elasticsearch/xcontent/XContentLocation.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.xcontent; +package org.elasticsearch.xcontent; /** * Simple data structure representing the line and column number of a position diff --git a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/XContentParseException.java b/libs/x-content/src/main/java/org/elasticsearch/xcontent/XContentParseException.java similarity index 97% rename from libs/x-content/src/main/java/org/elasticsearch/common/xcontent/XContentParseException.java rename to libs/x-content/src/main/java/org/elasticsearch/xcontent/XContentParseException.java index 5e14ade05acbb..d628cad4152c2 100644 --- a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/XContentParseException.java +++ b/libs/x-content/src/main/java/org/elasticsearch/xcontent/XContentParseException.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.xcontent; +package org.elasticsearch.xcontent; import org.elasticsearch.core.Nullable; diff --git a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/XContentParser.java b/libs/x-content/src/main/java/org/elasticsearch/xcontent/XContentParser.java similarity index 99% rename from libs/x-content/src/main/java/org/elasticsearch/common/xcontent/XContentParser.java rename to libs/x-content/src/main/java/org/elasticsearch/xcontent/XContentParser.java index 7094c77a771a0..f9f2677fe8b2c 100644 --- a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/XContentParser.java +++ b/libs/x-content/src/main/java/org/elasticsearch/xcontent/XContentParser.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.xcontent; +package org.elasticsearch.xcontent; import org.elasticsearch.core.CheckedFunction; import org.elasticsearch.core.RestApiVersion; diff --git a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/XContentSubParser.java b/libs/x-content/src/main/java/org/elasticsearch/xcontent/XContentSubParser.java similarity index 99% rename from libs/x-content/src/main/java/org/elasticsearch/common/xcontent/XContentSubParser.java rename to libs/x-content/src/main/java/org/elasticsearch/xcontent/XContentSubParser.java index 4927717ab8dba..cc455aae8ca8b 100644 --- a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/XContentSubParser.java +++ b/libs/x-content/src/main/java/org/elasticsearch/xcontent/XContentSubParser.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.xcontent; +package org.elasticsearch.xcontent; import org.elasticsearch.core.CheckedFunction; import org.elasticsearch.core.RestApiVersion; diff --git a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/XContentType.java b/libs/x-content/src/main/java/org/elasticsearch/xcontent/XContentType.java similarity index 96% rename from libs/x-content/src/main/java/org/elasticsearch/common/xcontent/XContentType.java rename to libs/x-content/src/main/java/org/elasticsearch/xcontent/XContentType.java index 733e5422b0f43..9847ba660277e 100644 --- a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/XContentType.java +++ b/libs/x-content/src/main/java/org/elasticsearch/xcontent/XContentType.java @@ -6,18 +6,18 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.xcontent; +package org.elasticsearch.xcontent; -import org.elasticsearch.common.xcontent.cbor.CborXContent; -import org.elasticsearch.common.xcontent.json.JsonXContent; -import org.elasticsearch.common.xcontent.smile.SmileXContent; -import org.elasticsearch.common.xcontent.yaml.YamlXContent; +import org.elasticsearch.xcontent.cbor.CborXContent; +import org.elasticsearch.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.smile.SmileXContent; +import org.elasticsearch.xcontent.yaml.YamlXContent; import java.util.Map; import java.util.Set; /** - * The content type of {@link org.elasticsearch.common.xcontent.XContent}. + * The content type of {@link org.elasticsearch.xcontent.XContent}. */ public enum XContentType implements MediaType { diff --git a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/XContentUtils.java b/libs/x-content/src/main/java/org/elasticsearch/xcontent/XContentUtils.java similarity index 97% rename from libs/x-content/src/main/java/org/elasticsearch/common/xcontent/XContentUtils.java rename to libs/x-content/src/main/java/org/elasticsearch/xcontent/XContentUtils.java index 3c6219fd562ba..23ed3bd03785c 100644 --- a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/XContentUtils.java +++ b/libs/x-content/src/main/java/org/elasticsearch/xcontent/XContentUtils.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.xcontent; +package org.elasticsearch.xcontent; import java.io.IOException; diff --git a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/cbor/CborXContent.java b/libs/x-content/src/main/java/org/elasticsearch/xcontent/cbor/CborXContent.java similarity index 89% rename from libs/x-content/src/main/java/org/elasticsearch/common/xcontent/cbor/CborXContent.java rename to libs/x-content/src/main/java/org/elasticsearch/xcontent/cbor/CborXContent.java index faddaa303155c..9dfb6f47f7e86 100644 --- a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/cbor/CborXContent.java +++ b/libs/x-content/src/main/java/org/elasticsearch/xcontent/cbor/CborXContent.java @@ -6,22 +6,22 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.xcontent.cbor; +package org.elasticsearch.xcontent.cbor; import com.fasterxml.jackson.core.JsonEncoding; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.dataformat.cbor.CBORFactory; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentGenerator; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.support.filtering.FilterPath; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentGenerator; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.support.filtering.FilterPath; import org.elasticsearch.core.RestApiVersion; import java.io.ByteArrayInputStream; diff --git a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/cbor/CborXContentGenerator.java b/libs/x-content/src/main/java/org/elasticsearch/xcontent/cbor/CborXContentGenerator.java similarity index 85% rename from libs/x-content/src/main/java/org/elasticsearch/common/xcontent/cbor/CborXContentGenerator.java rename to libs/x-content/src/main/java/org/elasticsearch/xcontent/cbor/CborXContentGenerator.java index 7543b654dfb79..d9e262e568f36 100644 --- a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/cbor/CborXContentGenerator.java +++ b/libs/x-content/src/main/java/org/elasticsearch/xcontent/cbor/CborXContentGenerator.java @@ -6,11 +6,11 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.xcontent.cbor; +package org.elasticsearch.xcontent.cbor; import com.fasterxml.jackson.core.JsonGenerator; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContentGenerator; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContentGenerator; import java.io.OutputStream; import java.util.Set; diff --git a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/cbor/CborXContentParser.java b/libs/x-content/src/main/java/org/elasticsearch/xcontent/cbor/CborXContentParser.java similarity index 82% rename from libs/x-content/src/main/java/org/elasticsearch/common/xcontent/cbor/CborXContentParser.java rename to libs/x-content/src/main/java/org/elasticsearch/xcontent/cbor/CborXContentParser.java index 1412eabf6b531..75e36a60d0d32 100644 --- a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/cbor/CborXContentParser.java +++ b/libs/x-content/src/main/java/org/elasticsearch/xcontent/cbor/CborXContentParser.java @@ -6,15 +6,15 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.xcontent.cbor; +package org.elasticsearch.xcontent.cbor; import com.fasterxml.jackson.core.JsonParser; import org.elasticsearch.core.RestApiVersion; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContentParser; -import org.elasticsearch.common.xcontent.support.filtering.FilterPath; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContentParser; +import org.elasticsearch.xcontent.support.filtering.FilterPath; public class CborXContentParser extends JsonXContentParser { diff --git a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/json/JsonXContent.java b/libs/x-content/src/main/java/org/elasticsearch/xcontent/json/JsonXContent.java similarity index 90% rename from libs/x-content/src/main/java/org/elasticsearch/common/xcontent/json/JsonXContent.java rename to libs/x-content/src/main/java/org/elasticsearch/xcontent/json/JsonXContent.java index 2a9e033be5307..cf551f5761315 100644 --- a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/json/JsonXContent.java +++ b/libs/x-content/src/main/java/org/elasticsearch/xcontent/json/JsonXContent.java @@ -6,21 +6,21 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.xcontent.json; +package org.elasticsearch.xcontent.json; import com.fasterxml.jackson.core.JsonEncoding; import com.fasterxml.jackson.core.JsonFactory; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonParser; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentGenerator; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.support.filtering.FilterPath; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentGenerator; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.support.filtering.FilterPath; import org.elasticsearch.core.RestApiVersion; import java.io.ByteArrayInputStream; diff --git a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/json/JsonXContentGenerator.java b/libs/x-content/src/main/java/org/elasticsearch/xcontent/json/JsonXContentGenerator.java similarity index 96% rename from libs/x-content/src/main/java/org/elasticsearch/common/xcontent/json/JsonXContentGenerator.java rename to libs/x-content/src/main/java/org/elasticsearch/xcontent/json/JsonXContentGenerator.java index 756cd468cc6d1..d39d68438f6d1 100644 --- a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/json/JsonXContentGenerator.java +++ b/libs/x-content/src/main/java/org/elasticsearch/xcontent/json/JsonXContentGenerator.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.xcontent.json; +package org.elasticsearch.xcontent.json; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonStreamContext; @@ -18,14 +18,14 @@ import com.fasterxml.jackson.core.util.DefaultPrettyPrinter; import com.fasterxml.jackson.core.util.JsonGeneratorDelegate; import org.elasticsearch.core.CheckedConsumer; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContent; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentGenerator; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.support.filtering.FilterPathBasedFilter; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContent; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentGenerator; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.support.filtering.FilterPathBasedFilter; import org.elasticsearch.core.internal.io.Streams; import java.io.BufferedInputStream; diff --git a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/json/JsonXContentParser.java b/libs/x-content/src/main/java/org/elasticsearch/xcontent/json/JsonXContentParser.java similarity index 94% rename from libs/x-content/src/main/java/org/elasticsearch/common/xcontent/json/JsonXContentParser.java rename to libs/x-content/src/main/java/org/elasticsearch/xcontent/json/JsonXContentParser.java index 6065c025a8a8b..c210233af2661 100644 --- a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/json/JsonXContentParser.java +++ b/libs/x-content/src/main/java/org/elasticsearch/xcontent/json/JsonXContentParser.java @@ -6,20 +6,20 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.xcontent.json; +package org.elasticsearch.xcontent.json; import com.fasterxml.jackson.core.JsonLocation; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonToken; import com.fasterxml.jackson.core.filter.FilteringParserDelegate; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentLocation; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.support.AbstractXContentParser; -import org.elasticsearch.common.xcontent.support.filtering.FilterPath; -import org.elasticsearch.common.xcontent.support.filtering.FilterPathBasedFilter; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentLocation; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.support.AbstractXContentParser; +import org.elasticsearch.xcontent.support.filtering.FilterPath; +import org.elasticsearch.xcontent.support.filtering.FilterPathBasedFilter; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.core.internal.io.IOUtils; diff --git a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/smile/SmileXContent.java b/libs/x-content/src/main/java/org/elasticsearch/xcontent/smile/SmileXContent.java similarity index 91% rename from libs/x-content/src/main/java/org/elasticsearch/common/xcontent/smile/SmileXContent.java rename to libs/x-content/src/main/java/org/elasticsearch/xcontent/smile/SmileXContent.java index 807b7cccdfd57..e02f8ec307af8 100644 --- a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/smile/SmileXContent.java +++ b/libs/x-content/src/main/java/org/elasticsearch/xcontent/smile/SmileXContent.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.xcontent.smile; +package org.elasticsearch.xcontent.smile; import com.fasterxml.jackson.core.JsonEncoding; import com.fasterxml.jackson.core.JsonGenerator; @@ -14,14 +14,14 @@ import com.fasterxml.jackson.dataformat.smile.SmileFactory; import com.fasterxml.jackson.dataformat.smile.SmileGenerator; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentGenerator; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.support.filtering.FilterPath; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentGenerator; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.support.filtering.FilterPath; import org.elasticsearch.core.RestApiVersion; import java.io.ByteArrayInputStream; diff --git a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/smile/SmileXContentGenerator.java b/libs/x-content/src/main/java/org/elasticsearch/xcontent/smile/SmileXContentGenerator.java similarity index 85% rename from libs/x-content/src/main/java/org/elasticsearch/common/xcontent/smile/SmileXContentGenerator.java rename to libs/x-content/src/main/java/org/elasticsearch/xcontent/smile/SmileXContentGenerator.java index a31ebf7eda31b..ce57578673ecf 100644 --- a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/smile/SmileXContentGenerator.java +++ b/libs/x-content/src/main/java/org/elasticsearch/xcontent/smile/SmileXContentGenerator.java @@ -6,11 +6,11 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.xcontent.smile; +package org.elasticsearch.xcontent.smile; import com.fasterxml.jackson.core.JsonGenerator; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContentGenerator; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContentGenerator; import java.io.OutputStream; import java.util.Set; diff --git a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/smile/SmileXContentParser.java b/libs/x-content/src/main/java/org/elasticsearch/xcontent/smile/SmileXContentParser.java similarity index 82% rename from libs/x-content/src/main/java/org/elasticsearch/common/xcontent/smile/SmileXContentParser.java rename to libs/x-content/src/main/java/org/elasticsearch/xcontent/smile/SmileXContentParser.java index a29f9a4843e00..d5db33a576bd8 100644 --- a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/smile/SmileXContentParser.java +++ b/libs/x-content/src/main/java/org/elasticsearch/xcontent/smile/SmileXContentParser.java @@ -6,15 +6,15 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.xcontent.smile; +package org.elasticsearch.xcontent.smile; import com.fasterxml.jackson.core.JsonParser; import org.elasticsearch.core.RestApiVersion; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContentParser; -import org.elasticsearch.common.xcontent.support.filtering.FilterPath; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContentParser; +import org.elasticsearch.xcontent.support.filtering.FilterPath; public class SmileXContentParser extends JsonXContentParser { diff --git a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/support/AbstractXContentParser.java b/libs/x-content/src/main/java/org/elasticsearch/xcontent/support/AbstractXContentParser.java similarity index 98% rename from libs/x-content/src/main/java/org/elasticsearch/common/xcontent/support/AbstractXContentParser.java rename to libs/x-content/src/main/java/org/elasticsearch/xcontent/support/AbstractXContentParser.java index 9e7b9c4538b05..b1c599f43037b 100644 --- a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/support/AbstractXContentParser.java +++ b/libs/x-content/src/main/java/org/elasticsearch/xcontent/support/AbstractXContentParser.java @@ -6,15 +6,15 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.xcontent.support; +package org.elasticsearch.xcontent.support; import org.elasticsearch.core.Booleans; import org.elasticsearch.core.CheckedFunction; import org.elasticsearch.core.RestApiVersion; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.math.BigDecimal; diff --git a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/support/MapXContentParser.java b/libs/x-content/src/main/java/org/elasticsearch/xcontent/support/MapXContentParser.java similarity index 97% rename from libs/x-content/src/main/java/org/elasticsearch/common/xcontent/support/MapXContentParser.java rename to libs/x-content/src/main/java/org/elasticsearch/xcontent/support/MapXContentParser.java index fa967d8663e85..ab7aed4fcdbc1 100644 --- a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/support/MapXContentParser.java +++ b/libs/x-content/src/main/java/org/elasticsearch/xcontent/support/MapXContentParser.java @@ -6,13 +6,13 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.xcontent.support; +package org.elasticsearch.xcontent.support; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentLocation; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentLocation; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.math.BigDecimal; diff --git a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/support/filtering/FilterPath.java b/libs/x-content/src/main/java/org/elasticsearch/xcontent/support/filtering/FilterPath.java similarity index 92% rename from libs/x-content/src/main/java/org/elasticsearch/common/xcontent/support/filtering/FilterPath.java rename to libs/x-content/src/main/java/org/elasticsearch/xcontent/support/filtering/FilterPath.java index d42b160c0ef63..393bd8b69c77f 100644 --- a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/support/filtering/FilterPath.java +++ b/libs/x-content/src/main/java/org/elasticsearch/xcontent/support/filtering/FilterPath.java @@ -7,7 +7,7 @@ */ -package org.elasticsearch.common.xcontent.support.filtering; +package org.elasticsearch.xcontent.support.filtering; import org.elasticsearch.core.Glob; @@ -17,7 +17,7 @@ public class FilterPath { - static final FilterPath EMPTY = new FilterPath(); + public static final FilterPath EMPTY = new FilterPath(); private final String filter; private final String segment; @@ -48,7 +48,7 @@ public boolean matches() { return next == null; } - boolean isDoubleWildcard() { + public boolean isDoubleWildcard() { return doubleWildcard; } @@ -59,15 +59,15 @@ public boolean hasDoubleWildcard() { return filter.indexOf("**") >= 0; } - boolean isSimpleWildcard() { + public boolean isSimpleWildcard() { return simpleWildcard; } - String getSegment() { + public String getSegment() { return segment; } - FilterPath getNext() { + public FilterPath getNext() { return next; } diff --git a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/support/filtering/FilterPathBasedFilter.java b/libs/x-content/src/main/java/org/elasticsearch/xcontent/support/filtering/FilterPathBasedFilter.java similarity index 98% rename from libs/x-content/src/main/java/org/elasticsearch/common/xcontent/support/filtering/FilterPathBasedFilter.java rename to libs/x-content/src/main/java/org/elasticsearch/xcontent/support/filtering/FilterPathBasedFilter.java index 95a5ca520a380..30a09f959a236 100644 --- a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/support/filtering/FilterPathBasedFilter.java +++ b/libs/x-content/src/main/java/org/elasticsearch/xcontent/support/filtering/FilterPathBasedFilter.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.xcontent.support.filtering; +package org.elasticsearch.xcontent.support.filtering; import com.fasterxml.jackson.core.filter.TokenFilter; diff --git a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/yaml/YamlXContent.java b/libs/x-content/src/main/java/org/elasticsearch/xcontent/yaml/YamlXContent.java similarity index 90% rename from libs/x-content/src/main/java/org/elasticsearch/common/xcontent/yaml/YamlXContent.java rename to libs/x-content/src/main/java/org/elasticsearch/xcontent/yaml/YamlXContent.java index fcdeedaace2d2..b3a684d20583d 100644 --- a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/yaml/YamlXContent.java +++ b/libs/x-content/src/main/java/org/elasticsearch/xcontent/yaml/YamlXContent.java @@ -6,20 +6,20 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.xcontent.yaml; +package org.elasticsearch.xcontent.yaml; import com.fasterxml.jackson.core.JsonEncoding; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.dataformat.yaml.YAMLFactory; import org.elasticsearch.core.RestApiVersion; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentGenerator; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.support.filtering.FilterPath; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentGenerator; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.support.filtering.FilterPath; import java.io.ByteArrayInputStream; import java.io.IOException; diff --git a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/yaml/YamlXContentGenerator.java b/libs/x-content/src/main/java/org/elasticsearch/xcontent/yaml/YamlXContentGenerator.java similarity index 85% rename from libs/x-content/src/main/java/org/elasticsearch/common/xcontent/yaml/YamlXContentGenerator.java rename to libs/x-content/src/main/java/org/elasticsearch/xcontent/yaml/YamlXContentGenerator.java index 10a311998bf59..a2318359e9c8e 100644 --- a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/yaml/YamlXContentGenerator.java +++ b/libs/x-content/src/main/java/org/elasticsearch/xcontent/yaml/YamlXContentGenerator.java @@ -6,11 +6,11 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.xcontent.yaml; +package org.elasticsearch.xcontent.yaml; import com.fasterxml.jackson.core.JsonGenerator; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContentGenerator; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContentGenerator; import java.io.OutputStream; import java.util.Set; diff --git a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/yaml/YamlXContentParser.java b/libs/x-content/src/main/java/org/elasticsearch/xcontent/yaml/YamlXContentParser.java similarity index 80% rename from libs/x-content/src/main/java/org/elasticsearch/common/xcontent/yaml/YamlXContentParser.java rename to libs/x-content/src/main/java/org/elasticsearch/xcontent/yaml/YamlXContentParser.java index c7811831c5b10..b51aa5fd1f50d 100644 --- a/libs/x-content/src/main/java/org/elasticsearch/common/xcontent/yaml/YamlXContentParser.java +++ b/libs/x-content/src/main/java/org/elasticsearch/xcontent/yaml/YamlXContentParser.java @@ -6,15 +6,15 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.xcontent.yaml; +package org.elasticsearch.xcontent.yaml; import com.fasterxml.jackson.core.JsonParser; import org.elasticsearch.core.RestApiVersion; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContentParser; -import org.elasticsearch.common.xcontent.support.filtering.FilterPath; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContentParser; +import org.elasticsearch.xcontent.support.filtering.FilterPath; public class YamlXContentParser extends JsonXContentParser { diff --git a/libs/x-content/src/test/java/org/elasticsearch/common/xcontent/ConstructingObjectParserTests.java b/libs/x-content/src/test/java/org/elasticsearch/xcontent/ConstructingObjectParserTests.java similarity index 99% rename from libs/x-content/src/test/java/org/elasticsearch/common/xcontent/ConstructingObjectParserTests.java rename to libs/x-content/src/test/java/org/elasticsearch/xcontent/ConstructingObjectParserTests.java index 74b29cf8b8e90..e6662ca3d96bc 100644 --- a/libs/x-content/src/test/java/org/elasticsearch/common/xcontent/ConstructingObjectParserTests.java +++ b/libs/x-content/src/test/java/org/elasticsearch/xcontent/ConstructingObjectParserTests.java @@ -6,14 +6,14 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.xcontent; +package org.elasticsearch.xcontent; import org.elasticsearch.core.CheckedFunction; import org.elasticsearch.core.Nullable; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.common.logging.DeprecationLogger; -import org.elasticsearch.common.xcontent.ObjectParserTests.NamedObject; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ObjectParserTests.NamedObject; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.ESTestCase; import org.hamcrest.Matcher; @@ -22,8 +22,8 @@ import java.util.List; import java.util.function.BiConsumer; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; import static org.hamcrest.Matchers.anyOf; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; diff --git a/libs/x-content/src/test/java/org/elasticsearch/common/xcontent/InstantiatingObjectParserTests.java b/libs/x-content/src/test/java/org/elasticsearch/xcontent/InstantiatingObjectParserTests.java similarity index 96% rename from libs/x-content/src/test/java/org/elasticsearch/common/xcontent/InstantiatingObjectParserTests.java rename to libs/x-content/src/test/java/org/elasticsearch/xcontent/InstantiatingObjectParserTests.java index cc3af9e0a33af..db155c2334851 100644 --- a/libs/x-content/src/test/java/org/elasticsearch/common/xcontent/InstantiatingObjectParserTests.java +++ b/libs/x-content/src/test/java/org/elasticsearch/xcontent/InstantiatingObjectParserTests.java @@ -6,15 +6,18 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.xcontent; +package org.elasticsearch.xcontent; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.InstantiatingObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ParserConstructor; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.ESTestCase; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.instanceOf; diff --git a/libs/x-content/src/test/java/org/elasticsearch/common/xcontent/MapXContentParserTests.java b/libs/x-content/src/test/java/org/elasticsearch/xcontent/MapXContentParserTests.java similarity index 96% rename from libs/x-content/src/test/java/org/elasticsearch/common/xcontent/MapXContentParserTests.java rename to libs/x-content/src/test/java/org/elasticsearch/xcontent/MapXContentParserTests.java index afae071adc83e..15c2104799570 100644 --- a/libs/x-content/src/test/java/org/elasticsearch/common/xcontent/MapXContentParserTests.java +++ b/libs/x-content/src/test/java/org/elasticsearch/xcontent/MapXContentParserTests.java @@ -6,19 +6,20 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.xcontent; +package org.elasticsearch.xcontent; +import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; import org.elasticsearch.core.CheckedConsumer; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.json.JsonXContent; -import org.elasticsearch.common.xcontent.support.MapXContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.support.MapXContentParser; import org.elasticsearch.test.ESTestCase; import java.io.IOException; import java.util.EnumSet; import java.util.Map; -import static org.elasticsearch.common.xcontent.XContentParserTests.generateRandomObject; +import static org.elasticsearch.xcontent.XContentParserTests.generateRandomObject; public class MapXContentParserTests extends ESTestCase { diff --git a/libs/x-content/src/test/java/org/elasticsearch/common/xcontent/ObjectParserTests.java b/libs/x-content/src/test/java/org/elasticsearch/xcontent/ObjectParserTests.java similarity index 99% rename from libs/x-content/src/test/java/org/elasticsearch/common/xcontent/ObjectParserTests.java rename to libs/x-content/src/test/java/org/elasticsearch/xcontent/ObjectParserTests.java index d910da285dc82..278702a4bb1e0 100644 --- a/libs/x-content/src/test/java/org/elasticsearch/common/xcontent/ObjectParserTests.java +++ b/libs/x-content/src/test/java/org/elasticsearch/xcontent/ObjectParserTests.java @@ -5,14 +5,15 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -package org.elasticsearch.common.xcontent; +package org.elasticsearch.xcontent; +import org.elasticsearch.common.xcontent.XContentParserUtils; import org.elasticsearch.core.CheckedFunction; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ObjectParser.NamedObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ObjectParser.NamedObjectParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.ESTestCase; import java.io.ByteArrayOutputStream; diff --git a/libs/x-content/src/test/java/org/elasticsearch/common/xcontent/ObjectPathTests.java b/libs/x-content/src/test/java/org/elasticsearch/xcontent/ObjectPathTests.java similarity index 96% rename from libs/x-content/src/test/java/org/elasticsearch/common/xcontent/ObjectPathTests.java rename to libs/x-content/src/test/java/org/elasticsearch/xcontent/ObjectPathTests.java index 721f34aec9af3..4f9dcb3cbf673 100644 --- a/libs/x-content/src/test/java/org/elasticsearch/common/xcontent/ObjectPathTests.java +++ b/libs/x-content/src/test/java/org/elasticsearch/xcontent/ObjectPathTests.java @@ -6,9 +6,10 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.xcontent; +package org.elasticsearch.xcontent; import org.elasticsearch.test.ESTestCase; +import org.elasticsearch.xcontent.ObjectPath; import java.util.ArrayList; import java.util.Arrays; diff --git a/libs/x-content/src/test/java/org/elasticsearch/common/ParseFieldTests.java b/libs/x-content/src/test/java/org/elasticsearch/xcontent/ParseFieldTests.java similarity index 97% rename from libs/x-content/src/test/java/org/elasticsearch/common/ParseFieldTests.java rename to libs/x-content/src/test/java/org/elasticsearch/xcontent/ParseFieldTests.java index de70ddb39d804..dc663f4455a5e 100644 --- a/libs/x-content/src/test/java/org/elasticsearch/common/ParseFieldTests.java +++ b/libs/x-content/src/test/java/org/elasticsearch/xcontent/ParseFieldTests.java @@ -5,12 +5,12 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -package org.elasticsearch.common; +package org.elasticsearch.xcontent; -import org.elasticsearch.common.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.DeprecationHandler; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentLocation; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentLocation; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.test.ESTestCase; diff --git a/libs/x-content/src/test/java/org/elasticsearch/common/xcontent/ParsedMediaTypeTests.java b/libs/x-content/src/test/java/org/elasticsearch/xcontent/ParsedMediaTypeTests.java similarity index 98% rename from libs/x-content/src/test/java/org/elasticsearch/common/xcontent/ParsedMediaTypeTests.java rename to libs/x-content/src/test/java/org/elasticsearch/xcontent/ParsedMediaTypeTests.java index b2a3902d61ede..f2a3b944b9482 100644 --- a/libs/x-content/src/test/java/org/elasticsearch/common/xcontent/ParsedMediaTypeTests.java +++ b/libs/x-content/src/test/java/org/elasticsearch/xcontent/ParsedMediaTypeTests.java @@ -6,9 +6,11 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.xcontent; +package org.elasticsearch.xcontent; import org.elasticsearch.test.ESTestCase; +import org.elasticsearch.xcontent.MediaTypeRegistry; +import org.elasticsearch.xcontent.ParsedMediaType; import java.util.Collections; import java.util.Map; diff --git a/libs/x-content/src/test/java/org/elasticsearch/common/xcontent/SimpleStruct.java b/libs/x-content/src/test/java/org/elasticsearch/xcontent/SimpleStruct.java similarity index 94% rename from libs/x-content/src/test/java/org/elasticsearch/common/xcontent/SimpleStruct.java rename to libs/x-content/src/test/java/org/elasticsearch/xcontent/SimpleStruct.java index a7b44dadb5508..f3a648119f60c 100644 --- a/libs/x-content/src/test/java/org/elasticsearch/common/xcontent/SimpleStruct.java +++ b/libs/x-content/src/test/java/org/elasticsearch/xcontent/SimpleStruct.java @@ -6,14 +6,14 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.xcontent; +package org.elasticsearch.xcontent; import org.elasticsearch.common.Strings; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; /** * Simple structure with 3 fields: int, double and String. diff --git a/libs/x-content/src/test/java/org/elasticsearch/common/xcontent/XContentParserTests.java b/libs/x-content/src/test/java/org/elasticsearch/xcontent/XContentParserTests.java similarity index 99% rename from libs/x-content/src/test/java/org/elasticsearch/common/xcontent/XContentParserTests.java rename to libs/x-content/src/test/java/org/elasticsearch/xcontent/XContentParserTests.java index 87cbb9a40494b..1d18aa9a7bdb8 100644 --- a/libs/x-content/src/test/java/org/elasticsearch/common/xcontent/XContentParserTests.java +++ b/libs/x-content/src/test/java/org/elasticsearch/xcontent/XContentParserTests.java @@ -6,13 +6,13 @@ * Side Public License, v 1. */ -package org.elasticsearch.common.xcontent; +package org.elasticsearch.xcontent; import com.fasterxml.jackson.core.JsonParseException; import org.elasticsearch.common.CheckedSupplier; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/modules/aggs-matrix-stats/src/main/java/org/elasticsearch/search/aggregations/matrix/ArrayValuesSourceAggregationBuilder.java b/modules/aggs-matrix-stats/src/main/java/org/elasticsearch/search/aggregations/matrix/ArrayValuesSourceAggregationBuilder.java index d5ac981c83886..86a1151333e59 100644 --- a/modules/aggs-matrix-stats/src/main/java/org/elasticsearch/search/aggregations/matrix/ArrayValuesSourceAggregationBuilder.java +++ b/modules/aggs-matrix-stats/src/main/java/org/elasticsearch/search/aggregations/matrix/ArrayValuesSourceAggregationBuilder.java @@ -9,8 +9,6 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.aggregations.AbstractAggregationBuilder; import org.elasticsearch.search.aggregations.AggregationInitializationException; import org.elasticsearch.search.aggregations.AggregatorFactories; @@ -20,6 +18,8 @@ import org.elasticsearch.search.aggregations.support.CoreValuesSourceType; import org.elasticsearch.search.aggregations.support.ValueType; import org.elasticsearch.search.aggregations.support.ValuesSourceConfig; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.ArrayList; diff --git a/modules/aggs-matrix-stats/src/main/java/org/elasticsearch/search/aggregations/matrix/ArrayValuesSourceParser.java b/modules/aggs-matrix-stats/src/main/java/org/elasticsearch/search/aggregations/matrix/ArrayValuesSourceParser.java index 3ebc43576bb5c..68daf3e8dbb6d 100644 --- a/modules/aggs-matrix-stats/src/main/java/org/elasticsearch/search/aggregations/matrix/ArrayValuesSourceParser.java +++ b/modules/aggs-matrix-stats/src/main/java/org/elasticsearch/search/aggregations/matrix/ArrayValuesSourceParser.java @@ -9,8 +9,6 @@ package org.elasticsearch.search.aggregations.matrix; import org.elasticsearch.common.ParsingException; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.script.Script; import org.elasticsearch.search.aggregations.AggregationBuilder.CommonFields; import org.elasticsearch.search.aggregations.Aggregator; @@ -19,6 +17,8 @@ import org.elasticsearch.search.aggregations.support.ValuesSource; import org.elasticsearch.search.aggregations.support.ValuesSourceAggregationBuilder; import org.elasticsearch.search.aggregations.support.ValuesSourceType; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; diff --git a/modules/aggs-matrix-stats/src/main/java/org/elasticsearch/search/aggregations/matrix/spi/MatrixStatsNamedXContentProvider.java b/modules/aggs-matrix-stats/src/main/java/org/elasticsearch/search/aggregations/matrix/spi/MatrixStatsNamedXContentProvider.java index 659de22577a57..ff3e6e06e22b7 100644 --- a/modules/aggs-matrix-stats/src/main/java/org/elasticsearch/search/aggregations/matrix/spi/MatrixStatsNamedXContentProvider.java +++ b/modules/aggs-matrix-stats/src/main/java/org/elasticsearch/search/aggregations/matrix/spi/MatrixStatsNamedXContentProvider.java @@ -8,13 +8,13 @@ package org.elasticsearch.search.aggregations.matrix.spi; -import org.elasticsearch.common.xcontent.ContextParser; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ParseField; import org.elasticsearch.plugins.spi.NamedXContentProvider; import org.elasticsearch.search.aggregations.Aggregation; import org.elasticsearch.search.aggregations.matrix.stats.MatrixStatsAggregationBuilder; import org.elasticsearch.search.aggregations.matrix.stats.ParsedMatrixStats; +import org.elasticsearch.xcontent.ContextParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ParseField; import java.util.List; diff --git a/modules/aggs-matrix-stats/src/main/java/org/elasticsearch/search/aggregations/matrix/stats/InternalMatrixStats.java b/modules/aggs-matrix-stats/src/main/java/org/elasticsearch/search/aggregations/matrix/stats/InternalMatrixStats.java index 15264b9b51c93..78df56972c31d 100644 --- a/modules/aggs-matrix-stats/src/main/java/org/elasticsearch/search/aggregations/matrix/stats/InternalMatrixStats.java +++ b/modules/aggs-matrix-stats/src/main/java/org/elasticsearch/search/aggregations/matrix/stats/InternalMatrixStats.java @@ -9,8 +9,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.aggregations.InternalAggregation; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.ArrayList; diff --git a/modules/aggs-matrix-stats/src/main/java/org/elasticsearch/search/aggregations/matrix/stats/MatrixStatsAggregationBuilder.java b/modules/aggs-matrix-stats/src/main/java/org/elasticsearch/search/aggregations/matrix/stats/MatrixStatsAggregationBuilder.java index 5f09915812921..075cfa157470f 100644 --- a/modules/aggs-matrix-stats/src/main/java/org/elasticsearch/search/aggregations/matrix/stats/MatrixStatsAggregationBuilder.java +++ b/modules/aggs-matrix-stats/src/main/java/org/elasticsearch/search/aggregations/matrix/stats/MatrixStatsAggregationBuilder.java @@ -9,8 +9,6 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.MultiValueMode; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.AggregatorFactories; @@ -18,6 +16,8 @@ import org.elasticsearch.search.aggregations.matrix.ArrayValuesSourceAggregationBuilder; import org.elasticsearch.search.aggregations.support.AggregationContext; import org.elasticsearch.search.aggregations.support.ValuesSourceConfig; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Map; diff --git a/modules/aggs-matrix-stats/src/main/java/org/elasticsearch/search/aggregations/matrix/stats/MatrixStatsParser.java b/modules/aggs-matrix-stats/src/main/java/org/elasticsearch/search/aggregations/matrix/stats/MatrixStatsParser.java index 2578ff59a7acb..c42cea2778b0c 100644 --- a/modules/aggs-matrix-stats/src/main/java/org/elasticsearch/search/aggregations/matrix/stats/MatrixStatsParser.java +++ b/modules/aggs-matrix-stats/src/main/java/org/elasticsearch/search/aggregations/matrix/stats/MatrixStatsParser.java @@ -7,12 +7,12 @@ */ package org.elasticsearch.search.aggregations.matrix.stats; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.search.MultiValueMode; import org.elasticsearch.search.aggregations.matrix.ArrayValuesSourceParser.NumericValuesSourceParser; import org.elasticsearch.search.aggregations.support.ValueType; import org.elasticsearch.search.aggregations.support.ValuesSourceType; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Map; diff --git a/modules/aggs-matrix-stats/src/main/java/org/elasticsearch/search/aggregations/matrix/stats/ParsedMatrixStats.java b/modules/aggs-matrix-stats/src/main/java/org/elasticsearch/search/aggregations/matrix/stats/ParsedMatrixStats.java index fe0f59cb17db4..21731a9cc068a 100644 --- a/modules/aggs-matrix-stats/src/main/java/org/elasticsearch/search/aggregations/matrix/stats/ParsedMatrixStats.java +++ b/modules/aggs-matrix-stats/src/main/java/org/elasticsearch/search/aggregations/matrix/stats/ParsedMatrixStats.java @@ -8,11 +8,11 @@ package org.elasticsearch.search.aggregations.matrix.stats; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.search.aggregations.ParsedAggregation; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.HashMap; diff --git a/modules/aggs-matrix-stats/src/test/java/org/elasticsearch/search/aggregations/matrix/stats/InternalMatrixStatsTests.java b/modules/aggs-matrix-stats/src/test/java/org/elasticsearch/search/aggregations/matrix/stats/InternalMatrixStatsTests.java index c7b5a6bf654c6..5d4701155ab18 100644 --- a/modules/aggs-matrix-stats/src/test/java/org/elasticsearch/search/aggregations/matrix/stats/InternalMatrixStatsTests.java +++ b/modules/aggs-matrix-stats/src/test/java/org/elasticsearch/search/aggregations/matrix/stats/InternalMatrixStatsTests.java @@ -11,9 +11,6 @@ import org.elasticsearch.common.util.CollectionUtils; import org.elasticsearch.common.util.MockBigArrays; import org.elasticsearch.common.util.MockPageCacheRecycler; -import org.elasticsearch.common.xcontent.ContextParser; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ParseField; import org.elasticsearch.indices.breaker.NoneCircuitBreakerService; import org.elasticsearch.plugins.SearchPlugin; import org.elasticsearch.script.ScriptService; @@ -24,6 +21,9 @@ import org.elasticsearch.search.aggregations.matrix.stats.InternalMatrixStats.Fields; import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator.PipelineTree; import org.elasticsearch.test.InternalAggregationTestCase; +import org.elasticsearch.xcontent.ContextParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ParseField; import java.io.IOException; import java.util.ArrayList; diff --git a/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/ASCIIFoldingTokenFilterFactory.java b/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/ASCIIFoldingTokenFilterFactory.java index 5eb45f6362372..2fafba4c8807b 100644 --- a/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/ASCIIFoldingTokenFilterFactory.java +++ b/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/ASCIIFoldingTokenFilterFactory.java @@ -10,7 +10,7 @@ import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.miscellaneous.ASCIIFoldingFilter; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.env.Environment; import org.elasticsearch.index.IndexSettings; diff --git a/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/CommonAnalysisPlugin.java b/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/CommonAnalysisPlugin.java index 336a59eb70fde..6896b4b94781b 100644 --- a/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/CommonAnalysisPlugin.java +++ b/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/CommonAnalysisPlugin.java @@ -109,7 +109,7 @@ import org.elasticsearch.common.logging.DeprecationLogger; import org.elasticsearch.common.regex.Regex; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.env.Environment; import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.index.IndexSettings; diff --git a/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/FingerprintAnalyzerProvider.java b/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/FingerprintAnalyzerProvider.java index d85bbcb401ec8..bceb378b2187e 100644 --- a/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/FingerprintAnalyzerProvider.java +++ b/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/FingerprintAnalyzerProvider.java @@ -10,7 +10,7 @@ import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.analysis.CharArraySet; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.env.Environment; import org.elasticsearch.index.IndexSettings; diff --git a/modules/analysis-common/src/test/java/org/elasticsearch/analysis/common/HighlighterWithAnalyzersTests.java b/modules/analysis-common/src/test/java/org/elasticsearch/analysis/common/HighlighterWithAnalyzersTests.java index 0f7807c8e4b81..ec46ebac072c5 100644 --- a/modules/analysis-common/src/test/java/org/elasticsearch/analysis/common/HighlighterWithAnalyzersTests.java +++ b/modules/analysis-common/src/test/java/org/elasticsearch/analysis/common/HighlighterWithAnalyzersTests.java @@ -10,8 +10,8 @@ import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.query.Operator; import org.elasticsearch.plugins.Plugin; @@ -24,7 +24,7 @@ import java.util.Collection; import static org.elasticsearch.client.Requests.searchRequest; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.boolQuery; import static org.elasticsearch.index.query.QueryBuilders.matchPhrasePrefixQuery; import static org.elasticsearch.index.query.QueryBuilders.matchPhraseQuery; diff --git a/modules/ingest-common/src/internalClusterTest/java/org/elasticsearch/ingest/common/IngestRestartIT.java b/modules/ingest-common/src/internalClusterTest/java/org/elasticsearch/ingest/common/IngestRestartIT.java index 2faf055edb969..4bc82afad69b2 100644 --- a/modules/ingest-common/src/internalClusterTest/java/org/elasticsearch/ingest/common/IngestRestartIT.java +++ b/modules/ingest-common/src/internalClusterTest/java/org/elasticsearch/ingest/common/IngestRestartIT.java @@ -13,7 +13,7 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.ingest.IngestStats; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.script.MockScriptEngine; diff --git a/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/GrokProcessorGetAction.java b/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/GrokProcessorGetAction.java index b8e0aea827a29..2b61265dfd290 100644 --- a/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/GrokProcessorGetAction.java +++ b/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/GrokProcessorGetAction.java @@ -19,8 +19,8 @@ import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.grok.Grok; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; diff --git a/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/JsonProcessor.java b/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/JsonProcessor.java index 68c1db0023fa7..b179c02e0a80a 100644 --- a/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/JsonProcessor.java +++ b/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/JsonProcessor.java @@ -10,10 +10,10 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.ingest.AbstractProcessor; import org.elasticsearch.ingest.ConfigurationUtils; import org.elasticsearch.ingest.IngestDocument; diff --git a/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/ScriptProcessor.java b/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/ScriptProcessor.java index ecb317902a49b..ae5aef0dc8c15 100644 --- a/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/ScriptProcessor.java +++ b/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/ScriptProcessor.java @@ -12,11 +12,11 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.util.CollectionUtils; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.ingest.AbstractProcessor; import org.elasticsearch.ingest.IngestDocument; import org.elasticsearch.ingest.Processor; diff --git a/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/GrokProcessorGetActionTests.java b/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/GrokProcessorGetActionTests.java index efae348adea33..d12719c5f317f 100644 --- a/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/GrokProcessorGetActionTests.java +++ b/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/GrokProcessorGetActionTests.java @@ -13,10 +13,10 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.grok.Grok; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.transport.TransportService; diff --git a/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/JsonProcessorTests.java b/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/JsonProcessorTests.java index c1ed2c49c36a4..7ce41cace0744 100644 --- a/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/JsonProcessorTests.java +++ b/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/JsonProcessorTests.java @@ -9,10 +9,10 @@ package org.elasticsearch.ingest.common; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.ingest.IngestDocument; import org.elasticsearch.ingest.RandomDocumentPicks; import org.elasticsearch.test.ESTestCase; diff --git a/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/ScriptProcessorFactoryTests.java b/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/ScriptProcessorFactoryTests.java index 443c73e5dbe5c..676d16cbe26f0 100644 --- a/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/ScriptProcessorFactoryTests.java +++ b/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/ScriptProcessorFactoryTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParseException; import org.elasticsearch.script.IngestScript; import org.elasticsearch.script.MockScriptEngine; import org.elasticsearch.script.Script; diff --git a/modules/ingest-geoip/qa/file-based-update/src/test/java/org/elasticsearch/ingest/geoip/UpdateDatabasesIT.java b/modules/ingest-geoip/qa/file-based-update/src/test/java/org/elasticsearch/ingest/geoip/UpdateDatabasesIT.java index c6c0d3592fc67..fd907738e5b28 100644 --- a/modules/ingest-geoip/qa/file-based-update/src/test/java/org/elasticsearch/ingest/geoip/UpdateDatabasesIT.java +++ b/modules/ingest-geoip/qa/file-based-update/src/test/java/org/elasticsearch/ingest/geoip/UpdateDatabasesIT.java @@ -14,9 +14,9 @@ import org.elasticsearch.common.settings.SecureString; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.ObjectPath; +import org.elasticsearch.xcontent.ObjectPath; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.rest.ESRestTestCase; import java.io.IOException; diff --git a/modules/ingest-geoip/src/internalClusterTest/java/org/elasticsearch/ingest/geoip/GeoIpDownloaderIT.java b/modules/ingest-geoip/src/internalClusterTest/java/org/elasticsearch/ingest/geoip/GeoIpDownloaderIT.java index e2e7290fa9b68..da312e2d73df3 100644 --- a/modules/ingest-geoip/src/internalClusterTest/java/org/elasticsearch/ingest/geoip/GeoIpDownloaderIT.java +++ b/modules/ingest-geoip/src/internalClusterTest/java/org/elasticsearch/ingest/geoip/GeoIpDownloaderIT.java @@ -19,9 +19,9 @@ import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.core.SuppressForbidden; import org.elasticsearch.core.TimeValue; import org.elasticsearch.env.Environment; diff --git a/modules/ingest-geoip/src/internalClusterTest/java/org/elasticsearch/ingest/geoip/GeoIpDownloaderStatsIT.java b/modules/ingest-geoip/src/internalClusterTest/java/org/elasticsearch/ingest/geoip/GeoIpDownloaderStatsIT.java index aa58cabbe3806..33b6da9bcc193 100644 --- a/modules/ingest-geoip/src/internalClusterTest/java/org/elasticsearch/ingest/geoip/GeoIpDownloaderStatsIT.java +++ b/modules/ingest-geoip/src/internalClusterTest/java/org/elasticsearch/ingest/geoip/GeoIpDownloaderStatsIT.java @@ -11,9 +11,9 @@ import org.elasticsearch.action.admin.cluster.settings.ClusterUpdateSettingsResponse; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; import org.elasticsearch.reindex.ReindexPlugin; import org.elasticsearch.ingest.geoip.stats.GeoIpDownloaderStatsAction; @@ -29,7 +29,7 @@ import java.util.Map; import java.util.stream.Collectors; -import static org.elasticsearch.common.xcontent.ToXContent.EMPTY_PARAMS; +import static org.elasticsearch.xcontent.ToXContent.EMPTY_PARAMS; import static org.hamcrest.Matchers.containsInAnyOrder; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.greaterThan; diff --git a/modules/ingest-geoip/src/internalClusterTest/java/org/elasticsearch/ingest/geoip/GeoIpProcessorNonIngestNodeIT.java b/modules/ingest-geoip/src/internalClusterTest/java/org/elasticsearch/ingest/geoip/GeoIpProcessorNonIngestNodeIT.java index dee3b6ec3e7c8..d4cf5f7116bd2 100644 --- a/modules/ingest-geoip/src/internalClusterTest/java/org/elasticsearch/ingest/geoip/GeoIpProcessorNonIngestNodeIT.java +++ b/modules/ingest-geoip/src/internalClusterTest/java/org/elasticsearch/ingest/geoip/GeoIpProcessorNonIngestNodeIT.java @@ -14,9 +14,9 @@ import org.elasticsearch.action.ingest.PutPipelineRequest; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.ingest.IngestService; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.test.NodeRoles; diff --git a/modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/GeoIpDownloader.java b/modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/GeoIpDownloader.java index 9ba7961069975..eee296492a4c1 100644 --- a/modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/GeoIpDownloader.java +++ b/modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/GeoIpDownloader.java @@ -21,10 +21,10 @@ import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Setting.Property; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.TimeValue; import org.elasticsearch.index.query.BoolQueryBuilder; import org.elasticsearch.index.query.MatchQueryBuilder; diff --git a/modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/GeoIpTaskParams.java b/modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/GeoIpTaskParams.java index 896becc6b0d8e..8cd65fa8a9fcf 100644 --- a/modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/GeoIpTaskParams.java +++ b/modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/GeoIpTaskParams.java @@ -11,9 +11,9 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.persistent.PersistentTaskParams; import java.io.IOException; diff --git a/modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/GeoIpTaskState.java b/modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/GeoIpTaskState.java index cbc6acd277ed9..4b2d803419c4b 100644 --- a/modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/GeoIpTaskState.java +++ b/modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/GeoIpTaskState.java @@ -13,11 +13,11 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.VersionedNamedWriteable; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.TimeValue; import org.elasticsearch.core.Tuple; import org.elasticsearch.persistent.PersistentTaskState; @@ -32,8 +32,8 @@ import java.util.Objects; import java.util.stream.Collectors; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; import static org.elasticsearch.ingest.geoip.GeoIpDownloader.GEOIP_DOWNLOADER; class GeoIpTaskState implements PersistentTaskState, VersionedNamedWriteable { diff --git a/modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/IngestGeoIpPlugin.java b/modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/IngestGeoIpPlugin.java index 0cd5deac94c92..cb27cdb26c1de 100644 --- a/modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/IngestGeoIpPlugin.java +++ b/modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/IngestGeoIpPlugin.java @@ -17,7 +17,7 @@ import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; import org.elasticsearch.cluster.node.DiscoveryNodes; import org.elasticsearch.cluster.service.ClusterService; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.settings.ClusterSettings; import org.elasticsearch.common.settings.IndexScopedSettings; @@ -25,8 +25,8 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.SettingsFilter; import org.elasticsearch.common.settings.SettingsModule; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.env.Environment; import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.indices.SystemIndexDescriptor; @@ -62,7 +62,7 @@ import java.util.Map; import java.util.function.Supplier; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.mapper.MapperService.SINGLE_MAPPING_NAME; import static org.elasticsearch.ingest.IngestService.INGEST_ORIGIN; import static org.elasticsearch.ingest.geoip.GeoIpDownloader.DATABASES_INDEX; diff --git a/modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/stats/GeoIpDownloaderStats.java b/modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/stats/GeoIpDownloaderStats.java index 73dbcee7e46a3..36d2e5be9757a 100644 --- a/modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/stats/GeoIpDownloaderStats.java +++ b/modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/stats/GeoIpDownloaderStats.java @@ -11,10 +11,10 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.ingest.geoip.GeoIpDownloader; import org.elasticsearch.tasks.Task; diff --git a/modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/stats/GeoIpDownloaderStatsAction.java b/modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/stats/GeoIpDownloaderStatsAction.java index a9c817dbc8ad6..6cf73333f2219 100644 --- a/modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/stats/GeoIpDownloaderStatsAction.java +++ b/modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/stats/GeoIpDownloaderStatsAction.java @@ -18,8 +18,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.transport.TransportRequest; import java.io.IOException; diff --git a/modules/ingest-geoip/src/test/java/org/elasticsearch/ingest/geoip/DatabaseRegistryTests.java b/modules/ingest-geoip/src/test/java/org/elasticsearch/ingest/geoip/DatabaseRegistryTests.java index 73803f5b78d19..6ed329a54c2b2 100644 --- a/modules/ingest-geoip/src/test/java/org/elasticsearch/ingest/geoip/DatabaseRegistryTests.java +++ b/modules/ingest-geoip/src/test/java/org/elasticsearch/ingest/geoip/DatabaseRegistryTests.java @@ -36,8 +36,8 @@ import org.elasticsearch.common.io.Streams; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.Index; import org.elasticsearch.index.query.TermQueryBuilder; import org.elasticsearch.index.shard.ShardId; diff --git a/modules/ingest-geoip/src/test/java/org/elasticsearch/ingest/geoip/GeoIpDownloaderTests.java b/modules/ingest-geoip/src/test/java/org/elasticsearch/ingest/geoip/GeoIpDownloaderTests.java index 4b4342e978522..131d1100b0df5 100644 --- a/modules/ingest-geoip/src/test/java/org/elasticsearch/ingest/geoip/GeoIpDownloaderTests.java +++ b/modules/ingest-geoip/src/test/java/org/elasticsearch/ingest/geoip/GeoIpDownloaderTests.java @@ -27,8 +27,8 @@ import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.settings.ClusterSettings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.node.Node; import org.elasticsearch.persistent.PersistentTaskState; import org.elasticsearch.persistent.PersistentTasksCustomMetadata.PersistentTask; diff --git a/modules/ingest-geoip/src/test/java/org/elasticsearch/ingest/geoip/GeoIpTaskStateSerializationTests.java b/modules/ingest-geoip/src/test/java/org/elasticsearch/ingest/geoip/GeoIpTaskStateSerializationTests.java index b5f5043d8ae5e..69b4a21c86890 100644 --- a/modules/ingest-geoip/src/test/java/org/elasticsearch/ingest/geoip/GeoIpTaskStateSerializationTests.java +++ b/modules/ingest-geoip/src/test/java/org/elasticsearch/ingest/geoip/GeoIpTaskStateSerializationTests.java @@ -9,7 +9,7 @@ package org.elasticsearch.ingest.geoip; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/modules/ingest-geoip/src/test/java/org/elasticsearch/ingest/geoip/stats/GeoIpDownloaderStatsSerializingTests.java b/modules/ingest-geoip/src/test/java/org/elasticsearch/ingest/geoip/stats/GeoIpDownloaderStatsSerializingTests.java index 7bb30fd7c203b..7ff2674bff3f5 100644 --- a/modules/ingest-geoip/src/test/java/org/elasticsearch/ingest/geoip/stats/GeoIpDownloaderStatsSerializingTests.java +++ b/modules/ingest-geoip/src/test/java/org/elasticsearch/ingest/geoip/stats/GeoIpDownloaderStatsSerializingTests.java @@ -9,7 +9,7 @@ package org.elasticsearch.ingest.geoip.stats; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/modules/ingest-user-agent/src/main/java/org/elasticsearch/ingest/useragent/DeviceTypeParser.java b/modules/ingest-user-agent/src/main/java/org/elasticsearch/ingest/useragent/DeviceTypeParser.java index 0108e428ba451..97b0f4160577c 100644 --- a/modules/ingest-user-agent/src/main/java/org/elasticsearch/ingest/useragent/DeviceTypeParser.java +++ b/modules/ingest-user-agent/src/main/java/org/elasticsearch/ingest/useragent/DeviceTypeParser.java @@ -10,10 +10,10 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.io.InputStream; diff --git a/modules/ingest-user-agent/src/main/java/org/elasticsearch/ingest/useragent/UserAgentParser.java b/modules/ingest-user-agent/src/main/java/org/elasticsearch/ingest/useragent/UserAgentParser.java index c142f93ef8d98..9658458d57420 100644 --- a/modules/ingest-user-agent/src/main/java/org/elasticsearch/ingest/useragent/UserAgentParser.java +++ b/modules/ingest-user-agent/src/main/java/org/elasticsearch/ingest/useragent/UserAgentParser.java @@ -10,10 +10,10 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; diff --git a/modules/ingest-user-agent/src/test/java/org/elasticsearch/ingest/useragent/DeviceTypeParserTests.java b/modules/ingest-user-agent/src/test/java/org/elasticsearch/ingest/useragent/DeviceTypeParserTests.java index dcde87fbb258e..115521dd4a912 100644 --- a/modules/ingest-user-agent/src/test/java/org/elasticsearch/ingest/useragent/DeviceTypeParserTests.java +++ b/modules/ingest-user-agent/src/test/java/org/elasticsearch/ingest/useragent/DeviceTypeParserTests.java @@ -8,10 +8,10 @@ package org.elasticsearch.ingest.useragent; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.junit.BeforeClass; diff --git a/modules/kibana/src/javaRestTest/java/org/elasticsearch/kibana/KibanaSystemIndexIT.java b/modules/kibana/src/javaRestTest/java/org/elasticsearch/kibana/KibanaSystemIndexIT.java index f4aac6fa0da5a..f82461f70b785 100644 --- a/modules/kibana/src/javaRestTest/java/org/elasticsearch/kibana/KibanaSystemIndexIT.java +++ b/modules/kibana/src/javaRestTest/java/org/elasticsearch/kibana/KibanaSystemIndexIT.java @@ -15,8 +15,8 @@ import org.elasticsearch.client.Request; import org.elasticsearch.client.Response; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.test.rest.ESRestTestCase; +import org.elasticsearch.xcontent.json.JsonXContent; import java.io.IOException; import java.util.Arrays; diff --git a/modules/lang-expression/src/internalClusterTest/java/org/elasticsearch/script/expression/MoreExpressionIT.java b/modules/lang-expression/src/internalClusterTest/java/org/elasticsearch/script/expression/MoreExpressionIT.java index 2a3864aca3227..194555c589310 100644 --- a/modules/lang-expression/src/internalClusterTest/java/org/elasticsearch/script/expression/MoreExpressionIT.java +++ b/modules/lang-expression/src/internalClusterTest/java/org/elasticsearch/script/expression/MoreExpressionIT.java @@ -14,8 +14,8 @@ import org.elasticsearch.action.search.SearchType; import org.elasticsearch.action.update.UpdateRequestBuilder; import org.elasticsearch.common.lucene.search.function.CombineFunction; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.index.query.functionscore.ScoreFunctionBuilders; import org.elasticsearch.index.query.functionscore.ScriptScoreFunctionBuilder; @@ -39,7 +39,7 @@ import java.util.Map; import static org.elasticsearch.action.support.WriteRequest.RefreshPolicy.IMMEDIATE; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.search.aggregations.AggregationBuilders.histogram; import static org.elasticsearch.search.aggregations.AggregationBuilders.sum; import static org.elasticsearch.search.aggregations.PipelineAggregatorBuilders.bucketScript; diff --git a/modules/lang-expression/src/internalClusterTest/java/org/elasticsearch/script/expression/StoredExpressionIT.java b/modules/lang-expression/src/internalClusterTest/java/org/elasticsearch/script/expression/StoredExpressionIT.java index a82f2dde12477..46665649a081b 100644 --- a/modules/lang-expression/src/internalClusterTest/java/org/elasticsearch/script/expression/StoredExpressionIT.java +++ b/modules/lang-expression/src/internalClusterTest/java/org/elasticsearch/script/expression/StoredExpressionIT.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.script.Script; import org.elasticsearch.script.ScriptType; diff --git a/modules/lang-mustache/src/internalClusterTest/java/org/elasticsearch/script/mustache/MultiSearchTemplateIT.java b/modules/lang-mustache/src/internalClusterTest/java/org/elasticsearch/script/mustache/MultiSearchTemplateIT.java index f41da742b71e9..700d3c38214a8 100644 --- a/modules/lang-mustache/src/internalClusterTest/java/org/elasticsearch/script/mustache/MultiSearchTemplateIT.java +++ b/modules/lang-mustache/src/internalClusterTest/java/org/elasticsearch/script/mustache/MultiSearchTemplateIT.java @@ -22,7 +22,7 @@ import java.util.HashMap; import java.util.Map; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount; import static org.hamcrest.Matchers.arrayWithSize; import static org.hamcrest.Matchers.equalTo; diff --git a/modules/lang-mustache/src/internalClusterTest/java/org/elasticsearch/script/mustache/SearchTemplateIT.java b/modules/lang-mustache/src/internalClusterTest/java/org/elasticsearch/script/mustache/SearchTemplateIT.java index 1f49cceb1d1db..e24aabff21c0d 100644 --- a/modules/lang-mustache/src/internalClusterTest/java/org/elasticsearch/script/mustache/SearchTemplateIT.java +++ b/modules/lang-mustache/src/internalClusterTest/java/org/elasticsearch/script/mustache/SearchTemplateIT.java @@ -12,8 +12,8 @@ import org.elasticsearch.action.bulk.BulkRequestBuilder; import org.elasticsearch.action.search.SearchRequest; import org.elasticsearch.common.bytes.BytesArray; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.script.ScriptType; import org.elasticsearch.test.ESSingleNodeTestCase; @@ -25,7 +25,7 @@ import java.util.HashMap; import java.util.Map; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount; import static org.hamcrest.Matchers.containsString; diff --git a/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/CustomMustacheFactory.java b/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/CustomMustacheFactory.java index e98981995859c..c2938cc6c7334 100644 --- a/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/CustomMustacheFactory.java +++ b/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/CustomMustacheFactory.java @@ -20,8 +20,8 @@ import com.github.mustachejava.codes.IterableCode; import com.github.mustachejava.codes.WriteCode; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.io.StringWriter; diff --git a/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/MultiSearchTemplateRequest.java b/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/MultiSearchTemplateRequest.java index d25ad0fa81882..809c0157eaa3e 100644 --- a/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/MultiSearchTemplateRequest.java +++ b/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/MultiSearchTemplateRequest.java @@ -17,9 +17,9 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContent; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.ByteArrayOutputStream; import java.io.IOException; diff --git a/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/MultiSearchTemplateResponse.java b/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/MultiSearchTemplateResponse.java index 204ef7d94dd85..c2f7345e05bb5 100644 --- a/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/MultiSearchTemplateResponse.java +++ b/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/MultiSearchTemplateResponse.java @@ -18,10 +18,10 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Arrays; diff --git a/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/RestRenderSearchTemplateAction.java b/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/RestRenderSearchTemplateAction.java index b72d86a4b63fa..b67e1e9a41887 100644 --- a/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/RestRenderSearchTemplateAction.java +++ b/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/RestRenderSearchTemplateAction.java @@ -9,7 +9,7 @@ package org.elasticsearch.script.mustache; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestToXContentListener; diff --git a/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/RestSearchTemplateAction.java b/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/RestSearchTemplateAction.java index 619aeb976ddd0..8ec26e720e3d6 100644 --- a/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/RestSearchTemplateAction.java +++ b/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/RestSearchTemplateAction.java @@ -11,7 +11,7 @@ import org.elasticsearch.action.search.SearchRequest; import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.core.RestApiVersion; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestStatusToXContentListener; diff --git a/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/SearchTemplateRequest.java b/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/SearchTemplateRequest.java index 7302409e73729..b0da5a84aae01 100644 --- a/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/SearchTemplateRequest.java +++ b/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/SearchTemplateRequest.java @@ -12,16 +12,16 @@ import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.CompositeIndicesRequest; import org.elasticsearch.action.search.SearchRequest; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.script.ScriptType; import java.io.IOException; diff --git a/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/SearchTemplateResponse.java b/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/SearchTemplateResponse.java index a1737786b45f4..2f682ae28ae4c 100644 --- a/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/SearchTemplateResponse.java +++ b/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/SearchTemplateResponse.java @@ -10,15 +10,15 @@ import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.xcontent.StatusToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.rest.RestStatus; import java.io.IOException; diff --git a/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/TransportMultiSearchTemplateAction.java b/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/TransportMultiSearchTemplateAction.java index 92ddb6cdc212d..6af8d269f32a4 100644 --- a/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/TransportMultiSearchTemplateAction.java +++ b/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/TransportMultiSearchTemplateAction.java @@ -16,7 +16,7 @@ import org.elasticsearch.action.support.HandledTransportAction; import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.common.inject.Inject; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.script.ScriptService; import org.elasticsearch.tasks.Task; import org.elasticsearch.transport.TransportService; diff --git a/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/TransportSearchTemplateAction.java b/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/TransportSearchTemplateAction.java index 21f16be87431a..6493ee856d7dd 100644 --- a/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/TransportSearchTemplateAction.java +++ b/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/TransportSearchTemplateAction.java @@ -16,10 +16,10 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.rest.action.search.RestSearchAction; import org.elasticsearch.script.Script; import org.elasticsearch.script.ScriptService; diff --git a/modules/lang-mustache/src/test/java/org/elasticsearch/script/mustache/MultiSearchTemplateRequestTests.java b/modules/lang-mustache/src/test/java/org/elasticsearch/script/mustache/MultiSearchTemplateRequestTests.java index c8009134c9bad..e79b93f65d148 100644 --- a/modules/lang-mustache/src/test/java/org/elasticsearch/script/mustache/MultiSearchTemplateRequestTests.java +++ b/modules/lang-mustache/src/test/java/org/elasticsearch/script/mustache/MultiSearchTemplateRequestTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.action.search.SearchRequest; import org.elasticsearch.common.bytes.BytesArray; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.script.ScriptType; import org.elasticsearch.search.Scroll; diff --git a/modules/lang-mustache/src/test/java/org/elasticsearch/script/mustache/MultiSearchTemplateResponseTests.java b/modules/lang-mustache/src/test/java/org/elasticsearch/script/mustache/MultiSearchTemplateResponseTests.java index 05190519b9693..bacfedd229a3a 100644 --- a/modules/lang-mustache/src/test/java/org/elasticsearch/script/mustache/MultiSearchTemplateResponseTests.java +++ b/modules/lang-mustache/src/test/java/org/elasticsearch/script/mustache/MultiSearchTemplateResponseTests.java @@ -11,8 +11,8 @@ import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.action.search.ShardSearchFailure; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.internal.InternalSearchResponse; import org.elasticsearch.test.AbstractXContentTestCase; diff --git a/modules/lang-mustache/src/test/java/org/elasticsearch/script/mustache/MustacheScriptEngineTests.java b/modules/lang-mustache/src/test/java/org/elasticsearch/script/mustache/MustacheScriptEngineTests.java index a2e39a78e4958..a0dc8b6f506df 100644 --- a/modules/lang-mustache/src/test/java/org/elasticsearch/script/mustache/MustacheScriptEngineTests.java +++ b/modules/lang-mustache/src/test/java/org/elasticsearch/script/mustache/MustacheScriptEngineTests.java @@ -9,8 +9,8 @@ import com.github.mustachejava.MustacheFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.script.TemplateScript; import org.elasticsearch.script.Script; import org.elasticsearch.test.ESTestCase; diff --git a/modules/lang-mustache/src/test/java/org/elasticsearch/script/mustache/MustacheTests.java b/modules/lang-mustache/src/test/java/org/elasticsearch/script/mustache/MustacheTests.java index 6bca4699289db..9a925e3b5aef7 100644 --- a/modules/lang-mustache/src/test/java/org/elasticsearch/script/mustache/MustacheTests.java +++ b/modules/lang-mustache/src/test/java/org/elasticsearch/script/mustache/MustacheTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.script.mustache; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; import org.elasticsearch.script.ScriptEngine; import org.elasticsearch.script.ScriptException; @@ -29,7 +29,7 @@ import static java.util.Collections.singleton; import static java.util.Collections.singletonMap; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.both; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.emptyOrNullString; diff --git a/modules/lang-mustache/src/test/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateActionTests.java b/modules/lang-mustache/src/test/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateActionTests.java index 2a6eef44c3c17..3aaa314580fde 100644 --- a/modules/lang-mustache/src/test/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateActionTests.java +++ b/modules/lang-mustache/src/test/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateActionTests.java @@ -11,7 +11,7 @@ import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.test.rest.FakeRestRequest; import org.elasticsearch.test.rest.RestActionTestCase; diff --git a/modules/lang-mustache/src/test/java/org/elasticsearch/script/mustache/SearchTemplateRequestXContentTests.java b/modules/lang-mustache/src/test/java/org/elasticsearch/script/mustache/SearchTemplateRequestXContentTests.java index b9e08467c8d7f..c39e92886a9b8 100644 --- a/modules/lang-mustache/src/test/java/org/elasticsearch/script/mustache/SearchTemplateRequestXContentTests.java +++ b/modules/lang-mustache/src/test/java/org/elasticsearch/script/mustache/SearchTemplateRequestXContentTests.java @@ -9,13 +9,13 @@ package org.elasticsearch.script.mustache; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.script.ScriptType; import org.elasticsearch.test.AbstractXContentTestCase; diff --git a/modules/lang-mustache/src/test/java/org/elasticsearch/script/mustache/SearchTemplateResponseTests.java b/modules/lang-mustache/src/test/java/org/elasticsearch/script/mustache/SearchTemplateResponseTests.java index 53ec863474ec7..810bec0b7fa71 100644 --- a/modules/lang-mustache/src/test/java/org/elasticsearch/script/mustache/SearchTemplateResponseTests.java +++ b/modules/lang-mustache/src/test/java/org/elasticsearch/script/mustache/SearchTemplateResponseTests.java @@ -12,11 +12,11 @@ import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.action.search.ShardSearchFailure; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.SearchHits; import org.elasticsearch.search.internal.InternalSearchResponse; diff --git a/modules/lang-painless/src/doc/java/org/elasticsearch/painless/ContextApiSpecGenerator.java b/modules/lang-painless/src/doc/java/org/elasticsearch/painless/ContextApiSpecGenerator.java index c800b7da8e654..4da95c70d0a12 100644 --- a/modules/lang-painless/src/doc/java/org/elasticsearch/painless/ContextApiSpecGenerator.java +++ b/modules/lang-painless/src/doc/java/org/elasticsearch/painless/ContextApiSpecGenerator.java @@ -10,8 +10,8 @@ import org.elasticsearch.core.SuppressForbidden; import org.elasticsearch.core.PathUtils; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.core.internal.io.IOUtils; import org.elasticsearch.painless.action.PainlessContextInfo; diff --git a/modules/lang-painless/src/doc/java/org/elasticsearch/painless/ContextGeneratorCommon.java b/modules/lang-painless/src/doc/java/org/elasticsearch/painless/ContextGeneratorCommon.java index 7e3594843311e..7e18fe447e53b 100644 --- a/modules/lang-painless/src/doc/java/org/elasticsearch/painless/ContextGeneratorCommon.java +++ b/modules/lang-painless/src/doc/java/org/elasticsearch/painless/ContextGeneratorCommon.java @@ -9,8 +9,8 @@ package org.elasticsearch.painless; import org.elasticsearch.core.SuppressForbidden; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.painless.action.PainlessContextClassBindingInfo; import org.elasticsearch.painless.action.PainlessContextClassInfo; import org.elasticsearch.painless.action.PainlessContextInfo; diff --git a/modules/lang-painless/src/doc/java/org/elasticsearch/painless/JavadocExtractor.java b/modules/lang-painless/src/doc/java/org/elasticsearch/painless/JavadocExtractor.java index eda71dd095a27..0e933eb280336 100644 --- a/modules/lang-painless/src/doc/java/org/elasticsearch/painless/JavadocExtractor.java +++ b/modules/lang-painless/src/doc/java/org/elasticsearch/painless/JavadocExtractor.java @@ -22,9 +22,9 @@ import com.github.javaparser.javadoc.description.JavadocDescription; import com.github.javaparser.javadoc.description.JavadocDescriptionElement; import com.github.javaparser.javadoc.description.JavadocInlineTag; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.jsoup.Jsoup; import org.jsoup.safety.Whitelist; diff --git a/modules/lang-painless/src/doc/java/org/elasticsearch/painless/PainlessInfoJson.java b/modules/lang-painless/src/doc/java/org/elasticsearch/painless/PainlessInfoJson.java index bc7b805072a9c..c8185cfa57569 100644 --- a/modules/lang-painless/src/doc/java/org/elasticsearch/painless/PainlessInfoJson.java +++ b/modules/lang-painless/src/doc/java/org/elasticsearch/painless/PainlessInfoJson.java @@ -8,9 +8,9 @@ package org.elasticsearch.painless; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.painless.action.PainlessContextClassBindingInfo; import org.elasticsearch.painless.action.PainlessContextClassInfo; import org.elasticsearch.painless.action.PainlessContextConstructorInfo; diff --git a/modules/lang-painless/src/main/java/org/elasticsearch/painless/PainlessPlugin.java b/modules/lang-painless/src/main/java/org/elasticsearch/painless/PainlessPlugin.java index b331007dfa16e..7715048059ff2 100644 --- a/modules/lang-painless/src/main/java/org/elasticsearch/painless/PainlessPlugin.java +++ b/modules/lang-painless/src/main/java/org/elasticsearch/painless/PainlessPlugin.java @@ -22,7 +22,7 @@ import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.SettingsFilter; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.env.Environment; import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.painless.action.PainlessContextAction; diff --git a/modules/lang-painless/src/main/java/org/elasticsearch/painless/action/PainlessContextAction.java b/modules/lang-painless/src/main/java/org/elasticsearch/painless/action/PainlessContextAction.java index f255d8e809451..174cdfe418c9e 100644 --- a/modules/lang-painless/src/main/java/org/elasticsearch/painless/action/PainlessContextAction.java +++ b/modules/lang-painless/src/main/java/org/elasticsearch/painless/action/PainlessContextAction.java @@ -16,13 +16,13 @@ import org.elasticsearch.action.support.ActionFilters; import org.elasticsearch.action.support.HandledTransportAction; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.painless.PainlessScriptEngine; import org.elasticsearch.painless.lookup.PainlessLookup; import org.elasticsearch.rest.BaseRestHandler; diff --git a/modules/lang-painless/src/main/java/org/elasticsearch/painless/action/PainlessContextClassBindingInfo.java b/modules/lang-painless/src/main/java/org/elasticsearch/painless/action/PainlessContextClassBindingInfo.java index 4c3b73ee160b7..92c6a8c357671 100644 --- a/modules/lang-painless/src/main/java/org/elasticsearch/painless/action/PainlessContextClassBindingInfo.java +++ b/modules/lang-painless/src/main/java/org/elasticsearch/painless/action/PainlessContextClassBindingInfo.java @@ -8,15 +8,15 @@ package org.elasticsearch.painless.action; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.painless.lookup.PainlessClassBinding; import org.elasticsearch.painless.lookup.PainlessLookupUtility; diff --git a/modules/lang-painless/src/main/java/org/elasticsearch/painless/action/PainlessContextClassInfo.java b/modules/lang-painless/src/main/java/org/elasticsearch/painless/action/PainlessContextClassInfo.java index c79e5a8a1aef4..80560a82d92ca 100644 --- a/modules/lang-painless/src/main/java/org/elasticsearch/painless/action/PainlessContextClassInfo.java +++ b/modules/lang-painless/src/main/java/org/elasticsearch/painless/action/PainlessContextClassInfo.java @@ -8,14 +8,14 @@ package org.elasticsearch.painless.action; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.painless.lookup.PainlessClass; import java.io.IOException; diff --git a/modules/lang-painless/src/main/java/org/elasticsearch/painless/action/PainlessContextConstructorInfo.java b/modules/lang-painless/src/main/java/org/elasticsearch/painless/action/PainlessContextConstructorInfo.java index ac69f558f1a61..81c3825012bb4 100644 --- a/modules/lang-painless/src/main/java/org/elasticsearch/painless/action/PainlessContextConstructorInfo.java +++ b/modules/lang-painless/src/main/java/org/elasticsearch/painless/action/PainlessContextConstructorInfo.java @@ -8,15 +8,15 @@ package org.elasticsearch.painless.action; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.painless.lookup.PainlessConstructor; import org.elasticsearch.painless.lookup.PainlessLookupUtility; diff --git a/modules/lang-painless/src/main/java/org/elasticsearch/painless/action/PainlessContextFieldInfo.java b/modules/lang-painless/src/main/java/org/elasticsearch/painless/action/PainlessContextFieldInfo.java index c79781db6a759..b0461fc2de57f 100644 --- a/modules/lang-painless/src/main/java/org/elasticsearch/painless/action/PainlessContextFieldInfo.java +++ b/modules/lang-painless/src/main/java/org/elasticsearch/painless/action/PainlessContextFieldInfo.java @@ -8,14 +8,14 @@ package org.elasticsearch.painless.action; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.painless.lookup.PainlessField; import org.elasticsearch.painless.lookup.PainlessLookupUtility; diff --git a/modules/lang-painless/src/main/java/org/elasticsearch/painless/action/PainlessContextInfo.java b/modules/lang-painless/src/main/java/org/elasticsearch/painless/action/PainlessContextInfo.java index d335cf14b44e0..413c4be0615a9 100644 --- a/modules/lang-painless/src/main/java/org/elasticsearch/painless/action/PainlessContextInfo.java +++ b/modules/lang-painless/src/main/java/org/elasticsearch/painless/action/PainlessContextInfo.java @@ -8,14 +8,14 @@ package org.elasticsearch.painless.action; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.painless.lookup.PainlessClassBinding; import org.elasticsearch.painless.lookup.PainlessInstanceBinding; import org.elasticsearch.painless.lookup.PainlessLookup; diff --git a/modules/lang-painless/src/main/java/org/elasticsearch/painless/action/PainlessContextInstanceBindingInfo.java b/modules/lang-painless/src/main/java/org/elasticsearch/painless/action/PainlessContextInstanceBindingInfo.java index a1882961a4374..d77a862f59883 100644 --- a/modules/lang-painless/src/main/java/org/elasticsearch/painless/action/PainlessContextInstanceBindingInfo.java +++ b/modules/lang-painless/src/main/java/org/elasticsearch/painless/action/PainlessContextInstanceBindingInfo.java @@ -8,15 +8,15 @@ package org.elasticsearch.painless.action; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.painless.lookup.PainlessInstanceBinding; import org.elasticsearch.painless.lookup.PainlessLookupUtility; diff --git a/modules/lang-painless/src/main/java/org/elasticsearch/painless/action/PainlessContextMethodInfo.java b/modules/lang-painless/src/main/java/org/elasticsearch/painless/action/PainlessContextMethodInfo.java index 9f443539429f9..bba26e43c2530 100644 --- a/modules/lang-painless/src/main/java/org/elasticsearch/painless/action/PainlessContextMethodInfo.java +++ b/modules/lang-painless/src/main/java/org/elasticsearch/painless/action/PainlessContextMethodInfo.java @@ -8,15 +8,15 @@ package org.elasticsearch.painless.action; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.painless.lookup.PainlessLookupUtility; import org.elasticsearch.painless.lookup.PainlessMethod; diff --git a/modules/lang-painless/src/main/java/org/elasticsearch/painless/action/PainlessExecuteAction.java b/modules/lang-painless/src/main/java/org/elasticsearch/painless/action/PainlessExecuteAction.java index 6899d58b17cfb..439c9f1a0ecb5 100644 --- a/modules/lang-painless/src/main/java/org/elasticsearch/painless/action/PainlessExecuteAction.java +++ b/modules/lang-painless/src/main/java/org/elasticsearch/painless/action/PainlessExecuteAction.java @@ -35,7 +35,7 @@ import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.CheckedBiFunction; import org.elasticsearch.common.geo.GeometryFormatterFactory; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.geo.GeoPoint; import org.elasticsearch.common.inject.Inject; @@ -43,14 +43,14 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.network.NetworkAddress; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.geometry.Point; import org.elasticsearch.index.Index; import org.elasticsearch.index.IndexService; diff --git a/modules/lang-painless/src/main/java/org/elasticsearch/painless/api/Json.java b/modules/lang-painless/src/main/java/org/elasticsearch/painless/api/Json.java index aba48473e1e4f..a1dd1d5896801 100644 --- a/modules/lang-painless/src/main/java/org/elasticsearch/painless/api/Json.java +++ b/modules/lang-painless/src/main/java/org/elasticsearch/painless/api/Json.java @@ -8,11 +8,11 @@ package org.elasticsearch.painless.api; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import java.io.IOException; diff --git a/modules/lang-painless/src/main/java/org/elasticsearch/painless/toxcontent/UserTreeToXContent.java b/modules/lang-painless/src/main/java/org/elasticsearch/painless/toxcontent/UserTreeToXContent.java index 1adb24a13caca..7ebf73028d71f 100644 --- a/modules/lang-painless/src/main/java/org/elasticsearch/painless/toxcontent/UserTreeToXContent.java +++ b/modules/lang-painless/src/main/java/org/elasticsearch/painless/toxcontent/UserTreeToXContent.java @@ -8,7 +8,7 @@ package org.elasticsearch.painless.toxcontent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.painless.Operation; import org.elasticsearch.painless.node.AExpression; import org.elasticsearch.painless.node.ANode; diff --git a/modules/lang-painless/src/main/java/org/elasticsearch/painless/toxcontent/XContentBuilderWrapper.java b/modules/lang-painless/src/main/java/org/elasticsearch/painless/toxcontent/XContentBuilderWrapper.java index 72db1021da138..7be645ef86cf6 100644 --- a/modules/lang-painless/src/main/java/org/elasticsearch/painless/toxcontent/XContentBuilderWrapper.java +++ b/modules/lang-painless/src/main/java/org/elasticsearch/painless/toxcontent/XContentBuilderWrapper.java @@ -8,8 +8,8 @@ package org.elasticsearch.painless.toxcontent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import java.io.IOException; import java.util.List; diff --git a/modules/lang-painless/src/test/java/org/elasticsearch/painless/ToXContentTests.java b/modules/lang-painless/src/test/java/org/elasticsearch/painless/ToXContentTests.java index 4ef3953ae8065..9df31d387b078 100644 --- a/modules/lang-painless/src/test/java/org/elasticsearch/painless/ToXContentTests.java +++ b/modules/lang-painless/src/test/java/org/elasticsearch/painless/ToXContentTests.java @@ -9,8 +9,8 @@ package org.elasticsearch.painless; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; import org.elasticsearch.painless.phase.UserTreeVisitor; import org.elasticsearch.painless.symbol.ScriptScope; diff --git a/modules/lang-painless/src/test/java/org/elasticsearch/painless/action/ContextInfoTests.java b/modules/lang-painless/src/test/java/org/elasticsearch/painless/action/ContextInfoTests.java index c18b04fad4c15..d06153ebfdd0b 100644 --- a/modules/lang-painless/src/test/java/org/elasticsearch/painless/action/ContextInfoTests.java +++ b/modules/lang-painless/src/test/java/org/elasticsearch/painless/action/ContextInfoTests.java @@ -9,7 +9,7 @@ package org.elasticsearch.painless.action; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import java.util.ArrayList; diff --git a/modules/lang-painless/src/test/java/org/elasticsearch/painless/action/PainlessExecuteApiTests.java b/modules/lang-painless/src/test/java/org/elasticsearch/painless/action/PainlessExecuteApiTests.java index 1ea75f511a1d1..0e72ddf363b8d 100644 --- a/modules/lang-painless/src/test/java/org/elasticsearch/painless/action/PainlessExecuteApiTests.java +++ b/modules/lang-painless/src/test/java/org/elasticsearch/painless/action/PainlessExecuteApiTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.IndexService; import org.elasticsearch.index.query.MatchAllQueryBuilder; import org.elasticsearch.index.query.MatchQueryBuilder; diff --git a/modules/lang-painless/src/test/java/org/elasticsearch/painless/action/PainlessExecuteRequestTests.java b/modules/lang-painless/src/test/java/org/elasticsearch/painless/action/PainlessExecuteRequestTests.java index 714e3c5d00d89..969f17a2fc875 100644 --- a/modules/lang-painless/src/test/java/org/elasticsearch/painless/action/PainlessExecuteRequestTests.java +++ b/modules/lang-painless/src/test/java/org/elasticsearch/painless/action/PainlessExecuteRequestTests.java @@ -13,11 +13,11 @@ import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.query.MatchAllQueryBuilder; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.painless.action.PainlessExecuteAction.Request.ContextSetup; diff --git a/modules/lang-painless/src/test/java/org/elasticsearch/painless/action/PainlessExecuteResponseTests.java b/modules/lang-painless/src/test/java/org/elasticsearch/painless/action/PainlessExecuteResponseTests.java index edad11076ad58..945f069943045 100644 --- a/modules/lang-painless/src/test/java/org/elasticsearch/painless/action/PainlessExecuteResponseTests.java +++ b/modules/lang-painless/src/test/java/org/elasticsearch/painless/action/PainlessExecuteResponseTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.painless.action; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/modules/legacy-geo/src/internalClusterTest/java/org/elasticsearch/legacygeo/search/GeoBoundingBoxQueryLegacyGeoShapeIT.java b/modules/legacy-geo/src/internalClusterTest/java/org/elasticsearch/legacygeo/search/GeoBoundingBoxQueryLegacyGeoShapeIT.java index c92df28e79591..ee12e28c35616 100644 --- a/modules/legacy-geo/src/internalClusterTest/java/org/elasticsearch/legacygeo/search/GeoBoundingBoxQueryLegacyGeoShapeIT.java +++ b/modules/legacy-geo/src/internalClusterTest/java/org/elasticsearch/legacygeo/search/GeoBoundingBoxQueryLegacyGeoShapeIT.java @@ -9,12 +9,12 @@ package org.elasticsearch.legacygeo.search; import org.elasticsearch.Version; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.legacygeo.test.TestLegacyGeoShapeFieldMapperPlugin; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.search.geo.GeoBoundingBoxQueryIntegTestCase; import org.elasticsearch.test.VersionUtils; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import java.io.IOException; import java.util.Collection; diff --git a/modules/legacy-geo/src/internalClusterTest/java/org/elasticsearch/legacygeo/search/LegacyGeoShapeIT.java b/modules/legacy-geo/src/internalClusterTest/java/org/elasticsearch/legacygeo/search/LegacyGeoShapeIT.java index 86114e491fc0d..263d3840f7333 100644 --- a/modules/legacy-geo/src/internalClusterTest/java/org/elasticsearch/legacygeo/search/LegacyGeoShapeIT.java +++ b/modules/legacy-geo/src/internalClusterTest/java/org/elasticsearch/legacygeo/search/LegacyGeoShapeIT.java @@ -10,13 +10,13 @@ import org.elasticsearch.Version; import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.geometry.Circle; import org.elasticsearch.legacygeo.test.TestLegacyGeoShapeFieldMapperPlugin; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.search.geo.GeoShapeIntegTestCase; import org.elasticsearch.test.VersionUtils; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Collection; diff --git a/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/CircleBuilder.java b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/CircleBuilder.java index fdff95a0b4345..20d600526c589 100644 --- a/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/CircleBuilder.java +++ b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/CircleBuilder.java @@ -12,10 +12,10 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.unit.DistanceUnit; import org.elasticsearch.common.unit.DistanceUnit.Distance; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.legacygeo.GeoShapeType; import org.elasticsearch.legacygeo.parsers.ShapeParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; import org.locationtech.jts.geom.Coordinate; import org.locationtech.spatial4j.shape.Circle; diff --git a/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/EnvelopeBuilder.java b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/EnvelopeBuilder.java index ef9df9ec84b79..ab21d6f346003 100644 --- a/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/EnvelopeBuilder.java +++ b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/EnvelopeBuilder.java @@ -10,10 +10,10 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.legacygeo.GeoShapeType; import org.elasticsearch.legacygeo.parsers.GeoWKTParser; import org.elasticsearch.legacygeo.parsers.ShapeParser; +import org.elasticsearch.xcontent.XContentBuilder; import org.locationtech.jts.geom.Coordinate; import org.locationtech.spatial4j.shape.Rectangle; diff --git a/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/GeometryCollectionBuilder.java b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/GeometryCollectionBuilder.java index 97dba205d8b51..6ab28c02b5863 100644 --- a/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/GeometryCollectionBuilder.java +++ b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/GeometryCollectionBuilder.java @@ -11,13 +11,13 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.geometry.Geometry; import org.elasticsearch.geometry.GeometryCollection; import org.elasticsearch.legacygeo.GeoShapeType; import org.elasticsearch.legacygeo.XShapeCollection; import org.elasticsearch.legacygeo.parsers.GeoWKTParser; import org.elasticsearch.legacygeo.parsers.ShapeParser; +import org.elasticsearch.xcontent.XContentBuilder; import org.locationtech.spatial4j.shape.Shape; import java.io.IOException; diff --git a/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/LineStringBuilder.java b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/LineStringBuilder.java index f758b31756dcb..35574b47f5b93 100644 --- a/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/LineStringBuilder.java +++ b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/LineStringBuilder.java @@ -9,10 +9,10 @@ package org.elasticsearch.legacygeo.builders; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.geometry.Line; import org.elasticsearch.legacygeo.GeoShapeType; import org.elasticsearch.legacygeo.parsers.ShapeParser; +import org.elasticsearch.xcontent.XContentBuilder; import org.locationtech.jts.geom.Coordinate; import org.locationtech.jts.geom.Geometry; import org.locationtech.jts.geom.GeometryFactory; diff --git a/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/MultiLineStringBuilder.java b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/MultiLineStringBuilder.java index bd3c2b2cc79ed..259aadb4d9a25 100644 --- a/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/MultiLineStringBuilder.java +++ b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/MultiLineStringBuilder.java @@ -10,12 +10,12 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.geometry.Line; import org.elasticsearch.geometry.MultiLine; import org.elasticsearch.legacygeo.GeoShapeType; import org.elasticsearch.legacygeo.parsers.GeoWKTParser; import org.elasticsearch.legacygeo.parsers.ShapeParser; +import org.elasticsearch.xcontent.XContentBuilder; import org.locationtech.jts.geom.Coordinate; import org.locationtech.jts.geom.Geometry; import org.locationtech.jts.geom.LineString; diff --git a/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/MultiPointBuilder.java b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/MultiPointBuilder.java index 9aaef6749eb75..4e6c5620ff1ed 100644 --- a/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/MultiPointBuilder.java +++ b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/MultiPointBuilder.java @@ -9,11 +9,11 @@ package org.elasticsearch.legacygeo.builders; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.geometry.MultiPoint; import org.elasticsearch.legacygeo.GeoShapeType; import org.elasticsearch.legacygeo.XShapeCollection; import org.elasticsearch.legacygeo.parsers.ShapeParser; +import org.elasticsearch.xcontent.XContentBuilder; import org.locationtech.jts.geom.Coordinate; import org.locationtech.spatial4j.shape.Point; diff --git a/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/MultiPolygonBuilder.java b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/MultiPolygonBuilder.java index 5aa6d9d7dff34..c472b2dd67b67 100644 --- a/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/MultiPolygonBuilder.java +++ b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/MultiPolygonBuilder.java @@ -11,13 +11,13 @@ import org.elasticsearch.common.geo.Orientation; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.geometry.MultiPolygon; import org.elasticsearch.geometry.Polygon; import org.elasticsearch.legacygeo.GeoShapeType; import org.elasticsearch.legacygeo.XShapeCollection; import org.elasticsearch.legacygeo.parsers.GeoWKTParser; import org.elasticsearch.legacygeo.parsers.ShapeParser; +import org.elasticsearch.xcontent.XContentBuilder; import org.locationtech.jts.geom.Coordinate; import org.locationtech.spatial4j.shape.Shape; diff --git a/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/PointBuilder.java b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/PointBuilder.java index eaa69d7ede8f0..a7aa6885c3bc4 100644 --- a/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/PointBuilder.java +++ b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/PointBuilder.java @@ -9,9 +9,9 @@ package org.elasticsearch.legacygeo.builders; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.legacygeo.GeoShapeType; import org.elasticsearch.legacygeo.parsers.ShapeParser; +import org.elasticsearch.xcontent.XContentBuilder; import org.locationtech.jts.geom.Coordinate; import org.locationtech.spatial4j.shape.Point; diff --git a/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/PolygonBuilder.java b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/PolygonBuilder.java index a8b171742aafd..ec9f95302566b 100644 --- a/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/PolygonBuilder.java +++ b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/PolygonBuilder.java @@ -12,10 +12,10 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.core.Tuple; import org.elasticsearch.legacygeo.GeoShapeType; import org.elasticsearch.legacygeo.parsers.ShapeParser; +import org.elasticsearch.xcontent.XContentBuilder; import org.locationtech.jts.geom.Coordinate; import org.locationtech.jts.geom.Geometry; import org.locationtech.jts.geom.GeometryFactory; diff --git a/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/ShapeBuilder.java b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/ShapeBuilder.java index 82f54a8f9f806..c0d52c62c3bd2 100644 --- a/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/ShapeBuilder.java +++ b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/builders/ShapeBuilder.java @@ -15,10 +15,10 @@ import org.elasticsearch.common.io.stream.NamedWriteable; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.legacygeo.GeoShapeType; import org.elasticsearch.legacygeo.parsers.GeoWKTParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.locationtech.jts.geom.Coordinate; import org.locationtech.jts.geom.Geometry; import org.locationtech.jts.geom.GeometryFactory; diff --git a/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/mapper/LegacyGeoShapeFieldMapper.java b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/mapper/LegacyGeoShapeFieldMapper.java index 1d96bb5ce73a7..b285fb2d4e98c 100644 --- a/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/mapper/LegacyGeoShapeFieldMapper.java +++ b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/mapper/LegacyGeoShapeFieldMapper.java @@ -25,7 +25,6 @@ import org.elasticsearch.common.geo.SpatialStrategy; import org.elasticsearch.common.lucene.Lucene; import org.elasticsearch.common.unit.DistanceUnit; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.core.CheckedConsumer; import org.elasticsearch.geometry.Geometry; @@ -43,6 +42,7 @@ import org.elasticsearch.legacygeo.builders.ShapeBuilder; import org.elasticsearch.legacygeo.parsers.ShapeParser; import org.elasticsearch.legacygeo.query.LegacyGeoShapeQueryProcessor; +import org.elasticsearch.xcontent.XContentParser; import org.locationtech.spatial4j.shape.Point; import org.locationtech.spatial4j.shape.Shape; import org.locationtech.spatial4j.shape.jts.JtsGeometry; diff --git a/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/parsers/CoordinateNode.java b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/parsers/CoordinateNode.java index efc08c7a75182..b3c42ae97f45d 100644 --- a/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/parsers/CoordinateNode.java +++ b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/parsers/CoordinateNode.java @@ -8,8 +8,8 @@ package org.elasticsearch.legacygeo.parsers; import org.elasticsearch.ElasticsearchException; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.locationtech.jts.geom.Coordinate; import java.io.IOException; diff --git a/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/parsers/GeoJsonParser.java b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/parsers/GeoJsonParser.java index 9afc9f2ed77c1..743b8b1ec8f0f 100644 --- a/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/parsers/GeoJsonParser.java +++ b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/parsers/GeoJsonParser.java @@ -11,13 +11,13 @@ import org.elasticsearch.common.geo.GeoPoint; import org.elasticsearch.common.geo.Orientation; import org.elasticsearch.common.unit.DistanceUnit; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentSubParser; import org.elasticsearch.index.mapper.AbstractShapeGeometryFieldMapper; import org.elasticsearch.legacygeo.GeoShapeType; import org.elasticsearch.legacygeo.builders.CircleBuilder; import org.elasticsearch.legacygeo.builders.GeometryCollectionBuilder; import org.elasticsearch.legacygeo.builders.ShapeBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentSubParser; import org.locationtech.jts.geom.Coordinate; import java.io.IOException; diff --git a/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/parsers/GeoWKTParser.java b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/parsers/GeoWKTParser.java index 24479b4bfd993..6509619ffbf8f 100644 --- a/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/parsers/GeoWKTParser.java +++ b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/parsers/GeoWKTParser.java @@ -11,7 +11,6 @@ import org.elasticsearch.common.geo.GeoPoint; import org.elasticsearch.common.geo.Orientation; import org.elasticsearch.common.logging.Loggers; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.mapper.AbstractShapeGeometryFieldMapper; import org.elasticsearch.legacygeo.GeoShapeType; import org.elasticsearch.legacygeo.builders.CoordinatesBuilder; @@ -24,6 +23,7 @@ import org.elasticsearch.legacygeo.builders.PointBuilder; import org.elasticsearch.legacygeo.builders.PolygonBuilder; import org.elasticsearch.legacygeo.builders.ShapeBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.locationtech.jts.geom.Coordinate; import java.io.IOException; diff --git a/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/parsers/ShapeParser.java b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/parsers/ShapeParser.java index a8d26a19d4733..06fef4e18c973 100644 --- a/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/parsers/ShapeParser.java +++ b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/parsers/ShapeParser.java @@ -9,14 +9,14 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContent; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.support.MapXContentParser; import org.elasticsearch.index.mapper.AbstractGeometryFieldMapper; import org.elasticsearch.index.mapper.AbstractShapeGeometryFieldMapper; import org.elasticsearch.legacygeo.builders.ShapeBuilder; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.support.MapXContentParser; import java.io.IOException; import java.util.Collections; diff --git a/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/BaseGeoParsingTestCase.java b/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/BaseGeoParsingTestCase.java index dcbb4ca73a308..646470d8e91b2 100644 --- a/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/BaseGeoParsingTestCase.java +++ b/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/BaseGeoParsingTestCase.java @@ -8,12 +8,12 @@ package org.elasticsearch.legacygeo; import org.elasticsearch.common.geo.GeometryParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.mapper.GeoShapeIndexer; import org.elasticsearch.legacygeo.parsers.ShapeParser; import org.elasticsearch.legacygeo.test.ElasticsearchGeoAssertions; import org.elasticsearch.test.ESTestCase; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.locationtech.jts.geom.Geometry; import org.locationtech.jts.geom.GeometryFactory; import org.locationtech.spatial4j.shape.Shape; diff --git a/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/GeoJsonShapeParserTests.java b/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/GeoJsonShapeParserTests.java index 25960d80434a0..fcd8112dc2e6a 100644 --- a/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/GeoJsonShapeParserTests.java +++ b/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/GeoJsonShapeParserTests.java @@ -16,10 +16,6 @@ import org.elasticsearch.common.geo.GeoUtils; import org.elasticsearch.common.geo.GeometryParser; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.geometry.Geometry; import org.elasticsearch.geometry.GeometryCollection; import org.elasticsearch.geometry.Line; @@ -31,6 +27,10 @@ import org.elasticsearch.legacygeo.parsers.ShapeParser; import org.elasticsearch.legacygeo.test.ElasticsearchGeoAssertions; import org.elasticsearch.test.VersionUtils; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.locationtech.jts.geom.Coordinate; import org.locationtech.jts.geom.LineString; import org.locationtech.jts.geom.LinearRing; diff --git a/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/GeoWKTShapeParserTests.java b/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/GeoWKTShapeParserTests.java index 4b77f0bcc5033..dc7d59f56a1ec 100644 --- a/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/GeoWKTShapeParserTests.java +++ b/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/GeoWKTShapeParserTests.java @@ -12,9 +12,6 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.Version; import org.elasticsearch.common.geo.GeoPoint; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.geometry.Geometry; import org.elasticsearch.geometry.GeometryCollection; import org.elasticsearch.geometry.Line; @@ -37,6 +34,9 @@ import org.elasticsearch.legacygeo.parsers.ShapeParser; import org.elasticsearch.legacygeo.test.RandomShapeGenerator; import org.elasticsearch.test.VersionUtils; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; import org.locationtech.jts.geom.Coordinate; import org.locationtech.jts.geom.LineString; import org.locationtech.jts.geom.LinearRing; diff --git a/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/builders/AbstractShapeBuilderTestCase.java b/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/builders/AbstractShapeBuilderTestCase.java index c55e2120e639f..972e72481c771 100644 --- a/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/builders/AbstractShapeBuilderTestCase.java +++ b/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/builders/AbstractShapeBuilderTestCase.java @@ -11,14 +11,14 @@ import org.elasticsearch.common.io.stream.NamedWriteable; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.legacygeo.GeoShapeType; import org.elasticsearch.legacygeo.parsers.ShapeParser; import org.elasticsearch.test.ESTestCase; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.junit.AfterClass; import org.junit.BeforeClass; diff --git a/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/mapper/LegacyGeoShapeFieldMapperTests.java b/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/mapper/LegacyGeoShapeFieldMapperTests.java index 5f2eaaba3d117..19c99342edae2 100644 --- a/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/mapper/LegacyGeoShapeFieldMapperTests.java +++ b/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/mapper/LegacyGeoShapeFieldMapperTests.java @@ -19,8 +19,6 @@ import org.elasticsearch.common.geo.Orientation; import org.elasticsearch.common.geo.ShapeRelation; import org.elasticsearch.common.geo.SpatialStrategy; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.core.CheckedConsumer; import org.elasticsearch.geometry.Point; import org.elasticsearch.index.mapper.DocumentMapper; @@ -34,6 +32,8 @@ import org.elasticsearch.legacygeo.test.TestLegacyGeoShapeFieldMapperPlugin; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.test.VersionUtils; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Collection; diff --git a/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/search/LegacyGeoShapeQueryTests.java b/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/search/LegacyGeoShapeQueryTests.java index 4a802b5b7c420..b4511e07adf1e 100644 --- a/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/search/LegacyGeoShapeQueryTests.java +++ b/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/search/LegacyGeoShapeQueryTests.java @@ -12,8 +12,6 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.geo.GeoJson; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.geo.GeometryTestUtils; import org.elasticsearch.geometry.Geometry; import org.elasticsearch.geometry.MultiPoint; @@ -23,16 +21,18 @@ import org.elasticsearch.legacygeo.test.TestLegacyGeoShapeFieldMapperPlugin; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.search.geo.GeoShapeQueryTestCase; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import java.io.IOException; import java.util.Collection; import java.util.Collections; import static org.elasticsearch.action.support.WriteRequest.RefreshPolicy.IMMEDIATE; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.geoIntersectionQuery; import static org.elasticsearch.index.query.QueryBuilders.geoShapeQuery; import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.containsString; public class LegacyGeoShapeQueryTests extends GeoShapeQueryTestCase { diff --git a/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/test/ElasticsearchGeoAssertions.java b/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/test/ElasticsearchGeoAssertions.java index b37ac93159d7a..4f62c12a3030a 100644 --- a/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/test/ElasticsearchGeoAssertions.java +++ b/modules/legacy-geo/src/test/java/org/elasticsearch/legacygeo/test/ElasticsearchGeoAssertions.java @@ -11,10 +11,10 @@ import org.elasticsearch.common.geo.GeoDistance; import org.elasticsearch.common.geo.GeoPoint; import org.elasticsearch.common.unit.DistanceUnit; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.geometry.Line; import org.elasticsearch.geometry.MultiLine; import org.elasticsearch.legacygeo.parsers.ShapeParser; +import org.elasticsearch.xcontent.XContentParser; import org.hamcrest.Matcher; import org.junit.Assert; import org.locationtech.jts.geom.Coordinate; diff --git a/modules/mapper-extras/src/internalClusterTest/java/org/elasticsearch/index/mapper/MatchOnlyTextFieldMapperTests.java b/modules/mapper-extras/src/internalClusterTest/java/org/elasticsearch/index/mapper/MatchOnlyTextFieldMapperTests.java index 749107ad205b9..e669b0d848dff 100644 --- a/modules/mapper-extras/src/internalClusterTest/java/org/elasticsearch/index/mapper/MatchOnlyTextFieldMapperTests.java +++ b/modules/mapper-extras/src/internalClusterTest/java/org/elasticsearch/index/mapper/MatchOnlyTextFieldMapperTests.java @@ -16,8 +16,8 @@ import org.apache.lucene.index.IndexableField; import org.apache.lucene.index.IndexableFieldType; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.index.mapper.extras.MapperExtrasPlugin; import org.elasticsearch.index.mapper.extras.MatchOnlyTextFieldMapper; import org.elasticsearch.index.query.SearchExecutionContext; diff --git a/modules/mapper-extras/src/internalClusterTest/java/org/elasticsearch/index/mapper/TokenCountFieldMapperIntegrationIT.java b/modules/mapper-extras/src/internalClusterTest/java/org/elasticsearch/index/mapper/TokenCountFieldMapperIntegrationIT.java index 0cd82c0ba6257..b2419fef68313 100644 --- a/modules/mapper-extras/src/internalClusterTest/java/org/elasticsearch/index/mapper/TokenCountFieldMapperIntegrationIT.java +++ b/modules/mapper-extras/src/internalClusterTest/java/org/elasticsearch/index/mapper/TokenCountFieldMapperIntegrationIT.java @@ -31,7 +31,7 @@ import java.util.Collection; import java.util.List; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.containsInAnyOrder; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.not; diff --git a/modules/mapper-extras/src/main/java/org/elasticsearch/index/mapper/extras/RankFeatureFieldMapper.java b/modules/mapper-extras/src/main/java/org/elasticsearch/index/mapper/extras/RankFeatureFieldMapper.java index 0859f3335fedb..9661fbd2e6bf9 100644 --- a/modules/mapper-extras/src/main/java/org/elasticsearch/index/mapper/extras/RankFeatureFieldMapper.java +++ b/modules/mapper-extras/src/main/java/org/elasticsearch/index/mapper/extras/RankFeatureFieldMapper.java @@ -15,7 +15,7 @@ import org.apache.lucene.search.Query; import org.apache.lucene.search.TermQuery; import org.elasticsearch.common.lucene.Lucene; -import org.elasticsearch.common.xcontent.XContentParser.Token; +import org.elasticsearch.xcontent.XContentParser.Token; import org.elasticsearch.index.fielddata.IndexFieldData; import org.elasticsearch.index.mapper.DocumentParserContext; import org.elasticsearch.index.mapper.FieldMapper; diff --git a/modules/mapper-extras/src/main/java/org/elasticsearch/index/mapper/extras/RankFeatureQueryBuilder.java b/modules/mapper-extras/src/main/java/org/elasticsearch/index/mapper/extras/RankFeatureQueryBuilder.java index edd132f0a0433..bfab8a71ec9cf 100644 --- a/modules/mapper-extras/src/main/java/org/elasticsearch/index/mapper/extras/RankFeatureQueryBuilder.java +++ b/modules/mapper-extras/src/main/java/org/elasticsearch/index/mapper/extras/RankFeatureQueryBuilder.java @@ -11,12 +11,12 @@ import org.apache.lucene.document.FeatureField; import org.apache.lucene.search.MatchNoDocsQuery; import org.apache.lucene.search.Query; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.mapper.extras.RankFeatureFieldMapper.RankFeatureFieldType; import org.elasticsearch.index.mapper.extras.RankFeaturesFieldMapper.RankFeaturesFieldType; diff --git a/modules/mapper-extras/src/main/java/org/elasticsearch/index/mapper/extras/RankFeaturesFieldMapper.java b/modules/mapper-extras/src/main/java/org/elasticsearch/index/mapper/extras/RankFeaturesFieldMapper.java index 0282dc2808ed8..050d52faf407f 100644 --- a/modules/mapper-extras/src/main/java/org/elasticsearch/index/mapper/extras/RankFeaturesFieldMapper.java +++ b/modules/mapper-extras/src/main/java/org/elasticsearch/index/mapper/extras/RankFeaturesFieldMapper.java @@ -11,7 +11,7 @@ import org.apache.lucene.document.FeatureField; import org.apache.lucene.search.Query; import org.elasticsearch.common.lucene.Lucene; -import org.elasticsearch.common.xcontent.XContentParser.Token; +import org.elasticsearch.xcontent.XContentParser.Token; import org.elasticsearch.index.fielddata.IndexFieldData; import org.elasticsearch.index.mapper.DocumentParserContext; import org.elasticsearch.index.mapper.FieldMapper; diff --git a/modules/mapper-extras/src/main/java/org/elasticsearch/index/mapper/extras/ScaledFloatFieldMapper.java b/modules/mapper-extras/src/main/java/org/elasticsearch/index/mapper/extras/ScaledFloatFieldMapper.java index cd9b267ec3bf0..ff585b416b72c 100644 --- a/modules/mapper-extras/src/main/java/org/elasticsearch/index/mapper/extras/ScaledFloatFieldMapper.java +++ b/modules/mapper-extras/src/main/java/org/elasticsearch/index/mapper/extras/ScaledFloatFieldMapper.java @@ -18,8 +18,8 @@ import org.elasticsearch.common.Explicit; import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentParser.Token; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser.Token; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.index.fielddata.FieldData; import org.elasticsearch.index.fielddata.FormattedDocValues; diff --git a/modules/mapper-extras/src/test/java/org/elasticsearch/index/mapper/extras/BWCTemplateTests.java b/modules/mapper-extras/src/test/java/org/elasticsearch/index/mapper/extras/BWCTemplateTests.java index 8a9bf17a3a3a4..c3f0be862b1de 100644 --- a/modules/mapper-extras/src/test/java/org/elasticsearch/index/mapper/extras/BWCTemplateTests.java +++ b/modules/mapper-extras/src/test/java/org/elasticsearch/index/mapper/extras/BWCTemplateTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.index.mapper.extras; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.test.ESSingleNodeTestCase; diff --git a/modules/mapper-extras/src/test/java/org/elasticsearch/index/mapper/extras/RankFeatureFieldMapperTests.java b/modules/mapper-extras/src/test/java/org/elasticsearch/index/mapper/extras/RankFeatureFieldMapperTests.java index 88f6d6e2d4348..0f3cfe3186661 100644 --- a/modules/mapper-extras/src/test/java/org/elasticsearch/index/mapper/extras/RankFeatureFieldMapperTests.java +++ b/modules/mapper-extras/src/test/java/org/elasticsearch/index/mapper/extras/RankFeatureFieldMapperTests.java @@ -15,7 +15,7 @@ import org.apache.lucene.search.Query; import org.apache.lucene.search.TermQuery; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.LuceneDocument; import org.elasticsearch.index.mapper.MappedFieldType; diff --git a/modules/mapper-extras/src/test/java/org/elasticsearch/index/mapper/extras/RankFeatureMetaFieldMapperTests.java b/modules/mapper-extras/src/test/java/org/elasticsearch/index/mapper/extras/RankFeatureMetaFieldMapperTests.java index 6ad3e225752c4..507ee58f3b689 100644 --- a/modules/mapper-extras/src/test/java/org/elasticsearch/index/mapper/extras/RankFeatureMetaFieldMapperTests.java +++ b/modules/mapper-extras/src/test/java/org/elasticsearch/index/mapper/extras/RankFeatureMetaFieldMapperTests.java @@ -11,8 +11,8 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.compress.CompressedXContent; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.MapperParsingException; import org.elasticsearch.index.mapper.MapperService; diff --git a/modules/mapper-extras/src/test/java/org/elasticsearch/index/mapper/extras/RankFeaturesFieldMapperTests.java b/modules/mapper-extras/src/test/java/org/elasticsearch/index/mapper/extras/RankFeaturesFieldMapperTests.java index e06548e61e4ef..558c907093901 100644 --- a/modules/mapper-extras/src/test/java/org/elasticsearch/index/mapper/extras/RankFeaturesFieldMapperTests.java +++ b/modules/mapper-extras/src/test/java/org/elasticsearch/index/mapper/extras/RankFeaturesFieldMapperTests.java @@ -11,7 +11,7 @@ import org.apache.lucene.document.FeatureField; import org.apache.lucene.index.IndexableField; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.mapper.MapperParsingException; diff --git a/modules/mapper-extras/src/test/java/org/elasticsearch/index/mapper/extras/ScaledFloatFieldMapperTests.java b/modules/mapper-extras/src/test/java/org/elasticsearch/index/mapper/extras/ScaledFloatFieldMapperTests.java index 7d537af0d33d9..eaca9edee1036 100644 --- a/modules/mapper-extras/src/test/java/org/elasticsearch/index/mapper/extras/ScaledFloatFieldMapperTests.java +++ b/modules/mapper-extras/src/test/java/org/elasticsearch/index/mapper/extras/ScaledFloatFieldMapperTests.java @@ -12,9 +12,9 @@ import org.apache.lucene.index.IndexableField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.mapper.MapperParsingException; diff --git a/modules/mapper-extras/src/test/java/org/elasticsearch/index/mapper/extras/SearchAsYouTypeFieldMapperTests.java b/modules/mapper-extras/src/test/java/org/elasticsearch/index/mapper/extras/SearchAsYouTypeFieldMapperTests.java index a37bc0a14590a..98cfcb980e40d 100644 --- a/modules/mapper-extras/src/test/java/org/elasticsearch/index/mapper/extras/SearchAsYouTypeFieldMapperTests.java +++ b/modules/mapper-extras/src/test/java/org/elasticsearch/index/mapper/extras/SearchAsYouTypeFieldMapperTests.java @@ -30,7 +30,7 @@ import org.apache.lucene.search.SynonymQuery; import org.apache.lucene.search.TermQuery; import org.elasticsearch.common.lucene.search.MultiPhrasePrefixQuery; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.analysis.AnalyzerScope; import org.elasticsearch.index.analysis.IndexAnalyzers; diff --git a/modules/mapper-extras/src/test/java/org/elasticsearch/index/mapper/extras/TokenCountFieldMapperTests.java b/modules/mapper-extras/src/test/java/org/elasticsearch/index/mapper/extras/TokenCountFieldMapperTests.java index c735302eac14c..c88487287971a 100644 --- a/modules/mapper-extras/src/test/java/org/elasticsearch/index/mapper/extras/TokenCountFieldMapperTests.java +++ b/modules/mapper-extras/src/test/java/org/elasticsearch/index/mapper/extras/TokenCountFieldMapperTests.java @@ -15,7 +15,7 @@ import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.core.KeywordAnalyzer; import org.apache.lucene.analysis.standard.StandardAnalyzer; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.analysis.AnalyzerScope; import org.elasticsearch.index.analysis.IndexAnalyzers; diff --git a/modules/parent-join/src/internalClusterTest/java/org/elasticsearch/join/query/ChildQuerySearchIT.java b/modules/parent-join/src/internalClusterTest/java/org/elasticsearch/join/query/ChildQuerySearchIT.java index 78efb9de7725c..2a0ecbd9d1a0c 100644 --- a/modules/parent-join/src/internalClusterTest/java/org/elasticsearch/join/query/ChildQuerySearchIT.java +++ b/modules/parent-join/src/internalClusterTest/java/org/elasticsearch/join/query/ChildQuerySearchIT.java @@ -48,7 +48,7 @@ import java.util.Map; import java.util.Set; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.common.xcontent.support.XContentMapValues.extractValue; import static org.elasticsearch.index.query.QueryBuilders.boolQuery; import static org.elasticsearch.index.query.QueryBuilders.constantScoreQuery; diff --git a/modules/parent-join/src/internalClusterTest/java/org/elasticsearch/join/query/InnerHitsIT.java b/modules/parent-join/src/internalClusterTest/java/org/elasticsearch/join/query/InnerHitsIT.java index 01df207fec5b6..a4cce3ca34782 100644 --- a/modules/parent-join/src/internalClusterTest/java/org/elasticsearch/join/query/InnerHitsIT.java +++ b/modules/parent-join/src/internalClusterTest/java/org/elasticsearch/join/query/InnerHitsIT.java @@ -38,7 +38,7 @@ import java.util.Map; import java.util.function.Function; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.common.xcontent.support.XContentMapValues.extractValue; import static org.elasticsearch.index.query.QueryBuilders.boolQuery; import static org.elasticsearch.index.query.QueryBuilders.constantScoreQuery; diff --git a/modules/parent-join/src/internalClusterTest/java/org/elasticsearch/join/query/ParentChildTestCase.java b/modules/parent-join/src/internalClusterTest/java/org/elasticsearch/join/query/ParentChildTestCase.java index b44b790ae37e8..84b7ec8d96b10 100644 --- a/modules/parent-join/src/internalClusterTest/java/org/elasticsearch/join/query/ParentChildTestCase.java +++ b/modules/parent-join/src/internalClusterTest/java/org/elasticsearch/join/query/ParentChildTestCase.java @@ -10,9 +10,9 @@ import org.elasticsearch.action.index.IndexRequestBuilder; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.IndexModule; import org.elasticsearch.join.ParentJoinPlugin; import org.elasticsearch.plugins.Plugin; diff --git a/modules/parent-join/src/main/java/org/elasticsearch/join/aggregations/ChildrenAggregationBuilder.java b/modules/parent-join/src/main/java/org/elasticsearch/join/aggregations/ChildrenAggregationBuilder.java index 8c717d1114471..b5a7b40dc77e7 100644 --- a/modules/parent-join/src/main/java/org/elasticsearch/join/aggregations/ChildrenAggregationBuilder.java +++ b/modules/parent-join/src/main/java/org/elasticsearch/join/aggregations/ChildrenAggregationBuilder.java @@ -12,8 +12,8 @@ import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.join.mapper.Joiner; import org.elasticsearch.search.aggregations.AggregationBuilder; diff --git a/modules/parent-join/src/main/java/org/elasticsearch/join/aggregations/ChildrenToParentAggregator.java b/modules/parent-join/src/main/java/org/elasticsearch/join/aggregations/ChildrenToParentAggregator.java index 324ad40811409..0731c9366a793 100644 --- a/modules/parent-join/src/main/java/org/elasticsearch/join/aggregations/ChildrenToParentAggregator.java +++ b/modules/parent-join/src/main/java/org/elasticsearch/join/aggregations/ChildrenToParentAggregator.java @@ -8,7 +8,7 @@ package org.elasticsearch.join.aggregations; import org.apache.lucene.search.Query; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.search.aggregations.Aggregator; import org.elasticsearch.search.aggregations.AggregatorFactories; import org.elasticsearch.search.aggregations.CardinalityUpperBound; diff --git a/modules/parent-join/src/main/java/org/elasticsearch/join/aggregations/ParentAggregationBuilder.java b/modules/parent-join/src/main/java/org/elasticsearch/join/aggregations/ParentAggregationBuilder.java index 9d2ae7af042ff..b0e270f4a59cf 100644 --- a/modules/parent-join/src/main/java/org/elasticsearch/join/aggregations/ParentAggregationBuilder.java +++ b/modules/parent-join/src/main/java/org/elasticsearch/join/aggregations/ParentAggregationBuilder.java @@ -12,8 +12,8 @@ import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.join.mapper.Joiner; import org.elasticsearch.search.aggregations.AggregationBuilder; diff --git a/modules/parent-join/src/main/java/org/elasticsearch/join/aggregations/ParentToChildrenAggregator.java b/modules/parent-join/src/main/java/org/elasticsearch/join/aggregations/ParentToChildrenAggregator.java index 51e63f58a9969..92b3679fb47be 100644 --- a/modules/parent-join/src/main/java/org/elasticsearch/join/aggregations/ParentToChildrenAggregator.java +++ b/modules/parent-join/src/main/java/org/elasticsearch/join/aggregations/ParentToChildrenAggregator.java @@ -8,7 +8,7 @@ package org.elasticsearch.join.aggregations; import org.apache.lucene.search.Query; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.search.aggregations.Aggregator; import org.elasticsearch.search.aggregations.AggregatorFactories; import org.elasticsearch.search.aggregations.CardinalityUpperBound; diff --git a/modules/parent-join/src/main/java/org/elasticsearch/join/aggregations/ParsedChildren.java b/modules/parent-join/src/main/java/org/elasticsearch/join/aggregations/ParsedChildren.java index c52cdff5f18f5..9caca8f2fc85e 100644 --- a/modules/parent-join/src/main/java/org/elasticsearch/join/aggregations/ParsedChildren.java +++ b/modules/parent-join/src/main/java/org/elasticsearch/join/aggregations/ParsedChildren.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.join.aggregations; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.aggregations.bucket.ParsedSingleBucketAggregation; import java.io.IOException; diff --git a/modules/parent-join/src/main/java/org/elasticsearch/join/aggregations/ParsedParent.java b/modules/parent-join/src/main/java/org/elasticsearch/join/aggregations/ParsedParent.java index fb33e2b8a0ea0..00725d4d48aa7 100644 --- a/modules/parent-join/src/main/java/org/elasticsearch/join/aggregations/ParsedParent.java +++ b/modules/parent-join/src/main/java/org/elasticsearch/join/aggregations/ParsedParent.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.join.aggregations; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.aggregations.bucket.ParsedSingleBucketAggregation; import java.io.IOException; diff --git a/modules/parent-join/src/main/java/org/elasticsearch/join/mapper/ParentJoinFieldMapper.java b/modules/parent-join/src/main/java/org/elasticsearch/join/mapper/ParentJoinFieldMapper.java index 5b05c84305290..43b9c444d5797 100644 --- a/modules/parent-join/src/main/java/org/elasticsearch/join/mapper/ParentJoinFieldMapper.java +++ b/modules/parent-join/src/main/java/org/elasticsearch/join/mapper/ParentJoinFieldMapper.java @@ -14,8 +14,8 @@ import org.apache.lucene.index.IndexOptions; import org.apache.lucene.util.BytesRef; import org.elasticsearch.common.lucene.Lucene; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.fielddata.IndexFieldData; import org.elasticsearch.index.fielddata.plain.SortedSetOrdinalsIndexFieldData; diff --git a/modules/parent-join/src/main/java/org/elasticsearch/join/query/HasChildQueryBuilder.java b/modules/parent-join/src/main/java/org/elasticsearch/join/query/HasChildQueryBuilder.java index de870462ea135..16513eb3b8767 100644 --- a/modules/parent-join/src/main/java/org/elasticsearch/join/query/HasChildQueryBuilder.java +++ b/modules/parent-join/src/main/java/org/elasticsearch/join/query/HasChildQueryBuilder.java @@ -18,13 +18,13 @@ import org.apache.lucene.search.join.ScoreMode; import org.apache.lucene.search.similarities.Similarity; import org.elasticsearch.ElasticsearchException; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.lucene.search.Queries; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.fielddata.IndexOrdinalsFieldData; import org.elasticsearch.index.fielddata.plain.SortedSetOrdinalsIndexFieldData; import org.elasticsearch.index.mapper.MappedFieldType; diff --git a/modules/parent-join/src/main/java/org/elasticsearch/join/query/HasParentQueryBuilder.java b/modules/parent-join/src/main/java/org/elasticsearch/join/query/HasParentQueryBuilder.java index 298e3c5785b93..6750ef7444d64 100644 --- a/modules/parent-join/src/main/java/org/elasticsearch/join/query/HasParentQueryBuilder.java +++ b/modules/parent-join/src/main/java/org/elasticsearch/join/query/HasParentQueryBuilder.java @@ -11,13 +11,13 @@ import org.apache.lucene.search.Query; import org.apache.lucene.search.join.ScoreMode; import org.elasticsearch.ElasticsearchException; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.lucene.search.Queries; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.fielddata.plain.SortedSetOrdinalsIndexFieldData; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.query.AbstractQueryBuilder; diff --git a/modules/parent-join/src/main/java/org/elasticsearch/join/query/ParentIdQueryBuilder.java b/modules/parent-join/src/main/java/org/elasticsearch/join/query/ParentIdQueryBuilder.java index bf3ca2e8e9578..1ba4d64f9124c 100644 --- a/modules/parent-join/src/main/java/org/elasticsearch/join/query/ParentIdQueryBuilder.java +++ b/modules/parent-join/src/main/java/org/elasticsearch/join/query/ParentIdQueryBuilder.java @@ -15,12 +15,12 @@ import org.apache.lucene.search.Query; import org.apache.lucene.search.TermQuery; import org.elasticsearch.ElasticsearchException; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.query.AbstractQueryBuilder; import org.elasticsearch.index.query.SearchExecutionContext; import org.elasticsearch.index.query.QueryShardException; diff --git a/modules/parent-join/src/main/java/org/elasticsearch/join/spi/ParentJoinNamedXContentProvider.java b/modules/parent-join/src/main/java/org/elasticsearch/join/spi/ParentJoinNamedXContentProvider.java index 5ca485bc0ceb0..1a9633f4c69c0 100644 --- a/modules/parent-join/src/main/java/org/elasticsearch/join/spi/ParentJoinNamedXContentProvider.java +++ b/modules/parent-join/src/main/java/org/elasticsearch/join/spi/ParentJoinNamedXContentProvider.java @@ -8,9 +8,9 @@ package org.elasticsearch.join.spi; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ContextParser; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ContextParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.join.aggregations.ChildrenAggregationBuilder; import org.elasticsearch.join.aggregations.ParentAggregationBuilder; import org.elasticsearch.join.aggregations.ParsedChildren; diff --git a/modules/parent-join/src/test/java/org/elasticsearch/join/aggregations/InternalChildrenTests.java b/modules/parent-join/src/test/java/org/elasticsearch/join/aggregations/InternalChildrenTests.java index fe0dffa2e456e..8f24c5593292f 100644 --- a/modules/parent-join/src/test/java/org/elasticsearch/join/aggregations/InternalChildrenTests.java +++ b/modules/parent-join/src/test/java/org/elasticsearch/join/aggregations/InternalChildrenTests.java @@ -8,9 +8,9 @@ package org.elasticsearch.join.aggregations; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.util.CollectionUtils; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.join.ParentJoinPlugin; import org.elasticsearch.plugins.SearchPlugin; import org.elasticsearch.search.aggregations.Aggregation; diff --git a/modules/parent-join/src/test/java/org/elasticsearch/join/aggregations/InternalParentTests.java b/modules/parent-join/src/test/java/org/elasticsearch/join/aggregations/InternalParentTests.java index f34989ce30086..77a1721cf2eca 100644 --- a/modules/parent-join/src/test/java/org/elasticsearch/join/aggregations/InternalParentTests.java +++ b/modules/parent-join/src/test/java/org/elasticsearch/join/aggregations/InternalParentTests.java @@ -8,9 +8,9 @@ package org.elasticsearch.join.aggregations; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.util.CollectionUtils; -import org.elasticsearch.common.xcontent.NamedXContentRegistry.Entry; +import org.elasticsearch.xcontent.NamedXContentRegistry.Entry; import org.elasticsearch.join.ParentJoinPlugin; import org.elasticsearch.plugins.SearchPlugin; import org.elasticsearch.search.aggregations.Aggregation; diff --git a/modules/parent-join/src/test/java/org/elasticsearch/join/mapper/ParentJoinFieldMapperTests.java b/modules/parent-join/src/test/java/org/elasticsearch/join/mapper/ParentJoinFieldMapperTests.java index f6a4938082ff8..e263c83f3d5d4 100644 --- a/modules/parent-join/src/test/java/org/elasticsearch/join/mapper/ParentJoinFieldMapperTests.java +++ b/modules/parent-join/src/test/java/org/elasticsearch/join/mapper/ParentJoinFieldMapperTests.java @@ -11,8 +11,8 @@ import org.apache.lucene.index.Term; import org.apache.lucene.search.TermQuery; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.FieldMapper; import org.elasticsearch.index.mapper.Mapper; diff --git a/modules/parent-join/src/test/java/org/elasticsearch/join/query/HasChildQueryBuilderTests.java b/modules/parent-join/src/test/java/org/elasticsearch/join/query/HasChildQueryBuilderTests.java index 68c4a6cd02c85..a1d70ae4196ff 100644 --- a/modules/parent-join/src/test/java/org/elasticsearch/join/query/HasChildQueryBuilderTests.java +++ b/modules/parent-join/src/test/java/org/elasticsearch/join/query/HasChildQueryBuilderTests.java @@ -25,7 +25,7 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.compress.CompressedXContent; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.mapper.IdFieldMapper; import org.elasticsearch.index.mapper.MapperService; import org.elasticsearch.index.mapper.Uid; @@ -54,7 +54,7 @@ import java.util.HashMap; import java.util.Map; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.join.query.HasChildQueryBuilder.LateParsingQuery; import static org.elasticsearch.join.query.JoinQueryBuilders.hasChildQuery; import static org.hamcrest.CoreMatchers.containsString; diff --git a/modules/parent-join/src/test/java/org/elasticsearch/join/query/HasParentQueryBuilderTests.java b/modules/parent-join/src/test/java/org/elasticsearch/join/query/HasParentQueryBuilderTests.java index 761494781d1fd..6d1478f2bf93c 100644 --- a/modules/parent-join/src/test/java/org/elasticsearch/join/query/HasParentQueryBuilderTests.java +++ b/modules/parent-join/src/test/java/org/elasticsearch/join/query/HasParentQueryBuilderTests.java @@ -15,7 +15,7 @@ import org.elasticsearch.Version; import org.elasticsearch.common.Strings; import org.elasticsearch.common.compress.CompressedXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.mapper.MapperService; import org.elasticsearch.index.query.IdsQueryBuilder; import org.elasticsearch.index.query.InnerHitBuilder; @@ -42,7 +42,7 @@ import java.util.HashMap; import java.util.Map; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.join.query.JoinQueryBuilders.hasParentQuery; import static org.hamcrest.CoreMatchers.containsString; import static org.hamcrest.CoreMatchers.equalTo; diff --git a/modules/parent-join/src/test/java/org/elasticsearch/join/query/ParentIdQueryBuilderTests.java b/modules/parent-join/src/test/java/org/elasticsearch/join/query/ParentIdQueryBuilderTests.java index 1d46d2eb9f722..7ed888f8300e2 100644 --- a/modules/parent-join/src/test/java/org/elasticsearch/join/query/ParentIdQueryBuilderTests.java +++ b/modules/parent-join/src/test/java/org/elasticsearch/join/query/ParentIdQueryBuilderTests.java @@ -17,7 +17,7 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.compress.CompressedXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.mapper.MapperService; import org.elasticsearch.index.query.SearchExecutionContext; import org.elasticsearch.index.query.QueryShardException; @@ -31,7 +31,7 @@ import java.util.Arrays; import java.util.Collection; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.CoreMatchers.containsString; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.instanceOf; diff --git a/modules/percolator/src/internalClusterTest/java/org/elasticsearch/percolator/PercolatorQuerySearchIT.java b/modules/percolator/src/internalClusterTest/java/org/elasticsearch/percolator/PercolatorQuerySearchIT.java index 57f1b397b313d..c2150b7e96c75 100644 --- a/modules/percolator/src/internalClusterTest/java/org/elasticsearch/percolator/PercolatorQuerySearchIT.java +++ b/modules/percolator/src/internalClusterTest/java/org/elasticsearch/percolator/PercolatorQuerySearchIT.java @@ -17,9 +17,9 @@ import org.elasticsearch.common.geo.GeoPoint; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.DistanceUnit; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.mapper.MapperParsingException; import org.elasticsearch.index.query.MatchPhraseQueryBuilder; import org.elasticsearch.index.query.MultiMatchQueryBuilder; @@ -36,8 +36,8 @@ import java.util.Collection; import java.util.Collections; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; -import static org.elasticsearch.common.xcontent.XContentFactory.yamlBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.yamlBuilder; import static org.elasticsearch.index.query.QueryBuilders.boolQuery; import static org.elasticsearch.index.query.QueryBuilders.constantScoreQuery; import static org.elasticsearch.index.query.QueryBuilders.geoBoundingBoxQuery; diff --git a/modules/percolator/src/main/java/org/elasticsearch/percolator/PercolateQueryBuilder.java b/modules/percolator/src/main/java/org/elasticsearch/percolator/PercolateQueryBuilder.java index c4110b40cbbeb..a0c5d346941ab 100644 --- a/modules/percolator/src/main/java/org/elasticsearch/percolator/PercolateQueryBuilder.java +++ b/modules/percolator/src/main/java/org/elasticsearch/percolator/PercolateQueryBuilder.java @@ -43,15 +43,15 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.logging.DeprecationLogger; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.index.fielddata.IndexFieldData; import org.elasticsearch.index.fielddata.IndexFieldDataCache; @@ -80,8 +80,8 @@ import java.util.function.BiConsumer; import java.util.function.Supplier; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; import static org.elasticsearch.core.RestApiVersion.equalTo; import static org.elasticsearch.search.SearchService.ALLOW_EXPENSIVE_QUERIES; diff --git a/modules/percolator/src/main/java/org/elasticsearch/percolator/PercolatorFieldMapper.java b/modules/percolator/src/main/java/org/elasticsearch/percolator/PercolatorFieldMapper.java index 1ccbcc4841873..ecf9844627f34 100644 --- a/modules/percolator/src/main/java/org/elasticsearch/percolator/PercolatorFieldMapper.java +++ b/modules/percolator/src/main/java/org/elasticsearch/percolator/PercolatorFieldMapper.java @@ -38,8 +38,8 @@ import org.elasticsearch.common.lucene.search.Queries; import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentLocation; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentLocation; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.Tuple; import org.elasticsearch.index.mapper.BinaryFieldMapper; import org.elasticsearch.index.mapper.DocumentParserContext; diff --git a/modules/percolator/src/test/java/org/elasticsearch/percolator/CandidateQueryTests.java b/modules/percolator/src/test/java/org/elasticsearch/percolator/CandidateQueryTests.java index aa84a9a46caba..5dea97db0cdb6 100644 --- a/modules/percolator/src/test/java/org/elasticsearch/percolator/CandidateQueryTests.java +++ b/modules/percolator/src/test/java/org/elasticsearch/percolator/CandidateQueryTests.java @@ -74,7 +74,7 @@ import org.elasticsearch.common.geo.ShapeRelation; import org.elasticsearch.common.lucene.search.function.FunctionScoreQuery; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.core.CheckedFunction; import org.elasticsearch.index.IndexService; import org.elasticsearch.index.mapper.DocumentParserContext; diff --git a/modules/percolator/src/test/java/org/elasticsearch/percolator/PercolateQueryBuilderTests.java b/modules/percolator/src/test/java/org/elasticsearch/percolator/PercolateQueryBuilderTests.java index 22cdb91966264..b61222ab3ded0 100644 --- a/modules/percolator/src/test/java/org/elasticsearch/percolator/PercolateQueryBuilderTests.java +++ b/modules/percolator/src/test/java/org/elasticsearch/percolator/PercolateQueryBuilderTests.java @@ -20,11 +20,11 @@ import org.elasticsearch.common.compress.CompressedXContent; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.lucene.uid.Versions; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.index.get.GetResult; import org.elasticsearch.index.mapper.MapperService; diff --git a/modules/percolator/src/test/java/org/elasticsearch/percolator/PercolateWithNestedQueryBuilderTests.java b/modules/percolator/src/test/java/org/elasticsearch/percolator/PercolateWithNestedQueryBuilderTests.java index 67eb9e679f6ed..53a6830d7e24a 100644 --- a/modules/percolator/src/test/java/org/elasticsearch/percolator/PercolateWithNestedQueryBuilderTests.java +++ b/modules/percolator/src/test/java/org/elasticsearch/percolator/PercolateWithNestedQueryBuilderTests.java @@ -12,7 +12,7 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.compress.CompressedXContent; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.mapper.MapperService; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.SearchExecutionContext; diff --git a/modules/percolator/src/test/java/org/elasticsearch/percolator/PercolatorFieldMapperTests.java b/modules/percolator/src/test/java/org/elasticsearch/percolator/PercolatorFieldMapperTests.java index 46a393bdda676..f4691193cd3a1 100644 --- a/modules/percolator/src/test/java/org/elasticsearch/percolator/PercolatorFieldMapperTests.java +++ b/modules/percolator/src/test/java/org/elasticsearch/percolator/PercolatorFieldMapperTests.java @@ -42,9 +42,9 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.network.InetAddresses; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.Tuple; import org.elasticsearch.index.IndexService; import org.elasticsearch.index.mapper.DocumentMapper; @@ -95,7 +95,7 @@ import java.util.stream.Collectors; import static java.util.Collections.emptyMap; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.boolQuery; import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery; import static org.elasticsearch.index.query.QueryBuilders.matchPhraseQuery; diff --git a/modules/percolator/src/test/java/org/elasticsearch/percolator/PercolatorQuerySearchTests.java b/modules/percolator/src/test/java/org/elasticsearch/percolator/PercolatorQuerySearchTests.java index 6f83e1794988f..4225c7cd59ea6 100644 --- a/modules/percolator/src/test/java/org/elasticsearch/percolator/PercolatorQuerySearchTests.java +++ b/modules/percolator/src/test/java/org/elasticsearch/percolator/PercolatorQuerySearchTests.java @@ -13,9 +13,9 @@ import org.elasticsearch.action.support.WriteRequest; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.IndexService; import org.elasticsearch.index.cache.bitset.BitsetFilterCache; import org.elasticsearch.index.engine.Engine; @@ -41,7 +41,7 @@ import java.util.function.Function; import static java.util.Collections.emptyMap; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.boolQuery; import static org.elasticsearch.index.query.QueryBuilders.matchQuery; import static org.elasticsearch.index.query.QueryBuilders.rangeQuery; diff --git a/modules/percolator/src/test/java/org/elasticsearch/percolator/QueryBuilderStoreTests.java b/modules/percolator/src/test/java/org/elasticsearch/percolator/QueryBuilderStoreTests.java index 2e25dc653628a..33cfb45df091b 100644 --- a/modules/percolator/src/test/java/org/elasticsearch/percolator/QueryBuilderStoreTests.java +++ b/modules/percolator/src/test/java/org/elasticsearch/percolator/QueryBuilderStoreTests.java @@ -20,7 +20,7 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.core.CheckedFunction; import org.elasticsearch.index.fielddata.plain.BytesBinaryIndexFieldData; import org.elasticsearch.index.mapper.BinaryFieldMapper; diff --git a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/DiscountedCumulativeGain.java b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/DiscountedCumulativeGain.java index dbbc0026cb6e4..cb472fd67e537 100644 --- a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/DiscountedCumulativeGain.java +++ b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/DiscountedCumulativeGain.java @@ -8,12 +8,12 @@ package org.elasticsearch.index.rankeval; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.SearchHit; import java.io.IOException; @@ -25,8 +25,8 @@ import java.util.OptionalInt; import java.util.stream.Collectors; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; import static org.elasticsearch.index.rankeval.EvaluationMetric.joinHitsWithRatings; /** diff --git a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/EvalQueryQuality.java b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/EvalQueryQuality.java index dcd49b9cb6fc0..c794667a36be2 100644 --- a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/EvalQueryQuality.java +++ b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/EvalQueryQuality.java @@ -8,14 +8,14 @@ package org.elasticsearch.index.rankeval; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParserUtils; import org.elasticsearch.index.rankeval.RatedDocument.DocumentKey; diff --git a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/EvaluationMetric.java b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/EvaluationMetric.java index d4b7cbc25b8b9..2c3d63dd84934 100644 --- a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/EvaluationMetric.java +++ b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/EvaluationMetric.java @@ -9,7 +9,7 @@ package org.elasticsearch.index.rankeval; import org.elasticsearch.common.io.stream.NamedWriteable; -import org.elasticsearch.common.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.ToXContentObject; import org.elasticsearch.index.rankeval.RatedDocument.DocumentKey; import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.SearchHits; diff --git a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/ExpectedReciprocalRank.java b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/ExpectedReciprocalRank.java index 341c68aecbcb3..5fd60be10d7e5 100644 --- a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/ExpectedReciprocalRank.java +++ b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/ExpectedReciprocalRank.java @@ -9,12 +9,12 @@ package org.elasticsearch.index.rankeval; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.SearchHit; import java.io.IOException; @@ -23,8 +23,8 @@ import java.util.Objects; import java.util.OptionalInt; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; import static org.elasticsearch.index.rankeval.EvaluationMetric.joinHitsWithRatings; /** diff --git a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/MeanReciprocalRank.java b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/MeanReciprocalRank.java index fb6a5a4190820..94f6ad4e87b35 100644 --- a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/MeanReciprocalRank.java +++ b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/MeanReciprocalRank.java @@ -8,12 +8,12 @@ package org.elasticsearch.index.rankeval; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.SearchHit; import java.io.IOException; @@ -21,8 +21,8 @@ import java.util.Objects; import java.util.OptionalInt; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; import static org.elasticsearch.index.rankeval.EvaluationMetric.joinHitsWithRatings; /** diff --git a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/MetricDetail.java b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/MetricDetail.java index 0e6e67eb3c145..3c0d9b527fa4d 100644 --- a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/MetricDetail.java +++ b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/MetricDetail.java @@ -9,8 +9,8 @@ package org.elasticsearch.index.rankeval; import org.elasticsearch.common.io.stream.NamedWriteable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; diff --git a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/PrecisionAtK.java b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/PrecisionAtK.java index d1792a9ae16bd..54cfcaa9fdc40 100644 --- a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/PrecisionAtK.java +++ b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/PrecisionAtK.java @@ -8,12 +8,12 @@ package org.elasticsearch.index.rankeval; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.SearchHit; import javax.naming.directory.SearchResult; @@ -22,8 +22,8 @@ import java.util.Objects; import java.util.OptionalInt; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; import static org.elasticsearch.index.rankeval.EvaluationMetric.joinHitsWithRatings; /** diff --git a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RankEvalNamedXContentProvider.java b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RankEvalNamedXContentProvider.java index 8416be9ab2e39..ab86b606d2a2e 100644 --- a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RankEvalNamedXContentProvider.java +++ b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RankEvalNamedXContentProvider.java @@ -8,8 +8,8 @@ package org.elasticsearch.index.rankeval; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.plugins.spi.NamedXContentProvider; import java.util.ArrayList; diff --git a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RankEvalPlugin.java b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RankEvalPlugin.java index 80edaec3ce1e9..d22702321baac 100644 --- a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RankEvalPlugin.java +++ b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RankEvalPlugin.java @@ -17,7 +17,7 @@ import org.elasticsearch.common.settings.IndexScopedSettings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.SettingsFilter; -import org.elasticsearch.common.xcontent.NamedXContentRegistry.Entry; +import org.elasticsearch.xcontent.NamedXContentRegistry.Entry; import org.elasticsearch.plugins.ActionPlugin; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.rest.RestController; diff --git a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RankEvalResponse.java b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RankEvalResponse.java index 39500ac5d8213..69921fdc8f7ab 100644 --- a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RankEvalResponse.java +++ b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RankEvalResponse.java @@ -10,15 +10,15 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.action.ActionResponse; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.core.Tuple; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParserUtils; import java.io.IOException; diff --git a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RankEvalSpec.java b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RankEvalSpec.java index 83f8305235f0d..3d38d7a3d0e29 100644 --- a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RankEvalSpec.java +++ b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RankEvalSpec.java @@ -8,16 +8,16 @@ package org.elasticsearch.index.rankeval; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParserUtils; import org.elasticsearch.script.Script; diff --git a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RatedDocument.java b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RatedDocument.java index ac1f12ac40314..d7d0ad0b93991 100644 --- a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RatedDocument.java +++ b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RatedDocument.java @@ -8,15 +8,15 @@ package org.elasticsearch.index.rankeval; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RatedRequest.java b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RatedRequest.java index 712af87bebab2..21bf7d3845481 100644 --- a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RatedRequest.java +++ b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RatedRequest.java @@ -9,15 +9,15 @@ package org.elasticsearch.index.rankeval; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.rankeval.RatedDocument.DocumentKey; import org.elasticsearch.search.builder.SearchSourceBuilder; diff --git a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RatedSearchHit.java b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RatedSearchHit.java index 44d7249eff084..571e7e8ddf9af 100644 --- a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RatedSearchHit.java +++ b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RatedSearchHit.java @@ -8,16 +8,16 @@ package org.elasticsearch.index.rankeval; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.SearchHit; import java.io.IOException; diff --git a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RecallAtK.java b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RecallAtK.java index ef906d633525f..64ec8dfa27b50 100644 --- a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RecallAtK.java +++ b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RecallAtK.java @@ -8,12 +8,12 @@ package org.elasticsearch.index.rankeval; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.SearchHit; import java.io.IOException; @@ -23,8 +23,8 @@ import javax.naming.directory.SearchResult; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; import static org.elasticsearch.index.rankeval.EvaluationMetric.joinHitsWithRatings; /** diff --git a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RestRankEvalAction.java b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RestRankEvalAction.java index b52f33d3a5cad..51f5c40bceaa1 100644 --- a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RestRankEvalAction.java +++ b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RestRankEvalAction.java @@ -12,7 +12,7 @@ import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestToXContentListener; diff --git a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/TransportRankEvalAction.java b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/TransportRankEvalAction.java index b0699a6bc2549..87b08196d058d 100644 --- a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/TransportRankEvalAction.java +++ b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/TransportRankEvalAction.java @@ -19,9 +19,9 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.script.Script; import org.elasticsearch.script.ScriptService; import org.elasticsearch.script.TemplateScript; diff --git a/modules/rank-eval/src/test/java/org/elasticsearch/index/rankeval/DiscountedCumulativeGainTests.java b/modules/rank-eval/src/test/java/org/elasticsearch/index/rankeval/DiscountedCumulativeGainTests.java index e6998a8e3e788..73d69ea47a3b7 100644 --- a/modules/rank-eval/src/test/java/org/elasticsearch/index/rankeval/DiscountedCumulativeGainTests.java +++ b/modules/rank-eval/src/test/java/org/elasticsearch/index/rankeval/DiscountedCumulativeGainTests.java @@ -12,13 +12,13 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.SearchShardTarget; diff --git a/modules/rank-eval/src/test/java/org/elasticsearch/index/rankeval/EvalQueryQualityTests.java b/modules/rank-eval/src/test/java/org/elasticsearch/index/rankeval/EvalQueryQualityTests.java index df130d83a6ae7..d0d27822c9332 100644 --- a/modules/rank-eval/src/test/java/org/elasticsearch/index/rankeval/EvalQueryQualityTests.java +++ b/modules/rank-eval/src/test/java/org/elasticsearch/index/rankeval/EvalQueryQualityTests.java @@ -11,10 +11,10 @@ import org.elasticsearch.action.OriginalIndices; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.search.SearchShardTarget; import org.elasticsearch.test.ESTestCase; diff --git a/modules/rank-eval/src/test/java/org/elasticsearch/index/rankeval/ExpectedReciprocalRankTests.java b/modules/rank-eval/src/test/java/org/elasticsearch/index/rankeval/ExpectedReciprocalRankTests.java index 27f25931f0772..cc43c9ae2f9d6 100644 --- a/modules/rank-eval/src/test/java/org/elasticsearch/index/rankeval/ExpectedReciprocalRankTests.java +++ b/modules/rank-eval/src/test/java/org/elasticsearch/index/rankeval/ExpectedReciprocalRankTests.java @@ -11,13 +11,13 @@ import org.elasticsearch.action.OriginalIndices; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.SearchShardTarget; diff --git a/modules/rank-eval/src/test/java/org/elasticsearch/index/rankeval/MeanReciprocalRankTests.java b/modules/rank-eval/src/test/java/org/elasticsearch/index/rankeval/MeanReciprocalRankTests.java index 0e24830459ea8..8bb61ccaa62d6 100644 --- a/modules/rank-eval/src/test/java/org/elasticsearch/index/rankeval/MeanReciprocalRankTests.java +++ b/modules/rank-eval/src/test/java/org/elasticsearch/index/rankeval/MeanReciprocalRankTests.java @@ -11,13 +11,13 @@ import org.elasticsearch.action.OriginalIndices; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.SearchShardTarget; diff --git a/modules/rank-eval/src/test/java/org/elasticsearch/index/rankeval/PrecisionAtKTests.java b/modules/rank-eval/src/test/java/org/elasticsearch/index/rankeval/PrecisionAtKTests.java index b5ffc74c1051a..91010256808dd 100644 --- a/modules/rank-eval/src/test/java/org/elasticsearch/index/rankeval/PrecisionAtKTests.java +++ b/modules/rank-eval/src/test/java/org/elasticsearch/index/rankeval/PrecisionAtKTests.java @@ -11,13 +11,13 @@ import org.elasticsearch.action.OriginalIndices; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.SearchShardTarget; diff --git a/modules/rank-eval/src/test/java/org/elasticsearch/index/rankeval/RankEvalRequestTests.java b/modules/rank-eval/src/test/java/org/elasticsearch/index/rankeval/RankEvalRequestTests.java index ca0d75c69891f..c2c6ebf685f2f 100644 --- a/modules/rank-eval/src/test/java/org/elasticsearch/index/rankeval/RankEvalRequestTests.java +++ b/modules/rank-eval/src/test/java/org/elasticsearch/index/rankeval/RankEvalRequestTests.java @@ -13,7 +13,7 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable.Reader; import org.elasticsearch.common.util.ArrayUtils; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.test.AbstractWireSerializingTestCase; import org.junit.AfterClass; diff --git a/modules/rank-eval/src/test/java/org/elasticsearch/index/rankeval/RankEvalResponseTests.java b/modules/rank-eval/src/test/java/org/elasticsearch/index/rankeval/RankEvalResponseTests.java index ded5a321e9a51..4b3e1190fd50e 100644 --- a/modules/rank-eval/src/test/java/org/elasticsearch/index/rankeval/RankEvalResponseTests.java +++ b/modules/rank-eval/src/test/java/org/elasticsearch/index/rankeval/RankEvalResponseTests.java @@ -20,12 +20,12 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentLocation; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentLocation; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.SearchParseException; diff --git a/modules/rank-eval/src/test/java/org/elasticsearch/index/rankeval/RankEvalSpecTests.java b/modules/rank-eval/src/test/java/org/elasticsearch/index/rankeval/RankEvalSpecTests.java index 3fbc0ddd72f91..c1cc545618627 100644 --- a/modules/rank-eval/src/test/java/org/elasticsearch/index/rankeval/RankEvalSpecTests.java +++ b/modules/rank-eval/src/test/java/org/elasticsearch/index/rankeval/RankEvalSpecTests.java @@ -11,13 +11,13 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.query.MatchAllQueryBuilder; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.rankeval.RankEvalSpec.ScriptWithId; diff --git a/modules/rank-eval/src/test/java/org/elasticsearch/index/rankeval/RatedDocumentTests.java b/modules/rank-eval/src/test/java/org/elasticsearch/index/rankeval/RatedDocumentTests.java index 6a44e355adbd4..47d1c79988377 100644 --- a/modules/rank-eval/src/test/java/org/elasticsearch/index/rankeval/RatedDocumentTests.java +++ b/modules/rank-eval/src/test/java/org/elasticsearch/index/rankeval/RatedDocumentTests.java @@ -10,12 +10,12 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/modules/rank-eval/src/test/java/org/elasticsearch/index/rankeval/RatedRequestsTests.java b/modules/rank-eval/src/test/java/org/elasticsearch/index/rankeval/RatedRequestsTests.java index e0be2deebc628..95c762a8b0724 100644 --- a/modules/rank-eval/src/test/java/org/elasticsearch/index/rankeval/RatedRequestsTests.java +++ b/modules/rank-eval/src/test/java/org/elasticsearch/index/rankeval/RatedRequestsTests.java @@ -11,14 +11,14 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.query.MatchAllQueryBuilder; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.search.SearchModule; diff --git a/modules/rank-eval/src/test/java/org/elasticsearch/index/rankeval/RatedSearchHitTests.java b/modules/rank-eval/src/test/java/org/elasticsearch/index/rankeval/RatedSearchHitTests.java index 26a6b8020ff9a..21efb0ce79b45 100644 --- a/modules/rank-eval/src/test/java/org/elasticsearch/index/rankeval/RatedSearchHitTests.java +++ b/modules/rank-eval/src/test/java/org/elasticsearch/index/rankeval/RatedSearchHitTests.java @@ -10,9 +10,9 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.search.SearchHit; import org.elasticsearch.test.ESTestCase; diff --git a/modules/rank-eval/src/test/java/org/elasticsearch/index/rankeval/RecallAtKTests.java b/modules/rank-eval/src/test/java/org/elasticsearch/index/rankeval/RecallAtKTests.java index b17760f10879c..ec391438cd630 100644 --- a/modules/rank-eval/src/test/java/org/elasticsearch/index/rankeval/RecallAtKTests.java +++ b/modules/rank-eval/src/test/java/org/elasticsearch/index/rankeval/RecallAtKTests.java @@ -11,13 +11,13 @@ import org.elasticsearch.action.OriginalIndices; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.SearchShardTarget; diff --git a/modules/rank-eval/src/test/java/org/elasticsearch/index/rankeval/TransportRankEvalActionTests.java b/modules/rank-eval/src/test/java/org/elasticsearch/index/rankeval/TransportRankEvalActionTests.java index 9a26fadb04ed6..1f99392a054cc 100644 --- a/modules/rank-eval/src/test/java/org/elasticsearch/index/rankeval/TransportRankEvalActionTests.java +++ b/modules/rank-eval/src/test/java/org/elasticsearch/index/rankeval/TransportRankEvalActionTests.java @@ -16,7 +16,7 @@ import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.env.Environment; import org.elasticsearch.script.ScriptService; import org.elasticsearch.search.builder.SearchSourceBuilder; diff --git a/modules/reindex/src/internalClusterTest/java/org/elasticsearch/index/reindex/BulkByScrollUsesAllScrollDocumentsAfterConflictsIntegTests.java b/modules/reindex/src/internalClusterTest/java/org/elasticsearch/index/reindex/BulkByScrollUsesAllScrollDocumentsAfterConflictsIntegTests.java index 278eb7f507039..2a8f0a6a9e12d 100644 --- a/modules/reindex/src/internalClusterTest/java/org/elasticsearch/index/reindex/BulkByScrollUsesAllScrollDocumentsAfterConflictsIntegTests.java +++ b/modules/reindex/src/internalClusterTest/java/org/elasticsearch/index/reindex/BulkByScrollUsesAllScrollDocumentsAfterConflictsIntegTests.java @@ -22,9 +22,9 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.CollectionUtils; import org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.VersionType; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.plugins.Plugin; @@ -52,7 +52,7 @@ import java.util.function.Function; import static org.elasticsearch.common.lucene.uid.Versions.MATCH_DELETED; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.mapper.MapperService.SINGLE_MAPPING_NAME; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.hamcrest.Matchers.equalTo; diff --git a/modules/reindex/src/main/java/org/elasticsearch/reindex/AbstractBaseReindexRestHandler.java b/modules/reindex/src/main/java/org/elasticsearch/reindex/AbstractBaseReindexRestHandler.java index df8c18c4d42f9..7804ca8abcf69 100644 --- a/modules/reindex/src/main/java/org/elasticsearch/reindex/AbstractBaseReindexRestHandler.java +++ b/modules/reindex/src/main/java/org/elasticsearch/reindex/AbstractBaseReindexRestHandler.java @@ -13,7 +13,7 @@ import org.elasticsearch.action.support.ActiveShardCount; import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.reindex.AbstractBulkByScrollRequest; import org.elasticsearch.index.reindex.BulkByScrollResponse; import org.elasticsearch.index.reindex.BulkByScrollTask; diff --git a/modules/reindex/src/main/java/org/elasticsearch/reindex/AbstractBulkByQueryRestHandler.java b/modules/reindex/src/main/java/org/elasticsearch/reindex/AbstractBulkByQueryRestHandler.java index bb2275e452fa3..f40d78a4dfb89 100644 --- a/modules/reindex/src/main/java/org/elasticsearch/reindex/AbstractBulkByQueryRestHandler.java +++ b/modules/reindex/src/main/java/org/elasticsearch/reindex/AbstractBulkByQueryRestHandler.java @@ -14,9 +14,9 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.reindex.AbstractBulkByScrollRequest; import org.elasticsearch.index.reindex.BulkByScrollResponse; import org.elasticsearch.rest.RestRequest; diff --git a/modules/reindex/src/main/java/org/elasticsearch/reindex/BulkIndexByScrollResponseContentListener.java b/modules/reindex/src/main/java/org/elasticsearch/reindex/BulkIndexByScrollResponseContentListener.java index bab0d5fafbf5a..363840cc50976 100644 --- a/modules/reindex/src/main/java/org/elasticsearch/reindex/BulkIndexByScrollResponseContentListener.java +++ b/modules/reindex/src/main/java/org/elasticsearch/reindex/BulkIndexByScrollResponseContentListener.java @@ -9,8 +9,8 @@ package org.elasticsearch.reindex; import org.elasticsearch.action.bulk.BulkItemResponse.Failure; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.reindex.BulkByScrollResponse; import org.elasticsearch.index.reindex.ScrollableHitSource.SearchFailure; import org.elasticsearch.rest.BytesRestResponse; diff --git a/modules/reindex/src/main/java/org/elasticsearch/reindex/ReindexPlugin.java b/modules/reindex/src/main/java/org/elasticsearch/reindex/ReindexPlugin.java index 7d0a87f55ea13..1228f36b805f4 100644 --- a/modules/reindex/src/main/java/org/elasticsearch/reindex/ReindexPlugin.java +++ b/modules/reindex/src/main/java/org/elasticsearch/reindex/ReindexPlugin.java @@ -20,7 +20,7 @@ import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.SettingsFilter; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.env.Environment; import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.index.reindex.BulkByScrollTask; diff --git a/modules/reindex/src/main/java/org/elasticsearch/reindex/Reindexer.java b/modules/reindex/src/main/java/org/elasticsearch/reindex/Reindexer.java index 2836172e66163..10e9373853604 100644 --- a/modules/reindex/src/main/java/org/elasticsearch/reindex/Reindexer.java +++ b/modules/reindex/src/main/java/org/elasticsearch/reindex/Reindexer.java @@ -31,11 +31,11 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.lucene.uid.Versions; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.VersionType; import org.elasticsearch.index.mapper.VersionFieldMapper; import org.elasticsearch.index.reindex.BulkByScrollResponse; diff --git a/modules/reindex/src/main/java/org/elasticsearch/reindex/RestReindexAction.java b/modules/reindex/src/main/java/org/elasticsearch/reindex/RestReindexAction.java index 5a0c0ee4d4a09..27cbb7c4a853d 100644 --- a/modules/reindex/src/main/java/org/elasticsearch/reindex/RestReindexAction.java +++ b/modules/reindex/src/main/java/org/elasticsearch/reindex/RestReindexAction.java @@ -11,7 +11,7 @@ import org.elasticsearch.action.DocWriteRequest; import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.reindex.ReindexAction; import org.elasticsearch.index.reindex.ReindexRequest; import org.elasticsearch.rest.RestRequest; diff --git a/modules/reindex/src/main/java/org/elasticsearch/reindex/remote/RemoteRequestBuilders.java b/modules/reindex/src/main/java/org/elasticsearch/reindex/remote/RemoteRequestBuilders.java index 3696509c1a2c1..9ef60325d5112 100644 --- a/modules/reindex/src/main/java/org/elasticsearch/reindex/remote/RemoteRequestBuilders.java +++ b/modules/reindex/src/main/java/org/elasticsearch/reindex/remote/RemoteRequestBuilders.java @@ -18,11 +18,11 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.search.sort.FieldSortBuilder; import org.elasticsearch.search.sort.SortBuilder; diff --git a/modules/reindex/src/main/java/org/elasticsearch/reindex/remote/RemoteResponseParsers.java b/modules/reindex/src/main/java/org/elasticsearch/reindex/remote/RemoteResponseParsers.java index 087e6cbdc4c10..97ae04d8a922d 100644 --- a/modules/reindex/src/main/java/org/elasticsearch/reindex/remote/RemoteResponseParsers.java +++ b/modules/reindex/src/main/java/org/elasticsearch/reindex/remote/RemoteResponseParsers.java @@ -10,18 +10,18 @@ import org.apache.lucene.search.TotalHits; import org.elasticsearch.Version; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.core.Tuple; import org.elasticsearch.common.util.concurrent.EsRejectedExecutionException; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentLocation; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentLocation; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.reindex.ScrollableHitSource.BasicHit; import org.elasticsearch.index.reindex.ScrollableHitSource.Hit; import org.elasticsearch.index.reindex.ScrollableHitSource.Response; @@ -35,8 +35,8 @@ import static java.util.Collections.emptyList; import static java.util.Collections.singletonList; import static java.util.Objects.requireNonNull; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * Parsers to convert the response from the remote host into objects useful for {@link RemoteScrollableHitSource}. diff --git a/modules/reindex/src/main/java/org/elasticsearch/reindex/remote/RemoteScrollableHitSource.java b/modules/reindex/src/main/java/org/elasticsearch/reindex/remote/RemoteScrollableHitSource.java index 1674630797e76..19fc1bbd05fed 100644 --- a/modules/reindex/src/main/java/org/elasticsearch/reindex/remote/RemoteScrollableHitSource.java +++ b/modules/reindex/src/main/java/org/elasticsearch/reindex/remote/RemoteScrollableHitSource.java @@ -30,10 +30,10 @@ import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.concurrent.ThreadContext; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.reindex.RejectAwareActionListener; import org.elasticsearch.index.reindex.ScrollableHitSource; import org.elasticsearch.rest.RestStatus; diff --git a/modules/reindex/src/test/java/org/elasticsearch/reindex/AsyncBulkByScrollActionTests.java b/modules/reindex/src/test/java/org/elasticsearch/reindex/AsyncBulkByScrollActionTests.java index 30bb5ac7e3476..c3df1ca343c94 100644 --- a/modules/reindex/src/test/java/org/elasticsearch/reindex/AsyncBulkByScrollActionTests.java +++ b/modules/reindex/src/test/java/org/elasticsearch/reindex/AsyncBulkByScrollActionTests.java @@ -52,7 +52,7 @@ import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.concurrent.AbstractRunnable; import org.elasticsearch.common.util.concurrent.EsRejectedExecutionException; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.Index; import org.elasticsearch.index.engine.VersionConflictEngineException; import org.elasticsearch.index.reindex.AbstractBulkByScrollRequest; diff --git a/modules/reindex/src/test/java/org/elasticsearch/reindex/CancelTests.java b/modules/reindex/src/test/java/org/elasticsearch/reindex/CancelTests.java index 5cf540a9b2331..1c8a2c3510ee8 100644 --- a/modules/reindex/src/test/java/org/elasticsearch/reindex/CancelTests.java +++ b/modules/reindex/src/test/java/org/elasticsearch/reindex/CancelTests.java @@ -17,7 +17,7 @@ import org.elasticsearch.action.ingest.DeletePipelineRequest; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.IndexModule; import org.elasticsearch.index.engine.Engine; import org.elasticsearch.index.engine.Engine.Operation.Origin; diff --git a/modules/reindex/src/test/java/org/elasticsearch/reindex/ReindexFromRemoteWithAuthTests.java b/modules/reindex/src/test/java/org/elasticsearch/reindex/ReindexFromRemoteWithAuthTests.java index 38c5e5826c9a9..059095dafd66f 100644 --- a/modules/reindex/src/test/java/org/elasticsearch/reindex/ReindexFromRemoteWithAuthTests.java +++ b/modules/reindex/src/test/java/org/elasticsearch/reindex/ReindexFromRemoteWithAuthTests.java @@ -28,7 +28,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.transport.TransportAddress; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.env.Environment; import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.http.HttpInfo; diff --git a/modules/reindex/src/test/java/org/elasticsearch/reindex/RestDeleteByQueryActionTests.java b/modules/reindex/src/test/java/org/elasticsearch/reindex/RestDeleteByQueryActionTests.java index e7bfcc9b6561e..1991ca15295c2 100644 --- a/modules/reindex/src/test/java/org/elasticsearch/reindex/RestDeleteByQueryActionTests.java +++ b/modules/reindex/src/test/java/org/elasticsearch/reindex/RestDeleteByQueryActionTests.java @@ -9,7 +9,7 @@ package org.elasticsearch.reindex; import org.elasticsearch.core.RestApiVersion; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.reindex.BulkByScrollResponse; import org.elasticsearch.reindex.RestDeleteByQueryAction; import org.elasticsearch.rest.RestRequest; diff --git a/modules/reindex/src/test/java/org/elasticsearch/reindex/RestReindexActionTests.java b/modules/reindex/src/test/java/org/elasticsearch/reindex/RestReindexActionTests.java index b55c3d6839a93..ef851ae6c821e 100644 --- a/modules/reindex/src/test/java/org/elasticsearch/reindex/RestReindexActionTests.java +++ b/modules/reindex/src/test/java/org/elasticsearch/reindex/RestReindexActionTests.java @@ -11,12 +11,11 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.reindex.AbstractBulkByScrollRequest; import org.elasticsearch.index.reindex.ReindexRequest; -import org.elasticsearch.reindex.RestReindexAction; import org.elasticsearch.test.rest.FakeRestRequest; import org.elasticsearch.test.rest.RestActionTestCase; import org.junit.Before; diff --git a/modules/reindex/src/test/java/org/elasticsearch/reindex/RestUpdateByQueryActionTests.java b/modules/reindex/src/test/java/org/elasticsearch/reindex/RestUpdateByQueryActionTests.java index 74a1c94cedf32..85180cd506bac 100644 --- a/modules/reindex/src/test/java/org/elasticsearch/reindex/RestUpdateByQueryActionTests.java +++ b/modules/reindex/src/test/java/org/elasticsearch/reindex/RestUpdateByQueryActionTests.java @@ -9,7 +9,7 @@ package org.elasticsearch.reindex; import org.elasticsearch.core.RestApiVersion; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.reindex.BulkByScrollResponse; import org.elasticsearch.reindex.RestUpdateByQueryAction; import org.elasticsearch.rest.RestRequest; diff --git a/modules/reindex/src/test/java/org/elasticsearch/reindex/remote/RemoteResponseParsersTests.java b/modules/reindex/src/test/java/org/elasticsearch/reindex/remote/RemoteResponseParsersTests.java index 3f6c2e377ab90..685ccba64369c 100644 --- a/modules/reindex/src/test/java/org/elasticsearch/reindex/remote/RemoteResponseParsersTests.java +++ b/modules/reindex/src/test/java/org/elasticsearch/reindex/remote/RemoteResponseParsersTests.java @@ -10,17 +10,16 @@ import org.elasticsearch.action.search.ShardSearchFailure; import org.elasticsearch.common.util.concurrent.EsRejectedExecutionException; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.reindex.ScrollableHitSource; -import org.elasticsearch.reindex.remote.RemoteResponseParsers; import org.elasticsearch.test.ESTestCase; import org.hamcrest.Matchers; import java.io.IOException; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; public class RemoteResponseParsersTests extends ESTestCase { diff --git a/modules/repository-url/src/main/java/org/elasticsearch/plugin/repository/url/URLRepositoryPlugin.java b/modules/repository-url/src/main/java/org/elasticsearch/plugin/repository/url/URLRepositoryPlugin.java index 2393fd990b219..9657508c7f5f5 100644 --- a/modules/repository-url/src/main/java/org/elasticsearch/plugin/repository/url/URLRepositoryPlugin.java +++ b/modules/repository-url/src/main/java/org/elasticsearch/plugin/repository/url/URLRepositoryPlugin.java @@ -16,7 +16,7 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.util.BigArrays; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.core.internal.io.IOUtils; import org.elasticsearch.env.Environment; import org.elasticsearch.env.NodeEnvironment; diff --git a/modules/repository-url/src/main/java/org/elasticsearch/repositories/url/URLRepository.java b/modules/repository-url/src/main/java/org/elasticsearch/repositories/url/URLRepository.java index 216978fd1e405..8ca8bccf29df5 100644 --- a/modules/repository-url/src/main/java/org/elasticsearch/repositories/url/URLRepository.java +++ b/modules/repository-url/src/main/java/org/elasticsearch/repositories/url/URLRepository.java @@ -22,7 +22,7 @@ import org.elasticsearch.common.settings.Setting.Property; import org.elasticsearch.common.util.BigArrays; import org.elasticsearch.common.util.URIPattern; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.core.internal.io.IOUtils; import org.elasticsearch.env.Environment; import org.elasticsearch.indices.recovery.RecoverySettings; diff --git a/modules/repository-url/src/test/java/org/elasticsearch/repositories/url/URLRepositoryTests.java b/modules/repository-url/src/test/java/org/elasticsearch/repositories/url/URLRepositoryTests.java index 6b5d453d5f0b1..d4c580ea99519 100644 --- a/modules/repository-url/src/test/java/org/elasticsearch/repositories/url/URLRepositoryTests.java +++ b/modules/repository-url/src/test/java/org/elasticsearch/repositories/url/URLRepositoryTests.java @@ -13,7 +13,7 @@ import org.elasticsearch.common.settings.ClusterSettings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.MockBigArrays; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.env.Environment; import org.elasticsearch.env.TestEnvironment; import org.elasticsearch.indices.recovery.RecoverySettings; diff --git a/modules/repository-url/src/yamlRestTest/java/org/elasticsearch/repositories/url/RepositoryURLClientYamlTestSuiteIT.java b/modules/repository-url/src/yamlRestTest/java/org/elasticsearch/repositories/url/RepositoryURLClientYamlTestSuiteIT.java index c8addf772d34d..61ad6cc9814af 100644 --- a/modules/repository-url/src/yamlRestTest/java/org/elasticsearch/repositories/url/RepositoryURLClientYamlTestSuiteIT.java +++ b/modules/repository-url/src/yamlRestTest/java/org/elasticsearch/repositories/url/RepositoryURLClientYamlTestSuiteIT.java @@ -18,8 +18,8 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.core.PathUtils; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.repositories.fs.FsRepository; import org.elasticsearch.rest.RestStatus; @@ -34,7 +34,7 @@ import java.util.List; import java.util.Map; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasSize; import static org.hamcrest.Matchers.notNullValue; diff --git a/modules/runtime-fields-common/src/main/java/org/elasticsearch/runtimefields/RuntimeFieldsCommonPlugin.java b/modules/runtime-fields-common/src/main/java/org/elasticsearch/runtimefields/RuntimeFieldsCommonPlugin.java index 4ecb1de1e4fd7..19d163bf6e4d4 100644 --- a/modules/runtime-fields-common/src/main/java/org/elasticsearch/runtimefields/RuntimeFieldsCommonPlugin.java +++ b/modules/runtime-fields-common/src/main/java/org/elasticsearch/runtimefields/RuntimeFieldsCommonPlugin.java @@ -14,7 +14,6 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; import org.elasticsearch.core.TimeValue; import org.elasticsearch.env.Environment; import org.elasticsearch.env.NodeEnvironment; @@ -23,6 +22,7 @@ import org.elasticsearch.script.ScriptService; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.watcher.ResourceWatcherService; +import org.elasticsearch.xcontent.NamedXContentRegistry; import java.util.Collection; import java.util.List; diff --git a/modules/systemd/src/main/java/org/elasticsearch/systemd/SystemdPlugin.java b/modules/systemd/src/main/java/org/elasticsearch/systemd/SystemdPlugin.java index 41f59073be97d..aa0b2e05ddcf9 100644 --- a/modules/systemd/src/main/java/org/elasticsearch/systemd/SystemdPlugin.java +++ b/modules/systemd/src/main/java/org/elasticsearch/systemd/SystemdPlugin.java @@ -17,7 +17,7 @@ import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.env.Environment; import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.plugins.ClusterPlugin; diff --git a/modules/transport-netty4/src/javaRestTest/java/org/elasticsearch/rest/Netty4HeadBodyIsEmptyIT.java b/modules/transport-netty4/src/javaRestTest/java/org/elasticsearch/rest/Netty4HeadBodyIsEmptyIT.java index 861ce8dbcb07c..8899ba0a35c4e 100644 --- a/modules/transport-netty4/src/javaRestTest/java/org/elasticsearch/rest/Netty4HeadBodyIsEmptyIT.java +++ b/modules/transport-netty4/src/javaRestTest/java/org/elasticsearch/rest/Netty4HeadBodyIsEmptyIT.java @@ -11,7 +11,7 @@ import org.elasticsearch.client.Request; import org.elasticsearch.client.Response; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.rest.action.admin.indices.RestPutIndexTemplateAction; import org.elasticsearch.test.rest.ESRestTestCase; import org.hamcrest.Matcher; @@ -21,7 +21,7 @@ import static java.util.Collections.emptyMap; import static java.util.Collections.singletonMap; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.rest.RestStatus.NOT_FOUND; import static org.elasticsearch.rest.RestStatus.OK; import static org.hamcrest.Matchers.greaterThan; diff --git a/modules/transport-netty4/src/main/java/org/elasticsearch/http/netty4/Netty4HttpServerTransport.java b/modules/transport-netty4/src/main/java/org/elasticsearch/http/netty4/Netty4HttpServerTransport.java index defd3ce39fcbe..aaf09590e474d 100644 --- a/modules/transport-netty4/src/main/java/org/elasticsearch/http/netty4/Netty4HttpServerTransport.java +++ b/modules/transport-netty4/src/main/java/org/elasticsearch/http/netty4/Netty4HttpServerTransport.java @@ -40,7 +40,7 @@ import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.common.util.BigArrays; import org.elasticsearch.common.util.concurrent.EsExecutors; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.core.internal.io.IOUtils; import org.elasticsearch.core.internal.net.NetUtils; import org.elasticsearch.http.AbstractHttpServerTransport; diff --git a/modules/transport-netty4/src/main/java/org/elasticsearch/transport/netty4/Netty4Plugin.java b/modules/transport-netty4/src/main/java/org/elasticsearch/transport/netty4/Netty4Plugin.java index 54b9391204fe4..af352a4791ab3 100644 --- a/modules/transport-netty4/src/main/java/org/elasticsearch/transport/netty4/Netty4Plugin.java +++ b/modules/transport-netty4/src/main/java/org/elasticsearch/transport/netty4/Netty4Plugin.java @@ -18,7 +18,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.BigArrays; import org.elasticsearch.common.util.PageCacheRecycler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.http.HttpServerTransport; import org.elasticsearch.http.netty4.Netty4HttpServerTransport; import org.elasticsearch.indices.breaker.CircuitBreakerService; diff --git a/plugins/analysis-icu/src/internalClusterTest/java/org/elasticsearch/index/mapper/ICUCollationKeywordFieldMapperIT.java b/plugins/analysis-icu/src/internalClusterTest/java/org/elasticsearch/index/mapper/ICUCollationKeywordFieldMapperIT.java index c1633cafbf2fb..6c61c6cd20e20 100644 --- a/plugins/analysis-icu/src/internalClusterTest/java/org/elasticsearch/index/mapper/ICUCollationKeywordFieldMapperIT.java +++ b/plugins/analysis-icu/src/internalClusterTest/java/org/elasticsearch/index/mapper/ICUCollationKeywordFieldMapperIT.java @@ -13,8 +13,8 @@ import org.elasticsearch.action.search.SearchRequest; import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.plugin.analysis.icu.AnalysisICUPlugin; import org.elasticsearch.plugins.Plugin; @@ -27,7 +27,7 @@ import java.util.Collection; import java.util.Collections; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures; diff --git a/plugins/analysis-icu/src/main/java/org/elasticsearch/plugin/analysis/icu/ICUCollationKeywordFieldMapper.java b/plugins/analysis-icu/src/main/java/org/elasticsearch/plugin/analysis/icu/ICUCollationKeywordFieldMapper.java index c40d0f32b3962..833b95ef360db 100644 --- a/plugins/analysis-icu/src/main/java/org/elasticsearch/plugin/analysis/icu/ICUCollationKeywordFieldMapper.java +++ b/plugins/analysis-icu/src/main/java/org/elasticsearch/plugin/analysis/icu/ICUCollationKeywordFieldMapper.java @@ -23,7 +23,7 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.lucene.Lucene; import org.elasticsearch.common.unit.Fuzziness; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.Nullable; import org.elasticsearch.index.mapper.DocumentParserContext; import org.elasticsearch.index.mapper.FieldMapper; diff --git a/plugins/analysis-icu/src/test/java/org/elasticsearch/plugin/analysis/icu/ICUCollationKeywordFieldMapperTests.java b/plugins/analysis-icu/src/test/java/org/elasticsearch/plugin/analysis/icu/ICUCollationKeywordFieldMapperTests.java index 82f6b1eaa9f22..9cbdbb4504237 100644 --- a/plugins/analysis-icu/src/test/java/org/elasticsearch/plugin/analysis/icu/ICUCollationKeywordFieldMapperTests.java +++ b/plugins/analysis-icu/src/test/java/org/elasticsearch/plugin/analysis/icu/ICUCollationKeywordFieldMapperTests.java @@ -18,9 +18,9 @@ import org.apache.lucene.util.BytesRef; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.mapper.MapperParsingException; diff --git a/plugins/discovery-gce/qa/gce/src/yamlRestTest/java/org/elasticsearch/cloud/gce/GCEFixture.java b/plugins/discovery-gce/qa/gce/src/yamlRestTest/java/org/elasticsearch/cloud/gce/GCEFixture.java index 660d6e17a0d03..bba13eae37af6 100644 --- a/plugins/discovery-gce/qa/gce/src/yamlRestTest/java/org/elasticsearch/cloud/gce/GCEFixture.java +++ b/plugins/discovery-gce/qa/gce/src/yamlRestTest/java/org/elasticsearch/cloud/gce/GCEFixture.java @@ -32,7 +32,7 @@ import java.util.function.Function; import static java.nio.charset.StandardCharsets.UTF_8; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; /** * {@link GCEFixture} is a fixture that emulates a GCE service. diff --git a/plugins/examples/custom-significance-heuristic/src/main/java/org/elasticsearch/example/customsigheuristic/SimpleHeuristic.java b/plugins/examples/custom-significance-heuristic/src/main/java/org/elasticsearch/example/customsigheuristic/SimpleHeuristic.java index efa57527886ba..202aec543e41e 100644 --- a/plugins/examples/custom-significance-heuristic/src/main/java/org/elasticsearch/example/customsigheuristic/SimpleHeuristic.java +++ b/plugins/examples/custom-significance-heuristic/src/main/java/org/elasticsearch/example/customsigheuristic/SimpleHeuristic.java @@ -11,7 +11,7 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.search.aggregations.bucket.terms.heuristic.SignificanceHeuristic; import java.io.IOException; diff --git a/plugins/examples/custom-significance-heuristic/src/test/java/org/elasticsearch/example/customsigheuristic/SimpleHeuristicWireTests.java b/plugins/examples/custom-significance-heuristic/src/test/java/org/elasticsearch/example/customsigheuristic/SimpleHeuristicWireTests.java index 8834412ddf222..f1662cb470b9b 100644 --- a/plugins/examples/custom-significance-heuristic/src/test/java/org/elasticsearch/example/customsigheuristic/SimpleHeuristicWireTests.java +++ b/plugins/examples/custom-significance-heuristic/src/test/java/org/elasticsearch/example/customsigheuristic/SimpleHeuristicWireTests.java @@ -9,8 +9,8 @@ package org.elasticsearch.example.customsigheuristic; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentParser.Token; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser.Token; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/plugins/examples/custom-suggester/src/main/java/org/elasticsearch/example/customsuggester/CustomSuggestion.java b/plugins/examples/custom-suggester/src/main/java/org/elasticsearch/example/customsuggester/CustomSuggestion.java index fe39da3082386..742a3876b14f6 100644 --- a/plugins/examples/custom-suggester/src/main/java/org/elasticsearch/example/customsuggester/CustomSuggestion.java +++ b/plugins/examples/custom-suggester/src/main/java/org/elasticsearch/example/customsuggester/CustomSuggestion.java @@ -14,8 +14,8 @@ import org.elasticsearch.common.text.Text; import org.elasticsearch.common.xcontent.ConstructingObjectParser; import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.suggest.Suggest; import java.io.IOException; diff --git a/plugins/examples/custom-suggester/src/main/java/org/elasticsearch/example/customsuggester/CustomSuggestionBuilder.java b/plugins/examples/custom-suggester/src/main/java/org/elasticsearch/example/customsuggester/CustomSuggestionBuilder.java index 74bdbaac98378..4ebc9cc0059e5 100644 --- a/plugins/examples/custom-suggester/src/main/java/org/elasticsearch/example/customsuggester/CustomSuggestionBuilder.java +++ b/plugins/examples/custom-suggester/src/main/java/org/elasticsearch/example/customsuggester/CustomSuggestionBuilder.java @@ -13,8 +13,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.lucene.BytesRefs; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.query.SearchExecutionContext; import org.elasticsearch.search.suggest.SuggestionBuilder; import org.elasticsearch.search.suggest.SuggestionSearchContext; diff --git a/plugins/examples/rescore/src/main/java/org/elasticsearch/example/rescore/ExampleRescoreBuilder.java b/plugins/examples/rescore/src/main/java/org/elasticsearch/example/rescore/ExampleRescoreBuilder.java index ad584fcb9e41a..83f586fb519bb 100644 --- a/plugins/examples/rescore/src/main/java/org/elasticsearch/example/rescore/ExampleRescoreBuilder.java +++ b/plugins/examples/rescore/src/main/java/org/elasticsearch/example/rescore/ExampleRescoreBuilder.java @@ -18,8 +18,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.fielddata.IndexFieldData; import org.elasticsearch.index.fielddata.LeafFieldData; import org.elasticsearch.index.fielddata.LeafNumericFieldData; diff --git a/plugins/mapper-annotated-text/src/internalClusterTest/java/org/elasticsearch/index/mapper/annotatedtext/AnnotatedTextFieldMapperTests.java b/plugins/mapper-annotated-text/src/internalClusterTest/java/org/elasticsearch/index/mapper/annotatedtext/AnnotatedTextFieldMapperTests.java index 252671f3f42ed..63d2ee0534c2c 100644 --- a/plugins/mapper-annotated-text/src/internalClusterTest/java/org/elasticsearch/index/mapper/annotatedtext/AnnotatedTextFieldMapperTests.java +++ b/plugins/mapper-annotated-text/src/internalClusterTest/java/org/elasticsearch/index/mapper/annotatedtext/AnnotatedTextFieldMapperTests.java @@ -24,9 +24,9 @@ import org.apache.lucene.index.TermsEnum; import org.apache.lucene.util.BytesRef; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.analysis.AnalyzerScope; import org.elasticsearch.index.analysis.CharFilterFactory; diff --git a/plugins/mapper-murmur3/src/test/java/org/elasticsearch/index/mapper/murmur3/Murmur3FieldMapperTests.java b/plugins/mapper-murmur3/src/test/java/org/elasticsearch/index/mapper/murmur3/Murmur3FieldMapperTests.java index 962c2e7c0cd9f..d180322060df5 100644 --- a/plugins/mapper-murmur3/src/test/java/org/elasticsearch/index/mapper/murmur3/Murmur3FieldMapperTests.java +++ b/plugins/mapper-murmur3/src/test/java/org/elasticsearch/index/mapper/murmur3/Murmur3FieldMapperTests.java @@ -11,7 +11,7 @@ import org.apache.lucene.index.DocValuesType; import org.apache.lucene.index.IndexOptions; import org.apache.lucene.index.IndexableField; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.mapper.MapperTestCase; diff --git a/plugins/mapper-size/src/internalClusterTest/java/org/elasticsearch/index/mapper/size/SizeMappingIT.java b/plugins/mapper-size/src/internalClusterTest/java/org/elasticsearch/index/mapper/size/SizeMappingIT.java index 1a11335178fe5..39a0edb8119b8 100644 --- a/plugins/mapper-size/src/internalClusterTest/java/org/elasticsearch/index/mapper/size/SizeMappingIT.java +++ b/plugins/mapper-size/src/internalClusterTest/java/org/elasticsearch/index/mapper/size/SizeMappingIT.java @@ -11,8 +11,8 @@ import org.elasticsearch.action.get.GetResponse; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.action.support.master.AcknowledgedResponse; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.plugin.mapper.MapperSizePlugin; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.test.ESIntegTestCase; @@ -23,7 +23,7 @@ import java.util.Locale; import java.util.Map; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.hamcrest.Matchers.hasKey; import static org.hamcrest.Matchers.is; diff --git a/plugins/mapper-size/src/test/java/org/elasticsearch/index/mapper/size/SizeMappingTests.java b/plugins/mapper-size/src/test/java/org/elasticsearch/index/mapper/size/SizeMappingTests.java index 8810fac6d1f17..98187dbdbf14b 100644 --- a/plugins/mapper-size/src/test/java/org/elasticsearch/index/mapper/size/SizeMappingTests.java +++ b/plugins/mapper-size/src/test/java/org/elasticsearch/index/mapper/size/SizeMappingTests.java @@ -9,7 +9,7 @@ package org.elasticsearch.index.mapper.size; import org.apache.lucene.index.IndexableField; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.MapperService; import org.elasticsearch.index.mapper.MapperServiceTestCase; diff --git a/plugins/repository-azure/src/main/java/org/elasticsearch/repositories/azure/AzureRepository.java b/plugins/repository-azure/src/main/java/org/elasticsearch/repositories/azure/AzureRepository.java index 777d0c14ac50a..13175864bf69a 100644 --- a/plugins/repository-azure/src/main/java/org/elasticsearch/repositories/azure/AzureRepository.java +++ b/plugins/repository-azure/src/main/java/org/elasticsearch/repositories/azure/AzureRepository.java @@ -21,7 +21,7 @@ import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.common.util.BigArrays; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.indices.recovery.RecoverySettings; import org.elasticsearch.repositories.blobstore.MeteredBlobStoreRepository; diff --git a/plugins/repository-azure/src/main/java/org/elasticsearch/repositories/azure/AzureRepositoryPlugin.java b/plugins/repository-azure/src/main/java/org/elasticsearch/repositories/azure/AzureRepositoryPlugin.java index 095f7b7f859b3..8ac33a98e413d 100644 --- a/plugins/repository-azure/src/main/java/org/elasticsearch/repositories/azure/AzureRepositoryPlugin.java +++ b/plugins/repository-azure/src/main/java/org/elasticsearch/repositories/azure/AzureRepositoryPlugin.java @@ -19,7 +19,7 @@ import org.elasticsearch.common.settings.SettingsException; import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.BigArrays; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.env.Environment; import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.indices.recovery.RecoverySettings; diff --git a/plugins/repository-azure/src/test/java/org/elasticsearch/repositories/azure/AzureRepositorySettingsTests.java b/plugins/repository-azure/src/test/java/org/elasticsearch/repositories/azure/AzureRepositorySettingsTests.java index 1c0f4d7eb6e3c..f52bdc7bdb42e 100644 --- a/plugins/repository-azure/src/test/java/org/elasticsearch/repositories/azure/AzureRepositorySettingsTests.java +++ b/plugins/repository-azure/src/test/java/org/elasticsearch/repositories/azure/AzureRepositorySettingsTests.java @@ -14,7 +14,7 @@ import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.common.util.MockBigArrays; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.env.Environment; import org.elasticsearch.indices.recovery.RecoverySettings; import org.elasticsearch.repositories.blobstore.BlobStoreTestUtil; diff --git a/plugins/repository-gcs/src/internalClusterTest/java/org/elasticsearch/repositories/gcs/GoogleCloudStorageBlobStoreRepositoryTests.java b/plugins/repository-gcs/src/internalClusterTest/java/org/elasticsearch/repositories/gcs/GoogleCloudStorageBlobStoreRepositoryTests.java index 58e9d12b48c75..4fc328898e33e 100644 --- a/plugins/repository-gcs/src/internalClusterTest/java/org/elasticsearch/repositories/gcs/GoogleCloudStorageBlobStoreRepositoryTests.java +++ b/plugins/repository-gcs/src/internalClusterTest/java/org/elasticsearch/repositories/gcs/GoogleCloudStorageBlobStoreRepositoryTests.java @@ -35,7 +35,7 @@ import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.common.util.BigArrays; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.env.Environment; import org.elasticsearch.indices.recovery.RecoverySettings; import org.elasticsearch.plugins.Plugin; diff --git a/plugins/repository-gcs/src/main/java/org/elasticsearch/repositories/gcs/GoogleCloudStoragePlugin.java b/plugins/repository-gcs/src/main/java/org/elasticsearch/repositories/gcs/GoogleCloudStoragePlugin.java index e82501738614a..d25ae6b304fd9 100644 --- a/plugins/repository-gcs/src/main/java/org/elasticsearch/repositories/gcs/GoogleCloudStoragePlugin.java +++ b/plugins/repository-gcs/src/main/java/org/elasticsearch/repositories/gcs/GoogleCloudStoragePlugin.java @@ -12,7 +12,7 @@ import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.BigArrays; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.env.Environment; import org.elasticsearch.indices.recovery.RecoverySettings; import org.elasticsearch.plugins.Plugin; diff --git a/plugins/repository-gcs/src/main/java/org/elasticsearch/repositories/gcs/GoogleCloudStorageRepository.java b/plugins/repository-gcs/src/main/java/org/elasticsearch/repositories/gcs/GoogleCloudStorageRepository.java index 117cf20762aa5..3b0125fc31e67 100644 --- a/plugins/repository-gcs/src/main/java/org/elasticsearch/repositories/gcs/GoogleCloudStorageRepository.java +++ b/plugins/repository-gcs/src/main/java/org/elasticsearch/repositories/gcs/GoogleCloudStorageRepository.java @@ -18,7 +18,7 @@ import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.common.util.BigArrays; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.indices.recovery.RecoverySettings; import org.elasticsearch.repositories.RepositoryException; import org.elasticsearch.repositories.blobstore.MeteredBlobStoreRepository; diff --git a/plugins/repository-gcs/src/test/java/org/elasticsearch/repositories/gcs/GoogleCloudStorageServiceTests.java b/plugins/repository-gcs/src/test/java/org/elasticsearch/repositories/gcs/GoogleCloudStorageServiceTests.java index 291bbe4b9343e..7acba307d54e9 100644 --- a/plugins/repository-gcs/src/test/java/org/elasticsearch/repositories/gcs/GoogleCloudStorageServiceTests.java +++ b/plugins/repository-gcs/src/test/java/org/elasticsearch/repositories/gcs/GoogleCloudStorageServiceTests.java @@ -17,7 +17,7 @@ import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.test.ESTestCase; import org.hamcrest.Matchers; @@ -27,7 +27,7 @@ import java.util.Locale; import java.util.UUID; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.containsString; diff --git a/plugins/repository-gcs/src/test/java/org/elasticsearch/repositories/gcs/TestUtils.java b/plugins/repository-gcs/src/test/java/org/elasticsearch/repositories/gcs/TestUtils.java index 0c21365c05d0f..800846fbbecfd 100644 --- a/plugins/repository-gcs/src/test/java/org/elasticsearch/repositories/gcs/TestUtils.java +++ b/plugins/repository-gcs/src/test/java/org/elasticsearch/repositories/gcs/TestUtils.java @@ -7,8 +7,8 @@ */ package org.elasticsearch.repositories.gcs; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import java.io.ByteArrayOutputStream; import java.security.KeyPairGenerator; diff --git a/plugins/repository-hdfs/src/main/java/org/elasticsearch/repositories/hdfs/HdfsPlugin.java b/plugins/repository-hdfs/src/main/java/org/elasticsearch/repositories/hdfs/HdfsPlugin.java index 483f65246fe2f..c63c43759cfe8 100644 --- a/plugins/repository-hdfs/src/main/java/org/elasticsearch/repositories/hdfs/HdfsPlugin.java +++ b/plugins/repository-hdfs/src/main/java/org/elasticsearch/repositories/hdfs/HdfsPlugin.java @@ -22,7 +22,7 @@ import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.core.SuppressForbidden; import org.elasticsearch.common.util.BigArrays; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.env.Environment; import org.elasticsearch.indices.recovery.RecoverySettings; import org.elasticsearch.plugins.Plugin; diff --git a/plugins/repository-hdfs/src/main/java/org/elasticsearch/repositories/hdfs/HdfsRepository.java b/plugins/repository-hdfs/src/main/java/org/elasticsearch/repositories/hdfs/HdfsRepository.java index 8951ebdc82fba..cb4b3b9421ceb 100644 --- a/plugins/repository-hdfs/src/main/java/org/elasticsearch/repositories/hdfs/HdfsRepository.java +++ b/plugins/repository-hdfs/src/main/java/org/elasticsearch/repositories/hdfs/HdfsRepository.java @@ -27,7 +27,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.common.util.BigArrays; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.env.Environment; import org.elasticsearch.indices.recovery.RecoverySettings; import org.elasticsearch.repositories.blobstore.BlobStoreRepository; diff --git a/plugins/repository-s3/src/internalClusterTest/java/org/elasticsearch/repositories/s3/S3BlobStoreRepositoryTests.java b/plugins/repository-s3/src/internalClusterTest/java/org/elasticsearch/repositories/s3/S3BlobStoreRepositoryTests.java index b3b53eebd37a0..11deffb908528 100644 --- a/plugins/repository-s3/src/internalClusterTest/java/org/elasticsearch/repositories/s3/S3BlobStoreRepositoryTests.java +++ b/plugins/repository-s3/src/internalClusterTest/java/org/elasticsearch/repositories/s3/S3BlobStoreRepositoryTests.java @@ -28,8 +28,8 @@ import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.BigArrays; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.indices.recovery.RecoverySettings; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.repositories.RepositoriesService; diff --git a/plugins/repository-s3/src/main/java/org/elasticsearch/repositories/s3/S3Repository.java b/plugins/repository-s3/src/main/java/org/elasticsearch/repositories/s3/S3Repository.java index 5aac348d1794a..de6f2df67112e 100644 --- a/plugins/repository-s3/src/main/java/org/elasticsearch/repositories/s3/S3Repository.java +++ b/plugins/repository-s3/src/main/java/org/elasticsearch/repositories/s3/S3Repository.java @@ -23,7 +23,6 @@ import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.BigArrays; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; import org.elasticsearch.indices.recovery.RecoverySettings; import org.elasticsearch.monitor.jvm.JvmInfo; import org.elasticsearch.repositories.FinalizeSnapshotContext; @@ -34,6 +33,7 @@ import org.elasticsearch.snapshots.SnapshotsService; import org.elasticsearch.threadpool.Scheduler; import org.elasticsearch.threadpool.ThreadPool; +import org.elasticsearch.xcontent.NamedXContentRegistry; import java.util.Collection; import java.util.Map; diff --git a/plugins/repository-s3/src/main/java/org/elasticsearch/repositories/s3/S3RepositoryPlugin.java b/plugins/repository-s3/src/main/java/org/elasticsearch/repositories/s3/S3RepositoryPlugin.java index ec4185f525c93..da0d5765b121f 100644 --- a/plugins/repository-s3/src/main/java/org/elasticsearch/repositories/s3/S3RepositoryPlugin.java +++ b/plugins/repository-s3/src/main/java/org/elasticsearch/repositories/s3/S3RepositoryPlugin.java @@ -15,13 +15,13 @@ import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.BigArrays; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; import org.elasticsearch.env.Environment; import org.elasticsearch.indices.recovery.RecoverySettings; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.plugins.ReloadablePlugin; import org.elasticsearch.plugins.RepositoryPlugin; import org.elasticsearch.repositories.Repository; +import org.elasticsearch.xcontent.NamedXContentRegistry; import java.io.IOException; import java.security.AccessController; diff --git a/plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/RepositoryCredentialsTests.java b/plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/RepositoryCredentialsTests.java index fd46f588f1c00..d7bc6b7c856fb 100644 --- a/plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/RepositoryCredentialsTests.java +++ b/plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/RepositoryCredentialsTests.java @@ -18,7 +18,7 @@ import org.elasticsearch.common.settings.MockSecureSettings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.BigArrays; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.indices.recovery.RecoverySettings; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.plugins.PluginsService; diff --git a/plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/S3RepositoryTests.java b/plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/S3RepositoryTests.java index 4518645d97309..4b3dfe442ad96 100644 --- a/plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/S3RepositoryTests.java +++ b/plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/S3RepositoryTests.java @@ -15,7 +15,7 @@ import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.common.util.MockBigArrays; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.indices.recovery.RecoverySettings; import org.elasticsearch.repositories.RepositoryException; import org.elasticsearch.repositories.blobstore.BlobStoreTestUtil; diff --git a/plugins/transport-nio/src/main/java/org/elasticsearch/http/nio/NioHttpServerTransport.java b/plugins/transport-nio/src/main/java/org/elasticsearch/http/nio/NioHttpServerTransport.java index cb33bcc374e61..fa23d238bf3b7 100644 --- a/plugins/transport-nio/src/main/java/org/elasticsearch/http/nio/NioHttpServerTransport.java +++ b/plugins/transport-nio/src/main/java/org/elasticsearch/http/nio/NioHttpServerTransport.java @@ -19,7 +19,7 @@ import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.common.util.BigArrays; import org.elasticsearch.common.util.PageCacheRecycler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.http.AbstractHttpServerTransport; import org.elasticsearch.http.HttpChannel; import org.elasticsearch.http.HttpServerChannel; diff --git a/plugins/transport-nio/src/main/java/org/elasticsearch/transport/nio/NioTransportPlugin.java b/plugins/transport-nio/src/main/java/org/elasticsearch/transport/nio/NioTransportPlugin.java index 8a84fc4ff269c..4fe52f90376ef 100644 --- a/plugins/transport-nio/src/main/java/org/elasticsearch/transport/nio/NioTransportPlugin.java +++ b/plugins/transport-nio/src/main/java/org/elasticsearch/transport/nio/NioTransportPlugin.java @@ -20,7 +20,7 @@ import org.elasticsearch.common.util.BigArrays; import org.elasticsearch.common.util.PageCacheRecycler; import org.elasticsearch.common.util.concurrent.EsExecutors; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.http.HttpServerTransport; import org.elasticsearch.http.nio.NioHttpServerTransport; import org.elasticsearch.indices.breaker.CircuitBreakerService; diff --git a/qa/ccs-rolling-upgrade-remote-cluster/src/test/java/org/elasticsearch/upgrades/SearchStatesIT.java b/qa/ccs-rolling-upgrade-remote-cluster/src/test/java/org/elasticsearch/upgrades/SearchStatesIT.java index e579e4a9cf8b1..72d86df63beaf 100644 --- a/qa/ccs-rolling-upgrade-remote-cluster/src/test/java/org/elasticsearch/upgrades/SearchStatesIT.java +++ b/qa/ccs-rolling-upgrade-remote-cluster/src/test/java/org/elasticsearch/upgrades/SearchStatesIT.java @@ -44,10 +44,10 @@ import org.elasticsearch.client.indices.CreateIndexRequest; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.hamcrest.ElasticsearchAssertions; import org.elasticsearch.test.rest.ESRestTestCase; import org.elasticsearch.test.rest.yaml.ObjectPath; diff --git a/qa/ccs-unavailable-clusters/src/test/java/org/elasticsearch/search/CrossClusterSearchUnavailableClusterIT.java b/qa/ccs-unavailable-clusters/src/test/java/org/elasticsearch/search/CrossClusterSearchUnavailableClusterIT.java index 00f0fb99f6c45..d391d81860369 100644 --- a/qa/ccs-unavailable-clusters/src/test/java/org/elasticsearch/search/CrossClusterSearchUnavailableClusterIT.java +++ b/qa/ccs-unavailable-clusters/src/test/java/org/elasticsearch/search/CrossClusterSearchUnavailableClusterIT.java @@ -41,8 +41,8 @@ import org.elasticsearch.common.settings.SecureString; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.search.aggregations.InternalAggregations; import org.elasticsearch.search.internal.InternalSearchResponse; import org.elasticsearch.test.rest.ESRestTestCase; diff --git a/qa/full-cluster-restart/src/test/java/org/elasticsearch/upgrades/FullClusterRestartIT.java b/qa/full-cluster-restart/src/test/java/org/elasticsearch/upgrades/FullClusterRestartIT.java index d6dcd01a3e053..a4bdda97635c1 100644 --- a/qa/full-cluster-restart/src/test/java/org/elasticsearch/upgrades/FullClusterRestartIT.java +++ b/qa/full-cluster-restart/src/test/java/org/elasticsearch/upgrades/FullClusterRestartIT.java @@ -19,9 +19,9 @@ import org.elasticsearch.cluster.metadata.MetadataIndexStateService; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.core.Booleans; import org.elasticsearch.core.CheckedFunction; @@ -54,7 +54,7 @@ import static org.elasticsearch.cluster.metadata.IndexNameExpressionResolver.SYSTEM_INDEX_ENFORCEMENT_VERSION; import static org.elasticsearch.cluster.routing.UnassignedInfo.INDEX_DELAYED_NODE_LEFT_TIMEOUT_SETTING; import static org.elasticsearch.cluster.routing.allocation.decider.MaxRetryAllocationDecider.SETTING_ALLOCATION_MAX_RETRY; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.transport.RemoteClusterService.REMOTE_CLUSTER_COMPRESS; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; diff --git a/qa/full-cluster-restart/src/test/java/org/elasticsearch/upgrades/QueryBuilderBWCIT.java b/qa/full-cluster-restart/src/test/java/org/elasticsearch/upgrades/QueryBuilderBWCIT.java index 8ced07de10c99..da17519d490ed 100644 --- a/qa/full-cluster-restart/src/test/java/org/elasticsearch/upgrades/QueryBuilderBWCIT.java +++ b/qa/full-cluster-restart/src/test/java/org/elasticsearch/upgrades/QueryBuilderBWCIT.java @@ -18,9 +18,9 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.Fuzziness; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.query.BoolQueryBuilder; import org.elasticsearch.index.query.ConstantScoreQueryBuilder; import org.elasticsearch.index.query.DisMaxQueryBuilder; @@ -45,7 +45,7 @@ import java.util.List; import java.util.Map; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; /** * An integration test that tests whether percolator queries stored in older supported ES version can still be read by the diff --git a/qa/logging-config/src/test/java/org/elasticsearch/common/logging/JsonLoggerTests.java b/qa/logging-config/src/test/java/org/elasticsearch/common/logging/JsonLoggerTests.java index bd1740ed202e9..1c0cf3f973c9b 100644 --- a/qa/logging-config/src/test/java/org/elasticsearch/common/logging/JsonLoggerTests.java +++ b/qa/logging-config/src/test/java/org/elasticsearch/common/logging/JsonLoggerTests.java @@ -15,7 +15,7 @@ import org.apache.logging.log4j.core.config.Configurator; import org.elasticsearch.cli.UserException; import org.elasticsearch.core.CheckedConsumer; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.core.PathUtils; import org.elasticsearch.common.settings.Settings; @@ -230,7 +230,7 @@ public void testParseFieldEmittingDeprecatedLogs() throws Exception { hasEntry("data_stream.dataset", "deprecation.elasticsearch"), hasEntry("data_stream.namespace", "default"), hasEntry("data_stream.type", "logs"), - hasEntry("log.logger", "org.elasticsearch.deprecation.common.xcontent.ParseField"), + hasEntry("log.logger", "org.elasticsearch.deprecation.xcontent.ParseField"), hasEntry("ecs.version", DeprecatedMessage.ECS_VERSION), hasEntry("elasticsearch.cluster.name", "elasticsearch"), hasEntry("elasticsearch.node.name", "sample-name"), @@ -247,7 +247,7 @@ public void testParseFieldEmittingDeprecatedLogs() throws Exception { hasEntry("data_stream.dataset", "deprecation.elasticsearch"), hasEntry("data_stream.namespace", "default"), hasEntry("data_stream.type", "logs"), - hasEntry("log.logger", "org.elasticsearch.deprecation.common.xcontent.ParseField"), + hasEntry("log.logger", "org.elasticsearch.deprecation.xcontent.ParseField"), hasEntry("ecs.version", DeprecatedMessage.ECS_VERSION), hasEntry("elasticsearch.cluster.name", "elasticsearch"), hasEntry("elasticsearch.node.name", "sample-name"), @@ -264,7 +264,7 @@ public void testParseFieldEmittingDeprecatedLogs() throws Exception { hasEntry("data_stream.dataset", "deprecation.elasticsearch"), hasEntry("data_stream.namespace", "default"), hasEntry("data_stream.type", "logs"), - hasEntry("log.logger", "org.elasticsearch.deprecation.common.xcontent.ParseField"), + hasEntry("log.logger", "org.elasticsearch.deprecation.xcontent.ParseField"), hasEntry("ecs.version", DeprecatedMessage.ECS_VERSION), hasEntry("elasticsearch.cluster.name", "elasticsearch"), hasEntry("elasticsearch.node.name", "sample-name"), diff --git a/qa/mixed-cluster/src/test/java/org/elasticsearch/backwards/IndexingIT.java b/qa/mixed-cluster/src/test/java/org/elasticsearch/backwards/IndexingIT.java index e60c8a4f45038..318e696480059 100644 --- a/qa/mixed-cluster/src/test/java/org/elasticsearch/backwards/IndexingIT.java +++ b/qa/mixed-cluster/src/test/java/org/elasticsearch/backwards/IndexingIT.java @@ -17,9 +17,9 @@ import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.MediaType; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.MediaType; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.index.seqno.SeqNoStats; diff --git a/qa/multi-cluster-search/src/test/java/org/elasticsearch/search/CCSDuelIT.java b/qa/multi-cluster-search/src/test/java/org/elasticsearch/search/CCSDuelIT.java index 75d765e39f44b..c2b9dbdb44462 100644 --- a/qa/multi-cluster-search/src/test/java/org/elasticsearch/search/CCSDuelIT.java +++ b/qa/multi-cluster-search/src/test/java/org/elasticsearch/search/CCSDuelIT.java @@ -34,7 +34,7 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.internal.io.IOUtils; import org.elasticsearch.index.query.InnerHitBuilder; import org.elasticsearch.index.query.MatchQueryBuilder; diff --git a/qa/remote-clusters/src/test/java/org/elasticsearch/cluster/remote/test/RemoteClustersIT.java b/qa/remote-clusters/src/test/java/org/elasticsearch/cluster/remote/test/RemoteClustersIT.java index 9ad94e7167726..dfec8d7c8ebbf 100644 --- a/qa/remote-clusters/src/test/java/org/elasticsearch/cluster/remote/test/RemoteClustersIT.java +++ b/qa/remote-clusters/src/test/java/org/elasticsearch/cluster/remote/test/RemoteClustersIT.java @@ -17,7 +17,7 @@ import org.elasticsearch.client.cluster.RemoteInfoRequest; import org.elasticsearch.client.indices.CreateIndexRequest; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentFactory; import org.junit.After; import org.junit.Before; diff --git a/qa/repository-multi-version/src/test/java/org/elasticsearch/upgrades/MultiVersionRepositoryAccessIT.java b/qa/repository-multi-version/src/test/java/org/elasticsearch/upgrades/MultiVersionRepositoryAccessIT.java index 4ef7d702191a7..4f71acf1bc562 100644 --- a/qa/repository-multi-version/src/test/java/org/elasticsearch/upgrades/MultiVersionRepositoryAccessIT.java +++ b/qa/repository-multi-version/src/test/java/org/elasticsearch/upgrades/MultiVersionRepositoryAccessIT.java @@ -24,9 +24,9 @@ import org.elasticsearch.client.RestClient; import org.elasticsearch.client.RestHighLevelClient; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.snapshots.RestoreInfo; import org.elasticsearch.snapshots.SnapshotsService; import org.elasticsearch.test.rest.ESRestTestCase; diff --git a/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/IndexingIT.java b/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/IndexingIT.java index 065e3d02c9034..43346f426897a 100644 --- a/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/IndexingIT.java +++ b/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/IndexingIT.java @@ -15,9 +15,9 @@ import org.elasticsearch.client.Response; import org.elasticsearch.client.ResponseException; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.core.Booleans; import org.elasticsearch.index.mapper.DateFieldMapper; diff --git a/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/SnapshotBasedRecoveryIT.java b/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/SnapshotBasedRecoveryIT.java index eb11d8b2264b5..ca0cc53d5c6ea 100644 --- a/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/SnapshotBasedRecoveryIT.java +++ b/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/SnapshotBasedRecoveryIT.java @@ -16,7 +16,7 @@ import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.core.Nullable; import org.elasticsearch.index.query.QueryBuilder; @@ -30,7 +30,7 @@ import static org.elasticsearch.cluster.routing.UnassignedInfo.INDEX_DELAYED_NODE_LEFT_TIMEOUT_SETTING; import static org.elasticsearch.cluster.routing.allocation.decider.MaxRetryAllocationDecider.SETTING_ALLOCATION_MAX_RETRY; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.allOf; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.greaterThanOrEqualTo; diff --git a/qa/smoke-test-http/src/test/java/org/elasticsearch/http/AutoCreateIndexIT.java b/qa/smoke-test-http/src/test/java/org/elasticsearch/http/AutoCreateIndexIT.java index 5635585d10658..f33fdd3691bb0 100644 --- a/qa/smoke-test-http/src/test/java/org/elasticsearch/http/AutoCreateIndexIT.java +++ b/qa/smoke-test-http/src/test/java/org/elasticsearch/http/AutoCreateIndexIT.java @@ -14,8 +14,8 @@ import org.elasticsearch.client.ResponseException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.Streams; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.rest.ESRestTestCase; import java.io.IOException; diff --git a/qa/smoke-test-http/src/test/java/org/elasticsearch/http/ClusterStateRestCancellationIT.java b/qa/smoke-test-http/src/test/java/org/elasticsearch/http/ClusterStateRestCancellationIT.java index 40fe313c36c42..e69e74ee72cd6 100644 --- a/qa/smoke-test-http/src/test/java/org/elasticsearch/http/ClusterStateRestCancellationIT.java +++ b/qa/smoke-test-http/src/test/java/org/elasticsearch/http/ClusterStateRestCancellationIT.java @@ -22,7 +22,7 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.util.CollectionUtils; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.tasks.TaskInfo; diff --git a/qa/smoke-test-http/src/test/java/org/elasticsearch/http/IndexingPressureRestIT.java b/qa/smoke-test-http/src/test/java/org/elasticsearch/http/IndexingPressureRestIT.java index 95a0583ba6bf6..c2c1f2861d032 100644 --- a/qa/smoke-test-http/src/test/java/org/elasticsearch/http/IndexingPressureRestIT.java +++ b/qa/smoke-test-http/src/test/java/org/elasticsearch/http/IndexingPressureRestIT.java @@ -12,7 +12,7 @@ import org.elasticsearch.client.ResponseException; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.IndexingPressure; import org.elasticsearch.test.ESIntegTestCase.ClusterScope; import org.elasticsearch.test.ESIntegTestCase.Scope; diff --git a/qa/smoke-test-http/src/test/java/org/elasticsearch/http/SearchRestCancellationIT.java b/qa/smoke-test-http/src/test/java/org/elasticsearch/http/SearchRestCancellationIT.java index 642754b6e395e..69c8dace87fc8 100644 --- a/qa/smoke-test-http/src/test/java/org/elasticsearch/http/SearchRestCancellationIT.java +++ b/qa/smoke-test-http/src/test/java/org/elasticsearch/http/SearchRestCancellationIT.java @@ -26,7 +26,7 @@ import org.elasticsearch.client.Response; import org.elasticsearch.common.Strings; import org.elasticsearch.common.util.CollectionUtils; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.plugins.PluginsService; import org.elasticsearch.script.MockScriptPlugin; diff --git a/qa/smoke-test-http/src/test/java/org/elasticsearch/http/SystemIndexRestIT.java b/qa/smoke-test-http/src/test/java/org/elasticsearch/http/SystemIndexRestIT.java index e15aadcf0f453..e9ba48f5c2851 100644 --- a/qa/smoke-test-http/src/test/java/org/elasticsearch/http/SystemIndexRestIT.java +++ b/qa/smoke-test-http/src/test/java/org/elasticsearch/http/SystemIndexRestIT.java @@ -23,7 +23,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.SettingsFilter; import org.elasticsearch.common.util.CollectionUtils; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.indices.SystemIndexDescriptor; import org.elasticsearch.indices.SystemIndexDescriptor.Type; import org.elasticsearch.plugins.Plugin; @@ -42,7 +42,7 @@ import java.util.Map; import java.util.function.Supplier; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.rest.RestRequest.Method.POST; import static org.elasticsearch.test.rest.ESRestTestCase.entityAsMap; import static org.hamcrest.Matchers.equalTo; diff --git a/qa/smoke-test-http/src/test/java/org/elasticsearch/http/snapshots/RestGetSnapshotsIT.java b/qa/smoke-test-http/src/test/java/org/elasticsearch/http/snapshots/RestGetSnapshotsIT.java index b30538a0e1642..56f52fc403265 100644 --- a/qa/smoke-test-http/src/test/java/org/elasticsearch/http/snapshots/RestGetSnapshotsIT.java +++ b/qa/smoke-test-http/src/test/java/org/elasticsearch/http/snapshots/RestGetSnapshotsIT.java @@ -17,10 +17,10 @@ import org.elasticsearch.client.Response; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.search.sort.SortOrder; import org.elasticsearch.snapshots.AbstractSnapshotIntegTestCase; import org.elasticsearch.snapshots.SnapshotInfo; diff --git a/qa/system-indices/src/main/java/org/elasticsearch/system/indices/SystemIndicesQA.java b/qa/system-indices/src/main/java/org/elasticsearch/system/indices/SystemIndicesQA.java index 6d73b22de1f60..fcf3177f2c94a 100644 --- a/qa/system-indices/src/main/java/org/elasticsearch/system/indices/SystemIndicesQA.java +++ b/qa/system-indices/src/main/java/org/elasticsearch/system/indices/SystemIndicesQA.java @@ -20,7 +20,6 @@ import org.elasticsearch.common.settings.IndexScopedSettings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.SettingsFilter; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.indices.SystemIndexDescriptor; import org.elasticsearch.plugins.ActionPlugin; import org.elasticsearch.plugins.Plugin; @@ -31,6 +30,7 @@ import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.RestRequest.Method; import org.elasticsearch.rest.action.RestToXContentListener; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.io.UncheckedIOException; @@ -38,10 +38,10 @@ import java.util.List; import java.util.function.Supplier; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.mapper.MapperService.SINGLE_MAPPING_NAME; import static org.elasticsearch.rest.RestRequest.Method.POST; import static org.elasticsearch.rest.RestRequest.Method.PUT; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; public class SystemIndicesQA extends Plugin implements SystemIndexPlugin, ActionPlugin { diff --git a/qa/wildfly/src/main/java/org/elasticsearch/wildfly/transport/RestHighLevelClientEmployeeResource.java b/qa/wildfly/src/main/java/org/elasticsearch/wildfly/transport/RestHighLevelClientEmployeeResource.java index d5dc5358ce6b9..6e271b2af7532 100644 --- a/qa/wildfly/src/main/java/org/elasticsearch/wildfly/transport/RestHighLevelClientEmployeeResource.java +++ b/qa/wildfly/src/main/java/org/elasticsearch/wildfly/transport/RestHighLevelClientEmployeeResource.java @@ -14,8 +14,8 @@ import org.elasticsearch.action.index.IndexResponse; import org.elasticsearch.client.RequestOptions; import org.elasticsearch.client.RestHighLevelClient; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.wildfly.model.Employee; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.net.URI; @@ -33,7 +33,7 @@ import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; @Path("/employees") public class RestHighLevelClientEmployeeResource { diff --git a/qa/wildfly/src/test/java/org/elasticsearch/wildfly/WildflyIT.java b/qa/wildfly/src/test/java/org/elasticsearch/wildfly/WildflyIT.java index f707d112fcdcc..117481da61f9b 100644 --- a/qa/wildfly/src/test/java/org/elasticsearch/wildfly/WildflyIT.java +++ b/qa/wildfly/src/test/java/org/elasticsearch/wildfly/WildflyIT.java @@ -20,11 +20,11 @@ import org.apache.logging.log4j.Logger; import org.apache.lucene.util.TestRuleLimitSysouts; import org.elasticsearch.cluster.ClusterModule; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.test.ESTestCase; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import java.io.IOException; import java.net.URI; diff --git a/server/build.gradle b/server/build.gradle index 9468d37eb6660..b3bdd1fdb0d46 100644 --- a/server/build.gradle +++ b/server/build.gradle @@ -264,10 +264,6 @@ tasks.named('splitPackagesAudit').configure { // Joda should own its own packages! This should be a simple move. 'org.joda.time.format.StrictISODateTimeFormat', - // xcontent should not have common, all it's common packages should be renamed to xcontent - 'org.elasticsearch.common.xcontent.*', - 'org.elasticsearch.common.xcontent.support.XContentMapValues', - // cli is owned by the libs/cli, so these should be moved to o.e.server.cli 'org.elasticsearch.cli.CommandLoggingConfigurator', 'org.elasticsearch.cli.EnvironmentAwareCommand', diff --git a/server/src/internalClusterTest/java/org/elasticsearch/action/admin/cluster/allocation/ClusterAllocationExplainIT.java b/server/src/internalClusterTest/java/org/elasticsearch/action/admin/cluster/allocation/ClusterAllocationExplainIT.java index b9fe3f6f4a13b..1037624d0ffa1 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/action/admin/cluster/allocation/ClusterAllocationExplainIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/action/admin/cluster/allocation/ClusterAllocationExplainIT.java @@ -29,11 +29,11 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentParser.Token; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser.Token; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.test.ESIntegTestCase; import org.elasticsearch.test.InternalTestCluster; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/action/admin/cluster/node/tasks/TasksIT.java b/server/src/internalClusterTest/java/org/elasticsearch/action/admin/cluster/node/tasks/TasksIT.java index 2c1a92a798fb8..59052ab36e3dd 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/action/admin/cluster/node/tasks/TasksIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/action/admin/cluster/node/tasks/TasksIT.java @@ -38,7 +38,7 @@ import org.elasticsearch.core.Tuple; import org.elasticsearch.common.regex.Regex; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.search.builder.SearchSourceBuilder; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/action/admin/indices/create/CloneIndexIT.java b/server/src/internalClusterTest/java/org/elasticsearch/action/admin/indices/create/CloneIndexIT.java index 97c0832602532..a39e50c001e9b 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/action/admin/indices/create/CloneIndexIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/action/admin/indices/create/CloneIndexIT.java @@ -13,7 +13,7 @@ import org.elasticsearch.action.admin.indices.stats.IndicesStatsResponse; import org.elasticsearch.cluster.routing.allocation.decider.EnableAllocationDecider; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.query.TermsQueryBuilder; import org.elasticsearch.index.seqno.SeqNoStats; import org.elasticsearch.test.ESIntegTestCase; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/action/admin/indices/create/CreateIndexIT.java b/server/src/internalClusterTest/java/org/elasticsearch/action/admin/indices/create/CreateIndexIT.java index eaa2b5c7b86cc..0658302c5d029 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/action/admin/indices/create/CreateIndexIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/action/admin/indices/create/CreateIndexIT.java @@ -24,7 +24,7 @@ import org.elasticsearch.common.collect.ImmutableOpenMap; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.index.IndexService; import org.elasticsearch.index.mapper.MapperParsingException; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/action/admin/indices/create/CreateSystemIndicesIT.java b/server/src/internalClusterTest/java/org/elasticsearch/action/admin/indices/create/CreateSystemIndicesIT.java index b8f0935a4f625..e2c3d6acf0bda 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/action/admin/indices/create/CreateSystemIndicesIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/action/admin/indices/create/CreateSystemIndicesIT.java @@ -16,7 +16,7 @@ import org.elasticsearch.common.collect.ImmutableOpenMap; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.CollectionUtils; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.indices.TestSystemIndexDescriptor; import org.elasticsearch.indices.TestSystemIndexPlugin; import org.elasticsearch.plugins.Plugin; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/action/admin/indices/create/ShrinkIndexIT.java b/server/src/internalClusterTest/java/org/elasticsearch/action/admin/indices/create/ShrinkIndexIT.java index 3970095587932..3e98bb4f339d8 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/action/admin/indices/create/ShrinkIndexIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/action/admin/indices/create/ShrinkIndexIT.java @@ -40,7 +40,7 @@ import org.elasticsearch.common.collect.ImmutableOpenMap; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.Index; import org.elasticsearch.index.IndexService; import org.elasticsearch.index.engine.SegmentsStats; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/action/admin/indices/create/SplitIndexIT.java b/server/src/internalClusterTest/java/org/elasticsearch/action/admin/indices/create/SplitIndexIT.java index 2cf2f08edda98..ad63d7ad591ee 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/action/admin/indices/create/SplitIndexIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/action/admin/indices/create/SplitIndexIT.java @@ -36,7 +36,7 @@ import org.elasticsearch.cluster.routing.allocation.decider.EnableAllocationDecider; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.Index; import org.elasticsearch.index.IndexService; import org.elasticsearch.index.engine.SegmentsStats; @@ -55,7 +55,7 @@ import java.util.function.BiFunction; import java.util.stream.IntStream; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.nestedQuery; import static org.elasticsearch.index.query.QueryBuilders.termQuery; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/action/admin/indices/diskusage/IndexDiskUsageAnalyzerIT.java b/server/src/internalClusterTest/java/org/elasticsearch/action/admin/indices/diskusage/IndexDiskUsageAnalyzerIT.java index 05330a64356c8..1140433cef5f7 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/action/admin/indices/diskusage/IndexDiskUsageAnalyzerIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/action/admin/indices/diskusage/IndexDiskUsageAnalyzerIT.java @@ -12,8 +12,8 @@ import org.elasticsearch.action.support.PlainActionFuture; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.test.ESIntegTestCase; import static org.hamcrest.Matchers.equalTo; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/action/bulk/BulkIntegrationIT.java b/server/src/internalClusterTest/java/org/elasticsearch/action/bulk/BulkIntegrationIT.java index 1238e564d8ca8..f6231811c5aea 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/action/bulk/BulkIntegrationIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/action/bulk/BulkIntegrationIT.java @@ -21,8 +21,8 @@ import org.elasticsearch.action.support.replication.ReplicationRequest; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.ingest.IngestTestPlugin; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.rest.RestStatus; @@ -40,7 +40,7 @@ import static org.elasticsearch.action.DocWriteResponse.Result.CREATED; import static org.elasticsearch.action.DocWriteResponse.Result.UPDATED; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.test.StreamsUtils.copyToStringFromClasspath; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.hamcrest.Matchers.containsInAnyOrder; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/action/bulk/BulkProcessorClusterSettingsIT.java b/server/src/internalClusterTest/java/org/elasticsearch/action/bulk/BulkProcessorClusterSettingsIT.java index e39ac73d36c4c..1cf096e6a2163 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/action/bulk/BulkProcessorClusterSettingsIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/action/bulk/BulkProcessorClusterSettingsIT.java @@ -10,7 +10,7 @@ import org.elasticsearch.action.support.AutoCreateIndex; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.test.ESIntegTestCase; import org.elasticsearch.test.ESIntegTestCase.ClusterScope; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/action/bulk/BulkWithUpdatesIT.java b/server/src/internalClusterTest/java/org/elasticsearch/action/bulk/BulkWithUpdatesIT.java index a6a5ca5f2ac63..83ee9a9abfa49 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/action/bulk/BulkWithUpdatesIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/action/bulk/BulkWithUpdatesIT.java @@ -24,7 +24,7 @@ import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.VersionType; import org.elasticsearch.indices.IndexClosedException; import org.elasticsearch.plugins.Plugin; @@ -44,7 +44,7 @@ import java.util.concurrent.CyclicBarrier; import java.util.function.Function; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/action/ingest/AsyncIngestProcessorIT.java b/server/src/internalClusterTest/java/org/elasticsearch/action/ingest/AsyncIngestProcessorIT.java index 3394cea0b0197..6f245666e47e3 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/action/ingest/AsyncIngestProcessorIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/action/ingest/AsyncIngestProcessorIT.java @@ -18,8 +18,8 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.env.Environment; import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.ingest.AbstractProcessor; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/action/search/TransportSearchIT.java b/server/src/internalClusterTest/java/org/elasticsearch/action/search/TransportSearchIT.java index 2cde1c46a1bff..2313503feb2f9 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/action/search/TransportSearchIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/action/search/TransportSearchIT.java @@ -26,8 +26,8 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.concurrent.AtomicArray; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.query.RangeQueryBuilder; import org.elasticsearch.index.shard.IndexShard; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/action/support/WaitActiveShardCountIT.java b/server/src/internalClusterTest/java/org/elasticsearch/action/support/WaitActiveShardCountIT.java index f63a2f99f12a1..109b68018d13a 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/action/support/WaitActiveShardCountIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/action/support/WaitActiveShardCountIT.java @@ -14,7 +14,7 @@ import org.elasticsearch.cluster.health.ClusterHealthStatus; import org.elasticsearch.common.Priority; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.test.ESIntegTestCase; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/action/termvectors/GetTermVectorsIT.java b/server/src/internalClusterTest/java/org/elasticsearch/action/termvectors/GetTermVectorsIT.java index 0f99cf9e7d506..6e5fa8f054ef9 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/action/termvectors/GetTermVectorsIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/action/termvectors/GetTermVectorsIT.java @@ -22,8 +22,8 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.lucene.uid.Versions; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.engine.VersionConflictEngineException; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.test.MockKeywordPlugin; @@ -41,7 +41,7 @@ import java.util.concurrent.ExecutionException; import java.util.stream.Collectors; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertRequestBuilderThrows; import static org.hamcrest.Matchers.equalTo; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/aliases/IndexAliasesIT.java b/server/src/internalClusterTest/java/org/elasticsearch/aliases/IndexAliasesIT.java index b339348e07c62..a079c97db1843 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/aliases/IndexAliasesIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/aliases/IndexAliasesIT.java @@ -26,7 +26,7 @@ import org.elasticsearch.common.StopWatch; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.index.query.TermQueryBuilder; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/aliases/NetNewSystemIndexAliasIT.java b/server/src/internalClusterTest/java/org/elasticsearch/aliases/NetNewSystemIndexAliasIT.java index 2627e788ebb12..29e7289fc78e2 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/aliases/NetNewSystemIndexAliasIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/aliases/NetNewSystemIndexAliasIT.java @@ -16,7 +16,7 @@ import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.CollectionUtils; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.indices.SystemIndexDescriptor; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.plugins.SystemIndexPlugin; @@ -27,7 +27,7 @@ import java.util.Collection; import java.util.Collections; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.is; public class NetNewSystemIndexAliasIT extends ESIntegTestCase { diff --git a/server/src/internalClusterTest/java/org/elasticsearch/broadcast/BroadcastActionsIT.java b/server/src/internalClusterTest/java/org/elasticsearch/broadcast/BroadcastActionsIT.java index ba40c420bfe52..85b415de1ad93 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/broadcast/BroadcastActionsIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/broadcast/BroadcastActionsIT.java @@ -9,8 +9,8 @@ package org.elasticsearch.broadcast; import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.test.ESIntegTestCase; import java.io.IOException; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/cluster/NoMasterNodeIT.java b/server/src/internalClusterTest/java/org/elasticsearch/cluster/NoMasterNodeIT.java index 33733fd786148..143f47d86e623 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/cluster/NoMasterNodeIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/cluster/NoMasterNodeIT.java @@ -25,7 +25,7 @@ import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.discovery.MasterNotDiscoveredException; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.rest.RestStatus; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/cluster/SimpleClusterStateIT.java b/server/src/internalClusterTest/java/org/elasticsearch/cluster/SimpleClusterStateIT.java index 1ef53dbdc8d41..fc7a05e7f66e9 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/cluster/SimpleClusterStateIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/cluster/SimpleClusterStateIT.java @@ -29,9 +29,9 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.env.Environment; import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.index.IndexNotFoundException; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/cluster/SimpleDataNodesIT.java b/server/src/internalClusterTest/java/org/elasticsearch/cluster/SimpleDataNodesIT.java index fff14965114e7..dce3c1b9d68ff 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/cluster/SimpleDataNodesIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/cluster/SimpleDataNodesIT.java @@ -17,7 +17,7 @@ import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.common.Priority; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESIntegTestCase; import org.elasticsearch.test.ESIntegTestCase.ClusterScope; import org.elasticsearch.test.ESIntegTestCase.Scope; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/cluster/coordination/ZenDiscoveryIT.java b/server/src/internalClusterTest/java/org/elasticsearch/cluster/coordination/ZenDiscoveryIT.java index 0eedd99e498e3..fe44e007983c0 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/cluster/coordination/ZenDiscoveryIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/cluster/coordination/ZenDiscoveryIT.java @@ -20,9 +20,9 @@ import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.Priority; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.discovery.DiscoveryStats; import org.elasticsearch.test.ESIntegTestCase; import org.elasticsearch.test.TestCustomMetadata; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/cluster/metadata/TemplateUpgradeServiceIT.java b/server/src/internalClusterTest/java/org/elasticsearch/cluster/metadata/TemplateUpgradeServiceIT.java index c19c136b898c3..1f35f0e965522 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/cluster/metadata/TemplateUpgradeServiceIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/cluster/metadata/TemplateUpgradeServiceIT.java @@ -15,7 +15,7 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.env.Environment; import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.plugins.Plugin; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/cluster/routing/PrimaryAllocationIT.java b/server/src/internalClusterTest/java/org/elasticsearch/cluster/routing/PrimaryAllocationIT.java index f3c8087640314..aa087e034967e 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/cluster/routing/PrimaryAllocationIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/cluster/routing/PrimaryAllocationIT.java @@ -58,7 +58,7 @@ import static org.elasticsearch.cluster.metadata.IndexMetadata.SETTING_NUMBER_OF_REPLICAS; import static org.elasticsearch.cluster.metadata.IndexMetadata.SETTING_NUMBER_OF_SHARDS; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/discovery/ClusterDisruptionCleanSettingsIT.java b/server/src/internalClusterTest/java/org/elasticsearch/discovery/ClusterDisruptionCleanSettingsIT.java index ef14b014f5df8..c7d07eccedcc9 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/discovery/ClusterDisruptionCleanSettingsIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/discovery/ClusterDisruptionCleanSettingsIT.java @@ -11,7 +11,7 @@ import org.elasticsearch.action.index.IndexRequestBuilder; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.indices.store.IndicesStoreIntegrationIT; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.test.ESIntegTestCase; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/discovery/ClusterDisruptionIT.java b/server/src/internalClusterTest/java/org/elasticsearch/discovery/ClusterDisruptionIT.java index 5b664be2ec3b1..7c863f74168e8 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/discovery/ClusterDisruptionIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/discovery/ClusterDisruptionIT.java @@ -30,7 +30,7 @@ import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ConcurrentCollections; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.TimeValue; import org.elasticsearch.index.VersionType; import org.elasticsearch.index.shard.IndexShard; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/discovery/MasterDisruptionIT.java b/server/src/internalClusterTest/java/org/elasticsearch/discovery/MasterDisruptionIT.java index 33279e234d208..ecb9b9db673f0 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/discovery/MasterDisruptionIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/discovery/MasterDisruptionIT.java @@ -17,7 +17,7 @@ import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESIntegTestCase; import org.elasticsearch.test.disruption.BlockMasterServiceOnMaster; import org.elasticsearch.test.disruption.IntermittentLongGCDisruption; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/discovery/SnapshotDisruptionIT.java b/server/src/internalClusterTest/java/org/elasticsearch/discovery/SnapshotDisruptionIT.java index 9c7285d4eea2a..a3a58644d79fb 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/discovery/SnapshotDisruptionIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/discovery/SnapshotDisruptionIT.java @@ -20,7 +20,7 @@ import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.snapshots.AbstractSnapshotIntegTestCase; import org.elasticsearch.snapshots.SnapshotException; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/document/DocumentActionsIT.java b/server/src/internalClusterTest/java/org/elasticsearch/document/DocumentActionsIT.java index 770c1ec184cd2..4162dcbf0ad38 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/document/DocumentActionsIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/document/DocumentActionsIT.java @@ -20,9 +20,9 @@ import org.elasticsearch.action.support.WriteRequest.RefreshPolicy; import org.elasticsearch.cluster.health.ClusterHealthStatus; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESIntegTestCase; import org.elasticsearch.test.hamcrest.ElasticsearchAssertions; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/document/ShardInfoIT.java b/server/src/internalClusterTest/java/org/elasticsearch/document/ShardInfoIT.java index ec53a9269e243..dbfb3d3c42c87 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/document/ShardInfoIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/document/ShardInfoIT.java @@ -20,7 +20,7 @@ import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESIntegTestCase; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/env/NodeEnvironmentIT.java b/server/src/internalClusterTest/java/org/elasticsearch/env/NodeEnvironmentIT.java index 0fc7a9a03d942..2da9afe352958 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/env/NodeEnvironmentIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/env/NodeEnvironmentIT.java @@ -13,7 +13,7 @@ import org.elasticsearch.core.CheckedConsumer; import org.elasticsearch.core.PathUtils; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.gateway.PersistedClusterStateService; import org.elasticsearch.indices.IndicesService; import org.elasticsearch.test.ESIntegTestCase; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/explain/ExplainActionIT.java b/server/src/internalClusterTest/java/org/elasticsearch/explain/ExplainActionIT.java index 58bd94e7462fe..25396f8bcd431 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/explain/ExplainActionIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/explain/ExplainActionIT.java @@ -28,7 +28,7 @@ import java.util.Set; import static java.util.Collections.singleton; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.queryStringQuery; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.hamcrest.Matchers.equalTo; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/gateway/GatewayIndexStateIT.java b/server/src/internalClusterTest/java/org/elasticsearch/gateway/GatewayIndexStateIT.java index 34d2abb978f59..2f6c8cfe4fe4f 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/gateway/GatewayIndexStateIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/gateway/GatewayIndexStateIT.java @@ -33,7 +33,7 @@ import org.elasticsearch.core.CheckedConsumer; import org.elasticsearch.common.Priority; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.core.internal.io.IOUtils; import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.env.NodeMetadata; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/gateway/MetadataNodesIT.java b/server/src/internalClusterTest/java/org/elasticsearch/gateway/MetadataNodesIT.java index 6e54a70678f8f..d8dc1a66a6ef9 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/gateway/MetadataNodesIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/gateway/MetadataNodesIT.java @@ -26,7 +26,7 @@ import java.util.List; import java.util.Map; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.hamcrest.Matchers.equalTo; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/gateway/QuorumGatewayIT.java b/server/src/internalClusterTest/java/org/elasticsearch/gateway/QuorumGatewayIT.java index 194d96f645679..3879642efe503 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/gateway/QuorumGatewayIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/gateway/QuorumGatewayIT.java @@ -19,7 +19,7 @@ import java.util.concurrent.TimeUnit; import static org.elasticsearch.client.Requests.clusterHealthRequest; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/gateway/RecoveryFromGatewayIT.java b/server/src/internalClusterTest/java/org/elasticsearch/gateway/RecoveryFromGatewayIT.java index 2f6d5b542d186..7a20778a49809 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/gateway/RecoveryFromGatewayIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/gateway/RecoveryFromGatewayIT.java @@ -24,7 +24,7 @@ import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.index.Index; import org.elasticsearch.index.IndexService; @@ -60,7 +60,7 @@ import static org.elasticsearch.cluster.coordination.ClusterBootstrapService.INITIAL_MASTER_NODES_SETTING; import static org.elasticsearch.cluster.metadata.IndexMetadata.SETTING_NUMBER_OF_REPLICAS; import static org.elasticsearch.cluster.metadata.IndexMetadata.SETTING_NUMBER_OF_SHARDS; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.gateway.GatewayService.RECOVER_AFTER_DATA_NODES_SETTING; import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery; import static org.elasticsearch.index.query.QueryBuilders.termQuery; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/get/GetActionIT.java b/server/src/internalClusterTest/java/org/elasticsearch/get/GetActionIT.java index 2b13cb8da85e0..e230b1be5ea6a 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/get/GetActionIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/get/GetActionIT.java @@ -23,8 +23,8 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.lucene.uid.Versions; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.Nullable; import org.elasticsearch.index.IndexModule; import org.elasticsearch.index.engine.EngineTestCase; @@ -42,7 +42,7 @@ import java.util.Set; import static java.util.Collections.singleton; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.hamcrest.Matchers.endsWith; import static org.hamcrest.Matchers.equalTo; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/index/FinalPipelineIT.java b/server/src/internalClusterTest/java/org/elasticsearch/index/FinalPipelineIT.java index 57c2d6a05c7aa..0b2525bbf1148 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/index/FinalPipelineIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/index/FinalPipelineIT.java @@ -25,8 +25,8 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.env.Environment; import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.ingest.AbstractProcessor; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/index/IndexRequestBuilderIT.java b/server/src/internalClusterTest/java/org/elasticsearch/index/IndexRequestBuilderIT.java index 8646d18853242..a13f05682ce17 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/index/IndexRequestBuilderIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/index/IndexRequestBuilderIT.java @@ -12,7 +12,7 @@ import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.test.ESIntegTestCase; import org.elasticsearch.test.hamcrest.ElasticsearchAssertions; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/index/IndexSortIT.java b/server/src/internalClusterTest/java/org/elasticsearch/index/IndexSortIT.java index d4298784521ee..d00c9da2618b2 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/index/IndexSortIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/index/IndexSortIT.java @@ -13,12 +13,12 @@ import org.apache.lucene.search.SortedNumericSortField; import org.apache.lucene.search.SortedSetSortField; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.test.ESIntegTestCase; import java.io.IOException; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.containsString; public class IndexSortIT extends ESIntegTestCase { diff --git a/server/src/internalClusterTest/java/org/elasticsearch/index/SettingsListenerIT.java b/server/src/internalClusterTest/java/org/elasticsearch/index/SettingsListenerIT.java index 8233a98f6cb36..4ae2cb4018a33 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/index/SettingsListenerIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/index/SettingsListenerIT.java @@ -15,7 +15,7 @@ import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Setting.Property; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.env.Environment; import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.plugins.Plugin; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/index/engine/InternalEngineMergeIT.java b/server/src/internalClusterTest/java/org/elasticsearch/index/engine/InternalEngineMergeIT.java index 2dd4ff8ba3cd4..352112a474346 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/index/engine/InternalEngineMergeIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/index/engine/InternalEngineMergeIT.java @@ -17,7 +17,7 @@ import org.elasticsearch.test.ESIntegTestCase.ClusterScope; import org.elasticsearch.test.ESIntegTestCase.Scope; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures; import static org.hamcrest.Matchers.equalTo; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/index/engine/MaxDocsLimitIT.java b/server/src/internalClusterTest/java/org/elasticsearch/index/engine/MaxDocsLimitIT.java index 448b7dfe1b9c8..8fabba1205814 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/index/engine/MaxDocsLimitIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/index/engine/MaxDocsLimitIT.java @@ -14,7 +14,7 @@ import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.CollectionUtils; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.query.MatchAllQueryBuilder; import org.elasticsearch.index.translog.Translog; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/index/fielddata/FieldDataLoadingIT.java b/server/src/internalClusterTest/java/org/elasticsearch/index/fielddata/FieldDataLoadingIT.java index c63dd5913ec27..58dc3ee3c5a8e 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/index/fielddata/FieldDataLoadingIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/index/fielddata/FieldDataLoadingIT.java @@ -11,7 +11,7 @@ import org.elasticsearch.action.admin.cluster.stats.ClusterStatsResponse; import org.elasticsearch.test.ESIntegTestCase; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.hamcrest.Matchers.greaterThan; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/index/mapper/CopyToMapperIntegrationIT.java b/server/src/internalClusterTest/java/org/elasticsearch/index/mapper/CopyToMapperIntegrationIT.java index e5c9ca87b0ecd..a47c43a501f80 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/index/mapper/CopyToMapperIntegrationIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/index/mapper/CopyToMapperIntegrationIT.java @@ -10,8 +10,8 @@ import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.search.aggregations.AggregationBuilders; import org.elasticsearch.search.aggregations.Aggregator.SubAggCollectionMode; @@ -20,7 +20,7 @@ import java.io.IOException; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.hamcrest.Matchers.equalTo; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/index/mapper/DynamicMappingIT.java b/server/src/internalClusterTest/java/org/elasticsearch/index/mapper/DynamicMappingIT.java index 3dddead57ea98..71485e09ac455 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/index/mapper/DynamicMappingIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/index/mapper/DynamicMappingIT.java @@ -22,9 +22,9 @@ import org.elasticsearch.common.Randomness; import org.elasticsearch.common.geo.GeoPoint; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.TimeValue; import org.elasticsearch.index.query.GeoBoundingBoxQueryBuilder; import org.elasticsearch.index.query.MatchQueryBuilder; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/index/mapper/MultiFieldsIntegrationIT.java b/server/src/internalClusterTest/java/org/elasticsearch/index/mapper/MultiFieldsIntegrationIT.java index fd98c816d5f75..1ca888547764e 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/index/mapper/MultiFieldsIntegrationIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/index/mapper/MultiFieldsIntegrationIT.java @@ -13,8 +13,8 @@ import org.elasticsearch.cluster.metadata.MappingMetadata; import org.elasticsearch.common.geo.GeoPoint; import org.elasticsearch.common.unit.DistanceUnit; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.test.ESIntegTestCase; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/index/seqno/GlobalCheckpointSyncIT.java b/server/src/internalClusterTest/java/org/elasticsearch/index/seqno/GlobalCheckpointSyncIT.java index e5c854f5e696b..bd60297d49b3e 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/index/seqno/GlobalCheckpointSyncIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/index/seqno/GlobalCheckpointSyncIT.java @@ -13,7 +13,7 @@ import org.elasticsearch.cluster.node.DiscoveryNodes; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.IndexService; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.shard.IndexShard; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/index/shard/GlobalCheckpointListenersIT.java b/server/src/internalClusterTest/java/org/elasticsearch/index/shard/GlobalCheckpointListenersIT.java index 2bbb632249b80..f8103dc03acb5 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/index/shard/GlobalCheckpointListenersIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/index/shard/GlobalCheckpointListenersIT.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.IndexService; import org.elasticsearch.indices.IndicesService; import org.elasticsearch.test.ESSingleNodeTestCase; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/index/shard/IndexShardIT.java b/server/src/internalClusterTest/java/org/elasticsearch/index/shard/IndexShardIT.java index 28ece3f75fcf6..56f40b95bcb72 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/index/shard/IndexShardIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/index/shard/IndexShardIT.java @@ -37,7 +37,7 @@ import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.internal.io.IOUtils; import org.elasticsearch.env.Environment; import org.elasticsearch.env.NodeEnvironment; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/index/shard/SearchIdleIT.java b/server/src/internalClusterTest/java/org/elasticsearch/index/shard/SearchIdleIT.java index bd1bdc4673401..d9d4f2782a489 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/index/shard/SearchIdleIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/index/shard/SearchIdleIT.java @@ -14,7 +14,7 @@ import org.elasticsearch.action.index.IndexResponse; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.IndexService; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.test.ESSingleNodeTestCase; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/index/store/ExceptionRetryIT.java b/server/src/internalClusterTest/java/org/elasticsearch/index/store/ExceptionRetryIT.java index a21109e5f14e3..296cdedd53de8 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/index/store/ExceptionRetryIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/index/store/ExceptionRetryIT.java @@ -20,7 +20,7 @@ import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.client.Client; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.engine.SegmentsStats; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.search.SearchHit; @@ -38,7 +38,7 @@ import java.util.concurrent.atomic.AtomicBoolean; import java.util.stream.Collectors; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.termQuery; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/indices/DateMathIndexExpressionsIntegrationIT.java b/server/src/internalClusterTest/java/org/elasticsearch/indices/DateMathIndexExpressionsIntegrationIT.java index 96233067ed156..c8d419ea55985 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/indices/DateMathIndexExpressionsIntegrationIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/indices/DateMathIndexExpressionsIntegrationIT.java @@ -20,7 +20,7 @@ import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.metadata.IndexMetadata; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.test.ESIntegTestCase; import org.junit.Before; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/indices/SystemIndexManagerIT.java b/server/src/internalClusterTest/java/org/elasticsearch/indices/SystemIndexManagerIT.java index 2a576f3e19e7c..2279b94d08d65 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/indices/SystemIndexManagerIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/indices/SystemIndexManagerIT.java @@ -17,7 +17,7 @@ import org.elasticsearch.common.collect.ImmutableOpenMap; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.CollectionUtils; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.test.ESIntegTestCase; import org.junit.Before; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/indices/TestSystemIndexDescriptor.java b/server/src/internalClusterTest/java/org/elasticsearch/indices/TestSystemIndexDescriptor.java index 6c8dc221d0614..02627a49ffe95 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/indices/TestSystemIndexDescriptor.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/indices/TestSystemIndexDescriptor.java @@ -12,14 +12,14 @@ import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.io.UncheckedIOException; import java.util.List; import java.util.concurrent.atomic.AtomicBoolean; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; /** * A special kind of {@link SystemIndexDescriptor} that can toggle what kind of mappings it diff --git a/server/src/internalClusterTest/java/org/elasticsearch/indices/analysis/PreBuiltAnalyzerIntegrationIT.java b/server/src/internalClusterTest/java/org/elasticsearch/indices/analysis/PreBuiltAnalyzerIntegrationIT.java index 8099187a6c245..8e34c5c0c3c1d 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/indices/analysis/PreBuiltAnalyzerIntegrationIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/indices/analysis/PreBuiltAnalyzerIntegrationIT.java @@ -12,7 +12,7 @@ import org.apache.lucene.analysis.TokenStream; import org.elasticsearch.Version; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.test.ESIntegTestCase; import java.io.IOException; @@ -22,7 +22,7 @@ import java.util.Locale; import java.util.Map; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.test.VersionUtils.randomVersion; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.notNullValue; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/indices/flush/FlushIT.java b/server/src/internalClusterTest/java/org/elasticsearch/indices/flush/FlushIT.java index 00e1305f0727d..e61845eeb4fdd 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/indices/flush/FlushIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/indices/flush/FlushIT.java @@ -14,7 +14,7 @@ import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.common.ValidationException; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.IndexService; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.indices.IndexingMemoryController; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/indices/mapping/MalformedDynamicTemplateIT.java b/server/src/internalClusterTest/java/org/elasticsearch/indices/mapping/MalformedDynamicTemplateIT.java index 52d844d984c16..aecdc8b1efffe 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/indices/mapping/MalformedDynamicTemplateIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/indices/mapping/MalformedDynamicTemplateIT.java @@ -10,7 +10,7 @@ import org.elasticsearch.Version; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.mapper.MapperParsingException; import org.elasticsearch.test.ESIntegTestCase; import org.elasticsearch.test.VersionUtils; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/indices/mapping/SimpleGetFieldMappingsIT.java b/server/src/internalClusterTest/java/org/elasticsearch/indices/mapping/SimpleGetFieldMappingsIT.java index 18509d399c803..17dbf6d51a2a7 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/indices/mapping/SimpleGetFieldMappingsIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/indices/mapping/SimpleGetFieldMappingsIT.java @@ -11,10 +11,10 @@ import org.elasticsearch.action.admin.indices.mapping.get.GetFieldMappingsResponse; import org.elasticsearch.action.admin.indices.mapping.get.GetFieldMappingsResponse.FieldMappingMetadata; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.test.ESIntegTestCase; import org.elasticsearch.test.InternalSettingsPlugin; @@ -32,7 +32,7 @@ import static org.elasticsearch.cluster.metadata.IndexMetadata.SETTING_BLOCKS_READ; import static org.elasticsearch.cluster.metadata.IndexMetadata.SETTING_BLOCKS_WRITE; import static org.elasticsearch.cluster.metadata.IndexMetadata.SETTING_READ_ONLY; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertBlocked; import static org.hamcrest.Matchers.equalTo; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/indices/mapping/SimpleGetMappingsIT.java b/server/src/internalClusterTest/java/org/elasticsearch/indices/mapping/SimpleGetMappingsIT.java index af88064fc2969..714a358648de1 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/indices/mapping/SimpleGetMappingsIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/indices/mapping/SimpleGetMappingsIT.java @@ -12,7 +12,7 @@ import org.elasticsearch.action.admin.indices.mapping.get.GetMappingsResponse; import org.elasticsearch.cluster.metadata.MappingMetadata; import org.elasticsearch.common.Priority; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.test.ESIntegTestCase; import org.elasticsearch.test.InternalSettingsPlugin; @@ -27,7 +27,7 @@ import static org.elasticsearch.cluster.metadata.IndexMetadata.SETTING_BLOCKS_READ; import static org.elasticsearch.cluster.metadata.IndexMetadata.SETTING_BLOCKS_WRITE; import static org.elasticsearch.cluster.metadata.IndexMetadata.SETTING_READ_ONLY; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertBlocked; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.notNullValue; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/indices/mapping/UpdateMappingIntegrationIT.java b/server/src/internalClusterTest/java/org/elasticsearch/indices/mapping/UpdateMappingIntegrationIT.java index 64edd111947b9..532c124a51b8a 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/indices/mapping/UpdateMappingIntegrationIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/indices/mapping/UpdateMappingIntegrationIT.java @@ -19,8 +19,8 @@ import org.elasticsearch.common.Priority; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.index.IndexService; import org.elasticsearch.index.mapper.MappedFieldType; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/indices/memory/breaker/CircuitBreakerServiceIT.java b/server/src/internalClusterTest/java/org/elasticsearch/indices/memory/breaker/CircuitBreakerServiceIT.java index c008a26e1ce3d..db2e595a39636 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/indices/memory/breaker/CircuitBreakerServiceIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/indices/memory/breaker/CircuitBreakerServiceIT.java @@ -29,7 +29,7 @@ import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.indices.breaker.CircuitBreakerStats; import org.elasticsearch.indices.breaker.HierarchyCircuitBreakerService; import org.elasticsearch.rest.RestStatus; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/indices/memory/breaker/RandomExceptionCircuitBreakerIT.java b/server/src/internalClusterTest/java/org/elasticsearch/indices/memory/breaker/RandomExceptionCircuitBreakerIT.java index a7f3df3812bca..ed8f3d17f8a4d 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/indices/memory/breaker/RandomExceptionCircuitBreakerIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/indices/memory/breaker/RandomExceptionCircuitBreakerIT.java @@ -24,7 +24,7 @@ import org.elasticsearch.common.settings.Setting.Property; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.index.MockEngineFactoryPlugin; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.indices.IndicesService; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/indices/recovery/IndexRecoveryIT.java b/server/src/internalClusterTest/java/org/elasticsearch/indices/recovery/IndexRecoveryIT.java index 8011f48ef80bd..ea4efd251a7ab 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/indices/recovery/IndexRecoveryIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/indices/recovery/IndexRecoveryIT.java @@ -55,7 +55,7 @@ import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.common.util.concurrent.EsRejectedExecutionException; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.TimeValue; import org.elasticsearch.gateway.ReplicaShardAllocatorIT; import org.elasticsearch.index.Index; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/indices/recovery/SnapshotBasedIndexRecoveryIT.java b/server/src/internalClusterTest/java/org/elasticsearch/indices/recovery/SnapshotBasedIndexRecoveryIT.java index 4d5bf8cd0d01e..cea75951bee63 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/indices/recovery/SnapshotBasedIndexRecoveryIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/indices/recovery/SnapshotBasedIndexRecoveryIT.java @@ -28,7 +28,7 @@ import org.elasticsearch.common.blobstore.support.FilterBlobContainer; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.BigArrays; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.env.Environment; import org.elasticsearch.index.IndexService; import org.elasticsearch.index.MergePolicyConfig; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/indices/recovery/plan/ShardSnapshotsServiceIT.java b/server/src/internalClusterTest/java/org/elasticsearch/indices/recovery/plan/ShardSnapshotsServiceIT.java index dad74ec7607c7..2828c786bc877 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/indices/recovery/plan/ShardSnapshotsServiceIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/indices/recovery/plan/ShardSnapshotsServiceIT.java @@ -17,7 +17,7 @@ import org.elasticsearch.common.blobstore.BlobContainer; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.BigArrays; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.core.Tuple; import org.elasticsearch.env.Environment; import org.elasticsearch.index.shard.ShardId; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/indices/settings/UpdateNumberOfReplicasIT.java b/server/src/internalClusterTest/java/org/elasticsearch/indices/settings/UpdateNumberOfReplicasIT.java index f94891fb6045f..dd7f4eff2fd66 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/indices/settings/UpdateNumberOfReplicasIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/indices/settings/UpdateNumberOfReplicasIT.java @@ -21,7 +21,7 @@ import java.io.IOException; import java.util.EnumSet; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/indices/state/OpenCloseIndexIT.java b/server/src/internalClusterTest/java/org/elasticsearch/indices/state/OpenCloseIndexIT.java index 62e9821ba5733..c87365fa7910e 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/indices/state/OpenCloseIndexIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/indices/state/OpenCloseIndexIT.java @@ -21,7 +21,7 @@ import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.rest.RestStatus; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/indices/stats/IndexStatsIT.java b/server/src/internalClusterTest/java/org/elasticsearch/indices/stats/IndexStatsIT.java index 0bc80c26c9a35..c0d94a7dcc08d 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/indices/stats/IndexStatsIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/indices/stats/IndexStatsIT.java @@ -37,7 +37,7 @@ import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.IndexModule; import org.elasticsearch.index.IndexService; import org.elasticsearch.index.IndexSettings; @@ -80,7 +80,7 @@ import java.util.concurrent.atomic.AtomicReference; import static org.elasticsearch.cluster.metadata.IndexMetadata.SETTING_NUMBER_OF_REPLICAS; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAllSuccessful; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/indices/template/ComposableTemplateIT.java b/server/src/internalClusterTest/java/org/elasticsearch/indices/template/ComposableTemplateIT.java index b0e9e02fb5370..b3d05e7b38f2e 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/indices/template/ComposableTemplateIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/indices/template/ComposableTemplateIT.java @@ -16,8 +16,8 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.compress.CompressedXContent; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESIntegTestCase; import java.io.IOException; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/indices/template/IndexTemplateBlocksIT.java b/server/src/internalClusterTest/java/org/elasticsearch/indices/template/IndexTemplateBlocksIT.java index 268f9b7c3edc5..947997f615c66 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/indices/template/IndexTemplateBlocksIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/indices/template/IndexTemplateBlocksIT.java @@ -10,7 +10,7 @@ import org.elasticsearch.action.admin.indices.alias.Alias; import org.elasticsearch.action.admin.indices.template.get.GetIndexTemplatesResponse; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.test.ESIntegTestCase; import org.elasticsearch.test.ESIntegTestCase.ClusterScope; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/indices/template/SimpleIndexTemplateIT.java b/server/src/internalClusterTest/java/org/elasticsearch/indices/template/SimpleIndexTemplateIT.java index 8f16483640ee9..d9426b99ae182 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/indices/template/SimpleIndexTemplateIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/indices/template/SimpleIndexTemplateIT.java @@ -21,8 +21,8 @@ import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.mapper.MapperParsingException; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.indices.InvalidAliasNameException; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/ingest/IngestClientIT.java b/server/src/internalClusterTest/java/org/elasticsearch/ingest/IngestClientIT.java index d20b1950a6fce..1aecd1fbbbb88 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/ingest/IngestClientIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/ingest/IngestClientIT.java @@ -28,8 +28,8 @@ import org.elasticsearch.client.Requests; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.test.ESIntegTestCase; @@ -38,7 +38,7 @@ import java.util.List; import java.util.Map; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.test.NodeRoles.nonIngestNode; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.instanceOf; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/ingest/IngestProcessorNotInstalledOnAllNodesIT.java b/server/src/internalClusterTest/java/org/elasticsearch/ingest/IngestProcessorNotInstalledOnAllNodesIT.java index c3f14bd672d23..cfbd456a79139 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/ingest/IngestProcessorNotInstalledOnAllNodesIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/ingest/IngestProcessorNotInstalledOnAllNodesIT.java @@ -11,7 +11,7 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.action.support.master.AcknowledgedResponse; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.node.NodeService; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.test.ESIntegTestCase; @@ -21,7 +21,7 @@ import java.util.Collection; import java.util.Collections; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/mget/SimpleMgetIT.java b/server/src/internalClusterTest/java/org/elasticsearch/mget/SimpleMgetIT.java index fddd251b763ec..1547ca6c8497e 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/mget/SimpleMgetIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/mget/SimpleMgetIT.java @@ -16,7 +16,7 @@ import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.search.fetch.subphase.FetchSourceContext; import org.elasticsearch.test.ESIntegTestCase; @@ -24,7 +24,7 @@ import java.util.Map; import static org.elasticsearch.action.support.WriteRequest.RefreshPolicy.IMMEDIATE; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/persistent/PersistentTaskInitializationFailureIT.java b/server/src/internalClusterTest/java/org/elasticsearch/persistent/PersistentTaskInitializationFailureIT.java index 6be82b4a4bedd..0c9f02a79dbcb 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/persistent/PersistentTaskInitializationFailureIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/persistent/PersistentTaskInitializationFailureIT.java @@ -19,7 +19,7 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.SettingsModule; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.plugins.PersistentTaskPlugin; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.tasks.TaskId; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/recovery/RelocationIT.java b/server/src/internalClusterTest/java/org/elasticsearch/recovery/RelocationIT.java index 874d26cf96374..a289bc9c7b5b8 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/recovery/RelocationIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/recovery/RelocationIT.java @@ -33,7 +33,7 @@ import org.elasticsearch.common.Priority; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.index.IndexService; import org.elasticsearch.index.IndexSettings; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/recovery/SimpleRecoveryIT.java b/server/src/internalClusterTest/java/org/elasticsearch/recovery/SimpleRecoveryIT.java index 7f9b0d3a6f4a0..26da1657631f5 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/recovery/SimpleRecoveryIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/recovery/SimpleRecoveryIT.java @@ -12,7 +12,7 @@ import org.elasticsearch.action.admin.indices.refresh.RefreshResponse; import org.elasticsearch.action.get.GetResponse; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESIntegTestCase; import static org.elasticsearch.client.Requests.flushRequest; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/routing/AliasRoutingIT.java b/server/src/internalClusterTest/java/org/elasticsearch/routing/AliasRoutingIT.java index c1542ae090e09..05b97022f2213 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/routing/AliasRoutingIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/routing/AliasRoutingIT.java @@ -15,7 +15,7 @@ import org.elasticsearch.client.Requests; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.test.ESIntegTestCase; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/routing/SimpleRoutingIT.java b/server/src/internalClusterTest/java/org/elasticsearch/routing/SimpleRoutingIT.java index eec13f14dba66..2293dbd6801ef 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/routing/SimpleRoutingIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/routing/SimpleRoutingIT.java @@ -29,7 +29,7 @@ import org.elasticsearch.cluster.routing.OperationRouting; import org.elasticsearch.common.settings.ClusterSettings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.rest.RestStatus; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/script/StoredScriptsIT.java b/server/src/internalClusterTest/java/org/elasticsearch/script/StoredScriptsIT.java index b1615cd04003b..c8e6f7e34210a 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/script/StoredScriptsIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/script/StoredScriptsIT.java @@ -9,7 +9,7 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.test.ESIntegTestCase; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/CombiIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/CombiIT.java index 4f54de00d454f..c7d814d7be047 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/CombiIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/CombiIT.java @@ -22,11 +22,11 @@ import java.util.List; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.search.aggregations.AggregationBuilders.histogram; import static org.elasticsearch.search.aggregations.AggregationBuilders.missing; import static org.elasticsearch.search.aggregations.AggregationBuilders.terms; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.core.IsNull.notNullValue; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/EquivalenceIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/EquivalenceIT.java index 338d4ae8a7d46..92834078dc86d 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/EquivalenceIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/EquivalenceIT.java @@ -14,7 +14,6 @@ import org.elasticsearch.action.search.SearchRequestBuilder; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.action.support.IndicesOptions; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.index.query.RangeQueryBuilder; import org.elasticsearch.plugins.Plugin; @@ -31,6 +30,7 @@ import org.elasticsearch.search.aggregations.bucket.terms.TermsAggregatorFactory; import org.elasticsearch.search.aggregations.metrics.Sum; import org.elasticsearch.test.ESIntegTestCase; +import org.elasticsearch.xcontent.XContentBuilder; import org.junit.After; import org.junit.Before; @@ -43,7 +43,6 @@ import java.util.Map; import java.util.function.Function; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.search.aggregations.AggregationBuilders.extendedStats; import static org.elasticsearch.search.aggregations.AggregationBuilders.filter; import static org.elasticsearch.search.aggregations.AggregationBuilders.histogram; @@ -57,6 +56,7 @@ import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAllSuccessful; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.core.IsNull.notNullValue; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/FiltersAggsRewriteIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/FiltersAggsRewriteIT.java index d8cc4537f1f01..fe51f4a1e2fb4 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/FiltersAggsRewriteIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/FiltersAggsRewriteIT.java @@ -11,14 +11,14 @@ import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.index.query.WrapperQueryBuilder; import org.elasticsearch.search.aggregations.bucket.filter.FiltersAggregationBuilder; import org.elasticsearch.search.aggregations.bucket.filter.FiltersAggregator; import org.elasticsearch.search.aggregations.bucket.filter.InternalFilters; import org.elasticsearch.test.ESSingleNodeTestCase; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.util.HashMap; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/MetadataIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/MetadataIT.java index 1e7fe6be8f7f7..95f85226c271a 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/MetadataIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/MetadataIT.java @@ -19,12 +19,12 @@ import java.util.List; import java.util.Map; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.search.aggregations.AggregationBuilders.sum; import static org.elasticsearch.search.aggregations.AggregationBuilders.terms; import static org.elasticsearch.search.aggregations.PipelineAggregatorBuilders.maxBucket; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; public class MetadataIT extends ESIntegTestCase { diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/AdjacencyMatrixIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/AdjacencyMatrixIT.java index 70d90c48d3bd3..1a95ec98b0087 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/AdjacencyMatrixIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/AdjacencyMatrixIT.java @@ -13,7 +13,6 @@ import org.elasticsearch.action.search.SearchPhaseExecutionException; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.index.query.BoolQueryBuilder; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.search.SearchModule; @@ -23,19 +22,20 @@ import org.elasticsearch.search.aggregations.bucket.histogram.Histogram; import org.elasticsearch.search.aggregations.metrics.Avg; import org.elasticsearch.test.ESIntegTestCase; +import org.elasticsearch.xcontent.XContentBuilder; import org.hamcrest.Matchers; import java.util.ArrayList; import java.util.HashMap; import java.util.List; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery; import static org.elasticsearch.index.query.QueryBuilders.termQuery; import static org.elasticsearch.search.aggregations.AggregationBuilders.adjacencyMatrix; import static org.elasticsearch.search.aggregations.AggregationBuilders.avg; import static org.elasticsearch.search.aggregations.AggregationBuilders.histogram; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.greaterThanOrEqualTo; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/BooleanTermsIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/BooleanTermsIT.java index ad9574b1d7c53..bc0cb683780ec 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/BooleanTermsIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/BooleanTermsIT.java @@ -13,9 +13,9 @@ import org.elasticsearch.search.aggregations.bucket.terms.Terms; import org.elasticsearch.test.ESIntegTestCase; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.search.aggregations.AggregationBuilders.terms; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.core.IsNull.notNullValue; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/DateHistogramIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/DateHistogramIT.java index 17802313e0af8..cb2bf993a6d2c 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/DateHistogramIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/DateHistogramIT.java @@ -53,7 +53,6 @@ import java.util.Map; import java.util.concurrent.ExecutionException; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery; import static org.elasticsearch.search.aggregations.AggregationBuilders.avg; import static org.elasticsearch.search.aggregations.AggregationBuilders.dateHistogram; @@ -64,6 +63,7 @@ import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchHits; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; import static org.hamcrest.core.IsNull.notNullValue; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/DateHistogramOffsetIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/DateHistogramOffsetIT.java index 7c2c6128717a4..40ff2d25e433c 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/DateHistogramOffsetIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/DateHistogramOffsetIT.java @@ -23,9 +23,9 @@ import java.time.ZonedDateTime; import java.util.List; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery; import static org.elasticsearch.search.aggregations.AggregationBuilders.dateHistogram; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.core.IsNull.notNullValue; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/DateRangeIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/DateRangeIT.java index bba29ac405a84..e2be4c85d567e 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/DateRangeIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/DateRangeIT.java @@ -37,13 +37,13 @@ import java.util.Locale; import java.util.Map; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery; import static org.elasticsearch.search.aggregations.AggregationBuilders.dateRange; import static org.elasticsearch.search.aggregations.AggregationBuilders.histogram; import static org.elasticsearch.search.aggregations.AggregationBuilders.sum; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.instanceOf; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/DoubleTermsIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/DoubleTermsIT.java index df7d96c379d0e..961add08e718f 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/DoubleTermsIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/DoubleTermsIT.java @@ -44,7 +44,6 @@ import java.util.Set; import java.util.function.Function; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.functionScoreQuery; import static org.elasticsearch.index.query.functionscore.ScoreFunctionBuilders.scriptFunction; import static org.elasticsearch.search.aggregations.AggregationBuilders.avg; @@ -56,6 +55,7 @@ import static org.elasticsearch.search.aggregations.AggregationBuilders.terms; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.instanceOf; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/FilterIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/FilterIT.java index 3b66b224717c3..4d799cbbea6b5 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/FilterIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/FilterIT.java @@ -10,7 +10,6 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.action.index.IndexRequestBuilder; import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.index.query.BoolQueryBuilder; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.search.aggregations.InternalAggregation; @@ -18,18 +17,19 @@ import org.elasticsearch.search.aggregations.bucket.histogram.Histogram; import org.elasticsearch.search.aggregations.metrics.Avg; import org.elasticsearch.test.ESIntegTestCase; +import org.elasticsearch.xcontent.XContentBuilder; import org.hamcrest.Matchers; import java.util.ArrayList; import java.util.List; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery; import static org.elasticsearch.index.query.QueryBuilders.termQuery; import static org.elasticsearch.search.aggregations.AggregationBuilders.avg; import static org.elasticsearch.search.aggregations.AggregationBuilders.filter; import static org.elasticsearch.search.aggregations.AggregationBuilders.histogram; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.greaterThanOrEqualTo; import static org.hamcrest.Matchers.is; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/FiltersIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/FiltersIT.java index bbf2806673004..68acd22ce6c55 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/FiltersIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/FiltersIT.java @@ -11,7 +11,6 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.action.index.IndexRequestBuilder; import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.index.query.BoolQueryBuilder; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.search.aggregations.InternalAggregation; @@ -20,6 +19,7 @@ import org.elasticsearch.search.aggregations.bucket.histogram.Histogram; import org.elasticsearch.search.aggregations.metrics.Avg; import org.elasticsearch.test.ESIntegTestCase; +import org.elasticsearch.xcontent.XContentBuilder; import org.hamcrest.Matchers; import java.util.ArrayList; @@ -29,13 +29,13 @@ import java.util.Iterator; import java.util.List; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery; import static org.elasticsearch.index.query.QueryBuilders.termQuery; import static org.elasticsearch.search.aggregations.AggregationBuilders.avg; import static org.elasticsearch.search.aggregations.AggregationBuilders.filters; import static org.elasticsearch.search.aggregations.AggregationBuilders.histogram; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.greaterThanOrEqualTo; import static org.hamcrest.Matchers.is; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/GeoDistanceIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/GeoDistanceIT.java index 8e0dd0ba6638c..4755d5b2bfece 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/GeoDistanceIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/GeoDistanceIT.java @@ -15,7 +15,6 @@ import org.elasticsearch.common.geo.GeoPoint; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.DistanceUnit; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.aggregations.Aggregator.SubAggCollectionMode; import org.elasticsearch.search.aggregations.InternalAggregation; import org.elasticsearch.search.aggregations.bucket.histogram.Histogram; @@ -24,6 +23,7 @@ import org.elasticsearch.search.aggregations.bucket.terms.Terms; import org.elasticsearch.test.ESIntegTestCase; import org.elasticsearch.test.VersionUtils; +import org.elasticsearch.xcontent.XContentBuilder; import org.hamcrest.Matchers; import java.util.ArrayList; @@ -32,12 +32,12 @@ import java.util.List; import java.util.Set; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery; import static org.elasticsearch.search.aggregations.AggregationBuilders.geoDistance; import static org.elasticsearch.search.aggregations.AggregationBuilders.histogram; import static org.elasticsearch.search.aggregations.AggregationBuilders.terms; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.instanceOf; import static org.hamcrest.Matchers.is; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/GeoHashGridIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/GeoHashGridIT.java index f7f4bd7794460..f19331250929f 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/GeoHashGridIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/GeoHashGridIT.java @@ -17,7 +17,6 @@ import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.common.geo.GeoPoint; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.index.query.GeoBoundingBoxQueryBuilder; import org.elasticsearch.search.aggregations.AggregationBuilders; import org.elasticsearch.search.aggregations.InternalAggregation; @@ -26,6 +25,7 @@ import org.elasticsearch.search.aggregations.bucket.geogrid.GeoGrid.Bucket; import org.elasticsearch.test.ESIntegTestCase; import org.elasticsearch.test.VersionUtils; +import org.elasticsearch.xcontent.XContentBuilder; import java.util.ArrayList; import java.util.Arrays; @@ -34,12 +34,12 @@ import java.util.Random; import java.util.Set; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.geometry.utils.Geohash.PRECISION; import static org.elasticsearch.geometry.utils.Geohash.stringEncode; import static org.elasticsearch.search.aggregations.AggregationBuilders.geohashGrid; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/GlobalIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/GlobalIT.java index 417bf7f9d382f..1ccb47a8517c4 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/GlobalIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/GlobalIT.java @@ -19,10 +19,10 @@ import java.util.ArrayList; import java.util.List; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.search.aggregations.AggregationBuilders.global; import static org.elasticsearch.search.aggregations.AggregationBuilders.stats; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.sameInstance; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/HistogramIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/HistogramIT.java index 940b325c16991..bdbe95160bee1 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/HistogramIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/HistogramIT.java @@ -43,7 +43,6 @@ import java.util.function.Function; import static java.util.Collections.emptyMap; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery; import static org.elasticsearch.search.aggregations.AggregationBuilders.avg; import static org.elasticsearch.search.aggregations.AggregationBuilders.filter; @@ -53,6 +52,7 @@ import static org.elasticsearch.search.aggregations.AggregationBuilders.sum; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.greaterThanOrEqualTo; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/LongTermsIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/LongTermsIT.java index f0e6fbde555e2..ba30077a44949 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/LongTermsIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/LongTermsIT.java @@ -44,7 +44,6 @@ import java.util.Set; import java.util.function.Function; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.search.aggregations.AggregationBuilders.avg; import static org.elasticsearch.search.aggregations.AggregationBuilders.extendedStats; import static org.elasticsearch.search.aggregations.AggregationBuilders.filter; @@ -54,6 +53,7 @@ import static org.elasticsearch.search.aggregations.AggregationBuilders.terms; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.instanceOf; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/MinDocCountIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/MinDocCountIT.java index 5018e8f300a29..f92aee48e8363 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/MinDocCountIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/MinDocCountIT.java @@ -46,12 +46,12 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.search.aggregations.AggregationBuilders.dateHistogram; import static org.elasticsearch.search.aggregations.AggregationBuilders.histogram; import static org.elasticsearch.search.aggregations.AggregationBuilders.terms; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAllSuccessful; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; @ESIntegTestCase.SuiteScopeTestCase public class MinDocCountIT extends AbstractTermsTestCase { diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/NaNSortingIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/NaNSortingIT.java index a072d2ae4a10b..076d431922ad8 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/NaNSortingIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/NaNSortingIT.java @@ -10,7 +10,6 @@ import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.common.util.Comparators; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.aggregations.Aggregation; import org.elasticsearch.search.aggregations.Aggregator.SubAggCollectionMode; import org.elasticsearch.search.aggregations.BucketOrder; @@ -23,14 +22,15 @@ import org.elasticsearch.search.aggregations.support.ValuesSource; import org.elasticsearch.search.aggregations.support.ValuesSourceAggregationBuilder; import org.elasticsearch.test.ESIntegTestCase; +import org.elasticsearch.xcontent.XContentBuilder; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.search.aggregations.AggregationBuilders.avg; import static org.elasticsearch.search.aggregations.AggregationBuilders.extendedStats; import static org.elasticsearch.search.aggregations.AggregationBuilders.histogram; import static org.elasticsearch.search.aggregations.AggregationBuilders.terms; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.core.IsNull.notNullValue; @ESIntegTestCase.SuiteScopeTestCase diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/NestedIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/NestedIT.java index d12e572c9da6c..7441378c2aa4a 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/NestedIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/NestedIT.java @@ -13,8 +13,6 @@ import org.elasticsearch.action.search.SearchRequestBuilder; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.index.query.InnerHitBuilder; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.search.aggregations.Aggregator.SubAggCollectionMode; @@ -30,6 +28,8 @@ import org.elasticsearch.search.aggregations.metrics.Stats; import org.elasticsearch.search.aggregations.metrics.Sum; import org.elasticsearch.test.ESIntegTestCase; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.hamcrest.Matchers; import java.util.ArrayList; @@ -37,7 +37,6 @@ import static org.elasticsearch.cluster.metadata.IndexMetadata.SETTING_NUMBER_OF_REPLICAS; import static org.elasticsearch.cluster.metadata.IndexMetadata.SETTING_NUMBER_OF_SHARDS; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.boolQuery; import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery; import static org.elasticsearch.index.query.QueryBuilders.nestedQuery; @@ -54,6 +53,7 @@ import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/RangeIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/RangeIT.java index b5aba9e4113c0..1010d03468187 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/RangeIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/RangeIT.java @@ -34,7 +34,6 @@ import java.util.Map; import java.util.function.Function; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery; import static org.elasticsearch.search.aggregations.AggregationBuilders.histogram; import static org.elasticsearch.search.aggregations.AggregationBuilders.range; @@ -42,6 +41,7 @@ import static org.elasticsearch.search.aggregations.AggregationBuilders.terms; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.instanceOf; import static org.hamcrest.Matchers.is; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/ReverseNestedIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/ReverseNestedIT.java index 20b6f761b0ec4..b9103daac144e 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/ReverseNestedIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/ReverseNestedIT.java @@ -10,7 +10,6 @@ import org.elasticsearch.action.search.SearchPhaseExecutionException; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.aggregations.Aggregator.SubAggCollectionMode; import org.elasticsearch.search.aggregations.BucketOrder; import org.elasticsearch.search.aggregations.InternalAggregation; @@ -20,6 +19,7 @@ import org.elasticsearch.search.aggregations.bucket.terms.Terms; import org.elasticsearch.search.aggregations.metrics.ValueCount; import org.elasticsearch.test.ESIntegTestCase; +import org.elasticsearch.xcontent.XContentBuilder; import java.util.ArrayList; import java.util.Arrays; @@ -28,7 +28,6 @@ import static org.elasticsearch.action.support.WriteRequest.RefreshPolicy.IMMEDIATE; import static org.elasticsearch.cluster.metadata.IndexMetadata.SETTING_NUMBER_OF_REPLICAS; import static org.elasticsearch.cluster.metadata.IndexMetadata.SETTING_NUMBER_OF_SHARDS; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery; import static org.elasticsearch.index.query.QueryBuilders.termQuery; import static org.elasticsearch.search.aggregations.AggregationBuilders.count; @@ -40,6 +39,7 @@ import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.sameInstance; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/ShardReduceIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/ShardReduceIT.java index e182852f461c3..1dba19319efc2 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/ShardReduceIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/ShardReduceIT.java @@ -23,7 +23,6 @@ import org.elasticsearch.search.aggregations.bucket.terms.Terms; import org.elasticsearch.test.ESIntegTestCase; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.search.aggregations.AggregationBuilders.dateHistogram; import static org.elasticsearch.search.aggregations.AggregationBuilders.dateRange; import static org.elasticsearch.search.aggregations.AggregationBuilders.filter; @@ -38,6 +37,7 @@ import static org.elasticsearch.search.aggregations.AggregationBuilders.terms; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.equalTo; /** diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/SignificantTermsSignificanceScoreIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/SignificantTermsSignificanceScoreIT.java index 1aa729a7119c8..adc5651cc728a 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/SignificantTermsSignificanceScoreIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/SignificantTermsSignificanceScoreIT.java @@ -12,10 +12,6 @@ import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.plugins.Plugin; @@ -38,6 +34,10 @@ import org.elasticsearch.search.aggregations.bucket.terms.heuristic.SignificanceHeuristic; import org.elasticsearch.test.ESIntegTestCase; import org.elasticsearch.test.search.aggregations.bucket.SharedSignificantTermsTestMethods; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/TermsDocCountErrorIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/TermsDocCountErrorIT.java index c22d38e3f79e8..230a7284e3cab 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/TermsDocCountErrorIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/TermsDocCountErrorIT.java @@ -25,11 +25,11 @@ import java.util.List; import java.util.Map; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.search.aggregations.AggregationBuilders.sum; import static org.elasticsearch.search.aggregations.AggregationBuilders.terms; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.anyOf; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.greaterThanOrEqualTo; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/TermsShardMinDocCountIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/TermsShardMinDocCountIT.java index 4a431fbf48b40..4e5e118340c08 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/TermsShardMinDocCountIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/TermsShardMinDocCountIT.java @@ -10,7 +10,6 @@ import org.elasticsearch.action.index.IndexRequestBuilder; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.search.aggregations.BucketOrder; import org.elasticsearch.search.aggregations.bucket.filter.InternalFilter; @@ -18,6 +17,7 @@ import org.elasticsearch.search.aggregations.bucket.terms.SignificantTermsAggregatorFactory; import org.elasticsearch.search.aggregations.bucket.terms.Terms; import org.elasticsearch.test.ESIntegTestCase; +import org.elasticsearch.xcontent.XContentType; import java.util.ArrayList; import java.util.List; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/terms/RareTermsIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/terms/RareTermsIT.java index 252a9e39f8cae..02d16804198dd 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/terms/RareTermsIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/terms/RareTermsIT.java @@ -14,8 +14,8 @@ import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.test.ESSingleNodeTestCase; +import org.elasticsearch.xcontent.XContentType; import org.hamcrest.Matchers; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/terms/StringTermsIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/terms/StringTermsIT.java index 370f9301a9ca3..3735537c3fa36 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/terms/StringTermsIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/terms/StringTermsIT.java @@ -13,9 +13,6 @@ import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.index.fielddata.ScriptDocValues; import org.elasticsearch.index.mapper.IndexFieldMapper; import org.elasticsearch.index.query.QueryBuilders; @@ -36,6 +33,9 @@ import org.elasticsearch.search.aggregations.support.ValueType; import org.elasticsearch.search.builder.SearchSourceBuilder; import org.elasticsearch.test.ESIntegTestCase; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.junit.After; import org.junit.Before; @@ -52,7 +52,6 @@ import java.util.Set; import java.util.function.Function; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.termQuery; import static org.elasticsearch.search.aggregations.AggregationBuilders.avg; import static org.elasticsearch.search.aggregations.AggregationBuilders.extendedStats; @@ -62,6 +61,7 @@ import static org.elasticsearch.search.aggregations.AggregationBuilders.terms; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.instanceOf; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/CardinalityIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/CardinalityIT.java index f700cf7456d1b..6777071b749fa 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/CardinalityIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/CardinalityIT.java @@ -29,13 +29,13 @@ import java.util.function.Function; import static java.util.Collections.emptyMap; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery; import static org.elasticsearch.search.aggregations.AggregationBuilders.cardinality; import static org.elasticsearch.search.aggregations.AggregationBuilders.global; import static org.elasticsearch.search.aggregations.AggregationBuilders.terms; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.greaterThan; import static org.hamcrest.Matchers.notNullValue; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/MedianAbsoluteDeviationIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/MedianAbsoluteDeviationIT.java index ba66cd18d53ad..afc127c9bfd25 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/MedianAbsoluteDeviationIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/MedianAbsoluteDeviationIT.java @@ -36,7 +36,6 @@ import static java.util.Collections.emptyMap; import static org.elasticsearch.cluster.metadata.IndexMetadata.SETTING_NUMBER_OF_REPLICAS; import static org.elasticsearch.cluster.metadata.IndexMetadata.SETTING_NUMBER_OF_SHARDS; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery; import static org.elasticsearch.index.query.QueryBuilders.termQuery; import static org.elasticsearch.search.aggregations.AggregationBuilders.filter; @@ -49,6 +48,7 @@ import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasSize; import static org.hamcrest.Matchers.sameInstance; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/ScriptedMetricIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/ScriptedMetricIT.java index b4ccec896eca4..032aaf3ba37eb 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/ScriptedMetricIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/ScriptedMetricIT.java @@ -14,7 +14,6 @@ import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.script.MockScriptPlugin; @@ -29,6 +28,7 @@ import org.elasticsearch.test.ESIntegTestCase; import org.elasticsearch.test.ESIntegTestCase.ClusterScope; import org.elasticsearch.test.ESIntegTestCase.Scope; +import org.elasticsearch.xcontent.XContentType; import org.junit.Before; import java.io.IOException; @@ -43,13 +43,13 @@ import java.util.function.Consumer; import java.util.function.Function; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery; import static org.elasticsearch.search.aggregations.AggregationBuilders.global; import static org.elasticsearch.search.aggregations.AggregationBuilders.histogram; import static org.elasticsearch.search.aggregations.AggregationBuilders.scriptedMetric; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.allOf; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/TopHitsIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/TopHitsIT.java index ef7d24495abd2..d47ade4fd8c55 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/TopHitsIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/TopHitsIT.java @@ -16,7 +16,6 @@ import org.elasticsearch.action.search.SearchType; import org.elasticsearch.common.document.DocumentField; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.query.MatchAllQueryBuilder; import org.elasticsearch.index.query.QueryBuilders; @@ -43,6 +42,7 @@ import org.elasticsearch.search.sort.SortBuilders; import org.elasticsearch.search.sort.SortOrder; import org.elasticsearch.test.ESIntegTestCase; +import org.elasticsearch.xcontent.XContentBuilder; import java.util.ArrayList; import java.util.Collection; @@ -52,9 +52,6 @@ import java.util.Map; import java.util.function.Function; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; -import static org.elasticsearch.common.xcontent.XContentFactory.smileBuilder; -import static org.elasticsearch.common.xcontent.XContentFactory.yamlBuilder; import static org.elasticsearch.common.xcontent.support.XContentMapValues.extractValue; import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery; import static org.elasticsearch.index.query.QueryBuilders.matchQuery; @@ -69,6 +66,9 @@ import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.smileBuilder; +import static org.elasticsearch.xcontent.XContentFactory.yamlBuilder; import static org.hamcrest.Matchers.arrayContaining; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/ValueCountIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/ValueCountIT.java index d5659586a24fd..23e6d8a6eff74 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/ValueCountIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/ValueCountIT.java @@ -24,7 +24,6 @@ import java.util.List; import java.util.Map; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery; import static org.elasticsearch.index.query.QueryBuilders.termQuery; import static org.elasticsearch.search.aggregations.AggregationBuilders.count; @@ -39,6 +38,7 @@ import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.notNullValue; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/pipeline/BucketMetricsPipeLineAggregationTestCase.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/pipeline/BucketMetricsPipeLineAggregationTestCase.java index 8c9c1acd19a2b..ef5abbbedd3fe 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/pipeline/BucketMetricsPipeLineAggregationTestCase.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/pipeline/BucketMetricsPipeLineAggregationTestCase.java @@ -12,9 +12,7 @@ import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.action.support.WriteRequest; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.search.aggregations.BucketOrder; import org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramAggregationBuilder; import org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramInterval; @@ -26,19 +24,21 @@ import org.elasticsearch.search.aggregations.metrics.Sum; import org.elasticsearch.search.aggregations.metrics.SumAggregationBuilder; import org.elasticsearch.test.ESIntegTestCase; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import java.util.ArrayList; import java.util.List; import java.util.function.Function; import java.util.function.IntToDoubleFunction; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.search.aggregations.AggregationBuilders.dateHistogram; import static org.elasticsearch.search.aggregations.AggregationBuilders.histogram; import static org.elasticsearch.search.aggregations.AggregationBuilders.sum; import static org.elasticsearch.search.aggregations.AggregationBuilders.terms; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.greaterThan; import static org.hamcrest.core.IsNull.notNullValue; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/pipeline/BucketScriptIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/pipeline/BucketScriptIT.java index 79186b851799f..9e600724a9081 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/pipeline/BucketScriptIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/pipeline/BucketScriptIT.java @@ -11,9 +11,6 @@ import org.elasticsearch.action.index.IndexRequestBuilder; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.common.bytes.BytesArray; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.script.MockScriptPlugin; import org.elasticsearch.script.Script; @@ -23,6 +20,9 @@ import org.elasticsearch.search.aggregations.metrics.Sum; import org.elasticsearch.search.aggregations.pipeline.BucketHelpers.GapPolicy; import org.elasticsearch.test.ESIntegTestCase; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.util.ArrayList; @@ -33,13 +33,13 @@ import java.util.Map; import java.util.function.Function; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.search.aggregations.AggregationBuilders.dateRange; import static org.elasticsearch.search.aggregations.AggregationBuilders.histogram; import static org.elasticsearch.search.aggregations.AggregationBuilders.sum; import static org.elasticsearch.search.aggregations.PipelineAggregatorBuilders.bucketScript; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.Matchers.nullValue; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/pipeline/BucketSelectorIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/pipeline/BucketSelectorIT.java index f5337d0f85639..b0f55882d8e3a 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/pipeline/BucketSelectorIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/pipeline/BucketSelectorIT.java @@ -11,8 +11,6 @@ import org.elasticsearch.action.index.IndexRequestBuilder; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.common.bytes.BytesArray; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.script.MockScriptPlugin; import org.elasticsearch.script.Script; @@ -22,6 +20,8 @@ import org.elasticsearch.search.aggregations.metrics.Sum; import org.elasticsearch.search.aggregations.pipeline.BucketHelpers.GapPolicy; import org.elasticsearch.test.ESIntegTestCase; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.util.ArrayList; @@ -32,13 +32,13 @@ import java.util.Map; import java.util.function.Function; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.search.aggregations.AggregationBuilders.histogram; import static org.elasticsearch.search.aggregations.AggregationBuilders.sum; import static org.elasticsearch.search.aggregations.PipelineAggregatorBuilders.bucketSelector; import static org.elasticsearch.search.aggregations.PipelineAggregatorBuilders.derivative; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.greaterThan; import static org.hamcrest.Matchers.lessThan; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/pipeline/BucketSortIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/pipeline/BucketSortIT.java index 582bf13b0c7b4..dd8a3163b312a 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/pipeline/BucketSortIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/pipeline/BucketSortIT.java @@ -11,7 +11,6 @@ import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.index.IndexRequestBuilder; import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.core.TimeValue; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramInterval; @@ -21,6 +20,7 @@ import org.elasticsearch.search.sort.FieldSortBuilder; import org.elasticsearch.search.sort.SortOrder; import org.elasticsearch.test.ESIntegTestCase; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.time.ZonedDateTime; @@ -29,7 +29,6 @@ import java.util.Collections; import java.util.List; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.search.aggregations.AggregationBuilders.avg; import static org.elasticsearch.search.aggregations.AggregationBuilders.dateHistogram; import static org.elasticsearch.search.aggregations.AggregationBuilders.histogram; @@ -37,6 +36,7 @@ import static org.elasticsearch.search.aggregations.AggregationBuilders.terms; import static org.elasticsearch.search.aggregations.PipelineAggregatorBuilders.bucketSort; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.greaterThanOrEqualTo; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/pipeline/DateDerivativeIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/pipeline/DateDerivativeIT.java index 4744eafecef12..918225b56c6a8 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/pipeline/DateDerivativeIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/pipeline/DateDerivativeIT.java @@ -33,11 +33,11 @@ import java.util.Arrays; import java.util.List; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.search.aggregations.AggregationBuilders.dateHistogram; import static org.elasticsearch.search.aggregations.AggregationBuilders.sum; import static org.elasticsearch.search.aggregations.PipelineAggregatorBuilders.derivative; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.closeTo; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/pipeline/DerivativeIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/pipeline/DerivativeIT.java index 52db45710607b..ae83bb85bd3d7 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/pipeline/DerivativeIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/pipeline/DerivativeIT.java @@ -12,7 +12,6 @@ import org.elasticsearch.action.index.IndexRequestBuilder; import org.elasticsearch.action.search.SearchPhaseExecutionException; import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.search.aggregations.InternalAggregation; import org.elasticsearch.search.aggregations.InternalMultiBucketAggregation; @@ -23,13 +22,13 @@ import org.elasticsearch.search.aggregations.pipeline.BucketHelpers.GapPolicy; import org.elasticsearch.search.aggregations.support.AggregationPath; import org.elasticsearch.test.ESIntegTestCase; +import org.elasticsearch.xcontent.XContentBuilder; import org.hamcrest.Matchers; import java.io.IOException; import java.util.ArrayList; import java.util.List; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery; import static org.elasticsearch.search.aggregations.AggregationBuilders.avg; import static org.elasticsearch.search.aggregations.AggregationBuilders.filters; @@ -39,6 +38,7 @@ import static org.elasticsearch.search.aggregations.PipelineAggregatorBuilders.derivative; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.closeTo; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.core.IsNull.notNullValue; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/pipeline/ExtendedStatsBucketIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/pipeline/ExtendedStatsBucketIT.java index 936d2f2f25b06..2950276e5c552 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/pipeline/ExtendedStatsBucketIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/pipeline/ExtendedStatsBucketIT.java @@ -22,12 +22,12 @@ import java.util.function.Function; import java.util.function.IntToDoubleFunction; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.search.aggregations.AggregationBuilders.histogram; import static org.elasticsearch.search.aggregations.AggregationBuilders.sum; import static org.elasticsearch.search.aggregations.AggregationBuilders.terms; import static org.elasticsearch.search.aggregations.PipelineAggregatorBuilders.extendedStatsBucket; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.core.IsNull.notNullValue; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/pipeline/SerialDiffIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/pipeline/SerialDiffIT.java index c9e7ad2e41ec9..6ba6c0b0a6879 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/pipeline/SerialDiffIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/pipeline/SerialDiffIT.java @@ -23,13 +23,13 @@ import java.util.List; import java.util.Map; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.search.aggregations.AggregationBuilders.avg; import static org.elasticsearch.search.aggregations.AggregationBuilders.histogram; import static org.elasticsearch.search.aggregations.AggregationBuilders.max; import static org.elasticsearch.search.aggregations.AggregationBuilders.min; import static org.elasticsearch.search.aggregations.PipelineAggregatorBuilders.diff; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.closeTo; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/basic/SearchWhileRelocatingIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/basic/SearchWhileRelocatingIT.java index 04d38578a87be..0c2c8ca1754e5 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/basic/SearchWhileRelocatingIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/basic/SearchWhileRelocatingIT.java @@ -24,7 +24,7 @@ import java.util.concurrent.atomic.AtomicBoolean; import java.util.stream.Stream; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoTimeout; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.formatShardStatus; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/basic/SearchWithRandomExceptionsIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/basic/SearchWithRandomExceptionsIT.java index 8d417fd46f057..73b64a5455ff0 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/basic/SearchWithRandomExceptionsIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/basic/SearchWithRandomExceptionsIT.java @@ -24,7 +24,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings.Builder; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.index.MockEngineFactoryPlugin; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.plugins.Plugin; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/basic/SearchWithRandomIOExceptionsIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/basic/SearchWithRandomIOExceptionsIT.java index e26fd8a3e0e0c..0d8504d4e8c19 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/basic/SearchWithRandomIOExceptionsIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/basic/SearchWithRandomIOExceptionsIT.java @@ -20,7 +20,7 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.search.sort.SortOrder; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/basic/TransportSearchFailuresIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/basic/TransportSearchFailuresIT.java index 57c1500f56071..ed8260d257c98 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/basic/TransportSearchFailuresIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/basic/TransportSearchFailuresIT.java @@ -17,7 +17,7 @@ import org.elasticsearch.client.Requests; import org.elasticsearch.cluster.health.ClusterHealthStatus; import org.elasticsearch.common.Priority; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.query.MatchQueryBuilder; import org.elasticsearch.search.builder.SearchSourceBuilder; import org.elasticsearch.test.ESIntegTestCase; @@ -27,7 +27,7 @@ import static org.elasticsearch.client.Requests.clusterHealthRequest; import static org.elasticsearch.client.Requests.refreshRequest; import static org.elasticsearch.client.Requests.searchRequest; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.hamcrest.Matchers.anyOf; import static org.hamcrest.Matchers.equalTo; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/basic/TransportTwoNodesSearchIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/basic/TransportTwoNodesSearchIT.java index 5941d794d68ef..7421e63800999 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/basic/TransportTwoNodesSearchIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/basic/TransportTwoNodesSearchIT.java @@ -16,7 +16,7 @@ import org.elasticsearch.client.Requests; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.query.MatchQueryBuilder; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.index.query.functionscore.ScriptScoreFunctionBuilder; @@ -40,7 +40,7 @@ import static org.elasticsearch.client.Requests.createIndexRequest; import static org.elasticsearch.client.Requests.searchRequest; import static org.elasticsearch.cluster.metadata.IndexMetadata.SETTING_NUMBER_OF_SHARDS; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery; import static org.elasticsearch.index.query.QueryBuilders.termQuery; import static org.elasticsearch.search.builder.SearchSourceBuilder.searchSource; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/fetch/FetchSubPhasePluginIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/fetch/FetchSubPhasePluginIT.java index e93875d6e1748..9e31c1de41142 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/fetch/FetchSubPhasePluginIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/fetch/FetchSubPhasePluginIT.java @@ -18,8 +18,8 @@ import org.elasticsearch.common.document.DocumentField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.plugins.SearchPlugin; import org.elasticsearch.search.SearchExtBuilder; @@ -39,7 +39,7 @@ import static java.util.Collections.singletonList; import static org.elasticsearch.client.Requests.indexRequest; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse; import static org.hamcrest.CoreMatchers.equalTo; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/fetch/subphase/InnerHitsIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/fetch/subphase/InnerHitsIT.java index 859f2a460d511..dfe2158455ab5 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/fetch/subphase/InnerHitsIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/fetch/subphase/InnerHitsIT.java @@ -15,7 +15,7 @@ import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.cluster.health.ClusterHealthStatus; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.query.BoolQueryBuilder; import org.elasticsearch.index.query.InnerHitBuilder; @@ -42,7 +42,7 @@ import java.util.function.Function; import static org.elasticsearch.action.support.WriteRequest.RefreshPolicy.IMMEDIATE; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.boolQuery; import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery; import static org.elasticsearch.index.query.QueryBuilders.matchQuery; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/fetch/subphase/MatchedQueriesIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/fetch/subphase/MatchedQueriesIT.java index 99619956a0d9b..36e4b40629c05 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/fetch/subphase/MatchedQueriesIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/fetch/subphase/MatchedQueriesIT.java @@ -11,7 +11,7 @@ import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.query.MatchQueryBuilder; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilders; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/fetch/subphase/highlight/HighlighterSearchIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/fetch/subphase/highlight/HighlighterSearchIT.java index 5e8785d60ab6f..84d3a60b20fbc 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/fetch/subphase/highlight/HighlighterSearchIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/fetch/subphase/highlight/HighlighterSearchIT.java @@ -25,8 +25,8 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings.Builder; import org.elasticsearch.common.time.DateFormatter; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.index.analysis.AbstractIndexAnalyzerProvider; import org.elasticsearch.index.analysis.AnalyzerProvider; import org.elasticsearch.index.analysis.PreConfiguredTokenFilter; @@ -68,7 +68,7 @@ import static java.util.Collections.singletonList; import static java.util.Collections.singletonMap; import static org.elasticsearch.client.Requests.searchRequest; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.boolQuery; import static org.elasticsearch.index.query.QueryBuilders.boostingQuery; import static org.elasticsearch.index.query.QueryBuilders.combinedFieldsQuery; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/fieldcaps/FieldCapabilitiesIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/fieldcaps/FieldCapabilitiesIT.java index b477781930238..c614f5f50f28e 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/fieldcaps/FieldCapabilitiesIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/fieldcaps/FieldCapabilitiesIT.java @@ -15,8 +15,8 @@ import org.elasticsearch.action.index.IndexRequestBuilder; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.index.mapper.DocumentParserContext; import org.elasticsearch.index.mapper.KeywordFieldMapper; import org.elasticsearch.index.mapper.MetadataFieldMapper; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/fields/SearchFieldsIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/fields/SearchFieldsIT.java index 34af1f1a26216..8a1ea3337fff9 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/fields/SearchFieldsIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/fields/SearchFieldsIT.java @@ -19,9 +19,9 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.time.DateFormatter; import org.elasticsearch.common.time.DateUtils; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.index.fielddata.ScriptDocValues; import org.elasticsearch.index.query.QueryBuilders; @@ -58,7 +58,7 @@ import static org.elasticsearch.action.support.WriteRequest.RefreshPolicy.IMMEDIATE; import static org.elasticsearch.client.Requests.refreshRequest; import static org.elasticsearch.common.util.set.Sets.newHashSet; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/functionscore/DecayFunctionScoreIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/functionscore/DecayFunctionScoreIT.java index c81b37af4b4b5..78a4db71c9e5e 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/functionscore/DecayFunctionScoreIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/functionscore/DecayFunctionScoreIT.java @@ -20,7 +20,7 @@ import org.elasticsearch.common.lucene.search.function.FunctionScoreQuery; import org.elasticsearch.common.lucene.search.function.FunctionScoreQuery.ScoreMode; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.index.query.functionscore.FunctionScoreQueryBuilder; @@ -40,7 +40,7 @@ import static org.elasticsearch.action.support.WriteRequest.RefreshPolicy.IMMEDIATE; import static org.elasticsearch.client.Requests.indexRequest; import static org.elasticsearch.client.Requests.searchRequest; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.constantScoreQuery; import static org.elasticsearch.index.query.QueryBuilders.functionScoreQuery; import static org.elasticsearch.index.query.QueryBuilders.termQuery; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/functionscore/ExplainableScriptIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/functionscore/ExplainableScriptIT.java index be264e8289184..67fbe70435ceb 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/functionscore/ExplainableScriptIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/functionscore/ExplainableScriptIT.java @@ -45,7 +45,7 @@ import java.util.concurrent.ExecutionException; import static org.elasticsearch.client.Requests.searchRequest; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.functionScoreQuery; import static org.elasticsearch.index.query.QueryBuilders.termQuery; import static org.elasticsearch.index.query.functionscore.ScoreFunctionBuilders.scriptFunction; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/functionscore/FunctionScoreFieldValueIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/functionscore/FunctionScoreFieldValueIT.java index db636b1ab97d7..0ffd6ae5ebbe5 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/functionscore/FunctionScoreFieldValueIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/functionscore/FunctionScoreFieldValueIT.java @@ -15,7 +15,7 @@ import java.io.IOException; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.functionScoreQuery; import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery; import static org.elasticsearch.index.query.QueryBuilders.simpleQueryStringQuery; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/functionscore/FunctionScoreIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/functionscore/FunctionScoreIT.java index 4ecda527f6900..f52a33495039a 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/functionscore/FunctionScoreIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/functionscore/FunctionScoreIT.java @@ -34,7 +34,7 @@ import java.util.function.Function; import static org.elasticsearch.client.Requests.searchRequest; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.functionScoreQuery; import static org.elasticsearch.index.query.QueryBuilders.termQuery; import static org.elasticsearch.index.query.functionscore.ScoreFunctionBuilders.scriptFunction; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/functionscore/FunctionScorePluginIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/functionscore/FunctionScorePluginIT.java index ae7d27ae62962..5a690543a611e 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/functionscore/FunctionScorePluginIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/functionscore/FunctionScorePluginIT.java @@ -35,7 +35,7 @@ import static java.util.Collections.singletonList; import static org.elasticsearch.client.Requests.indexRequest; import static org.elasticsearch.client.Requests.searchRequest; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.functionScoreQuery; import static org.elasticsearch.index.query.QueryBuilders.termQuery; import static org.elasticsearch.search.builder.SearchSourceBuilder.searchSource; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/functionscore/QueryRescorerIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/functionscore/QueryRescorerIT.java index f2cd422fa5f2a..1f8840c7b069b 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/functionscore/QueryRescorerIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/functionscore/QueryRescorerIT.java @@ -17,8 +17,8 @@ import org.elasticsearch.common.lucene.search.function.CombineFunction; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings.Builder; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.index.query.Operator; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilders; @@ -36,7 +36,7 @@ import static org.elasticsearch.cluster.metadata.IndexMetadata.SETTING_NUMBER_OF_REPLICAS; import static org.elasticsearch.cluster.metadata.IndexMetadata.SETTING_NUMBER_OF_SHARDS; import static org.elasticsearch.common.lucene.search.function.CombineFunction.REPLACE; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.boolQuery; import static org.elasticsearch.index.query.QueryBuilders.constantScoreQuery; import static org.elasticsearch.index.query.QueryBuilders.functionScoreQuery; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/functionscore/RandomScoreFunctionIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/functionscore/RandomScoreFunctionIT.java index 60d885947d6e0..f272354af7ca9 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/functionscore/RandomScoreFunctionIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/functionscore/RandomScoreFunctionIT.java @@ -28,7 +28,7 @@ import java.util.Map; import java.util.function.Function; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.functionScoreQuery; import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery; import static org.elasticsearch.index.query.QueryBuilders.matchQuery; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/geo/GeoBoundingBoxQueryGeoPointIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/geo/GeoBoundingBoxQueryGeoPointIT.java index f96ed273dce2c..671d597874c3b 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/geo/GeoBoundingBoxQueryGeoPointIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/geo/GeoBoundingBoxQueryGeoPointIT.java @@ -9,8 +9,8 @@ package org.elasticsearch.search.geo; import org.elasticsearch.Version; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.test.VersionUtils; import java.io.IOException; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/geo/GeoBoundingBoxQueryGeoShapeIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/geo/GeoBoundingBoxQueryGeoShapeIT.java index ab4b5fbf10b95..2aee415ffce9f 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/geo/GeoBoundingBoxQueryGeoShapeIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/geo/GeoBoundingBoxQueryGeoShapeIT.java @@ -9,8 +9,8 @@ package org.elasticsearch.search.geo; import org.elasticsearch.Version; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.test.VersionUtils; import java.io.IOException; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/geo/GeoDistanceIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/geo/GeoDistanceIT.java index b853c255f351b..9f741292b3e04 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/geo/GeoDistanceIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/geo/GeoDistanceIT.java @@ -16,8 +16,8 @@ import org.elasticsearch.common.geo.GeoUtils; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.DistanceUnit; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.geometry.utils.Geohash; import org.elasticsearch.index.fielddata.ScriptDocValues; import org.elasticsearch.index.query.QueryBuilders; @@ -41,7 +41,7 @@ import java.util.Map; import java.util.function.Function; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.hamcrest.Matchers.closeTo; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/geo/GeoPointScriptDocValuesIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/geo/GeoPointScriptDocValuesIT.java index 8bff25ae2a0ff..309a75280ad46 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/geo/GeoPointScriptDocValuesIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/geo/GeoPointScriptDocValuesIT.java @@ -19,8 +19,8 @@ import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.common.document.DocumentField; import org.elasticsearch.common.geo.GeoBoundingBox; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.geo.GeometryTestUtils; import org.elasticsearch.index.fielddata.ScriptDocValues; import org.elasticsearch.plugins.Plugin; @@ -39,7 +39,7 @@ import java.util.Map; import java.util.function.Function; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse; import static org.hamcrest.Matchers.equalTo; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/geo/GeoPolygonIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/geo/GeoPolygonIT.java index d6da8f4364bd4..e23c369ac115a 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/geo/GeoPolygonIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/geo/GeoPolygonIT.java @@ -20,7 +20,7 @@ import java.util.ArrayList; import java.util.List; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.boolQuery; import static org.elasticsearch.index.query.QueryBuilders.geoPolygonQuery; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/geo/GeoShapeIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/geo/GeoShapeIT.java index 41e20e4748de9..df4d80b7c4a47 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/geo/GeoShapeIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/geo/GeoShapeIT.java @@ -9,7 +9,7 @@ package org.elasticsearch.search.geo; import org.elasticsearch.Version; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.test.VersionUtils; import java.io.IOException; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/morelikethis/MoreLikeThisIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/morelikethis/MoreLikeThisIT.java index a2de65211023e..7d5aaabeba193 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/morelikethis/MoreLikeThisIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/morelikethis/MoreLikeThisIT.java @@ -15,8 +15,8 @@ import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.cluster.health.ClusterHealthStatus; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.index.query.MoreLikeThisQueryBuilder; import org.elasticsearch.index.query.MoreLikeThisQueryBuilder.Item; import org.elasticsearch.index.query.QueryBuilder; @@ -36,7 +36,7 @@ import static org.elasticsearch.client.Requests.refreshRequest; import static org.elasticsearch.cluster.metadata.IndexMetadata.SETTING_NUMBER_OF_REPLICAS; import static org.elasticsearch.cluster.metadata.IndexMetadata.SETTING_NUMBER_OF_SHARDS; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.moreLikeThisQuery; import static org.elasticsearch.index.query.QueryBuilders.termQuery; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/msearch/MultiSearchIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/msearch/MultiSearchIT.java index 63e1525e8d899..9254ce3fc39d2 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/msearch/MultiSearchIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/msearch/MultiSearchIT.java @@ -10,7 +10,7 @@ import org.elasticsearch.action.search.MultiSearchRequest; import org.elasticsearch.action.search.MultiSearchResponse; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.test.ESIntegTestCase; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/nested/SimpleNestedIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/nested/SimpleNestedIT.java index 2147f67e9ddfa..ac6cde023dc8e 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/nested/SimpleNestedIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/nested/SimpleNestedIT.java @@ -21,9 +21,9 @@ import org.elasticsearch.action.search.SearchType; import org.elasticsearch.cluster.health.ClusterHealthStatus; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.search.sort.NestedSortBuilder; import org.elasticsearch.search.sort.SortBuilders; @@ -32,7 +32,7 @@ import org.elasticsearch.test.ESIntegTestCase; import static org.elasticsearch.action.support.WriteRequest.RefreshPolicy.IMMEDIATE; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.boolQuery; import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery; import static org.elasticsearch.index.query.QueryBuilders.nestedQuery; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/profile/aggregation/AggregationProfilerIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/profile/aggregation/AggregationProfilerIT.java index 1be4f21f82935..f7e5982910acd 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/profile/aggregation/AggregationProfilerIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/profile/aggregation/AggregationProfilerIT.java @@ -37,7 +37,7 @@ import static io.github.nik9000.mapmatcher.ListMatcher.matchesList; import static io.github.nik9000.mapmatcher.MapMatcher.assertMap; import static io.github.nik9000.mapmatcher.MapMatcher.matchesMap; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.search.aggregations.AggregationBuilders.avg; import static org.elasticsearch.search.aggregations.AggregationBuilders.diversifiedSampler; import static org.elasticsearch.search.aggregations.AggregationBuilders.histogram; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/query/ExistsIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/query/ExistsIT.java index d89fa1abef555..7bb1da6dfa3be 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/query/ExistsIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/query/ExistsIT.java @@ -12,9 +12,9 @@ import org.elasticsearch.action.index.IndexRequestBuilder; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.search.SearchHit; import org.elasticsearch.test.ESIntegTestCase; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/query/MultiMatchQueryIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/query/MultiMatchQueryIT.java index 7d30afafecf5f..35506eae88498 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/query/MultiMatchQueryIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/query/MultiMatchQueryIT.java @@ -14,8 +14,8 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.Fuzziness; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.index.query.MatchQueryBuilder; import org.elasticsearch.index.query.MultiMatchQueryBuilder; import org.elasticsearch.index.query.Operator; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/query/QueryStringIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/query/QueryStringIT.java index d97500db8b722..41edf645f3195 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/query/QueryStringIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/query/QueryStringIT.java @@ -12,8 +12,8 @@ import org.elasticsearch.action.index.IndexRequestBuilder; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.mapper.MapperService; import org.elasticsearch.index.query.Operator; import org.elasticsearch.index.query.QueryStringQueryBuilder; @@ -30,7 +30,7 @@ import java.util.List; import java.util.Set; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.queryStringQuery; import static org.elasticsearch.test.StreamsUtils.copyToStringFromClasspath; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/query/SearchQueryIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/query/SearchQueryIT.java index 05f3a26a03a6c..f693328f1aa03 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/query/SearchQueryIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/query/SearchQueryIT.java @@ -27,9 +27,9 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.time.DateFormatter; import org.elasticsearch.common.unit.Fuzziness; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.analysis.CharFilterFactory; import org.elasticsearch.index.analysis.NormalizingCharFilterFactory; import org.elasticsearch.index.analysis.TokenizerFactory; @@ -76,7 +76,7 @@ import static java.util.Collections.singletonMap; import static org.elasticsearch.action.support.WriteRequest.RefreshPolicy.IMMEDIATE; import static org.elasticsearch.cluster.metadata.IndexMetadata.SETTING_NUMBER_OF_SHARDS; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.boolQuery; import static org.elasticsearch.index.query.QueryBuilders.constantScoreQuery; import static org.elasticsearch.index.query.QueryBuilders.existsQuery; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/query/SimpleQueryStringIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/query/SimpleQueryStringIT.java index 2aab118ae0fa4..8ab7c3eef21e7 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/query/SimpleQueryStringIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/query/SimpleQueryStringIT.java @@ -18,9 +18,9 @@ import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.analysis.PreConfiguredTokenFilter; import org.elasticsearch.index.mapper.MapperService; import org.elasticsearch.index.query.BoolQueryBuilder; @@ -47,7 +47,7 @@ import java.util.concurrent.ExecutionException; import static java.util.Collections.singletonList; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.boolQuery; import static org.elasticsearch.index.query.QueryBuilders.queryStringQuery; import static org.elasticsearch.index.query.QueryBuilders.simpleQueryStringQuery; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/routing/SearchPreferenceIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/routing/SearchPreferenceIT.java index eab855d13626f..a733b1486ee3a 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/routing/SearchPreferenceIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/routing/SearchPreferenceIT.java @@ -19,7 +19,7 @@ import org.elasticsearch.cluster.routing.allocation.decider.EnableAllocationDecider; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.node.Node; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.test.ESIntegTestCase; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/scriptfilter/ScriptQuerySearchIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/scriptfilter/ScriptQuerySearchIT.java index 62b24a373bae7..9d56d51e97b06 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/scriptfilter/ScriptQuerySearchIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/scriptfilter/ScriptQuerySearchIT.java @@ -12,8 +12,8 @@ import org.elasticsearch.action.admin.cluster.settings.ClusterUpdateSettingsRequest; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.index.IndexModule; import org.elasticsearch.index.fielddata.ScriptDocValues; import org.elasticsearch.plugins.Plugin; @@ -35,7 +35,7 @@ import java.util.function.Function; import static java.util.Collections.emptyMap; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.scriptQuery; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/scroll/DuelScrollIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/scroll/DuelScrollIT.java index c410e727a8ef5..e7c118527abd8 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/scroll/DuelScrollIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/scroll/DuelScrollIT.java @@ -27,7 +27,7 @@ import java.util.Arrays; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures; import static org.hamcrest.Matchers.equalTo; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/scroll/SearchScrollIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/scroll/SearchScrollIT.java index dc81a2ee24438..286269ab096b8 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/scroll/SearchScrollIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/scroll/SearchScrollIT.java @@ -20,9 +20,9 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.query.MatchAllQueryBuilder; @@ -41,7 +41,7 @@ import java.util.Map; import static org.elasticsearch.action.support.WriteRequest.RefreshPolicy.IMMEDIATE; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery; import static org.elasticsearch.index.query.QueryBuilders.queryStringQuery; import static org.elasticsearch.index.query.QueryBuilders.termQuery; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/scroll/SearchScrollWithFailingNodesIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/scroll/SearchScrollWithFailingNodesIT.java index f5f74dfdb356d..9294588d54fb8 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/scroll/SearchScrollWithFailingNodesIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/scroll/SearchScrollWithFailingNodesIT.java @@ -18,7 +18,7 @@ import java.util.ArrayList; import java.util.List; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAllSuccessful; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/searchafter/SearchAfterIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/searchafter/SearchAfterIT.java index 740c63e07cbbb..2188f7be174ba 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/searchafter/SearchAfterIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/searchafter/SearchAfterIT.java @@ -26,7 +26,7 @@ import org.elasticsearch.common.Randomness; import org.elasticsearch.common.UUIDs; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.core.TimeValue; import org.elasticsearch.index.query.MatchAllQueryBuilder; import org.elasticsearch.rest.RestStatus; @@ -46,7 +46,7 @@ import java.util.List; import static org.elasticsearch.action.support.WriteRequest.RefreshPolicy.IMMEDIATE; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertFailures; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/simple/SimpleSearchIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/simple/SimpleSearchIT.java index 8cd59e7b0d326..d03eebe731351 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/simple/SimpleSearchIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/simple/SimpleSearchIT.java @@ -15,10 +15,10 @@ import org.elasticsearch.action.support.WriteRequest.RefreshPolicy; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.CollectionUtils; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.IndexModule; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.query.QueryBuilders; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/slice/SearchSliceIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/slice/SearchSliceIT.java index 3a6a4c087d13e..e351ccdabd6da 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/slice/SearchSliceIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/slice/SearchSliceIT.java @@ -20,8 +20,8 @@ import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.core.TimeValue; import org.elasticsearch.search.Scroll; import org.elasticsearch.search.SearchException; @@ -37,7 +37,7 @@ import java.util.List; import java.util.concurrent.ExecutionException; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.hamcrest.Matchers.equalTo; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/sort/FieldSortIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/sort/FieldSortIT.java index 5e1bd24ba3153..4a21a71ace65d 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/sort/FieldSortIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/sort/FieldSortIT.java @@ -20,9 +20,9 @@ import org.elasticsearch.action.search.ShardSearchFailure; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.fielddata.ScriptDocValues; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.index.query.functionscore.ScoreFunctionBuilders; @@ -55,7 +55,7 @@ import java.util.concurrent.ExecutionException; import java.util.function.Function; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.functionScoreQuery; import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery; import static org.elasticsearch.index.query.functionscore.ScoreFunctionBuilders.fieldValueFactorFunction; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/sort/GeoDistanceIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/sort/GeoDistanceIT.java index 996d24adc5d3e..f56f6c78bbe1b 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/sort/GeoDistanceIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/sort/GeoDistanceIT.java @@ -13,9 +13,9 @@ import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.common.geo.GeoDistance; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.geometry.utils.Geohash; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.test.ESIntegTestCase; @@ -23,7 +23,7 @@ import java.io.IOException; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery; import static org.elasticsearch.index.query.QueryBuilders.termQuery; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/sort/GeoDistanceSortBuilderIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/sort/GeoDistanceSortBuilderIT.java index 14ad1937f291d..4716f50dd24dc 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/sort/GeoDistanceSortBuilderIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/sort/GeoDistanceSortBuilderIT.java @@ -15,7 +15,7 @@ import org.elasticsearch.common.geo.GeoPoint; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.DistanceUnit; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.query.GeoValidationMethod; import org.elasticsearch.search.builder.SearchSourceBuilder; import org.elasticsearch.test.ESIntegTestCase; @@ -28,7 +28,7 @@ import java.util.List; import java.util.concurrent.ExecutionException; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery; import static org.elasticsearch.search.sort.SortBuilders.fieldSort; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/sort/SimpleSortIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/sort/SimpleSortIT.java index 66952f217b0b3..f96c32ab66ea7 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/sort/SimpleSortIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/sort/SimpleSortIT.java @@ -36,7 +36,7 @@ import java.util.Random; import java.util.function.Function; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery; import static org.elasticsearch.index.query.QueryBuilders.termQuery; import static org.elasticsearch.search.sort.SortBuilders.scriptSort; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/suggest/CompletionSuggestSearchIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/suggest/CompletionSuggestSearchIT.java index b92579d2dceb4..033db2fbe9e57 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/suggest/CompletionSuggestSearchIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/suggest/CompletionSuggestSearchIT.java @@ -23,8 +23,8 @@ import org.elasticsearch.common.FieldMemoryStats; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.Fuzziness; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.index.mapper.MapperParsingException; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.plugins.Plugin; @@ -57,7 +57,7 @@ import static org.elasticsearch.cluster.metadata.IndexMetadata.SETTING_NUMBER_OF_REPLICAS; import static org.elasticsearch.cluster.metadata.IndexMetadata.SETTING_NUMBER_OF_SHARDS; import static org.elasticsearch.common.util.CollectionUtils.iterableAsArrayList; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAllSuccessful; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.hasId; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/suggest/ContextCompletionSuggestSearchIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/suggest/ContextCompletionSuggestSearchIT.java index 35b6f767941cd..592115feebc87 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/suggest/ContextCompletionSuggestSearchIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/suggest/ContextCompletionSuggestSearchIT.java @@ -15,8 +15,8 @@ import org.elasticsearch.common.geo.GeoPoint; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.Fuzziness; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.search.suggest.CompletionSuggestSearchIT.CompletionMappingBuilder; import org.elasticsearch.search.suggest.completion.CompletionSuggestionBuilder; @@ -38,7 +38,7 @@ import java.util.Locale; import java.util.Map; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures; import static org.hamcrest.core.IsEqual.equalTo; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/suggest/SuggestSearchIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/suggest/SuggestSearchIT.java index 3a30fb41051c1..f218551c1669e 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/suggest/SuggestSearchIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/suggest/SuggestSearchIT.java @@ -16,8 +16,8 @@ import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.plugins.ScriptPlugin; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/similarity/SimilarityIT.java b/server/src/internalClusterTest/java/org/elasticsearch/similarity/SimilarityIT.java index 036f575462ae1..d5b4a88330dfa 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/similarity/SimilarityIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/similarity/SimilarityIT.java @@ -13,7 +13,7 @@ import org.elasticsearch.test.ESIntegTestCase; import static org.elasticsearch.action.support.WriteRequest.RefreshPolicy.IMMEDIATE; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.matchQuery; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.not; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/BlobStoreIncrementalityIT.java b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/BlobStoreIncrementalityIT.java index 528ae71cd9624..38d15d91d8802 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/BlobStoreIncrementalityIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/BlobStoreIncrementalityIT.java @@ -37,9 +37,9 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.greaterThan; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.lessThan; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/CloneSnapshotIT.java b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/CloneSnapshotIT.java index a5e8a0ff3c8b6..f519e5b863c28 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/CloneSnapshotIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/CloneSnapshotIT.java @@ -18,7 +18,6 @@ import org.elasticsearch.cluster.SnapshotsInProgress; import org.elasticsearch.common.UUIDs; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; import org.elasticsearch.core.TimeValue; import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.index.snapshots.blobstore.BlobStoreIndexShardSnapshot; @@ -32,6 +31,7 @@ import org.elasticsearch.repositories.blobstore.BlobStoreRepository; import org.elasticsearch.snapshots.mockstore.MockRepository; import org.elasticsearch.test.ESIntegTestCase; +import org.elasticsearch.xcontent.NamedXContentRegistry; import java.nio.file.Path; import java.util.ArrayList; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/CorruptedBlobStoreRepositoryIT.java b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/CorruptedBlobStoreRepositoryIT.java index 5f497ebf7b125..014643b5a2906 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/CorruptedBlobStoreRepositoryIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/CorruptedBlobStoreRepositoryIT.java @@ -21,7 +21,6 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.ByteSizeUnit; -import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.core.internal.io.IOUtils; import org.elasticsearch.repositories.IndexId; import org.elasticsearch.repositories.IndexMetaDataGenerations; @@ -32,6 +31,7 @@ import org.elasticsearch.repositories.ShardGenerations; import org.elasticsearch.repositories.blobstore.BlobStoreRepository; import org.elasticsearch.threadpool.ThreadPool; +import org.elasticsearch.xcontent.XContentFactory; import java.nio.channels.SeekableByteChannel; import java.nio.file.Files; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/CustomMetadataSnapshotIT.java b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/CustomMetadataSnapshotIT.java index 01e92850bf191..471192343ebc8 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/CustomMetadataSnapshotIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/CustomMetadataSnapshotIT.java @@ -15,13 +15,13 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.core.CheckedFunction; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.repositories.RepositoryMissingException; import org.elasticsearch.test.TestCustomMetadata; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.nio.file.Path; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/MetadataLoadingDuringSnapshotRestoreIT.java b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/MetadataLoadingDuringSnapshotRestoreIT.java index ec0090e2d1a90..34cc51fb70704 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/MetadataLoadingDuringSnapshotRestoreIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/MetadataLoadingDuringSnapshotRestoreIT.java @@ -17,7 +17,6 @@ import org.elasticsearch.cluster.metadata.RepositoryMetadata; import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.util.BigArrays; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; import org.elasticsearch.env.Environment; import org.elasticsearch.indices.recovery.RecoverySettings; import org.elasticsearch.plugins.Plugin; @@ -27,6 +26,7 @@ import org.elasticsearch.repositories.RepositoryData; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.snapshots.mockstore.MockRepository; +import org.elasticsearch.xcontent.NamedXContentRegistry; import java.io.IOException; import java.util.Collection; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/RepositoryFilterUserMetadataIT.java b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/RepositoryFilterUserMetadataIT.java index 6f7fcd6abf6f0..d89c38f323a87 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/RepositoryFilterUserMetadataIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/RepositoryFilterUserMetadataIT.java @@ -10,7 +10,6 @@ import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.BigArrays; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; import org.elasticsearch.env.Environment; import org.elasticsearch.indices.recovery.RecoverySettings; import org.elasticsearch.plugins.Plugin; @@ -20,6 +19,7 @@ import org.elasticsearch.repositories.SnapshotShardContext; import org.elasticsearch.repositories.fs.FsRepository; import org.elasticsearch.test.ESIntegTestCase; +import org.elasticsearch.xcontent.NamedXContentRegistry; import java.util.Collection; import java.util.Collections; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/RestoreSnapshotIT.java b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/RestoreSnapshotIT.java index 906be39192d75..710b88b340cb5 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/RestoreSnapshotIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/RestoreSnapshotIT.java @@ -24,7 +24,6 @@ import org.elasticsearch.common.logging.Loggers; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.ByteSizeUnit; -import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.core.TimeValue; import org.elasticsearch.indices.InvalidIndexNameException; import org.elasticsearch.repositories.RepositoriesService; @@ -32,6 +31,7 @@ import org.elasticsearch.repositories.fs.FsRepository; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.test.MockLogAppender; +import org.elasticsearch.xcontent.XContentFactory; import java.nio.file.Path; import java.util.Arrays; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/SnapshotCustomPluginStateIT.java b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/SnapshotCustomPluginStateIT.java index b23a7dc2c8e16..9f515fd2db767 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/SnapshotCustomPluginStateIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/SnapshotCustomPluginStateIT.java @@ -18,21 +18,21 @@ import org.elasticsearch.action.ingest.GetPipelineResponse; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.ingest.IngestTestPlugin; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.script.MockScriptEngine; import org.elasticsearch.script.StoredScriptsIT; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import java.util.Arrays; import java.util.Collection; import java.util.Collections; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertIndexTemplateExists; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertIndexTemplateMissing; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.greaterThan; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/SnapshotStressTestsIT.java b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/SnapshotStressTestsIT.java index 1cfe670f38bda..0b258df26bfa8 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/SnapshotStressTestsIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/SnapshotStressTestsIT.java @@ -70,8 +70,8 @@ import java.util.stream.Collectors; import java.util.stream.Stream; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.repositories.blobstore.ChecksumBlobStoreFormat.SNAPSHOT_ONLY_FORMAT_PARAMS; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasSize; import static org.hamcrest.Matchers.notNullValue; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/threadpool/SimpleThreadPoolIT.java b/server/src/internalClusterTest/java/org/elasticsearch/threadpool/SimpleThreadPoolIT.java index 67cb1d15491ff..d98dc6ef943c3 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/threadpool/SimpleThreadPoolIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/threadpool/SimpleThreadPoolIT.java @@ -23,7 +23,7 @@ import java.util.Set; import java.util.regex.Pattern; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures; @ClusterScope(scope = Scope.TEST, numDataNodes = 0, numClientNodes = 0) diff --git a/server/src/internalClusterTest/java/org/elasticsearch/update/UpdateIT.java b/server/src/internalClusterTest/java/org/elasticsearch/update/UpdateIT.java index 417367c320865..17607361f82a6 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/update/UpdateIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/update/UpdateIT.java @@ -24,7 +24,7 @@ import org.elasticsearch.client.transport.NoNodeAvailableException; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.index.MergePolicyConfig; import org.elasticsearch.index.engine.DocumentMissingException; import org.elasticsearch.index.engine.VersionConflictEngineException; @@ -49,7 +49,7 @@ import java.util.concurrent.TimeUnit; import java.util.function.Function; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertFutureThrows; import static org.hamcrest.Matchers.containsString; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/update/UpdateNoopIT.java b/server/src/internalClusterTest/java/org/elasticsearch/update/UpdateNoopIT.java index c5fc369893cf4..6f04c9ece366a 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/update/UpdateNoopIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/update/UpdateNoopIT.java @@ -11,8 +11,8 @@ import org.elasticsearch.action.update.UpdateRequestBuilder; import org.elasticsearch.action.update.UpdateResponse; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.test.ESIntegTestCase; import org.junit.Before; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/validate/SimpleValidateQueryIT.java b/server/src/internalClusterTest/java/org/elasticsearch/validate/SimpleValidateQueryIT.java index 85e7c9634a2bc..406b494675a6d 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/validate/SimpleValidateQueryIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/validate/SimpleValidateQueryIT.java @@ -13,7 +13,7 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.Fuzziness; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.index.query.MoreLikeThisQueryBuilder.Item; import org.elasticsearch.index.query.QueryBuilder; diff --git a/server/src/main/java/org/elasticsearch/ElasticsearchException.java b/server/src/main/java/org/elasticsearch/ElasticsearchException.java index 5fd18008826d5..c5d0938a7bdb2 100644 --- a/server/src/main/java/org/elasticsearch/ElasticsearchException.java +++ b/server/src/main/java/org/elasticsearch/ElasticsearchException.java @@ -12,16 +12,16 @@ import org.elasticsearch.cluster.action.shard.ShardStateAction; import org.elasticsearch.core.CheckedFunction; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.Tuple; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.logging.LoggerMessageFormat; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.Index; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.rest.RestStatus; diff --git a/server/src/main/java/org/elasticsearch/Version.java b/server/src/main/java/org/elasticsearch/Version.java index 047f984df4a7a..8a63da440fff6 100644 --- a/server/src/main/java/org/elasticsearch/Version.java +++ b/server/src/main/java/org/elasticsearch/Version.java @@ -15,8 +15,8 @@ import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.monitor.jvm.JvmInfo; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/action/ActionResponse.java b/server/src/main/java/org/elasticsearch/action/ActionResponse.java index 7d26bb00043ff..3f940cf27ecb6 100644 --- a/server/src/main/java/org/elasticsearch/action/ActionResponse.java +++ b/server/src/main/java/org/elasticsearch/action/ActionResponse.java @@ -10,8 +10,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.transport.TransportResponse; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/action/DocWriteResponse.java b/server/src/main/java/org/elasticsearch/action/DocWriteResponse.java index 47519391b12ff..e074c6f754192 100644 --- a/server/src/main/java/org/elasticsearch/action/DocWriteResponse.java +++ b/server/src/main/java/org/elasticsearch/action/DocWriteResponse.java @@ -19,8 +19,8 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.xcontent.StatusToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.Index; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.mapper.MapperService; diff --git a/server/src/main/java/org/elasticsearch/action/FailedNodeException.java b/server/src/main/java/org/elasticsearch/action/FailedNodeException.java index f1cb4206eee6f..210e3100ccd26 100644 --- a/server/src/main/java/org/elasticsearch/action/FailedNodeException.java +++ b/server/src/main/java/org/elasticsearch/action/FailedNodeException.java @@ -11,7 +11,7 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/action/ShardOperationFailedException.java b/server/src/main/java/org/elasticsearch/action/ShardOperationFailedException.java index e3691c8d606e0..3055ca53fb2f5 100644 --- a/server/src/main/java/org/elasticsearch/action/ShardOperationFailedException.java +++ b/server/src/main/java/org/elasticsearch/action/ShardOperationFailedException.java @@ -10,7 +10,7 @@ import org.elasticsearch.core.Nullable; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.ToXContentObject; import org.elasticsearch.rest.RestStatus; import java.util.Objects; diff --git a/server/src/main/java/org/elasticsearch/action/TaskOperationFailure.java b/server/src/main/java/org/elasticsearch/action/TaskOperationFailure.java index 6c027e6e87944..77f012c997df8 100644 --- a/server/src/main/java/org/elasticsearch/action/TaskOperationFailure.java +++ b/server/src/main/java/org/elasticsearch/action/TaskOperationFailure.java @@ -10,19 +10,19 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.ExceptionsHelper; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.rest.RestStatus; import java.io.IOException; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; /** * Information about task operation failures diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/allocation/ClusterAllocationExplainRequest.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/allocation/ClusterAllocationExplainRequest.java index 177e2a78df784..ad5891f609daa 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/allocation/ClusterAllocationExplainRequest.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/allocation/ClusterAllocationExplainRequest.java @@ -11,11 +11,11 @@ import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.support.master.MasterNodeRequest; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/allocation/ClusterAllocationExplanation.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/allocation/ClusterAllocationExplanation.java index 534f8c964f602..b0ce018833f1c 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/allocation/ClusterAllocationExplanation.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/allocation/ClusterAllocationExplanation.java @@ -20,8 +20,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.shard.ShardId; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/health/ClusterHealthResponse.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/health/ClusterHealthResponse.java index 385a4ce827ed8..0123364954666 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/health/ClusterHealthResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/health/ClusterHealthResponse.java @@ -13,16 +13,16 @@ import org.elasticsearch.cluster.health.ClusterHealthStatus; import org.elasticsearch.cluster.health.ClusterIndexHealth; import org.elasticsearch.cluster.health.ClusterStateHealth; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; import org.elasticsearch.common.xcontent.StatusToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.rest.RestStatus; import java.io.IOException; @@ -33,8 +33,8 @@ import java.util.Objects; import static java.util.Collections.emptyMap; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class ClusterHealthResponse extends ActionResponse implements StatusToXContentObject { private static final String CLUSTER_NAME = "cluster_name"; diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/migration/GetFeatureUpgradeStatusResponse.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/migration/GetFeatureUpgradeStatusResponse.java index 3e46b4d4b6fa3..0d281ba4b6944 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/migration/GetFeatureUpgradeStatusResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/migration/GetFeatureUpgradeStatusResponse.java @@ -13,8 +13,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Collections; diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/migration/PostFeatureUpgradeResponse.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/migration/PostFeatureUpgradeResponse.java index 4b113f14a4999..245001acfa042 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/migration/PostFeatureUpgradeResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/migration/PostFeatureUpgradeResponse.java @@ -13,8 +13,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.core.Nullable; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/node/info/NodesInfoResponse.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/node/info/NodesInfoResponse.java index dce02f79de146..11628f5e2d046 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/node/info/NodesInfoResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/node/info/NodesInfoResponse.java @@ -16,9 +16,9 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.http.HttpInfo; import org.elasticsearch.ingest.IngestInfo; import org.elasticsearch.monitor.jvm.JvmInfo; diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/node/info/PluginsAndModules.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/node/info/PluginsAndModules.java index 6add1ea50abeb..f5011a6713edb 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/node/info/PluginsAndModules.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/node/info/PluginsAndModules.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.node.ReportingService; import org.elasticsearch.plugins.PluginInfo; diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/node/reload/NodesReloadSecureSettingsResponse.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/node/reload/NodesReloadSecureSettingsResponse.java index 5f47d19e1eb15..454c141df4b2f 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/node/reload/NodesReloadSecureSettingsResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/node/reload/NodesReloadSecureSettingsResponse.java @@ -17,9 +17,9 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import java.io.IOException; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/node/stats/NodeStats.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/node/stats/NodeStats.java index 573eb0bfcf359..7c17367f9ecbe 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/node/stats/NodeStats.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/node/stats/NodeStats.java @@ -14,8 +14,8 @@ import org.elasticsearch.core.Nullable; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.discovery.DiscoveryStats; import org.elasticsearch.http.HttpStats; import org.elasticsearch.index.stats.IndexingPressureStats; diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/node/stats/NodesStatsResponse.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/node/stats/NodesStatsResponse.java index 23db14e31d6f3..94655739b3168 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/node/stats/NodesStatsResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/node/stats/NodesStatsResponse.java @@ -14,9 +14,9 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import java.io.IOException; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/node/tasks/cancel/CancelTasksResponse.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/node/tasks/cancel/CancelTasksResponse.java index 97ef65ff90ba4..9dd0327753f53 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/node/tasks/cancel/CancelTasksResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/node/tasks/cancel/CancelTasksResponse.java @@ -13,9 +13,9 @@ import org.elasticsearch.action.admin.cluster.node.tasks.list.ListTasksResponse; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.tasks.TaskInfo; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/node/tasks/get/GetTaskResponse.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/node/tasks/get/GetTaskResponse.java index ac338099ab2b8..be21c97eab096 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/node/tasks/get/GetTaskResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/node/tasks/get/GetTaskResponse.java @@ -12,8 +12,8 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.tasks.TaskResult; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/node/tasks/get/TransportGetTaskAction.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/node/tasks/get/TransportGetTaskAction.java index 72e26365ccfea..dbc6f78789f50 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/node/tasks/get/TransportGetTaskAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/node/tasks/get/TransportGetTaskAction.java @@ -24,9 +24,9 @@ import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.util.concurrent.AbstractRunnable; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.tasks.Task; import org.elasticsearch.tasks.TaskId; diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/node/tasks/list/ListTasksResponse.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/node/tasks/list/ListTasksResponse.java index 46114fa87fb74..97ce9bf6b4171 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/node/tasks/list/ListTasksResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/node/tasks/list/ListTasksResponse.java @@ -14,15 +14,15 @@ import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.node.DiscoveryNodeRole; import org.elasticsearch.cluster.node.DiscoveryNodes; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.TriFunction; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.tasks.TaskId; import org.elasticsearch.tasks.TaskInfo; @@ -34,7 +34,7 @@ import java.util.Map; import java.util.stream.Collectors; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * Returns the list of tasks currently running on the nodes diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/node/tasks/list/TaskGroup.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/node/tasks/list/TaskGroup.java index d9a5c72ae7801..8ee6480917d94 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/node/tasks/list/TaskGroup.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/node/tasks/list/TaskGroup.java @@ -8,8 +8,8 @@ package org.elasticsearch.action.admin.cluster.node.tasks.list; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.tasks.TaskInfo; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/node/usage/NodeUsage.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/node/usage/NodeUsage.java index 774a5bdcdabde..c6166cbac3afd 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/node/usage/NodeUsage.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/node/usage/NodeUsage.java @@ -12,8 +12,8 @@ import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Map; diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/node/usage/NodesUsageResponse.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/node/usage/NodesUsageResponse.java index 7bee8fd3c6c92..0a91eb2a0d717 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/node/usage/NodesUsageResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/node/usage/NodesUsageResponse.java @@ -14,9 +14,9 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import java.io.IOException; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/remote/RemoteInfoResponse.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/remote/RemoteInfoResponse.java index 4637ba3834700..4701a93882cb4 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/remote/RemoteInfoResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/remote/RemoteInfoResponse.java @@ -11,8 +11,8 @@ import org.elasticsearch.action.ActionResponse; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.transport.RemoteConnectionInfo; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/cleanup/CleanupRepositoryResponse.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/cleanup/CleanupRepositoryResponse.java index 9203ef359c9a4..8bcedd274d613 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/cleanup/CleanupRepositoryResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/cleanup/CleanupRepositoryResponse.java @@ -10,12 +10,12 @@ import org.elasticsearch.action.ActionResponse; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.repositories.RepositoryCleanupResult; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/get/GetRepositoriesResponse.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/get/GetRepositoriesResponse.java index 93ecc7e7f5da6..da8642241f990 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/get/GetRepositoriesResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/get/GetRepositoriesResponse.java @@ -13,9 +13,9 @@ import org.elasticsearch.cluster.metadata.RepositoryMetadata; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/put/PutRepositoryRequest.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/put/PutRepositoryRequest.java index f50760d3bbad0..3aa500403062c 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/put/PutRepositoryRequest.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/put/PutRepositoryRequest.java @@ -13,9 +13,9 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.util.Map; diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/put/PutRepositoryRequestBuilder.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/put/PutRepositoryRequestBuilder.java index c41e1e0406cd8..596bb2d2c8ced 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/put/PutRepositoryRequestBuilder.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/put/PutRepositoryRequestBuilder.java @@ -12,7 +12,7 @@ import org.elasticsearch.action.support.master.AcknowledgedResponse; import org.elasticsearch.client.ElasticsearchClient; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import java.util.Map; diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/verify/VerifyRepositoryResponse.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/verify/VerifyRepositoryResponse.java index 5ec0d4b2a07e7..708e40f086214 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/verify/VerifyRepositoryResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/verify/VerifyRepositoryResponse.java @@ -14,11 +14,11 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Arrays; diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/reroute/ClusterRerouteResponse.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/reroute/ClusterRerouteResponse.java index dda004ae39eb7..bf671dd82bc3c 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/reroute/ClusterRerouteResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/reroute/ClusterRerouteResponse.java @@ -13,9 +13,9 @@ import org.elasticsearch.cluster.routing.allocation.RoutingExplanations; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/settings/ClusterGetSettingsResponse.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/settings/ClusterGetSettingsResponse.java index 5b373e09c84eb..b9234c3532681 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/settings/ClusterGetSettingsResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/settings/ClusterGetSettingsResponse.java @@ -9,20 +9,20 @@ package org.elasticsearch.action.admin.cluster.settings; import org.elasticsearch.action.ActionResponse; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * This response is specific to the REST client. {@link org.elasticsearch.action.admin.cluster.state.ClusterStateResponse} diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/settings/ClusterUpdateSettingsRequest.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/settings/ClusterUpdateSettingsRequest.java index 9cb624d6562ad..cea4cc0cde052 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/settings/ClusterUpdateSettingsRequest.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/settings/ClusterUpdateSettingsRequest.java @@ -10,15 +10,15 @@ import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.support.master.AcknowledgedRequest; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.util.Map; diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/settings/ClusterUpdateSettingsRequestBuilder.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/settings/ClusterUpdateSettingsRequestBuilder.java index a9ef0c859e89f..2c6f7fdba72a4 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/settings/ClusterUpdateSettingsRequestBuilder.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/settings/ClusterUpdateSettingsRequestBuilder.java @@ -11,7 +11,7 @@ import org.elasticsearch.action.support.master.AcknowledgedRequestBuilder; import org.elasticsearch.client.ElasticsearchClient; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import java.util.Map; diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/settings/ClusterUpdateSettingsResponse.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/settings/ClusterUpdateSettingsResponse.java index 08cc82735f09f..a810c399a6b80 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/settings/ClusterUpdateSettingsResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/settings/ClusterUpdateSettingsResponse.java @@ -9,18 +9,18 @@ package org.elasticsearch.action.admin.cluster.settings; import org.elasticsearch.action.support.master.AcknowledgedResponse; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; /** * A response for a cluster update settings action. diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/shards/ClusterSearchShardsGroup.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/shards/ClusterSearchShardsGroup.java index a86470a7f7678..fe73f9f05f1eb 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/shards/ClusterSearchShardsGroup.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/shards/ClusterSearchShardsGroup.java @@ -12,8 +12,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.shard.ShardId; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/shards/ClusterSearchShardsResponse.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/shards/ClusterSearchShardsResponse.java index 063353eff389f..c4370754fb079 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/shards/ClusterSearchShardsResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/shards/ClusterSearchShardsResponse.java @@ -12,8 +12,8 @@ import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.search.internal.AliasFilter; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/clone/CloneSnapshotRequest.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/clone/CloneSnapshotRequest.java index 6061a840440c8..65ca9bce89721 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/clone/CloneSnapshotRequest.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/clone/CloneSnapshotRequest.java @@ -15,8 +15,8 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/create/CreateSnapshotRequest.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/create/CreateSnapshotRequest.java index 9cdcd2b3bf1b1..00727fd00d0e9 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/create/CreateSnapshotRequest.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/create/CreateSnapshotRequest.java @@ -19,10 +19,10 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.core.Nullable; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import java.io.IOException; import java.util.Arrays; diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/create/CreateSnapshotResponse.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/create/CreateSnapshotResponse.java index e7a57abebc712..7062efd301991 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/create/CreateSnapshotResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/create/CreateSnapshotResponse.java @@ -11,15 +11,15 @@ import org.elasticsearch.action.ActionResponse; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.core.Nullable; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.snapshots.SnapshotInfo; import org.elasticsearch.snapshots.SnapshotInfo.SnapshotInfoBuilder; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/features/GetSnapshottableFeaturesResponse.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/features/GetSnapshottableFeaturesResponse.java index a2048bab29c58..95d171db33e74 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/features/GetSnapshottableFeaturesResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/features/GetSnapshottableFeaturesResponse.java @@ -12,8 +12,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Collections; diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/features/ResetFeatureStateResponse.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/features/ResetFeatureStateResponse.java index 3291e54f79df2..413b905dff738 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/features/ResetFeatureStateResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/features/ResetFeatureStateResponse.java @@ -13,9 +13,9 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.core.Nullable; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/get/GetSnapshotsResponse.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/get/GetSnapshotsResponse.java index fc323f114246b..4d4d5a6ea6075 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/get/GetSnapshotsResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/get/GetSnapshotsResponse.java @@ -13,14 +13,14 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.core.Nullable; import org.elasticsearch.snapshots.SnapshotInfo; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collections; diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/restore/RestoreSnapshotRequest.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/restore/RestoreSnapshotRequest.java index dce1e573d3ab6..b22ec18234e1c 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/restore/RestoreSnapshotRequest.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/restore/RestoreSnapshotRequest.java @@ -15,10 +15,10 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.core.Nullable; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/restore/RestoreSnapshotRequestBuilder.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/restore/RestoreSnapshotRequestBuilder.java index 1476822377db3..f8e47bfc9ba50 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/restore/RestoreSnapshotRequestBuilder.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/restore/RestoreSnapshotRequestBuilder.java @@ -12,7 +12,7 @@ import org.elasticsearch.action.support.master.MasterNodeOperationRequestBuilder; import org.elasticsearch.client.ElasticsearchClient; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import java.util.List; import java.util.Map; diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/restore/RestoreSnapshotResponse.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/restore/RestoreSnapshotResponse.java index 129ad1b8629b6..a2df3c1d439aa 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/restore/RestoreSnapshotResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/restore/RestoreSnapshotResponse.java @@ -11,20 +11,20 @@ import org.elasticsearch.action.ActionResponse; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.core.Nullable; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.snapshots.RestoreInfo; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * Contains information about restores snapshot diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotIndexShardStatus.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotIndexShardStatus.java index c395341dfa712..14a9ad4c28d9d 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotIndexShardStatus.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotIndexShardStatus.java @@ -13,22 +13,22 @@ import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParserUtils; import org.elasticsearch.index.Index; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.index.snapshots.IndexShardSnapshotStatus; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class SnapshotIndexShardStatus extends BroadcastShardResponse implements ToXContentFragment { diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotIndexStatus.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotIndexStatus.java index ce4923b20fae1..f9648579e2948 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotIndexStatus.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotIndexStatus.java @@ -8,13 +8,13 @@ package org.elasticsearch.action.admin.cluster.snapshots.status; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParserUtils; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collection; @@ -26,7 +26,7 @@ import static java.util.Collections.emptyMap; import static java.util.Collections.unmodifiableMap; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; /** * Represents snapshot status of all shards in the index diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotShardsStats.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotShardsStats.java index 864b0208d5f1e..e66bf0af476f1 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotShardsStats.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotShardsStats.java @@ -8,17 +8,17 @@ package org.elasticsearch.action.admin.cluster.snapshots.status; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collection; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; /** * Status of a snapshot shards diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotStats.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotStats.java index 0b3ae7b91967c..1b7de66954e3b 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotStats.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotStats.java @@ -13,12 +13,12 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParserUtils; import org.elasticsearch.core.TimeValue; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotStatus.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotStatus.java index 207197f3e8746..d365dd08555c5 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotStatus.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotStatus.java @@ -14,15 +14,15 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.core.Nullable; import org.elasticsearch.snapshots.Snapshot; import org.elasticsearch.snapshots.SnapshotId; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; @@ -37,8 +37,8 @@ import static java.util.Collections.emptyList; import static java.util.Collections.emptyMap; import static java.util.Collections.unmodifiableMap; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * Status of a snapshot diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotsStatusResponse.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotsStatusResponse.java index 45f332e743e5b..c8bc6608262ef 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotsStatusResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotsStatusResponse.java @@ -11,18 +11,18 @@ import org.elasticsearch.action.ActionResponse; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collections; import java.util.List; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; /** * Snapshot status response diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/stats/AnalysisStats.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/stats/AnalysisStats.java index 94cee3f6f475a..dfe14003ed662 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/stats/AnalysisStats.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/stats/AnalysisStats.java @@ -16,9 +16,9 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/stats/ClusterStatsIndices.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/stats/ClusterStatsIndices.java index b39d0ca0648fc..cb3a44d745e5b 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/stats/ClusterStatsIndices.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/stats/ClusterStatsIndices.java @@ -12,8 +12,8 @@ import com.carrotsearch.hppc.cursors.ObjectObjectCursor; import org.elasticsearch.action.admin.indices.stats.CommonStats; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.cache.query.QueryCacheStats; import org.elasticsearch.index.engine.SegmentsStats; import org.elasticsearch.index.fielddata.FieldDataStats; diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/stats/ClusterStatsNodes.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/stats/ClusterStatsNodes.java index 435e2856a9c51..29def459a3724 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/stats/ClusterStatsNodes.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/stats/ClusterStatsNodes.java @@ -22,8 +22,8 @@ import org.elasticsearch.common.transport.TransportAddress; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.discovery.DiscoveryModule; import org.elasticsearch.monitor.fs.FsInfo; import org.elasticsearch.monitor.jvm.JvmInfo; diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/stats/ClusterStatsResponse.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/stats/ClusterStatsResponse.java index 2b864c13bf9b8..8873716c0e054 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/stats/ClusterStatsResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/stats/ClusterStatsResponse.java @@ -16,9 +16,9 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import java.io.IOException; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/stats/FieldScriptStats.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/stats/FieldScriptStats.java index 82c6dc61ce734..fbbb9cfcfd58b 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/stats/FieldScriptStats.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/stats/FieldScriptStats.java @@ -11,8 +11,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/stats/FieldStats.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/stats/FieldStats.java index 94504dd3eab12..a691570e12b94 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/stats/FieldStats.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/stats/FieldStats.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.HashSet; diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/stats/IndexFeatureStats.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/stats/IndexFeatureStats.java index 19abe8e84a19c..7a7cdde4a887e 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/stats/IndexFeatureStats.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/stats/IndexFeatureStats.java @@ -11,8 +11,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/stats/MappingStats.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/stats/MappingStats.java index 835c72f73673b..6ba80a4351efc 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/stats/MappingStats.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/stats/MappingStats.java @@ -15,8 +15,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/stats/RuntimeFieldStats.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/stats/RuntimeFieldStats.java index 49011479de2c0..1d63d33ee5387 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/stats/RuntimeFieldStats.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/stats/RuntimeFieldStats.java @@ -11,8 +11,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.HashSet; diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/stats/VersionStats.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/stats/VersionStats.java index e0362e100a277..0400d7d4ec3ea 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/stats/VersionStats.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/stats/VersionStats.java @@ -18,9 +18,9 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/storedscripts/GetScriptContextResponse.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/storedscripts/GetScriptContextResponse.java index 7a5fef43dbd2a..42aae60cd5c03 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/storedscripts/GetScriptContextResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/storedscripts/GetScriptContextResponse.java @@ -9,13 +9,13 @@ package org.elasticsearch.action.admin.cluster.storedscripts; import org.elasticsearch.action.ActionResponse; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; import org.elasticsearch.common.xcontent.StatusToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.script.ScriptContextInfo; diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/storedscripts/GetScriptLanguageResponse.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/storedscripts/GetScriptLanguageResponse.java index e33932a96757c..8a31a68ab2c4c 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/storedscripts/GetScriptLanguageResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/storedscripts/GetScriptLanguageResponse.java @@ -13,8 +13,8 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.xcontent.StatusToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.script.ScriptLanguagesInfo; diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/storedscripts/GetStoredScriptResponse.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/storedscripts/GetStoredScriptResponse.java index 5a8c1a8f3e7dc..1ea96d5b1c979 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/storedscripts/GetStoredScriptResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/storedscripts/GetStoredScriptResponse.java @@ -9,22 +9,22 @@ package org.elasticsearch.action.admin.cluster.storedscripts; import org.elasticsearch.action.ActionResponse; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; import org.elasticsearch.common.xcontent.StatusToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.script.StoredScriptSource; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class GetStoredScriptResponse extends ActionResponse implements StatusToXContentObject { diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/storedscripts/PutStoredScriptRequest.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/storedscripts/PutStoredScriptRequest.java index f6a4c179ff6d0..a7d72962db212 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/storedscripts/PutStoredScriptRequest.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/storedscripts/PutStoredScriptRequest.java @@ -13,10 +13,10 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.script.StoredScriptSource; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/storedscripts/PutStoredScriptRequestBuilder.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/storedscripts/PutStoredScriptRequestBuilder.java index 4d947ba5e3b91..61a0711b5805e 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/storedscripts/PutStoredScriptRequestBuilder.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/storedscripts/PutStoredScriptRequestBuilder.java @@ -12,7 +12,7 @@ import org.elasticsearch.action.support.master.AcknowledgedResponse; import org.elasticsearch.client.ElasticsearchClient; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; public class PutStoredScriptRequestBuilder extends AcknowledgedRequestBuilder { diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/tasks/PendingClusterTasksResponse.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/tasks/PendingClusterTasksResponse.java index 08b3129e4643f..97c51f3ec4e22 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/tasks/PendingClusterTasksResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/tasks/PendingClusterTasksResponse.java @@ -12,8 +12,8 @@ import org.elasticsearch.cluster.service.PendingClusterTask; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Iterator; diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/alias/Alias.java b/server/src/main/java/org/elasticsearch/action/admin/indices/alias/Alias.java index fa14dae5d2191..7f695b6e3e622 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/alias/Alias.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/alias/Alias.java @@ -10,18 +10,18 @@ import org.elasticsearch.ElasticsearchGenerationException; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.query.QueryBuilder; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/alias/IndicesAliasesRequest.java b/server/src/main/java/org/elasticsearch/action/admin/indices/alias/IndicesAliasesRequest.java index 7d2646e25ec69..0e629f96cd5d9 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/alias/IndicesAliasesRequest.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/alias/IndicesAliasesRequest.java @@ -15,22 +15,22 @@ import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.master.AcknowledgedRequest; import org.elasticsearch.cluster.metadata.AliasAction; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.query.QueryBuilder; import java.io.IOException; @@ -43,8 +43,8 @@ import java.util.function.Supplier; import static org.elasticsearch.action.ValidateActions.addValidationError; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; -import static org.elasticsearch.common.xcontent.ObjectParser.fromList; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ObjectParser.fromList; /** * A request to add/remove aliases for one or more indices. diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/analyze/AnalyzeAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/analyze/AnalyzeAction.java index e739dcfba2e20..b070fe6aaec4a 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/analyze/AnalyzeAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/analyze/AnalyzeAction.java @@ -12,16 +12,16 @@ import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.ActionType; import org.elasticsearch.action.support.single.shard.SingleShardRequest; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.analysis.NameOrDefinition; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/cache/clear/ClearIndicesCacheResponse.java b/server/src/main/java/org/elasticsearch/action/admin/indices/cache/clear/ClearIndicesCacheResponse.java index 11eb99d923542..059b61567fa6e 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/cache/clear/ClearIndicesCacheResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/cache/clear/ClearIndicesCacheResponse.java @@ -11,8 +11,8 @@ import org.elasticsearch.action.support.DefaultShardOperationFailedException; import org.elasticsearch.action.support.broadcast.BroadcastResponse; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Arrays; diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/close/CloseIndexResponse.java b/server/src/main/java/org/elasticsearch/action/admin/indices/close/CloseIndexResponse.java index e75e593be969e..4a82c6de11dc6 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/close/CloseIndexResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/close/CloseIndexResponse.java @@ -16,8 +16,8 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.util.CollectionUtils; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.Index; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/create/CreateIndexRequest.java b/server/src/main/java/org/elasticsearch/action/admin/indices/create/CreateIndexRequest.java index 2870b71435f3b..ccbfb958bcb10 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/create/CreateIndexRequest.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/create/CreateIndexRequest.java @@ -18,21 +18,21 @@ import org.elasticsearch.action.support.ActiveShardCount; import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.master.AcknowledgedRequest; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.DeprecationHandler; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.mapper.MapperService; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/create/CreateIndexRequestBuilder.java b/server/src/main/java/org/elasticsearch/action/admin/indices/create/CreateIndexRequestBuilder.java index 4db0e283ee89d..05fd690d353ff 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/create/CreateIndexRequestBuilder.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/create/CreateIndexRequestBuilder.java @@ -15,8 +15,8 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import java.util.Map; diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/create/CreateIndexResponse.java b/server/src/main/java/org/elasticsearch/action/admin/indices/create/CreateIndexResponse.java index ec139d7178b9e..2a312544a9d5c 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/create/CreateIndexResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/create/CreateIndexResponse.java @@ -9,18 +9,18 @@ package org.elasticsearch.action.admin.indices.create; import org.elasticsearch.action.support.master.ShardsAcknowledgedResponse; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; /** * A response for a create index action. diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/dangling/list/ListDanglingIndicesResponse.java b/server/src/main/java/org/elasticsearch/action/admin/indices/dangling/list/ListDanglingIndicesResponse.java index 1cffe86ea08e4..8fabeba5fe1ff 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/dangling/list/ListDanglingIndicesResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/dangling/list/ListDanglingIndicesResponse.java @@ -15,8 +15,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.xcontent.StatusToXContentObject; -import org.elasticsearch.common.xcontent.XContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.rest.RestStatus; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/diskusage/AnalyzeIndexDiskUsageResponse.java b/server/src/main/java/org/elasticsearch/action/admin/indices/diskusage/AnalyzeIndexDiskUsageResponse.java index f390da3f9024d..4ca2f0f41c043 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/diskusage/AnalyzeIndexDiskUsageResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/diskusage/AnalyzeIndexDiskUsageResponse.java @@ -12,7 +12,7 @@ import org.elasticsearch.action.support.broadcast.BroadcastResponse; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/diskusage/IndexDiskUsageStats.java b/server/src/main/java/org/elasticsearch/action/admin/indices/diskusage/IndexDiskUsageStats.java index bf61d1d35d2de..13d9e9ee5a08e 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/diskusage/IndexDiskUsageStats.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/diskusage/IndexDiskUsageStats.java @@ -13,8 +13,8 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.HashMap; diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/flush/FlushResponse.java b/server/src/main/java/org/elasticsearch/action/admin/indices/flush/FlushResponse.java index 41f836b95b7aa..909c5d9b00f25 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/flush/FlushResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/flush/FlushResponse.java @@ -11,8 +11,8 @@ import org.elasticsearch.action.support.DefaultShardOperationFailedException; import org.elasticsearch.action.support.broadcast.BroadcastResponse; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Arrays; diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/forcemerge/ForceMergeResponse.java b/server/src/main/java/org/elasticsearch/action/admin/indices/forcemerge/ForceMergeResponse.java index 5b6d24f4cea63..6eb8d6c53e74d 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/forcemerge/ForceMergeResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/forcemerge/ForceMergeResponse.java @@ -11,8 +11,8 @@ import org.elasticsearch.action.support.DefaultShardOperationFailedException; import org.elasticsearch.action.support.broadcast.BroadcastResponse; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Arrays; diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/get/GetIndexResponse.java b/server/src/main/java/org/elasticsearch/action/admin/indices/get/GetIndexResponse.java index c691746cdbce9..9908a4312d376 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/get/GetIndexResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/get/GetIndexResponse.java @@ -18,8 +18,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.mapper.MapperService; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/mapping/get/GetFieldMappingsResponse.java b/server/src/main/java/org/elasticsearch/action/admin/indices/mapping/get/GetFieldMappingsResponse.java index 554cce56c1023..907b09a68a621 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/mapping/get/GetFieldMappingsResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/mapping/get/GetFieldMappingsResponse.java @@ -10,17 +10,17 @@ import org.elasticsearch.Version; import org.elasticsearch.action.ActionResponse; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.mapper.Mapper; import org.elasticsearch.index.mapper.MapperService; import org.elasticsearch.rest.BaseRestHandler; diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/mapping/get/GetMappingsResponse.java b/server/src/main/java/org/elasticsearch/action/admin/indices/mapping/get/GetMappingsResponse.java index e1c32c378af96..ac5e4a01c1669 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/mapping/get/GetMappingsResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/mapping/get/GetMappingsResponse.java @@ -12,14 +12,14 @@ import org.elasticsearch.Version; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.cluster.metadata.MappingMetadata; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.common.Strings; import org.elasticsearch.common.collect.ImmutableOpenMap; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.mapper.MapperService; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/mapping/get/TransportGetFieldMappingsIndexAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/mapping/get/TransportGetFieldMappingsIndexAction.java index 2e893d32d853a..085dd0a1eb581 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/mapping/get/TransportGetFieldMappingsIndexAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/mapping/get/TransportGetFieldMappingsIndexAction.java @@ -23,9 +23,9 @@ import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.regex.Regex; -import org.elasticsearch.common.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContent; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.IndexService; import org.elasticsearch.index.mapper.Mapper; import org.elasticsearch.index.mapper.MappingLookup; diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/mapping/put/PutMappingRequest.java b/server/src/main/java/org/elasticsearch/action/admin/indices/mapping/put/PutMappingRequest.java index 3ab9c32a7eb5b..101693576be4d 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/mapping/put/PutMappingRequest.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/mapping/put/PutMappingRequest.java @@ -22,10 +22,10 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.util.CollectionUtils; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.Index; import org.elasticsearch.index.mapper.MapperService; diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/mapping/put/PutMappingRequestBuilder.java b/server/src/main/java/org/elasticsearch/action/admin/indices/mapping/put/PutMappingRequestBuilder.java index 1efd025ade564..c9ddb16286911 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/mapping/put/PutMappingRequestBuilder.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/mapping/put/PutMappingRequestBuilder.java @@ -12,8 +12,8 @@ import org.elasticsearch.action.support.master.AcknowledgedRequestBuilder; import org.elasticsearch.action.support.master.AcknowledgedResponse; import org.elasticsearch.client.ElasticsearchClient; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.Index; import java.util.Map; diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/open/OpenIndexResponse.java b/server/src/main/java/org/elasticsearch/action/admin/indices/open/OpenIndexResponse.java index 37c18a477b603..d8375198e487a 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/open/OpenIndexResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/open/OpenIndexResponse.java @@ -11,8 +11,8 @@ import org.elasticsearch.action.support.master.ShardsAcknowledgedResponse; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/readonly/AddIndexBlockResponse.java b/server/src/main/java/org/elasticsearch/action/admin/indices/readonly/AddIndexBlockResponse.java index 66470343b4986..75b50910e41b5 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/readonly/AddIndexBlockResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/readonly/AddIndexBlockResponse.java @@ -15,9 +15,9 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.util.CollectionUtils; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.core.Nullable; import org.elasticsearch.index.Index; diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/recovery/RecoveryResponse.java b/server/src/main/java/org/elasticsearch/action/admin/indices/recovery/RecoveryResponse.java index 610c2380dcac8..596e362473243 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/recovery/RecoveryResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/recovery/RecoveryResponse.java @@ -13,7 +13,7 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.indices.recovery.RecoveryState; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/refresh/RefreshResponse.java b/server/src/main/java/org/elasticsearch/action/admin/indices/refresh/RefreshResponse.java index 4c162fa14ef24..2cf91913ab429 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/refresh/RefreshResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/refresh/RefreshResponse.java @@ -11,8 +11,8 @@ import org.elasticsearch.action.support.DefaultShardOperationFailedException; import org.elasticsearch.action.support.broadcast.BroadcastResponse; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Arrays; diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/resolve/ResolveIndexAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/resolve/ResolveIndexAction.java index 9a111642f01d4..2c16f441bfbc5 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/resolve/ResolveIndexAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/resolve/ResolveIndexAction.java @@ -32,9 +32,9 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.util.concurrent.CountDown; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.core.Nullable; import org.elasticsearch.tasks.Task; import org.elasticsearch.threadpool.ThreadPool; diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/Condition.java b/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/Condition.java index 5065fdc540ea0..252dd89915b1d 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/Condition.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/Condition.java @@ -11,7 +11,7 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.NamedWriteable; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.ToXContentFragment; import java.util.Objects; diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/MaxAgeCondition.java b/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/MaxAgeCondition.java index 6ce8379121895..2da69d3349b96 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/MaxAgeCondition.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/MaxAgeCondition.java @@ -11,8 +11,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/MaxDocsCondition.java b/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/MaxDocsCondition.java index ecf58a46dd1dc..efe304d64a146 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/MaxDocsCondition.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/MaxDocsCondition.java @@ -10,8 +10,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/MaxPrimaryShardSizeCondition.java b/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/MaxPrimaryShardSizeCondition.java index 1caad235307ad..e30bcac78d17d 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/MaxPrimaryShardSizeCondition.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/MaxPrimaryShardSizeCondition.java @@ -12,8 +12,8 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/MaxSizeCondition.java b/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/MaxSizeCondition.java index c72dedc8f2b64..9ed097b4e99d0 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/MaxSizeCondition.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/MaxSizeCondition.java @@ -12,8 +12,8 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/RolloverInfo.java b/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/RolloverInfo.java index 3d0a0f4a74aa7..b544db5f227c8 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/RolloverInfo.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/RolloverInfo.java @@ -10,15 +10,15 @@ import org.elasticsearch.cluster.AbstractDiffable; import org.elasticsearch.cluster.Diff; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/RolloverRequest.java b/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/RolloverRequest.java index 1b97df88a28e2..69b73aba7a9c3 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/RolloverRequest.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/RolloverRequest.java @@ -13,14 +13,14 @@ import org.elasticsearch.action.support.ActiveShardCount; import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.master.AcknowledgedRequest; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.mapper.MapperService; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/RolloverResponse.java b/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/RolloverResponse.java index 8484c04dfa29d..b14c0d88934fe 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/RolloverResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/RolloverResponse.java @@ -9,11 +9,11 @@ package org.elasticsearch.action.admin.indices.rollover; import org.elasticsearch.action.support.master.ShardsAcknowledgedResponse; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.HashMap; diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/segments/IndicesSegmentResponse.java b/server/src/main/java/org/elasticsearch/action/admin/indices/segments/IndicesSegmentResponse.java index 776d2db03692e..f791263a63c01 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/segments/IndicesSegmentResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/segments/IndicesSegmentResponse.java @@ -18,7 +18,7 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.index.engine.Segment; import org.elasticsearch.transport.Transports; diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/settings/get/GetSettingsResponse.java b/server/src/main/java/org/elasticsearch/action/admin/indices/settings/get/GetSettingsResponse.java index 2a4ef70ab11ac..c7d45648e0328 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/settings/get/GetSettingsResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/settings/get/GetSettingsResponse.java @@ -15,12 +15,12 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParserUtils; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.json.JsonXContent; import java.io.ByteArrayOutputStream; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/settings/put/UpdateSettingsRequest.java b/server/src/main/java/org/elasticsearch/action/admin/indices/settings/put/UpdateSettingsRequest.java index 78cf32952a66c..f2e5a17ef1800 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/settings/put/UpdateSettingsRequest.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/settings/put/UpdateSettingsRequest.java @@ -17,10 +17,10 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.util.Arrays; diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/settings/put/UpdateSettingsRequestBuilder.java b/server/src/main/java/org/elasticsearch/action/admin/indices/settings/put/UpdateSettingsRequestBuilder.java index 04e61225f1f67..e48c2f1da6786 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/settings/put/UpdateSettingsRequestBuilder.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/settings/put/UpdateSettingsRequestBuilder.java @@ -13,7 +13,7 @@ import org.elasticsearch.action.support.master.AcknowledgedResponse; import org.elasticsearch.client.ElasticsearchClient; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import java.util.Map; diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/shards/IndicesShardStoresResponse.java b/server/src/main/java/org/elasticsearch/action/admin/indices/shards/IndicesShardStoresResponse.java index cfc495ca39200..ab48aac139fe5 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/shards/IndicesShardStoresResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/shards/IndicesShardStoresResponse.java @@ -19,8 +19,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Collections; diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/shrink/ResizeRequest.java b/server/src/main/java/org/elasticsearch/action/admin/indices/shrink/ResizeRequest.java index 976e0a168b01d..2067cb654fdb8 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/shrink/ResizeRequest.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/shrink/ResizeRequest.java @@ -15,14 +15,14 @@ import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.master.AcknowledgedRequest; import org.elasticsearch.cluster.metadata.IndexMetadata; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/shrink/ResizeResponse.java b/server/src/main/java/org/elasticsearch/action/admin/indices/shrink/ResizeResponse.java index 32340404308b7..3d5765eac010c 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/shrink/ResizeResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/shrink/ResizeResponse.java @@ -10,8 +10,8 @@ import org.elasticsearch.action.admin.indices.create.CreateIndexResponse; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/stats/CommonStats.java b/server/src/main/java/org/elasticsearch/action/admin/indices/stats/CommonStats.java index 40051fbd01adf..edaff6b144291 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/stats/CommonStats.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/stats/CommonStats.java @@ -14,9 +14,9 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.core.Nullable; import org.elasticsearch.index.bulk.stats.BulkStats; import org.elasticsearch.index.cache.query.QueryCacheStats; diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/stats/FieldUsageShardResponse.java b/server/src/main/java/org/elasticsearch/action/admin/indices/stats/FieldUsageShardResponse.java index b33b4ab369c8a..5cd3a7e73e0d3 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/stats/FieldUsageShardResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/stats/FieldUsageShardResponse.java @@ -12,8 +12,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.search.stats.FieldUsageStats; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/stats/FieldUsageStatsResponse.java b/server/src/main/java/org/elasticsearch/action/admin/indices/stats/FieldUsageStatsResponse.java index 730598e347d4c..c24e25f168256 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/stats/FieldUsageStatsResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/stats/FieldUsageStatsResponse.java @@ -12,7 +12,7 @@ import org.elasticsearch.action.support.broadcast.BroadcastResponse; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/stats/IndicesStatsResponse.java b/server/src/main/java/org/elasticsearch/action/admin/indices/stats/IndicesStatsResponse.java index cf8a5800f6ee8..e1bb9cd88d812 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/stats/IndicesStatsResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/stats/IndicesStatsResponse.java @@ -15,7 +15,7 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.Index; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/stats/ShardStats.java b/server/src/main/java/org/elasticsearch/action/admin/indices/stats/ShardStats.java index 15b82b370799c..836fdf74926f5 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/stats/ShardStats.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/stats/ShardStats.java @@ -13,8 +13,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.engine.CommitStats; import org.elasticsearch.index.seqno.RetentionLeaseStats; import org.elasticsearch.index.seqno.SeqNoStats; diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/template/get/GetComponentTemplateAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/template/get/GetComponentTemplateAction.java index bc2be307ab977..fff255a9f5b2b 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/template/get/GetComponentTemplateAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/template/get/GetComponentTemplateAction.java @@ -14,11 +14,11 @@ import org.elasticsearch.action.support.master.MasterNodeReadRequest; import org.elasticsearch.cluster.metadata.ComponentTemplate; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Map; diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/template/get/GetComposableIndexTemplateAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/template/get/GetComposableIndexTemplateAction.java index f9ee6e0baf448..5026ffb7f2cce 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/template/get/GetComposableIndexTemplateAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/template/get/GetComposableIndexTemplateAction.java @@ -14,11 +14,11 @@ import org.elasticsearch.action.support.master.MasterNodeReadRequest; import org.elasticsearch.cluster.metadata.ComposableIndexTemplate; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Map; diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/template/get/GetIndexTemplatesResponse.java b/server/src/main/java/org/elasticsearch/action/admin/indices/template/get/GetIndexTemplatesResponse.java index 5e7e6a18f0743..0ebff054b1e40 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/template/get/GetIndexTemplatesResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/template/get/GetIndexTemplatesResponse.java @@ -12,9 +12,9 @@ import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/template/post/SimulateIndexTemplateResponse.java b/server/src/main/java/org/elasticsearch/action/admin/indices/template/post/SimulateIndexTemplateResponse.java index 6f8a561199184..9307bdac3d335 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/template/post/SimulateIndexTemplateResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/template/post/SimulateIndexTemplateResponse.java @@ -11,11 +11,11 @@ import org.elasticsearch.action.ActionResponse; import org.elasticsearch.cluster.metadata.Template; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.HashMap; diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/template/post/TransportSimulateIndexTemplateAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/template/post/TransportSimulateIndexTemplateAction.java index afd7f41b63a66..a389ef8b10f15 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/template/post/TransportSimulateIndexTemplateAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/template/post/TransportSimulateIndexTemplateAction.java @@ -29,7 +29,7 @@ import org.elasticsearch.common.compress.CompressedXContent; import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.MapperService; import org.elasticsearch.indices.IndicesService; diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/template/post/TransportSimulateTemplateAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/template/post/TransportSimulateTemplateAction.java index c143f8d769ee3..5497374fd7ac9 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/template/post/TransportSimulateTemplateAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/template/post/TransportSimulateTemplateAction.java @@ -22,7 +22,7 @@ import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.UUIDs; import org.elasticsearch.common.inject.Inject; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.indices.IndicesService; import org.elasticsearch.tasks.Task; import org.elasticsearch.threadpool.ThreadPool; diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/template/put/PutIndexTemplateRequest.java b/server/src/main/java/org/elasticsearch/action/admin/indices/template/put/PutIndexTemplateRequest.java index f3ee92307e251..fd1a75b8e2251 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/template/put/PutIndexTemplateRequest.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/template/put/PutIndexTemplateRequest.java @@ -24,12 +24,12 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.index.mapper.MapperService; diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/template/put/PutIndexTemplateRequestBuilder.java b/server/src/main/java/org/elasticsearch/action/admin/indices/template/put/PutIndexTemplateRequestBuilder.java index 05b73a385a26a..eb33e536f30eb 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/template/put/PutIndexTemplateRequestBuilder.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/template/put/PutIndexTemplateRequestBuilder.java @@ -13,8 +13,8 @@ import org.elasticsearch.client.ElasticsearchClient; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import java.util.List; import java.util.Map; diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/validate/query/QueryExplanation.java b/server/src/main/java/org/elasticsearch/action/admin/indices/validate/query/QueryExplanation.java index 0d0ed5b6c5825..fce89e40b5218 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/validate/query/QueryExplanation.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/validate/query/QueryExplanation.java @@ -8,20 +8,20 @@ package org.elasticsearch.action.admin.indices.validate.query; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class QueryExplanation implements Writeable, ToXContentFragment { diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/validate/query/ValidateQueryRequest.java b/server/src/main/java/org/elasticsearch/action/admin/indices/validate/query/ValidateQueryRequest.java index 4ca09393977eb..472b341983e5a 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/validate/query/ValidateQueryRequest.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/validate/query/ValidateQueryRequest.java @@ -16,8 +16,8 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.query.MatchAllQueryBuilder; import org.elasticsearch.index.query.QueryBuilder; diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/validate/query/ValidateQueryResponse.java b/server/src/main/java/org/elasticsearch/action/admin/indices/validate/query/ValidateQueryResponse.java index 13ed4fa7ecc6a..e82aed83b7c2b 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/validate/query/ValidateQueryResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/validate/query/ValidateQueryResponse.java @@ -10,20 +10,20 @@ import org.elasticsearch.action.support.DefaultShardOperationFailedException; import org.elasticsearch.action.support.broadcast.BroadcastResponse; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Arrays; import java.util.Collections; import java.util.List; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * The response of the validate action. diff --git a/server/src/main/java/org/elasticsearch/action/bulk/BulkItemResponse.java b/server/src/main/java/org/elasticsearch/action/bulk/BulkItemResponse.java index b109514f70e76..33902b937d1f3 100644 --- a/server/src/main/java/org/elasticsearch/action/bulk/BulkItemResponse.java +++ b/server/src/main/java/org/elasticsearch/action/bulk/BulkItemResponse.java @@ -17,17 +17,17 @@ import org.elasticsearch.action.index.IndexResponse; import org.elasticsearch.action.update.UpdateResponse; import org.elasticsearch.core.CheckedConsumer; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; import org.elasticsearch.common.xcontent.StatusToXContentObject; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.mapper.MapperService; import org.elasticsearch.index.seqno.SequenceNumbers; import org.elasticsearch.index.shard.ShardId; @@ -35,8 +35,8 @@ import java.io.IOException; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; import static org.elasticsearch.common.xcontent.XContentParserUtils.ensureExpectedToken; import static org.elasticsearch.common.xcontent.XContentParserUtils.throwUnknownField; diff --git a/server/src/main/java/org/elasticsearch/action/bulk/BulkProcessor.java b/server/src/main/java/org/elasticsearch/action/bulk/BulkProcessor.java index b8fb840942c56..18b9821105424 100644 --- a/server/src/main/java/org/elasticsearch/action/bulk/BulkProcessor.java +++ b/server/src/main/java/org/elasticsearch/action/bulk/BulkProcessor.java @@ -21,7 +21,7 @@ import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.threadpool.Scheduler; import org.elasticsearch.threadpool.ThreadPool; diff --git a/server/src/main/java/org/elasticsearch/action/bulk/BulkRequest.java b/server/src/main/java/org/elasticsearch/action/bulk/BulkRequest.java index a95811fbe06e7..26edb77b7f7a6 100644 --- a/server/src/main/java/org/elasticsearch/action/bulk/BulkRequest.java +++ b/server/src/main/java/org/elasticsearch/action/bulk/BulkRequest.java @@ -28,7 +28,7 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.search.fetch.subphase.FetchSourceContext; import org.elasticsearch.transport.RawIndexingDataTransportRequest; diff --git a/server/src/main/java/org/elasticsearch/action/bulk/BulkRequestBuilder.java b/server/src/main/java/org/elasticsearch/action/bulk/BulkRequestBuilder.java index 509f8962bf230..a2243fe2fa273 100644 --- a/server/src/main/java/org/elasticsearch/action/bulk/BulkRequestBuilder.java +++ b/server/src/main/java/org/elasticsearch/action/bulk/BulkRequestBuilder.java @@ -21,7 +21,7 @@ import org.elasticsearch.client.ElasticsearchClient; import org.elasticsearch.core.Nullable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; /** * A bulk request holds an ordered {@link IndexRequest}s and {@link DeleteRequest}s and allows to executes diff --git a/server/src/main/java/org/elasticsearch/action/bulk/BulkRequestParser.java b/server/src/main/java/org/elasticsearch/action/bulk/BulkRequestParser.java index f0bab54d1e2d3..7aba28df240ac 100644 --- a/server/src/main/java/org/elasticsearch/action/bulk/BulkRequestParser.java +++ b/server/src/main/java/org/elasticsearch/action/bulk/BulkRequestParser.java @@ -13,16 +13,16 @@ import org.elasticsearch.action.index.IndexRequest; import org.elasticsearch.action.update.UpdateRequest; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.logging.DeprecationLogger; import org.elasticsearch.common.lucene.uid.Versions; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContent; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.VersionType; import org.elasticsearch.index.seqno.SequenceNumbers; import org.elasticsearch.rest.action.document.RestBulkAction; diff --git a/server/src/main/java/org/elasticsearch/action/bulk/BulkResponse.java b/server/src/main/java/org/elasticsearch/action/bulk/BulkResponse.java index 470559034020b..8c2d8966682d3 100644 --- a/server/src/main/java/org/elasticsearch/action/bulk/BulkResponse.java +++ b/server/src/main/java/org/elasticsearch/action/bulk/BulkResponse.java @@ -13,8 +13,8 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.xcontent.StatusToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.rest.RestStatus; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/action/bulk/TransportShardBulkAction.java b/server/src/main/java/org/elasticsearch/action/bulk/TransportShardBulkAction.java index d942deaef9fe6..62a1a7e6ef0d0 100644 --- a/server/src/main/java/org/elasticsearch/action/bulk/TransportShardBulkAction.java +++ b/server/src/main/java/org/elasticsearch/action/bulk/TransportShardBulkAction.java @@ -42,9 +42,9 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContent; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.IndexingPressure; import org.elasticsearch.index.engine.Engine; import org.elasticsearch.index.engine.VersionConflictEngineException; diff --git a/server/src/main/java/org/elasticsearch/action/delete/DeleteResponse.java b/server/src/main/java/org/elasticsearch/action/delete/DeleteResponse.java index 6153d12e4c6c5..e4ca7e798c52a 100644 --- a/server/src/main/java/org/elasticsearch/action/delete/DeleteResponse.java +++ b/server/src/main/java/org/elasticsearch/action/delete/DeleteResponse.java @@ -10,7 +10,7 @@ import org.elasticsearch.action.DocWriteResponse; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.rest.RestStatus; diff --git a/server/src/main/java/org/elasticsearch/action/explain/ExplainRequest.java b/server/src/main/java/org/elasticsearch/action/explain/ExplainRequest.java index 5d913dff33838..48b74f42365d6 100644 --- a/server/src/main/java/org/elasticsearch/action/explain/ExplainRequest.java +++ b/server/src/main/java/org/elasticsearch/action/explain/ExplainRequest.java @@ -12,12 +12,12 @@ import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ValidateActions; import org.elasticsearch.action.support.single.shard.SingleShardRequest; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.mapper.MapperService; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.search.fetch.subphase.FetchSourceContext; diff --git a/server/src/main/java/org/elasticsearch/action/explain/ExplainResponse.java b/server/src/main/java/org/elasticsearch/action/explain/ExplainResponse.java index 26dbd0187f8f3..d0ca045af726c 100644 --- a/server/src/main/java/org/elasticsearch/action/explain/ExplainResponse.java +++ b/server/src/main/java/org/elasticsearch/action/explain/ExplainResponse.java @@ -11,14 +11,14 @@ import org.apache.lucene.search.Explanation; import org.elasticsearch.Version; import org.elasticsearch.action.ActionResponse; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; import org.elasticsearch.common.xcontent.StatusToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.get.GetResult; import org.elasticsearch.index.mapper.MapperService; import org.elasticsearch.rest.RestStatus; diff --git a/server/src/main/java/org/elasticsearch/action/fieldcaps/FieldCapabilities.java b/server/src/main/java/org/elasticsearch/action/fieldcaps/FieldCapabilities.java index 14e9e70428651..2d0f5e395ba1c 100644 --- a/server/src/main/java/org/elasticsearch/action/fieldcaps/FieldCapabilities.java +++ b/server/src/main/java/org/elasticsearch/action/fieldcaps/FieldCapabilities.java @@ -8,15 +8,15 @@ package org.elasticsearch.action.fieldcaps; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesFailure.java b/server/src/main/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesFailure.java index c436a6ef59413..68bc30d3c9f37 100644 --- a/server/src/main/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesFailure.java +++ b/server/src/main/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesFailure.java @@ -9,14 +9,14 @@ package org.elasticsearch.action.fieldcaps; import org.elasticsearch.ElasticsearchException; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParserUtils; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesRequest.java b/server/src/main/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesRequest.java index d69366793e87a..0b6dc8c7dbc4b 100644 --- a/server/src/main/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesRequest.java +++ b/server/src/main/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesRequest.java @@ -16,8 +16,8 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.query.QueryBuilder; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesResponse.java b/server/src/main/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesResponse.java index 8442e707b74d6..946b4d1272784 100644 --- a/server/src/main/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesResponse.java +++ b/server/src/main/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesResponse.java @@ -12,11 +12,11 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParserUtils; import org.elasticsearch.core.Tuple; diff --git a/server/src/main/java/org/elasticsearch/action/get/GetResponse.java b/server/src/main/java/org/elasticsearch/action/get/GetResponse.java index dae56bc9b9579..2ea3488c077f0 100644 --- a/server/src/main/java/org/elasticsearch/action/get/GetResponse.java +++ b/server/src/main/java/org/elasticsearch/action/get/GetResponse.java @@ -16,9 +16,9 @@ import org.elasticsearch.common.document.DocumentField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.get.GetResult; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/action/get/MultiGetRequest.java b/server/src/main/java/org/elasticsearch/action/get/MultiGetRequest.java index 52bbab56dd96c..2b69271d6e5fc 100644 --- a/server/src/main/java/org/elasticsearch/action/get/MultiGetRequest.java +++ b/server/src/main/java/org/elasticsearch/action/get/MultiGetRequest.java @@ -18,7 +18,7 @@ import org.elasticsearch.action.ValidateActions; import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.ParsingException; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.common.Strings; @@ -27,10 +27,10 @@ import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.logging.DeprecationLogger; import org.elasticsearch.common.lucene.uid.Versions; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentParser.Token; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser.Token; import org.elasticsearch.index.VersionType; import org.elasticsearch.index.mapper.MapperService; import org.elasticsearch.rest.action.document.RestMultiGetAction; diff --git a/server/src/main/java/org/elasticsearch/action/get/MultiGetResponse.java b/server/src/main/java/org/elasticsearch/action/get/MultiGetResponse.java index 5c949598d6979..f5e6c74bf6d9a 100644 --- a/server/src/main/java/org/elasticsearch/action/get/MultiGetResponse.java +++ b/server/src/main/java/org/elasticsearch/action/get/MultiGetResponse.java @@ -11,16 +11,16 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.Version; import org.elasticsearch.action.ActionResponse; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.logging.DeprecationLogger; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentParser.Token; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser.Token; import org.elasticsearch.index.get.GetResult; import org.elasticsearch.index.mapper.MapperService; import org.elasticsearch.rest.action.document.RestMultiGetAction; diff --git a/server/src/main/java/org/elasticsearch/action/index/IndexRequest.java b/server/src/main/java/org/elasticsearch/action/index/IndexRequest.java index b74d6676a0eb6..945b89cb41edf 100644 --- a/server/src/main/java/org/elasticsearch/action/index/IndexRequest.java +++ b/server/src/main/java/org/elasticsearch/action/index/IndexRequest.java @@ -29,10 +29,10 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.lucene.uid.Versions; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.VersionType; import org.elasticsearch.index.mapper.MapperService; import org.elasticsearch.index.shard.ShardId; @@ -55,8 +55,8 @@ * {@link #source(byte[], XContentType)} to be set. * * The source (content to index) can be set in its bytes form using ({@link #source(byte[], XContentType)}), - * its string form ({@link #source(String, XContentType)}) or using a {@link org.elasticsearch.common.xcontent.XContentBuilder} - * ({@link #source(org.elasticsearch.common.xcontent.XContentBuilder)}). + * its string form ({@link #source(String, XContentType)}) or using a {@link org.elasticsearch.xcontent.XContentBuilder} + * ({@link #source(org.elasticsearch.xcontent.XContentBuilder)}). * * If the {@link #id(String)} is not set, it will be automatically generated. * diff --git a/server/src/main/java/org/elasticsearch/action/index/IndexRequestBuilder.java b/server/src/main/java/org/elasticsearch/action/index/IndexRequestBuilder.java index a94ece210f541..b2f6987571c90 100644 --- a/server/src/main/java/org/elasticsearch/action/index/IndexRequestBuilder.java +++ b/server/src/main/java/org/elasticsearch/action/index/IndexRequestBuilder.java @@ -14,8 +14,8 @@ import org.elasticsearch.client.ElasticsearchClient; import org.elasticsearch.core.Nullable; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.VersionType; import java.util.Map; diff --git a/server/src/main/java/org/elasticsearch/action/index/IndexResponse.java b/server/src/main/java/org/elasticsearch/action/index/IndexResponse.java index da029e7ae39c7..9a9ce9de5d077 100644 --- a/server/src/main/java/org/elasticsearch/action/index/IndexResponse.java +++ b/server/src/main/java/org/elasticsearch/action/index/IndexResponse.java @@ -11,7 +11,7 @@ import org.elasticsearch.action.DocWriteResponse; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.rest.RestStatus; diff --git a/server/src/main/java/org/elasticsearch/action/ingest/GetPipelineResponse.java b/server/src/main/java/org/elasticsearch/action/ingest/GetPipelineResponse.java index fa4e99b006596..ad0a8a46b4a35 100644 --- a/server/src/main/java/org/elasticsearch/action/ingest/GetPipelineResponse.java +++ b/server/src/main/java/org/elasticsearch/action/ingest/GetPipelineResponse.java @@ -14,9 +14,9 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.xcontent.StatusToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentParser.Token; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser.Token; import org.elasticsearch.ingest.PipelineConfiguration; import org.elasticsearch.rest.RestStatus; diff --git a/server/src/main/java/org/elasticsearch/action/ingest/PutPipelineRequest.java b/server/src/main/java/org/elasticsearch/action/ingest/PutPipelineRequest.java index 4f2033fe560d7..700d361e8ef3d 100644 --- a/server/src/main/java/org/elasticsearch/action/ingest/PutPipelineRequest.java +++ b/server/src/main/java/org/elasticsearch/action/ingest/PutPipelineRequest.java @@ -13,10 +13,10 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.util.Objects; diff --git a/server/src/main/java/org/elasticsearch/action/ingest/PutPipelineRequestBuilder.java b/server/src/main/java/org/elasticsearch/action/ingest/PutPipelineRequestBuilder.java index 768443f4a281f..9e7fc63f9cbaf 100644 --- a/server/src/main/java/org/elasticsearch/action/ingest/PutPipelineRequestBuilder.java +++ b/server/src/main/java/org/elasticsearch/action/ingest/PutPipelineRequestBuilder.java @@ -12,7 +12,7 @@ import org.elasticsearch.action.support.master.AcknowledgedResponse; import org.elasticsearch.client.ElasticsearchClient; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; public class PutPipelineRequestBuilder extends ActionRequestBuilder { diff --git a/server/src/main/java/org/elasticsearch/action/ingest/SimulateDocumentBaseResult.java b/server/src/main/java/org/elasticsearch/action/ingest/SimulateDocumentBaseResult.java index 74fb8205bf145..fc510f91a08b0 100644 --- a/server/src/main/java/org/elasticsearch/action/ingest/SimulateDocumentBaseResult.java +++ b/server/src/main/java/org/elasticsearch/action/ingest/SimulateDocumentBaseResult.java @@ -8,17 +8,17 @@ package org.elasticsearch.action.ingest; import org.elasticsearch.ElasticsearchException; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.ingest.IngestDocument; import java.io.IOException; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * Holds the end result of what a pipeline did to sample document provided via the simulate api. diff --git a/server/src/main/java/org/elasticsearch/action/ingest/SimulateDocumentResult.java b/server/src/main/java/org/elasticsearch/action/ingest/SimulateDocumentResult.java index f88be08676e32..3180cedf8e3a5 100644 --- a/server/src/main/java/org/elasticsearch/action/ingest/SimulateDocumentResult.java +++ b/server/src/main/java/org/elasticsearch/action/ingest/SimulateDocumentResult.java @@ -8,7 +8,7 @@ package org.elasticsearch.action.ingest; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.ToXContentObject; public interface SimulateDocumentResult extends Writeable, ToXContentObject { diff --git a/server/src/main/java/org/elasticsearch/action/ingest/SimulateDocumentVerboseResult.java b/server/src/main/java/org/elasticsearch/action/ingest/SimulateDocumentVerboseResult.java index 9e5b07f128d4c..343ec2b088526 100644 --- a/server/src/main/java/org/elasticsearch/action/ingest/SimulateDocumentVerboseResult.java +++ b/server/src/main/java/org/elasticsearch/action/ingest/SimulateDocumentVerboseResult.java @@ -7,18 +7,18 @@ */ package org.elasticsearch.action.ingest; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; import java.util.List; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; /** * Holds the result of what a pipeline did to a sample document via the simulate api, but instead of {@link SimulateDocumentBaseResult} diff --git a/server/src/main/java/org/elasticsearch/action/ingest/SimulatePipelineRequest.java b/server/src/main/java/org/elasticsearch/action/ingest/SimulatePipelineRequest.java index 586671cad3de6..9a8f91c6703b8 100644 --- a/server/src/main/java/org/elasticsearch/action/ingest/SimulatePipelineRequest.java +++ b/server/src/main/java/org/elasticsearch/action/ingest/SimulatePipelineRequest.java @@ -14,10 +14,10 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.logging.DeprecationLogger; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.index.VersionType; import org.elasticsearch.ingest.ConfigurationUtils; diff --git a/server/src/main/java/org/elasticsearch/action/ingest/SimulatePipelineRequestBuilder.java b/server/src/main/java/org/elasticsearch/action/ingest/SimulatePipelineRequestBuilder.java index bec14ab4ade78..9ba4aab6091c4 100644 --- a/server/src/main/java/org/elasticsearch/action/ingest/SimulatePipelineRequestBuilder.java +++ b/server/src/main/java/org/elasticsearch/action/ingest/SimulatePipelineRequestBuilder.java @@ -11,7 +11,7 @@ import org.elasticsearch.action.ActionRequestBuilder; import org.elasticsearch.client.ElasticsearchClient; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; public class SimulatePipelineRequestBuilder extends ActionRequestBuilder { diff --git a/server/src/main/java/org/elasticsearch/action/ingest/SimulatePipelineResponse.java b/server/src/main/java/org/elasticsearch/action/ingest/SimulatePipelineResponse.java index 58a56742c8e27..4538c4d41adcd 100644 --- a/server/src/main/java/org/elasticsearch/action/ingest/SimulatePipelineResponse.java +++ b/server/src/main/java/org/elasticsearch/action/ingest/SimulatePipelineResponse.java @@ -10,21 +10,21 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.action.ActionResponse; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentParser.Token; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser.Token; import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import java.util.List; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; import static org.elasticsearch.common.xcontent.XContentParserUtils.ensureExpectedToken; public class SimulatePipelineResponse extends ActionResponse implements ToXContentObject { diff --git a/server/src/main/java/org/elasticsearch/action/ingest/SimulateProcessorResult.java b/server/src/main/java/org/elasticsearch/action/ingest/SimulateProcessorResult.java index 32817b6b596b1..3a19537eedca1 100644 --- a/server/src/main/java/org/elasticsearch/action/ingest/SimulateProcessorResult.java +++ b/server/src/main/java/org/elasticsearch/action/ingest/SimulateProcessorResult.java @@ -8,23 +8,23 @@ package org.elasticsearch.action.ingest; import org.elasticsearch.ElasticsearchException; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.Tuple; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.ingest.ConfigurationUtils; import org.elasticsearch.ingest.IngestDocument; import java.io.IOException; import java.util.Locale; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class SimulateProcessorResult implements Writeable, ToXContentObject { diff --git a/server/src/main/java/org/elasticsearch/action/ingest/WriteableIngestDocument.java b/server/src/main/java/org/elasticsearch/action/ingest/WriteableIngestDocument.java index c28d62945aa65..03718d7faca9a 100644 --- a/server/src/main/java/org/elasticsearch/action/ingest/WriteableIngestDocument.java +++ b/server/src/main/java/org/elasticsearch/action/ingest/WriteableIngestDocument.java @@ -8,14 +8,14 @@ package org.elasticsearch.action.ingest; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.index.mapper.MapperService; import org.elasticsearch.ingest.IngestDocument; @@ -27,8 +27,8 @@ import java.util.Map; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; final class WriteableIngestDocument implements Writeable, ToXContentFragment { diff --git a/server/src/main/java/org/elasticsearch/action/main/MainResponse.java b/server/src/main/java/org/elasticsearch/action/main/MainResponse.java index 243428ddfa2f8..5a1442f5b6ffe 100644 --- a/server/src/main/java/org/elasticsearch/action/main/MainResponse.java +++ b/server/src/main/java/org/elasticsearch/action/main/MainResponse.java @@ -12,13 +12,13 @@ import org.elasticsearch.Version; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.cluster.ClusterName; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/server/src/main/java/org/elasticsearch/action/search/ClearScrollRequest.java b/server/src/main/java/org/elasticsearch/action/search/ClearScrollRequest.java index eab4e67d6d58b..3c2a2927371ba 100644 --- a/server/src/main/java/org/elasticsearch/action/search/ClearScrollRequest.java +++ b/server/src/main/java/org/elasticsearch/action/search/ClearScrollRequest.java @@ -12,9 +12,9 @@ import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/action/search/ClearScrollResponse.java b/server/src/main/java/org/elasticsearch/action/search/ClearScrollResponse.java index 60d7dae4af2df..c2747ac0f6126 100644 --- a/server/src/main/java/org/elasticsearch/action/search/ClearScrollResponse.java +++ b/server/src/main/java/org/elasticsearch/action/search/ClearScrollResponse.java @@ -9,19 +9,19 @@ package org.elasticsearch.action.search; import org.elasticsearch.action.ActionResponse; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; import org.elasticsearch.common.xcontent.StatusToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.rest.RestStatus; import java.io.IOException; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; import static org.elasticsearch.rest.RestStatus.NOT_FOUND; import static org.elasticsearch.rest.RestStatus.OK; diff --git a/server/src/main/java/org/elasticsearch/action/search/ClosePointInTimeRequest.java b/server/src/main/java/org/elasticsearch/action/search/ClosePointInTimeRequest.java index d1f3a8a45ddde..bea4e69ff4b61 100644 --- a/server/src/main/java/org/elasticsearch/action/search/ClosePointInTimeRequest.java +++ b/server/src/main/java/org/elasticsearch/action/search/ClosePointInTimeRequest.java @@ -10,13 +10,13 @@ import org.elasticsearch.action.ActionRequest; import org.elasticsearch.action.ActionRequestValidationException; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/action/search/MultiSearchRequest.java b/server/src/main/java/org/elasticsearch/action/search/MultiSearchRequest.java index 489291ec56d3a..55ff225632a47 100644 --- a/server/src/main/java/org/elasticsearch/action/search/MultiSearchRequest.java +++ b/server/src/main/java/org/elasticsearch/action/search/MultiSearchRequest.java @@ -20,11 +20,11 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.logging.DeprecationLogger; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.rest.action.search.RestMultiSearchAction; import org.elasticsearch.rest.action.search.RestSearchAction; import org.elasticsearch.tasks.CancellableTask; diff --git a/server/src/main/java/org/elasticsearch/action/search/MultiSearchResponse.java b/server/src/main/java/org/elasticsearch/action/search/MultiSearchResponse.java index a06f31a2168df..e697eb806ae9d 100644 --- a/server/src/main/java/org/elasticsearch/action/search/MultiSearchResponse.java +++ b/server/src/main/java/org/elasticsearch/action/search/MultiSearchResponse.java @@ -12,24 +12,24 @@ import org.elasticsearch.ExceptionsHelper; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentParser.Token; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser.Token; import java.io.IOException; import java.util.Arrays; import java.util.Iterator; import java.util.List; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; /** * A multi search response. diff --git a/server/src/main/java/org/elasticsearch/action/search/OpenPointInTimeResponse.java b/server/src/main/java/org/elasticsearch/action/search/OpenPointInTimeResponse.java index 82f6c63810aaf..6816764da9ed8 100644 --- a/server/src/main/java/org/elasticsearch/action/search/OpenPointInTimeResponse.java +++ b/server/src/main/java/org/elasticsearch/action/search/OpenPointInTimeResponse.java @@ -9,19 +9,19 @@ package org.elasticsearch.action.search; import org.elasticsearch.action.ActionResponse; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; public final class OpenPointInTimeResponse extends ActionResponse implements ToXContentObject { private static final ParseField ID = new ParseField("id"); diff --git a/server/src/main/java/org/elasticsearch/action/search/RestClosePointInTimeAction.java b/server/src/main/java/org/elasticsearch/action/search/RestClosePointInTimeAction.java index 1302f02f85080..80916b714258c 100644 --- a/server/src/main/java/org/elasticsearch/action/search/RestClosePointInTimeAction.java +++ b/server/src/main/java/org/elasticsearch/action/search/RestClosePointInTimeAction.java @@ -9,7 +9,7 @@ package org.elasticsearch.action.search; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestStatusToXContentListener; diff --git a/server/src/main/java/org/elasticsearch/action/search/SearchPhaseExecutionException.java b/server/src/main/java/org/elasticsearch/action/search/SearchPhaseExecutionException.java index 58e663d3ae7a4..cc83f25466fa1 100644 --- a/server/src/main/java/org/elasticsearch/action/search/SearchPhaseExecutionException.java +++ b/server/src/main/java/org/elasticsearch/action/search/SearchPhaseExecutionException.java @@ -14,7 +14,7 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.util.CollectionUtils; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.rest.RestStatus; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/action/search/SearchRequest.java b/server/src/main/java/org/elasticsearch/action/search/SearchRequest.java index 43e0baf1dafc0..a8b576b7bd259 100644 --- a/server/src/main/java/org/elasticsearch/action/search/SearchRequest.java +++ b/server/src/main/java/org/elasticsearch/action/search/SearchRequest.java @@ -18,7 +18,7 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContent; import org.elasticsearch.index.query.QueryRewriteContext; import org.elasticsearch.index.query.Rewriteable; import org.elasticsearch.search.Scroll; diff --git a/server/src/main/java/org/elasticsearch/action/search/SearchResponse.java b/server/src/main/java/org/elasticsearch/action/search/SearchResponse.java index 88bb8ccea050c..f43ee78a9b98f 100644 --- a/server/src/main/java/org/elasticsearch/action/search/SearchResponse.java +++ b/server/src/main/java/org/elasticsearch/action/search/SearchResponse.java @@ -15,12 +15,12 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.xcontent.StatusToXContentObject; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentParser.Token; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser.Token; import org.elasticsearch.core.Nullable; import org.elasticsearch.core.TimeValue; import org.elasticsearch.rest.RestStatus; diff --git a/server/src/main/java/org/elasticsearch/action/search/SearchResponseSections.java b/server/src/main/java/org/elasticsearch/action/search/SearchResponseSections.java index dc955aa377921..d13f6f9963231 100644 --- a/server/src/main/java/org/elasticsearch/action/search/SearchResponseSections.java +++ b/server/src/main/java/org/elasticsearch/action/search/SearchResponseSections.java @@ -9,8 +9,8 @@ package org.elasticsearch.action.search; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.search.SearchHits; import org.elasticsearch.search.aggregations.Aggregations; import org.elasticsearch.search.profile.SearchProfileResults; diff --git a/server/src/main/java/org/elasticsearch/action/search/SearchScrollRequest.java b/server/src/main/java/org/elasticsearch/action/search/SearchScrollRequest.java index 1dc4daef4f546..c3bce4d5d51d6 100644 --- a/server/src/main/java/org/elasticsearch/action/search/SearchScrollRequest.java +++ b/server/src/main/java/org/elasticsearch/action/search/SearchScrollRequest.java @@ -13,9 +13,9 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.Scroll; import org.elasticsearch.tasks.Task; import org.elasticsearch.tasks.TaskId; diff --git a/server/src/main/java/org/elasticsearch/action/search/ShardSearchFailure.java b/server/src/main/java/org/elasticsearch/action/search/ShardSearchFailure.java index 4925f8a3f3b56..6377abba32904 100644 --- a/server/src/main/java/org/elasticsearch/action/search/ShardSearchFailure.java +++ b/server/src/main/java/org/elasticsearch/action/search/ShardSearchFailure.java @@ -16,8 +16,8 @@ import org.elasticsearch.core.Nullable; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.Index; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.rest.RestStatus; diff --git a/server/src/main/java/org/elasticsearch/action/support/DefaultShardOperationFailedException.java b/server/src/main/java/org/elasticsearch/action/support/DefaultShardOperationFailedException.java index bfbd300e29935..04db2a4c0b741 100644 --- a/server/src/main/java/org/elasticsearch/action/support/DefaultShardOperationFailedException.java +++ b/server/src/main/java/org/elasticsearch/action/support/DefaultShardOperationFailedException.java @@ -11,18 +11,18 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.ExceptionsHelper; import org.elasticsearch.action.ShardOperationFailedException; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.rest.RestStatus; import java.io.IOException; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; public class DefaultShardOperationFailedException extends ShardOperationFailedException implements Writeable { diff --git a/server/src/main/java/org/elasticsearch/action/support/IndicesOptions.java b/server/src/main/java/org/elasticsearch/action/support/IndicesOptions.java index cd1299ae8754a..172bc4a470ee0 100644 --- a/server/src/main/java/org/elasticsearch/action/support/IndicesOptions.java +++ b/server/src/main/java/org/elasticsearch/action/support/IndicesOptions.java @@ -11,14 +11,14 @@ import org.elasticsearch.common.logging.DeprecationCategory; import org.elasticsearch.common.logging.DeprecationLogger; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentParser.Token; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser.Token; import org.elasticsearch.rest.RestRequest; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/action/support/broadcast/BroadcastResponse.java b/server/src/main/java/org/elasticsearch/action/support/broadcast/BroadcastResponse.java index 51db9e99aa51b..1443899acf8a2 100644 --- a/server/src/main/java/org/elasticsearch/action/support/broadcast/BroadcastResponse.java +++ b/server/src/main/java/org/elasticsearch/action/support/broadcast/BroadcastResponse.java @@ -10,12 +10,12 @@ import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.support.DefaultShardOperationFailedException; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.rest.action.RestActions; @@ -23,8 +23,8 @@ import java.util.List; import static org.elasticsearch.action.support.DefaultShardOperationFailedException.readShardOperationFailed; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * Base class for all broadcast operation based responses. diff --git a/server/src/main/java/org/elasticsearch/action/support/master/AcknowledgedResponse.java b/server/src/main/java/org/elasticsearch/action/support/master/AcknowledgedResponse.java index f46a11e23fb85..27f4e724ee5eb 100644 --- a/server/src/main/java/org/elasticsearch/action/support/master/AcknowledgedResponse.java +++ b/server/src/main/java/org/elasticsearch/action/support/master/AcknowledgedResponse.java @@ -8,19 +8,19 @@ package org.elasticsearch.action.support.master; import org.elasticsearch.action.ActionResponse; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; /** * A response that indicates that a request has been acknowledged diff --git a/server/src/main/java/org/elasticsearch/action/support/master/ShardsAcknowledgedResponse.java b/server/src/main/java/org/elasticsearch/action/support/master/ShardsAcknowledgedResponse.java index efb4746bc5e3a..0c6ae97389e87 100644 --- a/server/src/main/java/org/elasticsearch/action/support/master/ShardsAcknowledgedResponse.java +++ b/server/src/main/java/org/elasticsearch/action/support/master/ShardsAcknowledgedResponse.java @@ -8,17 +8,17 @@ package org.elasticsearch.action.support.master; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; public class ShardsAcknowledgedResponse extends AcknowledgedResponse { diff --git a/server/src/main/java/org/elasticsearch/action/support/replication/ReplicationResponse.java b/server/src/main/java/org/elasticsearch/action/support/replication/ReplicationResponse.java index cba45ba6b193c..0e378190c4095 100644 --- a/server/src/main/java/org/elasticsearch/action/support/replication/ReplicationResponse.java +++ b/server/src/main/java/org/elasticsearch/action/support/replication/ReplicationResponse.java @@ -17,9 +17,9 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.rest.RestStatus; diff --git a/server/src/main/java/org/elasticsearch/action/support/replication/ReplicationTask.java b/server/src/main/java/org/elasticsearch/action/support/replication/ReplicationTask.java index 1b43cb996e67c..e8abe31411fc0 100644 --- a/server/src/main/java/org/elasticsearch/action/support/replication/ReplicationTask.java +++ b/server/src/main/java/org/elasticsearch/action/support/replication/ReplicationTask.java @@ -11,7 +11,7 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.tasks.Task; import org.elasticsearch.tasks.TaskId; diff --git a/server/src/main/java/org/elasticsearch/action/support/tasks/BaseTasksResponse.java b/server/src/main/java/org/elasticsearch/action/support/tasks/BaseTasksResponse.java index daad4cfda977a..c59645b571904 100644 --- a/server/src/main/java/org/elasticsearch/action/support/tasks/BaseTasksResponse.java +++ b/server/src/main/java/org/elasticsearch/action/support/tasks/BaseTasksResponse.java @@ -14,8 +14,8 @@ import org.elasticsearch.action.TaskOperationFailure; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.tasks.TaskId; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/action/termvectors/MultiTermVectorsRequest.java b/server/src/main/java/org/elasticsearch/action/termvectors/MultiTermVectorsRequest.java index 8ec240c0d143e..a7f4f4d7427fa 100644 --- a/server/src/main/java/org/elasticsearch/action/termvectors/MultiTermVectorsRequest.java +++ b/server/src/main/java/org/elasticsearch/action/termvectors/MultiTermVectorsRequest.java @@ -17,7 +17,7 @@ import org.elasticsearch.core.Nullable; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/action/termvectors/MultiTermVectorsResponse.java b/server/src/main/java/org/elasticsearch/action/termvectors/MultiTermVectorsResponse.java index ffe2c82c070cc..01a266264bc32 100644 --- a/server/src/main/java/org/elasticsearch/action/termvectors/MultiTermVectorsResponse.java +++ b/server/src/main/java/org/elasticsearch/action/termvectors/MultiTermVectorsResponse.java @@ -14,8 +14,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.index.mapper.MapperService; diff --git a/server/src/main/java/org/elasticsearch/action/termvectors/TermVectorsRequest.java b/server/src/main/java/org/elasticsearch/action/termvectors/TermVectorsRequest.java index ebf6125dcbf17..23938a41667d4 100644 --- a/server/src/main/java/org/elasticsearch/action/termvectors/TermVectorsRequest.java +++ b/server/src/main/java/org/elasticsearch/action/termvectors/TermVectorsRequest.java @@ -15,7 +15,7 @@ import org.elasticsearch.action.ValidateActions; import org.elasticsearch.action.get.MultiGetRequest; import org.elasticsearch.action.support.single.shard.SingleShardRequest; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; @@ -24,10 +24,10 @@ import org.elasticsearch.common.logging.DeprecationLogger; import org.elasticsearch.common.lucene.uid.Versions; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.VersionType; import org.elasticsearch.rest.action.document.RestTermVectorsAction; @@ -41,7 +41,7 @@ import java.util.Set; import java.util.concurrent.atomic.AtomicInteger; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; /** * Request returning the term vector (doc frequency, positions, offsets) for a document. diff --git a/server/src/main/java/org/elasticsearch/action/termvectors/TermVectorsRequestBuilder.java b/server/src/main/java/org/elasticsearch/action/termvectors/TermVectorsRequestBuilder.java index ee519c94abe02..b3415f03497e4 100644 --- a/server/src/main/java/org/elasticsearch/action/termvectors/TermVectorsRequestBuilder.java +++ b/server/src/main/java/org/elasticsearch/action/termvectors/TermVectorsRequestBuilder.java @@ -10,7 +10,7 @@ import org.elasticsearch.action.ActionRequestBuilder; import org.elasticsearch.client.ElasticsearchClient; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.VersionType; import java.util.Map; diff --git a/server/src/main/java/org/elasticsearch/action/termvectors/TermVectorsResponse.java b/server/src/main/java/org/elasticsearch/action/termvectors/TermVectorsResponse.java index da817fa334ebb..fddb324c9fcd3 100644 --- a/server/src/main/java/org/elasticsearch/action/termvectors/TermVectorsResponse.java +++ b/server/src/main/java/org/elasticsearch/action/termvectors/TermVectorsResponse.java @@ -26,8 +26,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.mapper.MapperService; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/action/update/TransportUpdateAction.java b/server/src/main/java/org/elasticsearch/action/update/TransportUpdateAction.java index fdc668b881f3e..397df7b0fe66e 100644 --- a/server/src/main/java/org/elasticsearch/action/update/TransportUpdateAction.java +++ b/server/src/main/java/org/elasticsearch/action/update/TransportUpdateAction.java @@ -38,7 +38,7 @@ import org.elasticsearch.common.io.stream.NotSerializableExceptionWrapper; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.Tuple; import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.index.IndexService; diff --git a/server/src/main/java/org/elasticsearch/action/update/UpdateHelper.java b/server/src/main/java/org/elasticsearch/action/update/UpdateHelper.java index 73e4e8079f5e7..5f190ee7639a3 100644 --- a/server/src/main/java/org/elasticsearch/action/update/UpdateHelper.java +++ b/server/src/main/java/org/elasticsearch/action/update/UpdateHelper.java @@ -20,9 +20,9 @@ import org.elasticsearch.core.Tuple; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.VersionType; import org.elasticsearch.index.engine.DocumentMissingException; import org.elasticsearch.index.engine.DocumentSourceMissingException; diff --git a/server/src/main/java/org/elasticsearch/action/update/UpdateRequest.java b/server/src/main/java/org/elasticsearch/action/update/UpdateRequest.java index 25a2a01b39ecc..7b369dae46295 100644 --- a/server/src/main/java/org/elasticsearch/action/update/UpdateRequest.java +++ b/server/src/main/java/org/elasticsearch/action/update/UpdateRequest.java @@ -18,21 +18,21 @@ import org.elasticsearch.action.support.replication.ReplicationRequest; import org.elasticsearch.action.support.single.instance.InstanceShardOperationRequest; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.lucene.uid.Versions; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.VersionType; import org.elasticsearch.index.mapper.MapperService; import org.elasticsearch.index.shard.ShardId; diff --git a/server/src/main/java/org/elasticsearch/action/update/UpdateRequestBuilder.java b/server/src/main/java/org/elasticsearch/action/update/UpdateRequestBuilder.java index a4db0087efcb0..d3a3bb0479abe 100644 --- a/server/src/main/java/org/elasticsearch/action/update/UpdateRequestBuilder.java +++ b/server/src/main/java/org/elasticsearch/action/update/UpdateRequestBuilder.java @@ -15,8 +15,8 @@ import org.elasticsearch.action.support.single.instance.InstanceShardOperationRequestBuilder; import org.elasticsearch.client.ElasticsearchClient; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.VersionType; import org.elasticsearch.script.Script; diff --git a/server/src/main/java/org/elasticsearch/action/update/UpdateResponse.java b/server/src/main/java/org/elasticsearch/action/update/UpdateResponse.java index 6d1cc3e216fee..5eb2f73f78701 100644 --- a/server/src/main/java/org/elasticsearch/action/update/UpdateResponse.java +++ b/server/src/main/java/org/elasticsearch/action/update/UpdateResponse.java @@ -11,8 +11,8 @@ import org.elasticsearch.action.DocWriteResponse; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.get.GetResult; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.rest.RestStatus; diff --git a/server/src/main/java/org/elasticsearch/client/ClusterAdminClient.java b/server/src/main/java/org/elasticsearch/client/ClusterAdminClient.java index e23537573f55a..41b8f97cc53b8 100644 --- a/server/src/main/java/org/elasticsearch/client/ClusterAdminClient.java +++ b/server/src/main/java/org/elasticsearch/client/ClusterAdminClient.java @@ -108,7 +108,7 @@ import org.elasticsearch.action.ingest.SimulatePipelineResponse; import org.elasticsearch.action.support.master.AcknowledgedResponse; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.tasks.TaskId; /** diff --git a/server/src/main/java/org/elasticsearch/client/Requests.java b/server/src/main/java/org/elasticsearch/client/Requests.java index ec49f597eecc0..0fbda848da61f 100644 --- a/server/src/main/java/org/elasticsearch/client/Requests.java +++ b/server/src/main/java/org/elasticsearch/client/Requests.java @@ -49,7 +49,7 @@ import org.elasticsearch.action.index.IndexRequest; import org.elasticsearch.action.search.SearchRequest; import org.elasticsearch.action.search.SearchScrollRequest; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; /** * A handy one stop shop for creating requests (make sure to import static this class). diff --git a/server/src/main/java/org/elasticsearch/client/support/AbstractClient.java b/server/src/main/java/org/elasticsearch/client/support/AbstractClient.java index 023a39ed6cb76..738f970ad6e3c 100644 --- a/server/src/main/java/org/elasticsearch/client/support/AbstractClient.java +++ b/server/src/main/java/org/elasticsearch/client/support/AbstractClient.java @@ -321,7 +321,7 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.tasks.TaskId; import org.elasticsearch.threadpool.ThreadPool; diff --git a/server/src/main/java/org/elasticsearch/cluster/ClusterInfo.java b/server/src/main/java/org/elasticsearch/cluster/ClusterInfo.java index c249a38f2abe2..61af8db54e71d 100644 --- a/server/src/main/java/org/elasticsearch/cluster/ClusterInfo.java +++ b/server/src/main/java/org/elasticsearch/cluster/ClusterInfo.java @@ -18,8 +18,8 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.index.store.StoreStats; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/cluster/ClusterModule.java b/server/src/main/java/org/elasticsearch/cluster/ClusterModule.java index 3e068709f17df..e7bc6e4f7ce42 100644 --- a/server/src/main/java/org/elasticsearch/cluster/ClusterModule.java +++ b/server/src/main/java/org/elasticsearch/cluster/ClusterModule.java @@ -50,6 +50,7 @@ import org.elasticsearch.cluster.routing.allocation.decider.SnapshotInProgressAllocationDecider; import org.elasticsearch.cluster.routing.allocation.decider.ThrottlingAllocationDecider; import org.elasticsearch.cluster.service.ClusterService; + import org.elasticsearch.common.inject.AbstractModule; import org.elasticsearch.common.io.stream.NamedWriteable; import org.elasticsearch.common.io.stream.NamedWriteableRegistry.Entry; @@ -59,8 +60,7 @@ import org.elasticsearch.common.settings.Setting.Property; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ParseField; + import org.elasticsearch.gateway.GatewayAllocator; import org.elasticsearch.indices.SystemIndices; import org.elasticsearch.ingest.IngestMetadata; @@ -71,6 +71,8 @@ import org.elasticsearch.snapshots.SnapshotsInfoService; import org.elasticsearch.tasks.Task; import org.elasticsearch.tasks.TaskResultsService; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.NamedXContentRegistry; import java.util.ArrayList; import java.util.Collection; diff --git a/server/src/main/java/org/elasticsearch/cluster/ClusterState.java b/server/src/main/java/org/elasticsearch/cluster/ClusterState.java index e39d9013f74f0..3d2ccbc33e45d 100644 --- a/server/src/main/java/org/elasticsearch/cluster/ClusterState.java +++ b/server/src/main/java/org/elasticsearch/cluster/ClusterState.java @@ -38,8 +38,8 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.VersionedNamedWriteable; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.EnumSet; diff --git a/server/src/main/java/org/elasticsearch/cluster/DiskUsage.java b/server/src/main/java/org/elasticsearch/cluster/DiskUsage.java index a36d7204b72df..710cfff63f75b 100644 --- a/server/src/main/java/org/elasticsearch/cluster/DiskUsage.java +++ b/server/src/main/java/org/elasticsearch/cluster/DiskUsage.java @@ -13,8 +13,8 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/server/src/main/java/org/elasticsearch/cluster/RepositoryCleanupInProgress.java b/server/src/main/java/org/elasticsearch/cluster/RepositoryCleanupInProgress.java index 522b896da4679..1181a2457be10 100644 --- a/server/src/main/java/org/elasticsearch/cluster/RepositoryCleanupInProgress.java +++ b/server/src/main/java/org/elasticsearch/cluster/RepositoryCleanupInProgress.java @@ -12,7 +12,7 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.repositories.RepositoryOperation; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/cluster/RestoreInProgress.java b/server/src/main/java/org/elasticsearch/cluster/RestoreInProgress.java index 218219d570c6c..5be7195df24a3 100644 --- a/server/src/main/java/org/elasticsearch/cluster/RestoreInProgress.java +++ b/server/src/main/java/org/elasticsearch/cluster/RestoreInProgress.java @@ -16,8 +16,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.snapshots.Snapshot; diff --git a/server/src/main/java/org/elasticsearch/cluster/SnapshotDeletionsInProgress.java b/server/src/main/java/org/elasticsearch/cluster/SnapshotDeletionsInProgress.java index c0abfc0f47f2b..a936669f32fd8 100644 --- a/server/src/main/java/org/elasticsearch/cluster/SnapshotDeletionsInProgress.java +++ b/server/src/main/java/org/elasticsearch/cluster/SnapshotDeletionsInProgress.java @@ -15,7 +15,7 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.util.CollectionUtils; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.repositories.RepositoryOperation; import org.elasticsearch.snapshots.SnapshotId; diff --git a/server/src/main/java/org/elasticsearch/cluster/SnapshotsInProgress.java b/server/src/main/java/org/elasticsearch/cluster/SnapshotsInProgress.java index 0eb189755dc18..6e3d640873b6a 100644 --- a/server/src/main/java/org/elasticsearch/cluster/SnapshotsInProgress.java +++ b/server/src/main/java/org/elasticsearch/cluster/SnapshotsInProgress.java @@ -19,8 +19,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.Index; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.repositories.IndexId; diff --git a/server/src/main/java/org/elasticsearch/cluster/action/index/MappingUpdatedAction.java b/server/src/main/java/org/elasticsearch/cluster/action/index/MappingUpdatedAction.java index 3778dbcc3950a..06e345c1aa2ff 100644 --- a/server/src/main/java/org/elasticsearch/cluster/action/index/MappingUpdatedAction.java +++ b/server/src/main/java/org/elasticsearch/cluster/action/index/MappingUpdatedAction.java @@ -21,7 +21,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.concurrent.RunOnce; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.Index; import org.elasticsearch.index.mapper.Mapping; diff --git a/server/src/main/java/org/elasticsearch/cluster/block/ClusterBlock.java b/server/src/main/java/org/elasticsearch/cluster/block/ClusterBlock.java index 3fdfeeeee4193..d8900c49eb396 100644 --- a/server/src/main/java/org/elasticsearch/cluster/block/ClusterBlock.java +++ b/server/src/main/java/org/elasticsearch/cluster/block/ClusterBlock.java @@ -12,8 +12,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.rest.RestStatus; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/cluster/coordination/CoordinationMetadata.java b/server/src/main/java/org/elasticsearch/cluster/coordination/CoordinationMetadata.java index 5065342558282..ca3d4784c2d17 100644 --- a/server/src/main/java/org/elasticsearch/cluster/coordination/CoordinationMetadata.java +++ b/server/src/main/java/org/elasticsearch/cluster/coordination/CoordinationMetadata.java @@ -8,15 +8,15 @@ package org.elasticsearch.cluster.coordination; import org.elasticsearch.cluster.node.DiscoveryNode; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Arrays; diff --git a/server/src/main/java/org/elasticsearch/cluster/coordination/Coordinator.java b/server/src/main/java/org/elasticsearch/cluster/coordination/Coordinator.java index a58049da27e8e..751345f761230 100644 --- a/server/src/main/java/org/elasticsearch/cluster/coordination/Coordinator.java +++ b/server/src/main/java/org/elasticsearch/cluster/coordination/Coordinator.java @@ -48,7 +48,7 @@ import org.elasticsearch.common.util.concurrent.EsExecutors; import org.elasticsearch.common.util.concurrent.ListenableFuture; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.core.Nullable; import org.elasticsearch.core.Releasable; import org.elasticsearch.core.Releasables; diff --git a/server/src/main/java/org/elasticsearch/cluster/coordination/ElasticsearchNodeCommand.java b/server/src/main/java/org/elasticsearch/cluster/coordination/ElasticsearchNodeCommand.java index b7143186d5d59..cbb6e02737f82 100644 --- a/server/src/main/java/org/elasticsearch/cluster/coordination/ElasticsearchNodeCommand.java +++ b/server/src/main/java/org/elasticsearch/cluster/coordination/ElasticsearchNodeCommand.java @@ -29,9 +29,9 @@ import org.elasticsearch.common.settings.ClusterSettings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.BigArrays; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.env.Environment; import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.env.NodeMetadata; diff --git a/server/src/main/java/org/elasticsearch/cluster/coordination/PendingClusterStateStats.java b/server/src/main/java/org/elasticsearch/cluster/coordination/PendingClusterStateStats.java index f471ae6d56c69..b0a62e8fa90b8 100644 --- a/server/src/main/java/org/elasticsearch/cluster/coordination/PendingClusterStateStats.java +++ b/server/src/main/java/org/elasticsearch/cluster/coordination/PendingClusterStateStats.java @@ -11,9 +11,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContent.Params; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/cluster/coordination/PublishClusterStateStats.java b/server/src/main/java/org/elasticsearch/cluster/coordination/PublishClusterStateStats.java index bedf89f578d60..dde9c850ab334 100644 --- a/server/src/main/java/org/elasticsearch/cluster/coordination/PublishClusterStateStats.java +++ b/server/src/main/java/org/elasticsearch/cluster/coordination/PublishClusterStateStats.java @@ -11,8 +11,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/cluster/health/ClusterIndexHealth.java b/server/src/main/java/org/elasticsearch/cluster/health/ClusterIndexHealth.java index ec040bea13f2d..e44eb3a6c1ea7 100644 --- a/server/src/main/java/org/elasticsearch/cluster/health/ClusterIndexHealth.java +++ b/server/src/main/java/org/elasticsearch/cluster/health/ClusterIndexHealth.java @@ -11,15 +11,15 @@ import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.cluster.routing.IndexRoutingTable; import org.elasticsearch.cluster.routing.IndexShardRoutingTable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.HashMap; @@ -30,8 +30,8 @@ import java.util.Objects; import static java.util.Collections.emptyMap; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; import static org.elasticsearch.common.xcontent.XContentParserUtils.ensureExpectedToken; public final class ClusterIndexHealth implements Iterable, Writeable, ToXContentFragment { diff --git a/server/src/main/java/org/elasticsearch/cluster/health/ClusterShardHealth.java b/server/src/main/java/org/elasticsearch/cluster/health/ClusterShardHealth.java index ac423698fb37b..02cc3e4734b04 100644 --- a/server/src/main/java/org/elasticsearch/cluster/health/ClusterShardHealth.java +++ b/server/src/main/java/org/elasticsearch/cluster/health/ClusterShardHealth.java @@ -13,21 +13,21 @@ import org.elasticsearch.cluster.routing.ShardRouting; import org.elasticsearch.cluster.routing.UnassignedInfo; import org.elasticsearch.cluster.routing.UnassignedInfo.AllocationStatus; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Locale; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; import static org.elasticsearch.common.xcontent.XContentParserUtils.ensureExpectedToken; public final class ClusterShardHealth implements Writeable, ToXContentFragment { diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/AliasMetadata.java b/server/src/main/java/org/elasticsearch/cluster/metadata/AliasMetadata.java index 43c41292865d1..61b5841e1d52f 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/AliasMetadata.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/AliasMetadata.java @@ -18,12 +18,12 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collections; diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/AliasValidator.java b/server/src/main/java/org/elasticsearch/cluster/metadata/AliasValidator.java index d526381497ec5..3c0c6c846f8c4 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/AliasValidator.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/AliasValidator.java @@ -13,10 +13,10 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.SearchExecutionContext; import org.elasticsearch.index.query.Rewriteable; @@ -55,7 +55,7 @@ public void validateAliasMetadata(AliasMetadata aliasMetadata, String index, Met /** * Allows to partially validate an alias, without knowing which index it'll get applied to. * Useful with index templates containing aliases. Checks also that it is possible to parse - * the alias filter via {@link org.elasticsearch.common.xcontent.XContentParser}, + * the alias filter via {@link org.elasticsearch.xcontent.XContentParser}, * without validating it as a filter though. * @throws IllegalArgumentException if the alias is not valid */ diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/ComponentTemplate.java b/server/src/main/java/org/elasticsearch/cluster/metadata/ComponentTemplate.java index b3f4ec9cca6c0..2548431276020 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/ComponentTemplate.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/ComponentTemplate.java @@ -11,14 +11,14 @@ import org.elasticsearch.cluster.AbstractDiffable; import org.elasticsearch.cluster.Diff; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Map; diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/ComponentTemplateMetadata.java b/server/src/main/java/org/elasticsearch/cluster/metadata/ComponentTemplateMetadata.java index 6c50276e78ef4..c655145bd7ff0 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/ComponentTemplateMetadata.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/ComponentTemplateMetadata.java @@ -12,13 +12,13 @@ import org.elasticsearch.cluster.Diff; import org.elasticsearch.cluster.DiffableUtils; import org.elasticsearch.cluster.NamedDiff; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.EnumSet; diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/ComposableIndexTemplate.java b/server/src/main/java/org/elasticsearch/cluster/metadata/ComposableIndexTemplate.java index 99dc022ab6992..7723fde5893a3 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/ComposableIndexTemplate.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/ComposableIndexTemplate.java @@ -11,15 +11,15 @@ import org.elasticsearch.cluster.AbstractDiffable; import org.elasticsearch.cluster.Diff; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.mapper.DataStreamTimestampFieldMapper; import org.elasticsearch.index.mapper.MapperService; diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/ComposableIndexTemplateMetadata.java b/server/src/main/java/org/elasticsearch/cluster/metadata/ComposableIndexTemplateMetadata.java index c87d415c225ab..67fd84779f6b7 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/ComposableIndexTemplateMetadata.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/ComposableIndexTemplateMetadata.java @@ -12,13 +12,13 @@ import org.elasticsearch.cluster.Diff; import org.elasticsearch.cluster.DiffableUtils; import org.elasticsearch.cluster.NamedDiff; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.EnumSet; diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/DataStream.java b/server/src/main/java/org/elasticsearch/cluster/metadata/DataStream.java index 2c826074b43a3..b61e76b9731ac 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/DataStream.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/DataStream.java @@ -15,15 +15,15 @@ import org.elasticsearch.cluster.Diff; import org.elasticsearch.common.Strings; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.time.DateFormatter; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.Index; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/DataStreamAlias.java b/server/src/main/java/org/elasticsearch/cluster/metadata/DataStreamAlias.java index 1276ccddda69f..29540da2c0f5e 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/DataStreamAlias.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/DataStreamAlias.java @@ -14,14 +14,14 @@ import org.elasticsearch.common.compress.CompressedXContent; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.io.UncheckedIOException; diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/DataStreamMetadata.java b/server/src/main/java/org/elasticsearch/cluster/metadata/DataStreamMetadata.java index d3df1a692f16e..b77f0b8c6d0a2 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/DataStreamMetadata.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/DataStreamMetadata.java @@ -12,13 +12,13 @@ import org.elasticsearch.cluster.Diff; import org.elasticsearch.cluster.DiffableUtils; import org.elasticsearch.cluster.NamedDiff; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.EnumSet; diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/IndexGraveyard.java b/server/src/main/java/org/elasticsearch/cluster/metadata/IndexGraveyard.java index 45cee960b85a5..55875b22476ff 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/IndexGraveyard.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/IndexGraveyard.java @@ -11,18 +11,18 @@ import org.elasticsearch.Version; import org.elasticsearch.cluster.Diff; import org.elasticsearch.cluster.NamedDiff; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.time.DateFormatter; -import org.elasticsearch.common.xcontent.ContextParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ContextParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.Index; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/IndexMetadata.java b/server/src/main/java/org/elasticsearch/cluster/metadata/IndexMetadata.java index b39ab956f4610..3a5b6cd240667 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/IndexMetadata.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/IndexMetadata.java @@ -37,12 +37,12 @@ import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Setting.Property; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParserUtils; import org.elasticsearch.core.Nullable; import org.elasticsearch.gateway.MetadataStateFormat; diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/IndexMetadataVerifier.java b/server/src/main/java/org/elasticsearch/cluster/metadata/IndexMetadataVerifier.java index 4ee4a57911dee..bd3f82e03f854 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/IndexMetadataVerifier.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/IndexMetadataVerifier.java @@ -17,7 +17,7 @@ import org.elasticsearch.common.TriFunction; import org.elasticsearch.common.settings.IndexScopedSettings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.analysis.AnalyzerScope; import org.elasticsearch.index.analysis.IndexAnalyzers; diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/IndexTemplateMetadata.java b/server/src/main/java/org/elasticsearch/cluster/metadata/IndexTemplateMetadata.java index 785fa69e5adee..e817a9c47af3e 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/IndexTemplateMetadata.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/IndexTemplateMetadata.java @@ -21,12 +21,12 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.mapper.MapperService; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/ItemUsage.java b/server/src/main/java/org/elasticsearch/cluster/metadata/ItemUsage.java index 8d3008b6ca162..5a72a0ccf3311 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/ItemUsage.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/ItemUsage.java @@ -12,8 +12,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.core.Nullable; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/Manifest.java b/server/src/main/java/org/elasticsearch/cluster/metadata/Manifest.java index d13c56dbb8252..f1644168b9f71 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/Manifest.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/Manifest.java @@ -8,13 +8,13 @@ package org.elasticsearch.cluster.metadata; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.gateway.MetadataStateFormat; import org.elasticsearch.index.Index; diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/MappingMetadata.java b/server/src/main/java/org/elasticsearch/cluster/metadata/MappingMetadata.java index 20476d9eb5836..57bcf46550fa0 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/MappingMetadata.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/MappingMetadata.java @@ -16,9 +16,9 @@ import org.elasticsearch.common.compress.CompressedXContent; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContent; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.MapperService; diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/Metadata.java b/server/src/main/java/org/elasticsearch/cluster/metadata/Metadata.java index da7eb6d0f69b4..d00d3dd27d9af 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/Metadata.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/Metadata.java @@ -38,14 +38,14 @@ import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Setting.Property; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedObjectNotFoundException; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.NamedObjectNotFoundException; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParserUtils; import org.elasticsearch.core.Nullable; import org.elasticsearch.gateway.MetadataStateFormat; diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/MetadataCreateIndexService.java b/server/src/main/java/org/elasticsearch/cluster/metadata/MetadataCreateIndexService.java index b3c7a5dc158be..98591c0ff02fd 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/MetadataCreateIndexService.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/MetadataCreateIndexService.java @@ -45,7 +45,7 @@ import org.elasticsearch.common.settings.IndexScopedSettings; import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.common.xcontent.XContentHelper; import org.elasticsearch.core.Nullable; import org.elasticsearch.core.PathUtils; diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/MetadataIndexAliasesService.java b/server/src/main/java/org/elasticsearch/cluster/metadata/MetadataIndexAliasesService.java index 7c95387e6b4c2..54824d96b5df7 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/MetadataIndexAliasesService.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/MetadataIndexAliasesService.java @@ -19,7 +19,7 @@ import org.elasticsearch.common.Priority; import org.elasticsearch.common.Strings; import org.elasticsearch.common.inject.Inject; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.index.Index; import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.index.IndexService; diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/MetadataIndexTemplateService.java b/server/src/main/java/org/elasticsearch/cluster/metadata/MetadataIndexTemplateService.java index d6338c231c004..5da664fae55f3 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/MetadataIndexTemplateService.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/MetadataIndexTemplateService.java @@ -38,11 +38,11 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.Index; import org.elasticsearch.index.IndexService; import org.elasticsearch.index.mapper.DataStreamTimestampFieldMapper; diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/NodesShutdownMetadata.java b/server/src/main/java/org/elasticsearch/cluster/metadata/NodesShutdownMetadata.java index 59d2743a189be..fd58d636c491b 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/NodesShutdownMetadata.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/NodesShutdownMetadata.java @@ -16,10 +16,10 @@ import org.elasticsearch.cluster.NamedDiff; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collections; diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/RepositoriesMetadata.java b/server/src/main/java/org/elasticsearch/cluster/metadata/RepositoriesMetadata.java index 71b66ffd3c978..272d0a40f4fe4 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/RepositoriesMetadata.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/RepositoriesMetadata.java @@ -18,9 +18,9 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.repositories.RepositoryData; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/ShutdownPersistentTasksStatus.java b/server/src/main/java/org/elasticsearch/cluster/metadata/ShutdownPersistentTasksStatus.java index 05430a9fa770f..e053e29e1c1eb 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/ShutdownPersistentTasksStatus.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/ShutdownPersistentTasksStatus.java @@ -12,8 +12,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/ShutdownPluginsStatus.java b/server/src/main/java/org/elasticsearch/cluster/metadata/ShutdownPluginsStatus.java index 964f9f93b531b..778afe33df067 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/ShutdownPluginsStatus.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/ShutdownPluginsStatus.java @@ -12,8 +12,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/ShutdownShardMigrationStatus.java b/server/src/main/java/org/elasticsearch/cluster/metadata/ShutdownShardMigrationStatus.java index 988e6dde17eef..5f029c96811e8 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/ShutdownShardMigrationStatus.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/ShutdownShardMigrationStatus.java @@ -14,8 +14,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.core.Nullable; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/SingleNodeShutdownMetadata.java b/server/src/main/java/org/elasticsearch/cluster/metadata/SingleNodeShutdownMetadata.java index b1800ffb60a89..2436c7272d137 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/SingleNodeShutdownMetadata.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/SingleNodeShutdownMetadata.java @@ -15,12 +15,12 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.Nullable; import org.elasticsearch.core.TimeValue; diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/Template.java b/server/src/main/java/org/elasticsearch/cluster/metadata/Template.java index f5854bb97fafc..ffb23b6835b7b 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/Template.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/Template.java @@ -11,19 +11,19 @@ import org.elasticsearch.cluster.AbstractDiffable; import org.elasticsearch.common.util.Maps; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.compress.CompressedXContent; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.mapper.MapperService; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/TemplateUpgradeService.java b/server/src/main/java/org/elasticsearch/cluster/metadata/TemplateUpgradeService.java index c6734b219d5c0..8ee6aafc70e88 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/TemplateUpgradeService.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/TemplateUpgradeService.java @@ -27,9 +27,9 @@ import org.elasticsearch.common.collect.ImmutableOpenMap; import org.elasticsearch.core.Tuple; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContent; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.gateway.GatewayService; import org.elasticsearch.indices.IndexTemplateMissingException; import org.elasticsearch.plugins.Plugin; diff --git a/server/src/main/java/org/elasticsearch/cluster/node/DiscoveryNode.java b/server/src/main/java/org/elasticsearch/cluster/node/DiscoveryNode.java index 398feeb2c479b..3db82e4fb78e7 100644 --- a/server/src/main/java/org/elasticsearch/cluster/node/DiscoveryNode.java +++ b/server/src/main/java/org/elasticsearch/cluster/node/DiscoveryNode.java @@ -15,8 +15,8 @@ import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.transport.TransportAddress; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.node.Node; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/cluster/routing/AllocationId.java b/server/src/main/java/org/elasticsearch/cluster/routing/AllocationId.java index e20a7bef333a9..b43b9a271c209 100644 --- a/server/src/main/java/org/elasticsearch/cluster/routing/AllocationId.java +++ b/server/src/main/java/org/elasticsearch/cluster/routing/AllocationId.java @@ -9,15 +9,15 @@ package org.elasticsearch.cluster.routing; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.UUIDs; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/server/src/main/java/org/elasticsearch/cluster/routing/RecoverySource.java b/server/src/main/java/org/elasticsearch/cluster/routing/RecoverySource.java index cf60b8fc746b9..f97803a369bc2 100644 --- a/server/src/main/java/org/elasticsearch/cluster/routing/RecoverySource.java +++ b/server/src/main/java/org/elasticsearch/cluster/routing/RecoverySource.java @@ -13,9 +13,9 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.repositories.IndexId; import org.elasticsearch.snapshots.Snapshot; diff --git a/server/src/main/java/org/elasticsearch/cluster/routing/ShardRouting.java b/server/src/main/java/org/elasticsearch/cluster/routing/ShardRouting.java index 7ca68e59c8430..d22a5035562e3 100644 --- a/server/src/main/java/org/elasticsearch/cluster/routing/ShardRouting.java +++ b/server/src/main/java/org/elasticsearch/cluster/routing/ShardRouting.java @@ -15,8 +15,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.Index; import org.elasticsearch.index.shard.ShardId; diff --git a/server/src/main/java/org/elasticsearch/cluster/routing/UnassignedInfo.java b/server/src/main/java/org/elasticsearch/cluster/routing/UnassignedInfo.java index aaa22320d1a7f..d162884b1f752 100644 --- a/server/src/main/java/org/elasticsearch/cluster/routing/UnassignedInfo.java +++ b/server/src/main/java/org/elasticsearch/cluster/routing/UnassignedInfo.java @@ -22,8 +22,8 @@ import org.elasticsearch.common.settings.Setting.Property; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.time.DateFormatter; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.core.Nullable; import org.elasticsearch.core.TimeValue; diff --git a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/AbstractAllocationDecision.java b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/AbstractAllocationDecision.java index 4a07fea35b526..4a3ad26f9538d 100644 --- a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/AbstractAllocationDecision.java +++ b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/AbstractAllocationDecision.java @@ -14,8 +14,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Collections; diff --git a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/AllocateUnassignedDecision.java b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/AllocateUnassignedDecision.java index 24abfa9ca17aa..d6fe064302873 100644 --- a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/AllocateUnassignedDecision.java +++ b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/AllocateUnassignedDecision.java @@ -16,7 +16,7 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Collections; diff --git a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/MoveDecision.java b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/MoveDecision.java index 6abfae6e73b1f..96ea0fdf87e2a 100644 --- a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/MoveDecision.java +++ b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/MoveDecision.java @@ -14,7 +14,7 @@ import org.elasticsearch.core.Nullable; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/NodeAllocationResult.java b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/NodeAllocationResult.java index d03512c8ce77f..1027e7c6ddcb7 100644 --- a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/NodeAllocationResult.java +++ b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/NodeAllocationResult.java @@ -16,9 +16,9 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Comparator; diff --git a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/RerouteExplanation.java b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/RerouteExplanation.java index a3bc87e3fc893..d3c6106ca525c 100644 --- a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/RerouteExplanation.java +++ b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/RerouteExplanation.java @@ -12,9 +12,8 @@ import org.elasticsearch.cluster.routing.allocation.decider.Decision; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContent.Params; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/RoutingExplanations.java b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/RoutingExplanations.java index 0ef933edc1a67..0e4efdbf678d1 100644 --- a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/RoutingExplanations.java +++ b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/RoutingExplanations.java @@ -11,9 +11,8 @@ import org.elasticsearch.cluster.routing.allocation.decider.Decision; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContent.Params; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/ShardAllocationDecision.java b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/ShardAllocationDecision.java index ae6a56aee0950..f1d6c34b4cf86 100644 --- a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/ShardAllocationDecision.java +++ b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/ShardAllocationDecision.java @@ -11,8 +11,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/command/AbstractAllocateAllocationCommand.java b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/command/AbstractAllocateAllocationCommand.java index 823c096f625b6..6e604d5274aeb 100644 --- a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/command/AbstractAllocateAllocationCommand.java +++ b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/command/AbstractAllocateAllocationCommand.java @@ -18,13 +18,13 @@ import org.elasticsearch.cluster.routing.allocation.RoutingAllocation; import org.elasticsearch.cluster.routing.allocation.decider.Decision; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/command/AllocateEmptyPrimaryAllocationCommand.java b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/command/AllocateEmptyPrimaryAllocationCommand.java index 980d88d3c42a8..f5d58ab2dcac7 100644 --- a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/command/AllocateEmptyPrimaryAllocationCommand.java +++ b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/command/AllocateEmptyPrimaryAllocationCommand.java @@ -18,10 +18,10 @@ import org.elasticsearch.cluster.routing.allocation.RerouteExplanation; import org.elasticsearch.cluster.routing.allocation.RoutingAllocation; import org.elasticsearch.cluster.routing.allocation.decider.Decision; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.index.shard.ShardNotFoundException; diff --git a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/command/AllocateReplicaAllocationCommand.java b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/command/AllocateReplicaAllocationCommand.java index 1d195c324dbfd..ab338f7b545af 100644 --- a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/command/AllocateReplicaAllocationCommand.java +++ b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/command/AllocateReplicaAllocationCommand.java @@ -15,10 +15,10 @@ import org.elasticsearch.cluster.routing.allocation.RerouteExplanation; import org.elasticsearch.cluster.routing.allocation.RoutingAllocation; import org.elasticsearch.cluster.routing.allocation.decider.Decision; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.index.shard.ShardNotFoundException; diff --git a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/command/AllocateStalePrimaryAllocationCommand.java b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/command/AllocateStalePrimaryAllocationCommand.java index bc1994677fe73..e2a782ac16268 100644 --- a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/command/AllocateStalePrimaryAllocationCommand.java +++ b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/command/AllocateStalePrimaryAllocationCommand.java @@ -16,10 +16,10 @@ import org.elasticsearch.cluster.routing.allocation.RerouteExplanation; import org.elasticsearch.cluster.routing.allocation.RoutingAllocation; import org.elasticsearch.cluster.routing.allocation.decider.Decision; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.index.shard.ShardNotFoundException; diff --git a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/command/AllocationCommand.java b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/command/AllocationCommand.java index 4b7c7f2386848..c2931accf65be 100644 --- a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/command/AllocationCommand.java +++ b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/command/AllocationCommand.java @@ -12,7 +12,7 @@ import org.elasticsearch.cluster.routing.allocation.RoutingAllocation; import org.elasticsearch.common.io.stream.NamedWriteable; import org.elasticsearch.common.network.NetworkModule; -import org.elasticsearch.common.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.ToXContentObject; import java.util.Optional; diff --git a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/command/AllocationCommands.java b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/command/AllocationCommands.java index 4c2304201f02d..9086d937a9692 100644 --- a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/command/AllocationCommands.java +++ b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/command/AllocationCommands.java @@ -14,9 +14,9 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/command/BasePrimaryAllocationCommand.java b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/command/BasePrimaryAllocationCommand.java index 228299c8bcf5c..33b702e489910 100644 --- a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/command/BasePrimaryAllocationCommand.java +++ b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/command/BasePrimaryAllocationCommand.java @@ -8,11 +8,11 @@ package org.elasticsearch.cluster.routing.allocation.command; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/command/CancelAllocationCommand.java b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/command/CancelAllocationCommand.java index 73812f2ffe40a..ad58105093fc8 100644 --- a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/command/CancelAllocationCommand.java +++ b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/command/CancelAllocationCommand.java @@ -19,11 +19,11 @@ import org.elasticsearch.cluster.routing.allocation.RerouteExplanation; import org.elasticsearch.cluster.routing.allocation.RoutingAllocation; import org.elasticsearch.cluster.routing.allocation.decider.Decision; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.index.shard.ShardId; diff --git a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/command/MoveAllocationCommand.java b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/command/MoveAllocationCommand.java index 6f0ab09c28392..d55fd9a2cb7dd 100644 --- a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/command/MoveAllocationCommand.java +++ b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/command/MoveAllocationCommand.java @@ -16,11 +16,11 @@ import org.elasticsearch.cluster.routing.allocation.RerouteExplanation; import org.elasticsearch.cluster.routing.allocation.RoutingAllocation; import org.elasticsearch.cluster.routing.allocation.decider.Decision; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/Decision.java b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/Decision.java index 7ea736ba31cca..b5bae4c79af68 100644 --- a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/Decision.java +++ b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/Decision.java @@ -12,10 +12,10 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/cluster/service/ClusterApplierRecordingService.java b/server/src/main/java/org/elasticsearch/cluster/service/ClusterApplierRecordingService.java index 499f32992e3c0..d9d526cb0405d 100644 --- a/server/src/main/java/org/elasticsearch/cluster/service/ClusterApplierRecordingService.java +++ b/server/src/main/java/org/elasticsearch/cluster/service/ClusterApplierRecordingService.java @@ -13,11 +13,11 @@ import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.metrics.MeanMetric; import org.elasticsearch.common.util.Maps; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.core.Releasable; import org.elasticsearch.core.TimeValue; import org.elasticsearch.core.Tuple; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Comparator; diff --git a/server/src/main/java/org/elasticsearch/cluster/service/ClusterStateUpdateStats.java b/server/src/main/java/org/elasticsearch/cluster/service/ClusterStateUpdateStats.java index 37e5bf3ea8f2a..d2cdef1945eb3 100644 --- a/server/src/main/java/org/elasticsearch/cluster/service/ClusterStateUpdateStats.java +++ b/server/src/main/java/org/elasticsearch/cluster/service/ClusterStateUpdateStats.java @@ -12,8 +12,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.core.TimeValue; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/common/FieldMemoryStats.java b/server/src/main/java/org/elasticsearch/common/FieldMemoryStats.java index 1ba0fa9bf2e67..fc3b030893414 100644 --- a/server/src/main/java/org/elasticsearch/common/FieldMemoryStats.java +++ b/server/src/main/java/org/elasticsearch/common/FieldMemoryStats.java @@ -14,7 +14,7 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Iterator; diff --git a/server/src/main/java/org/elasticsearch/common/ParsingException.java b/server/src/main/java/org/elasticsearch/common/ParsingException.java index c513128a517ca..2f62c7544a0b2 100644 --- a/server/src/main/java/org/elasticsearch/common/ParsingException.java +++ b/server/src/main/java/org/elasticsearch/common/ParsingException.java @@ -11,9 +11,9 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentLocation; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentLocation; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.rest.RestStatus; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/common/Strings.java b/server/src/main/java/org/elasticsearch/common/Strings.java index 4ac736e03beae..451638538cb10 100644 --- a/server/src/main/java/org/elasticsearch/common/Strings.java +++ b/server/src/main/java/org/elasticsearch/common/Strings.java @@ -13,9 +13,9 @@ import org.elasticsearch.ExceptionsHelper; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.util.CollectionUtils; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.core.Nullable; import java.io.BufferedReader; diff --git a/server/src/main/java/org/elasticsearch/common/breaker/CircuitBreakingException.java b/server/src/main/java/org/elasticsearch/common/breaker/CircuitBreakingException.java index cb4ecca79e12c..af2e4afad3845 100644 --- a/server/src/main/java/org/elasticsearch/common/breaker/CircuitBreakingException.java +++ b/server/src/main/java/org/elasticsearch/common/breaker/CircuitBreakingException.java @@ -10,7 +10,7 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.rest.RestStatus; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/common/bytes/AbstractBytesReference.java b/server/src/main/java/org/elasticsearch/common/bytes/AbstractBytesReference.java index 802ad0bdec327..6f6a47d1fecd6 100644 --- a/server/src/main/java/org/elasticsearch/common/bytes/AbstractBytesReference.java +++ b/server/src/main/java/org/elasticsearch/common/bytes/AbstractBytesReference.java @@ -10,7 +10,7 @@ import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.BytesRefIterator; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.io.OutputStream; diff --git a/server/src/main/java/org/elasticsearch/common/bytes/BytesReference.java b/server/src/main/java/org/elasticsearch/common/bytes/BytesReference.java index bd2f4bd7d95e3..7519527828355 100644 --- a/server/src/main/java/org/elasticsearch/common/bytes/BytesReference.java +++ b/server/src/main/java/org/elasticsearch/common/bytes/BytesReference.java @@ -14,8 +14,8 @@ import org.elasticsearch.common.io.stream.BytesStream; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.util.ByteArray; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.ByteArrayOutputStream; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/common/bytes/ReleasableBytesReference.java b/server/src/main/java/org/elasticsearch/common/bytes/ReleasableBytesReference.java index 6dacaf9da94e5..5199ff5ed83ea 100644 --- a/server/src/main/java/org/elasticsearch/common/bytes/ReleasableBytesReference.java +++ b/server/src/main/java/org/elasticsearch/common/bytes/ReleasableBytesReference.java @@ -15,7 +15,7 @@ import org.elasticsearch.core.Releasables; import org.elasticsearch.core.AbstractRefCounted; import org.elasticsearch.core.RefCounted; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.io.OutputStream; diff --git a/server/src/main/java/org/elasticsearch/common/compress/CompressedXContent.java b/server/src/main/java/org/elasticsearch/common/compress/CompressedXContent.java index 6ecf40edb77f5..e3c673a150d3f 100644 --- a/server/src/main/java/org/elasticsearch/common/compress/CompressedXContent.java +++ b/server/src/main/java/org/elasticsearch/common/compress/CompressedXContent.java @@ -14,10 +14,10 @@ import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.io.OutputStream; diff --git a/server/src/main/java/org/elasticsearch/common/compress/CompressorFactory.java b/server/src/main/java/org/elasticsearch/common/compress/CompressorFactory.java index 9465d58cfb9cd..511c5b47ffc77 100644 --- a/server/src/main/java/org/elasticsearch/common/compress/CompressorFactory.java +++ b/server/src/main/java/org/elasticsearch/common/compress/CompressorFactory.java @@ -11,7 +11,7 @@ import org.elasticsearch.core.Nullable; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.util.Objects; diff --git a/server/src/main/java/org/elasticsearch/common/compress/NotXContentException.java b/server/src/main/java/org/elasticsearch/common/compress/NotXContentException.java index 6fdfe1a0ff963..c3c7f98e4aaa1 100644 --- a/server/src/main/java/org/elasticsearch/common/compress/NotXContentException.java +++ b/server/src/main/java/org/elasticsearch/common/compress/NotXContentException.java @@ -8,7 +8,7 @@ package org.elasticsearch.common.compress; -import org.elasticsearch.common.xcontent.XContent; +import org.elasticsearch.xcontent.XContent; /** Exception indicating that we were expecting some {@link XContent} but could * not detect its type. */ diff --git a/server/src/main/java/org/elasticsearch/common/document/DocumentField.java b/server/src/main/java/org/elasticsearch/common/document/DocumentField.java index ffcee6e473bef..e6140c2e5ee5b 100644 --- a/server/src/main/java/org/elasticsearch/common/document/DocumentField.java +++ b/server/src/main/java/org/elasticsearch/common/document/DocumentField.java @@ -11,9 +11,9 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.get.GetResult; import org.elasticsearch.search.SearchHit; diff --git a/server/src/main/java/org/elasticsearch/common/geo/GeoBoundingBox.java b/server/src/main/java/org/elasticsearch/common/geo/GeoBoundingBox.java index 0868020d1a32f..a92a497d886a5 100644 --- a/server/src/main/java/org/elasticsearch/common/geo/GeoBoundingBox.java +++ b/server/src/main/java/org/elasticsearch/common/geo/GeoBoundingBox.java @@ -8,13 +8,13 @@ package org.elasticsearch.common.geo; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.geometry.Geometry; import org.elasticsearch.geometry.Rectangle; import org.elasticsearch.geometry.ShapeType; diff --git a/server/src/main/java/org/elasticsearch/common/geo/GeoJson.java b/server/src/main/java/org/elasticsearch/common/geo/GeoJson.java index 77ea437e7069f..a665603745894 100644 --- a/server/src/main/java/org/elasticsearch/common/geo/GeoJson.java +++ b/server/src/main/java/org/elasticsearch/common/geo/GeoJson.java @@ -10,15 +10,15 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.unit.DistanceUnit; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentSubParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentSubParser; import org.elasticsearch.geometry.Circle; import org.elasticsearch.geometry.Geometry; import org.elasticsearch.geometry.GeometryCollection; @@ -41,8 +41,8 @@ import java.util.Locale; import java.util.Map; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * Utility class for converting libs/geo shapes to and from GeoJson diff --git a/server/src/main/java/org/elasticsearch/common/geo/GeoPoint.java b/server/src/main/java/org/elasticsearch/common/geo/GeoPoint.java index e6c951f22be96..089f9a814b121 100644 --- a/server/src/main/java/org/elasticsearch/common/geo/GeoPoint.java +++ b/server/src/main/java/org/elasticsearch/common/geo/GeoPoint.java @@ -16,8 +16,8 @@ import org.apache.lucene.util.BytesRef; import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.geo.GeoUtils.EffectivePoint; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.geometry.Geometry; import org.elasticsearch.geometry.Point; import org.elasticsearch.geometry.Rectangle; diff --git a/server/src/main/java/org/elasticsearch/common/geo/GeoUtils.java b/server/src/main/java/org/elasticsearch/common/geo/GeoUtils.java index 728bc410bcfb9..34cc7742594fe 100644 --- a/server/src/main/java/org/elasticsearch/common/geo/GeoUtils.java +++ b/server/src/main/java/org/elasticsearch/common/geo/GeoUtils.java @@ -12,11 +12,11 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.unit.DistanceUnit; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentParser.Token; -import org.elasticsearch.common.xcontent.XContentSubParser; -import org.elasticsearch.common.xcontent.support.MapXContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser.Token; +import org.elasticsearch.xcontent.XContentSubParser; +import org.elasticsearch.xcontent.support.MapXContentParser; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.index.fielddata.FieldData; import org.elasticsearch.index.fielddata.GeoPointValues; diff --git a/server/src/main/java/org/elasticsearch/common/geo/GeometryParser.java b/server/src/main/java/org/elasticsearch/common/geo/GeometryParser.java index 090577f08efa7..da2bc40c929a3 100644 --- a/server/src/main/java/org/elasticsearch/common/geo/GeometryParser.java +++ b/server/src/main/java/org/elasticsearch/common/geo/GeometryParser.java @@ -10,9 +10,9 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.support.MapXContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.support.MapXContentParser; import org.elasticsearch.geometry.Geometry; import org.elasticsearch.geometry.GeometryCollection; import org.elasticsearch.geometry.Point; diff --git a/server/src/main/java/org/elasticsearch/common/geo/GeometryParserFormat.java b/server/src/main/java/org/elasticsearch/common/geo/GeometryParserFormat.java index 8b4268eccce5f..51120fa62a9ae 100644 --- a/server/src/main/java/org/elasticsearch/common/geo/GeometryParserFormat.java +++ b/server/src/main/java/org/elasticsearch/common/geo/GeometryParserFormat.java @@ -9,9 +9,9 @@ package org.elasticsearch.common.geo; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.geometry.Geometry; import org.elasticsearch.geometry.utils.GeometryValidator; import org.elasticsearch.geometry.utils.WellKnownText; diff --git a/server/src/main/java/org/elasticsearch/common/io/stream/StreamOutput.java b/server/src/main/java/org/elasticsearch/common/io/stream/StreamOutput.java index 4da2817ac6c85..5b87879103839 100644 --- a/server/src/main/java/org/elasticsearch/common/io/stream/StreamOutput.java +++ b/server/src/main/java/org/elasticsearch/common/io/stream/StreamOutput.java @@ -30,7 +30,7 @@ import org.elasticsearch.common.text.Text; import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.concurrent.EsRejectedExecutionException; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.joda.time.DateTimeZone; import org.joda.time.ReadableInstant; diff --git a/server/src/main/java/org/elasticsearch/common/network/NetworkModule.java b/server/src/main/java/org/elasticsearch/common/network/NetworkModule.java index d3c8bdc6e2aa5..e291a1520c56c 100644 --- a/server/src/main/java/org/elasticsearch/common/network/NetworkModule.java +++ b/server/src/main/java/org/elasticsearch/common/network/NetworkModule.java @@ -16,7 +16,7 @@ import org.elasticsearch.cluster.routing.allocation.command.CancelAllocationCommand; import org.elasticsearch.cluster.routing.allocation.command.MoveAllocationCommand; import org.elasticsearch.core.CheckedFunction; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.ClusterSettings; @@ -25,8 +25,8 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.BigArrays; import org.elasticsearch.common.util.PageCacheRecycler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.http.HttpServerTransport; import org.elasticsearch.index.shard.PrimaryReplicaSyncer.ResyncTask; import org.elasticsearch.indices.breaker.CircuitBreakerService; diff --git a/server/src/main/java/org/elasticsearch/common/settings/Setting.java b/server/src/main/java/org/elasticsearch/common/settings/Setting.java index 01d75211e3ed1..ccd25b89846f0 100644 --- a/server/src/main/java/org/elasticsearch/common/settings/Setting.java +++ b/server/src/main/java/org/elasticsearch/common/settings/Setting.java @@ -21,14 +21,14 @@ import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.common.unit.MemorySizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParserUtils; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.util.Arrays; diff --git a/server/src/main/java/org/elasticsearch/common/settings/Settings.java b/server/src/main/java/org/elasticsearch/common/settings/Settings.java index d18acf9d0d4f1..f0944017818ad 100644 --- a/server/src/main/java/org/elasticsearch/common/settings/Settings.java +++ b/server/src/main/java/org/elasticsearch/common/settings/Settings.java @@ -25,15 +25,15 @@ import org.elasticsearch.common.unit.MemorySizeValue; import org.elasticsearch.core.Nullable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.DeprecationHandler; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParserUtils; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.internal.io.IOUtils; import java.io.IOException; @@ -595,7 +595,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws /** * Parsers the generated xcontent from {@link Settings#toXContent(XContentBuilder, Params)} into a new Settings object. * Note this method requires the parser to either be positioned on a null token or on - * {@link org.elasticsearch.common.xcontent.XContentParser.Token#START_OBJECT}. + * {@link org.elasticsearch.xcontent.XContentParser.Token#START_OBJECT}. */ public static Settings fromXContent(XContentParser parser) throws IOException { return fromXContent(parser, true, false); diff --git a/server/src/main/java/org/elasticsearch/common/settings/SettingsFilter.java b/server/src/main/java/org/elasticsearch/common/settings/SettingsFilter.java index b54878c906428..1faab0d1c3f8a 100644 --- a/server/src/main/java/org/elasticsearch/common/settings/SettingsFilter.java +++ b/server/src/main/java/org/elasticsearch/common/settings/SettingsFilter.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.regex.Regex; -import org.elasticsearch.common.xcontent.ToXContent.Params; +import org.elasticsearch.xcontent.ToXContent.Params; import org.elasticsearch.rest.RestRequest; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/common/settings/SettingsModule.java b/server/src/main/java/org/elasticsearch/common/settings/SettingsModule.java index 428cc15c6fa9d..c08e4e182ea7b 100644 --- a/server/src/main/java/org/elasticsearch/common/settings/SettingsModule.java +++ b/server/src/main/java/org/elasticsearch/common/settings/SettingsModule.java @@ -13,9 +13,9 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.inject.Binder; import org.elasticsearch.common.inject.Module; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.util.Arrays; diff --git a/server/src/main/java/org/elasticsearch/common/text/Text.java b/server/src/main/java/org/elasticsearch/common/text/Text.java index 36d111fdae8b9..ec47552d319da 100644 --- a/server/src/main/java/org/elasticsearch/common/text/Text.java +++ b/server/src/main/java/org/elasticsearch/common/text/Text.java @@ -10,8 +10,8 @@ import org.apache.lucene.util.BytesRef; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.nio.charset.StandardCharsets; diff --git a/server/src/main/java/org/elasticsearch/common/time/WriteableZoneId.java b/server/src/main/java/org/elasticsearch/common/time/WriteableZoneId.java index 97469255e0da3..1ee62960e058e 100644 --- a/server/src/main/java/org/elasticsearch/common/time/WriteableZoneId.java +++ b/server/src/main/java/org/elasticsearch/common/time/WriteableZoneId.java @@ -12,8 +12,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.time.ZoneId; diff --git a/server/src/main/java/org/elasticsearch/common/transport/TransportAddress.java b/server/src/main/java/org/elasticsearch/common/transport/TransportAddress.java index 1e58de42a8a09..102de47919eff 100644 --- a/server/src/main/java/org/elasticsearch/common/transport/TransportAddress.java +++ b/server/src/main/java/org/elasticsearch/common/transport/TransportAddress.java @@ -12,8 +12,8 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.network.NetworkAddress; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.net.InetAddress; diff --git a/server/src/main/java/org/elasticsearch/common/unit/ByteSizeValue.java b/server/src/main/java/org/elasticsearch/common/unit/ByteSizeValue.java index d141bb2a28450..e64ed14fdb206 100644 --- a/server/src/main/java/org/elasticsearch/common/unit/ByteSizeValue.java +++ b/server/src/main/java/org/elasticsearch/common/unit/ByteSizeValue.java @@ -16,8 +16,8 @@ import org.elasticsearch.common.logging.DeprecationCategory; import org.elasticsearch.common.logging.DeprecationLogger; import org.elasticsearch.common.logging.LogConfigurator; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Locale; diff --git a/server/src/main/java/org/elasticsearch/common/unit/Fuzziness.java b/server/src/main/java/org/elasticsearch/common/unit/Fuzziness.java index b85cb0f634c29..9301bbe4bfba6 100644 --- a/server/src/main/java/org/elasticsearch/common/unit/Fuzziness.java +++ b/server/src/main/java/org/elasticsearch/common/unit/Fuzziness.java @@ -8,14 +8,14 @@ package org.elasticsearch.common.unit; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Locale; diff --git a/server/src/main/java/org/elasticsearch/common/xcontent/LoggingDeprecationHandler.java b/server/src/main/java/org/elasticsearch/common/xcontent/LoggingDeprecationHandler.java index e494afa2e6b63..d88221e914027 100644 --- a/server/src/main/java/org/elasticsearch/common/xcontent/LoggingDeprecationHandler.java +++ b/server/src/main/java/org/elasticsearch/common/xcontent/LoggingDeprecationHandler.java @@ -11,6 +11,9 @@ import org.elasticsearch.common.TriConsumer; import org.elasticsearch.common.logging.DeprecationCategory; import org.elasticsearch.common.logging.DeprecationLogger; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentLocation; import java.util.function.Supplier; diff --git a/server/src/main/java/org/elasticsearch/common/xcontent/ObjectParserHelper.java b/server/src/main/java/org/elasticsearch/common/xcontent/ObjectParserHelper.java index 7721cb396e07d..3e2e0440da503 100644 --- a/server/src/main/java/org/elasticsearch/common/xcontent/ObjectParserHelper.java +++ b/server/src/main/java/org/elasticsearch/common/xcontent/ObjectParserHelper.java @@ -10,8 +10,13 @@ import org.elasticsearch.core.CheckedFunction; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.AbstractObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import java.io.IOException; import java.util.function.BiConsumer; diff --git a/server/src/main/java/org/elasticsearch/common/xcontent/StatusToXContentObject.java b/server/src/main/java/org/elasticsearch/common/xcontent/StatusToXContentObject.java index b75f69bd2863a..e0af9777fddfc 100644 --- a/server/src/main/java/org/elasticsearch/common/xcontent/StatusToXContentObject.java +++ b/server/src/main/java/org/elasticsearch/common/xcontent/StatusToXContentObject.java @@ -8,6 +8,7 @@ package org.elasticsearch.common.xcontent; import org.elasticsearch.rest.RestStatus; +import org.elasticsearch.xcontent.ToXContentObject; /** * Objects that can both render themselves in as json/yaml/etc and can provide a {@link RestStatus} for their response. Usually should be diff --git a/server/src/main/java/org/elasticsearch/common/xcontent/SuggestingErrorOnUnknown.java b/server/src/main/java/org/elasticsearch/common/xcontent/SuggestingErrorOnUnknown.java index bdf610003fd42..17ac0e6a7c06d 100644 --- a/server/src/main/java/org/elasticsearch/common/xcontent/SuggestingErrorOnUnknown.java +++ b/server/src/main/java/org/elasticsearch/common/xcontent/SuggestingErrorOnUnknown.java @@ -11,6 +11,7 @@ import org.apache.lucene.search.spell.LevenshteinDistance; import org.apache.lucene.util.CollectionUtil; import org.elasticsearch.core.Tuple; +import org.elasticsearch.xcontent.ErrorOnUnknown; import java.util.ArrayList; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/common/xcontent/XContentElasticsearchExtension.java b/server/src/main/java/org/elasticsearch/common/xcontent/XContentElasticsearchExtension.java index 4ee2f199e8527..1e75d44a56366 100644 --- a/server/src/main/java/org/elasticsearch/common/xcontent/XContentElasticsearchExtension.java +++ b/server/src/main/java/org/elasticsearch/common/xcontent/XContentElasticsearchExtension.java @@ -13,6 +13,8 @@ import org.elasticsearch.common.time.DateFormatter; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilderExtension; import org.joda.time.DateTime; import org.joda.time.DateTimeZone; import org.joda.time.Instant; diff --git a/server/src/main/java/org/elasticsearch/common/xcontent/XContentHelper.java b/server/src/main/java/org/elasticsearch/common/xcontent/XContentHelper.java index 9da97348bd228..5c891843c0438 100644 --- a/server/src/main/java/org/elasticsearch/common/xcontent/XContentHelper.java +++ b/server/src/main/java/org/elasticsearch/common/xcontent/XContentHelper.java @@ -17,7 +17,16 @@ import org.elasticsearch.common.compress.Compressor; import org.elasticsearch.common.compress.CompressorFactory; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContent.Params; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContent.Params; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; import java.io.BufferedInputStream; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/common/xcontent/XContentParserUtils.java b/server/src/main/java/org/elasticsearch/common/xcontent/XContentParserUtils.java index b37593373c811..d711ca09d0b38 100644 --- a/server/src/main/java/org/elasticsearch/common/xcontent/XContentParserUtils.java +++ b/server/src/main/java/org/elasticsearch/common/xcontent/XContentParserUtils.java @@ -11,8 +11,11 @@ import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesArray; -import org.elasticsearch.common.xcontent.XContentParser.Token; +import org.elasticsearch.xcontent.XContentLocation; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser.Token; import org.elasticsearch.core.CheckedFunction; +import org.elasticsearch.xcontent.NamedXContentRegistry; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/discovery/DiscoveryStats.java b/server/src/main/java/org/elasticsearch/discovery/DiscoveryStats.java index d604d6075fa1c..7606fd9461122 100644 --- a/server/src/main/java/org/elasticsearch/discovery/DiscoveryStats.java +++ b/server/src/main/java/org/elasticsearch/discovery/DiscoveryStats.java @@ -14,8 +14,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.cluster.coordination.PendingClusterStateStats; import org.elasticsearch.cluster.coordination.PublishClusterStateStats; diff --git a/server/src/main/java/org/elasticsearch/env/NodeEnvironment.java b/server/src/main/java/org/elasticsearch/env/NodeEnvironment.java index 6147b1654bae4..8dceed8a9b179 100644 --- a/server/src/main/java/org/elasticsearch/env/NodeEnvironment.java +++ b/server/src/main/java/org/elasticsearch/env/NodeEnvironment.java @@ -39,7 +39,7 @@ import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.core.internal.io.IOUtils; import org.elasticsearch.gateway.MetadataStateFormat; import org.elasticsearch.gateway.PersistedClusterStateService; diff --git a/server/src/main/java/org/elasticsearch/env/NodeMetadata.java b/server/src/main/java/org/elasticsearch/env/NodeMetadata.java index 27f811a70504f..d291e06ca1434 100644 --- a/server/src/main/java/org/elasticsearch/env/NodeMetadata.java +++ b/server/src/main/java/org/elasticsearch/env/NodeMetadata.java @@ -9,11 +9,11 @@ package org.elasticsearch.env; import org.elasticsearch.Version; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.gateway.MetadataStateFormat; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/gateway/MetaStateService.java b/server/src/main/java/org/elasticsearch/gateway/MetaStateService.java index e01cc34a7a107..c3ce42c477f8e 100644 --- a/server/src/main/java/org/elasticsearch/gateway/MetaStateService.java +++ b/server/src/main/java/org/elasticsearch/gateway/MetaStateService.java @@ -16,7 +16,7 @@ import org.elasticsearch.cluster.metadata.Metadata; import org.elasticsearch.core.Nullable; import org.elasticsearch.core.Tuple; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.index.Index; diff --git a/server/src/main/java/org/elasticsearch/gateway/MetadataStateFormat.java b/server/src/main/java/org/elasticsearch/gateway/MetadataStateFormat.java index d17a7c02924fe..7215b1bcdcd7e 100644 --- a/server/src/main/java/org/elasticsearch/gateway/MetadataStateFormat.java +++ b/server/src/main/java/org/elasticsearch/gateway/MetadataStateFormat.java @@ -24,11 +24,11 @@ import org.elasticsearch.common.lucene.store.IndexOutputOutputStream; import org.elasticsearch.common.lucene.store.InputStreamIndexInput; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.internal.io.IOUtils; import java.io.FileNotFoundException; diff --git a/server/src/main/java/org/elasticsearch/gateway/PersistedClusterStateService.java b/server/src/main/java/org/elasticsearch/gateway/PersistedClusterStateService.java index cff89ca920ee3..4066239399558 100644 --- a/server/src/main/java/org/elasticsearch/gateway/PersistedClusterStateService.java +++ b/server/src/main/java/org/elasticsearch/gateway/PersistedClusterStateService.java @@ -53,11 +53,11 @@ import org.elasticsearch.common.util.ByteArray; import org.elasticsearch.common.util.PageCacheRecycler; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.CheckedConsumer; import org.elasticsearch.core.Nullable; import org.elasticsearch.core.Releasable; diff --git a/server/src/main/java/org/elasticsearch/gateway/TransportNodesListGatewayStartedShards.java b/server/src/main/java/org/elasticsearch/gateway/TransportNodesListGatewayStartedShards.java index 62926b1082fb8..a8d59376a1901 100644 --- a/server/src/main/java/org/elasticsearch/gateway/TransportNodesListGatewayStartedShards.java +++ b/server/src/main/java/org/elasticsearch/gateway/TransportNodesListGatewayStartedShards.java @@ -27,7 +27,7 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.shard.ShardId; diff --git a/server/src/main/java/org/elasticsearch/http/AbstractHttpServerTransport.java b/server/src/main/java/org/elasticsearch/http/AbstractHttpServerTransport.java index bf5524b7dc8ef..5ee5371f5e9a7 100644 --- a/server/src/main/java/org/elasticsearch/http/AbstractHttpServerTransport.java +++ b/server/src/main/java/org/elasticsearch/http/AbstractHttpServerTransport.java @@ -30,7 +30,7 @@ import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.common.util.BigArrays; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.core.AbstractRefCounted; import org.elasticsearch.core.RefCounted; import org.elasticsearch.rest.RestChannel; diff --git a/server/src/main/java/org/elasticsearch/http/HttpInfo.java b/server/src/main/java/org/elasticsearch/http/HttpInfo.java index f7ea9e71b701d..2b00182377cd6 100644 --- a/server/src/main/java/org/elasticsearch/http/HttpInfo.java +++ b/server/src/main/java/org/elasticsearch/http/HttpInfo.java @@ -14,7 +14,7 @@ import org.elasticsearch.common.transport.BoundTransportAddress; import org.elasticsearch.common.transport.TransportAddress; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.node.ReportingService; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/http/HttpStats.java b/server/src/main/java/org/elasticsearch/http/HttpStats.java index de5b640664983..2584d8bfcb7ba 100644 --- a/server/src/main/java/org/elasticsearch/http/HttpStats.java +++ b/server/src/main/java/org/elasticsearch/http/HttpStats.java @@ -11,8 +11,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/index/Index.java b/server/src/main/java/org/elasticsearch/index/Index.java index e77ef2406bc0a..13d7c242d8dc9 100644 --- a/server/src/main/java/org/elasticsearch/index/Index.java +++ b/server/src/main/java/org/elasticsearch/index/Index.java @@ -9,14 +9,14 @@ package org.elasticsearch.index; import org.elasticsearch.cluster.ClusterState; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/server/src/main/java/org/elasticsearch/index/IndexModule.java b/server/src/main/java/org/elasticsearch/index/IndexModule.java index c9dfa1c170566..f456a881f216b 100644 --- a/server/src/main/java/org/elasticsearch/index/IndexModule.java +++ b/server/src/main/java/org/elasticsearch/index/IndexModule.java @@ -28,7 +28,7 @@ import org.elasticsearch.common.settings.Setting.Property; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.BigArrays; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.core.internal.io.IOUtils; import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.index.analysis.AnalysisRegistry; diff --git a/server/src/main/java/org/elasticsearch/index/IndexService.java b/server/src/main/java/org/elasticsearch/index/IndexService.java index 8ac8c4f455aee..5585211939e32 100644 --- a/server/src/main/java/org/elasticsearch/index/IndexService.java +++ b/server/src/main/java/org/elasticsearch/index/IndexService.java @@ -34,7 +34,7 @@ import org.elasticsearch.common.util.Maps; import org.elasticsearch.common.util.concurrent.AbstractAsyncTask; import org.elasticsearch.common.util.concurrent.AbstractRunnable; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.core.internal.io.IOUtils; import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.env.ShardLock; diff --git a/server/src/main/java/org/elasticsearch/index/SearchSlowLog.java b/server/src/main/java/org/elasticsearch/index/SearchSlowLog.java index ad0787ce3e07e..1f6760a22e176 100644 --- a/server/src/main/java/org/elasticsearch/index/SearchSlowLog.java +++ b/server/src/main/java/org/elasticsearch/index/SearchSlowLog.java @@ -17,7 +17,7 @@ import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Setting.Property; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContent; import org.elasticsearch.index.shard.SearchOperationListener; import org.elasticsearch.search.internal.SearchContext; import org.elasticsearch.tasks.Task; diff --git a/server/src/main/java/org/elasticsearch/index/analysis/NameOrDefinition.java b/server/src/main/java/org/elasticsearch/index/analysis/NameOrDefinition.java index 737afb6565556..411536ba1b588 100644 --- a/server/src/main/java/org/elasticsearch/index/analysis/NameOrDefinition.java +++ b/server/src/main/java/org/elasticsearch/index/analysis/NameOrDefinition.java @@ -12,10 +12,10 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Map; diff --git a/server/src/main/java/org/elasticsearch/index/bulk/stats/BulkStats.java b/server/src/main/java/org/elasticsearch/index/bulk/stats/BulkStats.java index 35ad8cd3989c3..17295bc4186cd 100644 --- a/server/src/main/java/org/elasticsearch/index/bulk/stats/BulkStats.java +++ b/server/src/main/java/org/elasticsearch/index/bulk/stats/BulkStats.java @@ -12,9 +12,9 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/server/src/main/java/org/elasticsearch/index/cache/query/QueryCacheStats.java b/server/src/main/java/org/elasticsearch/index/cache/query/QueryCacheStats.java index 2b704de6960da..d332a85907cdd 100644 --- a/server/src/main/java/org/elasticsearch/index/cache/query/QueryCacheStats.java +++ b/server/src/main/java/org/elasticsearch/index/cache/query/QueryCacheStats.java @@ -15,9 +15,9 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/index/cache/request/RequestCacheStats.java b/server/src/main/java/org/elasticsearch/index/cache/request/RequestCacheStats.java index 8e285b108694a..60d9cdae3bb5d 100644 --- a/server/src/main/java/org/elasticsearch/index/cache/request/RequestCacheStats.java +++ b/server/src/main/java/org/elasticsearch/index/cache/request/RequestCacheStats.java @@ -12,8 +12,8 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/index/engine/CommitStats.java b/server/src/main/java/org/elasticsearch/index/engine/CommitStats.java index 50385c91f14f5..957a85ac9d757 100644 --- a/server/src/main/java/org/elasticsearch/index/engine/CommitStats.java +++ b/server/src/main/java/org/elasticsearch/index/engine/CommitStats.java @@ -13,8 +13,8 @@ import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.lucene.Lucene; import org.elasticsearch.common.util.Maps; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/index/engine/SegmentsStats.java b/server/src/main/java/org/elasticsearch/index/engine/SegmentsStats.java index d5381f1a1b0c1..71aaf155b9d38 100644 --- a/server/src/main/java/org/elasticsearch/index/engine/SegmentsStats.java +++ b/server/src/main/java/org/elasticsearch/index/engine/SegmentsStats.java @@ -17,8 +17,8 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.store.LuceneFilesExtensions; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/index/fielddata/FieldDataStats.java b/server/src/main/java/org/elasticsearch/index/fielddata/FieldDataStats.java index 3d59d58d7b1bb..d66849b3a59f9 100644 --- a/server/src/main/java/org/elasticsearch/index/fielddata/FieldDataStats.java +++ b/server/src/main/java/org/elasticsearch/index/fielddata/FieldDataStats.java @@ -14,8 +14,8 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/server/src/main/java/org/elasticsearch/index/flush/FlushStats.java b/server/src/main/java/org/elasticsearch/index/flush/FlushStats.java index 528fd20f46b0c..a6a82d9912500 100644 --- a/server/src/main/java/org/elasticsearch/index/flush/FlushStats.java +++ b/server/src/main/java/org/elasticsearch/index/flush/FlushStats.java @@ -12,8 +12,8 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/index/get/GetResult.java b/server/src/main/java/org/elasticsearch/index/get/GetResult.java index 7c5a7d18857db..1bc6b20321a2e 100644 --- a/server/src/main/java/org/elasticsearch/index/get/GetResult.java +++ b/server/src/main/java/org/elasticsearch/index/get/GetResult.java @@ -19,10 +19,10 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.logging.DeprecationLogger; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.mapper.IgnoredFieldMapper; import org.elasticsearch.index.mapper.MapperService; import org.elasticsearch.index.mapper.SourceFieldMapper; diff --git a/server/src/main/java/org/elasticsearch/index/get/GetStats.java b/server/src/main/java/org/elasticsearch/index/get/GetStats.java index e4a718bb662da..d800c06b793af 100644 --- a/server/src/main/java/org/elasticsearch/index/get/GetStats.java +++ b/server/src/main/java/org/elasticsearch/index/get/GetStats.java @@ -12,8 +12,8 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/index/get/ShardGetService.java b/server/src/main/java/org/elasticsearch/index/get/ShardGetService.java index 936ef7df165de..d263f8c2c2799 100644 --- a/server/src/main/java/org/elasticsearch/index/get/ShardGetService.java +++ b/server/src/main/java/org/elasticsearch/index/get/ShardGetService.java @@ -16,9 +16,9 @@ import org.elasticsearch.common.metrics.CounterMetric; import org.elasticsearch.common.metrics.MeanMetric; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.core.Nullable; import org.elasticsearch.core.Tuple; diff --git a/server/src/main/java/org/elasticsearch/index/mapper/AbstractGeometryFieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/AbstractGeometryFieldMapper.java index 914963c871dd6..ce7a0d82a916f 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/AbstractGeometryFieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/AbstractGeometryFieldMapper.java @@ -10,8 +10,8 @@ import org.apache.lucene.search.Query; import org.elasticsearch.common.Explicit; import org.elasticsearch.common.geo.GeometryFormatterFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.support.MapXContentParser; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.support.MapXContentParser; import org.elasticsearch.core.CheckedConsumer; import org.elasticsearch.index.analysis.NamedAnalyzer; import org.elasticsearch.index.query.SearchExecutionContext; diff --git a/server/src/main/java/org/elasticsearch/index/mapper/AbstractPointGeometryFieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/AbstractPointGeometryFieldMapper.java index eea937f2ff3bd..b73f0d5b0c0f8 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/AbstractPointGeometryFieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/AbstractPointGeometryFieldMapper.java @@ -11,7 +11,7 @@ import org.elasticsearch.common.CheckedBiFunction; import org.elasticsearch.common.Explicit; import org.elasticsearch.common.TriFunction; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.CheckedConsumer; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/index/mapper/BinaryFieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/BinaryFieldMapper.java index 7c158590e6c03..4483f04acbdf0 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/BinaryFieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/BinaryFieldMapper.java @@ -18,7 +18,7 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.util.CollectionUtils; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.fielddata.IndexFieldData; import org.elasticsearch.index.fielddata.plain.BytesBinaryIndexFieldData; import org.elasticsearch.index.query.SearchExecutionContext; diff --git a/server/src/main/java/org/elasticsearch/index/mapper/BooleanFieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/BooleanFieldMapper.java index 1b67683a1dcee..032f8ac11cef3 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/BooleanFieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/BooleanFieldMapper.java @@ -18,7 +18,7 @@ import org.apache.lucene.search.TermRangeQuery; import org.apache.lucene.util.BytesRef; import org.elasticsearch.common.lucene.Lucene; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.core.Booleans; import org.elasticsearch.core.Nullable; diff --git a/server/src/main/java/org/elasticsearch/index/mapper/CompletionFieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/CompletionFieldMapper.java index 0154a06703b98..72425a4929011 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/CompletionFieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/CompletionFieldMapper.java @@ -23,12 +23,12 @@ import org.elasticsearch.common.logging.DeprecationLogger; import org.elasticsearch.common.unit.Fuzziness; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.FilterXContentParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentParser.NumberType; -import org.elasticsearch.common.xcontent.XContentParser.Token; -import org.elasticsearch.common.xcontent.support.MapXContentParser; +import org.elasticsearch.xcontent.FilterXContentParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser.NumberType; +import org.elasticsearch.xcontent.XContentParser.Token; +import org.elasticsearch.xcontent.support.MapXContentParser; import org.elasticsearch.index.analysis.AnalyzerScope; import org.elasticsearch.index.analysis.NamedAnalyzer; import org.elasticsearch.index.query.SearchExecutionContext; diff --git a/server/src/main/java/org/elasticsearch/index/mapper/CompositeRuntimeField.java b/server/src/main/java/org/elasticsearch/index/mapper/CompositeRuntimeField.java index 78ab0f9d121a5..d229062cd60ef 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/CompositeRuntimeField.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/CompositeRuntimeField.java @@ -8,7 +8,7 @@ package org.elasticsearch.index.mapper; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.script.CompositeFieldScript; import org.elasticsearch.script.Script; import org.elasticsearch.search.lookup.SearchLookup; diff --git a/server/src/main/java/org/elasticsearch/index/mapper/DataStreamTimestampFieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/DataStreamTimestampFieldMapper.java index b4be07e53825d..88b8f6305e354 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/DataStreamTimestampFieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/DataStreamTimestampFieldMapper.java @@ -12,9 +12,9 @@ import org.apache.lucene.index.IndexableField; import org.apache.lucene.search.Query; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.query.SearchExecutionContext; import java.io.IOException; @@ -23,7 +23,7 @@ import java.util.List; import java.util.Map; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; /** * FieldMapper for the data-stream's timestamp meta-field. diff --git a/server/src/main/java/org/elasticsearch/index/mapper/DocCountFieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/DocCountFieldMapper.java index b379729d50012..db279f261d894 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/DocCountFieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/DocCountFieldMapper.java @@ -8,7 +8,7 @@ package org.elasticsearch.index.mapper; import org.apache.lucene.search.Query; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParserUtils; import org.elasticsearch.index.query.QueryShardException; import org.elasticsearch.index.query.SearchExecutionContext; diff --git a/server/src/main/java/org/elasticsearch/index/mapper/DocumentParser.java b/server/src/main/java/org/elasticsearch/index/mapper/DocumentParser.java index 155d6e1b33d72..24b81241592b8 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/DocumentParser.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/DocumentParser.java @@ -17,11 +17,11 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.time.DateFormatter; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.Tuple; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.analysis.IndexAnalyzers; diff --git a/server/src/main/java/org/elasticsearch/index/mapper/DocumentParserContext.java b/server/src/main/java/org/elasticsearch/index/mapper/DocumentParserContext.java index 121ecff565c2a..9c4f5f5e82822 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/DocumentParserContext.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/DocumentParserContext.java @@ -10,7 +10,7 @@ import org.apache.lucene.document.Field; import org.elasticsearch.common.time.DateFormatter; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.analysis.IndexAnalyzers; diff --git a/server/src/main/java/org/elasticsearch/index/mapper/DynamicFieldsBuilder.java b/server/src/main/java/org/elasticsearch/index/mapper/DynamicFieldsBuilder.java index 3fa2b58138a19..1820955a475d7 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/DynamicFieldsBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/DynamicFieldsBuilder.java @@ -12,7 +12,7 @@ import org.elasticsearch.common.CheckedBiConsumer; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.time.DateFormatter; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.CheckedRunnable; import org.elasticsearch.index.mapper.ObjectMapper.Dynamic; import org.elasticsearch.script.ScriptCompiler; diff --git a/server/src/main/java/org/elasticsearch/index/mapper/DynamicTemplate.java b/server/src/main/java/org/elasticsearch/index/mapper/DynamicTemplate.java index ebf845851d2a2..c48227c3fe400 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/DynamicTemplate.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/DynamicTemplate.java @@ -9,8 +9,8 @@ package org.elasticsearch.index.mapper; import org.elasticsearch.common.regex.Regex; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/index/mapper/FieldAliasMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/FieldAliasMapper.java index 24e24ef248a21..f51f6c9259a30 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/FieldAliasMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/FieldAliasMapper.java @@ -8,7 +8,7 @@ package org.elasticsearch.index.mapper; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.support.XContentMapValues; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/index/mapper/FieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/FieldMapper.java index 6018f410be6a3..0f7134841ab24 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/FieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/FieldMapper.java @@ -16,11 +16,11 @@ import org.elasticsearch.common.logging.DeprecationLogger; import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Setting.Property; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.support.AbstractXContentParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.support.AbstractXContentParser; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.index.analysis.NamedAnalyzer; import org.elasticsearch.script.Script; diff --git a/server/src/main/java/org/elasticsearch/index/mapper/GeoPointFieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/GeoPointFieldMapper.java index 49863fe61d759..c169425d1303c 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/GeoPointFieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/GeoPointFieldMapper.java @@ -27,8 +27,8 @@ import org.elasticsearch.common.geo.ShapeRelation; import org.elasticsearch.common.geo.SimpleVectorTileFormatter; import org.elasticsearch.common.unit.DistanceUnit; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.support.MapXContentParser; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.support.MapXContentParser; import org.elasticsearch.geometry.Geometry; import org.elasticsearch.geometry.Point; import org.elasticsearch.geometry.ShapeType; diff --git a/server/src/main/java/org/elasticsearch/index/mapper/GeoShapeParser.java b/server/src/main/java/org/elasticsearch/index/mapper/GeoShapeParser.java index d9d5ef152d9af..4e91478e242a5 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/GeoShapeParser.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/GeoShapeParser.java @@ -11,7 +11,7 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.core.CheckedConsumer; import org.elasticsearch.common.geo.GeometryParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.geometry.Geometry; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/index/mapper/IpFieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/IpFieldMapper.java index 5399ccc405f77..df11c09735c48 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/IpFieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/IpFieldMapper.java @@ -22,7 +22,7 @@ import org.elasticsearch.common.logging.DeprecationCategory; import org.elasticsearch.common.logging.DeprecationLogger; import org.elasticsearch.common.network.InetAddresses; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.Nullable; import org.elasticsearch.core.Tuple; import org.elasticsearch.index.fielddata.IndexFieldData; diff --git a/server/src/main/java/org/elasticsearch/index/mapper/KeywordFieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/KeywordFieldMapper.java index 0d02184f30443..2197baffe598a 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/KeywordFieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/KeywordFieldMapper.java @@ -31,7 +31,7 @@ import org.apache.lucene.util.automaton.Operations; import org.elasticsearch.common.lucene.Lucene; import org.elasticsearch.common.lucene.search.AutomatonQueries; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.analysis.IndexAnalyzers; import org.elasticsearch.index.analysis.NamedAnalyzer; import org.elasticsearch.index.fielddata.IndexFieldData; diff --git a/server/src/main/java/org/elasticsearch/index/mapper/LeafRuntimeField.java b/server/src/main/java/org/elasticsearch/index/mapper/LeafRuntimeField.java index 166aec60f45b1..9462e67f9ade1 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/LeafRuntimeField.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/LeafRuntimeField.java @@ -8,7 +8,7 @@ package org.elasticsearch.index.mapper; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/index/mapper/Mapper.java b/server/src/main/java/org/elasticsearch/index/mapper/Mapper.java index 112fd4a97633c..ebb743dca2402 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/Mapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/Mapper.java @@ -8,7 +8,7 @@ package org.elasticsearch.index.mapper; -import org.elasticsearch.common.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.ToXContentFragment; import java.util.Map; import java.util.Objects; diff --git a/server/src/main/java/org/elasticsearch/index/mapper/MapperService.java b/server/src/main/java/org/elasticsearch/index/mapper/MapperService.java index b16e545674806..c759f100b1fb0 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/MapperService.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/MapperService.java @@ -18,11 +18,11 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.time.DateFormatter; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.AbstractIndexComponent; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.analysis.AnalysisRegistry; diff --git a/server/src/main/java/org/elasticsearch/index/mapper/Mapping.java b/server/src/main/java/org/elasticsearch/index/mapper/Mapping.java index 5cc0827a1c932..ca6fe392236e3 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/Mapping.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/Mapping.java @@ -11,12 +11,12 @@ import org.elasticsearch.ElasticsearchGenerationException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.compress.CompressedXContent; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.mapper.MapperService.MergeReason; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/index/mapper/MappingParser.java b/server/src/main/java/org/elasticsearch/index/mapper/MappingParser.java index 60a1974aaa89a..727e7622c27df 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/MappingParser.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/MappingParser.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.compress.CompressedXContent; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.Nullable; import java.util.Collections; diff --git a/server/src/main/java/org/elasticsearch/index/mapper/MetadataFieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/MetadataFieldMapper.java index 8ee94d41193bf..dfdf1a1a908db 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/MetadataFieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/MetadataFieldMapper.java @@ -9,7 +9,7 @@ package org.elasticsearch.index.mapper; import org.elasticsearch.common.Explicit; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.index.analysis.NamedAnalyzer; diff --git a/server/src/main/java/org/elasticsearch/index/mapper/NestedObjectMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/NestedObjectMapper.java index 3ae5baa99164f..f14918e9da802 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/NestedObjectMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/NestedObjectMapper.java @@ -11,7 +11,7 @@ import org.apache.lucene.search.Query; import org.elasticsearch.Version; import org.elasticsearch.common.Explicit; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.support.XContentMapValues; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/index/mapper/NumberFieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/NumberFieldMapper.java index b2fee19c2e240..7ae747dae0b2d 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/NumberFieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/NumberFieldMapper.java @@ -32,8 +32,8 @@ import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Setting.Property; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentParser.Token; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser.Token; import org.elasticsearch.index.fielddata.IndexFieldData; import org.elasticsearch.index.fielddata.IndexNumericFieldData.NumericType; import org.elasticsearch.index.fielddata.plain.SortedNumericIndexFieldData; diff --git a/server/src/main/java/org/elasticsearch/index/mapper/ObjectMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/ObjectMapper.java index 6875ea191a4ff..524758243ca58 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/ObjectMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/ObjectMapper.java @@ -13,8 +13,8 @@ import org.elasticsearch.common.collect.CopyOnWriteHashMap; import org.elasticsearch.common.logging.DeprecationCategory; import org.elasticsearch.common.logging.DeprecationLogger; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.index.mapper.MapperService.MergeReason; diff --git a/server/src/main/java/org/elasticsearch/index/mapper/ParsedDocument.java b/server/src/main/java/org/elasticsearch/index/mapper/ParsedDocument.java index fcbcc6e572783..e8f47442b03be 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/ParsedDocument.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/ParsedDocument.java @@ -13,7 +13,7 @@ import org.apache.lucene.util.BytesRef; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.mapper.MapperService.MergeReason; import java.util.Collections; diff --git a/server/src/main/java/org/elasticsearch/index/mapper/RangeFieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/RangeFieldMapper.java index 903d818312325..bc64f5af91846 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/RangeFieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/RangeFieldMapper.java @@ -19,7 +19,7 @@ import org.elasticsearch.common.time.DateFormatter; import org.elasticsearch.common.time.DateMathParser; import org.elasticsearch.common.util.LocaleUtils; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.Tuple; import org.elasticsearch.index.fielddata.IndexFieldData; import org.elasticsearch.index.fielddata.plain.BinaryIndexFieldData; diff --git a/server/src/main/java/org/elasticsearch/index/mapper/RangeType.java b/server/src/main/java/org/elasticsearch/index/mapper/RangeType.java index 4d449707e6f44..8bddaec5b11b6 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/RangeType.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/RangeType.java @@ -26,7 +26,7 @@ import org.elasticsearch.common.network.InetAddresses; import org.elasticsearch.common.time.DateFormatter; import org.elasticsearch.common.time.DateMathParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.Nullable; import org.elasticsearch.index.query.SearchExecutionContext; diff --git a/server/src/main/java/org/elasticsearch/index/mapper/RootObjectMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/RootObjectMapper.java index 2477e3fed5547..ed2e51660d343 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/RootObjectMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/RootObjectMapper.java @@ -15,8 +15,8 @@ import org.elasticsearch.common.logging.DeprecationCategory; import org.elasticsearch.common.logging.DeprecationLogger; import org.elasticsearch.common.time.DateFormatter; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.mapper.DynamicTemplate.XContentFieldType; import org.elasticsearch.index.mapper.MapperService.MergeReason; diff --git a/server/src/main/java/org/elasticsearch/index/mapper/RuntimeField.java b/server/src/main/java/org/elasticsearch/index/mapper/RuntimeField.java index c2f342a610bdd..3d03a7321ecb4 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/RuntimeField.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/RuntimeField.java @@ -8,7 +8,7 @@ package org.elasticsearch.index.mapper; -import org.elasticsearch.common.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.ToXContentFragment; import org.elasticsearch.index.mapper.FieldMapper.Parameter; import org.elasticsearch.script.CompositeFieldScript; import org.elasticsearch.script.Script; diff --git a/server/src/main/java/org/elasticsearch/index/mapper/SourceFieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/SourceFieldMapper.java index 88fd543071e9e..20859cb557aa7 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/SourceFieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/SourceFieldMapper.java @@ -18,10 +18,10 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.util.CollectionUtils; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.core.Nullable; import org.elasticsearch.core.Tuple; diff --git a/server/src/main/java/org/elasticsearch/index/mapper/SourceToParse.java b/server/src/main/java/org/elasticsearch/index/mapper/SourceToParse.java index c7dd591a0321e..fe8e755a531c2 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/SourceToParse.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/SourceToParse.java @@ -11,7 +11,7 @@ import org.elasticsearch.core.Nullable; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import java.util.Map; import java.util.Objects; diff --git a/server/src/main/java/org/elasticsearch/index/mapper/TextFieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/TextFieldMapper.java index 61bca319741c7..0c5e07e3324f1 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/TextFieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/TextFieldMapper.java @@ -50,8 +50,8 @@ import org.elasticsearch.common.lucene.Lucene; import org.elasticsearch.common.lucene.search.AutomatonQueries; import org.elasticsearch.common.lucene.search.MultiPhrasePrefixQuery; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.index.analysis.AnalyzerScope; import org.elasticsearch.index.analysis.IndexAnalyzers; diff --git a/server/src/main/java/org/elasticsearch/index/mapper/flattened/FlattenedFieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/flattened/FlattenedFieldMapper.java index 29dd758fa432d..0395ec5b57dd6 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/flattened/FlattenedFieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/flattened/FlattenedFieldMapper.java @@ -34,7 +34,7 @@ import org.elasticsearch.common.lucene.search.AutomatonQueries; import org.elasticsearch.common.unit.Fuzziness; import org.elasticsearch.common.util.BigArrays; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.fielddata.IndexFieldData; import org.elasticsearch.index.fielddata.IndexFieldData.XFieldComparatorSource.Nested; import org.elasticsearch.index.fielddata.IndexFieldDataCache; diff --git a/server/src/main/java/org/elasticsearch/index/mapper/flattened/FlattenedFieldParser.java b/server/src/main/java/org/elasticsearch/index/mapper/flattened/FlattenedFieldParser.java index e9aaf7cc9c91b..8aab6cbfdc043 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/flattened/FlattenedFieldParser.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/flattened/FlattenedFieldParser.java @@ -13,7 +13,7 @@ import org.apache.lucene.document.StringField; import org.apache.lucene.index.IndexableField; import org.apache.lucene.util.BytesRef; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParserUtils; import org.elasticsearch.index.mapper.ContentPath; import org.elasticsearch.index.mapper.MappedFieldType; @@ -176,5 +176,5 @@ static BytesRef extractValue(BytesRef keyedValue) { } int valueStart = keyedValue.offset + length + 1; return new BytesRef(keyedValue.bytes, valueStart, keyedValue.length - valueStart ); - } + } } diff --git a/server/src/main/java/org/elasticsearch/index/merge/MergeStats.java b/server/src/main/java/org/elasticsearch/index/merge/MergeStats.java index bf0063b82cdb6..9ee03e64b5a19 100644 --- a/server/src/main/java/org/elasticsearch/index/merge/MergeStats.java +++ b/server/src/main/java/org/elasticsearch/index/merge/MergeStats.java @@ -13,8 +13,8 @@ import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/index/query/AbstractGeometryQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/AbstractGeometryQueryBuilder.java index f9ba9cdb87c20..6bbfd1ebc19a5 100644 --- a/server/src/main/java/org/elasticsearch/index/query/AbstractGeometryQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/AbstractGeometryQueryBuilder.java @@ -16,7 +16,7 @@ import org.elasticsearch.action.get.GetRequest; import org.elasticsearch.client.Client; import org.elasticsearch.common.logging.DeprecationLogger; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.geo.GeoJson; import org.elasticsearch.common.geo.GeometryIO; @@ -25,10 +25,10 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.geometry.Geometry; import org.elasticsearch.index.mapper.MappedFieldType; diff --git a/server/src/main/java/org/elasticsearch/index/query/AbstractQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/AbstractQueryBuilder.java index 5316d685fb4bd..95cb61fbd1176 100644 --- a/server/src/main/java/org/elasticsearch/index/query/AbstractQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/AbstractQueryBuilder.java @@ -17,13 +17,13 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.lucene.BytesRefs; -import org.elasticsearch.common.xcontent.AbstractObjectParser; -import org.elasticsearch.common.xcontent.NamedObjectNotFoundException; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.AbstractObjectParser; +import org.elasticsearch.xcontent.NamedObjectNotFoundException; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.xcontent.SuggestingErrorOnUnknown; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentLocation; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentLocation; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.math.BigInteger; diff --git a/server/src/main/java/org/elasticsearch/index/query/BaseTermQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/BaseTermQueryBuilder.java index 9b213980b8d47..f42661df6dbf8 100644 --- a/server/src/main/java/org/elasticsearch/index/query/BaseTermQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/BaseTermQueryBuilder.java @@ -9,11 +9,11 @@ package org.elasticsearch.index.query; import org.apache.lucene.util.BytesRef; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/server/src/main/java/org/elasticsearch/index/query/BoolQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/BoolQueryBuilder.java index fbcbf283a5af7..6789af3f1e2e3 100644 --- a/server/src/main/java/org/elasticsearch/index/query/BoolQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/BoolQueryBuilder.java @@ -13,14 +13,14 @@ import org.apache.lucene.search.BooleanQuery; import org.apache.lucene.search.MatchAllDocsQuery; import org.apache.lucene.search.Query; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.lucene.search.Queries; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.RestApiVersion; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/index/query/BoostingQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/BoostingQueryBuilder.java index b1df2329a9496..4b901310411b1 100644 --- a/server/src/main/java/org/elasticsearch/index/query/BoostingQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/BoostingQueryBuilder.java @@ -10,12 +10,12 @@ import org.apache.lucene.queries.function.FunctionScoreQuery; import org.apache.lucene.search.Query; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Map; diff --git a/server/src/main/java/org/elasticsearch/index/query/CombinedFieldsQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/CombinedFieldsQueryBuilder.java index c5e0c30b44dde..c8a950a72b3f1 100644 --- a/server/src/main/java/org/elasticsearch/index/query/CombinedFieldsQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/CombinedFieldsQueryBuilder.java @@ -22,15 +22,15 @@ import org.apache.lucene.search.similarities.Similarity; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.QueryBuilder; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.lucene.search.Queries; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.mapper.TextFieldMapper; import org.elasticsearch.index.mapper.TextSearchInfo; diff --git a/server/src/main/java/org/elasticsearch/index/query/CommonTermsQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/CommonTermsQueryBuilder.java index f7aea8458d7cc..76aa9dca5df3a 100644 --- a/server/src/main/java/org/elasticsearch/index/query/CommonTermsQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/CommonTermsQueryBuilder.java @@ -12,9 +12,9 @@ import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.logging.DeprecationLogger; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.RestApiVersion; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/index/query/ConstantScoreQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/ConstantScoreQueryBuilder.java index ca013d395e7fb..fdf3b8a710504 100644 --- a/server/src/main/java/org/elasticsearch/index/query/ConstantScoreQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/ConstantScoreQueryBuilder.java @@ -10,12 +10,12 @@ import org.apache.lucene.search.ConstantScoreQuery; import org.apache.lucene.search.Query; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Map; diff --git a/server/src/main/java/org/elasticsearch/index/query/CoordinatorRewriteContext.java b/server/src/main/java/org/elasticsearch/index/query/CoordinatorRewriteContext.java index 2570d3b30afa6..e842cbe86bf58 100644 --- a/server/src/main/java/org/elasticsearch/index/query/CoordinatorRewriteContext.java +++ b/server/src/main/java/org/elasticsearch/index/query/CoordinatorRewriteContext.java @@ -11,7 +11,7 @@ import org.elasticsearch.client.Client; import org.elasticsearch.core.Nullable; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.index.Index; import org.elasticsearch.index.mapper.DateFieldMapper; import org.elasticsearch.index.mapper.MappedFieldType; diff --git a/server/src/main/java/org/elasticsearch/index/query/CoordinatorRewriteContextProvider.java b/server/src/main/java/org/elasticsearch/index/query/CoordinatorRewriteContextProvider.java index 167c67f0ad988..a8c1b9b089846 100644 --- a/server/src/main/java/org/elasticsearch/index/query/CoordinatorRewriteContextProvider.java +++ b/server/src/main/java/org/elasticsearch/index/query/CoordinatorRewriteContextProvider.java @@ -13,7 +13,7 @@ import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.core.Nullable; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.index.Index; import org.elasticsearch.index.mapper.DateFieldMapper; import org.elasticsearch.index.shard.IndexLongFieldRange; diff --git a/server/src/main/java/org/elasticsearch/index/query/DisMaxQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/DisMaxQueryBuilder.java index 2be639d6cc59a..999dfd6f7118c 100644 --- a/server/src/main/java/org/elasticsearch/index/query/DisMaxQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/DisMaxQueryBuilder.java @@ -10,13 +10,13 @@ import org.apache.lucene.search.DisjunctionMaxQuery; import org.apache.lucene.search.Query; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.lucene.search.Queries; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/index/query/DistanceFeatureQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/DistanceFeatureQueryBuilder.java index b59fd546ac386..e1e644285584f 100644 --- a/server/src/main/java/org/elasticsearch/index/query/DistanceFeatureQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/DistanceFeatureQueryBuilder.java @@ -9,23 +9,23 @@ package org.elasticsearch.index.query; import org.apache.lucene.search.Query; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.geo.GeoPoint; import org.elasticsearch.common.geo.GeoUtils; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.lucene.search.Queries; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.mapper.MappedFieldType; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; /** * A query to boost scores based on their proximity to the given origin diff --git a/server/src/main/java/org/elasticsearch/index/query/ExistsQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/ExistsQueryBuilder.java index 364e18153321a..59aeca9ad8950 100644 --- a/server/src/main/java/org/elasticsearch/index/query/ExistsQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/ExistsQueryBuilder.java @@ -13,13 +13,13 @@ import org.apache.lucene.search.ConstantScoreQuery; import org.apache.lucene.search.MatchNoDocsQuery; import org.apache.lucene.search.Query; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.mapper.MappedFieldType; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/index/query/FieldMaskingSpanQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/FieldMaskingSpanQueryBuilder.java index 27b060f94744a..4805b467027a6 100644 --- a/server/src/main/java/org/elasticsearch/index/query/FieldMaskingSpanQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/FieldMaskingSpanQueryBuilder.java @@ -15,9 +15,9 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.mapper.MappedFieldType; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/index/query/FuzzyQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/FuzzyQueryBuilder.java index f884c9c6a566f..8260f611563c1 100644 --- a/server/src/main/java/org/elasticsearch/index/query/FuzzyQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/FuzzyQueryBuilder.java @@ -11,15 +11,15 @@ import org.apache.lucene.search.FuzzyQuery; import org.apache.lucene.search.MultiTermQuery; import org.apache.lucene.search.Query; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.unit.Fuzziness; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.query.support.QueryParsers; diff --git a/server/src/main/java/org/elasticsearch/index/query/GeoBoundingBoxQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/GeoBoundingBoxQueryBuilder.java index a6ee84c9a9bef..4d39c24c5927f 100644 --- a/server/src/main/java/org/elasticsearch/index/query/GeoBoundingBoxQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/GeoBoundingBoxQueryBuilder.java @@ -13,7 +13,7 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.Version; import org.elasticsearch.common.Numbers; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.geo.GeoBoundingBox; import org.elasticsearch.common.geo.GeoPoint; @@ -22,8 +22,8 @@ import org.elasticsearch.common.geo.SpatialStrategy; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.geometry.Rectangle; import org.elasticsearch.geometry.utils.Geohash; import org.elasticsearch.index.mapper.GeoShapeQueryable; diff --git a/server/src/main/java/org/elasticsearch/index/query/GeoDistanceQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/GeoDistanceQueryBuilder.java index 4cfd9bb5cc539..5b3eb168b5c92 100644 --- a/server/src/main/java/org/elasticsearch/index/query/GeoDistanceQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/GeoDistanceQueryBuilder.java @@ -10,7 +10,7 @@ import org.apache.lucene.search.MatchNoDocsQuery; import org.apache.lucene.search.Query; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.geo.GeoDistance; @@ -21,8 +21,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.unit.DistanceUnit; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.geometry.Circle; import org.elasticsearch.index.mapper.GeoShapeQueryable; import org.elasticsearch.index.mapper.MappedFieldType; diff --git a/server/src/main/java/org/elasticsearch/index/query/GeoPolygonQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/GeoPolygonQueryBuilder.java index dcc5376054322..c421aadb29ecb 100644 --- a/server/src/main/java/org/elasticsearch/index/query/GeoPolygonQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/GeoPolygonQueryBuilder.java @@ -14,16 +14,16 @@ import org.apache.lucene.search.IndexOrDocValuesQuery; import org.apache.lucene.search.MatchNoDocsQuery; import org.apache.lucene.search.Query; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.geo.GeoPoint; import org.elasticsearch.common.geo.GeoUtils; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentParser.Token; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser.Token; import org.elasticsearch.index.mapper.GeoPointFieldMapper.GeoPointFieldType; import org.elasticsearch.index.mapper.MappedFieldType; diff --git a/server/src/main/java/org/elasticsearch/index/query/GeoShapeQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/GeoShapeQueryBuilder.java index 9dc685040102f..9cebecfebd54d 100644 --- a/server/src/main/java/org/elasticsearch/index/query/GeoShapeQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/GeoShapeQueryBuilder.java @@ -11,14 +11,14 @@ import org.apache.lucene.search.ConstantScoreQuery; import org.apache.lucene.search.Query; import org.elasticsearch.common.geo.GeometryParser; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.geo.ShapeRelation; import org.elasticsearch.common.geo.SpatialStrategy; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.geometry.Geometry; import org.elasticsearch.index.mapper.GeoShapeQueryable; import org.elasticsearch.index.mapper.MappedFieldType; diff --git a/server/src/main/java/org/elasticsearch/index/query/IdsQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/IdsQueryBuilder.java index cf4781749eb93..37e50fddbcabf 100644 --- a/server/src/main/java/org/elasticsearch/index/query/IdsQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/IdsQueryBuilder.java @@ -10,14 +10,14 @@ import org.apache.lucene.search.Query; import org.elasticsearch.Version; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.mapper.IdFieldMapper; import org.elasticsearch.index.mapper.MappedFieldType; @@ -29,7 +29,7 @@ import java.util.Objects; import java.util.Set; -import static org.elasticsearch.common.xcontent.ObjectParser.fromList; +import static org.elasticsearch.xcontent.ObjectParser.fromList; /** * A query that will return only documents matching specific ids (and a type). diff --git a/server/src/main/java/org/elasticsearch/index/query/InnerHitBuilder.java b/server/src/main/java/org/elasticsearch/index/query/InnerHitBuilder.java index bb7b7ca48f03f..fb9e8e195cec8 100644 --- a/server/src/main/java/org/elasticsearch/index/query/InnerHitBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/InnerHitBuilder.java @@ -9,16 +9,16 @@ import org.elasticsearch.Version; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.script.Script; import org.elasticsearch.search.builder.SearchSourceBuilder; import org.elasticsearch.search.builder.SearchSourceBuilder.ScriptField; @@ -38,7 +38,7 @@ import java.util.Objects; import java.util.Set; -import static org.elasticsearch.common.xcontent.XContentParser.Token.END_OBJECT; +import static org.elasticsearch.xcontent.XContentParser.Token.END_OBJECT; public final class InnerHitBuilder implements Writeable, ToXContentObject { diff --git a/server/src/main/java/org/elasticsearch/index/query/IntervalQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/IntervalQueryBuilder.java index 380c5ac219e76..4d73a7ddd7d0a 100644 --- a/server/src/main/java/org/elasticsearch/index/query/IntervalQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/IntervalQueryBuilder.java @@ -14,8 +14,8 @@ import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.mapper.MappedFieldType; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/index/query/IntervalsSourceProvider.java b/server/src/main/java/org/elasticsearch/index/query/IntervalsSourceProvider.java index 38d8026821a12..afa4afe6bc1fc 100644 --- a/server/src/main/java/org/elasticsearch/index/query/IntervalsSourceProvider.java +++ b/server/src/main/java/org/elasticsearch/index/query/IntervalsSourceProvider.java @@ -14,19 +14,19 @@ import org.apache.lucene.queries.intervals.IntervalsSource; import org.apache.lucene.util.BytesRef; import org.elasticsearch.Version; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.NamedWriteable; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.unit.Fuzziness; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.analysis.NamedAnalyzer; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.script.Script; @@ -38,8 +38,8 @@ import java.util.Objects; import java.util.Set; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * Factory class for {@link IntervalsSource} diff --git a/server/src/main/java/org/elasticsearch/index/query/MatchAllQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/MatchAllQueryBuilder.java index 41235ecfd9b70..1c657ae8cbd19 100644 --- a/server/src/main/java/org/elasticsearch/index/query/MatchAllQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/MatchAllQueryBuilder.java @@ -13,9 +13,9 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.lucene.search.Queries; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/index/query/MatchBoolPrefixQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/MatchBoolPrefixQueryBuilder.java index 93cb91ee58a6f..30ebb59cb88b6 100644 --- a/server/src/main/java/org/elasticsearch/index/query/MatchBoolPrefixQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/MatchBoolPrefixQueryBuilder.java @@ -17,8 +17,8 @@ import org.elasticsearch.common.lucene.search.Queries; import org.elasticsearch.common.unit.Fuzziness; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.query.support.QueryParsers; import org.elasticsearch.index.search.MatchQueryParser; diff --git a/server/src/main/java/org/elasticsearch/index/query/MatchNoneQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/MatchNoneQueryBuilder.java index c51bb96f50a2d..2d7be2899f8ec 100644 --- a/server/src/main/java/org/elasticsearch/index/query/MatchNoneQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/MatchNoneQueryBuilder.java @@ -13,8 +13,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.lucene.search.Queries; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/index/query/MatchPhrasePrefixQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/MatchPhrasePrefixQueryBuilder.java index 118ed5b4167da..b85a6255f8db2 100644 --- a/server/src/main/java/org/elasticsearch/index/query/MatchPhrasePrefixQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/MatchPhrasePrefixQueryBuilder.java @@ -11,12 +11,12 @@ import org.apache.lucene.search.FuzzyQuery; import org.apache.lucene.search.Query; import org.elasticsearch.Version; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.search.MatchQueryParser; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/index/query/MatchPhraseQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/MatchPhraseQueryBuilder.java index 7b4af0fd961e4..d8eedda40c4f0 100644 --- a/server/src/main/java/org/elasticsearch/index/query/MatchPhraseQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/MatchPhraseQueryBuilder.java @@ -9,13 +9,13 @@ package org.elasticsearch.index.query; import org.apache.lucene.search.Query; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.search.MatchQueryParser; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/index/query/MatchQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/MatchQueryBuilder.java index 724932175914d..5d263eb80b4c7 100644 --- a/server/src/main/java/org/elasticsearch/index/query/MatchQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/MatchQueryBuilder.java @@ -11,15 +11,15 @@ import org.apache.lucene.search.FuzzyQuery; import org.apache.lucene.search.Query; import org.elasticsearch.Version; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.lucene.search.Queries; import org.elasticsearch.common.unit.Fuzziness; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.index.query.support.QueryParsers; import org.elasticsearch.index.search.MatchQueryParser; diff --git a/server/src/main/java/org/elasticsearch/index/query/MoreLikeThisQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/MoreLikeThisQueryBuilder.java index 7a56d94748f81..fcb960f9f6cb3 100644 --- a/server/src/main/java/org/elasticsearch/index/query/MoreLikeThisQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/MoreLikeThisQueryBuilder.java @@ -25,7 +25,7 @@ import org.elasticsearch.client.Client; import org.elasticsearch.common.logging.DeprecationLogger; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; @@ -35,12 +35,12 @@ import org.elasticsearch.common.lucene.search.MoreLikeThisQuery; import org.elasticsearch.common.lucene.search.XMoreLikeThis; import org.elasticsearch.common.lucene.uid.Versions; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.index.VersionType; import org.elasticsearch.index.mapper.IdFieldMapper; @@ -61,7 +61,7 @@ import java.util.Optional; import java.util.Set; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; /** * A more like this query that finds documents that are "like" the provided set of document(s). diff --git a/server/src/main/java/org/elasticsearch/index/query/MultiMatchQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/MultiMatchQueryBuilder.java index 7f7ca2c3d86b1..7fa500e4b27f7 100644 --- a/server/src/main/java/org/elasticsearch/index/query/MultiMatchQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/MultiMatchQueryBuilder.java @@ -12,17 +12,17 @@ import org.apache.lucene.search.Query; import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.Version; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.unit.Fuzziness; -import org.elasticsearch.common.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.DeprecationHandler; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.index.query.support.QueryParsers; import org.elasticsearch.index.search.MatchQueryParser; diff --git a/server/src/main/java/org/elasticsearch/index/query/NestedQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/NestedQueryBuilder.java index f210abf3257ac..1209e8e5c88b8 100644 --- a/server/src/main/java/org/elasticsearch/index/query/NestedQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/NestedQueryBuilder.java @@ -25,15 +25,15 @@ import org.apache.lucene.search.join.ScoreMode; import org.elasticsearch.ElasticsearchException; import org.elasticsearch.action.search.MaxScoreCollector; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.lucene.Lucene; import org.elasticsearch.common.lucene.search.Queries; import org.elasticsearch.common.lucene.search.TopDocsAndMaxScore; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.mapper.NestedObjectMapper; import org.elasticsearch.index.mapper.ObjectMapper; import org.elasticsearch.index.search.ESToParentBlockJoinQuery; diff --git a/server/src/main/java/org/elasticsearch/index/query/PrefixQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/PrefixQueryBuilder.java index 7452e28075270..6e899201ab567 100644 --- a/server/src/main/java/org/elasticsearch/index/query/PrefixQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/PrefixQueryBuilder.java @@ -13,14 +13,14 @@ import org.apache.lucene.search.MultiTermQuery; import org.apache.lucene.search.Query; import org.elasticsearch.Version; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.mapper.ConstantFieldType; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.query.support.QueryParsers; diff --git a/server/src/main/java/org/elasticsearch/index/query/QueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/QueryBuilder.java index dbeb075d4a9d3..1480a70a48c3f 100644 --- a/server/src/main/java/org/elasticsearch/index/query/QueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/QueryBuilder.java @@ -10,7 +10,7 @@ import org.apache.lucene.search.Query; import org.elasticsearch.common.io.stream.NamedWriteable; -import org.elasticsearch.common.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.ToXContentObject; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/index/query/QueryParser.java b/server/src/main/java/org/elasticsearch/index/query/QueryParser.java index 88f438eeae5e6..85ad9ef0ccc79 100644 --- a/server/src/main/java/org/elasticsearch/index/query/QueryParser.java +++ b/server/src/main/java/org/elasticsearch/index/query/QueryParser.java @@ -8,12 +8,12 @@ package org.elasticsearch.index.query; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; /** - * Defines a query parser that is able to parse {@link QueryBuilder}s from {@link org.elasticsearch.common.xcontent.XContent}. + * Defines a query parser that is able to parse {@link QueryBuilder}s from {@link org.elasticsearch.xcontent.XContent}. */ @FunctionalInterface public interface QueryParser { diff --git a/server/src/main/java/org/elasticsearch/index/query/QueryRewriteContext.java b/server/src/main/java/org/elasticsearch/index/query/QueryRewriteContext.java index 21f6b5e12f3a1..6701bbb55b03a 100644 --- a/server/src/main/java/org/elasticsearch/index/query/QueryRewriteContext.java +++ b/server/src/main/java/org/elasticsearch/index/query/QueryRewriteContext.java @@ -11,8 +11,8 @@ import org.elasticsearch.client.Client; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.util.concurrent.CountDown; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import java.util.ArrayList; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/index/query/QueryStringQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/QueryStringQueryBuilder.java index 45d0ce4d04698..03d3ef1efe321 100644 --- a/server/src/main/java/org/elasticsearch/index/query/QueryStringQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/QueryStringQueryBuilder.java @@ -12,7 +12,7 @@ import org.apache.lucene.search.FuzzyQuery; import org.apache.lucene.search.Query; import org.apache.lucene.util.automaton.Operations; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -20,8 +20,8 @@ import org.elasticsearch.common.regex.Regex; import org.elasticsearch.common.unit.Fuzziness; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.analysis.NamedAnalyzer; import org.elasticsearch.index.query.support.QueryParsers; import org.elasticsearch.index.search.QueryParserHelper; diff --git a/server/src/main/java/org/elasticsearch/index/query/RangeQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/RangeQueryBuilder.java index 9b6ac452f3720..e179bee5f0f48 100644 --- a/server/src/main/java/org/elasticsearch/index/query/RangeQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/RangeQueryBuilder.java @@ -11,7 +11,7 @@ import org.apache.lucene.search.MatchNoDocsQuery; import org.apache.lucene.search.Query; import org.apache.lucene.util.BytesRef; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.geo.ShapeRelation; @@ -19,8 +19,8 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.time.DateFormatter; import org.elasticsearch.common.time.DateMathParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.mapper.DateFieldMapper; import org.elasticsearch.index.mapper.FieldNamesFieldMapper; import org.elasticsearch.index.mapper.MappedFieldType; diff --git a/server/src/main/java/org/elasticsearch/index/query/RegexpQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/RegexpQueryBuilder.java index e7e7190b2bc9f..a9e5ce8561171 100644 --- a/server/src/main/java/org/elasticsearch/index/query/RegexpQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/RegexpQueryBuilder.java @@ -15,15 +15,15 @@ import org.apache.lucene.util.automaton.Operations; import org.apache.lucene.util.automaton.RegExp; import org.elasticsearch.Version; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.lucene.BytesRefs; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.query.support.QueryParsers; diff --git a/server/src/main/java/org/elasticsearch/index/query/ScriptQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/ScriptQueryBuilder.java index 846e49170b601..f521a07f8de76 100644 --- a/server/src/main/java/org/elasticsearch/index/query/ScriptQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/ScriptQueryBuilder.java @@ -23,8 +23,8 @@ import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.script.DocValuesDocReader; import org.elasticsearch.script.FilterScript; import org.elasticsearch.script.Script; diff --git a/server/src/main/java/org/elasticsearch/index/query/SearchExecutionContext.java b/server/src/main/java/org/elasticsearch/index/query/SearchExecutionContext.java index ca2a742c4bd38..10ce5568317ab 100644 --- a/server/src/main/java/org/elasticsearch/index/query/SearchExecutionContext.java +++ b/server/src/main/java/org/elasticsearch/index/query/SearchExecutionContext.java @@ -24,8 +24,8 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.lucene.search.Queries; import org.elasticsearch.common.regex.Regex; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.CheckedFunction; import org.elasticsearch.core.Nullable; import org.elasticsearch.index.Index; diff --git a/server/src/main/java/org/elasticsearch/index/query/SimpleQueryStringBuilder.java b/server/src/main/java/org/elasticsearch/index/query/SimpleQueryStringBuilder.java index 259d637063108..80783debdb858 100644 --- a/server/src/main/java/org/elasticsearch/index/query/SimpleQueryStringBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/SimpleQueryStringBuilder.java @@ -11,15 +11,15 @@ import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.search.FuzzyQuery; import org.apache.lucene.search.Query; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.lucene.search.Queries; import org.elasticsearch.common.util.CollectionUtils; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.search.QueryParserHelper; import org.elasticsearch.index.search.SimpleQueryStringQueryParser; import org.elasticsearch.index.search.SimpleQueryStringQueryParser.Settings; diff --git a/server/src/main/java/org/elasticsearch/index/query/SpanContainingQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/SpanContainingQueryBuilder.java index 19855fed66777..b94faa8b21744 100644 --- a/server/src/main/java/org/elasticsearch/index/query/SpanContainingQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/SpanContainingQueryBuilder.java @@ -14,9 +14,9 @@ import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/server/src/main/java/org/elasticsearch/index/query/SpanFirstQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/SpanFirstQueryBuilder.java index 506dd80b639a6..5403294c791d8 100644 --- a/server/src/main/java/org/elasticsearch/index/query/SpanFirstQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/SpanFirstQueryBuilder.java @@ -14,9 +14,9 @@ import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/server/src/main/java/org/elasticsearch/index/query/SpanMultiTermQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/SpanMultiTermQueryBuilder.java index c2a65cf5e68ca..a43e34a1fbb3a 100644 --- a/server/src/main/java/org/elasticsearch/index/query/SpanMultiTermQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/SpanMultiTermQueryBuilder.java @@ -20,9 +20,9 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.lucene.search.SpanBooleanQueryRewriteWithMaxClause; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.query.support.QueryParsers; diff --git a/server/src/main/java/org/elasticsearch/index/query/SpanNearQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/SpanNearQueryBuilder.java index 2880d563dbc9b..cc090bb8c6b3f 100644 --- a/server/src/main/java/org/elasticsearch/index/query/SpanNearQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/SpanNearQueryBuilder.java @@ -15,10 +15,10 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentLocation; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentLocation; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.mapper.MappedFieldType; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/index/query/SpanNotQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/SpanNotQueryBuilder.java index 7b31272261f98..c51442df59885 100644 --- a/server/src/main/java/org/elasticsearch/index/query/SpanNotQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/SpanNotQueryBuilder.java @@ -14,9 +14,9 @@ import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/server/src/main/java/org/elasticsearch/index/query/SpanOrQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/SpanOrQueryBuilder.java index 78695bf650df1..48b9cb79589b6 100644 --- a/server/src/main/java/org/elasticsearch/index/query/SpanOrQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/SpanOrQueryBuilder.java @@ -14,9 +14,9 @@ import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/index/query/SpanQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/SpanQueryBuilder.java index b3c1123be1393..7060f2f969ed6 100644 --- a/server/src/main/java/org/elasticsearch/index/query/SpanQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/SpanQueryBuilder.java @@ -9,7 +9,7 @@ package org.elasticsearch.index.query; import org.elasticsearch.common.ParsingException; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; /** * Marker interface for a specific type of {@link QueryBuilder} that allows to build span queries. diff --git a/server/src/main/java/org/elasticsearch/index/query/SpanTermQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/SpanTermQueryBuilder.java index 1eceb5b017e3b..8fe48130c9c83 100644 --- a/server/src/main/java/org/elasticsearch/index/query/SpanTermQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/SpanTermQueryBuilder.java @@ -15,8 +15,8 @@ import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.lucene.BytesRefs; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.mapper.MappedFieldType; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/index/query/SpanWithinQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/SpanWithinQueryBuilder.java index 6b8526705657f..39cf5fe51a977 100644 --- a/server/src/main/java/org/elasticsearch/index/query/SpanWithinQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/SpanWithinQueryBuilder.java @@ -14,9 +14,9 @@ import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/server/src/main/java/org/elasticsearch/index/query/TermQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/TermQueryBuilder.java index 9ef2dae3a09da..033240c45e0da 100644 --- a/server/src/main/java/org/elasticsearch/index/query/TermQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/TermQueryBuilder.java @@ -12,12 +12,12 @@ import org.apache.lucene.search.MatchNoDocsQuery; import org.apache.lucene.search.Query; import org.elasticsearch.Version; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.mapper.ConstantFieldType; import org.elasticsearch.index.mapper.MappedFieldType; diff --git a/server/src/main/java/org/elasticsearch/index/query/TermsQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/TermsQueryBuilder.java index 5b9ee24eeb565..0de6b106068a7 100644 --- a/server/src/main/java/org/elasticsearch/index/query/TermsQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/TermsQueryBuilder.java @@ -23,8 +23,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.mapper.ConstantFieldType; diff --git a/server/src/main/java/org/elasticsearch/index/query/TermsSetQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/TermsSetQueryBuilder.java index 6241fe614d97e..5a58cb7973072 100644 --- a/server/src/main/java/org/elasticsearch/index/query/TermsSetQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/TermsSetQueryBuilder.java @@ -18,14 +18,14 @@ import org.apache.lucene.search.LongValuesSource; import org.apache.lucene.search.Query; import org.apache.lucene.search.TermQuery; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.lucene.BytesRefs; import org.elasticsearch.common.lucene.search.Queries; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.fielddata.IndexNumericFieldData; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.script.Script; diff --git a/server/src/main/java/org/elasticsearch/index/query/TypeQueryV7Builder.java b/server/src/main/java/org/elasticsearch/index/query/TypeQueryV7Builder.java index 0e6b977811e48..8a4f0a9c16172 100644 --- a/server/src/main/java/org/elasticsearch/index/query/TypeQueryV7Builder.java +++ b/server/src/main/java/org/elasticsearch/index/query/TypeQueryV7Builder.java @@ -14,10 +14,10 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.logging.DeprecationLogger; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.index.mapper.MapperService; diff --git a/server/src/main/java/org/elasticsearch/index/query/WildcardQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/WildcardQueryBuilder.java index a35d3ed6214ea..516b575763818 100644 --- a/server/src/main/java/org/elasticsearch/index/query/WildcardQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/WildcardQueryBuilder.java @@ -13,14 +13,14 @@ import org.apache.lucene.search.MultiTermQuery; import org.apache.lucene.search.Query; import org.elasticsearch.Version; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.mapper.ConstantFieldType; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.query.support.QueryParsers; diff --git a/server/src/main/java/org/elasticsearch/index/query/WrapperQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/WrapperQueryBuilder.java index c505e1ad72f7e..0ffc13901c89d 100644 --- a/server/src/main/java/org/elasticsearch/index/query/WrapperQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/WrapperQueryBuilder.java @@ -10,16 +10,16 @@ import org.apache.lucene.search.Query; import org.apache.lucene.util.BytesRef; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.nio.charset.StandardCharsets; diff --git a/server/src/main/java/org/elasticsearch/index/query/functionscore/DecayFunctionBuilder.java b/server/src/main/java/org/elasticsearch/index/query/functionscore/DecayFunctionBuilder.java index 22450c3fa336c..75abf8ae82650 100644 --- a/server/src/main/java/org/elasticsearch/index/query/functionscore/DecayFunctionBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/functionscore/DecayFunctionBuilder.java @@ -24,11 +24,11 @@ import org.elasticsearch.common.unit.DistanceUnit; import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.fielddata.FieldData; import org.elasticsearch.index.fielddata.IndexGeoPointFieldData; import org.elasticsearch.index.fielddata.IndexNumericFieldData; diff --git a/server/src/main/java/org/elasticsearch/index/query/functionscore/DecayFunctionParser.java b/server/src/main/java/org/elasticsearch/index/query/functionscore/DecayFunctionParser.java index 4008b7095826e..4fab55d51911f 100644 --- a/server/src/main/java/org/elasticsearch/index/query/functionscore/DecayFunctionParser.java +++ b/server/src/main/java/org/elasticsearch/index/query/functionscore/DecayFunctionParser.java @@ -8,12 +8,12 @@ package org.elasticsearch.index.query.functionscore; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.plugins.SearchPlugin; import org.elasticsearch.search.MultiValueMode; import org.elasticsearch.search.SearchModule; diff --git a/server/src/main/java/org/elasticsearch/index/query/functionscore/FieldValueFactorFunctionBuilder.java b/server/src/main/java/org/elasticsearch/index/query/functionscore/FieldValueFactorFunctionBuilder.java index 09bc33f5bda3e..f180cd480dda2 100644 --- a/server/src/main/java/org/elasticsearch/index/query/functionscore/FieldValueFactorFunctionBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/functionscore/FieldValueFactorFunctionBuilder.java @@ -14,8 +14,8 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.lucene.search.function.FieldValueFactorFunction; import org.elasticsearch.common.lucene.search.function.ScoreFunction; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.fielddata.IndexNumericFieldData; import org.elasticsearch.index.query.SearchExecutionContext; diff --git a/server/src/main/java/org/elasticsearch/index/query/functionscore/FunctionScoreQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/functionscore/FunctionScoreQueryBuilder.java index 3f83c1853937d..0a4531f1d9ef3 100644 --- a/server/src/main/java/org/elasticsearch/index/query/functionscore/FunctionScoreQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/functionscore/FunctionScoreQueryBuilder.java @@ -10,7 +10,7 @@ import org.apache.lucene.search.MatchAllDocsQuery; import org.apache.lucene.search.Query; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -18,10 +18,10 @@ import org.elasticsearch.common.lucene.search.function.CombineFunction; import org.elasticsearch.common.lucene.search.function.FunctionScoreQuery; import org.elasticsearch.common.lucene.search.function.ScoreFunction; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentLocation; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentLocation; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.query.AbstractQueryBuilder; import org.elasticsearch.index.query.InnerHitContextBuilder; import org.elasticsearch.index.query.MatchAllQueryBuilder; diff --git a/server/src/main/java/org/elasticsearch/index/query/functionscore/GaussDecayFunctionBuilder.java b/server/src/main/java/org/elasticsearch/index/query/functionscore/GaussDecayFunctionBuilder.java index dfac2107beb27..dd87976b58b7d 100644 --- a/server/src/main/java/org/elasticsearch/index/query/functionscore/GaussDecayFunctionBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/functionscore/GaussDecayFunctionBuilder.java @@ -10,7 +10,7 @@ import org.apache.lucene.search.Explanation; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.StreamInput; diff --git a/server/src/main/java/org/elasticsearch/index/query/functionscore/RandomScoreFunctionBuilder.java b/server/src/main/java/org/elasticsearch/index/query/functionscore/RandomScoreFunctionBuilder.java index 45db8d9294c3a..48b163a889b8e 100644 --- a/server/src/main/java/org/elasticsearch/index/query/functionscore/RandomScoreFunctionBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/functionscore/RandomScoreFunctionBuilder.java @@ -14,8 +14,8 @@ import org.elasticsearch.common.logging.DeprecationLogger; import org.elasticsearch.common.lucene.search.function.RandomScoreFunction; import org.elasticsearch.common.lucene.search.function.ScoreFunction; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.mapper.IdFieldMapper; import org.elasticsearch.index.query.SearchExecutionContext; diff --git a/server/src/main/java/org/elasticsearch/index/query/functionscore/ScoreFunctionBuilder.java b/server/src/main/java/org/elasticsearch/index/query/functionscore/ScoreFunctionBuilder.java index a96da2083b1a6..f882666aef912 100644 --- a/server/src/main/java/org/elasticsearch/index/query/functionscore/ScoreFunctionBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/functionscore/ScoreFunctionBuilder.java @@ -13,8 +13,8 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.lucene.search.function.ScoreFunction; import org.elasticsearch.common.lucene.search.function.WeightFactorFunction; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.query.SearchExecutionContext; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/index/query/functionscore/ScoreFunctionParser.java b/server/src/main/java/org/elasticsearch/index/query/functionscore/ScoreFunctionParser.java index b3fa334cc27d0..f564af9261f9c 100644 --- a/server/src/main/java/org/elasticsearch/index/query/functionscore/ScoreFunctionParser.java +++ b/server/src/main/java/org/elasticsearch/index/query/functionscore/ScoreFunctionParser.java @@ -8,7 +8,7 @@ package org.elasticsearch.index.query.functionscore; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/index/query/functionscore/ScriptScoreFunctionBuilder.java b/server/src/main/java/org/elasticsearch/index/query/functionscore/ScriptScoreFunctionBuilder.java index 4bcc1ea45dd56..0b64bada9245a 100644 --- a/server/src/main/java/org/elasticsearch/index/query/functionscore/ScriptScoreFunctionBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/functionscore/ScriptScoreFunctionBuilder.java @@ -13,8 +13,8 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.lucene.search.function.ScoreFunction; import org.elasticsearch.common.lucene.search.function.ScriptScoreFunction; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.query.SearchExecutionContext; import org.elasticsearch.index.query.QueryShardException; import org.elasticsearch.script.ScoreScript; diff --git a/server/src/main/java/org/elasticsearch/index/query/functionscore/ScriptScoreQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/functionscore/ScriptScoreQueryBuilder.java index 6466f848735e0..598c5b2f1de34 100644 --- a/server/src/main/java/org/elasticsearch/index/query/functionscore/ScriptScoreQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/functionscore/ScriptScoreQueryBuilder.java @@ -10,13 +10,13 @@ import org.apache.lucene.search.Query; import org.elasticsearch.ElasticsearchException; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.lucene.search.function.ScriptScoreQuery; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.query.AbstractQueryBuilder; import org.elasticsearch.index.query.InnerHitContextBuilder; import org.elasticsearch.index.query.MatchNoneQueryBuilder; @@ -31,8 +31,8 @@ import java.util.Map; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; import static org.elasticsearch.search.SearchService.ALLOW_EXPENSIVE_QUERIES; /** diff --git a/server/src/main/java/org/elasticsearch/index/query/functionscore/WeightBuilder.java b/server/src/main/java/org/elasticsearch/index/query/functionscore/WeightBuilder.java index b85972acc7299..259f194f2e90e 100644 --- a/server/src/main/java/org/elasticsearch/index/query/functionscore/WeightBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/functionscore/WeightBuilder.java @@ -11,7 +11,7 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.lucene.search.function.ScoreFunction; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.query.SearchExecutionContext; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/index/query/support/QueryParsers.java b/server/src/main/java/org/elasticsearch/index/query/support/QueryParsers.java index ef4350e0d2068..9b17eefdc6f59 100644 --- a/server/src/main/java/org/elasticsearch/index/query/support/QueryParsers.java +++ b/server/src/main/java/org/elasticsearch/index/query/support/QueryParsers.java @@ -10,8 +10,8 @@ import org.apache.lucene.search.MultiTermQuery; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.DeprecationHandler; public final class QueryParsers { diff --git a/server/src/main/java/org/elasticsearch/index/recovery/RecoveryStats.java b/server/src/main/java/org/elasticsearch/index/recovery/RecoveryStats.java index c27e38e75d26d..a60ca17364653 100644 --- a/server/src/main/java/org/elasticsearch/index/recovery/RecoveryStats.java +++ b/server/src/main/java/org/elasticsearch/index/recovery/RecoveryStats.java @@ -11,8 +11,8 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.concurrent.atomic.AtomicInteger; diff --git a/server/src/main/java/org/elasticsearch/index/refresh/RefreshStats.java b/server/src/main/java/org/elasticsearch/index/refresh/RefreshStats.java index 1b80da0f9029c..5410affdeb3fb 100644 --- a/server/src/main/java/org/elasticsearch/index/refresh/RefreshStats.java +++ b/server/src/main/java/org/elasticsearch/index/refresh/RefreshStats.java @@ -13,8 +13,8 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/server/src/main/java/org/elasticsearch/index/reindex/BulkByScrollResponse.java b/server/src/main/java/org/elasticsearch/index/reindex/BulkByScrollResponse.java index 6115243fb173e..ea1d57fa8e1a2 100644 --- a/server/src/main/java/org/elasticsearch/index/reindex/BulkByScrollResponse.java +++ b/server/src/main/java/org/elasticsearch/index/reindex/BulkByScrollResponse.java @@ -12,17 +12,17 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.bulk.BulkItemResponse.Failure; -import org.elasticsearch.common.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ObjectParser; import org.elasticsearch.index.reindex.BulkByScrollTask.Status; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentParser.Token; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser.Token; import org.elasticsearch.index.reindex.ScrollableHitSource.SearchFailure; import org.elasticsearch.rest.RestStatus; diff --git a/server/src/main/java/org/elasticsearch/index/reindex/BulkByScrollResponseBuilder.java b/server/src/main/java/org/elasticsearch/index/reindex/BulkByScrollResponseBuilder.java index 46bfe86a57106..ba2dac8cbd564 100644 --- a/server/src/main/java/org/elasticsearch/index/reindex/BulkByScrollResponseBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/reindex/BulkByScrollResponseBuilder.java @@ -10,7 +10,7 @@ import org.elasticsearch.core.TimeValue; import org.elasticsearch.action.bulk.BulkItemResponse.Failure; -import org.elasticsearch.common.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ObjectParser; import org.elasticsearch.index.reindex.ScrollableHitSource.SearchFailure; import org.elasticsearch.index.reindex.BulkByScrollTask.StatusBuilder; diff --git a/server/src/main/java/org/elasticsearch/index/reindex/BulkByScrollTask.java b/server/src/main/java/org/elasticsearch/index/reindex/BulkByScrollTask.java index f43bc75b6c28d..5a13d0d05abfb 100644 --- a/server/src/main/java/org/elasticsearch/index/reindex/BulkByScrollTask.java +++ b/server/src/main/java/org/elasticsearch/index/reindex/BulkByScrollTask.java @@ -10,20 +10,20 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.core.Tuple; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentParser.Token; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser.Token; import org.elasticsearch.tasks.CancellableTask; import org.elasticsearch.tasks.Task; import org.elasticsearch.tasks.TaskId; @@ -43,7 +43,7 @@ import static java.lang.Math.min; import static java.util.Collections.emptyList; import static org.elasticsearch.core.TimeValue.timeValueNanos; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; import static org.elasticsearch.common.xcontent.XContentParserUtils.ensureExpectedToken; /** diff --git a/server/src/main/java/org/elasticsearch/index/reindex/ClientScrollableHitSource.java b/server/src/main/java/org/elasticsearch/index/reindex/ClientScrollableHitSource.java index 268da3edb6845..20989f9c02339 100644 --- a/server/src/main/java/org/elasticsearch/index/reindex/ClientScrollableHitSource.java +++ b/server/src/main/java/org/elasticsearch/index/reindex/ClientScrollableHitSource.java @@ -26,7 +26,7 @@ import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.concurrent.EsRejectedExecutionException; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.mapper.RoutingFieldMapper; import org.elasticsearch.search.SearchHit; import org.elasticsearch.threadpool.ThreadPool; diff --git a/server/src/main/java/org/elasticsearch/index/reindex/DeleteByQueryRequest.java b/server/src/main/java/org/elasticsearch/index/reindex/DeleteByQueryRequest.java index 95e206983f880..d0391344f8f58 100644 --- a/server/src/main/java/org/elasticsearch/index/reindex/DeleteByQueryRequest.java +++ b/server/src/main/java/org/elasticsearch/index/reindex/DeleteByQueryRequest.java @@ -13,8 +13,8 @@ import org.elasticsearch.action.search.SearchRequest; import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.tasks.TaskId; diff --git a/server/src/main/java/org/elasticsearch/index/reindex/ReindexRequest.java b/server/src/main/java/org/elasticsearch/index/reindex/ReindexRequest.java index c6e72dceda22b..87982438ce619 100644 --- a/server/src/main/java/org/elasticsearch/index/reindex/ReindexRequest.java +++ b/server/src/main/java/org/elasticsearch/index/reindex/ReindexRequest.java @@ -12,7 +12,7 @@ import org.elasticsearch.action.CompositeIndicesRequest; import org.elasticsearch.action.index.IndexRequest; import org.elasticsearch.action.search.SearchRequest; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.core.RestApiVersion; @@ -20,11 +20,11 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.lucene.uid.Versions; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.VersionType; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.script.Script; diff --git a/server/src/main/java/org/elasticsearch/index/reindex/RemoteInfo.java b/server/src/main/java/org/elasticsearch/index/reindex/RemoteInfo.java index 4089955e461b5..179cc636afeee 100644 --- a/server/src/main/java/org/elasticsearch/index/reindex/RemoteInfo.java +++ b/server/src/main/java/org/elasticsearch/index/reindex/RemoteInfo.java @@ -14,14 +14,14 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import java.io.IOException; import java.util.HashMap; diff --git a/server/src/main/java/org/elasticsearch/index/reindex/ScrollableHitSource.java b/server/src/main/java/org/elasticsearch/index/reindex/ScrollableHitSource.java index 3f099d483caf8..5547317432fc1 100644 --- a/server/src/main/java/org/elasticsearch/index/reindex/ScrollableHitSource.java +++ b/server/src/main/java/org/elasticsearch/index/reindex/ScrollableHitSource.java @@ -22,9 +22,9 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.seqno.SequenceNumbers; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.search.SearchHit; diff --git a/server/src/main/java/org/elasticsearch/index/reindex/UpdateByQueryRequest.java b/server/src/main/java/org/elasticsearch/index/reindex/UpdateByQueryRequest.java index aeafcaef600fb..b3eb7b5bdd806 100644 --- a/server/src/main/java/org/elasticsearch/index/reindex/UpdateByQueryRequest.java +++ b/server/src/main/java/org/elasticsearch/index/reindex/UpdateByQueryRequest.java @@ -13,8 +13,8 @@ import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.tasks.TaskId; diff --git a/server/src/main/java/org/elasticsearch/index/search/stats/FieldUsageStats.java b/server/src/main/java/org/elasticsearch/index/search/stats/FieldUsageStats.java index 966d06197731c..73677a6f394b9 100644 --- a/server/src/main/java/org/elasticsearch/index/search/stats/FieldUsageStats.java +++ b/server/src/main/java/org/elasticsearch/index/search/stats/FieldUsageStats.java @@ -12,9 +12,9 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.EnumSet; diff --git a/server/src/main/java/org/elasticsearch/index/search/stats/SearchStats.java b/server/src/main/java/org/elasticsearch/index/search/stats/SearchStats.java index 984549b2acfb2..8d1e25820fefb 100644 --- a/server/src/main/java/org/elasticsearch/index/search/stats/SearchStats.java +++ b/server/src/main/java/org/elasticsearch/index/search/stats/SearchStats.java @@ -14,9 +14,9 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Collections; diff --git a/server/src/main/java/org/elasticsearch/index/seqno/ReplicationTracker.java b/server/src/main/java/org/elasticsearch/index/seqno/ReplicationTracker.java index bfcd17753c252..ac4b8e8be4402 100644 --- a/server/src/main/java/org/elasticsearch/index/seqno/ReplicationTracker.java +++ b/server/src/main/java/org/elasticsearch/index/seqno/ReplicationTracker.java @@ -22,7 +22,7 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.gateway.WriteStateException; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.engine.SafeCommitInfo; diff --git a/server/src/main/java/org/elasticsearch/index/seqno/RetentionLease.java b/server/src/main/java/org/elasticsearch/index/seqno/RetentionLease.java index 14f31fde10fbb..5e9c4cba7cdc8 100644 --- a/server/src/main/java/org/elasticsearch/index/seqno/RetentionLease.java +++ b/server/src/main/java/org/elasticsearch/index/seqno/RetentionLease.java @@ -8,14 +8,14 @@ package org.elasticsearch.index.seqno; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; @@ -164,8 +164,8 @@ public boolean isFragment() { } /** - * Parses a retention lease from {@link org.elasticsearch.common.xcontent.XContent}. This method assumes that the retention lease was - * converted to {@link org.elasticsearch.common.xcontent.XContent} via {@link #toXContent(XContentBuilder, Params)}. + * Parses a retention lease from {@link org.elasticsearch.xcontent.XContent}. This method assumes that the retention lease was + * converted to {@link org.elasticsearch.xcontent.XContent} via {@link #toXContent(XContentBuilder, Params)}. * * @param parser the parser * @return a retention lease diff --git a/server/src/main/java/org/elasticsearch/index/seqno/RetentionLeaseStats.java b/server/src/main/java/org/elasticsearch/index/seqno/RetentionLeaseStats.java index df1a4dc189f72..cda8c0664d29a 100644 --- a/server/src/main/java/org/elasticsearch/index/seqno/RetentionLeaseStats.java +++ b/server/src/main/java/org/elasticsearch/index/seqno/RetentionLeaseStats.java @@ -11,8 +11,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; @@ -66,11 +66,11 @@ public void writeTo(final StreamOutput out) throws IOException { } /** - * Converts the retention lease stats to {@link org.elasticsearch.common.xcontent.XContent} using the specified builder and pararms. + * Converts the retention lease stats to {@link org.elasticsearch.xcontent.XContent} using the specified builder and pararms. * * @param builder the builder * @param params the params - * @return the builder that this retention lease collection was converted to {@link org.elasticsearch.common.xcontent.XContent} into + * @return the builder that this retention lease collection was converted to {@link org.elasticsearch.xcontent.XContent} into * @throws IOException if an I/O exception occurs writing to the builder */ @Override diff --git a/server/src/main/java/org/elasticsearch/index/seqno/RetentionLeases.java b/server/src/main/java/org/elasticsearch/index/seqno/RetentionLeases.java index 9871e25042d9b..a0b073aab8b08 100644 --- a/server/src/main/java/org/elasticsearch/index/seqno/RetentionLeases.java +++ b/server/src/main/java/org/elasticsearch/index/seqno/RetentionLeases.java @@ -8,15 +8,15 @@ package org.elasticsearch.index.seqno; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.gateway.MetadataStateFormat; import java.io.IOException; @@ -196,8 +196,8 @@ public XContentBuilder toXContent(final XContentBuilder builder, final Params pa } /** - * Parses a retention leases collection from {@link org.elasticsearch.common.xcontent.XContent}. This method assumes that the retention - * leases were converted to {@link org.elasticsearch.common.xcontent.XContent} via {@link #toXContent(XContentBuilder, Params)}. + * Parses a retention leases collection from {@link org.elasticsearch.xcontent.XContent}. This method assumes that the retention + * leases were converted to {@link org.elasticsearch.xcontent.XContent} via {@link #toXContent(XContentBuilder, Params)}. * * @param parser the parser * @return a retention leases collection diff --git a/server/src/main/java/org/elasticsearch/index/seqno/SeqNoStats.java b/server/src/main/java/org/elasticsearch/index/seqno/SeqNoStats.java index b0942a1d3dfde..50dafecf5ee38 100644 --- a/server/src/main/java/org/elasticsearch/index/seqno/SeqNoStats.java +++ b/server/src/main/java/org/elasticsearch/index/seqno/SeqNoStats.java @@ -11,8 +11,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/server/src/main/java/org/elasticsearch/index/shard/DocsStats.java b/server/src/main/java/org/elasticsearch/index/shard/DocsStats.java index 6ecb17b0c4f48..cb152f3ccb0fc 100644 --- a/server/src/main/java/org/elasticsearch/index/shard/DocsStats.java +++ b/server/src/main/java/org/elasticsearch/index/shard/DocsStats.java @@ -11,8 +11,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.store.StoreStats; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/index/shard/IndexLongFieldRange.java b/server/src/main/java/org/elasticsearch/index/shard/IndexLongFieldRange.java index bdedee694b3e1..b8858ace048db 100644 --- a/server/src/main/java/org/elasticsearch/index/shard/IndexLongFieldRange.java +++ b/server/src/main/java/org/elasticsearch/index/shard/IndexLongFieldRange.java @@ -12,9 +12,9 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/index/shard/IndexingStats.java b/server/src/main/java/org/elasticsearch/index/shard/IndexingStats.java index e4122cfd001a9..56134e91fa365 100644 --- a/server/src/main/java/org/elasticsearch/index/shard/IndexingStats.java +++ b/server/src/main/java/org/elasticsearch/index/shard/IndexingStats.java @@ -14,9 +14,9 @@ import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.mapper.MapperService; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/index/shard/PrimaryReplicaSyncer.java b/server/src/main/java/org/elasticsearch/index/shard/PrimaryReplicaSyncer.java index 2b5180c8c2231..e1888d45dfb11 100644 --- a/server/src/main/java/org/elasticsearch/index/shard/PrimaryReplicaSyncer.java +++ b/server/src/main/java/org/elasticsearch/index/shard/PrimaryReplicaSyncer.java @@ -23,7 +23,7 @@ import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.common.util.concurrent.AbstractRunnable; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.core.internal.io.IOUtils; import org.elasticsearch.index.seqno.SequenceNumbers; import org.elasticsearch.index.translog.Translog; diff --git a/server/src/main/java/org/elasticsearch/index/shard/ShardCountStats.java b/server/src/main/java/org/elasticsearch/index/shard/ShardCountStats.java index fe02534d9bf7d..123c50744cc21 100644 --- a/server/src/main/java/org/elasticsearch/index/shard/ShardCountStats.java +++ b/server/src/main/java/org/elasticsearch/index/shard/ShardCountStats.java @@ -12,8 +12,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.core.Nullable; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/index/shard/ShardId.java b/server/src/main/java/org/elasticsearch/index/shard/ShardId.java index 44327a1632cf7..f7d245bb99828 100644 --- a/server/src/main/java/org/elasticsearch/index/shard/ShardId.java +++ b/server/src/main/java/org/elasticsearch/index/shard/ShardId.java @@ -12,8 +12,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.Index; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/index/shard/ShardPath.java b/server/src/main/java/org/elasticsearch/index/shard/ShardPath.java index c2b44c5e2bc3c..8cd633e143626 100644 --- a/server/src/main/java/org/elasticsearch/index/shard/ShardPath.java +++ b/server/src/main/java/org/elasticsearch/index/shard/ShardPath.java @@ -11,10 +11,10 @@ import org.apache.logging.log4j.util.Strings; import org.elasticsearch.core.internal.io.IOUtils; import org.elasticsearch.cluster.metadata.IndexMetadata; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.env.ShardLock; import org.elasticsearch.index.IndexSettings; +import org.elasticsearch.xcontent.NamedXContentRegistry; import java.io.IOException; import java.math.BigInteger; diff --git a/server/src/main/java/org/elasticsearch/index/shard/ShardStateMetadata.java b/server/src/main/java/org/elasticsearch/index/shard/ShardStateMetadata.java index 4fd2e62510287..cfbb9238cf9f4 100644 --- a/server/src/main/java/org/elasticsearch/index/shard/ShardStateMetadata.java +++ b/server/src/main/java/org/elasticsearch/index/shard/ShardStateMetadata.java @@ -11,9 +11,9 @@ import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.cluster.routing.AllocationId; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.gateway.CorruptStateException; import org.elasticsearch.gateway.MetadataStateFormat; diff --git a/server/src/main/java/org/elasticsearch/index/snapshots/blobstore/BlobStoreIndexShardSnapshot.java b/server/src/main/java/org/elasticsearch/index/snapshots/blobstore/BlobStoreIndexShardSnapshot.java index 391384d1a6132..1f79458cdfd7e 100644 --- a/server/src/main/java/org/elasticsearch/index/snapshots/blobstore/BlobStoreIndexShardSnapshot.java +++ b/server/src/main/java/org/elasticsearch/index/snapshots/blobstore/BlobStoreIndexShardSnapshot.java @@ -15,12 +15,12 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParserUtils; import org.elasticsearch.index.store.StoreFileMetadata; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/index/snapshots/blobstore/BlobStoreIndexShardSnapshots.java b/server/src/main/java/org/elasticsearch/index/snapshots/blobstore/BlobStoreIndexShardSnapshots.java index 2c3fb3143e524..55e1bef5c3765 100644 --- a/server/src/main/java/org/elasticsearch/index/snapshots/blobstore/BlobStoreIndexShardSnapshots.java +++ b/server/src/main/java/org/elasticsearch/index/snapshots/blobstore/BlobStoreIndexShardSnapshots.java @@ -9,12 +9,12 @@ package org.elasticsearch.index.snapshots.blobstore; import org.elasticsearch.common.util.CollectionUtils; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParserUtils; import org.elasticsearch.index.snapshots.blobstore.BlobStoreIndexShardSnapshot.FileInfo; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/index/stats/IndexingPressureStats.java b/server/src/main/java/org/elasticsearch/index/stats/IndexingPressureStats.java index 718a67544b547..f4785d0c01ccd 100644 --- a/server/src/main/java/org/elasticsearch/index/stats/IndexingPressureStats.java +++ b/server/src/main/java/org/elasticsearch/index/stats/IndexingPressureStats.java @@ -13,8 +13,8 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/index/store/StoreStats.java b/server/src/main/java/org/elasticsearch/index/store/StoreStats.java index 7949f0144e9f9..d0d102c036dcb 100644 --- a/server/src/main/java/org/elasticsearch/index/store/StoreStats.java +++ b/server/src/main/java/org/elasticsearch/index/store/StoreStats.java @@ -13,8 +13,8 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/index/translog/TranslogStats.java b/server/src/main/java/org/elasticsearch/index/translog/TranslogStats.java index b4ccc3c2246a8..51e7336cfba16 100644 --- a/server/src/main/java/org/elasticsearch/index/translog/TranslogStats.java +++ b/server/src/main/java/org/elasticsearch/index/translog/TranslogStats.java @@ -12,8 +12,8 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/index/translog/TruncateTranslogAction.java b/server/src/main/java/org/elasticsearch/index/translog/TruncateTranslogAction.java index 8143b70720e89..6d9abbdbf6f13 100644 --- a/server/src/main/java/org/elasticsearch/index/translog/TruncateTranslogAction.java +++ b/server/src/main/java/org/elasticsearch/index/translog/TruncateTranslogAction.java @@ -21,7 +21,7 @@ import org.elasticsearch.core.Tuple; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.BigArrays; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.core.internal.io.IOUtils; import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.index.IndexSettings; diff --git a/server/src/main/java/org/elasticsearch/index/warmer/WarmerStats.java b/server/src/main/java/org/elasticsearch/index/warmer/WarmerStats.java index c829b6c4524d3..f59dde9e44af6 100644 --- a/server/src/main/java/org/elasticsearch/index/warmer/WarmerStats.java +++ b/server/src/main/java/org/elasticsearch/index/warmer/WarmerStats.java @@ -12,8 +12,8 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/indices/IndicesModule.java b/server/src/main/java/org/elasticsearch/indices/IndicesModule.java index 3419d32947e3f..37896dc1edb46 100644 --- a/server/src/main/java/org/elasticsearch/indices/IndicesModule.java +++ b/server/src/main/java/org/elasticsearch/indices/IndicesModule.java @@ -14,10 +14,10 @@ import org.elasticsearch.action.admin.indices.rollover.MaxPrimaryShardSizeCondition; import org.elasticsearch.action.admin.indices.rollover.MaxSizeCondition; import org.elasticsearch.action.resync.TransportResyncReplicationAction; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.inject.AbstractModule; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.index.mapper.BinaryFieldMapper; import org.elasticsearch.index.mapper.BooleanFieldMapper; import org.elasticsearch.index.mapper.BooleanScriptFieldType; diff --git a/server/src/main/java/org/elasticsearch/indices/IndicesService.java b/server/src/main/java/org/elasticsearch/indices/IndicesService.java index 02bb2e05b9654..d60bce286f8f7 100644 --- a/server/src/main/java/org/elasticsearch/indices/IndicesService.java +++ b/server/src/main/java/org/elasticsearch/indices/IndicesService.java @@ -59,10 +59,10 @@ import org.elasticsearch.common.util.iterable.Iterables; import org.elasticsearch.common.util.set.Sets; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.AbstractRefCounted; import org.elasticsearch.core.CheckedConsumer; import org.elasticsearch.core.CheckedFunction; diff --git a/server/src/main/java/org/elasticsearch/indices/NodeIndicesStats.java b/server/src/main/java/org/elasticsearch/indices/NodeIndicesStats.java index fc9bc3db932b2..7c46b4ea98e43 100644 --- a/server/src/main/java/org/elasticsearch/indices/NodeIndicesStats.java +++ b/server/src/main/java/org/elasticsearch/indices/NodeIndicesStats.java @@ -15,8 +15,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.Index; import org.elasticsearch.index.bulk.stats.BulkStats; import org.elasticsearch.index.cache.query.QueryCacheStats; diff --git a/server/src/main/java/org/elasticsearch/indices/SystemIndexDescriptor.java b/server/src/main/java/org/elasticsearch/indices/SystemIndexDescriptor.java index 7a05834667797..a7730b07840c8 100644 --- a/server/src/main/java/org/elasticsearch/indices/SystemIndexDescriptor.java +++ b/server/src/main/java/org/elasticsearch/indices/SystemIndexDescriptor.java @@ -17,10 +17,10 @@ import org.elasticsearch.cluster.metadata.Metadata; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.threadpool.ThreadPool; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/indices/SystemIndexManager.java b/server/src/main/java/org/elasticsearch/indices/SystemIndexManager.java index b41dec0ad9b57..2781a43990efd 100644 --- a/server/src/main/java/org/elasticsearch/indices/SystemIndexManager.java +++ b/server/src/main/java/org/elasticsearch/indices/SystemIndexManager.java @@ -29,7 +29,7 @@ import org.elasticsearch.cluster.metadata.MappingMetadata; import org.elasticsearch.cluster.metadata.Metadata; import org.elasticsearch.cluster.routing.IndexRoutingTable; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.gateway.GatewayService; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/indices/TermsLookup.java b/server/src/main/java/org/elasticsearch/indices/TermsLookup.java index 1e2a090f5c2d9..af5f732207750 100644 --- a/server/src/main/java/org/elasticsearch/indices/TermsLookup.java +++ b/server/src/main/java/org/elasticsearch/indices/TermsLookup.java @@ -9,14 +9,14 @@ package org.elasticsearch.indices; import org.elasticsearch.Version; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.index.mapper.MapperService; import org.elasticsearch.index.query.TermsQueryBuilder; @@ -24,7 +24,7 @@ import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; import static org.elasticsearch.core.RestApiVersion.equalTo; /** diff --git a/server/src/main/java/org/elasticsearch/indices/breaker/AllCircuitBreakerStats.java b/server/src/main/java/org/elasticsearch/indices/breaker/AllCircuitBreakerStats.java index d2c34632c7b0c..6664a127f9438 100644 --- a/server/src/main/java/org/elasticsearch/indices/breaker/AllCircuitBreakerStats.java +++ b/server/src/main/java/org/elasticsearch/indices/breaker/AllCircuitBreakerStats.java @@ -11,8 +11,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/indices/breaker/CircuitBreakerStats.java b/server/src/main/java/org/elasticsearch/indices/breaker/CircuitBreakerStats.java index ba8121b0ee345..a7c88a9f6c755 100644 --- a/server/src/main/java/org/elasticsearch/indices/breaker/CircuitBreakerStats.java +++ b/server/src/main/java/org/elasticsearch/indices/breaker/CircuitBreakerStats.java @@ -12,8 +12,8 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Locale; diff --git a/server/src/main/java/org/elasticsearch/indices/recovery/RecoveryState.java b/server/src/main/java/org/elasticsearch/indices/recovery/RecoveryState.java index e4c76785d864d..fcf3fac945570 100644 --- a/server/src/main/java/org/elasticsearch/indices/recovery/RecoveryState.java +++ b/server/src/main/java/org/elasticsearch/indices/recovery/RecoveryState.java @@ -18,10 +18,10 @@ import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.index.shard.IndexShard; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.index.store.StoreStats; diff --git a/server/src/main/java/org/elasticsearch/ingest/ConfigurationUtils.java b/server/src/main/java/org/elasticsearch/ingest/ConfigurationUtils.java index 95e9f21d517eb..6ca9b242461b9 100644 --- a/server/src/main/java/org/elasticsearch/ingest/ConfigurationUtils.java +++ b/server/src/main/java/org/elasticsearch/ingest/ConfigurationUtils.java @@ -15,11 +15,11 @@ import org.elasticsearch.ExceptionsHelper; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.script.Script; import org.elasticsearch.script.ScriptService; import org.elasticsearch.script.ScriptType; diff --git a/server/src/main/java/org/elasticsearch/ingest/IngestInfo.java b/server/src/main/java/org/elasticsearch/ingest/IngestInfo.java index 676be643bbb8d..acda77234f56a 100644 --- a/server/src/main/java/org/elasticsearch/ingest/IngestInfo.java +++ b/server/src/main/java/org/elasticsearch/ingest/IngestInfo.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.node.ReportingService; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/ingest/IngestMetadata.java b/server/src/main/java/org/elasticsearch/ingest/IngestMetadata.java index 2b7aa44ef9862..2703c57aa77ab 100644 --- a/server/src/main/java/org/elasticsearch/ingest/IngestMetadata.java +++ b/server/src/main/java/org/elasticsearch/ingest/IngestMetadata.java @@ -13,12 +13,12 @@ import org.elasticsearch.cluster.DiffableUtils; import org.elasticsearch.cluster.NamedDiff; import org.elasticsearch.cluster.metadata.Metadata; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/ingest/IngestStats.java b/server/src/main/java/org/elasticsearch/ingest/IngestStats.java index aa98886f2e798..9e36547e83830 100644 --- a/server/src/main/java/org/elasticsearch/ingest/IngestStats.java +++ b/server/src/main/java/org/elasticsearch/ingest/IngestStats.java @@ -12,8 +12,8 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/ingest/PipelineConfiguration.java b/server/src/main/java/org/elasticsearch/ingest/PipelineConfiguration.java index 9d9198c0699e0..54fa002eb66ba 100644 --- a/server/src/main/java/org/elasticsearch/ingest/PipelineConfiguration.java +++ b/server/src/main/java/org/elasticsearch/ingest/PipelineConfiguration.java @@ -14,13 +14,13 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ContextParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ContextParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.util.Map; diff --git a/server/src/main/java/org/elasticsearch/ingest/ProcessorInfo.java b/server/src/main/java/org/elasticsearch/ingest/ProcessorInfo.java index 0060f0df924f6..83b21f6e2ff74 100644 --- a/server/src/main/java/org/elasticsearch/ingest/ProcessorInfo.java +++ b/server/src/main/java/org/elasticsearch/ingest/ProcessorInfo.java @@ -11,9 +11,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContent.Params; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/monitor/fs/FsInfo.java b/server/src/main/java/org/elasticsearch/monitor/fs/FsInfo.java index b21278bedfd51..17e3854bfe191 100644 --- a/server/src/main/java/org/elasticsearch/monitor/fs/FsInfo.java +++ b/server/src/main/java/org/elasticsearch/monitor/fs/FsInfo.java @@ -12,9 +12,9 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.core.Nullable; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/monitor/jvm/JvmInfo.java b/server/src/main/java/org/elasticsearch/monitor/jvm/JvmInfo.java index 1bb80694ecc21..b77b107b500d3 100644 --- a/server/src/main/java/org/elasticsearch/monitor/jvm/JvmInfo.java +++ b/server/src/main/java/org/elasticsearch/monitor/jvm/JvmInfo.java @@ -16,7 +16,7 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.node.ReportingService; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/monitor/jvm/JvmStats.java b/server/src/main/java/org/elasticsearch/monitor/jvm/JvmStats.java index 9ce7244791abc..190a55ee78ef9 100644 --- a/server/src/main/java/org/elasticsearch/monitor/jvm/JvmStats.java +++ b/server/src/main/java/org/elasticsearch/monitor/jvm/JvmStats.java @@ -13,8 +13,8 @@ import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.lang.management.BufferPoolMXBean; diff --git a/server/src/main/java/org/elasticsearch/monitor/os/OsInfo.java b/server/src/main/java/org/elasticsearch/monitor/os/OsInfo.java index de137b3769993..91006d603d86a 100644 --- a/server/src/main/java/org/elasticsearch/monitor/os/OsInfo.java +++ b/server/src/main/java/org/elasticsearch/monitor/os/OsInfo.java @@ -11,7 +11,7 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.node.ReportingService; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/monitor/os/OsStats.java b/server/src/main/java/org/elasticsearch/monitor/os/OsStats.java index fdc48605a3eec..227751b0db586 100644 --- a/server/src/main/java/org/elasticsearch/monitor/os/OsStats.java +++ b/server/src/main/java/org/elasticsearch/monitor/os/OsStats.java @@ -14,8 +14,8 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Arrays; diff --git a/server/src/main/java/org/elasticsearch/monitor/process/ProcessInfo.java b/server/src/main/java/org/elasticsearch/monitor/process/ProcessInfo.java index b129e7ad3c886..47fa5ccf2bf62 100644 --- a/server/src/main/java/org/elasticsearch/monitor/process/ProcessInfo.java +++ b/server/src/main/java/org/elasticsearch/monitor/process/ProcessInfo.java @@ -11,7 +11,7 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.node.ReportingService; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/monitor/process/ProcessStats.java b/server/src/main/java/org/elasticsearch/monitor/process/ProcessStats.java index a86ff5d3be079..898aa21bb09c4 100644 --- a/server/src/main/java/org/elasticsearch/monitor/process/ProcessStats.java +++ b/server/src/main/java/org/elasticsearch/monitor/process/ProcessStats.java @@ -13,8 +13,8 @@ import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/node/AdaptiveSelectionStats.java b/server/src/main/java/org/elasticsearch/node/AdaptiveSelectionStats.java index e2d9342a25c2f..ceb64f4fe79a1 100644 --- a/server/src/main/java/org/elasticsearch/node/AdaptiveSelectionStats.java +++ b/server/src/main/java/org/elasticsearch/node/AdaptiveSelectionStats.java @@ -13,8 +13,8 @@ import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Locale; diff --git a/server/src/main/java/org/elasticsearch/node/Node.java b/server/src/main/java/org/elasticsearch/node/Node.java index 7e3beef886d72..0879e310d8758 100644 --- a/server/src/main/java/org/elasticsearch/node/Node.java +++ b/server/src/main/java/org/elasticsearch/node/Node.java @@ -79,7 +79,7 @@ import org.elasticsearch.common.transport.TransportAddress; import org.elasticsearch.common.util.BigArrays; import org.elasticsearch.common.util.PageCacheRecycler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.core.Releasables; import org.elasticsearch.core.TimeValue; import org.elasticsearch.core.internal.io.IOUtils; diff --git a/server/src/main/java/org/elasticsearch/node/ReportingService.java b/server/src/main/java/org/elasticsearch/node/ReportingService.java index a4076c7a3dc32..c89c213bf417b 100644 --- a/server/src/main/java/org/elasticsearch/node/ReportingService.java +++ b/server/src/main/java/org/elasticsearch/node/ReportingService.java @@ -9,7 +9,7 @@ package org.elasticsearch.node; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContent; public interface ReportingService { I info(); diff --git a/server/src/main/java/org/elasticsearch/persistent/PersistentTaskParams.java b/server/src/main/java/org/elasticsearch/persistent/PersistentTaskParams.java index ec8f3db6c3d7f..e525e3ae83e74 100644 --- a/server/src/main/java/org/elasticsearch/persistent/PersistentTaskParams.java +++ b/server/src/main/java/org/elasticsearch/persistent/PersistentTaskParams.java @@ -9,7 +9,7 @@ package org.elasticsearch.persistent; import org.elasticsearch.common.io.stream.VersionedNamedWriteable; -import org.elasticsearch.common.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.ToXContentObject; /** * Parameters used to start persistent task diff --git a/server/src/main/java/org/elasticsearch/persistent/PersistentTaskState.java b/server/src/main/java/org/elasticsearch/persistent/PersistentTaskState.java index f001b0b65d063..d4c6a7052a549 100644 --- a/server/src/main/java/org/elasticsearch/persistent/PersistentTaskState.java +++ b/server/src/main/java/org/elasticsearch/persistent/PersistentTaskState.java @@ -8,7 +8,7 @@ package org.elasticsearch.persistent; import org.elasticsearch.common.io.stream.NamedWriteable; -import org.elasticsearch.common.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.ToXContentObject; /** * {@link PersistentTaskState} represents the state of the persistent tasks, as it diff --git a/server/src/main/java/org/elasticsearch/persistent/PersistentTasksCustomMetadata.java b/server/src/main/java/org/elasticsearch/persistent/PersistentTasksCustomMetadata.java index 1b8364cccced1..d49985b187335 100644 --- a/server/src/main/java/org/elasticsearch/persistent/PersistentTasksCustomMetadata.java +++ b/server/src/main/java/org/elasticsearch/persistent/PersistentTasksCustomMetadata.java @@ -15,19 +15,19 @@ import org.elasticsearch.cluster.NamedDiff; import org.elasticsearch.cluster.metadata.Metadata; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.VersionedNamedWriteable; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.NamedObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ObjectParser.NamedObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collection; @@ -43,7 +43,7 @@ import java.util.stream.Collectors; import static org.elasticsearch.cluster.metadata.Metadata.ALL_CONTEXTS; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; /** * A cluster state record that contains a list of all running persistent tasks diff --git a/server/src/main/java/org/elasticsearch/persistent/PersistentTasksNodeService.java b/server/src/main/java/org/elasticsearch/persistent/PersistentTasksNodeService.java index 57b7ec74923b5..19b9329e3f5d0 100644 --- a/server/src/main/java/org/elasticsearch/persistent/PersistentTasksNodeService.java +++ b/server/src/main/java/org/elasticsearch/persistent/PersistentTasksNodeService.java @@ -17,7 +17,7 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.gateway.GatewayService; import org.elasticsearch.persistent.PersistentTasksCustomMetadata.PersistentTask; import org.elasticsearch.tasks.Task; diff --git a/server/src/main/java/org/elasticsearch/plugins/NetworkPlugin.java b/server/src/main/java/org/elasticsearch/plugins/NetworkPlugin.java index d32f75ca123f1..ad142997e41ac 100644 --- a/server/src/main/java/org/elasticsearch/plugins/NetworkPlugin.java +++ b/server/src/main/java/org/elasticsearch/plugins/NetworkPlugin.java @@ -19,7 +19,7 @@ import org.elasticsearch.common.util.BigArrays; import org.elasticsearch.common.util.PageCacheRecycler; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.http.HttpServerTransport; import org.elasticsearch.indices.breaker.CircuitBreakerService; import org.elasticsearch.threadpool.ThreadPool; diff --git a/server/src/main/java/org/elasticsearch/plugins/Plugin.java b/server/src/main/java/org/elasticsearch/plugins/Plugin.java index 0457529561a1f..88b0180b3b304 100644 --- a/server/src/main/java/org/elasticsearch/plugins/Plugin.java +++ b/server/src/main/java/org/elasticsearch/plugins/Plugin.java @@ -19,8 +19,8 @@ import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.SettingUpgrader; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.env.Environment; import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.index.IndexModule; diff --git a/server/src/main/java/org/elasticsearch/plugins/PluginInfo.java b/server/src/main/java/org/elasticsearch/plugins/PluginInfo.java index 9d139f8b0d7bc..f0e35b73d1d96 100644 --- a/server/src/main/java/org/elasticsearch/plugins/PluginInfo.java +++ b/server/src/main/java/org/elasticsearch/plugins/PluginInfo.java @@ -15,8 +15,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.io.InputStream; diff --git a/server/src/main/java/org/elasticsearch/plugins/RepositoryPlugin.java b/server/src/main/java/org/elasticsearch/plugins/RepositoryPlugin.java index 6db006353d825..465f57ce83644 100644 --- a/server/src/main/java/org/elasticsearch/plugins/RepositoryPlugin.java +++ b/server/src/main/java/org/elasticsearch/plugins/RepositoryPlugin.java @@ -10,7 +10,7 @@ import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.util.BigArrays; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.env.Environment; import org.elasticsearch.indices.recovery.RecoverySettings; import org.elasticsearch.repositories.Repository; diff --git a/server/src/main/java/org/elasticsearch/plugins/SearchPlugin.java b/server/src/main/java/org/elasticsearch/plugins/SearchPlugin.java index eeb65a683c64c..fa3bded838d3a 100644 --- a/server/src/main/java/org/elasticsearch/plugins/SearchPlugin.java +++ b/server/src/main/java/org/elasticsearch/plugins/SearchPlugin.java @@ -11,15 +11,15 @@ import org.apache.lucene.search.Query; import org.elasticsearch.common.CheckedBiConsumer; import org.elasticsearch.core.CheckedFunction; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.NamedWriteable; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.lucene.search.function.ScoreFunction; -import org.elasticsearch.common.xcontent.ContextParser; -import org.elasticsearch.common.xcontent.XContent; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ContextParser; +import org.elasticsearch.xcontent.XContent; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.Nullable; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryParser; diff --git a/server/src/main/java/org/elasticsearch/plugins/spi/NamedXContentProvider.java b/server/src/main/java/org/elasticsearch/plugins/spi/NamedXContentProvider.java index 36a97dc17305c..8d542d0e3b079 100644 --- a/server/src/main/java/org/elasticsearch/plugins/spi/NamedXContentProvider.java +++ b/server/src/main/java/org/elasticsearch/plugins/spi/NamedXContentProvider.java @@ -8,7 +8,7 @@ package org.elasticsearch.plugins.spi; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/repositories/IndexId.java b/server/src/main/java/org/elasticsearch/repositories/IndexId.java index 7355b350b5ed4..227aa7900a26b 100644 --- a/server/src/main/java/org/elasticsearch/repositories/IndexId.java +++ b/server/src/main/java/org/elasticsearch/repositories/IndexId.java @@ -11,10 +11,10 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.index.Index; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/server/src/main/java/org/elasticsearch/repositories/RepositoriesModule.java b/server/src/main/java/org/elasticsearch/repositories/RepositoriesModule.java index f7931bdb54a5d..89992b20fe96f 100644 --- a/server/src/main/java/org/elasticsearch/repositories/RepositoriesModule.java +++ b/server/src/main/java/org/elasticsearch/repositories/RepositoriesModule.java @@ -11,12 +11,12 @@ import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.BigArrays; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; import org.elasticsearch.env.Environment; import org.elasticsearch.indices.recovery.RecoverySettings; import org.elasticsearch.plugins.RepositoryPlugin; import org.elasticsearch.repositories.fs.FsRepository; import org.elasticsearch.transport.TransportService; +import org.elasticsearch.xcontent.NamedXContentRegistry; import java.util.Collections; import java.util.HashMap; diff --git a/server/src/main/java/org/elasticsearch/repositories/RepositoryCleanupResult.java b/server/src/main/java/org/elasticsearch/repositories/RepositoryCleanupResult.java index 441253f08c487..664b6d1cb078c 100644 --- a/server/src/main/java/org/elasticsearch/repositories/RepositoryCleanupResult.java +++ b/server/src/main/java/org/elasticsearch/repositories/RepositoryCleanupResult.java @@ -12,10 +12,10 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/repositories/RepositoryData.java b/server/src/main/java/org/elasticsearch/repositories/RepositoryData.java index 43de0e37030d8..a246b3472d7c6 100644 --- a/server/src/main/java/org/elasticsearch/repositories/RepositoryData.java +++ b/server/src/main/java/org/elasticsearch/repositories/RepositoryData.java @@ -15,14 +15,14 @@ import org.elasticsearch.cluster.metadata.Metadata; import org.elasticsearch.common.UUIDs; import org.elasticsearch.common.util.CollectionUtils; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParserUtils; import org.elasticsearch.core.Nullable; import org.elasticsearch.snapshots.SnapshotId; import org.elasticsearch.snapshots.SnapshotInfo; import org.elasticsearch.snapshots.SnapshotState; import org.elasticsearch.snapshots.SnapshotsService; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/repositories/RepositoryInfo.java b/server/src/main/java/org/elasticsearch/repositories/RepositoryInfo.java index 709a4ba6e511a..040d02acfcc8a 100644 --- a/server/src/main/java/org/elasticsearch/repositories/RepositoryInfo.java +++ b/server/src/main/java/org/elasticsearch/repositories/RepositoryInfo.java @@ -12,9 +12,9 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.core.Nullable; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Map; diff --git a/server/src/main/java/org/elasticsearch/repositories/RepositoryStatsSnapshot.java b/server/src/main/java/org/elasticsearch/repositories/RepositoryStatsSnapshot.java index e352a9e282161..5da5a404582e5 100644 --- a/server/src/main/java/org/elasticsearch/repositories/RepositoryStatsSnapshot.java +++ b/server/src/main/java/org/elasticsearch/repositories/RepositoryStatsSnapshot.java @@ -12,8 +12,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/server/src/main/java/org/elasticsearch/repositories/ShardGeneration.java b/server/src/main/java/org/elasticsearch/repositories/ShardGeneration.java index 1ee3afc1b6ed3..5bdd68b14762e 100644 --- a/server/src/main/java/org/elasticsearch/repositories/ShardGeneration.java +++ b/server/src/main/java/org/elasticsearch/repositories/ShardGeneration.java @@ -12,11 +12,11 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.snapshots.blobstore.BlobStoreIndexShardSnapshots; import org.elasticsearch.snapshots.SnapshotsService; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/server/src/main/java/org/elasticsearch/repositories/blobstore/BlobStoreRepository.java b/server/src/main/java/org/elasticsearch/repositories/blobstore/BlobStoreRepository.java index 427493200cc36..542994f30f8ef 100644 --- a/server/src/main/java/org/elasticsearch/repositories/blobstore/BlobStoreRepository.java +++ b/server/src/main/java/org/elasticsearch/repositories/blobstore/BlobStoreRepository.java @@ -70,11 +70,6 @@ import org.elasticsearch.common.util.concurrent.ConcurrentCollections; import org.elasticsearch.common.util.concurrent.FutureUtils; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.core.CheckedConsumer; import org.elasticsearch.core.Nullable; import org.elasticsearch.core.Releasable; @@ -118,6 +113,11 @@ import org.elasticsearch.snapshots.SnapshotsService; import org.elasticsearch.tasks.TaskCancelledException; import org.elasticsearch.threadpool.ThreadPool; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import java.io.FilterInputStream; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/repositories/blobstore/ChecksumBlobStoreFormat.java b/server/src/main/java/org/elasticsearch/repositories/blobstore/ChecksumBlobStoreFormat.java index 79a83205cbac9..a2918f6bda00c 100644 --- a/server/src/main/java/org/elasticsearch/repositories/blobstore/ChecksumBlobStoreFormat.java +++ b/server/src/main/java/org/elasticsearch/repositories/blobstore/ChecksumBlobStoreFormat.java @@ -23,14 +23,14 @@ import org.elasticsearch.common.io.Streams; import org.elasticsearch.common.lucene.store.IndexOutputOutputStream; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParserUtils; -import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.gateway.CorruptStateException; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import java.io.FilterInputStream; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/repositories/blobstore/MeteredBlobStoreRepository.java b/server/src/main/java/org/elasticsearch/repositories/blobstore/MeteredBlobStoreRepository.java index db29862688433..c5ea99b0e5c14 100644 --- a/server/src/main/java/org/elasticsearch/repositories/blobstore/MeteredBlobStoreRepository.java +++ b/server/src/main/java/org/elasticsearch/repositories/blobstore/MeteredBlobStoreRepository.java @@ -13,11 +13,11 @@ import org.elasticsearch.common.UUIDs; import org.elasticsearch.common.blobstore.BlobPath; import org.elasticsearch.common.util.BigArrays; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; import org.elasticsearch.indices.recovery.RecoverySettings; import org.elasticsearch.repositories.RepositoryInfo; import org.elasticsearch.repositories.RepositoryStatsSnapshot; import org.elasticsearch.threadpool.ThreadPool; +import org.elasticsearch.xcontent.NamedXContentRegistry; import java.util.Map; diff --git a/server/src/main/java/org/elasticsearch/repositories/fs/FsRepository.java b/server/src/main/java/org/elasticsearch/repositories/fs/FsRepository.java index 3b7449aa4bfd7..b193ba182b8cb 100644 --- a/server/src/main/java/org/elasticsearch/repositories/fs/FsRepository.java +++ b/server/src/main/java/org/elasticsearch/repositories/fs/FsRepository.java @@ -19,11 +19,11 @@ import org.elasticsearch.common.settings.Setting.Property; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.common.util.BigArrays; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; import org.elasticsearch.env.Environment; import org.elasticsearch.indices.recovery.RecoverySettings; import org.elasticsearch.repositories.RepositoryException; import org.elasticsearch.repositories.blobstore.BlobStoreRepository; +import org.elasticsearch.xcontent.NamedXContentRegistry; import java.nio.file.Path; import java.util.function.Function; diff --git a/server/src/main/java/org/elasticsearch/rest/AbstractRestChannel.java b/server/src/main/java/org/elasticsearch/rest/AbstractRestChannel.java index e516f8cb23be9..e10494067c33d 100644 --- a/server/src/main/java/org/elasticsearch/rest/AbstractRestChannel.java +++ b/server/src/main/java/org/elasticsearch/rest/AbstractRestChannel.java @@ -13,10 +13,10 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.Streams; import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.common.xcontent.ParsedMediaType; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ParsedMediaType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.io.OutputStream; diff --git a/server/src/main/java/org/elasticsearch/rest/BytesRestResponse.java b/server/src/main/java/org/elasticsearch/rest/BytesRestResponse.java index c76692c50c834..fedd300628cd3 100644 --- a/server/src/main/java/org/elasticsearch/rest/BytesRestResponse.java +++ b/server/src/main/java/org/elasticsearch/rest/BytesRestResponse.java @@ -17,9 +17,9 @@ import org.elasticsearch.ExceptionsHelper; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/rest/RestChannel.java b/server/src/main/java/org/elasticsearch/rest/RestChannel.java index 5c4a4a9d5f1ba..9cbdb28dfd3d6 100644 --- a/server/src/main/java/org/elasticsearch/rest/RestChannel.java +++ b/server/src/main/java/org/elasticsearch/rest/RestChannel.java @@ -10,8 +10,8 @@ import org.elasticsearch.core.Nullable; import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/rest/RestCompatibleVersionHelper.java b/server/src/main/java/org/elasticsearch/rest/RestCompatibleVersionHelper.java index 2e0e8d61b8371..4799332f0ac55 100644 --- a/server/src/main/java/org/elasticsearch/rest/RestCompatibleVersionHelper.java +++ b/server/src/main/java/org/elasticsearch/rest/RestCompatibleVersionHelper.java @@ -17,8 +17,8 @@ import org.elasticsearch.ElasticsearchStatusException; import org.elasticsearch.core.Nullable; import org.elasticsearch.core.RestApiVersion; -import org.elasticsearch.common.xcontent.MediaType; -import org.elasticsearch.common.xcontent.ParsedMediaType; +import org.elasticsearch.xcontent.MediaType; +import org.elasticsearch.xcontent.ParsedMediaType; /** * A helper that is responsible for parsing a Compatible REST API version from RestRequest. diff --git a/server/src/main/java/org/elasticsearch/rest/RestController.java b/server/src/main/java/org/elasticsearch/rest/RestController.java index f36faab118481..a799ddcedc87c 100644 --- a/server/src/main/java/org/elasticsearch/rest/RestController.java +++ b/server/src/main/java/org/elasticsearch/rest/RestController.java @@ -23,8 +23,8 @@ import org.elasticsearch.common.logging.DeprecationLogger; import org.elasticsearch.common.path.PathTrie; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.internal.io.Streams; import org.elasticsearch.http.HttpServerTransport; import org.elasticsearch.indices.breaker.CircuitBreakerService; diff --git a/server/src/main/java/org/elasticsearch/rest/RestHandler.java b/server/src/main/java/org/elasticsearch/rest/RestHandler.java index 998c4098cc200..4d6e5a06daeb8 100644 --- a/server/src/main/java/org/elasticsearch/rest/RestHandler.java +++ b/server/src/main/java/org/elasticsearch/rest/RestHandler.java @@ -10,10 +10,10 @@ import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.core.RestApiVersion; -import org.elasticsearch.common.xcontent.MediaType; -import org.elasticsearch.common.xcontent.MediaTypeRegistry; -import org.elasticsearch.common.xcontent.XContent; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.MediaType; +import org.elasticsearch.xcontent.MediaTypeRegistry; +import org.elasticsearch.xcontent.XContent; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.rest.RestRequest.Method; import java.util.Collections; diff --git a/server/src/main/java/org/elasticsearch/rest/RestRequest.java b/server/src/main/java/org/elasticsearch/rest/RestRequest.java index 69570dfbdb1a6..cd3a1e41889fc 100644 --- a/server/src/main/java/org/elasticsearch/rest/RestRequest.java +++ b/server/src/main/java/org/elasticsearch/rest/RestRequest.java @@ -21,12 +21,12 @@ import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ParsedMediaType; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContent; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ParsedMediaType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.http.HttpChannel; import org.elasticsearch.http.HttpRequest; diff --git a/server/src/main/java/org/elasticsearch/rest/RestRequestFilter.java b/server/src/main/java/org/elasticsearch/rest/RestRequestFilter.java index d10075cbf034c..604ed6a1e7118 100644 --- a/server/src/main/java/org/elasticsearch/rest/RestRequestFilter.java +++ b/server/src/main/java/org/elasticsearch/rest/RestRequestFilter.java @@ -12,9 +12,9 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.core.Tuple; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.common.xcontent.support.XContentMapValues; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/rest/action/DispatchingRestToXContentListener.java b/server/src/main/java/org/elasticsearch/rest/action/DispatchingRestToXContentListener.java index 3339572497e85..9180c1a1787f4 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/DispatchingRestToXContentListener.java +++ b/server/src/main/java/org/elasticsearch/rest/action/DispatchingRestToXContentListener.java @@ -9,9 +9,9 @@ package org.elasticsearch.rest.action; import org.elasticsearch.action.ActionRunnable; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestChannel; import org.elasticsearch.rest.RestRequest; diff --git a/server/src/main/java/org/elasticsearch/rest/action/RestActions.java b/server/src/main/java/org/elasticsearch/rest/action/RestActions.java index dfe80e2b779a7..4fbd6f97979f2 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/RestActions.java +++ b/server/src/main/java/org/elasticsearch/rest/action/RestActions.java @@ -14,14 +14,14 @@ import org.elasticsearch.action.support.broadcast.BroadcastResponse; import org.elasticsearch.action.support.nodes.BaseNodeResponse; import org.elasticsearch.action.support.nodes.BaseNodesResponse; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.lucene.uid.Versions; import org.elasticsearch.common.util.CollectionUtils; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContent.Params; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContent.Params; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.query.Operator; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilders; diff --git a/server/src/main/java/org/elasticsearch/rest/action/RestBuilderListener.java b/server/src/main/java/org/elasticsearch/rest/action/RestBuilderListener.java index ce1f1d8e40cf1..9e8f7a6ca508e 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/RestBuilderListener.java +++ b/server/src/main/java/org/elasticsearch/rest/action/RestBuilderListener.java @@ -8,7 +8,7 @@ package org.elasticsearch.rest.action; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.rest.RestChannel; import org.elasticsearch.rest.RestResponse; diff --git a/server/src/main/java/org/elasticsearch/rest/action/RestFieldCapabilitiesAction.java b/server/src/main/java/org/elasticsearch/rest/action/RestFieldCapabilitiesAction.java index 8abb467a4785e..8709f9e1724ce 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/RestFieldCapabilitiesAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/RestFieldCapabilitiesAction.java @@ -11,9 +11,9 @@ import org.elasticsearch.action.fieldcaps.FieldCapabilitiesRequest; import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ObjectParser; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; diff --git a/server/src/main/java/org/elasticsearch/rest/action/RestMainAction.java b/server/src/main/java/org/elasticsearch/rest/action/RestMainAction.java index ce8f079f86b19..bd55619aebc01 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/RestMainAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/RestMainAction.java @@ -12,7 +12,7 @@ import org.elasticsearch.action.main.MainRequest; import org.elasticsearch.action.main.MainResponse; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestRequest; diff --git a/server/src/main/java/org/elasticsearch/rest/action/RestStatusToXContentListener.java b/server/src/main/java/org/elasticsearch/rest/action/RestStatusToXContentListener.java index 3c6396efab5cc..e10a63466a962 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/RestStatusToXContentListener.java +++ b/server/src/main/java/org/elasticsearch/rest/action/RestStatusToXContentListener.java @@ -8,7 +8,7 @@ package org.elasticsearch.rest.action; import org.elasticsearch.common.xcontent.StatusToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestChannel; import org.elasticsearch.rest.RestResponse; diff --git a/server/src/main/java/org/elasticsearch/rest/action/RestToXContentListener.java b/server/src/main/java/org/elasticsearch/rest/action/RestToXContentListener.java index c6ee96210fc2c..e7b66dc07e6ca 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/RestToXContentListener.java +++ b/server/src/main/java/org/elasticsearch/rest/action/RestToXContentListener.java @@ -8,8 +8,8 @@ package org.elasticsearch.rest.action; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestChannel; import org.elasticsearch.rest.RestResponse; diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestClusterAllocationExplainAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestClusterAllocationExplainAction.java index 579ad307267b0..1b6e456914a9b 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestClusterAllocationExplainAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestClusterAllocationExplainAction.java @@ -11,9 +11,9 @@ import org.elasticsearch.action.admin.cluster.allocation.ClusterAllocationExplainRequest; import org.elasticsearch.action.admin.cluster.allocation.ClusterAllocationExplainResponse; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestRequest; diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestClusterGetSettingsAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestClusterGetSettingsAction.java index 7c06f2f8f4dbe..b798e0e4d17b2 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestClusterGetSettingsAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestClusterGetSettingsAction.java @@ -17,8 +17,8 @@ import org.elasticsearch.common.settings.ClusterSettings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.SettingsFilter; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestRequest; diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestClusterRerouteAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestClusterRerouteAction.java index f0191dc807ab8..052317c3cc7c0 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestClusterRerouteAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestClusterRerouteAction.java @@ -13,12 +13,12 @@ import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.routing.allocation.command.AllocationCommands; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.SettingsFilter; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestToXContentListener; diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestClusterStateAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestClusterStateAction.java index d4e84d8e1a6fb..c0e7afde5d8ff 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestClusterStateAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestClusterStateAction.java @@ -20,9 +20,9 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.SettingsFilter; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.DispatchingRestToXContentListener; diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestClusterUpdateSettingsAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestClusterUpdateSettingsAction.java index dd6503112e814..6326cfcecd524 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestClusterUpdateSettingsAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestClusterUpdateSettingsAction.java @@ -12,7 +12,7 @@ import org.elasticsearch.client.Requests; import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestToXContentListener; diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestListTasksAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestListTasksAction.java index 991e73577b8cf..7155aa437b058 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestListTasksAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestListTasksAction.java @@ -15,7 +15,7 @@ import org.elasticsearch.cluster.node.DiscoveryNodes; import org.elasticsearch.common.Strings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestChannel; diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestNodesUsageAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestNodesUsageAction.java index 535f42a3e4a40..e61a100839166 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestNodesUsageAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestNodesUsageAction.java @@ -12,7 +12,7 @@ import org.elasticsearch.action.admin.cluster.node.usage.NodesUsageResponse; import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestRequest; diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestPutRepositoryAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestPutRepositoryAction.java index 72616243250ab..3f0271282b3b2 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestPutRepositoryAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestPutRepositoryAction.java @@ -10,7 +10,7 @@ import org.elasticsearch.action.admin.cluster.repositories.put.PutRepositoryRequest; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestToXContentListener; diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestPutStoredScriptAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestPutStoredScriptAction.java index 4b7299d13d3fc..a3283aa5c1041 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestPutStoredScriptAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestPutStoredScriptAction.java @@ -10,7 +10,7 @@ import org.elasticsearch.action.admin.cluster.storedscripts.PutStoredScriptRequest; import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestToXContentListener; diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestReloadSecureSettingsAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestReloadSecureSettingsAction.java index 047843c8933c5..2e424b7df1b7f 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestReloadSecureSettingsAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestReloadSecureSettingsAction.java @@ -12,11 +12,11 @@ import org.elasticsearch.action.admin.cluster.node.reload.NodesReloadSecureSettingsRequestBuilder; import org.elasticsearch.action.admin.cluster.node.reload.NodesReloadSecureSettingsResponse; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.SecureString; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestRequest; diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestAnalyzeAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestAnalyzeAction.java index 5bcac35dab0ac..6cd14c7179185 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestAnalyzeAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestAnalyzeAction.java @@ -9,7 +9,7 @@ import org.elasticsearch.action.admin.indices.analyze.AnalyzeAction; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestToXContentListener; diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetAliasesAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetAliasesAction.java index 68dcf0ebc5013..7451757f1fdfa 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetAliasesAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetAliasesAction.java @@ -19,8 +19,8 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.collect.ImmutableOpenMap; import org.elasticsearch.common.regex.Regex; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BytesRestResponse; diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetFieldMappingAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetFieldMappingAction.java index 6c69897a7759c..2fa97d4e8cbec 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetFieldMappingAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetFieldMappingAction.java @@ -18,7 +18,7 @@ import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.common.Strings; import org.elasticsearch.common.logging.DeprecationLogger; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestRequest; diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetMappingAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetMappingAction.java index e71a2b2e3336d..8cd0e21e7b90e 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetMappingAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetMappingAction.java @@ -17,8 +17,8 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.logging.DeprecationLogger; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.http.HttpChannel; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestIndexPutAliasAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestIndexPutAliasAction.java index 0d2cef0a44def..d2300d405a8f7 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestIndexPutAliasAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestIndexPutAliasAction.java @@ -11,7 +11,7 @@ import org.elasticsearch.action.admin.indices.alias.IndicesAliasesRequest.AliasActions; import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestToXContentListener; diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestIndicesAliasesAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestIndicesAliasesAction.java index bb6d89ce9dc8d..23c34cf1122c3 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestIndicesAliasesAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestIndicesAliasesAction.java @@ -10,7 +10,7 @@ import org.elasticsearch.action.admin.indices.alias.IndicesAliasesRequest; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestToXContentListener; diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestIndicesShardStoresAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestIndicesShardStoresAction.java index ffc52b0a35e22..b446ad5d11f08 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestIndicesShardStoresAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestIndicesShardStoresAction.java @@ -14,7 +14,7 @@ import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestRequest; diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestSyncedFlushAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestSyncedFlushAction.java index a2bd549f32c22..3fe2860d97f27 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestSyncedFlushAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestSyncedFlushAction.java @@ -13,7 +13,7 @@ import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BytesRestResponse; diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestValidateQueryAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestValidateQueryAction.java index 315169cb32209..ba09e5ba2542e 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestValidateQueryAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestValidateQueryAction.java @@ -16,7 +16,7 @@ import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.logging.DeprecationLogger; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BytesRestResponse; diff --git a/server/src/main/java/org/elasticsearch/rest/action/cat/RestTable.java b/server/src/main/java/org/elasticsearch/rest/action/cat/RestTable.java index d944d82df5413..bb2d1f7f45435 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/cat/RestTable.java +++ b/server/src/main/java/org/elasticsearch/rest/action/cat/RestTable.java @@ -18,8 +18,8 @@ import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.common.unit.SizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestChannel; import org.elasticsearch.rest.RestRequest; diff --git a/server/src/main/java/org/elasticsearch/rest/action/document/RestGetSourceAction.java b/server/src/main/java/org/elasticsearch/rest/action/document/RestGetSourceAction.java index 8591bf87a5828..e457fb86214b2 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/document/RestGetSourceAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/document/RestGetSourceAction.java @@ -15,7 +15,7 @@ import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.logging.DeprecationLogger; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; diff --git a/server/src/main/java/org/elasticsearch/rest/action/document/RestMultiGetAction.java b/server/src/main/java/org/elasticsearch/rest/action/document/RestMultiGetAction.java index 45d2230d3fec2..cc2cbb1a6a03d 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/document/RestMultiGetAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/document/RestMultiGetAction.java @@ -13,7 +13,7 @@ import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestToXContentListener; diff --git a/server/src/main/java/org/elasticsearch/rest/action/document/RestTermVectorsAction.java b/server/src/main/java/org/elasticsearch/rest/action/document/RestTermVectorsAction.java index 5e3069c08089a..004b904206e84 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/document/RestTermVectorsAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/document/RestTermVectorsAction.java @@ -12,7 +12,7 @@ import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.VersionType; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; diff --git a/server/src/main/java/org/elasticsearch/rest/action/ingest/RestPutPipelineAction.java b/server/src/main/java/org/elasticsearch/rest/action/ingest/RestPutPipelineAction.java index 4033498394597..1ec41d745826f 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/ingest/RestPutPipelineAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/ingest/RestPutPipelineAction.java @@ -12,7 +12,7 @@ import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.core.Tuple; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestToXContentListener; diff --git a/server/src/main/java/org/elasticsearch/rest/action/ingest/RestSimulatePipelineAction.java b/server/src/main/java/org/elasticsearch/rest/action/ingest/RestSimulatePipelineAction.java index 6d3df0d7570aa..9de32ce2c6aa8 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/ingest/RestSimulatePipelineAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/ingest/RestSimulatePipelineAction.java @@ -12,7 +12,7 @@ import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.core.Tuple; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestToXContentListener; diff --git a/server/src/main/java/org/elasticsearch/rest/action/search/RestCountAction.java b/server/src/main/java/org/elasticsearch/rest/action/search/RestCountAction.java index 2b45963f71f6e..6d7ee2fae3894 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/search/RestCountAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/search/RestCountAction.java @@ -14,7 +14,7 @@ import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.common.Strings; import org.elasticsearch.common.logging.DeprecationLogger; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.rest.BaseRestHandler; diff --git a/server/src/main/java/org/elasticsearch/rest/action/search/RestMultiSearchAction.java b/server/src/main/java/org/elasticsearch/rest/action/search/RestMultiSearchAction.java index fa27e8eeaf488..c0fab6ef2989b 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/search/RestMultiSearchAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/search/RestMultiSearchAction.java @@ -21,9 +21,9 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.logging.DeprecationLogger; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContent; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestCancellableNodeClient; diff --git a/server/src/main/java/org/elasticsearch/rest/action/search/RestSearchAction.java b/server/src/main/java/org/elasticsearch/rest/action/search/RestSearchAction.java index d6425f2cbf6ee..871d216a15ae0 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/search/RestSearchAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/search/RestSearchAction.java @@ -19,7 +19,7 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.logging.DeprecationLogger; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.Booleans; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.index.query.QueryBuilder; diff --git a/server/src/main/java/org/elasticsearch/script/Script.java b/server/src/main/java/org/elasticsearch/script/Script.java index 036f81ba4c84c..b9d0050b8b96d 100644 --- a/server/src/main/java/org/elasticsearch/script/Script.java +++ b/server/src/main/java/org/elasticsearch/script/Script.java @@ -9,7 +9,7 @@ package org.elasticsearch.script; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; @@ -17,19 +17,19 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.AbstractObjectParser; +import org.elasticsearch.xcontent.AbstractObjectParser; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentParser.Token; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser.Token; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import java.io.IOException; import java.io.InputStream; diff --git a/server/src/main/java/org/elasticsearch/script/ScriptContextInfo.java b/server/src/main/java/org/elasticsearch/script/ScriptContextInfo.java index 491c0915dea1c..a439adb7b7067 100644 --- a/server/src/main/java/org/elasticsearch/script/ScriptContextInfo.java +++ b/server/src/main/java/org/elasticsearch/script/ScriptContextInfo.java @@ -8,14 +8,14 @@ package org.elasticsearch.script; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.lang.reflect.Field; @@ -31,7 +31,7 @@ import java.util.Set; import java.util.stream.Collectors; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; public class ScriptContextInfo implements ToXContentObject, Writeable { public final String name; diff --git a/server/src/main/java/org/elasticsearch/script/ScriptContextStats.java b/server/src/main/java/org/elasticsearch/script/ScriptContextStats.java index cf52d8d7a9347..2668979f158ef 100644 --- a/server/src/main/java/org/elasticsearch/script/ScriptContextStats.java +++ b/server/src/main/java/org/elasticsearch/script/ScriptContextStats.java @@ -12,8 +12,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/server/src/main/java/org/elasticsearch/script/ScriptException.java b/server/src/main/java/org/elasticsearch/script/ScriptException.java index 5959d9f0beab6..b06cf2a759e8c 100644 --- a/server/src/main/java/org/elasticsearch/script/ScriptException.java +++ b/server/src/main/java/org/elasticsearch/script/ScriptException.java @@ -5,9 +5,9 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.rest.RestStatus; /* diff --git a/server/src/main/java/org/elasticsearch/script/ScriptLanguagesInfo.java b/server/src/main/java/org/elasticsearch/script/ScriptLanguagesInfo.java index 5da0136527aa3..3210637504c70 100644 --- a/server/src/main/java/org/elasticsearch/script/ScriptLanguagesInfo.java +++ b/server/src/main/java/org/elasticsearch/script/ScriptLanguagesInfo.java @@ -8,15 +8,15 @@ package org.elasticsearch.script; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.Tuple; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collections; @@ -27,7 +27,7 @@ import java.util.Set; import java.util.stream.Collectors; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; /** * The allowable types, languages and their corresponding contexts. When serialized there is a top level types_allowed list, diff --git a/server/src/main/java/org/elasticsearch/script/ScriptMetadata.java b/server/src/main/java/org/elasticsearch/script/ScriptMetadata.java index fb18105bb4c0a..2d94b33aad40f 100644 --- a/server/src/main/java/org/elasticsearch/script/ScriptMetadata.java +++ b/server/src/main/java/org/elasticsearch/script/ScriptMetadata.java @@ -20,10 +20,10 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentParser.Token; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser.Token; import java.io.IOException; import java.util.Collections; diff --git a/server/src/main/java/org/elasticsearch/script/ScriptStats.java b/server/src/main/java/org/elasticsearch/script/ScriptStats.java index 4fc0cbcaefb31..55ba2a847f7bb 100644 --- a/server/src/main/java/org/elasticsearch/script/ScriptStats.java +++ b/server/src/main/java/org/elasticsearch/script/ScriptStats.java @@ -11,8 +11,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/script/ScriptType.java b/server/src/main/java/org/elasticsearch/script/ScriptType.java index 580c9676965e4..cf73322d528f8 100644 --- a/server/src/main/java/org/elasticsearch/script/ScriptType.java +++ b/server/src/main/java/org/elasticsearch/script/ScriptType.java @@ -8,7 +8,7 @@ package org.elasticsearch.script; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; diff --git a/server/src/main/java/org/elasticsearch/script/StoredScriptSource.java b/server/src/main/java/org/elasticsearch/script/StoredScriptSource.java index ac6e8089c134d..af4237c0a755d 100644 --- a/server/src/main/java/org/elasticsearch/script/StoredScriptSource.java +++ b/server/src/main/java/org/elasticsearch/script/StoredScriptSource.java @@ -19,16 +19,16 @@ import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.logging.DeprecationLogger; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentParser.Token; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser.Token; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.io.InputStream; diff --git a/server/src/main/java/org/elasticsearch/search/SearchExtBuilder.java b/server/src/main/java/org/elasticsearch/search/SearchExtBuilder.java index 0c5bd9e86ccba..4c21d89abfa0e 100644 --- a/server/src/main/java/org/elasticsearch/search/SearchExtBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/SearchExtBuilder.java @@ -13,7 +13,7 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.ToXContentFragment; import org.elasticsearch.plugins.SearchPlugin; import org.elasticsearch.plugins.SearchPlugin.SearchExtSpec; diff --git a/server/src/main/java/org/elasticsearch/search/SearchHit.java b/server/src/main/java/org/elasticsearch/search/SearchHit.java index 3a9c7cf697ad6..d14167d635be6 100644 --- a/server/src/main/java/org/elasticsearch/search/SearchHit.java +++ b/server/src/main/java/org/elasticsearch/search/SearchHit.java @@ -13,7 +13,7 @@ import org.elasticsearch.Version; import org.elasticsearch.action.OriginalIndices; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.ParsingException; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.common.Strings; @@ -24,15 +24,15 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.text.Text; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentParser.Token; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser.Token; import org.elasticsearch.index.mapper.IgnoredFieldMapper; import org.elasticsearch.index.mapper.MapperService; import org.elasticsearch.index.mapper.SourceFieldMapper; @@ -57,8 +57,8 @@ import static java.util.Collections.unmodifiableMap; import static org.elasticsearch.common.lucene.Lucene.readExplanation; import static org.elasticsearch.common.lucene.Lucene.writeExplanation; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; import static org.elasticsearch.common.xcontent.XContentParserUtils.ensureExpectedToken; import static org.elasticsearch.common.xcontent.XContentParserUtils.ensureFieldName; @@ -721,7 +721,7 @@ public XContentBuilder toInnerXContent(XContentBuilder builder, Params params) t * is that this way we can reuse the parser when parsing xContent from * {@link org.elasticsearch.search.suggest.completion.CompletionSuggestion.Entry.Option} which unfortunately inlines * the output of - * {@link #toInnerXContent(XContentBuilder, org.elasticsearch.common.xcontent.ToXContent.Params)} + * {@link #toInnerXContent(XContentBuilder, org.elasticsearch.xcontent.ToXContent.Params)} * of the included search hit. The output of the map is used to create the * actual SearchHit instance via {@link #createFromMap(Map)} */ diff --git a/server/src/main/java/org/elasticsearch/search/SearchHits.java b/server/src/main/java/org/elasticsearch/search/SearchHits.java index 37ed07fc87720..d76afe6029465 100644 --- a/server/src/main/java/org/elasticsearch/search/SearchHits.java +++ b/server/src/main/java/org/elasticsearch/search/SearchHits.java @@ -16,9 +16,9 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.lucene.Lucene; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.rest.action.search.RestSearchAction; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/search/SearchModule.java b/server/src/main/java/org/elasticsearch/search/SearchModule.java index a9f4c8024c377..acbd16c785ab6 100644 --- a/server/src/main/java/org/elasticsearch/search/SearchModule.java +++ b/server/src/main/java/org/elasticsearch/search/SearchModule.java @@ -17,9 +17,9 @@ import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.Nullable; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.index.query.BoolQueryBuilder; diff --git a/server/src/main/java/org/elasticsearch/search/SearchParseException.java b/server/src/main/java/org/elasticsearch/search/SearchParseException.java index 79c5e5f636e0b..71381f8d3f47b 100644 --- a/server/src/main/java/org/elasticsearch/search/SearchParseException.java +++ b/server/src/main/java/org/elasticsearch/search/SearchParseException.java @@ -11,8 +11,8 @@ import org.elasticsearch.core.Nullable; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentLocation; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentLocation; import org.elasticsearch.rest.RestStatus; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/search/SearchSortValues.java b/server/src/main/java/org/elasticsearch/search/SearchSortValues.java index 22e8f039f5edb..dec0cc22d4b42 100644 --- a/server/src/main/java/org/elasticsearch/search/SearchSortValues.java +++ b/server/src/main/java/org/elasticsearch/search/SearchSortValues.java @@ -12,9 +12,9 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.lucene.Lucene; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParserUtils; import org.elasticsearch.search.SearchHit.Fields; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/AbstractAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/AbstractAggregationBuilder.java index b28d45a851268..d592c19a0429e 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/AbstractAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/AbstractAggregationBuilder.java @@ -9,8 +9,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.aggregations.support.AggregationContext; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Collections; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/Aggregation.java b/server/src/main/java/org/elasticsearch/search/aggregations/Aggregation.java index 942f65ab15856..1bebbdaf7577e 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/Aggregation.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/Aggregation.java @@ -7,9 +7,9 @@ */ package org.elasticsearch.search.aggregations; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentFragment; import java.util.Map; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/AggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/AggregationBuilder.java index 3794b7526f4e5..860a83f88712f 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/AggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/AggregationBuilder.java @@ -9,14 +9,14 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.NamedWriteable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.query.QueryRewriteContext; import org.elasticsearch.index.query.Rewriteable; import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator; import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator.PipelineTree; import org.elasticsearch.search.aggregations.support.AggregationContext; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collection; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/Aggregations.java b/server/src/main/java/org/elasticsearch/search/aggregations/Aggregations.java index ad110e118b2a2..b6ba90dc6f9d9 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/Aggregations.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/Aggregations.java @@ -9,9 +9,9 @@ import org.apache.lucene.util.SetOnce; import org.elasticsearch.common.ParsingException; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/Aggregator.java b/server/src/main/java/org/elasticsearch/search/aggregations/Aggregator.java index 57108011ee856..ef3baa6be3176 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/Aggregator.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/Aggregator.java @@ -12,13 +12,13 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.core.Releasable; import org.elasticsearch.search.aggregations.support.AggregationPath; import org.elasticsearch.search.sort.SortOrder; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Iterator; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/AggregatorFactories.java b/server/src/main/java/org/elasticsearch/search/aggregations/AggregatorFactories.java index 3246151b9e3e9..867c63393c7f0 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/AggregatorFactories.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/AggregatorFactories.java @@ -13,12 +13,7 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.NamedObjectNotFoundException; import org.elasticsearch.common.xcontent.SuggestingErrorOnUnknown; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentLocation; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.query.QueryRewriteContext; import org.elasticsearch.index.query.Rewriteable; import org.elasticsearch.search.aggregations.bucket.global.GlobalAggregationBuilder; @@ -28,6 +23,11 @@ import org.elasticsearch.search.aggregations.support.AggregationContext; import org.elasticsearch.search.aggregations.support.AggregationPath; import org.elasticsearch.search.aggregations.support.AggregationPath.PathElement; +import org.elasticsearch.xcontent.NamedObjectNotFoundException; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentLocation; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/BaseAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/BaseAggregationBuilder.java index ac4c198f370e1..77a9a09b167f5 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/BaseAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/BaseAggregationBuilder.java @@ -8,8 +8,8 @@ package org.elasticsearch.search.aggregations; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.search.aggregations.AggregatorFactories.Builder; +import org.elasticsearch.xcontent.XContentParser; import java.util.Map; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/BucketOrder.java b/server/src/main/java/org/elasticsearch/search/aggregations/BucketOrder.java index 6be4699c62c29..04dea2d8bd882 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/BucketOrder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/BucketOrder.java @@ -10,9 +10,9 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentObject; import org.elasticsearch.search.aggregations.bucket.MultiBucketsAggregation.Bucket; import org.elasticsearch.search.aggregations.support.AggregationPath; +import org.elasticsearch.xcontent.ToXContentObject; import java.io.IOException; import java.util.Arrays; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/InternalAggregation.java b/server/src/main/java/org/elasticsearch/search/aggregations/InternalAggregation.java index 36c6128803f8d..3a5933a732af3 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/InternalAggregation.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/InternalAggregation.java @@ -12,13 +12,13 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.util.BigArrays; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.rest.action.search.RestSearchAction; import org.elasticsearch.script.ScriptService; import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator; import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator.PipelineTree; import org.elasticsearch.search.aggregations.support.AggregationPath; import org.elasticsearch.tasks.TaskCancelledException; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Iterator; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/InternalOrder.java b/server/src/main/java/org/elasticsearch/search/aggregations/InternalOrder.java index 2ff631bc265c6..d0d06cdba5260 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/InternalOrder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/InternalOrder.java @@ -12,14 +12,14 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.logging.DeprecationLogger; import org.elasticsearch.common.util.Comparators; -import org.elasticsearch.common.xcontent.XContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.search.aggregations.Aggregator.BucketComparator; import org.elasticsearch.search.aggregations.bucket.MultiBucketsAggregation.Bucket; import org.elasticsearch.search.aggregations.support.AggregationPath; import org.elasticsearch.search.sort.SortOrder; +import org.elasticsearch.xcontent.XContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/MultiBucketConsumerService.java b/server/src/main/java/org/elasticsearch/search/aggregations/MultiBucketConsumerService.java index 4cb2233fab74c..047d05bd0c9d0 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/MultiBucketConsumerService.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/MultiBucketConsumerService.java @@ -13,9 +13,9 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.search.aggregations.bucket.BucketsAggregator; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.function.IntConsumer; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/ParsedAggregation.java b/server/src/main/java/org/elasticsearch/search/aggregations/ParsedAggregation.java index e12e0567c71e2..ac1d8b970cb90 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/ParsedAggregation.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/ParsedAggregation.java @@ -8,12 +8,12 @@ package org.elasticsearch.search.aggregations; -import org.elasticsearch.common.xcontent.AbstractObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentParser.Token; +import org.elasticsearch.xcontent.AbstractObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser.Token; import java.io.IOException; import java.util.Collections; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/ParsedMultiBucketAggregation.java b/server/src/main/java/org/elasticsearch/search/aggregations/ParsedMultiBucketAggregation.java index 48bd678ce5f80..dce1ac0df53ee 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/ParsedMultiBucketAggregation.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/ParsedMultiBucketAggregation.java @@ -9,12 +9,12 @@ package org.elasticsearch.search.aggregations; import org.elasticsearch.common.CheckedBiConsumer; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParserUtils; import org.elasticsearch.core.CheckedFunction; import org.elasticsearch.search.aggregations.bucket.MultiBucketsAggregation; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/PipelineAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/PipelineAggregationBuilder.java index 3f8fda7810349..dfb93fac8f96b 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/PipelineAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/PipelineAggregationBuilder.java @@ -11,7 +11,6 @@ import org.elasticsearch.action.ValidateActions; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.NamedWriteable; -import org.elasticsearch.common.xcontent.ToXContentFragment; import org.elasticsearch.index.query.QueryRewriteContext; import org.elasticsearch.index.query.Rewriteable; import org.elasticsearch.search.aggregations.AggregatorFactories.Builder; @@ -19,6 +18,7 @@ import org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramAggregationBuilder; import org.elasticsearch.search.aggregations.bucket.histogram.HistogramAggregationBuilder; import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator; +import org.elasticsearch.xcontent.ToXContentFragment; import java.io.IOException; import java.util.Collection; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/InternalSingleBucketAggregation.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/InternalSingleBucketAggregation.java index 4e5756ba869e6..afcb147c91d92 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/InternalSingleBucketAggregation.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/InternalSingleBucketAggregation.java @@ -9,12 +9,12 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.aggregations.Aggregation; import org.elasticsearch.search.aggregations.InternalAggregation; import org.elasticsearch.search.aggregations.InternalAggregations; import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator.PipelineTree; import org.elasticsearch.search.aggregations.support.AggregationPath; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/MultiBucketsAggregation.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/MultiBucketsAggregation.java index 6758dc8927ec5..10c21d4b549d8 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/MultiBucketsAggregation.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/MultiBucketsAggregation.java @@ -8,10 +8,10 @@ package org.elasticsearch.search.aggregations.bucket; -import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.search.aggregations.Aggregation; import org.elasticsearch.search.aggregations.Aggregations; import org.elasticsearch.search.aggregations.HasAggregations; +import org.elasticsearch.xcontent.ToXContent; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/ParsedSingleBucketAggregation.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/ParsedSingleBucketAggregation.java index 8d708d671ce23..9f8891fc37b8e 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/ParsedSingleBucketAggregation.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/ParsedSingleBucketAggregation.java @@ -7,12 +7,12 @@ */ package org.elasticsearch.search.aggregations.bucket; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParserUtils; import org.elasticsearch.search.aggregations.Aggregation; import org.elasticsearch.search.aggregations.Aggregations; import org.elasticsearch.search.aggregations.ParsedAggregation; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/adjacency/AdjacencyMatrixAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/adjacency/AdjacencyMatrixAggregationBuilder.java index 0e474c4e37276..527d40143850c 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/adjacency/AdjacencyMatrixAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/adjacency/AdjacencyMatrixAggregationBuilder.java @@ -11,10 +11,6 @@ import org.apache.lucene.search.BooleanQuery; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryRewriteContext; import org.elasticsearch.index.query.Rewriteable; @@ -25,6 +21,10 @@ import org.elasticsearch.search.aggregations.AggregatorFactory; import org.elasticsearch.search.aggregations.bucket.adjacency.AdjacencyMatrixAggregator.KeyedFilter; import org.elasticsearch.search.aggregations.support.AggregationContext; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/adjacency/AdjacencyMatrixAggregator.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/adjacency/AdjacencyMatrixAggregator.java index b7e25985bffc5..7d151869ba7af 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/adjacency/AdjacencyMatrixAggregator.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/adjacency/AdjacencyMatrixAggregator.java @@ -15,11 +15,6 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.lucene.Lucene; -import org.elasticsearch.common.xcontent.ObjectParser.NamedObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.search.aggregations.Aggregator; import org.elasticsearch.search.aggregations.AggregatorFactories; @@ -30,6 +25,11 @@ import org.elasticsearch.search.aggregations.LeafBucketCollectorBase; import org.elasticsearch.search.aggregations.bucket.BucketsAggregator; import org.elasticsearch.search.aggregations.support.AggregationContext; +import org.elasticsearch.xcontent.ObjectParser.NamedObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/adjacency/InternalAdjacencyMatrix.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/adjacency/InternalAdjacencyMatrix.java index 0cae5b815246a..4a3c7615707ea 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/adjacency/InternalAdjacencyMatrix.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/adjacency/InternalAdjacencyMatrix.java @@ -10,10 +10,10 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.aggregations.InternalAggregation; import org.elasticsearch.search.aggregations.InternalAggregations; import org.elasticsearch.search.aggregations.InternalMultiBucketAggregation; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/adjacency/ParsedAdjacencyMatrix.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/adjacency/ParsedAdjacencyMatrix.java index 0833f7c5064f8..c962a31afae7b 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/adjacency/ParsedAdjacencyMatrix.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/adjacency/ParsedAdjacencyMatrix.java @@ -8,9 +8,9 @@ package org.elasticsearch.search.aggregations.bucket.adjacency; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.search.aggregations.ParsedMultiBucketAggregation; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.HashMap; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/CompositeAggregation.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/CompositeAggregation.java index 9531fab37bf3f..96b1fb77da4e3 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/CompositeAggregation.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/CompositeAggregation.java @@ -8,8 +8,8 @@ package org.elasticsearch.search.aggregations.bucket.composite; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.aggregations.bucket.MultiBucketsAggregation; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/CompositeAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/CompositeAggregationBuilder.java index 614a0a84aa1a0..b2065e655df1a 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/CompositeAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/CompositeAggregationBuilder.java @@ -10,9 +10,6 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.aggregations.AbstractAggregationBuilder; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.AggregatorFactories; @@ -21,6 +18,9 @@ import org.elasticsearch.search.aggregations.bucket.nested.NestedAggregatorFactory; import org.elasticsearch.search.aggregations.support.AggregationContext; import org.elasticsearch.search.aggregations.support.ValuesSourceRegistry; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.ArrayList; @@ -30,7 +30,7 @@ import java.util.Objects; import java.util.Set; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; public class CompositeAggregationBuilder extends AbstractAggregationBuilder { public static final String NAME = "composite"; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/CompositeValuesSourceBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/CompositeValuesSourceBuilder.java index 3441a11f68fb6..980fa1ca45517 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/CompositeValuesSourceBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/CompositeValuesSourceBuilder.java @@ -12,8 +12,6 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.script.Script; import org.elasticsearch.search.aggregations.support.AggregationContext; import org.elasticsearch.search.aggregations.support.ValueType; @@ -22,6 +20,8 @@ import org.elasticsearch.search.aggregations.support.ValuesSourceRegistry; import org.elasticsearch.search.aggregations.support.ValuesSourceType; import org.elasticsearch.search.sort.SortOrder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.time.ZoneId; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/CompositeValuesSourceParserHelper.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/CompositeValuesSourceParserHelper.java index 1c4a55935f5f3..b362f9421f35b 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/CompositeValuesSourceParserHelper.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/CompositeValuesSourceParserHelper.java @@ -12,14 +12,14 @@ import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.AbstractObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContent.Params; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.script.Script; import org.elasticsearch.search.aggregations.support.ValueType; +import org.elasticsearch.xcontent.AbstractObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContent.Params; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/DateHistogramValuesSourceBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/DateHistogramValuesSourceBuilder.java index e3a46f11bf9e1..7468af95b053c 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/DateHistogramValuesSourceBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/DateHistogramValuesSourceBuilder.java @@ -14,10 +14,6 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.util.BigArrays; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.core.TimeValue; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.script.Script; @@ -33,6 +29,10 @@ import org.elasticsearch.search.aggregations.support.ValuesSourceRegistry; import org.elasticsearch.search.aggregations.support.ValuesSourceType; import org.elasticsearch.search.sort.SortOrder; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.time.ZoneId; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/GeoTileGridValuesSourceBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/GeoTileGridValuesSourceBuilder.java index df4429abe4aff..b799cc0475b02 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/GeoTileGridValuesSourceBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/GeoTileGridValuesSourceBuilder.java @@ -14,10 +14,6 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.util.BigArrays; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.bucket.geogrid.GeoTileCellIdSource; @@ -29,6 +25,10 @@ import org.elasticsearch.search.aggregations.support.ValuesSourceRegistry; import org.elasticsearch.search.aggregations.support.ValuesSourceType; import org.elasticsearch.search.sort.SortOrder; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/HistogramValuesSourceBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/HistogramValuesSourceBuilder.java index 358a3b4195611..cdd4906058c84 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/HistogramValuesSourceBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/HistogramValuesSourceBuilder.java @@ -12,9 +12,6 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.util.BigArrays; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.search.aggregations.bucket.histogram.Histogram; import org.elasticsearch.search.aggregations.support.CoreValuesSourceType; @@ -23,6 +20,9 @@ import org.elasticsearch.search.aggregations.support.ValuesSourceRegistry; import org.elasticsearch.search.aggregations.support.ValuesSourceType; import org.elasticsearch.search.sort.SortOrder; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/InternalComposite.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/InternalComposite.java index 566579b318b18..2db84e849baa2 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/InternalComposite.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/InternalComposite.java @@ -13,13 +13,13 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.Aggregations; import org.elasticsearch.search.aggregations.InternalAggregation; import org.elasticsearch.search.aggregations.InternalAggregations; import org.elasticsearch.search.aggregations.InternalMultiBucketAggregation; import org.elasticsearch.search.aggregations.KeyComparable; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.AbstractMap; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/ParsedComposite.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/ParsedComposite.java index 576460ad89324..0c3ec9a521b8e 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/ParsedComposite.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/ParsedComposite.java @@ -8,11 +8,11 @@ package org.elasticsearch.search.aggregations.bucket.composite; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.search.aggregations.ParsedMultiBucketAggregation; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/TermsValuesSourceBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/TermsValuesSourceBuilder.java index 6529abc5f8902..5cdaf788f5a05 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/TermsValuesSourceBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/TermsValuesSourceBuilder.java @@ -13,9 +13,6 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.util.BigArrays; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.script.Script; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.support.CoreValuesSourceType; @@ -24,6 +21,9 @@ import org.elasticsearch.search.aggregations.support.ValuesSourceRegistry; import org.elasticsearch.search.aggregations.support.ValuesSourceType; import org.elasticsearch.search.sort.SortOrder; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/filter/FilterAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/filter/FilterAggregationBuilder.java index 7d9c778f27353..8c18496471bd1 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/filter/FilterAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/filter/FilterAggregationBuilder.java @@ -10,8 +10,6 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryRewriteContext; import org.elasticsearch.index.query.Rewriteable; @@ -20,6 +18,8 @@ import org.elasticsearch.search.aggregations.AggregatorFactories; import org.elasticsearch.search.aggregations.AggregatorFactory; import org.elasticsearch.search.aggregations.support.AggregationContext; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Map; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/filter/FiltersAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/filter/FiltersAggregationBuilder.java index 271ce7ccf5a04..ace97c341325c 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/filter/FiltersAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/filter/FiltersAggregationBuilder.java @@ -11,9 +11,6 @@ import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryRewriteContext; import org.elasticsearch.index.query.Rewriteable; @@ -23,6 +20,9 @@ import org.elasticsearch.search.aggregations.AggregatorFactory; import org.elasticsearch.search.aggregations.bucket.filter.FiltersAggregator.KeyedFilter; import org.elasticsearch.search.aggregations.support.AggregationContext; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/filter/FiltersAggregator.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/filter/FiltersAggregator.java index 2de7ae21ce493..4553e2e18aa5b 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/filter/FiltersAggregator.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/filter/FiltersAggregator.java @@ -14,9 +14,6 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.core.CheckedFunction; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.search.aggregations.Aggregator; @@ -29,6 +26,9 @@ import org.elasticsearch.search.aggregations.bucket.BucketsAggregator; import org.elasticsearch.search.aggregations.bucket.DocCountProvider; import org.elasticsearch.search.aggregations.support.AggregationContext; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/filter/InternalFilters.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/filter/InternalFilters.java index 8c7481f586a63..633ae98223fdb 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/filter/InternalFilters.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/filter/InternalFilters.java @@ -10,10 +10,10 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.aggregations.InternalAggregation; import org.elasticsearch.search.aggregations.InternalAggregations; import org.elasticsearch.search.aggregations.InternalMultiBucketAggregation; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/filter/ParsedFilter.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/filter/ParsedFilter.java index 3c9be814fc6f6..32957cee586b4 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/filter/ParsedFilter.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/filter/ParsedFilter.java @@ -7,8 +7,8 @@ */ package org.elasticsearch.search.aggregations.bucket.filter; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.search.aggregations.bucket.ParsedSingleBucketAggregation; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/filter/ParsedFilters.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/filter/ParsedFilters.java index 8827c29f5dbe4..a8442bc6306c1 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/filter/ParsedFilters.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/filter/ParsedFilters.java @@ -8,13 +8,13 @@ package org.elasticsearch.search.aggregations.bucket.filter; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParserUtils; import org.elasticsearch.search.aggregations.Aggregation; import org.elasticsearch.search.aggregations.Aggregations; import org.elasticsearch.search.aggregations.ParsedMultiBucketAggregation; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/filter/QueryToFilterAdapter.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/filter/QueryToFilterAdapter.java index 6375ed4268be5..370a312e96b9f 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/filter/QueryToFilterAdapter.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/filter/QueryToFilterAdapter.java @@ -29,8 +29,8 @@ import org.apache.lucene.util.Bits; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.lucene.Lucene; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.aggregations.Aggregator; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.function.BiConsumer; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/GeoGridAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/GeoGridAggregationBuilder.java index f1c7bed70de09..6ae49de2f1d35 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/GeoGridAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/GeoGridAggregationBuilder.java @@ -14,10 +14,6 @@ import org.elasticsearch.common.geo.GeoPoint; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.search.aggregations.AggregatorFactories.Builder; import org.elasticsearch.search.aggregations.AggregatorFactory; import org.elasticsearch.search.aggregations.bucket.BucketUtils; @@ -27,6 +23,10 @@ import org.elasticsearch.search.aggregations.support.ValuesSourceAggregatorFactory; import org.elasticsearch.search.aggregations.support.ValuesSourceConfig; import org.elasticsearch.search.aggregations.support.ValuesSourceType; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Map; @@ -59,14 +59,14 @@ public static ObjectParser crea parser.declareField( (p, builder, context) -> builder.precision(precisionParser.parse(p)), FIELD_PRECISION, - org.elasticsearch.common.xcontent.ObjectParser.ValueType.INT + org.elasticsearch.xcontent.ObjectParser.ValueType.INT ); parser.declareInt(GeoGridAggregationBuilder::size, FIELD_SIZE); parser.declareInt(GeoGridAggregationBuilder::shardSize, FIELD_SHARD_SIZE); parser.declareField( (p, builder, context) -> { builder.setGeoBoundingBox(GeoBoundingBox.parseBoundingBox(p)); }, GeoBoundingBox.BOUNDS_FIELD, - org.elasticsearch.common.xcontent.ObjectParser.ValueType.OBJECT + org.elasticsearch.xcontent.ObjectParser.ValueType.OBJECT ); return parser; } diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/GeoHashGridAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/GeoHashGridAggregationBuilder.java index 30b285983e176..e0145b9a2fc4a 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/GeoHashGridAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/GeoHashGridAggregationBuilder.java @@ -11,7 +11,6 @@ import org.elasticsearch.common.geo.GeoBoundingBox; import org.elasticsearch.common.geo.GeoUtils; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.ObjectParser; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.AggregatorFactories; import org.elasticsearch.search.aggregations.AggregatorFactory; @@ -20,6 +19,7 @@ import org.elasticsearch.search.aggregations.support.ValuesSourceAggregatorFactory; import org.elasticsearch.search.aggregations.support.ValuesSourceConfig; import org.elasticsearch.search.aggregations.support.ValuesSourceRegistry; +import org.elasticsearch.xcontent.ObjectParser; import java.io.IOException; import java.util.Map; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/GeoTileGridAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/GeoTileGridAggregationBuilder.java index 9fafadde559d1..98e8112e0d10d 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/GeoTileGridAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/GeoTileGridAggregationBuilder.java @@ -10,7 +10,6 @@ import org.elasticsearch.common.geo.GeoBoundingBox; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.ObjectParser; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.AggregatorFactories; import org.elasticsearch.search.aggregations.AggregatorFactory; @@ -19,6 +18,7 @@ import org.elasticsearch.search.aggregations.support.ValuesSourceAggregatorFactory; import org.elasticsearch.search.aggregations.support.ValuesSourceConfig; import org.elasticsearch.search.aggregations.support.ValuesSourceRegistry; +import org.elasticsearch.xcontent.ObjectParser; import java.io.IOException; import java.util.Map; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/GeoTileUtils.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/GeoTileUtils.java index 79dc4a90ef327..020bbe45a741d 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/GeoTileUtils.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/GeoTileUtils.java @@ -11,11 +11,11 @@ import org.apache.lucene.util.SloppyMath; import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.geo.GeoPoint; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.core.ESSloppyMath; import org.elasticsearch.geometry.Rectangle; +import org.elasticsearch.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Locale; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/InternalGeoGrid.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/InternalGeoGrid.java index 8fa631b80995e..402d937450187 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/InternalGeoGrid.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/InternalGeoGrid.java @@ -11,10 +11,10 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.util.LongObjectPagedHashMap; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.aggregations.InternalAggregation; import org.elasticsearch.search.aggregations.InternalAggregations; import org.elasticsearch.search.aggregations.InternalMultiBucketAggregation; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/InternalGeoGridBucket.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/InternalGeoGridBucket.java index 998f0cfbaa988..7662fc8a172e1 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/InternalGeoGridBucket.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/InternalGeoGridBucket.java @@ -9,11 +9,11 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.aggregations.Aggregation; import org.elasticsearch.search.aggregations.Aggregations; import org.elasticsearch.search.aggregations.InternalAggregations; import org.elasticsearch.search.aggregations.InternalMultiBucketAggregation; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/ParsedGeoGrid.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/ParsedGeoGrid.java index 74e2d28592ba1..21a0249c485e2 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/ParsedGeoGrid.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/ParsedGeoGrid.java @@ -8,10 +8,10 @@ package org.elasticsearch.search.aggregations.bucket.geogrid; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.core.CheckedFunction; import org.elasticsearch.search.aggregations.ParsedMultiBucketAggregation; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/ParsedGeoGridBucket.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/ParsedGeoGridBucket.java index ba07bae34ba1f..97e126c003170 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/ParsedGeoGridBucket.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/ParsedGeoGridBucket.java @@ -7,9 +7,9 @@ */ package org.elasticsearch.search.aggregations.bucket.geogrid; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.aggregations.Aggregation; import org.elasticsearch.search.aggregations.ParsedMultiBucketAggregation; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/ParsedGeoHashGrid.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/ParsedGeoHashGrid.java index 1b7ed8e97076f..ada6fa1e73c4a 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/ParsedGeoHashGrid.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/ParsedGeoHashGrid.java @@ -8,8 +8,8 @@ package org.elasticsearch.search.aggregations.bucket.geogrid; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/ParsedGeoHashGridBucket.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/ParsedGeoHashGridBucket.java index 64599265d28ca..c709099b56520 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/ParsedGeoHashGridBucket.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/ParsedGeoHashGridBucket.java @@ -8,7 +8,7 @@ package org.elasticsearch.search.aggregations.bucket.geogrid; import org.elasticsearch.common.geo.GeoPoint; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/ParsedGeoTileGrid.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/ParsedGeoTileGrid.java index bd3bd36f48fac..88fa9954f3281 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/ParsedGeoTileGrid.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/ParsedGeoTileGrid.java @@ -8,8 +8,8 @@ package org.elasticsearch.search.aggregations.bucket.geogrid; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/ParsedGeoTileGridBucket.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/ParsedGeoTileGridBucket.java index c8ae7e2d9eec5..e39252bc77118 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/ParsedGeoTileGridBucket.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/ParsedGeoTileGridBucket.java @@ -9,7 +9,7 @@ package org.elasticsearch.search.aggregations.bucket.geogrid; import org.elasticsearch.common.geo.GeoPoint; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/global/GlobalAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/global/GlobalAggregationBuilder.java index 5853561486b7e..95c6becd68de7 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/global/GlobalAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/global/GlobalAggregationBuilder.java @@ -10,13 +10,13 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.search.aggregations.AbstractAggregationBuilder; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.AggregatorFactories.Builder; import org.elasticsearch.search.aggregations.AggregatorFactory; import org.elasticsearch.search.aggregations.support.AggregationContext; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Map; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/global/ParsedGlobal.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/global/ParsedGlobal.java index 68ff790049f6d..7d94351ccc5a0 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/global/ParsedGlobal.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/global/ParsedGlobal.java @@ -7,8 +7,8 @@ */ package org.elasticsearch.search.aggregations.bucket.global; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.search.aggregations.bucket.ParsedSingleBucketAggregation; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/AutoDateHistogramAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/AutoDateHistogramAggregationBuilder.java index fc07566236acd..571adb02a727e 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/AutoDateHistogramAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/AutoDateHistogramAggregationBuilder.java @@ -14,9 +14,6 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.AggregatorFactories.Builder; import org.elasticsearch.search.aggregations.AggregatorFactory; @@ -28,6 +25,9 @@ import org.elasticsearch.search.aggregations.support.ValuesSourceConfig; import org.elasticsearch.search.aggregations.support.ValuesSourceRegistry; import org.elasticsearch.search.aggregations.support.ValuesSourceType; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.time.ZoneId; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/DateHistogramAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/DateHistogramAggregationBuilder.java index 754b1f957bb82..77e861793f71d 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/DateHistogramAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/DateHistogramAggregationBuilder.java @@ -12,9 +12,6 @@ import org.elasticsearch.common.Rounding; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.core.TimeValue; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.AggregatorFactories; @@ -29,6 +26,9 @@ import org.elasticsearch.search.aggregations.support.ValuesSourceConfig; import org.elasticsearch.search.aggregations.support.ValuesSourceRegistry; import org.elasticsearch.search.aggregations.support.ValuesSourceType; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.time.ZoneId; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/DateHistogramInterval.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/DateHistogramInterval.java index 1b1c8e8eb5285..895ad35de19de 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/DateHistogramInterval.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/DateHistogramInterval.java @@ -13,9 +13,9 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.core.TimeValue; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/DateIntervalWrapper.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/DateIntervalWrapper.java index c3d38bbd7a719..a7603da899af2 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/DateIntervalWrapper.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/DateIntervalWrapper.java @@ -16,13 +16,13 @@ import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.logging.DeprecationCategory; import org.elasticsearch.common.logging.DeprecationLogger; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.core.TimeValue; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.time.ZoneId; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/DoubleBounds.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/DoubleBounds.java index 9984776facd2a..43420e14abb4e 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/DoubleBounds.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/DoubleBounds.java @@ -11,17 +11,17 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.InstantiatingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.InstantiatingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * Represent hard_bounds and extended_bounds in histogram aggregations. diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/Histogram.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/Histogram.java index 950f585014d0d..834d3c10016cb 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/Histogram.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/Histogram.java @@ -7,8 +7,8 @@ */ package org.elasticsearch.search.aggregations.bucket.histogram; -import org.elasticsearch.common.xcontent.ParseField; import org.elasticsearch.search.aggregations.bucket.MultiBucketsAggregation; +import org.elasticsearch.xcontent.ParseField; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/HistogramAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/HistogramAggregationBuilder.java index 881fd9916d9c7..7e29e8d2dd11e 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/HistogramAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/HistogramAggregationBuilder.java @@ -11,9 +11,6 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.AggregatorFactories; import org.elasticsearch.search.aggregations.AggregatorFactory; @@ -27,6 +24,9 @@ import org.elasticsearch.search.aggregations.support.ValuesSourceConfig; import org.elasticsearch.search.aggregations.support.ValuesSourceRegistry; import org.elasticsearch.search.aggregations.support.ValuesSourceType; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/InternalAutoDateHistogram.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/InternalAutoDateHistogram.java index 20602d33e51e2..903dd746b7593 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/InternalAutoDateHistogram.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/InternalAutoDateHistogram.java @@ -11,7 +11,6 @@ import org.elasticsearch.common.Rounding; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.Aggregations; import org.elasticsearch.search.aggregations.InternalAggregation; @@ -21,6 +20,7 @@ import org.elasticsearch.search.aggregations.bucket.IteratorAndCurrent; import org.elasticsearch.search.aggregations.bucket.MultiBucketsAggregation; import org.elasticsearch.search.aggregations.bucket.histogram.AutoDateHistogramAggregationBuilder.RoundingInfo; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.time.Instant; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/InternalDateHistogram.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/InternalDateHistogram.java index 10dfa5cc9f687..03c6c646b26c1 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/InternalDateHistogram.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/InternalDateHistogram.java @@ -12,7 +12,6 @@ import org.elasticsearch.common.Rounding; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.Aggregations; import org.elasticsearch.search.aggregations.BucketOrder; @@ -23,6 +22,7 @@ import org.elasticsearch.search.aggregations.KeyComparable; import org.elasticsearch.search.aggregations.bucket.IteratorAndCurrent; import org.elasticsearch.search.aggregations.bucket.MultiBucketsAggregation; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.time.Instant; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/InternalHistogram.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/InternalHistogram.java index 81c631bf5c0da..b98f9a771f474 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/InternalHistogram.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/InternalHistogram.java @@ -11,7 +11,6 @@ import org.apache.lucene.util.PriorityQueue; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.Aggregations; import org.elasticsearch.search.aggregations.BucketOrder; @@ -22,6 +21,7 @@ import org.elasticsearch.search.aggregations.KeyComparable; import org.elasticsearch.search.aggregations.bucket.IteratorAndCurrent; import org.elasticsearch.search.aggregations.bucket.MultiBucketsAggregation; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/InternalVariableWidthHistogram.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/InternalVariableWidthHistogram.java index f35354abdbdb4..8c9dd09d1fee6 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/InternalVariableWidthHistogram.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/InternalVariableWidthHistogram.java @@ -11,7 +11,6 @@ import org.apache.lucene.util.PriorityQueue; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.Aggregations; import org.elasticsearch.search.aggregations.InternalAggregation; @@ -20,6 +19,7 @@ import org.elasticsearch.search.aggregations.KeyComparable; import org.elasticsearch.search.aggregations.bucket.IteratorAndCurrent; import org.elasticsearch.search.aggregations.bucket.MultiBucketsAggregation; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/LongBounds.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/LongBounds.java index fbf6246bc8cdf..c23ada5c19c4d 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/LongBounds.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/LongBounds.java @@ -12,21 +12,21 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentParser.Token; import org.elasticsearch.core.CheckedFunction; import org.elasticsearch.search.DocValueFormat; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser.Token; import java.io.IOException; import java.util.Objects; import java.util.function.LongSupplier; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * Represent hard_bounds and extended_bounds in date-histogram aggregations. diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/ParsedAutoDateHistogram.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/ParsedAutoDateHistogram.java index 0a672488c83c4..7e3b0ce9b31b4 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/ParsedAutoDateHistogram.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/ParsedAutoDateHistogram.java @@ -8,11 +8,11 @@ package org.elasticsearch.search.aggregations.bucket.histogram; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.search.aggregations.ParsedMultiBucketAggregation; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.time.Instant; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/ParsedDateHistogram.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/ParsedDateHistogram.java index 64f81918c3bf7..5445bc2126277 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/ParsedDateHistogram.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/ParsedDateHistogram.java @@ -8,10 +8,10 @@ package org.elasticsearch.search.aggregations.bucket.histogram; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.search.aggregations.ParsedMultiBucketAggregation; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.time.Instant; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/ParsedHistogram.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/ParsedHistogram.java index c628b624c0930..a0ebcb0e6d207 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/ParsedHistogram.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/ParsedHistogram.java @@ -8,9 +8,9 @@ package org.elasticsearch.search.aggregations.bucket.histogram; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.search.aggregations.ParsedMultiBucketAggregation; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/ParsedVariableWidthHistogram.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/ParsedVariableWidthHistogram.java index c1ec1b4699542..cc29ce21c2507 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/ParsedVariableWidthHistogram.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/ParsedVariableWidthHistogram.java @@ -8,13 +8,13 @@ package org.elasticsearch.search.aggregations.bucket.histogram; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParserUtils; import org.elasticsearch.search.aggregations.Aggregation; import org.elasticsearch.search.aggregations.Aggregations; import org.elasticsearch.search.aggregations.ParsedMultiBucketAggregation; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/VariableWidthHistogramAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/VariableWidthHistogramAggregationBuilder.java index 002bb1c3b68ef..6cd3425934b22 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/VariableWidthHistogramAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/VariableWidthHistogramAggregationBuilder.java @@ -11,9 +11,6 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.AggregatorFactories; import org.elasticsearch.search.aggregations.AggregatorFactory; @@ -25,6 +22,9 @@ import org.elasticsearch.search.aggregations.support.ValuesSourceConfig; import org.elasticsearch.search.aggregations.support.ValuesSourceRegistry; import org.elasticsearch.search.aggregations.support.ValuesSourceType; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Locale; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/missing/MissingAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/missing/MissingAggregationBuilder.java index 1140c03c55aae..24ab1dd8890b5 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/missing/MissingAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/missing/MissingAggregationBuilder.java @@ -11,8 +11,6 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.AggregatorFactories; import org.elasticsearch.search.aggregations.AggregatorFactory; @@ -23,6 +21,8 @@ import org.elasticsearch.search.aggregations.support.ValuesSourceConfig; import org.elasticsearch.search.aggregations.support.ValuesSourceRegistry; import org.elasticsearch.search.aggregations.support.ValuesSourceType; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Map; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/missing/ParsedMissing.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/missing/ParsedMissing.java index 0279dbcfd32cf..f5065be55eb75 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/missing/ParsedMissing.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/missing/ParsedMissing.java @@ -7,8 +7,8 @@ */ package org.elasticsearch.search.aggregations.bucket.missing; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.search.aggregations.bucket.ParsedSingleBucketAggregation; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/nested/NestedAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/nested/NestedAggregationBuilder.java index 437e62b129ab5..363fec62c135f 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/nested/NestedAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/nested/NestedAggregationBuilder.java @@ -11,8 +11,6 @@ import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.mapper.NestedObjectMapper; import org.elasticsearch.index.mapper.ObjectMapper; import org.elasticsearch.search.aggregations.AbstractAggregationBuilder; @@ -21,6 +19,8 @@ import org.elasticsearch.search.aggregations.AggregatorFactories.Builder; import org.elasticsearch.search.aggregations.AggregatorFactory; import org.elasticsearch.search.aggregations.support.AggregationContext; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Map; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/nested/NestedAggregator.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/nested/NestedAggregator.java index 7ee4484c69b7f..7e443bf2574bc 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/nested/NestedAggregator.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/nested/NestedAggregator.java @@ -22,7 +22,6 @@ import org.apache.lucene.search.join.BitSetProducer; import org.apache.lucene.util.BitSet; import org.elasticsearch.common.lucene.search.Queries; -import org.elasticsearch.common.xcontent.ParseField; import org.elasticsearch.index.mapper.NestedObjectMapper; import org.elasticsearch.search.aggregations.Aggregator; import org.elasticsearch.search.aggregations.AggregatorFactories; @@ -33,6 +32,7 @@ import org.elasticsearch.search.aggregations.bucket.BucketsAggregator; import org.elasticsearch.search.aggregations.bucket.SingleBucketAggregator; import org.elasticsearch.search.aggregations.support.AggregationContext; +import org.elasticsearch.xcontent.ParseField; import java.io.IOException; import java.util.Map; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/nested/ParsedNested.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/nested/ParsedNested.java index e7c55e1b3baf1..fadd915720a92 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/nested/ParsedNested.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/nested/ParsedNested.java @@ -7,8 +7,8 @@ */ package org.elasticsearch.search.aggregations.bucket.nested; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.search.aggregations.bucket.ParsedSingleBucketAggregation; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/nested/ParsedReverseNested.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/nested/ParsedReverseNested.java index 9ed658dec8972..f356d2d431259 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/nested/ParsedReverseNested.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/nested/ParsedReverseNested.java @@ -7,8 +7,8 @@ */ package org.elasticsearch.search.aggregations.bucket.nested; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.search.aggregations.bucket.ParsedSingleBucketAggregation; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/nested/ReverseNestedAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/nested/ReverseNestedAggregationBuilder.java index bb18a00102398..f49f0d4410211 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/nested/ReverseNestedAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/nested/ReverseNestedAggregationBuilder.java @@ -11,8 +11,6 @@ import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.mapper.NestedObjectMapper; import org.elasticsearch.index.mapper.ObjectMapper; import org.elasticsearch.index.query.support.NestedScope; @@ -22,6 +20,8 @@ import org.elasticsearch.search.aggregations.AggregatorFactories.Builder; import org.elasticsearch.search.aggregations.AggregatorFactory; import org.elasticsearch.search.aggregations.support.AggregationContext; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Map; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/nested/ReverseNestedAggregator.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/nested/ReverseNestedAggregator.java index 1e7df769ca6b6..b0250c3df0427 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/nested/ReverseNestedAggregator.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/nested/ReverseNestedAggregator.java @@ -15,7 +15,6 @@ import org.apache.lucene.search.join.BitSetProducer; import org.apache.lucene.util.BitSet; import org.elasticsearch.common.lucene.search.Queries; -import org.elasticsearch.common.xcontent.ParseField; import org.elasticsearch.index.mapper.NestedObjectMapper; import org.elasticsearch.search.aggregations.Aggregator; import org.elasticsearch.search.aggregations.AggregatorFactories; @@ -26,6 +25,7 @@ import org.elasticsearch.search.aggregations.bucket.BucketsAggregator; import org.elasticsearch.search.aggregations.bucket.SingleBucketAggregator; import org.elasticsearch.search.aggregations.support.AggregationContext; +import org.elasticsearch.xcontent.ParseField; import java.io.IOException; import java.util.Map; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/AbstractRangeBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/AbstractRangeBuilder.java index c5d15de4927a3..bb1cf6afebd69 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/AbstractRangeBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/AbstractRangeBuilder.java @@ -12,11 +12,11 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.aggregations.AggregatorFactories; import org.elasticsearch.search.aggregations.bucket.range.RangeAggregator.Range; import org.elasticsearch.search.aggregations.support.ValuesSourceAggregationBuilder; import org.elasticsearch.search.aggregations.support.ValuesSourceType; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/DateRangeAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/DateRangeAggregationBuilder.java index cfb1914ce21d3..91677120a155e 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/DateRangeAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/DateRangeAggregationBuilder.java @@ -11,7 +11,6 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.logging.DeprecationCategory; import org.elasticsearch.common.logging.DeprecationLogger; -import org.elasticsearch.common.xcontent.ObjectParser; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.Aggregator; @@ -24,6 +23,7 @@ import org.elasticsearch.search.aggregations.support.ValuesSourceConfig; import org.elasticsearch.search.aggregations.support.ValuesSourceRegistry; import org.elasticsearch.search.aggregations.support.ValuesSourceType; +import org.elasticsearch.xcontent.ObjectParser; import java.io.IOException; import java.time.ZonedDateTime; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/GeoDistanceAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/GeoDistanceAggregationBuilder.java index 2a6a7bc5edd68..baac21ebd754a 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/GeoDistanceAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/GeoDistanceAggregationBuilder.java @@ -14,11 +14,6 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.unit.DistanceUnit; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentParser.Token; import org.elasticsearch.common.xcontent.XContentParserUtils; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.AggregatorFactories.Builder; @@ -30,6 +25,11 @@ import org.elasticsearch.search.aggregations.support.ValuesSourceConfig; import org.elasticsearch.search.aggregations.support.ValuesSourceRegistry; import org.elasticsearch.search.aggregations.support.ValuesSourceType; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser.Token; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/InternalBinaryRange.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/InternalBinaryRange.java index 9ac3840104c1e..6ec329eb0ec74 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/InternalBinaryRange.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/InternalBinaryRange.java @@ -11,12 +11,12 @@ import org.apache.lucene.util.BytesRef; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.Aggregations; import org.elasticsearch.search.aggregations.InternalAggregation; import org.elasticsearch.search.aggregations.InternalAggregations; import org.elasticsearch.search.aggregations.InternalMultiBucketAggregation; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/InternalRange.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/InternalRange.java index b23e60b3ff571..2a9bc1aaecadc 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/InternalRange.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/InternalRange.java @@ -9,7 +9,6 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.InternalAggregation; import org.elasticsearch.search.aggregations.InternalAggregations; @@ -17,6 +16,7 @@ import org.elasticsearch.search.aggregations.support.CoreValuesSourceType; import org.elasticsearch.search.aggregations.support.ValueType; import org.elasticsearch.search.aggregations.support.ValuesSourceType; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/IpRangeAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/IpRangeAggregationBuilder.java index f361c3f9f420c..573c0d8e4d6b0 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/IpRangeAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/IpRangeAggregationBuilder.java @@ -13,12 +13,6 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.network.InetAddresses; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentParser.Token; import org.elasticsearch.core.Tuple; import org.elasticsearch.script.Script; import org.elasticsearch.search.aggregations.AggregationBuilder; @@ -31,6 +25,12 @@ import org.elasticsearch.search.aggregations.support.ValuesSourceConfig; import org.elasticsearch.search.aggregations.support.ValuesSourceRegistry; import org.elasticsearch.search.aggregations.support.ValuesSourceType; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser.Token; import java.io.IOException; import java.net.InetAddress; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/ParsedBinaryRange.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/ParsedBinaryRange.java index b4920fc23e7d0..db9a7301db790 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/ParsedBinaryRange.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/ParsedBinaryRange.java @@ -8,13 +8,13 @@ package org.elasticsearch.search.aggregations.bucket.range; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParserUtils; import org.elasticsearch.search.aggregations.Aggregation; import org.elasticsearch.search.aggregations.Aggregations; import org.elasticsearch.search.aggregations.ParsedMultiBucketAggregation; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/ParsedDateRange.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/ParsedDateRange.java index 590cd1777342c..8ba02ebd031f4 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/ParsedDateRange.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/ParsedDateRange.java @@ -8,8 +8,8 @@ package org.elasticsearch.search.aggregations.bucket.range; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.time.Instant; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/ParsedGeoDistance.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/ParsedGeoDistance.java index 8d354bf6cc43e..62d63712f3695 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/ParsedGeoDistance.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/ParsedGeoDistance.java @@ -8,8 +8,8 @@ package org.elasticsearch.search.aggregations.bucket.range; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/ParsedRange.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/ParsedRange.java index beecb4e2b953d..499b8c3e4f039 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/ParsedRange.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/ParsedRange.java @@ -8,14 +8,14 @@ package org.elasticsearch.search.aggregations.bucket.range; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParserUtils; import org.elasticsearch.core.CheckedFunction; import org.elasticsearch.search.aggregations.Aggregation; import org.elasticsearch.search.aggregations.Aggregations; import org.elasticsearch.search.aggregations.ParsedMultiBucketAggregation; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/RangeAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/RangeAggregationBuilder.java index e82c382ab92e2..c35dda2b4cf26 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/RangeAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/RangeAggregationBuilder.java @@ -9,7 +9,6 @@ package org.elasticsearch.search.aggregations.bucket.range; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.ObjectParser; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.AggregatorFactories; @@ -20,6 +19,7 @@ import org.elasticsearch.search.aggregations.support.ValuesSourceAggregationBuilder; import org.elasticsearch.search.aggregations.support.ValuesSourceConfig; import org.elasticsearch.search.aggregations.support.ValuesSourceRegistry; +import org.elasticsearch.xcontent.ObjectParser; import java.io.IOException; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/RangeAggregator.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/RangeAggregator.java index 55c20e4eeaea9..2b79c959793cf 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/RangeAggregator.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/RangeAggregator.java @@ -13,13 +13,6 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ContextParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.core.CheckedFunction; import org.elasticsearch.index.fielddata.SortedNumericDoubleValues; import org.elasticsearch.index.mapper.DateFieldMapper.DateFieldType; @@ -44,6 +37,13 @@ import org.elasticsearch.search.aggregations.support.ValuesSource; import org.elasticsearch.search.aggregations.support.ValuesSource.Numeric; import org.elasticsearch.search.aggregations.support.ValuesSourceConfig; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ContextParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; @@ -52,7 +52,7 @@ import java.util.Objects; import java.util.function.BiConsumer; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * Aggregator for {@code range}. There are two known subclasses, diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/sampler/DiversifiedAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/sampler/DiversifiedAggregationBuilder.java index 3f1356eaba448..b9ffa6ccd302c 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/sampler/DiversifiedAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/sampler/DiversifiedAggregationBuilder.java @@ -10,8 +10,6 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.AggregatorFactories.Builder; import org.elasticsearch.search.aggregations.AggregatorFactory; @@ -22,6 +20,8 @@ import org.elasticsearch.search.aggregations.support.ValuesSourceConfig; import org.elasticsearch.search.aggregations.support.ValuesSourceRegistry; import org.elasticsearch.search.aggregations.support.ValuesSourceType; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Map; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/sampler/ParsedSampler.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/sampler/ParsedSampler.java index 47ce73b2d114d..3d29205a91b15 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/sampler/ParsedSampler.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/sampler/ParsedSampler.java @@ -7,8 +7,8 @@ */ package org.elasticsearch.search.aggregations.bucket.sampler; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.search.aggregations.bucket.ParsedSingleBucketAggregation; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/sampler/SamplerAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/sampler/SamplerAggregationBuilder.java index cf34888a30371..a8731d82d085b 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/sampler/SamplerAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/sampler/SamplerAggregationBuilder.java @@ -11,13 +11,13 @@ import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.search.aggregations.AbstractAggregationBuilder; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.AggregatorFactories.Builder; import org.elasticsearch.search.aggregations.AggregatorFactory; import org.elasticsearch.search.aggregations.support.AggregationContext; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Map; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/sampler/SamplerAggregator.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/sampler/SamplerAggregator.java index 077f2297bd048..bc920810103b1 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/sampler/SamplerAggregator.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/sampler/SamplerAggregator.java @@ -12,7 +12,6 @@ import org.apache.lucene.search.ScoreMode; import org.apache.lucene.util.RamUsageEstimator; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.ParseField; import org.elasticsearch.core.Releasables; import org.elasticsearch.search.aggregations.AggregationExecutionException; import org.elasticsearch.search.aggregations.Aggregator; @@ -24,6 +23,7 @@ import org.elasticsearch.search.aggregations.bucket.SingleBucketAggregator; import org.elasticsearch.search.aggregations.support.AggregationContext; import org.elasticsearch.search.aggregations.support.ValuesSourceConfig; +import org.elasticsearch.xcontent.ParseField; import java.io.IOException; import java.util.Arrays; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/sampler/UnmappedSampler.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/sampler/UnmappedSampler.java index 50f764437ee76..93b1d8cc0a7f9 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/sampler/UnmappedSampler.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/sampler/UnmappedSampler.java @@ -8,10 +8,10 @@ package org.elasticsearch.search.aggregations.bucket.sampler; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.aggregations.Aggregation; import org.elasticsearch.search.aggregations.InternalAggregation; import org.elasticsearch.search.aggregations.InternalAggregations; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/AbstractInternalTerms.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/AbstractInternalTerms.java index 0c603607ea750..b8acf86da819f 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/AbstractInternalTerms.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/AbstractInternalTerms.java @@ -10,7 +10,6 @@ import org.apache.lucene.util.PriorityQueue; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.aggregations.AggregationExecutionException; import org.elasticsearch.search.aggregations.BucketOrder; import org.elasticsearch.search.aggregations.DelayedBucket; @@ -20,6 +19,7 @@ import org.elasticsearch.search.aggregations.InternalOrder; import org.elasticsearch.search.aggregations.TopBucketBuilder; import org.elasticsearch.search.aggregations.bucket.IteratorAndCurrent; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/DoubleTerms.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/DoubleTerms.java index 230ac0671683c..76b34650d5db6 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/DoubleTerms.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/DoubleTerms.java @@ -9,11 +9,11 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.BucketOrder; import org.elasticsearch.search.aggregations.InternalAggregation; import org.elasticsearch.search.aggregations.InternalAggregations; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/GlobalOrdinalsStringTermsAggregator.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/GlobalOrdinalsStringTermsAggregator.java index 0b18abb98beaf..cdba34a831ad2 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/GlobalOrdinalsStringTermsAggregator.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/GlobalOrdinalsStringTermsAggregator.java @@ -18,7 +18,6 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.util.LongArray; import org.elasticsearch.common.util.LongHash; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.core.Releasable; import org.elasticsearch.core.Releasables; import org.elasticsearch.search.DocValueFormat; @@ -36,6 +35,7 @@ import org.elasticsearch.search.aggregations.bucket.terms.heuristic.SignificanceHeuristic; import org.elasticsearch.search.aggregations.support.AggregationContext; import org.elasticsearch.search.aggregations.support.ValuesSource; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Arrays; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/IncludeExclude.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/IncludeExclude.java index 035f58b8a8777..7df6d53afe877 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/IncludeExclude.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/IncludeExclude.java @@ -29,11 +29,11 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.search.DocValueFormat; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.HashSet; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/InternalMappedRareTerms.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/InternalMappedRareTerms.java index a26972509664e..76b9b744c4e1c 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/InternalMappedRareTerms.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/InternalMappedRareTerms.java @@ -14,11 +14,11 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.util.SetBackedScalingCuckooFilter; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.AggregationExecutionException; import org.elasticsearch.search.aggregations.BucketOrder; import org.elasticsearch.search.aggregations.InternalAggregation; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/InternalMappedSignificantTerms.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/InternalMappedSignificantTerms.java index 8eb9662517fc9..6a67b251320e4 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/InternalMappedSignificantTerms.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/InternalMappedSignificantTerms.java @@ -10,9 +10,9 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.bucket.terms.heuristic.SignificanceHeuristic; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Iterator; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/InternalMappedTerms.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/InternalMappedTerms.java index e42a711511d25..445ee82d982d8 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/InternalMappedTerms.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/InternalMappedTerms.java @@ -11,9 +11,9 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.BucketOrder; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/InternalRareTerms.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/InternalRareTerms.java index b453b9e0189ae..3fec16e450ee4 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/InternalRareTerms.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/InternalRareTerms.java @@ -10,7 +10,6 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.util.SetBackedScalingCuckooFilter; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.Aggregations; import org.elasticsearch.search.aggregations.BucketOrder; @@ -19,6 +18,7 @@ import org.elasticsearch.search.aggregations.InternalMultiBucketAggregation; import org.elasticsearch.search.aggregations.InternalOrder; import org.elasticsearch.search.aggregations.KeyComparable; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/InternalSignificantTerms.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/InternalSignificantTerms.java index 1f5feb9d7367f..0dbe0ddd66740 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/InternalSignificantTerms.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/InternalSignificantTerms.java @@ -9,13 +9,13 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.Aggregations; import org.elasticsearch.search.aggregations.InternalAggregation; import org.elasticsearch.search.aggregations.InternalAggregations; import org.elasticsearch.search.aggregations.InternalMultiBucketAggregation; import org.elasticsearch.search.aggregations.bucket.terms.heuristic.SignificanceHeuristic; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/InternalTerms.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/InternalTerms.java index cef41afb07346..f8fd65ff5ff10 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/InternalTerms.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/InternalTerms.java @@ -10,14 +10,14 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.Aggregations; import org.elasticsearch.search.aggregations.BucketOrder; import org.elasticsearch.search.aggregations.InternalAggregations; import org.elasticsearch.search.aggregations.InternalOrder; import org.elasticsearch.search.aggregations.KeyComparable; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/LongRareTerms.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/LongRareTerms.java index 435a89b94f924..8a27a6929f0ba 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/LongRareTerms.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/LongRareTerms.java @@ -10,10 +10,10 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.util.SetBackedScalingCuckooFilter; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.BucketOrder; import org.elasticsearch.search.aggregations.InternalAggregations; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/LongTerms.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/LongTerms.java index a10a2087902ce..a519e0246a5d6 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/LongTerms.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/LongTerms.java @@ -9,11 +9,11 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.BucketOrder; import org.elasticsearch.search.aggregations.InternalAggregation; import org.elasticsearch.search.aggregations.InternalAggregations; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/ParsedDoubleTerms.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/ParsedDoubleTerms.java index d949ebb0f91cf..d50eb0713e337 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/ParsedDoubleTerms.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/ParsedDoubleTerms.java @@ -8,9 +8,9 @@ package org.elasticsearch.search.aggregations.bucket.terms; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/ParsedLongRareTerms.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/ParsedLongRareTerms.java index 603c0685462ce..c383d27022648 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/ParsedLongRareTerms.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/ParsedLongRareTerms.java @@ -8,9 +8,9 @@ package org.elasticsearch.search.aggregations.bucket.terms; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/ParsedLongTerms.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/ParsedLongTerms.java index 1af68873961bc..2b7a2c4487c6e 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/ParsedLongTerms.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/ParsedLongTerms.java @@ -8,9 +8,9 @@ package org.elasticsearch.search.aggregations.bucket.terms; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/ParsedRareTerms.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/ParsedRareTerms.java index cee9d39ee16f3..3edf31b9ed69d 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/ParsedRareTerms.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/ParsedRareTerms.java @@ -9,14 +9,14 @@ package org.elasticsearch.search.aggregations.bucket.terms; import org.elasticsearch.common.CheckedBiConsumer; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParserUtils; import org.elasticsearch.core.CheckedFunction; import org.elasticsearch.search.aggregations.Aggregation; import org.elasticsearch.search.aggregations.Aggregations; import org.elasticsearch.search.aggregations.ParsedMultiBucketAggregation; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/ParsedSignificantLongTerms.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/ParsedSignificantLongTerms.java index 4980f70f2e50c..9f7bfb564b73f 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/ParsedSignificantLongTerms.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/ParsedSignificantLongTerms.java @@ -8,9 +8,9 @@ package org.elasticsearch.search.aggregations.bucket.terms; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/ParsedSignificantStringTerms.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/ParsedSignificantStringTerms.java index 635cfdbed9555..f2b1375b7bd94 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/ParsedSignificantStringTerms.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/ParsedSignificantStringTerms.java @@ -9,9 +9,9 @@ package org.elasticsearch.search.aggregations.bucket.terms; import org.apache.lucene.util.BytesRef; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.nio.CharBuffer; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/ParsedSignificantTerms.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/ParsedSignificantTerms.java index bbed7ab4ba2f6..c830eceab78d2 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/ParsedSignificantTerms.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/ParsedSignificantTerms.java @@ -10,15 +10,15 @@ import org.elasticsearch.common.CheckedBiConsumer; import org.elasticsearch.common.CheckedSupplier; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParserUtils; import org.elasticsearch.core.CheckedFunction; import org.elasticsearch.search.aggregations.Aggregation; import org.elasticsearch.search.aggregations.Aggregations; import org.elasticsearch.search.aggregations.ParsedMultiBucketAggregation; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/ParsedStringRareTerms.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/ParsedStringRareTerms.java index d89bcfb501e89..24923a115b27c 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/ParsedStringRareTerms.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/ParsedStringRareTerms.java @@ -9,9 +9,9 @@ package org.elasticsearch.search.aggregations.bucket.terms; import org.apache.lucene.util.BytesRef; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.nio.CharBuffer; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/ParsedStringTerms.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/ParsedStringTerms.java index c0fd24b694acd..d592e59076fed 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/ParsedStringTerms.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/ParsedStringTerms.java @@ -9,9 +9,9 @@ package org.elasticsearch.search.aggregations.bucket.terms; import org.apache.lucene.util.BytesRef; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.nio.CharBuffer; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/ParsedTerms.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/ParsedTerms.java index 4d17f9e49aba7..49a303f97453c 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/ParsedTerms.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/ParsedTerms.java @@ -9,14 +9,14 @@ package org.elasticsearch.search.aggregations.bucket.terms; import org.elasticsearch.common.CheckedBiConsumer; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParserUtils; import org.elasticsearch.core.CheckedFunction; import org.elasticsearch.search.aggregations.Aggregation; import org.elasticsearch.search.aggregations.Aggregations; import org.elasticsearch.search.aggregations.ParsedMultiBucketAggregation; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/RareTermsAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/RareTermsAggregationBuilder.java index ac21b08d40772..832b6f6180e80 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/RareTermsAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/RareTermsAggregationBuilder.java @@ -10,9 +10,6 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.AggregatorFactories; import org.elasticsearch.search.aggregations.AggregatorFactory; @@ -23,6 +20,9 @@ import org.elasticsearch.search.aggregations.support.ValuesSourceConfig; import org.elasticsearch.search.aggregations.support.ValuesSourceRegistry; import org.elasticsearch.search.aggregations.support.ValuesSourceType; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Map; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/RareTermsAggregatorFactory.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/RareTermsAggregatorFactory.java index 13a4f34306751..e238239dd5b5e 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/RareTermsAggregatorFactory.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/RareTermsAggregatorFactory.java @@ -9,7 +9,6 @@ package org.elasticsearch.search.aggregations.bucket.terms; import org.elasticsearch.common.logging.DeprecationLogger; -import org.elasticsearch.common.xcontent.ParseField; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.Aggregator; import org.elasticsearch.search.aggregations.AggregatorFactories; @@ -23,6 +22,7 @@ import org.elasticsearch.search.aggregations.support.ValuesSourceAggregatorFactory; import org.elasticsearch.search.aggregations.support.ValuesSourceConfig; import org.elasticsearch.search.aggregations.support.ValuesSourceRegistry; +import org.elasticsearch.xcontent.ParseField; import java.io.IOException; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/SignificantLongTerms.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/SignificantLongTerms.java index c39334fa38a1a..6040c5e42e841 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/SignificantLongTerms.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/SignificantLongTerms.java @@ -9,10 +9,10 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.InternalAggregations; import org.elasticsearch.search.aggregations.bucket.terms.heuristic.SignificanceHeuristic; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/SignificantStringTerms.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/SignificantStringTerms.java index 064f10757bef0..9782093401396 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/SignificantStringTerms.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/SignificantStringTerms.java @@ -10,10 +10,10 @@ import org.apache.lucene.util.BytesRef; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.InternalAggregations; import org.elasticsearch.search.aggregations.bucket.terms.heuristic.SignificanceHeuristic; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/SignificantTermsAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/SignificantTermsAggregationBuilder.java index 5fd1d4bef6b90..712c8fe92449d 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/SignificantTermsAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/SignificantTermsAggregationBuilder.java @@ -10,10 +10,6 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryRewriteContext; import org.elasticsearch.search.aggregations.AggregationBuilder; @@ -29,6 +25,10 @@ import org.elasticsearch.search.aggregations.support.ValuesSourceConfig; import org.elasticsearch.search.aggregations.support.ValuesSourceRegistry; import org.elasticsearch.search.aggregations.support.ValuesSourceType; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Map; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/SignificantTermsAggregatorFactory.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/SignificantTermsAggregatorFactory.java index 20ef055587dec..6cdf6b6e305bb 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/SignificantTermsAggregatorFactory.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/SignificantTermsAggregatorFactory.java @@ -11,7 +11,6 @@ import org.apache.lucene.index.SortedSetDocValues; import org.elasticsearch.common.logging.DeprecationCategory; import org.elasticsearch.common.logging.DeprecationLogger; -import org.elasticsearch.common.xcontent.ParseField; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.Aggregator; @@ -30,6 +29,7 @@ import org.elasticsearch.search.aggregations.support.ValuesSourceAggregatorFactory; import org.elasticsearch.search.aggregations.support.ValuesSourceConfig; import org.elasticsearch.search.aggregations.support.ValuesSourceRegistry; +import org.elasticsearch.xcontent.ParseField; import java.io.IOException; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/SignificantTextAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/SignificantTextAggregationBuilder.java index 488d2ace1c8ea..edc2c355fd0ad 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/SignificantTextAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/SignificantTextAggregationBuilder.java @@ -10,10 +10,6 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.query.AbstractQueryBuilder; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.search.aggregations.AbstractAggregationBuilder; @@ -24,6 +20,10 @@ import org.elasticsearch.search.aggregations.bucket.terms.TermsAggregator.BucketCountThresholds; import org.elasticsearch.search.aggregations.bucket.terms.heuristic.SignificanceHeuristic; import org.elasticsearch.search.aggregations.support.AggregationContext; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Arrays; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/StringRareTerms.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/StringRareTerms.java index 3b9d886ad1070..f1cdfa8bf6ac3 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/StringRareTerms.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/StringRareTerms.java @@ -11,10 +11,10 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.util.SetBackedScalingCuckooFilter; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.BucketOrder; import org.elasticsearch.search.aggregations.InternalAggregations; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/StringTerms.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/StringTerms.java index 4fb5b055e325a..b50aa2f7dc596 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/StringTerms.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/StringTerms.java @@ -10,10 +10,10 @@ import org.apache.lucene.util.BytesRef; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.BucketOrder; import org.elasticsearch.search.aggregations.InternalAggregations; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/TermsAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/TermsAggregationBuilder.java index 4c1644ec7959d..437bd9b4047ac 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/TermsAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/TermsAggregationBuilder.java @@ -11,9 +11,6 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.Aggregator.SubAggCollectionMode; import org.elasticsearch.search.aggregations.AggregatorFactories; @@ -29,6 +26,9 @@ import org.elasticsearch.search.aggregations.support.ValuesSourceConfig; import org.elasticsearch.search.aggregations.support.ValuesSourceRegistry; import org.elasticsearch.search.aggregations.support.ValuesSourceType; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/TermsAggregator.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/TermsAggregator.java index 2be52e16fcfd9..cad4afa6222f3 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/TermsAggregator.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/TermsAggregator.java @@ -12,8 +12,6 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.Aggregator; import org.elasticsearch.search.aggregations.AggregatorFactories; @@ -24,6 +22,8 @@ import org.elasticsearch.search.aggregations.bucket.nested.NestedAggregator; import org.elasticsearch.search.aggregations.support.AggregationContext; import org.elasticsearch.search.aggregations.support.AggregationPath; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Comparator; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/TermsAggregatorFactory.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/TermsAggregatorFactory.java index c6c1b194c7289..770f8e0b0edea 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/TermsAggregatorFactory.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/TermsAggregatorFactory.java @@ -12,7 +12,6 @@ import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.SortedSetDocValues; import org.apache.lucene.search.IndexSearcher; -import org.elasticsearch.common.xcontent.ParseField; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.AggregationExecutionException; import org.elasticsearch.search.aggregations.Aggregator; @@ -34,6 +33,7 @@ import org.elasticsearch.search.aggregations.support.ValuesSourceAggregatorFactory; import org.elasticsearch.search.aggregations.support.ValuesSourceConfig; import org.elasticsearch.search.aggregations.support.ValuesSourceRegistry; +import org.elasticsearch.xcontent.ParseField; import java.io.IOException; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/UnmappedRareTerms.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/UnmappedRareTerms.java index 7dcfcaf75ca4e..11a23acdb2077 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/UnmappedRareTerms.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/UnmappedRareTerms.java @@ -10,10 +10,10 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.util.SetBackedScalingCuckooFilter; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.InternalAggregation; import org.elasticsearch.search.aggregations.InternalAggregations; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Collections; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/UnmappedSignificantTerms.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/UnmappedSignificantTerms.java index 8ba548e1c147b..6ec5dc7580c73 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/UnmappedSignificantTerms.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/UnmappedSignificantTerms.java @@ -10,11 +10,11 @@ import org.apache.lucene.util.BytesRef; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.InternalAggregation; import org.elasticsearch.search.aggregations.InternalAggregations; import org.elasticsearch.search.aggregations.bucket.terms.heuristic.SignificanceHeuristic; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Iterator; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/UnmappedTerms.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/UnmappedTerms.java index ed16a441a2f79..6d7384621b378 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/UnmappedTerms.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/UnmappedTerms.java @@ -9,11 +9,11 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.BucketOrder; import org.elasticsearch.search.aggregations.InternalAggregation; import org.elasticsearch.search.aggregations.InternalAggregations; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Collections; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/heuristic/ChiSquare.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/heuristic/ChiSquare.java index 11b404de6de2e..9de061847ebfb 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/heuristic/ChiSquare.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/heuristic/ChiSquare.java @@ -9,8 +9,8 @@ package org.elasticsearch.search.aggregations.bucket.terms.heuristic; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/heuristic/GND.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/heuristic/GND.java index 86b1548b2a761..07943f176ce72 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/heuristic/GND.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/heuristic/GND.java @@ -10,12 +10,12 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class GND extends NXYSignificanceHeuristic { public static final String NAME = "gnd"; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/heuristic/JLHScore.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/heuristic/JLHScore.java index 6230963c50976..108ce52931eaa 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/heuristic/JLHScore.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/heuristic/JLHScore.java @@ -10,8 +10,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/heuristic/MutualInformation.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/heuristic/MutualInformation.java index 257f019014e87..bfc188d32bffd 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/heuristic/MutualInformation.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/heuristic/MutualInformation.java @@ -9,8 +9,8 @@ package org.elasticsearch.search.aggregations.bucket.terms.heuristic; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/heuristic/NXYSignificanceHeuristic.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/heuristic/NXYSignificanceHeuristic.java index bdfa72813ecef..b00123d80708c 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/heuristic/NXYSignificanceHeuristic.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/heuristic/NXYSignificanceHeuristic.java @@ -10,15 +10,15 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.function.BiFunction; import java.util.function.Function; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public abstract class NXYSignificanceHeuristic extends SignificanceHeuristic { diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/heuristic/PercentageScore.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/heuristic/PercentageScore.java index dc22a8e49e8f1..7c3ee3bdbc044 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/heuristic/PercentageScore.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/heuristic/PercentageScore.java @@ -11,10 +11,10 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.query.QueryShardException; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/heuristic/ScriptHeuristic.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/heuristic/ScriptHeuristic.java index 89728ae7816ba..d7c5896896ab5 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/heuristic/ScriptHeuristic.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/heuristic/ScriptHeuristic.java @@ -10,19 +10,19 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.script.Script; import org.elasticsearch.script.SignificantTermsHeuristicScoreScript; import org.elasticsearch.search.aggregations.InternalAggregation; import org.elasticsearch.search.aggregations.support.AggregationContext; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.HashMap; import java.util.Map; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; public class ScriptHeuristic extends SignificanceHeuristic { public static final String NAME = "script_heuristic"; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/heuristic/SignificanceHeuristic.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/heuristic/SignificanceHeuristic.java index cfc14069f082e..edd82bce62102 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/heuristic/SignificanceHeuristic.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/heuristic/SignificanceHeuristic.java @@ -9,10 +9,10 @@ package org.elasticsearch.search.aggregations.bucket.terms.heuristic; import org.elasticsearch.common.io.stream.NamedWriteable; -import org.elasticsearch.common.xcontent.ToXContentFragment; import org.elasticsearch.search.aggregations.InternalAggregation; import org.elasticsearch.search.aggregations.bucket.terms.SignificantTerms; import org.elasticsearch.search.aggregations.support.AggregationContext; +import org.elasticsearch.xcontent.ToXContentFragment; /** * Heuristic for that {@link SignificantTerms} uses to pick out significant terms. diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/heuristic/SignificanceHeuristicBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/heuristic/SignificanceHeuristicBuilder.java index 02dcc9cbbbada..9f68a8c89a3df 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/heuristic/SignificanceHeuristicBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/heuristic/SignificanceHeuristicBuilder.java @@ -8,6 +8,6 @@ package org.elasticsearch.search.aggregations.bucket.terms.heuristic; -import org.elasticsearch.common.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.ToXContentFragment; public interface SignificanceHeuristicBuilder extends ToXContentFragment {} diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/AbstractInternalHDRPercentiles.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/AbstractInternalHDRPercentiles.java index bf45092acd2ed..f8f1ff0649446 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/AbstractInternalHDRPercentiles.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/AbstractInternalHDRPercentiles.java @@ -11,9 +11,9 @@ import org.HdrHistogram.DoubleHistogram; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.InternalAggregation; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.nio.ByteBuffer; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/AbstractInternalTDigestPercentiles.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/AbstractInternalTDigestPercentiles.java index a4fd0a5d37009..bd85adcbebff5 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/AbstractInternalTDigestPercentiles.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/AbstractInternalTDigestPercentiles.java @@ -10,9 +10,9 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.InternalAggregation; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Arrays; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/AbstractPercentilesAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/AbstractPercentilesAggregationBuilder.java index 9ec9b52c89939..1e5a710d3b560 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/AbstractPercentilesAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/AbstractPercentilesAggregationBuilder.java @@ -12,13 +12,13 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.core.Nullable; import org.elasticsearch.search.aggregations.AggregatorFactories; import org.elasticsearch.search.aggregations.support.ValuesSource; import org.elasticsearch.search.aggregations.support.ValuesSourceAggregationBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Arrays; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/AvgAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/AvgAggregationBuilder.java index 8b7f17d31f33c..d1e99d7a61018 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/AvgAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/AvgAggregationBuilder.java @@ -10,8 +10,6 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.AggregatorFactories; import org.elasticsearch.search.aggregations.AggregatorFactory; @@ -22,6 +20,8 @@ import org.elasticsearch.search.aggregations.support.ValuesSourceConfig; import org.elasticsearch.search.aggregations.support.ValuesSourceRegistry; import org.elasticsearch.search.aggregations.support.ValuesSourceType; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Map; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/CardinalityAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/CardinalityAggregationBuilder.java index 937ce90a8bb14..384b92100faea 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/CardinalityAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/CardinalityAggregationBuilder.java @@ -11,9 +11,6 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.AggregatorFactories; import org.elasticsearch.search.aggregations.AggregatorFactory; @@ -24,6 +21,9 @@ import org.elasticsearch.search.aggregations.support.ValuesSourceConfig; import org.elasticsearch.search.aggregations.support.ValuesSourceRegistry; import org.elasticsearch.search.aggregations.support.ValuesSourceType; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Map; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ExtendedStatsAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ExtendedStatsAggregationBuilder.java index 0a1c5ab957517..caab288ee4f9c 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ExtendedStatsAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ExtendedStatsAggregationBuilder.java @@ -10,8 +10,6 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.AggregatorFactories; import org.elasticsearch.search.aggregations.AggregatorFactory; @@ -22,6 +20,8 @@ import org.elasticsearch.search.aggregations.support.ValuesSourceConfig; import org.elasticsearch.search.aggregations.support.ValuesSourceRegistry; import org.elasticsearch.search.aggregations.support.ValuesSourceType; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Map; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ExtendedStatsAggregator.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ExtendedStatsAggregator.java index b746ab44fd0ce..6c6437a1ba9a3 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ExtendedStatsAggregator.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ExtendedStatsAggregator.java @@ -12,7 +12,6 @@ import org.elasticsearch.common.util.BigArrays; import org.elasticsearch.common.util.DoubleArray; import org.elasticsearch.common.util.LongArray; -import org.elasticsearch.common.xcontent.ParseField; import org.elasticsearch.core.Releasables; import org.elasticsearch.index.fielddata.SortedNumericDoubleValues; import org.elasticsearch.search.DocValueFormat; @@ -23,6 +22,7 @@ import org.elasticsearch.search.aggregations.support.AggregationContext; import org.elasticsearch.search.aggregations.support.ValuesSource; import org.elasticsearch.search.aggregations.support.ValuesSourceConfig; +import org.elasticsearch.xcontent.ParseField; import java.io.IOException; import java.util.Map; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/GeoBoundsAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/GeoBoundsAggregationBuilder.java index f8b5f80cd934a..b8b76fa81c83d 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/GeoBoundsAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/GeoBoundsAggregationBuilder.java @@ -10,8 +10,6 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.AggregatorFactories; import org.elasticsearch.search.aggregations.AggregatorFactory; @@ -21,6 +19,8 @@ import org.elasticsearch.search.aggregations.support.ValuesSourceConfig; import org.elasticsearch.search.aggregations.support.ValuesSourceRegistry; import org.elasticsearch.search.aggregations.support.ValuesSourceType; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Map; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/GeoBoundsAggregator.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/GeoBoundsAggregator.java index 6cf7c5f3dd856..12857c69d481d 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/GeoBoundsAggregator.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/GeoBoundsAggregator.java @@ -11,7 +11,6 @@ import org.apache.lucene.index.LeafReaderContext; import org.elasticsearch.common.geo.GeoPoint; import org.elasticsearch.common.util.DoubleArray; -import org.elasticsearch.common.xcontent.ParseField; import org.elasticsearch.core.Releasables; import org.elasticsearch.index.fielddata.MultiGeoPointValues; import org.elasticsearch.search.aggregations.Aggregator; @@ -21,6 +20,7 @@ import org.elasticsearch.search.aggregations.support.AggregationContext; import org.elasticsearch.search.aggregations.support.ValuesSource; import org.elasticsearch.search.aggregations.support.ValuesSourceConfig; +import org.elasticsearch.xcontent.ParseField; import java.io.IOException; import java.util.Map; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/GeoCentroidAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/GeoCentroidAggregationBuilder.java index e30b36bad52da..4f1a9220e70c6 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/GeoCentroidAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/GeoCentroidAggregationBuilder.java @@ -10,8 +10,6 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.AggregatorFactories; import org.elasticsearch.search.aggregations.AggregatorFactory; @@ -22,6 +20,8 @@ import org.elasticsearch.search.aggregations.support.ValuesSourceConfig; import org.elasticsearch.search.aggregations.support.ValuesSourceRegistry; import org.elasticsearch.search.aggregations.support.ValuesSourceType; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Map; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalAvg.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalAvg.java index c59b49b42f2dc..73d3374f64238 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalAvg.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalAvg.java @@ -9,9 +9,9 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.InternalAggregation; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalCardinality.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalCardinality.java index 9d29b584bc9ce..cc2e3f16718b2 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalCardinality.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalCardinality.java @@ -11,9 +11,9 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.util.BigArrays; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.InternalAggregation; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalExtendedStats.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalExtendedStats.java index 5fe9fdd94ee8f..c60ec7f87e461 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalExtendedStats.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalExtendedStats.java @@ -9,9 +9,9 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.InternalAggregation; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Collections; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalGeoBounds.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalGeoBounds.java index 088d326ec1a11..c19de43b4cc88 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalGeoBounds.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalGeoBounds.java @@ -12,8 +12,8 @@ import org.elasticsearch.common.geo.GeoPoint; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.aggregations.InternalAggregation; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalGeoCentroid.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalGeoCentroid.java index 736bd79c6e16c..25f9ee191df04 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalGeoCentroid.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalGeoCentroid.java @@ -13,9 +13,9 @@ import org.elasticsearch.common.geo.GeoPoint; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.aggregations.InternalAggregation; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalMax.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalMax.java index 24b8113711998..cb78d5bc3863a 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalMax.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalMax.java @@ -9,9 +9,9 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.InternalAggregation; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalMedianAbsoluteDeviation.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalMedianAbsoluteDeviation.java index 5494f8480ba40..5cf19686ed73e 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalMedianAbsoluteDeviation.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalMedianAbsoluteDeviation.java @@ -10,9 +10,9 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.InternalAggregation; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalMin.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalMin.java index 03dfdecd4d923..6838f9905f3ec 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalMin.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalMin.java @@ -9,9 +9,9 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.InternalAggregation; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalScriptedMetric.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalScriptedMetric.java index 1ff7c926cd433..bf2b716d49509 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalScriptedMetric.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalScriptedMetric.java @@ -12,10 +12,10 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.util.CollectionUtils; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.script.Script; import org.elasticsearch.script.ScriptedMetricAggContexts; import org.elasticsearch.search.aggregations.InternalAggregation; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalStats.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalStats.java index 6b9a87d58e5e0..aecb85250e8d9 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalStats.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalStats.java @@ -9,9 +9,9 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.InternalAggregation; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Collections; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalSum.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalSum.java index 37361a298dff6..40b18035f09fa 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalSum.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalSum.java @@ -9,9 +9,9 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.InternalAggregation; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalTopHits.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalTopHits.java index 6b94e603a0f86..9cb56fbbbf5dd 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalTopHits.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalTopHits.java @@ -17,10 +17,10 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.lucene.Lucene; import org.elasticsearch.common.lucene.search.TopDocsAndMaxScore; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.SearchHits; import org.elasticsearch.search.aggregations.InternalAggregation; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Arrays; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalValueCount.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalValueCount.java index 59274e96bbf91..ebbf1c55d5965 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalValueCount.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalValueCount.java @@ -9,8 +9,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.aggregations.InternalAggregation; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalWeightedAvg.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalWeightedAvg.java index 2f574f17e2992..e1af1cec7e920 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalWeightedAvg.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/InternalWeightedAvg.java @@ -9,9 +9,9 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.InternalAggregation; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/MaxAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/MaxAggregationBuilder.java index 99182829d32f0..4c79c427404b0 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/MaxAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/MaxAggregationBuilder.java @@ -10,8 +10,6 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.AggregatorFactories; import org.elasticsearch.search.aggregations.AggregatorFactory; @@ -22,6 +20,8 @@ import org.elasticsearch.search.aggregations.support.ValuesSourceConfig; import org.elasticsearch.search.aggregations.support.ValuesSourceRegistry; import org.elasticsearch.search.aggregations.support.ValuesSourceType; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Map; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/MedianAbsoluteDeviationAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/MedianAbsoluteDeviationAggregationBuilder.java index 6a2dbf55f6eac..e43c61400cb35 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/MedianAbsoluteDeviationAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/MedianAbsoluteDeviationAggregationBuilder.java @@ -10,9 +10,6 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.AggregatorFactories; import org.elasticsearch.search.aggregations.AggregatorFactory; @@ -25,6 +22,9 @@ import org.elasticsearch.search.aggregations.support.ValuesSourceConfig; import org.elasticsearch.search.aggregations.support.ValuesSourceRegistry; import org.elasticsearch.search.aggregations.support.ValuesSourceType; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Map; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/MinAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/MinAggregationBuilder.java index b50904545476c..6c47fd5364846 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/MinAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/MinAggregationBuilder.java @@ -10,8 +10,6 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.AggregatorFactories; import org.elasticsearch.search.aggregations.AggregatorFactory; @@ -22,6 +20,8 @@ import org.elasticsearch.search.aggregations.support.ValuesSourceConfig; import org.elasticsearch.search.aggregations.support.ValuesSourceRegistry; import org.elasticsearch.search.aggregations.support.ValuesSourceType; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Map; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedAvg.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedAvg.java index dcb7a0dcbb1be..346e79ddbcecf 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedAvg.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedAvg.java @@ -8,9 +8,9 @@ package org.elasticsearch.search.aggregations.metrics; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedCardinality.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedCardinality.java index f6be0d4f6a12c..9b8fdf1bde09c 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedCardinality.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedCardinality.java @@ -8,10 +8,10 @@ package org.elasticsearch.search.aggregations.metrics; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.search.aggregations.ParsedAggregation; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedExtendedStats.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedExtendedStats.java index 22bb3d2340a30..9bb1ecf2d8202 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedExtendedStats.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedExtendedStats.java @@ -8,21 +8,21 @@ package org.elasticsearch.search.aggregations.metrics; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.search.aggregations.metrics.InternalExtendedStats.Fields; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class ParsedExtendedStats extends ParsedStats implements ExtendedStats { diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedGeoBounds.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedGeoBounds.java index 078624794e9cf..676f1a34ebb08 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedGeoBounds.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedGeoBounds.java @@ -10,13 +10,13 @@ import org.elasticsearch.common.geo.GeoBoundingBox; import org.elasticsearch.common.geo.GeoPoint; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.core.Nullable; import org.elasticsearch.core.Tuple; import org.elasticsearch.search.aggregations.ParsedAggregation; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; @@ -25,7 +25,7 @@ import static org.elasticsearch.common.geo.GeoBoundingBox.LAT_FIELD; import static org.elasticsearch.common.geo.GeoBoundingBox.LON_FIELD; import static org.elasticsearch.common.geo.GeoBoundingBox.TOP_LEFT_FIELD; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; public class ParsedGeoBounds extends ParsedAggregation implements GeoBounds { diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedGeoCentroid.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedGeoCentroid.java index ac1f881cf4d8e..03563d408b6ff 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedGeoCentroid.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedGeoCentroid.java @@ -9,11 +9,11 @@ package org.elasticsearch.search.aggregations.metrics; import org.elasticsearch.common.geo.GeoPoint; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.search.aggregations.ParsedAggregation; import org.elasticsearch.search.aggregations.metrics.InternalGeoCentroid.Fields; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedHDRPercentileRanks.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedHDRPercentileRanks.java index 84a54b3295ce8..593df3b032cee 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedHDRPercentileRanks.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedHDRPercentileRanks.java @@ -8,8 +8,8 @@ package org.elasticsearch.search.aggregations.metrics; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Iterator; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedHDRPercentiles.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedHDRPercentiles.java index b56fc98b306ee..79a8d840f1fba 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedHDRPercentiles.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedHDRPercentiles.java @@ -8,8 +8,8 @@ package org.elasticsearch.search.aggregations.metrics; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.stream.Collectors; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedMax.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedMax.java index 673fd18b8c0c9..460308db0a8b5 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedMax.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedMax.java @@ -8,9 +8,9 @@ package org.elasticsearch.search.aggregations.metrics; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedMedianAbsoluteDeviation.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedMedianAbsoluteDeviation.java index e7f10cd27e7a5..6d1794ab57ba2 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedMedianAbsoluteDeviation.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedMedianAbsoluteDeviation.java @@ -8,9 +8,9 @@ package org.elasticsearch.search.aggregations.metrics; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedMin.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedMin.java index 7c0d2873d0d1b..b8d3cb70aa666 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedMin.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedMin.java @@ -8,9 +8,9 @@ package org.elasticsearch.search.aggregations.metrics; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedPercentiles.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedPercentiles.java index e75026257a1cd..91c7b1e3224ac 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedPercentiles.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedPercentiles.java @@ -8,10 +8,10 @@ package org.elasticsearch.search.aggregations.metrics; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.search.aggregations.ParsedAggregation; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.HashMap; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedScriptedMetric.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedScriptedMetric.java index 4ee11228510cc..4d9946ed9f98f 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedScriptedMetric.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedScriptedMetric.java @@ -9,12 +9,12 @@ package org.elasticsearch.search.aggregations.metrics; import org.elasticsearch.common.bytes.BytesArray; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentParser.Token; import org.elasticsearch.search.aggregations.ParsedAggregation; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser.Token; import java.io.IOException; import java.util.Collections; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedSingleValueNumericMetricsAggregation.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedSingleValueNumericMetricsAggregation.java index e34e3631992e2..ddb8b9f6f97af 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedSingleValueNumericMetricsAggregation.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedSingleValueNumericMetricsAggregation.java @@ -7,9 +7,9 @@ */ package org.elasticsearch.search.aggregations.metrics; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; import org.elasticsearch.search.aggregations.ParsedAggregation; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; public abstract class ParsedSingleValueNumericMetricsAggregation extends ParsedAggregation implements diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedStats.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedStats.java index adfd0c1c67c2d..52de1ea23156a 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedStats.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedStats.java @@ -8,14 +8,14 @@ package org.elasticsearch.search.aggregations.metrics; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.search.aggregations.ParsedAggregation; import org.elasticsearch.search.aggregations.metrics.InternalStats.Fields; import org.elasticsearch.search.aggregations.metrics.InternalStats.Metrics; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.HashMap; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedSum.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedSum.java index 206e3e7c6903c..363fdf0a63b7a 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedSum.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedSum.java @@ -8,9 +8,9 @@ package org.elasticsearch.search.aggregations.metrics; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedTDigestPercentileRanks.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedTDigestPercentileRanks.java index a0d295e40a2f6..d2ed1630578d4 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedTDigestPercentileRanks.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedTDigestPercentileRanks.java @@ -8,8 +8,8 @@ package org.elasticsearch.search.aggregations.metrics; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Iterator; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedTDigestPercentiles.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedTDigestPercentiles.java index e814ce27d3989..40fc15285823b 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedTDigestPercentiles.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedTDigestPercentiles.java @@ -8,8 +8,8 @@ package org.elasticsearch.search.aggregations.metrics; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.stream.Collectors; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedTopHits.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedTopHits.java index 230e6c63d76f1..0ab953cdacd2c 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedTopHits.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedTopHits.java @@ -8,12 +8,12 @@ package org.elasticsearch.search.aggregations.metrics; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.search.SearchHits; import org.elasticsearch.search.aggregations.ParsedAggregation; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedValueCount.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedValueCount.java index 819bf729341dd..39f96efcef81c 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedValueCount.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedValueCount.java @@ -8,10 +8,10 @@ package org.elasticsearch.search.aggregations.metrics; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.search.aggregations.ParsedAggregation; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedWeightedAvg.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedWeightedAvg.java index d3e744b91590a..090c7b15ff195 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedWeightedAvg.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ParsedWeightedAvg.java @@ -8,9 +8,9 @@ package org.elasticsearch.search.aggregations.metrics; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/PercentileRanksAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/PercentileRanksAggregationBuilder.java index f0b4c3191ffd6..b0addd861c578 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/PercentileRanksAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/PercentileRanksAggregationBuilder.java @@ -9,8 +9,6 @@ package org.elasticsearch.search.aggregations.metrics; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ParseField; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.AggregatorFactories; import org.elasticsearch.search.aggregations.AggregatorFactory; @@ -20,6 +18,8 @@ import org.elasticsearch.search.aggregations.support.ValuesSourceConfig; import org.elasticsearch.search.aggregations.support.ValuesSourceRegistry; import org.elasticsearch.search.aggregations.support.ValuesSourceType; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ParseField; import java.io.IOException; import java.util.Map; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/PercentilesAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/PercentilesAggregationBuilder.java index ccef0cb313238..f3604e41e59fc 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/PercentilesAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/PercentilesAggregationBuilder.java @@ -9,8 +9,6 @@ package org.elasticsearch.search.aggregations.metrics; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ParseField; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.AggregatorFactories; import org.elasticsearch.search.aggregations.AggregatorFactory; @@ -20,6 +18,8 @@ import org.elasticsearch.search.aggregations.support.ValuesSourceConfig; import org.elasticsearch.search.aggregations.support.ValuesSourceRegistry; import org.elasticsearch.search.aggregations.support.ValuesSourceType; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ParseField; import java.io.IOException; import java.util.Arrays; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/PercentilesConfig.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/PercentilesConfig.java index 76ca4462c3ec9..d60fb69e56a63 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/PercentilesConfig.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/PercentilesConfig.java @@ -11,12 +11,12 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.Aggregator; import org.elasticsearch.search.aggregations.support.AggregationContext; import org.elasticsearch.search.aggregations.support.ValuesSource; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Map; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/PercentilesMethod.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/PercentilesMethod.java index dc1664a368ade..a89d950a809a3 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/PercentilesMethod.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/PercentilesMethod.java @@ -11,8 +11,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ScriptedMetricAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ScriptedMetricAggregationBuilder.java index 47c64c4c9467e..818bd06ed695d 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ScriptedMetricAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ScriptedMetricAggregationBuilder.java @@ -10,9 +10,6 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.script.Script; import org.elasticsearch.script.ScriptedMetricAggContexts; import org.elasticsearch.search.aggregations.AbstractAggregationBuilder; @@ -20,13 +17,16 @@ import org.elasticsearch.search.aggregations.AggregatorFactories.Builder; import org.elasticsearch.search.aggregations.AggregatorFactory; import org.elasticsearch.search.aggregations.support.AggregationContext; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Collections; import java.util.Map; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; public class ScriptedMetricAggregationBuilder extends AbstractAggregationBuilder { public static final String NAME = "scripted_metric"; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/StatsAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/StatsAggregationBuilder.java index de6af088a28dd..64e54f37b2f02 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/StatsAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/StatsAggregationBuilder.java @@ -10,8 +10,6 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.AggregatorFactories; import org.elasticsearch.search.aggregations.AggregatorFactory; @@ -22,6 +20,8 @@ import org.elasticsearch.search.aggregations.support.ValuesSourceConfig; import org.elasticsearch.search.aggregations.support.ValuesSourceRegistry; import org.elasticsearch.search.aggregations.support.ValuesSourceType; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Map; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/SumAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/SumAggregationBuilder.java index 0cfc96ab1051f..9bc74f57cee0b 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/SumAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/SumAggregationBuilder.java @@ -10,8 +10,6 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.AggregatorFactories; import org.elasticsearch.search.aggregations.AggregatorFactory; @@ -22,6 +20,8 @@ import org.elasticsearch.search.aggregations.support.ValuesSourceConfig; import org.elasticsearch.search.aggregations.support.ValuesSourceRegistry; import org.elasticsearch.search.aggregations.support.ValuesSourceType; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Map; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/TopHitsAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/TopHitsAggregationBuilder.java index c40ddfb49536a..d9e1ead5022fc 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/TopHitsAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/TopHitsAggregationBuilder.java @@ -13,8 +13,6 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.core.Nullable; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.script.FieldScript; @@ -37,6 +35,8 @@ import org.elasticsearch.search.sort.SortBuilder; import org.elasticsearch.search.sort.SortBuilders; import org.elasticsearch.search.sort.SortOrder; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ValueCountAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ValueCountAggregationBuilder.java index 2d8864cb71168..f74777539624c 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ValueCountAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/ValueCountAggregationBuilder.java @@ -11,8 +11,6 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.AggregatorFactories; import org.elasticsearch.search.aggregations.AggregatorFactory; @@ -23,6 +21,8 @@ import org.elasticsearch.search.aggregations.support.ValuesSourceConfig; import org.elasticsearch.search.aggregations.support.ValuesSourceRegistry; import org.elasticsearch.search.aggregations.support.ValuesSourceType; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Map; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/WeightedAvgAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/WeightedAvgAggregationBuilder.java index 22e67d7fbc849..fe6997ad35fde 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/WeightedAvgAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/WeightedAvgAggregationBuilder.java @@ -10,10 +10,6 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.AggregationBuilder; @@ -29,6 +25,10 @@ import org.elasticsearch.search.aggregations.support.ValuesSourceConfig; import org.elasticsearch.search.aggregations.support.ValuesSourceRegistry; import org.elasticsearch.search.aggregations.support.ValuesSourceType; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Map; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/AbstractPipelineAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/AbstractPipelineAggregationBuilder.java index 0e6a4e529a6e1..83bf87f168b76 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/AbstractPipelineAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/AbstractPipelineAggregationBuilder.java @@ -9,9 +9,9 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.aggregations.PipelineAggregationBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Arrays; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/AvgBucketPipelineAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/AvgBucketPipelineAggregationBuilder.java index d997cfe7ef580..5b9e26276b99e 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/AvgBucketPipelineAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/AvgBucketPipelineAggregationBuilder.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Map; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/BucketHelpers.java b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/BucketHelpers.java index 29e2d6f8438d3..6a49fae9a3886 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/BucketHelpers.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/BucketHelpers.java @@ -13,14 +13,14 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentLocation; import org.elasticsearch.search.aggregations.AggregationExecutionException; import org.elasticsearch.search.aggregations.InternalMultiBucketAggregation; import org.elasticsearch.search.aggregations.InvalidAggregationPathException; import org.elasticsearch.search.aggregations.bucket.MultiBucketsAggregation; import org.elasticsearch.search.aggregations.metrics.InternalNumericMetricsAggregation; import org.elasticsearch.search.aggregations.support.AggregationPath; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentLocation; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/BucketMetricsParser.java b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/BucketMetricsParser.java index 5377b0d7ab6b0..f6fef132f2f82 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/BucketMetricsParser.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/BucketMetricsParser.java @@ -9,9 +9,9 @@ package org.elasticsearch.search.aggregations.pipeline; import org.elasticsearch.common.ParsingException; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.search.aggregations.pipeline.BucketHelpers.GapPolicy; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/BucketMetricsPipelineAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/BucketMetricsPipelineAggregationBuilder.java index 2bed4badffcab..fc98a782557f9 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/BucketMetricsPipelineAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/BucketMetricsPipelineAggregationBuilder.java @@ -10,11 +10,11 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.pipeline.BucketHelpers.GapPolicy; import org.elasticsearch.search.aggregations.support.AggregationPath; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Map; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/BucketScriptPipelineAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/BucketScriptPipelineAggregationBuilder.java index d581e3d46b4f7..95111ae97443c 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/BucketScriptPipelineAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/BucketScriptPipelineAggregationBuilder.java @@ -10,13 +10,13 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.script.Script; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.pipeline.BucketHelpers.GapPolicy; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collections; @@ -27,10 +27,10 @@ import java.util.Objects; import java.util.TreeMap; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; import static org.elasticsearch.search.aggregations.pipeline.PipelineAggregator.Parser.BUCKETS_PATH; import static org.elasticsearch.search.aggregations.pipeline.PipelineAggregator.Parser.FORMAT; import static org.elasticsearch.search.aggregations.pipeline.PipelineAggregator.Parser.GAP_POLICY; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; public class BucketScriptPipelineAggregationBuilder extends AbstractPipelineAggregationBuilder { public static final String NAME = "bucket_script"; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/BucketSelectorPipelineAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/BucketSelectorPipelineAggregationBuilder.java index 7a57a55c21ab3..7e66dfd00af6e 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/BucketSelectorPipelineAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/BucketSelectorPipelineAggregationBuilder.java @@ -11,10 +11,10 @@ import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.script.Script; import org.elasticsearch.search.aggregations.pipeline.BucketHelpers.GapPolicy; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/BucketSortPipelineAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/BucketSortPipelineAggregationBuilder.java index 2c1a4a0e95967..62780cfe56091 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/BucketSortPipelineAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/BucketSortPipelineAggregationBuilder.java @@ -9,15 +9,15 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.search.aggregations.pipeline.BucketHelpers.GapPolicy; import org.elasticsearch.search.builder.SearchSourceBuilder; import org.elasticsearch.search.sort.FieldSortBuilder; import org.elasticsearch.search.sort.SortBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; @@ -28,8 +28,8 @@ import java.util.Map; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; import static org.elasticsearch.search.aggregations.pipeline.PipelineAggregator.Parser.GAP_POLICY; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * Builds a pipeline aggregation that allows sorting the buckets of its parent diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/CumulativeSumPipelineAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/CumulativeSumPipelineAggregationBuilder.java index e2f6aafaa84e1..90fc593c61c96 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/CumulativeSumPipelineAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/CumulativeSumPipelineAggregationBuilder.java @@ -10,17 +10,17 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.DocValueFormat; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.List; import java.util.Map; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; import static org.elasticsearch.search.aggregations.pipeline.PipelineAggregator.Parser.FORMAT; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; public class CumulativeSumPipelineAggregationBuilder extends AbstractPipelineAggregationBuilder { public static final String NAME = "cumulative_sum"; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/DerivativePipelineAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/DerivativePipelineAggregationBuilder.java index f65bb33c77c07..f59142ad3bc1d 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/DerivativePipelineAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/DerivativePipelineAggregationBuilder.java @@ -12,14 +12,14 @@ import org.elasticsearch.common.Rounding; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.core.TimeValue; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramAggregationBuilder; import org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramInterval; import org.elasticsearch.search.aggregations.pipeline.BucketHelpers.GapPolicy; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/ExtendedStatsBucketParser.java b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/ExtendedStatsBucketParser.java index f59af1a15db4d..40a5315c9d777 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/ExtendedStatsBucketParser.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/ExtendedStatsBucketParser.java @@ -8,8 +8,8 @@ package org.elasticsearch.search.aggregations.pipeline; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Map; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/ExtendedStatsBucketPipelineAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/ExtendedStatsBucketPipelineAggregationBuilder.java index 61f4d750ef7ab..914fea8ed8bbb 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/ExtendedStatsBucketPipelineAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/ExtendedStatsBucketPipelineAggregationBuilder.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Map; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/InternalBucketMetricValue.java b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/InternalBucketMetricValue.java index 2104715d5567a..d3eaa55a826e2 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/InternalBucketMetricValue.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/InternalBucketMetricValue.java @@ -10,11 +10,11 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.InternalAggregation; import org.elasticsearch.search.aggregations.metrics.InternalNumericMetricsAggregation; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Arrays; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/InternalDerivative.java b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/InternalDerivative.java index d015d51c9709f..14a790b079dc6 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/InternalDerivative.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/InternalDerivative.java @@ -10,8 +10,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.DocValueFormat; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/InternalPercentilesBucket.java b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/InternalPercentilesBucket.java index 6a5f2620cc1e4..48e61c063a7b4 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/InternalPercentilesBucket.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/InternalPercentilesBucket.java @@ -10,12 +10,12 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.InternalAggregation; import org.elasticsearch.search.aggregations.metrics.InternalMax; import org.elasticsearch.search.aggregations.metrics.InternalNumericMetricsAggregation; import org.elasticsearch.search.aggregations.metrics.Percentile; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Arrays; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/InternalSimpleValue.java b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/InternalSimpleValue.java index c611e6ed2d40e..ae4db4682919b 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/InternalSimpleValue.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/InternalSimpleValue.java @@ -10,10 +10,10 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.InternalAggregation; import org.elasticsearch.search.aggregations.metrics.InternalNumericMetricsAggregation; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/MaxBucketPipelineAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/MaxBucketPipelineAggregationBuilder.java index a03800d6dc64c..6fadfd6b16774 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/MaxBucketPipelineAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/MaxBucketPipelineAggregationBuilder.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Map; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/MinBucketPipelineAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/MinBucketPipelineAggregationBuilder.java index 857c9487713a6..e730dc2091c38 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/MinBucketPipelineAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/MinBucketPipelineAggregationBuilder.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Map; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/MovFnPipelineAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/MovFnPipelineAggregationBuilder.java index 49ab98486f358..f4074302dd96a 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/MovFnPipelineAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/MovFnPipelineAggregationBuilder.java @@ -11,24 +11,24 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.script.Script; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.pipeline.BucketHelpers.GapPolicy; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Locale; import java.util.Map; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; import static org.elasticsearch.search.aggregations.pipeline.PipelineAggregator.Parser.BUCKETS_PATH; import static org.elasticsearch.search.aggregations.pipeline.PipelineAggregator.Parser.FORMAT; import static org.elasticsearch.search.aggregations.pipeline.PipelineAggregator.Parser.GAP_POLICY; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; public class MovFnPipelineAggregationBuilder extends AbstractPipelineAggregationBuilder { public static final String NAME = "moving_fn"; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/ParsedBucketMetricValue.java b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/ParsedBucketMetricValue.java index c921d01692f9b..03fe874b0b487 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/ParsedBucketMetricValue.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/ParsedBucketMetricValue.java @@ -8,10 +8,10 @@ package org.elasticsearch.search.aggregations.pipeline; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.search.aggregations.metrics.ParsedSingleValueNumericMetricsAggregation; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collections; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/ParsedDerivative.java b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/ParsedDerivative.java index 88e950e90a312..b227cebb3e58a 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/ParsedDerivative.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/ParsedDerivative.java @@ -8,11 +8,11 @@ package org.elasticsearch.search.aggregations.pipeline; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/ParsedExtendedStatsBucket.java b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/ParsedExtendedStatsBucket.java index 0f14e27dea111..33725e7bc3199 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/ParsedExtendedStatsBucket.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/ParsedExtendedStatsBucket.java @@ -8,9 +8,9 @@ package org.elasticsearch.search.aggregations.pipeline; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.search.aggregations.metrics.ParsedExtendedStats; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentParser; public class ParsedExtendedStatsBucket extends ParsedExtendedStats implements ExtendedStatsBucket { diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/ParsedPercentilesBucket.java b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/ParsedPercentilesBucket.java index 5f458595ade90..4c2f68e29805c 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/ParsedPercentilesBucket.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/ParsedPercentilesBucket.java @@ -8,11 +8,11 @@ package org.elasticsearch.search.aggregations.pipeline; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.search.aggregations.metrics.ParsedPercentiles; import org.elasticsearch.search.aggregations.metrics.Percentiles; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Map.Entry; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/ParsedSimpleValue.java b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/ParsedSimpleValue.java index 5b7c7ef6c8f3b..0d02ba6e5365b 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/ParsedSimpleValue.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/ParsedSimpleValue.java @@ -8,10 +8,10 @@ package org.elasticsearch.search.aggregations.pipeline; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.search.aggregations.metrics.ParsedSingleValueNumericMetricsAggregation; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/ParsedStatsBucket.java b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/ParsedStatsBucket.java index 4442aaf4cb6da..a2a784acfdb34 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/ParsedStatsBucket.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/ParsedStatsBucket.java @@ -8,9 +8,9 @@ package org.elasticsearch.search.aggregations.pipeline; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.search.aggregations.metrics.ParsedStats; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentParser; public class ParsedStatsBucket extends ParsedStats implements StatsBucket { diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/PercentilesBucketPipelineAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/PercentilesBucketPipelineAggregationBuilder.java index 48edf2829f44d..719aa3a4010f5 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/PercentilesBucketPipelineAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/PercentilesBucketPipelineAggregationBuilder.java @@ -12,9 +12,9 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Arrays; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/PipelineAggregator.java b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/PipelineAggregator.java index 090dfd73f028c..f6a0b59369806 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/PipelineAggregator.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/PipelineAggregator.java @@ -8,11 +8,11 @@ package org.elasticsearch.search.aggregations.pipeline; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.search.aggregations.InternalAggregation; import org.elasticsearch.search.aggregations.InternalAggregation.ReduceContext; import org.elasticsearch.search.aggregations.PipelineAggregationBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/SerialDiffPipelineAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/SerialDiffPipelineAggregationBuilder.java index de0d7a85a42f6..1c081c9af534a 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/SerialDiffPipelineAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/SerialDiffPipelineAggregationBuilder.java @@ -11,11 +11,11 @@ import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.pipeline.BucketHelpers.GapPolicy; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/StatsBucketPipelineAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/StatsBucketPipelineAggregationBuilder.java index 502547289e633..5ae9b7c0af671 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/StatsBucketPipelineAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/StatsBucketPipelineAggregationBuilder.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Map; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/SumBucketPipelineAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/SumBucketPipelineAggregationBuilder.java index 8914292f0a845..de36d99e3a0dc 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/SumBucketPipelineAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/SumBucketPipelineAggregationBuilder.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Map; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/support/AggregationInfo.java b/server/src/main/java/org/elasticsearch/search/aggregations/support/AggregationInfo.java index d62d1f187c5d4..9706092351c37 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/support/AggregationInfo.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/support/AggregationInfo.java @@ -10,8 +10,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.node.ReportingService; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Collections; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/support/MultiValuesSourceAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/support/MultiValuesSourceAggregationBuilder.java index e148451476742..034b23f7585fb 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/support/MultiValuesSourceAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/support/MultiValuesSourceAggregationBuilder.java @@ -9,7 +9,6 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.core.Nullable; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.search.DocValueFormat; @@ -17,6 +16,7 @@ import org.elasticsearch.search.aggregations.AggregationInitializationException; import org.elasticsearch.search.aggregations.AggregatorFactories.Builder; import org.elasticsearch.search.aggregations.AggregatorFactory; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.HashMap; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/support/MultiValuesSourceFieldConfig.java b/server/src/main/java/org/elasticsearch/search/aggregations/support/MultiValuesSourceFieldConfig.java index 2d19f73ef7ad5..2033cdacb6f46 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/support/MultiValuesSourceFieldConfig.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/support/MultiValuesSourceFieldConfig.java @@ -13,15 +13,15 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.query.AbstractQueryBuilder; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.script.Script; import org.elasticsearch.search.aggregations.AggregationBuilder; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.time.ZoneId; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/support/MultiValuesSourceParseHelper.java b/server/src/main/java/org/elasticsearch/search/aggregations/support/MultiValuesSourceParseHelper.java index 9244afa39745f..4fe17985fdc02 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/support/MultiValuesSourceParseHelper.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/support/MultiValuesSourceParseHelper.java @@ -9,10 +9,10 @@ package org.elasticsearch.search.aggregations.support; import org.elasticsearch.common.ParsingException; -import org.elasticsearch.common.xcontent.AbstractObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.AbstractObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentParser; public final class MultiValuesSourceParseHelper { diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/support/ValueType.java b/server/src/main/java/org/elasticsearch/search/aggregations/support/ValueType.java index 83bfc3cfa50e5..3a598494b58cf 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/support/ValueType.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/support/ValueType.java @@ -11,9 +11,9 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ParseField; import org.elasticsearch.index.mapper.DateFieldMapper; import org.elasticsearch.search.DocValueFormat; +import org.elasticsearch.xcontent.ParseField; import java.io.IOException; import java.time.ZoneOffset; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/support/ValuesSourceAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/support/ValuesSourceAggregationBuilder.java index fd681bbc9232a..8cbedec6bad8c 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/support/ValuesSourceAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/support/ValuesSourceAggregationBuilder.java @@ -10,16 +10,16 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.AbstractObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.script.Script; import org.elasticsearch.search.aggregations.AbstractAggregationBuilder; import org.elasticsearch.search.aggregations.AggregationInitializationException; import org.elasticsearch.search.aggregations.AggregatorFactories.Builder; import org.elasticsearch.search.aggregations.AggregatorFactory; +import org.elasticsearch.xcontent.AbstractObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.time.ZoneId; diff --git a/server/src/main/java/org/elasticsearch/search/builder/PointInTimeBuilder.java b/server/src/main/java/org/elasticsearch/search/builder/PointInTimeBuilder.java index b02c01bc55366..54ef59e85b803 100644 --- a/server/src/main/java/org/elasticsearch/search/builder/PointInTimeBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/builder/PointInTimeBuilder.java @@ -9,17 +9,17 @@ package org.elasticsearch.search.builder; import org.elasticsearch.action.search.SearchContextId; -import org.elasticsearch.common.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.ToXContentFragment; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/server/src/main/java/org/elasticsearch/search/builder/SearchSourceBuilder.java b/server/src/main/java/org/elasticsearch/search/builder/SearchSourceBuilder.java index 2d77f1a438f15..af67aeb1fd0ae 100644 --- a/server/src/main/java/org/elasticsearch/search/builder/SearchSourceBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/builder/SearchSourceBuilder.java @@ -16,13 +16,13 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.logging.DeprecationLogger; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.Booleans; import org.elasticsearch.core.Nullable; import org.elasticsearch.core.RestApiVersion; diff --git a/server/src/main/java/org/elasticsearch/search/collapse/CollapseBuilder.java b/server/src/main/java/org/elasticsearch/search/collapse/CollapseBuilder.java index fede1cd48c3f1..cf0f426f94317 100644 --- a/server/src/main/java/org/elasticsearch/search/collapse/CollapseBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/collapse/CollapseBuilder.java @@ -7,17 +7,17 @@ */ package org.elasticsearch.search.collapse; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.query.InnerHitBuilder; import org.elasticsearch.index.query.SearchExecutionContext; diff --git a/server/src/main/java/org/elasticsearch/search/fetch/FetchPhase.java b/server/src/main/java/org/elasticsearch/search/fetch/FetchPhase.java index 027c4b3e4e4d1..e5446e06261c5 100644 --- a/server/src/main/java/org/elasticsearch/search/fetch/FetchPhase.java +++ b/server/src/main/java/org/elasticsearch/search/fetch/FetchPhase.java @@ -17,7 +17,7 @@ import org.elasticsearch.common.document.DocumentField; import org.elasticsearch.common.lucene.index.SequentialStoredFieldsLeafReader; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.core.Tuple; import org.elasticsearch.index.fieldvisitor.CustomFieldsVisitor; diff --git a/server/src/main/java/org/elasticsearch/search/fetch/StoredFieldsContext.java b/server/src/main/java/org/elasticsearch/search/fetch/StoredFieldsContext.java index 8f255d67198cc..2914738bc6cb5 100644 --- a/server/src/main/java/org/elasticsearch/search/fetch/StoredFieldsContext.java +++ b/server/src/main/java/org/elasticsearch/search/fetch/StoredFieldsContext.java @@ -13,8 +13,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.rest.RestRequest; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/search/fetch/subphase/FetchSourceContext.java b/server/src/main/java/org/elasticsearch/search/fetch/subphase/FetchSourceContext.java index 4ffa77bce732f..8c8c1eda15533 100644 --- a/server/src/main/java/org/elasticsearch/search/fetch/subphase/FetchSourceContext.java +++ b/server/src/main/java/org/elasticsearch/search/fetch/subphase/FetchSourceContext.java @@ -13,10 +13,10 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.core.Booleans; import org.elasticsearch.rest.RestRequest; diff --git a/server/src/main/java/org/elasticsearch/search/fetch/subphase/FetchSourcePhase.java b/server/src/main/java/org/elasticsearch/search/fetch/subphase/FetchSourcePhase.java index 4a88d79d79953..b55f59b4d5e4b 100644 --- a/server/src/main/java/org/elasticsearch/search/fetch/subphase/FetchSourcePhase.java +++ b/server/src/main/java/org/elasticsearch/search/fetch/subphase/FetchSourcePhase.java @@ -12,8 +12,8 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.fetch.FetchContext; import org.elasticsearch.search.fetch.FetchSubPhase; diff --git a/server/src/main/java/org/elasticsearch/search/fetch/subphase/FieldAndFormat.java b/server/src/main/java/org/elasticsearch/search/fetch/subphase/FieldAndFormat.java index d2932ea09d32a..eabccce13bf41 100644 --- a/server/src/main/java/org/elasticsearch/search/fetch/subphase/FieldAndFormat.java +++ b/server/src/main/java/org/elasticsearch/search/fetch/subphase/FieldAndFormat.java @@ -13,13 +13,13 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.logging.DeprecationLogger; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.CheckedFunction; import org.elasticsearch.core.Nullable; import org.elasticsearch.core.RestApiVersion; diff --git a/server/src/main/java/org/elasticsearch/search/fetch/subphase/highlight/AbstractHighlighterBuilder.java b/server/src/main/java/org/elasticsearch/search/fetch/subphase/highlight/AbstractHighlighterBuilder.java index 6dcf8fedc5b20..27e742dcb74b1 100644 --- a/server/src/main/java/org/elasticsearch/search/fetch/subphase/highlight/AbstractHighlighterBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/fetch/subphase/highlight/AbstractHighlighterBuilder.java @@ -11,16 +11,16 @@ import org.apache.lucene.search.highlight.SimpleFragmenter; import org.apache.lucene.search.highlight.SimpleSpanFragmenter; import org.elasticsearch.Version; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.Rewriteable; import org.elasticsearch.search.fetch.subphase.highlight.HighlightBuilder.BoundaryScannerType; @@ -33,7 +33,7 @@ import java.util.Objects; import java.util.function.BiFunction; -import static org.elasticsearch.common.xcontent.ObjectParser.fromList; +import static org.elasticsearch.xcontent.ObjectParser.fromList; import static org.elasticsearch.index.query.AbstractQueryBuilder.parseInnerQueryBuilder; /** diff --git a/server/src/main/java/org/elasticsearch/search/fetch/subphase/highlight/HighlightBuilder.java b/server/src/main/java/org/elasticsearch/search/fetch/subphase/highlight/HighlightBuilder.java index fa1bbd23d3bc6..d11b3253261e6 100644 --- a/server/src/main/java/org/elasticsearch/search/fetch/subphase/highlight/HighlightBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/fetch/subphase/highlight/HighlightBuilder.java @@ -10,14 +10,14 @@ import org.apache.lucene.search.Query; import org.apache.lucene.search.vectorhighlight.SimpleBoundaryScanner; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.NamedObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ObjectParser.NamedObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryRewriteContext; import org.elasticsearch.index.query.SearchExecutionContext; @@ -36,7 +36,7 @@ import java.util.Set; import java.util.function.BiFunction; -import static org.elasticsearch.common.xcontent.ObjectParser.fromList; +import static org.elasticsearch.xcontent.ObjectParser.fromList; /** * A builder for search highlighting. Settings can control how large fields diff --git a/server/src/main/java/org/elasticsearch/search/fetch/subphase/highlight/HighlightField.java b/server/src/main/java/org/elasticsearch/search/fetch/subphase/highlight/HighlightField.java index 0fc42bb4b460b..e082bccfa8849 100644 --- a/server/src/main/java/org/elasticsearch/search/fetch/subphase/highlight/HighlightField.java +++ b/server/src/main/java/org/elasticsearch/search/fetch/subphase/highlight/HighlightField.java @@ -13,9 +13,9 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.text.Text; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/search/internal/InternalSearchResponse.java b/server/src/main/java/org/elasticsearch/search/internal/InternalSearchResponse.java index 4fa628ca3c8d7..18f220dab2594 100644 --- a/server/src/main/java/org/elasticsearch/search/internal/InternalSearchResponse.java +++ b/server/src/main/java/org/elasticsearch/search/internal/InternalSearchResponse.java @@ -12,7 +12,7 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.ToXContentFragment; import org.elasticsearch.search.SearchHits; import org.elasticsearch.search.aggregations.InternalAggregations; import org.elasticsearch.search.profile.SearchProfileResults; diff --git a/server/src/main/java/org/elasticsearch/search/lookup/SourceLookup.java b/server/src/main/java/org/elasticsearch/search/lookup/SourceLookup.java index 6f9abff7126ec..505ea16927e97 100644 --- a/server/src/main/java/org/elasticsearch/search/lookup/SourceLookup.java +++ b/server/src/main/java/org/elasticsearch/search/lookup/SourceLookup.java @@ -16,7 +16,7 @@ import org.elasticsearch.core.Tuple; import org.elasticsearch.common.lucene.index.SequentialStoredFieldsLeafReader; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.index.fieldvisitor.FieldsVisitor; import org.elasticsearch.search.fetch.subphase.FetchSourceContext; diff --git a/server/src/main/java/org/elasticsearch/search/profile/ProfileResult.java b/server/src/main/java/org/elasticsearch/search/profile/ProfileResult.java index f97af9b21957f..4930b8fc521cf 100644 --- a/server/src/main/java/org/elasticsearch/search/profile/ProfileResult.java +++ b/server/src/main/java/org/elasticsearch/search/profile/ProfileResult.java @@ -13,11 +13,11 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.InstantiatingObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.InstantiatingObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.TimeValue; import java.io.IOException; @@ -28,8 +28,8 @@ import java.util.concurrent.TimeUnit; import static java.util.stream.Collectors.toMap; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * The result of a profiled *thing*, like a query or an aggregation. See diff --git a/server/src/main/java/org/elasticsearch/search/profile/SearchProfileResults.java b/server/src/main/java/org/elasticsearch/search/profile/SearchProfileResults.java index 4e7e467cf51dc..69d7117d44721 100644 --- a/server/src/main/java/org/elasticsearch/search/profile/SearchProfileResults.java +++ b/server/src/main/java/org/elasticsearch/search/profile/SearchProfileResults.java @@ -14,9 +14,9 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.profile.aggregation.AggregationProfileShardResult; import org.elasticsearch.search.profile.query.QueryProfileShardResult; diff --git a/server/src/main/java/org/elasticsearch/search/profile/SearchProfileShardResult.java b/server/src/main/java/org/elasticsearch/search/profile/SearchProfileShardResult.java index 3b67f0e27808b..11c1fd0106c7d 100644 --- a/server/src/main/java/org/elasticsearch/search/profile/SearchProfileShardResult.java +++ b/server/src/main/java/org/elasticsearch/search/profile/SearchProfileShardResult.java @@ -12,8 +12,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.core.Nullable; import org.elasticsearch.search.profile.aggregation.AggregationProfileShardResult; import org.elasticsearch.search.profile.query.QueryProfileShardResult; diff --git a/server/src/main/java/org/elasticsearch/search/profile/aggregation/AggregationProfileShardResult.java b/server/src/main/java/org/elasticsearch/search/profile/aggregation/AggregationProfileShardResult.java index aae41f023a8db..c9737ff6684ed 100644 --- a/server/src/main/java/org/elasticsearch/search/profile/aggregation/AggregationProfileShardResult.java +++ b/server/src/main/java/org/elasticsearch/search/profile/aggregation/AggregationProfileShardResult.java @@ -11,9 +11,9 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.profile.ProfileResult; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/search/profile/query/CollectorResult.java b/server/src/main/java/org/elasticsearch/search/profile/query/CollectorResult.java index cbcee72029205..29512054750f1 100644 --- a/server/src/main/java/org/elasticsearch/search/profile/query/CollectorResult.java +++ b/server/src/main/java/org/elasticsearch/search/profile/query/CollectorResult.java @@ -8,16 +8,16 @@ package org.elasticsearch.search.profile.query; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/main/java/org/elasticsearch/search/profile/query/QueryProfileShardResult.java b/server/src/main/java/org/elasticsearch/search/profile/query/QueryProfileShardResult.java index 352f48ee6589e..3ebfb8c52da8b 100644 --- a/server/src/main/java/org/elasticsearch/search/profile/query/QueryProfileShardResult.java +++ b/server/src/main/java/org/elasticsearch/search/profile/query/QueryProfileShardResult.java @@ -12,9 +12,9 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.profile.ProfileResult; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/search/rescore/QueryRescorerBuilder.java b/server/src/main/java/org/elasticsearch/search/rescore/QueryRescorerBuilder.java index d7a4ad60f4331..c4155bca17104 100644 --- a/server/src/main/java/org/elasticsearch/search/rescore/QueryRescorerBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/rescore/QueryRescorerBuilder.java @@ -8,13 +8,13 @@ package org.elasticsearch.search.rescore; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryRewriteContext; import org.elasticsearch.index.query.SearchExecutionContext; diff --git a/server/src/main/java/org/elasticsearch/search/rescore/RescorerBuilder.java b/server/src/main/java/org/elasticsearch/search/rescore/RescorerBuilder.java index c12669eae22a8..1817881be7cd9 100644 --- a/server/src/main/java/org/elasticsearch/search/rescore/RescorerBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/rescore/RescorerBuilder.java @@ -8,15 +8,15 @@ package org.elasticsearch.search.rescore; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.NamedWriteable; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.query.SearchExecutionContext; import org.elasticsearch.index.query.Rewriteable; diff --git a/server/src/main/java/org/elasticsearch/search/searchafter/SearchAfterBuilder.java b/server/src/main/java/org/elasticsearch/search/searchafter/SearchAfterBuilder.java index a03907163854b..345ae73f03047 100644 --- a/server/src/main/java/org/elasticsearch/search/searchafter/SearchAfterBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/searchafter/SearchAfterBuilder.java @@ -14,17 +14,17 @@ import org.apache.lucene.search.SortedSetSortField; import org.elasticsearch.ElasticsearchException; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.text.Text; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.fielddata.IndexFieldData; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.sort.SortAndFormats; diff --git a/server/src/main/java/org/elasticsearch/search/slice/SliceBuilder.java b/server/src/main/java/org/elasticsearch/search/slice/SliceBuilder.java index e383111fc5a70..62cf22d2b36ad 100644 --- a/server/src/main/java/org/elasticsearch/search/slice/SliceBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/slice/SliceBuilder.java @@ -16,11 +16,11 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.Nullable; import org.elasticsearch.index.fielddata.IndexFieldData; import org.elasticsearch.index.fielddata.IndexNumericFieldData; diff --git a/server/src/main/java/org/elasticsearch/search/sort/FieldSortBuilder.java b/server/src/main/java/org/elasticsearch/search/sort/FieldSortBuilder.java index b6bba8b9c2ef2..d711cb4aa46ad 100644 --- a/server/src/main/java/org/elasticsearch/search/sort/FieldSortBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/sort/FieldSortBuilder.java @@ -17,16 +17,16 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.Version; import org.elasticsearch.common.ParsingException; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.time.DateMathParser; import org.elasticsearch.common.time.DateUtils; import org.elasticsearch.common.util.BigArrays; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.IndexSortConfig; import org.elasticsearch.index.fielddata.IndexFieldData; import org.elasticsearch.index.fielddata.IndexFieldData.XFieldComparatorSource.Nested; @@ -672,7 +672,7 @@ public String getWriteableName() { /** * Creates a new {@link FieldSortBuilder} from the query held by the {@link XContentParser} in - * {@link org.elasticsearch.common.xcontent.XContent} format. + * {@link org.elasticsearch.xcontent.XContent} format. * * @param parser the input parser. The state on the parser contained in this context will be changed as a side effect of this * method call diff --git a/server/src/main/java/org/elasticsearch/search/sort/GeoDistanceSortBuilder.java b/server/src/main/java/org/elasticsearch/search/sort/GeoDistanceSortBuilder.java index 92608968de245..d89c34692acf3 100644 --- a/server/src/main/java/org/elasticsearch/search/sort/GeoDistanceSortBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/sort/GeoDistanceSortBuilder.java @@ -20,7 +20,7 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.Version; import org.elasticsearch.common.logging.DeprecationLogger; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.geo.GeoDistance; import org.elasticsearch.common.geo.GeoPoint; @@ -29,9 +29,9 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.unit.DistanceUnit; import org.elasticsearch.common.util.BigArrays; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentParser.Token; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser.Token; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.index.fielddata.FieldData; import org.elasticsearch.index.fielddata.IndexFieldData; @@ -380,7 +380,7 @@ public int hashCode() { /** * Creates a new {@link GeoDistanceSortBuilder} from the query held by the {@link XContentParser} in - * {@link org.elasticsearch.common.xcontent.XContent} format. + * {@link org.elasticsearch.xcontent.XContent} format. * * @param parser the input parser. The state on the parser contained in this context will be changed as a * side effect of this method call diff --git a/server/src/main/java/org/elasticsearch/search/sort/NestedSortBuilder.java b/server/src/main/java/org/elasticsearch/search/sort/NestedSortBuilder.java index c09c900ab85bd..2f13eeecb7a7b 100644 --- a/server/src/main/java/org/elasticsearch/search/sort/NestedSortBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/sort/NestedSortBuilder.java @@ -8,13 +8,13 @@ package org.elasticsearch.search.sort; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryRewriteContext; diff --git a/server/src/main/java/org/elasticsearch/search/sort/ScoreSortBuilder.java b/server/src/main/java/org/elasticsearch/search/sort/ScoreSortBuilder.java index 06d9e430e0551..f438224ec9ca6 100644 --- a/server/src/main/java/org/elasticsearch/search/sort/ScoreSortBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/sort/ScoreSortBuilder.java @@ -14,9 +14,9 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.util.BigArrays; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.query.QueryRewriteContext; import org.elasticsearch.index.query.SearchExecutionContext; import org.elasticsearch.search.DocValueFormat; @@ -67,7 +67,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws /** * Creates a new {@link ScoreSortBuilder} from the query held by the {@link XContentParser} in - * {@link org.elasticsearch.common.xcontent.XContent} format. + * {@link org.elasticsearch.xcontent.XContent} format. * * @param parser the input parser. The state on the parser contained in this context will be changed as a side effect of this * method call diff --git a/server/src/main/java/org/elasticsearch/search/sort/ScriptSortBuilder.java b/server/src/main/java/org/elasticsearch/search/sort/ScriptSortBuilder.java index 1c4738165f815..f91c653500e27 100644 --- a/server/src/main/java/org/elasticsearch/search/sort/ScriptSortBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/sort/ScriptSortBuilder.java @@ -16,15 +16,15 @@ import org.apache.lucene.util.BytesRefBuilder; import org.elasticsearch.Version; import org.elasticsearch.common.ParsingException; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.util.BigArrays; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.fielddata.AbstractBinaryDocValues; import org.elasticsearch.index.fielddata.FieldData; import org.elasticsearch.index.fielddata.IndexFieldData; @@ -50,7 +50,7 @@ import java.util.Locale; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; import static org.elasticsearch.search.sort.FieldSortBuilder.validateMaxChildrenExistOnlyInTopLevelNestedSort; import static org.elasticsearch.search.sort.NestedSortBuilder.NESTED_FIELD; @@ -225,7 +225,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params builderParams) /** * Creates a new {@link ScriptSortBuilder} from the query held by the {@link XContentParser} in - * {@link org.elasticsearch.common.xcontent.XContent} format. + * {@link org.elasticsearch.xcontent.XContent} format. * * @param parser the input parser. The state on the parser contained in this context will be changed as a side effect of this * method call diff --git a/server/src/main/java/org/elasticsearch/search/sort/SortBuilder.java b/server/src/main/java/org/elasticsearch/search/sort/SortBuilder.java index 7964de6ecd29c..9297fb36aee09 100644 --- a/server/src/main/java/org/elasticsearch/search/sort/SortBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/sort/SortBuilder.java @@ -12,14 +12,14 @@ import org.apache.lucene.search.Sort; import org.apache.lucene.search.SortField; import org.apache.lucene.search.join.ToChildBlockJoinQuery; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.NamedWriteable; import org.elasticsearch.common.lucene.search.Queries; import org.elasticsearch.common.util.BigArrays; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.index.fielddata.IndexFieldData.XFieldComparatorSource.Nested; import org.elasticsearch.index.mapper.NestedObjectMapper; diff --git a/server/src/main/java/org/elasticsearch/search/sort/SortValue.java b/server/src/main/java/org/elasticsearch/search/sort/SortValue.java index 890c61e9bd55e..f1272bbd7acba 100644 --- a/server/src/main/java/org/elasticsearch/search/sort/SortValue.java +++ b/server/src/main/java/org/elasticsearch/search/sort/SortValue.java @@ -14,7 +14,7 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.search.DocValueFormat; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/search/suggest/Suggest.java b/server/src/main/java/org/elasticsearch/search/suggest/Suggest.java index 21dfa3f47e7a1..eb55b67247e5f 100644 --- a/server/src/main/java/org/elasticsearch/search/suggest/Suggest.java +++ b/server/src/main/java/org/elasticsearch/search/suggest/Suggest.java @@ -10,7 +10,7 @@ import org.apache.lucene.util.CollectionUtil; import org.apache.lucene.util.SetOnce; import org.elasticsearch.core.CheckedFunction; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.NamedWriteable; @@ -18,10 +18,10 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.text.Text; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParserUtils; import org.elasticsearch.rest.action.search.RestSearchAction; import org.elasticsearch.search.aggregations.Aggregation; diff --git a/server/src/main/java/org/elasticsearch/search/suggest/SuggestBuilder.java b/server/src/main/java/org/elasticsearch/search/suggest/SuggestBuilder.java index d982f570ac37a..d65dfe01da258 100644 --- a/server/src/main/java/org/elasticsearch/search/suggest/SuggestBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/suggest/SuggestBuilder.java @@ -8,16 +8,16 @@ package org.elasticsearch.search.suggest; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.lucene.BytesRefs; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.query.SearchExecutionContext; import org.elasticsearch.search.suggest.SuggestionSearchContext.SuggestionContext; diff --git a/server/src/main/java/org/elasticsearch/search/suggest/SuggestionBuilder.java b/server/src/main/java/org/elasticsearch/search/suggest/SuggestionBuilder.java index 282b1eb209d21..bae79e30a51bd 100644 --- a/server/src/main/java/org/elasticsearch/search/suggest/SuggestionBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/suggest/SuggestionBuilder.java @@ -10,15 +10,15 @@ import org.apache.lucene.analysis.Analyzer; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.NamedWriteable; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.lucene.BytesRefs; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.query.SearchExecutionContext; import org.elasticsearch.search.suggest.SuggestionSearchContext.SuggestionContext; diff --git a/server/src/main/java/org/elasticsearch/search/suggest/completion/CompletionStats.java b/server/src/main/java/org/elasticsearch/search/suggest/completion/CompletionStats.java index 6ae50c49f10f4..2d28ff02341c8 100644 --- a/server/src/main/java/org/elasticsearch/search/suggest/completion/CompletionStats.java +++ b/server/src/main/java/org/elasticsearch/search/suggest/completion/CompletionStats.java @@ -13,8 +13,8 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/search/suggest/completion/CompletionSuggestion.java b/server/src/main/java/org/elasticsearch/search/suggest/completion/CompletionSuggestion.java index f01af488709fb..bd98ea6b782b8 100644 --- a/server/src/main/java/org/elasticsearch/search/suggest/completion/CompletionSuggestion.java +++ b/server/src/main/java/org/elasticsearch/search/suggest/completion/CompletionSuggestion.java @@ -10,14 +10,14 @@ import org.apache.lucene.analysis.CharArraySet; import org.apache.lucene.search.ScoreDoc; import org.apache.lucene.util.PriorityQueue; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.lucene.Lucene; import org.elasticsearch.common.text.Text; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.suggest.Suggest; import org.elasticsearch.search.suggest.Suggest.Suggestion; diff --git a/server/src/main/java/org/elasticsearch/search/suggest/completion/CompletionSuggestionBuilder.java b/server/src/main/java/org/elasticsearch/search/suggest/completion/CompletionSuggestionBuilder.java index 3ec4ba4bbdc05..5c12ed123149f 100644 --- a/server/src/main/java/org/elasticsearch/search/suggest/completion/CompletionSuggestionBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/suggest/completion/CompletionSuggestionBuilder.java @@ -8,20 +8,20 @@ package org.elasticsearch.search.suggest.completion; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.unit.Fuzziness; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.mapper.CompletionFieldMapper; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.query.SearchExecutionContext; diff --git a/server/src/main/java/org/elasticsearch/search/suggest/completion/FuzzyOptions.java b/server/src/main/java/org/elasticsearch/search/suggest/completion/FuzzyOptions.java index 9db5efaa449fb..281e17d608b6e 100644 --- a/server/src/main/java/org/elasticsearch/search/suggest/completion/FuzzyOptions.java +++ b/server/src/main/java/org/elasticsearch/search/suggest/completion/FuzzyOptions.java @@ -10,15 +10,15 @@ import org.apache.lucene.search.suggest.document.FuzzyCompletionQuery; import org.apache.lucene.util.automaton.Operations; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.unit.Fuzziness; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/server/src/main/java/org/elasticsearch/search/suggest/completion/RegexOptions.java b/server/src/main/java/org/elasticsearch/search/suggest/completion/RegexOptions.java index ba3ae909200c2..e7c23531f6199 100644 --- a/server/src/main/java/org/elasticsearch/search/suggest/completion/RegexOptions.java +++ b/server/src/main/java/org/elasticsearch/search/suggest/completion/RegexOptions.java @@ -11,14 +11,14 @@ import org.apache.lucene.util.automaton.Operations; import org.apache.lucene.util.automaton.RegExp; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.query.RegexpFlag; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/search/suggest/completion/context/CategoryContextMapping.java b/server/src/main/java/org/elasticsearch/search/suggest/completion/context/CategoryContextMapping.java index 03cd4b46fd0f2..97281d4cca2d7 100644 --- a/server/src/main/java/org/elasticsearch/search/suggest/completion/context/CategoryContextMapping.java +++ b/server/src/main/java/org/elasticsearch/search/suggest/completion/context/CategoryContextMapping.java @@ -13,9 +13,9 @@ import org.apache.lucene.document.StoredField; import org.apache.lucene.index.IndexableField; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentParser.Token; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser.Token; import org.elasticsearch.index.mapper.DocumentParserContext; import org.elasticsearch.index.mapper.KeywordFieldMapper; import org.elasticsearch.index.mapper.LuceneDocument; diff --git a/server/src/main/java/org/elasticsearch/search/suggest/completion/context/CategoryQueryContext.java b/server/src/main/java/org/elasticsearch/search/suggest/completion/context/CategoryQueryContext.java index 6dd28825eafd7..480986cb534cc 100644 --- a/server/src/main/java/org/elasticsearch/search/suggest/completion/context/CategoryQueryContext.java +++ b/server/src/main/java/org/elasticsearch/search/suggest/completion/context/CategoryQueryContext.java @@ -8,12 +8,12 @@ package org.elasticsearch.search.suggest.completion.context; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/server/src/main/java/org/elasticsearch/search/suggest/completion/context/ContextMapping.java b/server/src/main/java/org/elasticsearch/search/suggest/completion/context/ContextMapping.java index dc0d71079d123..6b7e76b671ec8 100644 --- a/server/src/main/java/org/elasticsearch/search/suggest/completion/context/ContextMapping.java +++ b/server/src/main/java/org/elasticsearch/search/suggest/completion/context/ContextMapping.java @@ -11,12 +11,12 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.Version; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentParser.Token; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser.Token; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.mapper.CompletionFieldMapper; import org.elasticsearch.index.mapper.DocumentParserContext; import org.elasticsearch.index.mapper.LuceneDocument; diff --git a/server/src/main/java/org/elasticsearch/search/suggest/completion/context/ContextMappings.java b/server/src/main/java/org/elasticsearch/search/suggest/completion/context/ContextMappings.java index 9eb4cfa4abc6e..97a008e59f8cf 100644 --- a/server/src/main/java/org/elasticsearch/search/suggest/completion/context/ContextMappings.java +++ b/server/src/main/java/org/elasticsearch/search/suggest/completion/context/ContextMappings.java @@ -14,8 +14,8 @@ import org.apache.lucene.util.CharsRef; import org.apache.lucene.util.CharsRefBuilder; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.mapper.CompletionFieldMapper; import org.elasticsearch.index.mapper.LuceneDocument; import org.elasticsearch.index.mapper.MappingParser; diff --git a/server/src/main/java/org/elasticsearch/search/suggest/completion/context/GeoContextMapping.java b/server/src/main/java/org/elasticsearch/search/suggest/completion/context/GeoContextMapping.java index 700dbafd1622e..68d39e108241e 100644 --- a/server/src/main/java/org/elasticsearch/search/suggest/completion/context/GeoContextMapping.java +++ b/server/src/main/java/org/elasticsearch/search/suggest/completion/context/GeoContextMapping.java @@ -20,9 +20,9 @@ import org.elasticsearch.common.logging.DeprecationCategory; import org.elasticsearch.common.logging.DeprecationLogger; import org.elasticsearch.common.unit.DistanceUnit; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentParser.Token; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser.Token; import org.elasticsearch.index.mapper.DocumentParserContext; import org.elasticsearch.index.mapper.GeoPointFieldMapper; import org.elasticsearch.index.mapper.LuceneDocument; diff --git a/server/src/main/java/org/elasticsearch/search/suggest/completion/context/GeoQueryContext.java b/server/src/main/java/org/elasticsearch/search/suggest/completion/context/GeoQueryContext.java index 6fe4f6cde61d2..18f9158bfd518 100644 --- a/server/src/main/java/org/elasticsearch/search/suggest/completion/context/GeoQueryContext.java +++ b/server/src/main/java/org/elasticsearch/search/suggest/completion/context/GeoQueryContext.java @@ -9,13 +9,13 @@ package org.elasticsearch.search.suggest.completion.context; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.geo.GeoPoint; import org.elasticsearch.common.geo.GeoUtils; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collections; diff --git a/server/src/main/java/org/elasticsearch/search/suggest/phrase/DirectCandidateGeneratorBuilder.java b/server/src/main/java/org/elasticsearch/search/suggest/phrase/DirectCandidateGeneratorBuilder.java index bab31071cd4d5..49efffb38ec4e 100644 --- a/server/src/main/java/org/elasticsearch/search/suggest/phrase/DirectCandidateGeneratorBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/suggest/phrase/DirectCandidateGeneratorBuilder.java @@ -16,13 +16,13 @@ import org.apache.lucene.search.spell.StringDistance; import org.apache.lucene.search.spell.SuggestMode; import org.apache.lucene.util.automaton.LevenshteinAutomata; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.index.analysis.IndexAnalyzers; import org.elasticsearch.search.suggest.SortBy; import org.elasticsearch.search.suggest.phrase.PhraseSuggestionBuilder.CandidateGenerator; diff --git a/server/src/main/java/org/elasticsearch/search/suggest/phrase/Laplace.java b/server/src/main/java/org/elasticsearch/search/suggest/phrase/Laplace.java index 09ac1948749d3..b995c3dea4b8b 100644 --- a/server/src/main/java/org/elasticsearch/search/suggest/phrase/Laplace.java +++ b/server/src/main/java/org/elasticsearch/search/suggest/phrase/Laplace.java @@ -11,12 +11,12 @@ import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.Terms; import org.apache.lucene.util.BytesRef; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentParser.Token; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser.Token; import org.elasticsearch.search.suggest.phrase.WordScorer.WordScorerFactory; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/search/suggest/phrase/LinearInterpolation.java b/server/src/main/java/org/elasticsearch/search/suggest/phrase/LinearInterpolation.java index 0139526dca8c0..e49d968ec9d5d 100644 --- a/server/src/main/java/org/elasticsearch/search/suggest/phrase/LinearInterpolation.java +++ b/server/src/main/java/org/elasticsearch/search/suggest/phrase/LinearInterpolation.java @@ -11,13 +11,13 @@ import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.Terms; import org.apache.lucene.util.BytesRef; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentParser.Token; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser.Token; import org.elasticsearch.search.suggest.phrase.WordScorer.WordScorerFactory; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/search/suggest/phrase/PhraseSuggester.java b/server/src/main/java/org/elasticsearch/search/suggest/phrase/PhraseSuggester.java index 62ad74d05249d..cc7cd15c85af3 100644 --- a/server/src/main/java/org/elasticsearch/search/suggest/phrase/PhraseSuggester.java +++ b/server/src/main/java/org/elasticsearch/search/suggest/phrase/PhraseSuggester.java @@ -21,8 +21,6 @@ import org.elasticsearch.common.lucene.Lucene; import org.elasticsearch.common.text.Text; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.query.AbstractQueryBuilder; import org.elasticsearch.index.query.ParsedQuery; import org.elasticsearch.index.query.QueryBuilder; @@ -34,6 +32,8 @@ import org.elasticsearch.search.suggest.Suggester; import org.elasticsearch.search.suggest.SuggestionSearchContext.SuggestionContext; import org.elasticsearch.search.suggest.phrase.NoisyChannelSpellChecker.Result; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; import java.io.CharArrayReader; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/search/suggest/phrase/PhraseSuggestion.java b/server/src/main/java/org/elasticsearch/search/suggest/phrase/PhraseSuggestion.java index f293f39c6564a..0218fa5ff5807 100644 --- a/server/src/main/java/org/elasticsearch/search/suggest/phrase/PhraseSuggestion.java +++ b/server/src/main/java/org/elasticsearch/search/suggest/phrase/PhraseSuggestion.java @@ -8,21 +8,21 @@ package org.elasticsearch.search.suggest.phrase; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.text.Text; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.suggest.Suggest; import org.elasticsearch.search.suggest.Suggest.Suggestion; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * Suggestion entry returned from the {@link PhraseSuggester}. diff --git a/server/src/main/java/org/elasticsearch/search/suggest/phrase/PhraseSuggestionBuilder.java b/server/src/main/java/org/elasticsearch/search/suggest/phrase/PhraseSuggestionBuilder.java index f45a9f237d7ab..38a64bfb33e15 100644 --- a/server/src/main/java/org/elasticsearch/search/suggest/phrase/PhraseSuggestionBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/suggest/phrase/PhraseSuggestionBuilder.java @@ -10,16 +10,16 @@ import org.apache.lucene.analysis.Analyzer; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.lucene.BytesRefs; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentParser.Token; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser.Token; import org.elasticsearch.index.analysis.AnalyzerComponentsProvider; import org.elasticsearch.index.analysis.IndexAnalyzers; import org.elasticsearch.index.analysis.NamedAnalyzer; diff --git a/server/src/main/java/org/elasticsearch/search/suggest/phrase/SmoothingModel.java b/server/src/main/java/org/elasticsearch/search/suggest/phrase/SmoothingModel.java index 3c1195e62298c..420ed6b5914da 100644 --- a/server/src/main/java/org/elasticsearch/search/suggest/phrase/SmoothingModel.java +++ b/server/src/main/java/org/elasticsearch/search/suggest/phrase/SmoothingModel.java @@ -10,10 +10,9 @@ import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.NamedWriteable; -import org.elasticsearch.common.xcontent.ToXContent.Params; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.suggest.phrase.WordScorer.WordScorerFactory; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/search/suggest/phrase/StupidBackoff.java b/server/src/main/java/org/elasticsearch/search/suggest/phrase/StupidBackoff.java index b057bef5db6d9..f66a5191844db 100644 --- a/server/src/main/java/org/elasticsearch/search/suggest/phrase/StupidBackoff.java +++ b/server/src/main/java/org/elasticsearch/search/suggest/phrase/StupidBackoff.java @@ -11,12 +11,12 @@ import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.Terms; import org.apache.lucene.util.BytesRef; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentParser.Token; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser.Token; import org.elasticsearch.search.suggest.phrase.WordScorer.WordScorerFactory; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/search/suggest/term/TermSuggestion.java b/server/src/main/java/org/elasticsearch/search/suggest/term/TermSuggestion.java index 94ab5a840bd18..257ba6702c8ba 100644 --- a/server/src/main/java/org/elasticsearch/search/suggest/term/TermSuggestion.java +++ b/server/src/main/java/org/elasticsearch/search/suggest/term/TermSuggestion.java @@ -8,14 +8,14 @@ package org.elasticsearch.search.suggest.term; import org.elasticsearch.ElasticsearchException; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.text.Text; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.suggest.SortBy; import org.elasticsearch.search.suggest.Suggest; import org.elasticsearch.search.suggest.Suggest.Suggestion; @@ -25,7 +25,7 @@ import java.util.Comparator; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; /** * The suggestion responses corresponding with the suggestions in the request. diff --git a/server/src/main/java/org/elasticsearch/search/suggest/term/TermSuggestionBuilder.java b/server/src/main/java/org/elasticsearch/search/suggest/term/TermSuggestionBuilder.java index 0ce76488404be..73411f82a535b 100644 --- a/server/src/main/java/org/elasticsearch/search/suggest/term/TermSuggestionBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/suggest/term/TermSuggestionBuilder.java @@ -19,8 +19,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.query.SearchExecutionContext; import org.elasticsearch.search.suggest.DirectSpellcheckerSettings; import org.elasticsearch.search.suggest.SortBy; diff --git a/server/src/main/java/org/elasticsearch/snapshots/RestoreInfo.java b/server/src/main/java/org/elasticsearch/snapshots/RestoreInfo.java index 4aaf686267061..80c575a39b3a1 100644 --- a/server/src/main/java/org/elasticsearch/snapshots/RestoreInfo.java +++ b/server/src/main/java/org/elasticsearch/snapshots/RestoreInfo.java @@ -11,11 +11,11 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collections; diff --git a/server/src/main/java/org/elasticsearch/snapshots/SnapshotFeatureInfo.java b/server/src/main/java/org/elasticsearch/snapshots/SnapshotFeatureInfo.java index d5daac995001f..919dcc948ae7f 100644 --- a/server/src/main/java/org/elasticsearch/snapshots/SnapshotFeatureInfo.java +++ b/server/src/main/java/org/elasticsearch/snapshots/SnapshotFeatureInfo.java @@ -12,11 +12,11 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.List; diff --git a/server/src/main/java/org/elasticsearch/snapshots/SnapshotId.java b/server/src/main/java/org/elasticsearch/snapshots/SnapshotId.java index c534b5970d239..8a67572040116 100644 --- a/server/src/main/java/org/elasticsearch/snapshots/SnapshotId.java +++ b/server/src/main/java/org/elasticsearch/snapshots/SnapshotId.java @@ -11,8 +11,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/server/src/main/java/org/elasticsearch/snapshots/SnapshotInfo.java b/server/src/main/java/org/elasticsearch/snapshots/SnapshotInfo.java index 933f9d926b107..16222e211ad03 100644 --- a/server/src/main/java/org/elasticsearch/snapshots/SnapshotInfo.java +++ b/server/src/main/java/org/elasticsearch/snapshots/SnapshotInfo.java @@ -17,18 +17,18 @@ import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.time.DateFormatter; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParserUtils; import org.elasticsearch.core.Nullable; import org.elasticsearch.core.TimeValue; import org.elasticsearch.rest.RestStatus; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.time.Instant; diff --git a/server/src/main/java/org/elasticsearch/snapshots/SnapshotShardFailure.java b/server/src/main/java/org/elasticsearch/snapshots/SnapshotShardFailure.java index 2574a8fe3d125..d34cc0fb42e25 100644 --- a/server/src/main/java/org/elasticsearch/snapshots/SnapshotShardFailure.java +++ b/server/src/main/java/org/elasticsearch/snapshots/SnapshotShardFailure.java @@ -13,14 +13,14 @@ import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.core.Nullable; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.index.snapshots.IndexShardSnapshotFailedException; import org.elasticsearch.rest.RestStatus; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/server/src/main/java/org/elasticsearch/tasks/RawTaskStatus.java b/server/src/main/java/org/elasticsearch/tasks/RawTaskStatus.java index fe9c7c434f488..ab6dfcaf76cda 100644 --- a/server/src/main/java/org/elasticsearch/tasks/RawTaskStatus.java +++ b/server/src/main/java/org/elasticsearch/tasks/RawTaskStatus.java @@ -12,7 +12,7 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/tasks/Task.java b/server/src/main/java/org/elasticsearch/tasks/Task.java index b65669a110758..90d5474f95667 100644 --- a/server/src/main/java/org/elasticsearch/tasks/Task.java +++ b/server/src/main/java/org/elasticsearch/tasks/Task.java @@ -12,8 +12,8 @@ import org.elasticsearch.action.ActionResponse; import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.common.io.stream.NamedWriteable; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; import java.io.IOException; import java.util.Map; diff --git a/server/src/main/java/org/elasticsearch/tasks/TaskId.java b/server/src/main/java/org/elasticsearch/tasks/TaskId.java index 92b35528f8385..f9420574058f0 100644 --- a/server/src/main/java/org/elasticsearch/tasks/TaskId.java +++ b/server/src/main/java/org/elasticsearch/tasks/TaskId.java @@ -13,8 +13,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ContextParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ContextParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/tasks/TaskInfo.java b/server/src/main/java/org/elasticsearch/tasks/TaskInfo.java index 9504ffe77bbf8..696681847c425 100644 --- a/server/src/main/java/org/elasticsearch/tasks/TaskInfo.java +++ b/server/src/main/java/org/elasticsearch/tasks/TaskInfo.java @@ -8,18 +8,18 @@ package org.elasticsearch.tasks; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; import org.elasticsearch.common.xcontent.ObjectParserHelper; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collections; @@ -27,8 +27,8 @@ import java.util.Objects; import java.util.concurrent.TimeUnit; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** diff --git a/server/src/main/java/org/elasticsearch/tasks/TaskResult.java b/server/src/main/java/org/elasticsearch/tasks/TaskResult.java index 78130e05fb062..d26261208aeb8 100644 --- a/server/src/main/java/org/elasticsearch/tasks/TaskResult.java +++ b/server/src/main/java/org/elasticsearch/tasks/TaskResult.java @@ -10,18 +10,18 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.client.Requests; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.InstantiatingObjectParser; +import org.elasticsearch.xcontent.InstantiatingObjectParser; import org.elasticsearch.common.xcontent.ObjectParserHelper; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; import java.io.IOException; @@ -30,8 +30,8 @@ import static java.util.Collections.emptyMap; import static java.util.Objects.requireNonNull; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; import static org.elasticsearch.common.xcontent.XContentHelper.convertToMap; /** diff --git a/server/src/main/java/org/elasticsearch/tasks/TaskResultsService.java b/server/src/main/java/org/elasticsearch/tasks/TaskResultsService.java index 941409945d84e..6f8c0d055cee5 100644 --- a/server/src/main/java/org/elasticsearch/tasks/TaskResultsService.java +++ b/server/src/main/java/org/elasticsearch/tasks/TaskResultsService.java @@ -24,9 +24,9 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.concurrent.EsRejectedExecutionException; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.indices.SystemIndexDescriptor; import org.elasticsearch.threadpool.ThreadPool; @@ -37,7 +37,7 @@ import static org.elasticsearch.action.admin.cluster.node.tasks.get.GetTaskAction.TASKS_ORIGIN; import static org.elasticsearch.core.TimeValue.timeValueMillis; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.tasks.TaskInfo.INCLUDE_CANCELLED_PARAM; /** diff --git a/server/src/main/java/org/elasticsearch/threadpool/ThreadPool.java b/server/src/main/java/org/elasticsearch/threadpool/ThreadPool.java index d259283f57885..b19784be87829 100644 --- a/server/src/main/java/org/elasticsearch/threadpool/ThreadPool.java +++ b/server/src/main/java/org/elasticsearch/threadpool/ThreadPool.java @@ -24,8 +24,8 @@ import org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor; import org.elasticsearch.common.util.concurrent.ThreadContext; import org.elasticsearch.common.util.concurrent.XRejectedExecutionHandler; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.node.Node; import org.elasticsearch.node.ReportingService; diff --git a/server/src/main/java/org/elasticsearch/threadpool/ThreadPoolInfo.java b/server/src/main/java/org/elasticsearch/threadpool/ThreadPoolInfo.java index 37966c21248a7..9ed8832f682b8 100644 --- a/server/src/main/java/org/elasticsearch/threadpool/ThreadPoolInfo.java +++ b/server/src/main/java/org/elasticsearch/threadpool/ThreadPoolInfo.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.node.ReportingService; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/threadpool/ThreadPoolStats.java b/server/src/main/java/org/elasticsearch/threadpool/ThreadPoolStats.java index e797f0a87dae1..5c973f246307f 100644 --- a/server/src/main/java/org/elasticsearch/threadpool/ThreadPoolStats.java +++ b/server/src/main/java/org/elasticsearch/threadpool/ThreadPoolStats.java @@ -11,9 +11,9 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Collections; diff --git a/server/src/main/java/org/elasticsearch/transport/ProxyConnectionStrategy.java b/server/src/main/java/org/elasticsearch/transport/ProxyConnectionStrategy.java index 25d7c13b63920..f8c5f30a5fb1b 100644 --- a/server/src/main/java/org/elasticsearch/transport/ProxyConnectionStrategy.java +++ b/server/src/main/java/org/elasticsearch/transport/ProxyConnectionStrategy.java @@ -22,7 +22,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.transport.TransportAddress; import org.elasticsearch.common.util.concurrent.CountDown; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Collections; diff --git a/server/src/main/java/org/elasticsearch/transport/RemoteConnectionInfo.java b/server/src/main/java/org/elasticsearch/transport/RemoteConnectionInfo.java index 12d3425b8abf2..7481d4a3d75e3 100644 --- a/server/src/main/java/org/elasticsearch/transport/RemoteConnectionInfo.java +++ b/server/src/main/java/org/elasticsearch/transport/RemoteConnectionInfo.java @@ -13,8 +13,8 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Arrays; diff --git a/server/src/main/java/org/elasticsearch/transport/SniffConnectionStrategy.java b/server/src/main/java/org/elasticsearch/transport/SniffConnectionStrategy.java index f85701c4b16b4..c61ef3f967a26 100644 --- a/server/src/main/java/org/elasticsearch/transport/SniffConnectionStrategy.java +++ b/server/src/main/java/org/elasticsearch/transport/SniffConnectionStrategy.java @@ -29,7 +29,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.transport.TransportAddress; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.core.internal.io.IOUtils; import org.elasticsearch.threadpool.ThreadPool; diff --git a/server/src/main/java/org/elasticsearch/transport/TransportInfo.java b/server/src/main/java/org/elasticsearch/transport/TransportInfo.java index 4608f4c116a12..af5b15b845db1 100644 --- a/server/src/main/java/org/elasticsearch/transport/TransportInfo.java +++ b/server/src/main/java/org/elasticsearch/transport/TransportInfo.java @@ -16,7 +16,7 @@ import org.elasticsearch.common.network.InetAddresses; import org.elasticsearch.common.transport.BoundTransportAddress; import org.elasticsearch.common.transport.TransportAddress; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.node.ReportingService; import java.io.IOException; diff --git a/server/src/main/java/org/elasticsearch/transport/TransportStats.java b/server/src/main/java/org/elasticsearch/transport/TransportStats.java index 0344b4520e8e9..7caf3c241615c 100644 --- a/server/src/main/java/org/elasticsearch/transport/TransportStats.java +++ b/server/src/main/java/org/elasticsearch/transport/TransportStats.java @@ -12,8 +12,8 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; diff --git a/server/src/main/resources/META-INF/services/org.elasticsearch.common.xcontent.ErrorOnUnknown b/server/src/main/resources/META-INF/services/org.elasticsearch.xcontent.ErrorOnUnknown similarity index 100% rename from server/src/main/resources/META-INF/services/org.elasticsearch.common.xcontent.ErrorOnUnknown rename to server/src/main/resources/META-INF/services/org.elasticsearch.xcontent.ErrorOnUnknown diff --git a/server/src/main/resources/META-INF/services/org.elasticsearch.common.xcontent.XContentBuilderExtension b/server/src/main/resources/META-INF/services/org.elasticsearch.xcontent.XContentBuilderExtension similarity index 100% rename from server/src/main/resources/META-INF/services/org.elasticsearch.common.xcontent.XContentBuilderExtension rename to server/src/main/resources/META-INF/services/org.elasticsearch.xcontent.XContentBuilderExtension diff --git a/server/src/test/java/org/elasticsearch/ElasticsearchExceptionTests.java b/server/src/test/java/org/elasticsearch/ElasticsearchExceptionTests.java index 3de0f3c8cd7c5..2bcbe8305693f 100644 --- a/server/src/test/java/org/elasticsearch/ElasticsearchExceptionTests.java +++ b/server/src/test/java/org/elasticsearch/ElasticsearchExceptionTests.java @@ -25,15 +25,15 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.core.Tuple; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentLocation; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentLocation; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.Index; import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.index.query.QueryShardException; diff --git a/server/src/test/java/org/elasticsearch/ExceptionSerializationTests.java b/server/src/test/java/org/elasticsearch/ExceptionSerializationTests.java index 64f0869b17502..9880f5ba14658 100644 --- a/server/src/test/java/org/elasticsearch/ExceptionSerializationTests.java +++ b/server/src/test/java/org/elasticsearch/ExceptionSerializationTests.java @@ -46,7 +46,7 @@ import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.common.util.CancellableThreadsTests; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.XContentLocation; +import org.elasticsearch.xcontent.XContentLocation; import org.elasticsearch.env.ShardLockObtainFailedException; import org.elasticsearch.index.Index; import org.elasticsearch.index.engine.RecoveryEngineException; diff --git a/server/src/test/java/org/elasticsearch/action/DocWriteResponseTests.java b/server/src/test/java/org/elasticsearch/action/DocWriteResponseTests.java index 97cbf78685ab4..95701bff51f5c 100644 --- a/server/src/test/java/org/elasticsearch/action/DocWriteResponseTests.java +++ b/server/src/test/java/org/elasticsearch/action/DocWriteResponseTests.java @@ -12,10 +12,10 @@ import org.elasticsearch.action.support.replication.ReplicationResponse.ShardInfo; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.mapper.MapperService; import org.elasticsearch.index.seqno.SequenceNumbers; import org.elasticsearch.index.shard.ShardId; diff --git a/server/src/test/java/org/elasticsearch/action/ShardOperationFailedExceptionTests.java b/server/src/test/java/org/elasticsearch/action/ShardOperationFailedExceptionTests.java index 6e699d997ab6b..9ac512d0c92f1 100644 --- a/server/src/test/java/org/elasticsearch/action/ShardOperationFailedExceptionTests.java +++ b/server/src/test/java/org/elasticsearch/action/ShardOperationFailedExceptionTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.core.Nullable; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.test.ESTestCase; diff --git a/server/src/test/java/org/elasticsearch/action/TaskOperationFailureTests.java b/server/src/test/java/org/elasticsearch/action/TaskOperationFailureTests.java index 4ac83aa50fc82..7e235d9accb0b 100644 --- a/server/src/test/java/org/elasticsearch/action/TaskOperationFailureTests.java +++ b/server/src/test/java/org/elasticsearch/action/TaskOperationFailureTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.action; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/allocation/ClusterAllocationExplainActionTests.java b/server/src/test/java/org/elasticsearch/action/admin/cluster/allocation/ClusterAllocationExplainActionTests.java index 7fb692f273256..11ec0cdf1b722 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/allocation/ClusterAllocationExplainActionTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/cluster/allocation/ClusterAllocationExplainActionTests.java @@ -24,9 +24,9 @@ import org.elasticsearch.cluster.routing.allocation.allocator.ShardsAllocator; import org.elasticsearch.cluster.routing.allocation.decider.AllocationDeciders; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.gateway.TestGatewayAllocator; diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/allocation/ClusterAllocationExplanationTests.java b/server/src/test/java/org/elasticsearch/action/admin/cluster/allocation/ClusterAllocationExplanationTests.java index 2917adc4df256..cc5623436d7c9 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/allocation/ClusterAllocationExplanationTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/cluster/allocation/ClusterAllocationExplanationTests.java @@ -22,9 +22,9 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.index.Index; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.test.ESTestCase; diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/health/ClusterHealthResponsesTests.java b/server/src/test/java/org/elasticsearch/action/admin/cluster/health/ClusterHealthResponsesTests.java index 6dd3a872885b8..4bb4fbbdd82f2 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/health/ClusterHealthResponsesTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/cluster/health/ClusterHealthResponsesTests.java @@ -20,8 +20,8 @@ import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.test.AbstractSerializingTestCase; import org.hamcrest.Matchers; diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/node/tasks/TestTaskPlugin.java b/server/src/test/java/org/elasticsearch/action/admin/cluster/node/tasks/TestTaskPlugin.java index 88dc7441e65b0..8edeb58745fff 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/node/tasks/TestTaskPlugin.java +++ b/server/src/test/java/org/elasticsearch/action/admin/cluster/node/tasks/TestTaskPlugin.java @@ -33,8 +33,8 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.plugins.ActionPlugin; import org.elasticsearch.plugins.NetworkPlugin; import org.elasticsearch.plugins.Plugin; diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/node/tasks/TransportTasksActionTests.java b/server/src/test/java/org/elasticsearch/action/admin/cluster/node/tasks/TransportTasksActionTests.java index 2ebe0263afb9d..92db66e63e269 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/node/tasks/TransportTasksActionTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/cluster/node/tasks/TransportTasksActionTests.java @@ -33,11 +33,11 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.tasks.Task; import org.elasticsearch.tasks.TaskId; import org.elasticsearch.tasks.TaskInfo; diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/repositories/put/PutRepositoryRequestTests.java b/server/src/test/java/org/elasticsearch/action/admin/cluster/repositories/put/PutRepositoryRequestTests.java index 8993cabc7921d..f02d551fd9a44 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/repositories/put/PutRepositoryRequestTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/cluster/repositories/put/PutRepositoryRequestTests.java @@ -9,17 +9,17 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; import org.elasticsearch.repositories.fs.FsRepository; import org.elasticsearch.test.ESTestCase; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.HashMap; import java.util.Map; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.equalTo; public class PutRepositoryRequestTests extends ESTestCase { diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/repositories/verify/VerifyRepositoryResponseTests.java b/server/src/test/java/org/elasticsearch/action/admin/cluster/repositories/verify/VerifyRepositoryResponseTests.java index 6ab6a1c5c28e9..8f5712d90487f 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/repositories/verify/VerifyRepositoryResponseTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/cluster/repositories/verify/VerifyRepositoryResponseTests.java @@ -7,8 +7,8 @@ */ package org.elasticsearch.action.admin.cluster.repositories.verify; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; +import org.elasticsearch.xcontent.XContentParser; import java.util.ArrayList; import java.util.List; diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/reroute/ClusterRerouteRequestTests.java b/server/src/test/java/org/elasticsearch/action/admin/cluster/reroute/ClusterRerouteRequestTests.java index 0b0ebe8db6bed..383dd6cbd8020 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/reroute/ClusterRerouteRequestTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/cluster/reroute/ClusterRerouteRequestTests.java @@ -22,11 +22,11 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.network.NetworkModule; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.admin.cluster.RestClusterRerouteAction; import org.elasticsearch.test.ESTestCase; diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/reroute/ClusterRerouteResponseTests.java b/server/src/test/java/org/elasticsearch/action/admin/cluster/reroute/ClusterRerouteResponseTests.java index a5a90501a0cb3..c4136a9fdd5d9 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/reroute/ClusterRerouteResponseTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/cluster/reroute/ClusterRerouteResponseTests.java @@ -23,9 +23,9 @@ import org.elasticsearch.common.collect.ImmutableOpenMap; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.transport.TransportAddress; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.test.ESTestCase; diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/settings/ClusterGetSettingsResponseTests.java b/server/src/test/java/org/elasticsearch/action/admin/cluster/settings/ClusterGetSettingsResponseTests.java index 81bcf6abae0cd..c37517cf62185 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/settings/ClusterGetSettingsResponseTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/cluster/settings/ClusterGetSettingsResponseTests.java @@ -9,7 +9,7 @@ package org.elasticsearch.action.admin.cluster.settings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/settings/ClusterUpdateSettingsRequestTests.java b/server/src/test/java/org/elasticsearch/action/admin/cluster/settings/ClusterUpdateSettingsRequestTests.java index 64c0ce4b071a9..08d7ffd839ca8 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/settings/ClusterUpdateSettingsRequestTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/cluster/settings/ClusterUpdateSettingsRequestTests.java @@ -9,10 +9,10 @@ package org.elasticsearch.action.admin.cluster.settings; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.XContentTestUtils; diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/settings/ClusterUpdateSettingsResponseTests.java b/server/src/test/java/org/elasticsearch/action/admin/cluster/settings/ClusterUpdateSettingsResponseTests.java index c5f979ecba45e..9ea820cb7dcab 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/settings/ClusterUpdateSettingsResponseTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/cluster/settings/ClusterUpdateSettingsResponseTests.java @@ -13,7 +13,7 @@ import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings.Builder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import java.util.List; diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/create/CreateSnapshotRequestTests.java b/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/create/CreateSnapshotRequestTests.java index ce292e2755a8a..2f151e516cde4 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/create/CreateSnapshotRequestTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/create/CreateSnapshotRequestTests.java @@ -13,13 +13,13 @@ import org.elasticsearch.action.support.IndicesOptions.Option; import org.elasticsearch.action.support.IndicesOptions.WildcardStates; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent.MapParams; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent.MapParams; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/create/CreateSnapshotResponseTests.java b/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/create/CreateSnapshotResponseTests.java index 5717def040458..cb3c9a3557d61 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/create/CreateSnapshotResponseTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/create/CreateSnapshotResponseTests.java @@ -8,7 +8,6 @@ package org.elasticsearch.action.admin.cluster.snapshots.create; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.snapshots.Snapshot; import org.elasticsearch.snapshots.SnapshotFeatureInfo; @@ -18,6 +17,7 @@ import org.elasticsearch.snapshots.SnapshotInfoTestUtils; import org.elasticsearch.snapshots.SnapshotShardFailure; import org.elasticsearch.test.AbstractXContentTestCase; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/get/GetSnapshotsResponseTests.java b/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/get/GetSnapshotsResponseTests.java index 5825aab091b44..db7c389ab2239 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/get/GetSnapshotsResponseTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/get/GetSnapshotsResponseTests.java @@ -13,8 +13,6 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.UUIDs; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.snapshots.Snapshot; import org.elasticsearch.snapshots.SnapshotFeatureInfo; @@ -24,6 +22,8 @@ import org.elasticsearch.snapshots.SnapshotInfoTestUtils; import org.elasticsearch.snapshots.SnapshotShardFailure; import org.elasticsearch.test.ESTestCase; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.nio.charset.StandardCharsets; diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/restore/RestoreSnapshotRequestTests.java b/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/restore/RestoreSnapshotRequestTests.java index 2f91351772577..ae730ed4d4a64 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/restore/RestoreSnapshotRequestTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/restore/RestoreSnapshotRequestTests.java @@ -12,13 +12,13 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.test.AbstractWireSerializingTestCase; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/restore/RestoreSnapshotResponseTests.java b/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/restore/RestoreSnapshotResponseTests.java index 09bf1358e4360..125431db811a8 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/restore/RestoreSnapshotResponseTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/restore/RestoreSnapshotResponseTests.java @@ -8,9 +8,9 @@ package org.elasticsearch.action.admin.cluster.snapshots.restore; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.snapshots.RestoreInfo; import org.elasticsearch.test.AbstractXContentTestCase; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotIndexShardStatusTests.java b/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotIndexShardStatusTests.java index f6b13f777422b..4f2bae0c75c81 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotIndexShardStatusTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotIndexShardStatusTests.java @@ -9,11 +9,11 @@ package org.elasticsearch.action.admin.cluster.snapshots.status; import org.elasticsearch.cluster.metadata.IndexMetadata; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParserUtils; import org.elasticsearch.index.Index; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.test.AbstractXContentTestCase; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.function.Predicate; diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotIndexStatusTests.java b/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotIndexStatusTests.java index c9595df44a58f..4980d0f786d84 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotIndexStatusTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotIndexStatusTests.java @@ -8,9 +8,9 @@ package org.elasticsearch.action.admin.cluster.snapshots.status; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParserUtils; import org.elasticsearch.test.AbstractXContentTestCase; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotShardsStatsTests.java b/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotShardsStatsTests.java index 0efff61432f84..9d4b8d601c63b 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotShardsStatsTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotShardsStatsTests.java @@ -8,8 +8,8 @@ package org.elasticsearch.action.admin.cluster.snapshots.status; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotStatsTests.java b/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotStatsTests.java index 5bd7ac685b98c..55a776438d540 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotStatsTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotStatsTests.java @@ -8,8 +8,8 @@ package org.elasticsearch.action.admin.cluster.snapshots.status; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotStatusTests.java b/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotStatusTests.java index d7db7f6983231..b6b219f238c12 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotStatusTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotStatusTests.java @@ -10,11 +10,11 @@ import org.elasticsearch.cluster.SnapshotsInProgress; import org.elasticsearch.common.UUIDs; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.snapshots.Snapshot; import org.elasticsearch.snapshots.SnapshotId; import org.elasticsearch.test.AbstractXContentTestCase; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotsStatusResponseTests.java b/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotsStatusResponseTests.java index 3e217368af2ba..82807d37501ad 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotsStatusResponseTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotsStatusResponseTests.java @@ -8,8 +8,8 @@ package org.elasticsearch.action.admin.cluster.snapshots.status; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/stats/ClusterStatsNodesTests.java b/server/src/test/java/org/elasticsearch/action/admin/cluster/stats/ClusterStatsNodesTests.java index ceea2b7c9599d..4c497ebe388e0 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/stats/ClusterStatsNodesTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/cluster/stats/ClusterStatsNodesTests.java @@ -14,7 +14,7 @@ import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import java.util.Arrays; diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/storedscripts/GetScriptContextResponseTests.java b/server/src/test/java/org/elasticsearch/action/admin/cluster/storedscripts/GetScriptContextResponseTests.java index 7df3704159afd..74e30d4da16d1 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/storedscripts/GetScriptContextResponseTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/cluster/storedscripts/GetScriptContextResponseTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.action.admin.cluster.storedscripts; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/storedscripts/GetScriptLanguageResponseTests.java b/server/src/test/java/org/elasticsearch/action/admin/cluster/storedscripts/GetScriptLanguageResponseTests.java index 2190177556dde..c777a9ded26f4 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/storedscripts/GetScriptLanguageResponseTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/cluster/storedscripts/GetScriptLanguageResponseTests.java @@ -9,7 +9,7 @@ package org.elasticsearch.action.admin.cluster.storedscripts; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.script.ScriptLanguagesInfo; import org.elasticsearch.test.AbstractSerializingTestCase; diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/storedscripts/GetStoredScriptResponseTests.java b/server/src/test/java/org/elasticsearch/action/admin/cluster/storedscripts/GetStoredScriptResponseTests.java index af2c61d4f2f22..d1f089e6b722f 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/storedscripts/GetStoredScriptResponseTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/cluster/storedscripts/GetStoredScriptResponseTests.java @@ -7,8 +7,8 @@ */ import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.script.Script; import org.elasticsearch.script.StoredScriptSource; import org.elasticsearch.test.AbstractSerializingTestCase; diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/storedscripts/PutStoredScriptRequestTests.java b/server/src/test/java/org/elasticsearch/action/admin/cluster/storedscripts/PutStoredScriptRequestTests.java index d97a9fc7770d3..57d3d89fa5b44 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/storedscripts/PutStoredScriptRequestTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/cluster/storedscripts/PutStoredScriptRequestTests.java @@ -12,9 +12,9 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.script.StoredScriptSource; import org.elasticsearch.test.ESTestCase; diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/storedscripts/ScriptContextInfoSerializingTests.java b/server/src/test/java/org/elasticsearch/action/admin/cluster/storedscripts/ScriptContextInfoSerializingTests.java index 2abdb5a7a2113..37cfdc10066e6 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/storedscripts/ScriptContextInfoSerializingTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/cluster/storedscripts/ScriptContextInfoSerializingTests.java @@ -9,7 +9,7 @@ package org.elasticsearch.action.admin.cluster.storedscripts; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.script.ScriptContextInfo; import org.elasticsearch.test.AbstractSerializingTestCase; diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/storedscripts/ScriptMethodInfoSerializingTests.java b/server/src/test/java/org/elasticsearch/action/admin/cluster/storedscripts/ScriptMethodInfoSerializingTests.java index 6877836543dbd..07863818ad286 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/storedscripts/ScriptMethodInfoSerializingTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/cluster/storedscripts/ScriptMethodInfoSerializingTests.java @@ -9,7 +9,7 @@ package org.elasticsearch.action.admin.cluster.storedscripts; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.script.ScriptContextInfo.ScriptMethodInfo; import org.elasticsearch.test.AbstractSerializingTestCase; diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/storedscripts/ScriptParameterInfoSerializingTests.java b/server/src/test/java/org/elasticsearch/action/admin/cluster/storedscripts/ScriptParameterInfoSerializingTests.java index 0d8491f564f72..4bc7eae7e011b 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/storedscripts/ScriptParameterInfoSerializingTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/cluster/storedscripts/ScriptParameterInfoSerializingTests.java @@ -9,7 +9,7 @@ package org.elasticsearch.action.admin.cluster.storedscripts; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.script.ScriptContextInfo.ScriptMethodInfo.ParameterInfo; import org.elasticsearch.test.AbstractSerializingTestCase; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/alias/AliasActionsTests.java b/server/src/test/java/org/elasticsearch/action/admin/indices/alias/AliasActionsTests.java index ce801ffc57f94..7ec61fb622fc6 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/alias/AliasActionsTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/indices/alias/AliasActionsTests.java @@ -13,12 +13,12 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.alias.RandomAliasActionsGenerator; import org.elasticsearch.test.ESTestCase; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/alias/IndicesAliasesRequestTests.java b/server/src/test/java/org/elasticsearch/action/admin/indices/alias/IndicesAliasesRequestTests.java index e128117749563..d1c26ff17f47d 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/alias/IndicesAliasesRequestTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/indices/alias/IndicesAliasesRequestTests.java @@ -10,9 +10,9 @@ import org.elasticsearch.action.admin.indices.alias.IndicesAliasesRequest.AliasActions; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/analyze/AnalyzeResponseTests.java b/server/src/test/java/org/elasticsearch/action/admin/indices/analyze/AnalyzeResponseTests.java index c40ddfa799766..bfa80f3310df6 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/analyze/AnalyzeResponseTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/indices/analyze/AnalyzeResponseTests.java @@ -12,10 +12,10 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.Writeable.Reader; import org.elasticsearch.common.util.CollectionUtils; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.AbstractWireSerializingTestCase; import org.elasticsearch.test.RandomObjects; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/cache/clear/ClearIndicesCacheResponseTests.java b/server/src/test/java/org/elasticsearch/action/admin/indices/cache/clear/ClearIndicesCacheResponseTests.java index 58efc002499b7..eca05253c08d8 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/cache/clear/ClearIndicesCacheResponseTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/indices/cache/clear/ClearIndicesCacheResponseTests.java @@ -9,7 +9,7 @@ package org.elasticsearch.action.admin.indices.cache.clear; import org.elasticsearch.action.support.DefaultShardOperationFailedException; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractBroadcastResponseTestCase; import java.util.List; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/close/CloseIndexResponseTests.java b/server/src/test/java/org/elasticsearch/action/admin/indices/close/CloseIndexResponseTests.java index ba04f1210928a..5e819ae6c3717 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/close/CloseIndexResponseTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/indices/close/CloseIndexResponseTests.java @@ -13,9 +13,9 @@ import org.elasticsearch.action.admin.indices.close.CloseIndexResponse.IndexResult; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.Index; import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.index.shard.ShardId; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/create/CreateIndexRequestBuilderTests.java b/server/src/test/java/org/elasticsearch/action/admin/indices/create/CreateIndexRequestBuilderTests.java index da2b6bf01295c..de999f0b329a0 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/create/CreateIndexRequestBuilderTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/indices/create/CreateIndexRequestBuilderTests.java @@ -10,9 +10,9 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.client.NoOpClient; import org.junit.After; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/create/CreateIndexRequestTests.java b/server/src/test/java/org/elasticsearch/action/admin/indices/create/CreateIndexRequestTests.java index 8185e4d50fef8..808b9a6ce36be 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/create/CreateIndexRequestTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/indices/create/CreateIndexRequestTests.java @@ -15,12 +15,12 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.RandomCreateIndexGenerator; import org.elasticsearch.test.AbstractWireSerializingTestCase; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/create/CreateIndexResponseTests.java b/server/src/test/java/org/elasticsearch/action/admin/indices/create/CreateIndexResponseTests.java index f344976a0bae3..37259963da219 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/create/CreateIndexResponseTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/indices/create/CreateIndexResponseTests.java @@ -10,8 +10,8 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/flush/FlushResponseTests.java b/server/src/test/java/org/elasticsearch/action/admin/indices/flush/FlushResponseTests.java index 26e74a576b99b..cd3da3835ec49 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/flush/FlushResponseTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/indices/flush/FlushResponseTests.java @@ -9,7 +9,7 @@ package org.elasticsearch.action.admin.indices.flush; import org.elasticsearch.action.support.DefaultShardOperationFailedException; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractBroadcastResponseTestCase; import java.util.List; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/forcemerge/ForceMergeResponseTests.java b/server/src/test/java/org/elasticsearch/action/admin/indices/forcemerge/ForceMergeResponseTests.java index a4abb5ae5785e..db3622160a291 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/forcemerge/ForceMergeResponseTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/indices/forcemerge/ForceMergeResponseTests.java @@ -9,7 +9,7 @@ package org.elasticsearch.action.admin.indices.forcemerge; import org.elasticsearch.action.support.DefaultShardOperationFailedException; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractBroadcastResponseTestCase; import java.util.List; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/forcemerge/RestForceMergeActionTests.java b/server/src/test/java/org/elasticsearch/action/admin/indices/forcemerge/RestForceMergeActionTests.java index 4ad3504da5ac8..09c4324d5c1f7 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/forcemerge/RestForceMergeActionTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/indices/forcemerge/RestForceMergeActionTests.java @@ -12,9 +12,9 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.rest.AbstractRestChannel; import org.elasticsearch.rest.RestChannel; import org.elasticsearch.rest.RestRequest; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/mapping/get/GetFieldMappingsResponseTests.java b/server/src/test/java/org/elasticsearch/action/admin/indices/mapping/get/GetFieldMappingsResponseTests.java index c722b5f2ece73..03d9c76e10ee0 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/mapping/get/GetFieldMappingsResponseTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/indices/mapping/get/GetFieldMappingsResponseTests.java @@ -16,10 +16,10 @@ import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.mapper.MapperService; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.test.AbstractWireSerializingTestCase; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/mapping/put/PutMappingRequestTests.java b/server/src/test/java/org/elasticsearch/action/admin/indices/mapping/put/PutMappingRequestTests.java index 4b8c7e11bdf14..6cc50efded78e 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/mapping/put/PutMappingRequestTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/indices/mapping/put/PutMappingRequestTests.java @@ -16,7 +16,7 @@ import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.cluster.metadata.Metadata; import org.elasticsearch.core.Tuple; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.Index; import org.elasticsearch.indices.TestIndexNameExpressionResolver; import org.elasticsearch.test.ESTestCase; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/open/OpenIndexResponseTests.java b/server/src/test/java/org/elasticsearch/action/admin/indices/open/OpenIndexResponseTests.java index 0de9a9ef968e8..c23d8e46ace09 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/open/OpenIndexResponseTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/indices/open/OpenIndexResponseTests.java @@ -9,7 +9,7 @@ package org.elasticsearch.action.admin.indices.open; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; public class OpenIndexResponseTests extends AbstractSerializingTestCase { diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/refresh/RefreshResponseTests.java b/server/src/test/java/org/elasticsearch/action/admin/indices/refresh/RefreshResponseTests.java index c2b00866a405b..1b3806b4649b3 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/refresh/RefreshResponseTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/indices/refresh/RefreshResponseTests.java @@ -9,7 +9,7 @@ package org.elasticsearch.action.admin.indices.refresh; import org.elasticsearch.action.support.DefaultShardOperationFailedException; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractBroadcastResponseTestCase; import java.util.List; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/resolve/ResolveIndexResponseTests.java b/server/src/test/java/org/elasticsearch/action/admin/indices/resolve/ResolveIndexResponseTests.java index 6fba4ca3ea85d..9b59a736ddd14 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/resolve/ResolveIndexResponseTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/indices/resolve/ResolveIndexResponseTests.java @@ -14,8 +14,8 @@ import org.elasticsearch.action.admin.indices.resolve.ResolveIndexAction.Response; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/rollover/MetadataRolloverServiceTests.java b/server/src/test/java/org/elasticsearch/action/admin/indices/rollover/MetadataRolloverServiceTests.java index 3200154183350..9790fd700b7be 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/rollover/MetadataRolloverServiceTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/indices/rollover/MetadataRolloverServiceTests.java @@ -36,7 +36,7 @@ import org.elasticsearch.common.UUIDs; import org.elasticsearch.common.settings.IndexScopedSettings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.core.CheckedFunction; import org.elasticsearch.core.TimeValue; import org.elasticsearch.env.Environment; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/rollover/RolloverRequestTests.java b/server/src/test/java/org/elasticsearch/action/admin/indices/rollover/RolloverRequestTests.java index c249c8b6b1723..00e050806808c 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/rollover/RolloverRequestTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/indices/rollover/RolloverRequestTests.java @@ -20,13 +20,13 @@ import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.mapper.MapperService; import org.elasticsearch.indices.IndicesModule; import org.elasticsearch.test.ESTestCase; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/segments/IndicesSegmentResponseTests.java b/server/src/test/java/org/elasticsearch/action/admin/indices/segments/IndicesSegmentResponseTests.java index 9fb811fb1394e..da5d371ad110d 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/segments/IndicesSegmentResponseTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/indices/segments/IndicesSegmentResponseTests.java @@ -13,14 +13,14 @@ import org.elasticsearch.cluster.routing.ShardRouting; import org.elasticsearch.cluster.routing.ShardRoutingState; import org.elasticsearch.cluster.routing.TestShardRouting; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.engine.Segment; import org.elasticsearch.test.ESTestCase; import java.util.Collections; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; public class IndicesSegmentResponseTests extends ESTestCase { diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/settings/get/GetSettingsResponseTests.java b/server/src/test/java/org/elasticsearch/action/admin/indices/settings/get/GetSettingsResponseTests.java index d3492a02c4c01..5f0ead6d7aa7d 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/settings/get/GetSettingsResponseTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/indices/settings/get/GetSettingsResponseTests.java @@ -12,7 +12,7 @@ import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.IndexScopedSettings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.RandomCreateIndexGenerator; import org.elasticsearch.test.AbstractSerializingTestCase; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/settings/put/UpdateSettingsRequestTests.java b/server/src/test/java/org/elasticsearch/action/admin/indices/settings/put/UpdateSettingsRequestTests.java index d6893bee4f314..5402661285266 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/settings/put/UpdateSettingsRequestTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/indices/settings/put/UpdateSettingsRequestTests.java @@ -8,8 +8,8 @@ package org.elasticsearch.action.admin.indices.settings.put; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/shards/IndicesShardStoreResponseTests.java b/server/src/test/java/org/elasticsearch/action/admin/indices/shards/IndicesShardStoreResponseTests.java index 763547f7248e2..ed2f43ff39aa0 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/shards/IndicesShardStoreResponseTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/indices/shards/IndicesShardStoreResponseTests.java @@ -15,11 +15,11 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.collect.ImmutableOpenIntMap; import org.elasticsearch.common.collect.ImmutableOpenMap; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.transport.NodeDisconnectedException; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/shrink/ResizeRequestTests.java b/server/src/test/java/org/elasticsearch/action/admin/indices/shrink/ResizeRequestTests.java index e0bb35d8dc577..c94321aa97bc2 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/shrink/ResizeRequestTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/indices/shrink/ResizeRequestTests.java @@ -21,8 +21,8 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.RandomCreateIndexGenerator; import org.elasticsearch.test.AbstractWireSerializingTestCase; import org.elasticsearch.test.hamcrest.ElasticsearchAssertions; @@ -33,7 +33,7 @@ import static org.elasticsearch.action.admin.indices.create.CreateIndexRequestTests.assertAliasesEqual; import static org.elasticsearch.cluster.metadata.IndexMetadata.SETTING_NUMBER_OF_SHARDS; -import static org.elasticsearch.common.xcontent.ToXContent.EMPTY_PARAMS; +import static org.elasticsearch.xcontent.ToXContent.EMPTY_PARAMS; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.hasToString; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/shrink/ResizeResponseTests.java b/server/src/test/java/org/elasticsearch/action/admin/indices/shrink/ResizeResponseTests.java index 02d8e456ef170..075c09e578136 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/shrink/ResizeResponseTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/indices/shrink/ResizeResponseTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; public class ResizeResponseTests extends AbstractSerializingTestCase { diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/stats/IndicesStatsResponseTests.java b/server/src/test/java/org/elasticsearch/action/admin/indices/stats/IndicesStatsResponseTests.java index 7a590efe64174..580ef94fd25ff 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/stats/IndicesStatsResponseTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/indices/stats/IndicesStatsResponseTests.java @@ -12,8 +12,8 @@ import org.elasticsearch.cluster.routing.ShardRoutingState; import org.elasticsearch.cluster.routing.TestShardRouting; import org.elasticsearch.common.UUIDs; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.Index; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.index.shard.ShardPath; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/stats/IndicesStatsTests.java b/server/src/test/java/org/elasticsearch/action/admin/indices/stats/IndicesStatsTests.java index 2d5b1290b5e5f..f6330e4c3b5b5 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/stats/IndicesStatsTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/indices/stats/IndicesStatsTests.java @@ -14,8 +14,8 @@ import org.elasticsearch.action.support.WriteRequest.RefreshPolicy; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.index.IndexModule; import org.elasticsearch.index.engine.CommitStats; import org.elasticsearch.index.engine.SegmentsStats; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/template/put/PutIndexTemplateRequestTests.java b/server/src/test/java/org/elasticsearch/action/admin/indices/template/put/PutIndexTemplateRequestTests.java index 9e08042d0bf76..a15749b9262bb 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/template/put/PutIndexTemplateRequestTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/indices/template/put/PutIndexTemplateRequestTests.java @@ -11,9 +11,9 @@ import org.elasticsearch.action.admin.indices.alias.Alias; import org.elasticsearch.common.collect.MapBuilder; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/validate/query/QueryExplanationTests.java b/server/src/test/java/org/elasticsearch/action/admin/indices/validate/query/QueryExplanationTests.java index 2f375fbee5c44..343984bd7c230 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/validate/query/QueryExplanationTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/indices/validate/query/QueryExplanationTests.java @@ -9,7 +9,7 @@ package org.elasticsearch.action.admin.indices.validate.query; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/validate/query/ValidateQueryResponseTests.java b/server/src/test/java/org/elasticsearch/action/admin/indices/validate/query/ValidateQueryResponseTests.java index 385f77e5bdfaa..ebf551ab50006 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/validate/query/ValidateQueryResponseTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/indices/validate/query/ValidateQueryResponseTests.java @@ -11,7 +11,7 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.action.support.DefaultShardOperationFailedException; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractBroadcastResponseTestCase; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/action/bulk/BulkItemResponseTests.java b/server/src/test/java/org/elasticsearch/action/bulk/BulkItemResponseTests.java index 4be13c7fe100c..cafa37cb147f0 100644 --- a/server/src/test/java/org/elasticsearch/action/bulk/BulkItemResponseTests.java +++ b/server/src/test/java/org/elasticsearch/action/bulk/BulkItemResponseTests.java @@ -19,9 +19,9 @@ import org.elasticsearch.action.update.UpdateResponseTests; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.core.Tuple; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/action/bulk/BulkProcessorTests.java b/server/src/test/java/org/elasticsearch/action/bulk/BulkProcessorTests.java index 9f8eb55e08baf..848f6db468bb8 100644 --- a/server/src/test/java/org/elasticsearch/action/bulk/BulkProcessorTests.java +++ b/server/src/test/java/org/elasticsearch/action/bulk/BulkProcessorTests.java @@ -22,7 +22,7 @@ import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.common.util.concurrent.EsRejectedExecutionException; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.TimeValue; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.test.ESTestCase; diff --git a/server/src/test/java/org/elasticsearch/action/bulk/BulkRequestModifierTests.java b/server/src/test/java/org/elasticsearch/action/bulk/BulkRequestModifierTests.java index 27eb818116d6f..accaa327842f4 100644 --- a/server/src/test/java/org/elasticsearch/action/bulk/BulkRequestModifierTests.java +++ b/server/src/test/java/org/elasticsearch/action/bulk/BulkRequestModifierTests.java @@ -12,7 +12,7 @@ import org.elasticsearch.action.DocWriteRequest; import org.elasticsearch.action.index.IndexRequest; import org.elasticsearch.action.index.IndexResponse; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.test.ESTestCase; import org.hamcrest.Matchers; diff --git a/server/src/test/java/org/elasticsearch/action/bulk/BulkRequestParserTests.java b/server/src/test/java/org/elasticsearch/action/bulk/BulkRequestParserTests.java index 102b9410d95b5..25042de02cab2 100644 --- a/server/src/test/java/org/elasticsearch/action/bulk/BulkRequestParserTests.java +++ b/server/src/test/java/org/elasticsearch/action/bulk/BulkRequestParserTests.java @@ -11,7 +11,7 @@ import org.elasticsearch.action.index.IndexRequest; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.common.bytes.BytesArray; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.hamcrest.Matchers; diff --git a/server/src/test/java/org/elasticsearch/action/bulk/BulkRequestTests.java b/server/src/test/java/org/elasticsearch/action/bulk/BulkRequestTests.java index f9c88731065bb..f94765d4bcf4d 100644 --- a/server/src/test/java/org/elasticsearch/action/bulk/BulkRequestTests.java +++ b/server/src/test/java/org/elasticsearch/action/bulk/BulkRequestTests.java @@ -19,10 +19,10 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.script.Script; import org.elasticsearch.test.ESTestCase; diff --git a/server/src/test/java/org/elasticsearch/action/bulk/BulkResponseTests.java b/server/src/test/java/org/elasticsearch/action/bulk/BulkResponseTests.java index 40257bedf4841..4884b48eb6791 100644 --- a/server/src/test/java/org/elasticsearch/action/bulk/BulkResponseTests.java +++ b/server/src/test/java/org/elasticsearch/action/bulk/BulkResponseTests.java @@ -17,9 +17,9 @@ import org.elasticsearch.action.update.UpdateResponseTests; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.core.Tuple; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/action/bulk/TransportBulkActionTookTests.java b/server/src/test/java/org/elasticsearch/action/bulk/TransportBulkActionTookTests.java index e6a8c5647c085..1418a06137e88 100644 --- a/server/src/test/java/org/elasticsearch/action/bulk/TransportBulkActionTookTests.java +++ b/server/src/test/java/org/elasticsearch/action/bulk/TransportBulkActionTookTests.java @@ -28,7 +28,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.AtomicArray; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.index.IndexingPressure; import org.elasticsearch.indices.EmptySystemIndices; diff --git a/server/src/test/java/org/elasticsearch/action/delete/DeleteResponseTests.java b/server/src/test/java/org/elasticsearch/action/delete/DeleteResponseTests.java index 51a07f1c959b4..1bb123613fe2d 100644 --- a/server/src/test/java/org/elasticsearch/action/delete/DeleteResponseTests.java +++ b/server/src/test/java/org/elasticsearch/action/delete/DeleteResponseTests.java @@ -12,9 +12,9 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.core.Tuple; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.seqno.SequenceNumbers; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.test.ESTestCase; diff --git a/server/src/test/java/org/elasticsearch/action/explain/ExplainResponseTests.java b/server/src/test/java/org/elasticsearch/action/explain/ExplainResponseTests.java index fa08890a368dd..1be692e628a38 100644 --- a/server/src/test/java/org/elasticsearch/action/explain/ExplainResponseTests.java +++ b/server/src/test/java/org/elasticsearch/action/explain/ExplainResponseTests.java @@ -13,11 +13,11 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.document.DocumentField; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.get.GetResult; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.test.RandomObjects; diff --git a/server/src/test/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesRequestTests.java b/server/src/test/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesRequestTests.java index 4caf0d7410417..f936550387ce0 100644 --- a/server/src/test/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesRequestTests.java +++ b/server/src/test/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesRequestTests.java @@ -15,10 +15,10 @@ import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.ArrayUtils; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.search.SearchModule; import org.elasticsearch.test.AbstractWireSerializingTestCase; diff --git a/server/src/test/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesResponseTests.java b/server/src/test/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesResponseTests.java index 7d7f92faec272..1e47792561dfe 100644 --- a/server/src/test/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesResponseTests.java +++ b/server/src/test/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesResponseTests.java @@ -11,9 +11,9 @@ import org.elasticsearch.ElasticsearchExceptionTests; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.AbstractWireSerializingTestCase; import org.hamcrest.Matchers; diff --git a/server/src/test/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesTests.java b/server/src/test/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesTests.java index 6b93bac3d3796..e162728081582 100644 --- a/server/src/test/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesTests.java +++ b/server/src/test/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesTests.java @@ -9,7 +9,7 @@ package org.elasticsearch.action.fieldcaps; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/action/fieldcaps/MergedFieldCapabilitiesResponseTests.java b/server/src/test/java/org/elasticsearch/action/fieldcaps/MergedFieldCapabilitiesResponseTests.java index 7442d84f05e90..576d8ca9bd940 100644 --- a/server/src/test/java/org/elasticsearch/action/fieldcaps/MergedFieldCapabilitiesResponseTests.java +++ b/server/src/test/java/org/elasticsearch/action/fieldcaps/MergedFieldCapabilitiesResponseTests.java @@ -10,11 +10,11 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/action/get/GetResponseTests.java b/server/src/test/java/org/elasticsearch/action/get/GetResponseTests.java index 9c479db75375b..a9bb11fa73d65 100644 --- a/server/src/test/java/org/elasticsearch/action/get/GetResponseTests.java +++ b/server/src/test/java/org/elasticsearch/action/get/GetResponseTests.java @@ -14,9 +14,9 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.core.Tuple; import org.elasticsearch.common.document.DocumentField; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.get.GetResult; import org.elasticsearch.test.ESTestCase; diff --git a/server/src/test/java/org/elasticsearch/action/get/MultiGetRequestTests.java b/server/src/test/java/org/elasticsearch/action/get/MultiGetRequestTests.java index f56701b51eac2..fdfba6243a3a9 100644 --- a/server/src/test/java/org/elasticsearch/action/get/MultiGetRequestTests.java +++ b/server/src/test/java/org/elasticsearch/action/get/MultiGetRequestTests.java @@ -10,11 +10,11 @@ import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.VersionType; import org.elasticsearch.search.fetch.subphase.FetchSourceContext; import org.elasticsearch.test.ESTestCase; diff --git a/server/src/test/java/org/elasticsearch/action/get/MultiGetResponseTests.java b/server/src/test/java/org/elasticsearch/action/get/MultiGetResponseTests.java index 6591b1d882351..12b573d724d82 100644 --- a/server/src/test/java/org/elasticsearch/action/get/MultiGetResponseTests.java +++ b/server/src/test/java/org/elasticsearch/action/get/MultiGetResponseTests.java @@ -8,10 +8,10 @@ package org.elasticsearch.action.get; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.get.GetResult; import org.elasticsearch.test.ESTestCase; diff --git a/server/src/test/java/org/elasticsearch/action/get/TransportMultiGetActionTests.java b/server/src/test/java/org/elasticsearch/action/get/TransportMultiGetActionTests.java index 460aa49af03d2..1927210c9c971 100644 --- a/server/src/test/java/org/elasticsearch/action/get/TransportMultiGetActionTests.java +++ b/server/src/test/java/org/elasticsearch/action/get/TransportMultiGetActionTests.java @@ -28,9 +28,9 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.AtomicArray; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.Index; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.indices.EmptySystemIndices; diff --git a/server/src/test/java/org/elasticsearch/action/index/IndexRequestBuilderTests.java b/server/src/test/java/org/elasticsearch/action/index/IndexRequestBuilderTests.java index 6ac2d255597ab..f4919d761ae44 100644 --- a/server/src/test/java/org/elasticsearch/action/index/IndexRequestBuilderTests.java +++ b/server/src/test/java/org/elasticsearch/action/index/IndexRequestBuilderTests.java @@ -8,10 +8,10 @@ package org.elasticsearch.action.index; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.client.NoOpClient; import org.junit.After; diff --git a/server/src/test/java/org/elasticsearch/action/index/IndexRequestTests.java b/server/src/test/java/org/elasticsearch/action/index/IndexRequestTests.java index fe03569c779d6..4138a7a961797 100644 --- a/server/src/test/java/org/elasticsearch/action/index/IndexRequestTests.java +++ b/server/src/test/java/org/elasticsearch/action/index/IndexRequestTests.java @@ -16,7 +16,7 @@ import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.VersionType; import org.elasticsearch.index.seqno.SequenceNumbers; import org.elasticsearch.index.shard.ShardId; diff --git a/server/src/test/java/org/elasticsearch/action/index/IndexResponseTests.java b/server/src/test/java/org/elasticsearch/action/index/IndexResponseTests.java index 88db548572533..4b48d9eae1d60 100644 --- a/server/src/test/java/org/elasticsearch/action/index/IndexResponseTests.java +++ b/server/src/test/java/org/elasticsearch/action/index/IndexResponseTests.java @@ -13,9 +13,9 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.core.Tuple; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.seqno.SequenceNumbers; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.test.ESTestCase; diff --git a/server/src/test/java/org/elasticsearch/action/ingest/GetPipelineResponseTests.java b/server/src/test/java/org/elasticsearch/action/ingest/GetPipelineResponseTests.java index c5fd810edcaaf..8d756d1c07eeb 100644 --- a/server/src/test/java/org/elasticsearch/action/ingest/GetPipelineResponseTests.java +++ b/server/src/test/java/org/elasticsearch/action/ingest/GetPipelineResponseTests.java @@ -12,10 +12,10 @@ import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.util.CollectionUtils; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.ingest.PipelineConfiguration; import org.elasticsearch.test.AbstractSerializingTestCase; diff --git a/server/src/test/java/org/elasticsearch/action/ingest/PutPipelineRequestTests.java b/server/src/test/java/org/elasticsearch/action/ingest/PutPipelineRequestTests.java index e1227950ad2e9..1c2e86180123c 100644 --- a/server/src/test/java/org/elasticsearch/action/ingest/PutPipelineRequestTests.java +++ b/server/src/test/java/org/elasticsearch/action/ingest/PutPipelineRequestTests.java @@ -12,9 +12,9 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.ingest.Pipeline; import org.elasticsearch.test.ESTestCase; diff --git a/server/src/test/java/org/elasticsearch/action/ingest/SimulateDocumentBaseResultTests.java b/server/src/test/java/org/elasticsearch/action/ingest/SimulateDocumentBaseResultTests.java index 3265c21afb661..05c2e485aa6fe 100644 --- a/server/src/test/java/org/elasticsearch/action/ingest/SimulateDocumentBaseResultTests.java +++ b/server/src/test/java/org/elasticsearch/action/ingest/SimulateDocumentBaseResultTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.ingest.IngestDocument; import org.elasticsearch.test.AbstractXContentTestCase; diff --git a/server/src/test/java/org/elasticsearch/action/ingest/SimulateDocumentVerboseResultTests.java b/server/src/test/java/org/elasticsearch/action/ingest/SimulateDocumentVerboseResultTests.java index c90d243f9ecf5..395c2d4c3a350 100644 --- a/server/src/test/java/org/elasticsearch/action/ingest/SimulateDocumentVerboseResultTests.java +++ b/server/src/test/java/org/elasticsearch/action/ingest/SimulateDocumentVerboseResultTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.action.ingest; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/action/ingest/SimulatePipelineRequestTests.java b/server/src/test/java/org/elasticsearch/action/ingest/SimulatePipelineRequestTests.java index 15afc877d917b..de46d6480dfb9 100644 --- a/server/src/test/java/org/elasticsearch/action/ingest/SimulatePipelineRequestTests.java +++ b/server/src/test/java/org/elasticsearch/action/ingest/SimulatePipelineRequestTests.java @@ -11,7 +11,7 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/action/ingest/SimulatePipelineResponseTests.java b/server/src/test/java/org/elasticsearch/action/ingest/SimulatePipelineResponseTests.java index badc78cde0a1f..80ef78bb49101 100644 --- a/server/src/test/java/org/elasticsearch/action/ingest/SimulatePipelineResponseTests.java +++ b/server/src/test/java/org/elasticsearch/action/ingest/SimulatePipelineResponseTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/action/ingest/SimulateProcessorResultTests.java b/server/src/test/java/org/elasticsearch/action/ingest/SimulateProcessorResultTests.java index 12ceee0db357b..08903d08e50d9 100644 --- a/server/src/test/java/org/elasticsearch/action/ingest/SimulateProcessorResultTests.java +++ b/server/src/test/java/org/elasticsearch/action/ingest/SimulateProcessorResultTests.java @@ -11,7 +11,7 @@ import org.elasticsearch.core.Tuple; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.ingest.IngestDocument; import org.elasticsearch.test.AbstractXContentTestCase; diff --git a/server/src/test/java/org/elasticsearch/action/ingest/WriteableIngestDocumentTests.java b/server/src/test/java/org/elasticsearch/action/ingest/WriteableIngestDocumentTests.java index 661fbec20ddb0..71dd30e761646 100644 --- a/server/src/test/java/org/elasticsearch/action/ingest/WriteableIngestDocumentTests.java +++ b/server/src/test/java/org/elasticsearch/action/ingest/WriteableIngestDocumentTests.java @@ -11,11 +11,11 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.ingest.IngestDocument; import org.elasticsearch.ingest.RandomDocumentPicks; import org.elasticsearch.test.AbstractXContentTestCase; @@ -30,7 +30,7 @@ import java.util.StringJoiner; import java.util.function.Predicate; -import static org.elasticsearch.common.xcontent.ToXContent.EMPTY_PARAMS; +import static org.elasticsearch.xcontent.ToXContent.EMPTY_PARAMS; import static org.elasticsearch.ingest.IngestDocumentMatcher.assertIngestDocument; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.instanceOf; diff --git a/server/src/test/java/org/elasticsearch/action/main/MainResponseTests.java b/server/src/test/java/org/elasticsearch/action/main/MainResponseTests.java index 733445065e8b4..cb02983e2b256 100644 --- a/server/src/test/java/org/elasticsearch/action/main/MainResponseTests.java +++ b/server/src/test/java/org/elasticsearch/action/main/MainResponseTests.java @@ -13,10 +13,10 @@ import org.elasticsearch.cluster.ClusterName; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.test.VersionUtils; diff --git a/server/src/test/java/org/elasticsearch/action/search/CanMatchPreFilterSearchPhaseTests.java b/server/src/test/java/org/elasticsearch/action/search/CanMatchPreFilterSearchPhaseTests.java index 0ae9d743e6143..aaf0420a27307 100644 --- a/server/src/test/java/org/elasticsearch/action/search/CanMatchPreFilterSearchPhaseTests.java +++ b/server/src/test/java/org/elasticsearch/action/search/CanMatchPreFilterSearchPhaseTests.java @@ -23,7 +23,7 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.EsExecutors; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.index.Index; import org.elasticsearch.index.mapper.DateFieldMapper; import org.elasticsearch.index.query.AbstractQueryBuilder; diff --git a/server/src/test/java/org/elasticsearch/action/search/ClearScrollRequestTests.java b/server/src/test/java/org/elasticsearch/action/search/ClearScrollRequestTests.java index 346069f6ef804..4be3c431a6023 100644 --- a/server/src/test/java/org/elasticsearch/action/search/ClearScrollRequestTests.java +++ b/server/src/test/java/org/elasticsearch/action/search/ClearScrollRequestTests.java @@ -10,13 +10,13 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/action/search/MultiSearchRequestTests.java b/server/src/test/java/org/elasticsearch/action/search/MultiSearchRequestTests.java index 8bc96be821798..4855c47ff7e66 100644 --- a/server/src/test/java/org/elasticsearch/action/search/MultiSearchRequestTests.java +++ b/server/src/test/java/org/elasticsearch/action/search/MultiSearchRequestTests.java @@ -11,17 +11,17 @@ import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.common.CheckedBiConsumer; import org.elasticsearch.core.CheckedRunnable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.query.MatchAllQueryBuilder; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.rest.RestRequest; diff --git a/server/src/test/java/org/elasticsearch/action/search/MultiSearchResponseTests.java b/server/src/test/java/org/elasticsearch/action/search/MultiSearchResponseTests.java index df6ceba5a457a..1b2224adce3ed 100644 --- a/server/src/test/java/org/elasticsearch/action/search/MultiSearchResponseTests.java +++ b/server/src/test/java/org/elasticsearch/action/search/MultiSearchResponseTests.java @@ -9,8 +9,8 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.internal.InternalSearchResponse; import org.elasticsearch.test.AbstractXContentTestCase; diff --git a/server/src/test/java/org/elasticsearch/action/search/SearchPhaseExecutionExceptionTests.java b/server/src/test/java/org/elasticsearch/action/search/SearchPhaseExecutionExceptionTests.java index f01aa4b862ce7..4b4f482406d2a 100644 --- a/server/src/test/java/org/elasticsearch/action/search/SearchPhaseExecutionExceptionTests.java +++ b/server/src/test/java/org/elasticsearch/action/search/SearchPhaseExecutionExceptionTests.java @@ -15,11 +15,11 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.util.concurrent.EsRejectedExecutionException; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContent; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.shard.IndexShardClosedException; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.indices.InvalidIndexTemplateException; diff --git a/server/src/test/java/org/elasticsearch/action/search/SearchResponseTests.java b/server/src/test/java/org/elasticsearch/action/search/SearchResponseTests.java index ddc3466460943..028ad8f90cba0 100644 --- a/server/src/test/java/org/elasticsearch/action/search/SearchResponseTests.java +++ b/server/src/test/java/org/elasticsearch/action/search/SearchResponseTests.java @@ -15,12 +15,12 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.rest.action.search.RestSearchAction; import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.SearchHits; diff --git a/server/src/test/java/org/elasticsearch/action/search/SearchScrollRequestTests.java b/server/src/test/java/org/elasticsearch/action/search/SearchScrollRequestTests.java index d013cae0468ee..668b0ff8f6fe8 100644 --- a/server/src/test/java/org/elasticsearch/action/search/SearchScrollRequestTests.java +++ b/server/src/test/java/org/elasticsearch/action/search/SearchScrollRequestTests.java @@ -14,13 +14,13 @@ import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.search.internal.InternalScrollSearchRequest; import org.elasticsearch.search.internal.ShardSearchContextId; import org.elasticsearch.test.ESTestCase; diff --git a/server/src/test/java/org/elasticsearch/action/search/ShardSearchFailureTests.java b/server/src/test/java/org/elasticsearch/action/search/ShardSearchFailureTests.java index 862a57fbbb575..724b158a0e0d4 100644 --- a/server/src/test/java/org/elasticsearch/action/search/ShardSearchFailureTests.java +++ b/server/src/test/java/org/elasticsearch/action/search/ShardSearchFailureTests.java @@ -12,9 +12,9 @@ import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.Index; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.search.SearchShardTarget; diff --git a/server/src/test/java/org/elasticsearch/action/support/DefaultShardOperationFailedExceptionTests.java b/server/src/test/java/org/elasticsearch/action/support/DefaultShardOperationFailedExceptionTests.java index a111f1f0d0b95..ad166356608fc 100644 --- a/server/src/test/java/org/elasticsearch/action/support/DefaultShardOperationFailedExceptionTests.java +++ b/server/src/test/java/org/elasticsearch/action/support/DefaultShardOperationFailedExceptionTests.java @@ -20,10 +20,10 @@ import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.util.concurrent.EsRejectedExecutionException; -import org.elasticsearch.common.xcontent.XContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.Index; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.rest.RestStatus; diff --git a/server/src/test/java/org/elasticsearch/action/support/IndicesOptionsTests.java b/server/src/test/java/org/elasticsearch/action/support/IndicesOptionsTests.java index bbe1fd8940178..c6e7fe1427e53 100644 --- a/server/src/test/java/org/elasticsearch/action/support/IndicesOptionsTests.java +++ b/server/src/test/java/org/elasticsearch/action/support/IndicesOptionsTests.java @@ -13,13 +13,13 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent.MapParams; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent.MapParams; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.EqualsHashCodeTestUtils; diff --git a/server/src/test/java/org/elasticsearch/action/support/replication/ReplicationResponseTests.java b/server/src/test/java/org/elasticsearch/action/support/replication/ReplicationResponseTests.java index 86606b317c73f..e997ea4c16983 100644 --- a/server/src/test/java/org/elasticsearch/action/support/replication/ReplicationResponseTests.java +++ b/server/src/test/java/org/elasticsearch/action/support/replication/ReplicationResponseTests.java @@ -15,9 +15,9 @@ import org.elasticsearch.common.breaker.CircuitBreakingException; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.core.Tuple; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.test.ESTestCase; diff --git a/server/src/test/java/org/elasticsearch/action/termvectors/AbstractTermVectorsTestCase.java b/server/src/test/java/org/elasticsearch/action/termvectors/AbstractTermVectorsTestCase.java index 7f5565493e9d4..13bd5d9f40e14 100644 --- a/server/src/test/java/org/elasticsearch/action/termvectors/AbstractTermVectorsTestCase.java +++ b/server/src/test/java/org/elasticsearch/action/termvectors/AbstractTermVectorsTestCase.java @@ -38,7 +38,7 @@ import org.apache.lucene.store.Directory; import org.elasticsearch.action.admin.indices.alias.Alias; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.test.ESIntegTestCase; import java.io.IOException; @@ -49,7 +49,7 @@ import java.util.Locale; import java.util.Map; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.hamcrest.Matchers.equalTo; diff --git a/server/src/test/java/org/elasticsearch/action/termvectors/GetTermVectorsTests.java b/server/src/test/java/org/elasticsearch/action/termvectors/GetTermVectorsTests.java index f192dddd0e1a3..28cdd0c1b6f63 100644 --- a/server/src/test/java/org/elasticsearch/action/termvectors/GetTermVectorsTests.java +++ b/server/src/test/java/org/elasticsearch/action/termvectors/GetTermVectorsTests.java @@ -24,7 +24,7 @@ import org.apache.lucene.util.BytesRef; import org.elasticsearch.ElasticsearchException; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.analysis.PreConfiguredTokenizer; import org.elasticsearch.index.analysis.TokenFilterFactory; import org.elasticsearch.indices.analysis.AnalysisModule; @@ -40,7 +40,7 @@ import java.util.List; import java.util.Map; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.Matchers.nullValue; diff --git a/server/src/test/java/org/elasticsearch/action/termvectors/TermVectorsUnitTests.java b/server/src/test/java/org/elasticsearch/action/termvectors/TermVectorsUnitTests.java index 7cecc69b6e756..4a71a36bc1938 100644 --- a/server/src/test/java/org/elasticsearch/action/termvectors/TermVectorsUnitTests.java +++ b/server/src/test/java/org/elasticsearch/action/termvectors/TermVectorsUnitTests.java @@ -32,9 +32,9 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.InputStreamStreamInput; import org.elasticsearch.common.io.stream.OutputStreamStreamOutput; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.rest.action.document.RestTermVectorsAction; import org.elasticsearch.tasks.TaskId; diff --git a/server/src/test/java/org/elasticsearch/action/termvectors/TransportMultiTermVectorsActionTests.java b/server/src/test/java/org/elasticsearch/action/termvectors/TransportMultiTermVectorsActionTests.java index fbbbb66b327ed..116741d6630d9 100644 --- a/server/src/test/java/org/elasticsearch/action/termvectors/TransportMultiTermVectorsActionTests.java +++ b/server/src/test/java/org/elasticsearch/action/termvectors/TransportMultiTermVectorsActionTests.java @@ -29,9 +29,9 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.AtomicArray; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.Index; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.indices.EmptySystemIndices; diff --git a/server/src/test/java/org/elasticsearch/action/update/UpdateRequestTests.java b/server/src/test/java/org/elasticsearch/action/update/UpdateRequestTests.java index 120b842d2b63e..a7b8f735d42c3 100644 --- a/server/src/test/java/org/elasticsearch/action/update/UpdateRequestTests.java +++ b/server/src/test/java/org/elasticsearch/action/update/UpdateRequestTests.java @@ -18,14 +18,14 @@ import org.elasticsearch.common.document.DocumentField; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.env.Environment; import org.elasticsearch.index.get.GetResult; import org.elasticsearch.index.shard.ShardId; @@ -46,7 +46,7 @@ import java.util.function.Function; import static java.util.Collections.emptyMap; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.common.xcontent.XContentHelper.toXContent; import static org.elasticsearch.index.seqno.SequenceNumbers.UNASSIGNED_SEQ_NO; import static org.elasticsearch.script.MockScriptEngine.mockInlineScript; diff --git a/server/src/test/java/org/elasticsearch/action/update/UpdateResponseTests.java b/server/src/test/java/org/elasticsearch/action/update/UpdateResponseTests.java index 7d4b1f4dbc0e9..793bf4d244666 100644 --- a/server/src/test/java/org/elasticsearch/action/update/UpdateResponseTests.java +++ b/server/src/test/java/org/elasticsearch/action/update/UpdateResponseTests.java @@ -16,9 +16,9 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.core.Tuple; import org.elasticsearch.common.document.DocumentField; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.get.GetResult; import org.elasticsearch.index.get.GetResultTests; import org.elasticsearch.index.seqno.SequenceNumbers; diff --git a/server/src/test/java/org/elasticsearch/client/AbstractClientHeadersTestCase.java b/server/src/test/java/org/elasticsearch/client/AbstractClientHeadersTestCase.java index 033f91337d9ed..a3db39c03e15e 100644 --- a/server/src/test/java/org/elasticsearch/client/AbstractClientHeadersTestCase.java +++ b/server/src/test/java/org/elasticsearch/client/AbstractClientHeadersTestCase.java @@ -25,7 +25,7 @@ import org.elasticsearch.action.search.SearchAction; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.env.Environment; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.threadpool.ThreadPool; diff --git a/server/src/test/java/org/elasticsearch/cluster/ClusterStateTests.java b/server/src/test/java/org/elasticsearch/cluster/ClusterStateTests.java index 13184246d0da3..bb3dc59ca713a 100644 --- a/server/src/test/java/org/elasticsearch/cluster/ClusterStateTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/ClusterStateTests.java @@ -29,9 +29,9 @@ import org.elasticsearch.common.collect.ImmutableOpenMap; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.transport.TransportAddress; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.Index; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.rest.RestStatus; diff --git a/server/src/test/java/org/elasticsearch/cluster/SnapshotDeletionsInProgressTests.java b/server/src/test/java/org/elasticsearch/cluster/SnapshotDeletionsInProgressTests.java index 5618449b4e323..5aac0795bd6fa 100644 --- a/server/src/test/java/org/elasticsearch/cluster/SnapshotDeletionsInProgressTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/SnapshotDeletionsInProgressTests.java @@ -9,15 +9,15 @@ package org.elasticsearch.cluster; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.test.ESTestCase; import java.io.IOException; import java.util.Collections; import java.util.List; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.equalTo; public class SnapshotDeletionsInProgressTests extends ESTestCase { diff --git a/server/src/test/java/org/elasticsearch/cluster/coordination/CoordinationMetadataTests.java b/server/src/test/java/org/elasticsearch/cluster/coordination/CoordinationMetadataTests.java index a529eb48ba2e1..7f7d51e0596c5 100644 --- a/server/src/test/java/org/elasticsearch/cluster/coordination/CoordinationMetadataTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/coordination/CoordinationMetadataTests.java @@ -12,10 +12,10 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.EqualsHashCodeTestUtils; import org.elasticsearch.test.EqualsHashCodeTestUtils.CopyFunction; diff --git a/server/src/test/java/org/elasticsearch/cluster/coordination/CoordinatorTests.java b/server/src/test/java/org/elasticsearch/cluster/coordination/CoordinatorTests.java index 89db4ffdb2b75..693a6a81b9867 100644 --- a/server/src/test/java/org/elasticsearch/cluster/coordination/CoordinatorTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/coordination/CoordinatorTests.java @@ -35,7 +35,7 @@ import org.elasticsearch.common.settings.Settings.Builder; import org.elasticsearch.common.util.concurrent.DeterministicTaskQueue; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.core.Nullable; import org.elasticsearch.core.TimeValue; import org.elasticsearch.discovery.DiscoveryModule; diff --git a/server/src/test/java/org/elasticsearch/cluster/coordination/ElasticsearchNodeCommandTests.java b/server/src/test/java/org/elasticsearch/cluster/coordination/ElasticsearchNodeCommandTests.java index 69c4554f2be50..bcf614926606c 100644 --- a/server/src/test/java/org/elasticsearch/cluster/coordination/ElasticsearchNodeCommandTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/coordination/ElasticsearchNodeCommandTests.java @@ -15,10 +15,10 @@ import org.elasticsearch.cluster.metadata.Metadata; import org.elasticsearch.common.UUIDs; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.Index; import org.elasticsearch.indices.IndicesModule; import org.elasticsearch.test.ESTestCase; diff --git a/server/src/test/java/org/elasticsearch/cluster/health/ClusterIndexHealthTests.java b/server/src/test/java/org/elasticsearch/cluster/health/ClusterIndexHealthTests.java index 222ffe6691e16..4a790491f6477 100644 --- a/server/src/test/java/org/elasticsearch/cluster/health/ClusterIndexHealthTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/health/ClusterIndexHealthTests.java @@ -13,8 +13,8 @@ import org.elasticsearch.cluster.routing.IndexRoutingTable; import org.elasticsearch.cluster.routing.RoutingTableGenerator; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/cluster/health/ClusterShardHealthTests.java b/server/src/test/java/org/elasticsearch/cluster/health/ClusterShardHealthTests.java index 33ecedfa3f416..b8060a9218835 100644 --- a/server/src/test/java/org/elasticsearch/cluster/health/ClusterShardHealthTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/health/ClusterShardHealthTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.cluster.health; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/cluster/metadata/AliasMetadataTests.java b/server/src/test/java/org/elasticsearch/cluster/metadata/AliasMetadataTests.java index 39f1a81299094..90b8f9e92db89 100644 --- a/server/src/test/java/org/elasticsearch/cluster/metadata/AliasMetadataTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/metadata/AliasMetadataTests.java @@ -12,7 +12,7 @@ import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/cluster/metadata/ComponentTemplateTests.java b/server/src/test/java/org/elasticsearch/cluster/metadata/ComponentTemplateTests.java index 0895233befac0..3c133b4eec298 100644 --- a/server/src/test/java/org/elasticsearch/cluster/metadata/ComponentTemplateTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/metadata/ComponentTemplateTests.java @@ -14,10 +14,10 @@ import org.elasticsearch.common.compress.CompressedXContent; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.mapper.MapperService; import org.elasticsearch.test.AbstractDiffableSerializationTestCase; import org.elasticsearch.test.ESTestCase; diff --git a/server/src/test/java/org/elasticsearch/cluster/metadata/ComposableIndexTemplateTests.java b/server/src/test/java/org/elasticsearch/cluster/metadata/ComposableIndexTemplateTests.java index 5a598aee80bbd..3f7953fafcf74 100644 --- a/server/src/test/java/org/elasticsearch/cluster/metadata/ComposableIndexTemplateTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/metadata/ComposableIndexTemplateTests.java @@ -12,7 +12,7 @@ import org.elasticsearch.common.compress.CompressedXContent; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractDiffableSerializationTestCase; import org.elasticsearch.test.ESTestCase; diff --git a/server/src/test/java/org/elasticsearch/cluster/metadata/DataStreamAliasTests.java b/server/src/test/java/org/elasticsearch/cluster/metadata/DataStreamAliasTests.java index 77c1e0b0ec4e1..b437ab7f74825 100644 --- a/server/src/test/java/org/elasticsearch/cluster/metadata/DataStreamAliasTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/metadata/DataStreamAliasTests.java @@ -9,8 +9,8 @@ package org.elasticsearch.cluster.metadata; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/cluster/metadata/DataStreamMetadataTests.java b/server/src/test/java/org/elasticsearch/cluster/metadata/DataStreamMetadataTests.java index 7f43a85b18f16..fb04bd9291167 100644 --- a/server/src/test/java/org/elasticsearch/cluster/metadata/DataStreamMetadataTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/metadata/DataStreamMetadataTests.java @@ -9,7 +9,7 @@ package org.elasticsearch.cluster.metadata; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; -import org.elasticsearch.common.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContent; import org.elasticsearch.test.AbstractNamedWriteableTestCase; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/cluster/metadata/DataStreamTemplateTests.java b/server/src/test/java/org/elasticsearch/cluster/metadata/DataStreamTemplateTests.java index 65e6efcdca6e4..92f7d187d45d4 100644 --- a/server/src/test/java/org/elasticsearch/cluster/metadata/DataStreamTemplateTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/metadata/DataStreamTemplateTests.java @@ -11,7 +11,7 @@ import org.elasticsearch.cluster.metadata.ComposableIndexTemplate.DataStreamTemplate; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; public class DataStreamTemplateTests extends AbstractSerializingTestCase { diff --git a/server/src/test/java/org/elasticsearch/cluster/metadata/DataStreamTests.java b/server/src/test/java/org/elasticsearch/cluster/metadata/DataStreamTests.java index eff33cf8779a7..68fd082eda44d 100644 --- a/server/src/test/java/org/elasticsearch/cluster/metadata/DataStreamTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/metadata/DataStreamTests.java @@ -11,7 +11,7 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.UUIDs; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.Index; import org.elasticsearch.test.AbstractSerializingTestCase; diff --git a/server/src/test/java/org/elasticsearch/cluster/metadata/IndexGraveyardTests.java b/server/src/test/java/org/elasticsearch/cluster/metadata/IndexGraveyardTests.java index 4528d48dfc0d2..a7316a20aa72c 100644 --- a/server/src/test/java/org/elasticsearch/cluster/metadata/IndexGraveyardTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/metadata/IndexGraveyardTests.java @@ -13,11 +13,11 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentElasticsearchExtension; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.Index; import org.elasticsearch.test.ESTestCase; diff --git a/server/src/test/java/org/elasticsearch/cluster/metadata/IndexMetadataTests.java b/server/src/test/java/org/elasticsearch/cluster/metadata/IndexMetadataTests.java index b50d1a96930f7..9b0d040b5618d 100644 --- a/server/src/test/java/org/elasticsearch/cluster/metadata/IndexMetadataTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/metadata/IndexMetadataTests.java @@ -26,10 +26,10 @@ import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.indices.IndicesModule; import org.elasticsearch.test.ESTestCase; diff --git a/server/src/test/java/org/elasticsearch/cluster/metadata/IndexTemplateMetadataTests.java b/server/src/test/java/org/elasticsearch/cluster/metadata/IndexTemplateMetadataTests.java index 5c5765f7fdcc7..d6c78884c05c5 100644 --- a/server/src/test/java/org/elasticsearch/cluster/metadata/IndexTemplateMetadataTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/metadata/IndexTemplateMetadataTests.java @@ -11,14 +11,14 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.collect.ImmutableOpenMap; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.ESTestCase; import java.util.Arrays; diff --git a/server/src/test/java/org/elasticsearch/cluster/metadata/ManifestTests.java b/server/src/test/java/org/elasticsearch/cluster/metadata/ManifestTests.java index 700138889f82b..4771aca52b8e9 100644 --- a/server/src/test/java/org/elasticsearch/cluster/metadata/ManifestTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/metadata/ManifestTests.java @@ -11,9 +11,9 @@ import org.elasticsearch.common.UUIDs; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.core.Tuple; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.Index; import org.elasticsearch.test.ESTestCase; diff --git a/server/src/test/java/org/elasticsearch/cluster/metadata/MetadataCreateIndexServiceTests.java b/server/src/test/java/org/elasticsearch/cluster/metadata/MetadataCreateIndexServiceTests.java index 68f82f9435547..07712373dade8 100644 --- a/server/src/test/java/org/elasticsearch/cluster/metadata/MetadataCreateIndexServiceTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/metadata/MetadataCreateIndexServiceTests.java @@ -36,8 +36,8 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.index.Index; import org.elasticsearch.index.IndexModule; import org.elasticsearch.index.IndexNotFoundException; diff --git a/server/src/test/java/org/elasticsearch/cluster/metadata/MetadataIndexTemplateServiceTests.java b/server/src/test/java/org/elasticsearch/cluster/metadata/MetadataIndexTemplateServiceTests.java index 316d1913422f6..af6b8d40029da 100644 --- a/server/src/test/java/org/elasticsearch/cluster/metadata/MetadataIndexTemplateServiceTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/metadata/MetadataIndexTemplateServiceTests.java @@ -23,8 +23,8 @@ import org.elasticsearch.common.settings.IndexScopedSettings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.env.Environment; import org.elasticsearch.index.Index; import org.elasticsearch.index.mapper.DataStreamTimestampFieldMapper; diff --git a/server/src/test/java/org/elasticsearch/cluster/metadata/MetadataTests.java b/server/src/test/java/org/elasticsearch/cluster/metadata/MetadataTests.java index 66369532798b9..8530281076fbd 100644 --- a/server/src/test/java/org/elasticsearch/cluster/metadata/MetadataTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/metadata/MetadataTests.java @@ -24,10 +24,10 @@ import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.Index; import org.elasticsearch.plugins.MapperPlugin; import org.elasticsearch.test.ESTestCase; diff --git a/server/src/test/java/org/elasticsearch/cluster/metadata/NodesShutdownMetadataTests.java b/server/src/test/java/org/elasticsearch/cluster/metadata/NodesShutdownMetadataTests.java index 8dafeaa8ee429..7b9bd494bbb34 100644 --- a/server/src/test/java/org/elasticsearch/cluster/metadata/NodesShutdownMetadataTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/metadata/NodesShutdownMetadataTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.cluster.Diff; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.TimeValue; import org.elasticsearch.test.AbstractDiffableSerializationTestCase; diff --git a/server/src/test/java/org/elasticsearch/cluster/metadata/ToAndFromJsonMetadataTests.java b/server/src/test/java/org/elasticsearch/cluster/metadata/ToAndFromJsonMetadataTests.java index 505c77a1217eb..bdce1335a215f 100644 --- a/server/src/test/java/org/elasticsearch/cluster/metadata/ToAndFromJsonMetadataTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/metadata/ToAndFromJsonMetadataTests.java @@ -14,9 +14,9 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.compress.CompressedXContent; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.TestCustomMetadata; diff --git a/server/src/test/java/org/elasticsearch/cluster/node/DiscoveryNodeTests.java b/server/src/test/java/org/elasticsearch/cluster/node/DiscoveryNodeTests.java index 1c57b1d4d0727..6043a05ab1956 100644 --- a/server/src/test/java/org/elasticsearch/cluster/node/DiscoveryNodeTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/node/DiscoveryNodeTests.java @@ -15,7 +15,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.transport.TransportAddress; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import java.net.InetAddress; diff --git a/server/src/test/java/org/elasticsearch/cluster/routing/AllocationIdTests.java b/server/src/test/java/org/elasticsearch/cluster/routing/AllocationIdTests.java index ab7b27dfa6bf4..6ea0fee1042b5 100644 --- a/server/src/test/java/org/elasticsearch/cluster/routing/AllocationIdTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/routing/AllocationIdTests.java @@ -10,9 +10,9 @@ import org.elasticsearch.cluster.routing.RecoverySource.ExistingStoreRecoverySource; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.test.ESTestCase; diff --git a/server/src/test/java/org/elasticsearch/cluster/routing/allocation/AllocationCommandsTests.java b/server/src/test/java/org/elasticsearch/cluster/routing/allocation/AllocationCommandsTests.java index 21091cfa7768b..033fa56fcbe9c 100644 --- a/server/src/test/java/org/elasticsearch/cluster/routing/allocation/AllocationCommandsTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/routing/allocation/AllocationCommandsTests.java @@ -41,9 +41,9 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.Index; import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.index.shard.ShardId; diff --git a/server/src/test/java/org/elasticsearch/cluster/serialization/ClusterSerializationTests.java b/server/src/test/java/org/elasticsearch/cluster/serialization/ClusterSerializationTests.java index 632289f5a1039..c743f4af5ce21 100644 --- a/server/src/test/java/org/elasticsearch/cluster/serialization/ClusterSerializationTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/serialization/ClusterSerializationTests.java @@ -33,7 +33,7 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.snapshots.Snapshot; import org.elasticsearch.snapshots.SnapshotId; import org.elasticsearch.test.VersionUtils; diff --git a/server/src/test/java/org/elasticsearch/common/StringsTests.java b/server/src/test/java/org/elasticsearch/common/StringsTests.java index 23e57f8ab9c6f..6d42af1d356ad 100644 --- a/server/src/test/java/org/elasticsearch/common/StringsTests.java +++ b/server/src/test/java/org/elasticsearch/common/StringsTests.java @@ -9,9 +9,9 @@ package org.elasticsearch.common; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; import org.elasticsearch.test.ESTestCase; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; import java.util.ArrayList; import java.util.Collections; diff --git a/server/src/test/java/org/elasticsearch/common/compress/DeflateCompressedXContentTests.java b/server/src/test/java/org/elasticsearch/common/compress/DeflateCompressedXContentTests.java index 4bc76d30977e8..b37dcd7e71970 100644 --- a/server/src/test/java/org/elasticsearch/common/compress/DeflateCompressedXContentTests.java +++ b/server/src/test/java/org/elasticsearch/common/compress/DeflateCompressedXContentTests.java @@ -11,10 +11,10 @@ import org.apache.lucene.util.TestUtil; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.junit.Assert; diff --git a/server/src/test/java/org/elasticsearch/common/geo/GeoBoundingBoxTests.java b/server/src/test/java/org/elasticsearch/common/geo/GeoBoundingBoxTests.java index 23e081ef2bbdc..7da34901a2bd0 100644 --- a/server/src/test/java/org/elasticsearch/common/geo/GeoBoundingBoxTests.java +++ b/server/src/test/java/org/elasticsearch/common/geo/GeoBoundingBoxTests.java @@ -10,9 +10,9 @@ import org.apache.lucene.geo.GeoEncodingUtils; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.geo.GeometryTestUtils; import org.elasticsearch.geometry.Rectangle; import org.elasticsearch.test.ESTestCase; diff --git a/server/src/test/java/org/elasticsearch/common/geo/GeoJsonParserTests.java b/server/src/test/java/org/elasticsearch/common/geo/GeoJsonParserTests.java index 57504c7c0da78..4f066b5e43e23 100644 --- a/server/src/test/java/org/elasticsearch/common/geo/GeoJsonParserTests.java +++ b/server/src/test/java/org/elasticsearch/common/geo/GeoJsonParserTests.java @@ -9,11 +9,11 @@ package org.elasticsearch.common.geo; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.geometry.Circle; import org.elasticsearch.geometry.Geometry; import org.elasticsearch.geometry.GeometryCollection; diff --git a/server/src/test/java/org/elasticsearch/common/geo/GeoJsonSerializationTests.java b/server/src/test/java/org/elasticsearch/common/geo/GeoJsonSerializationTests.java index 8fe02ed63419c..051d8b31f1156 100644 --- a/server/src/test/java/org/elasticsearch/common/geo/GeoJsonSerializationTests.java +++ b/server/src/test/java/org/elasticsearch/common/geo/GeoJsonSerializationTests.java @@ -11,13 +11,13 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.geo.GeometryTestUtils; import org.elasticsearch.geometry.Geometry; import org.elasticsearch.geometry.utils.GeographyValidator; diff --git a/server/src/test/java/org/elasticsearch/common/geo/GeoUtilTests.java b/server/src/test/java/org/elasticsearch/common/geo/GeoUtilTests.java index 6331e724b284a..a4caac463f9a2 100644 --- a/server/src/test/java/org/elasticsearch/common/geo/GeoUtilTests.java +++ b/server/src/test/java/org/elasticsearch/common/geo/GeoUtilTests.java @@ -9,14 +9,14 @@ import org.elasticsearch.core.CheckedConsumer; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.ESTestCase; import java.io.IOException; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; public class GeoUtilTests extends ESTestCase { diff --git a/server/src/test/java/org/elasticsearch/common/geo/GeometryIndexerTests.java b/server/src/test/java/org/elasticsearch/common/geo/GeometryIndexerTests.java index 1e420fc20027d..7b7d8c2df6e38 100644 --- a/server/src/test/java/org/elasticsearch/common/geo/GeometryIndexerTests.java +++ b/server/src/test/java/org/elasticsearch/common/geo/GeometryIndexerTests.java @@ -9,9 +9,9 @@ package org.elasticsearch.common.geo; import org.apache.lucene.index.IndexableField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.geo.GeometryTestUtils; import org.elasticsearch.geometry.Circle; import org.elasticsearch.geometry.Geometry; diff --git a/server/src/test/java/org/elasticsearch/common/geo/GeometryParserTests.java b/server/src/test/java/org/elasticsearch/common/geo/GeometryParserTests.java index 97a266d2cbb55..e2f04dd6ba025 100644 --- a/server/src/test/java/org/elasticsearch/common/geo/GeometryParserTests.java +++ b/server/src/test/java/org/elasticsearch/common/geo/GeometryParserTests.java @@ -10,11 +10,11 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.geometry.Geometry; import org.elasticsearch.geometry.GeometryCollection; import org.elasticsearch.geometry.Line; diff --git a/server/src/test/java/org/elasticsearch/common/network/NetworkModuleTests.java b/server/src/test/java/org/elasticsearch/common/network/NetworkModuleTests.java index 9e7b05f438dab..0851255cbec8b 100644 --- a/server/src/test/java/org/elasticsearch/common/network/NetworkModuleTests.java +++ b/server/src/test/java/org/elasticsearch/common/network/NetworkModuleTests.java @@ -16,7 +16,7 @@ import org.elasticsearch.common.util.BigArrays; import org.elasticsearch.common.util.PageCacheRecycler; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.http.HttpInfo; import org.elasticsearch.http.HttpServerTransport; import org.elasticsearch.http.HttpStats; diff --git a/server/src/test/java/org/elasticsearch/common/settings/SettingsFilterTests.java b/server/src/test/java/org/elasticsearch/common/settings/SettingsFilterTests.java index bde223cdb4caf..7df1aa1498154 100644 --- a/server/src/test/java/org/elasticsearch/common/settings/SettingsFilterTests.java +++ b/server/src/test/java/org/elasticsearch/common/settings/SettingsFilterTests.java @@ -13,8 +13,8 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.logging.Loggers; import org.elasticsearch.common.settings.Setting.Property; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.MockLogAppender; diff --git a/server/src/test/java/org/elasticsearch/common/settings/SettingsTests.java b/server/src/test/java/org/elasticsearch/common/settings/SettingsTests.java index 2e3364641f11e..d519a29c9b672 100644 --- a/server/src/test/java/org/elasticsearch/common/settings/SettingsTests.java +++ b/server/src/test/java/org/elasticsearch/common/settings/SettingsTests.java @@ -17,10 +17,10 @@ import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import java.io.ByteArrayInputStream; diff --git a/server/src/test/java/org/elasticsearch/common/unit/FuzzinessTests.java b/server/src/test/java/org/elasticsearch/common/unit/FuzzinessTests.java index a0b637e45b391..cee5cd9325c28 100644 --- a/server/src/test/java/org/elasticsearch/common/unit/FuzzinessTests.java +++ b/server/src/test/java/org/elasticsearch/common/unit/FuzzinessTests.java @@ -10,13 +10,13 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.ESTestCase; import java.io.IOException; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.CoreMatchers.anyOf; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.sameInstance; diff --git a/server/src/test/java/org/elasticsearch/common/xcontent/BaseXContentTestCase.java b/server/src/test/java/org/elasticsearch/common/xcontent/BaseXContentTestCase.java index 98953cbaea3e6..a5486decde4a7 100644 --- a/server/src/test/java/org/elasticsearch/common/xcontent/BaseXContentTestCase.java +++ b/server/src/test/java/org/elasticsearch/common/xcontent/BaseXContentTestCase.java @@ -22,9 +22,22 @@ import org.elasticsearch.common.text.Text; import org.elasticsearch.common.unit.DistanceUnit; import org.elasticsearch.common.util.CollectionUtils; -import org.elasticsearch.common.xcontent.XContentParser.Token; import org.elasticsearch.core.PathUtils; import org.elasticsearch.test.ESTestCase; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedObjectNotFoundException; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.XContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentGenerator; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser.Token; import org.hamcrest.Matcher; import org.hamcrest.Matchers; diff --git a/server/src/test/java/org/elasticsearch/common/xcontent/CompatibleNamedXContentRegistryTests.java b/server/src/test/java/org/elasticsearch/common/xcontent/CompatibleNamedXContentRegistryTests.java index 2393ddf233c90..8a7433a2a2a04 100644 --- a/server/src/test/java/org/elasticsearch/common/xcontent/CompatibleNamedXContentRegistryTests.java +++ b/server/src/test/java/org/elasticsearch/common/xcontent/CompatibleNamedXContentRegistryTests.java @@ -14,6 +14,13 @@ import org.elasticsearch.rest.RestRequest; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.rest.FakeRestRequest; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.MediaType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.util.Collections; diff --git a/server/src/test/java/org/elasticsearch/common/xcontent/XContentFactoryTests.java b/server/src/test/java/org/elasticsearch/common/xcontent/XContentFactoryTests.java index 804f96a12caee..0d489aabe897e 100644 --- a/server/src/test/java/org/elasticsearch/common/xcontent/XContentFactoryTests.java +++ b/server/src/test/java/org/elasticsearch/common/xcontent/XContentFactoryTests.java @@ -14,6 +14,9 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.test.ESTestCase; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import java.io.ByteArrayInputStream; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/common/xcontent/XContentParserUtilsTests.java b/server/src/test/java/org/elasticsearch/common/xcontent/XContentParserUtilsTests.java index a6cf916978844..5d30f7ea547ad 100644 --- a/server/src/test/java/org/elasticsearch/common/xcontent/XContentParserUtilsTests.java +++ b/server/src/test/java/org/elasticsearch/common/xcontent/XContentParserUtilsTests.java @@ -14,7 +14,15 @@ import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedObjectNotFoundException; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/common/xcontent/XContentTypeTests.java b/server/src/test/java/org/elasticsearch/common/xcontent/XContentTypeTests.java index e54e8004d36be..c3e875895de44 100644 --- a/server/src/test/java/org/elasticsearch/common/xcontent/XContentTypeTests.java +++ b/server/src/test/java/org/elasticsearch/common/xcontent/XContentTypeTests.java @@ -8,6 +8,8 @@ package org.elasticsearch.common.xcontent; import org.elasticsearch.test.ESTestCase; +import org.elasticsearch.xcontent.ParsedMediaType; +import org.elasticsearch.xcontent.XContentType; import java.util.HashMap; import java.util.Locale; diff --git a/server/src/test/java/org/elasticsearch/common/xcontent/builder/XContentBuilderTests.java b/server/src/test/java/org/elasticsearch/common/xcontent/builder/XContentBuilderTests.java index 3839dcf31e984..38f109f209729 100644 --- a/server/src/test/java/org/elasticsearch/common/xcontent/builder/XContentBuilderTests.java +++ b/server/src/test/java/org/elasticsearch/common/xcontent/builder/XContentBuilderTests.java @@ -15,14 +15,14 @@ import org.elasticsearch.common.geo.GeoPoint; import org.elasticsearch.core.PathUtils; import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentElasticsearchExtension; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentGenerator; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentGenerator; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.ESTestCase; import java.io.ByteArrayOutputStream; diff --git a/server/src/test/java/org/elasticsearch/common/xcontent/cbor/CborXContentParserTests.java b/server/src/test/java/org/elasticsearch/common/xcontent/cbor/CborXContentParserTests.java index befae040bf54e..95494a74a92f6 100644 --- a/server/src/test/java/org/elasticsearch/common/xcontent/cbor/CborXContentParserTests.java +++ b/server/src/test/java/org/elasticsearch/common/xcontent/cbor/CborXContentParserTests.java @@ -9,9 +9,10 @@ package org.elasticsearch.common.xcontent.cbor; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.test.ESTestCase; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.cbor.CborXContent; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/common/xcontent/cbor/CborXContentTests.java b/server/src/test/java/org/elasticsearch/common/xcontent/cbor/CborXContentTests.java index 8aca16eb9877b..ee5c4ad17fa37 100644 --- a/server/src/test/java/org/elasticsearch/common/xcontent/cbor/CborXContentTests.java +++ b/server/src/test/java/org/elasticsearch/common/xcontent/cbor/CborXContentTests.java @@ -12,8 +12,8 @@ import com.fasterxml.jackson.dataformat.cbor.CBORFactory; import org.elasticsearch.common.xcontent.BaseXContentTestCase; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import java.io.ByteArrayOutputStream; diff --git a/server/src/test/java/org/elasticsearch/common/xcontent/cbor/JsonVsCborTests.java b/server/src/test/java/org/elasticsearch/common/xcontent/cbor/JsonVsCborTests.java index 9bb00f81fdf5d..bb2e0ddd7075e 100644 --- a/server/src/test/java/org/elasticsearch/common/xcontent/cbor/JsonVsCborTests.java +++ b/server/src/test/java/org/elasticsearch/common/xcontent/cbor/JsonVsCborTests.java @@ -9,11 +9,12 @@ package org.elasticsearch.common.xcontent.cbor; import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentGenerator; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentGenerator; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.cbor.CborXContent; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/common/xcontent/json/JsonXContentTests.java b/server/src/test/java/org/elasticsearch/common/xcontent/json/JsonXContentTests.java index d76cd8f92687b..349c84eeb0a55 100644 --- a/server/src/test/java/org/elasticsearch/common/xcontent/json/JsonXContentTests.java +++ b/server/src/test/java/org/elasticsearch/common/xcontent/json/JsonXContentTests.java @@ -12,7 +12,7 @@ import com.fasterxml.jackson.core.JsonGenerator; import org.elasticsearch.common.xcontent.BaseXContentTestCase; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import java.io.ByteArrayOutputStream; diff --git a/server/src/test/java/org/elasticsearch/common/xcontent/smile/JsonVsSmileTests.java b/server/src/test/java/org/elasticsearch/common/xcontent/smile/JsonVsSmileTests.java index c93d297138dce..a8530ec51fa01 100644 --- a/server/src/test/java/org/elasticsearch/common/xcontent/smile/JsonVsSmileTests.java +++ b/server/src/test/java/org/elasticsearch/common/xcontent/smile/JsonVsSmileTests.java @@ -9,12 +9,13 @@ package org.elasticsearch.common.xcontent.smile; import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentGenerator; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.test.ESTestCase; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentGenerator; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.smile.SmileXContent; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/common/xcontent/smile/SmileXContentTests.java b/server/src/test/java/org/elasticsearch/common/xcontent/smile/SmileXContentTests.java index 45706fa5fa94d..d33d36b446055 100644 --- a/server/src/test/java/org/elasticsearch/common/xcontent/smile/SmileXContentTests.java +++ b/server/src/test/java/org/elasticsearch/common/xcontent/smile/SmileXContentTests.java @@ -12,8 +12,8 @@ import com.fasterxml.jackson.dataformat.smile.SmileFactory; import org.elasticsearch.common.xcontent.BaseXContentTestCase; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import java.io.ByteArrayOutputStream; diff --git a/server/src/test/java/org/elasticsearch/common/xcontent/support/AbstractFilteringTestCase.java b/server/src/test/java/org/elasticsearch/common/xcontent/support/AbstractFilteringTestCase.java index 09a0d5289643d..fbb5a8c84372b 100644 --- a/server/src/test/java/org/elasticsearch/common/xcontent/support/AbstractFilteringTestCase.java +++ b/server/src/test/java/org/elasticsearch/common/xcontent/support/AbstractFilteringTestCase.java @@ -10,16 +10,16 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.FilterXContentParser; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.core.CheckedFunction; import org.elasticsearch.core.PathUtils; import org.elasticsearch.test.ESTestCase; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.FilterXContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.net.URISyntaxException; diff --git a/server/src/test/java/org/elasticsearch/common/xcontent/support/XContentHelperTests.java b/server/src/test/java/org/elasticsearch/common/xcontent/support/XContentHelperTests.java index 7f7ee6ad652ae..f60556f75de17 100644 --- a/server/src/test/java/org/elasticsearch/common/xcontent/support/XContentHelperTests.java +++ b/server/src/test/java/org/elasticsearch/common/xcontent/support/XContentHelperTests.java @@ -10,14 +10,14 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.compress.CompressedXContent; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.hamcrest.Matchers; diff --git a/server/src/test/java/org/elasticsearch/common/xcontent/support/XContentMapValuesTests.java b/server/src/test/java/org/elasticsearch/common/xcontent/support/XContentMapValuesTests.java index 5ac7c9ce64ee3..c5f6dff52be66 100644 --- a/server/src/test/java/org/elasticsearch/common/xcontent/support/XContentMapValuesTests.java +++ b/server/src/test/java/org/elasticsearch/common/xcontent/support/XContentMapValuesTests.java @@ -10,13 +10,13 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.core.Tuple; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.hamcrest.Matchers; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/common/xcontent/support/filtering/AbstractXContentFilteringTestCase.java b/server/src/test/java/org/elasticsearch/common/xcontent/support/filtering/AbstractXContentFilteringTestCase.java index 1db805cd9e0fe..87d4d92c7a910 100644 --- a/server/src/test/java/org/elasticsearch/common/xcontent/support/filtering/AbstractXContentFilteringTestCase.java +++ b/server/src/test/java/org/elasticsearch/common/xcontent/support/filtering/AbstractXContentFilteringTestCase.java @@ -10,14 +10,15 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.common.xcontent.support.AbstractFilteringTestCase; +import org.elasticsearch.xcontent.support.filtering.FilterPath; import java.io.IOException; import java.util.Arrays; diff --git a/server/src/test/java/org/elasticsearch/common/xcontent/support/filtering/CborXContentFilteringTests.java b/server/src/test/java/org/elasticsearch/common/xcontent/support/filtering/CborXContentFilteringTests.java index c6b5f2e7f9d55..ce4c5d005c759 100644 --- a/server/src/test/java/org/elasticsearch/common/xcontent/support/filtering/CborXContentFilteringTests.java +++ b/server/src/test/java/org/elasticsearch/common/xcontent/support/filtering/CborXContentFilteringTests.java @@ -8,8 +8,8 @@ package org.elasticsearch.common.xcontent.support.filtering; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; public class CborXContentFilteringTests extends AbstractXContentFilteringTestCase { diff --git a/server/src/test/java/org/elasticsearch/common/xcontent/support/filtering/FilterPathGeneratorFilteringTests.java b/server/src/test/java/org/elasticsearch/common/xcontent/support/filtering/FilterPathGeneratorFilteringTests.java index 4bb6000c7968c..3d73c8717e7ef 100644 --- a/server/src/test/java/org/elasticsearch/common/xcontent/support/filtering/FilterPathGeneratorFilteringTests.java +++ b/server/src/test/java/org/elasticsearch/common/xcontent/support/filtering/FilterPathGeneratorFilteringTests.java @@ -13,6 +13,7 @@ import com.fasterxml.jackson.core.filter.FilteringGeneratorDelegate; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.test.ESTestCase; +import org.elasticsearch.xcontent.support.filtering.FilterPathBasedFilter; import java.util.Collections; diff --git a/server/src/test/java/org/elasticsearch/common/xcontent/support/filtering/FilterPathTests.java b/server/src/test/java/org/elasticsearch/common/xcontent/support/filtering/FilterPathTests.java index d32d9386300b4..2046772e0afcf 100644 --- a/server/src/test/java/org/elasticsearch/common/xcontent/support/filtering/FilterPathTests.java +++ b/server/src/test/java/org/elasticsearch/common/xcontent/support/filtering/FilterPathTests.java @@ -9,6 +9,7 @@ package org.elasticsearch.common.xcontent.support.filtering; import org.elasticsearch.test.ESTestCase; +import org.elasticsearch.xcontent.support.filtering.FilterPath; import java.util.Arrays; import java.util.LinkedHashSet; diff --git a/server/src/test/java/org/elasticsearch/common/xcontent/support/filtering/JsonXContentFilteringTests.java b/server/src/test/java/org/elasticsearch/common/xcontent/support/filtering/JsonXContentFilteringTests.java index bce584a3cc7ca..fffdbb2ad8818 100644 --- a/server/src/test/java/org/elasticsearch/common/xcontent/support/filtering/JsonXContentFilteringTests.java +++ b/server/src/test/java/org/elasticsearch/common/xcontent/support/filtering/JsonXContentFilteringTests.java @@ -8,8 +8,8 @@ package org.elasticsearch.common.xcontent.support.filtering; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; public class JsonXContentFilteringTests extends AbstractXContentFilteringTestCase { diff --git a/server/src/test/java/org/elasticsearch/common/xcontent/support/filtering/SmileFilteringGeneratorTests.java b/server/src/test/java/org/elasticsearch/common/xcontent/support/filtering/SmileFilteringGeneratorTests.java index b00227671475e..7c54668d17192 100644 --- a/server/src/test/java/org/elasticsearch/common/xcontent/support/filtering/SmileFilteringGeneratorTests.java +++ b/server/src/test/java/org/elasticsearch/common/xcontent/support/filtering/SmileFilteringGeneratorTests.java @@ -8,8 +8,8 @@ package org.elasticsearch.common.xcontent.support.filtering; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; public class SmileFilteringGeneratorTests extends AbstractXContentFilteringTestCase { diff --git a/server/src/test/java/org/elasticsearch/common/xcontent/support/filtering/YamlFilteringGeneratorTests.java b/server/src/test/java/org/elasticsearch/common/xcontent/support/filtering/YamlFilteringGeneratorTests.java index 3905d6a307718..00769671707a2 100644 --- a/server/src/test/java/org/elasticsearch/common/xcontent/support/filtering/YamlFilteringGeneratorTests.java +++ b/server/src/test/java/org/elasticsearch/common/xcontent/support/filtering/YamlFilteringGeneratorTests.java @@ -8,8 +8,8 @@ package org.elasticsearch.common.xcontent.support.filtering; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; public class YamlFilteringGeneratorTests extends AbstractXContentFilteringTestCase { diff --git a/server/src/test/java/org/elasticsearch/common/xcontent/yaml/YamlXContentTests.java b/server/src/test/java/org/elasticsearch/common/xcontent/yaml/YamlXContentTests.java index a42d9c9854776..e3b4b426e2802 100644 --- a/server/src/test/java/org/elasticsearch/common/xcontent/yaml/YamlXContentTests.java +++ b/server/src/test/java/org/elasticsearch/common/xcontent/yaml/YamlXContentTests.java @@ -12,7 +12,7 @@ import com.fasterxml.jackson.dataformat.yaml.YAMLFactory; import org.elasticsearch.common.xcontent.BaseXContentTestCase; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import java.io.ByteArrayOutputStream; diff --git a/server/src/test/java/org/elasticsearch/gateway/IncrementalClusterStateWriterTests.java b/server/src/test/java/org/elasticsearch/gateway/IncrementalClusterStateWriterTests.java index 29efb51b3fe4c..e2456a0b1540e 100644 --- a/server/src/test/java/org/elasticsearch/gateway/IncrementalClusterStateWriterTests.java +++ b/server/src/test/java/org/elasticsearch/gateway/IncrementalClusterStateWriterTests.java @@ -30,9 +30,9 @@ import org.elasticsearch.common.logging.Loggers; import org.elasticsearch.common.settings.ClusterSettings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.index.Index; import org.elasticsearch.test.MockLogAppender; diff --git a/server/src/test/java/org/elasticsearch/gateway/MetadataStateFormatTests.java b/server/src/test/java/org/elasticsearch/gateway/MetadataStateFormatTests.java index c40b4c4b8b3dc..5675db036ec20 100644 --- a/server/src/test/java/org/elasticsearch/gateway/MetadataStateFormatTests.java +++ b/server/src/test/java/org/elasticsearch/gateway/MetadataStateFormatTests.java @@ -19,10 +19,10 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.cluster.ClusterModule; import org.elasticsearch.cluster.metadata.Metadata; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/http/AbstractHttpServerTransportTests.java b/server/src/test/java/org/elasticsearch/http/AbstractHttpServerTransportTests.java index f336bd0a4a033..726a48723d0db 100644 --- a/server/src/test/java/org/elasticsearch/http/AbstractHttpServerTransportTests.java +++ b/server/src/test/java/org/elasticsearch/http/AbstractHttpServerTransportTests.java @@ -25,7 +25,7 @@ import org.elasticsearch.common.util.MockBigArrays; import org.elasticsearch.common.util.MockPageCacheRecycler; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.indices.breaker.NoneCircuitBreakerService; import org.elasticsearch.rest.RestChannel; import org.elasticsearch.rest.RestRequest; diff --git a/server/src/test/java/org/elasticsearch/http/DefaultRestChannelTests.java b/server/src/test/java/org/elasticsearch/http/DefaultRestChannelTests.java index 00577bba2b038..1feb153320341 100644 --- a/server/src/test/java/org/elasticsearch/http/DefaultRestChannelTests.java +++ b/server/src/test/java/org/elasticsearch/http/DefaultRestChannelTests.java @@ -20,8 +20,8 @@ import org.elasticsearch.common.util.ByteArray; import org.elasticsearch.common.util.MockBigArrays; import org.elasticsearch.common.util.MockPageCacheRecycler; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.indices.breaker.NoneCircuitBreakerService; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestChannel; diff --git a/server/src/test/java/org/elasticsearch/http/HttpInfoTests.java b/server/src/test/java/org/elasticsearch/http/HttpInfoTests.java index d13dcea9ba752..8f68daa7cd2db 100644 --- a/server/src/test/java/org/elasticsearch/http/HttpInfoTests.java +++ b/server/src/test/java/org/elasticsearch/http/HttpInfoTests.java @@ -14,9 +14,9 @@ import org.elasticsearch.common.network.NetworkAddress; import org.elasticsearch.common.transport.BoundTransportAddress; import org.elasticsearch.common.transport.TransportAddress; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.test.ESTestCase; public class HttpInfoTests extends ESTestCase { diff --git a/server/src/test/java/org/elasticsearch/index/IndexServiceTests.java b/server/src/test/java/org/elasticsearch/index/IndexServiceTests.java index 5bb9e5a39cdf8..bdaa8689ae6d9 100644 --- a/server/src/test/java/org/elasticsearch/index/IndexServiceTests.java +++ b/server/src/test/java/org/elasticsearch/index/IndexServiceTests.java @@ -15,10 +15,10 @@ import org.elasticsearch.common.compress.CompressedXContent; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.engine.Engine; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.shard.IndexShard; diff --git a/server/src/test/java/org/elasticsearch/index/IndexTests.java b/server/src/test/java/org/elasticsearch/index/IndexTests.java index 002ae1f7ecd9f..e0934369cd93d 100644 --- a/server/src/test/java/org/elasticsearch/index/IndexTests.java +++ b/server/src/test/java/org/elasticsearch/index/IndexTests.java @@ -11,10 +11,10 @@ import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.common.UUIDs; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/index/IndexingSlowLogTests.java b/server/src/test/java/org/elasticsearch/index/IndexingSlowLogTests.java index 20a529ea29193..e6f5e167c1123 100644 --- a/server/src/test/java/org/elasticsearch/index/IndexingSlowLogTests.java +++ b/server/src/test/java/org/elasticsearch/index/IndexingSlowLogTests.java @@ -25,8 +25,8 @@ import org.elasticsearch.common.logging.MockAppender; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.IndexingSlowLog.IndexingSlowLogMessage; import org.elasticsearch.index.engine.Engine; import org.elasticsearch.index.engine.InternalEngineTests; diff --git a/server/src/test/java/org/elasticsearch/index/analysis/PreBuiltAnalyzerTests.java b/server/src/test/java/org/elasticsearch/index/analysis/PreBuiltAnalyzerTests.java index 391024547ef56..1e8ae4e69a18a 100644 --- a/server/src/test/java/org/elasticsearch/index/analysis/PreBuiltAnalyzerTests.java +++ b/server/src/test/java/org/elasticsearch/index/analysis/PreBuiltAnalyzerTests.java @@ -11,8 +11,8 @@ import org.elasticsearch.Version; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.mapper.MapperService; import org.elasticsearch.indices.analysis.PreBuiltAnalyzers; diff --git a/server/src/test/java/org/elasticsearch/index/engine/InternalEngineTests.java b/server/src/test/java/org/elasticsearch/index/engine/InternalEngineTests.java index 9ef4bbc9164d2..759626c174664 100644 --- a/server/src/test/java/org/elasticsearch/index/engine/InternalEngineTests.java +++ b/server/src/test/java/org/elasticsearch/index/engine/InternalEngineTests.java @@ -91,7 +91,7 @@ import org.elasticsearch.common.util.concurrent.AbstractRunnable; import org.elasticsearch.common.util.concurrent.ConcurrentCollections; import org.elasticsearch.common.util.concurrent.ReleasableLock; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.CheckedRunnable; import org.elasticsearch.core.TimeValue; import org.elasticsearch.core.Tuple; diff --git a/server/src/test/java/org/elasticsearch/index/fielddata/BinaryDVFieldDataTests.java b/server/src/test/java/org/elasticsearch/index/fielddata/BinaryDVFieldDataTests.java index 113bb8bf8b720..39578766c7b61 100644 --- a/server/src/test/java/org/elasticsearch/index/fielddata/BinaryDVFieldDataTests.java +++ b/server/src/test/java/org/elasticsearch/index/fielddata/BinaryDVFieldDataTests.java @@ -13,9 +13,9 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.compress.CompressedXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.MapperService; import org.elasticsearch.index.mapper.ParsedDocument; diff --git a/server/src/test/java/org/elasticsearch/index/get/DocumentFieldTests.java b/server/src/test/java/org/elasticsearch/index/get/DocumentFieldTests.java index cec785c54d062..826e8d4b6ab09 100644 --- a/server/src/test/java/org/elasticsearch/index/get/DocumentFieldTests.java +++ b/server/src/test/java/org/elasticsearch/index/get/DocumentFieldTests.java @@ -12,9 +12,9 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.core.Tuple; import org.elasticsearch.common.document.DocumentField; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.mapper.IgnoredFieldMapper; import org.elasticsearch.indices.IndicesModule; import org.elasticsearch.test.ESTestCase; diff --git a/server/src/test/java/org/elasticsearch/index/get/GetResultTests.java b/server/src/test/java/org/elasticsearch/index/get/GetResultTests.java index 76897a88cbf59..689fa659e9f0a 100644 --- a/server/src/test/java/org/elasticsearch/index/get/GetResultTests.java +++ b/server/src/test/java/org/elasticsearch/index/get/GetResultTests.java @@ -15,12 +15,12 @@ import org.elasticsearch.core.Tuple; import org.elasticsearch.common.document.DocumentField; import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.mapper.IdFieldMapper; import org.elasticsearch.index.mapper.IndexFieldMapper; import org.elasticsearch.index.mapper.SeqNoFieldMapper; diff --git a/server/src/test/java/org/elasticsearch/index/mapper/AbstractScriptFieldTypeTestCase.java b/server/src/test/java/org/elasticsearch/index/mapper/AbstractScriptFieldTypeTestCase.java index 37351407608c9..cedc12608fc4a 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/AbstractScriptFieldTypeTestCase.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/AbstractScriptFieldTypeTestCase.java @@ -14,11 +14,11 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.geo.ShapeRelation; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.query.SearchExecutionContext; import org.elasticsearch.script.BooleanFieldScript; import org.elasticsearch.script.DateFieldScript; diff --git a/server/src/test/java/org/elasticsearch/index/mapper/BinaryFieldMapperTests.java b/server/src/test/java/org/elasticsearch/index/mapper/BinaryFieldMapperTests.java index 7c6ca80dfb30e..3808a3894a239 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/BinaryFieldMapperTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/BinaryFieldMapperTests.java @@ -15,7 +15,7 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.compress.CompressorFactory; import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.io.OutputStream; diff --git a/server/src/test/java/org/elasticsearch/index/mapper/BooleanFieldMapperTests.java b/server/src/test/java/org/elasticsearch/index/mapper/BooleanFieldMapperTests.java index 06fb658ed7d91..65a80170a1c55 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/BooleanFieldMapperTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/BooleanFieldMapperTests.java @@ -14,9 +14,9 @@ import org.apache.lucene.index.SortedNumericDocValues; import org.apache.lucene.util.BytesRef; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/index/mapper/BooleanScriptFieldTypeTests.java b/server/src/test/java/org/elasticsearch/index/mapper/BooleanScriptFieldTypeTests.java index 51d098edfb67c..1e21e3dcc8b7c 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/BooleanScriptFieldTypeTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/BooleanScriptFieldTypeTests.java @@ -29,10 +29,10 @@ import org.elasticsearch.Version; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.lucene.search.function.ScriptScoreQuery; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentParser.Token; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser.Token; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.fielddata.BooleanScriptFieldData; import org.elasticsearch.index.fielddata.ScriptDocValues; import org.elasticsearch.index.query.SearchExecutionContext; diff --git a/server/src/test/java/org/elasticsearch/index/mapper/ByteFieldMapperTests.java b/server/src/test/java/org/elasticsearch/index/mapper/ByteFieldMapperTests.java index 78e4555eb98a6..23d6534d30ad2 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/ByteFieldMapperTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/ByteFieldMapperTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.index.mapper; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.mapper.NumberFieldMapper.NumberType; import org.elasticsearch.index.mapper.NumberFieldTypeTests.OutOfRangeSpec; diff --git a/server/src/test/java/org/elasticsearch/index/mapper/CompletionFieldMapperTests.java b/server/src/test/java/org/elasticsearch/index/mapper/CompletionFieldMapperTests.java index 2285087d5f517..15b2af9211f37 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/CompletionFieldMapperTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/CompletionFieldMapperTests.java @@ -29,10 +29,10 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.lucene.Lucene; import org.elasticsearch.common.unit.Fuzziness; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.analysis.AnalyzerScope; import org.elasticsearch.index.analysis.IndexAnalyzers; @@ -48,7 +48,7 @@ import java.util.Map; import java.util.function.Function; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.arrayContainingInAnyOrder; import static org.hamcrest.Matchers.arrayWithSize; import static org.hamcrest.Matchers.containsString; diff --git a/server/src/test/java/org/elasticsearch/index/mapper/CompositeRuntimeFieldTests.java b/server/src/test/java/org/elasticsearch/index/mapper/CompositeRuntimeFieldTests.java index 72d7df28c5706..443c436167119 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/CompositeRuntimeFieldTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/CompositeRuntimeFieldTests.java @@ -9,8 +9,8 @@ package org.elasticsearch.index.mapper; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.script.LongFieldScript; import org.elasticsearch.script.CompositeFieldScript; import org.elasticsearch.script.Script; diff --git a/server/src/test/java/org/elasticsearch/index/mapper/CopyToMapperTests.java b/server/src/test/java/org/elasticsearch/index/mapper/CopyToMapperTests.java index 6c0f6f3dd35f6..e757b3bb966c3 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/CopyToMapperTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/CopyToMapperTests.java @@ -10,11 +10,11 @@ import org.apache.lucene.index.IndexableField; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.hamcrest.Matchers; import java.io.IOException; @@ -22,7 +22,7 @@ import java.util.List; import java.util.Map; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.startsWith; diff --git a/server/src/test/java/org/elasticsearch/index/mapper/DateFieldMapperTests.java b/server/src/test/java/org/elasticsearch/index/mapper/DateFieldMapperTests.java index b03421c2146a4..205f081b5ae83 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/DateFieldMapperTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/DateFieldMapperTests.java @@ -14,7 +14,7 @@ import org.elasticsearch.jdk.JavaVersion; import org.elasticsearch.common.time.DateFormatter; import org.elasticsearch.common.time.DateUtils; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.mapper.DateFieldMapper.DateFieldType; import org.elasticsearch.index.termvectors.TermVectorsService; import org.elasticsearch.search.DocValueFormat; diff --git a/server/src/test/java/org/elasticsearch/index/mapper/DateScriptFieldTypeTests.java b/server/src/test/java/org/elasticsearch/index/mapper/DateScriptFieldTypeTests.java index b676982ada9aa..71fe242816986 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/DateScriptFieldTypeTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/DateScriptFieldTypeTests.java @@ -35,7 +35,7 @@ import org.elasticsearch.common.geo.ShapeRelation; import org.elasticsearch.common.lucene.search.function.ScriptScoreQuery; import org.elasticsearch.common.time.DateFormatter; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.fielddata.ScriptDocValues; import org.elasticsearch.index.query.SearchExecutionContext; import org.elasticsearch.index.fielddata.DateScriptFieldData; diff --git a/server/src/test/java/org/elasticsearch/index/mapper/DocumentParserTests.java b/server/src/test/java/org/elasticsearch/index/mapper/DocumentParserTests.java index e1b1e2849ee00..6089dfd478aa4 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/DocumentParserTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/DocumentParserTests.java @@ -17,10 +17,10 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.plugins.MapperPlugin; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.script.CompositeFieldScript; diff --git a/server/src/test/java/org/elasticsearch/index/mapper/DoubleFieldMapperTests.java b/server/src/test/java/org/elasticsearch/index/mapper/DoubleFieldMapperTests.java index 9a19782f18449..a0eddffdac810 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/DoubleFieldMapperTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/DoubleFieldMapperTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.index.mapper; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.mapper.NumberFieldTypeTests.OutOfRangeSpec; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/index/mapper/DynamicMappingTests.java b/server/src/test/java/org/elasticsearch/index/mapper/DynamicMappingTests.java index 13949866e770c..4f91a616d409a 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/DynamicMappingTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/DynamicMappingTests.java @@ -9,8 +9,8 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.core.CheckedConsumer; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/index/mapper/DynamicTemplateTests.java b/server/src/test/java/org/elasticsearch/index/mapper/DynamicTemplateTests.java index 1c9da4df2b460..df2597fe952d0 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/DynamicTemplateTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/DynamicTemplateTests.java @@ -9,9 +9,9 @@ package org.elasticsearch.index.mapper; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.mapper.DynamicTemplate.XContentFieldType; import org.elasticsearch.test.ESTestCase; diff --git a/server/src/test/java/org/elasticsearch/index/mapper/DynamicTemplatesTests.java b/server/src/test/java/org/elasticsearch/index/mapper/DynamicTemplatesTests.java index 545275c0fdb26..f9e6924a26a4b 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/DynamicTemplatesTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/DynamicTemplatesTests.java @@ -16,9 +16,9 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.compress.CompressedXContent; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.VersionUtils; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/index/mapper/FieldAliasMapperTests.java b/server/src/test/java/org/elasticsearch/index/mapper/FieldAliasMapperTests.java index b246b1edcf0c8..6097542bf9fab 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/FieldAliasMapperTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/FieldAliasMapperTests.java @@ -9,7 +9,7 @@ package org.elasticsearch.index.mapper; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentFactory; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/index/mapper/FieldFilterMapperPluginTests.java b/server/src/test/java/org/elasticsearch/index/mapper/FieldFilterMapperPluginTests.java index 0156087d053f3..33c7b063ab53a 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/FieldFilterMapperPluginTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/FieldFilterMapperPluginTests.java @@ -17,7 +17,7 @@ import org.elasticsearch.action.fieldcaps.FieldCapabilitiesResponse; import org.elasticsearch.cluster.metadata.MappingMetadata; import org.elasticsearch.common.collect.ImmutableOpenMap; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.indices.IndicesModule; import org.elasticsearch.plugins.MapperPlugin; import org.elasticsearch.plugins.Plugin; diff --git a/server/src/test/java/org/elasticsearch/index/mapper/FieldNamesFieldMapperTests.java b/server/src/test/java/org/elasticsearch/index/mapper/FieldNamesFieldMapperTests.java index f7e1d4754033e..5beb0d6ac5d37 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/FieldNamesFieldMapperTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/FieldNamesFieldMapperTests.java @@ -11,8 +11,8 @@ import org.apache.lucene.index.IndexOptions; import org.elasticsearch.Version; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.termvectors.TermVectorsService; import org.elasticsearch.test.VersionUtils; diff --git a/server/src/test/java/org/elasticsearch/index/mapper/FloatFieldMapperTests.java b/server/src/test/java/org/elasticsearch/index/mapper/FloatFieldMapperTests.java index 7a44465c805a9..a0dc9129f8200 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/FloatFieldMapperTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/FloatFieldMapperTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.index.mapper; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.mapper.NumberFieldTypeTests.OutOfRangeSpec; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/index/mapper/GeoPointFieldMapperTests.java b/server/src/test/java/org/elasticsearch/index/mapper/GeoPointFieldMapperTests.java index 60ea239853f52..a6595c7823fa8 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/GeoPointFieldMapperTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/GeoPointFieldMapperTests.java @@ -9,8 +9,8 @@ import org.apache.lucene.util.BytesRef; import org.elasticsearch.common.geo.GeoPoint; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.hamcrest.CoreMatchers; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/index/mapper/GeoShapeFieldMapperTests.java b/server/src/test/java/org/elasticsearch/index/mapper/GeoShapeFieldMapperTests.java index 2647368407a7f..f1a272fb6b306 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/GeoShapeFieldMapperTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/GeoShapeFieldMapperTests.java @@ -9,8 +9,8 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.geo.Orientation; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.test.TestGeoShapeFieldMapperPlugin; diff --git a/server/src/test/java/org/elasticsearch/index/mapper/HalfFloatFieldMapperTests.java b/server/src/test/java/org/elasticsearch/index/mapper/HalfFloatFieldMapperTests.java index 7c217d71ac279..8d3668f916ca7 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/HalfFloatFieldMapperTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/HalfFloatFieldMapperTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.index.mapper; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.mapper.NumberFieldMapper.NumberType; import org.elasticsearch.index.mapper.NumberFieldTypeTests.OutOfRangeSpec; diff --git a/server/src/test/java/org/elasticsearch/index/mapper/IntegerFieldMapperTests.java b/server/src/test/java/org/elasticsearch/index/mapper/IntegerFieldMapperTests.java index 3df1442232eb1..20a32119ff2b9 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/IntegerFieldMapperTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/IntegerFieldMapperTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.index.mapper; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.mapper.NumberFieldMapper.NumberType; import org.elasticsearch.index.mapper.NumberFieldTypeTests.OutOfRangeSpec; diff --git a/server/src/test/java/org/elasticsearch/index/mapper/IpFieldMapperTests.java b/server/src/test/java/org/elasticsearch/index/mapper/IpFieldMapperTests.java index 5011c60f9141f..d8a4d0a40de68 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/IpFieldMapperTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/IpFieldMapperTests.java @@ -18,7 +18,7 @@ import org.elasticsearch.Version; import org.elasticsearch.common.network.InetAddresses; import org.elasticsearch.common.network.NetworkAddress; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.termvectors.TermVectorsService; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/index/mapper/JavaMultiFieldMergeTests.java b/server/src/test/java/org/elasticsearch/index/mapper/JavaMultiFieldMergeTests.java index e3f22a9cd41c5..6c5c680e1d64d 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/JavaMultiFieldMergeTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/JavaMultiFieldMergeTests.java @@ -11,8 +11,8 @@ import org.apache.lucene.index.IndexableField; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.compress.CompressedXContent; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import static org.elasticsearch.test.StreamsUtils.copyToStringFromClasspath; import static org.hamcrest.Matchers.containsString; diff --git a/server/src/test/java/org/elasticsearch/index/mapper/KeywordFieldMapperTests.java b/server/src/test/java/org/elasticsearch/index/mapper/KeywordFieldMapperTests.java index 774eb5bada910..3e33f32020169 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/KeywordFieldMapperTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/KeywordFieldMapperTests.java @@ -21,7 +21,7 @@ import org.apache.lucene.index.IndexableFieldType; import org.apache.lucene.util.BytesRef; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.analysis.AnalyzerScope; import org.elasticsearch.index.analysis.CharFilterFactory; diff --git a/server/src/test/java/org/elasticsearch/index/mapper/LongFieldMapperTests.java b/server/src/test/java/org/elasticsearch/index/mapper/LongFieldMapperTests.java index 361bce199b6f1..36065921bdae7 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/LongFieldMapperTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/LongFieldMapperTests.java @@ -9,8 +9,8 @@ package org.elasticsearch.index.mapper; import org.elasticsearch.common.bytes.BytesArray; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.mapper.NumberFieldTypeTests.OutOfRangeSpec; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/index/mapper/MapperServiceTests.java b/server/src/test/java/org/elasticsearch/index/mapper/MapperServiceTests.java index 25f718ed45e6f..00575dcab32a9 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/MapperServiceTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/MapperServiceTests.java @@ -13,8 +13,8 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.compress.CompressedXContent; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.index.mapper.MapperService.MergeReason; import org.elasticsearch.indices.IndicesModule; import org.elasticsearch.test.VersionUtils; diff --git a/server/src/test/java/org/elasticsearch/index/mapper/MappingParserTests.java b/server/src/test/java/org/elasticsearch/index/mapper/MappingParserTests.java index b706834c7089f..209ee41fd07f1 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/MappingParserTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/MappingParserTests.java @@ -12,7 +12,7 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.compress.CompressedXContent; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.analysis.IndexAnalyzers; import org.elasticsearch.index.similarity.SimilarityService; diff --git a/server/src/test/java/org/elasticsearch/index/mapper/MultiFieldTests.java b/server/src/test/java/org/elasticsearch/index/mapper/MultiFieldTests.java index 3b7aeedd42105..c7983a0a16631 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/MultiFieldTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/MultiFieldTests.java @@ -14,7 +14,7 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.index.mapper.TextFieldMapper.TextFieldType; diff --git a/server/src/test/java/org/elasticsearch/index/mapper/NestedObjectMapperTests.java b/server/src/test/java/org/elasticsearch/index/mapper/NestedObjectMapperTests.java index f2a31bc81b3f1..dd784e4dea8d9 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/NestedObjectMapperTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/NestedObjectMapperTests.java @@ -14,9 +14,9 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.compress.CompressedXContent; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.mapper.MapperService.MergeReason; import org.elasticsearch.index.mapper.ObjectMapper.Dynamic; import org.elasticsearch.test.VersionUtils; diff --git a/server/src/test/java/org/elasticsearch/index/mapper/NestedPathFieldMapperTests.java b/server/src/test/java/org/elasticsearch/index/mapper/NestedPathFieldMapperTests.java index c97bcf709f5a3..55d1ba369fcb2 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/NestedPathFieldMapperTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/NestedPathFieldMapperTests.java @@ -10,7 +10,7 @@ import org.apache.lucene.index.IndexableField; import org.elasticsearch.common.bytes.BytesArray; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.util.Arrays; diff --git a/server/src/test/java/org/elasticsearch/index/mapper/NullValueObjectMappingTests.java b/server/src/test/java/org/elasticsearch/index/mapper/NullValueObjectMappingTests.java index 7947216726ea0..30a55671621b8 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/NullValueObjectMappingTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/NullValueObjectMappingTests.java @@ -9,8 +9,8 @@ package org.elasticsearch.index.mapper; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/index/mapper/NullValueTests.java b/server/src/test/java/org/elasticsearch/index/mapper/NullValueTests.java index 52f3a8b77d116..c4e3193330e25 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/NullValueTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/NullValueTests.java @@ -9,9 +9,9 @@ package org.elasticsearch.index.mapper; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import java.util.Map; diff --git a/server/src/test/java/org/elasticsearch/index/mapper/NumberFieldMapperTests.java b/server/src/test/java/org/elasticsearch/index/mapper/NumberFieldMapperTests.java index b1b62f3beb5e1..e625e5cc9e886 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/NumberFieldMapperTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/NumberFieldMapperTests.java @@ -11,7 +11,7 @@ import org.apache.lucene.index.DocValuesType; import org.apache.lucene.index.IndexableField; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.mapper.NumberFieldTypeTests.OutOfRangeSpec; import org.elasticsearch.index.termvectors.TermVectorsService; import org.elasticsearch.script.DoubleFieldScript; diff --git a/server/src/test/java/org/elasticsearch/index/mapper/NumberFieldTypeTests.java b/server/src/test/java/org/elasticsearch/index/mapper/NumberFieldTypeTests.java index fa8aa3f0e5fae..5c845d33024b1 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/NumberFieldTypeTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/NumberFieldTypeTests.java @@ -32,8 +32,8 @@ import org.elasticsearch.Version; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.internal.io.IOUtils; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.fielddata.IndexNumericFieldData; diff --git a/server/src/test/java/org/elasticsearch/index/mapper/ObjectMapperTests.java b/server/src/test/java/org/elasticsearch/index/mapper/ObjectMapperTests.java index 4ab70e63063eb..2d53b5566974e 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/ObjectMapperTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/ObjectMapperTests.java @@ -12,8 +12,8 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.compress.CompressedXContent; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.mapper.MapperService.MergeReason; import org.elasticsearch.index.mapper.ObjectMapper.Dynamic; diff --git a/server/src/test/java/org/elasticsearch/index/mapper/ParametrizedMapperTests.java b/server/src/test/java/org/elasticsearch/index/mapper/ParametrizedMapperTests.java index e2d7eddfed211..9f0a68c938217 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/ParametrizedMapperTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/ParametrizedMapperTests.java @@ -13,10 +13,10 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.compress.CompressedXContent; import org.elasticsearch.common.lucene.Lucene; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.analysis.AnalyzerScope; import org.elasticsearch.index.analysis.IndexAnalyzers; import org.elasticsearch.index.analysis.NamedAnalyzer; diff --git a/server/src/test/java/org/elasticsearch/index/mapper/PathMatchDynamicTemplateTests.java b/server/src/test/java/org/elasticsearch/index/mapper/PathMatchDynamicTemplateTests.java index fc98b115d794f..54fb5ab052997 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/PathMatchDynamicTemplateTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/PathMatchDynamicTemplateTests.java @@ -10,7 +10,7 @@ import org.apache.lucene.index.IndexableField; import org.elasticsearch.common.bytes.BytesArray; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import static org.elasticsearch.test.StreamsUtils.copyToBytesFromClasspath; import static org.elasticsearch.test.StreamsUtils.copyToStringFromClasspath; diff --git a/server/src/test/java/org/elasticsearch/index/mapper/RangeFieldMapperTests.java b/server/src/test/java/org/elasticsearch/index/mapper/RangeFieldMapperTests.java index 4e57219fee68a..2209503935429 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/RangeFieldMapperTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/RangeFieldMapperTests.java @@ -14,9 +14,9 @@ import org.elasticsearch.core.CheckedConsumer; import org.elasticsearch.common.Strings; import org.elasticsearch.common.network.InetAddresses; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import java.io.IOException; import java.net.InetAddress; diff --git a/server/src/test/java/org/elasticsearch/index/mapper/ReloadableAnalyzerTests.java b/server/src/test/java/org/elasticsearch/index/mapper/ReloadableAnalyzerTests.java index 6c6c2906a935e..191922892fd3c 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/ReloadableAnalyzerTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/ReloadableAnalyzerTests.java @@ -13,7 +13,7 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.compress.CompressedXContent; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.index.analysis.AnalysisMode; import org.elasticsearch.index.analysis.AnalysisRegistry; import org.elasticsearch.index.analysis.IndexAnalyzers; diff --git a/server/src/test/java/org/elasticsearch/index/mapper/RootObjectMapperTests.java b/server/src/test/java/org/elasticsearch/index/mapper/RootObjectMapperTests.java index 154dcff84a985..9d920c4aebe69 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/RootObjectMapperTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/RootObjectMapperTests.java @@ -9,8 +9,8 @@ package org.elasticsearch.index.mapper; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.index.mapper.MapperService.MergeReason; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/index/mapper/RoutingFieldMapperTests.java b/server/src/test/java/org/elasticsearch/index/mapper/RoutingFieldMapperTests.java index 9183cbbf1f7b7..e855843e7cc03 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/RoutingFieldMapperTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/RoutingFieldMapperTests.java @@ -9,8 +9,8 @@ package org.elasticsearch.index.mapper; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.util.Map; diff --git a/server/src/test/java/org/elasticsearch/index/mapper/ShortFieldMapperTests.java b/server/src/test/java/org/elasticsearch/index/mapper/ShortFieldMapperTests.java index a78e6234b7877..78baafb1bbc0c 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/ShortFieldMapperTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/ShortFieldMapperTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.index.mapper; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.mapper.NumberFieldMapper.NumberType; import org.elasticsearch.index.mapper.NumberFieldTypeTests.OutOfRangeSpec; diff --git a/server/src/test/java/org/elasticsearch/index/mapper/SourceFieldMapperTests.java b/server/src/test/java/org/elasticsearch/index/mapper/SourceFieldMapperTests.java index 9221af4ed1925..fcc80ced2fe15 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/SourceFieldMapperTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/SourceFieldMapperTests.java @@ -11,11 +11,11 @@ import org.apache.lucene.index.IndexableField; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import java.io.IOException; import java.util.Map; diff --git a/server/src/test/java/org/elasticsearch/index/mapper/StoredNumericValuesTests.java b/server/src/test/java/org/elasticsearch/index/mapper/StoredNumericValuesTests.java index 82153fb65ba40..2a3f70d2e3d0e 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/StoredNumericValuesTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/StoredNumericValuesTests.java @@ -11,8 +11,8 @@ import org.apache.lucene.search.IndexSearcher; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.fieldvisitor.CustomFieldsVisitor; import java.util.Set; diff --git a/server/src/test/java/org/elasticsearch/index/mapper/TestRuntimeField.java b/server/src/test/java/org/elasticsearch/index/mapper/TestRuntimeField.java index 15f94065bb968..f25374b91fda2 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/TestRuntimeField.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/TestRuntimeField.java @@ -9,7 +9,7 @@ package org.elasticsearch.index.mapper; import org.apache.lucene.search.Query; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.query.SearchExecutionContext; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/index/mapper/TextFieldMapperTests.java b/server/src/test/java/org/elasticsearch/index/mapper/TextFieldMapperTests.java index 4d220a0b09ef4..05f004f795e7f 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/TextFieldMapperTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/TextFieldMapperTests.java @@ -45,9 +45,9 @@ import org.apache.lucene.util.BytesRef; import org.elasticsearch.common.Strings; import org.elasticsearch.common.lucene.search.MultiPhrasePrefixQuery; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.analysis.AnalyzerScope; import org.elasticsearch.index.analysis.CharFilterFactory; diff --git a/server/src/test/java/org/elasticsearch/index/mapper/TypeParsersTests.java b/server/src/test/java/org/elasticsearch/index/mapper/TypeParsersTests.java index 5f73ea4ceccb9..c3835e3a5897b 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/TypeParsersTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/TypeParsersTests.java @@ -10,8 +10,8 @@ import org.elasticsearch.Version; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; import org.elasticsearch.index.analysis.AnalyzerScope; import org.elasticsearch.index.analysis.IndexAnalyzers; diff --git a/server/src/test/java/org/elasticsearch/index/mapper/UpdateMappingTests.java b/server/src/test/java/org/elasticsearch/index/mapper/UpdateMappingTests.java index 5a46d1f16587b..397b49c0be13f 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/UpdateMappingTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/UpdateMappingTests.java @@ -14,8 +14,8 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.compress.CompressedXContent; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.index.IndexService; import org.elasticsearch.index.mapper.MapperService.MergeReason; import org.elasticsearch.plugins.Plugin; diff --git a/server/src/test/java/org/elasticsearch/index/mapper/flattened/FlattenedFieldMapperTests.java b/server/src/test/java/org/elasticsearch/index/mapper/flattened/FlattenedFieldMapperTests.java index b6ed5a0c64af1..77d1723825a70 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/flattened/FlattenedFieldMapperTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/flattened/FlattenedFieldMapperTests.java @@ -13,8 +13,8 @@ import org.apache.lucene.util.BytesRef; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.FieldMapper; import org.elasticsearch.index.mapper.FieldNamesFieldMapper; diff --git a/server/src/test/java/org/elasticsearch/index/mapper/flattened/FlattenedFieldParserTests.java b/server/src/test/java/org/elasticsearch/index/mapper/flattened/FlattenedFieldParserTests.java index 64df4068efe19..7ed46309ef77d 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/flattened/FlattenedFieldParserTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/flattened/FlattenedFieldParserTests.java @@ -12,10 +12,10 @@ import org.apache.lucene.index.IndexableField; import org.apache.lucene.util.BytesRef; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.mapper.MockFieldMapper.FakeFieldType; import org.elasticsearch.test.ESTestCase; diff --git a/server/src/test/java/org/elasticsearch/index/mapper/flattened/FlattenedFieldSearchTests.java b/server/src/test/java/org/elasticsearch/index/mapper/flattened/FlattenedFieldSearchTests.java index ebed0a5cd2d35..475641ec67a60 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/flattened/FlattenedFieldSearchTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/flattened/FlattenedFieldSearchTests.java @@ -14,8 +14,8 @@ import org.elasticsearch.action.support.WriteRequest.RefreshPolicy; import org.elasticsearch.common.document.DocumentField; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.search.aggregations.Aggregator; import org.elasticsearch.search.aggregations.bucket.terms.Terms; import org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder; diff --git a/server/src/test/java/org/elasticsearch/index/query/AbstractQueryBuilderTests.java b/server/src/test/java/org/elasticsearch/index/query/AbstractQueryBuilderTests.java index 45d644d9e9058..f58c8bf959ba2 100644 --- a/server/src/test/java/org/elasticsearch/index/query/AbstractQueryBuilderTests.java +++ b/server/src/test/java/org/elasticsearch/index/query/AbstractQueryBuilderTests.java @@ -10,9 +10,9 @@ import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.search.SearchModule; import org.elasticsearch.test.ESTestCase; import org.junit.AfterClass; diff --git a/server/src/test/java/org/elasticsearch/index/query/BoolQueryBuilderTests.java b/server/src/test/java/org/elasticsearch/index/query/BoolQueryBuilderTests.java index bb4561159b708..7b16d5c337df3 100644 --- a/server/src/test/java/org/elasticsearch/index/query/BoolQueryBuilderTests.java +++ b/server/src/test/java/org/elasticsearch/index/query/BoolQueryBuilderTests.java @@ -13,12 +13,12 @@ import org.apache.lucene.search.MatchAllDocsQuery; import org.apache.lucene.search.MatchNoDocsQuery; import org.apache.lucene.search.Query; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.AbstractQueryTestCase; import org.hamcrest.Matchers; diff --git a/server/src/test/java/org/elasticsearch/index/query/CombineIntervalsSourceProviderTests.java b/server/src/test/java/org/elasticsearch/index/query/CombineIntervalsSourceProviderTests.java index b4b6b27f8b5f0..b4101453e5f4a 100644 --- a/server/src/test/java/org/elasticsearch/index/query/CombineIntervalsSourceProviderTests.java +++ b/server/src/test/java/org/elasticsearch/index/query/CombineIntervalsSourceProviderTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.SearchModule; import org.elasticsearch.test.AbstractSerializingTestCase; diff --git a/server/src/test/java/org/elasticsearch/index/query/CombinedFieldsQueryParsingTests.java b/server/src/test/java/org/elasticsearch/index/query/CombinedFieldsQueryParsingTests.java index 995d87efc4711..4c39bc2133242 100644 --- a/server/src/test/java/org/elasticsearch/index/query/CombinedFieldsQueryParsingTests.java +++ b/server/src/test/java/org/elasticsearch/index/query/CombinedFieldsQueryParsingTests.java @@ -22,7 +22,7 @@ import org.apache.lucene.search.Query; import org.apache.lucene.util.BytesRef; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.analysis.AnalyzerScope; import org.elasticsearch.index.analysis.IndexAnalyzers; diff --git a/server/src/test/java/org/elasticsearch/index/query/DisjunctionIntervalsSourceProviderTests.java b/server/src/test/java/org/elasticsearch/index/query/DisjunctionIntervalsSourceProviderTests.java index 6b3c59fe644de..3865676357a7b 100644 --- a/server/src/test/java/org/elasticsearch/index/query/DisjunctionIntervalsSourceProviderTests.java +++ b/server/src/test/java/org/elasticsearch/index/query/DisjunctionIntervalsSourceProviderTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.SearchModule; import org.elasticsearch.test.AbstractSerializingTestCase; diff --git a/server/src/test/java/org/elasticsearch/index/query/FilterIntervalsSourceProviderTests.java b/server/src/test/java/org/elasticsearch/index/query/FilterIntervalsSourceProviderTests.java index ce10131b55140..51a11b4a150bf 100644 --- a/server/src/test/java/org/elasticsearch/index/query/FilterIntervalsSourceProviderTests.java +++ b/server/src/test/java/org/elasticsearch/index/query/FilterIntervalsSourceProviderTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.script.Script; import org.elasticsearch.script.ScriptType; import org.elasticsearch.search.SearchModule; diff --git a/server/src/test/java/org/elasticsearch/index/query/FuzzyIntervalsSourceProviderTests.java b/server/src/test/java/org/elasticsearch/index/query/FuzzyIntervalsSourceProviderTests.java index 63bc6c443efb9..7eff10d7f971d 100644 --- a/server/src/test/java/org/elasticsearch/index/query/FuzzyIntervalsSourceProviderTests.java +++ b/server/src/test/java/org/elasticsearch/index/query/FuzzyIntervalsSourceProviderTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.unit.Fuzziness; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.query.IntervalsSourceProvider.Fuzzy; import org.elasticsearch.test.AbstractSerializingTestCase; diff --git a/server/src/test/java/org/elasticsearch/index/query/GeoShapeQueryBuilderTests.java b/server/src/test/java/org/elasticsearch/index/query/GeoShapeQueryBuilderTests.java index c006f18b7bde4..4d367c98d27ac 100644 --- a/server/src/test/java/org/elasticsearch/index/query/GeoShapeQueryBuilderTests.java +++ b/server/src/test/java/org/elasticsearch/index/query/GeoShapeQueryBuilderTests.java @@ -17,10 +17,10 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.geo.GeometryTestUtils; import org.elasticsearch.geometry.Geometry; import org.elasticsearch.geometry.Rectangle; diff --git a/server/src/test/java/org/elasticsearch/index/query/IdsQueryBuilderTests.java b/server/src/test/java/org/elasticsearch/index/query/IdsQueryBuilderTests.java index 89260d4182903..dbc39ba367d46 100644 --- a/server/src/test/java/org/elasticsearch/index/query/IdsQueryBuilderTests.java +++ b/server/src/test/java/org/elasticsearch/index/query/IdsQueryBuilderTests.java @@ -13,7 +13,7 @@ import org.apache.lucene.search.Query; import org.apache.lucene.search.TermInSetQuery; import org.elasticsearch.common.ParsingException; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractQueryTestCase; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/index/query/InnerHitBuilderTests.java b/server/src/test/java/org/elasticsearch/index/query/InnerHitBuilderTests.java index 309d34903f2a8..cf9e37d02d93e 100644 --- a/server/src/test/java/org/elasticsearch/index/query/InnerHitBuilderTests.java +++ b/server/src/test/java/org/elasticsearch/index/query/InnerHitBuilderTests.java @@ -11,12 +11,12 @@ import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.script.Script; import org.elasticsearch.script.ScriptType; import org.elasticsearch.search.SearchModule; diff --git a/server/src/test/java/org/elasticsearch/index/query/IntervalQueryBuilderTests.java b/server/src/test/java/org/elasticsearch/index/query/IntervalQueryBuilderTests.java index 77c999f45cd7a..ded26ba7d49ef 100644 --- a/server/src/test/java/org/elasticsearch/index/query/IntervalQueryBuilderTests.java +++ b/server/src/test/java/org/elasticsearch/index/query/IntervalQueryBuilderTests.java @@ -21,7 +21,7 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.compress.CompressedXContent; import org.elasticsearch.common.unit.Fuzziness; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.mapper.MapperService; import org.elasticsearch.script.Script; import org.elasticsearch.script.ScriptContext; @@ -33,7 +33,7 @@ import java.util.Collections; import java.util.List; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.instanceOf; diff --git a/server/src/test/java/org/elasticsearch/index/query/MatchIntervalsSourceProviderTests.java b/server/src/test/java/org/elasticsearch/index/query/MatchIntervalsSourceProviderTests.java index 4b3e9049c09e5..4b5579b73fe12 100644 --- a/server/src/test/java/org/elasticsearch/index/query/MatchIntervalsSourceProviderTests.java +++ b/server/src/test/java/org/elasticsearch/index/query/MatchIntervalsSourceProviderTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.SearchModule; import org.elasticsearch.test.AbstractSerializingTestCase; diff --git a/server/src/test/java/org/elasticsearch/index/query/MoreLikeThisQueryBuilderTests.java b/server/src/test/java/org/elasticsearch/index/query/MoreLikeThisQueryBuilderTests.java index 80b939014a614..7b4673d2d6abe 100644 --- a/server/src/test/java/org/elasticsearch/index/query/MoreLikeThisQueryBuilderTests.java +++ b/server/src/test/java/org/elasticsearch/index/query/MoreLikeThisQueryBuilderTests.java @@ -29,11 +29,11 @@ import org.elasticsearch.common.lucene.search.MoreLikeThisQuery; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.CollectionUtils; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.VersionType; import org.elasticsearch.index.query.MoreLikeThisQueryBuilder.Item; import org.elasticsearch.test.AbstractQueryTestCase; diff --git a/server/src/test/java/org/elasticsearch/index/query/PrefixIntervalsSourceProviderTests.java b/server/src/test/java/org/elasticsearch/index/query/PrefixIntervalsSourceProviderTests.java index 2de71dd0c819b..c8d1ccc3879b4 100644 --- a/server/src/test/java/org/elasticsearch/index/query/PrefixIntervalsSourceProviderTests.java +++ b/server/src/test/java/org/elasticsearch/index/query/PrefixIntervalsSourceProviderTests.java @@ -9,7 +9,7 @@ package org.elasticsearch.index.query; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/index/query/QueryStringQueryBuilderTests.java b/server/src/test/java/org/elasticsearch/index/query/QueryStringQueryBuilderTests.java index d6c106aa1a9e3..6f53a08d9d3e8 100644 --- a/server/src/test/java/org/elasticsearch/index/query/QueryStringQueryBuilderTests.java +++ b/server/src/test/java/org/elasticsearch/index/query/QueryStringQueryBuilderTests.java @@ -47,8 +47,8 @@ import org.elasticsearch.common.compress.CompressedXContent; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.Fuzziness; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.mapper.MapperService; import org.elasticsearch.index.search.QueryStringQueryParser; import org.elasticsearch.test.AbstractQueryTestCase; @@ -66,7 +66,7 @@ import java.util.Locale; import java.util.Map; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.AbstractQueryBuilder.parseInnerQueryBuilder; import static org.elasticsearch.index.query.QueryBuilders.queryStringQuery; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertBooleanSubQuery; diff --git a/server/src/test/java/org/elasticsearch/index/query/RangeQueryRewriteTests.java b/server/src/test/java/org/elasticsearch/index/query/RangeQueryRewriteTests.java index 2efcb15422a43..554a7ae8cabe8 100644 --- a/server/src/test/java/org/elasticsearch/index/query/RangeQueryRewriteTests.java +++ b/server/src/test/java/org/elasticsearch/index/query/RangeQueryRewriteTests.java @@ -13,7 +13,7 @@ import org.apache.lucene.search.IndexSearcher; import org.elasticsearch.common.Strings; import org.elasticsearch.common.compress.CompressedXContent; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.index.IndexService; import org.elasticsearch.index.mapper.MappedFieldType.Relation; import org.elasticsearch.index.mapper.MapperService.MergeReason; diff --git a/server/src/test/java/org/elasticsearch/index/query/SearchExecutionContextTests.java b/server/src/test/java/org/elasticsearch/index/query/SearchExecutionContextTests.java index 4caa677c6cc0e..a3bfc11c74e17 100644 --- a/server/src/test/java/org/elasticsearch/index/query/SearchExecutionContextTests.java +++ b/server/src/test/java/org/elasticsearch/index/query/SearchExecutionContextTests.java @@ -29,8 +29,8 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.BigArrays; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.analysis.AnalyzerScope; import org.elasticsearch.index.analysis.IndexAnalyzers; diff --git a/server/src/test/java/org/elasticsearch/index/query/SpanFirstQueryBuilderTests.java b/server/src/test/java/org/elasticsearch/index/query/SpanFirstQueryBuilderTests.java index 4d01b52e109fd..5a27431d6b6de 100644 --- a/server/src/test/java/org/elasticsearch/index/query/SpanFirstQueryBuilderTests.java +++ b/server/src/test/java/org/elasticsearch/index/query/SpanFirstQueryBuilderTests.java @@ -12,8 +12,8 @@ import org.apache.lucene.search.Query; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.test.AbstractQueryTestCase; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/index/query/SpanMultiTermQueryBuilderTests.java b/server/src/test/java/org/elasticsearch/index/query/SpanMultiTermQueryBuilderTests.java index 2cffbc2c220a0..6724be30263f1 100644 --- a/server/src/test/java/org/elasticsearch/index/query/SpanMultiTermQueryBuilderTests.java +++ b/server/src/test/java/org/elasticsearch/index/query/SpanMultiTermQueryBuilderTests.java @@ -32,14 +32,14 @@ import org.elasticsearch.common.compress.CompressedXContent; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.lucene.search.SpanBooleanQueryRewriteWithMaxClause; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.mapper.MapperService; import org.elasticsearch.test.AbstractQueryTestCase; import java.io.IOException; import static java.util.Collections.singleton; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.CoreMatchers.containsString; import static org.hamcrest.CoreMatchers.either; import static org.hamcrest.CoreMatchers.equalTo; diff --git a/server/src/test/java/org/elasticsearch/index/query/SpanNotQueryBuilderTests.java b/server/src/test/java/org/elasticsearch/index/query/SpanNotQueryBuilderTests.java index 398af982d36bd..9c470ece331a6 100644 --- a/server/src/test/java/org/elasticsearch/index/query/SpanNotQueryBuilderTests.java +++ b/server/src/test/java/org/elasticsearch/index/query/SpanNotQueryBuilderTests.java @@ -12,8 +12,8 @@ import org.apache.lucene.search.Query; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.test.AbstractQueryTestCase; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/index/query/TermsQueryBuilderTests.java b/server/src/test/java/org/elasticsearch/index/query/TermsQueryBuilderTests.java index 430ddb5c5f3a0..89d3a81d1ba4f 100644 --- a/server/src/test/java/org/elasticsearch/index/query/TermsQueryBuilderTests.java +++ b/server/src/test/java/org/elasticsearch/index/query/TermsQueryBuilderTests.java @@ -22,9 +22,9 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.get.GetResult; import org.elasticsearch.indices.TermsLookup; import org.elasticsearch.test.AbstractQueryTestCase; diff --git a/server/src/test/java/org/elasticsearch/index/query/WildcardIntervalsSourceProviderTests.java b/server/src/test/java/org/elasticsearch/index/query/WildcardIntervalsSourceProviderTests.java index d0e8c1bc2b4fc..c4bfe5405f5c6 100644 --- a/server/src/test/java/org/elasticsearch/index/query/WildcardIntervalsSourceProviderTests.java +++ b/server/src/test/java/org/elasticsearch/index/query/WildcardIntervalsSourceProviderTests.java @@ -9,7 +9,7 @@ package org.elasticsearch.index.query; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/index/query/WrapperQueryBuilderTests.java b/server/src/test/java/org/elasticsearch/index/query/WrapperQueryBuilderTests.java index 2784da2ff0a35..f97369a2b0fab 100644 --- a/server/src/test/java/org/elasticsearch/index/query/WrapperQueryBuilderTests.java +++ b/server/src/test/java/org/elasticsearch/index/query/WrapperQueryBuilderTests.java @@ -17,7 +17,7 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.AbstractQueryTestCase; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/index/query/functionscore/FunctionScoreQueryBuilderTests.java b/server/src/test/java/org/elasticsearch/index/query/functionscore/FunctionScoreQueryBuilderTests.java index 95bd2b0eef61c..be4a8e579886c 100644 --- a/server/src/test/java/org/elasticsearch/index/query/functionscore/FunctionScoreQueryBuilderTests.java +++ b/server/src/test/java/org/elasticsearch/index/query/functionscore/FunctionScoreQueryBuilderTests.java @@ -33,8 +33,8 @@ import org.elasticsearch.common.lucene.search.function.WeightFactorFunction; import org.elasticsearch.common.unit.DistanceUnit; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.mapper.SeqNoFieldMapper; import org.elasticsearch.index.query.MatchAllQueryBuilder; import org.elasticsearch.index.query.MatchNoneQueryBuilder; @@ -67,7 +67,7 @@ import java.util.Map; import static java.util.Collections.singletonList; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.functionScoreQuery; import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery; import static org.elasticsearch.index.query.QueryBuilders.termQuery; diff --git a/server/src/test/java/org/elasticsearch/index/query/plugin/DummyQueryBuilder.java b/server/src/test/java/org/elasticsearch/index/query/plugin/DummyQueryBuilder.java index 36b20f45e5beb..d5b77ca2c9bc5 100644 --- a/server/src/test/java/org/elasticsearch/index/query/plugin/DummyQueryBuilder.java +++ b/server/src/test/java/org/elasticsearch/index/query/plugin/DummyQueryBuilder.java @@ -11,8 +11,8 @@ import org.apache.lucene.search.Query; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.query.AbstractQueryBuilder; import org.elasticsearch.index.query.SearchExecutionContext; import org.elasticsearch.index.query.plugin.DummyQueryParserPlugin.DummyQuery; diff --git a/server/src/test/java/org/elasticsearch/index/reindex/AbstractBulkByScrollRequestTestCase.java b/server/src/test/java/org/elasticsearch/index/reindex/AbstractBulkByScrollRequestTestCase.java index cc703e5714f93..396776e6c8627 100644 --- a/server/src/test/java/org/elasticsearch/index/reindex/AbstractBulkByScrollRequestTestCase.java +++ b/server/src/test/java/org/elasticsearch/index/reindex/AbstractBulkByScrollRequestTestCase.java @@ -10,7 +10,7 @@ import org.elasticsearch.action.search.SearchRequest; import org.elasticsearch.action.support.ActiveShardCount; -import org.elasticsearch.common.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContent; import org.elasticsearch.tasks.TaskId; import org.elasticsearch.test.AbstractXContentTestCase; import org.elasticsearch.test.ESTestCase; diff --git a/server/src/test/java/org/elasticsearch/index/reindex/BulkByScrollResponseTests.java b/server/src/test/java/org/elasticsearch/index/reindex/BulkByScrollResponseTests.java index 12ea808f3e355..f8d1a1d90beb1 100644 --- a/server/src/test/java/org/elasticsearch/index/reindex/BulkByScrollResponseTests.java +++ b/server/src/test/java/org/elasticsearch/index/reindex/BulkByScrollResponseTests.java @@ -15,8 +15,8 @@ import org.elasticsearch.client.transport.NoNodeAvailableException; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.reindex.BulkByScrollTask.Status; import org.elasticsearch.test.AbstractXContentTestCase; diff --git a/server/src/test/java/org/elasticsearch/index/reindex/BulkByScrollTaskStatusOrExceptionTests.java b/server/src/test/java/org/elasticsearch/index/reindex/BulkByScrollTaskStatusOrExceptionTests.java index 082597b3e62d7..86d875e83f29e 100644 --- a/server/src/test/java/org/elasticsearch/index/reindex/BulkByScrollTaskStatusOrExceptionTests.java +++ b/server/src/test/java/org/elasticsearch/index/reindex/BulkByScrollTaskStatusOrExceptionTests.java @@ -10,8 +10,8 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import org.elasticsearch.index.reindex.BulkByScrollTask.StatusOrException; diff --git a/server/src/test/java/org/elasticsearch/index/reindex/BulkByScrollTaskStatusTests.java b/server/src/test/java/org/elasticsearch/index/reindex/BulkByScrollTaskStatusTests.java index 8aab33d7202ee..1d5aafde17461 100644 --- a/server/src/test/java/org/elasticsearch/index/reindex/BulkByScrollTaskStatusTests.java +++ b/server/src/test/java/org/elasticsearch/index/reindex/BulkByScrollTaskStatusTests.java @@ -15,8 +15,8 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import org.hamcrest.Matchers; import org.elasticsearch.index.reindex.BulkByScrollTask.Status; diff --git a/server/src/test/java/org/elasticsearch/index/reindex/BulkByScrollTaskTests.java b/server/src/test/java/org/elasticsearch/index/reindex/BulkByScrollTaskTests.java index d985d5ac90446..9c86073ccc2d3 100644 --- a/server/src/test/java/org/elasticsearch/index/reindex/BulkByScrollTaskTests.java +++ b/server/src/test/java/org/elasticsearch/index/reindex/BulkByScrollTaskTests.java @@ -10,9 +10,9 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/index/reindex/DeleteByQueryRequestTests.java b/server/src/test/java/org/elasticsearch/index/reindex/DeleteByQueryRequestTests.java index e64e1e7fefcaa..f49d42f28a18a 100644 --- a/server/src/test/java/org/elasticsearch/index/reindex/DeleteByQueryRequestTests.java +++ b/server/src/test/java/org/elasticsearch/index/reindex/DeleteByQueryRequestTests.java @@ -11,7 +11,7 @@ import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.search.SearchRequest; import org.elasticsearch.action.support.IndicesOptions; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.query.QueryBuilders; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/index/reindex/ReindexRequestTests.java b/server/src/test/java/org/elasticsearch/index/reindex/ReindexRequestTests.java index cfb4b41fecad7..8bbd8668cd0fc 100644 --- a/server/src/test/java/org/elasticsearch/index/reindex/ReindexRequestTests.java +++ b/server/src/test/java/org/elasticsearch/index/reindex/ReindexRequestTests.java @@ -13,11 +13,11 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.query.TermQueryBuilder; import org.elasticsearch.search.SearchModule; import org.elasticsearch.search.slice.SliceBuilder; diff --git a/server/src/test/java/org/elasticsearch/index/reindex/UpdateByQueryRequestTests.java b/server/src/test/java/org/elasticsearch/index/reindex/UpdateByQueryRequestTests.java index 59a76e80daf98..366ccd08e2489 100644 --- a/server/src/test/java/org/elasticsearch/index/reindex/UpdateByQueryRequestTests.java +++ b/server/src/test/java/org/elasticsearch/index/reindex/UpdateByQueryRequestTests.java @@ -9,7 +9,7 @@ package org.elasticsearch.index.reindex; import org.elasticsearch.action.support.IndicesOptions; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/index/replication/IndexLevelReplicationTests.java b/server/src/test/java/org/elasticsearch/index/replication/IndexLevelReplicationTests.java index 2d34074e550cf..f8c49e24a0530 100644 --- a/server/src/test/java/org/elasticsearch/index/replication/IndexLevelReplicationTests.java +++ b/server/src/test/java/org/elasticsearch/index/replication/IndexLevelReplicationTests.java @@ -23,7 +23,7 @@ import org.elasticsearch.cluster.routing.ShardRouting; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.iterable.Iterables; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.TimeValue; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.engine.Engine; diff --git a/server/src/test/java/org/elasticsearch/index/replication/RecoveryDuringReplicationTests.java b/server/src/test/java/org/elasticsearch/index/replication/RecoveryDuringReplicationTests.java index b6532a0c20b20..c32db56d83a9e 100644 --- a/server/src/test/java/org/elasticsearch/index/replication/RecoveryDuringReplicationTests.java +++ b/server/src/test/java/org/elasticsearch/index/replication/RecoveryDuringReplicationTests.java @@ -25,7 +25,7 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.lucene.uid.Versions; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.Releasable; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.VersionType; diff --git a/server/src/test/java/org/elasticsearch/index/search/MultiMatchQueryParserTests.java b/server/src/test/java/org/elasticsearch/index/search/MultiMatchQueryParserTests.java index f0071f6d677f3..d5b6477f569c9 100644 --- a/server/src/test/java/org/elasticsearch/index/search/MultiMatchQueryParserTests.java +++ b/server/src/test/java/org/elasticsearch/index/search/MultiMatchQueryParserTests.java @@ -25,7 +25,7 @@ import org.elasticsearch.common.compress.CompressedXContent; import org.elasticsearch.common.lucene.search.Queries; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.index.IndexService; import org.elasticsearch.index.engine.Engine; import org.elasticsearch.index.mapper.MapperService; diff --git a/server/src/test/java/org/elasticsearch/index/search/NestedHelperTests.java b/server/src/test/java/org/elasticsearch/index/search/NestedHelperTests.java index e2ca3e6f8cbf3..eeb8ec5699ffc 100644 --- a/server/src/test/java/org/elasticsearch/index/search/NestedHelperTests.java +++ b/server/src/test/java/org/elasticsearch/index/search/NestedHelperTests.java @@ -19,8 +19,8 @@ import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.join.ScoreMode; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.index.IndexService; import org.elasticsearch.index.mapper.MapperService; import org.elasticsearch.index.query.MatchAllQueryBuilder; diff --git a/server/src/test/java/org/elasticsearch/index/search/geo/GeoPointParsingTests.java b/server/src/test/java/org/elasticsearch/index/search/geo/GeoPointParsingTests.java index 30c23423838a8..0033d79351a83 100644 --- a/server/src/test/java/org/elasticsearch/index/search/geo/GeoPointParsingTests.java +++ b/server/src/test/java/org/elasticsearch/index/search/geo/GeoPointParsingTests.java @@ -12,9 +12,9 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.geo.GeoPoint; import org.elasticsearch.common.geo.GeoUtils; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.geo.RandomGeoGenerator; diff --git a/server/src/test/java/org/elasticsearch/index/search/geo/GeoUtilsTests.java b/server/src/test/java/org/elasticsearch/index/search/geo/GeoUtilsTests.java index df0d3fbf55aec..8c79cee92d762 100644 --- a/server/src/test/java/org/elasticsearch/index/search/geo/GeoUtilsTests.java +++ b/server/src/test/java/org/elasticsearch/index/search/geo/GeoUtilsTests.java @@ -11,15 +11,15 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.geo.GeoPoint; import org.elasticsearch.common.geo.GeoUtils; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentParser.Token; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser.Token; import org.elasticsearch.geometry.utils.Geohash; import org.elasticsearch.test.ESTestCase; import java.io.IOException; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.allOf; import static org.hamcrest.Matchers.closeTo; import static org.hamcrest.Matchers.containsString; diff --git a/server/src/test/java/org/elasticsearch/index/search/nested/NestedSortingTests.java b/server/src/test/java/org/elasticsearch/index/search/nested/NestedSortingTests.java index 72208f3465a27..9bce87ad3ec81 100644 --- a/server/src/test/java/org/elasticsearch/index/search/nested/NestedSortingTests.java +++ b/server/src/test/java/org/elasticsearch/index/search/nested/NestedSortingTests.java @@ -36,8 +36,8 @@ import org.elasticsearch.common.lucene.index.ElasticsearchDirectoryReader; import org.elasticsearch.common.lucene.search.Queries; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.index.IndexService; import org.elasticsearch.index.fielddata.AbstractFieldDataTestCase; import org.elasticsearch.index.fielddata.IndexFieldData; diff --git a/server/src/test/java/org/elasticsearch/index/seqno/ReplicationTrackerRetentionLeaseTests.java b/server/src/test/java/org/elasticsearch/index/seqno/ReplicationTrackerRetentionLeaseTests.java index cd33c2dee1fca..0a792af76130b 100644 --- a/server/src/test/java/org/elasticsearch/index/seqno/ReplicationTrackerRetentionLeaseTests.java +++ b/server/src/test/java/org/elasticsearch/index/seqno/ReplicationTrackerRetentionLeaseTests.java @@ -15,7 +15,7 @@ import org.elasticsearch.core.Tuple; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.gateway.WriteStateException; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.shard.ShardId; diff --git a/server/src/test/java/org/elasticsearch/index/seqno/RetentionLeaseXContentTests.java b/server/src/test/java/org/elasticsearch/index/seqno/RetentionLeaseXContentTests.java index 70e46eca57344..39e1fa4f64bc0 100644 --- a/server/src/test/java/org/elasticsearch/index/seqno/RetentionLeaseXContentTests.java +++ b/server/src/test/java/org/elasticsearch/index/seqno/RetentionLeaseXContentTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.index.seqno; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/index/seqno/RetentionLeasesTests.java b/server/src/test/java/org/elasticsearch/index/seqno/RetentionLeasesTests.java index 5bc88b7263870..e775d5bc8e9b2 100644 --- a/server/src/test/java/org/elasticsearch/index/seqno/RetentionLeasesTests.java +++ b/server/src/test/java/org/elasticsearch/index/seqno/RetentionLeasesTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.index.seqno; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/index/seqno/RetentionLeasesXContentTests.java b/server/src/test/java/org/elasticsearch/index/seqno/RetentionLeasesXContentTests.java index 41d0805c0e37c..eab3169417bd7 100644 --- a/server/src/test/java/org/elasticsearch/index/seqno/RetentionLeasesXContentTests.java +++ b/server/src/test/java/org/elasticsearch/index/seqno/RetentionLeasesXContentTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.index.seqno; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/index/shard/IndexLongFieldRangeXContentTests.java b/server/src/test/java/org/elasticsearch/index/shard/IndexLongFieldRangeXContentTests.java index 86c65a7e5bd0e..19432ae5ac765 100644 --- a/server/src/test/java/org/elasticsearch/index/shard/IndexLongFieldRangeXContentTests.java +++ b/server/src/test/java/org/elasticsearch/index/shard/IndexLongFieldRangeXContentTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.index.shard; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java b/server/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java index beecb89d12ef3..6d070591aa7ed 100644 --- a/server/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java +++ b/server/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java @@ -58,10 +58,10 @@ import org.elasticsearch.common.util.concurrent.AbstractRunnable; import org.elasticsearch.common.util.concurrent.AtomicArray; import org.elasticsearch.common.util.concurrent.ConcurrentCollections; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.CheckedFunction; import org.elasticsearch.core.Releasable; import org.elasticsearch.core.Releasables; @@ -160,8 +160,8 @@ import static java.util.Collections.emptySet; import static org.elasticsearch.cluster.routing.TestShardRouting.newShardRouting; import static org.elasticsearch.common.lucene.Lucene.cleanLuceneIndex; -import static org.elasticsearch.common.xcontent.ToXContent.EMPTY_PARAMS; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.ToXContent.EMPTY_PARAMS; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.seqno.SequenceNumbers.UNASSIGNED_SEQ_NO; import static org.elasticsearch.test.hamcrest.RegexMatcher.matches; import static org.hamcrest.Matchers.containsInAnyOrder; diff --git a/server/src/test/java/org/elasticsearch/index/shard/PrimaryReplicaSyncerTests.java b/server/src/test/java/org/elasticsearch/index/shard/PrimaryReplicaSyncerTests.java index ec8b588e8c8c8..e1451066ae423 100644 --- a/server/src/test/java/org/elasticsearch/index/shard/PrimaryReplicaSyncerTests.java +++ b/server/src/test/java/org/elasticsearch/index/shard/PrimaryReplicaSyncerTests.java @@ -24,10 +24,10 @@ import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.VersionType; import org.elasticsearch.index.mapper.SourceToParse; import org.elasticsearch.index.seqno.SequenceNumbers; diff --git a/server/src/test/java/org/elasticsearch/index/shard/RefreshListenersTests.java b/server/src/test/java/org/elasticsearch/index/shard/RefreshListenersTests.java index 05b86970d7943..61428c361eaa6 100644 --- a/server/src/test/java/org/elasticsearch/index/shard/RefreshListenersTests.java +++ b/server/src/test/java/org/elasticsearch/index/shard/RefreshListenersTests.java @@ -23,7 +23,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.BigArrays; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.Nullable; import org.elasticsearch.core.Releasable; import org.elasticsearch.core.TimeValue; diff --git a/server/src/test/java/org/elasticsearch/index/shard/ShardGetServiceTests.java b/server/src/test/java/org/elasticsearch/index/shard/ShardGetServiceTests.java index 411902daa8d35..f2e88fceefb8d 100644 --- a/server/src/test/java/org/elasticsearch/index/shard/ShardGetServiceTests.java +++ b/server/src/test/java/org/elasticsearch/index/shard/ShardGetServiceTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.Version; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.VersionType; import org.elasticsearch.index.engine.Engine; import org.elasticsearch.index.engine.EngineTestCase; diff --git a/server/src/test/java/org/elasticsearch/index/similarity/SimilarityTests.java b/server/src/test/java/org/elasticsearch/index/similarity/SimilarityTests.java index 7c0245dd61b8b..0a63fe2754b39 100644 --- a/server/src/test/java/org/elasticsearch/index/similarity/SimilarityTests.java +++ b/server/src/test/java/org/elasticsearch/index/similarity/SimilarityTests.java @@ -23,8 +23,8 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.compress.CompressedXContent; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.index.IndexService; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.mapper.MapperParsingException; diff --git a/server/src/test/java/org/elasticsearch/index/snapshots/blobstore/FileInfoTests.java b/server/src/test/java/org/elasticsearch/index/snapshots/blobstore/FileInfoTests.java index 3dc9e6474d2b6..6b10c8bf85e88 100644 --- a/server/src/test/java/org/elasticsearch/index/snapshots/blobstore/FileInfoTests.java +++ b/server/src/test/java/org/elasticsearch/index/snapshots/blobstore/FileInfoTests.java @@ -12,15 +12,15 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.index.snapshots.blobstore.BlobStoreIndexShardSnapshot.FileInfo; import org.elasticsearch.index.store.StoreFileMetadata; import org.elasticsearch.test.ESTestCase; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import java.io.IOException; import java.util.Collections; diff --git a/server/src/test/java/org/elasticsearch/index/termvectors/TermVectorsServiceTests.java b/server/src/test/java/org/elasticsearch/index/termvectors/TermVectorsServiceTests.java index 31b50765c0ece..4ee157b82e79f 100644 --- a/server/src/test/java/org/elasticsearch/index/termvectors/TermVectorsServiceTests.java +++ b/server/src/test/java/org/elasticsearch/index/termvectors/TermVectorsServiceTests.java @@ -14,7 +14,7 @@ import org.elasticsearch.action.termvectors.TermVectorsRequest; import org.elasticsearch.action.termvectors.TermVectorsResponse; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.IndexService; import org.elasticsearch.index.shard.IndexShard; import org.elasticsearch.indices.IndicesService; @@ -28,7 +28,7 @@ import static java.lang.Math.abs; import static java.util.stream.Collectors.toList; import static org.elasticsearch.action.support.WriteRequest.RefreshPolicy.IMMEDIATE; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.notNullValue; diff --git a/server/src/test/java/org/elasticsearch/index/translog/TranslogTests.java b/server/src/test/java/org/elasticsearch/index/translog/TranslogTests.java index 1c3e248baee3f..1d02aa21df74e 100644 --- a/server/src/test/java/org/elasticsearch/index/translog/TranslogTests.java +++ b/server/src/test/java/org/elasticsearch/index/translog/TranslogTests.java @@ -44,10 +44,10 @@ import org.elasticsearch.common.util.concurrent.AbstractRunnable; import org.elasticsearch.common.util.concurrent.ConcurrentCollections; import org.elasticsearch.common.util.concurrent.ReleasableLock; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.Tuple; import org.elasticsearch.core.internal.io.IOUtils; import org.elasticsearch.index.IndexSettings; diff --git a/server/src/test/java/org/elasticsearch/indices/IndexingMemoryControllerTests.java b/server/src/test/java/org/elasticsearch/indices/IndexingMemoryControllerTests.java index bf83f7a4d676e..af688e6640fee 100644 --- a/server/src/test/java/org/elasticsearch/indices/IndexingMemoryControllerTests.java +++ b/server/src/test/java/org/elasticsearch/indices/IndexingMemoryControllerTests.java @@ -14,7 +14,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.codec.CodecService; import org.elasticsearch.index.engine.EngineConfig; import org.elasticsearch.index.engine.InternalEngine; diff --git a/server/src/test/java/org/elasticsearch/indices/IndicesRequestCacheTests.java b/server/src/test/java/org/elasticsearch/indices/IndicesRequestCacheTests.java index 3f136f59d97ab..455f102cdf965 100644 --- a/server/src/test/java/org/elasticsearch/indices/IndicesRequestCacheTests.java +++ b/server/src/test/java/org/elasticsearch/indices/IndicesRequestCacheTests.java @@ -29,7 +29,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.internal.io.IOUtils; import org.elasticsearch.index.cache.request.ShardRequestCache; import org.elasticsearch.index.mapper.Mapping; diff --git a/server/src/test/java/org/elasticsearch/indices/NodeIndicesStatsTests.java b/server/src/test/java/org/elasticsearch/indices/NodeIndicesStatsTests.java index 5f3cb89a5397d..0f37917330e0b 100644 --- a/server/src/test/java/org/elasticsearch/indices/NodeIndicesStatsTests.java +++ b/server/src/test/java/org/elasticsearch/indices/NodeIndicesStatsTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.indices; -import org.elasticsearch.common.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContent; import org.elasticsearch.test.ESTestCase; import java.util.Collections; diff --git a/server/src/test/java/org/elasticsearch/indices/SystemIndexDescriptorTests.java b/server/src/test/java/org/elasticsearch/indices/SystemIndexDescriptorTests.java index 3fb93fda57ae0..fd9f11762bc87 100644 --- a/server/src/test/java/org/elasticsearch/indices/SystemIndexDescriptorTests.java +++ b/server/src/test/java/org/elasticsearch/indices/SystemIndexDescriptorTests.java @@ -13,7 +13,7 @@ import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.indices.SystemIndexDescriptor.Type; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.VersionUtils; diff --git a/server/src/test/java/org/elasticsearch/indices/SystemIndexManagerTests.java b/server/src/test/java/org/elasticsearch/indices/SystemIndexManagerTests.java index 245af61d50436..85ea87d30ce5f 100644 --- a/server/src/test/java/org/elasticsearch/indices/SystemIndexManagerTests.java +++ b/server/src/test/java/org/elasticsearch/indices/SystemIndexManagerTests.java @@ -30,7 +30,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.EsExecutors; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.Index; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.indices.SystemIndexManager.UpgradeStatus; @@ -43,7 +43,7 @@ import java.util.List; import java.util.Map; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasSize; diff --git a/server/src/test/java/org/elasticsearch/indices/TermsLookupTests.java b/server/src/test/java/org/elasticsearch/indices/TermsLookupTests.java index 670644bf7e0ad..70834917d058c 100644 --- a/server/src/test/java/org/elasticsearch/indices/TermsLookupTests.java +++ b/server/src/test/java/org/elasticsearch/indices/TermsLookupTests.java @@ -10,8 +10,8 @@ import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/indices/analysis/AnalysisModuleTests.java b/server/src/test/java/org/elasticsearch/indices/analysis/AnalysisModuleTests.java index e6529bb18041a..ee74b92a70703 100644 --- a/server/src/test/java/org/elasticsearch/indices/analysis/AnalysisModuleTests.java +++ b/server/src/test/java/org/elasticsearch/indices/analysis/AnalysisModuleTests.java @@ -21,7 +21,7 @@ import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.common.io.Streams; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.env.Environment; import org.elasticsearch.env.TestEnvironment; import org.elasticsearch.index.IndexSettings; diff --git a/server/src/test/java/org/elasticsearch/indices/cluster/ClusterStateChanges.java b/server/src/test/java/org/elasticsearch/indices/cluster/ClusterStateChanges.java index 09c22ce707f01..171812aef811c 100644 --- a/server/src/test/java/org/elasticsearch/indices/cluster/ClusterStateChanges.java +++ b/server/src/test/java/org/elasticsearch/indices/cluster/ClusterStateChanges.java @@ -73,7 +73,7 @@ import org.elasticsearch.common.settings.ClusterSettings; import org.elasticsearch.common.settings.IndexScopedSettings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.env.Environment; import org.elasticsearch.env.TestEnvironment; import org.elasticsearch.index.Index; diff --git a/server/src/test/java/org/elasticsearch/indices/recovery/PeerRecoveryTargetServiceTests.java b/server/src/test/java/org/elasticsearch/indices/recovery/PeerRecoveryTargetServiceTests.java index dfcd53e56828c..5597d8460bfee 100644 --- a/server/src/test/java/org/elasticsearch/indices/recovery/PeerRecoveryTargetServiceTests.java +++ b/server/src/test/java/org/elasticsearch/indices/recovery/PeerRecoveryTargetServiceTests.java @@ -31,7 +31,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.Tuple; import org.elasticsearch.core.internal.io.IOUtils; import org.elasticsearch.index.engine.NoOpEngine; diff --git a/server/src/test/java/org/elasticsearch/indices/recovery/RecoverySourceHandlerTests.java b/server/src/test/java/org/elasticsearch/indices/recovery/RecoverySourceHandlerTests.java index ca3ceae054e22..a1059701f1836 100644 --- a/server/src/test/java/org/elasticsearch/indices/recovery/RecoverySourceHandlerTests.java +++ b/server/src/test/java/org/elasticsearch/indices/recovery/RecoverySourceHandlerTests.java @@ -46,7 +46,7 @@ import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.common.util.CancellableThreads; import org.elasticsearch.common.util.concurrent.ConcurrentCollections; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.Releasable; import org.elasticsearch.core.TimeValue; import org.elasticsearch.core.internal.io.IOUtils; diff --git a/server/src/test/java/org/elasticsearch/indices/recovery/RecoveryTests.java b/server/src/test/java/org/elasticsearch/indices/recovery/RecoveryTests.java index 2d6a4e81a2e64..29f82bfc64d38 100644 --- a/server/src/test/java/org/elasticsearch/indices/recovery/RecoveryTests.java +++ b/server/src/test/java/org/elasticsearch/indices/recovery/RecoveryTests.java @@ -28,7 +28,7 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.lucene.uid.Versions; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.MergePolicyConfig; import org.elasticsearch.index.VersionType; diff --git a/server/src/test/java/org/elasticsearch/ingest/IngestMetadataTests.java b/server/src/test/java/org/elasticsearch/ingest/IngestMetadataTests.java index aa3f18026b1b1..cc4777f0447c5 100644 --- a/server/src/test/java/org/elasticsearch/ingest/IngestMetadataTests.java +++ b/server/src/test/java/org/elasticsearch/ingest/IngestMetadataTests.java @@ -12,11 +12,11 @@ import org.elasticsearch.cluster.metadata.Metadata; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/ingest/IngestServiceTests.java b/server/src/test/java/org/elasticsearch/ingest/IngestServiceTests.java index 631efa75ae36d..087f961b61ac0 100644 --- a/server/src/test/java/org/elasticsearch/ingest/IngestServiceTests.java +++ b/server/src/test/java/org/elasticsearch/ingest/IngestServiceTests.java @@ -42,10 +42,10 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.time.DateFormatter; import org.elasticsearch.common.util.concurrent.EsExecutors; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.cbor.CborXContent; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.cbor.CborXContent; import org.elasticsearch.core.Tuple; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.VersionType; diff --git a/server/src/test/java/org/elasticsearch/ingest/PipelineConfigurationTests.java b/server/src/test/java/org/elasticsearch/ingest/PipelineConfigurationTests.java index c3cb0361fdf92..342acaa5a079a 100644 --- a/server/src/test/java/org/elasticsearch/ingest/PipelineConfigurationTests.java +++ b/server/src/test/java/org/elasticsearch/ingest/PipelineConfigurationTests.java @@ -12,14 +12,14 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.ContextParser; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ContextParser; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/node/NodeTests.java b/server/src/test/java/org/elasticsearch/node/NodeTests.java index f37f584db78c0..415e0aaad9505 100644 --- a/server/src/test/java/org/elasticsearch/node/NodeTests.java +++ b/server/src/test/java/org/elasticsearch/node/NodeTests.java @@ -17,14 +17,14 @@ import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.transport.BoundTransportAddress; -import org.elasticsearch.common.xcontent.ContextParser; -import org.elasticsearch.common.xcontent.MediaType; -import org.elasticsearch.common.xcontent.NamedObjectNotFoundException; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ContextParser; +import org.elasticsearch.xcontent.MediaType; +import org.elasticsearch.xcontent.NamedObjectNotFoundException; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.env.Environment; import org.elasticsearch.index.IndexService; diff --git a/server/src/test/java/org/elasticsearch/nodesinfo/NodeInfoStreamingTests.java b/server/src/test/java/org/elasticsearch/nodesinfo/NodeInfoStreamingTests.java index cf3ed57aabae8..57286d401bef2 100644 --- a/server/src/test/java/org/elasticsearch/nodesinfo/NodeInfoStreamingTests.java +++ b/server/src/test/java/org/elasticsearch/nodesinfo/NodeInfoStreamingTests.java @@ -19,8 +19,8 @@ import org.elasticsearch.common.transport.BoundTransportAddress; import org.elasticsearch.common.transport.TransportAddress; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.http.HttpInfo; import org.elasticsearch.ingest.IngestInfo; import org.elasticsearch.ingest.ProcessorInfo; @@ -46,7 +46,7 @@ import static java.util.Collections.emptyMap; import static java.util.Collections.emptySet; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.core.IsEqual.equalTo; public class NodeInfoStreamingTests extends ESTestCase { diff --git a/server/src/test/java/org/elasticsearch/persistent/PersistentTasksCustomMetadataTests.java b/server/src/test/java/org/elasticsearch/persistent/PersistentTasksCustomMetadataTests.java index f7b80a250f85d..2295a1bf816f3 100644 --- a/server/src/test/java/org/elasticsearch/persistent/PersistentTasksCustomMetadataTests.java +++ b/server/src/test/java/org/elasticsearch/persistent/PersistentTasksCustomMetadataTests.java @@ -17,7 +17,7 @@ import org.elasticsearch.cluster.metadata.Metadata.Custom; import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.node.DiscoveryNodes; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.UUIDs; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.BytesStreamOutput; @@ -27,12 +27,12 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.persistent.PersistentTasksCustomMetadata.Assignment; import org.elasticsearch.persistent.PersistentTasksCustomMetadata.Builder; import org.elasticsearch.persistent.PersistentTasksCustomMetadata.PersistentTask; diff --git a/server/src/test/java/org/elasticsearch/persistent/TestPersistentTasksPlugin.java b/server/src/test/java/org/elasticsearch/persistent/TestPersistentTasksPlugin.java index 977dc94255b57..98ca6c2925289 100644 --- a/server/src/test/java/org/elasticsearch/persistent/TestPersistentTasksPlugin.java +++ b/server/src/test/java/org/elasticsearch/persistent/TestPersistentTasksPlugin.java @@ -28,7 +28,7 @@ import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.service.ClusterService; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.component.Lifecycle; import org.elasticsearch.common.inject.Inject; @@ -37,10 +37,10 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.SettingsModule; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.persistent.PersistentTasksCustomMetadata.Assignment; import org.elasticsearch.persistent.PersistentTasksCustomMetadata.PersistentTask; import org.elasticsearch.plugins.ActionPlugin; @@ -64,7 +64,7 @@ import java.util.concurrent.atomic.AtomicInteger; import static java.util.Objects.requireNonNull; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; import static org.elasticsearch.test.ESTestCase.assertBusy; import static org.elasticsearch.test.ESTestCase.randomBoolean; import static org.junit.Assert.assertTrue; diff --git a/server/src/test/java/org/elasticsearch/plugins/spi/NamedXContentProviderTests.java b/server/src/test/java/org/elasticsearch/plugins/spi/NamedXContentProviderTests.java index a377bbb2ebe94..a8a5e04a89f17 100644 --- a/server/src/test/java/org/elasticsearch/plugins/spi/NamedXContentProviderTests.java +++ b/server/src/test/java/org/elasticsearch/plugins/spi/NamedXContentProviderTests.java @@ -8,9 +8,9 @@ package org.elasticsearch.plugins.spi; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.Streams; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.search.aggregations.Aggregation; import org.elasticsearch.search.aggregations.pipeline.ParsedSimpleValue; import org.elasticsearch.search.suggest.Suggest; diff --git a/server/src/test/java/org/elasticsearch/repositories/IndexIdTests.java b/server/src/test/java/org/elasticsearch/repositories/IndexIdTests.java index 515e7018e5493..39e3d3cbee8e4 100644 --- a/server/src/test/java/org/elasticsearch/repositories/IndexIdTests.java +++ b/server/src/test/java/org/elasticsearch/repositories/IndexIdTests.java @@ -11,11 +11,11 @@ import org.elasticsearch.common.UUIDs; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.test.ESTestCase; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/repositories/RepositoriesModuleTests.java b/server/src/test/java/org/elasticsearch/repositories/RepositoriesModuleTests.java index 961fdc0b90892..24edc9dac1229 100644 --- a/server/src/test/java/org/elasticsearch/repositories/RepositoriesModuleTests.java +++ b/server/src/test/java/org/elasticsearch/repositories/RepositoriesModuleTests.java @@ -11,13 +11,13 @@ import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.MockBigArrays; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; import org.elasticsearch.env.Environment; import org.elasticsearch.indices.recovery.RecoverySettings; import org.elasticsearch.plugins.RepositoryPlugin; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.TransportService; +import org.elasticsearch.xcontent.NamedXContentRegistry; import java.util.ArrayList; import java.util.Collections; diff --git a/server/src/test/java/org/elasticsearch/repositories/RepositoriesServiceTests.java b/server/src/test/java/org/elasticsearch/repositories/RepositoriesServiceTests.java index de45b4adbeb54..308e1e495c18e 100644 --- a/server/src/test/java/org/elasticsearch/repositories/RepositoriesServiceTests.java +++ b/server/src/test/java/org/elasticsearch/repositories/RepositoriesServiceTests.java @@ -30,7 +30,6 @@ import org.elasticsearch.common.component.LifecycleListener; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.MockBigArrays; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.index.snapshots.IndexShardSnapshotStatus; import org.elasticsearch.index.store.Store; @@ -42,6 +41,7 @@ import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.Transport; import org.elasticsearch.transport.TransportService; +import org.elasticsearch.xcontent.NamedXContentRegistry; import java.util.Collection; import java.util.Collections; diff --git a/server/src/test/java/org/elasticsearch/repositories/RepositoryDataTests.java b/server/src/test/java/org/elasticsearch/repositories/RepositoryDataTests.java index 1e7491f0d39d9..06656d942b810 100644 --- a/server/src/test/java/org/elasticsearch/repositories/RepositoryDataTests.java +++ b/server/src/test/java/org/elasticsearch/repositories/RepositoryDataTests.java @@ -12,14 +12,14 @@ import org.elasticsearch.Version; import org.elasticsearch.common.UUIDs; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.snapshots.SnapshotId; import org.elasticsearch.snapshots.SnapshotState; import org.elasticsearch.test.ESTestCase; +import org.elasticsearch.xcontent.XContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/test/java/org/elasticsearch/repositories/blobstore/BlobStoreRepositoryTests.java b/server/src/test/java/org/elasticsearch/repositories/blobstore/BlobStoreRepositoryTests.java index 23c0f6b7b752a..1181a6747b1ab 100644 --- a/server/src/test/java/org/elasticsearch/repositories/blobstore/BlobStoreRepositoryTests.java +++ b/server/src/test/java/org/elasticsearch/repositories/blobstore/BlobStoreRepositoryTests.java @@ -21,7 +21,6 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.util.BigArrays; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; import org.elasticsearch.env.Environment; import org.elasticsearch.indices.recovery.RecoverySettings; import org.elasticsearch.plugins.Plugin; @@ -39,6 +38,7 @@ import org.elasticsearch.test.ESIntegTestCase; import org.elasticsearch.test.ESSingleNodeTestCase; import org.elasticsearch.threadpool.ThreadPool; +import org.elasticsearch.xcontent.NamedXContentRegistry; import java.nio.file.Path; import java.util.Arrays; diff --git a/server/src/test/java/org/elasticsearch/repositories/fs/FsRepositoryTests.java b/server/src/test/java/org/elasticsearch/repositories/fs/FsRepositoryTests.java index d46be9ccc19d8..9304b2f4f66b2 100644 --- a/server/src/test/java/org/elasticsearch/repositories/fs/FsRepositoryTests.java +++ b/server/src/test/java/org/elasticsearch/repositories/fs/FsRepositoryTests.java @@ -37,7 +37,6 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.util.MockBigArrays; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; import org.elasticsearch.env.Environment; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.engine.Engine; @@ -58,6 +57,7 @@ import org.elasticsearch.test.IndexSettingsModule; import org.elasticsearch.threadpool.TestThreadPool; import org.elasticsearch.threadpool.ThreadPool; +import org.elasticsearch.xcontent.NamedXContentRegistry; import java.io.IOException; import java.nio.file.Path; diff --git a/server/src/test/java/org/elasticsearch/rest/BaseRestHandlerTests.java b/server/src/test/java/org/elasticsearch/rest/BaseRestHandlerTests.java index 135a350d2d671..0e5be3e852c09 100644 --- a/server/src/test/java/org/elasticsearch/rest/BaseRestHandlerTests.java +++ b/server/src/test/java/org/elasticsearch/rest/BaseRestHandlerTests.java @@ -12,9 +12,9 @@ import org.elasticsearch.common.Table; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.rest.action.cat.AbstractCatAction; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.rest.FakeRestChannel; diff --git a/server/src/test/java/org/elasticsearch/rest/BytesRestResponseTests.java b/server/src/test/java/org/elasticsearch/rest/BytesRestResponseTests.java index 344b3367415f7..9fdeab771877e 100644 --- a/server/src/test/java/org/elasticsearch/rest/BytesRestResponseTests.java +++ b/server/src/test/java/org/elasticsearch/rest/BytesRestResponseTests.java @@ -19,9 +19,9 @@ import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.transport.TransportAddress; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.search.SearchShardTarget; import org.elasticsearch.test.ESTestCase; diff --git a/server/src/test/java/org/elasticsearch/rest/RestCompatibleVersionHelperTests.java b/server/src/test/java/org/elasticsearch/rest/RestCompatibleVersionHelperTests.java index 449f13b23147c..1e325de32d30b 100644 --- a/server/src/test/java/org/elasticsearch/rest/RestCompatibleVersionHelperTests.java +++ b/server/src/test/java/org/elasticsearch/rest/RestCompatibleVersionHelperTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.ElasticsearchStatusException; import org.elasticsearch.core.RestApiVersion; -import org.elasticsearch.common.xcontent.ParsedMediaType; +import org.elasticsearch.xcontent.ParsedMediaType; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.hamcrest.ElasticsearchMatchers; import org.hamcrest.Matcher; diff --git a/server/src/test/java/org/elasticsearch/rest/RestControllerTests.java b/server/src/test/java/org/elasticsearch/rest/RestControllerTests.java index 0f2cadace00f2..19c6d262365a1 100644 --- a/server/src/test/java/org/elasticsearch/rest/RestControllerTests.java +++ b/server/src/test/java/org/elasticsearch/rest/RestControllerTests.java @@ -20,10 +20,10 @@ import org.elasticsearch.common.transport.TransportAddress; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.yaml.YamlXContent; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.yaml.YamlXContent; import org.elasticsearch.core.internal.io.IOUtils; import org.elasticsearch.http.HttpInfo; import org.elasticsearch.http.HttpRequest; diff --git a/server/src/test/java/org/elasticsearch/rest/RestRequestTests.java b/server/src/test/java/org/elasticsearch/rest/RestRequestTests.java index 139439b561ad3..66de00105bd18 100644 --- a/server/src/test/java/org/elasticsearch/rest/RestRequestTests.java +++ b/server/src/test/java/org/elasticsearch/rest/RestRequestTests.java @@ -12,9 +12,9 @@ import org.elasticsearch.core.CheckedConsumer; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.http.HttpChannel; import org.elasticsearch.http.HttpRequest; import org.elasticsearch.test.ESTestCase; diff --git a/server/src/test/java/org/elasticsearch/rest/action/RestActionsTests.java b/server/src/test/java/org/elasticsearch/rest/action/RestActionsTests.java index ff3eb65784b7c..dfc9f6053b49b 100644 --- a/server/src/test/java/org/elasticsearch/rest/action/RestActionsTests.java +++ b/server/src/test/java/org/elasticsearch/rest/action/RestActionsTests.java @@ -16,11 +16,11 @@ import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.Index; import org.elasticsearch.index.query.MatchQueryBuilder; import org.elasticsearch.index.query.QueryBuilder; diff --git a/server/src/test/java/org/elasticsearch/rest/action/RestBuilderListenerTests.java b/server/src/test/java/org/elasticsearch/rest/action/RestBuilderListenerTests.java index 217ce9ce6431a..78cef7cc8c123 100644 --- a/server/src/test/java/org/elasticsearch/rest/action/RestBuilderListenerTests.java +++ b/server/src/test/java/org/elasticsearch/rest/action/RestBuilderListenerTests.java @@ -9,7 +9,7 @@ package org.elasticsearch.rest.action; import org.elasticsearch.common.bytes.BytesArray; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestResponse; import org.elasticsearch.rest.RestStatus; diff --git a/server/src/test/java/org/elasticsearch/rest/action/RestMainActionTests.java b/server/src/test/java/org/elasticsearch/rest/action/RestMainActionTests.java index 66be98c462342..403c58e71c53e 100644 --- a/server/src/test/java/org/elasticsearch/rest/action/RestMainActionTests.java +++ b/server/src/test/java/org/elasticsearch/rest/action/RestMainActionTests.java @@ -13,9 +13,9 @@ import org.elasticsearch.action.main.MainResponse; import org.elasticsearch.cluster.ClusterName; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.RestStatus; diff --git a/server/src/test/java/org/elasticsearch/rest/action/admin/cluster/RestReloadSecureSettingsActionTests.java b/server/src/test/java/org/elasticsearch/rest/action/admin/cluster/RestReloadSecureSettingsActionTests.java index 1369f48c7a0f2..aabc3ad043817 100644 --- a/server/src/test/java/org/elasticsearch/rest/action/admin/cluster/RestReloadSecureSettingsActionTests.java +++ b/server/src/test/java/org/elasticsearch/rest/action/admin/cluster/RestReloadSecureSettingsActionTests.java @@ -9,10 +9,10 @@ package org.elasticsearch.rest.action.admin.cluster; import org.elasticsearch.action.admin.cluster.node.reload.NodesReloadSecureSettingsRequest; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import static org.hamcrest.Matchers.nullValue; diff --git a/server/src/test/java/org/elasticsearch/rest/action/admin/indices/RestAnalyzeActionTests.java b/server/src/test/java/org/elasticsearch/rest/action/admin/indices/RestAnalyzeActionTests.java index 7894dc73b0d0d..2a359b353df3a 100644 --- a/server/src/test/java/org/elasticsearch/rest/action/admin/indices/RestAnalyzeActionTests.java +++ b/server/src/test/java/org/elasticsearch/rest/action/admin/indices/RestAnalyzeActionTests.java @@ -10,9 +10,9 @@ import org.elasticsearch.action.admin.indices.analyze.AnalyzeAction; import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.common.bytes.BytesArray; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.analysis.NameOrDefinition; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.test.ESTestCase; diff --git a/server/src/test/java/org/elasticsearch/rest/action/admin/indices/RestCreateIndexActionTests.java b/server/src/test/java/org/elasticsearch/rest/action/admin/indices/RestCreateIndexActionTests.java index 1ac6b4bad9f76..6b0d0fd18abd7 100644 --- a/server/src/test/java/org/elasticsearch/rest/action/admin/indices/RestCreateIndexActionTests.java +++ b/server/src/test/java/org/elasticsearch/rest/action/admin/indices/RestCreateIndexActionTests.java @@ -13,10 +13,10 @@ import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.rest.FakeRestRequest; diff --git a/server/src/test/java/org/elasticsearch/rest/action/admin/indices/RestGetAliasesActionTests.java b/server/src/test/java/org/elasticsearch/rest/action/admin/indices/RestGetAliasesActionTests.java index c2e17440f7808..767b66bf5324a 100644 --- a/server/src/test/java/org/elasticsearch/rest/action/admin/indices/RestGetAliasesActionTests.java +++ b/server/src/test/java/org/elasticsearch/rest/action/admin/indices/RestGetAliasesActionTests.java @@ -10,9 +10,9 @@ import org.elasticsearch.cluster.metadata.AliasMetadata; import org.elasticsearch.common.collect.ImmutableOpenMap; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.rest.RestResponse; import org.elasticsearch.test.ESTestCase; diff --git a/server/src/test/java/org/elasticsearch/rest/action/admin/indices/RestPutIndexTemplateActionTests.java b/server/src/test/java/org/elasticsearch/rest/action/admin/indices/RestPutIndexTemplateActionTests.java index 65d97f0034964..f17470d539fdf 100644 --- a/server/src/test/java/org/elasticsearch/rest/action/admin/indices/RestPutIndexTemplateActionTests.java +++ b/server/src/test/java/org/elasticsearch/rest/action/admin/indices/RestPutIndexTemplateActionTests.java @@ -12,9 +12,9 @@ import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.rest.FakeRestRequest; diff --git a/server/src/test/java/org/elasticsearch/rest/action/admin/indices/RestValidateQueryActionTests.java b/server/src/test/java/org/elasticsearch/rest/action/admin/indices/RestValidateQueryActionTests.java index 7ab2d04035a82..c6f743e8511ff 100644 --- a/server/src/test/java/org/elasticsearch/rest/action/admin/indices/RestValidateQueryActionTests.java +++ b/server/src/test/java/org/elasticsearch/rest/action/admin/indices/RestValidateQueryActionTests.java @@ -19,7 +19,7 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.indices.breaker.NoneCircuitBreakerService; import org.elasticsearch.rest.RestChannel; diff --git a/server/src/test/java/org/elasticsearch/rest/action/cat/RestTableTests.java b/server/src/test/java/org/elasticsearch/rest/action/cat/RestTableTests.java index 50ad8e49f8faf..6b7b689c14882 100644 --- a/server/src/test/java/org/elasticsearch/rest/action/cat/RestTableTests.java +++ b/server/src/test/java/org/elasticsearch/rest/action/cat/RestTableTests.java @@ -9,7 +9,7 @@ package org.elasticsearch.rest.action.cat; import org.elasticsearch.common.Table; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.rest.AbstractRestChannel; import org.elasticsearch.rest.RestResponse; import org.elasticsearch.test.ESTestCase; diff --git a/server/src/test/java/org/elasticsearch/rest/action/cat/RestTasksActionTests.java b/server/src/test/java/org/elasticsearch/rest/action/cat/RestTasksActionTests.java index d4ff86a1566fc..d98ff11afe374 100644 --- a/server/src/test/java/org/elasticsearch/rest/action/cat/RestTasksActionTests.java +++ b/server/src/test/java/org/elasticsearch/rest/action/cat/RestTasksActionTests.java @@ -14,7 +14,7 @@ import org.elasticsearch.action.ActionType; import org.elasticsearch.action.admin.cluster.node.tasks.list.ListTasksResponse; import org.elasticsearch.cluster.node.DiscoveryNodes; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.client.NoOpNodeClient; import org.elasticsearch.test.rest.FakeRestChannel; diff --git a/server/src/test/java/org/elasticsearch/rest/action/document/RestBulkActionTests.java b/server/src/test/java/org/elasticsearch/rest/action/document/RestBulkActionTests.java index a9ad854839eef..92243850ed251 100644 --- a/server/src/test/java/org/elasticsearch/rest/action/document/RestBulkActionTests.java +++ b/server/src/test/java/org/elasticsearch/rest/action/document/RestBulkActionTests.java @@ -16,7 +16,7 @@ import org.elasticsearch.action.update.UpdateRequest; import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.common.bytes.BytesArray; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.rest.RestChannel; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.test.ESTestCase; diff --git a/server/src/test/java/org/elasticsearch/rest/action/document/RestIndexActionTests.java b/server/src/test/java/org/elasticsearch/rest/action/document/RestIndexActionTests.java index 961d2271c2586..ce8e451b3c3ad 100644 --- a/server/src/test/java/org/elasticsearch/rest/action/document/RestIndexActionTests.java +++ b/server/src/test/java/org/elasticsearch/rest/action/document/RestIndexActionTests.java @@ -19,7 +19,7 @@ import org.elasticsearch.cluster.node.DiscoveryNodes; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.common.bytes.BytesArray; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.document.RestIndexAction.AutoIdHandler; diff --git a/server/src/test/java/org/elasticsearch/rest/action/document/RestMultiGetActionTests.java b/server/src/test/java/org/elasticsearch/rest/action/document/RestMultiGetActionTests.java index 064c9ae23df29..d518d3a0371af 100644 --- a/server/src/test/java/org/elasticsearch/rest/action/document/RestMultiGetActionTests.java +++ b/server/src/test/java/org/elasticsearch/rest/action/document/RestMultiGetActionTests.java @@ -13,9 +13,9 @@ import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.test.rest.FakeRestRequest; import org.elasticsearch.test.rest.RestActionTestCase; diff --git a/server/src/test/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsActionTests.java b/server/src/test/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsActionTests.java index 9a177f335c422..4d62148e68272 100644 --- a/server/src/test/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsActionTests.java +++ b/server/src/test/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsActionTests.java @@ -11,9 +11,9 @@ import org.elasticsearch.action.termvectors.MultiTermVectorsResponse; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.test.rest.FakeRestRequest; import org.elasticsearch.test.rest.RestActionTestCase; diff --git a/server/src/test/java/org/elasticsearch/rest/action/document/RestTermVectorsActionTests.java b/server/src/test/java/org/elasticsearch/rest/action/document/RestTermVectorsActionTests.java index 57e68b246f7ff..e9dfdb48d5619 100644 --- a/server/src/test/java/org/elasticsearch/rest/action/document/RestTermVectorsActionTests.java +++ b/server/src/test/java/org/elasticsearch/rest/action/document/RestTermVectorsActionTests.java @@ -11,9 +11,9 @@ import org.elasticsearch.action.termvectors.TermVectorsResponse; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.test.rest.FakeRestRequest; import org.elasticsearch.test.rest.RestActionTestCase; diff --git a/server/src/test/java/org/elasticsearch/rest/action/document/RestUpdateActionTests.java b/server/src/test/java/org/elasticsearch/rest/action/document/RestUpdateActionTests.java index 2a6bfa7c46ebc..a26302ed8472b 100644 --- a/server/src/test/java/org/elasticsearch/rest/action/document/RestUpdateActionTests.java +++ b/server/src/test/java/org/elasticsearch/rest/action/document/RestUpdateActionTests.java @@ -13,7 +13,7 @@ import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.common.bytes.BytesArray; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.VersionType; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.test.rest.FakeRestRequest; diff --git a/server/src/test/java/org/elasticsearch/rest/action/search/RestExplainActionTests.java b/server/src/test/java/org/elasticsearch/rest/action/search/RestExplainActionTests.java index 6155289a1e488..1c31b39aabe0f 100644 --- a/server/src/test/java/org/elasticsearch/rest/action/search/RestExplainActionTests.java +++ b/server/src/test/java/org/elasticsearch/rest/action/search/RestExplainActionTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.action.explain.ExplainResponse; import org.elasticsearch.core.RestApiVersion; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.test.rest.FakeRestRequest; import org.elasticsearch.test.rest.RestActionTestCase; diff --git a/server/src/test/java/org/elasticsearch/rest/action/search/RestMultiSearchActionTests.java b/server/src/test/java/org/elasticsearch/rest/action/search/RestMultiSearchActionTests.java index 0980aa6a26766..5ef0991d5cccc 100644 --- a/server/src/test/java/org/elasticsearch/rest/action/search/RestMultiSearchActionTests.java +++ b/server/src/test/java/org/elasticsearch/rest/action/search/RestMultiSearchActionTests.java @@ -12,7 +12,7 @@ import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.test.rest.FakeRestRequest; import org.elasticsearch.test.rest.RestActionTestCase; diff --git a/server/src/test/java/org/elasticsearch/script/ScriptContextInfoTests.java b/server/src/test/java/org/elasticsearch/script/ScriptContextInfoTests.java index f8071b21b3965..ac2b3d8fdd0d1 100644 --- a/server/src/test/java/org/elasticsearch/script/ScriptContextInfoTests.java +++ b/server/src/test/java/org/elasticsearch/script/ScriptContextInfoTests.java @@ -10,12 +10,12 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.core.Tuple; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.script.ScriptContextInfo.ScriptMethodInfo; import org.elasticsearch.script.ScriptContextInfo.ScriptMethodInfo.ParameterInfo; import org.elasticsearch.test.ESTestCase; diff --git a/server/src/test/java/org/elasticsearch/script/ScriptMetadataTests.java b/server/src/test/java/org/elasticsearch/script/ScriptMetadataTests.java index f2793289e6088..5b3462295ab01 100644 --- a/server/src/test/java/org/elasticsearch/script/ScriptMetadataTests.java +++ b/server/src/test/java/org/elasticsearch/script/ScriptMetadataTests.java @@ -11,12 +11,12 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/script/ScriptServiceTests.java b/server/src/test/java/org/elasticsearch/script/ScriptServiceTests.java index 938d04c1e805a..1ea9780c762a6 100644 --- a/server/src/test/java/org/elasticsearch/script/ScriptServiceTests.java +++ b/server/src/test/java/org/elasticsearch/script/ScriptServiceTests.java @@ -18,8 +18,8 @@ import org.elasticsearch.common.settings.ClusterSettings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.env.Environment; import org.elasticsearch.test.ESTestCase; import org.junit.Before; diff --git a/server/src/test/java/org/elasticsearch/script/ScriptStatsTests.java b/server/src/test/java/org/elasticsearch/script/ScriptStatsTests.java index 1967837aa108e..f7fe489a5fd38 100644 --- a/server/src/test/java/org/elasticsearch/script/ScriptStatsTests.java +++ b/server/src/test/java/org/elasticsearch/script/ScriptStatsTests.java @@ -12,9 +12,9 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/script/ScriptTests.java b/server/src/test/java/org/elasticsearch/script/ScriptTests.java index f5432003d1c71..0f17366971098 100644 --- a/server/src/test/java/org/elasticsearch/script/ScriptTests.java +++ b/server/src/test/java/org/elasticsearch/script/ScriptTests.java @@ -13,12 +13,12 @@ import org.elasticsearch.common.io.stream.InputStreamStreamInput; import org.elasticsearch.common.io.stream.OutputStreamStreamOutput; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import java.io.ByteArrayInputStream; diff --git a/server/src/test/java/org/elasticsearch/script/StoredScriptSourceTests.java b/server/src/test/java/org/elasticsearch/script/StoredScriptSourceTests.java index 8f76a5778e84a..1698550b1a490 100644 --- a/server/src/test/java/org/elasticsearch/script/StoredScriptSourceTests.java +++ b/server/src/test/java/org/elasticsearch/script/StoredScriptSourceTests.java @@ -11,9 +11,9 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/script/StoredScriptTests.java b/server/src/test/java/org/elasticsearch/script/StoredScriptTests.java index 88320e9f46698..91ac1a71ab184 100644 --- a/server/src/test/java/org/elasticsearch/script/StoredScriptTests.java +++ b/server/src/test/java/org/elasticsearch/script/StoredScriptTests.java @@ -13,10 +13,10 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/search/AbstractSearchTestCase.java b/server/src/test/java/org/elasticsearch/search/AbstractSearchTestCase.java index d972c67196941..acd3fd3b6d550 100644 --- a/server/src/test/java/org/elasticsearch/search/AbstractSearchTestCase.java +++ b/server/src/test/java/org/elasticsearch/search/AbstractSearchTestCase.java @@ -15,9 +15,9 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.indices.IndicesModule; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.plugins.SearchPlugin; diff --git a/server/src/test/java/org/elasticsearch/search/ClearScrollResponseTests.java b/server/src/test/java/org/elasticsearch/search/ClearScrollResponseTests.java index 23eaf05c5ce8b..38464a1d56f60 100644 --- a/server/src/test/java/org/elasticsearch/search/ClearScrollResponseTests.java +++ b/server/src/test/java/org/elasticsearch/search/ClearScrollResponseTests.java @@ -10,12 +10,12 @@ import org.elasticsearch.action.search.ClearScrollResponse; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/search/NestedIdentityTests.java b/server/src/test/java/org/elasticsearch/search/NestedIdentityTests.java index 74198942f19f2..ffa74a7998698 100644 --- a/server/src/test/java/org/elasticsearch/search/NestedIdentityTests.java +++ b/server/src/test/java/org/elasticsearch/search/NestedIdentityTests.java @@ -11,12 +11,12 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.search.SearchHit.NestedIdentity; import org.elasticsearch.test.ESTestCase; diff --git a/server/src/test/java/org/elasticsearch/search/SearchHitTests.java b/server/src/test/java/org/elasticsearch/search/SearchHitTests.java index c4de8093bbc2b..61623261b7faa 100644 --- a/server/src/test/java/org/elasticsearch/search/SearchHitTests.java +++ b/server/src/test/java/org/elasticsearch/search/SearchHitTests.java @@ -17,11 +17,11 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.document.DocumentField; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.Index; import org.elasticsearch.index.get.GetResultTests; import org.elasticsearch.index.shard.ShardId; diff --git a/server/src/test/java/org/elasticsearch/search/SearchHitsTests.java b/server/src/test/java/org/elasticsearch/search/SearchHitsTests.java index 85f13c98b8b9e..3b482451f37f7 100644 --- a/server/src/test/java/org/elasticsearch/search/SearchHitsTests.java +++ b/server/src/test/java/org/elasticsearch/search/SearchHitsTests.java @@ -17,11 +17,11 @@ import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.lucene.LuceneTests; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.Index; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.test.AbstractSerializingTestCase; diff --git a/server/src/test/java/org/elasticsearch/search/SearchModuleTests.java b/server/src/test/java/org/elasticsearch/search/SearchModuleTests.java index a978c99dba098..1e1591ab1f16c 100644 --- a/server/src/test/java/org/elasticsearch/search/SearchModuleTests.java +++ b/server/src/test/java/org/elasticsearch/search/SearchModuleTests.java @@ -15,10 +15,10 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.index.query.AbstractQueryBuilder; import org.elasticsearch.index.query.CommonTermsQueryBuilder; diff --git a/server/src/test/java/org/elasticsearch/search/SearchServiceTests.java b/server/src/test/java/org/elasticsearch/search/SearchServiceTests.java index 1ecdcc956669b..3f7a2b30e4099 100644 --- a/server/src/test/java/org/elasticsearch/search/SearchServiceTests.java +++ b/server/src/test/java/org/elasticsearch/search/SearchServiceTests.java @@ -40,8 +40,8 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.lucene.search.Queries; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.core.AbstractRefCounted; import org.elasticsearch.core.TimeValue; import org.elasticsearch.index.Index; diff --git a/server/src/test/java/org/elasticsearch/search/SearchSortValuesTests.java b/server/src/test/java/org/elasticsearch/search/SearchSortValuesTests.java index 46e52fbedafca..f1e8bb5773cd3 100644 --- a/server/src/test/java/org/elasticsearch/search/SearchSortValuesTests.java +++ b/server/src/test/java/org/elasticsearch/search/SearchSortValuesTests.java @@ -12,11 +12,11 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.lucene.LuceneTests; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.test.RandomObjects; diff --git a/server/src/test/java/org/elasticsearch/search/aggregations/AggregationsTests.java b/server/src/test/java/org/elasticsearch/search/aggregations/AggregationsTests.java index aa5d7b6450584..64eb0b12daac8 100644 --- a/server/src/test/java/org/elasticsearch/search/aggregations/AggregationsTests.java +++ b/server/src/test/java/org/elasticsearch/search/aggregations/AggregationsTests.java @@ -10,14 +10,7 @@ import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.rest.action.search.RestSearchAction; import org.elasticsearch.search.aggregations.Aggregation.CommonFields; import org.elasticsearch.search.aggregations.bucket.adjacency.InternalAdjacencyMatrixTests; @@ -74,6 +67,13 @@ import org.elasticsearch.test.InternalAggregationTestCase; import org.elasticsearch.test.InternalMultiBucketAggregationTestCase; import org.elasticsearch.test.hamcrest.ElasticsearchAssertions; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.junit.After; import org.junit.Before; diff --git a/server/src/test/java/org/elasticsearch/search/aggregations/AggregatorFactoriesBuilderTests.java b/server/src/test/java/org/elasticsearch/search/aggregations/AggregatorFactoriesBuilderTests.java index 87b8026d8b143..be3491965dc44 100644 --- a/server/src/test/java/org/elasticsearch/search/aggregations/AggregatorFactoriesBuilderTests.java +++ b/server/src/test/java/org/elasticsearch/search/aggregations/AggregatorFactoriesBuilderTests.java @@ -11,12 +11,12 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable.Reader; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.search.SearchModule; import org.elasticsearch.search.aggregations.AggregatorFactories.Builder; import org.elasticsearch.search.aggregations.pipeline.CumulativeSumPipelineAggregationBuilder; import org.elasticsearch.test.AbstractSerializingTestCase; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.junit.Before; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/search/aggregations/AggregatorFactoriesTests.java b/server/src/test/java/org/elasticsearch/search/aggregations/AggregatorFactoriesTests.java index 7e26488821e88..ee7d8c5e393bf 100644 --- a/server/src/test/java/org/elasticsearch/search/aggregations/AggregatorFactoriesTests.java +++ b/server/src/test/java/org/elasticsearch/search/aggregations/AggregatorFactoriesTests.java @@ -14,12 +14,6 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.env.Environment; import org.elasticsearch.index.query.MatchAllQueryBuilder; import org.elasticsearch.index.query.QueryBuilder; @@ -35,6 +29,12 @@ import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator.PipelineTree; import org.elasticsearch.test.AbstractQueryTestCase; import org.elasticsearch.test.ESTestCase; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import java.io.IOException; import java.util.Collection; diff --git a/server/src/test/java/org/elasticsearch/search/aggregations/InternalOrderTests.java b/server/src/test/java/org/elasticsearch/search/aggregations/InternalOrderTests.java index b8de1e26e2cb8..ef7d4114785f6 100644 --- a/server/src/test/java/org/elasticsearch/search/aggregations/InternalOrderTests.java +++ b/server/src/test/java/org/elasticsearch/search/aggregations/InternalOrderTests.java @@ -8,10 +8,10 @@ package org.elasticsearch.search.aggregations; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentParser.Token; import org.elasticsearch.search.aggregations.InternalOrder.CompoundOrder; import org.elasticsearch.test.AbstractSerializingTestCase; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser.Token; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/test/java/org/elasticsearch/search/aggregations/bucket/DateRangeTests.java b/server/src/test/java/org/elasticsearch/search/aggregations/bucket/DateRangeTests.java index 4d477cfcadb2e..f053977fcd712 100644 --- a/server/src/test/java/org/elasticsearch/search/aggregations/bucket/DateRangeTests.java +++ b/server/src/test/java/org/elasticsearch/search/aggregations/bucket/DateRangeTests.java @@ -8,12 +8,12 @@ package org.elasticsearch.search.aggregations.bucket; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.search.aggregations.BaseAggregationTestCase; import org.elasticsearch.search.aggregations.bucket.range.DateRangeAggregationBuilder; import org.elasticsearch.search.aggregations.bucket.range.RangeAggregator.Range; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/search/aggregations/bucket/FiltersTests.java b/server/src/test/java/org/elasticsearch/search/aggregations/bucket/FiltersTests.java index 19c081dde609c..7b96f9c8a4e2f 100644 --- a/server/src/test/java/org/elasticsearch/search/aggregations/bucket/FiltersTests.java +++ b/server/src/test/java/org/elasticsearch/search/aggregations/bucket/FiltersTests.java @@ -8,10 +8,6 @@ package org.elasticsearch.search.aggregations.bucket; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.index.query.BoolQueryBuilder; import org.elasticsearch.index.query.MatchAllQueryBuilder; import org.elasticsearch.index.query.MatchNoneQueryBuilder; @@ -24,6 +20,10 @@ import org.elasticsearch.search.aggregations.bucket.filter.FiltersAggregator.KeyedFilter; import org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder; import org.elasticsearch.search.aggregations.support.ValueType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.util.Collections; diff --git a/server/src/test/java/org/elasticsearch/search/aggregations/bucket/GeoDistanceRangeTests.java b/server/src/test/java/org/elasticsearch/search/aggregations/bucket/GeoDistanceRangeTests.java index fd106ae5303a5..249b477fa4ba5 100644 --- a/server/src/test/java/org/elasticsearch/search/aggregations/bucket/GeoDistanceRangeTests.java +++ b/server/src/test/java/org/elasticsearch/search/aggregations/bucket/GeoDistanceRangeTests.java @@ -11,14 +11,14 @@ import org.elasticsearch.common.geo.GeoDistance; import org.elasticsearch.common.geo.GeoPoint; import org.elasticsearch.common.unit.DistanceUnit; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.geo.GeometryTestUtils; import org.elasticsearch.geometry.Point; import org.elasticsearch.search.aggregations.BaseAggregationTestCase; import org.elasticsearch.search.aggregations.bucket.range.GeoDistanceAggregationBuilder; import org.elasticsearch.search.aggregations.bucket.range.GeoDistanceAggregationBuilder.Range; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/search/aggregations/bucket/RangeTests.java b/server/src/test/java/org/elasticsearch/search/aggregations/bucket/RangeTests.java index 8c2b6751177ea..0f550c1b302b0 100644 --- a/server/src/test/java/org/elasticsearch/search/aggregations/bucket/RangeTests.java +++ b/server/src/test/java/org/elasticsearch/search/aggregations/bucket/RangeTests.java @@ -8,12 +8,12 @@ package org.elasticsearch.search.aggregations.bucket; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.search.aggregations.BaseAggregationTestCase; import org.elasticsearch.search.aggregations.bucket.range.RangeAggregationBuilder; import org.elasticsearch.search.aggregations.bucket.range.RangeAggregator.Range; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/search/aggregations/bucket/ShardSizeTestCase.java b/server/src/test/java/org/elasticsearch/search/aggregations/bucket/ShardSizeTestCase.java index 98c6cfee17b05..80eb0c4ac6bbb 100644 --- a/server/src/test/java/org/elasticsearch/search/aggregations/bucket/ShardSizeTestCase.java +++ b/server/src/test/java/org/elasticsearch/search/aggregations/bucket/ShardSizeTestCase.java @@ -16,10 +16,10 @@ import java.util.Arrays; import java.util.List; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.is; public abstract class ShardSizeTestCase extends ESIntegTestCase { diff --git a/server/src/test/java/org/elasticsearch/search/aggregations/bucket/geogrid/GeoHashGridParserTests.java b/server/src/test/java/org/elasticsearch/search/aggregations/bucket/geogrid/GeoHashGridParserTests.java index 761f00cb6a4dd..910a375d635dd 100644 --- a/server/src/test/java/org/elasticsearch/search/aggregations/bucket/geogrid/GeoHashGridParserTests.java +++ b/server/src/test/java/org/elasticsearch/search/aggregations/bucket/geogrid/GeoHashGridParserTests.java @@ -8,12 +8,12 @@ package org.elasticsearch.search.aggregations.bucket.geogrid; import org.elasticsearch.common.unit.DistanceUnit; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.geo.GeometryTestUtils; import org.elasticsearch.geometry.Rectangle; import org.elasticsearch.test.ESTestCase; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.greaterThanOrEqualTo; diff --git a/server/src/test/java/org/elasticsearch/search/aggregations/bucket/geogrid/GeoTileGridParserTests.java b/server/src/test/java/org/elasticsearch/search/aggregations/bucket/geogrid/GeoTileGridParserTests.java index eec1c095e4397..1a12a331bfce0 100644 --- a/server/src/test/java/org/elasticsearch/search/aggregations/bucket/geogrid/GeoTileGridParserTests.java +++ b/server/src/test/java/org/elasticsearch/search/aggregations/bucket/geogrid/GeoTileGridParserTests.java @@ -8,12 +8,12 @@ package org.elasticsearch.search.aggregations.bucket.geogrid; import org.elasticsearch.ExceptionsHelper; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.geo.GeometryTestUtils; import org.elasticsearch.geometry.Rectangle; import org.elasticsearch.test.ESTestCase; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.instanceOf; diff --git a/server/src/test/java/org/elasticsearch/search/aggregations/bucket/histogram/DoubleBoundsTests.java b/server/src/test/java/org/elasticsearch/search/aggregations/bucket/histogram/DoubleBoundsTests.java index fe1a3b61bcb39..72ab3c07fe1c4 100644 --- a/server/src/test/java/org/elasticsearch/search/aggregations/bucket/histogram/DoubleBoundsTests.java +++ b/server/src/test/java/org/elasticsearch/search/aggregations/bucket/histogram/DoubleBoundsTests.java @@ -11,11 +11,11 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.test.ESTestCase; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/search/aggregations/bucket/histogram/LongBoundsTests.java b/server/src/test/java/org/elasticsearch/search/aggregations/bucket/histogram/LongBoundsTests.java index 007dcf89d639a..8f2b60aba09a4 100644 --- a/server/src/test/java/org/elasticsearch/search/aggregations/bucket/histogram/LongBoundsTests.java +++ b/server/src/test/java/org/elasticsearch/search/aggregations/bucket/histogram/LongBoundsTests.java @@ -13,13 +13,13 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.time.DateFormatter; import org.elasticsearch.common.time.DateUtils; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.index.mapper.DateFieldMapper; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.test.ESTestCase; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import java.io.IOException; import java.time.ZoneOffset; diff --git a/server/src/test/java/org/elasticsearch/search/aggregations/bucket/range/RangeAggregationBuilderTests.java b/server/src/test/java/org/elasticsearch/search/aggregations/bucket/range/RangeAggregationBuilderTests.java index 2175f19ce02f0..68a2b6f35b3b5 100644 --- a/server/src/test/java/org/elasticsearch/search/aggregations/bucket/range/RangeAggregationBuilderTests.java +++ b/server/src/test/java/org/elasticsearch/search/aggregations/bucket/range/RangeAggregationBuilderTests.java @@ -9,9 +9,9 @@ package org.elasticsearch.search.aggregations.bucket.range; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.test.AbstractSerializingTestCase; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/test/java/org/elasticsearch/search/aggregations/metrics/AbstractGeoTestCase.java b/server/src/test/java/org/elasticsearch/search/aggregations/metrics/AbstractGeoTestCase.java index 23fe564a26cb0..e4a349160f549 100644 --- a/server/src/test/java/org/elasticsearch/search/aggregations/metrics/AbstractGeoTestCase.java +++ b/server/src/test/java/org/elasticsearch/search/aggregations/metrics/AbstractGeoTestCase.java @@ -19,22 +19,22 @@ import org.elasticsearch.common.document.DocumentField; import org.elasticsearch.common.geo.GeoPoint; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.geometry.utils.Geohash; import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.sort.SortBuilders; import org.elasticsearch.search.sort.SortOrder; import org.elasticsearch.test.ESIntegTestCase; import org.elasticsearch.test.geo.RandomGeoGenerator; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import java.util.ArrayList; import java.util.List; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.equalTo; @ESIntegTestCase.SuiteScopeTestCase diff --git a/server/src/test/java/org/elasticsearch/search/aggregations/metrics/AbstractPercentilesTestCase.java b/server/src/test/java/org/elasticsearch/search/aggregations/metrics/AbstractPercentilesTestCase.java index 00ce4c64bb6dd..773e5f5881cc6 100644 --- a/server/src/test/java/org/elasticsearch/search/aggregations/metrics/AbstractPercentilesTestCase.java +++ b/server/src/test/java/org/elasticsearch/search/aggregations/metrics/AbstractPercentilesTestCase.java @@ -9,13 +9,13 @@ package org.elasticsearch.search.aggregations.metrics; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.Aggregation.CommonFields; import org.elasticsearch.search.aggregations.InternalAggregation; import org.elasticsearch.test.InternalAggregationTestCase; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import java.io.IOException; import java.util.Arrays; diff --git a/server/src/test/java/org/elasticsearch/search/aggregations/metrics/InternalStatsTests.java b/server/src/test/java/org/elasticsearch/search/aggregations/metrics/InternalStatsTests.java index 5a7ae9b13d9cd..59587468b55bc 100644 --- a/server/src/test/java/org/elasticsearch/search/aggregations/metrics/InternalStatsTests.java +++ b/server/src/test/java/org/elasticsearch/search/aggregations/metrics/InternalStatsTests.java @@ -8,13 +8,13 @@ package org.elasticsearch.search.aggregations.metrics; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.InternalAggregation; import org.elasticsearch.search.aggregations.ParsedAggregation; import org.elasticsearch.test.InternalAggregationTestCase; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/test/java/org/elasticsearch/search/aggregations/metrics/InternalTopHitsTests.java b/server/src/test/java/org/elasticsearch/search/aggregations/metrics/InternalTopHitsTests.java index 61e8de696233f..aac96be83f88b 100644 --- a/server/src/test/java/org/elasticsearch/search/aggregations/metrics/InternalTopHitsTests.java +++ b/server/src/test/java/org/elasticsearch/search/aggregations/metrics/InternalTopHitsTests.java @@ -20,10 +20,7 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.document.DocumentField; import org.elasticsearch.common.lucene.search.TopDocsAndMaxScore; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.core.Tuple; import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.SearchHits; @@ -31,6 +28,9 @@ import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.InternalAggregationTestCase; import org.elasticsearch.test.NotEqualMessageBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/test/java/org/elasticsearch/search/aggregations/metrics/PercentilesTests.java b/server/src/test/java/org/elasticsearch/search/aggregations/metrics/PercentilesTests.java index 08265565d60f7..2798d6d83310e 100644 --- a/server/src/test/java/org/elasticsearch/search/aggregations/metrics/PercentilesTests.java +++ b/server/src/test/java/org/elasticsearch/search/aggregations/metrics/PercentilesTests.java @@ -8,10 +8,10 @@ package org.elasticsearch.search.aggregations.metrics; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.search.aggregations.BaseAggregationTestCase; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/search/aggregations/metrics/TopHitsTests.java b/server/src/test/java/org/elasticsearch/search/aggregations/metrics/TopHitsTests.java index b343a34210636..ef35f3630f122 100644 --- a/server/src/test/java/org/elasticsearch/search/aggregations/metrics/TopHitsTests.java +++ b/server/src/test/java/org/elasticsearch/search/aggregations/metrics/TopHitsTests.java @@ -9,9 +9,6 @@ package org.elasticsearch.search.aggregations.metrics; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.search.aggregations.AggregationInitializationException; import org.elasticsearch.search.aggregations.AggregatorFactories; import org.elasticsearch.search.aggregations.BaseAggregationTestCase; @@ -22,6 +19,9 @@ import org.elasticsearch.search.sort.SortOrder; import org.elasticsearch.test.AbstractQueryTestCase; import org.elasticsearch.test.hamcrest.ElasticsearchAssertions; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/test/java/org/elasticsearch/search/aggregations/metrics/weighted_avg/WeightedAvgAggregationBuilderTests.java b/server/src/test/java/org/elasticsearch/search/aggregations/metrics/weighted_avg/WeightedAvgAggregationBuilderTests.java index ee41024ee8abd..8ea9213d1a8d1 100644 --- a/server/src/test/java/org/elasticsearch/search/aggregations/metrics/weighted_avg/WeightedAvgAggregationBuilderTests.java +++ b/server/src/test/java/org/elasticsearch/search/aggregations/metrics/weighted_avg/WeightedAvgAggregationBuilderTests.java @@ -10,13 +10,13 @@ import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.search.SearchModule; import org.elasticsearch.search.aggregations.AggregatorFactories; import org.elasticsearch.search.aggregations.metrics.WeightedAvgAggregationBuilder; import org.elasticsearch.search.aggregations.support.MultiValuesSourceFieldConfig; import org.elasticsearch.test.AbstractSerializingTestCase; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.junit.Before; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/search/aggregations/pipeline/BucketHelpersTests.java b/server/src/test/java/org/elasticsearch/search/aggregations/pipeline/BucketHelpersTests.java index a061af9e95db9..e772fe75cf152 100644 --- a/server/src/test/java/org/elasticsearch/search/aggregations/pipeline/BucketHelpersTests.java +++ b/server/src/test/java/org/elasticsearch/search/aggregations/pipeline/BucketHelpersTests.java @@ -9,13 +9,13 @@ package org.elasticsearch.search.aggregations.pipeline; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.aggregations.AggregationExecutionException; import org.elasticsearch.search.aggregations.Aggregations; import org.elasticsearch.search.aggregations.InternalMultiBucketAggregation; import org.elasticsearch.search.aggregations.bucket.MultiBucketsAggregation; import org.elasticsearch.search.aggregations.metrics.InternalTDigestPercentiles; import org.elasticsearch.test.ESTestCase; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.List; diff --git a/server/src/test/java/org/elasticsearch/search/aggregations/pipeline/BucketScriptTests.java b/server/src/test/java/org/elasticsearch/search/aggregations/pipeline/BucketScriptTests.java index 408b6c84519e6..b7ecc2667ffe8 100644 --- a/server/src/test/java/org/elasticsearch/search/aggregations/pipeline/BucketScriptTests.java +++ b/server/src/test/java/org/elasticsearch/search/aggregations/pipeline/BucketScriptTests.java @@ -8,12 +8,12 @@ package org.elasticsearch.search.aggregations.pipeline; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.script.Script; import org.elasticsearch.script.ScriptType; import org.elasticsearch.search.aggregations.BasePipelineAggregationTestCase; import org.elasticsearch.search.aggregations.pipeline.BucketHelpers.GapPolicy; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import java.io.IOException; import java.util.HashMap; diff --git a/server/src/test/java/org/elasticsearch/search/aggregations/pipeline/ExtendedStatsBucketTests.java b/server/src/test/java/org/elasticsearch/search/aggregations/pipeline/ExtendedStatsBucketTests.java index 54c18dfb1052a..ceb88d5b4216e 100644 --- a/server/src/test/java/org/elasticsearch/search/aggregations/pipeline/ExtendedStatsBucketTests.java +++ b/server/src/test/java/org/elasticsearch/search/aggregations/pipeline/ExtendedStatsBucketTests.java @@ -8,12 +8,12 @@ package org.elasticsearch.search.aggregations.pipeline; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.bucket.global.GlobalAggregationBuilder; import org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder; import org.elasticsearch.search.aggregations.support.ValueType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import java.util.HashSet; import java.util.Set; diff --git a/server/src/test/java/org/elasticsearch/search/aggregations/pipeline/InternalPercentilesBucketTests.java b/server/src/test/java/org/elasticsearch/search/aggregations/pipeline/InternalPercentilesBucketTests.java index a5d33f16d477d..547536e0c32c7 100644 --- a/server/src/test/java/org/elasticsearch/search/aggregations/pipeline/InternalPercentilesBucketTests.java +++ b/server/src/test/java/org/elasticsearch/search/aggregations/pipeline/InternalPercentilesBucketTests.java @@ -9,14 +9,14 @@ package org.elasticsearch.search.aggregations.pipeline; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.Aggregation.CommonFields; import org.elasticsearch.search.aggregations.ParsedAggregation; import org.elasticsearch.search.aggregations.metrics.Percentile; import org.elasticsearch.test.InternalAggregationTestCase; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/test/java/org/elasticsearch/search/aggregations/pipeline/PercentilesBucketTests.java b/server/src/test/java/org/elasticsearch/search/aggregations/pipeline/PercentilesBucketTests.java index a0914e8367133..6ce280e4067b3 100644 --- a/server/src/test/java/org/elasticsearch/search/aggregations/pipeline/PercentilesBucketTests.java +++ b/server/src/test/java/org/elasticsearch/search/aggregations/pipeline/PercentilesBucketTests.java @@ -8,12 +8,12 @@ package org.elasticsearch.search.aggregations.pipeline; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.bucket.global.GlobalAggregationBuilder; import org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder; import org.elasticsearch.search.aggregations.support.ValueType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import java.util.HashSet; import java.util.Set; diff --git a/server/src/test/java/org/elasticsearch/search/aggregations/support/IncludeExcludeTests.java b/server/src/test/java/org/elasticsearch/search/aggregations/support/IncludeExcludeTests.java index 70697d07b91e5..e95242810556c 100644 --- a/server/src/test/java/org/elasticsearch/search/aggregations/support/IncludeExcludeTests.java +++ b/server/src/test/java/org/elasticsearch/search/aggregations/support/IncludeExcludeTests.java @@ -12,18 +12,18 @@ import org.apache.lucene.index.SortedSetDocValues; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.LongBitSet; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.index.fielddata.AbstractSortedSetDocValues; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.bucket.terms.IncludeExclude; import org.elasticsearch.search.aggregations.bucket.terms.IncludeExclude.OrdinalsFilter; import org.elasticsearch.search.aggregations.bucket.terms.IncludeExclude.StringFilter; import org.elasticsearch.test.ESTestCase; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.util.Collections; diff --git a/server/src/test/java/org/elasticsearch/search/aggregations/support/MultiValuesSourceFieldConfigTests.java b/server/src/test/java/org/elasticsearch/search/aggregations/support/MultiValuesSourceFieldConfigTests.java index e74ad00f277b1..7fc07c5e78758 100644 --- a/server/src/test/java/org/elasticsearch/search/aggregations/support/MultiValuesSourceFieldConfigTests.java +++ b/server/src/test/java/org/elasticsearch/search/aggregations/support/MultiValuesSourceFieldConfigTests.java @@ -11,13 +11,13 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.script.Script; import org.elasticsearch.search.SearchModule; import org.elasticsearch.test.AbstractSerializingTestCase; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.time.ZoneId; diff --git a/server/src/test/java/org/elasticsearch/search/builder/PointInTimeBuilderTests.java b/server/src/test/java/org/elasticsearch/search/builder/PointInTimeBuilderTests.java index edd8e81ebf683..42a17902c6243 100644 --- a/server/src/test/java/org/elasticsearch/search/builder/PointInTimeBuilderTests.java +++ b/server/src/test/java/org/elasticsearch/search/builder/PointInTimeBuilderTests.java @@ -9,7 +9,7 @@ package org.elasticsearch.search.builder; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/search/builder/SearchSourceBuilderTests.java b/server/src/test/java/org/elasticsearch/search/builder/SearchSourceBuilderTests.java index 85150128ce1b2..e432da4eb227a 100644 --- a/server/src/test/java/org/elasticsearch/search/builder/SearchSourceBuilderTests.java +++ b/server/src/test/java/org/elasticsearch/search/builder/SearchSourceBuilderTests.java @@ -15,13 +15,13 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.query.BoolQueryBuilder; import org.elasticsearch.index.query.MatchNoneQueryBuilder; import org.elasticsearch.index.query.QueryBuilders; diff --git a/server/src/test/java/org/elasticsearch/search/collapse/CollapseBuilderTests.java b/server/src/test/java/org/elasticsearch/search/collapse/CollapseBuilderTests.java index cff84c07019fb..7624a2ae9ce66 100644 --- a/server/src/test/java/org/elasticsearch/search/collapse/CollapseBuilderTests.java +++ b/server/src/test/java/org/elasticsearch/search/collapse/CollapseBuilderTests.java @@ -17,8 +17,8 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.mapper.KeywordFieldMapper; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.mapper.NumberFieldMapper; diff --git a/server/src/test/java/org/elasticsearch/search/fetch/subphase/FetchSourceContextTests.java b/server/src/test/java/org/elasticsearch/search/fetch/subphase/FetchSourceContextTests.java index 091466b421bb1..484b0e4506e1f 100644 --- a/server/src/test/java/org/elasticsearch/search/fetch/subphase/FetchSourceContextTests.java +++ b/server/src/test/java/org/elasticsearch/search/fetch/subphase/FetchSourceContextTests.java @@ -10,9 +10,9 @@ import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/search/fetch/subphase/FetchSourcePhaseTests.java b/server/src/test/java/org/elasticsearch/search/fetch/subphase/FetchSourcePhaseTests.java index a6fbaaf04a7a2..2d623ccede76c 100644 --- a/server/src/test/java/org/elasticsearch/search/fetch/subphase/FetchSourcePhaseTests.java +++ b/server/src/test/java/org/elasticsearch/search/fetch/subphase/FetchSourcePhaseTests.java @@ -12,8 +12,8 @@ import org.apache.lucene.index.memory.MemoryIndex; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.index.query.SearchExecutionContext; import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.fetch.FetchContext; diff --git a/server/src/test/java/org/elasticsearch/search/fetch/subphase/FieldFetcherTests.java b/server/src/test/java/org/elasticsearch/search/fetch/subphase/FieldFetcherTests.java index cd0921c64bed2..7560058cc6952 100644 --- a/server/src/test/java/org/elasticsearch/search/fetch/subphase/FieldFetcherTests.java +++ b/server/src/test/java/org/elasticsearch/search/fetch/subphase/FieldFetcherTests.java @@ -15,8 +15,8 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.document.DocumentField; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.mapper.MapperService; import org.elasticsearch.index.mapper.MapperServiceTestCase; @@ -31,7 +31,7 @@ import java.util.Map; import static java.util.Collections.emptyMap; -import static org.elasticsearch.common.xcontent.ObjectPath.eval; +import static org.elasticsearch.xcontent.ObjectPath.eval; import static org.hamcrest.Matchers.containsInAnyOrder; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasItems; diff --git a/server/src/test/java/org/elasticsearch/search/fetch/subphase/highlight/HighlightBuilderTests.java b/server/src/test/java/org/elasticsearch/search/fetch/subphase/highlight/HighlightBuilderTests.java index a4e8c6e0973d8..710e7b6994529 100644 --- a/server/src/test/java/org/elasticsearch/search/fetch/subphase/highlight/HighlightBuilderTests.java +++ b/server/src/test/java/org/elasticsearch/search/fetch/subphase/highlight/HighlightBuilderTests.java @@ -16,14 +16,14 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.Index; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.mapper.MappedFieldType; diff --git a/server/src/test/java/org/elasticsearch/search/fetch/subphase/highlight/HighlightFieldTests.java b/server/src/test/java/org/elasticsearch/search/fetch/subphase/highlight/HighlightFieldTests.java index 91cb7bb2a6145..56d686e92f677 100644 --- a/server/src/test/java/org/elasticsearch/search/fetch/subphase/highlight/HighlightFieldTests.java +++ b/server/src/test/java/org/elasticsearch/search/fetch/subphase/highlight/HighlightFieldTests.java @@ -12,12 +12,12 @@ import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.text.Text; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/search/geo/GeoPointShapeQueryTests.java b/server/src/test/java/org/elasticsearch/search/geo/GeoPointShapeQueryTests.java index 89a4551f3d3b0..a4283d350f3df 100644 --- a/server/src/test/java/org/elasticsearch/search/geo/GeoPointShapeQueryTests.java +++ b/server/src/test/java/org/elasticsearch/search/geo/GeoPointShapeQueryTests.java @@ -11,8 +11,8 @@ import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.geo.GeometryTestUtils; import org.elasticsearch.geometry.Point; import org.elasticsearch.geometry.utils.WellKnownText; @@ -20,7 +20,7 @@ import java.io.IOException; import static org.elasticsearch.action.support.WriteRequest.RefreshPolicy.IMMEDIATE; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.geoShapeQuery; public class GeoPointShapeQueryTests extends GeoPointShapeQueryTestCase { diff --git a/server/src/test/java/org/elasticsearch/search/geo/GeoShapeQueryTests.java b/server/src/test/java/org/elasticsearch/search/geo/GeoShapeQueryTests.java index 197dddd0c9dfa..b14a8c2e13ed5 100644 --- a/server/src/test/java/org/elasticsearch/search/geo/GeoShapeQueryTests.java +++ b/server/src/test/java/org/elasticsearch/search/geo/GeoShapeQueryTests.java @@ -12,15 +12,15 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.geo.GeoJson; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.geo.GeometryTestUtils; import org.elasticsearch.geometry.MultiPoint; import java.io.IOException; import static org.elasticsearch.action.support.WriteRequest.RefreshPolicy.IMMEDIATE; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.geoShapeQuery; public class GeoShapeQueryTests extends GeoShapeQueryTestCase { diff --git a/server/src/test/java/org/elasticsearch/search/internal/ShardSearchRequestTests.java b/server/src/test/java/org/elasticsearch/search/internal/ShardSearchRequestTests.java index be982eede6b63..3c2ffad8cf63c 100644 --- a/server/src/test/java/org/elasticsearch/search/internal/ShardSearchRequestTests.java +++ b/server/src/test/java/org/elasticsearch/search/internal/ShardSearchRequestTests.java @@ -21,11 +21,11 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.index.query.RandomQueryBuilder; diff --git a/server/src/test/java/org/elasticsearch/search/profile/ProfileResultTests.java b/server/src/test/java/org/elasticsearch/search/profile/ProfileResultTests.java index f6c3dd3dd3d83..d703f9f1f7407 100644 --- a/server/src/test/java/org/elasticsearch/search/profile/ProfileResultTests.java +++ b/server/src/test/java/org/elasticsearch/search/profile/ProfileResultTests.java @@ -10,10 +10,10 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/search/profile/SearchProfileResultsTests.java b/server/src/test/java/org/elasticsearch/search/profile/SearchProfileResultsTests.java index 00bcee23d7fbb..8ea166faaefbd 100644 --- a/server/src/test/java/org/elasticsearch/search/profile/SearchProfileResultsTests.java +++ b/server/src/test/java/org/elasticsearch/search/profile/SearchProfileResultsTests.java @@ -9,7 +9,7 @@ package org.elasticsearch.search.profile; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/search/profile/aggregation/AggregationProfileShardResultTests.java b/server/src/test/java/org/elasticsearch/search/profile/aggregation/AggregationProfileShardResultTests.java index 51b836792abc6..4bd5ff3102dbd 100644 --- a/server/src/test/java/org/elasticsearch/search/profile/aggregation/AggregationProfileShardResultTests.java +++ b/server/src/test/java/org/elasticsearch/search/profile/aggregation/AggregationProfileShardResultTests.java @@ -10,9 +10,9 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParserUtils; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.search.profile.ProfileResult; import org.elasticsearch.search.profile.ProfileResultTests; import org.elasticsearch.test.AbstractSerializingTestCase; diff --git a/server/src/test/java/org/elasticsearch/search/profile/query/CollectorResultTests.java b/server/src/test/java/org/elasticsearch/search/profile/query/CollectorResultTests.java index f782c9c9a683a..0019212b54981 100644 --- a/server/src/test/java/org/elasticsearch/search/profile/query/CollectorResultTests.java +++ b/server/src/test/java/org/elasticsearch/search/profile/query/CollectorResultTests.java @@ -10,10 +10,10 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/search/profile/query/QueryProfileShardResultTests.java b/server/src/test/java/org/elasticsearch/search/profile/query/QueryProfileShardResultTests.java index f103146ef0242..e2bfd2bfa1784 100644 --- a/server/src/test/java/org/elasticsearch/search/profile/query/QueryProfileShardResultTests.java +++ b/server/src/test/java/org/elasticsearch/search/profile/query/QueryProfileShardResultTests.java @@ -9,7 +9,7 @@ package org.elasticsearch.search.profile.query; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.profile.ProfileResult; import org.elasticsearch.search.profile.ProfileResultTests; import org.elasticsearch.test.AbstractSerializingTestCase; diff --git a/server/src/test/java/org/elasticsearch/search/rescore/QueryRescorerBuilderTests.java b/server/src/test/java/org/elasticsearch/search/rescore/QueryRescorerBuilderTests.java index 6ef5f784b5333..ca00bf9b22d2f 100644 --- a/server/src/test/java/org/elasticsearch/search/rescore/QueryRescorerBuilderTests.java +++ b/server/src/test/java/org/elasticsearch/search/rescore/QueryRescorerBuilderTests.java @@ -15,15 +15,15 @@ import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedObjectNotFoundException; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.NamedObjectNotFoundException; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.mapper.MapperBuilderContext; diff --git a/server/src/test/java/org/elasticsearch/search/scroll/RestClearScrollActionTests.java b/server/src/test/java/org/elasticsearch/search/scroll/RestClearScrollActionTests.java index af8b01a476904..5ce39b3160a35 100644 --- a/server/src/test/java/org/elasticsearch/search/scroll/RestClearScrollActionTests.java +++ b/server/src/test/java/org/elasticsearch/search/scroll/RestClearScrollActionTests.java @@ -14,7 +14,7 @@ import org.elasticsearch.action.search.ClearScrollResponse; import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.common.bytes.BytesArray; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.search.RestClearScrollAction; import org.elasticsearch.test.ESTestCase; diff --git a/server/src/test/java/org/elasticsearch/search/scroll/RestSearchScrollActionTests.java b/server/src/test/java/org/elasticsearch/search/scroll/RestSearchScrollActionTests.java index a40e998cafc0e..e6bc539e196fc 100644 --- a/server/src/test/java/org/elasticsearch/search/scroll/RestSearchScrollActionTests.java +++ b/server/src/test/java/org/elasticsearch/search/scroll/RestSearchScrollActionTests.java @@ -14,7 +14,7 @@ import org.elasticsearch.action.search.SearchScrollRequest; import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.common.bytes.BytesArray; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.search.RestSearchScrollAction; import org.elasticsearch.test.ESTestCase; diff --git a/server/src/test/java/org/elasticsearch/search/searchafter/SearchAfterBuilderTests.java b/server/src/test/java/org/elasticsearch/search/searchafter/SearchAfterBuilderTests.java index 1b0b6d1876a97..27ccb26a72a27 100644 --- a/server/src/test/java/org/elasticsearch/search/searchafter/SearchAfterBuilderTests.java +++ b/server/src/test/java/org/elasticsearch/search/searchafter/SearchAfterBuilderTests.java @@ -18,11 +18,11 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.text.Text; import org.elasticsearch.common.util.BigArrays; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.fielddata.IndexFieldData; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.MultiValueMode; diff --git a/server/src/test/java/org/elasticsearch/search/slice/SliceBuilderTests.java b/server/src/test/java/org/elasticsearch/search/slice/SliceBuilderTests.java index da80a686d8d18..21e2be0e3cee5 100644 --- a/server/src/test/java/org/elasticsearch/search/slice/SliceBuilderTests.java +++ b/server/src/test/java/org/elasticsearch/search/slice/SliceBuilderTests.java @@ -24,10 +24,10 @@ import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.Nullable; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.fielddata.IndexNumericFieldData; diff --git a/server/src/test/java/org/elasticsearch/search/sort/AbstractSortTestCase.java b/server/src/test/java/org/elasticsearch/search/sort/AbstractSortTestCase.java index 3d54b8cfe498d..545b23e92ecc2 100644 --- a/server/src/test/java/org/elasticsearch/search/sort/AbstractSortTestCase.java +++ b/server/src/test/java/org/elasticsearch/search/sort/AbstractSortTestCase.java @@ -15,12 +15,12 @@ import org.elasticsearch.common.TriFunction; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.env.Environment; import org.elasticsearch.index.Index; import org.elasticsearch.index.IndexSettings; diff --git a/server/src/test/java/org/elasticsearch/search/sort/FieldSortBuilderTests.java b/server/src/test/java/org/elasticsearch/search/sort/FieldSortBuilderTests.java index aab44654c83fc..5ead9432f1901 100644 --- a/server/src/test/java/org/elasticsearch/search/sort/FieldSortBuilderTests.java +++ b/server/src/test/java/org/elasticsearch/search/sort/FieldSortBuilderTests.java @@ -31,9 +31,9 @@ import org.apache.lucene.search.TermQuery; import org.apache.lucene.store.Directory; import org.apache.lucene.util.BytesRef; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.fielddata.IndexFieldData.XFieldComparatorSource; import org.elasticsearch.index.fielddata.IndexFieldData.XFieldComparatorSource.Nested; import org.elasticsearch.index.mapper.DateFieldMapper; diff --git a/server/src/test/java/org/elasticsearch/search/sort/GeoDistanceSortBuilderTests.java b/server/src/test/java/org/elasticsearch/search/sort/GeoDistanceSortBuilderTests.java index 966967e21e348..93d75755a17e8 100644 --- a/server/src/test/java/org/elasticsearch/search/sort/GeoDistanceSortBuilderTests.java +++ b/server/src/test/java/org/elasticsearch/search/sort/GeoDistanceSortBuilderTests.java @@ -18,9 +18,9 @@ import org.elasticsearch.common.geo.GeoDistance; import org.elasticsearch.common.geo.GeoPoint; import org.elasticsearch.common.unit.DistanceUnit; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.fielddata.IndexFieldData.XFieldComparatorSource; import org.elasticsearch.index.fielddata.IndexFieldData.XFieldComparatorSource.Nested; import org.elasticsearch.index.mapper.GeoPointFieldMapper; @@ -41,7 +41,7 @@ import java.io.IOException; import java.util.Arrays; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.instanceOf; public class GeoDistanceSortBuilderTests extends AbstractSortTestCase { diff --git a/server/src/test/java/org/elasticsearch/search/sort/NestedSortBuilderTests.java b/server/src/test/java/org/elasticsearch/search/sort/NestedSortBuilderTests.java index 77a5b8dfb81d8..541a1003c63a8 100644 --- a/server/src/test/java/org/elasticsearch/search/sort/NestedSortBuilderTests.java +++ b/server/src/test/java/org/elasticsearch/search/sort/NestedSortBuilderTests.java @@ -10,12 +10,12 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.query.ConstantScoreQueryBuilder; import org.elasticsearch.index.query.MatchAllQueryBuilder; import org.elasticsearch.index.query.MatchNoneQueryBuilder; diff --git a/server/src/test/java/org/elasticsearch/search/sort/ScoreSortBuilderTests.java b/server/src/test/java/org/elasticsearch/search/sort/ScoreSortBuilderTests.java index b7791df666a56..f49786283eba1 100644 --- a/server/src/test/java/org/elasticsearch/search/sort/ScoreSortBuilderTests.java +++ b/server/src/test/java/org/elasticsearch/search/sort/ScoreSortBuilderTests.java @@ -10,8 +10,8 @@ import org.apache.lucene.search.SortField; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.search.DocValueFormat; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/search/sort/ScriptSortBuilderTests.java b/server/src/test/java/org/elasticsearch/search/sort/ScriptSortBuilderTests.java index 951eb90647e70..4c9a07509641f 100644 --- a/server/src/test/java/org/elasticsearch/search/sort/ScriptSortBuilderTests.java +++ b/server/src/test/java/org/elasticsearch/search/sort/ScriptSortBuilderTests.java @@ -13,9 +13,9 @@ import org.apache.lucene.search.MatchAllDocsQuery; import org.apache.lucene.search.SortField; import org.apache.lucene.search.TermQuery; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.fielddata.IndexFieldData.XFieldComparatorSource; import org.elasticsearch.index.fielddata.IndexFieldData.XFieldComparatorSource.Nested; import org.elasticsearch.index.fielddata.fieldcomparator.BytesRefFieldComparatorSource; diff --git a/server/src/test/java/org/elasticsearch/search/sort/SortBuilderTests.java b/server/src/test/java/org/elasticsearch/search/sort/SortBuilderTests.java index fe39c356f365f..e55b8806e3b6b 100644 --- a/server/src/test/java/org/elasticsearch/search/sort/SortBuilderTests.java +++ b/server/src/test/java/org/elasticsearch/search/sort/SortBuilderTests.java @@ -11,12 +11,12 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.geo.GeoPoint; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.search.SearchModule; import org.elasticsearch.test.ESTestCase; import org.junit.AfterClass; diff --git a/server/src/test/java/org/elasticsearch/search/sort/SortValueTests.java b/server/src/test/java/org/elasticsearch/search/sort/SortValueTests.java index 410fd138938c4..286b066f8daa6 100644 --- a/server/src/test/java/org/elasticsearch/search/sort/SortValueTests.java +++ b/server/src/test/java/org/elasticsearch/search/sort/SortValueTests.java @@ -15,8 +15,8 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.network.InetAddresses; import org.elasticsearch.common.time.DateFormatter; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.mapper.DateFieldMapper; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.test.AbstractNamedWriteableTestCase; diff --git a/server/src/test/java/org/elasticsearch/search/suggest/AbstractSuggestionBuilderTestCase.java b/server/src/test/java/org/elasticsearch/search/suggest/AbstractSuggestionBuilderTestCase.java index 46ee9b408b30b..ca17e6d9731db 100644 --- a/server/src/test/java/org/elasticsearch/search/suggest/AbstractSuggestionBuilderTestCase.java +++ b/server/src/test/java/org/elasticsearch/search/suggest/AbstractSuggestionBuilderTestCase.java @@ -14,12 +14,12 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.Index; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.analysis.AnalyzerScope; diff --git a/server/src/test/java/org/elasticsearch/search/suggest/CompletionSuggestionOptionTests.java b/server/src/test/java/org/elasticsearch/search/suggest/CompletionSuggestionOptionTests.java index 1319c5540f5af..13ff23862ced0 100644 --- a/server/src/test/java/org/elasticsearch/search/suggest/CompletionSuggestionOptionTests.java +++ b/server/src/test/java/org/elasticsearch/search/suggest/CompletionSuggestionOptionTests.java @@ -10,9 +10,9 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.text.Text; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.SearchHitTests; import org.elasticsearch.search.suggest.completion.CompletionSuggestion; diff --git a/server/src/test/java/org/elasticsearch/search/suggest/SuggestBuilderTests.java b/server/src/test/java/org/elasticsearch/search/suggest/SuggestBuilderTests.java index 0bfe8dc9a5a94..65d56a8e81b26 100644 --- a/server/src/test/java/org/elasticsearch/search/suggest/SuggestBuilderTests.java +++ b/server/src/test/java/org/elasticsearch/search/suggest/SuggestBuilderTests.java @@ -10,12 +10,12 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.search.SearchModule; import org.elasticsearch.search.suggest.completion.CompletionSuggesterBuilderTests; import org.elasticsearch.search.suggest.phrase.PhraseSuggestionBuilderTests; diff --git a/server/src/test/java/org/elasticsearch/search/suggest/SuggestTests.java b/server/src/test/java/org/elasticsearch/search/suggest/SuggestTests.java index 13a9d40bde2da..8e88fa5bfb463 100644 --- a/server/src/test/java/org/elasticsearch/search/suggest/SuggestTests.java +++ b/server/src/test/java/org/elasticsearch/search/suggest/SuggestTests.java @@ -9,7 +9,7 @@ package org.elasticsearch.search.suggest; import org.elasticsearch.Version; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.BytesStreamOutput; @@ -17,12 +17,12 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.text.Text; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.rest.action.search.RestSearchAction; import org.elasticsearch.search.SearchModule; import org.elasticsearch.search.suggest.Suggest.Suggestion; diff --git a/server/src/test/java/org/elasticsearch/search/suggest/SuggestionEntryTests.java b/server/src/test/java/org/elasticsearch/search/suggest/SuggestionEntryTests.java index 8768b8ce37e28..c6ce0a8ec35e2 100644 --- a/server/src/test/java/org/elasticsearch/search/suggest/SuggestionEntryTests.java +++ b/server/src/test/java/org/elasticsearch/search/suggest/SuggestionEntryTests.java @@ -10,9 +10,9 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.text.Text; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.search.suggest.Suggest.Suggestion.Entry; import org.elasticsearch.search.suggest.Suggest.Suggestion.Entry.Option; import org.elasticsearch.search.suggest.completion.CompletionSuggestion; diff --git a/server/src/test/java/org/elasticsearch/search/suggest/SuggestionOptionTests.java b/server/src/test/java/org/elasticsearch/search/suggest/SuggestionOptionTests.java index bcf70262709c9..249d3af76096a 100644 --- a/server/src/test/java/org/elasticsearch/search/suggest/SuggestionOptionTests.java +++ b/server/src/test/java/org/elasticsearch/search/suggest/SuggestionOptionTests.java @@ -10,9 +10,9 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.text.Text; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.search.suggest.Suggest.Suggestion.Entry.Option; import org.elasticsearch.search.suggest.phrase.PhraseSuggestion; import org.elasticsearch.test.ESTestCase; diff --git a/server/src/test/java/org/elasticsearch/search/suggest/SuggestionTests.java b/server/src/test/java/org/elasticsearch/search/suggest/SuggestionTests.java index 532a0af7cc2ba..24e5af2416b96 100644 --- a/server/src/test/java/org/elasticsearch/search/suggest/SuggestionTests.java +++ b/server/src/test/java/org/elasticsearch/search/suggest/SuggestionTests.java @@ -10,14 +10,14 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.text.Text; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedObjectNotFoundException; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContent; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedObjectNotFoundException; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.rest.action.search.RestSearchAction; import org.elasticsearch.search.suggest.Suggest.Suggestion; import org.elasticsearch.search.suggest.Suggest.Suggestion.Entry; diff --git a/server/src/test/java/org/elasticsearch/search/suggest/TermSuggestionOptionTests.java b/server/src/test/java/org/elasticsearch/search/suggest/TermSuggestionOptionTests.java index 0fd53e1dc16c6..6808a1abc9f39 100644 --- a/server/src/test/java/org/elasticsearch/search/suggest/TermSuggestionOptionTests.java +++ b/server/src/test/java/org/elasticsearch/search/suggest/TermSuggestionOptionTests.java @@ -10,9 +10,9 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.text.Text; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.search.suggest.term.TermSuggestion.Entry.Option; import org.elasticsearch.test.ESTestCase; diff --git a/server/src/test/java/org/elasticsearch/search/suggest/completion/CategoryContextMappingTests.java b/server/src/test/java/org/elasticsearch/search/suggest/completion/CategoryContextMappingTests.java index 4ab1b84e627a4..ac442b71dcdaf 100644 --- a/server/src/test/java/org/elasticsearch/search/suggest/completion/CategoryContextMappingTests.java +++ b/server/src/test/java/org/elasticsearch/search/suggest/completion/CategoryContextMappingTests.java @@ -21,11 +21,11 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.compress.CompressedXContent; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.mapper.CompletionFieldMapper.CompletionFieldType; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.KeywordFieldMapper; @@ -44,7 +44,7 @@ import java.util.List; import java.util.Set; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; diff --git a/server/src/test/java/org/elasticsearch/search/suggest/completion/CategoryQueryContextTests.java b/server/src/test/java/org/elasticsearch/search/suggest/completion/CategoryQueryContextTests.java index 447b6d9cc9584..3abc8c8b6606c 100644 --- a/server/src/test/java/org/elasticsearch/search/suggest/completion/CategoryQueryContextTests.java +++ b/server/src/test/java/org/elasticsearch/search/suggest/completion/CategoryQueryContextTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.search.suggest.completion; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.suggest.completion.context.CategoryQueryContext; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/search/suggest/completion/CompletionSuggesterBuilderTests.java b/server/src/test/java/org/elasticsearch/search/suggest/completion/CompletionSuggesterBuilderTests.java index 312427f077b6e..3166deb7a5e9a 100644 --- a/server/src/test/java/org/elasticsearch/search/suggest/completion/CompletionSuggesterBuilderTests.java +++ b/server/src/test/java/org/elasticsearch/search/suggest/completion/CompletionSuggesterBuilderTests.java @@ -11,7 +11,7 @@ import org.apache.lucene.analysis.core.SimpleAnalyzer; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.unit.Fuzziness; -import org.elasticsearch.common.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContent; import org.elasticsearch.index.analysis.AnalyzerScope; import org.elasticsearch.index.analysis.NamedAnalyzer; import org.elasticsearch.index.mapper.CompletionFieldMapper.CompletionFieldType; diff --git a/server/src/test/java/org/elasticsearch/search/suggest/completion/GeoContextMappingTests.java b/server/src/test/java/org/elasticsearch/search/suggest/completion/GeoContextMappingTests.java index 091fabce893c1..37a79d9007cc4 100644 --- a/server/src/test/java/org/elasticsearch/search/suggest/completion/GeoContextMappingTests.java +++ b/server/src/test/java/org/elasticsearch/search/suggest/completion/GeoContextMappingTests.java @@ -12,10 +12,10 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.mapper.MapperService; import org.elasticsearch.index.mapper.ParsedDocument; @@ -30,7 +30,7 @@ import java.util.List; import static org.elasticsearch.geometry.utils.Geohash.addNeighborsAtLevel; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.search.suggest.completion.CategoryContextMappingTests.assertContextSuggestFields; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.in; diff --git a/server/src/test/java/org/elasticsearch/search/suggest/completion/GeoQueryContextTests.java b/server/src/test/java/org/elasticsearch/search/suggest/completion/GeoQueryContextTests.java index b58f27980f51f..814d0c4196cd9 100644 --- a/server/src/test/java/org/elasticsearch/search/suggest/completion/GeoQueryContextTests.java +++ b/server/src/test/java/org/elasticsearch/search/suggest/completion/GeoQueryContextTests.java @@ -10,9 +10,9 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.geo.GeoPoint; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.search.suggest.completion.context.GeoQueryContext; import java.io.IOException; @@ -21,7 +21,7 @@ import java.util.Collections; import java.util.List; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.equalTo; public class GeoQueryContextTests extends QueryContextTestCase { diff --git a/server/src/test/java/org/elasticsearch/search/suggest/completion/QueryContextTestCase.java b/server/src/test/java/org/elasticsearch/search/suggest/completion/QueryContextTestCase.java index 2527de47b2f55..bcdd117b0db8c 100644 --- a/server/src/test/java/org/elasticsearch/search/suggest/completion/QueryContextTestCase.java +++ b/server/src/test/java/org/elasticsearch/search/suggest/completion/QueryContextTestCase.java @@ -8,10 +8,10 @@ package org.elasticsearch.search.suggest.completion; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/search/suggest/phrase/DirectCandidateGeneratorTests.java b/server/src/test/java/org/elasticsearch/search/suggest/phrase/DirectCandidateGeneratorTests.java index 6573c01edb13c..34e97ed2fa3dd 100644 --- a/server/src/test/java/org/elasticsearch/search/suggest/phrase/DirectCandidateGeneratorTests.java +++ b/server/src/test/java/org/elasticsearch/search/suggest/phrase/DirectCandidateGeneratorTests.java @@ -23,13 +23,13 @@ import org.apache.lucene.store.Directory; import org.apache.lucene.util.BytesRef; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/search/suggest/phrase/LaplaceModelTests.java b/server/src/test/java/org/elasticsearch/search/suggest/phrase/LaplaceModelTests.java index 476e723125384..d4587493c0fdf 100644 --- a/server/src/test/java/org/elasticsearch/search/suggest/phrase/LaplaceModelTests.java +++ b/server/src/test/java/org/elasticsearch/search/suggest/phrase/LaplaceModelTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.search.suggest.phrase; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/search/suggest/phrase/LinearInterpolationModelTests.java b/server/src/test/java/org/elasticsearch/search/suggest/phrase/LinearInterpolationModelTests.java index cff3264963833..37b37bd819775 100644 --- a/server/src/test/java/org/elasticsearch/search/suggest/phrase/LinearInterpolationModelTests.java +++ b/server/src/test/java/org/elasticsearch/search/suggest/phrase/LinearInterpolationModelTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.search.suggest.phrase; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/search/suggest/phrase/SmoothingModelTestCase.java b/server/src/test/java/org/elasticsearch/search/suggest/phrase/SmoothingModelTestCase.java index 597ddab85b49c..ed97dabb9a8f7 100644 --- a/server/src/test/java/org/elasticsearch/search/suggest/phrase/SmoothingModelTestCase.java +++ b/server/src/test/java/org/elasticsearch/search/suggest/phrase/SmoothingModelTestCase.java @@ -21,11 +21,11 @@ import org.apache.lucene.store.ByteBuffersDirectory; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.lucene.BytesRefs; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.search.SearchModule; import org.elasticsearch.test.ESTestCase; import org.junit.AfterClass; diff --git a/server/src/test/java/org/elasticsearch/search/suggest/phrase/StupidBackoffModelTests.java b/server/src/test/java/org/elasticsearch/search/suggest/phrase/StupidBackoffModelTests.java index 7a2420dd59192..aae5da951540f 100644 --- a/server/src/test/java/org/elasticsearch/search/suggest/phrase/StupidBackoffModelTests.java +++ b/server/src/test/java/org/elasticsearch/search/suggest/phrase/StupidBackoffModelTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.search.suggest.phrase; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/search/suggest/term/TermSuggestionBuilderTests.java b/server/src/test/java/org/elasticsearch/search/suggest/term/TermSuggestionBuilderTests.java index 2aec19b1ed072..6d151b607dde5 100644 --- a/server/src/test/java/org/elasticsearch/search/suggest/term/TermSuggestionBuilderTests.java +++ b/server/src/test/java/org/elasticsearch/search/suggest/term/TermSuggestionBuilderTests.java @@ -10,8 +10,8 @@ import com.carrotsearch.randomizedtesting.generators.RandomStrings; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.search.suggest.AbstractSuggestionBuilderTestCase; import org.elasticsearch.search.suggest.SortBy; import org.elasticsearch.search.suggest.SuggestBuilder; diff --git a/server/src/test/java/org/elasticsearch/snapshots/BlobStoreFormatTests.java b/server/src/test/java/org/elasticsearch/snapshots/BlobStoreFormatTests.java index 2ff9d68ce8657..e724324bc05c1 100644 --- a/server/src/test/java/org/elasticsearch/snapshots/BlobStoreFormatTests.java +++ b/server/src/test/java/org/elasticsearch/snapshots/BlobStoreFormatTests.java @@ -17,13 +17,13 @@ import org.elasticsearch.common.blobstore.fs.FsBlobStore; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.io.Streams; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParserUtils; import org.elasticsearch.repositories.blobstore.ChecksumBlobStoreFormat; import org.elasticsearch.test.ESTestCase; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.EOFException; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/snapshots/RepositoriesMetadataSerializationTests.java b/server/src/test/java/org/elasticsearch/snapshots/RepositoriesMetadataSerializationTests.java index f36aa52918924..b9ff3d12c0db1 100644 --- a/server/src/test/java/org/elasticsearch/snapshots/RepositoriesMetadataSerializationTests.java +++ b/server/src/test/java/org/elasticsearch/snapshots/RepositoriesMetadataSerializationTests.java @@ -16,8 +16,8 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.test.AbstractDiffableSerializationTestCase; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/test/java/org/elasticsearch/snapshots/SnapshotFeatureInfoTests.java b/server/src/test/java/org/elasticsearch/snapshots/SnapshotFeatureInfoTests.java index 2352c89baed00..07664952e3e45 100644 --- a/server/src/test/java/org/elasticsearch/snapshots/SnapshotFeatureInfoTests.java +++ b/server/src/test/java/org/elasticsearch/snapshots/SnapshotFeatureInfoTests.java @@ -9,8 +9,8 @@ package org.elasticsearch.snapshots; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.List; diff --git a/server/src/test/java/org/elasticsearch/snapshots/SnapshotInfoBlobSerializationTests.java b/server/src/test/java/org/elasticsearch/snapshots/SnapshotInfoBlobSerializationTests.java index f8a7c1a1ac59b..a171beb6c9056 100644 --- a/server/src/test/java/org/elasticsearch/snapshots/SnapshotInfoBlobSerializationTests.java +++ b/server/src/test/java/org/elasticsearch/snapshots/SnapshotInfoBlobSerializationTests.java @@ -10,9 +10,9 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; import org.elasticsearch.repositories.blobstore.BlobStoreRepository; import org.elasticsearch.test.AbstractWireTestCase; +import org.elasticsearch.xcontent.NamedXContentRegistry; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/snapshots/SnapshotRequestsTests.java b/server/src/test/java/org/elasticsearch/snapshots/SnapshotRequestsTests.java index 0b2b8e9e96621..11b6c98d0f40c 100644 --- a/server/src/test/java/org/elasticsearch/snapshots/SnapshotRequestsTests.java +++ b/server/src/test/java/org/elasticsearch/snapshots/SnapshotRequestsTests.java @@ -12,13 +12,13 @@ import org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotRequest; import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; import org.elasticsearch.test.ESTestCase; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; public class SnapshotRequestsTests extends ESTestCase { public void testRestoreSnapshotRequestParsing() throws IOException { diff --git a/server/src/test/java/org/elasticsearch/snapshots/SnapshotResiliencyTests.java b/server/src/test/java/org/elasticsearch/snapshots/SnapshotResiliencyTests.java index b013bb7a5af5a..05d77044ea94f 100644 --- a/server/src/test/java/org/elasticsearch/snapshots/SnapshotResiliencyTests.java +++ b/server/src/test/java/org/elasticsearch/snapshots/SnapshotResiliencyTests.java @@ -130,7 +130,6 @@ import org.elasticsearch.common.util.PageCacheRecycler; import org.elasticsearch.common.util.concurrent.DeterministicTaskQueue; import org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; import org.elasticsearch.core.CheckedConsumer; import org.elasticsearch.env.Environment; import org.elasticsearch.env.NodeEnvironment; @@ -176,6 +175,7 @@ import org.elasticsearch.test.disruption.DisruptableMockTransport; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.TransportService; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.junit.After; import org.junit.Before; diff --git a/server/src/test/java/org/elasticsearch/snapshots/SnapshotShardFailureSerializationTests.java b/server/src/test/java/org/elasticsearch/snapshots/SnapshotShardFailureSerializationTests.java index bf776d5c39ce1..079cab625c6e7 100644 --- a/server/src/test/java/org/elasticsearch/snapshots/SnapshotShardFailureSerializationTests.java +++ b/server/src/test/java/org/elasticsearch/snapshots/SnapshotShardFailureSerializationTests.java @@ -8,12 +8,12 @@ package org.elasticsearch.snapshots; import org.elasticsearch.common.UUIDs; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.Index; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.test.AbstractXContentTestCase; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.EqualsHashCodeTestUtils; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/snapshots/SnapshotsInProgressSerializationTests.java b/server/src/test/java/org/elasticsearch/snapshots/SnapshotsInProgressSerializationTests.java index 33a3997de2bc4..b24b9810f07ec 100644 --- a/server/src/test/java/org/elasticsearch/snapshots/SnapshotsInProgressSerializationTests.java +++ b/server/src/test/java/org/elasticsearch/snapshots/SnapshotsInProgressSerializationTests.java @@ -21,8 +21,6 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.index.Index; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.repositories.IndexId; @@ -31,6 +29,8 @@ import org.elasticsearch.test.AbstractDiffableWireSerializationTestCase; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.VersionUtils; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.ArrayList; @@ -42,7 +42,7 @@ import java.util.stream.Collectors; import java.util.stream.Stream; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.anyOf; import static org.hamcrest.Matchers.equalTo; diff --git a/server/src/test/java/org/elasticsearch/tasks/CancelTasksResponseTests.java b/server/src/test/java/org/elasticsearch/tasks/CancelTasksResponseTests.java index ca8b37abd9cd8..367bc26405ab3 100644 --- a/server/src/test/java/org/elasticsearch/tasks/CancelTasksResponseTests.java +++ b/server/src/test/java/org/elasticsearch/tasks/CancelTasksResponseTests.java @@ -13,8 +13,8 @@ import org.elasticsearch.action.admin.cluster.node.tasks.cancel.CancelTasksResponse; import org.elasticsearch.action.admin.cluster.node.tasks.list.ListTasksResponse; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/tasks/ListTasksResponseTests.java b/server/src/test/java/org/elasticsearch/tasks/ListTasksResponseTests.java index 623c041498808..584e9689bcacc 100644 --- a/server/src/test/java/org/elasticsearch/tasks/ListTasksResponseTests.java +++ b/server/src/test/java/org/elasticsearch/tasks/ListTasksResponseTests.java @@ -13,8 +13,8 @@ import org.elasticsearch.action.TaskOperationFailure; import org.elasticsearch.action.admin.cluster.node.tasks.list.ListTasksResponse; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/tasks/TaskInfoTests.java b/server/src/test/java/org/elasticsearch/tasks/TaskInfoTests.java index 42e2a56366a22..9b2d01c3ccd1a 100644 --- a/server/src/test/java/org/elasticsearch/tasks/TaskInfoTests.java +++ b/server/src/test/java/org/elasticsearch/tasks/TaskInfoTests.java @@ -12,8 +12,8 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/tasks/TaskResultTests.java b/server/src/test/java/org/elasticsearch/tasks/TaskResultTests.java index addce6401ee34..a46209a7e23ce 100644 --- a/server/src/test/java/org/elasticsearch/tasks/TaskResultTests.java +++ b/server/src/test/java/org/elasticsearch/tasks/TaskResultTests.java @@ -12,11 +12,11 @@ import org.elasticsearch.common.io.stream.NamedWriteableAwareStreamInput; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/test/search/aggregations/bucket/SharedSignificantTermsTestMethods.java b/server/src/test/java/org/elasticsearch/test/search/aggregations/bucket/SharedSignificantTermsTestMethods.java index dea89a5216e8f..a804c5a81c3d2 100644 --- a/server/src/test/java/org/elasticsearch/test/search/aggregations/bucket/SharedSignificantTermsTestMethods.java +++ b/server/src/test/java/org/elasticsearch/test/search/aggregations/bucket/SharedSignificantTermsTestMethods.java @@ -10,7 +10,7 @@ import org.elasticsearch.action.index.IndexRequestBuilder; import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.search.aggregations.Aggregation; import org.elasticsearch.search.aggregations.bucket.terms.SignificantTerms; import org.elasticsearch.search.aggregations.bucket.terms.StringTerms; diff --git a/server/src/test/java/org/elasticsearch/threadpool/ThreadPoolSerializationTests.java b/server/src/test/java/org/elasticsearch/threadpool/ThreadPoolSerializationTests.java index 942845bb1baa9..362cf2113757d 100644 --- a/server/src/test/java/org/elasticsearch/threadpool/ThreadPoolSerializationTests.java +++ b/server/src/test/java/org/elasticsearch/threadpool/ThreadPoolSerializationTests.java @@ -14,8 +14,8 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.SizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; import org.elasticsearch.test.ESTestCase; import org.junit.Before; @@ -23,7 +23,7 @@ import java.io.IOException; import java.util.Map; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.hasKey; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.nullValue; diff --git a/server/src/test/java/org/elasticsearch/threadpool/ThreadPoolStatsTests.java b/server/src/test/java/org/elasticsearch/threadpool/ThreadPoolStatsTests.java index 119232ce6da95..34fb90021608c 100644 --- a/server/src/test/java/org/elasticsearch/threadpool/ThreadPoolStatsTests.java +++ b/server/src/test/java/org/elasticsearch/threadpool/ThreadPoolStatsTests.java @@ -9,11 +9,11 @@ package org.elasticsearch.threadpool; import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/transport/RemoteClusterConnectionTests.java b/server/src/test/java/org/elasticsearch/transport/RemoteClusterConnectionTests.java index 0456a1bb0252f..468c614d36fef 100644 --- a/server/src/test/java/org/elasticsearch/transport/RemoteClusterConnectionTests.java +++ b/server/src/test/java/org/elasticsearch/transport/RemoteClusterConnectionTests.java @@ -34,8 +34,8 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.transport.TransportAddress; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.core.internal.io.IOUtils; import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.mocksocket.MockServerSocket; diff --git a/server/src/test/java/org/elasticsearch/transport/TransportInfoTests.java b/server/src/test/java/org/elasticsearch/transport/TransportInfoTests.java index fa38bb3172d28..c847ee3e17012 100644 --- a/server/src/test/java/org/elasticsearch/transport/TransportInfoTests.java +++ b/server/src/test/java/org/elasticsearch/transport/TransportInfoTests.java @@ -12,9 +12,9 @@ import org.elasticsearch.common.network.NetworkAddress; import org.elasticsearch.common.transport.BoundTransportAddress; import org.elasticsearch.common.transport.TransportAddress; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/test/external-modules/delayed-aggs/src/main/java/org/elasticsearch/test/delayedshard/DelayedShardAggregationBuilder.java b/test/external-modules/delayed-aggs/src/main/java/org/elasticsearch/test/delayedshard/DelayedShardAggregationBuilder.java index 878cb0b23ab9d..0c222c0c348aa 100644 --- a/test/external-modules/delayed-aggs/src/main/java/org/elasticsearch/test/delayedshard/DelayedShardAggregationBuilder.java +++ b/test/external-modules/delayed-aggs/src/main/java/org/elasticsearch/test/delayedshard/DelayedShardAggregationBuilder.java @@ -10,9 +10,6 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.core.TimeValue; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.search.aggregations.AbstractAggregationBuilder; @@ -23,6 +20,9 @@ import org.elasticsearch.search.aggregations.CardinalityUpperBound; import org.elasticsearch.search.aggregations.bucket.filter.FilterAggregationBuilder; import org.elasticsearch.search.aggregations.support.AggregationContext; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Map; diff --git a/test/external-modules/die-with-dignity/src/main/java/org/elasticsearch/test/diewithdignity/RestDieWithDignityAction.java b/test/external-modules/die-with-dignity/src/main/java/org/elasticsearch/test/diewithdignity/RestDieWithDignityAction.java index 84d0081140880..b88ecdf20c58a 100644 --- a/test/external-modules/die-with-dignity/src/main/java/org/elasticsearch/test/diewithdignity/RestDieWithDignityAction.java +++ b/test/external-modules/die-with-dignity/src/main/java/org/elasticsearch/test/diewithdignity/RestDieWithDignityAction.java @@ -10,11 +10,11 @@ import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.common.Randomness; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.RestStatus; +import org.elasticsearch.xcontent.XContentBuilder; import java.util.List; diff --git a/test/external-modules/error-query/src/main/java/org/elasticsearch/test/errorquery/ErrorQueryBuilder.java b/test/external-modules/error-query/src/main/java/org/elasticsearch/test/errorquery/ErrorQueryBuilder.java index d9f6c53b869f2..15a6f50244cb0 100644 --- a/test/external-modules/error-query/src/main/java/org/elasticsearch/test/errorquery/ErrorQueryBuilder.java +++ b/test/external-modules/error-query/src/main/java/org/elasticsearch/test/errorquery/ErrorQueryBuilder.java @@ -13,17 +13,17 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.logging.HeaderWarning; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.index.query.AbstractQueryBuilder; import org.elasticsearch.index.query.SearchExecutionContext; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.List; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; /** * A test query that can simulate errors and warnings when executing a shard request. diff --git a/test/external-modules/error-query/src/main/java/org/elasticsearch/test/errorquery/IndexError.java b/test/external-modules/error-query/src/main/java/org/elasticsearch/test/errorquery/IndexError.java index 8c7856367b7c4..714529c50dc94 100644 --- a/test/external-modules/error-query/src/main/java/org/elasticsearch/test/errorquery/IndexError.java +++ b/test/external-modules/error-query/src/main/java/org/elasticsearch/test/errorquery/IndexError.java @@ -11,11 +11,11 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.core.Nullable; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Arrays; @@ -23,8 +23,8 @@ import java.util.Locale; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class IndexError implements Writeable, ToXContentFragment { enum ERROR_TYPE { diff --git a/test/framework/src/main/java/org/elasticsearch/common/logging/JsonLogLine.java b/test/framework/src/main/java/org/elasticsearch/common/logging/JsonLogLine.java index aedc082a7cffb..f6676d0b32534 100644 --- a/test/framework/src/main/java/org/elasticsearch/common/logging/JsonLogLine.java +++ b/test/framework/src/main/java/org/elasticsearch/common/logging/JsonLogLine.java @@ -8,8 +8,8 @@ package org.elasticsearch.common.logging; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ObjectParser; import java.util.List; diff --git a/test/framework/src/main/java/org/elasticsearch/common/logging/JsonLogsIntegTestCase.java b/test/framework/src/main/java/org/elasticsearch/common/logging/JsonLogsIntegTestCase.java index 7197c7b8ed190..bb965e7bff337 100644 --- a/test/framework/src/main/java/org/elasticsearch/common/logging/JsonLogsIntegTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/common/logging/JsonLogsIntegTestCase.java @@ -9,7 +9,7 @@ package org.elasticsearch.common.logging; import org.elasticsearch.core.SuppressForbidden; -import org.elasticsearch.common.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ObjectParser; import org.elasticsearch.test.rest.ESRestTestCase; import java.io.BufferedReader; diff --git a/test/framework/src/main/java/org/elasticsearch/common/logging/JsonLogsStream.java b/test/framework/src/main/java/org/elasticsearch/common/logging/JsonLogsStream.java index 80de3d02b17da..40a90e6ac4f1f 100644 --- a/test/framework/src/main/java/org/elasticsearch/common/logging/JsonLogsStream.java +++ b/test/framework/src/main/java/org/elasticsearch/common/logging/JsonLogsStream.java @@ -8,11 +8,11 @@ package org.elasticsearch.common.logging; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import java.io.BufferedReader; import java.io.IOException; diff --git a/test/framework/src/main/java/org/elasticsearch/gateway/MockGatewayMetaState.java b/test/framework/src/main/java/org/elasticsearch/gateway/MockGatewayMetaState.java index d882f407edef0..76c5a41df1e8b 100644 --- a/test/framework/src/main/java/org/elasticsearch/gateway/MockGatewayMetaState.java +++ b/test/framework/src/main/java/org/elasticsearch/gateway/MockGatewayMetaState.java @@ -18,7 +18,7 @@ import org.elasticsearch.common.settings.ClusterSettings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.BigArrays; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.plugins.MetadataUpgrader; import org.elasticsearch.threadpool.ThreadPool; diff --git a/test/framework/src/main/java/org/elasticsearch/index/MapperTestUtils.java b/test/framework/src/main/java/org/elasticsearch/index/MapperTestUtils.java index f6708cc2b78c1..39d97d028f01c 100644 --- a/test/framework/src/main/java/org/elasticsearch/index/MapperTestUtils.java +++ b/test/framework/src/main/java/org/elasticsearch/index/MapperTestUtils.java @@ -11,7 +11,7 @@ import org.elasticsearch.Version; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.env.Environment; import org.elasticsearch.index.analysis.IndexAnalyzers; import org.elasticsearch.index.mapper.MapperRegistry; diff --git a/test/framework/src/main/java/org/elasticsearch/index/RandomCreateIndexGenerator.java b/test/framework/src/main/java/org/elasticsearch/index/RandomCreateIndexGenerator.java index d1aee955b5800..a3631d6f564a1 100644 --- a/test/framework/src/main/java/org/elasticsearch/index/RandomCreateIndexGenerator.java +++ b/test/framework/src/main/java/org/elasticsearch/index/RandomCreateIndexGenerator.java @@ -11,9 +11,9 @@ import org.elasticsearch.action.admin.indices.alias.Alias; import org.elasticsearch.action.admin.indices.create.CreateIndexRequest; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.mapper.MapperService; import java.io.IOException; diff --git a/test/framework/src/main/java/org/elasticsearch/index/engine/EngineTestCase.java b/test/framework/src/main/java/org/elasticsearch/index/engine/EngineTestCase.java index 0908dd1eb478d..98c90ac7ac480 100644 --- a/test/framework/src/main/java/org/elasticsearch/index/engine/EngineTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/index/engine/EngineTestCase.java @@ -63,10 +63,10 @@ import org.elasticsearch.common.lucene.uid.Versions; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.BigArrays; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.CheckedFunction; import org.elasticsearch.core.Nullable; import org.elasticsearch.core.TimeValue; diff --git a/test/framework/src/main/java/org/elasticsearch/index/engine/TranslogHandler.java b/test/framework/src/main/java/org/elasticsearch/index/engine/TranslogHandler.java index af41b2728df5e..0ad5b73da82b1 100644 --- a/test/framework/src/main/java/org/elasticsearch/index/engine/TranslogHandler.java +++ b/test/framework/src/main/java/org/elasticsearch/index/engine/TranslogHandler.java @@ -9,7 +9,7 @@ package org.elasticsearch.index.engine; import org.apache.lucene.analysis.standard.StandardAnalyzer; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.common.xcontent.XContentHelper; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.VersionType; diff --git a/test/framework/src/main/java/org/elasticsearch/index/mapper/AbstractNumericFieldMapperTestCase.java b/test/framework/src/main/java/org/elasticsearch/index/mapper/AbstractNumericFieldMapperTestCase.java index dd6eb95a9d7ce..d51164c4a3cc1 100644 --- a/test/framework/src/main/java/org/elasticsearch/index/mapper/AbstractNumericFieldMapperTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/index/mapper/AbstractNumericFieldMapperTestCase.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.index.mapper; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Set; diff --git a/test/framework/src/main/java/org/elasticsearch/index/mapper/MapperServiceTestCase.java b/test/framework/src/main/java/org/elasticsearch/index/mapper/MapperServiceTestCase.java index c9d1529e45430..a00a0a397c7d8 100644 --- a/test/framework/src/main/java/org/elasticsearch/index/mapper/MapperServiceTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/index/mapper/MapperServiceTestCase.java @@ -29,11 +29,11 @@ import org.elasticsearch.common.util.BigArrays; import org.elasticsearch.common.util.MockBigArrays; import org.elasticsearch.common.util.MockPageCacheRecycler; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.analysis.AnalyzerScope; import org.elasticsearch.index.analysis.IndexAnalyzers; diff --git a/test/framework/src/main/java/org/elasticsearch/index/mapper/MapperTestCase.java b/test/framework/src/main/java/org/elasticsearch/index/mapper/MapperTestCase.java index adddf13187289..ef114f3b5be1b 100644 --- a/test/framework/src/main/java/org/elasticsearch/index/mapper/MapperTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/index/mapper/MapperTestCase.java @@ -22,10 +22,10 @@ import org.elasticsearch.Version; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.core.CheckedConsumer; import org.elasticsearch.index.fielddata.IndexFieldData; import org.elasticsearch.index.fielddata.IndexFieldDataCache; diff --git a/test/framework/src/main/java/org/elasticsearch/index/mapper/MetadataMapperTestCase.java b/test/framework/src/main/java/org/elasticsearch/index/mapper/MetadataMapperTestCase.java index 0878e3226181d..dcc914eb0b63b 100644 --- a/test/framework/src/main/java/org/elasticsearch/index/mapper/MetadataMapperTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/index/mapper/MetadataMapperTestCase.java @@ -9,7 +9,7 @@ package org.elasticsearch.index.mapper; import org.elasticsearch.core.CheckedConsumer; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.ArrayList; diff --git a/test/framework/src/main/java/org/elasticsearch/index/mapper/TestDocumentParserContext.java b/test/framework/src/main/java/org/elasticsearch/index/mapper/TestDocumentParserContext.java index 6f3dc62757ba8..c78f393894270 100644 --- a/test/framework/src/main/java/org/elasticsearch/index/mapper/TestDocumentParserContext.java +++ b/test/framework/src/main/java/org/elasticsearch/index/mapper/TestDocumentParserContext.java @@ -9,7 +9,7 @@ package org.elasticsearch.index.mapper; import org.elasticsearch.common.time.DateFormatter; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.analysis.IndexAnalyzers; diff --git a/test/framework/src/main/java/org/elasticsearch/index/replication/ESIndexLevelReplicationTestCase.java b/test/framework/src/main/java/org/elasticsearch/index/replication/ESIndexLevelReplicationTestCase.java index 52f716b2e642d..1c73e60d653e3 100644 --- a/test/framework/src/main/java/org/elasticsearch/index/replication/ESIndexLevelReplicationTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/index/replication/ESIndexLevelReplicationTestCase.java @@ -51,7 +51,7 @@ import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.Releasable; import org.elasticsearch.core.Releasables; import org.elasticsearch.core.TimeValue; diff --git a/test/framework/src/main/java/org/elasticsearch/index/shard/IndexShardTestCase.java b/test/framework/src/main/java/org/elasticsearch/index/shard/IndexShardTestCase.java index 8cc04ff9b4608..36a2f93e63188 100644 --- a/test/framework/src/main/java/org/elasticsearch/index/shard/IndexShardTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/index/shard/IndexShardTestCase.java @@ -30,7 +30,7 @@ import org.elasticsearch.common.settings.ClusterSettings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.BigArrays; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.CheckedFunction; import org.elasticsearch.core.Nullable; import org.elasticsearch.core.internal.io.IOUtils; diff --git a/test/framework/src/main/java/org/elasticsearch/repositories/blobstore/BlobStoreTestUtil.java b/test/framework/src/main/java/org/elasticsearch/repositories/blobstore/BlobStoreTestUtil.java index 8100a755311d5..485c5f814dc97 100644 --- a/test/framework/src/main/java/org/elasticsearch/repositories/blobstore/BlobStoreTestUtil.java +++ b/test/framework/src/main/java/org/elasticsearch/repositories/blobstore/BlobStoreTestUtil.java @@ -31,9 +31,9 @@ import org.elasticsearch.common.blobstore.BlobPath; import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.snapshots.blobstore.BlobStoreIndexShardSnapshots; import org.elasticsearch.repositories.GetSnapshotInfoContext; import org.elasticsearch.repositories.IndexId; diff --git a/test/framework/src/main/java/org/elasticsearch/search/RandomSearchRequestGenerator.java b/test/framework/src/main/java/org/elasticsearch/search/RandomSearchRequestGenerator.java index 7e373eac95d38..50079a920525f 100644 --- a/test/framework/src/main/java/org/elasticsearch/search/RandomSearchRequestGenerator.java +++ b/test/framework/src/main/java/org/elasticsearch/search/RandomSearchRequestGenerator.java @@ -14,12 +14,12 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.text.Text; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.script.Script; import org.elasticsearch.script.ScriptType; diff --git a/test/framework/src/main/java/org/elasticsearch/search/aggregations/AggregatorTestCase.java b/test/framework/src/main/java/org/elasticsearch/search/aggregations/AggregatorTestCase.java index ac684f99e97c7..6ddcf8b041fa8 100644 --- a/test/framework/src/main/java/org/elasticsearch/search/aggregations/AggregatorTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/search/aggregations/AggregatorTestCase.java @@ -51,8 +51,8 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.MockBigArrays; import org.elasticsearch.common.util.MockPageCacheRecycler; -import org.elasticsearch.common.xcontent.ContextParser; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ContextParser; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.core.CheckedConsumer; import org.elasticsearch.core.Releasable; import org.elasticsearch.core.Releasables; diff --git a/test/framework/src/main/java/org/elasticsearch/search/aggregations/BaseAggregationTestCase.java b/test/framework/src/main/java/org/elasticsearch/search/aggregations/BaseAggregationTestCase.java index e8f1e9018a952..17c448826bcc3 100644 --- a/test/framework/src/main/java/org/elasticsearch/search/aggregations/BaseAggregationTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/search/aggregations/BaseAggregationTestCase.java @@ -12,11 +12,11 @@ import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.NamedWriteableAwareStreamInput; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.search.aggregations.support.ValuesSourceAggregationBuilder; import org.elasticsearch.test.AbstractBuilderTestCase; diff --git a/test/framework/src/main/java/org/elasticsearch/search/aggregations/BasePipelineAggregationTestCase.java b/test/framework/src/main/java/org/elasticsearch/search/aggregations/BasePipelineAggregationTestCase.java index 0bcf8bacc27a3..828ecd693714f 100644 --- a/test/framework/src/main/java/org/elasticsearch/search/aggregations/BasePipelineAggregationTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/search/aggregations/BasePipelineAggregationTestCase.java @@ -14,12 +14,12 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.env.Environment; import org.elasticsearch.indices.IndicesModule; import org.elasticsearch.plugins.SearchPlugin; diff --git a/test/framework/src/main/java/org/elasticsearch/search/aggregations/InternalSingleBucketAggregationTestCase.java b/test/framework/src/main/java/org/elasticsearch/search/aggregations/InternalSingleBucketAggregationTestCase.java index e821ad686ca77..991e6e7c54839 100644 --- a/test/framework/src/main/java/org/elasticsearch/search/aggregations/InternalSingleBucketAggregationTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/search/aggregations/InternalSingleBucketAggregationTestCase.java @@ -9,8 +9,8 @@ package org.elasticsearch.search.aggregations; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.rest.action.search.RestSearchAction; import org.elasticsearch.search.aggregations.bucket.InternalSingleBucketAggregation; import org.elasticsearch.search.aggregations.bucket.ParsedSingleBucketAggregation; diff --git a/test/framework/src/main/java/org/elasticsearch/search/aggregations/bucket/AbstractSignificanceHeuristicTestCase.java b/test/framework/src/main/java/org/elasticsearch/search/aggregations/bucket/AbstractSignificanceHeuristicTestCase.java index 376f9854c7ca4..5195619945f45 100644 --- a/test/framework/src/main/java/org/elasticsearch/search/aggregations/bucket/AbstractSignificanceHeuristicTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/search/aggregations/bucket/AbstractSignificanceHeuristicTestCase.java @@ -17,13 +17,13 @@ import org.elasticsearch.common.io.stream.OutputStreamStreamOutput; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.SearchModule; import org.elasticsearch.search.aggregations.InternalAggregation; diff --git a/test/framework/src/main/java/org/elasticsearch/search/aggregations/metrics/AbstractNumericTestCase.java b/test/framework/src/main/java/org/elasticsearch/search/aggregations/metrics/AbstractNumericTestCase.java index e34179bea0ebc..35a02ea25c403 100644 --- a/test/framework/src/main/java/org/elasticsearch/search/aggregations/metrics/AbstractNumericTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/search/aggregations/metrics/AbstractNumericTestCase.java @@ -13,7 +13,7 @@ import java.util.ArrayList; import java.util.List; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; @ESIntegTestCase.SuiteScopeTestCase public abstract class AbstractNumericTestCase extends ESIntegTestCase { diff --git a/test/framework/src/main/java/org/elasticsearch/search/geo/GeoBoundingBoxQueryIntegTestCase.java b/test/framework/src/main/java/org/elasticsearch/search/geo/GeoBoundingBoxQueryIntegTestCase.java index 954fb77d9ba2d..091a7fb7d4304 100644 --- a/test/framework/src/main/java/org/elasticsearch/search/geo/GeoBoundingBoxQueryIntegTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/search/geo/GeoBoundingBoxQueryIntegTestCase.java @@ -13,7 +13,7 @@ import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.DistanceUnit; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.query.GeoValidationMethod; import org.elasticsearch.search.SearchHit; import org.elasticsearch.test.ESIntegTestCase; @@ -21,7 +21,7 @@ import java.io.IOException; import static org.elasticsearch.action.support.WriteRequest.RefreshPolicy.IMMEDIATE; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.boolQuery; import static org.elasticsearch.index.query.QueryBuilders.geoBoundingBoxQuery; import static org.elasticsearch.index.query.QueryBuilders.geoDistanceQuery; diff --git a/test/framework/src/main/java/org/elasticsearch/search/geo/GeoPointShapeQueryTestCase.java b/test/framework/src/main/java/org/elasticsearch/search/geo/GeoPointShapeQueryTestCase.java index baed6e1372abc..6d906ce9a64ba 100644 --- a/test/framework/src/main/java/org/elasticsearch/search/geo/GeoPointShapeQueryTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/search/geo/GeoPointShapeQueryTestCase.java @@ -16,8 +16,8 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.geo.ShapeRelation; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.geometry.Circle; import org.elasticsearch.geometry.Geometry; import org.elasticsearch.geometry.Line; @@ -41,7 +41,7 @@ import java.util.List; import static org.elasticsearch.action.support.WriteRequest.RefreshPolicy.IMMEDIATE; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; diff --git a/test/framework/src/main/java/org/elasticsearch/search/geo/GeoShapeIntegTestCase.java b/test/framework/src/main/java/org/elasticsearch/search/geo/GeoShapeIntegTestCase.java index e72e896b46fba..cf0ebbca80a7a 100644 --- a/test/framework/src/main/java/org/elasticsearch/search/geo/GeoShapeIntegTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/search/geo/GeoShapeIntegTestCase.java @@ -25,9 +25,9 @@ import org.elasticsearch.common.geo.GeoPoint; import org.elasticsearch.common.geo.Orientation; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.internal.io.Streams; import org.elasticsearch.geometry.Circle; import org.elasticsearch.geometry.LinearRing; @@ -50,7 +50,7 @@ import java.util.List; import java.util.zip.GZIPInputStream; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.geoBoundingBoxQuery; import static org.elasticsearch.index.query.QueryBuilders.geoDistanceQuery; import static org.elasticsearch.index.query.QueryBuilders.geoShapeQuery; diff --git a/test/framework/src/main/java/org/elasticsearch/search/geo/GeoShapeQueryTestCase.java b/test/framework/src/main/java/org/elasticsearch/search/geo/GeoShapeQueryTestCase.java index f0373f56dba15..57d3b86894131 100644 --- a/test/framework/src/main/java/org/elasticsearch/search/geo/GeoShapeQueryTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/search/geo/GeoShapeQueryTestCase.java @@ -16,11 +16,11 @@ import org.elasticsearch.common.geo.GeoJson; import org.elasticsearch.common.geo.ShapeRelation; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.geo.GeometryTestUtils; import org.elasticsearch.geometry.Circle; import org.elasticsearch.geometry.Geometry; @@ -40,7 +40,7 @@ import java.util.Locale; import static org.elasticsearch.action.support.WriteRequest.RefreshPolicy.IMMEDIATE; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.geoIntersectionQuery; import static org.elasticsearch.index.query.QueryBuilders.geoShapeQuery; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount; diff --git a/test/framework/src/main/java/org/elasticsearch/snapshots/AbstractSnapshotIntegTestCase.java b/test/framework/src/main/java/org/elasticsearch/snapshots/AbstractSnapshotIntegTestCase.java index 1893e9fcccdbb..528f2d77452e9 100644 --- a/test/framework/src/main/java/org/elasticsearch/snapshots/AbstractSnapshotIntegTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/snapshots/AbstractSnapshotIntegTestCase.java @@ -36,11 +36,11 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.core.Tuple; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.repositories.FinalizeSnapshotContext; diff --git a/test/framework/src/main/java/org/elasticsearch/snapshots/mockstore/MockRepository.java b/test/framework/src/main/java/org/elasticsearch/snapshots/mockstore/MockRepository.java index dfa54b3ca5c75..510172e0b7688 100644 --- a/test/framework/src/main/java/org/elasticsearch/snapshots/mockstore/MockRepository.java +++ b/test/framework/src/main/java/org/elasticsearch/snapshots/mockstore/MockRepository.java @@ -31,7 +31,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.BigArrays; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.env.Environment; import org.elasticsearch.indices.recovery.RecoverySettings; import org.elasticsearch.plugins.RepositoryPlugin; diff --git a/test/framework/src/main/java/org/elasticsearch/test/AbstractBroadcastResponseTestCase.java b/test/framework/src/main/java/org/elasticsearch/test/AbstractBroadcastResponseTestCase.java index 4dc3aebcedff4..d0cb09a9c2e00 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/AbstractBroadcastResponseTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/test/AbstractBroadcastResponseTestCase.java @@ -13,9 +13,9 @@ import org.elasticsearch.action.support.broadcast.BroadcastResponse; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.Index; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.rest.RestStatus; diff --git a/test/framework/src/main/java/org/elasticsearch/test/AbstractBuilderTestCase.java b/test/framework/src/main/java/org/elasticsearch/test/AbstractBuilderTestCase.java index 73eef9442246e..2c9b6ac0ff77c 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/AbstractBuilderTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/test/AbstractBuilderTestCase.java @@ -30,7 +30,7 @@ import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.SettingsModule; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.core.internal.io.IOUtils; import org.elasticsearch.env.Environment; import org.elasticsearch.env.TestEnvironment; diff --git a/test/framework/src/main/java/org/elasticsearch/test/AbstractDiffableSerializationTestCase.java b/test/framework/src/main/java/org/elasticsearch/test/AbstractDiffableSerializationTestCase.java index 4901330628486..1276f207a04ac 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/AbstractDiffableSerializationTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/test/AbstractDiffableSerializationTestCase.java @@ -11,7 +11,7 @@ import org.elasticsearch.cluster.Diff; import org.elasticsearch.cluster.Diffable; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContent; import java.io.IOException; diff --git a/test/framework/src/main/java/org/elasticsearch/test/AbstractQueryTestCase.java b/test/framework/src/main/java/org/elasticsearch/test/AbstractQueryTestCase.java index a6804f4f6d564..15dc0e07a9946 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/AbstractQueryTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/test/AbstractQueryTestCase.java @@ -25,17 +25,17 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.Writeable.Reader; import org.elasticsearch.common.unit.Fuzziness; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentGenerator; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentGenerator; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.core.Tuple; import org.elasticsearch.index.query.AbstractQueryBuilder; import org.elasticsearch.index.query.QueryBuilder; diff --git a/test/framework/src/main/java/org/elasticsearch/test/AbstractSchemaValidationTestCase.java b/test/framework/src/main/java/org/elasticsearch/test/AbstractSchemaValidationTestCase.java index 750f8446fe080..89b83ea8834ef 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/AbstractSchemaValidationTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/test/AbstractSchemaValidationTestCase.java @@ -21,10 +21,10 @@ import com.networknt.schema.ValidationMessage; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.nio.file.Files; diff --git a/test/framework/src/main/java/org/elasticsearch/test/AbstractSerializingTestCase.java b/test/framework/src/main/java/org/elasticsearch/test/AbstractSerializingTestCase.java index 9c38b7461884e..fc4e1bb2137e2 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/AbstractSerializingTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/test/AbstractSerializingTestCase.java @@ -10,10 +10,10 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.time.Instant; @@ -83,8 +83,8 @@ protected ToXContent.Params getToXContentParams() { } /** - * Whether or not to assert equivalence of the {@link org.elasticsearch.common.xcontent.XContent} of the test instance and the instance - * parsed from the {@link org.elasticsearch.common.xcontent.XContent} of the test instance. + * Whether or not to assert equivalence of the {@link org.elasticsearch.xcontent.XContent} of the test instance and the instance + * parsed from the {@link org.elasticsearch.xcontent.XContent} of the test instance. * * @return true if equivalence should be asserted, otherwise false */ diff --git a/test/framework/src/main/java/org/elasticsearch/test/AbstractXContentTestCase.java b/test/framework/src/main/java/org/elasticsearch/test/AbstractXContentTestCase.java index b3fd6b9ba0e0d..d349fcb931740 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/AbstractXContentTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/test/AbstractXContentTestCase.java @@ -13,13 +13,13 @@ import org.elasticsearch.core.CheckedFunction; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.util.function.BiConsumer; diff --git a/test/framework/src/main/java/org/elasticsearch/test/BackgroundIndexer.java b/test/framework/src/main/java/org/elasticsearch/test/BackgroundIndexer.java index b64f21ce27a53..fa3c0423a86fd 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/BackgroundIndexer.java +++ b/test/framework/src/main/java/org/elasticsearch/test/BackgroundIndexer.java @@ -23,8 +23,8 @@ import org.elasticsearch.client.Client; import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.concurrent.ConcurrentCollections; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.junit.Assert; import java.io.IOException; diff --git a/test/framework/src/main/java/org/elasticsearch/test/ESIntegTestCase.java b/test/framework/src/main/java/org/elasticsearch/test/ESIntegTestCase.java index 7a0b1b8ebd4e5..719a501d7b640 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/ESIntegTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/test/ESIntegTestCase.java @@ -87,13 +87,13 @@ import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.concurrent.EsRejectedExecutionException; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.smile.SmileXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.smile.SmileXContent; import org.elasticsearch.core.internal.io.IOUtils; import org.elasticsearch.env.Environment; import org.elasticsearch.env.TestEnvironment; diff --git a/test/framework/src/main/java/org/elasticsearch/test/ESSingleNodeTestCase.java b/test/framework/src/main/java/org/elasticsearch/test/ESSingleNodeTestCase.java index 73863ddbdcc74..3981fe965b1d0 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/ESSingleNodeTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/test/ESSingleNodeTestCase.java @@ -26,8 +26,8 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.concurrent.EsExecutors; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.core.internal.io.IOUtils; import org.elasticsearch.env.Environment; import org.elasticsearch.env.NodeEnvironment; diff --git a/test/framework/src/main/java/org/elasticsearch/test/ESTestCase.java b/test/framework/src/main/java/org/elasticsearch/test/ESTestCase.java index 587d2252cf087..443496e41c1bf 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/ESTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/test/ESTestCase.java @@ -66,16 +66,16 @@ import org.elasticsearch.common.util.MockBigArrays; import org.elasticsearch.common.util.concurrent.ThreadContext; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.MediaType; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.MediaType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentParser.Token; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser.Token; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.env.Environment; import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.env.TestEnvironment; diff --git a/test/framework/src/main/java/org/elasticsearch/test/InternalAggregationTestCase.java b/test/framework/src/main/java/org/elasticsearch/test/InternalAggregationTestCase.java index 111825ef44732..d631faaef427f 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/InternalAggregationTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/test/InternalAggregationTestCase.java @@ -9,7 +9,7 @@ package org.elasticsearch.test; import org.apache.lucene.util.SetOnce; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.breaker.CircuitBreaker; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; @@ -17,12 +17,12 @@ import org.elasticsearch.common.util.BigArrays; import org.elasticsearch.common.util.MockBigArrays; import org.elasticsearch.common.util.MockPageCacheRecycler; -import org.elasticsearch.common.xcontent.ContextParser; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ContextParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParserUtils; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.indices.breaker.NoneCircuitBreakerService; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.plugins.SearchPlugin; diff --git a/test/framework/src/main/java/org/elasticsearch/test/MockIndexEventListener.java b/test/framework/src/main/java/org/elasticsearch/test/MockIndexEventListener.java index 4b58f9eb11b7a..ee079d70d073d 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/MockIndexEventListener.java +++ b/test/framework/src/main/java/org/elasticsearch/test/MockIndexEventListener.java @@ -16,7 +16,7 @@ import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Setting.Property; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.env.Environment; import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.index.Index; diff --git a/test/framework/src/main/java/org/elasticsearch/test/RandomObjects.java b/test/framework/src/main/java/org/elasticsearch/test/RandomObjects.java index c2a4f34d4231b..9dd1cca21108b 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/RandomObjects.java +++ b/test/framework/src/main/java/org/elasticsearch/test/RandomObjects.java @@ -23,11 +23,11 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.core.Tuple; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.shard.IndexShardRecoveringException; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.index.shard.ShardNotFoundException; @@ -57,8 +57,8 @@ private RandomObjects() { /** * Returns a tuple containing random stored field values and their corresponding expected values once printed out - * via {@link org.elasticsearch.common.xcontent.ToXContent#toXContent(XContentBuilder, ToXContent.Params)} and parsed back via - * {@link org.elasticsearch.common.xcontent.XContentParser#objectText()}. + * via {@link ToXContent#toXContent(XContentBuilder, ToXContent.Params)} and parsed back via + * {@link org.elasticsearch.xcontent.XContentParser#objectText()}. * Generates values based on what can get printed out. Stored fields values are retrieved from lucene and converted via * {@link org.elasticsearch.index.mapper.MappedFieldType#valueForDisplay(Object)} to either strings, numbers or booleans. * @@ -118,8 +118,8 @@ private static List randomStoredFieldValues(Random random, int numValues /** * Converts the provided field value to its corresponding expected value once printed out - * via {@link org.elasticsearch.common.xcontent.ToXContent#toXContent(XContentBuilder, ToXContent.Params)} and parsed back via - * {@link org.elasticsearch.common.xcontent.XContentParser#objectText()}. + * via {@link ToXContent#toXContent(XContentBuilder, ToXContent.Params)} and parsed back via + * {@link org.elasticsearch.xcontent.XContentParser#objectText()}. * Generates values based on what can get printed out. Stored fields values are retrieved from lucene and converted via * {@link org.elasticsearch.index.mapper.MappedFieldType#valueForDisplay(Object)} to either strings, numbers or booleans. */ diff --git a/test/framework/src/main/java/org/elasticsearch/test/TestCustomMetadata.java b/test/framework/src/main/java/org/elasticsearch/test/TestCustomMetadata.java index e2e4103b77817..d8455584cc759 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/TestCustomMetadata.java +++ b/test/framework/src/main/java/org/elasticsearch/test/TestCustomMetadata.java @@ -14,8 +14,8 @@ import org.elasticsearch.cluster.metadata.Metadata; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.function.Function; diff --git a/test/framework/src/main/java/org/elasticsearch/test/XContentTestUtils.java b/test/framework/src/main/java/org/elasticsearch/test/XContentTestUtils.java index 954eb0c10af57..8e5b066070872 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/XContentTestUtils.java +++ b/test/framework/src/main/java/org/elasticsearch/test/XContentTestUtils.java @@ -9,16 +9,16 @@ package org.elasticsearch.test; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.rest.yaml.ObjectPath; import java.io.IOException; @@ -33,7 +33,7 @@ import java.util.stream.Collectors; import static com.carrotsearch.randomizedtesting.generators.RandomStrings.randomAsciiOfLength; -import static org.elasticsearch.common.xcontent.ToXContent.EMPTY_PARAMS; +import static org.elasticsearch.xcontent.ToXContent.EMPTY_PARAMS; import static org.elasticsearch.common.xcontent.XContentHelper.createParser; public final class XContentTestUtils { diff --git a/test/framework/src/main/java/org/elasticsearch/test/hamcrest/ElasticsearchAssertions.java b/test/framework/src/main/java/org/elasticsearch/test/hamcrest/ElasticsearchAssertions.java index 5ea2c6103749e..a726ae6daeffb 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/hamcrest/ElasticsearchAssertions.java +++ b/test/framework/src/main/java/org/elasticsearch/test/hamcrest/ElasticsearchAssertions.java @@ -36,12 +36,12 @@ import org.elasticsearch.core.Nullable; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.suggest.Suggest; @@ -623,7 +623,7 @@ public static void assertFileNotExists(Path file) { /** * Asserts that the provided {@link BytesReference}s created through - * {@link org.elasticsearch.common.xcontent.ToXContent#toXContent(XContentBuilder, ToXContent.Params)} hold the same content. + * {@link ToXContent#toXContent(XContentBuilder, ToXContent.Params)} hold the same content. * The comparison is done by parsing both into a map and comparing those two, so that keys ordering doesn't matter. * Also binary values (byte[]) are properly compared through arrays comparisons. */ diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/ESRestTestCase.java b/test/framework/src/main/java/org/elasticsearch/test/rest/ESRestTestCase.java index 0a542e1c50d68..eec2ad3477896 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/ESRestTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/ESRestTestCase.java @@ -39,13 +39,13 @@ import org.elasticsearch.common.ssl.PemUtils; import org.elasticsearch.common.util.concurrent.ThreadContext; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.core.CharArrays; import org.elasticsearch.core.CheckedRunnable; diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/FakeRestRequest.java b/test/framework/src/main/java/org/elasticsearch/test/rest/FakeRestRequest.java index 0b1bf2ee67dbc..393fb1384862b 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/FakeRestRequest.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/FakeRestRequest.java @@ -12,8 +12,8 @@ import org.elasticsearch.action.support.ListenableActionFuture; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.http.HttpChannel; import org.elasticsearch.http.HttpRequest; import org.elasticsearch.http.HttpResponse; diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/ClientYamlTestExecutionContext.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/ClientYamlTestExecutionContext.java index 5a261426a83f8..a303598e15e27 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/ClientYamlTestExecutionContext.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/ClientYamlTestExecutionContext.java @@ -18,9 +18,9 @@ import org.elasticsearch.Version; import org.elasticsearch.client.NodeSelector; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.nio.charset.StandardCharsets; diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/ClientYamlTestResponse.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/ClientYamlTestResponse.java index e58815fc82008..90412820501d9 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/ClientYamlTestResponse.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/ClientYamlTestResponse.java @@ -14,11 +14,11 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.io.UncheckedIOException; diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/ESClientYamlSuiteTestCase.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/ESClientYamlSuiteTestCase.java index 5d4746bcd2c6d..fcbd29f5f0e12 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/ESClientYamlSuiteTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/ESClientYamlSuiteTestCase.java @@ -23,7 +23,7 @@ import org.elasticsearch.client.sniff.ElasticsearchNodesSniffer; import org.elasticsearch.common.Strings; import org.elasticsearch.core.Tuple; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.core.internal.io.IOUtils; import org.elasticsearch.test.ClasspathUtils; diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/ObjectPath.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/ObjectPath.java index c44c33cce215b..82711c444e67a 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/ObjectPath.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/ObjectPath.java @@ -11,12 +11,12 @@ import org.elasticsearch.client.Response; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.util.ArrayList; diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/Stash.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/Stash.java index b772a2da5bdec..7586d3ecf55b6 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/Stash.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/Stash.java @@ -11,8 +11,8 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.ArrayList; diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestApiParser.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestApiParser.java index 0b2265af4bb2c..425da7d6a6515 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestApiParser.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestApiParser.java @@ -7,11 +7,11 @@ */ package org.elasticsearch.test.rest.yaml.restspec; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.ParsingException; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.HashSet; diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestSpec.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestSpec.java index 75874593480df..247f636ac1a61 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestSpec.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestSpec.java @@ -8,9 +8,9 @@ package org.elasticsearch.test.rest.yaml.restspec; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.ClasspathUtils; import java.io.IOException; diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/Assertion.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/Assertion.java index 579a63b180929..beefc1f442d2b 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/Assertion.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/Assertion.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.test.rest.yaml.section; -import org.elasticsearch.common.xcontent.XContentLocation; +import org.elasticsearch.xcontent.XContentLocation; import org.elasticsearch.test.rest.yaml.ClientYamlTestExecutionContext; import java.io.IOException; diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/ClientYamlTestSection.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/ClientYamlTestSection.java index ea785f350e148..04a237e575a06 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/ClientYamlTestSection.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/ClientYamlTestSection.java @@ -8,8 +8,8 @@ package org.elasticsearch.test.rest.yaml.section; import org.elasticsearch.common.ParsingException; -import org.elasticsearch.common.xcontent.XContentLocation; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentLocation; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/ClientYamlTestSuite.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/ClientYamlTestSuite.java index 4b9fa898c122d..edf556ad28ae1 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/ClientYamlTestSuite.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/ClientYamlTestSuite.java @@ -10,10 +10,10 @@ import org.elasticsearch.client.NodeSelector; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.yaml.YamlXContent; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.yaml.YamlXContent; import java.io.IOException; import java.nio.ByteBuffer; diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/CloseToAssertion.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/CloseToAssertion.java index 00e54ecaea5fe..a5aaa42cbe598 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/CloseToAssertion.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/CloseToAssertion.java @@ -10,8 +10,8 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.elasticsearch.core.Tuple; -import org.elasticsearch.common.xcontent.XContentLocation; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentLocation; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Map; diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/ContainsAssertion.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/ContainsAssertion.java index 9cbda4707b242..077115b725766 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/ContainsAssertion.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/ContainsAssertion.java @@ -10,8 +10,8 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.elasticsearch.core.Tuple; -import org.elasticsearch.common.xcontent.XContentLocation; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentLocation; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.List; diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/DoSection.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/DoSection.java index 690f57d4d1c7c..cd3b934715711 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/DoSection.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/DoSection.java @@ -18,12 +18,12 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.core.Tuple; import org.elasticsearch.common.logging.HeaderWarning; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentLocation; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentLocation; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.rest.action.admin.indices.RestPutIndexTemplateAction; import org.elasticsearch.test.rest.yaml.ClientYamlTestExecutionContext; import org.elasticsearch.test.rest.yaml.ClientYamlTestResponse; diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/ExecutableSection.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/ExecutableSection.java index 197a83a8357b4..67108306e74a4 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/ExecutableSection.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/ExecutableSection.java @@ -7,10 +7,10 @@ */ package org.elasticsearch.test.rest.yaml.section; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentLocation; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentLocation; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.rest.yaml.ClientYamlTestExecutionContext; import java.io.IOException; diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/GreaterThanAssertion.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/GreaterThanAssertion.java index 5f2b6647ba995..7e195001a668c 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/GreaterThanAssertion.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/GreaterThanAssertion.java @@ -10,8 +10,8 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.elasticsearch.core.Tuple; -import org.elasticsearch.common.xcontent.XContentLocation; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentLocation; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/GreaterThanEqualToAssertion.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/GreaterThanEqualToAssertion.java index 2402b224bb17e..f235b1baeb341 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/GreaterThanEqualToAssertion.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/GreaterThanEqualToAssertion.java @@ -11,8 +11,8 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.elasticsearch.core.Tuple; -import org.elasticsearch.common.xcontent.XContentLocation; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentLocation; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/IsFalseAssertion.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/IsFalseAssertion.java index 4aff11eb822c9..c73f09d71c52c 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/IsFalseAssertion.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/IsFalseAssertion.java @@ -9,8 +9,8 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.elasticsearch.common.xcontent.XContentLocation; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentLocation; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/IsTrueAssertion.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/IsTrueAssertion.java index c6d37032ad872..2144397b072b5 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/IsTrueAssertion.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/IsTrueAssertion.java @@ -9,8 +9,8 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.elasticsearch.common.xcontent.XContentLocation; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentLocation; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/LengthAssertion.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/LengthAssertion.java index 51df949f75d26..448d88ce4ac4e 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/LengthAssertion.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/LengthAssertion.java @@ -10,8 +10,8 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.elasticsearch.core.Tuple; -import org.elasticsearch.common.xcontent.XContentLocation; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentLocation; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.List; diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/LessThanAssertion.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/LessThanAssertion.java index 0e0f792aa8331..e52f9330f0895 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/LessThanAssertion.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/LessThanAssertion.java @@ -10,8 +10,8 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.elasticsearch.core.Tuple; -import org.elasticsearch.common.xcontent.XContentLocation; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentLocation; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/LessThanOrEqualToAssertion.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/LessThanOrEqualToAssertion.java index 83ba784d9e08e..1125b1e50a34c 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/LessThanOrEqualToAssertion.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/LessThanOrEqualToAssertion.java @@ -11,8 +11,8 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.elasticsearch.core.Tuple; -import org.elasticsearch.common.xcontent.XContentLocation; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentLocation; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/MatchAssertion.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/MatchAssertion.java index 27d9919467455..9df02b8f882b2 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/MatchAssertion.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/MatchAssertion.java @@ -11,8 +11,8 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.elasticsearch.core.Tuple; -import org.elasticsearch.common.xcontent.XContentLocation; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentLocation; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.List; diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/ParserUtils.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/ParserUtils.java index 28c105186a557..ee642e1b1c95e 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/ParserUtils.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/ParserUtils.java @@ -9,7 +9,7 @@ package org.elasticsearch.test.rest.yaml.section; import org.elasticsearch.core.Tuple; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Map; diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/SetSection.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/SetSection.java index bc0d040c132ae..58e5079158c40 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/SetSection.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/SetSection.java @@ -8,8 +8,8 @@ package org.elasticsearch.test.rest.yaml.section; import org.elasticsearch.common.ParsingException; -import org.elasticsearch.common.xcontent.XContentLocation; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentLocation; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.rest.yaml.ClientYamlTestExecutionContext; import java.io.IOException; diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/SetupSection.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/SetupSection.java index 4f71b9660d4d3..351cfa8e40ebc 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/SetupSection.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/SetupSection.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.test.rest.yaml.section; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/SkipSection.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/SkipSection.java index f30097ebb2bc4..eee582c229a28 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/SkipSection.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/SkipSection.java @@ -10,7 +10,7 @@ import org.elasticsearch.Version; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.VersionUtils; import org.elasticsearch.test.rest.yaml.Features; diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/TeardownSection.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/TeardownSection.java index 043a19fabd021..33d9af2f0240c 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/TeardownSection.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/TeardownSection.java @@ -9,7 +9,7 @@ package org.elasticsearch.test.rest.yaml.section; import org.elasticsearch.common.ParsingException; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/TransformAndSetSection.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/TransformAndSetSection.java index 0a4c4062f347b..777c974f5e089 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/TransformAndSetSection.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/TransformAndSetSection.java @@ -9,8 +9,8 @@ package org.elasticsearch.test.rest.yaml.section; import org.elasticsearch.common.ParsingException; -import org.elasticsearch.common.xcontent.XContentLocation; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentLocation; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.rest.yaml.ClientYamlTestExecutionContext; import java.io.IOException; diff --git a/test/framework/src/test/java/org/elasticsearch/test/AbstractXContentTestCaseTests.java b/test/framework/src/test/java/org/elasticsearch/test/AbstractXContentTestCaseTests.java index 6756db8a1406f..7f88f126ce7f7 100644 --- a/test/framework/src/test/java/org/elasticsearch/test/AbstractXContentTestCaseTests.java +++ b/test/framework/src/test/java/org/elasticsearch/test/AbstractXContentTestCaseTests.java @@ -11,10 +11,10 @@ import com.carrotsearch.randomizedtesting.RandomizedContext; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import java.util.Map; diff --git a/test/framework/src/test/java/org/elasticsearch/test/XContentTestUtilsTests.java b/test/framework/src/test/java/org/elasticsearch/test/XContentTestUtilsTests.java index 44263bd4c6664..f6cdbf31ddc15 100644 --- a/test/framework/src/test/java/org/elasticsearch/test/XContentTestUtilsTests.java +++ b/test/framework/src/test/java/org/elasticsearch/test/XContentTestUtilsTests.java @@ -9,14 +9,14 @@ package org.elasticsearch.test; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import java.io.IOException; import java.util.Collections; diff --git a/test/framework/src/test/java/org/elasticsearch/test/hamcrest/ElasticsearchAssertionsTests.java b/test/framework/src/test/java/org/elasticsearch/test/hamcrest/ElasticsearchAssertionsTests.java index 99a5c6b2b44b0..909e2f1b3a230 100644 --- a/test/framework/src/test/java/org/elasticsearch/test/hamcrest/ElasticsearchAssertionsTests.java +++ b/test/framework/src/test/java/org/elasticsearch/test/hamcrest/ElasticsearchAssertionsTests.java @@ -14,9 +14,9 @@ import org.elasticsearch.cluster.block.ClusterBlockException; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.RandomObjects; diff --git a/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/ObjectPathTests.java b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/ObjectPathTests.java index 4684ae9a70c32..f1ca19fb2d117 100644 --- a/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/ObjectPathTests.java +++ b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/ObjectPathTests.java @@ -8,9 +8,9 @@ package org.elasticsearch.test.rest.yaml; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestApiParserFailingTests.java b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestApiParserFailingTests.java index 889ea8e4b7fd1..5647948b8dbb6 100644 --- a/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestApiParserFailingTests.java +++ b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestApiParserFailingTests.java @@ -8,8 +8,8 @@ package org.elasticsearch.test.rest.yaml.restspec; import org.elasticsearch.common.ParsingException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.yaml.YamlXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.yaml.YamlXContent; import org.elasticsearch.test.ESTestCase; import static org.hamcrest.Matchers.containsString; diff --git a/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestApiParserTests.java b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestApiParserTests.java index 8725c58857b7a..c69862c3aa33a 100644 --- a/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestApiParserTests.java +++ b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestApiParserTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.test.rest.yaml.restspec; -import org.elasticsearch.common.xcontent.yaml.YamlXContent; +import org.elasticsearch.xcontent.yaml.YamlXContent; import org.elasticsearch.test.rest.yaml.section.AbstractClientYamlTestFragmentParserTestCase; import java.util.Iterator; diff --git a/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestApiTests.java b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestApiTests.java index 66b8636837ba1..67f3ed5b01325 100644 --- a/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestApiTests.java +++ b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestApiTests.java @@ -7,8 +7,8 @@ */ package org.elasticsearch.test.rest.yaml.restspec; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.yaml.YamlXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.yaml.YamlXContent; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/section/AbstractClientYamlTestFragmentParserTestCase.java b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/section/AbstractClientYamlTestFragmentParserTestCase.java index f2a14446654bf..dbd0dd23ee1a2 100644 --- a/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/section/AbstractClientYamlTestFragmentParserTestCase.java +++ b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/section/AbstractClientYamlTestFragmentParserTestCase.java @@ -8,10 +8,9 @@ package org.elasticsearch.test.rest.yaml.section; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.rest.yaml.section.ExecutableSection; import org.junit.After; import static org.hamcrest.Matchers.nullValue; diff --git a/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/section/AssertionTests.java b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/section/AssertionTests.java index 813a1608f0040..49957e5e6759b 100644 --- a/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/section/AssertionTests.java +++ b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/section/AssertionTests.java @@ -7,13 +7,7 @@ */ package org.elasticsearch.test.rest.yaml.section; -import org.elasticsearch.common.xcontent.yaml.YamlXContent; -import org.elasticsearch.test.rest.yaml.section.GreaterThanAssertion; -import org.elasticsearch.test.rest.yaml.section.IsFalseAssertion; -import org.elasticsearch.test.rest.yaml.section.IsTrueAssertion; -import org.elasticsearch.test.rest.yaml.section.LengthAssertion; -import org.elasticsearch.test.rest.yaml.section.LessThanAssertion; -import org.elasticsearch.test.rest.yaml.section.MatchAssertion; +import org.elasticsearch.xcontent.yaml.YamlXContent; import java.util.List; import java.util.Map; diff --git a/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/section/ClientYamlTestSectionTests.java b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/section/ClientYamlTestSectionTests.java index be6b15364c0e7..abb93b834bf64 100644 --- a/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/section/ClientYamlTestSectionTests.java +++ b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/section/ClientYamlTestSectionTests.java @@ -10,8 +10,8 @@ import org.elasticsearch.Version; import org.elasticsearch.common.ParsingException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.yaml.YamlXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.yaml.YamlXContent; import java.io.IOException; import java.util.Map; diff --git a/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/section/ClientYamlTestSuiteTests.java b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/section/ClientYamlTestSuiteTests.java index b2ec8c659fa88..98d53d199ecc7 100644 --- a/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/section/ClientYamlTestSuiteTests.java +++ b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/section/ClientYamlTestSuiteTests.java @@ -11,8 +11,8 @@ import org.elasticsearch.Version; import org.elasticsearch.client.NodeSelector; import org.elasticsearch.common.ParsingException; -import org.elasticsearch.common.xcontent.XContentLocation; -import org.elasticsearch.common.xcontent.yaml.YamlXContent; +import org.elasticsearch.xcontent.XContentLocation; +import org.elasticsearch.xcontent.yaml.YamlXContent; import java.util.ArrayList; import java.util.Collections; diff --git a/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/section/DoSectionTests.java b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/section/DoSectionTests.java index 301ac0088c17b..c5a83db87dabc 100644 --- a/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/section/DoSectionTests.java +++ b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/section/DoSectionTests.java @@ -14,9 +14,9 @@ import org.elasticsearch.client.NodeSelector; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.logging.HeaderWarning; -import org.elasticsearch.common.xcontent.XContentLocation; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.yaml.YamlXContent; +import org.elasticsearch.xcontent.XContentLocation; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.yaml.YamlXContent; import org.elasticsearch.test.rest.yaml.ClientYamlTestExecutionContext; import org.elasticsearch.test.rest.yaml.ClientYamlTestResponse; import org.hamcrest.MatcherAssert; diff --git a/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/section/MatchAssertionTests.java b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/section/MatchAssertionTests.java index 6493f6a30ece2..122e05a57d35e 100644 --- a/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/section/MatchAssertionTests.java +++ b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/section/MatchAssertionTests.java @@ -7,7 +7,7 @@ */ package org.elasticsearch.test.rest.yaml.section; -import org.elasticsearch.common.xcontent.XContentLocation; +import org.elasticsearch.xcontent.XContentLocation; import org.elasticsearch.test.ESTestCase; import static java.util.Collections.emptyMap; diff --git a/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/section/SetSectionTests.java b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/section/SetSectionTests.java index 53ff8fdd50e92..b7e5a7ed98edd 100644 --- a/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/section/SetSectionTests.java +++ b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/section/SetSectionTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.test.rest.yaml.section; import org.elasticsearch.common.ParsingException; -import org.elasticsearch.common.xcontent.yaml.YamlXContent; +import org.elasticsearch.xcontent.yaml.YamlXContent; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; diff --git a/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/section/SetupSectionTests.java b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/section/SetupSectionTests.java index d1e60ac8e760d..15d205ae803db 100644 --- a/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/section/SetupSectionTests.java +++ b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/section/SetupSectionTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.test.rest.yaml.section; import org.elasticsearch.Version; -import org.elasticsearch.common.xcontent.yaml.YamlXContent; +import org.elasticsearch.xcontent.yaml.YamlXContent; import java.io.IOException; diff --git a/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/section/SkipSectionTests.java b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/section/SkipSectionTests.java index 3767b565c461a..ffefd7451a76e 100644 --- a/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/section/SkipSectionTests.java +++ b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/section/SkipSectionTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.Version; import org.elasticsearch.common.ParsingException; -import org.elasticsearch.common.xcontent.yaml.YamlXContent; +import org.elasticsearch.xcontent.yaml.YamlXContent; import org.elasticsearch.test.VersionUtils; import java.util.Collections; diff --git a/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/section/TeardownSectionTests.java b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/section/TeardownSectionTests.java index 3019a5daba889..764357d771b1b 100644 --- a/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/section/TeardownSectionTests.java +++ b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/section/TeardownSectionTests.java @@ -9,7 +9,7 @@ package org.elasticsearch.test.rest.yaml.section; import org.elasticsearch.Version; -import org.elasticsearch.common.xcontent.yaml.YamlXContent; +import org.elasticsearch.xcontent.yaml.YamlXContent; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.notNullValue; diff --git a/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/section/TransformAndSetSectionTests.java b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/section/TransformAndSetSectionTests.java index 25da92a64db44..45f95ca58a767 100644 --- a/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/section/TransformAndSetSectionTests.java +++ b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/section/TransformAndSetSectionTests.java @@ -9,7 +9,7 @@ package org.elasticsearch.test.rest.yaml.section; import org.elasticsearch.common.ParsingException; -import org.elasticsearch.common.xcontent.yaml.YamlXContent; +import org.elasticsearch.xcontent.yaml.YamlXContent; import org.elasticsearch.test.rest.yaml.ClientYamlTestExecutionContext; import org.elasticsearch.test.rest.yaml.Stash; diff --git a/test/framework/src/test/java/org/elasticsearch/test/test/ESTestCaseTests.java b/test/framework/src/test/java/org/elasticsearch/test/test/ESTestCaseTests.java index 1701af1f1a4b7..e7da0e39b75a1 100644 --- a/test/framework/src/test/java/org/elasticsearch/test/test/ESTestCaseTests.java +++ b/test/framework/src/test/java/org/elasticsearch/test/test/ESTestCaseTests.java @@ -12,9 +12,9 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.time.DateFormatter; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.RandomObjects; diff --git a/x-pack/license-tools/src/main/java/org/elasticsearch/license/licensor/LicenseSigner.java b/x-pack/license-tools/src/main/java/org/elasticsearch/license/licensor/LicenseSigner.java index f029f6973e6ed..53e8cb8c048a1 100644 --- a/x-pack/license-tools/src/main/java/org/elasticsearch/license/licensor/LicenseSigner.java +++ b/x-pack/license-tools/src/main/java/org/elasticsearch/license/licensor/LicenseSigner.java @@ -10,10 +10,10 @@ import org.apache.lucene.util.BytesRefIterator; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.hash.MessageDigests; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.license.CryptUtils; import org.elasticsearch.license.License; diff --git a/x-pack/license-tools/src/main/java/org/elasticsearch/license/licensor/tools/LicenseGeneratorTool.java b/x-pack/license-tools/src/main/java/org/elasticsearch/license/licensor/tools/LicenseGeneratorTool.java index 0b3961fc2cd77..dcb0aa940f701 100644 --- a/x-pack/license-tools/src/main/java/org/elasticsearch/license/licensor/tools/LicenseGeneratorTool.java +++ b/x-pack/license-tools/src/main/java/org/elasticsearch/license/licensor/tools/LicenseGeneratorTool.java @@ -16,10 +16,10 @@ import org.elasticsearch.core.SuppressForbidden; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.core.PathUtils; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.license.License; import org.elasticsearch.license.licensor.LicenseSigner; diff --git a/x-pack/license-tools/src/main/java/org/elasticsearch/license/licensor/tools/LicenseVerificationTool.java b/x-pack/license-tools/src/main/java/org/elasticsearch/license/licensor/tools/LicenseVerificationTool.java index 1e6e7a968c4d3..927b023306669 100644 --- a/x-pack/license-tools/src/main/java/org/elasticsearch/license/licensor/tools/LicenseVerificationTool.java +++ b/x-pack/license-tools/src/main/java/org/elasticsearch/license/licensor/tools/LicenseVerificationTool.java @@ -16,10 +16,10 @@ import org.elasticsearch.core.SuppressForbidden; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.core.PathUtils; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.license.License; import org.elasticsearch.license.LicenseVerifier; diff --git a/x-pack/license-tools/src/test/java/org/elasticsearch/license/licensor/TestUtils.java b/x-pack/license-tools/src/test/java/org/elasticsearch/license/licensor/TestUtils.java index 5f85df7361b51..abb46c053ea76 100644 --- a/x-pack/license-tools/src/test/java/org/elasticsearch/license/licensor/TestUtils.java +++ b/x-pack/license-tools/src/test/java/org/elasticsearch/license/licensor/TestUtils.java @@ -10,10 +10,10 @@ import org.elasticsearch.common.time.DateFormatter; import org.elasticsearch.common.time.DateMathParser; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.license.DateUtils; import org.elasticsearch.license.License; import org.elasticsearch.test.ESTestCase; @@ -27,7 +27,7 @@ import static com.carrotsearch.randomizedtesting.RandomizedTest.randomBoolean; import static com.carrotsearch.randomizedtesting.RandomizedTest.randomInt; import static com.carrotsearch.randomizedtesting.RandomizedTest.randomIntBetween; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.test.ESTestCase.randomFrom; import static org.hamcrest.core.IsEqual.equalTo; diff --git a/x-pack/license-tools/src/test/java/org/elasticsearch/license/licensor/tools/LicenseGenerationToolTests.java b/x-pack/license-tools/src/test/java/org/elasticsearch/license/licensor/tools/LicenseGenerationToolTests.java index 427fdc7a3cb24..c0353b485c11f 100644 --- a/x-pack/license-tools/src/test/java/org/elasticsearch/license/licensor/tools/LicenseGenerationToolTests.java +++ b/x-pack/license-tools/src/test/java/org/elasticsearch/license/licensor/tools/LicenseGenerationToolTests.java @@ -11,7 +11,7 @@ import org.elasticsearch.cli.ExitCodes; import org.elasticsearch.cli.UserException; import org.elasticsearch.common.bytes.BytesArray; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.license.License; import org.elasticsearch.license.licensor.TestUtils; import org.junit.Before; diff --git a/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/AnalyticsPlugin.java b/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/AnalyticsPlugin.java index 86728ca2bcbb5..2c40e5dc27880 100644 --- a/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/AnalyticsPlugin.java +++ b/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/AnalyticsPlugin.java @@ -13,7 +13,6 @@ import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.settings.Setting; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; import org.elasticsearch.env.Environment; import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.index.mapper.Mapper; @@ -26,6 +25,7 @@ import org.elasticsearch.search.aggregations.support.ValuesSourceRegistry; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.watcher.ResourceWatcherService; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.xpack.analytics.action.AnalyticsInfoTransportAction; import org.elasticsearch.xpack.analytics.action.AnalyticsUsageTransportAction; import org.elasticsearch.xpack.analytics.action.TransportAnalyticsStatsAction; diff --git a/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/AnalyticsUsage.java b/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/AnalyticsUsage.java index 5c7a90ff04ec7..a7cb1f024f644 100644 --- a/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/AnalyticsUsage.java +++ b/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/AnalyticsUsage.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.analytics; import org.elasticsearch.cluster.node.DiscoveryNode; -import org.elasticsearch.common.xcontent.ContextParser; +import org.elasticsearch.xcontent.ContextParser; import org.elasticsearch.xpack.core.analytics.action.AnalyticsStatsAction; import org.elasticsearch.xpack.core.common.stats.EnumCounters; diff --git a/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/boxplot/BoxplotAggregationBuilder.java b/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/boxplot/BoxplotAggregationBuilder.java index 98a18f1bafc10..8ad0379815dbd 100644 --- a/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/boxplot/BoxplotAggregationBuilder.java +++ b/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/boxplot/BoxplotAggregationBuilder.java @@ -9,8 +9,6 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.AggregatorFactories; import org.elasticsearch.search.aggregations.AggregatorFactory; @@ -22,6 +20,8 @@ import org.elasticsearch.search.aggregations.support.ValuesSourceConfig; import org.elasticsearch.search.aggregations.support.ValuesSourceRegistry; import org.elasticsearch.search.aggregations.support.ValuesSourceType; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Map; diff --git a/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/boxplot/InternalBoxplot.java b/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/boxplot/InternalBoxplot.java index 8c56829c7ccfd..477ea5c9b6ba6 100644 --- a/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/boxplot/InternalBoxplot.java +++ b/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/boxplot/InternalBoxplot.java @@ -11,11 +11,11 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.InternalAggregation; import org.elasticsearch.search.aggregations.metrics.InternalNumericMetricsAggregation; import org.elasticsearch.search.aggregations.metrics.TDigestState; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Collections; diff --git a/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/cumulativecardinality/CumulativeCardinalityPipelineAggregationBuilder.java b/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/cumulativecardinality/CumulativeCardinalityPipelineAggregationBuilder.java index f98b4725463f6..8804818f91695 100644 --- a/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/cumulativecardinality/CumulativeCardinalityPipelineAggregationBuilder.java +++ b/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/cumulativecardinality/CumulativeCardinalityPipelineAggregationBuilder.java @@ -8,19 +8,19 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.pipeline.AbstractPipelineAggregationBuilder; import org.elasticsearch.search.aggregations.pipeline.BucketMetricsParser; import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Map; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; import static org.elasticsearch.search.aggregations.pipeline.PipelineAggregator.Parser.FORMAT; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; public class CumulativeCardinalityPipelineAggregationBuilder extends AbstractPipelineAggregationBuilder< CumulativeCardinalityPipelineAggregationBuilder> { diff --git a/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/cumulativecardinality/InternalSimpleLongValue.java b/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/cumulativecardinality/InternalSimpleLongValue.java index ae8a1ae7336fc..fad356cae61e7 100644 --- a/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/cumulativecardinality/InternalSimpleLongValue.java +++ b/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/cumulativecardinality/InternalSimpleLongValue.java @@ -8,11 +8,11 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.InternalAggregation; import org.elasticsearch.search.aggregations.metrics.InternalNumericMetricsAggregation; import org.elasticsearch.search.aggregations.pipeline.SimpleValue; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.List; diff --git a/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/mapper/HistogramFieldMapper.java b/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/mapper/HistogramFieldMapper.java index 222d9172586bd..30eeb4aa69954 100644 --- a/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/mapper/HistogramFieldMapper.java +++ b/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/mapper/HistogramFieldMapper.java @@ -21,9 +21,6 @@ import org.elasticsearch.common.io.stream.ByteArrayStreamInput; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.util.BigArrays; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentSubParser; import org.elasticsearch.index.fielddata.HistogramValue; import org.elasticsearch.index.fielddata.HistogramValues; import org.elasticsearch.index.fielddata.IndexFieldData; @@ -47,6 +44,9 @@ import org.elasticsearch.search.lookup.SearchLookup; import org.elasticsearch.search.sort.BucketedSort; import org.elasticsearch.search.sort.SortOrder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentSubParser; import org.elasticsearch.xpack.analytics.aggregations.support.AnalyticsValuesSourceType; import java.io.IOException; diff --git a/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/movingPercentiles/MovingPercentilesPipelineAggregationBuilder.java b/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/movingPercentiles/MovingPercentilesPipelineAggregationBuilder.java index 7f3603fead159..bd86230ed4182 100644 --- a/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/movingPercentiles/MovingPercentilesPipelineAggregationBuilder.java +++ b/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/movingPercentiles/MovingPercentilesPipelineAggregationBuilder.java @@ -8,17 +8,17 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.aggregations.pipeline.AbstractPipelineAggregationBuilder; import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Map; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; public class MovingPercentilesPipelineAggregationBuilder extends AbstractPipelineAggregationBuilder< MovingPercentilesPipelineAggregationBuilder> { diff --git a/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/multiterms/InternalMultiTerms.java b/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/multiterms/InternalMultiTerms.java index f2a6268f6e05d..86fd44db0268d 100644 --- a/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/multiterms/InternalMultiTerms.java +++ b/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/multiterms/InternalMultiTerms.java @@ -10,7 +10,6 @@ import org.apache.lucene.util.BytesRef; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.AggregationExecutionException; import org.elasticsearch.search.aggregations.Aggregations; @@ -20,6 +19,7 @@ import org.elasticsearch.search.aggregations.InternalOrder; import org.elasticsearch.search.aggregations.KeyComparable; import org.elasticsearch.search.aggregations.bucket.terms.AbstractInternalTerms; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.ArrayList; diff --git a/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/multiterms/MultiTermsAggregationBuilder.java b/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/multiterms/MultiTermsAggregationBuilder.java index d7217b93b8c90..5e2ec1f9aa813 100644 --- a/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/multiterms/MultiTermsAggregationBuilder.java +++ b/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/multiterms/MultiTermsAggregationBuilder.java @@ -9,11 +9,7 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ContextParser; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.aggregations.AbstractAggregationBuilder; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.Aggregator; @@ -27,6 +23,10 @@ import org.elasticsearch.search.aggregations.support.MultiValuesSourceFieldConfig; import org.elasticsearch.search.aggregations.support.ValuesSourceConfig; import org.elasticsearch.search.aggregations.support.ValuesSourceRegistry; +import org.elasticsearch.xcontent.ContextParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.ArrayList; diff --git a/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/normalize/NormalizePipelineAggregationBuilder.java b/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/normalize/NormalizePipelineAggregationBuilder.java index fd69d73ed6122..f16b19f46f045 100644 --- a/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/normalize/NormalizePipelineAggregationBuilder.java +++ b/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/normalize/NormalizePipelineAggregationBuilder.java @@ -9,13 +9,13 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.pipeline.AbstractPipelineAggregationBuilder; import org.elasticsearch.search.aggregations.pipeline.BucketMetricsParser; import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.List; @@ -24,9 +24,9 @@ import java.util.function.DoubleUnaryOperator; import java.util.function.Function; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; import static org.elasticsearch.search.aggregations.pipeline.PipelineAggregator.Parser.FORMAT; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; import static org.elasticsearch.xpack.analytics.normalize.NormalizePipelineMethods.Mean; import static org.elasticsearch.xpack.analytics.normalize.NormalizePipelineMethods.Percent; import static org.elasticsearch.xpack.analytics.normalize.NormalizePipelineMethods.RescaleZeroToOne; diff --git a/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/rate/InternalRate.java b/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/rate/InternalRate.java index 8b95a2c2e59cb..c221fc612336e 100644 --- a/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/rate/InternalRate.java +++ b/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/rate/InternalRate.java @@ -8,11 +8,11 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.InternalAggregation; import org.elasticsearch.search.aggregations.metrics.CompensatedSum; import org.elasticsearch.search.aggregations.metrics.InternalNumericMetricsAggregation; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.List; diff --git a/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/rate/RateAggregationBuilder.java b/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/rate/RateAggregationBuilder.java index dde74f4b9e440..eb1f9815e1875 100644 --- a/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/rate/RateAggregationBuilder.java +++ b/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/rate/RateAggregationBuilder.java @@ -10,9 +10,6 @@ import org.elasticsearch.common.Rounding; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.AggregatorFactories; @@ -25,6 +22,9 @@ import org.elasticsearch.search.aggregations.support.ValuesSourceConfig; import org.elasticsearch.search.aggregations.support.ValuesSourceRegistry; import org.elasticsearch.search.aggregations.support.ValuesSourceType; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Map; diff --git a/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/stringstats/InternalStringStats.java b/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/stringstats/InternalStringStats.java index 563262ec20d6f..b39cc0fda4e9c 100644 --- a/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/stringstats/InternalStringStats.java +++ b/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/stringstats/InternalStringStats.java @@ -8,11 +8,11 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.InternalAggregation; import org.elasticsearch.search.aggregations.metrics.CompensatedSum; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.HashMap; diff --git a/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/stringstats/StringStatsAggregationBuilder.java b/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/stringstats/StringStatsAggregationBuilder.java index 29b20d6f6cfda..4afce484819dc 100644 --- a/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/stringstats/StringStatsAggregationBuilder.java +++ b/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/stringstats/StringStatsAggregationBuilder.java @@ -8,9 +8,6 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.AggregatorFactories; import org.elasticsearch.search.aggregations.AggregatorFactory; @@ -20,6 +17,9 @@ import org.elasticsearch.search.aggregations.support.ValuesSourceConfig; import org.elasticsearch.search.aggregations.support.ValuesSourceRegistry; import org.elasticsearch.search.aggregations.support.ValuesSourceType; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Map; diff --git a/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/topmetrics/InternalTopMetrics.java b/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/topmetrics/InternalTopMetrics.java index a27c7d56463a5..4d75e35e33564 100644 --- a/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/topmetrics/InternalTopMetrics.java +++ b/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/topmetrics/InternalTopMetrics.java @@ -10,14 +10,14 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.core.Nullable; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.InternalAggregation; import org.elasticsearch.search.aggregations.metrics.InternalMultiValueAggregation; import org.elasticsearch.search.sort.SortOrder; import org.elasticsearch.search.sort.SortValue; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.ArrayList; diff --git a/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/topmetrics/TopMetricsAggregationBuilder.java b/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/topmetrics/TopMetricsAggregationBuilder.java index 04b39d1b31e42..bdf28c33786fe 100644 --- a/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/topmetrics/TopMetricsAggregationBuilder.java +++ b/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/topmetrics/TopMetricsAggregationBuilder.java @@ -8,11 +8,6 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ContextParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.aggregations.AbstractAggregationBuilder; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.AggregatorFactories; @@ -24,6 +19,11 @@ import org.elasticsearch.search.aggregations.support.ValuesSourceRegistry; import org.elasticsearch.search.aggregations.support.ValuesSourceRegistry.RegistryKey; import org.elasticsearch.search.sort.SortBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ContextParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.List; @@ -32,10 +32,10 @@ import java.util.Set; import java.util.stream.Collectors; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; import static org.elasticsearch.search.builder.SearchSourceBuilder.SIZE_FIELD; import static org.elasticsearch.search.builder.SearchSourceBuilder.SORT_FIELD; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class TopMetricsAggregationBuilder extends AbstractAggregationBuilder { public static final String NAME = "top_metrics"; diff --git a/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/ttest/InternalTTest.java b/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/ttest/InternalTTest.java index 138698f6574aa..07cd87a630b30 100644 --- a/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/ttest/InternalTTest.java +++ b/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/ttest/InternalTTest.java @@ -9,10 +9,10 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.InternalAggregation; import org.elasticsearch.search.aggregations.metrics.InternalNumericMetricsAggregation; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.List; diff --git a/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/ttest/TTestAggregationBuilder.java b/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/ttest/TTestAggregationBuilder.java index 64056b722376c..2fb36f0eaaa0b 100644 --- a/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/ttest/TTestAggregationBuilder.java +++ b/x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/ttest/TTestAggregationBuilder.java @@ -9,10 +9,6 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.AggregationBuilder; @@ -29,6 +25,10 @@ import org.elasticsearch.search.aggregations.support.ValuesSourceConfig; import org.elasticsearch.search.aggregations.support.ValuesSourceRegistry; import org.elasticsearch.search.aggregations.support.ValuesSourceType; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Map; diff --git a/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/action/TransportAnalyticsStatsActionTests.java b/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/action/TransportAnalyticsStatsActionTests.java index bbb75405fbfb2..a5374270b2b85 100644 --- a/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/action/TransportAnalyticsStatsActionTests.java +++ b/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/action/TransportAnalyticsStatsActionTests.java @@ -14,14 +14,14 @@ import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ContextParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.rest.yaml.ObjectPath; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.TransportService; +import org.elasticsearch.xcontent.ContextParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.xpack.analytics.AnalyticsUsage; import org.elasticsearch.xpack.core.analytics.AnalyticsFeatureSetUsage; import org.elasticsearch.xpack.core.analytics.action.AnalyticsStatsAction; @@ -34,7 +34,7 @@ import static java.util.Collections.emptyList; import static java.util.stream.Collectors.toList; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.equalTo; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/aggregations/metrics/HistogramPercentileAggregationTests.java b/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/aggregations/metrics/HistogramPercentileAggregationTests.java index 4d4d88a6c2f4c..e09c3ebf9bc06 100644 --- a/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/aggregations/metrics/HistogramPercentileAggregationTests.java +++ b/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/aggregations/metrics/HistogramPercentileAggregationTests.java @@ -16,8 +16,6 @@ import org.elasticsearch.action.bulk.BulkRequest; import org.elasticsearch.action.index.IndexRequest; import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.search.aggregations.AggregationBuilders; import org.elasticsearch.search.aggregations.metrics.InternalHDRPercentiles; @@ -26,6 +24,8 @@ import org.elasticsearch.search.aggregations.metrics.PercentilesMethod; import org.elasticsearch.search.aggregations.metrics.TDigestState; import org.elasticsearch.test.ESSingleNodeTestCase; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.xpack.analytics.AnalyticsPlugin; import org.elasticsearch.xpack.analytics.boxplot.Boxplot; import org.elasticsearch.xpack.analytics.boxplot.BoxplotAggregationBuilder; diff --git a/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/boxplot/BoxplotAggregationBuilderTests.java b/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/boxplot/BoxplotAggregationBuilderTests.java index 954127fab02d5..447f5b37478fa 100644 --- a/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/boxplot/BoxplotAggregationBuilderTests.java +++ b/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/boxplot/BoxplotAggregationBuilderTests.java @@ -8,12 +8,12 @@ package org.elasticsearch.xpack.analytics.boxplot; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.search.aggregations.AggregatorFactories; import org.elasticsearch.search.aggregations.BaseAggregationBuilder; import org.elasticsearch.test.AbstractSerializingTestCase; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentParser; import org.junit.Before; import java.io.IOException; diff --git a/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/boxplot/InternalBoxplotTests.java b/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/boxplot/InternalBoxplotTests.java index cbc720ae25057..435d21776b291 100644 --- a/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/boxplot/InternalBoxplotTests.java +++ b/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/boxplot/InternalBoxplotTests.java @@ -11,14 +11,14 @@ import org.elasticsearch.common.io.stream.NamedWriteableAwareStreamInput; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.util.CollectionUtils; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ParseField; import org.elasticsearch.plugins.SearchPlugin; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.Aggregation; import org.elasticsearch.search.aggregations.ParsedAggregation; import org.elasticsearch.search.aggregations.metrics.TDigestState; import org.elasticsearch.test.InternalAggregationTestCase; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.xpack.analytics.AnalyticsPlugin; import java.io.IOException; diff --git a/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/mapper/HistogramFieldMapperTests.java b/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/mapper/HistogramFieldMapperTests.java index 32d4942e65af2..173083100ce97 100644 --- a/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/mapper/HistogramFieldMapperTests.java +++ b/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/mapper/HistogramFieldMapperTests.java @@ -6,7 +6,6 @@ */ package org.elasticsearch.xpack.analytics.mapper; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.mapper.MapperParsingException; @@ -15,6 +14,7 @@ import org.elasticsearch.index.mapper.ParsedDocument; import org.elasticsearch.index.mapper.SourceToParse; import org.elasticsearch.plugins.Plugin; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.analytics.AnalyticsPlugin; import java.io.IOException; diff --git a/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/multiterms/InternalMultiTermsTests.java b/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/multiterms/InternalMultiTermsTests.java index 5bf553811a493..baa38b4312959 100644 --- a/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/multiterms/InternalMultiTermsTests.java +++ b/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/multiterms/InternalMultiTermsTests.java @@ -11,8 +11,6 @@ import org.elasticsearch.common.util.CollectionUtils; import org.elasticsearch.common.util.MockBigArrays; import org.elasticsearch.common.util.MockPageCacheRecycler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ParseField; import org.elasticsearch.indices.breaker.NoneCircuitBreakerService; import org.elasticsearch.plugins.SearchPlugin; import org.elasticsearch.script.ScriptService; @@ -25,6 +23,8 @@ import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.InternalAggregationTestCase; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.xpack.analytics.AnalyticsPlugin; import java.util.ArrayList; diff --git a/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/multiterms/MultiTermsAggregationBuilderTests.java b/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/multiterms/MultiTermsAggregationBuilderTests.java index 74f657e49608e..4515cc26361a4 100644 --- a/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/multiterms/MultiTermsAggregationBuilderTests.java +++ b/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/multiterms/MultiTermsAggregationBuilderTests.java @@ -10,9 +10,6 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.search.SearchModule; import org.elasticsearch.search.aggregations.Aggregator; import org.elasticsearch.search.aggregations.AggregatorFactories; @@ -20,6 +17,9 @@ import org.elasticsearch.search.aggregations.support.MultiValuesSourceFieldConfig; import org.elasticsearch.search.aggregations.support.ValueType; import org.elasticsearch.test.AbstractSerializingTestCase; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentParser; import org.junit.Before; import java.io.IOException; diff --git a/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/rate/InternalRateTests.java b/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/rate/InternalRateTests.java index 1d574d83e754e..101d38757f494 100644 --- a/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/rate/InternalRateTests.java +++ b/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/rate/InternalRateTests.java @@ -8,13 +8,13 @@ package org.elasticsearch.xpack.analytics.rate; import org.elasticsearch.common.util.CollectionUtils; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ParseField; import org.elasticsearch.plugins.SearchPlugin; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.Aggregation; import org.elasticsearch.search.aggregations.ParsedAggregation; import org.elasticsearch.test.InternalAggregationTestCase; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.xpack.analytics.AnalyticsPlugin; import java.util.ArrayList; diff --git a/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/rate/RateAggregationBuilderTests.java b/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/rate/RateAggregationBuilderTests.java index f8d70a300fdcb..a2cfe458b456a 100644 --- a/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/rate/RateAggregationBuilderTests.java +++ b/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/rate/RateAggregationBuilderTests.java @@ -11,14 +11,14 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.script.Script; import org.elasticsearch.search.SearchModule; import org.elasticsearch.search.aggregations.AggregatorFactories; import org.elasticsearch.search.aggregations.BaseAggregationBuilder; import org.elasticsearch.test.AbstractSerializingTestCase; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentParser; import org.junit.Before; import java.io.IOException; diff --git a/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/stringstats/InternalStringStatsTests.java b/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/stringstats/InternalStringStatsTests.java index c130ec850ac51..56e8334d6a0b4 100644 --- a/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/stringstats/InternalStringStatsTests.java +++ b/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/stringstats/InternalStringStatsTests.java @@ -9,14 +9,14 @@ import org.elasticsearch.client.analytics.ParsedStringStats; import org.elasticsearch.common.util.CollectionUtils; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ParseField; import org.elasticsearch.plugins.SearchPlugin; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.Aggregation; import org.elasticsearch.search.aggregations.ParsedAggregation; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.InternalAggregationTestCase; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.xpack.analytics.AnalyticsPlugin; import java.io.IOException; diff --git a/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/stringstats/StringStatsAggregationBuilderTests.java b/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/stringstats/StringStatsAggregationBuilderTests.java index e0d369148772d..7c6631655ffde 100644 --- a/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/stringstats/StringStatsAggregationBuilderTests.java +++ b/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/stringstats/StringStatsAggregationBuilderTests.java @@ -8,15 +8,15 @@ package org.elasticsearch.xpack.analytics.stringstats; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.search.aggregations.AggregatorFactories; import org.elasticsearch.search.aggregations.BaseAggregationBuilder; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.test.AbstractXContentTestCase; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Arrays; diff --git a/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/topmetrics/InternalTopMetricsTests.java b/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/topmetrics/InternalTopMetricsTests.java index 2b7f88e458079..98bcd93173a88 100644 --- a/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/topmetrics/InternalTopMetricsTests.java +++ b/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/topmetrics/InternalTopMetricsTests.java @@ -13,8 +13,6 @@ import org.elasticsearch.common.time.DateFormatter; import org.elasticsearch.common.time.DateUtils; import org.elasticsearch.common.util.CollectionUtils; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ParseField; import org.elasticsearch.index.mapper.DateFieldMapper; import org.elasticsearch.plugins.SearchPlugin; import org.elasticsearch.search.DocValueFormat; @@ -23,6 +21,8 @@ import org.elasticsearch.search.sort.SortOrder; import org.elasticsearch.search.sort.SortValue; import org.elasticsearch.test.InternalAggregationTestCase; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.xpack.analytics.AnalyticsPlugin; import org.elasticsearch.xpack.analytics.topmetrics.InternalTopMetrics.MetricValue; diff --git a/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/topmetrics/TopMetricsAggregationBuilderTests.java b/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/topmetrics/TopMetricsAggregationBuilderTests.java index be06f88c98ee8..39c278f66aad6 100644 --- a/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/topmetrics/TopMetricsAggregationBuilderTests.java +++ b/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/topmetrics/TopMetricsAggregationBuilderTests.java @@ -9,11 +9,6 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.search.aggregations.AggregatorFactories; import org.elasticsearch.search.aggregations.BaseAggregationBuilder; import org.elasticsearch.search.aggregations.support.MultiValuesSourceFieldConfig; @@ -22,6 +17,11 @@ import org.elasticsearch.search.sort.SortOrder; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.test.AbstractXContentTestCase; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Arrays; diff --git a/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/ttest/InternalTTestTests.java b/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/ttest/InternalTTestTests.java index 38e8eb91cb76f..ab003fb6ef8e2 100644 --- a/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/ttest/InternalTTestTests.java +++ b/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/ttest/InternalTTestTests.java @@ -11,13 +11,13 @@ import org.elasticsearch.common.io.stream.NamedWriteableAwareStreamInput; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.util.CollectionUtils; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ParseField; import org.elasticsearch.plugins.SearchPlugin; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.Aggregation; import org.elasticsearch.search.aggregations.ParsedAggregation; import org.elasticsearch.test.InternalAggregationTestCase; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.xpack.analytics.AnalyticsPlugin; import java.io.IOException; diff --git a/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/ttest/TTestAggregationBuilderTests.java b/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/ttest/TTestAggregationBuilderTests.java index 47a562432b3ac..61c3a2fbc76f6 100644 --- a/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/ttest/TTestAggregationBuilderTests.java +++ b/x-pack/plugin/analytics/src/test/java/org/elasticsearch/xpack/analytics/ttest/TTestAggregationBuilderTests.java @@ -10,9 +10,6 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.script.Script; import org.elasticsearch.search.SearchModule; @@ -20,6 +17,9 @@ import org.elasticsearch.search.aggregations.BaseAggregationBuilder; import org.elasticsearch.search.aggregations.support.MultiValuesSourceFieldConfig; import org.elasticsearch.test.AbstractSerializingTestCase; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentParser; import org.junit.Before; import java.io.IOException; diff --git a/x-pack/plugin/async-search/qa/rest/src/main/java/org/elasticsearch/query/DeprecatedQueryBuilder.java b/x-pack/plugin/async-search/qa/rest/src/main/java/org/elasticsearch/query/DeprecatedQueryBuilder.java index bb9ac4163d0bc..ced8f7e855873 100644 --- a/x-pack/plugin/async-search/qa/rest/src/main/java/org/elasticsearch/query/DeprecatedQueryBuilder.java +++ b/x-pack/plugin/async-search/qa/rest/src/main/java/org/elasticsearch/query/DeprecatedQueryBuilder.java @@ -14,11 +14,11 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.logging.DeprecationCategory; import org.elasticsearch.common.logging.DeprecationLogger; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.query.AbstractQueryBuilder; import org.elasticsearch.index.query.SearchExecutionContext; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/x-pack/plugin/async-search/qa/security/src/javaRestTest/java/org/elasticsearch/xpack/search/AsyncSearchSecurityIT.java b/x-pack/plugin/async-search/qa/security/src/javaRestTest/java/org/elasticsearch/xpack/search/AsyncSearchSecurityIT.java index 342322923c1b5..8220bf9cadde3 100644 --- a/x-pack/plugin/async-search/qa/security/src/javaRestTest/java/org/elasticsearch/xpack/search/AsyncSearchSecurityIT.java +++ b/x-pack/plugin/async-search/qa/security/src/javaRestTest/java/org/elasticsearch/xpack/search/AsyncSearchSecurityIT.java @@ -20,11 +20,11 @@ import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.concurrent.ThreadContext; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.search.SearchHit; import org.elasticsearch.test.rest.ESRestTestCase; import org.elasticsearch.xpack.core.async.AsyncExecutionId; @@ -36,7 +36,7 @@ import java.util.List; import java.util.Map; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.xpack.core.XPackPlugin.ASYNC_RESULTS_INDEX; import static org.elasticsearch.xpack.core.security.authc.AuthenticationServiceField.RUN_AS_USER_HEADER; import static org.hamcrest.Matchers.arrayContainingInAnyOrder; diff --git a/x-pack/plugin/async-search/src/internalClusterTest/java/org/elasticsearch/xpack/search/AsyncSearchIntegTestCase.java b/x-pack/plugin/async-search/src/internalClusterTest/java/org/elasticsearch/xpack/search/AsyncSearchIntegTestCase.java index 358046c1ad5e9..cfe1a000033dd 100644 --- a/x-pack/plugin/async-search/src/internalClusterTest/java/org/elasticsearch/xpack/search/AsyncSearchIntegTestCase.java +++ b/x-pack/plugin/async-search/src/internalClusterTest/java/org/elasticsearch/xpack/search/AsyncSearchIntegTestCase.java @@ -22,7 +22,7 @@ import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.common.component.Lifecycle; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ContextParser; +import org.elasticsearch.xcontent.ContextParser; import org.elasticsearch.core.TimeValue; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.plugins.SearchPlugin; diff --git a/x-pack/plugin/async-search/src/internalClusterTest/java/org/elasticsearch/xpack/search/BlockingQueryBuilder.java b/x-pack/plugin/async-search/src/internalClusterTest/java/org/elasticsearch/xpack/search/BlockingQueryBuilder.java index 7fb330e40e450..f96df3b7afd3c 100644 --- a/x-pack/plugin/async-search/src/internalClusterTest/java/org/elasticsearch/xpack/search/BlockingQueryBuilder.java +++ b/x-pack/plugin/async-search/src/internalClusterTest/java/org/elasticsearch/xpack/search/BlockingQueryBuilder.java @@ -14,7 +14,7 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.lucene.search.Queries; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.query.AbstractQueryBuilder; import org.elasticsearch.index.query.SearchExecutionContext; diff --git a/x-pack/plugin/async-search/src/test/java/org/elasticsearch/xpack/search/AsyncSearchResponseTests.java b/x-pack/plugin/async-search/src/test/java/org/elasticsearch/xpack/search/AsyncSearchResponseTests.java index 8e875c7aa4d39..82f809010c226 100644 --- a/x-pack/plugin/async-search/src/test/java/org/elasticsearch/xpack/search/AsyncSearchResponseTests.java +++ b/x-pack/plugin/async-search/src/test/java/org/elasticsearch/xpack/search/AsyncSearchResponseTests.java @@ -14,10 +14,10 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentElasticsearchExtension; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.script.ScriptException; import org.elasticsearch.search.SearchModule; import org.elasticsearch.search.internal.InternalSearchResponse; diff --git a/x-pack/plugin/async-search/src/test/java/org/elasticsearch/xpack/search/AsyncStatusResponseTests.java b/x-pack/plugin/async-search/src/test/java/org/elasticsearch/xpack/search/AsyncStatusResponseTests.java index acd669e8ac068..c6ed72df8f5e1 100644 --- a/x-pack/plugin/async-search/src/test/java/org/elasticsearch/xpack/search/AsyncStatusResponseTests.java +++ b/x-pack/plugin/async-search/src/test/java/org/elasticsearch/xpack/search/AsyncStatusResponseTests.java @@ -9,9 +9,9 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.xpack.core.search.action.AsyncStatusResponse; import org.elasticsearch.test.AbstractWireSerializingTestCase; diff --git a/x-pack/plugin/async-search/src/test/java/org/elasticsearch/xpack/search/CancellingAggregationBuilder.java b/x-pack/plugin/async-search/src/test/java/org/elasticsearch/xpack/search/CancellingAggregationBuilder.java index 371fb440fd580..9eb3ac1c0e9c4 100644 --- a/x-pack/plugin/async-search/src/test/java/org/elasticsearch/xpack/search/CancellingAggregationBuilder.java +++ b/x-pack/plugin/async-search/src/test/java/org/elasticsearch/xpack/search/CancellingAggregationBuilder.java @@ -8,8 +8,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.search.aggregations.AbstractAggregationBuilder; import org.elasticsearch.search.aggregations.AggregationBuilder; diff --git a/x-pack/plugin/async-search/src/test/java/org/elasticsearch/xpack/search/RestSubmitAsyncSearchActionTests.java b/x-pack/plugin/async-search/src/test/java/org/elasticsearch/xpack/search/RestSubmitAsyncSearchActionTests.java index 91018259ccafd..89c8fb8512ef5 100644 --- a/x-pack/plugin/async-search/src/test/java/org/elasticsearch/xpack/search/RestSubmitAsyncSearchActionTests.java +++ b/x-pack/plugin/async-search/src/test/java/org/elasticsearch/xpack/search/RestSubmitAsyncSearchActionTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.test.rest.FakeRestRequest; import org.elasticsearch.test.rest.RestActionTestCase; diff --git a/x-pack/plugin/async-search/src/test/java/org/elasticsearch/xpack/search/ThrowingQueryBuilder.java b/x-pack/plugin/async-search/src/test/java/org/elasticsearch/xpack/search/ThrowingQueryBuilder.java index 04ce3d4a7c12a..d3f3af0ec7ef2 100644 --- a/x-pack/plugin/async-search/src/test/java/org/elasticsearch/xpack/search/ThrowingQueryBuilder.java +++ b/x-pack/plugin/async-search/src/test/java/org/elasticsearch/xpack/search/ThrowingQueryBuilder.java @@ -14,7 +14,7 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.lucene.search.Queries; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.query.AbstractQueryBuilder; import org.elasticsearch.index.query.SearchExecutionContext; diff --git a/x-pack/plugin/async/src/main/java/org/elasticsearch/xpack/async/AsyncResultsIndexPlugin.java b/x-pack/plugin/async/src/main/java/org/elasticsearch/xpack/async/AsyncResultsIndexPlugin.java index f4a126677befe..1031228a31f37 100644 --- a/x-pack/plugin/async/src/main/java/org/elasticsearch/xpack/async/AsyncResultsIndexPlugin.java +++ b/x-pack/plugin/async/src/main/java/org/elasticsearch/xpack/async/AsyncResultsIndexPlugin.java @@ -14,7 +14,6 @@ import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; import org.elasticsearch.env.Environment; import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.indices.SystemIndexDescriptor; @@ -24,6 +23,7 @@ import org.elasticsearch.script.ScriptService; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.watcher.ResourceWatcherService; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.xpack.core.async.AsyncTaskIndexService; import org.elasticsearch.xpack.core.async.AsyncTaskMaintenanceService; diff --git a/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/Autoscaling.java b/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/Autoscaling.java index 8e7a66fac6bcf..3cdb18c7ae24d 100644 --- a/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/Autoscaling.java +++ b/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/Autoscaling.java @@ -23,8 +23,6 @@ import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.SettingsFilter; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ParseField; import org.elasticsearch.env.Environment; import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.license.License; @@ -38,6 +36,8 @@ import org.elasticsearch.script.ScriptService; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.watcher.ResourceWatcherService; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.xpack.autoscaling.action.DeleteAutoscalingPolicyAction; import org.elasticsearch.xpack.autoscaling.action.GetAutoscalingCapacityAction; import org.elasticsearch.xpack.autoscaling.action.GetAutoscalingPolicyAction; diff --git a/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/AutoscalingMetadata.java b/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/AutoscalingMetadata.java index 94f643ff8e943..2489063244e2b 100644 --- a/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/AutoscalingMetadata.java +++ b/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/AutoscalingMetadata.java @@ -15,10 +15,10 @@ import org.elasticsearch.cluster.metadata.Metadata; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.autoscaling.policy.AutoscalingPolicyMetadata; import java.io.IOException; diff --git a/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/action/GetAutoscalingCapacityAction.java b/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/action/GetAutoscalingCapacityAction.java index be71ae3f02c03..ce614d25a91d1 100644 --- a/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/action/GetAutoscalingCapacityAction.java +++ b/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/action/GetAutoscalingCapacityAction.java @@ -14,8 +14,8 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.autoscaling.capacity.AutoscalingDeciderResults; import java.io.IOException; diff --git a/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/action/GetAutoscalingPolicyAction.java b/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/action/GetAutoscalingPolicyAction.java index 6d918e7a99c16..d01fb600ccbfe 100644 --- a/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/action/GetAutoscalingPolicyAction.java +++ b/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/action/GetAutoscalingPolicyAction.java @@ -13,8 +13,8 @@ import org.elasticsearch.action.support.master.MasterNodeReadRequest; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.autoscaling.policy.AutoscalingPolicy; import java.io.IOException; diff --git a/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/action/PutAutoscalingPolicyAction.java b/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/action/PutAutoscalingPolicyAction.java index 07a607e84e6b4..0a1f92960fa73 100644 --- a/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/action/PutAutoscalingPolicyAction.java +++ b/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/action/PutAutoscalingPolicyAction.java @@ -18,8 +18,8 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.autoscaling.policy.AutoscalingPolicy; import java.io.IOException; diff --git a/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/capacity/AutoscalingCapacity.java b/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/capacity/AutoscalingCapacity.java index 096afc27ad86c..f14732c713f7c 100644 --- a/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/capacity/AutoscalingCapacity.java +++ b/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/capacity/AutoscalingCapacity.java @@ -12,8 +12,8 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/capacity/AutoscalingDeciderResult.java b/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/capacity/AutoscalingDeciderResult.java index 1ad7187dba788..9f7b605d27b13 100644 --- a/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/capacity/AutoscalingDeciderResult.java +++ b/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/capacity/AutoscalingDeciderResult.java @@ -11,8 +11,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/capacity/AutoscalingDeciderResults.java b/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/capacity/AutoscalingDeciderResults.java index eaba55a9cbc6a..1082a2e0696e3 100644 --- a/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/capacity/AutoscalingDeciderResults.java +++ b/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/capacity/AutoscalingDeciderResults.java @@ -12,8 +12,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Comparator; diff --git a/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/capacity/FixedAutoscalingDeciderService.java b/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/capacity/FixedAutoscalingDeciderService.java index f6cdc1a31390f..33398f4f416ef 100644 --- a/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/capacity/FixedAutoscalingDeciderService.java +++ b/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/capacity/FixedAutoscalingDeciderService.java @@ -14,7 +14,7 @@ import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.List; diff --git a/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/existence/FrozenExistenceDeciderService.java b/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/existence/FrozenExistenceDeciderService.java index 1886503f780a6..d20b6f9387cb1 100644 --- a/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/existence/FrozenExistenceDeciderService.java +++ b/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/existence/FrozenExistenceDeciderService.java @@ -14,7 +14,7 @@ import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.autoscaling.capacity.AutoscalingCapacity; import org.elasticsearch.xpack.autoscaling.capacity.AutoscalingDeciderContext; import org.elasticsearch.xpack.autoscaling.capacity.AutoscalingDeciderResult; diff --git a/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/policy/AutoscalingPolicy.java b/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/policy/AutoscalingPolicy.java index 82780041d0773..f592ff21a9efe 100644 --- a/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/policy/AutoscalingPolicy.java +++ b/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/policy/AutoscalingPolicy.java @@ -14,11 +14,11 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.Maps; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.AbstractMap; diff --git a/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/policy/AutoscalingPolicyMetadata.java b/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/policy/AutoscalingPolicyMetadata.java index c5368d9f525cc..4c730f1d218c4 100644 --- a/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/policy/AutoscalingPolicyMetadata.java +++ b/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/policy/AutoscalingPolicyMetadata.java @@ -11,11 +11,11 @@ import org.elasticsearch.cluster.Diffable; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/rest/RestPutAutoscalingPolicyHandler.java b/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/rest/RestPutAutoscalingPolicyHandler.java index b512efa0c3419..99d3fcd9a9029 100644 --- a/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/rest/RestPutAutoscalingPolicyHandler.java +++ b/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/rest/RestPutAutoscalingPolicyHandler.java @@ -8,10 +8,10 @@ package org.elasticsearch.xpack.autoscaling.rest; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestToXContentListener; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.autoscaling.action.PutAutoscalingPolicyAction; import java.io.IOException; diff --git a/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/shards/FrozenShardsDeciderService.java b/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/shards/FrozenShardsDeciderService.java index 98354b1eee39b..9d405593bb4bb 100644 --- a/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/shards/FrozenShardsDeciderService.java +++ b/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/shards/FrozenShardsDeciderService.java @@ -15,7 +15,7 @@ import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.autoscaling.capacity.AutoscalingCapacity; import org.elasticsearch.xpack.autoscaling.capacity.AutoscalingDeciderContext; import org.elasticsearch.xpack.autoscaling.capacity.AutoscalingDeciderResult; diff --git a/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/storage/FrozenStorageDeciderService.java b/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/storage/FrozenStorageDeciderService.java index 2763eb26fb210..dbaa812c5eafc 100644 --- a/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/storage/FrozenStorageDeciderService.java +++ b/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/storage/FrozenStorageDeciderService.java @@ -15,8 +15,8 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.index.shard.ShardId; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.autoscaling.capacity.AutoscalingCapacity; import org.elasticsearch.xpack.autoscaling.capacity.AutoscalingDeciderContext; import org.elasticsearch.xpack.autoscaling.capacity.AutoscalingDeciderResult; diff --git a/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/storage/ProactiveStorageDeciderService.java b/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/storage/ProactiveStorageDeciderService.java index adb258495243c..9dc5eb76c259d 100644 --- a/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/storage/ProactiveStorageDeciderService.java +++ b/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/storage/ProactiveStorageDeciderService.java @@ -15,8 +15,8 @@ import org.elasticsearch.common.settings.ClusterSettings; import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.core.TimeValue; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.autoscaling.capacity.AutoscalingCapacity; import org.elasticsearch.xpack.autoscaling.capacity.AutoscalingDeciderContext; import org.elasticsearch.xpack.autoscaling.capacity.AutoscalingDeciderResult; diff --git a/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/storage/ReactiveStorageDeciderService.java b/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/storage/ReactiveStorageDeciderService.java index e4a268447874c..e523fb81ded1a 100644 --- a/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/storage/ReactiveStorageDeciderService.java +++ b/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/storage/ReactiveStorageDeciderService.java @@ -42,9 +42,9 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.snapshots.SnapshotShardSizeInfo; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.autoscaling.capacity.AutoscalingCapacity; import org.elasticsearch.xpack.autoscaling.capacity.AutoscalingDeciderContext; import org.elasticsearch.xpack.autoscaling.capacity.AutoscalingDeciderResult; diff --git a/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/AutoscalingMetadataDiffableSerializationTests.java b/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/AutoscalingMetadataDiffableSerializationTests.java index a3dc5b54d62c3..e174a6ce822fe 100644 --- a/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/AutoscalingMetadataDiffableSerializationTests.java +++ b/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/AutoscalingMetadataDiffableSerializationTests.java @@ -11,9 +11,9 @@ import org.elasticsearch.cluster.metadata.Metadata; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.test.AbstractDiffableSerializationTestCase; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.autoscaling.policy.AutoscalingPolicy; import org.elasticsearch.xpack.autoscaling.policy.AutoscalingPolicyMetadata; diff --git a/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/AutoscalingTestCase.java b/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/AutoscalingTestCase.java index 7533b367fc2a3..cfddd5994243f 100644 --- a/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/AutoscalingTestCase.java +++ b/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/AutoscalingTestCase.java @@ -14,9 +14,9 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; import org.elasticsearch.core.Tuple; import org.elasticsearch.test.ESTestCase; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.xpack.autoscaling.capacity.AutoscalingCapacity; import org.elasticsearch.xpack.autoscaling.capacity.AutoscalingDeciderResult; import org.elasticsearch.xpack.autoscaling.capacity.AutoscalingDeciderResults; diff --git a/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/action/GetAutoscalingCapacityActionResponseTests.java b/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/action/GetAutoscalingCapacityActionResponseTests.java index a311fbe6a08c9..225ab2a7ba8bb 100644 --- a/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/action/GetAutoscalingCapacityActionResponseTests.java +++ b/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/action/GetAutoscalingCapacityActionResponseTests.java @@ -8,9 +8,9 @@ package org.elasticsearch.xpack.autoscaling.action; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.core.Tuple; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.autoscaling.AutoscalingTestCase; import org.elasticsearch.xpack.autoscaling.capacity.AutoscalingDeciderResults; import org.hamcrest.Matchers; diff --git a/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/capacity/AutoscalingDeciderResultsTests.java b/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/capacity/AutoscalingDeciderResultsTests.java index 65412a3b18f57..c0ff016559399 100644 --- a/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/capacity/AutoscalingDeciderResultsTests.java +++ b/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/capacity/AutoscalingDeciderResultsTests.java @@ -9,12 +9,12 @@ import org.elasticsearch.common.Randomness; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.autoscaling.AutoscalingTestCase; import java.io.IOException; diff --git a/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/policy/AutoscalingPolicyMetadataDiffableSerializationTests.java b/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/policy/AutoscalingPolicyMetadataDiffableSerializationTests.java index 8bc7e1f4943a9..7acc240f455c0 100644 --- a/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/policy/AutoscalingPolicyMetadataDiffableSerializationTests.java +++ b/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/policy/AutoscalingPolicyMetadataDiffableSerializationTests.java @@ -11,9 +11,9 @@ import org.elasticsearch.cluster.Diff; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.test.AbstractDiffableSerializationTestCase; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.autoscaling.AutoscalingTestCase; import static org.elasticsearch.xpack.autoscaling.AutoscalingTestCase.mutateAutoscalingPolicy; diff --git a/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/policy/AutoscalingPolicySerializingTests.java b/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/policy/AutoscalingPolicySerializingTests.java index 0df20019a24d1..ea4e8d0628074 100644 --- a/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/policy/AutoscalingPolicySerializingTests.java +++ b/x-pack/plugin/autoscaling/src/test/java/org/elasticsearch/xpack/autoscaling/policy/AutoscalingPolicySerializingTests.java @@ -9,9 +9,9 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.autoscaling.AutoscalingTestCase; import static org.elasticsearch.xpack.autoscaling.AutoscalingTestCase.mutateAutoscalingPolicy; diff --git a/x-pack/plugin/ccr/qa/downgrade-to-basic-license/src/test/java/org/elasticsearch/xpack/ccr/FollowIndexIT.java b/x-pack/plugin/ccr/qa/downgrade-to-basic-license/src/test/java/org/elasticsearch/xpack/ccr/FollowIndexIT.java index 62f9752b5c454..ef6679e578727 100644 --- a/x-pack/plugin/ccr/qa/downgrade-to-basic-license/src/test/java/org/elasticsearch/xpack/ccr/FollowIndexIT.java +++ b/x-pack/plugin/ccr/qa/downgrade-to-basic-license/src/test/java/org/elasticsearch/xpack/ccr/FollowIndexIT.java @@ -26,7 +26,7 @@ import java.util.concurrent.TimeUnit; import java.util.stream.Stream; -import static org.elasticsearch.common.xcontent.ObjectPath.eval; +import static org.elasticsearch.xcontent.ObjectPath.eval; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.greaterThanOrEqualTo; diff --git a/x-pack/plugin/ccr/qa/multi-cluster/src/test/java/org/elasticsearch/xpack/ccr/AutoFollowIT.java b/x-pack/plugin/ccr/qa/multi-cluster/src/test/java/org/elasticsearch/xpack/ccr/AutoFollowIT.java index 6d150866200d0..fd46726a6f725 100644 --- a/x-pack/plugin/ccr/qa/multi-cluster/src/test/java/org/elasticsearch/xpack/ccr/AutoFollowIT.java +++ b/x-pack/plugin/ccr/qa/multi-cluster/src/test/java/org/elasticsearch/xpack/ccr/AutoFollowIT.java @@ -18,9 +18,9 @@ import org.elasticsearch.common.settings.SecureString; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.ObjectPath; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ObjectPath; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.core.CheckedRunnable; import org.elasticsearch.rest.RestStatus; @@ -32,7 +32,7 @@ import java.util.Map; import java.util.concurrent.TimeUnit; -import static org.elasticsearch.common.xcontent.ObjectPath.eval; +import static org.elasticsearch.xcontent.ObjectPath.eval; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.emptyOrNullString; import static org.hamcrest.Matchers.equalTo; diff --git a/x-pack/plugin/ccr/qa/multi-cluster/src/test/java/org/elasticsearch/xpack/ccr/XPackUsageIT.java b/x-pack/plugin/ccr/qa/multi-cluster/src/test/java/org/elasticsearch/xpack/ccr/XPackUsageIT.java index 8493f0be79a44..7acb53cdbb720 100644 --- a/x-pack/plugin/ccr/qa/multi-cluster/src/test/java/org/elasticsearch/xpack/ccr/XPackUsageIT.java +++ b/x-pack/plugin/ccr/qa/multi-cluster/src/test/java/org/elasticsearch/xpack/ccr/XPackUsageIT.java @@ -11,7 +11,7 @@ import org.elasticsearch.common.settings.SecureString; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.ObjectPath; +import org.elasticsearch.xcontent.ObjectPath; import java.io.IOException; import java.util.Map; diff --git a/x-pack/plugin/ccr/qa/src/main/java/org/elasticsearch/xpack/ccr/ESCCRRestTestCase.java b/x-pack/plugin/ccr/qa/src/main/java/org/elasticsearch/xpack/ccr/ESCCRRestTestCase.java index 9145a4968595f..d8483028c1abd 100644 --- a/x-pack/plugin/ccr/qa/src/main/java/org/elasticsearch/xpack/ccr/ESCCRRestTestCase.java +++ b/x-pack/plugin/ccr/qa/src/main/java/org/elasticsearch/xpack/ccr/ESCCRRestTestCase.java @@ -15,10 +15,10 @@ import org.elasticsearch.cluster.metadata.DataStream; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.test.rest.ESRestTestCase; @@ -28,7 +28,7 @@ import java.util.List; import java.util.Map; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.rest.action.search.RestSearchAction.TOTAL_HITS_AS_INT_PARAM; import static org.hamcrest.Matchers.endsWith; import static org.hamcrest.Matchers.equalTo; diff --git a/x-pack/plugin/ccr/src/internalClusterTest/java/org/elasticsearch/xpack/ccr/CcrAliasesIT.java b/x-pack/plugin/ccr/src/internalClusterTest/java/org/elasticsearch/xpack/ccr/CcrAliasesIT.java index 0188861cb2a10..924504fd896da 100644 --- a/x-pack/plugin/ccr/src/internalClusterTest/java/org/elasticsearch/xpack/ccr/CcrAliasesIT.java +++ b/x-pack/plugin/ccr/src/internalClusterTest/java/org/elasticsearch/xpack/ccr/CcrAliasesIT.java @@ -20,8 +20,8 @@ import org.elasticsearch.core.CheckedRunnable; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.persistent.PersistentTasksCustomMetadata; import org.elasticsearch.rest.action.admin.indices.AliasesNotFoundException; import org.elasticsearch.tasks.TaskInfo; @@ -38,7 +38,7 @@ import java.util.concurrent.CyclicBarrier; import java.util.concurrent.ExecutionException; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.termQuery; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.hamcrest.Matchers.equalTo; diff --git a/x-pack/plugin/ccr/src/internalClusterTest/java/org/elasticsearch/xpack/ccr/CcrRepositoryIT.java b/x-pack/plugin/ccr/src/internalClusterTest/java/org/elasticsearch/xpack/ccr/CcrRepositoryIT.java index 6aa7719298bf7..fa37f6a36d239 100644 --- a/x-pack/plugin/ccr/src/internalClusterTest/java/org/elasticsearch/xpack/ccr/CcrRepositoryIT.java +++ b/x-pack/plugin/ccr/src/internalClusterTest/java/org/elasticsearch/xpack/ccr/CcrRepositoryIT.java @@ -36,7 +36,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.index.Index; import org.elasticsearch.index.shard.ShardId; diff --git a/x-pack/plugin/ccr/src/internalClusterTest/java/org/elasticsearch/xpack/ccr/CcrRetentionLeaseIT.java b/x-pack/plugin/ccr/src/internalClusterTest/java/org/elasticsearch/xpack/ccr/CcrRetentionLeaseIT.java index b6b605ef8d762..8109896e1f544 100644 --- a/x-pack/plugin/ccr/src/internalClusterTest/java/org/elasticsearch/xpack/ccr/CcrRetentionLeaseIT.java +++ b/x-pack/plugin/ccr/src/internalClusterTest/java/org/elasticsearch/xpack/ccr/CcrRetentionLeaseIT.java @@ -30,7 +30,7 @@ import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.Index; import org.elasticsearch.index.IndexService; import org.elasticsearch.index.seqno.RetentionLease; diff --git a/x-pack/plugin/ccr/src/internalClusterTest/java/org/elasticsearch/xpack/ccr/CloseFollowerIndexIT.java b/x-pack/plugin/ccr/src/internalClusterTest/java/org/elasticsearch/xpack/ccr/CloseFollowerIndexIT.java index dc1b1f5b609ae..9aa01f4afd3ed 100644 --- a/x-pack/plugin/ccr/src/internalClusterTest/java/org/elasticsearch/xpack/ccr/CloseFollowerIndexIT.java +++ b/x-pack/plugin/ccr/src/internalClusterTest/java/org/elasticsearch/xpack/ccr/CloseFollowerIndexIT.java @@ -17,7 +17,7 @@ import org.elasticsearch.cluster.metadata.MetadataIndexStateService; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.engine.ReadOnlyEngine; import org.elasticsearch.xpack.CcrIntegTestCase; import org.elasticsearch.xpack.core.ccr.action.PutFollowAction; diff --git a/x-pack/plugin/ccr/src/internalClusterTest/java/org/elasticsearch/xpack/ccr/FollowInfoIT.java b/x-pack/plugin/ccr/src/internalClusterTest/java/org/elasticsearch/xpack/ccr/FollowInfoIT.java index f643e41f249e3..1efedc74dd4bb 100644 --- a/x-pack/plugin/ccr/src/internalClusterTest/java/org/elasticsearch/xpack/ccr/FollowInfoIT.java +++ b/x-pack/plugin/ccr/src/internalClusterTest/java/org/elasticsearch/xpack/ccr/FollowInfoIT.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.ccr; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.xpack.CcrSingleNodeTestCase; import org.elasticsearch.xpack.core.ccr.action.FollowInfoAction; diff --git a/x-pack/plugin/ccr/src/internalClusterTest/java/org/elasticsearch/xpack/ccr/FollowStatsIT.java b/x-pack/plugin/ccr/src/internalClusterTest/java/org/elasticsearch/xpack/ccr/FollowStatsIT.java index f2e2ac187e1ca..2f279617b6036 100644 --- a/x-pack/plugin/ccr/src/internalClusterTest/java/org/elasticsearch/xpack/ccr/FollowStatsIT.java +++ b/x-pack/plugin/ccr/src/internalClusterTest/java/org/elasticsearch/xpack/ccr/FollowStatsIT.java @@ -13,7 +13,7 @@ import org.elasticsearch.action.admin.cluster.state.ClusterStateResponse; import org.elasticsearch.action.admin.indices.close.CloseIndexRequest; import org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.persistent.PersistentTasksCustomMetadata; import org.elasticsearch.xpack.CcrSingleNodeTestCase; import org.elasticsearch.xpack.core.ccr.action.CcrStatsAction; diff --git a/x-pack/plugin/ccr/src/internalClusterTest/java/org/elasticsearch/xpack/ccr/FollowerFailOverIT.java b/x-pack/plugin/ccr/src/internalClusterTest/java/org/elasticsearch/xpack/ccr/FollowerFailOverIT.java index 1c003cd354e6c..ab751bdc2f736 100644 --- a/x-pack/plugin/ccr/src/internalClusterTest/java/org/elasticsearch/xpack/ccr/FollowerFailOverIT.java +++ b/x-pack/plugin/ccr/src/internalClusterTest/java/org/elasticsearch/xpack/ccr/FollowerFailOverIT.java @@ -21,7 +21,7 @@ import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.shard.IndexShard; diff --git a/x-pack/plugin/ccr/src/internalClusterTest/java/org/elasticsearch/xpack/ccr/IndexFollowingIT.java b/x-pack/plugin/ccr/src/internalClusterTest/java/org/elasticsearch/xpack/ccr/IndexFollowingIT.java index 2e2ddba38ba2b..868c0466dcec4 100644 --- a/x-pack/plugin/ccr/src/internalClusterTest/java/org/elasticsearch/xpack/ccr/IndexFollowingIT.java +++ b/x-pack/plugin/ccr/src/internalClusterTest/java/org/elasticsearch/xpack/ccr/IndexFollowingIT.java @@ -61,8 +61,8 @@ import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.index.Index; import org.elasticsearch.index.IndexNotFoundException; @@ -115,7 +115,7 @@ import java.util.stream.IntStream; import java.util.stream.Stream; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.elasticsearch.xpack.ccr.CcrRetentionLeases.retentionLeaseId; import static org.hamcrest.Matchers.containsString; diff --git a/x-pack/plugin/ccr/src/internalClusterTest/java/org/elasticsearch/xpack/ccr/LocalIndexFollowingIT.java b/x-pack/plugin/ccr/src/internalClusterTest/java/org/elasticsearch/xpack/ccr/LocalIndexFollowingIT.java index 1ef2fa8a1fa39..37533304142f1 100644 --- a/x-pack/plugin/ccr/src/internalClusterTest/java/org/elasticsearch/xpack/ccr/LocalIndexFollowingIT.java +++ b/x-pack/plugin/ccr/src/internalClusterTest/java/org/elasticsearch/xpack/ccr/LocalIndexFollowingIT.java @@ -14,8 +14,8 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.xpack.CcrSingleNodeTestCase; import org.elasticsearch.xpack.core.ccr.action.CcrStatsAction; @@ -31,7 +31,7 @@ import java.util.concurrent.CountDownLatch; import java.util.stream.StreamSupport; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; diff --git a/x-pack/plugin/ccr/src/internalClusterTest/java/org/elasticsearch/xpack/ccr/PrimaryFollowerAllocationIT.java b/x-pack/plugin/ccr/src/internalClusterTest/java/org/elasticsearch/xpack/ccr/PrimaryFollowerAllocationIT.java index 18b257dd5823b..16d6684a085ad 100644 --- a/x-pack/plugin/ccr/src/internalClusterTest/java/org/elasticsearch/xpack/ccr/PrimaryFollowerAllocationIT.java +++ b/x-pack/plugin/ccr/src/internalClusterTest/java/org/elasticsearch/xpack/ccr/PrimaryFollowerAllocationIT.java @@ -18,7 +18,7 @@ import org.elasticsearch.cluster.routing.allocation.NodeAllocationResult; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.NodeRoles; import org.elasticsearch.xpack.CcrIntegTestCase; import org.elasticsearch.xpack.core.ccr.action.PutFollowAction; diff --git a/x-pack/plugin/ccr/src/internalClusterTest/java/org/elasticsearch/xpack/ccr/RestartIndexFollowingIT.java b/x-pack/plugin/ccr/src/internalClusterTest/java/org/elasticsearch/xpack/ccr/RestartIndexFollowingIT.java index 9d03e6e1aba0c..fc71ed2eeaee4 100644 --- a/x-pack/plugin/ccr/src/internalClusterTest/java/org/elasticsearch/xpack/ccr/RestartIndexFollowingIT.java +++ b/x-pack/plugin/ccr/src/internalClusterTest/java/org/elasticsearch/xpack/ccr/RestartIndexFollowingIT.java @@ -15,7 +15,7 @@ import org.elasticsearch.action.support.master.AcknowledgedResponse; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.transport.RemoteConnectionInfo; import org.elasticsearch.transport.RemoteConnectionStrategy; import org.elasticsearch.transport.TransportService; diff --git a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/CCRInfoTransportAction.java b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/CCRInfoTransportAction.java index b99d7f7e5fd3a..e054fa8e15fec 100644 --- a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/CCRInfoTransportAction.java +++ b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/CCRInfoTransportAction.java @@ -12,7 +12,7 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.transport.TransportService; import org.elasticsearch.xpack.core.XPackFeatureSet; diff --git a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/Ccr.java b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/Ccr.java index 230d74d20450b..7790886cad569 100644 --- a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/Ccr.java +++ b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/Ccr.java @@ -19,7 +19,7 @@ import org.elasticsearch.cluster.node.DiscoveryNodes; import org.elasticsearch.cluster.routing.allocation.decider.AllocationDecider; import org.elasticsearch.cluster.service.ClusterService; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.settings.ClusterSettings; import org.elasticsearch.common.settings.IndexScopedSettings; @@ -27,7 +27,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.SettingsFilter; import org.elasticsearch.common.settings.SettingsModule; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.env.Environment; import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.index.IndexModule; diff --git a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/action/CcrRequests.java b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/action/CcrRequests.java index 18553730afe6f..dffe3daa887d5 100644 --- a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/action/CcrRequests.java +++ b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/action/CcrRequests.java @@ -17,7 +17,7 @@ import org.elasticsearch.cluster.metadata.MappingMetadata; import org.elasticsearch.cluster.metadata.Metadata; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.Index; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.xpack.ccr.CcrSettings; diff --git a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestForgetFollowerAction.java b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestForgetFollowerAction.java index 9b11f4c236a73..cf188bbe3dc33 100644 --- a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestForgetFollowerAction.java +++ b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestForgetFollowerAction.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.ccr.rest; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestToXContentListener; diff --git a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestPutAutoFollowPatternAction.java b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestPutAutoFollowPatternAction.java index 2a3e39778aeb7..0e39fd2a026a5 100644 --- a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestPutAutoFollowPatternAction.java +++ b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestPutAutoFollowPatternAction.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.ccr.rest; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestToXContentListener; diff --git a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestPutFollowAction.java b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestPutFollowAction.java index 5b0bce8b793a9..98789508028d7 100644 --- a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestPutFollowAction.java +++ b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestPutFollowAction.java @@ -8,7 +8,7 @@ import org.elasticsearch.action.support.ActiveShardCount; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestToXContentListener; diff --git a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestResumeFollowAction.java b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestResumeFollowAction.java index 281868b286dbe..4bfa239b348c5 100644 --- a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestResumeFollowAction.java +++ b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestResumeFollowAction.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.ccr.rest; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestToXContentListener; diff --git a/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/CcrIntegTestCase.java b/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/CcrIntegTestCase.java index ecaf82e8e1104..b63fca82f41b9 100644 --- a/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/CcrIntegTestCase.java +++ b/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/CcrIntegTestCase.java @@ -48,7 +48,7 @@ import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.core.internal.io.IOUtils; import org.elasticsearch.index.Index; import org.elasticsearch.index.IndexService; @@ -119,7 +119,7 @@ import java.util.stream.Collectors; import java.util.stream.Stream; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.discovery.DiscoveryModule.DISCOVERY_SEED_PROVIDERS_SETTING; import static org.elasticsearch.discovery.SettingsBasedSeedHostsProvider.DISCOVERY_SEED_HOSTS_SETTING; import static org.elasticsearch.snapshots.RestoreService.restoreInProgress; diff --git a/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/AutoFollowMetadataTests.java b/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/AutoFollowMetadataTests.java index 2a68a8725acbb..bc4d8f0e242db 100644 --- a/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/AutoFollowMetadataTests.java +++ b/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/AutoFollowMetadataTests.java @@ -12,7 +12,7 @@ import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ccr.AutoFollowMetadata; diff --git a/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/action/AutoFollowStatsTests.java b/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/action/AutoFollowStatsTests.java index 0a91e7f4e287f..4a855b05bc3f6 100644 --- a/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/action/AutoFollowStatsTests.java +++ b/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/action/AutoFollowStatsTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.core.Tuple; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ccr.AutoFollowStats; import org.elasticsearch.xpack.core.ccr.AutoFollowStats.AutoFollowedCluster; diff --git a/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/action/FollowInfoResponseTests.java b/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/action/FollowInfoResponseTests.java index ddd805e99a137..f068a68169a3e 100644 --- a/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/action/FollowInfoResponseTests.java +++ b/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/action/FollowInfoResponseTests.java @@ -7,8 +7,8 @@ package org.elasticsearch.xpack.ccr.action; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ccr.action.FollowInfoAction; import org.elasticsearch.xpack.core.ccr.action.FollowInfoAction.Response.FollowerInfo; diff --git a/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/action/FollowParametersTests.java b/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/action/FollowParametersTests.java index 2f367f0085305..63edf1d7b1247 100644 --- a/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/action/FollowParametersTests.java +++ b/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/action/FollowParametersTests.java @@ -9,8 +9,8 @@ import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ccr.action.FollowParameters; diff --git a/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/action/PutAutoFollowPatternRequestTests.java b/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/action/PutAutoFollowPatternRequestTests.java index 68ad3aba9513e..19e755ce59dbc 100644 --- a/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/action/PutAutoFollowPatternRequestTests.java +++ b/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/action/PutAutoFollowPatternRequestTests.java @@ -9,8 +9,8 @@ import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ccr.action.PutAutoFollowPatternAction; diff --git a/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/action/PutFollowActionRequestTests.java b/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/action/PutFollowActionRequestTests.java index 6b99090a34cf1..88946553e10e8 100644 --- a/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/action/PutFollowActionRequestTests.java +++ b/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/action/PutFollowActionRequestTests.java @@ -10,8 +10,8 @@ import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ccr.action.PutFollowAction; diff --git a/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/action/ResumeFollowActionRequestTests.java b/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/action/ResumeFollowActionRequestTests.java index ef400e8974e5a..cefbea1d3bbc0 100644 --- a/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/action/ResumeFollowActionRequestTests.java +++ b/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/action/ResumeFollowActionRequestTests.java @@ -11,8 +11,8 @@ import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ccr.action.FollowParameters; import org.elasticsearch.xpack.core.ccr.action.ResumeFollowAction; diff --git a/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/action/ShardChangesActionTests.java b/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/action/ShardChangesActionTests.java index f3e94314294c9..4e6ff7e534972 100644 --- a/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/action/ShardChangesActionTests.java +++ b/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/action/ShardChangesActionTests.java @@ -14,7 +14,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.Index; import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.index.IndexService; diff --git a/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/action/ShardChangesTests.java b/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/action/ShardChangesTests.java index 18de3df98020a..b0dc45f542288 100644 --- a/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/action/ShardChangesTests.java +++ b/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/action/ShardChangesTests.java @@ -15,7 +15,7 @@ import org.elasticsearch.action.admin.indices.refresh.RefreshRequest; import org.elasticsearch.action.admin.indices.stats.ShardStats; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.IndexService; import org.elasticsearch.index.engine.Engine; import org.elasticsearch.index.seqno.RetentionLease; diff --git a/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/action/ShardFollowNodeTaskStatusTests.java b/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/action/ShardFollowNodeTaskStatusTests.java index d7f5b2322ff7a..db79c46a2e36b 100644 --- a/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/action/ShardFollowNodeTaskStatusTests.java +++ b/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/action/ShardFollowNodeTaskStatusTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.core.Tuple; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ccr.ShardFollowNodeTaskStatus; diff --git a/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/index/engine/FollowEngineIndexShardTests.java b/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/index/engine/FollowEngineIndexShardTests.java index 6fe23f1e2fbaa..ef48a5032f24f 100644 --- a/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/index/engine/FollowEngineIndexShardTests.java +++ b/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/index/engine/FollowEngineIndexShardTests.java @@ -21,7 +21,7 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.core.Releasable; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.engine.EngineTestCase; import org.elasticsearch.index.mapper.SourceToParse; import org.elasticsearch.index.shard.IndexShard; diff --git a/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/monitoring/collector/ccr/AutoFollowStatsMonitoringDocTests.java b/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/monitoring/collector/ccr/AutoFollowStatsMonitoringDocTests.java index fc36bc6bfbfe4..308d8dfce8616 100644 --- a/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/monitoring/collector/ccr/AutoFollowStatsMonitoringDocTests.java +++ b/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/monitoring/collector/ccr/AutoFollowStatsMonitoringDocTests.java @@ -11,9 +11,9 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.core.Tuple; import org.elasticsearch.common.time.DateFormatter; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.xpack.core.ccr.AutoFollowStats; import org.elasticsearch.xpack.core.ccr.AutoFollowStats.AutoFollowedCluster; @@ -31,7 +31,7 @@ import java.util.NavigableMap; import java.util.TreeMap; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.anyOf; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; diff --git a/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/monitoring/collector/ccr/FollowStatsMonitoringDocTests.java b/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/monitoring/collector/ccr/FollowStatsMonitoringDocTests.java index 8c97f753cae09..06f0a78a36e3f 100644 --- a/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/monitoring/collector/ccr/FollowStatsMonitoringDocTests.java +++ b/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/monitoring/collector/ccr/FollowStatsMonitoringDocTests.java @@ -12,9 +12,9 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.core.Tuple; import org.elasticsearch.common.time.DateFormatter; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.xpack.core.ccr.ShardFollowNodeTaskStatus; import org.elasticsearch.xpack.core.monitoring.MonitoredSystem; @@ -30,7 +30,7 @@ import java.util.NavigableMap; import java.util.TreeMap; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.anyOf; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; diff --git a/x-pack/plugin/core/src/internalClusterTest/java/org/elasticsearch/snapshots/sourceonly/SourceOnlySnapshotIT.java b/x-pack/plugin/core/src/internalClusterTest/java/org/elasticsearch/snapshots/sourceonly/SourceOnlySnapshotIT.java index 08aedb76ae25d..4600a99cfb7af 100644 --- a/x-pack/plugin/core/src/internalClusterTest/java/org/elasticsearch/snapshots/sourceonly/SourceOnlySnapshotIT.java +++ b/x-pack/plugin/core/src/internalClusterTest/java/org/elasticsearch/snapshots/sourceonly/SourceOnlySnapshotIT.java @@ -21,8 +21,8 @@ import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.BigArrays; import org.elasticsearch.common.util.CollectionUtils; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.env.Environment; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.engine.EngineFactory; @@ -55,7 +55,7 @@ import java.util.Optional; import java.util.function.BiConsumer; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/GetBasicStatusResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/GetBasicStatusResponse.java index 2e7b5a9fb82a8..58e7be10cfa81 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/GetBasicStatusResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/GetBasicStatusResponse.java @@ -9,8 +9,8 @@ import org.elasticsearch.action.ActionResponse; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/GetFeatureUsageResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/GetFeatureUsageResponse.java index 1b66ebd527b1a..7d1a6333757ee 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/GetFeatureUsageResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/GetFeatureUsageResponse.java @@ -12,8 +12,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.core.Nullable; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/GetTrialStatusResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/GetTrialStatusResponse.java index e7d06231f6e65..9126d22f33250 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/GetTrialStatusResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/GetTrialStatusResponse.java @@ -9,8 +9,8 @@ import org.elasticsearch.action.ActionResponse; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/License.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/License.java index a8c250f9654d6..fc9a01b6a9d9e 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/License.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/License.java @@ -14,13 +14,13 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.protocol.xpack.license.LicenseStatus; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/LicenseVerifier.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/LicenseVerifier.java index c32cf9fd99b0a..fd4df172b1c7b 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/LicenseVerifier.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/LicenseVerifier.java @@ -9,10 +9,10 @@ import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.BytesRefIterator; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.internal.io.Streams; import java.io.ByteArrayOutputStream; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/LicensesMetadata.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/LicensesMetadata.java index 937e8ecc0c107..2a59c11fa78ab 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/LicensesMetadata.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/LicensesMetadata.java @@ -14,8 +14,8 @@ import org.elasticsearch.core.Nullable; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.license.License.OperationMode; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/Licensing.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/Licensing.java index 262a954017bea..a9c1a55d130a1 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/Licensing.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/Licensing.java @@ -12,14 +12,14 @@ import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; import org.elasticsearch.cluster.metadata.Metadata; import org.elasticsearch.cluster.node.DiscoveryNodes; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.settings.ClusterSettings; import org.elasticsearch.common.settings.IndexScopedSettings; import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.SettingsFilter; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.plugins.ActionPlugin; import org.elasticsearch.rest.RestController; import org.elasticsearch.rest.RestHandler; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/PostStartBasicResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/PostStartBasicResponse.java index 397444bd47c60..8a0ee8448433c 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/PostStartBasicResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/PostStartBasicResponse.java @@ -7,11 +7,11 @@ package org.elasticsearch.license; import org.elasticsearch.action.support.master.AcknowledgedResponse; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.xcontent.StatusToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.protocol.xpack.common.ProtocolUtils; import org.elasticsearch.rest.RestStatus; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/PutLicenseRequest.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/PutLicenseRequest.java index 239649f041700..dc9e43f1875d2 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/PutLicenseRequest.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/PutLicenseRequest.java @@ -12,7 +12,7 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/PutLicenseRequestBuilder.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/PutLicenseRequestBuilder.java index 07e626df00085..762f008694fb3 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/PutLicenseRequestBuilder.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/PutLicenseRequestBuilder.java @@ -9,7 +9,7 @@ import org.elasticsearch.action.support.master.AcknowledgedRequestBuilder; import org.elasticsearch.client.ElasticsearchClient; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.protocol.xpack.license.PutLicenseResponse; /** diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestGetLicenseAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestGetLicenseAction.java index a691d1b6d0e57..ebbffef33ef94 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestGetLicenseAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestGetLicenseAction.java @@ -10,8 +10,8 @@ import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.common.logging.DeprecationCategory; import org.elasticsearch.common.logging.DeprecationLogger; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.protocol.xpack.license.GetLicenseRequest; import org.elasticsearch.rest.BaseRestHandler; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestPostStartTrialLicense.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestPostStartTrialLicense.java index e881af7c1362e..12814fed494f6 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestPostStartTrialLicense.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestPostStartTrialLicense.java @@ -8,7 +8,7 @@ package org.elasticsearch.license; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BytesRestResponse; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/SelfGeneratedLicense.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/SelfGeneratedLicense.java index f21ff8e448af2..88412d1804d75 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/SelfGeneratedLicense.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/SelfGeneratedLicense.java @@ -9,12 +9,12 @@ import org.elasticsearch.cluster.node.DiscoveryNodes; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.nio.ByteBuffer; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/XPackInfoResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/XPackInfoResponse.java index ceae01e173907..68d2c6068cc4a 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/XPackInfoResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/XPackInfoResponse.java @@ -9,14 +9,14 @@ import org.elasticsearch.Version; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.license.License; import org.elasticsearch.protocol.xpack.license.LicenseStatus; @@ -33,7 +33,7 @@ import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; public class XPackInfoResponse extends ActionResponse implements ToXContentObject { /** diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/XPackUsageResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/XPackUsageResponse.java index 3fae154586707..24a193826fe8f 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/XPackUsageResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/XPackUsageResponse.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.protocol.xpack; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Map; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/graph/Connection.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/graph/Connection.java index 8bfadb1953683..c2fb52e5214a3 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/graph/Connection.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/graph/Connection.java @@ -8,13 +8,13 @@ import com.carrotsearch.hppc.ObjectIntHashMap; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContent.Params; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContent.Params; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.protocol.xpack.graph.Vertex.VertexId; import java.io.IOException; @@ -22,7 +22,7 @@ import java.util.Map; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; /** * A Connection links exactly two {@link Vertex} objects. The basis of a diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/graph/GraphExploreRequest.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/graph/GraphExploreRequest.java index f166396283760..15f189b6330fa 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/graph/GraphExploreRequest.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/graph/GraphExploreRequest.java @@ -16,8 +16,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.search.aggregations.bucket.sampler.SamplerAggregationBuilder; import org.elasticsearch.search.aggregations.bucket.terms.SignificantTerms; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/graph/GraphExploreResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/graph/GraphExploreResponse.java index 2d7894f96d7e1..2a058681bb68d 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/graph/GraphExploreResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/graph/GraphExploreResponse.java @@ -11,14 +11,14 @@ import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.ShardOperationFailedException; import org.elasticsearch.action.search.ShardSearchFailure; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.protocol.xpack.graph.Connection.ConnectionId; import org.elasticsearch.protocol.xpack.graph.Connection.UnresolvedConnection; import org.elasticsearch.protocol.xpack.graph.Vertex.VertexId; @@ -30,8 +30,8 @@ import java.util.Map; import static org.elasticsearch.action.search.ShardSearchFailure.readShardSearchFailure; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * Graph explore response holds a graph of {@link Vertex} and {@link Connection} objects diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/graph/Hop.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/graph/Hop.java index 249e44b8d4b30..4a5ac89f6c327 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/graph/Hop.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/graph/Hop.java @@ -10,8 +10,8 @@ import org.elasticsearch.action.ValidateActions; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilders; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/graph/Vertex.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/graph/Vertex.java index 798faec676f49..253bc708cf13c 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/graph/Vertex.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/graph/Vertex.java @@ -6,19 +6,19 @@ */ package org.elasticsearch.protocol.xpack.graph; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * A vertex in a graph response represents a single term (a field and value pair) diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/graph/VertexRequest.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/graph/VertexRequest.java index b58acdecf35ab..a5e19ead0a7e6 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/graph/VertexRequest.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/graph/VertexRequest.java @@ -8,8 +8,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.protocol.xpack.graph.GraphExploreRequest.TermBoost; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/license/PutLicenseResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/license/PutLicenseResponse.java index e8dc5c8521333..e0b57c2e08229 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/license/PutLicenseResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/license/PutLicenseResponse.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.protocol.xpack.common.ProtocolUtils; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/watcher/DeleteWatchResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/watcher/DeleteWatchResponse.java index 900b18a05e757..bc1eb4c8d1191 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/watcher/DeleteWatchResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/watcher/DeleteWatchResponse.java @@ -7,13 +7,13 @@ package org.elasticsearch.protocol.xpack.watcher; import org.elasticsearch.action.ActionResponse; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/watcher/PutWatchRequest.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/watcher/PutWatchRequest.java index 913fc4fe65a85..b6e9a079402e8 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/watcher/PutWatchRequest.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/watcher/PutWatchRequest.java @@ -14,7 +14,7 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.lucene.uid.Versions; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.seqno.SequenceNumbers; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/watcher/PutWatchResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/watcher/PutWatchResponse.java index ef43f117910b6..283b42fff54a0 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/watcher/PutWatchResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/watcher/PutWatchResponse.java @@ -7,13 +7,13 @@ package org.elasticsearch.protocol.xpack.watcher; import org.elasticsearch.action.ActionResponse; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.seqno.SequenceNumbers; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/cluster/action/MigrateToDataTiersRequest.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/cluster/action/MigrateToDataTiersRequest.java index 69d0e025c8c90..99ab103ca0cee 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/cluster/action/MigrateToDataTiersRequest.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/cluster/action/MigrateToDataTiersRequest.java @@ -11,9 +11,9 @@ import org.elasticsearch.action.support.master.AcknowledgedRequest; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.Nullable; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/cluster/action/MigrateToDataTiersResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/cluster/action/MigrateToDataTiersResponse.java index 79707794c77c7..f2c09498b8469 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/cluster/action/MigrateToDataTiersResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/cluster/action/MigrateToDataTiersResponse.java @@ -10,9 +10,9 @@ import org.elasticsearch.action.ActionResponse; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.core.Nullable; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/DataTiersFeatureSetUsage.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/DataTiersFeatureSetUsage.java index 151552ba222ac..6acbe58f81822 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/DataTiersFeatureSetUsage.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/DataTiersFeatureSetUsage.java @@ -13,8 +13,8 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Collections; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/XPackClientPlugin.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/XPackClientPlugin.java index 5a07d611acfc6..d3ea820889529 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/XPackClientPlugin.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/XPackClientPlugin.java @@ -11,11 +11,11 @@ import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.NamedDiff; import org.elasticsearch.cluster.metadata.Metadata; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.license.DeleteLicenseAction; import org.elasticsearch.license.GetBasicStatusAction; import org.elasticsearch.license.GetLicenseAction; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/XPackFeatureSet.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/XPackFeatureSet.java index 286f44eeb00ec..7593bc9af2902 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/XPackFeatureSet.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/XPackFeatureSet.java @@ -9,8 +9,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.VersionedNamedWriteable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/XPackPlugin.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/XPackPlugin.java index 30cf991994688..cb17171127a86 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/XPackPlugin.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/XPackPlugin.java @@ -34,7 +34,7 @@ import org.elasticsearch.common.settings.SettingsFilter; import org.elasticsearch.common.ssl.SslConfiguration; import org.elasticsearch.common.util.BigArrays; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.core.Booleans; import org.elasticsearch.env.Environment; import org.elasticsearch.env.NodeEnvironment; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/AbstractGetResourcesResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/AbstractGetResourcesResponse.java index 6a48bd2f84ce6..df53869537b4b 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/AbstractGetResourcesResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/AbstractGetResourcesResponse.java @@ -12,8 +12,8 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.xcontent.StatusToXContentObject; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.xpack.core.action.util.QueryPage; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/AbstractTransportGetResourcesAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/AbstractTransportGetResourcesAction.java index 6a1fea430dc16..990c5f5c40aed 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/AbstractTransportGetResourcesAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/AbstractTransportGetResourcesAction.java @@ -15,17 +15,17 @@ import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.client.Client; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.regex.Regex; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.query.BoolQueryBuilder; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilders; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/DataStreamsStatsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/DataStreamsStatsAction.java index ef7a56c830e5c..a1776ae6c5367 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/DataStreamsStatsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/DataStreamsStatsAction.java @@ -16,8 +16,8 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.store.StoreStats; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/GetDataStreamAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/GetDataStreamAction.java index 317a062be1e25..d774c74dd0ca3 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/GetDataStreamAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/GetDataStreamAction.java @@ -16,11 +16,11 @@ import org.elasticsearch.cluster.health.ClusterHealthStatus; import org.elasticsearch.cluster.metadata.DataStream; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Arrays; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/ReloadAnalyzersResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/ReloadAnalyzersResponse.java index 654aac16ccbe2..b0705b41ed3ec 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/ReloadAnalyzersResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/ReloadAnalyzersResponse.java @@ -8,13 +8,13 @@ import org.elasticsearch.action.support.DefaultShardOperationFailedException; import org.elasticsearch.action.support.broadcast.BroadcastResponse; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.action.TransportReloadAnalyzersAction.ReloadResult; import java.io.IOException; @@ -27,7 +27,7 @@ import java.util.Objects; import java.util.Set; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; /** * The response object that will be returned when reloading analyzers diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/SetResetModeActionRequest.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/SetResetModeActionRequest.java index a7b263f34c7b4..84a6ae049dbe0 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/SetResetModeActionRequest.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/SetResetModeActionRequest.java @@ -9,13 +9,13 @@ import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.support.master.AcknowledgedRequest; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/util/PageParams.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/util/PageParams.java index ade1996fb891c..cf1113955c4df 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/util/PageParams.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/util/PageParams.java @@ -6,13 +6,13 @@ */ package org.elasticsearch.xpack.core.action.util; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/util/QueryPage.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/util/QueryPage.java index 95bf38fec9425..59cec62ad253f 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/util/QueryPage.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/util/QueryPage.java @@ -7,13 +7,13 @@ package org.elasticsearch.xpack.core.action.util; import org.elasticsearch.ResourceNotFoundException; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.List; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/analytics/AnalyticsFeatureSetUsage.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/analytics/AnalyticsFeatureSetUsage.java index 14d2af03b12df..1593e5d548211 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/analytics/AnalyticsFeatureSetUsage.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/analytics/AnalyticsFeatureSetUsage.java @@ -10,7 +10,7 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.XPackFeatureSet; import org.elasticsearch.xpack.core.XPackField; import org.elasticsearch.xpack.core.analytics.action.AnalyticsStatsAction; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/analytics/action/AnalyticsStatsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/analytics/action/AnalyticsStatsAction.java index 7d3ec85878f1b..2237ea003c306 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/analytics/action/AnalyticsStatsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/analytics/action/AnalyticsStatsAction.java @@ -17,8 +17,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.transport.TransportRequest; import org.elasticsearch.xpack.core.common.stats.EnumCounters; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/async/AsyncTaskIndexService.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/async/AsyncTaskIndexService.java index 3360d42772c50..e564c1d902bd7 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/async/AsyncTaskIndexService.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/async/AsyncTaskIndexService.java @@ -39,14 +39,14 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.BigArrays; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParserUtils; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.engine.DocumentMissingException; import org.elasticsearch.index.engine.VersionConflictEngineException; import org.elasticsearch.indices.SystemIndexDescriptor; @@ -73,7 +73,7 @@ import java.util.Objects; import java.util.function.Function; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.common.xcontent.XContentParserUtils.ensureExpectedToken; import static org.elasticsearch.index.mapper.MapperService.SINGLE_MAPPING_NAME; import static org.elasticsearch.search.SearchService.MAX_ASYNC_SEARCH_RESPONSE_SIZE_SETTING; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/async/StoredAsyncResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/async/StoredAsyncResponse.java index 3d7cca850e4da..916abaf87278e 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/async/StoredAsyncResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/async/StoredAsyncResponse.java @@ -11,8 +11,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/AutoFollowMetadata.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/AutoFollowMetadata.java index 912c145854748..a9e8c5f32e0cb 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/AutoFollowMetadata.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/AutoFollowMetadata.java @@ -11,17 +11,17 @@ import org.elasticsearch.cluster.AbstractNamedDiffable; import org.elasticsearch.cluster.metadata.IndexAbstraction; import org.elasticsearch.cluster.metadata.Metadata; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.regex.Regex; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ccr.action.ImmutableFollowParameters; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/AutoFollowStats.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/AutoFollowStats.java index 10e6632531749..ac9497776a89a 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/AutoFollowStats.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/AutoFollowStats.java @@ -7,15 +7,15 @@ package org.elasticsearch.xpack.core.ccr; import org.elasticsearch.ElasticsearchException; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.Tuple; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.AbstractMap; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/ShardFollowNodeTaskStatus.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/ShardFollowNodeTaskStatus.java index dbece3fd0edce..fecac75ff1e96 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/ShardFollowNodeTaskStatus.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/ShardFollowNodeTaskStatus.java @@ -15,10 +15,10 @@ import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.common.util.Maps; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.TimeValue; import org.elasticsearch.core.Tuple; import org.elasticsearch.tasks.Task; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/action/CcrStatsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/action/CcrStatsAction.java index bec7fde89c55f..5a5a1ca20b7d0 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/action/CcrStatsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/action/CcrStatsAction.java @@ -13,8 +13,8 @@ import org.elasticsearch.action.support.master.MasterNodeRequest; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ccr.AutoFollowStats; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/action/FollowInfoAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/action/FollowInfoAction.java index 644935a211203..627c2730185b7 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/action/FollowInfoAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/action/FollowInfoAction.java @@ -10,13 +10,13 @@ import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.support.master.MasterNodeReadRequest; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Arrays; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/action/FollowParameters.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/action/FollowParameters.java index dc1506a14a38f..efa670de62fdb 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/action/FollowParameters.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/action/FollowParameters.java @@ -7,16 +7,16 @@ package org.elasticsearch.xpack.core.ccr.action; import org.elasticsearch.action.ActionRequestValidationException; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.AbstractObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.AbstractObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/action/FollowStatsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/action/FollowStatsAction.java index d26e96734302f..aa68cbde2be6d 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/action/FollowStatsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/action/FollowStatsAction.java @@ -18,8 +18,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.tasks.Task; import org.elasticsearch.xpack.core.ccr.ShardFollowNodeTaskStatus; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/action/ForgetFollowerAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/action/ForgetFollowerAction.java index 78d9e597a551f..c62ee935bc2fa 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/action/ForgetFollowerAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/action/ForgetFollowerAction.java @@ -11,11 +11,11 @@ import org.elasticsearch.action.ActionType; import org.elasticsearch.action.support.broadcast.BroadcastRequest; import org.elasticsearch.action.support.broadcast.BroadcastResponse; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/action/GetAutoFollowPatternAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/action/GetAutoFollowPatternAction.java index daa50fc76c303..b366c3b8e515b 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/action/GetAutoFollowPatternAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/action/GetAutoFollowPatternAction.java @@ -13,8 +13,8 @@ import org.elasticsearch.action.support.master.MasterNodeReadRequest; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ccr.AutoFollowMetadata.AutoFollowPattern; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/action/ImmutableFollowParameters.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/action/ImmutableFollowParameters.java index 517d1d4352bc8..c93023188bc6a 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/action/ImmutableFollowParameters.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/action/ImmutableFollowParameters.java @@ -11,9 +11,9 @@ import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/action/PutAutoFollowPatternAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/action/PutAutoFollowPatternAction.java index 94e8096351604..73aef1e5c3a98 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/action/PutAutoFollowPatternAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/action/PutAutoFollowPatternAction.java @@ -14,10 +14,10 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ccr.AutoFollowMetadata.AutoFollowPattern; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/action/PutFollowAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/action/PutFollowAction.java index c9fa724da630a..de6742e345b95 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/action/PutFollowAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/action/PutFollowAction.java @@ -15,14 +15,14 @@ import org.elasticsearch.action.support.ActiveShardCount; import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.master.AcknowledgedRequest; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/action/ResumeFollowAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/action/ResumeFollowAction.java index 1992054d605e5..0a6a1422be09e 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/action/ResumeFollowAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/action/ResumeFollowAction.java @@ -13,10 +13,10 @@ import org.elasticsearch.action.support.master.MasterNodeRequest; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/action/ShardFollowTask.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/action/ShardFollowTask.java index d757716c4bf27..90bd9e8d25e28 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/action/ShardFollowTask.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/action/ShardFollowTask.java @@ -8,15 +8,15 @@ package org.elasticsearch.xpack.core.ccr.action; import org.elasticsearch.Version; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.persistent.PersistentTaskParams; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/common/notifications/AbstractAuditMessage.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/common/notifications/AbstractAuditMessage.java index 7ea428a868931..52ac4a1aaf04e 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/common/notifications/AbstractAuditMessage.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/common/notifications/AbstractAuditMessage.java @@ -6,20 +6,20 @@ */ package org.elasticsearch.xpack.core.common.notifications; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.common.time.TimeUtils; import java.io.IOException; import java.util.Date; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public abstract class AbstractAuditMessage implements ToXContentObject { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/common/notifications/AbstractAuditor.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/common/notifications/AbstractAuditor.java index fc5a58654ddda..9f6af80e15d40 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/common/notifications/AbstractAuditor.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/common/notifications/AbstractAuditor.java @@ -20,12 +20,12 @@ import org.elasticsearch.cluster.metadata.ComposableIndexTemplate; import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.xpack.core.ml.utils.MlIndexAndAlias; import org.elasticsearch.xpack.core.template.IndexTemplateConfig; @@ -37,7 +37,7 @@ import java.util.concurrent.atomic.AtomicBoolean; import java.util.function.Supplier; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; public abstract class AbstractAuditor { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/common/time/TimeUtils.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/common/time/TimeUtils.java index 115f25e3c6ac5..cea209a711b2a 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/common/time/TimeUtils.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/common/time/TimeUtils.java @@ -7,9 +7,9 @@ package org.elasticsearch.xpack.core.common.time; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.mapper.DateFieldMapper; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/datastreams/DataStreamFeatureSetUsage.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/datastreams/DataStreamFeatureSetUsage.java index ddd88687492a8..beaf576498453 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/datastreams/DataStreamFeatureSetUsage.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/datastreams/DataStreamFeatureSetUsage.java @@ -12,7 +12,7 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.XPackFeatureSet; import org.elasticsearch.xpack.core.XPackField; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/deprecation/DeprecationIssue.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/deprecation/DeprecationIssue.java index 56ac3ab35a09e..45cc4c975beb3 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/deprecation/DeprecationIssue.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/deprecation/DeprecationIssue.java @@ -10,8 +10,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.core.Nullable; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/deprecation/LoggingDeprecationAccumulationHandler.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/deprecation/LoggingDeprecationAccumulationHandler.java index 4002b1de46386..a4e2f3a3caa5a 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/deprecation/LoggingDeprecationAccumulationHandler.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/deprecation/LoggingDeprecationAccumulationHandler.java @@ -7,9 +7,9 @@ package org.elasticsearch.xpack.core.deprecation; import org.elasticsearch.common.logging.LoggerMessageFormat; -import org.elasticsearch.common.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.DeprecationHandler; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.XContentLocation; +import org.elasticsearch.xcontent.XContentLocation; import java.util.ArrayList; import java.util.Collections; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/EnrichPolicy.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/EnrichPolicy.java index ade5ff69eae4e..033192fcfdc93 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/EnrichPolicy.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/EnrichPolicy.java @@ -7,21 +7,21 @@ package org.elasticsearch.xpack.core.enrich; import org.elasticsearch.Version; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentParser.Token; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser.Token; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.util.List; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/action/EnrichStatsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/action/EnrichStatsAction.java index a79247f241bac..6691de4cff7a2 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/action/EnrichStatsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/action/EnrichStatsAction.java @@ -14,9 +14,9 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.tasks.TaskInfo; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/action/ExecuteEnrichPolicyAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/action/ExecuteEnrichPolicyAction.java index dd14d96959d1e..6110c220840c1 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/action/ExecuteEnrichPolicyAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/action/ExecuteEnrichPolicyAction.java @@ -12,8 +12,8 @@ import org.elasticsearch.action.support.master.MasterNodeRequest; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.tasks.TaskId; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/action/ExecuteEnrichPolicyStatus.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/action/ExecuteEnrichPolicyStatus.java index 92740f9f249f3..8dbcd4b6ba3a4 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/action/ExecuteEnrichPolicyStatus.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/action/ExecuteEnrichPolicyStatus.java @@ -11,7 +11,7 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.tasks.Task; public class ExecuteEnrichPolicyStatus implements Task.Status { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/action/GetEnrichPolicyAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/action/GetEnrichPolicyAction.java index d79c4405d7332..f891a112e1d3e 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/action/GetEnrichPolicyAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/action/GetEnrichPolicyAction.java @@ -12,8 +12,8 @@ import org.elasticsearch.action.support.master.MasterNodeReadRequest; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.enrich.EnrichPolicy; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/action/PutEnrichPolicyAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/action/PutEnrichPolicyAction.java index d57ac381f55af..5edd6b8b47e49 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/action/PutEnrichPolicyAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/action/PutEnrichPolicyAction.java @@ -13,7 +13,7 @@ import org.elasticsearch.action.support.master.MasterNodeRequest; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.enrich.EnrichPolicy; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/eql/EqlFeatureSetUsage.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/eql/EqlFeatureSetUsage.java index 347c41e0fac95..74639175085d7 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/eql/EqlFeatureSetUsage.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/eql/EqlFeatureSetUsage.java @@ -10,7 +10,7 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.XPackFeatureSet; import org.elasticsearch.xpack.core.XPackField; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/frozen/FrozenIndicesFeatureSetUsage.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/frozen/FrozenIndicesFeatureSetUsage.java index ade51652b9552..a6603cd8c91c0 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/frozen/FrozenIndicesFeatureSetUsage.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/frozen/FrozenIndicesFeatureSetUsage.java @@ -9,7 +9,7 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.XPackFeatureSet; import org.elasticsearch.xpack.core.XPackField; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/AllocateAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/AllocateAction.java index 1472197b8136e..249d346c522f8 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/AllocateAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/AllocateAction.java @@ -10,14 +10,14 @@ import org.elasticsearch.client.Client; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.cluster.routing.allocation.decider.ShardsLimitAllocationDecider; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ilm.Step.StepKey; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/AsyncWaitStep.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/AsyncWaitStep.java index e12f4c671ad25..658335aef1224 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/AsyncWaitStep.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/AsyncWaitStep.java @@ -9,7 +9,7 @@ import org.elasticsearch.client.Client; import org.elasticsearch.cluster.metadata.Metadata; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.ToXContentObject; import org.elasticsearch.index.Index; /** diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/CheckNotDataStreamWriteIndexStep.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/CheckNotDataStreamWriteIndexStep.java index e160126be6d54..81e0a6d1393a8 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/CheckNotDataStreamWriteIndexStep.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/CheckNotDataStreamWriteIndexStep.java @@ -12,9 +12,9 @@ import org.elasticsearch.cluster.metadata.IndexAbstraction; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.cluster.metadata.Metadata; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.Index; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/CheckShrinkReadyStep.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/CheckShrinkReadyStep.java index e77396b3e3f9f..5d6efa39d6865 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/CheckShrinkReadyStep.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/CheckShrinkReadyStep.java @@ -16,11 +16,11 @@ import org.elasticsearch.cluster.routing.IndexRoutingTable; import org.elasticsearch.cluster.routing.ShardRouting; import org.elasticsearch.cluster.routing.ShardRoutingState; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.Index; import org.elasticsearch.xpack.core.ilm.step.info.SingleMessageFieldInfo; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/ClusterStateWaitStep.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/ClusterStateWaitStep.java index e6e95d1110a7f..36b37c73fe19e 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/ClusterStateWaitStep.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/ClusterStateWaitStep.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ilm; import org.elasticsearch.cluster.ClusterState; -import org.elasticsearch.common.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.ToXContentObject; import org.elasticsearch.index.Index; /** diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/DeleteAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/DeleteAction.java index 2f6f4b11b1a02..e0c18f6fd46bc 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/DeleteAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/DeleteAction.java @@ -7,13 +7,13 @@ package org.elasticsearch.xpack.core.ilm; import org.elasticsearch.client.Client; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Arrays; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/ExplainLifecycleResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/ExplainLifecycleResponse.java index ac9018ef672ab..ac70c24d721aa 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/ExplainLifecycleResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/ExplainLifecycleResponse.java @@ -8,14 +8,14 @@ package org.elasticsearch.xpack.core.ilm; import org.elasticsearch.action.ActionResponse; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.HashMap; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/ForceMergeAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/ForceMergeAction.java index e4d15ef6a15e3..a34f22fe6918d 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/ForceMergeAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/ForceMergeAction.java @@ -12,14 +12,14 @@ import org.elasticsearch.cluster.health.ClusterHealthStatus; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.codec.CodecService; import org.elasticsearch.index.engine.EngineConfig; import org.elasticsearch.xpack.core.ilm.Step.StepKey; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/FreezeAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/FreezeAction.java index ca0b5ec06ea76..f5bc8b8d6fb24 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/FreezeAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/FreezeAction.java @@ -13,9 +13,9 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ilm.Step.StepKey; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/IndexLifecycleExplainResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/IndexLifecycleExplainResponse.java index cd67d2f331d03..f55e5c36f57b3 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/IndexLifecycleExplainResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/IndexLifecycleExplainResponse.java @@ -7,18 +7,18 @@ package org.elasticsearch.xpack.core.ilm; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import java.io.IOException; import java.util.Objects; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/IndexLifecycleFeatureSetUsage.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/IndexLifecycleFeatureSetUsage.java index ee118827932ca..506f34ae0a91e 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/IndexLifecycleFeatureSetUsage.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/IndexLifecycleFeatureSetUsage.java @@ -12,9 +12,9 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.core.TimeValue; import org.elasticsearch.xpack.core.XPackFeatureSet; import org.elasticsearch.xpack.core.XPackField; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/IndexLifecycleMetadata.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/IndexLifecycleMetadata.java index fa3f2efe0de21..d9f2c6051eab0 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/IndexLifecycleMetadata.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/IndexLifecycleMetadata.java @@ -13,12 +13,12 @@ import org.elasticsearch.cluster.NamedDiff; import org.elasticsearch.cluster.metadata.Metadata; import org.elasticsearch.cluster.metadata.Metadata.Custom; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Collections; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/LifecycleAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/LifecycleAction.java index 153887d40c84a..35d26fa36eb15 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/LifecycleAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/LifecycleAction.java @@ -9,7 +9,7 @@ import org.elasticsearch.client.Client; import org.elasticsearch.core.Nullable; import org.elasticsearch.common.io.stream.NamedWriteable; -import org.elasticsearch.common.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.ToXContentObject; import org.elasticsearch.license.XPackLicenseState; import java.util.List; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/LifecyclePolicy.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/LifecyclePolicy.java index 5ba80505ac911..e56f7ddf77680 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/LifecyclePolicy.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/LifecyclePolicy.java @@ -12,11 +12,11 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.Nullable; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.xpack.core.ilm.Step.StepKey; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/LifecyclePolicyMetadata.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/LifecyclePolicyMetadata.java index 407bca34b68ad..ba57b30c3dd8e 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/LifecyclePolicyMetadata.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/LifecyclePolicyMetadata.java @@ -9,14 +9,14 @@ import org.elasticsearch.cluster.AbstractDiffable; import org.elasticsearch.cluster.Diffable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.time.Instant; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/LifecyclePolicyUtils.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/LifecyclePolicyUtils.java index 3070dfa719b04..e867288874802 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/LifecyclePolicyUtils.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/LifecyclePolicyUtils.java @@ -18,10 +18,10 @@ import org.elasticsearch.common.compress.NotXContentException; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.internal.io.Streams; import java.io.ByteArrayOutputStream; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/MigrateAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/MigrateAction.java index 8d629ee08ae90..4765d26c773ef 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/MigrateAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/MigrateAction.java @@ -13,10 +13,10 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.snapshots.SearchableSnapshotsSettings; import org.elasticsearch.cluster.routing.allocation.DataTier; import org.elasticsearch.xpack.core.ilm.Step.StepKey; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/Phase.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/Phase.java index faadc712218cb..57af96005ac9a 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/Phase.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/Phase.java @@ -9,18 +9,18 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.elasticsearch.Version; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ContextParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ContextParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.List; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/PhaseCacheManagement.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/PhaseCacheManagement.java index cd085e736f7b6..984311aa23d00 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/PhaseCacheManagement.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/PhaseCacheManagement.java @@ -15,10 +15,10 @@ import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.cluster.metadata.Metadata; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.core.Nullable; import org.elasticsearch.license.XPackLicenseState; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/PhaseExecutionInfo.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/PhaseExecutionInfo.java index 557465863df99..e96913d6fc513 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/PhaseExecutionInfo.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/PhaseExecutionInfo.java @@ -7,15 +7,15 @@ package org.elasticsearch.xpack.core.ilm; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/ReadOnlyAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/ReadOnlyAction.java index b3509baf3d6a9..2f63fb3605fde 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/ReadOnlyAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/ReadOnlyAction.java @@ -10,9 +10,9 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ilm.Step.StepKey; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/RolloverAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/RolloverAction.java index 0ffb6b239b93f..f9b151361b091 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/RolloverAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/RolloverAction.java @@ -8,7 +8,7 @@ import org.elasticsearch.client.Client; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; @@ -16,10 +16,10 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ilm.Step.StepKey; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/RollupILMAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/RollupILMAction.java index 6475665c39d19..db1cc7350d51c 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/RollupILMAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/RollupILMAction.java @@ -8,14 +8,14 @@ import org.elasticsearch.client.Client; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ilm.Step.StepKey; import org.elasticsearch.xpack.core.rollup.RollupActionConfig; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/SearchableSnapshotAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/SearchableSnapshotAction.java index ab04e00b93da5..2af137341218d 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/SearchableSnapshotAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/SearchableSnapshotAction.java @@ -15,10 +15,10 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.license.LicenseUtils; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.xpack.core.ilm.Step.StepKey; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/SegmentCountStep.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/SegmentCountStep.java index 8bb178ac60689..d749b5a22ec61 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/SegmentCountStep.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/SegmentCountStep.java @@ -16,12 +16,12 @@ import org.elasticsearch.client.Client; import org.elasticsearch.cluster.metadata.Metadata; import org.elasticsearch.cluster.routing.ShardRouting; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.Index; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/SetPriorityAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/SetPriorityAction.java index e7049b1a6d975..361f5e763daef 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/SetPriorityAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/SetPriorityAction.java @@ -9,15 +9,15 @@ import org.elasticsearch.client.Client; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ilm.Step.StepKey; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/ShrinkAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/ShrinkAction.java index 172998b97ab44..d743b1a8bf35f 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/ShrinkAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/ShrinkAction.java @@ -12,15 +12,15 @@ import org.elasticsearch.cluster.metadata.IndexAbstraction; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ilm.Step.StepKey; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/ShrunkShardsAllocatedStep.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/ShrunkShardsAllocatedStep.java index f153c2b6606a0..0654959bc01c2 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/ShrunkShardsAllocatedStep.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/ShrunkShardsAllocatedStep.java @@ -11,11 +11,11 @@ import org.elasticsearch.action.support.ActiveShardCount; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.metadata.IndexMetadata; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.Index; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/ShrunkenIndexCheckStep.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/ShrunkenIndexCheckStep.java index a0cdfcd76d445..22ec03a0e4fb8 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/ShrunkenIndexCheckStep.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/ShrunkenIndexCheckStep.java @@ -10,11 +10,11 @@ import org.apache.logging.log4j.Logger; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.metadata.IndexMetadata; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.Index; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/Step.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/Step.java index c4d7a60a431ec..9d7906d91f899 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/Step.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/Step.java @@ -6,15 +6,15 @@ */ package org.elasticsearch.xpack.core.ilm; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/UnfollowAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/UnfollowAction.java index a09926aa07527..95122bb48d1e0 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/UnfollowAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/UnfollowAction.java @@ -12,9 +12,9 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ilm.Step.StepKey; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/WaitForActiveShardsStep.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/WaitForActiveShardsStep.java index 7f7f5b09b308b..ddb748b40f04d 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/WaitForActiveShardsStep.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/WaitForActiveShardsStep.java @@ -17,10 +17,10 @@ import org.elasticsearch.cluster.metadata.Metadata; import org.elasticsearch.cluster.routing.IndexRoutingTable; import org.elasticsearch.cluster.routing.IndexShardRoutingTable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.Index; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/WaitForFollowShardTasksStep.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/WaitForFollowShardTasksStep.java index 85860ff41ee78..48c8771f43387 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/WaitForFollowShardTasksStep.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/WaitForFollowShardTasksStep.java @@ -10,11 +10,11 @@ import org.elasticsearch.client.Client; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.cluster.metadata.Metadata; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.Index; import org.elasticsearch.xpack.core.ccr.ShardFollowNodeTaskStatus; import org.elasticsearch.xpack.core.ccr.action.FollowStatsAction; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/WaitForIndexColorStep.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/WaitForIndexColorStep.java index 4ae90c91c885e..780cc6ec09823 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/WaitForIndexColorStep.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/WaitForIndexColorStep.java @@ -17,9 +17,9 @@ import org.elasticsearch.cluster.routing.IndexShardRoutingTable; import org.elasticsearch.cluster.routing.ShardRouting; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.Index; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/WaitForIndexingCompleteStep.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/WaitForIndexingCompleteStep.java index ede928fde7954..2e0f938cb4ea9 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/WaitForIndexingCompleteStep.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/WaitForIndexingCompleteStep.java @@ -10,9 +10,9 @@ import org.apache.logging.log4j.Logger; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.metadata.IndexMetadata; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.Index; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/WaitForNoFollowersStep.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/WaitForNoFollowersStep.java index baaf4e2c7031b..dc4ed0ee8dafc 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/WaitForNoFollowersStep.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/WaitForNoFollowersStep.java @@ -15,10 +15,10 @@ import org.elasticsearch.action.admin.indices.stats.ShardStats; import org.elasticsearch.client.Client; import org.elasticsearch.cluster.metadata.Metadata; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.Index; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/WaitForRolloverReadyStep.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/WaitForRolloverReadyStep.java index 91e51888c7431..3bc33a82f8882 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/WaitForRolloverReadyStep.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/WaitForRolloverReadyStep.java @@ -18,8 +18,8 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.Index; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/WaitForSnapshotAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/WaitForSnapshotAction.java index 1196c0ef7dc0f..2c898b55799ab 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/WaitForSnapshotAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/WaitForSnapshotAction.java @@ -7,13 +7,13 @@ package org.elasticsearch.xpack.core.ilm; import org.elasticsearch.client.Client; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ilm.Step.StepKey; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/WaitForSnapshotStep.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/WaitForSnapshotStep.java index 563e0f614ab8d..9ba605a8ce3b6 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/WaitForSnapshotStep.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/WaitForSnapshotStep.java @@ -10,7 +10,7 @@ import org.apache.logging.log4j.Logger; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.metadata.IndexMetadata; -import org.elasticsearch.common.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.ToXContentObject; import org.elasticsearch.index.Index; import org.elasticsearch.xpack.core.slm.SnapshotLifecycleMetadata; import org.elasticsearch.xpack.core.slm.SnapshotLifecyclePolicyMetadata; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/action/DeleteLifecycleAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/action/DeleteLifecycleAction.java index d55b2217d3579..0bb605edb7883 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/action/DeleteLifecycleAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/action/DeleteLifecycleAction.java @@ -11,7 +11,7 @@ import org.elasticsearch.action.ActionType; import org.elasticsearch.action.support.master.AcknowledgedRequest; import org.elasticsearch.action.support.master.AcknowledgedResponse; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/action/GetLifecycleAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/action/GetLifecycleAction.java index e8de1905af238..8cf6d2de1030d 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/action/GetLifecycleAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/action/GetLifecycleAction.java @@ -16,8 +16,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ilm.LifecyclePolicy; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/action/GetStatusAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/action/GetStatusAction.java index 025cf87b67d05..66f40b84b2876 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/action/GetStatusAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/action/GetStatusAction.java @@ -14,8 +14,8 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ilm.OperationMode; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/action/MoveToStepAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/action/MoveToStepAction.java index 6a0ad231ab345..f0d08b4805938 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/action/MoveToStepAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/action/MoveToStepAction.java @@ -15,11 +15,11 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.Nullable; import org.elasticsearch.xpack.core.ilm.Step.StepKey; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/action/PutLifecycleAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/action/PutLifecycleAction.java index abc09831e97d8..8bd3362f7e094 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/action/PutLifecycleAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/action/PutLifecycleAction.java @@ -10,14 +10,14 @@ import org.elasticsearch.action.ActionType; import org.elasticsearch.action.support.master.AcknowledgedRequest; import org.elasticsearch.action.support.master.AcknowledgedResponse; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ilm.LifecyclePolicy; import org.elasticsearch.xpack.core.ilm.TimeseriesLifecycleType; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/action/RemoveIndexLifecyclePolicyAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/action/RemoveIndexLifecyclePolicyAction.java index e9987b2dff8aa..e65a998b06a43 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/action/RemoveIndexLifecyclePolicyAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/action/RemoveIndexLifecyclePolicyAction.java @@ -13,12 +13,12 @@ import org.elasticsearch.action.ActionType; import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.master.AcknowledgedRequest; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Arrays; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/step/info/AllocationInfo.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/step/info/AllocationInfo.java index da1b10d393828..77bd83de2e018 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/step/info/AllocationInfo.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/step/info/AllocationInfo.java @@ -7,18 +7,18 @@ package org.elasticsearch.xpack.core.ilm.step.info; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; /** * Represents the state of an index's shards allocation, including a user friendly message describing the current state. - * It allows to transfer the allocation information to {@link org.elasticsearch.common.xcontent.XContent} using + * It allows to transfer the allocation information to {@link org.elasticsearch.xcontent.XContent} using * {@link #toXContent(XContentBuilder, Params)} */ public class AllocationInfo implements ToXContentObject { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/step/info/SingleMessageFieldInfo.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/step/info/SingleMessageFieldInfo.java index f4e4a43f72fd3..8d7eb8c3d303b 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/step/info/SingleMessageFieldInfo.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/step/info/SingleMessageFieldInfo.java @@ -7,9 +7,9 @@ package org.elasticsearch.xpack.core.ilm.step.info; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/index/query/PinnedQueryBuilder.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/index/query/PinnedQueryBuilder.java index 708a9b34471d1..eb09b99cdd51f 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/index/query/PinnedQueryBuilder.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/index/query/PinnedQueryBuilder.java @@ -9,10 +9,10 @@ import org.apache.lucene.search.Query; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.regex.Regex; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.query.AbstractQueryBuilder; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.SearchExecutionContext; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/indexing/IndexerJobStats.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/indexing/IndexerJobStats.java index 0bb60c9483c94..fff4474d98f3e 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/indexing/IndexerJobStats.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/indexing/IndexerJobStats.java @@ -7,11 +7,11 @@ package org.elasticsearch.xpack.core.indexing; import org.elasticsearch.Version; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.ToXContentObject; import java.io.IOException; import java.util.Objects; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/indexing/IndexerState.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/indexing/IndexerState.java index 8d6fac95e1aea..740123faa326f 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/indexing/IndexerState.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/indexing/IndexerState.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.core.indexing; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/MachineLearningFeatureSetUsage.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/MachineLearningFeatureSetUsage.java index 8319d66fcfbc4..c2e40246451e1 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/MachineLearningFeatureSetUsage.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/MachineLearningFeatureSetUsage.java @@ -9,7 +9,7 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.XPackFeatureSet; import org.elasticsearch.xpack.core.XPackField; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/MlMetadata.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/MlMetadata.java index 073918861c9cd..2a0f6d3d02bb8 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/MlMetadata.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/MlMetadata.java @@ -14,15 +14,15 @@ import org.elasticsearch.cluster.NamedDiff; import org.elasticsearch.cluster.metadata.Metadata; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ml.datafeed.DatafeedConfig; import org.elasticsearch.xpack.core.ml.datafeed.DatafeedJobValidator; import org.elasticsearch.xpack.core.ml.job.config.Job; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/CloseJobAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/CloseJobAction.java index 5aac76d759caf..7e9910a782e8c 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/CloseJobAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/CloseJobAction.java @@ -9,15 +9,15 @@ import org.elasticsearch.action.ActionType; import org.elasticsearch.action.support.tasks.BaseTasksRequest; import org.elasticsearch.action.support.tasks.BaseTasksResponse; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.tasks.Task; import org.elasticsearch.xpack.core.ml.MachineLearningField; import org.elasticsearch.xpack.core.ml.job.config.Job; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/CreateTrainedModelAllocationAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/CreateTrainedModelAllocationAction.java index ccf567e76a559..9ac6c6b5e4a31 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/CreateTrainedModelAllocationAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/CreateTrainedModelAllocationAction.java @@ -13,11 +13,11 @@ import org.elasticsearch.action.support.master.MasterNodeRequest; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.inference.allocation.TrainedModelAllocation; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteDataFrameAnalyticsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteDataFrameAnalyticsAction.java index f1c3822ddf989..90469e580f82d 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteDataFrameAnalyticsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteDataFrameAnalyticsAction.java @@ -10,7 +10,7 @@ import org.elasticsearch.action.ActionType; import org.elasticsearch.action.support.master.AcknowledgedRequest; import org.elasticsearch.action.support.master.AcknowledgedResponse; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.core.TimeValue; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteDatafeedAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteDatafeedAction.java index 82767c8bfeccf..40f8e6821efda 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteDatafeedAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteDatafeedAction.java @@ -10,11 +10,11 @@ import org.elasticsearch.action.ActionType; import org.elasticsearch.action.support.master.AcknowledgedRequest; import org.elasticsearch.action.support.master.AcknowledgedResponse; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ml.datafeed.DatafeedConfig; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteExpiredDataAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteExpiredDataAction.java index 0c015af361fa5..20a72d251c92c 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteExpiredDataAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteExpiredDataAction.java @@ -10,14 +10,14 @@ import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.ActionType; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.job.config.Job; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteFilterAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteFilterAction.java index 9fafad7ec29ad..2214a3f5bea2c 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteFilterAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteFilterAction.java @@ -10,7 +10,7 @@ import org.elasticsearch.action.ActionType; import org.elasticsearch.action.support.master.AcknowledgedRequest; import org.elasticsearch.action.support.master.AcknowledgedResponse; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteTrainedModelAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteTrainedModelAction.java index f88b573c38576..d360f6f80edea 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteTrainedModelAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteTrainedModelAction.java @@ -12,8 +12,8 @@ import org.elasticsearch.action.support.master.AcknowledgedResponse; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ml.inference.TrainedModelConfig; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/EstimateModelMemoryAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/EstimateModelMemoryAction.java index acc73d20782da..37d325831a841 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/EstimateModelMemoryAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/EstimateModelMemoryAction.java @@ -10,14 +10,14 @@ import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.ActionType; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.job.config.AnalysisConfig; import org.elasticsearch.xpack.core.ml.job.config.Job; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/EvaluateDataFrameAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/EvaluateDataFrameAction.java index 3839ca77122a9..9b8eb2ed3588d 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/EvaluateDataFrameAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/EvaluateDataFrameAction.java @@ -11,14 +11,14 @@ import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.ActionType; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParserUtils; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.xpack.core.ml.dataframe.evaluation.Evaluation; @@ -33,8 +33,8 @@ import java.util.Objects; import java.util.Optional; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class EvaluateDataFrameAction extends ActionType { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/ExplainDataFrameAnalyticsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/ExplainDataFrameAnalyticsAction.java index 15cefb9e91211..697f02860ef3c 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/ExplainDataFrameAnalyticsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/ExplainDataFrameAnalyticsAction.java @@ -8,12 +8,12 @@ import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.ActionType; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ml.dataframe.explain.FieldSelection; import org.elasticsearch.xpack.core.ml.dataframe.explain.MemoryEstimation; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/FlushJobAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/FlushJobAction.java index f5e80cd559865..48c7bfac9314f 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/FlushJobAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/FlushJobAction.java @@ -9,14 +9,14 @@ import org.elasticsearch.action.ActionType; import org.elasticsearch.action.support.tasks.BaseTasksResponse; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.job.config.Job; import org.elasticsearch.xpack.core.ml.job.process.autodetect.output.FlushAcknowledgement; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/ForecastJobAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/ForecastJobAction.java index 53d8dc094f9c0..548828a071235 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/ForecastJobAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/ForecastJobAction.java @@ -8,17 +8,17 @@ import org.elasticsearch.action.ActionType; import org.elasticsearch.action.support.tasks.BaseTasksResponse; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.job.config.Job; import org.elasticsearch.xpack.core.ml.job.results.Forecast; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetBucketsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetBucketsAction.java index 3ad8265909bf8..fad3eafc2a802 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetBucketsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetBucketsAction.java @@ -9,13 +9,13 @@ import org.elasticsearch.action.ActionRequest; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionType; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.action.AbstractGetResourcesResponse; import org.elasticsearch.xpack.core.action.util.PageParams; import org.elasticsearch.xpack.core.action.util.QueryPage; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetCalendarEventsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetCalendarEventsAction.java index b668d6deddf4e..ef9355b026c88 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetCalendarEventsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetCalendarEventsAction.java @@ -10,14 +10,14 @@ import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionType; import org.elasticsearch.action.ValidateActions; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.action.AbstractGetResourcesResponse; import org.elasticsearch.xpack.core.action.util.PageParams; import org.elasticsearch.xpack.core.action.util.QueryPage; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetCalendarsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetCalendarsAction.java index 920ac831f3ed6..b189141e77ac7 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetCalendarsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetCalendarsAction.java @@ -11,11 +11,11 @@ import org.elasticsearch.action.ActionType; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ObjectParser; import org.elasticsearch.common.xcontent.StatusToXContentObject; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.xpack.core.action.AbstractGetResourcesResponse; import org.elasticsearch.xpack.core.action.util.PageParams; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetCategoriesAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetCategoriesAction.java index 6990773331f6d..1f808613de057 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetCategoriesAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetCategoriesAction.java @@ -9,13 +9,13 @@ import org.elasticsearch.action.ActionRequest; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionType; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.action.AbstractGetResourcesResponse; import org.elasticsearch.xpack.core.action.util.PageParams; import org.elasticsearch.xpack.core.action.util.QueryPage; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetDataFrameAnalyticsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetDataFrameAnalyticsAction.java index 0494809dd0b43..e5ef4bf8f2bef 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetDataFrameAnalyticsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetDataFrameAnalyticsAction.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.action.ActionType; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.xpack.core.action.AbstractGetResourcesRequest; import org.elasticsearch.xpack.core.action.AbstractGetResourcesResponse; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetDataFrameAnalyticsStatsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetDataFrameAnalyticsStatsAction.java index 84407256d45c5..448b20147ba5a 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetDataFrameAnalyticsStatsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetDataFrameAnalyticsStatsAction.java @@ -18,9 +18,9 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.core.Nullable; import org.elasticsearch.tasks.Task; import org.elasticsearch.xpack.core.action.util.PageParams; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetDatafeedRunningStateAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetDatafeedRunningStateAction.java index 999c17290747b..a17f7e58556dc 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetDatafeedRunningStateAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetDatafeedRunningStateAction.java @@ -13,8 +13,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.tasks.Task; import org.elasticsearch.xpack.core.ml.MlTasks; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetDatafeedsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetDatafeedsAction.java index daf43034d51c6..d57bf7fca28c9 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetDatafeedsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetDatafeedsAction.java @@ -11,7 +11,7 @@ import org.elasticsearch.action.support.master.MasterNodeReadRequest; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.ToXContentObject; import org.elasticsearch.xpack.core.action.AbstractGetResourcesResponse; import org.elasticsearch.xpack.core.action.util.QueryPage; import org.elasticsearch.xpack.core.ml.datafeed.DatafeedConfig; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetDatafeedsStatsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetDatafeedsStatsAction.java index e7b2f60c152a6..9aeea60a142c7 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetDatafeedsStatsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetDatafeedsStatsAction.java @@ -15,8 +15,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.persistent.PersistentTasksCustomMetadata; import org.elasticsearch.xpack.core.action.AbstractGetResourcesResponse; import org.elasticsearch.xpack.core.action.util.QueryPage; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetDeploymentStatsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetDeploymentStatsAction.java index 87de2a1338971..95bddce31b27b 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetDeploymentStatsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetDeploymentStatsAction.java @@ -18,9 +18,9 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.core.Nullable; import org.elasticsearch.tasks.Task; import org.elasticsearch.xpack.core.action.util.QueryPage; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetInfluencersAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetInfluencersAction.java index c53b71044bccb..44de64454c493 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetInfluencersAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetInfluencersAction.java @@ -9,13 +9,13 @@ import org.elasticsearch.action.ActionRequest; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionType; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.action.AbstractGetResourcesResponse; import org.elasticsearch.xpack.core.action.util.PageParams; import org.elasticsearch.xpack.core.action.util.QueryPage; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetJobsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetJobsAction.java index caf40a7220f48..bdbba36d5ed7a 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetJobsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetJobsAction.java @@ -11,7 +11,7 @@ import org.elasticsearch.action.support.master.MasterNodeReadRequest; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.ToXContentObject; import org.elasticsearch.xpack.core.action.AbstractGetResourcesResponse; import org.elasticsearch.xpack.core.action.util.QueryPage; import org.elasticsearch.xpack.core.ml.job.config.Job; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetJobsStatsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetJobsStatsAction.java index 7464815f2dff5..8d603ac4d9baf 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetJobsStatsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetJobsStatsAction.java @@ -19,8 +19,8 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.tasks.Task; import org.elasticsearch.xpack.core.action.util.QueryPage; import org.elasticsearch.xpack.core.ml.job.config.Job; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetModelSnapshotsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetModelSnapshotsAction.java index de62876833491..615823f62dce6 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetModelSnapshotsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetModelSnapshotsAction.java @@ -10,13 +10,13 @@ import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionType; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.action.AbstractGetResourcesResponse; import org.elasticsearch.xpack.core.action.util.PageParams; import org.elasticsearch.xpack.core.action.util.QueryPage; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetOverallBucketsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetOverallBucketsAction.java index c5e8457d02303..f17c951ef8da3 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetOverallBucketsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetOverallBucketsAction.java @@ -10,15 +10,15 @@ import org.elasticsearch.action.ActionRequest; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionType; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.time.DateMathParser; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.mapper.DateFieldMapper; import org.elasticsearch.xpack.core.action.AbstractGetResourcesResponse; import org.elasticsearch.xpack.core.action.util.QueryPage; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetRecordsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetRecordsAction.java index 76c1fd02b9908..2938a59ff7856 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetRecordsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetRecordsAction.java @@ -9,13 +9,13 @@ import org.elasticsearch.action.ActionRequest; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionType; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.action.AbstractGetResourcesResponse; import org.elasticsearch.xpack.core.action.util.PageParams; import org.elasticsearch.xpack.core.action.util.QueryPage; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetTrainedModelsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetTrainedModelsAction.java index 3c02c7646ba7a..3b1459b43d1fc 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetTrainedModelsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetTrainedModelsAction.java @@ -8,7 +8,7 @@ import org.elasticsearch.Version; import org.elasticsearch.action.ActionType; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetTrainedModelsStatsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetTrainedModelsStatsAction.java index f880daa6392fe..f82f55c689f95 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetTrainedModelsStatsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetTrainedModelsStatsAction.java @@ -8,12 +8,12 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.action.ActionType; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.ingest.IngestStats; import org.elasticsearch.xpack.core.action.AbstractGetResourcesRequest; import org.elasticsearch.xpack.core.action.AbstractGetResourcesResponse; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/InferTrainedModelDeploymentAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/InferTrainedModelDeploymentAction.java index d880433cc76a2..37cc068168661 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/InferTrainedModelDeploymentAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/InferTrainedModelDeploymentAction.java @@ -14,11 +14,11 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.TimeValue; import org.elasticsearch.tasks.Task; import org.elasticsearch.xpack.core.ml.inference.results.InferenceResults; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/IsolateDatafeedAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/IsolateDatafeedAction.java index cb9be79d077a7..e8533def32d62 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/IsolateDatafeedAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/IsolateDatafeedAction.java @@ -13,10 +13,10 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.tasks.Task; import org.elasticsearch.xpack.core.ml.MlTasks; import org.elasticsearch.xpack.core.ml.datafeed.DatafeedConfig; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/MlInfoAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/MlInfoAction.java index 46cb701e3a379..5cd84db2280bd 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/MlInfoAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/MlInfoAction.java @@ -12,8 +12,8 @@ import org.elasticsearch.action.ActionType; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Collections; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/NodeAcknowledgedResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/NodeAcknowledgedResponse.java index 42e5dd9f4c4dc..e4a4dd5f1bf6b 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/NodeAcknowledgedResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/NodeAcknowledgedResponse.java @@ -10,7 +10,7 @@ import org.elasticsearch.action.support.master.AcknowledgedResponse; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/OpenJobAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/OpenJobAction.java index ca4451b4eda90..c2274716b272e 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/OpenJobAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/OpenJobAction.java @@ -11,16 +11,16 @@ import org.elasticsearch.action.ActionType; import org.elasticsearch.action.support.master.MasterNodeRequest; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.persistent.PersistentTaskParams; import org.elasticsearch.tasks.Task; import org.elasticsearch.xpack.core.ml.MachineLearningField; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PostCalendarEventsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PostCalendarEventsAction.java index d27bf3c796b55..8ae627d5dbe80 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PostCalendarEventsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PostCalendarEventsAction.java @@ -10,13 +10,13 @@ import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.ActionType; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.calendars.Calendar; import org.elasticsearch.xpack.core.ml.calendars.ScheduledEvent; import org.elasticsearch.xpack.core.ml.job.messages.Messages; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PostDataAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PostDataAction.java index 313b5f27bce87..f9c841a5a23d6 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PostDataAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PostDataAction.java @@ -8,15 +8,15 @@ import org.elasticsearch.action.ActionType; import org.elasticsearch.action.support.tasks.BaseTasksResponse; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.xcontent.StatusToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.xpack.core.ml.job.config.DataDescription; import org.elasticsearch.xpack.core.ml.job.process.autodetect.state.DataCounts; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PreviewDataFrameAnalyticsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PreviewDataFrameAnalyticsAction.java index b7f2ccfc1f8c4..a0137a1866d0c 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PreviewDataFrameAnalyticsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PreviewDataFrameAnalyticsAction.java @@ -10,14 +10,14 @@ import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.ActionType; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.dataframe.DataFrameAnalyticsConfig; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PreviewDatafeedAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PreviewDatafeedAction.java index 018702c54fdcf..d9ec4761375a0 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PreviewDatafeedAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PreviewDatafeedAction.java @@ -11,16 +11,16 @@ import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.ActionType; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.ml.datafeed.DatafeedConfig; import org.elasticsearch.xpack.core.ml.job.config.Job; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutCalendarAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutCalendarAction.java index d73ce491305ca..5c16e95fe5987 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutCalendarAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutCalendarAction.java @@ -13,9 +13,9 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.calendars.Calendar; import org.elasticsearch.xpack.core.ml.job.messages.Messages; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutDataFrameAnalyticsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutDataFrameAnalyticsAction.java index 2de0bf15e775e..8c630d4767e95 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutDataFrameAnalyticsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutDataFrameAnalyticsAction.java @@ -14,9 +14,9 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.common.validation.SourceDestValidator; import org.elasticsearch.xpack.core.ml.dataframe.DataFrameAnalyticsConfig; import org.elasticsearch.xpack.core.ml.dataframe.DataFrameAnalyticsSource; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutDatafeedAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutDatafeedAction.java index 1fbe040a2a22f..722b524cdab55 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutDatafeedAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutDatafeedAction.java @@ -13,9 +13,9 @@ import org.elasticsearch.action.support.master.AcknowledgedRequest; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.datafeed.DatafeedConfig; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutFilterAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutFilterAction.java index 80ecf56a56a43..7cf7ed93f9368 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutFilterAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutFilterAction.java @@ -13,9 +13,9 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.job.config.MlFilter; import org.elasticsearch.xpack.core.ml.job.messages.Messages; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutJobAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutJobAction.java index 25c1c1662ed56..9a96d5bd25335 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutJobAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutJobAction.java @@ -14,9 +14,9 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.job.config.Job; import org.elasticsearch.xpack.core.ml.job.messages.Messages; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutTrainedModelAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutTrainedModelAction.java index 56ee1413b8a82..515a520f97f14 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutTrainedModelAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutTrainedModelAction.java @@ -13,9 +13,9 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.inference.TrainedModelConfig; import org.elasticsearch.xpack.core.ml.job.messages.Messages; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutTrainedModelDefinitionPartAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutTrainedModelDefinitionPartAction.java index 5866e14ef2c75..d5f16ab828665 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutTrainedModelDefinitionPartAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutTrainedModelDefinitionPartAction.java @@ -15,9 +15,9 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.inference.TrainedModelConfig; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutTrainedModelVocabularyAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutTrainedModelVocabularyAction.java index 149a483f421fe..35084cf5f2108 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutTrainedModelVocabularyAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutTrainedModelVocabularyAction.java @@ -13,9 +13,9 @@ import org.elasticsearch.action.support.master.AcknowledgedResponse; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.inference.TrainedModelConfig; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/RevertModelSnapshotAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/RevertModelSnapshotAction.java index 491917448a55b..3eabd9c94904c 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/RevertModelSnapshotAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/RevertModelSnapshotAction.java @@ -11,15 +11,15 @@ import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.ActionType; import org.elasticsearch.action.support.master.AcknowledgedRequest; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ObjectParser; import org.elasticsearch.common.xcontent.StatusToXContentObject; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.xpack.core.ml.job.config.Job; import org.elasticsearch.xpack.core.ml.job.process.autodetect.state.ModelSnapshot; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/SetUpgradeModeAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/SetUpgradeModeAction.java index 96c4ee2d7b49a..e2b462cc37311 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/SetUpgradeModeAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/SetUpgradeModeAction.java @@ -10,12 +10,12 @@ import org.elasticsearch.action.ActionType; import org.elasticsearch.action.support.master.AcknowledgedRequest; import org.elasticsearch.action.support.master.AcknowledgedResponse; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/StartDataFrameAnalyticsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/StartDataFrameAnalyticsAction.java index a0b2e5db04de2..eef68d9cb1134 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/StartDataFrameAnalyticsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/StartDataFrameAnalyticsAction.java @@ -13,12 +13,12 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.TimeValue; import org.elasticsearch.persistent.PersistentTaskParams; import org.elasticsearch.tasks.Task; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/StartDatafeedAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/StartDatafeedAction.java index 49b8c81635d88..d2d3c82969499 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/StartDatafeedAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/StartDatafeedAction.java @@ -14,16 +14,16 @@ import org.elasticsearch.action.search.SearchRequest; import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.master.MasterNodeRequest; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.time.DateMathParser; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.mapper.DateFieldMapper; import org.elasticsearch.persistent.PersistentTaskParams; import org.elasticsearch.xpack.core.ml.MlTasks; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/StartTrainedModelDeploymentAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/StartTrainedModelDeploymentAction.java index e3d8d37cbb4ea..0aa300346c58d 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/StartTrainedModelDeploymentAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/StartTrainedModelDeploymentAction.java @@ -18,12 +18,12 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.TimeValue; import org.elasticsearch.tasks.Task; import org.elasticsearch.xpack.core.ml.inference.TrainedModelConfig; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/StopDataFrameAnalyticsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/StopDataFrameAnalyticsAction.java index 674ee7104eee2..d5be99aa337dd 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/StopDataFrameAnalyticsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/StopDataFrameAnalyticsAction.java @@ -11,16 +11,16 @@ import org.elasticsearch.action.support.tasks.BaseTasksRequest; import org.elasticsearch.action.support.tasks.BaseTasksResponse; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.tasks.Task; import org.elasticsearch.xpack.core.ml.dataframe.DataFrameAnalyticsConfig; import org.elasticsearch.xpack.core.ml.job.messages.Messages; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/StopDatafeedAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/StopDatafeedAction.java index 1c87807748e3b..6ca4cde7fa3cd 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/StopDatafeedAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/StopDatafeedAction.java @@ -10,15 +10,15 @@ import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.support.tasks.BaseTasksRequest; import org.elasticsearch.action.support.tasks.BaseTasksResponse; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.tasks.Task; import org.elasticsearch.xpack.core.ml.MlTasks; import org.elasticsearch.xpack.core.ml.datafeed.DatafeedConfig; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/StopTrainedModelDeploymentAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/StopTrainedModelDeploymentAction.java index c62f5e497c7e6..073a43dc20fc1 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/StopTrainedModelDeploymentAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/StopTrainedModelDeploymentAction.java @@ -10,12 +10,12 @@ import org.elasticsearch.action.ActionType; import org.elasticsearch.action.support.tasks.BaseTasksRequest; import org.elasticsearch.action.support.tasks.BaseTasksResponse; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.tasks.Task; import org.elasticsearch.xpack.core.ml.inference.TrainedModelConfig; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/UpdateDataFrameAnalyticsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/UpdateDataFrameAnalyticsAction.java index 942ec81c8b5ad..c0db9360a992a 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/UpdateDataFrameAnalyticsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/UpdateDataFrameAnalyticsAction.java @@ -12,9 +12,9 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.dataframe.DataFrameAnalyticsConfig; import org.elasticsearch.xpack.core.ml.dataframe.DataFrameAnalyticsConfigUpdate; import org.elasticsearch.xpack.core.ml.job.messages.Messages; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/UpdateDatafeedAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/UpdateDatafeedAction.java index c95824db653c7..39ce7f9ff2479 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/UpdateDatafeedAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/UpdateDatafeedAction.java @@ -13,9 +13,9 @@ import org.elasticsearch.core.Nullable; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.datafeed.DatafeedUpdate; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/UpdateFilterAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/UpdateFilterAction.java index b35fa983deef9..574dce24ebbd3 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/UpdateFilterAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/UpdateFilterAction.java @@ -10,14 +10,14 @@ import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionType; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.job.config.MlFilter; import org.elasticsearch.xpack.core.ml.job.messages.Messages; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/UpdateJobAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/UpdateJobAction.java index 33b559c617537..8def6d0a2fcae 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/UpdateJobAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/UpdateJobAction.java @@ -12,9 +12,9 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.job.config.JobUpdate; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/UpdateModelSnapshotAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/UpdateModelSnapshotAction.java index 71a3187201461..f0b3dae86ade9 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/UpdateModelSnapshotAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/UpdateModelSnapshotAction.java @@ -10,15 +10,15 @@ import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.ActionType; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ObjectParser; import org.elasticsearch.common.xcontent.StatusToXContentObject; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.xpack.core.ml.job.config.Job; import org.elasticsearch.xpack.core.ml.job.process.autodetect.state.ModelSnapshot; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/UpdateProcessAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/UpdateProcessAction.java index 0bcb27db80f30..e3d89768bd437 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/UpdateProcessAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/UpdateProcessAction.java @@ -12,7 +12,7 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.xcontent.StatusToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.xpack.core.ml.job.config.JobUpdate; import org.elasticsearch.xpack.core.ml.job.config.MlFilter; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/UpgradeJobModelSnapshotAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/UpgradeJobModelSnapshotAction.java index 6ee54e41e77ff..6cd22760ea347 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/UpgradeJobModelSnapshotAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/UpgradeJobModelSnapshotAction.java @@ -10,14 +10,14 @@ import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.ActionType; import org.elasticsearch.action.support.master.MasterNodeRequest; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.job.config.Job; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/ValidateDetectorAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/ValidateDetectorAction.java index ab47e30d4ca85..2f7b561d69c04 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/ValidateDetectorAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/ValidateDetectorAction.java @@ -12,9 +12,9 @@ import org.elasticsearch.action.support.master.AcknowledgedResponse; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.job.config.Detector; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/ValidateJobConfigAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/ValidateJobConfigAction.java index a5cd86824c27b..9ff1d519cadb3 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/ValidateJobConfigAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/ValidateJobConfigAction.java @@ -12,7 +12,7 @@ import org.elasticsearch.action.support.master.AcknowledgedResponse; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.job.config.Job; import org.elasticsearch.xpack.core.ml.job.messages.Messages; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/annotations/Annotation.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/annotations/Annotation.java index a91a9ee9a7a14..10ea532284533 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/annotations/Annotation.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/annotations/Annotation.java @@ -6,15 +6,15 @@ */ package org.elasticsearch.xpack.core.ml.annotations; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.common.time.TimeUtils; import org.elasticsearch.xpack.core.ml.job.config.Job; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/calendars/Calendar.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/calendars/Calendar.java index c66006c4011c0..b6677585316ed 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/calendars/Calendar.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/calendars/Calendar.java @@ -7,13 +7,13 @@ package org.elasticsearch.xpack.core.ml.calendars; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ml.utils.ToXContentParams; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/calendars/ScheduledEvent.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/calendars/ScheduledEvent.java index 697a6b32e0e78..bef1e4378c6d0 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/calendars/ScheduledEvent.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/calendars/ScheduledEvent.java @@ -7,14 +7,14 @@ package org.elasticsearch.xpack.core.ml.calendars; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ml.job.config.DetectionRule; import org.elasticsearch.xpack.core.ml.job.config.Operator; import org.elasticsearch.xpack.core.ml.job.config.RuleAction; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/datafeed/AggProvider.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/datafeed/AggProvider.java index 1a5a53f938d42..b82dce3f434f0 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/datafeed/AggProvider.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/datafeed/AggProvider.java @@ -12,10 +12,10 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.aggregations.AggregatorFactories; import org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramAggregationBuilder; import org.elasticsearch.search.aggregations.bucket.histogram.Histogram; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/datafeed/ChunkingConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/datafeed/ChunkingConfig.java index f48702a144860..1c9df7e9c073b 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/datafeed/ChunkingConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/datafeed/ChunkingConfig.java @@ -7,14 +7,14 @@ package org.elasticsearch.xpack.core.ml.datafeed; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/datafeed/DatafeedConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/datafeed/DatafeedConfig.java index 519987d6aca61..84cd031c5a701 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/datafeed/DatafeedConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/datafeed/DatafeedConfig.java @@ -15,17 +15,17 @@ import org.elasticsearch.cluster.AbstractDiffable; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.core.Tuple; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.AggregatorFactories; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/datafeed/DatafeedJobValidator.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/datafeed/DatafeedJobValidator.java index e711981d1a23a..e6dc9c2cc64ce 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/datafeed/DatafeedJobValidator.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/datafeed/DatafeedJobValidator.java @@ -8,7 +8,7 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.xpack.core.ml.job.config.AnalysisConfig; import org.elasticsearch.xpack.core.ml.job.config.Job; import org.elasticsearch.xpack.core.ml.job.messages.Messages; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/datafeed/DatafeedState.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/datafeed/DatafeedState.java index ab9f1d954fbf5..8cdb4c30d2ccf 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/datafeed/DatafeedState.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/datafeed/DatafeedState.java @@ -6,19 +6,19 @@ */ package org.elasticsearch.xpack.core.ml.datafeed; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.persistent.PersistentTaskState; import org.elasticsearch.xpack.core.ml.MlTasks; import java.io.IOException; import java.util.Locale; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; public enum DatafeedState implements PersistentTaskState { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/datafeed/DatafeedTimingStats.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/datafeed/DatafeedTimingStats.java index 62dac550d451c..0a1d67fca26d1 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/datafeed/DatafeedTimingStats.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/datafeed/DatafeedTimingStats.java @@ -7,15 +7,15 @@ package org.elasticsearch.xpack.core.ml.datafeed; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ml.job.results.Result; import org.elasticsearch.xpack.core.ml.utils.ExponentialAverageCalculationContext; import org.elasticsearch.xpack.core.ml.utils.ToXContentParams; @@ -24,8 +24,8 @@ import java.time.Instant; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class DatafeedTimingStats implements ToXContentObject, Writeable { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/datafeed/DatafeedUpdate.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/datafeed/DatafeedUpdate.java index eb3353f82f1ff..9f496f26bef33 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/datafeed/DatafeedUpdate.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/datafeed/DatafeedUpdate.java @@ -8,17 +8,17 @@ import org.elasticsearch.action.search.SearchRequest; import org.elasticsearch.action.support.IndicesOptions; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.search.aggregations.AggregatorFactories; import org.elasticsearch.search.builder.SearchSourceBuilder; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/datafeed/DelayedDataCheckConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/datafeed/DelayedDataCheckConfig.java index adb0a39dd0732..00b7861b6bb98 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/datafeed/DelayedDataCheckConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/datafeed/DelayedDataCheckConfig.java @@ -7,15 +7,15 @@ package org.elasticsearch.xpack.core.ml.datafeed; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.common.time.TimeUtils; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/DataFrameAnalyticsConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/DataFrameAnalyticsConfig.java index 54e1eb24d8809..56c4c25f5d499 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/DataFrameAnalyticsConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/DataFrameAnalyticsConfig.java @@ -8,16 +8,16 @@ import org.elasticsearch.Version; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParserUtils; import org.elasticsearch.search.fetch.subphase.FetchSourceContext; import org.elasticsearch.xpack.core.common.time.TimeUtils; @@ -33,8 +33,8 @@ import java.util.Map; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ObjectParser.ValueType.OBJECT_ARRAY_BOOLEAN_OR_STRING; -import static org.elasticsearch.common.xcontent.ObjectParser.ValueType.VALUE; +import static org.elasticsearch.xcontent.ObjectParser.ValueType.OBJECT_ARRAY_BOOLEAN_OR_STRING; +import static org.elasticsearch.xcontent.ObjectParser.ValueType.VALUE; import static org.elasticsearch.xpack.core.ClientHelper.assertNoAuthorizationHeader; import static org.elasticsearch.xpack.core.ml.utils.ToXContentParams.EXCLUDE_GENERATED; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/DataFrameAnalyticsConfigUpdate.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/DataFrameAnalyticsConfigUpdate.java index f3a21e34c0d38..bd5ea5dbdf82a 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/DataFrameAnalyticsConfigUpdate.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/DataFrameAnalyticsConfigUpdate.java @@ -11,9 +11,9 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; import java.io.IOException; @@ -21,7 +21,7 @@ import java.util.Set; import java.util.TreeSet; -import static org.elasticsearch.common.xcontent.ObjectParser.ValueType.VALUE; +import static org.elasticsearch.xcontent.ObjectParser.ValueType.VALUE; public class DataFrameAnalyticsConfigUpdate implements Writeable, ToXContentObject { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/DataFrameAnalyticsDest.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/DataFrameAnalyticsDest.java index a3704322747fe..3bed995cdd383 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/DataFrameAnalyticsDest.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/DataFrameAnalyticsDest.java @@ -7,13 +7,13 @@ package org.elasticsearch.xpack.core.ml.dataframe; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/DataFrameAnalyticsSource.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/DataFrameAnalyticsSource.java index dc65c5df482af..17e8a730aa986 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/DataFrameAnalyticsSource.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/DataFrameAnalyticsSource.java @@ -8,17 +8,17 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.regex.Regex; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.search.builder.SearchSourceBuilder; import org.elasticsearch.search.fetch.subphase.FetchSourceContext; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/DataFrameAnalyticsTaskState.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/DataFrameAnalyticsTaskState.java index add8fbd038d88..f705096c04fa0 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/DataFrameAnalyticsTaskState.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/DataFrameAnalyticsTaskState.java @@ -8,10 +8,10 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.Nullable; import org.elasticsearch.persistent.PersistentTaskState; import org.elasticsearch.persistent.PersistentTasksCustomMetadata; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/analyses/BoostedTreeParams.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/analyses/BoostedTreeParams.java index ec78dc8bdc223..725fb58a8515a 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/analyses/BoostedTreeParams.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/analyses/BoostedTreeParams.java @@ -7,13 +7,13 @@ package org.elasticsearch.xpack.core.ml.dataframe.analyses; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.AbstractObjectParser; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.AbstractObjectParser; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; import java.io.IOException; @@ -21,7 +21,7 @@ import java.util.Map; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * Parameters used by both {@link Classification} and {@link Regression} analyses. diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/analyses/Classification.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/analyses/Classification.java index 65f955bafa22b..5da9e2784376f 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/analyses/Classification.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/analyses/Classification.java @@ -10,13 +10,13 @@ import org.elasticsearch.action.fieldcaps.FieldCapabilities; import org.elasticsearch.action.fieldcaps.FieldCapabilitiesResponse; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Randomness; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.mapper.BooleanFieldMapper; import org.elasticsearch.index.mapper.KeywordFieldMapper; import org.elasticsearch.index.mapper.NestedObjectMapper; @@ -42,8 +42,8 @@ import java.util.stream.Collectors; import java.util.stream.Stream; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class Classification implements DataFrameAnalysis { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/analyses/DataFrameAnalysis.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/analyses/DataFrameAnalysis.java index db248e3d615b4..1a251a135ea64 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/analyses/DataFrameAnalysis.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/analyses/DataFrameAnalysis.java @@ -9,7 +9,7 @@ import org.elasticsearch.action.fieldcaps.FieldCapabilitiesResponse; import org.elasticsearch.core.Nullable; import org.elasticsearch.common.io.stream.NamedWriteable; -import org.elasticsearch.common.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.ToXContentObject; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.InferenceConfig; import java.util.List; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/analyses/MlDataFrameAnalysisNamedXContentProvider.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/analyses/MlDataFrameAnalysisNamedXContentProvider.java index 3fbf4762a8d84..f1f7af0789a39 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/analyses/MlDataFrameAnalysisNamedXContentProvider.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/analyses/MlDataFrameAnalysisNamedXContentProvider.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.dataframe.analyses; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.plugins.spi.NamedXContentProvider; import java.util.Arrays; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/analyses/OutlierDetection.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/analyses/OutlierDetection.java index 000c209d3f1b4..8a5b9028c547e 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/analyses/OutlierDetection.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/analyses/OutlierDetection.java @@ -9,12 +9,12 @@ import org.elasticsearch.Version; import org.elasticsearch.action.fieldcaps.FieldCapabilitiesResponse; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.mapper.KeywordFieldMapper; import org.elasticsearch.index.mapper.NestedObjectMapper; import org.elasticsearch.index.mapper.NumberFieldMapper; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/analyses/Regression.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/analyses/Regression.java index d3fc9ea2a6fd7..4670dccc43e4d 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/analyses/Regression.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/analyses/Regression.java @@ -9,13 +9,13 @@ import org.elasticsearch.Version; import org.elasticsearch.action.fieldcaps.FieldCapabilitiesResponse; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Randomness; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.mapper.BooleanFieldMapper; import org.elasticsearch.index.mapper.KeywordFieldMapper; import org.elasticsearch.index.mapper.NestedObjectMapper; @@ -39,8 +39,8 @@ import java.util.Set; import java.util.stream.Collectors; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class Regression implements DataFrameAnalysis { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/Evaluation.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/Evaluation.java index 936a0bb4d2400..77f061c78b43b 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/Evaluation.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/Evaluation.java @@ -11,7 +11,7 @@ import org.elasticsearch.core.Nullable; import org.elasticsearch.core.Tuple; import org.elasticsearch.common.io.stream.NamedWriteable; -import org.elasticsearch.common.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.ToXContentObject; import org.elasticsearch.index.query.BoolQueryBuilder; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilders; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/EvaluationFields.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/EvaluationFields.java index 6a9e121f6b53a..f5a2793512043 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/EvaluationFields.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/EvaluationFields.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.dataframe.evaluation; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.Tuple; import java.util.Arrays; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/EvaluationMetric.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/EvaluationMetric.java index 2298b7dfe0535..106beffa7764c 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/EvaluationMetric.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/EvaluationMetric.java @@ -9,7 +9,7 @@ import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.core.Tuple; import org.elasticsearch.common.io.stream.NamedWriteable; -import org.elasticsearch.common.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.ToXContentObject; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.Aggregations; import org.elasticsearch.search.aggregations.PipelineAggregationBuilder; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/EvaluationMetricResult.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/EvaluationMetricResult.java index 9f860476e2f88..f37168b82703f 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/EvaluationMetricResult.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/EvaluationMetricResult.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.dataframe.evaluation; import org.elasticsearch.common.io.stream.NamedWriteable; -import org.elasticsearch.common.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.ToXContentObject; /** * The result of an evaluation metric diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/MlEvaluationNamedXContentProvider.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/MlEvaluationNamedXContentProvider.java index cdcf642926cd8..2c0f1cf919090 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/MlEvaluationNamedXContentProvider.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/MlEvaluationNamedXContentProvider.java @@ -6,9 +6,9 @@ */ package org.elasticsearch.xpack.core.ml.dataframe.evaluation; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.plugins.spi.NamedXContentProvider; import org.elasticsearch.xpack.core.ml.dataframe.evaluation.classification.Accuracy; import org.elasticsearch.xpack.core.ml.dataframe.evaluation.classification.AucRoc; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/classification/Accuracy.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/classification/Accuracy.java index 2f00e0fbc9eaf..6579bba468277 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/classification/Accuracy.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/classification/Accuracy.java @@ -7,15 +7,15 @@ package org.elasticsearch.xpack.core.ml.dataframe.evaluation.classification; import org.apache.lucene.util.SetOnce; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.Tuple; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.script.Script; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.AggregationBuilders; @@ -36,7 +36,7 @@ import java.util.Optional; import java.util.Set; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; import static org.elasticsearch.xpack.core.ml.dataframe.evaluation.MlEvaluationNamedXContentProvider.registeredMetricName; /** diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/classification/AucRoc.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/classification/AucRoc.java index a647170951928..fa84677e786ec 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/classification/AucRoc.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/classification/AucRoc.java @@ -7,14 +7,14 @@ package org.elasticsearch.xpack.core.ml.dataframe.evaluation.classification; import org.apache.lucene.util.SetOnce; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.Tuple; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.search.aggregations.AggregationBuilder; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/classification/Classification.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/classification/Classification.java index 0b60680a9a534..dd557e3989bee 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/classification/Classification.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/classification/Classification.java @@ -7,12 +7,12 @@ package org.elasticsearch.xpack.core.ml.dataframe.evaluation.classification; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.dataframe.evaluation.Evaluation; import org.elasticsearch.xpack.core.ml.dataframe.evaluation.EvaluationFields; import org.elasticsearch.xpack.core.ml.dataframe.evaluation.EvaluationMetric; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/classification/MulticlassConfusionMatrix.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/classification/MulticlassConfusionMatrix.java index 32b6b735954a9..6954202772f04 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/classification/MulticlassConfusionMatrix.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/classification/MulticlassConfusionMatrix.java @@ -8,16 +8,16 @@ import org.apache.lucene.util.SetOnce; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.Tuple; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.AggregationBuilders; @@ -44,8 +44,8 @@ import java.util.stream.Collectors; import static java.util.Comparator.comparing; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; import static org.elasticsearch.xpack.core.ml.dataframe.evaluation.MlEvaluationNamedXContentProvider.registeredMetricName; /** diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/classification/PerClassSingleValue.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/classification/PerClassSingleValue.java index 4dca955bc2f7c..ffb4d6d0095c0 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/classification/PerClassSingleValue.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/classification/PerClassSingleValue.java @@ -7,19 +7,19 @@ package org.elasticsearch.xpack.core.ml.dataframe.evaluation.classification; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; public class PerClassSingleValue implements ToXContentObject, Writeable { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/classification/Precision.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/classification/Precision.java index 60c3366733965..30ebd998e35ec 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/classification/Precision.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/classification/Precision.java @@ -7,15 +7,15 @@ package org.elasticsearch.xpack.core.ml.dataframe.evaluation.classification; import org.apache.lucene.util.SetOnce; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.Tuple; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.script.Script; import org.elasticsearch.search.aggregations.AggregationBuilder; @@ -43,7 +43,7 @@ import java.util.Set; import java.util.stream.Collectors; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; import static org.elasticsearch.xpack.core.ml.dataframe.evaluation.MlEvaluationNamedXContentProvider.registeredMetricName; /** diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/classification/Recall.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/classification/Recall.java index f3bca4f35e987..76f6e8d68c002 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/classification/Recall.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/classification/Recall.java @@ -7,15 +7,15 @@ package org.elasticsearch.xpack.core.ml.dataframe.evaluation.classification; import org.apache.lucene.util.SetOnce; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.Tuple; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.script.Script; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.AggregationBuilders; @@ -39,7 +39,7 @@ import java.util.Optional; import java.util.Set; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; import static org.elasticsearch.xpack.core.ml.dataframe.evaluation.MlEvaluationNamedXContentProvider.registeredMetricName; /** diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/common/AbstractAucRoc.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/common/AbstractAucRoc.java index 0a91ffc78b2c1..50f2e0e5b86e0 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/common/AbstractAucRoc.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/common/AbstractAucRoc.java @@ -6,13 +6,13 @@ */ package org.elasticsearch.xpack.core.ml.dataframe.evaluation.common; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.search.aggregations.metrics.Percentiles; import org.elasticsearch.xpack.core.ml.dataframe.evaluation.EvaluationMetric; import org.elasticsearch.xpack.core.ml.dataframe.evaluation.EvaluationMetricResult; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/outlierdetection/AbstractConfusionMatrixMetric.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/outlierdetection/AbstractConfusionMatrixMetric.java index 92c3accfd3aee..d0c7cc2436ad7 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/outlierdetection/AbstractConfusionMatrixMetric.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/outlierdetection/AbstractConfusionMatrixMetric.java @@ -6,12 +6,12 @@ */ package org.elasticsearch.xpack.core.ml.dataframe.evaluation.outlierdetection; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.Tuple; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.query.BoolQueryBuilder; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilders; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/outlierdetection/AucRoc.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/outlierdetection/AucRoc.java index adecde4f2876f..be9bf6f2b482a 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/outlierdetection/AucRoc.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/outlierdetection/AucRoc.java @@ -7,14 +7,14 @@ package org.elasticsearch.xpack.core.ml.dataframe.evaluation.outlierdetection; import org.apache.lucene.util.SetOnce; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.Tuple; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.AggregationBuilders; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/outlierdetection/ConfusionMatrix.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/outlierdetection/ConfusionMatrix.java index 6a5417958e485..8567deb282422 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/outlierdetection/ConfusionMatrix.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/outlierdetection/ConfusionMatrix.java @@ -6,12 +6,12 @@ */ package org.elasticsearch.xpack.core.ml.dataframe.evaluation.outlierdetection; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.Aggregations; import org.elasticsearch.search.aggregations.bucket.filter.Filter; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/outlierdetection/OutlierDetection.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/outlierdetection/OutlierDetection.java index 109ff5564230c..a132de57d6321 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/outlierdetection/OutlierDetection.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/outlierdetection/OutlierDetection.java @@ -7,12 +7,12 @@ package org.elasticsearch.xpack.core.ml.dataframe.evaluation.outlierdetection; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.xpack.core.ml.dataframe.evaluation.Evaluation; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/outlierdetection/Precision.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/outlierdetection/Precision.java index 5628c72f30cd6..64b3e38116009 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/outlierdetection/Precision.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/outlierdetection/Precision.java @@ -6,10 +6,10 @@ */ package org.elasticsearch.xpack.core.ml.dataframe.evaluation.outlierdetection; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.Aggregations; import org.elasticsearch.search.aggregations.bucket.filter.Filter; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/outlierdetection/Recall.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/outlierdetection/Recall.java index 209b4f9535c7c..415f9a1c81cfd 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/outlierdetection/Recall.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/outlierdetection/Recall.java @@ -6,10 +6,10 @@ */ package org.elasticsearch.xpack.core.ml.dataframe.evaluation.outlierdetection; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.Aggregations; import org.elasticsearch.search.aggregations.bucket.filter.Filter; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/outlierdetection/ScoreByThresholdResult.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/outlierdetection/ScoreByThresholdResult.java index 0c26bebfb8081..6c9c73012702b 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/outlierdetection/ScoreByThresholdResult.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/outlierdetection/ScoreByThresholdResult.java @@ -6,10 +6,10 @@ */ package org.elasticsearch.xpack.core.ml.dataframe.evaluation.outlierdetection; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ml.dataframe.evaluation.EvaluationMetricResult; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/regression/Huber.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/regression/Huber.java index 7719168dcb9dc..ede894314c62a 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/regression/Huber.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/regression/Huber.java @@ -7,14 +7,14 @@ package org.elasticsearch.xpack.core.ml.dataframe.evaluation.regression; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.Tuple; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.script.Script; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.AggregationBuilders; @@ -36,7 +36,7 @@ import java.util.Optional; import java.util.Set; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; import static org.elasticsearch.xpack.core.ml.dataframe.evaluation.MlEvaluationNamedXContentProvider.registeredMetricName; /** diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/regression/MeanSquaredError.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/regression/MeanSquaredError.java index 1f9bfea95aae7..f9caf2392ee76 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/regression/MeanSquaredError.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/regression/MeanSquaredError.java @@ -6,14 +6,14 @@ */ package org.elasticsearch.xpack.core.ml.dataframe.evaluation.regression; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.Tuple; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.script.Script; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.AggregationBuilders; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/regression/MeanSquaredLogarithmicError.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/regression/MeanSquaredLogarithmicError.java index e3aa99781b6f3..c3b3927326f02 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/regression/MeanSquaredLogarithmicError.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/regression/MeanSquaredLogarithmicError.java @@ -7,14 +7,14 @@ package org.elasticsearch.xpack.core.ml.dataframe.evaluation.regression; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.Tuple; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.script.Script; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.AggregationBuilders; @@ -36,7 +36,7 @@ import java.util.Optional; import java.util.Set; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; import static org.elasticsearch.xpack.core.ml.dataframe.evaluation.MlEvaluationNamedXContentProvider.registeredMetricName; /** diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/regression/RSquared.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/regression/RSquared.java index e879e60b50bf9..225190d1a5c4b 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/regression/RSquared.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/regression/RSquared.java @@ -6,14 +6,14 @@ */ package org.elasticsearch.xpack.core.ml.dataframe.evaluation.regression; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.Tuple; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.script.Script; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.AggregationBuilders; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/regression/Regression.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/regression/Regression.java index 33d54f72e6813..de02ee891c7a9 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/regression/Regression.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/regression/Regression.java @@ -7,12 +7,12 @@ package org.elasticsearch.xpack.core.ml.dataframe.evaluation.regression; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.dataframe.evaluation.Evaluation; import org.elasticsearch.xpack.core.ml.dataframe.evaluation.EvaluationFields; import org.elasticsearch.xpack.core.ml.dataframe.evaluation.EvaluationMetric; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/explain/FieldSelection.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/explain/FieldSelection.java index bbe5e91988822..ea7167d637285 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/explain/FieldSelection.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/explain/FieldSelection.java @@ -7,13 +7,13 @@ package org.elasticsearch.xpack.core.ml.dataframe.explain; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Collections; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/explain/MemoryEstimation.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/explain/MemoryEstimation.java index 5406b6e180038..d32366974ad44 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/explain/MemoryEstimation.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/explain/MemoryEstimation.java @@ -7,20 +7,20 @@ package org.elasticsearch.xpack.core.ml.dataframe.explain; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class MemoryEstimation implements ToXContentObject, Writeable { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/AnalysisStats.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/AnalysisStats.java index 95c3ab8985e50..4f99f5dcba999 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/AnalysisStats.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/AnalysisStats.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.dataframe.stats; import org.elasticsearch.common.io.stream.NamedWriteable; -import org.elasticsearch.common.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.ToXContentObject; /** * Statistics for the data frame analysis diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/Fields.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/Fields.java index 6748ad6b2286f..b8c7d7b9ce070 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/Fields.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/Fields.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.core.ml.dataframe.stats; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; /** * A collection of parse fields commonly used by stats objects diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/classification/ClassificationStats.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/classification/ClassificationStats.java index bb7d60f23081f..dff8c49480d87 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/classification/ClassificationStats.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/classification/ClassificationStats.java @@ -6,12 +6,12 @@ */ package org.elasticsearch.xpack.core.ml.dataframe.stats.classification; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.common.time.TimeUtils; import org.elasticsearch.xpack.core.ml.dataframe.stats.AnalysisStats; import org.elasticsearch.xpack.core.ml.dataframe.stats.Fields; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/classification/Hyperparameters.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/classification/Hyperparameters.java index 4d9498135332a..16d5da913cdda 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/classification/Hyperparameters.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/classification/Hyperparameters.java @@ -6,19 +6,19 @@ */ package org.elasticsearch.xpack.core.ml.dataframe.stats.classification; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; public class Hyperparameters implements ToXContentObject, Writeable { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/classification/TimingStats.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/classification/TimingStats.java index 42456003a9319..5c38676793405 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/classification/TimingStats.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/classification/TimingStats.java @@ -6,15 +6,15 @@ */ package org.elasticsearch.xpack.core.ml.dataframe.stats.classification; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/classification/ValidationLoss.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/classification/ValidationLoss.java index 93ba08774e273..4b4e58a8280a7 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/classification/ValidationLoss.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/classification/ValidationLoss.java @@ -6,14 +6,14 @@ */ package org.elasticsearch.xpack.core.ml.dataframe.stats.classification; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.dataframe.stats.common.FoldValues; import org.elasticsearch.xpack.core.ml.utils.ToXContentParams; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/common/DataCounts.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/common/DataCounts.java index 17b36e31b21e4..fdaa98c6f6694 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/common/DataCounts.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/common/DataCounts.java @@ -6,13 +6,13 @@ */ package org.elasticsearch.xpack.core.ml.dataframe.stats.common; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ml.dataframe.stats.Fields; import org.elasticsearch.xpack.core.ml.utils.ToXContentParams; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/common/FoldValues.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/common/FoldValues.java index 9df829274a2a3..a9ea8dc42c0c4 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/common/FoldValues.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/common/FoldValues.java @@ -6,14 +6,14 @@ */ package org.elasticsearch.xpack.core.ml.dataframe.stats.common; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Arrays; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/common/MemoryUsage.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/common/MemoryUsage.java index 564f17389dc98..60374f83fa281 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/common/MemoryUsage.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/common/MemoryUsage.java @@ -7,15 +7,15 @@ package org.elasticsearch.xpack.core.ml.dataframe.stats.common; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.common.time.TimeUtils; import org.elasticsearch.xpack.core.ml.dataframe.stats.Fields; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/outlierdetection/OutlierDetectionStats.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/outlierdetection/OutlierDetectionStats.java index 7b243932d2fc2..9fbcff7a3cca1 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/outlierdetection/OutlierDetectionStats.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/outlierdetection/OutlierDetectionStats.java @@ -6,12 +6,12 @@ */ package org.elasticsearch.xpack.core.ml.dataframe.stats.outlierdetection; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.common.time.TimeUtils; import org.elasticsearch.xpack.core.ml.dataframe.stats.AnalysisStats; import org.elasticsearch.xpack.core.ml.dataframe.stats.Fields; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/outlierdetection/Parameters.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/outlierdetection/Parameters.java index ac269d8fc025a..d4b4724b5f015 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/outlierdetection/Parameters.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/outlierdetection/Parameters.java @@ -6,19 +6,19 @@ */ package org.elasticsearch.xpack.core.ml.dataframe.stats.outlierdetection; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; public class Parameters implements Writeable, ToXContentObject { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/outlierdetection/TimingStats.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/outlierdetection/TimingStats.java index b98db07275541..b1ce4f46d2980 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/outlierdetection/TimingStats.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/outlierdetection/TimingStats.java @@ -6,15 +6,15 @@ */ package org.elasticsearch.xpack.core.ml.dataframe.stats.outlierdetection; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/regression/Hyperparameters.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/regression/Hyperparameters.java index 6eb0edf3ea5b3..965df9334217f 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/regression/Hyperparameters.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/regression/Hyperparameters.java @@ -6,19 +6,19 @@ */ package org.elasticsearch.xpack.core.ml.dataframe.stats.regression; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; public class Hyperparameters implements ToXContentObject, Writeable { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/regression/RegressionStats.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/regression/RegressionStats.java index 22d98534140eb..1c6712b2deefd 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/regression/RegressionStats.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/regression/RegressionStats.java @@ -6,12 +6,12 @@ */ package org.elasticsearch.xpack.core.ml.dataframe.stats.regression; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.common.time.TimeUtils; import org.elasticsearch.xpack.core.ml.dataframe.stats.AnalysisStats; import org.elasticsearch.xpack.core.ml.dataframe.stats.Fields; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/regression/TimingStats.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/regression/TimingStats.java index 37bf74499f8fe..e6698ea4e651c 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/regression/TimingStats.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/regression/TimingStats.java @@ -6,15 +6,15 @@ */ package org.elasticsearch.xpack.core.ml.dataframe.stats.regression; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/regression/ValidationLoss.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/regression/ValidationLoss.java index 4ed4bc5dcfbad..8ac67eac610f4 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/regression/ValidationLoss.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/regression/ValidationLoss.java @@ -6,14 +6,14 @@ */ package org.elasticsearch.xpack.core.ml.dataframe.stats.regression; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.dataframe.stats.common.FoldValues; import org.elasticsearch.xpack.core.ml.utils.ToXContentParams; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/InferenceToXContentCompressor.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/InferenceToXContentCompressor.java index 35ca522e3f7d0..c488386441432 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/InferenceToXContentCompressor.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/InferenceToXContentCompressor.java @@ -15,13 +15,13 @@ import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContentObject; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.monitor.jvm.JvmInfo; import org.elasticsearch.xpack.core.ml.inference.utils.SimpleBoundedInputStream; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/MlInferenceNamedXContentProvider.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/MlInferenceNamedXContentProvider.java index f709ba44928ea..823b38c486664 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/MlInferenceNamedXContentProvider.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/MlInferenceNamedXContentProvider.java @@ -7,8 +7,8 @@ package org.elasticsearch.xpack.core.ml.inference; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.plugins.spi.NamedXContentProvider; import org.elasticsearch.xpack.core.ml.inference.preprocessing.CustomWordEmbedding; import org.elasticsearch.xpack.core.ml.inference.preprocessing.FrequencyEncoding; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/TrainedModelConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/TrainedModelConfig.java index cf7b902548ffe..5f2ddae51436a 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/TrainedModelConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/TrainedModelConfig.java @@ -10,7 +10,7 @@ import org.elasticsearch.Version; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; @@ -18,11 +18,11 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.license.License; import org.elasticsearch.xpack.core.common.time.TimeUtils; import org.elasticsearch.xpack.core.ml.inference.persistence.InferenceIndexConstants; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/TrainedModelDefinition.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/TrainedModelDefinition.java index 51d3f9f1f83be..8a1f6bb6a5e31 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/TrainedModelDefinition.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/TrainedModelDefinition.java @@ -9,15 +9,15 @@ import org.apache.lucene.util.Accountable; import org.apache.lucene.util.Accountables; import org.apache.lucene.util.RamUsageEstimator; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.inference.preprocessing.LenientlyParsedPreProcessor; import org.elasticsearch.xpack.core.ml.inference.preprocessing.PreProcessor; import org.elasticsearch.xpack.core.ml.inference.preprocessing.StrictlyParsedPreProcessor; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/TrainedModelInput.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/TrainedModelInput.java index 52542f8ad701b..2b88a21d0eb3f 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/TrainedModelInput.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/TrainedModelInput.java @@ -6,14 +6,14 @@ */ package org.elasticsearch.xpack.core.ml.inference; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/allocation/AllocationStatus.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/allocation/AllocationStatus.java index 5a1725d696861..ab16ba3b476ca 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/allocation/AllocationStatus.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/allocation/AllocationStatus.java @@ -10,11 +10,11 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Arrays; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/allocation/RoutingStateAndReason.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/allocation/RoutingStateAndReason.java index c6f1ce7d71510..916cdab9be25b 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/allocation/RoutingStateAndReason.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/allocation/RoutingStateAndReason.java @@ -10,11 +10,11 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/allocation/TrainedModelAllocation.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/allocation/TrainedModelAllocation.java index f133055b7fd0d..fc7b6f1620cc3 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/allocation/TrainedModelAllocation.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/allocation/TrainedModelAllocation.java @@ -14,11 +14,11 @@ import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.action.StartTrainedModelDeploymentAction; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/persistence/InferenceIndexConstants.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/persistence/InferenceIndexConstants.java index 403382acd6050..38fc66bdba0b4 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/persistence/InferenceIndexConstants.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/persistence/InferenceIndexConstants.java @@ -8,7 +8,7 @@ import org.elasticsearch.Version; import org.elasticsearch.cluster.metadata.IndexMetadata; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.xpack.core.template.TemplateUtils; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/preprocessing/CustomWordEmbedding.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/preprocessing/CustomWordEmbedding.java index c4098d9b87cd2..6694f0708a83c 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/preprocessing/CustomWordEmbedding.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/preprocessing/CustomWordEmbedding.java @@ -8,13 +8,13 @@ package org.elasticsearch.xpack.core.ml.inference.preprocessing; import org.apache.lucene.util.RamUsageEstimator; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.inference.preprocessing.customwordembedding.FeatureExtractor; import org.elasticsearch.xpack.core.ml.inference.preprocessing.customwordembedding.FeatureUtils; import org.elasticsearch.xpack.core.ml.inference.preprocessing.customwordembedding.FeatureValue; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/preprocessing/FrequencyEncoding.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/preprocessing/FrequencyEncoding.java index e1556cf7cbfb3..3e173c8622649 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/preprocessing/FrequencyEncoding.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/preprocessing/FrequencyEncoding.java @@ -7,13 +7,13 @@ package org.elasticsearch.xpack.core.ml.inference.preprocessing; import org.apache.lucene.util.RamUsageEstimator; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.mapper.NumberFieldMapper; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/preprocessing/Multi.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/preprocessing/Multi.java index e7dee0e007895..08a1c5ef39d10 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/preprocessing/Multi.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/preprocessing/Multi.java @@ -21,13 +21,13 @@ import java.util.stream.Collectors; import org.apache.lucene.util.RamUsageEstimator; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; import org.elasticsearch.xpack.core.ml.utils.NamedXContentObjectHelper; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/preprocessing/NGram.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/preprocessing/NGram.java index af97191ac1553..1144536abdb73 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/preprocessing/NGram.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/preprocessing/NGram.java @@ -7,14 +7,14 @@ package org.elasticsearch.xpack.core.ml.inference.preprocessing; import org.apache.lucene.util.RamUsageEstimator; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.mapper.TextFieldMapper; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/preprocessing/OneHotEncoding.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/preprocessing/OneHotEncoding.java index 9d0aabc6064c2..40955364d39d4 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/preprocessing/OneHotEncoding.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/preprocessing/OneHotEncoding.java @@ -7,13 +7,13 @@ package org.elasticsearch.xpack.core.ml.inference.preprocessing; import org.apache.lucene.util.RamUsageEstimator; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.mapper.NumberFieldMapper; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/preprocessing/TargetMeanEncoding.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/preprocessing/TargetMeanEncoding.java index 345e198912ef4..2848b30066651 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/preprocessing/TargetMeanEncoding.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/preprocessing/TargetMeanEncoding.java @@ -7,13 +7,13 @@ package org.elasticsearch.xpack.core.ml.inference.preprocessing; import org.apache.lucene.util.RamUsageEstimator; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.mapper.NumberFieldMapper; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/AbstractFeatureImportance.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/AbstractFeatureImportance.java index 35f8f37059db0..b5d8bf8c3394b 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/AbstractFeatureImportance.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/AbstractFeatureImportance.java @@ -8,8 +8,8 @@ package org.elasticsearch.xpack.core.ml.inference.results; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Map; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/ClassificationFeatureImportance.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/ClassificationFeatureImportance.java index 56191b44fecab..7aae582e12a97 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/ClassificationFeatureImportance.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/ClassificationFeatureImportance.java @@ -6,16 +6,16 @@ */ package org.elasticsearch.xpack.core.ml.inference.results; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collections; @@ -25,8 +25,8 @@ import java.util.Objects; import java.util.stream.Collectors; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class ClassificationFeatureImportance extends AbstractFeatureImportance { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/ClassificationInferenceResults.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/ClassificationInferenceResults.java index 502d7bdc2641d..584445b7c362c 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/ClassificationInferenceResults.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/ClassificationInferenceResults.java @@ -8,7 +8,7 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.ClassificationConfig; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.InferenceConfig; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.PredictionFieldType; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/FillMaskResults.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/FillMaskResults.java index 253f7b7779676..e46d61df6fdf3 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/FillMaskResults.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/FillMaskResults.java @@ -9,7 +9,7 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.PredictionFieldType; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/InferenceResults.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/InferenceResults.java index 443d741346fa3..466b60a38f38c 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/InferenceResults.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/InferenceResults.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.inference.results; import org.elasticsearch.common.io.stream.NamedWriteable; -import org.elasticsearch.common.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.ToXContentFragment; import org.elasticsearch.ingest.IngestDocument; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/NerResults.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/NerResults.java index 5fdf455369be2..ee07cff858d73 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/NerResults.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/NerResults.java @@ -10,8 +10,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.LinkedHashMap; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/PyTorchPassThroughResults.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/PyTorchPassThroughResults.java index 0b532412822f3..30a7ff792ad75 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/PyTorchPassThroughResults.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/PyTorchPassThroughResults.java @@ -9,7 +9,7 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Arrays; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/RawInferenceResults.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/RawInferenceResults.java index 9713a001f77cf..e174e49de6a23 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/RawInferenceResults.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/RawInferenceResults.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.inference.results; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Arrays; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/RegressionFeatureImportance.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/RegressionFeatureImportance.java index c31f936392e84..b58481ba8b982 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/RegressionFeatureImportance.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/RegressionFeatureImportance.java @@ -6,18 +6,18 @@ */ package org.elasticsearch.xpack.core.ml.inference.results; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.LinkedHashMap; import java.util.Map; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; public class RegressionFeatureImportance extends AbstractFeatureImportance { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/RegressionInferenceResults.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/RegressionInferenceResults.java index 737b7b4aca367..95cef180cefa8 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/RegressionInferenceResults.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/RegressionInferenceResults.java @@ -8,7 +8,7 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.InferenceConfig; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.RegressionConfig; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/TextEmbeddingResults.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/TextEmbeddingResults.java index d83991b1a2c41..438f458f69e2e 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/TextEmbeddingResults.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/TextEmbeddingResults.java @@ -9,7 +9,7 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Arrays; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/TopClassEntry.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/TopClassEntry.java index 42286e7665f88..b4e05dcfdc7c2 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/TopClassEntry.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/TopClassEntry.java @@ -7,16 +7,16 @@ package org.elasticsearch.xpack.core.ml.inference.results; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; import java.io.IOException; @@ -24,7 +24,7 @@ import java.util.Map; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; public class TopClassEntry implements Writeable, ToXContentObject { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/WarningInferenceResults.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/WarningInferenceResults.java index 65b20572d3de2..de1a60ca4e2ba 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/WarningInferenceResults.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/WarningInferenceResults.java @@ -7,10 +7,10 @@ package org.elasticsearch.xpack.core.ml.inference.results; import org.elasticsearch.common.logging.LoggerMessageFormat; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.LinkedHashMap; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/BertTokenization.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/BertTokenization.java index 263d381451f07..a5ea7176db547 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/BertTokenization.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/BertTokenization.java @@ -9,10 +9,10 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.Nullable; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ClassificationConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ClassificationConfig.java index ec8957b3e5557..ea5cd6a9c6287 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ClassificationConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ClassificationConfig.java @@ -7,12 +7,12 @@ package org.elasticsearch.xpack.core.ml.inference.trainedmodel; import org.elasticsearch.Version; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ClassificationConfigUpdate.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ClassificationConfigUpdate.java index ceda8ce57718f..602931ee6947c 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ClassificationConfigUpdate.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ClassificationConfigUpdate.java @@ -6,12 +6,12 @@ */ package org.elasticsearch.xpack.core.ml.inference.trainedmodel; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; import org.elasticsearch.xpack.core.ml.utils.NamedXContentObject; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/FillMaskConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/FillMaskConfig.java index f5d71a7801afa..e47b6405e5f91 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/FillMaskConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/FillMaskConfig.java @@ -10,9 +10,9 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.Nullable; import org.elasticsearch.xpack.core.ml.inference.persistence.InferenceIndexConstants; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/FillMaskConfigUpdate.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/FillMaskConfigUpdate.java index 3d14f4561bea8..9c85af9e294b4 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/FillMaskConfigUpdate.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/FillMaskConfigUpdate.java @@ -9,9 +9,9 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; import org.elasticsearch.xpack.core.ml.utils.NamedXContentObject; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/IndexLocation.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/IndexLocation.java index e980d23dd2074..275c88ace08a2 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/IndexLocation.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/IndexLocation.java @@ -7,12 +7,12 @@ package org.elasticsearch.xpack.core.ml.inference.trainedmodel; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/InferenceStats.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/InferenceStats.java index edb2d231044b3..485be68329f8f 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/InferenceStats.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/InferenceStats.java @@ -7,14 +7,14 @@ package org.elasticsearch.xpack.core.ml.inference.trainedmodel; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.common.time.TimeUtils; import org.elasticsearch.xpack.core.ml.utils.ToXContentParams; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NerConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NerConfig.java index b0e18240da21e..1f7e8b721da69 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NerConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NerConfig.java @@ -10,9 +10,9 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.Nullable; import org.elasticsearch.xpack.core.ml.inference.persistence.InferenceIndexConstants; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NerConfigUpdate.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NerConfigUpdate.java index 1efcfe58e4b4b..4996324db77ef 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NerConfigUpdate.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NerConfigUpdate.java @@ -9,9 +9,9 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; import org.elasticsearch.xpack.core.ml.utils.NamedXContentObject; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NlpConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NlpConfig.java index a23a27ecf79f8..2cdcd765ecbca 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NlpConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NlpConfig.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.inference.trainedmodel; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; public interface NlpConfig extends LenientlyParsedInferenceConfig, StrictlyParsedInferenceConfig { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NullInferenceConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NullInferenceConfig.java index 0cd54c0ee3ee8..f5cf9364f9e3d 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NullInferenceConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NullInferenceConfig.java @@ -8,7 +8,7 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/PassThroughConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/PassThroughConfig.java index 5ebc54e018276..633df2a5d3e45 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/PassThroughConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/PassThroughConfig.java @@ -10,9 +10,9 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.Nullable; import org.elasticsearch.xpack.core.ml.inference.persistence.InferenceIndexConstants; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/PassThroughConfigUpdate.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/PassThroughConfigUpdate.java index 2d259f773b1d1..33c78e7933704 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/PassThroughConfigUpdate.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/PassThroughConfigUpdate.java @@ -9,9 +9,9 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; import org.elasticsearch.xpack.core.ml.utils.NamedXContentObject; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/RegressionConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/RegressionConfig.java index c52fdc302f8a3..caed2c9b2211c 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/RegressionConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/RegressionConfig.java @@ -7,12 +7,12 @@ package org.elasticsearch.xpack.core.ml.inference.trainedmodel; import org.elasticsearch.Version; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/RegressionConfigUpdate.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/RegressionConfigUpdate.java index bacd511fc6eb6..239c2a39ccf87 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/RegressionConfigUpdate.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/RegressionConfigUpdate.java @@ -6,12 +6,12 @@ */ package org.elasticsearch.xpack.core.ml.inference.trainedmodel; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; import org.elasticsearch.xpack.core.ml.utils.NamedXContentObject; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TargetType.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TargetType.java index 32d172a046abe..c25bc618d5607 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TargetType.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TargetType.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.core.ml.inference.trainedmodel; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextClassificationConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextClassificationConfig.java index 1eb5348aeb814..74805ced94f53 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextClassificationConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextClassificationConfig.java @@ -10,9 +10,9 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.Nullable; import org.elasticsearch.xpack.core.ml.inference.persistence.InferenceIndexConstants; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextClassificationConfigUpdate.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextClassificationConfigUpdate.java index fcb85d4e9f968..06b9bc424d0b6 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextClassificationConfigUpdate.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextClassificationConfigUpdate.java @@ -9,9 +9,9 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; import org.elasticsearch.xpack.core.ml.utils.NamedXContentObject; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextEmbeddingConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextEmbeddingConfig.java index 2939c8bd2e7f2..f5cf09e1b05d5 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextEmbeddingConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextEmbeddingConfig.java @@ -10,9 +10,9 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.Nullable; import org.elasticsearch.xpack.core.ml.inference.persistence.InferenceIndexConstants; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextEmbeddingConfigUpdate.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextEmbeddingConfigUpdate.java index 9bb196daaef6f..df1d39655215d 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextEmbeddingConfigUpdate.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextEmbeddingConfigUpdate.java @@ -9,9 +9,9 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; import org.elasticsearch.xpack.core.ml.utils.NamedXContentObject; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/Tokenization.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/Tokenization.java index 3b051f9462ed6..dc34ed7c3ec3c 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/Tokenization.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/Tokenization.java @@ -10,9 +10,9 @@ import org.elasticsearch.common.io.stream.NamedWriteable; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.core.Nullable; import org.elasticsearch.xpack.core.ml.utils.NamedXContentObject; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/VocabularyConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/VocabularyConfig.java index c64a915c10f9e..03061e9a97f1e 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/VocabularyConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/VocabularyConfig.java @@ -10,11 +10,11 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ZeroShotClassificationConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ZeroShotClassificationConfig.java index 1e9f34245e821..c7b75069ae80a 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ZeroShotClassificationConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ZeroShotClassificationConfig.java @@ -10,10 +10,10 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.Nullable; import org.elasticsearch.xpack.core.ml.inference.persistence.InferenceIndexConstants; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ZeroShotClassificationConfigUpdate.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ZeroShotClassificationConfigUpdate.java index b9af0403ce6c0..71fafc49a6984 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ZeroShotClassificationConfigUpdate.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ZeroShotClassificationConfigUpdate.java @@ -9,9 +9,9 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.Nullable; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; import org.elasticsearch.xpack.core.ml.utils.NamedXContentObject; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ensemble/Ensemble.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ensemble/Ensemble.java index 7c6bc1ee24f17..922d10ba3fec4 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ensemble/Ensemble.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ensemble/Ensemble.java @@ -11,12 +11,12 @@ import org.apache.lucene.util.RamUsageEstimator; import org.elasticsearch.Version; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.LenientlyParsedTrainedModel; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.StrictlyParsedTrainedModel; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.TargetType; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ensemble/Exponent.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ensemble/Exponent.java index 03db278447337..87d2832388d7b 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ensemble/Exponent.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ensemble/Exponent.java @@ -7,12 +7,12 @@ package org.elasticsearch.xpack.core.ml.inference.trainedmodel.ensemble; import org.apache.lucene.util.RamUsageEstimator; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.TargetType; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ensemble/LogisticRegression.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ensemble/LogisticRegression.java index 706d29a775f12..ec587d84e2530 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ensemble/LogisticRegression.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ensemble/LogisticRegression.java @@ -8,12 +8,12 @@ import org.apache.lucene.util.RamUsageEstimator; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.TargetType; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ensemble/WeightedMode.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ensemble/WeightedMode.java index 53a6a26bac832..e707a8e30bbaf 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ensemble/WeightedMode.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ensemble/WeightedMode.java @@ -8,12 +8,12 @@ import org.apache.lucene.util.RamUsageEstimator; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.TargetType; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ensemble/WeightedSum.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ensemble/WeightedSum.java index 41e1fb2bf99a3..40e0563ed634b 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ensemble/WeightedSum.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ensemble/WeightedSum.java @@ -8,12 +8,12 @@ import org.apache.lucene.util.RamUsageEstimator; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.TargetType; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/inference/EnsembleInferenceModel.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/inference/EnsembleInferenceModel.java index 8e7c94757516a..a93b6b24da4e6 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/inference/EnsembleInferenceModel.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/inference/EnsembleInferenceModel.java @@ -14,8 +14,8 @@ import org.elasticsearch.core.Nullable; import org.elasticsearch.common.Strings; import org.elasticsearch.core.Tuple; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.inference.results.ClassificationInferenceResults; import org.elasticsearch.xpack.core.ml.inference.results.InferenceResults; import org.elasticsearch.xpack.core.ml.inference.results.RawInferenceResults; @@ -40,8 +40,8 @@ import java.util.stream.Collectors; import java.util.stream.IntStream; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; import static org.elasticsearch.xpack.core.ml.inference.trainedmodel.InferenceHelpers.classificationLabel; import static org.elasticsearch.xpack.core.ml.inference.trainedmodel.InferenceHelpers.decodeFeatureImportances; import static org.elasticsearch.xpack.core.ml.inference.trainedmodel.InferenceHelpers.sumDoubleArrays; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/inference/InferenceDefinition.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/inference/InferenceDefinition.java index 8077b37792dae..f1d2da413b9fe 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/inference/InferenceDefinition.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/inference/InferenceDefinition.java @@ -8,8 +8,8 @@ package org.elasticsearch.xpack.core.ml.inference.trainedmodel.inference; import org.apache.lucene.util.RamUsageEstimator; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.inference.preprocessing.LenientlyParsedPreProcessor; import org.elasticsearch.xpack.core.ml.inference.preprocessing.PreProcessor; import org.elasticsearch.xpack.core.ml.inference.results.InferenceResults; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/inference/TreeInferenceModel.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/inference/TreeInferenceModel.java index 48d1e9c26ea39..8ea8b9821c7b0 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/inference/TreeInferenceModel.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/inference/TreeInferenceModel.java @@ -14,9 +14,9 @@ import org.elasticsearch.core.Nullable; import org.elasticsearch.common.Numbers; import org.elasticsearch.core.Tuple; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.inference.results.ClassificationInferenceResults; import org.elasticsearch.xpack.core.ml.inference.results.InferenceResults; import org.elasticsearch.xpack.core.ml.inference.results.RawInferenceResults; @@ -42,8 +42,8 @@ import static org.apache.lucene.util.RamUsageEstimator.shallowSizeOfInstance; import static org.apache.lucene.util.RamUsageEstimator.sizeOf; import static org.apache.lucene.util.RamUsageEstimator.sizeOfCollection; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; import static org.elasticsearch.xpack.core.ml.inference.trainedmodel.InferenceHelpers.classificationLabel; import static org.elasticsearch.xpack.core.ml.inference.trainedmodel.InferenceHelpers.decodeFeatureImportances; import static org.elasticsearch.xpack.core.ml.inference.trainedmodel.tree.Tree.CLASSIFICATION_LABELS; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/langident/LangIdentNeuralNetwork.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/langident/LangIdentNeuralNetwork.java index da708d9516c9a..ead27ceab3dd9 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/langident/LangIdentNeuralNetwork.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/langident/LangIdentNeuralNetwork.java @@ -8,13 +8,13 @@ package org.elasticsearch.xpack.core.ml.inference.trainedmodel.langident; import org.apache.lucene.util.RamUsageEstimator; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.Tuple; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.inference.results.ClassificationInferenceResults; import org.elasticsearch.xpack.core.ml.inference.results.InferenceResults; import org.elasticsearch.xpack.core.ml.inference.results.TopClassEntry; @@ -35,7 +35,7 @@ import java.util.Map; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; import static org.elasticsearch.xpack.core.ml.inference.utils.Statistics.softMax; public class LangIdentNeuralNetwork implements StrictlyParsedTrainedModel, LenientlyParsedTrainedModel, InferenceModel { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/langident/LangNetLayer.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/langident/LangNetLayer.java index e6c100f02243e..b51c6e9975419 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/langident/LangNetLayer.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/langident/LangNetLayer.java @@ -9,13 +9,13 @@ import org.apache.lucene.util.Accountable; import org.apache.lucene.util.RamUsageEstimator; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; import java.io.IOException; @@ -23,7 +23,7 @@ import java.util.List; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; /** * Represents a single layer in the compressed Lang Net diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/metadata/FeatureImportanceBaseline.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/metadata/FeatureImportanceBaseline.java index 48f9397315a4f..22c8ca75c3b1f 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/metadata/FeatureImportanceBaseline.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/metadata/FeatureImportanceBaseline.java @@ -7,16 +7,16 @@ package org.elasticsearch.xpack.core.ml.inference.trainedmodel.metadata; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collections; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/metadata/Hyperparameters.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/metadata/Hyperparameters.java index 04878ceaba2a1..5f8c263dffebf 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/metadata/Hyperparameters.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/metadata/Hyperparameters.java @@ -7,14 +7,14 @@ package org.elasticsearch.xpack.core.ml.inference.trainedmodel.metadata; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/metadata/TotalFeatureImportance.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/metadata/TotalFeatureImportance.java index 3670877ede75e..c494a57a8b252 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/metadata/TotalFeatureImportance.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/metadata/TotalFeatureImportance.java @@ -8,16 +8,16 @@ package org.elasticsearch.xpack.core.ml.inference.trainedmodel.metadata; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collections; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/metadata/TrainedModelMetadata.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/metadata/TrainedModelMetadata.java index e3c3890bb2db5..430dd848be32d 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/metadata/TrainedModelMetadata.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/metadata/TrainedModelMetadata.java @@ -7,14 +7,14 @@ package org.elasticsearch.xpack.core.ml.inference.trainedmodel.metadata; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.inference.persistence.InferenceIndexConstants; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; import org.elasticsearch.xpack.core.ml.utils.ToXContentParams; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/tree/Tree.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/tree/Tree.java index 8642202f1c2f4..561b7e41e5cf9 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/tree/Tree.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/tree/Tree.java @@ -10,13 +10,13 @@ import org.apache.lucene.util.Accountables; import org.apache.lucene.util.RamUsageEstimator; import org.elasticsearch.Version; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.LenientlyParsedTrainedModel; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.StrictlyParsedTrainedModel; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.TargetType; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/tree/TreeNode.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/tree/TreeNode.java index dd3e64a74fe2a..79b23c5335633 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/tree/TreeNode.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/tree/TreeNode.java @@ -9,15 +9,15 @@ import org.apache.lucene.util.Accountable; import org.apache.lucene.util.RamUsageEstimator; import org.elasticsearch.common.Numbers; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.job.config.Operator; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/AnalysisConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/AnalysisConfig.java index 6e8cb3845de63..88281f1849bd5 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/AnalysisConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/AnalysisConfig.java @@ -11,11 +11,11 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.core.TimeValue; import org.elasticsearch.xpack.core.common.time.TimeUtils; import org.elasticsearch.xpack.core.ml.job.messages.Messages; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/AnalysisLimits.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/AnalysisLimits.java index 6ee0cf3eadea7..aa68c3a1ddfe7 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/AnalysisLimits.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/AnalysisLimits.java @@ -7,16 +7,16 @@ package org.elasticsearch.xpack.core.ml.job.config; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.job.messages.Messages; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/Blocked.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/Blocked.java index 757168f351cf0..fb5f454ba81b1 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/Blocked.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/Blocked.java @@ -10,10 +10,10 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.core.Nullable; import org.elasticsearch.tasks.TaskId; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/CategorizationAnalyzerConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/CategorizationAnalyzerConfig.java index cedc046b26674..bf2849f568d55 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/CategorizationAnalyzerConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/CategorizationAnalyzerConfig.java @@ -7,17 +7,17 @@ package org.elasticsearch.xpack.core.ml.job.config; import org.elasticsearch.action.admin.indices.analyze.AnalyzeAction; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.analysis.NameOrDefinition; import org.elasticsearch.rest.action.admin.indices.RestAnalyzeAction; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/DataDescription.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/DataDescription.java index acb9d39a93a77..149a6092ee8aa 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/DataDescription.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/DataDescription.java @@ -7,13 +7,13 @@ package org.elasticsearch.xpack.core.ml.job.config; import org.elasticsearch.Version; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ml.job.messages.Messages; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; import org.elasticsearch.xpack.core.ml.utils.time.DateTimeFormatterTimestampConverter; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/DetectionRule.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/DetectionRule.java index 65d6ebfc30f2c..2cc3fb9b2a57a 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/DetectionRule.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/DetectionRule.java @@ -6,13 +6,13 @@ */ package org.elasticsearch.xpack.core.ml.job.config; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ml.job.messages.Messages; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/Detector.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/Detector.java index 031f0cd2e37c3..a821e1ecca0ff 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/Detector.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/Detector.java @@ -7,14 +7,14 @@ package org.elasticsearch.xpack.core.ml.job.config; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ml.job.messages.Messages; import org.elasticsearch.xpack.core.ml.process.writer.RecordWriter; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/FilterRef.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/FilterRef.java index 0af9fbd4c8f30..1443e4b6f7db2 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/FilterRef.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/FilterRef.java @@ -6,13 +6,13 @@ */ package org.elasticsearch.xpack.core.ml.job.config; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Locale; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/Job.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/Job.java index 66cb7af944cd3..1d06f55b45189 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/Job.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/Job.java @@ -11,17 +11,17 @@ import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.cluster.AbstractDiffable; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ml.datafeed.DatafeedConfig; import org.elasticsearch.xpack.core.ml.job.messages.Messages; import org.elasticsearch.xpack.core.ml.job.persistence.AnomalyDetectorsIndexFields; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/JobTaskState.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/JobTaskState.java index c7456d3388532..5c5ab2e9cea9a 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/JobTaskState.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/JobTaskState.java @@ -8,10 +8,10 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.Nullable; import org.elasticsearch.persistent.PersistentTaskState; import org.elasticsearch.persistent.PersistentTasksCustomMetadata.PersistentTask; @@ -20,8 +20,8 @@ import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class JobTaskState implements PersistentTaskState { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/JobUpdate.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/JobUpdate.java index 42b641eb59a40..f3ee728050869 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/JobUpdate.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/JobUpdate.java @@ -8,16 +8,16 @@ import org.elasticsearch.Version; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ml.job.process.autodetect.state.ModelSnapshot; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/MlFilter.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/MlFilter.java index 3c38d3f3842b0..175a9e2058c04 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/MlFilter.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/MlFilter.java @@ -7,13 +7,13 @@ package org.elasticsearch.xpack.core.ml.job.config; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ml.job.messages.Messages; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; import org.elasticsearch.xpack.core.ml.utils.MlStrings; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/ModelPlotConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/ModelPlotConfig.java index bee478ee4c0db..231088288c4da 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/ModelPlotConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/ModelPlotConfig.java @@ -6,13 +6,13 @@ */ package org.elasticsearch.xpack.core.ml.job.config; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/Operator.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/Operator.java index 18a2be4b80471..616cec1220988 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/Operator.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/Operator.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.core.ml.job.config; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/PerPartitionCategorizationConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/PerPartitionCategorizationConfig.java index 21faa75483cd1..9d73d743e91f9 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/PerPartitionCategorizationConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/PerPartitionCategorizationConfig.java @@ -6,13 +6,13 @@ */ package org.elasticsearch.xpack.core.ml.job.config; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/RuleCondition.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/RuleCondition.java index 36353f7246dba..2705533f481cd 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/RuleCondition.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/RuleCondition.java @@ -6,13 +6,13 @@ */ package org.elasticsearch.xpack.core.ml.job.config; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Locale; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/RuleScope.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/RuleScope.java index 256cfeca65582..599b10680603d 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/RuleScope.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/config/RuleScope.java @@ -10,14 +10,14 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ContextParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ContextParser; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.job.messages.Messages; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/persistence/ElasticsearchMappings.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/persistence/ElasticsearchMappings.java index 69e4787c663c4..00e4fecca2fac 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/persistence/ElasticsearchMappings.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/persistence/ElasticsearchMappings.java @@ -23,7 +23,7 @@ import org.elasticsearch.common.CheckedSupplier; import org.elasticsearch.common.collect.ImmutableOpenMap; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.Index; import org.elasticsearch.plugins.MapperPlugin; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/output/FlushAcknowledgement.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/output/FlushAcknowledgement.java index bca3c6480f203..d84e904f44025 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/output/FlushAcknowledgement.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/output/FlushAcknowledgement.java @@ -6,13 +6,13 @@ */ package org.elasticsearch.xpack.core.ml.job.process.autodetect.output; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.time.Instant; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/CategorizerStats.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/CategorizerStats.java index 3044ef0f6a970..6fce6b37d8bda 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/CategorizerStats.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/CategorizerStats.java @@ -8,14 +8,14 @@ package org.elasticsearch.xpack.core.ml.job.process.autodetect.state; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.common.time.TimeUtils; import org.elasticsearch.xpack.core.ml.MachineLearningField; import org.elasticsearch.xpack.core.ml.job.config.Job; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/DataCounts.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/DataCounts.java index 3a01b49471f60..7a34a90f6165c 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/DataCounts.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/DataCounts.java @@ -6,14 +6,14 @@ */ package org.elasticsearch.xpack.core.ml.job.process.autodetect.state; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.common.time.TimeUtils; import org.elasticsearch.xpack.core.ml.job.config.Job; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/ModelSizeStats.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/ModelSizeStats.java index 17c7d446dfa55..8192af2db0c73 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/ModelSizeStats.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/ModelSizeStats.java @@ -7,14 +7,14 @@ package org.elasticsearch.xpack.core.ml.job.process.autodetect.state; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ml.job.config.Job; import org.elasticsearch.xpack.core.ml.job.results.Result; import org.elasticsearch.xpack.core.common.time.TimeUtils; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/ModelSnapshot.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/ModelSnapshot.java index 1cf7a3c0f2ad8..de1c9963b60a4 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/ModelSnapshot.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/ModelSnapshot.java @@ -8,20 +8,20 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.Version; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.common.time.TimeUtils; import org.elasticsearch.xpack.core.ml.job.config.Job; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/ModelSnapshotField.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/ModelSnapshotField.java index 57aac614fc5d5..030759ee6f587 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/ModelSnapshotField.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/ModelSnapshotField.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.core.ml.job.process.autodetect.state; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; public final class ModelSnapshotField { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/Quantiles.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/Quantiles.java index cafc7bedb6266..8e78f540390d0 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/Quantiles.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/Quantiles.java @@ -6,14 +6,14 @@ */ package org.elasticsearch.xpack.core.ml.job.process.autodetect.state; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ml.job.config.Job; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/TimingStats.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/TimingStats.java index 3eb24d9c5cbb2..65a7b221f55e2 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/TimingStats.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/TimingStats.java @@ -7,14 +7,14 @@ package org.elasticsearch.xpack.core.ml.job.process.autodetect.state; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ml.job.config.Job; import org.elasticsearch.xpack.core.ml.job.results.Result; import org.elasticsearch.xpack.core.ml.utils.ExponentialAverageCalculationContext; @@ -24,8 +24,8 @@ import java.time.Instant; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * Stats that give more insight into timing of various operations performed as part of anomaly detection job. diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/results/AnomalyCause.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/results/AnomalyCause.java index 9043cd7fe1ee1..b79212b2087fc 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/results/AnomalyCause.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/results/AnomalyCause.java @@ -6,14 +6,14 @@ */ package org.elasticsearch.xpack.core.ml.job.results; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.List; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/results/AnomalyRecord.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/results/AnomalyRecord.java index 1e057ac3f1f62..8d98d255e7843 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/results/AnomalyRecord.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/results/AnomalyRecord.java @@ -6,15 +6,15 @@ */ package org.elasticsearch.xpack.core.ml.job.results; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ml.MachineLearningField; import org.elasticsearch.xpack.core.ml.job.config.Detector; import org.elasticsearch.xpack.core.ml.job.config.Job; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/results/Bucket.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/results/Bucket.java index 69cc035a585d8..73053254f69ae 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/results/Bucket.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/results/Bucket.java @@ -7,14 +7,14 @@ package org.elasticsearch.xpack.core.ml.job.results; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ml.job.config.Job; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; import org.elasticsearch.xpack.core.common.time.TimeUtils; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/results/BucketInfluencer.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/results/BucketInfluencer.java index 31a49aa347069..39b9179be9369 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/results/BucketInfluencer.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/results/BucketInfluencer.java @@ -6,14 +6,14 @@ */ package org.elasticsearch.xpack.core.ml.job.results; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ml.job.config.Job; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; import org.elasticsearch.xpack.core.common.time.TimeUtils; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/results/CategoryDefinition.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/results/CategoryDefinition.java index f469781152717..217ee348daccb 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/results/CategoryDefinition.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/results/CategoryDefinition.java @@ -6,13 +6,13 @@ */ package org.elasticsearch.xpack.core.ml.job.results; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ml.job.config.Job; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/results/Forecast.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/results/Forecast.java index 4d2749eb43731..f93568a870e99 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/results/Forecast.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/results/Forecast.java @@ -6,14 +6,14 @@ */ package org.elasticsearch.xpack.core.ml.job.results; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ml.MachineLearningField; import org.elasticsearch.xpack.core.ml.job.config.Job; import org.elasticsearch.xpack.core.common.time.TimeUtils; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/results/ForecastRequestStats.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/results/ForecastRequestStats.java index fcdac9c2310bb..3836568b7552f 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/results/ForecastRequestStats.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/results/ForecastRequestStats.java @@ -6,14 +6,14 @@ */ package org.elasticsearch.xpack.core.ml.job.results; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ml.job.config.Job; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/results/GeoResults.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/results/GeoResults.java index 622b6883edc0b..53f6d042799f7 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/results/GeoResults.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/results/GeoResults.java @@ -6,13 +6,13 @@ */ package org.elasticsearch.xpack.core.ml.job.results; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/results/Influence.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/results/Influence.java index 7633b23e64b22..a461967e5d1ce 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/results/Influence.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/results/Influence.java @@ -6,13 +6,13 @@ */ package org.elasticsearch.xpack.core.ml.job.results; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Arrays; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/results/Influencer.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/results/Influencer.java index 0cf1226e948cd..2a89e71893855 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/results/Influencer.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/results/Influencer.java @@ -6,14 +6,14 @@ */ package org.elasticsearch.xpack.core.ml.job.results; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ml.MachineLearningField; import org.elasticsearch.xpack.core.ml.job.config.Job; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/results/ModelPlot.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/results/ModelPlot.java index 85eca30bf3db3..5058e95c0b21b 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/results/ModelPlot.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/results/ModelPlot.java @@ -6,14 +6,14 @@ */ package org.elasticsearch.xpack.core.ml.job.results; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ml.MachineLearningField; import org.elasticsearch.xpack.core.ml.job.config.Job; import org.elasticsearch.xpack.core.common.time.TimeUtils; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/results/OverallBucket.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/results/OverallBucket.java index 6de6dbbdb8ed2..cbcde34cef3dc 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/results/OverallBucket.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/results/OverallBucket.java @@ -6,12 +6,12 @@ */ package org.elasticsearch.xpack.core.ml.job.results; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ml.job.config.Job; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/results/Result.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/results/Result.java index fc8708c194789..84fc151c0536f 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/results/Result.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/results/Result.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.job.results; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; /** * A wrapper for concrete result objects plus meta information. diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/snapshot/upgrade/SnapshotUpgradeTaskState.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/snapshot/upgrade/SnapshotUpgradeTaskState.java index 6d4182dbbfdb9..3863a2fc7548f 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/snapshot/upgrade/SnapshotUpgradeTaskState.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/snapshot/upgrade/SnapshotUpgradeTaskState.java @@ -9,10 +9,10 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.Nullable; import org.elasticsearch.persistent.PersistentTaskState; import org.elasticsearch.xpack.core.ml.MlTasks; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/notifications/AnomalyDetectionAuditMessage.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/notifications/AnomalyDetectionAuditMessage.java index 866d997c87e67..c43929bd17aec 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/notifications/AnomalyDetectionAuditMessage.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/notifications/AnomalyDetectionAuditMessage.java @@ -6,8 +6,8 @@ */ package org.elasticsearch.xpack.core.ml.notifications; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; import org.elasticsearch.xpack.core.common.notifications.AbstractAuditMessage; import org.elasticsearch.xpack.core.common.notifications.Level; import org.elasticsearch.xpack.core.ml.job.config.Job; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/notifications/DataFrameAnalyticsAuditMessage.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/notifications/DataFrameAnalyticsAuditMessage.java index ca90379e79ee3..f7f8ddb2536a7 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/notifications/DataFrameAnalyticsAuditMessage.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/notifications/DataFrameAnalyticsAuditMessage.java @@ -6,8 +6,8 @@ */ package org.elasticsearch.xpack.core.ml.notifications; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; import org.elasticsearch.xpack.core.common.notifications.AbstractAuditMessage; import org.elasticsearch.xpack.core.common.notifications.Level; import org.elasticsearch.xpack.core.ml.job.config.Job; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/notifications/InferenceAuditMessage.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/notifications/InferenceAuditMessage.java index 5aaa01c2334fb..31095325dc52f 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/notifications/InferenceAuditMessage.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/notifications/InferenceAuditMessage.java @@ -6,8 +6,8 @@ */ package org.elasticsearch.xpack.core.ml.notifications; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; import org.elasticsearch.xpack.core.common.notifications.AbstractAuditMessage; import org.elasticsearch.xpack.core.common.notifications.Level; import org.elasticsearch.xpack.core.ml.job.config.Job; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/stats/ForecastStats.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/stats/ForecastStats.java index 31342a5ce0413..520d07c359baa 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/stats/ForecastStats.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/stats/ForecastStats.java @@ -10,8 +10,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.HashMap; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/utils/ExceptionsHelper.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/utils/ExceptionsHelper.java index 1710459c0908b..03ee5af56f010 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/utils/ExceptionsHelper.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/utils/ExceptionsHelper.java @@ -12,7 +12,7 @@ import org.elasticsearch.ResourceNotFoundException; import org.elasticsearch.action.search.SearchPhaseExecutionException; import org.elasticsearch.action.search.ShardSearchFailure; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.search.SearchShardTarget; import org.elasticsearch.xpack.core.ml.job.messages.Messages; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/utils/ExponentialAverageCalculationContext.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/utils/ExponentialAverageCalculationContext.java index 0f79b34de3e0e..b104f7b38ecd6 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/utils/ExponentialAverageCalculationContext.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/utils/ExponentialAverageCalculationContext.java @@ -7,15 +7,15 @@ package org.elasticsearch.xpack.core.ml.utils; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.common.time.TimeUtils; import java.io.IOException; @@ -25,7 +25,7 @@ import java.time.temporal.TemporalUnit; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * Utility for calculating current value of exponentially-weighted moving average per fixed-sized time window. diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/utils/MlIndexAndAlias.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/utils/MlIndexAndAlias.java index 7f0ecbc9a2076..35abccb925eb8 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/utils/MlIndexAndAlias.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/utils/MlIndexAndAlias.java @@ -33,10 +33,10 @@ import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; import org.elasticsearch.core.Nullable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.indices.SystemIndexDescriptor; import org.elasticsearch.xpack.core.template.IndexTemplateConfig; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/utils/MlParserUtils.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/utils/MlParserUtils.java index 3e1dafd01ab60..e13046e213d84 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/utils/MlParserUtils.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/utils/MlParserUtils.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.core.ml.utils; import org.elasticsearch.core.CheckedFunction; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/utils/NamedXContentObject.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/utils/NamedXContentObject.java index 3167b5e41e87b..109320a8ae6d5 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/utils/NamedXContentObject.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/utils/NamedXContentObject.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.core.ml.utils; -import org.elasticsearch.common.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.ToXContentObject; /** * Simple interface for XContent Objects that are named. diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/utils/NamedXContentObjectHelper.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/utils/NamedXContentObjectHelper.java index 3075320b3bcaa..a23bc526dcae6 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/utils/NamedXContentObjectHelper.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/utils/NamedXContentObjectHelper.java @@ -6,8 +6,8 @@ */ package org.elasticsearch.xpack.core.ml.utils; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.List; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/utils/PhaseProgress.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/utils/PhaseProgress.java index 4582e562d2aea..734138b27ccf7 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/utils/PhaseProgress.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/utils/PhaseProgress.java @@ -6,14 +6,14 @@ */ package org.elasticsearch.xpack.core.ml.utils; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/utils/QueryProvider.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/utils/QueryProvider.java index ecac6eb7fb661..29de396317d7e 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/utils/QueryProvider.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/utils/QueryProvider.java @@ -11,10 +11,10 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.query.MatchAllQueryBuilder; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilders; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/utils/XContentObjectTransformer.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/utils/XContentObjectTransformer.java index 530a062a344c5..267b4a25bdc11 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/utils/XContentObjectTransformer.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/utils/XContentObjectTransformer.java @@ -8,14 +8,14 @@ import org.elasticsearch.core.CheckedFunction; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.query.AbstractQueryBuilder; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.search.aggregations.AggregatorFactories; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/monitoring/MonitoringFeatureSetUsage.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/monitoring/MonitoringFeatureSetUsage.java index 0dc660fc931d6..127f149c11cdc 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/monitoring/MonitoringFeatureSetUsage.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/monitoring/MonitoringFeatureSetUsage.java @@ -10,7 +10,7 @@ import org.elasticsearch.core.Nullable; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.XPackFeatureSet; import org.elasticsearch.xpack.core.XPackField; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/monitoring/action/MonitoringBulkDoc.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/monitoring/action/MonitoringBulkDoc.java index e6961e1e235cd..2a3d40d871166 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/monitoring/action/MonitoringBulkDoc.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/monitoring/action/MonitoringBulkDoc.java @@ -14,7 +14,7 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.monitoring.MonitoredSystem; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/monitoring/action/MonitoringBulkRequest.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/monitoring/action/MonitoringBulkRequest.java index c78d36ff0dc54..eafec818b5e8e 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/monitoring/action/MonitoringBulkRequest.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/monitoring/action/MonitoringBulkRequest.java @@ -13,7 +13,7 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.monitoring.MonitoredSystem; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/monitoring/action/MonitoringBulkRequestBuilder.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/monitoring/action/MonitoringBulkRequestBuilder.java index 8d4273aad45c6..b58940fa6a490 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/monitoring/action/MonitoringBulkRequestBuilder.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/monitoring/action/MonitoringBulkRequestBuilder.java @@ -9,7 +9,7 @@ import org.elasticsearch.action.ActionRequestBuilder; import org.elasticsearch.client.ElasticsearchClient; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.monitoring.MonitoredSystem; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/monitoring/action/MonitoringBulkResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/monitoring/action/MonitoringBulkResponse.java index 3a3d84206dd40..2c115863457e2 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/monitoring/action/MonitoringBulkResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/monitoring/action/MonitoringBulkResponse.java @@ -13,8 +13,8 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.rest.RestStatus; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/monitoring/action/MonitoringMigrateAlertsResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/monitoring/action/MonitoringMigrateAlertsResponse.java index d5a9fa708049e..4776bd3a22645 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/monitoring/action/MonitoringMigrateAlertsResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/monitoring/action/MonitoringMigrateAlertsResponse.java @@ -13,9 +13,9 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.List; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/monitoring/exporter/MonitoringDoc.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/monitoring/exporter/MonitoringDoc.java index 7114a2e8f3e95..5f44456ca9f5d 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/monitoring/exporter/MonitoringDoc.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/monitoring/exporter/MonitoringDoc.java @@ -11,8 +11,8 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.time.DateFormatter; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.monitoring.MonitoredSystem; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rest/action/RestXPackUsageAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rest/action/RestXPackUsageAction.java index e94796cc5c464..8686e4f7a5177 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rest/action/RestXPackUsageAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rest/action/RestXPackUsageAction.java @@ -9,7 +9,7 @@ import org.elasticsearch.action.support.master.MasterNodeRequest; import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.http.HttpChannel; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BytesRestResponse; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/RollupActionConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/RollupActionConfig.java index 09b255a489394..8192614c17d02 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/RollupActionConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/RollupActionConfig.java @@ -8,15 +8,15 @@ import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.fieldcaps.FieldCapabilities; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.NamedWriteable; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.rollup.action.RollupAction; import org.elasticsearch.xpack.core.rollup.job.MetricConfig; @@ -28,7 +28,7 @@ import java.util.Objects; import java.util.Set; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * This class holds the configuration details of a {@link RollupAction} job, such as the groupings, metrics, what diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/RollupActionDateHistogramGroupConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/RollupActionDateHistogramGroupConfig.java index 516e22d99ce6d..e6c5391f90b29 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/RollupActionDateHistogramGroupConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/RollupActionDateHistogramGroupConfig.java @@ -9,17 +9,17 @@ import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.fieldcaps.FieldCapabilities; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Rounding; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramAggregationBuilder; import org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramInterval; @@ -28,9 +28,9 @@ import java.util.Map; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; -import static org.elasticsearch.common.xcontent.ObjectParser.ValueType; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ObjectParser.ValueType; /** * The configuration object for the histograms in the rollup config diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/RollupActionGroupConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/RollupActionGroupConfig.java index fe2807782f37a..8939f15e3380b 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/RollupActionGroupConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/RollupActionGroupConfig.java @@ -9,15 +9,15 @@ import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.fieldcaps.FieldCapabilities; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.rollup.job.HistogramGroupConfig; import org.elasticsearch.xpack.core.rollup.job.TermsGroupConfig; @@ -29,8 +29,8 @@ import java.util.Set; import static java.util.Arrays.asList; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * The configuration object for the groups section in the rollup config. diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/RollupField.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/RollupField.java index c67f284070182..1da661d2c249a 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/RollupField.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/RollupField.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.core.rollup; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.index.mapper.DateFieldMapper; import org.elasticsearch.index.mapper.NumberFieldMapper; import org.elasticsearch.search.aggregations.metrics.AvgAggregationBuilder; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/DeleteRollupJobAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/DeleteRollupJobAction.java index c4e93be31bd2b..ee4f9fc9a377b 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/DeleteRollupJobAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/DeleteRollupJobAction.java @@ -18,9 +18,9 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.tasks.Task; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; import org.elasticsearch.xpack.core.rollup.RollupField; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/GetRollupCapsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/GetRollupCapsAction.java index a56ad215ed805..f05acd96d0c38 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/GetRollupCapsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/GetRollupCapsAction.java @@ -13,14 +13,14 @@ import org.elasticsearch.action.ActionType; import org.elasticsearch.client.ElasticsearchClient; import org.elasticsearch.cluster.metadata.Metadata; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.rollup.RollupField; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/GetRollupIndexCapsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/GetRollupIndexCapsAction.java index 9fb93c352f73d..cadbb0615fad1 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/GetRollupIndexCapsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/GetRollupIndexCapsAction.java @@ -15,14 +15,14 @@ import org.elasticsearch.action.IndicesRequest; import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.client.ElasticsearchClient; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.rollup.RollupField; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/GetRollupJobsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/GetRollupJobsAction.java index 9f41c2689df35..83bff449c28d2 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/GetRollupJobsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/GetRollupJobsAction.java @@ -16,14 +16,14 @@ import org.elasticsearch.action.support.tasks.BaseTasksResponse; import org.elasticsearch.client.ElasticsearchClient; import org.elasticsearch.cluster.metadata.Metadata; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.tasks.Task; import org.elasticsearch.xpack.core.rollup.RollupField; import org.elasticsearch.xpack.core.rollup.job.RollupIndexerJobStats; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/PutRollupJobAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/PutRollupJobAction.java index 9f3aa83ca1f28..d1e7a0ea08066 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/PutRollupJobAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/PutRollupJobAction.java @@ -17,9 +17,9 @@ import org.elasticsearch.client.ElasticsearchClient; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.rollup.job.RollupJobConfig; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/RollableIndexCaps.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/RollableIndexCaps.java index e73bfe9d32d80..819ff7fa6bf99 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/RollableIndexCaps.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/RollableIndexCaps.java @@ -6,12 +6,12 @@ */ package org.elasticsearch.xpack.core.rollup.action; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Collections; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/RollupAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/RollupAction.java index e76cb0061bcd7..fe3ab3c654e41 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/RollupAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/RollupAction.java @@ -17,8 +17,8 @@ import org.elasticsearch.client.ElasticsearchClient; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.tasks.Task; import org.elasticsearch.tasks.TaskId; import org.elasticsearch.xpack.core.rollup.RollupActionConfig; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/RollupIndexerAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/RollupIndexerAction.java index 67180af7aca21..49ac479211d31 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/RollupIndexerAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/RollupIndexerAction.java @@ -20,8 +20,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.tasks.Task; import org.elasticsearch.tasks.TaskId; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/RollupJobCaps.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/RollupJobCaps.java index 4de41df47050f..044841f5e7016 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/RollupJobCaps.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/RollupJobCaps.java @@ -6,13 +6,13 @@ */ package org.elasticsearch.xpack.core.rollup.action; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramAggregationBuilder; import org.elasticsearch.search.aggregations.bucket.histogram.HistogramAggregationBuilder; import org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/StartRollupJobAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/StartRollupJobAction.java index cf464c7781088..3b413fd85f52e 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/StartRollupJobAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/StartRollupJobAction.java @@ -16,8 +16,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; import org.elasticsearch.xpack.core.rollup.RollupField; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/StopRollupJobAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/StopRollupJobAction.java index 6c6feca93cd50..b804bcae78659 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/StopRollupJobAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/StopRollupJobAction.java @@ -13,13 +13,13 @@ import org.elasticsearch.action.support.tasks.BaseTasksResponse; import org.elasticsearch.client.ElasticsearchClient; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; import org.elasticsearch.xpack.core.rollup.RollupField; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/job/DateHistogramGroupConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/job/DateHistogramGroupConfig.java index a8de715ce2457..b9f39abab724a 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/job/DateHistogramGroupConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/job/DateHistogramGroupConfig.java @@ -9,17 +9,17 @@ import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.fieldcaps.FieldCapabilities; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Rounding; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramAggregationBuilder; import org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramInterval; import org.elasticsearch.xpack.core.rollup.RollupField; @@ -30,9 +30,9 @@ import java.util.Map; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; -import static org.elasticsearch.common.xcontent.ObjectParser.ValueType; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ObjectParser.ValueType; /** * The configuration object for the histograms in the rollup config diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/job/GroupConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/job/GroupConfig.java index 08a43002d8b0d..bf356638e38fd 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/job/GroupConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/job/GroupConfig.java @@ -9,15 +9,15 @@ import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.fieldcaps.FieldCapabilities; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collections; @@ -27,8 +27,8 @@ import java.util.Set; import static java.util.Arrays.asList; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * The configuration object for the groups section in the rollup config. diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/job/HistogramGroupConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/job/HistogramGroupConfig.java index a7e5594af583b..3c76925f19903 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/job/HistogramGroupConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/job/HistogramGroupConfig.java @@ -8,15 +8,15 @@ import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.fieldcaps.FieldCapabilities; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.rollup.RollupField; import java.io.IOException; @@ -25,7 +25,7 @@ import java.util.Map; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; /** * The configuration object for the histograms in the rollup config diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/job/MetricConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/job/MetricConfig.java index 7d705e71cbc66..eb08396f61b18 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/job/MetricConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/job/MetricConfig.java @@ -8,15 +8,15 @@ import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.fieldcaps.FieldCapabilities; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.rollup.RollupField; import java.io.IOException; @@ -25,7 +25,7 @@ import java.util.Map; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; /** * The configuration object for the metrics portion of a rollup job config diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/job/RollupIndexerJobStats.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/job/RollupIndexerJobStats.java index 2299f594801a8..04c186ddc94d4 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/job/RollupIndexerJobStats.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/job/RollupIndexerJobStats.java @@ -6,16 +6,16 @@ */ package org.elasticsearch.xpack.core.rollup.job; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.indexing.IndexerJobStats; import java.io.IOException; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; /** * The Rollup specialization of stats for the AsyncTwoPhaseIndexer. diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/job/RollupJob.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/job/RollupJob.java index 6d59d7b70dc78..503e4977513ed 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/job/RollupJob.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/job/RollupJob.java @@ -9,12 +9,12 @@ import org.elasticsearch.Version; import org.elasticsearch.cluster.AbstractDiffable; import org.elasticsearch.cluster.Diff; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.persistent.PersistentTaskParams; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/job/RollupJobConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/job/RollupJobConfig.java index 1b7a636d09543..5a7e7b42bcce5 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/job/RollupJobConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/job/RollupJobConfig.java @@ -9,18 +9,18 @@ import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.fieldcaps.FieldCapabilities; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.NamedWriteable; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.regex.Regex; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collections; @@ -30,8 +30,8 @@ import java.util.Objects; import java.util.Set; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * This class holds the configuration details of a rollup job, such as the groupings, metrics, what diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/job/RollupJobStatus.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/job/RollupJobStatus.java index f2e006419cba1..98dbb1fdd5e5b 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/job/RollupJobStatus.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/job/RollupJobStatus.java @@ -9,13 +9,13 @@ import org.elasticsearch.Version; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.persistent.PersistentTaskState; import org.elasticsearch.tasks.Task; import org.elasticsearch.xpack.core.indexing.IndexerState; @@ -26,8 +26,8 @@ import java.util.Objects; import java.util.TreeMap; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * This class is essentially just a wrapper around the IndexerState and the diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/job/TermsGroupConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/job/TermsGroupConfig.java index 39fda7140e1ce..f66e2fb628cbc 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/job/TermsGroupConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/job/TermsGroupConfig.java @@ -8,15 +8,15 @@ import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.fieldcaps.FieldCapabilities; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.mapper.KeywordFieldMapper; import org.elasticsearch.index.mapper.TextFieldMapper; @@ -25,7 +25,7 @@ import java.util.List; import java.util.Map; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; /** * The configuration object for the histograms in the rollup config diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/scheduler/Cron.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/scheduler/Cron.java index acdfeb09ac45d..6d97d8e2a9110 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/scheduler/Cron.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/scheduler/Cron.java @@ -8,8 +8,8 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.time.DateFormatter; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.time.ZoneOffset; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/search/action/AsyncSearchResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/search/action/AsyncSearchResponse.java index 9be8fe07ddb10..ebb51eb0897d8 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/search/action/AsyncSearchResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/search/action/AsyncSearchResponse.java @@ -14,7 +14,7 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.xcontent.StatusToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.xpack.core.async.AsyncResponse; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/search/action/AsyncStatusResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/search/action/AsyncStatusResponse.java index 5f12fc49fae06..ef0b4a45c48e6 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/search/action/AsyncStatusResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/search/action/AsyncStatusResponse.java @@ -12,7 +12,7 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.xcontent.StatusToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.rest.action.RestActions; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/searchablesnapshots/MountSearchableSnapshotRequest.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/searchablesnapshots/MountSearchableSnapshotRequest.java index 991945e861a63..dfc9fff6e1b75 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/searchablesnapshots/MountSearchableSnapshotRequest.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/searchablesnapshots/MountSearchableSnapshotRequest.java @@ -11,15 +11,15 @@ import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.support.master.MasterNodeRequest; import org.elasticsearch.cluster.metadata.IndexMetadata; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.cluster.routing.allocation.DataTier; @@ -32,8 +32,8 @@ import static org.elasticsearch.action.ValidateActions.addValidationError; import static org.elasticsearch.common.settings.Settings.readSettingsFromStream; import static org.elasticsearch.common.settings.Settings.writeSettingsToStream; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class MountSearchableSnapshotRequest extends MasterNodeRequest { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/searchablesnapshots/SearchableSnapshotFeatureSetUsage.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/searchablesnapshots/SearchableSnapshotFeatureSetUsage.java index 0723530d6d84c..8cc62cf7d6a32 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/searchablesnapshots/SearchableSnapshotFeatureSetUsage.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/searchablesnapshots/SearchableSnapshotFeatureSetUsage.java @@ -10,8 +10,8 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.XPackFeatureSet; import org.elasticsearch.xpack.core.XPackField; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/searchablesnapshots/SearchableSnapshotShardStats.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/searchablesnapshots/SearchableSnapshotShardStats.java index 8371cf2ae83df..9315a13cb5b66 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/searchablesnapshots/SearchableSnapshotShardStats.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/searchablesnapshots/SearchableSnapshotShardStats.java @@ -13,8 +13,8 @@ import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.repositories.IndexId; import org.elasticsearch.snapshots.SnapshotId; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/CommandLineHttpClient.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/CommandLineHttpClient.java index 3a1bb2da31319..71055bdfd7516 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/CommandLineHttpClient.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/CommandLineHttpClient.java @@ -19,7 +19,7 @@ import org.elasticsearch.common.settings.SecureString; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.ssl.SslConfiguration; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.env.Environment; import org.elasticsearch.xpack.core.XPackSettings; import org.elasticsearch.xpack.core.common.socket.SocketAccess; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/EnrollmentToken.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/EnrollmentToken.java index a46d57881a957..67aa083e48b6e 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/EnrollmentToken.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/EnrollmentToken.java @@ -8,13 +8,13 @@ package org.elasticsearch.xpack.core.security; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import java.io.IOException; import java.nio.charset.StandardCharsets; @@ -22,7 +22,7 @@ import java.util.List; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; public class EnrollmentToken { private final String apiKey; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/HttpResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/HttpResponse.java index f102b1ce137ed..6201147d99aa9 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/HttpResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/HttpResponse.java @@ -8,7 +8,7 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import java.io.UnsupportedEncodingException; import java.util.Collections; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/SecurityContext.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/SecurityContext.java index 16efd4f8d2648..1bdbb6e6c4c59 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/SecurityContext.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/SecurityContext.java @@ -15,9 +15,9 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; import org.elasticsearch.common.util.concurrent.ThreadContext.StoredContext; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.node.Node; import org.elasticsearch.xpack.core.security.authc.Authentication; import org.elasticsearch.xpack.core.security.authc.Authentication.AuthenticationType; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/SecurityFeatureSetUsage.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/SecurityFeatureSetUsage.java index 0e313f0ab3057..f20b24d2dc287 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/SecurityFeatureSetUsage.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/SecurityFeatureSetUsage.java @@ -9,7 +9,7 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.XPackFeatureSet; import org.elasticsearch.xpack.core.XPackField; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/ApiKey.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/ApiKey.java index e04ea8a22e8fe..491febdbbe57d 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/ApiKey.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/ApiKey.java @@ -9,22 +9,22 @@ import org.elasticsearch.Version; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.time.Instant; import java.util.Map; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * API key information diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/ClearSecurityCacheResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/ClearSecurityCacheResponse.java index ec939315db004..89bc598a60a82 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/ClearSecurityCacheResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/ClearSecurityCacheResponse.java @@ -14,8 +14,8 @@ import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.List; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/CreateApiKeyRequestBuilder.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/CreateApiKeyRequestBuilder.java index 576c6fd32bf40..1ae34c817a27e 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/CreateApiKeyRequestBuilder.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/CreateApiKeyRequestBuilder.java @@ -9,14 +9,14 @@ import org.elasticsearch.action.ActionRequestBuilder; import org.elasticsearch.action.support.WriteRequest; import org.elasticsearch.client.ElasticsearchClient; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.security.authz.RoleDescriptor; import java.io.IOException; @@ -24,8 +24,8 @@ import java.util.List; import java.util.Map; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * Request builder for populating a {@link CreateApiKeyRequest} diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/CreateApiKeyResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/CreateApiKeyResponse.java index ff9475bf3ca13..3a0eda0fbd278 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/CreateApiKeyResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/CreateApiKeyResponse.java @@ -10,14 +10,14 @@ import org.elasticsearch.action.ActionResponse; import org.elasticsearch.core.CharArrays; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.settings.SecureString; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.nio.charset.StandardCharsets; @@ -26,8 +26,8 @@ import java.util.Base64; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * Response for the successful creation of an api key diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/DelegatePkiAuthenticationRequest.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/DelegatePkiAuthenticationRequest.java index 41970f0077d2d..74005301c5f78 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/DelegatePkiAuthenticationRequest.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/DelegatePkiAuthenticationRequest.java @@ -9,14 +9,14 @@ import org.elasticsearch.action.ActionRequest; import org.elasticsearch.action.ActionRequestValidationException; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; import org.elasticsearch.xpack.core.ssl.CertParsingUtils; import java.io.ByteArrayInputStream; @@ -30,7 +30,7 @@ import java.util.Objects; import static org.elasticsearch.action.ValidateActions.addValidationError; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * The request object for {@code TransportDelegatePkiAuthenticationAction} containing the certificate chain for the target subject diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/DelegatePkiAuthenticationResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/DelegatePkiAuthenticationResponse.java index ad9930c315cb8..433d959acb652 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/DelegatePkiAuthenticationResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/DelegatePkiAuthenticationResponse.java @@ -9,12 +9,12 @@ import org.elasticsearch.Version; import org.elasticsearch.action.ActionResponse; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.security.authc.Authentication; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/GetApiKeyResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/GetApiKeyResponse.java index f98c09b269bc0..2940f405898f7 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/GetApiKeyResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/GetApiKeyResponse.java @@ -8,14 +8,14 @@ package org.elasticsearch.xpack.core.security.action; import org.elasticsearch.action.ActionResponse; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collection; @@ -23,7 +23,7 @@ import java.util.List; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * Response for get API keys.
    diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/InvalidateApiKeyResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/InvalidateApiKeyResponse.java index 5e239af810ca8..a2141ddd2c968 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/InvalidateApiKeyResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/InvalidateApiKeyResponse.java @@ -10,23 +10,23 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collections; import java.util.List; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * Response for invalidation of one or more API keys result.
    diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/apikey/QueryApiKeyResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/apikey/QueryApiKeyResponse.java index fac10e5d3a82e..257e26850c9a3 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/apikey/QueryApiKeyResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/apikey/QueryApiKeyResponse.java @@ -12,8 +12,8 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.lucene.Lucene; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.core.Nullable; import org.elasticsearch.xpack.core.security.action.ApiKey; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/enrollment/KibanaEnrollmentResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/enrollment/KibanaEnrollmentResponse.java index 5e35355a70869..8bce230731470 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/enrollment/KibanaEnrollmentResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/enrollment/KibanaEnrollmentResponse.java @@ -11,8 +11,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.settings.SecureString; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/enrollment/NodeEnrollmentResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/enrollment/NodeEnrollmentResponse.java index 14a4fb6f53f60..59717fa4d88ea 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/enrollment/NodeEnrollmentResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/enrollment/NodeEnrollmentResponse.java @@ -8,12 +8,12 @@ package org.elasticsearch.xpack.core.security.action.enrollment; import org.elasticsearch.action.ActionResponse; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.List; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/oidc/OpenIdConnectPrepareAuthenticationResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/oidc/OpenIdConnectPrepareAuthenticationResponse.java index 852e23dc5b0f6..0030d8572e884 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/oidc/OpenIdConnectPrepareAuthenticationResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/oidc/OpenIdConnectPrepareAuthenticationResponse.java @@ -10,8 +10,8 @@ import org.elasticsearch.action.ActionResponse; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/privilege/ClearPrivilegesCacheResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/privilege/ClearPrivilegesCacheResponse.java index fcb944cd0992f..f9582e1d42c69 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/privilege/ClearPrivilegesCacheResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/privilege/ClearPrivilegesCacheResponse.java @@ -14,8 +14,8 @@ import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.List; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/privilege/DeletePrivilegesResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/privilege/DeletePrivilegesResponse.java index 556ae3d0facbe..5b7632096756e 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/privilege/DeletePrivilegesResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/privilege/DeletePrivilegesResponse.java @@ -9,8 +9,8 @@ import org.elasticsearch.action.ActionResponse; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Collection; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/privilege/PutPrivilegesRequestBuilder.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/privilege/PutPrivilegesRequestBuilder.java index 723a8c98d7c38..3cff84c4bdd95 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/privilege/PutPrivilegesRequestBuilder.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/privilege/PutPrivilegesRequestBuilder.java @@ -13,9 +13,9 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.security.authz.privilege.ApplicationPrivilegeDescriptor; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/privilege/PutPrivilegesResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/privilege/PutPrivilegesResponse.java index 6e308a9e8af34..65e81e4324b7f 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/privilege/PutPrivilegesResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/privilege/PutPrivilegesResponse.java @@ -9,8 +9,8 @@ import org.elasticsearch.action.ActionResponse; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Collections; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/realm/ClearRealmCacheResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/realm/ClearRealmCacheResponse.java index cbe4a84319186..c320a6b7b2b73 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/realm/ClearRealmCacheResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/realm/ClearRealmCacheResponse.java @@ -14,9 +14,9 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import java.io.IOException; import java.util.List; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/role/ClearRolesCacheResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/role/ClearRolesCacheResponse.java index 055d7fbf389d8..91ec8932f9dac 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/role/ClearRolesCacheResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/role/ClearRolesCacheResponse.java @@ -14,9 +14,9 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import java.io.IOException; import java.util.List; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/role/DeleteRoleResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/role/DeleteRoleResponse.java index 5853c03506bd3..f1495e2fc7a59 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/role/DeleteRoleResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/role/DeleteRoleResponse.java @@ -9,8 +9,8 @@ import org.elasticsearch.action.ActionResponse; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/role/PutRoleRequestBuilder.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/role/PutRoleRequestBuilder.java index 8d48f792c74f2..bfe72f6f72578 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/role/PutRoleRequestBuilder.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/role/PutRoleRequestBuilder.java @@ -11,7 +11,7 @@ import org.elasticsearch.client.ElasticsearchClient; import org.elasticsearch.core.Nullable; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.security.authz.RoleDescriptor; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/role/PutRoleResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/role/PutRoleResponse.java index a0320eb3c8b98..0c033e295dbf8 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/role/PutRoleResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/role/PutRoleResponse.java @@ -9,8 +9,8 @@ import org.elasticsearch.action.ActionResponse; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/rolemapping/DeleteRoleMappingResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/rolemapping/DeleteRoleMappingResponse.java index d22a119b27d03..12393213fa740 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/rolemapping/DeleteRoleMappingResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/rolemapping/DeleteRoleMappingResponse.java @@ -9,8 +9,8 @@ import org.elasticsearch.action.ActionResponse; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/rolemapping/PutRoleMappingRequestBuilder.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/rolemapping/PutRoleMappingRequestBuilder.java index 95f9dacf8fd2a..3f7ee99181c99 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/rolemapping/PutRoleMappingRequestBuilder.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/rolemapping/PutRoleMappingRequestBuilder.java @@ -10,7 +10,7 @@ import org.elasticsearch.action.support.WriteRequestBuilder; import org.elasticsearch.client.ElasticsearchClient; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.security.authc.support.mapper.ExpressionRoleMapping; import org.elasticsearch.xpack.core.security.authc.support.mapper.TemplateRoleName; import org.elasticsearch.xpack.core.security.authc.support.mapper.expressiondsl.RoleMapperExpression; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/rolemapping/PutRoleMappingResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/rolemapping/PutRoleMappingResponse.java index 8e409a45d49d4..b6d220d5e27bf 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/rolemapping/PutRoleMappingResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/rolemapping/PutRoleMappingResponse.java @@ -9,8 +9,8 @@ import org.elasticsearch.action.ActionResponse; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/service/CreateServiceAccountTokenResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/service/CreateServiceAccountTokenResponse.java index e0b6c56a5f7f8..ea7edb4e4e2ae 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/service/CreateServiceAccountTokenResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/service/CreateServiceAccountTokenResponse.java @@ -11,8 +11,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.settings.SecureString; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/service/DeleteServiceAccountTokenResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/service/DeleteServiceAccountTokenResponse.java index 532abcd2e0193..3ad8b078b5eba 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/service/DeleteServiceAccountTokenResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/service/DeleteServiceAccountTokenResponse.java @@ -10,8 +10,8 @@ import org.elasticsearch.action.ActionResponse; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/service/GetServiceAccountCredentialsResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/service/GetServiceAccountCredentialsResponse.java index 8ad5ea38048a8..76d7423d46606 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/service/GetServiceAccountCredentialsResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/service/GetServiceAccountCredentialsResponse.java @@ -10,8 +10,8 @@ import org.elasticsearch.action.ActionResponse; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.rest.action.RestActions; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/service/GetServiceAccountResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/service/GetServiceAccountResponse.java index 1a9b2c112183c..8c1eeb9d67aef 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/service/GetServiceAccountResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/service/GetServiceAccountResponse.java @@ -10,8 +10,8 @@ import org.elasticsearch.action.ActionResponse; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Arrays; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/service/ServiceAccountInfo.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/service/ServiceAccountInfo.java index a886088978fc7..02d1d7b33019b 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/service/ServiceAccountInfo.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/service/ServiceAccountInfo.java @@ -10,8 +10,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.security.authz.RoleDescriptor; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/service/TokenInfo.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/service/TokenInfo.java index 137954944bc7f..e166bb1fc8ad9 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/service/TokenInfo.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/service/TokenInfo.java @@ -10,8 +10,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.core.Nullable; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/token/CreateTokenResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/token/CreateTokenResponse.java index ab6cb4f62a63b..15179f8a8aaff 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/token/CreateTokenResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/token/CreateTokenResponse.java @@ -11,8 +11,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.security.authc.Authentication; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/token/InvalidateTokenResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/token/InvalidateTokenResponse.java index 1dfabc7583d01..dda836e31b6a2 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/token/InvalidateTokenResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/token/InvalidateTokenResponse.java @@ -9,9 +9,9 @@ import org.elasticsearch.action.ActionResponse; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.security.authc.support.TokensInvalidationResult; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/ChangePasswordRequestBuilder.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/ChangePasswordRequestBuilder.java index 5eff333d070f7..7b2e8ad5f7142 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/ChangePasswordRequestBuilder.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/ChangePasswordRequestBuilder.java @@ -15,9 +15,9 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.SecureString; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.security.authc.support.Hasher; import org.elasticsearch.xpack.core.security.support.Validation; import org.elasticsearch.xpack.core.security.user.User; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/DeleteUserResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/DeleteUserResponse.java index ca8a191326bc1..4b07a3db7a038 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/DeleteUserResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/DeleteUserResponse.java @@ -9,8 +9,8 @@ import org.elasticsearch.action.ActionResponse; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/GetUserPrivilegesResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/GetUserPrivilegesResponse.java index b59e9b2904491..fd6d2669e9faf 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/GetUserPrivilegesResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/GetUserPrivilegesResponse.java @@ -12,8 +12,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.security.authz.RoleDescriptor; import org.elasticsearch.xpack.core.security.authz.permission.FieldPermissionsDefinition; import org.elasticsearch.xpack.core.security.authz.privilege.ConfigurableClusterPrivilege; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/HasPrivilegesRequestBuilder.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/HasPrivilegesRequestBuilder.java index 31239a94ec08a..11aeb5eb1a2cc 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/HasPrivilegesRequestBuilder.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/HasPrivilegesRequestBuilder.java @@ -9,7 +9,7 @@ import org.elasticsearch.action.ActionRequestBuilder; import org.elasticsearch.client.ElasticsearchClient; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.security.authz.RoleDescriptor; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/HasPrivilegesResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/HasPrivilegesResponse.java index 42176c5a5b50c..0b8380c55c5f0 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/HasPrivilegesResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/HasPrivilegesResponse.java @@ -9,8 +9,8 @@ import org.elasticsearch.action.ActionResponse; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.security.authz.permission.ResourcePrivileges; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/PutUserRequestBuilder.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/PutUserRequestBuilder.java index b215fb7a51323..df205e8adfe30 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/PutUserRequestBuilder.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/PutUserRequestBuilder.java @@ -15,10 +15,10 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.SecureString; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentParser.Token; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser.Token; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.security.authc.support.Hasher; import org.elasticsearch.xpack.core.security.support.Validation; import org.elasticsearch.xpack.core.security.user.User; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/PutUserResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/PutUserResponse.java index f314b570a4a24..b13ec212cc8bb 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/PutUserResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/PutUserResponse.java @@ -10,8 +10,8 @@ import org.elasticsearch.action.ActionResponse; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/Authentication.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/Authentication.java index c39af02345883..22da39cc71475 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/Authentication.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/Authentication.java @@ -12,8 +12,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.security.authc.esnative.NativeRealmSettings; import org.elasticsearch.xpack.core.security.authc.file.FileRealmSettings; import org.elasticsearch.xpack.core.security.authc.service.ServiceAccountSettings; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/TokenMetadata.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/TokenMetadata.java index 45511551a505c..3681364da0d25 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/TokenMetadata.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/TokenMetadata.java @@ -12,7 +12,7 @@ import org.elasticsearch.cluster.NamedDiff; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Arrays; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/TokensInvalidationResult.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/TokensInvalidationResult.java index f4d91076d892c..1432d1d5f99c2 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/TokensInvalidationResult.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/TokensInvalidationResult.java @@ -13,8 +13,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.rest.RestStatus; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ExpressionRoleMapping.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ExpressionRoleMapping.java index 8c8b6b0b27c7e..0042bd0312cd1 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ExpressionRoleMapping.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ExpressionRoleMapping.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.security.authc.support.mapper; import org.elasticsearch.Version; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; @@ -15,13 +15,13 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.script.ScriptService; import org.elasticsearch.xpack.core.security.authc.support.mapper.expressiondsl.ExpressionModel; import org.elasticsearch.xpack.core.security.authc.support.mapper.expressiondsl.ExpressionParser; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/TemplateRoleName.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/TemplateRoleName.java index 6e8a3045dce08..f2d1424888988 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/TemplateRoleName.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/TemplateRoleName.java @@ -7,24 +7,24 @@ package org.elasticsearch.xpack.core.security.authc.support.mapper; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.script.Script; import org.elasticsearch.script.ScriptService; import org.elasticsearch.script.TemplateScript; @@ -41,8 +41,8 @@ import java.util.stream.Collectors; import java.util.stream.Stream; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * Representation of a Mustache template for expressing one or more roles names in a {@link ExpressionRoleMapping}. diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/expressiondsl/AllExpression.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/expressiondsl/AllExpression.java index 87913636c8596..f8a8745812eec 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/expressiondsl/AllExpression.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/expressiondsl/AllExpression.java @@ -12,7 +12,7 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; /** * An expression that evaluates to true if-and-only-if all its children diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/expressiondsl/AnyExpression.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/expressiondsl/AnyExpression.java index bff9f11df98cf..1a409f9bd2d07 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/expressiondsl/AnyExpression.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/expressiondsl/AnyExpression.java @@ -12,7 +12,7 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; /** * An expression that evaluates to true if at least one of its children diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/expressiondsl/ExceptExpression.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/expressiondsl/ExceptExpression.java index 19aa73feba7c1..beac9bbd353fe 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/expressiondsl/ExceptExpression.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/expressiondsl/ExceptExpression.java @@ -8,7 +8,7 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/expressiondsl/ExpressionParser.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/expressiondsl/ExpressionParser.java index b9d854c7e6f24..31fddcda08bfe 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/expressiondsl/ExpressionParser.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/expressiondsl/ExpressionParser.java @@ -8,11 +8,12 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.core.CheckedFunction; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.ContextParser; import org.elasticsearch.xpack.core.watcher.support.xcontent.XContentSource; import java.io.IOException; @@ -44,7 +45,7 @@ static void writeExpressionList(List list, StreamOutput ou /** * This function exists to be compatible with - * {@link org.elasticsearch.common.xcontent.ContextParser#parse(XContentParser, Object)} + * {@link ContextParser#parse(XContentParser, Object)} */ public static RoleMapperExpression parseObject(XContentParser parser, String id) throws IOException { return new ExpressionParser().parse(id, parser); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/expressiondsl/FieldExpression.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/expressiondsl/FieldExpression.java index 634dfbfb84855..418ceda2dca1e 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/expressiondsl/FieldExpression.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/expressiondsl/FieldExpression.java @@ -12,8 +12,8 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.regex.Regex; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.security.support.Automatons; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/expressiondsl/RoleMapperExpression.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/expressiondsl/RoleMapperExpression.java index c989dfecd8d5e..80031f7008952 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/expressiondsl/RoleMapperExpression.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/expressiondsl/RoleMapperExpression.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.security.authc.support.mapper.expressiondsl; import org.elasticsearch.common.io.stream.NamedWriteable; -import org.elasticsearch.common.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.ToXContentObject; import java.util.function.Predicate; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/RoleDescriptor.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/RoleDescriptor.java index 5bf5693232bdb..d680070ae70f1 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/RoleDescriptor.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/RoleDescriptor.java @@ -9,7 +9,7 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.ElasticsearchSecurityException; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.ValidationException; import org.elasticsearch.common.bytes.BytesArray; @@ -18,13 +18,13 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.xpack.core.security.authz.permission.FieldPermissions; import org.elasticsearch.xpack.core.security.authz.privilege.ConfigurableClusterPrivilege; import org.elasticsearch.xpack.core.security.authz.privilege.ConfigurableClusterPrivileges; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/accesscontrol/FieldSubsetReader.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/accesscontrol/FieldSubsetReader.java index 76e6516f89f1c..5768f1bd7d5bc 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/accesscontrol/FieldSubsetReader.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/accesscontrol/FieldSubsetReader.java @@ -31,9 +31,9 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.logging.LoggerMessageFormat; import org.elasticsearch.common.lucene.index.SequentialStoredFieldsLeafReader; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.Tuple; import org.elasticsearch.index.mapper.FieldNamesFieldMapper; import org.elasticsearch.index.mapper.SourceFieldMapper; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/permission/DocumentPermissions.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/permission/DocumentPermissions.java index 6cf1f23441bc7..8981261cfd7e4 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/permission/DocumentPermissions.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/permission/DocumentPermissions.java @@ -14,7 +14,7 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.lucene.search.Queries; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryRewriteContext; import org.elasticsearch.index.query.SearchExecutionContext; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/privilege/ApplicationPrivilegeDescriptor.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/privilege/ApplicationPrivilegeDescriptor.java index 7ed616ffdc862..6df9c24cf0181 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/privilege/ApplicationPrivilegeDescriptor.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/privilege/ApplicationPrivilegeDescriptor.java @@ -7,14 +7,14 @@ package org.elasticsearch.xpack.core.security.authz.privilege; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collection; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/privilege/ConfigurableClusterPrivilege.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/privilege/ConfigurableClusterPrivilege.java index 17ca441d2b88b..820bfa7046960 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/privilege/ConfigurableClusterPrivilege.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/privilege/ConfigurableClusterPrivilege.java @@ -7,10 +7,10 @@ package org.elasticsearch.xpack.core.security.authz.privilege; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.NamedWriteable; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Collection; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/privilege/ConfigurableClusterPrivileges.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/privilege/ConfigurableClusterPrivileges.java index 5074a5739101f..601daff85948b 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/privilege/ConfigurableClusterPrivileges.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/privilege/ConfigurableClusterPrivileges.java @@ -7,15 +7,15 @@ package org.elasticsearch.xpack.core.security.authz.privilege; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.transport.TransportRequest; import org.elasticsearch.xpack.core.security.action.privilege.ApplicationPrivilegesRequest; import org.elasticsearch.xpack.core.security.authz.permission.ClusterPermission; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/support/DLSRoleQueryValidator.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/support/DLSRoleQueryValidator.java index 6f92ce22ec098..e51d5d4ae2274 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/support/DLSRoleQueryValidator.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/support/DLSRoleQueryValidator.java @@ -12,11 +12,11 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.query.AbstractQueryBuilder; import org.elasticsearch.index.query.BoolQueryBuilder; import org.elasticsearch.index.query.BoostingQueryBuilder; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/support/SecurityQueryTemplateEvaluator.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/support/SecurityQueryTemplateEvaluator.java index d36bd350cbff2..abc2b2a5df450 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/support/SecurityQueryTemplateEvaluator.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/support/SecurityQueryTemplateEvaluator.java @@ -10,9 +10,9 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.script.ScriptService; import org.elasticsearch.xpack.core.security.support.MustacheTemplateEvaluator; import org.elasticsearch.xpack.core.security.user.User; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/support/MustacheTemplateEvaluator.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/support/MustacheTemplateEvaluator.java index 247356e00533e..23d6f975d13ad 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/support/MustacheTemplateEvaluator.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/support/MustacheTemplateEvaluator.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.security.support; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.script.Script; import org.elasticsearch.script.ScriptService; import org.elasticsearch.script.ScriptType; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/user/User.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/user/User.java index 7993dba17d516..13f87b5c0e63e 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/user/User.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/user/User.java @@ -7,12 +7,12 @@ package org.elasticsearch.xpack.core.security.user; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Arrays; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/xcontent/XContentUtils.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/xcontent/XContentUtils.java index 85b8f751ff3c5..a42e4c3f0dddb 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/xcontent/XContentUtils.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/xcontent/XContentUtils.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.security.xcontent; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/SLMFeatureSetUsage.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/SLMFeatureSetUsage.java index e11e08a4ae55f..34ad54dfa0332 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/SLMFeatureSetUsage.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/SLMFeatureSetUsage.java @@ -11,7 +11,7 @@ import org.elasticsearch.core.Nullable; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.XPackFeatureSet; import org.elasticsearch.xpack.core.XPackField; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/SnapshotInvocationRecord.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/SnapshotInvocationRecord.java index 38fd95aac9af0..9121d0c610a31 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/SnapshotInvocationRecord.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/SnapshotInvocationRecord.java @@ -12,11 +12,11 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.Nullable; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/SnapshotLifecycleMetadata.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/SnapshotLifecycleMetadata.java index 90f8d47eb2362..c969b294690ab 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/SnapshotLifecycleMetadata.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/SnapshotLifecycleMetadata.java @@ -13,12 +13,12 @@ import org.elasticsearch.cluster.DiffableUtils; import org.elasticsearch.cluster.NamedDiff; import org.elasticsearch.cluster.metadata.Metadata; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ilm.OperationMode; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/SnapshotLifecyclePolicy.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/SnapshotLifecyclePolicy.java index dd8f31057aa0e..c72cb916b033f 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/SnapshotLifecyclePolicy.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/SnapshotLifecyclePolicy.java @@ -13,16 +13,16 @@ import org.elasticsearch.cluster.AbstractDiffable; import org.elasticsearch.cluster.Diffable; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.snapshots.SnapshotsService; import org.elasticsearch.xpack.core.scheduler.Cron; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/SnapshotLifecyclePolicyItem.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/SnapshotLifecyclePolicyItem.java index 4919d63c082b0..21ec3bb8e067c 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/SnapshotLifecyclePolicyItem.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/SnapshotLifecyclePolicyItem.java @@ -9,14 +9,14 @@ import org.elasticsearch.cluster.SnapshotsInProgress; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.snapshots.SnapshotId; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/SnapshotLifecyclePolicyMetadata.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/SnapshotLifecyclePolicyMetadata.java index 1e8fb96af9205..78153ec9f06e8 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/SnapshotLifecyclePolicyMetadata.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/SnapshotLifecyclePolicyMetadata.java @@ -10,14 +10,14 @@ import org.elasticsearch.cluster.AbstractDiffable; import org.elasticsearch.cluster.Diffable; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.HashMap; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/SnapshotLifecycleStats.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/SnapshotLifecycleStats.java index a002f792ab5b2..d3347447828ae 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/SnapshotLifecycleStats.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/SnapshotLifecycleStats.java @@ -7,18 +7,18 @@ package org.elasticsearch.xpack.core.slm; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.metrics.CounterMetric; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collections; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/SnapshotRetentionConfiguration.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/SnapshotRetentionConfiguration.java index 7796d11e60221..48adb51aaf51c 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/SnapshotRetentionConfiguration.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/SnapshotRetentionConfiguration.java @@ -11,16 +11,16 @@ import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.message.ParameterizedMessage; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.snapshots.SnapshotInfo; import org.elasticsearch.snapshots.SnapshotState; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/action/DeleteSnapshotLifecycleAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/action/DeleteSnapshotLifecycleAction.java index 4dc112b81c76e..738270182222c 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/action/DeleteSnapshotLifecycleAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/action/DeleteSnapshotLifecycleAction.java @@ -13,7 +13,7 @@ import org.elasticsearch.action.support.master.AcknowledgedResponse; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.ToXContentObject; import java.io.IOException; import java.util.Objects; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/action/ExecuteSnapshotLifecycleAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/action/ExecuteSnapshotLifecycleAction.java index ed701424c61d0..140065dabac5f 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/action/ExecuteSnapshotLifecycleAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/action/ExecuteSnapshotLifecycleAction.java @@ -14,8 +14,8 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/action/ExecuteSnapshotRetentionAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/action/ExecuteSnapshotRetentionAction.java index 86ba392a7672d..ed71dc7d3d77b 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/action/ExecuteSnapshotRetentionAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/action/ExecuteSnapshotRetentionAction.java @@ -12,8 +12,8 @@ import org.elasticsearch.action.support.master.AcknowledgedRequest; import org.elasticsearch.action.support.master.AcknowledgedResponse; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/action/GetSLMStatusAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/action/GetSLMStatusAction.java index 77b83258196f3..65240b202050a 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/action/GetSLMStatusAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/action/GetSLMStatusAction.java @@ -13,8 +13,8 @@ import org.elasticsearch.action.support.master.AcknowledgedRequest; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ilm.OperationMode; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/action/GetSnapshotLifecycleAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/action/GetSnapshotLifecycleAction.java index 28935974a1928..d4c7066ee5f25 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/action/GetSnapshotLifecycleAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/action/GetSnapshotLifecycleAction.java @@ -14,8 +14,8 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.slm.SnapshotLifecyclePolicyItem; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/action/GetSnapshotLifecycleStatsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/action/GetSnapshotLifecycleStatsAction.java index a46cb8eac2001..5b2586e03a1aa 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/action/GetSnapshotLifecycleStatsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/action/GetSnapshotLifecycleStatsAction.java @@ -14,8 +14,8 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.slm.SnapshotLifecycleStats; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/action/PutSnapshotLifecycleAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/action/PutSnapshotLifecycleAction.java index 787bc0df51f71..68c6ac2b1c1df 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/action/PutSnapshotLifecycleAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/action/PutSnapshotLifecycleAction.java @@ -14,9 +14,9 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.slm.SnapshotLifecyclePolicy; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/history/SnapshotHistoryItem.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/history/SnapshotHistoryItem.java index 4e52eedb8d63f..e03b05fd5676d 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/history/SnapshotHistoryItem.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/history/SnapshotHistoryItem.java @@ -9,17 +9,17 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.xpack.core.slm.SnapshotLifecyclePolicy; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/history/SnapshotHistoryStore.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/history/SnapshotHistoryStore.java index 10a68bd57fa76..70f86a2996951 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/history/SnapshotHistoryStore.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/history/SnapshotHistoryStore.java @@ -17,9 +17,9 @@ import org.elasticsearch.cluster.metadata.Metadata; import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/history/SnapshotLifecycleTemplateRegistry.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/history/SnapshotLifecycleTemplateRegistry.java index b52004fcc1113..f0436b00208af 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/history/SnapshotLifecycleTemplateRegistry.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/history/SnapshotLifecycleTemplateRegistry.java @@ -11,7 +11,7 @@ import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.xpack.core.ilm.IndexLifecycleMetadata; import org.elasticsearch.xpack.core.ilm.LifecyclePolicy; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/spatial/action/SpatialStatsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/spatial/action/SpatialStatsAction.java index 13f9091d63b6e..f0e1fe2b59789 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/spatial/action/SpatialStatsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/spatial/action/SpatialStatsAction.java @@ -16,8 +16,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.transport.TransportRequest; import org.elasticsearch.xpack.core.common.stats.EnumCounters; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/sql/SqlFeatureSetUsage.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/sql/SqlFeatureSetUsage.java index a47b16219c17e..8d9ed9e3ca5f8 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/sql/SqlFeatureSetUsage.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/sql/SqlFeatureSetUsage.java @@ -10,7 +10,7 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.XPackFeatureSet; import org.elasticsearch.xpack.core.XPackField; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ssl/action/GetCertificateInfoAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ssl/action/GetCertificateInfoAction.java index ebd2d16d5a2ed..b458b6505f291 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ssl/action/GetCertificateInfoAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ssl/action/GetCertificateInfoAction.java @@ -14,8 +14,8 @@ import org.elasticsearch.client.ElasticsearchClient; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ssl.cert.CertificateInfo; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ssl/cert/CertificateInfo.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ssl/cert/CertificateInfo.java index 92b6c377f40c2..3fe4f083f66b3 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ssl/cert/CertificateInfo.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ssl/cert/CertificateInfo.java @@ -11,8 +11,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.core.Nullable; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ssl/rest/RestGetCertificateInfoAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ssl/rest/RestGetCertificateInfoAction.java index dfe75e18d25d5..742f101322b56 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ssl/rest/RestGetCertificateInfoAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ssl/rest/RestGetCertificateInfoAction.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ssl.rest; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BytesRestResponse; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/template/IndexTemplateRegistry.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/template/IndexTemplateRegistry.java index 09159763911b9..096ab52bff322 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/template/IndexTemplateRegistry.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/template/IndexTemplateRegistry.java @@ -27,10 +27,10 @@ import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.gateway.GatewayService; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.xpack.core.ilm.IndexLifecycleMetadata; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/template/LifecyclePolicyConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/template/LifecyclePolicyConfig.java index caf2898b41fab..d6262d8512e46 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/template/LifecyclePolicyConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/template/LifecyclePolicyConfig.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.template; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.xpack.core.ilm.LifecyclePolicy; import org.elasticsearch.xpack.core.ilm.LifecyclePolicyUtils; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/template/TemplateUtils.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/template/TemplateUtils.java index 2feec8a481b74..a755881edeab2 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/template/TemplateUtils.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/template/TemplateUtils.java @@ -17,12 +17,12 @@ import org.elasticsearch.common.compress.CompressedXContent; import org.elasticsearch.common.io.Streams; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import java.io.IOException; import java.util.Collections; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/termsenum/action/TermCount.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/termsenum/action/TermCount.java index 546607bb24593..52573ac088a06 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/termsenum/action/TermCount.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/termsenum/action/TermCount.java @@ -6,19 +6,19 @@ */ package org.elasticsearch.xpack.core.termsenum.action; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; public class TermCount implements Writeable, ToXContentFragment { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/termsenum/action/TermsEnumAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/termsenum/action/TermsEnumAction.java index 2711d62e7ffc3..d01b2525cda8e 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/termsenum/action/TermsEnumAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/termsenum/action/TermsEnumAction.java @@ -7,10 +7,10 @@ package org.elasticsearch.xpack.core.termsenum.action; import org.elasticsearch.action.ActionType; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/termsenum/action/TermsEnumRequest.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/termsenum/action/TermsEnumRequest.java index 9878d71c92b9d..fcc17a58bc52f 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/termsenum/action/TermsEnumRequest.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/termsenum/action/TermsEnumRequest.java @@ -16,8 +16,8 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.core.Nullable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.query.QueryBuilder; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/termsenum/action/TermsEnumResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/termsenum/action/TermsEnumResponse.java index b39171633142f..433d213f020dd 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/termsenum/action/TermsEnumResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/termsenum/action/TermsEnumResponse.java @@ -8,19 +8,19 @@ import org.elasticsearch.action.support.DefaultShardOperationFailedException; import org.elasticsearch.action.support.broadcast.BroadcastResponse; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Arrays; import java.util.Collections; import java.util.List; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * The response of the _terms_enum action. diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/termsenum/rest/RestTermsEnumAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/termsenum/rest/RestTermsEnumAction.java index 4c771995d085e..bc5dcd3b4d35a 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/termsenum/rest/RestTermsEnumAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/termsenum/rest/RestTermsEnumAction.java @@ -8,7 +8,7 @@ import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestToXContentListener; @@ -38,11 +38,11 @@ public String getName() { @Override public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { try (XContentParser parser = request.contentOrSourceParamParser()) { - TermsEnumRequest termEnumRequest = TermsEnumAction.fromXContent(parser, + TermsEnumRequest termEnumRequest = TermsEnumAction.fromXContent(parser, Strings.splitStringByCommaToArray(request.param("index"))); return channel -> client.execute(TermsEnumAction.INSTANCE, termEnumRequest, new RestToXContentListener<>(channel)); - } + } } - + } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/textstructure/action/FindStructureAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/textstructure/action/FindStructureAction.java index fdaac19a7af0a..aa0a7c3dfafd2 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/textstructure/action/FindStructureAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/textstructure/action/FindStructureAction.java @@ -10,14 +10,14 @@ import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.ActionType; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.xcontent.StatusToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.xpack.core.textstructure.structurefinder.TextStructure; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/textstructure/structurefinder/FieldStats.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/textstructure/structurefinder/FieldStats.java index f3d02b416073b..842296ccb59a7 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/textstructure/structurefinder/FieldStats.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/textstructure/structurefinder/FieldStats.java @@ -6,14 +6,14 @@ */ package org.elasticsearch.xpack.core.textstructure.structurefinder; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Collections; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/textstructure/structurefinder/TextStructure.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/textstructure/structurefinder/TextStructure.java index 500516b7aaff3..366d05fb1e064 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/textstructure/structurefinder/TextStructure.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/textstructure/structurefinder/TextStructure.java @@ -6,14 +6,14 @@ */ package org.elasticsearch.xpack.core.textstructure.structurefinder; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collections; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/TransformFeatureSetUsage.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/TransformFeatureSetUsage.java index 52d5c78606d40..dd12bb968f177 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/TransformFeatureSetUsage.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/TransformFeatureSetUsage.java @@ -11,7 +11,7 @@ import org.elasticsearch.cluster.metadata.Metadata; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.XPackFeatureSet.Usage; import org.elasticsearch.xpack.core.transform.transforms.TransformIndexerStats; import org.elasticsearch.xpack.core.XPackField; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/TransformField.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/TransformField.java index 0a616a2c51c8c..57580486f2b2e 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/TransformField.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/TransformField.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.transform; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; /* * Utility class to hold common fields and strings for transform. diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/TransformMetadata.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/TransformMetadata.java index ba503f85536f2..8598dbc12999b 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/TransformMetadata.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/TransformMetadata.java @@ -13,13 +13,13 @@ import org.elasticsearch.cluster.NamedDiff; import org.elasticsearch.cluster.metadata.Metadata; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.EnumSet; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/TransformNamedXContentProvider.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/TransformNamedXContentProvider.java index 447575c4de9f4..9d0dd568d2ed0 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/TransformNamedXContentProvider.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/TransformNamedXContentProvider.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.transform; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.plugins.spi.NamedXContentProvider; import org.elasticsearch.xpack.core.transform.transforms.RetentionPolicyConfig; import org.elasticsearch.xpack.core.transform.transforms.SyncConfig; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/action/GetTransformAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/action/GetTransformAction.java index b9402c003bc62..736f1f4a13abe 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/action/GetTransformAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/action/GetTransformAction.java @@ -9,14 +9,14 @@ import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionType; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.ValidationException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.logging.DeprecationCategory; import org.elasticsearch.common.logging.DeprecationLogger; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.action.AbstractGetResourcesRequest; import org.elasticsearch.xpack.core.action.AbstractGetResourcesResponse; import org.elasticsearch.xpack.core.action.util.PageParams; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/action/GetTransformStatsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/action/GetTransformStatsAction.java index 5e7621961abe3..6154f7582bda8 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/action/GetTransformStatsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/action/GetTransformStatsAction.java @@ -18,8 +18,8 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.tasks.Task; import org.elasticsearch.xpack.core.action.util.PageParams; import org.elasticsearch.xpack.core.action.util.QueryPage; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/action/PreviewTransformAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/action/PreviewTransformAction.java index b4ecab690cf08..882a880feb1be 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/action/PreviewTransformAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/action/PreviewTransformAction.java @@ -12,18 +12,18 @@ import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.ActionType; import org.elasticsearch.action.support.master.AcknowledgedRequest; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.common.validation.SourceDestValidator; import org.elasticsearch.xpack.core.transform.TransformField; import org.elasticsearch.xpack.core.transform.transforms.DestConfig; @@ -37,7 +37,7 @@ import java.util.Map; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class PreviewTransformAction extends ActionType { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/action/PutTransformAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/action/PutTransformAction.java index 8e888af8bae9f..723ef73d25b3b 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/action/PutTransformAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/action/PutTransformAction.java @@ -15,7 +15,7 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.common.validation.SourceDestValidator; import org.elasticsearch.xpack.core.transform.TransformField; import org.elasticsearch.xpack.core.transform.TransformMessages; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/action/StartTransformAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/action/StartTransformAction.java index 6c9c09863a537..80033e0102bf9 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/action/StartTransformAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/action/StartTransformAction.java @@ -14,8 +14,8 @@ import org.elasticsearch.action.support.tasks.BaseTasksResponse; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.transform.TransformField; import org.elasticsearch.xpack.core.transform.utils.ExceptionsHelper; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/action/StopTransformAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/action/StopTransformAction.java index ef2b6e16c67bd..fe17059eb1caa 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/action/StopTransformAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/action/StopTransformAction.java @@ -19,8 +19,8 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.tasks.Task; import org.elasticsearch.xpack.core.transform.TransformField; import org.elasticsearch.xpack.core.transform.utils.ExceptionsHelper; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/action/UpdateTransformAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/action/UpdateTransformAction.java index a3a4f906ce468..2c1bc9fe33840 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/action/UpdateTransformAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/action/UpdateTransformAction.java @@ -15,9 +15,9 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.common.validation.SourceDestValidator; import org.elasticsearch.xpack.core.transform.TransformField; import org.elasticsearch.xpack.core.transform.action.compat.UpdateTransformActionPre78; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/action/compat/UpdateTransformActionPre78.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/action/compat/UpdateTransformActionPre78.java index 13c4fc7251a83..429a4acc4b65c 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/action/compat/UpdateTransformActionPre78.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/action/compat/UpdateTransformActionPre78.java @@ -13,9 +13,9 @@ import org.elasticsearch.action.support.master.AcknowledgedRequest; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.transform.transforms.TransformConfig; import org.elasticsearch.xpack.core.transform.transforms.TransformConfigUpdate; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/notifications/TransformAuditMessage.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/notifications/TransformAuditMessage.java index d7cc0792757e3..a7bc15d4d85a2 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/notifications/TransformAuditMessage.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/notifications/TransformAuditMessage.java @@ -6,8 +6,8 @@ */ package org.elasticsearch.xpack.core.transform.notifications; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; import org.elasticsearch.xpack.core.common.notifications.AbstractAuditMessage; import org.elasticsearch.xpack.core.common.notifications.Level; import org.elasticsearch.xpack.core.transform.TransformField; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/DestConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/DestConfig.java index 04947265d8197..89bcc7403cf70 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/DestConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/DestConfig.java @@ -12,12 +12,12 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.deprecation.DeprecationIssue; import org.elasticsearch.xpack.core.transform.utils.ExceptionsHelper; @@ -26,8 +26,8 @@ import java.util.function.Consumer; import static org.elasticsearch.action.ValidateActions.addValidationError; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class DestConfig implements Writeable, ToXContentObject { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/NodeAttributes.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/NodeAttributes.java index 7ccba957aa6b2..52b5eed2f5e6f 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/NodeAttributes.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/NodeAttributes.java @@ -7,15 +7,15 @@ package org.elasticsearch.xpack.core.transform.transforms; import org.elasticsearch.cluster.node.DiscoveryNode; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.transform.utils.ExceptionsHelper; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/QueryConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/QueryConfig.java index 7630fea72ac80..f383edbe5d60d 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/QueryConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/QueryConfig.java @@ -15,14 +15,14 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.DeprecationHandler; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.query.AbstractQueryBuilder; import org.elasticsearch.index.query.MatchAllQueryBuilder; import org.elasticsearch.index.query.QueryBuilder; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/RetentionPolicyConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/RetentionPolicyConfig.java index 707f105ff74b4..04c60ec25ef25 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/RetentionPolicyConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/RetentionPolicyConfig.java @@ -9,8 +9,8 @@ import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.common.io.stream.NamedWriteable; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContentObject; import org.elasticsearch.xpack.core.deprecation.DeprecationIssue; import java.util.function.Consumer; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/SettingsConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/SettingsConfig.java index 5589f1da4d211..7934be3893737 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/SettingsConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/SettingsConfig.java @@ -13,12 +13,12 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.aggregations.MultiBucketConsumerService; import org.elasticsearch.xpack.core.deprecation.DeprecationIssue; import org.elasticsearch.xpack.core.transform.TransformField; @@ -28,7 +28,7 @@ import java.util.function.Consumer; import static org.elasticsearch.action.ValidateActions.addValidationError; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class SettingsConfig implements Writeable, ToXContentObject { public static final ConstructingObjectParser STRICT_PARSER = createParser(false); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/SourceConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/SourceConfig.java index a42f5f1c1c875..2228f16e1ebaf 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/SourceConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/SourceConfig.java @@ -13,12 +13,12 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.license.RemoteClusterLicenseChecker; import org.elasticsearch.search.builder.SearchSourceBuilder; import org.elasticsearch.xpack.core.deprecation.DeprecationIssue; @@ -34,8 +34,8 @@ import java.util.function.Consumer; import static java.util.stream.Collectors.toMap; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class SourceConfig implements Writeable, ToXContentObject { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/SyncConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/SyncConfig.java index 2efc2ff699363..c8b4e47d52060 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/SyncConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/SyncConfig.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.core.transform.transforms; import org.elasticsearch.common.io.stream.NamedWriteable; -import org.elasticsearch.common.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.ToXContentObject; import org.elasticsearch.index.query.QueryBuilder; public interface SyncConfig extends ToXContentObject, NamedWriteable { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TimeRetentionPolicyConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TimeRetentionPolicyConfig.java index 56a4db63dc4c4..1f9e0868e0d64 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TimeRetentionPolicyConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TimeRetentionPolicyConfig.java @@ -11,11 +11,11 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.TimeValue; import org.elasticsearch.xpack.core.deprecation.DeprecationIssue; import org.elasticsearch.xpack.core.transform.TransformField; @@ -26,7 +26,7 @@ import java.util.function.Consumer; import static org.elasticsearch.action.ValidateActions.addValidationError; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; public class TimeRetentionPolicyConfig implements RetentionPolicyConfig { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TimeSyncConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TimeSyncConfig.java index a57780ca8bd18..0404ac31e6402 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TimeSyncConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TimeSyncConfig.java @@ -11,10 +11,10 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.RangeQueryBuilder; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; @@ -23,8 +23,8 @@ import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class TimeSyncConfig implements SyncConfig { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformCheckpoint.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformCheckpoint.java index f3adabfacb250..14d4f4df47594 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformCheckpoint.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformCheckpoint.java @@ -12,11 +12,11 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.transform.TransformField; import java.io.IOException; @@ -30,8 +30,8 @@ import java.util.Set; import java.util.TreeMap; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * Checkpoint document to store the checkpoint of a transform diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformCheckpointStats.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformCheckpointStats.java index 57cf3ce86c4b7..a5218eb2bdcb3 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformCheckpointStats.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformCheckpointStats.java @@ -11,16 +11,16 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.transform.TransformField; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * Checkpoint stats data for 1 checkpoint diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformCheckpointingInfo.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformCheckpointingInfo.java index 2d6578a13bd73..c9f6dcaae90d3 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformCheckpointingInfo.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformCheckpointingInfo.java @@ -8,16 +8,16 @@ package org.elasticsearch.xpack.core.transform.transforms; import org.elasticsearch.Version; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.common.time.TimeUtils; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformConfig.java index 05bce04b3f3ee..26def45ff68ca 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformConfig.java @@ -14,13 +14,13 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.Nullable; import org.elasticsearch.core.TimeValue; import org.elasticsearch.xpack.core.common.time.TimeUtils; @@ -44,8 +44,8 @@ import java.util.Map; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * This class holds the configuration details of a data frame transform diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformConfigUpdate.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformConfigUpdate.java index d6a9327e6dd23..b163116ae0016 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformConfigUpdate.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformConfigUpdate.java @@ -14,8 +14,8 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.xpack.core.transform.TransformField; import org.elasticsearch.xpack.core.transform.TransformMessages; @@ -24,7 +24,7 @@ import java.util.Map; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; import static org.elasticsearch.xpack.core.transform.transforms.TransformConfig.MAX_DESCRIPTION_LENGTH; /** diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformDestIndexSettings.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformDestIndexSettings.java index ffb4ed26cdb4b..6e2f515c251cf 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformDestIndexSettings.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformDestIndexSettings.java @@ -9,15 +9,15 @@ import org.elasticsearch.action.admin.indices.alias.Alias; import org.elasticsearch.cluster.AbstractDiffable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collections; @@ -26,7 +26,7 @@ import java.util.Objects; import java.util.Set; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class TransformDestIndexSettings extends AbstractDiffable implements Writeable, ToXContentObject { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformIndexerPosition.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformIndexerPosition.java index 86bb4b6ab8df1..312616cf632e0 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformIndexerPosition.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformIndexerPosition.java @@ -7,23 +7,23 @@ package org.elasticsearch.xpack.core.transform.transforms; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collections; import java.util.Map; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class TransformIndexerPosition implements Writeable, ToXContentObject { public static final String NAME = "data_frame/indexer_position"; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformIndexerStats.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformIndexerStats.java index 7061ab1d7c8ef..33656751cfcf8 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformIndexerStats.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformIndexerStats.java @@ -8,19 +8,19 @@ package org.elasticsearch.xpack.core.transform.transforms; import org.elasticsearch.Version; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.indexing.IndexerJobStats; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class TransformIndexerStats extends IndexerJobStats { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformProgress.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformProgress.java index d3518b4e7b413..4027d83636e77 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformProgress.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformProgress.java @@ -8,19 +8,19 @@ package org.elasticsearch.xpack.core.transform.transforms; import org.elasticsearch.Version; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class TransformProgress implements Writeable, ToXContentObject { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformState.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformState.java index b3d36dbe6d7d4..cb583c7acb421 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformState.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformState.java @@ -9,14 +9,14 @@ import org.elasticsearch.Version; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.persistent.PersistentTaskState; import org.elasticsearch.tasks.Task; import org.elasticsearch.xpack.core.indexing.IndexerState; @@ -26,8 +26,8 @@ import java.util.Map; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class TransformState implements Task.Status, PersistentTaskState { public static final String NAME = TransformField.TASK_NAME; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformStats.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformStats.java index d43e83046bb1e..55dc2dc35fac6 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformStats.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformStats.java @@ -9,17 +9,17 @@ import org.elasticsearch.Version; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.core.Tuple; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.indexing.IndexerState; import org.elasticsearch.xpack.core.transform.TransformField; @@ -27,8 +27,8 @@ import java.util.Locale; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * Used as a wrapper for the objects returned from the stats endpoint. diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformStoredDoc.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformStoredDoc.java index eb69429d57532..2828a3c2d7ed1 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformStoredDoc.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformStoredDoc.java @@ -8,15 +8,15 @@ package org.elasticsearch.xpack.core.transform.transforms; import org.elasticsearch.Version; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.transform.TransformField; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformTaskParams.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformTaskParams.java index d29ca68540836..78f0d17846d36 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformTaskParams.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformTaskParams.java @@ -9,13 +9,13 @@ import org.elasticsearch.Version; import org.elasticsearch.cluster.AbstractDiffable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.persistent.PersistentTaskParams; import org.elasticsearch.xpack.core.transform.TransformField; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/latest/LatestConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/latest/LatestConfig.java index 9cfb1fc595daf..ee18b5578b1e3 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/latest/LatestConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/latest/LatestConfig.java @@ -11,12 +11,12 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.sort.SortBuilder; import org.elasticsearch.search.sort.SortBuilders; import org.elasticsearch.search.sort.SortOrder; @@ -32,7 +32,7 @@ import java.util.function.Consumer; import static org.elasticsearch.action.ValidateActions.addValidationError; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; public class LatestConfig implements Writeable, ToXContentObject { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/pivot/AggregationConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/pivot/AggregationConfig.java index 63b8e0caf1da7..6026341a85fbb 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/pivot/AggregationConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/pivot/AggregationConfig.java @@ -14,14 +14,14 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.DeprecationHandler; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.AggregatorFactories; import org.elasticsearch.search.aggregations.PipelineAggregationBuilder; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/pivot/DateHistogramGroupSource.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/pivot/DateHistogramGroupSource.java index 5dc0e61e9412e..1db3fb562a031 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/pivot/DateHistogramGroupSource.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/pivot/DateHistogramGroupSource.java @@ -7,17 +7,17 @@ package org.elasticsearch.xpack.core.transform.transforms.pivot; import org.elasticsearch.Version; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Rounding; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramAggregationBuilder; import org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramInterval; @@ -26,7 +26,7 @@ import java.time.ZoneOffset; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class DateHistogramGroupSource extends SingleGroupSource { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/pivot/GeoTileGroupSource.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/pivot/GeoTileGroupSource.java index a4018c15d3ad3..21716567856cd 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/pivot/GeoTileGroupSource.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/pivot/GeoTileGroupSource.java @@ -7,21 +7,21 @@ package org.elasticsearch.xpack.core.transform.transforms.pivot; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.geo.GeoBoundingBox; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.mapper.GeoShapeFieldMapper; import org.elasticsearch.search.aggregations.bucket.geogrid.GeoTileUtils; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /* * A geotile_grid aggregation source for group_by diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/pivot/GroupConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/pivot/GroupConfig.java index 0cbc1a1aaf707..91a30e88cf9a3 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/pivot/GroupConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/pivot/GroupConfig.java @@ -16,12 +16,12 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.search.aggregations.AggregatorFactories; import org.elasticsearch.xpack.core.deprecation.DeprecationIssue; import org.elasticsearch.xpack.core.transform.TransformField; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/pivot/HistogramGroupSource.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/pivot/HistogramGroupSource.java index 62b1e86607a0e..70a5954c02abc 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/pivot/HistogramGroupSource.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/pivot/HistogramGroupSource.java @@ -6,17 +6,17 @@ */ package org.elasticsearch.xpack.core.transform.transforms.pivot; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class HistogramGroupSource extends SingleGroupSource { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/pivot/PivotConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/pivot/PivotConfig.java index 22e627c260f13..652ee0577e39d 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/pivot/PivotConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/pivot/PivotConfig.java @@ -13,11 +13,11 @@ import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.logging.DeprecationCategory; import org.elasticsearch.common.logging.DeprecationLogger; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.Nullable; import org.elasticsearch.search.aggregations.MultiBucketConsumerService; import org.elasticsearch.xpack.core.deprecation.DeprecationIssue; @@ -34,8 +34,8 @@ import java.util.function.Consumer; import static org.elasticsearch.action.ValidateActions.addValidationError; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class PivotConfig implements Writeable, ToXContentObject { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/pivot/ScriptConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/pivot/ScriptConfig.java index 66473e5d1aa23..e5412a19bfbdf 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/pivot/ScriptConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/pivot/ScriptConfig.java @@ -16,12 +16,12 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.script.Script; import org.elasticsearch.xpack.core.transform.TransformMessages; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/pivot/SingleGroupSource.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/pivot/SingleGroupSource.java index c4e423bfd56e9..a291bc421a0fa 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/pivot/SingleGroupSource.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/pivot/SingleGroupSource.java @@ -10,21 +10,21 @@ import org.elasticsearch.Version; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.AbstractObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.AbstractObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Locale; import java.util.Objects; import static org.elasticsearch.action.ValidateActions.addValidationError; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /* * Base class for a single source for group_by diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/pivot/TermsGroupSource.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/pivot/TermsGroupSource.java index 8c53172c55526..d8313162b186d 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/pivot/TermsGroupSource.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/pivot/TermsGroupSource.java @@ -8,8 +8,8 @@ package org.elasticsearch.xpack.core.transform.transforms.pivot; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/WatcherFeatureSetUsage.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/WatcherFeatureSetUsage.java index 3b98df9f0e1b7..bf2d012c1800b 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/WatcherFeatureSetUsage.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/WatcherFeatureSetUsage.java @@ -9,7 +9,7 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.XPackFeatureSet; import org.elasticsearch.xpack.core.XPackField; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/WatcherMetadata.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/WatcherMetadata.java index 9ece32bdebb06..2179cbafdfff2 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/WatcherMetadata.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/WatcherMetadata.java @@ -10,11 +10,11 @@ import org.elasticsearch.cluster.AbstractNamedDiffable; import org.elasticsearch.cluster.NamedDiff; import org.elasticsearch.cluster.metadata.Metadata; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.EnumSet; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/actions/Action.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/actions/Action.java index 0a4a6f0f5a40b..2560bfedd1518 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/actions/Action.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/actions/Action.java @@ -7,11 +7,11 @@ package org.elasticsearch.xpack.core.watcher.actions; import org.elasticsearch.ElasticsearchException; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.logging.LoggerMessageFormat; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Locale; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/actions/ActionFactory.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/actions/ActionFactory.java index f06e0b3566277..bd51d327e0e66 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/actions/ActionFactory.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/actions/ActionFactory.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.watcher.actions; import org.apache.logging.log4j.Logger; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/actions/ActionRegistry.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/actions/ActionRegistry.java index 50f1287982c1b..6216827a594ac 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/actions/ActionRegistry.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/actions/ActionRegistry.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.watcher.actions; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.xpack.core.watcher.condition.ConditionRegistry; import org.elasticsearch.xpack.core.watcher.support.WatcherUtils; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/actions/ActionStatus.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/actions/ActionStatus.java index e8b26128fc793..8219b833ad718 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/actions/ActionStatus.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/actions/ActionStatus.java @@ -8,13 +8,13 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.time.DateFormatters; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.time.Instant; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/actions/ActionWrapper.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/actions/ActionWrapper.java index 0a7aa4288593a..b560e1ba4e94b 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/actions/ActionWrapper.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/actions/ActionWrapper.java @@ -13,10 +13,10 @@ import org.elasticsearch.core.Nullable; import org.elasticsearch.common.Strings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ObjectPath; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectPath; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.xpack.core.watcher.actions.throttler.ActionThrottler; import org.elasticsearch.xpack.core.watcher.actions.throttler.Throttler; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/actions/ActionWrapperField.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/actions/ActionWrapperField.java index 5eb3dc55cfa3e..8858e09fbfe52 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/actions/ActionWrapperField.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/actions/ActionWrapperField.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.core.watcher.actions; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; public final class ActionWrapperField { public static final ParseField ID = new ParseField("id"); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/actions/ActionWrapperResult.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/actions/ActionWrapperResult.java index 694b8b717a344..ef19a423aa7ec 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/actions/ActionWrapperResult.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/actions/ActionWrapperResult.java @@ -7,8 +7,8 @@ package org.elasticsearch.xpack.core.watcher.actions; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.watcher.condition.Condition; import org.elasticsearch.xpack.core.watcher.transform.Transform; import org.elasticsearch.xpack.core.watcher.watch.WatchField; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/actions/ExecutableAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/actions/ExecutableAction.java index cbe08054b7111..c1c94e97d7263 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/actions/ExecutableAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/actions/ExecutableAction.java @@ -7,8 +7,8 @@ package org.elasticsearch.xpack.core.watcher.actions; import org.apache.logging.log4j.Logger; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.watcher.execution.WatchExecutionContext; import org.elasticsearch.xpack.core.watcher.watch.Payload; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/actions/throttler/ThrottlerField.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/actions/throttler/ThrottlerField.java index 08deff6da962f..49bb08f1bd6cb 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/actions/throttler/ThrottlerField.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/actions/throttler/ThrottlerField.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.core.watcher.actions.throttler; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; public final class ThrottlerField { public static final ParseField THROTTLE_PERIOD = new ParseField("throttle_period_in_millis"); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/client/WatchSourceBuilder.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/client/WatchSourceBuilder.java index 6fdc174a00892..9030660258c65 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/client/WatchSourceBuilder.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/client/WatchSourceBuilder.java @@ -10,11 +10,11 @@ import org.elasticsearch.core.Nullable; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.watcher.actions.Action; import org.elasticsearch.xpack.core.watcher.actions.throttler.ThrottlerField; import org.elasticsearch.xpack.core.watcher.condition.AlwaysCondition; @@ -32,7 +32,7 @@ import java.util.HashMap; import java.util.Map; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; public class WatchSourceBuilder implements ToXContentObject { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/condition/AlwaysCondition.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/condition/AlwaysCondition.java index 962810232991c..35f568850c7c6 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/condition/AlwaysCondition.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/condition/AlwaysCondition.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.core.watcher.condition; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/condition/Condition.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/condition/Condition.java index e1f885f16404b..11e1201843b2f 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/condition/Condition.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/condition/Condition.java @@ -7,8 +7,8 @@ package org.elasticsearch.xpack.core.watcher.condition; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Locale; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/condition/ConditionFactory.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/condition/ConditionFactory.java index 8ccd32fb25a6e..f24d5a3d26b39 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/condition/ConditionFactory.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/condition/ConditionFactory.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.core.watcher.condition; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.time.Clock; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/condition/ConditionRegistry.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/condition/ConditionRegistry.java index ecd15b81f56ad..ccd6c53169102 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/condition/ConditionRegistry.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/condition/ConditionRegistry.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.watcher.condition; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.time.Clock; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/execution/QueuedWatch.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/execution/QueuedWatch.java index f22101a3dd6a2..4da5d46e82fa6 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/execution/QueuedWatch.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/execution/QueuedWatch.java @@ -9,8 +9,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.time.Instant; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/execution/WatchExecutionResult.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/execution/WatchExecutionResult.java index a130fa9eb87e5..9aecd89940ad8 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/execution/WatchExecutionResult.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/execution/WatchExecutionResult.java @@ -7,9 +7,9 @@ package org.elasticsearch.xpack.core.watcher.execution; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.watcher.actions.ActionWrapperResult; import org.elasticsearch.xpack.core.watcher.condition.Condition; import org.elasticsearch.xpack.core.watcher.input.Input; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/execution/WatchExecutionSnapshot.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/execution/WatchExecutionSnapshot.java index 4158feb0e1182..8271892dcaab3 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/execution/WatchExecutionSnapshot.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/execution/WatchExecutionSnapshot.java @@ -9,8 +9,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.watcher.actions.ActionWrapperResult; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/history/WatchRecord.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/history/WatchRecord.java index c2d7a3a5c2174..2c6968b6f0a48 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/history/WatchRecord.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/history/WatchRecord.java @@ -8,10 +8,10 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.watcher.actions.Action; import org.elasticsearch.xpack.core.watcher.actions.ActionWrapperResult; import org.elasticsearch.xpack.core.watcher.condition.ExecutableCondition; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/input/ExecutableInput.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/input/ExecutableInput.java index 99ae64d672c8a..2f22e1346d7d0 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/input/ExecutableInput.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/input/ExecutableInput.java @@ -7,8 +7,8 @@ package org.elasticsearch.xpack.core.watcher.input; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.watcher.execution.WatchExecutionContext; import org.elasticsearch.xpack.core.watcher.watch.Payload; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/input/Input.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/input/Input.java index a71f7850ad0eb..47cc99705ced3 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/input/Input.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/input/Input.java @@ -8,9 +8,9 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.watcher.watch.Payload; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/input/none/NoneInput.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/input/none/NoneInput.java index 2bb89bae51bd3..c3eddbac3c9bb 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/input/none/NoneInput.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/input/none/NoneInput.java @@ -7,8 +7,8 @@ package org.elasticsearch.xpack.core.watcher.input.none; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.watcher.input.Input; import org.elasticsearch.xpack.core.watcher.watch.Payload; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/support/WatcherDateTimeUtils.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/support/WatcherDateTimeUtils.java index 01794daee29da..210fa2e02d51f 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/support/WatcherDateTimeUtils.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/support/WatcherDateTimeUtils.java @@ -14,8 +14,8 @@ import org.elasticsearch.common.time.DateFormatters; import org.elasticsearch.common.time.DateMathParser; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.mapper.DateFieldMapper; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/support/WatcherUtils.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/support/WatcherUtils.java index c88329fd45731..0d084b8949c56 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/support/WatcherUtils.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/support/WatcherUtils.java @@ -8,10 +8,10 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.lang.reflect.Array; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/support/xcontent/WatcherParams.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/support/xcontent/WatcherParams.java index 53cf7591dac9f..6c7e84991f390 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/support/xcontent/WatcherParams.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/support/xcontent/WatcherParams.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.core.watcher.support.xcontent; -import org.elasticsearch.common.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContent; import org.elasticsearch.xpack.core.watcher.watch.Watch; import java.util.HashMap; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/support/xcontent/WatcherXContentParser.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/support/xcontent/WatcherXContentParser.java index 985f8e893e731..b235cdccfd5cf 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/support/xcontent/WatcherXContentParser.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/support/xcontent/WatcherXContentParser.java @@ -8,8 +8,8 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.FilterXContentParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.FilterXContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.watcher.common.secret.Secret; import org.elasticsearch.xpack.core.watcher.crypto.CryptoService; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/support/xcontent/XContentSource.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/support/xcontent/XContentSource.java index 3a22aa3003428..53a97a921c092 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/support/xcontent/XContentSource.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/support/xcontent/XContentSource.java @@ -12,14 +12,14 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ObjectPath; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ObjectPath; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.XContentUtils; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentUtils; import java.io.IOException; import java.io.InputStream; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transform/ExecutableTransform.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transform/ExecutableTransform.java index 10d867f6b84db..e9afc13905ba5 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transform/ExecutableTransform.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transform/ExecutableTransform.java @@ -7,8 +7,8 @@ package org.elasticsearch.xpack.core.watcher.transform; import org.apache.logging.log4j.Logger; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.watcher.execution.WatchExecutionContext; import org.elasticsearch.xpack.core.watcher.watch.Payload; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transform/Transform.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transform/Transform.java index 41749662de027..9de859b593e7c 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transform/Transform.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transform/Transform.java @@ -8,9 +8,9 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.watcher.watch.Payload; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transform/TransformFactory.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transform/TransformFactory.java index b2862776ad2fc..cef4c89d7d94f 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transform/TransformFactory.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transform/TransformFactory.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.watcher.transform; import org.apache.logging.log4j.Logger; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transform/TransformRegistry.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transform/TransformRegistry.java index 0813e551c5d7e..4bf70962a1744 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transform/TransformRegistry.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transform/TransformRegistry.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.watcher.transform; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.watcher.transform.chain.ChainTransform; import org.elasticsearch.xpack.core.watcher.transform.chain.ChainTransformFactory; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transform/chain/ChainTransform.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transform/chain/ChainTransform.java index 4167f846affdb..b0841d9edcaad 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transform/chain/ChainTransform.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transform/chain/ChainTransform.java @@ -7,9 +7,9 @@ package org.elasticsearch.xpack.core.watcher.transform.chain; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.watcher.transform.Transform; import org.elasticsearch.xpack.core.watcher.transform.TransformRegistry; import org.elasticsearch.xpack.core.watcher.watch.Payload; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transform/chain/ChainTransformFactory.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transform/chain/ChainTransformFactory.java index d40a47f5c7316..8415804f0ffb3 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transform/chain/ChainTransformFactory.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transform/chain/ChainTransformFactory.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.watcher.transform.chain; import org.apache.logging.log4j.LogManager; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.watcher.transform.ExecutableTransform; import org.elasticsearch.xpack.core.watcher.transform.Transform; import org.elasticsearch.xpack.core.watcher.transform.TransformFactory; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/QueryWatchesAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/QueryWatchesAction.java index f8caf7ff97ada..1099066b0d4c2 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/QueryWatchesAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/QueryWatchesAction.java @@ -10,18 +10,18 @@ import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.ActionType; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentParser.Token; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser.Token; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.search.searchafter.SearchAfterBuilder; import org.elasticsearch.search.sort.FieldSortBuilder; @@ -32,7 +32,7 @@ import java.util.List; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; import static org.elasticsearch.index.query.AbstractQueryBuilder.parseInnerQueryBuilder; public class QueryWatchesAction extends ActionType { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/execute/ExecuteWatchRequest.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/execute/ExecuteWatchRequest.java index f2ab40528e74d..1baade7510974 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/execute/ExecuteWatchRequest.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/execute/ExecuteWatchRequest.java @@ -14,7 +14,7 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.watcher.client.WatchSourceBuilder; import org.elasticsearch.xpack.core.watcher.execution.ActionExecutionMode; import org.elasticsearch.xpack.core.watcher.support.WatcherUtils; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/execute/ExecuteWatchRequestBuilder.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/execute/ExecuteWatchRequestBuilder.java index 17c572c241860..99e01a9c5087f 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/execute/ExecuteWatchRequestBuilder.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/execute/ExecuteWatchRequestBuilder.java @@ -9,7 +9,7 @@ import org.elasticsearch.action.ActionRequestBuilder; import org.elasticsearch.client.ElasticsearchClient; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.watcher.client.WatchSourceBuilder; import org.elasticsearch.xpack.core.watcher.execution.ActionExecutionMode; import org.elasticsearch.xpack.core.watcher.trigger.TriggerEvent; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/execute/ExecuteWatchResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/execute/ExecuteWatchResponse.java index f004a5c50a197..231495a273aab 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/execute/ExecuteWatchResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/execute/ExecuteWatchResponse.java @@ -7,16 +7,16 @@ package org.elasticsearch.xpack.core.watcher.transport.actions.execute; import org.elasticsearch.action.ActionResponse; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.watcher.support.xcontent.XContentSource; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/get/GetWatchResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/get/GetWatchResponse.java index 7925b82699d61..1d1bbce5c504f 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/get/GetWatchResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/get/GetWatchResponse.java @@ -11,8 +11,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.lucene.uid.Versions; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.seqno.SequenceNumbers; import org.elasticsearch.xpack.core.watcher.support.xcontent.XContentSource; import org.elasticsearch.xpack.core.watcher.watch.WatchStatus; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/put/PutWatchRequestBuilder.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/put/PutWatchRequestBuilder.java index 03af9ce5e3868..a6433986b1496 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/put/PutWatchRequestBuilder.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/put/PutWatchRequestBuilder.java @@ -9,7 +9,7 @@ import org.elasticsearch.action.ActionRequestBuilder; import org.elasticsearch.client.ElasticsearchClient; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.protocol.xpack.watcher.PutWatchRequest; import org.elasticsearch.protocol.xpack.watcher.PutWatchResponse; import org.elasticsearch.xpack.core.watcher.client.WatchSourceBuilder; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/stats/WatcherStatsResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/stats/WatcherStatsResponse.java index 3717d8789b738..f351cde0d2c06 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/stats/WatcherStatsResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/stats/WatcherStatsResponse.java @@ -14,8 +14,8 @@ import org.elasticsearch.core.Nullable; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.watcher.WatcherMetadata; import org.elasticsearch.xpack.core.watcher.WatcherState; import org.elasticsearch.xpack.core.watcher.common.stats.Counters; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/trigger/Trigger.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/trigger/Trigger.java index 2afd0ff2ccff8..34f034162f0b4 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/trigger/Trigger.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/trigger/Trigger.java @@ -6,8 +6,8 @@ */ package org.elasticsearch.xpack.core.watcher.trigger; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/trigger/TriggerEvent.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/trigger/TriggerEvent.java index 033d650f043d5..b6b0fb5461788 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/trigger/TriggerEvent.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/trigger/TriggerEvent.java @@ -6,9 +6,9 @@ */ package org.elasticsearch.xpack.core.watcher.trigger; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.watcher.support.WatcherDateTimeUtils; import java.io.IOException; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/watch/Payload.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/watch/Payload.java index 66e3fa8733e46..efe22fcab9d73 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/watch/Payload.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/watch/Payload.java @@ -7,8 +7,8 @@ package org.elasticsearch.xpack.core.watcher.watch; import org.elasticsearch.common.collect.MapBuilder; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Collections; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/watch/Watch.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/watch/Watch.java index 74fc5bb535991..1abccf46e2a20 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/watch/Watch.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/watch/Watch.java @@ -8,8 +8,8 @@ import org.elasticsearch.core.Nullable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.seqno.SequenceNumbers; import org.elasticsearch.xpack.core.watcher.actions.ActionStatus; import org.elasticsearch.xpack.core.watcher.actions.ActionWrapper; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/watch/WatchField.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/watch/WatchField.java index 519718573863b..ffe6162e72905 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/watch/WatchField.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/watch/WatchField.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.core.watcher.watch; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; public final class WatchField { public static final ParseField TRIGGER = new ParseField("trigger"); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/watch/WatchStatus.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/watch/WatchStatus.java index 438bdd798d7d0..f186427a0a2d1 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/watch/WatchStatus.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/watch/WatchStatus.java @@ -8,13 +8,13 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.watcher.actions.Action; import org.elasticsearch.xpack.core.watcher.actions.ActionStatus; import org.elasticsearch.xpack.core.watcher.execution.ExecutionState; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/license/LicenseSerializationTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/license/LicenseSerializationTests.java index b5aeb3b4bd104..aaa672509ac15 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/license/LicenseSerializationTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/license/LicenseSerializationTests.java @@ -8,11 +8,11 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import java.nio.charset.StandardCharsets; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/license/LicenseServiceTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/license/LicenseServiceTests.java index 035faa484cf92..2c5092d042f16 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/license/LicenseServiceTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/license/LicenseServiceTests.java @@ -16,10 +16,10 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.env.Environment; import org.elasticsearch.env.TestEnvironment; import org.elasticsearch.license.licensor.LicenseSigner; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/license/LicenseTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/license/LicenseTests.java index 216697507fd5c..e118eac3a38c1 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/license/LicenseTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/license/LicenseTests.java @@ -13,9 +13,9 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.TestMatchers; import org.hamcrest.Matchers; @@ -24,7 +24,7 @@ import java.nio.charset.StandardCharsets; import java.util.concurrent.TimeUnit; -import static org.elasticsearch.common.xcontent.DeprecationHandler.THROW_UNSUPPORTED_OPERATION; +import static org.elasticsearch.xcontent.DeprecationHandler.THROW_UNSUPPORTED_OPERATION; import static org.elasticsearch.test.TestMatchers.throwableWithMessage; import static org.hamcrest.CoreMatchers.containsString; import static org.hamcrest.CoreMatchers.equalTo; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/license/LicensesMetadataSerializationTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/license/LicensesMetadataSerializationTests.java index 2289d1263749b..eb27f6e7107db 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/license/LicensesMetadataSerializationTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/license/LicensesMetadataSerializationTests.java @@ -13,12 +13,12 @@ import org.elasticsearch.cluster.metadata.RepositoryMetadata; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContent.Params; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContent.Params; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.ESTestCase; import java.util.Collections; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/license/LicensesTransportTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/license/LicensesTransportTests.java index 8dc93b7d94551..92bf2c0ebcb99 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/license/LicensesTransportTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/license/LicensesTransportTests.java @@ -11,7 +11,7 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.protocol.xpack.license.LicensesStatus; import org.elasticsearch.protocol.xpack.license.PutLicenseResponse; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/license/SelfGeneratedLicenseTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/license/SelfGeneratedLicenseTests.java index 3610d5817c350..a8f7ee9cf177e 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/license/SelfGeneratedLicenseTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/license/SelfGeneratedLicenseTests.java @@ -8,10 +8,10 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/license/TestUtils.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/license/TestUtils.java index e7d95e72b5692..88f4e8b921d32 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/license/TestUtils.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/license/TestUtils.java @@ -14,10 +14,10 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.time.DateFormatter; import org.elasticsearch.common.time.DateMathParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.TimeValue; import org.elasticsearch.license.licensor.LicenseSigner; import org.elasticsearch.protocol.xpack.license.LicensesStatus; @@ -40,7 +40,7 @@ import static com.carrotsearch.randomizedtesting.RandomizedTest.randomBoolean; import static com.carrotsearch.randomizedtesting.RandomizedTest.randomInt; import static org.apache.lucene.util.LuceneTestCase.createTempFile; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.test.ESTestCase.randomAlphaOfLength; import static org.elasticsearch.test.ESTestCase.randomFrom; import static org.elasticsearch.test.ESTestCase.randomIntBetween; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/LocalStateCompositeXPackPlugin.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/LocalStateCompositeXPackPlugin.java index 476c9fe62f02d..3a20c484e6457 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/LocalStateCompositeXPackPlugin.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/LocalStateCompositeXPackPlugin.java @@ -37,7 +37,7 @@ import org.elasticsearch.common.util.BigArrays; import org.elasticsearch.common.util.PageCacheRecycler; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.core.internal.io.IOUtils; import org.elasticsearch.env.Environment; import org.elasticsearch.env.NodeEnvironment; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/action/DelegatePkiAuthenticationRequestTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/action/DelegatePkiAuthenticationRequestTests.java index d83d03323e62c..090de8c0bc877 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/action/DelegatePkiAuthenticationRequestTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/action/DelegatePkiAuthenticationRequestTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import org.elasticsearch.xpack.core.security.action.DelegatePkiAuthenticationRequest; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/action/DelegatePkiAuthenticationResponseTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/action/DelegatePkiAuthenticationResponseTests.java index d38c24f0cf66f..460c90d571aaa 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/action/DelegatePkiAuthenticationResponseTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/action/DelegatePkiAuthenticationResponseTests.java @@ -8,12 +8,12 @@ package org.elasticsearch.xpack.core.action; import org.elasticsearch.Version; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import org.elasticsearch.xpack.core.security.action.DelegatePkiAuthenticationResponse; import org.elasticsearch.xpack.core.security.authc.Authentication; @@ -26,7 +26,7 @@ import java.util.Locale; import java.util.Map; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; import static org.hamcrest.Matchers.is; public class DelegatePkiAuthenticationResponseTests extends AbstractXContentTestCase { diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/action/ReloadAnalyzersResponseTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/action/ReloadAnalyzersResponseTests.java index c306013abdc2a..72d89b7ef41d3 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/action/ReloadAnalyzersResponseTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/action/ReloadAnalyzersResponseTests.java @@ -8,7 +8,7 @@ import org.elasticsearch.action.support.DefaultShardOperationFailedException; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractBroadcastResponseTestCase; import org.elasticsearch.test.VersionUtils; import org.elasticsearch.xpack.core.action.ReloadAnalyzersResponse.ReloadDetails; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/action/SetResetModeActionRequestTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/action/SetResetModeActionRequestTests.java index c56c95dc33fb2..5e28b413e154d 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/action/SetResetModeActionRequestTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/action/SetResetModeActionRequestTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.action; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; public class SetResetModeActionRequestTests extends AbstractSerializingTestCase { diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/action/util/PageParamsTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/action/util/PageParamsTests.java index c9cccde61811d..7fa3a173fc8fb 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/action/util/PageParamsTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/action/util/PageParamsTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.action.util; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; public class PageParamsTests extends AbstractSerializingTestCase { diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/action/util/QueryPageTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/action/util/QueryPageTests.java index d9f9bd02939ce..c740945d27757 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/action/util/QueryPageTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/action/util/QueryPageTests.java @@ -6,13 +6,13 @@ */ package org.elasticsearch.xpack.core.action.util; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.test.AbstractWireSerializingTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ccr/action/ShardFollowTaskTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ccr/action/ShardFollowTaskTests.java index 108f0807b0503..860043dc1a8c6 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ccr/action/ShardFollowTaskTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ccr/action/ShardFollowTaskTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.test.AbstractSerializingTestCase; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/common/notifications/AbstractAuditMessageTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/common/notifications/AbstractAuditMessageTests.java index c5461e777ed62..69b58c930874a 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/common/notifications/AbstractAuditMessageTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/common/notifications/AbstractAuditMessageTests.java @@ -6,13 +6,13 @@ */ package org.elasticsearch.xpack.core.common.notifications; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/common/notifications/AbstractAuditorTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/common/notifications/AbstractAuditorTests.java index a3d3b73db96bd..4c7341a4cb6ae 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/common/notifications/AbstractAuditorTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/common/notifications/AbstractAuditorTests.java @@ -31,11 +31,11 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.threadpool.TestThreadPool; import org.elasticsearch.threadpool.ThreadPool; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/common/time/TimeUtilsTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/common/time/TimeUtilsTests.java index 2fb7eb7e2a7b7..da6ae8fc7b150 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/common/time/TimeUtilsTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/common/time/TimeUtilsTests.java @@ -6,10 +6,10 @@ */ package org.elasticsearch.xpack.core.common.time; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/deprecation/DeprecationIssueTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/deprecation/DeprecationIssueTests.java index 05f1d01dd984b..4289d6230d70d 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/deprecation/DeprecationIssueTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/deprecation/DeprecationIssueTests.java @@ -9,8 +9,8 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; import org.elasticsearch.core.Tuple; import org.elasticsearch.test.ESTestCase; @@ -20,7 +20,7 @@ import java.io.IOException; import java.util.Map; -import static org.elasticsearch.common.xcontent.ToXContent.EMPTY_PARAMS; +import static org.elasticsearch.xcontent.ToXContent.EMPTY_PARAMS; import static org.hamcrest.core.IsEqual.equalTo; public class DeprecationIssueTests extends ESTestCase { diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/AllocateActionTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/AllocateActionTests.java index 0e509e827193f..222b30ca9d557 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/AllocateActionTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/AllocateActionTests.java @@ -11,7 +11,7 @@ import org.elasticsearch.cluster.routing.allocation.decider.ShardsLimitAllocationDecider; import org.elasticsearch.common.io.stream.Writeable.Reader; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ilm.Step.StepKey; import java.util.Collections; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/DeleteActionTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/DeleteActionTests.java index 33bf9527277dc..350bedb081a29 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/DeleteActionTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/DeleteActionTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ilm; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ilm.Step.StepKey; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/ExplainLifecycleResponseTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/ExplainLifecycleResponseTests.java index b139b6a157ac1..cc9924c26bae8 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/ExplainLifecycleResponseTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/ExplainLifecycleResponseTests.java @@ -8,12 +8,12 @@ package org.elasticsearch.xpack.core.ilm; import org.elasticsearch.cluster.ClusterModule; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.util.CollectionUtils; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/ForceMergeActionTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/ForceMergeActionTests.java index c61e10ea6810a..11c4264f5e400 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/ForceMergeActionTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/ForceMergeActionTests.java @@ -10,11 +10,11 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.core.Tuple; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.DeprecationHandler; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.codec.CodecService; import org.elasticsearch.index.engine.EngineConfig; import org.elasticsearch.xpack.core.ilm.Step.StepKey; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/FreezeActionTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/FreezeActionTests.java index 2e9afbf27d4a4..7e48a6fa01dd6 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/FreezeActionTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/FreezeActionTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ilm; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ilm.Step.StepKey; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/IndexLifecycleExplainResponseTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/IndexLifecycleExplainResponseTests.java index 52ab154414a5d..71d40f4038d42 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/IndexLifecycleExplainResponseTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/IndexLifecycleExplainResponseTests.java @@ -8,17 +8,17 @@ package org.elasticsearch.xpack.core.ilm; import org.elasticsearch.cluster.ClusterModule; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable.Reader; import org.elasticsearch.common.util.CollectionUtils; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/LifecyclePolicyMetadataTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/LifecyclePolicyMetadataTests.java index 0102c062a0f26..6081f82ac6635 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/LifecyclePolicyMetadataTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/LifecyclePolicyMetadataTests.java @@ -8,11 +8,11 @@ package org.elasticsearch.xpack.core.ilm; import org.elasticsearch.cluster.ClusterModule; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.junit.Before; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/LifecyclePolicyTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/LifecyclePolicyTests.java index e815b9db7c4a2..1623526c9d979 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/LifecyclePolicyTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/LifecyclePolicyTests.java @@ -9,12 +9,12 @@ import org.elasticsearch.client.Client; import org.elasticsearch.cluster.ClusterModule; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable.Reader; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ilm.Step.StepKey; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/MigrateActionTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/MigrateActionTests.java index eb0aa03c13420..550265f63e2c3 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/MigrateActionTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/MigrateActionTests.java @@ -13,7 +13,7 @@ import org.elasticsearch.cluster.metadata.Metadata; import org.elasticsearch.cluster.routing.allocation.DataTier; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ilm.Step.StepKey; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/MockAction.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/MockAction.java index ee9f2541ad716..c3f903d9ec2e1 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/MockAction.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/MockAction.java @@ -9,9 +9,9 @@ import org.elasticsearch.client.Client; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/MockActionTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/MockActionTests.java index 6f35085e7ef76..c95a1bcfdee07 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/MockActionTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/MockActionTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ilm; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/PhaseCacheManagementTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/PhaseCacheManagementTests.java index 81f2d9570402c..fcd320cad8a9e 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/PhaseCacheManagementTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/PhaseCacheManagementTests.java @@ -14,8 +14,8 @@ import org.elasticsearch.cluster.metadata.Metadata; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.TimeValue; import org.elasticsearch.test.ESTestCase; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/PhaseExecutionInfoTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/PhaseExecutionInfoTests.java index 71342c73602f6..73d3d4a45b530 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/PhaseExecutionInfoTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/PhaseExecutionInfoTests.java @@ -8,12 +8,12 @@ package org.elasticsearch.xpack.core.ilm; import org.elasticsearch.cluster.ClusterModule; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable.Reader; import org.elasticsearch.common.util.CollectionUtils; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.junit.Before; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/PhaseTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/PhaseTests.java index 03da4862fdc23..a3f6374903eea 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/PhaseTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/PhaseTests.java @@ -7,13 +7,13 @@ package org.elasticsearch.xpack.core.ilm; import org.elasticsearch.cluster.ClusterModule; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable.Reader; import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.CollectionUtils; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.junit.Before; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/ReadOnlyActionTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/ReadOnlyActionTests.java index 7f946ee7a736d..0986389072ec0 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/ReadOnlyActionTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/ReadOnlyActionTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ilm; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ilm.Step.StepKey; import java.util.List; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/RolloverActionTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/RolloverActionTests.java index eee5a913a1440..0f0f8c5176d27 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/RolloverActionTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/RolloverActionTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ilm.Step.StepKey; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/RollupILMActionTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/RollupILMActionTests.java index 020269c64d0b1..0570fb108cfe2 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/RollupILMActionTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/RollupILMActionTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ilm; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.EqualsHashCodeTestUtils; import org.elasticsearch.xpack.core.ilm.Step.StepKey; import org.elasticsearch.xpack.core.rollup.RollupActionConfig; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/SearchableSnapshotActionTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/SearchableSnapshotActionTests.java index c63254d3e0838..2b39fe6f18ecd 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/SearchableSnapshotActionTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/SearchableSnapshotActionTests.java @@ -7,8 +7,8 @@ package org.elasticsearch.xpack.core.ilm; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.cluster.routing.allocation.DataTier; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ilm.Step.StepKey; import org.elasticsearch.xpack.core.searchablesnapshots.MountSearchableSnapshotRequest; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/SegmentCountStepInfoTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/SegmentCountStepInfoTests.java index b061c20622cea..037f2d32b875e 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/SegmentCountStepInfoTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/SegmentCountStepInfoTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ilm; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import org.elasticsearch.test.EqualsHashCodeTestUtils; import org.elasticsearch.xpack.core.ilm.SegmentCountStep.Info; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/SegmentCountStepTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/SegmentCountStepTests.java index 790a64f2b8d7c..e455a21e8e55d 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/SegmentCountStepTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/SegmentCountStepTests.java @@ -17,7 +17,7 @@ import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.cluster.metadata.Metadata; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.ToXContentObject; import org.elasticsearch.index.Index; import org.elasticsearch.index.engine.Segment; import org.elasticsearch.rest.RestStatus; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/SetPriorityActionTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/SetPriorityActionTests.java index c5a087ca181a4..52f2c781323c9 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/SetPriorityActionTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/SetPriorityActionTests.java @@ -8,7 +8,7 @@ import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.EqualsHashCodeTestUtils; import org.elasticsearch.xpack.core.ilm.Step.StepKey; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/ShrinkActionTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/ShrinkActionTests.java index a6d4d5dde3aa8..3381350c6de7d 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/ShrinkActionTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/ShrinkActionTests.java @@ -14,7 +14,7 @@ import org.elasticsearch.common.io.stream.Writeable.Reader; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ilm.Step.StepKey; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/ShrunkShardsAllocatedStepInfoTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/ShrunkShardsAllocatedStepInfoTests.java index d99037617a831..6a12ac90859ce 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/ShrunkShardsAllocatedStepInfoTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/ShrunkShardsAllocatedStepInfoTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ilm; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import org.elasticsearch.test.EqualsHashCodeTestUtils; import org.elasticsearch.xpack.core.ilm.ShrunkShardsAllocatedStep.Info; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/ShrunkenIndexCheckStepInfoTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/ShrunkenIndexCheckStepInfoTests.java index f08b28b974c61..d8b9b76637528 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/ShrunkenIndexCheckStepInfoTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/ShrunkenIndexCheckStepInfoTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ilm; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import org.elasticsearch.test.EqualsHashCodeTestUtils; import org.elasticsearch.xpack.core.ilm.ShrunkenIndexCheckStep.Info; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/StepKeyTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/StepKeyTests.java index e38d2a3506b61..84ee38d342e39 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/StepKeyTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/StepKeyTests.java @@ -8,7 +8,7 @@ import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ilm.Step.StepKey; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/UnfollowActionTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/UnfollowActionTests.java index a7e613a60a3e5..916d06f1cbc24 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/UnfollowActionTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/UnfollowActionTests.java @@ -8,7 +8,7 @@ import org.elasticsearch.cluster.health.ClusterHealthStatus; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ilm.Step.StepKey; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/WaitForActiveShardsTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/WaitForActiveShardsTests.java index 14e761c3cef36..61a81afda1173 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/WaitForActiveShardsTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/WaitForActiveShardsTests.java @@ -18,9 +18,9 @@ import org.elasticsearch.cluster.routing.ShardRoutingState; import org.elasticsearch.cluster.routing.TestShardRouting; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.Index; import org.elasticsearch.xpack.core.ilm.Step.StepKey; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/WaitForFollowShardTasksStepInfoTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/WaitForFollowShardTasksStepInfoTests.java index d4128746fe3ba..ea8664ddd1259 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/WaitForFollowShardTasksStepInfoTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/WaitForFollowShardTasksStepInfoTests.java @@ -6,8 +6,8 @@ */ package org.elasticsearch.xpack.core.ilm; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import org.elasticsearch.xpack.core.ilm.WaitForFollowShardTasksStep.Info; import org.elasticsearch.xpack.core.ilm.WaitForFollowShardTasksStep.Info.ShardFollowTaskInfo; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/WaitForFollowShardTasksStepTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/WaitForFollowShardTasksStepTests.java index 11654282096ff..71eb7f8a75237 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/WaitForFollowShardTasksStepTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/WaitForFollowShardTasksStepTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.action.ActionListener; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.cluster.metadata.Metadata; -import org.elasticsearch.common.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.ToXContentObject; import org.elasticsearch.xpack.core.ccr.ShardFollowNodeTaskStatus; import org.elasticsearch.xpack.core.ccr.action.FollowStatsAction; import org.elasticsearch.xpack.core.ilm.Step.StepKey; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/WaitForNoFollowersStepTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/WaitForNoFollowersStepTests.java index d0db4d6545e7c..19c7665cee7ad 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/WaitForNoFollowersStepTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/WaitForNoFollowersStepTests.java @@ -17,7 +17,7 @@ import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.cluster.metadata.Metadata; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.ToXContentObject; import org.elasticsearch.index.seqno.RetentionLease; import org.elasticsearch.index.seqno.RetentionLeaseStats; import org.elasticsearch.index.seqno.RetentionLeases; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/WaitForRolloverReadyStepTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/WaitForRolloverReadyStepTests.java index db954daa1df42..b811470fca3d0 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/WaitForRolloverReadyStepTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/WaitForRolloverReadyStepTests.java @@ -25,7 +25,7 @@ import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.ToXContentObject; import org.mockito.Mockito; import java.util.Collections; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/WaitForSnapshotActionTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/WaitForSnapshotActionTests.java index 89b9687386ea7..c1089e365e9d9 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/WaitForSnapshotActionTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/WaitForSnapshotActionTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ilm; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.List; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/action/MoveToStepRequestTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/action/MoveToStepRequestTests.java index ee4bead3c25a5..cc3d19ed55d75 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/action/MoveToStepRequestTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/action/MoveToStepRequestTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.core.ilm.action; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ilm.Step.StepKey; import org.elasticsearch.xpack.core.ilm.StepKeyTests; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/action/PutLifecycleRequestTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/action/PutLifecycleRequestTests.java index 4db7b137d6199..cf556cd62b6a1 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/action/PutLifecycleRequestTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/action/PutLifecycleRequestTests.java @@ -7,11 +7,11 @@ package org.elasticsearch.xpack.core.ilm.action; import org.elasticsearch.cluster.ClusterModule; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ilm.AllocateAction; import org.elasticsearch.xpack.core.ilm.DeleteAction; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/action/RemoveIndexLifecyclePolicyResponseTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/action/RemoveIndexLifecyclePolicyResponseTests.java index fc2126cba42dc..d5e05ea966555 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/action/RemoveIndexLifecyclePolicyResponseTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/action/RemoveIndexLifecyclePolicyResponseTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.core.ilm.action; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ilm.action.RemoveIndexLifecyclePolicyAction.Response; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/step/info/AllocationRoutedStepInfoTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/step/info/AllocationRoutedStepInfoTests.java index e6c33af5526ef..4eb69a6f2e47a 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/step/info/AllocationRoutedStepInfoTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/step/info/AllocationRoutedStepInfoTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ilm.step.info; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import org.elasticsearch.test.EqualsHashCodeTestUtils; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/indexing/AsyncTwoPhaseIndexerTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/indexing/AsyncTwoPhaseIndexerTests.java index 0ab9cc8bdd90a..2f93e77e52d1e 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/indexing/AsyncTwoPhaseIndexerTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/indexing/AsyncTwoPhaseIndexerTests.java @@ -17,7 +17,7 @@ import org.elasticsearch.action.search.SearchResponseSections; import org.elasticsearch.action.search.ShardSearchFailure; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.core.TimeValue; import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.SearchHits; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/AbstractBWCSerializationTestCase.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/AbstractBWCSerializationTestCase.java index b45059d15f5f3..ae1863930d3a7 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/AbstractBWCSerializationTestCase.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/AbstractBWCSerializationTestCase.java @@ -8,7 +8,7 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContent; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/CloseJobActionRequestTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/CloseJobActionRequestTests.java index 42ce509e01163..b5cfe0cbea19b 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/CloseJobActionRequestTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/CloseJobActionRequestTests.java @@ -8,7 +8,7 @@ import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ml.action.CloseJobAction.Request; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/CreateTrainedModelAllocationActionResponseTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/CreateTrainedModelAllocationActionResponseTests.java index 980f5ef050559..3fcd6e89c79d3 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/CreateTrainedModelAllocationActionResponseTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/CreateTrainedModelAllocationActionResponseTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ml.action.CreateTrainedModelAllocationAction.Response; import org.elasticsearch.xpack.core.ml.inference.allocation.TrainedModelAllocationTests; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/DatafeedParamsTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/DatafeedParamsTests.java index eaa6abbdc9b16..8c4586a17df09 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/DatafeedParamsTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/DatafeedParamsTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/EvaluateDataFrameActionRequestTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/EvaluateDataFrameActionRequestTests.java index a5ecd13cfc98b..53222d3dfffeb 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/EvaluateDataFrameActionRequestTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/EvaluateDataFrameActionRequestTests.java @@ -9,8 +9,8 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.search.SearchModule; import org.elasticsearch.test.AbstractSerializingTestCase; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/ExplainDataFrameAnalyticsActionResponseTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/ExplainDataFrameAnalyticsActionResponseTests.java index 01b1fc75191c1..91f3fecdb3cfd 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/ExplainDataFrameAnalyticsActionResponseTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/ExplainDataFrameAnalyticsActionResponseTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ml.action.ExplainDataFrameAnalyticsAction.Response; import org.elasticsearch.xpack.core.ml.dataframe.explain.FieldSelection; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/ForecastJobActionRequestTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/ForecastJobActionRequestTests.java index 775b8f4b9a9cd..b38e06cf05ee7 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/ForecastJobActionRequestTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/ForecastJobActionRequestTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ml.action.ForecastJobAction.Request; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetBucketActionRequestTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetBucketActionRequestTests.java index 96b2725dc7da8..6f1deaa2513e9 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetBucketActionRequestTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetBucketActionRequestTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.action.util.PageParams; import org.elasticsearch.xpack.core.ml.action.GetBucketsAction.Request; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetCalendarEventsActionRequestTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetCalendarEventsActionRequestTests.java index fc886e2eeb44a..b2a8e180a96ba 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetCalendarEventsActionRequestTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetCalendarEventsActionRequestTests.java @@ -8,7 +8,7 @@ import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.action.util.PageParams; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetCalendarsActionRequestTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetCalendarsActionRequestTests.java index e0a000bdb4b51..81512b6f977ae 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetCalendarsActionRequestTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetCalendarsActionRequestTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.action.util.PageParams; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetCategoriesRequestTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetCategoriesRequestTests.java index d0d1ccdb78218..7c1bcb9619095 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetCategoriesRequestTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetCategoriesRequestTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.action.util.PageParams; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetDataFrameAnalyticsActionResponseTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetDataFrameAnalyticsActionResponseTests.java index 61f2cc2c70c77..32c0ff3f30604 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetDataFrameAnalyticsActionResponseTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetDataFrameAnalyticsActionResponseTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.search.SearchModule; import org.elasticsearch.test.AbstractWireSerializingTestCase; import org.elasticsearch.xpack.core.action.util.QueryPage; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetDataFrameAnalyticsStatsActionResponseTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetDataFrameAnalyticsStatsActionResponseTests.java index 811a576bf6f41..cb2886c59c871 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetDataFrameAnalyticsStatsActionResponseTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetDataFrameAnalyticsStatsActionResponseTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContent; import org.elasticsearch.test.AbstractWireSerializingTestCase; import org.elasticsearch.xpack.core.action.util.QueryPage; import org.elasticsearch.xpack.core.ml.action.GetDataFrameAnalyticsStatsAction.Response; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetDatafeedStatsActionResponseTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetDatafeedStatsActionResponseTests.java index 8f3053307274a..fbde8f3f83bc2 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetDatafeedStatsActionResponseTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetDatafeedStatsActionResponseTests.java @@ -11,10 +11,10 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.transport.TransportAddress; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.AbstractWireSerializingTestCase; import org.elasticsearch.xpack.core.action.util.QueryPage; import org.elasticsearch.xpack.core.ml.action.GetDatafeedsStatsAction.Response; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetInfluencersActionRequestTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetInfluencersActionRequestTests.java index 39246330abab3..1f70e1057a60f 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetInfluencersActionRequestTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetInfluencersActionRequestTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.action.util.PageParams; import org.elasticsearch.xpack.core.ml.action.GetInfluencersAction.Request; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetModelSnapshotsActionRequestTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetModelSnapshotsActionRequestTests.java index 1063686a97acf..36b16bc82767b 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetModelSnapshotsActionRequestTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetModelSnapshotsActionRequestTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.action.util.PageParams; import org.elasticsearch.xpack.core.ml.action.GetModelSnapshotsAction.Request; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetOverallBucketsActionRequestTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetOverallBucketsActionRequestTests.java index 49a8ea7ab3cd1..aea852a96405e 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetOverallBucketsActionRequestTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetOverallBucketsActionRequestTests.java @@ -8,7 +8,7 @@ import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ml.action.GetOverallBucketsAction.Request; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetRecordsActionRequestTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetRecordsActionRequestTests.java index 9dbe63181498f..f3dbfe21f2ec7 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetRecordsActionRequestTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/GetRecordsActionRequestTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.action.util.PageParams; import org.elasticsearch.xpack.core.ml.action.GetRecordsAction.Request; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/JobParamsTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/JobParamsTests.java index 8cd59139069a9..d9b720c7f323a 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/JobParamsTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/JobParamsTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ml.job.config.JobTests; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/OpenJobActionRequestTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/OpenJobActionRequestTests.java index 15408064bc3ef..b8310fc15d5ac 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/OpenJobActionRequestTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/OpenJobActionRequestTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ml.action.OpenJobAction.Request; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PostCalendarEventActionRequestTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PostCalendarEventActionRequestTests.java index 959f8f6c449a9..b522e52261b74 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PostCalendarEventActionRequestTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PostCalendarEventActionRequestTests.java @@ -9,8 +9,8 @@ import org.elasticsearch.ElasticsearchStatusException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.AbstractWireSerializingTestCase; import org.elasticsearch.xpack.core.ml.calendars.ScheduledEvent; import org.elasticsearch.xpack.core.ml.calendars.ScheduledEventTests; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PostDataActionRequestTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PostDataActionRequestTests.java index 017cd296bdd88..702dbc13bbf08 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PostDataActionRequestTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PostDataActionRequestTests.java @@ -8,7 +8,7 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.AbstractWireSerializingTestCase; import org.elasticsearch.xpack.core.ml.job.config.DataDescription; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PreviewDatafeedActionRequestTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PreviewDatafeedActionRequestTests.java index f2d465dccdd0d..1d33361863133 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PreviewDatafeedActionRequestTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PreviewDatafeedActionRequestTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.search.SearchModule; import org.elasticsearch.test.AbstractWireSerializingTestCase; import org.elasticsearch.xpack.core.ml.action.PreviewDatafeedAction.Request; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PutCalendarActionRequestTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PutCalendarActionRequestTests.java index e5237b5c53e5e..a8f3e97d8cf1c 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PutCalendarActionRequestTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PutCalendarActionRequestTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ml.calendars.CalendarTests; import org.elasticsearch.xpack.core.ml.job.config.JobTests; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PutDataFrameAnalyticsActionRequestTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PutDataFrameAnalyticsActionRequestTests.java index cad20194dfc59..50ee59e3ba81a 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PutDataFrameAnalyticsActionRequestTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PutDataFrameAnalyticsActionRequestTests.java @@ -9,8 +9,8 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.SearchModule; import org.elasticsearch.search.fetch.subphase.FetchSourceContext; import org.elasticsearch.test.AbstractSerializingTestCase; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PutDatafeedActionRequestTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PutDatafeedActionRequestTests.java index ce12663d58fa3..ea012a1d966de 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PutDatafeedActionRequestTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PutDatafeedActionRequestTests.java @@ -10,8 +10,8 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.SearchModule; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ml.action.PutDatafeedAction.Request; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PutFilterActionRequestTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PutFilterActionRequestTests.java index 8f0db61c1dbaa..03520de25a27a 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PutFilterActionRequestTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PutFilterActionRequestTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ml.action.PutFilterAction.Request; import org.elasticsearch.xpack.core.ml.job.config.MlFilterTests; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PutFilterActionResponseTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PutFilterActionResponseTests.java index e2db4f2ea1e98..a6bafdfed2c68 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PutFilterActionResponseTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PutFilterActionResponseTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ml.job.config.MlFilter; import org.elasticsearch.xpack.core.ml.job.config.MlFilterTests; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PutTrainedModelActionRequestTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PutTrainedModelActionRequestTests.java index 01555aa6024c3..272ec0a06a256 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PutTrainedModelActionRequestTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PutTrainedModelActionRequestTests.java @@ -8,7 +8,7 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.test.AbstractWireSerializingTestCase; import org.elasticsearch.xpack.core.ml.action.PutTrainedModelAction.Request; import org.elasticsearch.xpack.core.ml.inference.MlInferenceNamedXContentProvider; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PutTrainedModelActionResponseTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PutTrainedModelActionResponseTests.java index ee986cab32f49..01f4bda52e66e 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PutTrainedModelActionResponseTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/PutTrainedModelActionResponseTests.java @@ -8,7 +8,7 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.test.AbstractWireSerializingTestCase; import org.elasticsearch.xpack.core.ml.action.PutTrainedModelAction.Response; import org.elasticsearch.xpack.core.ml.inference.MlInferenceNamedXContentProvider; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/RevertModelSnapshotActionRequestTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/RevertModelSnapshotActionRequestTests.java index e22fe11218180..fbf2b53bb0c13 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/RevertModelSnapshotActionRequestTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/RevertModelSnapshotActionRequestTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ml.action.RevertModelSnapshotAction.Request; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/SetUpgradeModeActionRequestTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/SetUpgradeModeActionRequestTests.java index 7729e0e49a5d8..2711ff38b8a33 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/SetUpgradeModeActionRequestTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/SetUpgradeModeActionRequestTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ml.action.SetUpgradeModeAction.Request; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/StartDataFrameAnalyticsActionTaskParamsTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/StartDataFrameAnalyticsActionTaskParamsTests.java index 986d808808cdd..8886d43b8d3ff 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/StartDataFrameAnalyticsActionTaskParamsTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/StartDataFrameAnalyticsActionTaskParamsTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/StartDataFrameAnalyticsRequestTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/StartDataFrameAnalyticsRequestTests.java index bb8545220531d..2046a84ad3e97 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/StartDataFrameAnalyticsRequestTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/StartDataFrameAnalyticsRequestTests.java @@ -8,8 +8,8 @@ import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.AbstractWireSerializingTestCase; import org.elasticsearch.xpack.core.ml.action.StartDataFrameAnalyticsAction.Request; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/StartDatafeedActionRequestTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/StartDatafeedActionRequestTests.java index b223e8d525a73..1ed3c636e3268 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/StartDatafeedActionRequestTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/StartDatafeedActionRequestTests.java @@ -8,7 +8,7 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ml.action.StartDatafeedAction.Request; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/StartTrainedModelDeploymentRequestTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/StartTrainedModelDeploymentRequestTests.java index 545d242d3d69b..6bd27634dcf69 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/StartTrainedModelDeploymentRequestTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/StartTrainedModelDeploymentRequestTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.TimeValue; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ml.action.StartTrainedModelDeploymentAction.Request; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/StartTrainedModelDeploymentTaskParamsTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/StartTrainedModelDeploymentTaskParamsTests.java index 6781ce5ab23a6..95a529d3ccc1e 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/StartTrainedModelDeploymentTaskParamsTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/StartTrainedModelDeploymentTaskParamsTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ml.action.StartTrainedModelDeploymentAction.TaskParams; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/StopDataFrameAnalyticsRequestTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/StopDataFrameAnalyticsRequestTests.java index 51348b737308d..f8d195c593675 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/StopDataFrameAnalyticsRequestTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/StopDataFrameAnalyticsRequestTests.java @@ -8,8 +8,8 @@ import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.AbstractWireSerializingTestCase; import org.elasticsearch.xpack.core.ml.action.StopDataFrameAnalyticsAction.Request; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/StopDatafeedActionRequestTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/StopDatafeedActionRequestTests.java index eafdaa12289ef..a6f5b064e57f4 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/StopDatafeedActionRequestTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/StopDatafeedActionRequestTests.java @@ -8,7 +8,7 @@ import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ml.action.StopDatafeedAction.Request; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/UpdateDataFrameAnalyticsActionRequestTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/UpdateDataFrameAnalyticsActionRequestTests.java index 1a4f044831a75..493eb803d6c5f 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/UpdateDataFrameAnalyticsActionRequestTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/UpdateDataFrameAnalyticsActionRequestTests.java @@ -7,8 +7,8 @@ package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ml.action.UpdateDataFrameAnalyticsAction.Request; import org.elasticsearch.xpack.core.ml.dataframe.DataFrameAnalyticsConfigUpdate; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/UpdateDatafeedActionRequestTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/UpdateDatafeedActionRequestTests.java index bcd5612f6c1ef..27728b2aee22d 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/UpdateDatafeedActionRequestTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/UpdateDatafeedActionRequestTests.java @@ -9,8 +9,8 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.SearchModule; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ml.action.UpdateDatafeedAction.Request; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/UpdateFilterActionRequestTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/UpdateFilterActionRequestTests.java index 77516934075d4..c42864a0f3479 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/UpdateFilterActionRequestTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/UpdateFilterActionRequestTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ml.action.UpdateFilterAction.Request; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/UpdateModelSnapshotActionRequestTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/UpdateModelSnapshotActionRequestTests.java index 9800b44808336..ec01f8352a849 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/UpdateModelSnapshotActionRequestTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/UpdateModelSnapshotActionRequestTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ml.action.UpdateModelSnapshotAction.Request; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/UpgradeJobModelSnapshotRequestTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/UpgradeJobModelSnapshotRequestTests.java index 91341ae1dbeb4..1875f95fd96ee 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/UpgradeJobModelSnapshotRequestTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/UpgradeJobModelSnapshotRequestTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ml.action.UpgradeJobModelSnapshotAction.Request; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/UpgradeJobModelSnapshotResponseTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/UpgradeJobModelSnapshotResponseTests.java index 3f1800552fefa..86c70d28d22e7 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/UpgradeJobModelSnapshotResponseTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/UpgradeJobModelSnapshotResponseTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ml.action.UpgradeJobModelSnapshotAction.Response; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/ValidateDetectorActionRequestTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/ValidateDetectorActionRequestTests.java index c6947f005868a..8148ed6a8845b 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/ValidateDetectorActionRequestTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/ValidateDetectorActionRequestTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.action; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ml.action.ValidateDetectorAction.Request; import org.elasticsearch.xpack.core.ml.job.config.Detector; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/ValidateJobConfigActionRequestTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/ValidateJobConfigActionRequestTests.java index 1f0d97f32482a..3dcf770e5a125 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/ValidateJobConfigActionRequestTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/ValidateJobConfigActionRequestTests.java @@ -8,13 +8,13 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.AbstractWireSerializingTestCase; import org.elasticsearch.xpack.core.ml.action.ValidateJobConfigAction.Request; import org.elasticsearch.xpack.core.ml.job.config.Job; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/annotations/AnnotationTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/annotations/AnnotationTests.java index f48959adff3c2..68bf809a6fac7 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/annotations/AnnotationTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/annotations/AnnotationTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.annotations; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import java.util.Date; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/calendars/CalendarTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/calendars/CalendarTests.java index 6951b2b8d1c54..6b748e86f063c 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/calendars/CalendarTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/calendars/CalendarTests.java @@ -7,8 +7,8 @@ package org.elasticsearch.xpack.core.ml.calendars; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ml.job.config.JobTests; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/calendars/ScheduledEventTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/calendars/ScheduledEventTests.java index 7ed3cfdd08935..31071526fb8d3 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/calendars/ScheduledEventTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/calendars/ScheduledEventTests.java @@ -9,8 +9,8 @@ import org.elasticsearch.ElasticsearchStatusException; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ml.job.config.DetectionRule; import org.elasticsearch.xpack.core.ml.job.config.Operator; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/datafeed/AggProviderTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/datafeed/AggProviderTests.java index 2f6ff7bd733a1..64de65066c688 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/datafeed/AggProviderTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/datafeed/AggProviderTests.java @@ -10,11 +10,11 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.search.SearchModule; import org.elasticsearch.search.aggregations.AggregatorFactories; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/datafeed/AggProviderWireSerializationTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/datafeed/AggProviderWireSerializationTests.java index f230998da528c..35d9149da4590 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/datafeed/AggProviderWireSerializationTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/datafeed/AggProviderWireSerializationTests.java @@ -11,7 +11,7 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.search.SearchModule; import org.elasticsearch.search.aggregations.AggregatorFactories; import org.elasticsearch.xpack.core.ml.AbstractBWCWireSerializationTestCase; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/datafeed/ChunkingConfigTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/datafeed/ChunkingConfigTests.java index 984cff4ebb5af..cf1803bb3ea7c 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/datafeed/ChunkingConfigTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/datafeed/ChunkingConfigTests.java @@ -8,7 +8,7 @@ import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/datafeed/DatafeedConfigTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/datafeed/DatafeedConfigTests.java index decbd9d51bfec..1e7a08a861f8c 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/datafeed/DatafeedConfigTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/datafeed/DatafeedConfigTests.java @@ -21,15 +21,15 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.CollectionUtils; -import org.elasticsearch.common.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.DeprecationHandler; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.query.BoolQueryBuilder; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.index.query.TermQueryBuilder; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/datafeed/DatafeedTimingStatsTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/datafeed/DatafeedTimingStatsTests.java index 1ec6127251a41..8af6cf3b5124c 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/datafeed/DatafeedTimingStatsTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/datafeed/DatafeedTimingStatsTests.java @@ -7,11 +7,11 @@ package org.elasticsearch.xpack.core.ml.datafeed; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ml.utils.ExponentialAverageCalculationContext; import org.elasticsearch.xpack.core.ml.utils.ExponentialAverageCalculationContextTests; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/datafeed/DatafeedUpdateTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/datafeed/DatafeedUpdateTests.java index 2334ba5501d47..642ff8979f7f3 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/datafeed/DatafeedUpdateTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/datafeed/DatafeedUpdateTests.java @@ -19,12 +19,12 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.CollectionUtils; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.query.BoolQueryBuilder; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.index.query.TermQueryBuilder; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/datafeed/DelayedDataCheckConfigTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/datafeed/DelayedDataCheckConfigTests.java index b3ccb7e46e3ba..b7eff99e5e494 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/datafeed/DelayedDataCheckConfigTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/datafeed/DelayedDataCheckConfigTests.java @@ -8,7 +8,7 @@ import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/DataFrameAnalyticsConfigTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/DataFrameAnalyticsConfigTests.java index 799b2779b6c8d..8acabb0c0a93f 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/DataFrameAnalyticsConfigTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/DataFrameAnalyticsConfigTests.java @@ -17,18 +17,18 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.DeprecationHandler; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.query.MatchAllQueryBuilder; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.search.SearchModule; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/DataFrameAnalyticsConfigUpdateTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/DataFrameAnalyticsConfigUpdateTests.java index 0507dbabc620c..1b295070003b6 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/DataFrameAnalyticsConfigUpdateTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/DataFrameAnalyticsConfigUpdateTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.test.AbstractSerializingTestCase; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/DataFrameAnalyticsDestTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/DataFrameAnalyticsDestTests.java index a6163b38b5bc1..b06ed310c3493 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/DataFrameAnalyticsDestTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/DataFrameAnalyticsDestTests.java @@ -8,7 +8,7 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.AbstractBWCSerializationTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/DataFrameAnalyticsSourceTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/DataFrameAnalyticsSourceTests.java index a238b445efff8..88d671d669d95 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/DataFrameAnalyticsSourceTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/DataFrameAnalyticsSourceTests.java @@ -11,8 +11,8 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.search.SearchModule; import org.elasticsearch.search.fetch.subphase.FetchSourceContext; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/DataFrameAnalyticsTaskStateTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/DataFrameAnalyticsTaskStateTests.java index a5dfb17c604c1..c3cc06e15a6e3 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/DataFrameAnalyticsTaskStateTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/DataFrameAnalyticsTaskStateTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.dataframe; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/analyses/BoostedTreeParamsTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/analyses/BoostedTreeParamsTests.java index 8e25a183c922f..fb55296d59696 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/analyses/BoostedTreeParamsTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/analyses/BoostedTreeParamsTests.java @@ -9,8 +9,8 @@ import org.elasticsearch.ElasticsearchStatusException; import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.AbstractBWCSerializationTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/analyses/ClassificationTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/analyses/ClassificationTests.java index 08b439dc8f928..c735fb2f9923f 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/analyses/ClassificationTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/analyses/ClassificationTests.java @@ -15,14 +15,14 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.mapper.BooleanFieldMapper; import org.elasticsearch.index.mapper.KeywordFieldMapper; import org.elasticsearch.index.mapper.NumberFieldMapper; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/analyses/OutlierDetectionTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/analyses/OutlierDetectionTests.java index 081af73f017e1..395bb6d8a51e8 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/analyses/OutlierDetectionTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/analyses/OutlierDetectionTests.java @@ -8,7 +8,7 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.mapper.NumberFieldMapper; import org.elasticsearch.xpack.core.ml.AbstractBWCSerializationTestCase; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/analyses/RegressionTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/analyses/RegressionTests.java index dd501734b1d90..be8e95c5b96e9 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/analyses/RegressionTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/analyses/RegressionTests.java @@ -13,14 +13,14 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.search.SearchModule; import org.elasticsearch.xpack.core.ml.AbstractBWCSerializationTestCase; import org.elasticsearch.xpack.core.ml.inference.MlInferenceNamedXContentProvider; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/classification/AccuracyTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/classification/AccuracyTests.java index f06fc59c33982..8121d64f99b69 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/classification/AccuracyTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/classification/AccuracyTests.java @@ -8,7 +8,7 @@ import org.elasticsearch.ElasticsearchStatusException; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.aggregations.Aggregations; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ml.dataframe.evaluation.EvaluationFields; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/classification/AucRocTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/classification/AucRocTests.java index d23d030f55d95..f79bd5fd6495a 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/classification/AucRocTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/classification/AucRocTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.dataframe.evaluation.classification; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/classification/ClassificationTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/classification/ClassificationTests.java index 6239d8f47c52c..2eebdd905a4dc 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/classification/ClassificationTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/classification/ClassificationTests.java @@ -15,9 +15,9 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.search.SearchHits; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/classification/MulticlassConfusionMatrixResultTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/classification/MulticlassConfusionMatrixResultTests.java index 84d2f743b89cb..b2842fe802288 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/classification/MulticlassConfusionMatrixResultTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/classification/MulticlassConfusionMatrixResultTests.java @@ -8,7 +8,7 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ml.dataframe.evaluation.classification.MulticlassConfusionMatrix.ActualClass; import org.elasticsearch.xpack.core.ml.dataframe.evaluation.classification.MulticlassConfusionMatrix.PredictedClass; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/classification/MulticlassConfusionMatrixTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/classification/MulticlassConfusionMatrixTests.java index 1bacf784d50d4..e148ffc9e2653 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/classification/MulticlassConfusionMatrixTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/classification/MulticlassConfusionMatrixTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.ElasticsearchStatusException; import org.elasticsearch.core.Tuple; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.Aggregations; import org.elasticsearch.search.aggregations.PipelineAggregationBuilder; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/classification/PerClassSingleValueTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/classification/PerClassSingleValueTests.java index 33627ffbe288e..9d3ec91f9e81d 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/classification/PerClassSingleValueTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/classification/PerClassSingleValueTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.dataframe.evaluation.classification; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/classification/PrecisionTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/classification/PrecisionTests.java index 6f2bc9c13bd1c..dbc51ad679ff3 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/classification/PrecisionTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/classification/PrecisionTests.java @@ -8,7 +8,7 @@ import org.elasticsearch.ElasticsearchStatusException; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.aggregations.Aggregations; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ml.dataframe.evaluation.EvaluationFields; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/classification/RecallTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/classification/RecallTests.java index eb787161b3b7b..e1ab0a15264a5 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/classification/RecallTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/classification/RecallTests.java @@ -8,7 +8,7 @@ import org.elasticsearch.ElasticsearchStatusException; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.aggregations.Aggregations; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ml.dataframe.evaluation.EvaluationFields; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/outlierdetection/AucRocTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/outlierdetection/AucRocTests.java index a1181b3ac5d74..cbbd0ed40fdaa 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/outlierdetection/AucRocTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/outlierdetection/AucRocTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.dataframe.evaluation.outlierdetection; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/outlierdetection/ConfusionMatrixTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/outlierdetection/ConfusionMatrixTests.java index bf88fcd341c7d..f30cd27ca5cf8 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/outlierdetection/ConfusionMatrixTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/outlierdetection/ConfusionMatrixTests.java @@ -8,7 +8,7 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.aggregations.Aggregations; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ml.dataframe.evaluation.EvaluationMetricResult; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/outlierdetection/OutlierDetectionTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/outlierdetection/OutlierDetectionTests.java index e6521656fde82..b965954967953 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/outlierdetection/OutlierDetectionTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/outlierdetection/OutlierDetectionTests.java @@ -9,8 +9,8 @@ import org.elasticsearch.ElasticsearchStatusException; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.search.builder.SearchSourceBuilder; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/outlierdetection/PrecisionTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/outlierdetection/PrecisionTests.java index 6686c37dd9d66..bd4c81b119c5d 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/outlierdetection/PrecisionTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/outlierdetection/PrecisionTests.java @@ -8,7 +8,7 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.aggregations.Aggregations; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ml.dataframe.evaluation.EvaluationMetricResult; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/outlierdetection/RecallTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/outlierdetection/RecallTests.java index a8f0ef0212a21..be6ca623f6e6f 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/outlierdetection/RecallTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/outlierdetection/RecallTests.java @@ -8,7 +8,7 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.aggregations.Aggregations; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ml.dataframe.evaluation.EvaluationMetricResult; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/regression/HuberTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/regression/HuberTests.java index 8474ca658188d..ef5abedc0a61c 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/regression/HuberTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/regression/HuberTests.java @@ -8,7 +8,7 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.aggregations.Aggregations; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ml.dataframe.evaluation.EvaluationMetricResult; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/regression/MeanSquaredErrorTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/regression/MeanSquaredErrorTests.java index 8751e37094c5a..ea3f4cc9b5dd4 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/regression/MeanSquaredErrorTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/regression/MeanSquaredErrorTests.java @@ -8,7 +8,7 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.aggregations.Aggregations; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ml.dataframe.evaluation.EvaluationMetricResult; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/regression/MeanSquaredLogarithmicErrorTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/regression/MeanSquaredLogarithmicErrorTests.java index c30822bc61c73..009fd1dd4a6e0 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/regression/MeanSquaredLogarithmicErrorTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/regression/MeanSquaredLogarithmicErrorTests.java @@ -8,7 +8,7 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.aggregations.Aggregations; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ml.dataframe.evaluation.EvaluationMetricResult; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/regression/RSquaredTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/regression/RSquaredTests.java index 25daef4674890..485ded8ee6185 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/regression/RSquaredTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/regression/RSquaredTests.java @@ -8,7 +8,7 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.aggregations.Aggregations; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ml.dataframe.evaluation.EvaluationMetricResult; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/regression/RegressionTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/regression/RegressionTests.java index 7084dbe7723e5..ac3f2901e1514 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/regression/RegressionTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/evaluation/regression/RegressionTests.java @@ -9,8 +9,8 @@ import org.elasticsearch.ElasticsearchStatusException; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.search.builder.SearchSourceBuilder; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/explain/FieldSelectionTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/explain/FieldSelectionTests.java index ec1a679e9cb5f..d007da5363b96 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/explain/FieldSelectionTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/explain/FieldSelectionTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.dataframe.explain; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/explain/MemoryEstimationTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/explain/MemoryEstimationTests.java index c6adc8d19754d..0abdfd6791d18 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/explain/MemoryEstimationTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/explain/MemoryEstimationTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/stats/classification/ClassificationStatsTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/stats/classification/ClassificationStatsTests.java index 3d33473c3a605..6b9135d06617b 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/stats/classification/ClassificationStatsTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/stats/classification/ClassificationStatsTests.java @@ -8,8 +8,8 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.AbstractBWCSerializationTestCase; import org.elasticsearch.xpack.core.ml.utils.ToXContentParams; import org.junit.Before; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/stats/classification/HyperparametersTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/stats/classification/HyperparametersTests.java index ccae7f2cfc3ff..b903ab8f845cf 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/stats/classification/HyperparametersTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/stats/classification/HyperparametersTests.java @@ -8,7 +8,7 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.AbstractBWCSerializationTestCase; import org.junit.Before; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/stats/classification/TimingStatsTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/stats/classification/TimingStatsTests.java index d3facbd16ddbf..e241d80e38f48 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/stats/classification/TimingStatsTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/stats/classification/TimingStatsTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.AbstractBWCSerializationTestCase; import org.junit.Before; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/stats/classification/ValidationLossTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/stats/classification/ValidationLossTests.java index ed843dfc89218..ed5ee83ebd666 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/stats/classification/ValidationLossTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/stats/classification/ValidationLossTests.java @@ -9,8 +9,8 @@ import org.elasticsearch.Version; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.AbstractBWCSerializationTestCase; import org.elasticsearch.xpack.core.ml.dataframe.stats.common.FoldValuesTests; import org.elasticsearch.xpack.core.ml.utils.ToXContentParams; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/stats/common/DataCountsTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/stats/common/DataCountsTests.java index 51a0ce13ca86c..4a3371b02e74e 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/stats/common/DataCountsTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/stats/common/DataCountsTests.java @@ -8,8 +8,8 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.AbstractBWCSerializationTestCase; import org.elasticsearch.xpack.core.ml.utils.ToXContentParams; import org.junit.Before; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/stats/common/FoldValuesTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/stats/common/FoldValuesTests.java index a8715b4eb7f2f..5bfbd085a1871 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/stats/common/FoldValuesTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/stats/common/FoldValuesTests.java @@ -8,7 +8,7 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.AbstractBWCSerializationTestCase; import org.junit.Before; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/stats/common/MemoryUsageTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/stats/common/MemoryUsageTests.java index 45bb46f1aa85f..2ac99381bcf89 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/stats/common/MemoryUsageTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/stats/common/MemoryUsageTests.java @@ -8,8 +8,8 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ml.utils.ToXContentParams; import org.junit.Before; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/stats/outlierdetection/OutlierDetectionStatsTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/stats/outlierdetection/OutlierDetectionStatsTests.java index 99d718ecf78b2..84bb4dd15d686 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/stats/outlierdetection/OutlierDetectionStatsTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/stats/outlierdetection/OutlierDetectionStatsTests.java @@ -8,8 +8,8 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.AbstractBWCSerializationTestCase; import org.elasticsearch.xpack.core.ml.utils.ToXContentParams; import org.junit.Before; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/stats/outlierdetection/ParametersTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/stats/outlierdetection/ParametersTests.java index 09050dd865533..c8aab4756d1c7 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/stats/outlierdetection/ParametersTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/stats/outlierdetection/ParametersTests.java @@ -8,7 +8,7 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.AbstractBWCSerializationTestCase; import org.junit.Before; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/stats/outlierdetection/TimingStatsTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/stats/outlierdetection/TimingStatsTests.java index 0409c44e5ec0c..c33b30b77da60 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/stats/outlierdetection/TimingStatsTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/stats/outlierdetection/TimingStatsTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.AbstractBWCSerializationTestCase; import org.junit.Before; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/stats/regression/HyperparametersTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/stats/regression/HyperparametersTests.java index b558a6a616f26..61a0aba7b88f0 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/stats/regression/HyperparametersTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/stats/regression/HyperparametersTests.java @@ -8,7 +8,7 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.AbstractBWCSerializationTestCase; import org.junit.Before; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/stats/regression/RegressionStatsTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/stats/regression/RegressionStatsTests.java index af39d6de2a0ce..e35e48c03a04c 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/stats/regression/RegressionStatsTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/stats/regression/RegressionStatsTests.java @@ -8,8 +8,8 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.AbstractBWCSerializationTestCase; import org.elasticsearch.xpack.core.ml.utils.ToXContentParams; import org.junit.Before; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/stats/regression/TimingStatsTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/stats/regression/TimingStatsTests.java index 830c6843e81e4..868019e1fead5 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/stats/regression/TimingStatsTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/stats/regression/TimingStatsTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.AbstractBWCSerializationTestCase; import org.junit.Before; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/stats/regression/ValidationLossTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/stats/regression/ValidationLossTests.java index 75317559e6f88..6c99ced12136e 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/stats/regression/ValidationLossTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/dataframe/stats/regression/ValidationLossTests.java @@ -9,8 +9,8 @@ import org.elasticsearch.Version; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.AbstractBWCSerializationTestCase; import org.elasticsearch.xpack.core.ml.dataframe.stats.common.FoldValuesTests; import org.elasticsearch.xpack.core.ml.utils.ToXContentParams; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/InferenceConfigItemTestCase.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/InferenceConfigItemTestCase.java index 372894696a548..74e5de5dd4ea3 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/InferenceConfigItemTestCase.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/InferenceConfigItemTestCase.java @@ -10,8 +10,8 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; import org.elasticsearch.search.SearchModule; import org.elasticsearch.xpack.core.ml.AbstractBWCSerializationTestCase; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/InferenceToXContentCompressorTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/InferenceToXContentCompressorTests.java index 6a98cdb49550a..bcd2f36c21454 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/InferenceToXContentCompressorTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/InferenceToXContentCompressorTests.java @@ -11,7 +11,7 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.Streams; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.ml.inference.preprocessing.FrequencyEncodingTests; import org.elasticsearch.xpack.core.ml.inference.preprocessing.OneHotEncodingTests; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/NamedXContentObjectsTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/NamedXContentObjectsTests.java index ff4d404e75761..666f297047f54 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/NamedXContentObjectsTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/NamedXContentObjectsTests.java @@ -6,13 +6,13 @@ */ package org.elasticsearch.xpack.core.ml.inference; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.SearchModule; import org.elasticsearch.test.AbstractXContentTestCase; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.LenientlyParsedTrainedModel; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/TrainedModelConfigTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/TrainedModelConfigTests.java index 1097b8ff37fd1..c2911a51ebf6a 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/TrainedModelConfigTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/TrainedModelConfigTests.java @@ -12,14 +12,14 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.license.License; import org.elasticsearch.search.SearchModule; import org.elasticsearch.xpack.core.ml.AbstractBWCSerializationTestCase; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/TrainedModelDefinitionTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/TrainedModelDefinitionTests.java index 56a4eae17bcd1..a2cc7e915c19a 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/TrainedModelDefinitionTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/TrainedModelDefinitionTests.java @@ -9,11 +9,11 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.search.SearchModule; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ml.inference.preprocessing.FrequencyEncodingTests; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/TrainedModelInputTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/TrainedModelInputTests.java index 1213d033ff456..d72017d596bd8 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/TrainedModelInputTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/TrainedModelInputTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.inference; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.junit.Before; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/allocation/AllocationStatusTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/allocation/AllocationStatusTests.java index fcd15d017104b..e00b5aa981eff 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/allocation/AllocationStatusTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/allocation/AllocationStatusTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.core.ml.inference.allocation; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/allocation/RoutingStateAndReasonTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/allocation/RoutingStateAndReasonTests.java index 438372248cee3..e803fe98204c5 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/allocation/RoutingStateAndReasonTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/allocation/RoutingStateAndReasonTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.core.ml.inference.allocation; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/allocation/TrainedModelAllocationTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/allocation/TrainedModelAllocationTests.java index 2b559d7d512f4..473730901cac7 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/allocation/TrainedModelAllocationTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/allocation/TrainedModelAllocationTests.java @@ -13,7 +13,7 @@ import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.node.DiscoveryNodeRole; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ml.action.StartTrainedModelDeploymentAction; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/preprocessing/CustomWordEmbeddingTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/preprocessing/CustomWordEmbeddingTests.java index a4e1ea8da7d4b..48cae048a57e6 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/preprocessing/CustomWordEmbeddingTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/preprocessing/CustomWordEmbeddingTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.inference.preprocessing; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/preprocessing/FrequencyEncodingTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/preprocessing/FrequencyEncodingTests.java index bc56d923fff57..08c778edaad51 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/preprocessing/FrequencyEncodingTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/preprocessing/FrequencyEncodingTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.inference.preprocessing; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.hamcrest.Matcher; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/preprocessing/MultiTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/preprocessing/MultiTests.java index f226cec21d19d..f480cedc9b23b 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/preprocessing/MultiTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/preprocessing/MultiTests.java @@ -8,7 +8,7 @@ import org.elasticsearch.common.collect.MapBuilder; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/preprocessing/NGramTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/preprocessing/NGramTests.java index a90404ec968b4..3f1e5bec212f7 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/preprocessing/NGramTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/preprocessing/NGramTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.inference.preprocessing; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.hamcrest.Matcher; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/preprocessing/OneHotEncodingTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/preprocessing/OneHotEncodingTests.java index 6afdc6f7ede80..da75608e46d50 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/preprocessing/OneHotEncodingTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/preprocessing/OneHotEncodingTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.inference.preprocessing; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.hamcrest.Matcher; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/preprocessing/PreProcessingTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/preprocessing/PreProcessingTests.java index 6e36e1d888130..01141e637dc0c 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/preprocessing/PreProcessingTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/preprocessing/PreProcessingTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.inference.preprocessing; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ml.inference.MlInferenceNamedXContentProvider; import org.hamcrest.Matcher; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/preprocessing/TargetMeanEncodingTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/preprocessing/TargetMeanEncodingTests.java index a01d2f6c793fd..500f025711a96 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/preprocessing/TargetMeanEncodingTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/preprocessing/TargetMeanEncodingTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.inference.preprocessing; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.hamcrest.Matcher; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/preprocessing/customwordembedding/NGramFeatureExtractorTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/preprocessing/customwordembedding/NGramFeatureExtractorTests.java index 9d21adb96bc5d..afcf4d9e51830 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/preprocessing/customwordembedding/NGramFeatureExtractorTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/preprocessing/customwordembedding/NGramFeatureExtractorTests.java @@ -7,14 +7,14 @@ */ package org.elasticsearch.xpack.core.ml.inference.preprocessing.customwordembedding; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.langident.LanguageExamples; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/ClassificationFeatureImportanceTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/ClassificationFeatureImportanceTests.java index a41cd0ec18bab..a47a4a5bcf0cc 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/ClassificationFeatureImportanceTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/ClassificationFeatureImportanceTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.inference.results; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.test.ESTestCase; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/InferenceResultsTestCase.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/InferenceResultsTestCase.java index 0a06eafbc7697..a6eadd1bbd0ad 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/InferenceResultsTestCase.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/InferenceResultsTestCase.java @@ -8,8 +8,8 @@ package org.elasticsearch.xpack.core.ml.inference.results; import org.elasticsearch.Version; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.ingest.IngestDocument; import org.elasticsearch.test.AbstractWireSerializingTestCase; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/RegressionFeatureImportanceTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/RegressionFeatureImportanceTests.java index 9859af87b6a43..4080ada7e02d1 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/RegressionFeatureImportanceTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/RegressionFeatureImportanceTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.inference.results; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/TopClassEntryTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/TopClassEntryTests.java index 7fad41cb79fa7..9a636edad619a 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/TopClassEntryTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/results/TopClassEntryTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.core.ml.inference.results; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/BertTokenizationTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/BertTokenizationTests.java index 4343183e095aa..9000a6b61e921 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/BertTokenizationTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/BertTokenizationTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.AbstractBWCSerializationTestCase; import org.junit.Before; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ClassificationConfigTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ClassificationConfigTests.java index 2ed669bf04a0b..b03e9a2cf7809 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ClassificationConfigTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ClassificationConfigTests.java @@ -8,7 +8,7 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.AbstractBWCSerializationTestCase; import org.junit.Before; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ClassificationConfigUpdateTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ClassificationConfigUpdateTests.java index 4dfa7e370e663..eedfc153aa7be 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ClassificationConfigUpdateTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ClassificationConfigUpdateTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.ElasticsearchStatusException; import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.AbstractBWCSerializationTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/FillMaskConfigTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/FillMaskConfigTests.java index f0f42583c84d1..cea3428ff1355 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/FillMaskConfigTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/FillMaskConfigTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.inference.InferenceConfigItemTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/FillMaskConfigUpdateTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/FillMaskConfigUpdateTests.java index 9c76d91e36ec8..2f791fc3809bd 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/FillMaskConfigUpdateTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/FillMaskConfigUpdateTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.AbstractBWCSerializationTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/IndexLocationTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/IndexLocationTests.java index 9e070279494e0..52668fc145bb8 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/IndexLocationTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/IndexLocationTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.core.ml.inference.trainedmodel; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/InferenceStatsTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/InferenceStatsTests.java index 4658357b501a2..92d54765e8247 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/InferenceStatsTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/InferenceStatsTests.java @@ -8,8 +8,8 @@ import org.elasticsearch.core.Nullable; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NerConfigTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NerConfigTests.java index 292b2fd1b8fc7..4b1af9313e8fd 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NerConfigTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NerConfigTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.inference.InferenceConfigItemTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NerConfigUpdateTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NerConfigUpdateTests.java index 3ae354b5de464..42b35842c11d8 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NerConfigUpdateTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/NerConfigUpdateTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.AbstractBWCSerializationTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/PassThroughConfigTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/PassThroughConfigTests.java index 77c81fe3b509f..0412243522329 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/PassThroughConfigTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/PassThroughConfigTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.inference.InferenceConfigItemTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/PassThroughConfigUpdateTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/PassThroughConfigUpdateTests.java index a292e07d29b59..265b2d6ee15fb 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/PassThroughConfigUpdateTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/PassThroughConfigUpdateTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.AbstractBWCSerializationTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/RegressionConfigTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/RegressionConfigTests.java index db75e77e1a890..17a56b97a7533 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/RegressionConfigTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/RegressionConfigTests.java @@ -8,7 +8,7 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.AbstractBWCSerializationTestCase; import org.junit.Before; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/RegressionConfigUpdateTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/RegressionConfigUpdateTests.java index a8c382ef4be3d..b513e0cfc5090 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/RegressionConfigUpdateTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/RegressionConfigUpdateTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.ElasticsearchStatusException; import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.AbstractBWCSerializationTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextClassificationConfigTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextClassificationConfigTests.java index 29e8400bc40af..ec9a8b6102cf5 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextClassificationConfigTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextClassificationConfigTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.ElasticsearchStatusException; import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.inference.InferenceConfigItemTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextClassificationConfigUpdateTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextClassificationConfigUpdateTests.java index 33ed909d9b9e5..f9003e6afd3da 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextClassificationConfigUpdateTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextClassificationConfigUpdateTests.java @@ -11,7 +11,7 @@ import org.elasticsearch.ElasticsearchStatusException; import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.AbstractBWCSerializationTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextEmbeddingConfigTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextEmbeddingConfigTests.java index a16bd03c577f4..d3dbde369a638 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextEmbeddingConfigTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextEmbeddingConfigTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.inference.InferenceConfigItemTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextEmbeddingConfigUpdateTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextEmbeddingConfigUpdateTests.java index 579118ab8702f..1f56f7fc6f9d3 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextEmbeddingConfigUpdateTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextEmbeddingConfigUpdateTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.AbstractBWCSerializationTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/VocabularyConfigTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/VocabularyConfigTests.java index 9d9d5d30294bb..6c0f07e8a0fd0 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/VocabularyConfigTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/VocabularyConfigTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.AbstractBWCSerializationTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ZeroShotClassificationConfigTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ZeroShotClassificationConfigTests.java index cac3e3a18cafc..037ed1c729b29 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ZeroShotClassificationConfigTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ZeroShotClassificationConfigTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.inference.InferenceConfigItemTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ZeroShotClassificationConfigUpdateTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ZeroShotClassificationConfigUpdateTests.java index ca1144de3d3be..93244a5f42cc5 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ZeroShotClassificationConfigUpdateTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ZeroShotClassificationConfigUpdateTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.inference.InferenceConfigItemTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ensemble/EnsembleTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ensemble/EnsembleTests.java index f531df541b6c6..9923daa8d7c31 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ensemble/EnsembleTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ensemble/EnsembleTests.java @@ -9,8 +9,8 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.ml.inference.MlInferenceNamedXContentProvider; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ensemble/ExponentTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ensemble/ExponentTests.java index dacb9d48054a9..1583dbebccbe5 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ensemble/ExponentTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ensemble/ExponentTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.inference.trainedmodel.ensemble; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.TargetType; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ensemble/LogisticRegressionTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ensemble/LogisticRegressionTests.java index 7e819d239a7e3..fe8eb4f9f05f6 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ensemble/LogisticRegressionTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ensemble/LogisticRegressionTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.inference.trainedmodel.ensemble; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.TargetType; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ensemble/WeightedModeTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ensemble/WeightedModeTests.java index 7345c64567a39..109eb4ef4ea4e 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ensemble/WeightedModeTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ensemble/WeightedModeTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.inference.trainedmodel.ensemble; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.TargetType; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ensemble/WeightedSumTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ensemble/WeightedSumTests.java index d294ce31d4c46..b1a7f6a6df0cc 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ensemble/WeightedSumTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ensemble/WeightedSumTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.inference.trainedmodel.ensemble; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.TargetType; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/inference/EnsembleInferenceModelTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/inference/EnsembleInferenceModelTests.java index afede5a5cad2d..d304fcd35e42d 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/inference/EnsembleInferenceModelTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/inference/EnsembleInferenceModelTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.search.SearchModule; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.ml.inference.MlInferenceNamedXContentProvider; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/inference/InferenceDefinitionTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/inference/InferenceDefinitionTests.java index 58cd3eaad2d2b..01f9c7261558f 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/inference/InferenceDefinitionTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/inference/InferenceDefinitionTests.java @@ -10,12 +10,12 @@ import com.unboundid.util.Base64; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.search.SearchModule; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.ml.inference.InferenceToXContentCompressor; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/inference/InferenceModelTestUtils.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/inference/InferenceModelTestUtils.java index c4eaac28bfac6..93c0ac999bb22 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/inference/InferenceModelTestUtils.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/inference/InferenceModelTestUtils.java @@ -9,17 +9,17 @@ import org.elasticsearch.core.CheckedFunction; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.TrainedModel; import java.io.IOException; -import static org.elasticsearch.common.xcontent.ToXContent.EMPTY_PARAMS; +import static org.elasticsearch.xcontent.ToXContent.EMPTY_PARAMS; final class InferenceModelTestUtils { diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/inference/TreeInferenceModelTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/inference/TreeInferenceModelTests.java index c1c4d6bd89d9b..480a938d1264a 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/inference/TreeInferenceModelTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/inference/TreeInferenceModelTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.search.SearchModule; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.ml.inference.MlInferenceNamedXContentProvider; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/langident/LangIdentNeuralNetworkTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/langident/LangIdentNeuralNetworkTests.java index 12d57a4eafef2..7525132c066bf 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/langident/LangIdentNeuralNetworkTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/langident/LangIdentNeuralNetworkTests.java @@ -8,8 +8,8 @@ import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.SearchModule; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ml.inference.MlInferenceNamedXContentProvider; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/langident/LangNetLayerTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/langident/LangNetLayerTests.java index 1f5d0105234c9..d21de4858e5f7 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/langident/LangNetLayerTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/langident/LangNetLayerTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.inference.trainedmodel.langident; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.test.ESTestCase; import org.junit.Before; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/langident/LanguageExamples.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/langident/LanguageExamples.java index f08bb577d8859..b332599f27c5c 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/langident/LanguageExamples.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/langident/LanguageExamples.java @@ -9,14 +9,14 @@ package org.elasticsearch.xpack.core.ml.inference.trainedmodel.langident; import org.elasticsearch.ElasticsearchException; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.net.URL; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/metadata/FeatureImportanceBaselineTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/metadata/FeatureImportanceBaselineTests.java index f2956be5a5689..a6c56c5c01ea6 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/metadata/FeatureImportanceBaselineTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/metadata/FeatureImportanceBaselineTests.java @@ -8,7 +8,7 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.ml.AbstractBWCSerializationTestCase; import org.junit.Before; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/metadata/HyperparametersTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/metadata/HyperparametersTests.java index 4e80b578707ee..43edc4442b5e7 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/metadata/HyperparametersTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/metadata/HyperparametersTests.java @@ -8,7 +8,7 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.AbstractBWCSerializationTestCase; import org.junit.Before; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/metadata/TotalFeatureImportanceTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/metadata/TotalFeatureImportanceTests.java index 5e9925891ac82..a5ef7344a43eb 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/metadata/TotalFeatureImportanceTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/metadata/TotalFeatureImportanceTests.java @@ -8,7 +8,7 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.ml.AbstractBWCSerializationTestCase; import org.junit.Before; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/metadata/TrainedModelMetadataTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/metadata/TrainedModelMetadataTests.java index 270f451f2e636..95057d9d12120 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/metadata/TrainedModelMetadataTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/metadata/TrainedModelMetadataTests.java @@ -8,7 +8,7 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.AbstractBWCSerializationTestCase; import org.junit.Before; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/tree/TreeNodeTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/tree/TreeNodeTests.java index b74af08f2fa0a..525c444112264 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/tree/TreeNodeTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/tree/TreeNodeTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.inference.trainedmodel.tree; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ml.job.config.Operator; import org.junit.Before; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/tree/TreeTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/tree/TreeTests.java index bc94693cfbc24..e63cb28b70f2e 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/tree/TreeTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/tree/TreeTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.ElasticsearchStatusException; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.TargetType; import org.junit.Before; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/config/AnalysisConfigTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/config/AnalysisConfigTests.java index 9b21aab073ecb..4211ea7defcdd 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/config/AnalysisConfigTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/config/AnalysisConfigTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.CollectionUtils; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.ml.job.messages.Messages; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/config/AnalysisLimitsTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/config/AnalysisLimitsTests.java index 1da01ba0f47a3..24d182ca8f767 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/config/AnalysisLimitsTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/config/AnalysisLimitsTests.java @@ -9,12 +9,12 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ml.job.messages.Messages; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/config/BlockedTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/config/BlockedTests.java index d1052a64332ae..8248df5c29746 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/config/BlockedTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/config/BlockedTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.core.ml.job.config; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.tasks.TaskId; import org.elasticsearch.test.AbstractSerializingTestCase; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/config/DataDescriptionTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/config/DataDescriptionTests.java index 1ffc394b377aa..5e2067cebba1a 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/config/DataDescriptionTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/config/DataDescriptionTests.java @@ -9,11 +9,11 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ml.job.messages.Messages; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/config/DetectionRuleTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/config/DetectionRuleTests.java index 7a2461d7859ac..8279d408de8b9 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/config/DetectionRuleTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/config/DetectionRuleTests.java @@ -8,7 +8,7 @@ import org.elasticsearch.ElasticsearchStatusException; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import java.util.ArrayList; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/config/DetectorTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/config/DetectorTests.java index 4dd434feb1ae4..4345ffd4e15eb 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/config/DetectorTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/config/DetectorTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.ElasticsearchStatusException; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.ml.job.messages.Messages; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/config/FilterRefTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/config/FilterRefTests.java index 7cfa2b748c54a..acb403a4c2126 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/config/FilterRefTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/config/FilterRefTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.job.config; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/config/JobTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/config/JobTests.java index de0ed46144724..809978fe7a7a9 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/config/JobTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/config/JobTests.java @@ -17,16 +17,16 @@ import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContent; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.search.SearchModule; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.test.ESTestCase; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/config/JobUpdateTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/config/JobUpdateTests.java index d5986858e2532..a08253377d7e6 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/config/JobUpdateTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/config/JobUpdateTests.java @@ -13,7 +13,7 @@ import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.test.VersionUtils; import org.elasticsearch.xpack.core.ml.job.process.autodetect.state.ModelSnapshot; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/config/MlFilterTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/config/MlFilterTests.java index 1f6de06988602..0f6b20d863b78 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/config/MlFilterTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/config/MlFilterTests.java @@ -9,8 +9,8 @@ import com.carrotsearch.randomizedtesting.generators.CodepointSetGenerator; import org.elasticsearch.ElasticsearchStatusException; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/config/ModelPlotConfigTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/config/ModelPlotConfigTests.java index 5596559cdf60c..04c18eef9efd1 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/config/ModelPlotConfigTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/config/ModelPlotConfigTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.job.config; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import static org.hamcrest.Matchers.is; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/config/PerPartitionCategorizationConfigTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/config/PerPartitionCategorizationConfigTests.java index eacdad13801b4..c50f9c2b67b16 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/config/PerPartitionCategorizationConfigTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/config/PerPartitionCategorizationConfigTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.ElasticsearchStatusException; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import static org.hamcrest.Matchers.is; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/config/RuleConditionTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/config/RuleConditionTests.java index dab12bce9d7c5..9a498e2821c5c 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/config/RuleConditionTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/config/RuleConditionTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.job.config; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; public class RuleConditionTests extends AbstractSerializingTestCase { diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/CategorizerStatsTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/CategorizerStatsTests.java index 63da444974a4e..4e8db35ca15af 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/CategorizerStatsTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/CategorizerStatsTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.core.ml.job.process.autodetect.state; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; public class CategorizerStatsTests extends AbstractSerializingTestCase { diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/DataCountsTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/DataCountsTests.java index f1c28d0bcc81f..ec717388d2e1c 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/DataCountsTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/DataCountsTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.job.process.autodetect.state; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import java.time.Instant; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/ModelSizeStatsTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/ModelSizeStatsTests.java index 383fff173edd2..1ddf260952ed3 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/ModelSizeStatsTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/ModelSizeStatsTests.java @@ -8,8 +8,8 @@ import org.elasticsearch.common.io.stream.Writeable.Reader; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ml.job.process.autodetect.state.ModelSizeStats.MemoryStatus; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/ModelSnapshotTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/ModelSnapshotTests.java index d3ae55d9f15dc..f692b73950d5e 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/ModelSnapshotTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/ModelSnapshotTests.java @@ -9,8 +9,8 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.Writeable.Reader; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/QuantilesTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/QuantilesTests.java index ed858fa200d46..027b80a107a89 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/QuantilesTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/QuantilesTests.java @@ -8,8 +8,8 @@ import org.elasticsearch.common.io.stream.Writeable.Reader; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/TimingStatsTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/TimingStatsTests.java index eb7865c87cfd5..bf65556a7ee91 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/TimingStatsTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/TimingStatsTests.java @@ -7,8 +7,8 @@ package org.elasticsearch.xpack.core.ml.job.process.autodetect.state; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ml.utils.ExponentialAverageCalculationContext; import org.elasticsearch.xpack.core.ml.utils.ExponentialAverageCalculationContextTests; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/results/AnomalyCauseTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/results/AnomalyCauseTests.java index 34bf0c655363f..f12a7e9c5d28a 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/results/AnomalyCauseTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/results/AnomalyCauseTests.java @@ -8,8 +8,8 @@ import org.elasticsearch.client.ml.job.config.DetectorFunction; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/results/AnomalyRecordTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/results/AnomalyRecordTests.java index 00f64af0542d5..c4477b21bf032 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/results/AnomalyRecordTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/results/AnomalyRecordTests.java @@ -10,10 +10,10 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ml.MachineLearningField; import org.elasticsearch.xpack.core.ml.utils.MlStrings; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/results/BucketInfluencerTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/results/BucketInfluencerTests.java index 5b08c1de5e319..600753675807c 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/results/BucketInfluencerTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/results/BucketInfluencerTests.java @@ -7,8 +7,8 @@ package org.elasticsearch.xpack.core.ml.job.results; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/results/GeoResultsTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/results/GeoResultsTests.java index 722131a883919..4f26a36a71dec 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/results/GeoResultsTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/results/GeoResultsTests.java @@ -7,8 +7,8 @@ package org.elasticsearch.xpack.core.ml.job.results; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.AbstractSerializingTestCase; import org.junit.Before; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/results/InfluencerTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/results/InfluencerTests.java index 1e66b84a68a95..2501169c348f6 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/results/InfluencerTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/results/InfluencerTests.java @@ -9,9 +9,9 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.Writeable.Reader; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ml.MachineLearningField; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/notifications/AnomalyDetectionAuditMessageTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/notifications/AnomalyDetectionAuditMessageTests.java index e769a128e5219..d90ea56f8eb54 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/notifications/AnomalyDetectionAuditMessageTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/notifications/AnomalyDetectionAuditMessageTests.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.core.ml.notifications; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.common.notifications.Level; import org.elasticsearch.xpack.core.ml.job.config.Job; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/notifications/DataFrameAnalyticsAuditMessageTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/notifications/DataFrameAnalyticsAuditMessageTests.java index aab4525c851b2..85fb28904695c 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/notifications/DataFrameAnalyticsAuditMessageTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/notifications/DataFrameAnalyticsAuditMessageTests.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.core.ml.notifications; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.common.notifications.Level; import java.util.Date; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/notifications/InferenceAuditMessageTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/notifications/InferenceAuditMessageTests.java index 5024dc0788679..91c5f2e59b217 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/notifications/InferenceAuditMessageTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/notifications/InferenceAuditMessageTests.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.core.ml.notifications; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.common.notifications.Level; import java.util.Date; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/stats/ForecastStatsTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/stats/ForecastStatsTests.java index 53f6110f8db8d..ceedd0c756022 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/stats/ForecastStatsTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/stats/ForecastStatsTests.java @@ -8,12 +8,11 @@ package org.elasticsearch.xpack.core.ml.stats; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.AbstractWireSerializingTestCase; -import org.elasticsearch.xpack.core.ml.stats.ForecastStats; import org.elasticsearch.xpack.core.ml.stats.ForecastStats.Fields; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/utils/ExponentialAverageCalculationContextTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/utils/ExponentialAverageCalculationContextTests.java index 4d59ec526a4de..1c156ae8a0886 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/utils/ExponentialAverageCalculationContextTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/utils/ExponentialAverageCalculationContextTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.utils; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import java.time.Instant; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/utils/NamedXContentObjectHelperTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/utils/NamedXContentObjectHelperTests.java index 6f817829fe051..fcb566913a1f7 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/utils/NamedXContentObjectHelperTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/utils/NamedXContentObjectHelperTests.java @@ -8,14 +8,14 @@ import org.elasticsearch.client.ml.inference.NamedXContentObject; import org.elasticsearch.client.ml.inference.NamedXContentObjectHelper; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.search.SearchModule; import org.elasticsearch.test.ESTestCase; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/utils/PhaseProgressTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/utils/PhaseProgressTests.java index e1bf356faac01..ed7db06095edf 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/utils/PhaseProgressTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/utils/PhaseProgressTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ml.utils; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/utils/QueryProviderTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/utils/QueryProviderTests.java index 8e89646bfa113..413180b29d121 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/utils/QueryProviderTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/utils/QueryProviderTests.java @@ -10,11 +10,11 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.query.BoolQueryBuilder; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilders; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/utils/XContentObjectTransformerTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/utils/XContentObjectTransformerTests.java index c64906b0f663e..1298285b49f80 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/utils/XContentObjectTransformerTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/utils/XContentObjectTransformerTests.java @@ -9,12 +9,12 @@ import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.query.BoolQueryBuilder; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilders; @@ -32,7 +32,7 @@ import java.util.List; import java.util.Map; -import static org.elasticsearch.common.xcontent.ToXContent.EMPTY_PARAMS; +import static org.elasticsearch.xcontent.ToXContent.EMPTY_PARAMS; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertToXContentEquivalent; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/rollup/RollupActionConfigTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/rollup/RollupActionConfigTests.java index 10f7578b2d626..f64b99f38864a 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/rollup/RollupActionConfigTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/rollup/RollupActionConfigTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.fieldcaps.FieldCapabilities; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramInterval; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.rollup.job.MetricConfig; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/rollup/RollupActionDateHistogramGroupConfigSerializingTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/rollup/RollupActionDateHistogramGroupConfigSerializingTests.java index b310a6de44ba1..937cc916a532d 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/rollup/RollupActionDateHistogramGroupConfigSerializingTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/rollup/RollupActionDateHistogramGroupConfigSerializingTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.fieldcaps.FieldCapabilities; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramInterval; import org.elasticsearch.test.AbstractSerializingTestCase; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/rollup/RollupActionGroupConfigSerializingTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/rollup/RollupActionGroupConfigSerializingTests.java index e69d064b75488..86e985adbce92 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/rollup/RollupActionGroupConfigSerializingTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/rollup/RollupActionGroupConfigSerializingTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.fieldcaps.FieldCapabilities; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramInterval; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.rollup.job.HistogramGroupConfig; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/rollup/job/DateHistogramGroupConfigSerializingTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/rollup/job/DateHistogramGroupConfigSerializingTests.java index d8206d1ebf30b..330cea0460f71 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/rollup/job/DateHistogramGroupConfigSerializingTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/rollup/job/DateHistogramGroupConfigSerializingTests.java @@ -11,7 +11,7 @@ import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramInterval; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.rollup.ConfigTestHelpers; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/rollup/job/GroupConfigSerializingTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/rollup/job/GroupConfigSerializingTests.java index 29c802565937c..888bf857005b5 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/rollup/job/GroupConfigSerializingTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/rollup/job/GroupConfigSerializingTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.rollup.job; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/rollup/job/HistogramGroupConfigSerializingTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/rollup/job/HistogramGroupConfigSerializingTests.java index 0f7481f3cafa4..5387d656fd6c2 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/rollup/job/HistogramGroupConfigSerializingTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/rollup/job/HistogramGroupConfigSerializingTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.fieldcaps.FieldCapabilities; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.rollup.RollupField; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/rollup/job/JobWrapperSerializingTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/rollup/job/JobWrapperSerializingTests.java index c1c2355b944c1..91c835133f38a 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/rollup/job/JobWrapperSerializingTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/rollup/job/JobWrapperSerializingTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.rollup.job; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.indexing.IndexerState; import org.elasticsearch.xpack.core.rollup.ConfigTestHelpers; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/rollup/job/MetricConfigSerializingTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/rollup/job/MetricConfigSerializingTests.java index e50f323c8c917..735b5ee2c32f7 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/rollup/job/MetricConfigSerializingTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/rollup/job/MetricConfigSerializingTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.fieldcaps.FieldCapabilities; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.rollup.ConfigTestHelpers; import org.elasticsearch.xpack.core.rollup.RollupField; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/rollup/job/RollupIndexerJobStatsTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/rollup/job/RollupIndexerJobStatsTests.java index 5297236e67ae2..b74970ae0c520 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/rollup/job/RollupIndexerJobStatsTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/rollup/job/RollupIndexerJobStatsTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.rollup.job; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; public class RollupIndexerJobStatsTests extends AbstractSerializingTestCase { diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/rollup/job/RollupJobConfigTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/rollup/job/RollupJobConfigTests.java index d3b03368a25f6..daf938eb47ed7 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/rollup/job/RollupJobConfigTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/rollup/job/RollupJobConfigTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.rollup.job; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.junit.Before; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/rollup/job/RollupJobStatusTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/rollup/job/RollupJobStatusTests.java index 8fcf107c73f2f..1d250eab87cf1 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/rollup/job/RollupJobStatusTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/rollup/job/RollupJobStatusTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.rollup.job; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.indexing.IndexerState; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/rollup/job/RollupJobTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/rollup/job/RollupJobTests.java index 2c9aa49c323e5..0e8df2338bbff 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/rollup/job/RollupJobTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/rollup/job/RollupJobTests.java @@ -8,7 +8,7 @@ import org.elasticsearch.cluster.Diff; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractDiffableSerializationTestCase; import org.elasticsearch.xpack.core.rollup.ConfigTestHelpers; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/rollup/job/TermsGroupConfigSerializingTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/rollup/job/TermsGroupConfigSerializingTests.java index 0bd77557446e0..cbb3b8dde5ebd 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/rollup/job/TermsGroupConfigSerializingTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/rollup/job/TermsGroupConfigSerializingTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.fieldcaps.FieldCapabilities; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/EnrollmentTokenTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/EnrollmentTokenTests.java index 43d13ce55f300..c5df55977fba3 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/EnrollmentTokenTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/EnrollmentTokenTests.java @@ -7,10 +7,9 @@ package org.elasticsearch.xpack.core.security; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.xpack.core.security.EnrollmentToken; import java.nio.charset.StandardCharsets; import java.util.Arrays; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/ApiKeyTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/ApiKeyTests.java index e83a5bd83336e..673b98d3fb23e 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/ApiKeyTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/ApiKeyTests.java @@ -8,9 +8,9 @@ package org.elasticsearch.xpack.core.security.action; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; import org.elasticsearch.test.ESTestCase; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/CreateApiKeyRequestBuilderTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/CreateApiKeyRequestBuilderTests.java index 97039475fe9ad..fd25bfd34457a 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/CreateApiKeyRequestBuilderTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/CreateApiKeyRequestBuilderTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.security.authz.RoleDescriptor; import org.elasticsearch.xpack.core.security.authz.RoleDescriptor.IndicesPrivileges; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/CreateApiKeyResponseTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/CreateApiKeyResponseTests.java index 60e4769d5cda3..b5b7a613f4a54 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/CreateApiKeyResponseTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/CreateApiKeyResponseTests.java @@ -11,7 +11,7 @@ import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.settings.SecureString; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import org.elasticsearch.test.EqualsHashCodeTestUtils; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/GetApiKeyResponseTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/GetApiKeyResponseTests.java index be41ad28cf183..5434c7c7eaac2 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/GetApiKeyResponseTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/GetApiKeyResponseTests.java @@ -10,9 +10,9 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/InvalidateApiKeyResponseTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/InvalidateApiKeyResponseTests.java index d662242aa4675..db544fc40743a 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/InvalidateApiKeyResponseTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/InvalidateApiKeyResponseTests.java @@ -11,9 +11,9 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/enrollment/KibanaEnrollmentResponseTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/enrollment/KibanaEnrollmentResponseTests.java index ac56dd0c87009..969502510c1ef 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/enrollment/KibanaEnrollmentResponseTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/enrollment/KibanaEnrollmentResponseTests.java @@ -10,9 +10,9 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.SecureString; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; import org.elasticsearch.test.AbstractWireSerializingTestCase; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/enrollment/NodeEnrollementResponseTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/enrollment/NodeEnrollementResponseTests.java index d13f21204379d..4815a78c90eb1 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/enrollment/NodeEnrollementResponseTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/enrollment/NodeEnrollementResponseTests.java @@ -7,11 +7,11 @@ package org.elasticsearch.xpack.core.security.action.enrollment; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/service/CreateServiceAccountTokenResponseTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/service/CreateServiceAccountTokenResponseTests.java index a7e2f47169296..3b5554c5460b9 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/service/CreateServiceAccountTokenResponseTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/service/CreateServiceAccountTokenResponseTests.java @@ -10,9 +10,9 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.SecureString; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; import org.elasticsearch.test.AbstractWireSerializingTestCase; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/service/DeleteServiceAccountTokenResponseTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/service/DeleteServiceAccountTokenResponseTests.java index ebd0eddaa3148..aa3123eb620f6 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/service/DeleteServiceAccountTokenResponseTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/service/DeleteServiceAccountTokenResponseTests.java @@ -9,9 +9,9 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; import org.elasticsearch.test.AbstractWireSerializingTestCase; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/service/GetServiceAccountCredentialsResponseTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/service/GetServiceAccountCredentialsResponseTests.java index da0a5f3ddc009..747b7d73df29e 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/service/GetServiceAccountCredentialsResponseTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/service/GetServiceAccountCredentialsResponseTests.java @@ -14,9 +14,9 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.transport.TransportAddress; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; import org.elasticsearch.test.ESTestCase; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/service/GetServiceAccountResponseTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/service/GetServiceAccountResponseTests.java index 680606218821f..7520631a6ef67 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/service/GetServiceAccountResponseTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/service/GetServiceAccountResponseTests.java @@ -9,11 +9,11 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.AbstractWireSerializingTestCase; import org.elasticsearch.test.XContentTestUtils; import org.elasticsearch.xpack.core.security.authz.RoleDescriptor; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/token/InvalidateTokenResponseTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/token/InvalidateTokenResponseTests.java index 04221e6ab97e3..66800b531aa76 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/token/InvalidateTokenResponseTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/action/token/InvalidateTokenResponseTests.java @@ -10,9 +10,9 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.security.authc.support.TokensInvalidationResult; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authc/support/mapper/TemplateRoleNameTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authc/support/mapper/TemplateRoleNameTests.java index 9153405402a34..df934673b3d40 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authc/support/mapper/TemplateRoleNameTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authc/support/mapper/TemplateRoleNameTests.java @@ -17,10 +17,10 @@ import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.script.ScriptEngine; import org.elasticsearch.script.ScriptException; import org.elasticsearch.script.ScriptMetadata; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authc/support/mapper/expressiondsl/ExpressionParserTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authc/support/mapper/expressiondsl/ExpressionParserTests.java index 1d7b7f3cd91f4..83df8c7656da2 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authc/support/mapper/expressiondsl/ExpressionParserTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authc/support/mapper/expressiondsl/ExpressionParserTests.java @@ -12,10 +12,10 @@ import org.elasticsearch.common.io.stream.NamedWriteableAwareStreamInput; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.XPackClientPlugin; import org.elasticsearch.xpack.core.security.authc.support.mapper.expressiondsl.FieldExpression.FieldValue; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/accesscontrol/FieldSubsetReaderTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/accesscontrol/FieldSubsetReaderTests.java index 0ac4a98542539..66a7daea9a600 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/accesscontrol/FieldSubsetReaderTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/accesscontrol/FieldSubsetReaderTests.java @@ -58,7 +58,7 @@ import org.elasticsearch.common.lucene.index.SequentialStoredFieldsLeafReader; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.internal.io.IOUtils; import org.elasticsearch.index.mapper.FieldNamesFieldMapper; import org.elasticsearch.index.mapper.SourceFieldMapper; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/permission/ClusterPermissionTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/permission/ClusterPermissionTests.java index 7e1a82593a327..a6eea750958cf 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/permission/ClusterPermissionTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/permission/ClusterPermissionTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.core.security.authz.permission; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.transport.TransportRequest; import org.elasticsearch.xpack.core.security.authc.Authentication; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/privilege/ApplicationPrivilegeDescriptorTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/privilege/ApplicationPrivilegeDescriptorTests.java index 6b420aa2397ef..2dd752ead277c 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/privilege/ApplicationPrivilegeDescriptorTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/privilege/ApplicationPrivilegeDescriptorTests.java @@ -8,12 +8,12 @@ import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.EqualsHashCodeTestUtils; import org.hamcrest.Matchers; @@ -25,7 +25,7 @@ import java.util.Locale; import java.util.Map; -import static org.elasticsearch.common.xcontent.DeprecationHandler.THROW_UNSUPPORTED_OPERATION; +import static org.elasticsearch.xcontent.DeprecationHandler.THROW_UNSUPPORTED_OPERATION; import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.iterableWithSize; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/privilege/ConfigurableClusterPrivilegesTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/privilege/ConfigurableClusterPrivilegesTests.java index f214359b2b311..0c69796013642 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/privilege/ConfigurableClusterPrivilegesTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/privilege/ConfigurableClusterPrivilegesTests.java @@ -12,12 +12,12 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.XPackClientPlugin; @@ -25,7 +25,7 @@ import java.util.Arrays; import java.util.List; -import static org.elasticsearch.common.xcontent.DeprecationHandler.THROW_UNSUPPORTED_OPERATION; +import static org.elasticsearch.xcontent.DeprecationHandler.THROW_UNSUPPORTED_OPERATION; import static org.hamcrest.Matchers.equalTo; public class ConfigurableClusterPrivilegesTests extends ESTestCase { diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/privilege/ManageApplicationPrivilegesTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/privilege/ManageApplicationPrivilegesTests.java index 809402a57192d..b6ce496b14c80 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/privilege/ManageApplicationPrivilegesTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/privilege/ManageApplicationPrivilegesTests.java @@ -13,12 +13,12 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.EqualsHashCodeTestUtils; import org.elasticsearch.xpack.core.XPackClientPlugin; @@ -38,7 +38,7 @@ import java.util.Locale; import java.util.Set; -import static org.elasticsearch.common.xcontent.DeprecationHandler.THROW_UNSUPPORTED_OPERATION; +import static org.elasticsearch.xcontent.DeprecationHandler.THROW_UNSUPPORTED_OPERATION; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.Matchers.nullValue; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/support/DLSRoleQueryValidatorTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/support/DLSRoleQueryValidatorTests.java index c5ad6927304fb..4a9f74d92235b 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/support/DLSRoleQueryValidatorTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/support/DLSRoleQueryValidatorTests.java @@ -8,7 +8,7 @@ import org.apache.lucene.search.join.ScoreMode; import org.elasticsearch.common.bytes.BytesArray; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.index.query.BoolQueryBuilder; import org.elasticsearch.index.query.BoostingQueryBuilder; import org.elasticsearch.index.query.ConstantScoreQueryBuilder; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/support/SecurityQueryTemplateEvaluatorTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/support/SecurityQueryTemplateEvaluatorTests.java index 9b83fbe3f741a..44397d4c6151b 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/support/SecurityQueryTemplateEvaluatorTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/support/SecurityQueryTemplateEvaluatorTests.java @@ -8,8 +8,8 @@ package org.elasticsearch.xpack.core.security.authz.support; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.query.TermQueryBuilder; import org.elasticsearch.script.Script; import org.elasticsearch.script.ScriptService; @@ -26,7 +26,7 @@ import java.util.HashMap; import java.util.Map; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.arrayWithSize; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.sameInstance; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/test/TestRestrictedIndices.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/test/TestRestrictedIndices.java index ad85f7a9857f4..cbc76a25c7b12 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/test/TestRestrictedIndices.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/test/TestRestrictedIndices.java @@ -12,7 +12,7 @@ import org.elasticsearch.Version; import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.indices.ExecutorNames; import org.elasticsearch.indices.SystemIndexDescriptor; import org.elasticsearch.indices.SystemIndices; @@ -27,7 +27,7 @@ import java.util.List; import java.util.Map; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.mapper.MapperService.SINGLE_MAPPING_NAME; import static org.elasticsearch.xpack.core.ClientHelper.ASYNC_SEARCH_ORIGIN; import static org.elasticsearch.xpack.core.ClientHelper.SECURITY_ORIGIN; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/slm/SnapshotInvocationRecordTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/slm/SnapshotInvocationRecordTests.java index d8a8c4bc23498..40c51ab0ed909 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/slm/SnapshotInvocationRecordTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/slm/SnapshotInvocationRecordTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.core.slm; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.test.ESTestCase; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/slm/SnapshotLifecycleMetadataTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/slm/SnapshotLifecycleMetadataTests.java index 11ed5c6d8a67f..395a27922cf72 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/slm/SnapshotLifecycleMetadataTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/slm/SnapshotLifecycleMetadataTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.core.slm; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ilm.OperationMode; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/slm/SnapshotLifecyclePolicyMetadataTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/slm/SnapshotLifecyclePolicyMetadataTests.java index 824245deb85d5..bbdf63227f59b 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/slm/SnapshotLifecyclePolicyMetadataTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/slm/SnapshotLifecyclePolicyMetadataTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.test.ESTestCase; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/slm/SnapshotLifecycleStatsTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/slm/SnapshotLifecycleStatsTests.java index d77ebf606ad2e..72104731077c4 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/slm/SnapshotLifecycleStatsTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/slm/SnapshotLifecycleStatsTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.core.slm; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/slm/history/SnapshotHistoryItemTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/slm/history/SnapshotHistoryItemTests.java index b7cbd1bc9157c..49973d16ddec4 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/slm/history/SnapshotHistoryItemTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/slm/history/SnapshotHistoryItemTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.core.slm.history; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.test.ESTestCase; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/slm/history/SnapshotHistoryStoreTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/slm/history/SnapshotHistoryStoreTests.java index 9fc1b4ab9b405..58aa4efd169a4 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/slm/history/SnapshotHistoryStoreTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/slm/history/SnapshotHistoryStoreTests.java @@ -18,9 +18,9 @@ import org.elasticsearch.cluster.metadata.Metadata; import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.test.ClusterServiceUtils; import org.elasticsearch.test.ESTestCase; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/slm/history/SnapshotLifecycleTemplateRegistryTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/slm/history/SnapshotLifecycleTemplateRegistryTests.java index a84a1dc1db280..61d8d6da01ab2 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/slm/history/SnapshotLifecycleTemplateRegistryTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/slm/history/SnapshotLifecycleTemplateRegistryTests.java @@ -24,13 +24,13 @@ import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.node.DiscoveryNodes; import org.elasticsearch.cluster.service.ClusterService; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.TriFunction; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ClusterServiceUtils; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.client.NoOpClient; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/termsenum/TermCountTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/termsenum/TermCountTests.java index c6368db221e29..964fd7fc32b16 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/termsenum/TermCountTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/termsenum/TermCountTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.termsenum; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.termsenum.action.TermCount; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/termsenum/TermsEnumRequestTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/termsenum/TermsEnumRequestTests.java index 6683ce0eee696..8b46be3f6cb6b 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/termsenum/TermsEnumRequestTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/termsenum/TermsEnumRequestTests.java @@ -12,9 +12,9 @@ import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.ArrayUtils; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.indices.IndicesModule; import org.elasticsearch.search.SearchModule; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/termsenum/TermsEnumResponseTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/termsenum/TermsEnumResponseTests.java index e166599f591c0..14714c1fefacd 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/termsenum/TermsEnumResponseTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/termsenum/TermsEnumResponseTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.action.support.DefaultShardOperationFailedException; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractBroadcastResponseTestCase; import org.elasticsearch.xpack.core.termsenum.action.TermsEnumResponse; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/termsenum/action/RestTermsEnumActionTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/termsenum/action/RestTermsEnumActionTests.java index 8c30298247e15..086db3a99a3ee 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/termsenum/action/RestTermsEnumActionTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/termsenum/action/RestTermsEnumActionTests.java @@ -16,8 +16,8 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.indices.breaker.NoneCircuitBreakerService; import org.elasticsearch.rest.RestController; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/textstructure/structurefinder/FieldStatsTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/textstructure/structurefinder/FieldStatsTests.java index 1d73bad8b40ca..a6936bd5faafa 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/textstructure/structurefinder/FieldStatsTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/textstructure/structurefinder/FieldStatsTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.textstructure.structurefinder; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import java.util.ArrayList; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/textstructure/structurefinder/TextStructureTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/textstructure/structurefinder/TextStructureTests.java index bb1ea7a84533c..f4fa81816a187 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/textstructure/structurefinder/TextStructureTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/textstructure/structurefinder/TextStructureTests.java @@ -7,8 +7,8 @@ package org.elasticsearch.xpack.core.textstructure.structurefinder; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import java.nio.charset.Charset; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/AbstractSerializingTransformTestCase.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/AbstractSerializingTransformTestCase.java index 57b9843479aa1..1b2b10e3961f6 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/AbstractSerializingTransformTestCase.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/AbstractSerializingTransformTestCase.java @@ -8,16 +8,16 @@ package org.elasticsearch.xpack.core.transform; import org.elasticsearch.Version; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.NamedWriteableAwareStreamInput; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContent.Params; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContent.Params; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.search.SearchModule; import org.elasticsearch.search.aggregations.AggregationBuilder; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/MockDeprecatedAggregationBuilder.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/MockDeprecatedAggregationBuilder.java index ccf11eb1167da..8e8bfd639df14 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/MockDeprecatedAggregationBuilder.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/MockDeprecatedAggregationBuilder.java @@ -11,8 +11,8 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.logging.DeprecationCategory; import org.elasticsearch.common.logging.DeprecationLogger; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.AggregatorFactories.Builder; import org.elasticsearch.search.aggregations.AggregatorFactory; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/MockDeprecatedQueryBuilder.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/MockDeprecatedQueryBuilder.java index acbc8f6550928..09e610f7cae00 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/MockDeprecatedQueryBuilder.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/MockDeprecatedQueryBuilder.java @@ -14,9 +14,9 @@ import org.elasticsearch.common.logging.DeprecationCategory; import org.elasticsearch.common.logging.DeprecationLogger; import org.elasticsearch.common.lucene.search.Queries; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.query.AbstractQueryBuilder; import org.elasticsearch.index.query.SearchExecutionContext; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/action/AbstractWireSerializingTransformTestCase.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/action/AbstractWireSerializingTransformTestCase.java index 4ba7ed80a8f88..68cdaa87a8a6a 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/action/AbstractWireSerializingTransformTestCase.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/action/AbstractWireSerializingTransformTestCase.java @@ -14,7 +14,7 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.search.SearchModule; import org.elasticsearch.test.AbstractWireSerializingTestCase; import org.elasticsearch.xpack.core.transform.TransformField; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/action/GetTransformActionResponseTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/action/GetTransformActionResponseTests.java index 79c2d79351930..00989174c7985 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/action/GetTransformActionResponseTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/action/GetTransformActionResponseTests.java @@ -9,9 +9,9 @@ import org.elasticsearch.common.io.stream.Writeable.Reader; import org.elasticsearch.common.logging.LoggerMessageFormat; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.xpack.core.transform.action.GetTransformAction.Response; import org.elasticsearch.xpack.core.transform.transforms.TransformConfig; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/action/PreviewTransformActionRequestTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/action/PreviewTransformActionRequestTests.java index cd95534045601..337721f21a063 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/action/PreviewTransformActionRequestTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/action/PreviewTransformActionRequestTests.java @@ -9,9 +9,9 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.xpack.core.transform.AbstractSerializingTransformTestCase; import org.elasticsearch.xpack.core.transform.action.PreviewTransformAction.Request; import org.elasticsearch.xpack.core.transform.transforms.DestConfig; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/action/PreviewTransformsActionResponseTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/action/PreviewTransformsActionResponseTests.java index 6a29b22cf5751..c34c693d0c94f 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/action/PreviewTransformsActionResponseTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/action/PreviewTransformsActionResponseTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.core.transform.action; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.transform.action.PreviewTransformAction.Response; import org.elasticsearch.xpack.core.transform.transforms.TransformDestIndexSettingsTests; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/action/UpdateTransformsActionResponseTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/action/UpdateTransformsActionResponseTests.java index fe9240583b5d3..0b3c13c3e2844 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/action/UpdateTransformsActionResponseTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/action/UpdateTransformsActionResponseTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.transform.AbstractSerializingTransformTestCase; import org.elasticsearch.xpack.core.transform.action.UpdateTransformAction.Response; import org.elasticsearch.xpack.core.transform.action.compat.UpdateTransformActionPre78; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/notifications/TransformAuditMessageTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/notifications/TransformAuditMessageTests.java index 6a1b59c2e162c..117924fed8719 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/notifications/TransformAuditMessageTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/notifications/TransformAuditMessageTests.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.core.transform.notifications; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import org.elasticsearch.xpack.core.common.notifications.Level; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/DestConfigTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/DestConfigTests.java index 2fd701e70eb6c..6030ddf7596bc 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/DestConfigTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/DestConfigTests.java @@ -9,8 +9,8 @@ import org.elasticsearch.common.ValidationException; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.xpack.core.transform.AbstractSerializingTransformTestCase; import org.junit.Before; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/NodeAttributeTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/NodeAttributeTests.java index 1a728fce40ba8..fe8a197da81e0 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/NodeAttributeTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/NodeAttributeTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.core.transform.transforms; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/QueryConfigTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/QueryConfigTests.java index d2b047e4f7c9f..33a66397e342f 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/QueryConfigTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/QueryConfigTests.java @@ -11,13 +11,13 @@ import org.elasticsearch.common.ValidationException; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.query.MatchAllQueryBuilder; import org.elasticsearch.index.query.MatchNoneQueryBuilder; import org.elasticsearch.index.query.MatchQueryBuilder; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/SettingsConfigTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/SettingsConfigTests.java index 94db9471dd9d5..aef8eb2351f9b 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/SettingsConfigTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/SettingsConfigTests.java @@ -10,12 +10,12 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.Writeable.Reader; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.xpack.core.transform.AbstractSerializingTransformTestCase; import org.elasticsearch.xpack.core.watcher.watch.Payload.XContent; import org.junit.Before; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/SourceConfigTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/SourceConfigTests.java index 1ee3a90f2cf3f..ebba7b5b65186 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/SourceConfigTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/SourceConfigTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.core.transform.transforms; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.transform.AbstractSerializingTransformTestCase; import org.junit.Before; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TimeRetentionPolicyConfigTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TimeRetentionPolicyConfigTests.java index 774f984e19bf1..88d64464f4d9a 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TimeRetentionPolicyConfigTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TimeRetentionPolicyConfigTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.common.io.stream.Writeable.Reader; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TimeSyncConfigTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TimeSyncConfigTests.java index 573d2b56eeec0..b87a927a244a1 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TimeSyncConfigTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TimeSyncConfigTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.common.io.stream.Writeable.Reader; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformCheckpointStatsTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformCheckpointStatsTests.java index ef1ef1fa8c0e8..81eec3933da49 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformCheckpointStatsTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformCheckpointStatsTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.core.transform.transforms; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.transform.AbstractSerializingTransformTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformCheckpointTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformCheckpointTests.java index 69669ae758a78..fe9383602e5cc 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformCheckpointTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformCheckpointTests.java @@ -9,9 +9,9 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.transform.AbstractSerializingTransformTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformCheckpointingInfoTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformCheckpointingInfoTests.java index bd3e087e161a9..87060901b46eb 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformCheckpointingInfoTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformCheckpointingInfoTests.java @@ -11,7 +11,7 @@ import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.transform.AbstractSerializingTransformTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformConfigTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformConfigTests.java index 20d0c7b6114a5..05c8ca6dd2147 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformConfigTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformConfigTests.java @@ -11,13 +11,13 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.TimeValue; import org.elasticsearch.xpack.core.common.validation.SourceDestValidator.RemoteClusterMinimumVersionValidation; import org.elasticsearch.xpack.core.common.validation.SourceDestValidator.SourceDestValidation; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformConfigUpdateTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformConfigUpdateTests.java index 01edf06271617..568d36c7d9d7e 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformConfigUpdateTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformConfigUpdateTests.java @@ -12,7 +12,7 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable.Reader; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.xpack.core.transform.TransformField; import org.elasticsearch.xpack.core.transform.action.AbstractWireSerializingTransformTestCase; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformDestIndexSettingsTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformDestIndexSettingsTests.java index b5f993350446d..060233cf1d187 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformDestIndexSettingsTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformDestIndexSettingsTests.java @@ -11,7 +11,7 @@ import org.elasticsearch.action.admin.indices.alias.Alias; import org.elasticsearch.common.io.stream.Writeable.Reader; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.transform.AbstractSerializingTransformTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformIndexerPositionTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformIndexerPositionTests.java index 19f9f72acbe51..30f6feeca18cc 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformIndexerPositionTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformIndexerPositionTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.core.transform.transforms; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformIndexerStatsTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformIndexerStatsTests.java index 3b43d95f0ca55..3a74ece4f5d21 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformIndexerStatsTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformIndexerStatsTests.java @@ -8,8 +8,8 @@ package org.elasticsearch.xpack.core.transform.transforms; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformProgressTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformProgressTests.java index 541f1c8fd7639..a0efb3fbbfd58 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformProgressTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformProgressTests.java @@ -11,7 +11,7 @@ import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.transform.AbstractSerializingTransformTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformStateTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformStateTests.java index 0ef1cab0b6a79..5486c0ff2fc3e 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformStateTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformStateTests.java @@ -11,7 +11,7 @@ import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.indexing.IndexerState; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformStatsTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformStatsTests.java index f8cc0669156de..75b80b3840a7f 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformStatsTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformStatsTests.java @@ -11,7 +11,7 @@ import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformStoredDocTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformStoredDocTests.java index 6c9e71e2b7844..83f80c4aa8769 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformStoredDocTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformStoredDocTests.java @@ -8,8 +8,8 @@ package org.elasticsearch.xpack.core.transform.transforms; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.transform.AbstractSerializingTransformTestCase; import org.elasticsearch.xpack.core.transform.TransformField; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformTests.java index b6d384b17a572..c6260111e7acc 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformTests.java @@ -12,7 +12,7 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.Writeable.Reader; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.transform.AbstractSerializingTransformTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/latest/LatestConfigTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/latest/LatestConfigTests.java index ddc688445dfb5..72c4e60d156e9 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/latest/LatestConfigTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/latest/LatestConfigTests.java @@ -8,9 +8,9 @@ package org.elasticsearch.xpack.core.transform.transforms.latest; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.search.sort.SortBuilders; import org.elasticsearch.search.sort.SortOrder; import org.elasticsearch.xpack.core.transform.AbstractSerializingTransformTestCase; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/pivot/AggregationConfigTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/pivot/AggregationConfigTests.java index 42baa7855b03d..25f49dd9e718b 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/pivot/AggregationConfigTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/pivot/AggregationConfigTests.java @@ -11,13 +11,13 @@ import org.elasticsearch.common.ValidationException; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.AggregationBuilders; import org.elasticsearch.search.aggregations.AggregatorFactories; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/pivot/DateHistogramGroupSourceTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/pivot/DateHistogramGroupSourceTests.java index 90e239fa14b96..68803199d5a0b 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/pivot/DateHistogramGroupSourceTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/pivot/DateHistogramGroupSourceTests.java @@ -13,7 +13,7 @@ import org.elasticsearch.common.io.stream.Writeable.Reader; import org.elasticsearch.common.time.DateFormatter; import org.elasticsearch.common.time.DateFormatters; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramInterval; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.test.VersionUtils; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/pivot/GeoTileGroupSourceTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/pivot/GeoTileGroupSourceTests.java index aab8beea9935f..3b0e091651c2d 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/pivot/GeoTileGroupSourceTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/pivot/GeoTileGroupSourceTests.java @@ -11,7 +11,7 @@ import org.elasticsearch.common.geo.GeoBoundingBox; import org.elasticsearch.common.geo.GeoPoint; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.geo.GeometryTestUtils; import org.elasticsearch.geometry.Rectangle; import org.elasticsearch.search.aggregations.bucket.geogrid.GeoTileUtils; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/pivot/GroupConfigTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/pivot/GroupConfigTests.java index 70d8cf840b9ae..c177d3926c240 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/pivot/GroupConfigTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/pivot/GroupConfigTests.java @@ -12,13 +12,13 @@ import org.elasticsearch.common.ValidationException; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.transform.transforms.pivot.SingleGroupSource.Type; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/pivot/HistogramGroupSourceTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/pivot/HistogramGroupSourceTests.java index 849c800b348d0..c409f0f22b159 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/pivot/HistogramGroupSourceTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/pivot/HistogramGroupSourceTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/pivot/PivotConfigTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/pivot/PivotConfigTests.java index cda8532fa3d04..bb82c92726519 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/pivot/PivotConfigTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/pivot/PivotConfigTests.java @@ -11,9 +11,9 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.ValidationException; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.transform.AbstractSerializingTransformTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/pivot/ScriptConfigTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/pivot/ScriptConfigTests.java index e8fb8b8126ed1..228fba539a839 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/pivot/ScriptConfigTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/pivot/ScriptConfigTests.java @@ -10,14 +10,14 @@ import org.elasticsearch.common.ValidationException; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.script.Script; import org.elasticsearch.script.ScriptType; import org.elasticsearch.xpack.core.transform.AbstractSerializingTransformTestCase; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/pivot/TermsGroupSourceTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/pivot/TermsGroupSourceTests.java index 06d6b51ce8580..774181cea4af3 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/pivot/TermsGroupSourceTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/pivot/TermsGroupSourceTests.java @@ -10,8 +10,8 @@ import org.elasticsearch.Version; import org.elasticsearch.common.ValidationException; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/schema/TransformConfigTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/schema/TransformConfigTests.java index a26be0d2843e7..168a93ad67198 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/schema/TransformConfigTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/schema/TransformConfigTests.java @@ -7,8 +7,8 @@ package org.elasticsearch.xpack.core.transform.transforms.schema; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContent.Params; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContent.Params; import org.elasticsearch.test.AbstractSchemaValidationTestCase; import org.elasticsearch.xpack.core.transform.TransformField; import org.elasticsearch.xpack.core.transform.transforms.TransformConfig; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/watcher/support/xcontent/WatcherXContentParserTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/watcher/support/xcontent/WatcherXContentParserTests.java index 389125b0f372a..28424d1df0da8 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/watcher/support/xcontent/WatcherXContentParserTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/watcher/support/xcontent/WatcherXContentParserTests.java @@ -9,17 +9,17 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.watcher.support.xcontent.WatcherXContentParser; import java.time.ZoneOffset; import java.time.ZonedDateTime; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.is; public class WatcherXContentParserTests extends ESTestCase { diff --git a/x-pack/plugin/data-streams/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/datastreams/DataStreamRestIT.java b/x-pack/plugin/data-streams/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/datastreams/DataStreamRestIT.java index 2f8a86239af76..e4de4763c6968 100644 --- a/x-pack/plugin/data-streams/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/datastreams/DataStreamRestIT.java +++ b/x-pack/plugin/data-streams/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/datastreams/DataStreamRestIT.java @@ -10,10 +10,10 @@ import org.apache.http.util.EntityUtils; import org.elasticsearch.client.Request; import org.elasticsearch.client.Response; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.rest.ESRestTestCase; import java.util.Map; diff --git a/x-pack/plugin/data-streams/qa/rest/src/javaRestTest/java/org/elasticsearch/xpack/datastreams/DataStreamUpgradeRestIT.java b/x-pack/plugin/data-streams/qa/rest/src/javaRestTest/java/org/elasticsearch/xpack/datastreams/DataStreamUpgradeRestIT.java index c9a5989ffd268..1f420c9fd034f 100644 --- a/x-pack/plugin/data-streams/qa/rest/src/javaRestTest/java/org/elasticsearch/xpack/datastreams/DataStreamUpgradeRestIT.java +++ b/x-pack/plugin/data-streams/qa/rest/src/javaRestTest/java/org/elasticsearch/xpack/datastreams/DataStreamUpgradeRestIT.java @@ -12,7 +12,7 @@ import org.elasticsearch.client.Response; import org.elasticsearch.client.ResponseException; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.test.rest.ESRestTestCase; diff --git a/x-pack/plugin/data-streams/qa/rest/src/yamlRestTest/java/org/elasticsearch/xpack/datastreams/AutoCreateDataStreamIT.java b/x-pack/plugin/data-streams/qa/rest/src/yamlRestTest/java/org/elasticsearch/xpack/datastreams/AutoCreateDataStreamIT.java index 341a2b48fc0f6..9f6cdbeedc53b 100644 --- a/x-pack/plugin/data-streams/qa/rest/src/yamlRestTest/java/org/elasticsearch/xpack/datastreams/AutoCreateDataStreamIT.java +++ b/x-pack/plugin/data-streams/qa/rest/src/yamlRestTest/java/org/elasticsearch/xpack/datastreams/AutoCreateDataStreamIT.java @@ -14,8 +14,8 @@ import org.elasticsearch.client.ResponseException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.Streams; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.rest.ESRestTestCase; import java.io.IOException; diff --git a/x-pack/plugin/data-streams/src/internalClusterTest/java/org/elasticsearch/datastreams/DataStreamIT.java b/x-pack/plugin/data-streams/src/internalClusterTest/java/org/elasticsearch/datastreams/DataStreamIT.java index 02b134be30d1d..eb1163b36a6e2 100644 --- a/x-pack/plugin/data-streams/src/internalClusterTest/java/org/elasticsearch/datastreams/DataStreamIT.java +++ b/x-pack/plugin/data-streams/src/internalClusterTest/java/org/elasticsearch/datastreams/DataStreamIT.java @@ -52,8 +52,6 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.compress.CompressedXContent; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ObjectPath; -import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.core.Nullable; import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.index.mapper.DateFieldMapper; @@ -66,6 +64,8 @@ import org.elasticsearch.search.builder.SearchSourceBuilder; import org.elasticsearch.search.fetch.subphase.FieldAndFormat; import org.elasticsearch.test.ESIntegTestCase; +import org.elasticsearch.xcontent.ObjectPath; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.action.CreateDataStreamAction; import org.elasticsearch.xpack.core.action.DeleteDataStreamAction; import org.elasticsearch.xpack.core.action.GetDataStreamAction; diff --git a/x-pack/plugin/data-streams/src/internalClusterTest/java/org/elasticsearch/datastreams/DataStreamMigrationIT.java b/x-pack/plugin/data-streams/src/internalClusterTest/java/org/elasticsearch/datastreams/DataStreamMigrationIT.java index f5531490476fa..f821fd1c550eb 100644 --- a/x-pack/plugin/data-streams/src/internalClusterTest/java/org/elasticsearch/datastreams/DataStreamMigrationIT.java +++ b/x-pack/plugin/data-streams/src/internalClusterTest/java/org/elasticsearch/datastreams/DataStreamMigrationIT.java @@ -21,11 +21,11 @@ import org.elasticsearch.action.index.IndexRequest; import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.master.AcknowledgedResponse; -import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.index.mapper.DateFieldMapper; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.test.ESIntegTestCase; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.MigrateToDataStreamAction; import org.elasticsearch.xpack.core.action.DeleteDataStreamAction; import org.elasticsearch.xpack.datastreams.DataStreamsPlugin; diff --git a/x-pack/plugin/data-streams/src/internalClusterTest/java/org/elasticsearch/datastreams/SystemDataStreamIT.java b/x-pack/plugin/data-streams/src/internalClusterTest/java/org/elasticsearch/datastreams/SystemDataStreamIT.java index 56d005a7a491b..0bdd822733329 100644 --- a/x-pack/plugin/data-streams/src/internalClusterTest/java/org/elasticsearch/datastreams/SystemDataStreamIT.java +++ b/x-pack/plugin/data-streams/src/internalClusterTest/java/org/elasticsearch/datastreams/SystemDataStreamIT.java @@ -30,7 +30,6 @@ import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.indices.ExecutorNames; import org.elasticsearch.indices.SystemDataStreamDescriptor; import org.elasticsearch.indices.SystemDataStreamDescriptor.Type; @@ -39,6 +38,7 @@ import org.elasticsearch.test.ESIntegTestCase; import org.elasticsearch.transport.netty4.Netty4Plugin; import org.elasticsearch.transport.nio.NioTransportPlugin; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.action.DeleteDataStreamAction; import org.elasticsearch.xpack.datastreams.DataStreamsPlugin; import org.junit.After; diff --git a/x-pack/plugin/data-streams/src/internalClusterTest/java/org/elasticsearch/datastreams/SystemDataStreamSnapshotIT.java b/x-pack/plugin/data-streams/src/internalClusterTest/java/org/elasticsearch/datastreams/SystemDataStreamSnapshotIT.java index c701ff5e6ed36..e110b70dd2016 100644 --- a/x-pack/plugin/data-streams/src/internalClusterTest/java/org/elasticsearch/datastreams/SystemDataStreamSnapshotIT.java +++ b/x-pack/plugin/data-streams/src/internalClusterTest/java/org/elasticsearch/datastreams/SystemDataStreamSnapshotIT.java @@ -13,7 +13,6 @@ import org.elasticsearch.action.index.IndexResponse; import org.elasticsearch.action.support.master.AcknowledgedResponse; import org.elasticsearch.cluster.metadata.ComposableIndexTemplate; -import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.indices.ExecutorNames; import org.elasticsearch.indices.SystemDataStreamDescriptor; import org.elasticsearch.plugins.Plugin; @@ -22,6 +21,7 @@ import org.elasticsearch.snapshots.SnapshotInfo; import org.elasticsearch.snapshots.mockstore.MockRepository; import org.elasticsearch.threadpool.ThreadPool; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.action.CreateDataStreamAction; import org.elasticsearch.xpack.core.action.DeleteDataStreamAction; import org.elasticsearch.xpack.core.action.GetDataStreamAction; diff --git a/x-pack/plugin/data-streams/src/test/java/org/elasticsearch/xpack/datastreams/DataStreamsStatsTests.java b/x-pack/plugin/data-streams/src/test/java/org/elasticsearch/xpack/datastreams/DataStreamsStatsTests.java index 3a8a8aab26e87..62baf5a941325 100644 --- a/x-pack/plugin/data-streams/src/test/java/org/elasticsearch/xpack/datastreams/DataStreamsStatsTests.java +++ b/x-pack/plugin/data-streams/src/test/java/org/elasticsearch/xpack/datastreams/DataStreamsStatsTests.java @@ -20,9 +20,9 @@ import org.elasticsearch.cluster.metadata.ComposableIndexTemplate; import org.elasticsearch.cluster.metadata.Template; import org.elasticsearch.common.compress.CompressedXContent; -import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.test.ESSingleNodeTestCase; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.xpack.core.action.CreateDataStreamAction; import org.elasticsearch.xpack.core.action.DataStreamsStatsAction; import org.elasticsearch.xpack.core.action.DeleteDataStreamAction; diff --git a/x-pack/plugin/data-streams/src/test/java/org/elasticsearch/xpack/datastreams/mapper/DataStreamTimestampFieldMapperTests.java b/x-pack/plugin/data-streams/src/test/java/org/elasticsearch/xpack/datastreams/mapper/DataStreamTimestampFieldMapperTests.java index 2e8b139bf862c..afc7a328ee4ab 100644 --- a/x-pack/plugin/data-streams/src/test/java/org/elasticsearch/xpack/datastreams/mapper/DataStreamTimestampFieldMapperTests.java +++ b/x-pack/plugin/data-streams/src/test/java/org/elasticsearch/xpack/datastreams/mapper/DataStreamTimestampFieldMapperTests.java @@ -8,7 +8,6 @@ import org.elasticsearch.Version; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.core.CheckedConsumer; import org.elasticsearch.index.mapper.DataStreamTimestampFieldMapper; import org.elasticsearch.index.mapper.DateFieldMapper; @@ -19,6 +18,7 @@ import org.elasticsearch.index.mapper.MetadataMapperTestCase; import org.elasticsearch.index.mapper.ParsedDocument; import org.elasticsearch.plugins.Plugin; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.datastreams.DataStreamsPlugin; import java.io.IOException; diff --git a/x-pack/plugin/deprecation/qa/rest/src/javaRestTest/java/org/elasticsearch/xpack/deprecation/DeprecationHttpIT.java b/x-pack/plugin/deprecation/qa/rest/src/javaRestTest/java/org/elasticsearch/xpack/deprecation/DeprecationHttpIT.java index bd126d0787ee3..17bab498632c4 100644 --- a/x-pack/plugin/deprecation/qa/rest/src/javaRestTest/java/org/elasticsearch/xpack/deprecation/DeprecationHttpIT.java +++ b/x-pack/plugin/deprecation/qa/rest/src/javaRestTest/java/org/elasticsearch/xpack/deprecation/DeprecationHttpIT.java @@ -24,10 +24,10 @@ import org.elasticsearch.common.logging.LoggerMessageFormat; import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.test.rest.ESRestTestCase; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.hamcrest.Matcher; import java.io.IOException; diff --git a/x-pack/plugin/deprecation/qa/rest/src/javaRestTest/java/org/elasticsearch/xpack/deprecation/MlDeprecationIT.java b/x-pack/plugin/deprecation/qa/rest/src/javaRestTest/java/org/elasticsearch/xpack/deprecation/MlDeprecationIT.java index a371528e79b60..4bddf736daee3 100644 --- a/x-pack/plugin/deprecation/qa/rest/src/javaRestTest/java/org/elasticsearch/xpack/deprecation/MlDeprecationIT.java +++ b/x-pack/plugin/deprecation/qa/rest/src/javaRestTest/java/org/elasticsearch/xpack/deprecation/MlDeprecationIT.java @@ -21,10 +21,10 @@ import org.elasticsearch.client.ml.job.config.Detector; import org.elasticsearch.client.ml.job.config.Job; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.search.SearchModule; import org.elasticsearch.test.rest.ESRestTestCase; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentType; import java.util.ArrayList; import java.util.Collections; diff --git a/x-pack/plugin/deprecation/qa/rest/src/main/java/org/elasticsearch/xpack/deprecation/TestDeprecatedQueryBuilder.java b/x-pack/plugin/deprecation/qa/rest/src/main/java/org/elasticsearch/xpack/deprecation/TestDeprecatedQueryBuilder.java index 81cbde5eb6688..b71b537ee5e1d 100644 --- a/x-pack/plugin/deprecation/qa/rest/src/main/java/org/elasticsearch/xpack/deprecation/TestDeprecatedQueryBuilder.java +++ b/x-pack/plugin/deprecation/qa/rest/src/main/java/org/elasticsearch/xpack/deprecation/TestDeprecatedQueryBuilder.java @@ -14,10 +14,10 @@ import org.elasticsearch.common.logging.DeprecationCategory; import org.elasticsearch.common.logging.DeprecationLogger; import org.elasticsearch.common.lucene.search.Queries; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.query.AbstractQueryBuilder; import org.elasticsearch.index.query.SearchExecutionContext; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/x-pack/plugin/deprecation/qa/rest/src/main/java/org/elasticsearch/xpack/deprecation/TestDeprecationHeaderRestAction.java b/x-pack/plugin/deprecation/qa/rest/src/main/java/org/elasticsearch/xpack/deprecation/TestDeprecationHeaderRestAction.java index fda518fea609d..64a1a6fa300df 100644 --- a/x-pack/plugin/deprecation/qa/rest/src/main/java/org/elasticsearch/xpack/deprecation/TestDeprecationHeaderRestAction.java +++ b/x-pack/plugin/deprecation/qa/rest/src/main/java/org/elasticsearch/xpack/deprecation/TestDeprecationHeaderRestAction.java @@ -11,13 +11,13 @@ import org.elasticsearch.common.logging.DeprecationLogger; import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.RestStatus; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.HashMap; diff --git a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/Deprecation.java b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/Deprecation.java index 61ac7808113f6..53ae8eb4b2252 100644 --- a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/Deprecation.java +++ b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/Deprecation.java @@ -19,7 +19,7 @@ import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.SettingsFilter; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.env.Environment; import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.plugins.ActionPlugin; diff --git a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/DeprecationChecker.java b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/DeprecationChecker.java index 7e64ea8c47113..7720bdf17f56f 100644 --- a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/DeprecationChecker.java +++ b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/DeprecationChecker.java @@ -11,7 +11,7 @@ import org.elasticsearch.client.Client; import org.elasticsearch.client.OriginSettingClient; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.xpack.core.deprecation.DeprecationIssue; import java.util.List; diff --git a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/DeprecationInfoAction.java b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/DeprecationInfoAction.java index 9a01b8aa1e954..78590fbbacc0f 100644 --- a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/DeprecationInfoAction.java +++ b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/DeprecationInfoAction.java @@ -21,8 +21,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.xpack.core.deprecation.DeprecationIssue; diff --git a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/MlDeprecationChecker.java b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/MlDeprecationChecker.java index d0c501cb9b0fd..fce11d08bd938 100644 --- a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/MlDeprecationChecker.java +++ b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/MlDeprecationChecker.java @@ -10,7 +10,7 @@ import org.elasticsearch.Version; import org.elasticsearch.action.ActionListener; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.common.xcontent.XContentElasticsearchExtension; import org.elasticsearch.xpack.core.XPackSettings; import org.elasticsearch.xpack.core.action.util.PageParams; diff --git a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/TransportDeprecationInfoAction.java b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/TransportDeprecationInfoAction.java index 47ceb494efbb3..6a8a5dec7e261 100644 --- a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/TransportDeprecationInfoAction.java +++ b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/TransportDeprecationInfoAction.java @@ -22,7 +22,7 @@ import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.tasks.Task; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.TransportService; diff --git a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/logging/DeprecationCacheResetAction.java b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/logging/DeprecationCacheResetAction.java index 1a88b04ac04d4..596a3c77fe9ca 100644 --- a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/logging/DeprecationCacheResetAction.java +++ b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/logging/DeprecationCacheResetAction.java @@ -17,8 +17,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.transport.TransportRequest; import java.io.IOException; diff --git a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/logging/DeprecationIndexingAppender.java b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/logging/DeprecationIndexingAppender.java index fa6fd9aed697d..5e7429efeaec1 100644 --- a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/logging/DeprecationIndexingAppender.java +++ b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/logging/DeprecationIndexingAppender.java @@ -16,7 +16,7 @@ import org.apache.logging.log4j.core.config.plugins.Plugin; import org.elasticsearch.action.DocWriteRequest; import org.elasticsearch.action.index.IndexRequest; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import java.util.Objects; import java.util.function.Consumer; diff --git a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/logging/DeprecationIndexingTemplateRegistry.java b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/logging/DeprecationIndexingTemplateRegistry.java index 904481a2ccd62..9740324da0a79 100644 --- a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/logging/DeprecationIndexingTemplateRegistry.java +++ b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/logging/DeprecationIndexingTemplateRegistry.java @@ -10,7 +10,7 @@ import org.elasticsearch.client.Client; import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.xpack.core.template.IndexTemplateConfig; import org.elasticsearch.xpack.core.template.IndexTemplateRegistry; diff --git a/x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/DeprecationInfoActionResponseTests.java b/x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/DeprecationInfoActionResponseTests.java index dc32491eaf4be..ac1eac2773b5a 100644 --- a/x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/DeprecationInfoActionResponseTests.java +++ b/x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/DeprecationInfoActionResponseTests.java @@ -18,8 +18,8 @@ import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.transport.TransportAddress; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.core.Tuple; import org.elasticsearch.indices.TestIndexNameExpressionResolver; import org.elasticsearch.test.AbstractWireSerializingTestCase; diff --git a/x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/MlDeprecationCheckerTests.java b/x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/MlDeprecationCheckerTests.java index 6c0bd813df550..d4059a5bebd8e 100644 --- a/x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/MlDeprecationCheckerTests.java +++ b/x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/MlDeprecationCheckerTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.deprecation; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.search.SearchModule; import org.elasticsearch.test.ESTestCase; diff --git a/x-pack/plugin/enrich/qa/common/src/main/java/org/elasticsearch/test/enrich/CommonEnrichRestTestCase.java b/x-pack/plugin/enrich/qa/common/src/main/java/org/elasticsearch/test/enrich/CommonEnrichRestTestCase.java index 31ae9477a0e22..d8bf1b8301709 100644 --- a/x-pack/plugin/enrich/qa/common/src/main/java/org/elasticsearch/test/enrich/CommonEnrichRestTestCase.java +++ b/x-pack/plugin/enrich/qa/common/src/main/java/org/elasticsearch/test/enrich/CommonEnrichRestTestCase.java @@ -12,9 +12,9 @@ import org.elasticsearch.client.ResponseException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.test.rest.ESRestTestCase; @@ -25,7 +25,7 @@ import java.util.Map; import java.util.concurrent.TimeUnit; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.greaterThanOrEqualTo; import static org.hamcrest.Matchers.notNullValue; diff --git a/x-pack/plugin/enrich/src/internalClusterTest/java/org/elasticsearch/xpack/enrich/EnrichMultiNodeIT.java b/x-pack/plugin/enrich/src/internalClusterTest/java/org/elasticsearch/xpack/enrich/EnrichMultiNodeIT.java index bd7f0fda9f107..e3722846fec3a 100644 --- a/x-pack/plugin/enrich/src/internalClusterTest/java/org/elasticsearch/xpack/enrich/EnrichMultiNodeIT.java +++ b/x-pack/plugin/enrich/src/internalClusterTest/java/org/elasticsearch/xpack/enrich/EnrichMultiNodeIT.java @@ -25,12 +25,12 @@ import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.ingest.common.IngestCommonPlugin; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.reindex.ReindexPlugin; import org.elasticsearch.tasks.TaskInfo; import org.elasticsearch.test.ESIntegTestCase; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.XPackSettings; import org.elasticsearch.xpack.core.enrich.EnrichPolicy; import org.elasticsearch.xpack.core.enrich.action.DeleteEnrichPolicyAction; diff --git a/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/EnrichMetadata.java b/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/EnrichMetadata.java index dfdd5de8f84e5..83b4aff08879c 100644 --- a/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/EnrichMetadata.java +++ b/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/EnrichMetadata.java @@ -12,10 +12,10 @@ import org.elasticsearch.cluster.metadata.Metadata; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.enrich.EnrichPolicy; import java.io.IOException; diff --git a/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/EnrichPlugin.java b/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/EnrichPlugin.java index 47da07d19d31c..ea0b58a46afc1 100644 --- a/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/EnrichPlugin.java +++ b/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/EnrichPlugin.java @@ -20,8 +20,6 @@ import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.SettingsFilter; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ParseField; import org.elasticsearch.core.TimeValue; import org.elasticsearch.env.Environment; import org.elasticsearch.env.NodeEnvironment; @@ -37,6 +35,8 @@ import org.elasticsearch.script.ScriptService; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.watcher.ResourceWatcherService; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.xpack.core.XPackPlugin; import org.elasticsearch.xpack.core.action.XPackInfoFeatureAction; import org.elasticsearch.xpack.core.action.XPackUsageFeatureAction; diff --git a/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/EnrichPolicyMaintenanceService.java b/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/EnrichPolicyMaintenanceService.java index 7fc63a0132621..5c248db449938 100644 --- a/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/EnrichPolicyMaintenanceService.java +++ b/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/EnrichPolicyMaintenanceService.java @@ -23,10 +23,10 @@ import org.elasticsearch.common.component.LifecycleListener; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.EsRejectedExecutionException; -import org.elasticsearch.common.xcontent.ObjectPath; import org.elasticsearch.core.TimeValue; import org.elasticsearch.threadpool.Scheduler; import org.elasticsearch.threadpool.ThreadPool; +import org.elasticsearch.xcontent.ObjectPath; import org.elasticsearch.xpack.core.enrich.EnrichPolicy; import java.util.Arrays; diff --git a/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/EnrichPolicyReindexPipeline.java b/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/EnrichPolicyReindexPipeline.java index 2d32a80f86cb8..db339590ab9ec 100644 --- a/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/EnrichPolicyReindexPipeline.java +++ b/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/EnrichPolicyReindexPipeline.java @@ -13,10 +13,10 @@ import org.elasticsearch.client.Client; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.ingest.IngestMetadata; import org.elasticsearch.ingest.PipelineConfiguration; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.io.UncheckedIOException; diff --git a/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/EnrichPolicyRunner.java b/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/EnrichPolicyRunner.java index 8846c96057556..799c77c98b504 100644 --- a/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/EnrichPolicyRunner.java +++ b/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/EnrichPolicyRunner.java @@ -41,10 +41,6 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.collect.ImmutableOpenMap; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ObjectPath; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.core.CheckedFunction; import org.elasticsearch.index.mapper.MapperService; import org.elasticsearch.index.query.QueryBuilders; @@ -53,6 +49,10 @@ import org.elasticsearch.index.reindex.ScrollableHitSource; import org.elasticsearch.search.builder.SearchSourceBuilder; import org.elasticsearch.tasks.TaskCancelledException; +import org.elasticsearch.xcontent.ObjectPath; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.xpack.core.enrich.EnrichPolicy; import org.elasticsearch.xpack.core.enrich.action.ExecuteEnrichPolicyStatus; import org.elasticsearch.xpack.enrich.action.EnrichReindexAction; diff --git a/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/action/EnrichShardMultiSearchAction.java b/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/action/EnrichShardMultiSearchAction.java index e23efe0196893..a08d149543178 100644 --- a/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/action/EnrichShardMultiSearchAction.java +++ b/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/action/EnrichShardMultiSearchAction.java @@ -40,13 +40,7 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ParsedMediaType; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.index.IndexService; import org.elasticsearch.index.engine.Engine; import org.elasticsearch.index.fieldvisitor.FieldsVisitor; @@ -63,6 +57,12 @@ import org.elasticsearch.search.internal.InternalSearchResponse; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.TransportService; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ParsedMediaType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.enrich.EnrichPolicy; import java.io.IOException; diff --git a/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/rest/RestPutEnrichPolicyAction.java b/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/rest/RestPutEnrichPolicyAction.java index 1eb2ce7aed45d..1c766c67f6e34 100644 --- a/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/rest/RestPutEnrichPolicyAction.java +++ b/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/rest/RestPutEnrichPolicyAction.java @@ -7,10 +7,10 @@ package org.elasticsearch.xpack.enrich.rest; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestToXContentListener; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.enrich.action.PutEnrichPolicyAction; import java.io.IOException; diff --git a/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/BasicEnrichTests.java b/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/BasicEnrichTests.java index 29f5bab3d2648..3133c2c701ea4 100644 --- a/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/BasicEnrichTests.java +++ b/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/BasicEnrichTests.java @@ -20,13 +20,13 @@ import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.ingest.common.IngestCommonPlugin; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.reindex.ReindexPlugin; import org.elasticsearch.script.mustache.MustachePlugin; import org.elasticsearch.test.ESSingleNodeTestCase; import org.elasticsearch.test.TestGeoShapeFieldMapperPlugin; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.XPackSettings; import org.elasticsearch.xpack.core.enrich.EnrichPolicy; import org.elasticsearch.xpack.core.enrich.action.EnrichStatsAction; diff --git a/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/EnrichMetadataTests.java b/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/EnrichMetadataTests.java index 1a0cbc3f8b041..96f5de17ac5cd 100644 --- a/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/EnrichMetadataTests.java +++ b/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/EnrichMetadataTests.java @@ -7,9 +7,9 @@ package org.elasticsearch.xpack.enrich; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.test.AbstractSerializingTestCase; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.enrich.EnrichPolicy; import java.io.IOException; diff --git a/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/EnrichPolicyMaintenanceServiceTests.java b/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/EnrichPolicyMaintenanceServiceTests.java index a800ec5fc0569..5009d4fbdaa97 100644 --- a/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/EnrichPolicyMaintenanceServiceTests.java +++ b/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/EnrichPolicyMaintenanceServiceTests.java @@ -15,13 +15,13 @@ import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.index.mapper.MapperService; import org.elasticsearch.indices.TestIndexNameExpressionResolver; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.test.ESSingleNodeTestCase; import org.elasticsearch.threadpool.ThreadPool; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.xpack.core.enrich.EnrichPolicy; import java.io.IOException; diff --git a/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/EnrichPolicyRunnerTests.java b/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/EnrichPolicyRunnerTests.java index 6deb40c136012..fcac8e1587674 100644 --- a/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/EnrichPolicyRunnerTests.java +++ b/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/EnrichPolicyRunnerTests.java @@ -38,10 +38,6 @@ import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; -import org.elasticsearch.common.xcontent.smile.SmileXContent; import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.index.engine.Segment; import org.elasticsearch.index.mapper.MapperService; @@ -59,6 +55,10 @@ import org.elasticsearch.test.TestGeoShapeFieldMapperPlugin; import org.elasticsearch.threadpool.TestThreadPool; import org.elasticsearch.threadpool.ThreadPool; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.smile.SmileXContent; import org.elasticsearch.xpack.core.enrich.EnrichPolicy; import org.elasticsearch.xpack.core.enrich.action.ExecuteEnrichPolicyStatus; import org.elasticsearch.xpack.enrich.action.EnrichReindexAction; diff --git a/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/EnrichPolicyTests.java b/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/EnrichPolicyTests.java index 967fb05a1fc94..0559ec08205de 100644 --- a/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/EnrichPolicyTests.java +++ b/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/EnrichPolicyTests.java @@ -8,15 +8,15 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.index.query.MatchAllQueryBuilder; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.TermQueryBuilder; import org.elasticsearch.test.AbstractSerializingTestCase; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.enrich.EnrichPolicy; import java.io.ByteArrayOutputStream; diff --git a/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/EnrichPolicyUpdateTests.java b/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/EnrichPolicyUpdateTests.java index c30e31f3f27ab..9b1081bb15d4b 100644 --- a/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/EnrichPolicyUpdateTests.java +++ b/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/EnrichPolicyUpdateTests.java @@ -10,13 +10,13 @@ import org.elasticsearch.action.ingest.PutPipelineRequest; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.ingest.IngestService; import org.elasticsearch.ingest.Pipeline; import org.elasticsearch.ingest.common.IngestCommonPlugin; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.reindex.ReindexPlugin; import org.elasticsearch.test.ESSingleNodeTestCase; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.XPackSettings; import org.elasticsearch.xpack.core.enrich.EnrichPolicy; import org.elasticsearch.xpack.core.enrich.action.ExecuteEnrichPolicyAction; diff --git a/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/EnrichResiliencyTests.java b/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/EnrichResiliencyTests.java index b13ebf3d3685c..dc664835fdb4c 100644 --- a/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/EnrichResiliencyTests.java +++ b/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/EnrichResiliencyTests.java @@ -17,14 +17,14 @@ import org.elasticsearch.action.search.SearchRequest; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.core.TimeValue; import org.elasticsearch.ingest.common.IngestCommonPlugin; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.reindex.ReindexPlugin; import org.elasticsearch.test.ESSingleNodeTestCase; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.xpack.core.XPackSettings; import org.elasticsearch.xpack.core.enrich.EnrichPolicy; import org.elasticsearch.xpack.core.enrich.action.ExecuteEnrichPolicyAction; diff --git a/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/EnrichStoreCrudTests.java b/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/EnrichStoreCrudTests.java index 3af9f45263d10..e6a3fca6e688b 100644 --- a/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/EnrichStoreCrudTests.java +++ b/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/EnrichStoreCrudTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.ResourceNotFoundException; import org.elasticsearch.cluster.service.ClusterService; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.enrich.EnrichPolicy; import java.util.List; diff --git a/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/GeoMatchProcessorTests.java b/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/GeoMatchProcessorTests.java index fb8a7b02e6fc4..e661f07c6cb37 100644 --- a/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/GeoMatchProcessorTests.java +++ b/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/GeoMatchProcessorTests.java @@ -16,8 +16,6 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.geo.Orientation; import org.elasticsearch.common.geo.ShapeRelation; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.geometry.Geometry; import org.elasticsearch.geometry.GeometryCollection; import org.elasticsearch.geometry.Line; @@ -33,6 +31,8 @@ import org.elasticsearch.search.aggregations.Aggregations; import org.elasticsearch.search.suggest.Suggest; import org.elasticsearch.test.ESTestCase; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import java.io.ByteArrayOutputStream; import java.io.IOException; diff --git a/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/MatchProcessorTests.java b/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/MatchProcessorTests.java index 1b9dcf529fac5..aff34f4852a04 100644 --- a/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/MatchProcessorTests.java +++ b/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/MatchProcessorTests.java @@ -14,8 +14,6 @@ import org.elasticsearch.action.search.ShardSearchFailure; import org.elasticsearch.cluster.routing.Preference; import org.elasticsearch.common.bytes.BytesArray; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.index.VersionType; import org.elasticsearch.index.query.ConstantScoreQueryBuilder; @@ -29,6 +27,8 @@ import org.elasticsearch.search.aggregations.Aggregations; import org.elasticsearch.search.suggest.Suggest; import org.elasticsearch.test.ESTestCase; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import java.io.ByteArrayOutputStream; import java.io.IOException; diff --git a/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/action/EnrichShardMultiSearchActionTests.java b/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/action/EnrichShardMultiSearchActionTests.java index 5bf19f956230b..aa9a67bb0d283 100644 --- a/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/action/EnrichShardMultiSearchActionTests.java +++ b/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/action/EnrichShardMultiSearchActionTests.java @@ -13,11 +13,11 @@ import org.elasticsearch.action.search.MultiSearchResponse; import org.elasticsearch.action.search.SearchRequest; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.index.query.MatchAllQueryBuilder; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.test.ESSingleNodeTestCase; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.enrich.EnrichPolicy; import org.elasticsearch.xpack.enrich.LocalStateEnrich; diff --git a/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/action/GetEnrichPolicyActionResponseTests.java b/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/action/GetEnrichPolicyActionResponseTests.java index 5e0c68a0c426b..4f9957fc5732d 100644 --- a/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/action/GetEnrichPolicyActionResponseTests.java +++ b/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/action/GetEnrichPolicyActionResponseTests.java @@ -7,9 +7,9 @@ package org.elasticsearch.xpack.enrich.action; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.test.AbstractSerializingTestCase; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.enrich.EnrichPolicy; import org.elasticsearch.xpack.core.enrich.action.GetEnrichPolicyAction; diff --git a/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/action/PutEnrichPolicyActionRequestTests.java b/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/action/PutEnrichPolicyActionRequestTests.java index d5ed97116ba31..8ae0870bd308d 100644 --- a/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/action/PutEnrichPolicyActionRequestTests.java +++ b/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/action/PutEnrichPolicyActionRequestTests.java @@ -7,8 +7,8 @@ package org.elasticsearch.xpack.enrich.action; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.test.AbstractWireSerializingTestCase; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.enrich.EnrichPolicy; import org.elasticsearch.xpack.core.enrich.action.PutEnrichPolicyAction; diff --git a/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/action/TransportDeleteEnrichPolicyActionTests.java b/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/action/TransportDeleteEnrichPolicyActionTests.java index 295b3b29eca47..580de0ba26b46 100644 --- a/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/action/TransportDeleteEnrichPolicyActionTests.java +++ b/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/action/TransportDeleteEnrichPolicyActionTests.java @@ -15,8 +15,8 @@ import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.EsRejectedExecutionException; -import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.index.IndexNotFoundException; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.enrich.EnrichPolicy; import org.elasticsearch.xpack.core.enrich.action.DeleteEnrichPolicyAction; import org.elasticsearch.xpack.enrich.AbstractEnrichTestCase; diff --git a/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/action/TransportGetEnrichPolicyActionTests.java b/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/action/TransportGetEnrichPolicyActionTests.java index 1b5b99680ce4e..4cd7e7137e246 100644 --- a/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/action/TransportGetEnrichPolicyActionTests.java +++ b/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/enrich/action/TransportGetEnrichPolicyActionTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.support.ActionTestUtils; import org.elasticsearch.cluster.service.ClusterService; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.enrich.EnrichPolicy; import org.elasticsearch.xpack.core.enrich.action.GetEnrichPolicyAction; import org.elasticsearch.xpack.enrich.AbstractEnrichTestCase; diff --git a/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/monitoring/collector/enrich/EnrichCoordinatorDocTests.java b/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/monitoring/collector/enrich/EnrichCoordinatorDocTests.java index 1d6a44b186933..56d6bdc3314ac 100644 --- a/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/monitoring/collector/enrich/EnrichCoordinatorDocTests.java +++ b/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/monitoring/collector/enrich/EnrichCoordinatorDocTests.java @@ -9,10 +9,10 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.time.DateFormatter; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.common.xcontent.support.XContentMapValues; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.enrich.action.EnrichStatsAction.Response.CoordinatorStats; import org.elasticsearch.xpack.core.monitoring.MonitoredSystem; import org.elasticsearch.xpack.core.monitoring.exporter.MonitoringDoc; @@ -23,7 +23,7 @@ import java.time.ZoneOffset; import java.util.Map; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.anyOf; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; diff --git a/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/monitoring/collector/enrich/ExecutingPolicyDocTests.java b/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/monitoring/collector/enrich/ExecutingPolicyDocTests.java index 0650298a3c844..0c2e506659f3f 100644 --- a/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/monitoring/collector/enrich/ExecutingPolicyDocTests.java +++ b/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/monitoring/collector/enrich/ExecutingPolicyDocTests.java @@ -8,10 +8,10 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.common.xcontent.support.XContentMapValues; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.enrich.action.EnrichStatsAction.Response.ExecutingPolicy; import org.elasticsearch.xpack.core.monitoring.MonitoredSystem; import org.elasticsearch.xpack.core.monitoring.exporter.MonitoringDoc; @@ -23,7 +23,7 @@ import java.util.Map; import java.util.Optional; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.xpack.enrich.action.EnrichStatsResponseTests.randomTaskInfo; import static org.elasticsearch.xpack.monitoring.collector.enrich.EnrichCoordinatorDocTests.DATE_TIME_FORMATTER; import static org.hamcrest.Matchers.anyOf; diff --git a/x-pack/plugin/eql/qa/common/src/main/java/org/elasticsearch/test/eql/DataLoader.java b/x-pack/plugin/eql/qa/common/src/main/java/org/elasticsearch/test/eql/DataLoader.java index 9fc49568568a1..42cf97a883f71 100644 --- a/x-pack/plugin/eql/qa/common/src/main/java/org/elasticsearch/test/eql/DataLoader.java +++ b/x-pack/plugin/eql/qa/common/src/main/java/org/elasticsearch/test/eql/DataLoader.java @@ -34,11 +34,11 @@ import org.elasticsearch.cluster.ClusterModule; import org.elasticsearch.common.CheckedBiFunction; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContent; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.rest.ESRestTestCase; import org.elasticsearch.xpack.ql.TestUtils; diff --git a/x-pack/plugin/eql/qa/common/src/main/java/org/elasticsearch/test/eql/EqlRestTestCase.java b/x-pack/plugin/eql/qa/common/src/main/java/org/elasticsearch/test/eql/EqlRestTestCase.java index 2852bd11a7a85..8888b9e0a872a 100644 --- a/x-pack/plugin/eql/qa/common/src/main/java/org/elasticsearch/test/eql/EqlRestTestCase.java +++ b/x-pack/plugin/eql/qa/common/src/main/java/org/elasticsearch/test/eql/EqlRestTestCase.java @@ -11,7 +11,7 @@ import org.elasticsearch.client.Response; import org.elasticsearch.client.ResponseException; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.json.JsonXContent; import org.junit.After; import java.io.IOException; diff --git a/x-pack/plugin/eql/qa/common/src/main/java/org/elasticsearch/test/eql/EqlRestValidationTestCase.java b/x-pack/plugin/eql/qa/common/src/main/java/org/elasticsearch/test/eql/EqlRestValidationTestCase.java index e25f686961735..254e9c34b44c4 100644 --- a/x-pack/plugin/eql/qa/common/src/main/java/org/elasticsearch/test/eql/EqlRestValidationTestCase.java +++ b/x-pack/plugin/eql/qa/common/src/main/java/org/elasticsearch/test/eql/EqlRestValidationTestCase.java @@ -11,13 +11,13 @@ import org.elasticsearch.client.Response; import org.elasticsearch.client.ResponseException; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.junit.Before; import java.io.IOException; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.xpack.ql.util.StringUtils.EMPTY; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; diff --git a/x-pack/plugin/eql/qa/common/src/main/java/org/elasticsearch/test/eql/stats/EqlUsageRestTestCase.java b/x-pack/plugin/eql/qa/common/src/main/java/org/elasticsearch/test/eql/stats/EqlUsageRestTestCase.java index 217ee338f6dce..b45822bf37504 100644 --- a/x-pack/plugin/eql/qa/common/src/main/java/org/elasticsearch/test/eql/stats/EqlUsageRestTestCase.java +++ b/x-pack/plugin/eql/qa/common/src/main/java/org/elasticsearch/test/eql/stats/EqlUsageRestTestCase.java @@ -13,7 +13,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.eql.DataLoader; import org.elasticsearch.test.rest.ESRestTestCase; import org.junit.Before; diff --git a/x-pack/plugin/eql/qa/mixed-node/src/test/java/org/elasticsearch/xpack/eql/qa/mixed_node/EqlSearchIT.java b/x-pack/plugin/eql/qa/mixed-node/src/test/java/org/elasticsearch/xpack/eql/qa/mixed_node/EqlSearchIT.java index 6fdba0049dc1f..034b66af07630 100644 --- a/x-pack/plugin/eql/qa/mixed-node/src/test/java/org/elasticsearch/xpack/eql/qa/mixed_node/EqlSearchIT.java +++ b/x-pack/plugin/eql/qa/mixed-node/src/test/java/org/elasticsearch/xpack/eql/qa/mixed_node/EqlSearchIT.java @@ -14,7 +14,7 @@ import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.NotEqualMessageBuilder; import org.elasticsearch.test.rest.ESRestTestCase; import org.elasticsearch.xpack.eql.execution.search.RuntimeUtils; diff --git a/x-pack/plugin/eql/qa/security/src/javaRestTest/java/org/elasticsearch/xpack/eql/AsyncEqlSecurityIT.java b/x-pack/plugin/eql/qa/security/src/javaRestTest/java/org/elasticsearch/xpack/eql/AsyncEqlSecurityIT.java index ac8f78775d4e4..08f211623a2cf 100644 --- a/x-pack/plugin/eql/qa/security/src/javaRestTest/java/org/elasticsearch/xpack/eql/AsyncEqlSecurityIT.java +++ b/x-pack/plugin/eql/qa/security/src/javaRestTest/java/org/elasticsearch/xpack/eql/AsyncEqlSecurityIT.java @@ -14,9 +14,9 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.rest.ESRestTestCase; import org.elasticsearch.xpack.core.XPackPlugin; import org.elasticsearch.xpack.core.async.AsyncExecutionId; @@ -25,7 +25,7 @@ import java.io.IOException; import java.util.Map; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.xpack.eql.SecurityUtils.secureClientSettings; import static org.elasticsearch.xpack.eql.SecurityUtils.setRunAsHeader; import static org.hamcrest.Matchers.containsString; diff --git a/x-pack/plugin/eql/src/internalClusterTest/java/org/elasticsearch/xpack/eql/action/AsyncEqlSearchActionIT.java b/x-pack/plugin/eql/src/internalClusterTest/java/org/elasticsearch/xpack/eql/action/AsyncEqlSearchActionIT.java index 46d2a9740a82b..817bf03a1186d 100644 --- a/x-pack/plugin/eql/src/internalClusterTest/java/org/elasticsearch/xpack/eql/action/AsyncEqlSearchActionIT.java +++ b/x-pack/plugin/eql/src/internalClusterTest/java/org/elasticsearch/xpack/eql/action/AsyncEqlSearchActionIT.java @@ -55,7 +55,7 @@ import java.util.concurrent.Executors; import java.util.function.Function; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertFutureThrows; import static org.hamcrest.Matchers.containsString; diff --git a/x-pack/plugin/eql/src/internalClusterTest/java/org/elasticsearch/xpack/eql/action/EqlCancellationIT.java b/x-pack/plugin/eql/src/internalClusterTest/java/org/elasticsearch/xpack/eql/action/EqlCancellationIT.java index 864952a2382e8..7eac83d912ce8 100644 --- a/x-pack/plugin/eql/src/internalClusterTest/java/org/elasticsearch/xpack/eql/action/EqlCancellationIT.java +++ b/x-pack/plugin/eql/src/internalClusterTest/java/org/elasticsearch/xpack/eql/action/EqlCancellationIT.java @@ -21,7 +21,7 @@ import java.util.concurrent.Executors; import java.util.concurrent.Future; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.instanceOf; diff --git a/x-pack/plugin/eql/src/internalClusterTest/java/org/elasticsearch/xpack/eql/action/RestEqlCancellationIT.java b/x-pack/plugin/eql/src/internalClusterTest/java/org/elasticsearch/xpack/eql/action/RestEqlCancellationIT.java index 24534a418bf6c..b9cde24239a19 100644 --- a/x-pack/plugin/eql/src/internalClusterTest/java/org/elasticsearch/xpack/eql/action/RestEqlCancellationIT.java +++ b/x-pack/plugin/eql/src/internalClusterTest/java/org/elasticsearch/xpack/eql/action/RestEqlCancellationIT.java @@ -30,7 +30,7 @@ import java.util.concurrent.CancellationException; import static org.elasticsearch.action.support.ActionTestUtils.wrapAsRestResponseListener; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.instanceOf; diff --git a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/action/EqlSearchRequest.java b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/action/EqlSearchRequest.java index 63bf2047b21a5..d87e6881d44fc 100644 --- a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/action/EqlSearchRequest.java +++ b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/action/EqlSearchRequest.java @@ -11,17 +11,17 @@ import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.IndicesRequest; import org.elasticsearch.action.support.IndicesOptions; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentParser.Token; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser.Token; import org.elasticsearch.index.query.AbstractQueryBuilder; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.search.builder.SearchSourceBuilder; diff --git a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/action/EqlSearchResponse.java b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/action/EqlSearchResponse.java index ce34a94713a3f..693cf3bafdd15 100644 --- a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/action/EqlSearchResponse.java +++ b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/action/EqlSearchResponse.java @@ -10,7 +10,7 @@ import org.elasticsearch.Version; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.document.DocumentField; @@ -18,14 +18,14 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.lucene.Lucene; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.InstantiatingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.InstantiatingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParserUtils; import org.elasticsearch.index.get.GetResult; import org.elasticsearch.index.mapper.SourceFieldMapper; @@ -39,8 +39,8 @@ import java.util.Map; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class EqlSearchResponse extends ActionResponse implements ToXContentObject, QlStatusResponse.AsyncStatus { diff --git a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/plugin/EqlPlugin.java b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/plugin/EqlPlugin.java index 5d6a44c139fa1..f85c9e4d03cd7 100644 --- a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/plugin/EqlPlugin.java +++ b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/plugin/EqlPlugin.java @@ -20,7 +20,7 @@ import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.SettingsFilter; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.env.Environment; import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.indices.breaker.BreakerSettings; diff --git a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/plugin/EqlStatsResponse.java b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/plugin/EqlStatsResponse.java index c040fc8bc3801..61417c94c6ff6 100644 --- a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/plugin/EqlStatsResponse.java +++ b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/plugin/EqlStatsResponse.java @@ -14,8 +14,8 @@ import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.watcher.common.stats.Counters; import java.io.IOException; diff --git a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/plugin/RestEqlSearchAction.java b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/plugin/RestEqlSearchAction.java index 9b979bb67b99d..73b812bb42e4a 100644 --- a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/plugin/RestEqlSearchAction.java +++ b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/plugin/RestEqlSearchAction.java @@ -12,9 +12,9 @@ import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BytesRestResponse; diff --git a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/querydsl/container/QueryContainer.java b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/querydsl/container/QueryContainer.java index 38c04c3c6fc61..e0be482654730 100644 --- a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/querydsl/container/QueryContainer.java +++ b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/querydsl/container/QueryContainer.java @@ -8,9 +8,9 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.core.Tuple; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.xpack.eql.EqlIllegalArgumentException; import org.elasticsearch.xpack.eql.execution.search.Limit; import org.elasticsearch.xpack.eql.execution.search.SourceGenerator; diff --git a/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/AbstractBWCSerializationTestCase.java b/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/AbstractBWCSerializationTestCase.java index 9f49e3ad9012c..cf863eaf3d778 100644 --- a/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/AbstractBWCSerializationTestCase.java +++ b/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/AbstractBWCSerializationTestCase.java @@ -8,7 +8,7 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContent; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/EqlInfoTransportActionTests.java b/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/EqlInfoTransportActionTests.java index 8abc10d61c50e..686c279b3a230 100644 --- a/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/EqlInfoTransportActionTests.java +++ b/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/EqlInfoTransportActionTests.java @@ -16,7 +16,7 @@ import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.ObjectPath; +import org.elasticsearch.xcontent.ObjectPath; import org.elasticsearch.tasks.Task; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.threadpool.ThreadPool; diff --git a/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/action/EqlRequestParserTests.java b/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/action/EqlRequestParserTests.java index 5bb8e81524993..9b202a9dde866 100644 --- a/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/action/EqlRequestParserTests.java +++ b/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/action/EqlRequestParserTests.java @@ -8,10 +8,10 @@ package org.elasticsearch.xpack.eql.action; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.query.MatchQueryBuilder; import org.elasticsearch.search.SearchModule; import org.elasticsearch.test.ESTestCase; diff --git a/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/action/EqlSearchRequestTests.java b/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/action/EqlSearchRequestTests.java index faca32f4aec33..dc4f306ab3b42 100644 --- a/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/action/EqlSearchRequestTests.java +++ b/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/action/EqlSearchRequestTests.java @@ -10,9 +10,9 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.search.SearchModule; import org.elasticsearch.search.fetch.subphase.FieldAndFormat; diff --git a/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/action/EqlSearchResponseTests.java b/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/action/EqlSearchResponseTests.java index 8b706d0eca211..5308528829e80 100644 --- a/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/action/EqlSearchResponseTests.java +++ b/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/action/EqlSearchResponseTests.java @@ -12,11 +12,11 @@ import org.elasticsearch.core.Tuple; import org.elasticsearch.common.document.DocumentField; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.RandomObjects; import org.elasticsearch.xpack.eql.AbstractBWCWireSerializingTestCase; diff --git a/x-pack/plugin/fleet/src/internalClusterTest/java/org/elasticsearch/xpack/fleet/action/GetGlobalCheckpointsActionIT.java b/x-pack/plugin/fleet/src/internalClusterTest/java/org/elasticsearch/xpack/fleet/action/GetGlobalCheckpointsActionIT.java index e8df5d3c28228..4380029a331ff 100644 --- a/x-pack/plugin/fleet/src/internalClusterTest/java/org/elasticsearch/xpack/fleet/action/GetGlobalCheckpointsActionIT.java +++ b/x-pack/plugin/fleet/src/internalClusterTest/java/org/elasticsearch/xpack/fleet/action/GetGlobalCheckpointsActionIT.java @@ -15,7 +15,6 @@ import org.elasticsearch.action.support.ActiveShardCount; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.core.TimeValue; import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.index.IndexSettings; @@ -23,6 +22,7 @@ import org.elasticsearch.plugins.Plugin; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.test.ESIntegTestCase; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.fleet.Fleet; import java.util.Arrays; diff --git a/x-pack/plugin/fleet/src/javaRestTest/java/org/elasticsearch/xpack/fleet/FleetSystemIndicesIT.java b/x-pack/plugin/fleet/src/javaRestTest/java/org/elasticsearch/xpack/fleet/FleetSystemIndicesIT.java index 8b6f8c9ddb8a3..56e323ef8fa0b 100644 --- a/x-pack/plugin/fleet/src/javaRestTest/java/org/elasticsearch/xpack/fleet/FleetSystemIndicesIT.java +++ b/x-pack/plugin/fleet/src/javaRestTest/java/org/elasticsearch/xpack/fleet/FleetSystemIndicesIT.java @@ -32,9 +32,9 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.test.SecuritySettingsSourceField; import org.elasticsearch.test.rest.ESRestTestCase; +import org.elasticsearch.xcontent.XContentType; import java.util.Map; diff --git a/x-pack/plugin/fleet/src/main/java/org/elasticsearch/xpack/fleet/Fleet.java b/x-pack/plugin/fleet/src/main/java/org/elasticsearch/xpack/fleet/Fleet.java index 206cdc12fd3b4..92b2d701da95b 100644 --- a/x-pack/plugin/fleet/src/main/java/org/elasticsearch/xpack/fleet/Fleet.java +++ b/x-pack/plugin/fleet/src/main/java/org/elasticsearch/xpack/fleet/Fleet.java @@ -28,10 +28,6 @@ import org.elasticsearch.common.settings.IndexScopedSettings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.SettingsFilter; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.env.Environment; import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.indices.ExecutorNames; @@ -46,6 +42,10 @@ import org.elasticsearch.script.ScriptService; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.watcher.ResourceWatcherService; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.action.DeleteDataStreamAction; import org.elasticsearch.xpack.core.action.DeleteDataStreamAction.Request; import org.elasticsearch.xpack.core.template.TemplateUtils; diff --git a/x-pack/plugin/fleet/src/main/java/org/elasticsearch/xpack/fleet/FleetTemplateRegistry.java b/x-pack/plugin/fleet/src/main/java/org/elasticsearch/xpack/fleet/FleetTemplateRegistry.java index 37cc5fb4ee304..4f8cd8c5cbd4b 100644 --- a/x-pack/plugin/fleet/src/main/java/org/elasticsearch/xpack/fleet/FleetTemplateRegistry.java +++ b/x-pack/plugin/fleet/src/main/java/org/elasticsearch/xpack/fleet/FleetTemplateRegistry.java @@ -29,8 +29,8 @@ import org.elasticsearch.client.Client; import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; import org.elasticsearch.threadpool.ThreadPool; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.xpack.core.ClientHelper; import org.elasticsearch.xpack.core.template.IndexTemplateRegistry; import org.elasticsearch.xpack.core.template.LifecyclePolicyConfig; diff --git a/x-pack/plugin/fleet/src/main/java/org/elasticsearch/xpack/fleet/action/GetGlobalCheckpointsAction.java b/x-pack/plugin/fleet/src/main/java/org/elasticsearch/xpack/fleet/action/GetGlobalCheckpointsAction.java index 8b3dc1421674d..21652d946805b 100644 --- a/x-pack/plugin/fleet/src/main/java/org/elasticsearch/xpack/fleet/action/GetGlobalCheckpointsAction.java +++ b/x-pack/plugin/fleet/src/main/java/org/elasticsearch/xpack/fleet/action/GetGlobalCheckpointsAction.java @@ -30,9 +30,6 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.util.concurrent.AtomicArray; import org.elasticsearch.common.util.concurrent.CountDown; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.core.TimeValue; import org.elasticsearch.index.Index; import org.elasticsearch.index.IndexNotFoundException; @@ -41,6 +38,9 @@ import org.elasticsearch.rest.RestStatus; import org.elasticsearch.tasks.Task; import org.elasticsearch.transport.TransportService; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Arrays; diff --git a/x-pack/plugin/frozen-indices/src/internalClusterTest/java/org/elasticsearch/index/engine/frozen/FrozenIndexIT.java b/x-pack/plugin/frozen-indices/src/internalClusterTest/java/org/elasticsearch/index/engine/frozen/FrozenIndexIT.java index 0832830ff01c6..063c5dcf1d7ef 100644 --- a/x-pack/plugin/frozen-indices/src/internalClusterTest/java/org/elasticsearch/index/engine/frozen/FrozenIndexIT.java +++ b/x-pack/plugin/frozen-indices/src/internalClusterTest/java/org/elasticsearch/index/engine/frozen/FrozenIndexIT.java @@ -45,10 +45,10 @@ import java.util.stream.Collectors; import static org.elasticsearch.cluster.metadata.IndexMetadata.INDEX_ROUTING_EXCLUDE_GROUP_SETTING; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.not; import static org.hamcrest.Matchers.sameInstance; diff --git a/x-pack/plugin/frozen-indices/src/internalClusterTest/java/org/elasticsearch/index/engine/frozen/FrozenIndexTests.java b/x-pack/plugin/frozen-indices/src/internalClusterTest/java/org/elasticsearch/index/engine/frozen/FrozenIndexTests.java index 7ff2c22e34ec3..71034cdb9dd26 100644 --- a/x-pack/plugin/frozen-indices/src/internalClusterTest/java/org/elasticsearch/index/engine/frozen/FrozenIndexTests.java +++ b/x-pack/plugin/frozen-indices/src/internalClusterTest/java/org/elasticsearch/index/engine/frozen/FrozenIndexTests.java @@ -29,8 +29,6 @@ import org.elasticsearch.cluster.routing.RecoverySource; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.core.TimeValue; import org.elasticsearch.index.Index; import org.elasticsearch.index.IndexNotFoundException; @@ -56,6 +54,8 @@ import org.elasticsearch.search.internal.ShardSearchContextId; import org.elasticsearch.search.internal.ShardSearchRequest; import org.elasticsearch.test.ESSingleNodeTestCase; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.xpack.core.LocalStateCompositeXPackPlugin; import org.elasticsearch.xpack.core.frozen.action.FreezeIndexAction; import org.elasticsearch.xpack.frozen.FrozenIndices; diff --git a/x-pack/plugin/graph/src/main/java/org/elasticsearch/xpack/graph/rest/action/RestGraphAction.java b/x-pack/plugin/graph/src/main/java/org/elasticsearch/xpack/graph/rest/action/RestGraphAction.java index bb0c3a043c625..df1fd9ba746e4 100644 --- a/x-pack/plugin/graph/src/main/java/org/elasticsearch/xpack/graph/rest/action/RestGraphAction.java +++ b/x-pack/plugin/graph/src/main/java/org/elasticsearch/xpack/graph/rest/action/RestGraphAction.java @@ -11,11 +11,11 @@ import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.common.logging.DeprecationLogger; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.protocol.xpack.graph.GraphExploreRequest; import org.elasticsearch.protocol.xpack.graph.GraphExploreRequest.TermBoost; import org.elasticsearch.protocol.xpack.graph.Hop; diff --git a/x-pack/plugin/graph/src/test/java/org/elasticsearch/xpack/graph/rest/action/RestGraphActionTests.java b/x-pack/plugin/graph/src/test/java/org/elasticsearch/xpack/graph/rest/action/RestGraphActionTests.java index 37f2a2fc95d6e..9acca76d71435 100644 --- a/x-pack/plugin/graph/src/test/java/org/elasticsearch/xpack/graph/rest/action/RestGraphActionTests.java +++ b/x-pack/plugin/graph/src/test/java/org/elasticsearch/xpack/graph/rest/action/RestGraphActionTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.graph.rest.action; import org.elasticsearch.common.bytes.BytesArray; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.core.Tuple; import org.elasticsearch.protocol.xpack.graph.GraphExploreRequest; diff --git a/x-pack/plugin/identity-provider/qa/idp-rest-tests/src/javaRestTest/java/org/elasticsearch/xpack/idp/IdentityProviderAuthenticationIT.java b/x-pack/plugin/identity-provider/qa/idp-rest-tests/src/javaRestTest/java/org/elasticsearch/xpack/idp/IdentityProviderAuthenticationIT.java index 782b3593d0240..19d6a5732faa9 100644 --- a/x-pack/plugin/identity-provider/qa/idp-rest-tests/src/javaRestTest/java/org/elasticsearch/xpack/idp/IdentityProviderAuthenticationIT.java +++ b/x-pack/plugin/identity-provider/qa/idp-rest-tests/src/javaRestTest/java/org/elasticsearch/xpack/idp/IdentityProviderAuthenticationIT.java @@ -17,8 +17,8 @@ import org.elasticsearch.common.settings.SecureString; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.ObjectPath; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ObjectPath; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.xpack.core.security.action.saml.SamlPrepareAuthenticationResponse; import org.elasticsearch.xpack.idp.saml.sp.SamlServiceProviderIndex; import org.junit.Before; diff --git a/x-pack/plugin/identity-provider/qa/idp-rest-tests/src/javaRestTest/java/org/elasticsearch/xpack/idp/IdpRestTestCase.java b/x-pack/plugin/identity-provider/qa/idp-rest-tests/src/javaRestTest/java/org/elasticsearch/xpack/idp/IdpRestTestCase.java index f013c36733153..0fc25e182eea7 100644 --- a/x-pack/plugin/identity-provider/qa/idp-rest-tests/src/javaRestTest/java/org/elasticsearch/xpack/idp/IdpRestTestCase.java +++ b/x-pack/plugin/identity-provider/qa/idp-rest-tests/src/javaRestTest/java/org/elasticsearch/xpack/idp/IdpRestTestCase.java @@ -26,8 +26,8 @@ import org.elasticsearch.common.settings.SecureString; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.ObjectPath; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ObjectPath; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.rest.ESRestTestCase; import org.elasticsearch.xpack.idp.saml.sp.SamlServiceProviderIndex; @@ -39,7 +39,6 @@ import java.util.Map; import java.util.stream.Collectors; -import static org.elasticsearch.xpack.core.security.authc.support.UsernamePasswordToken.basicAuthHeaderValue; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.instanceOf; diff --git a/x-pack/plugin/identity-provider/qa/idp-rest-tests/src/javaRestTest/java/org/elasticsearch/xpack/idp/ManageServiceProviderRestIT.java b/x-pack/plugin/identity-provider/qa/idp-rest-tests/src/javaRestTest/java/org/elasticsearch/xpack/idp/ManageServiceProviderRestIT.java index 9c53f81325097..4e35aa71b2542 100644 --- a/x-pack/plugin/identity-provider/qa/idp-rest-tests/src/javaRestTest/java/org/elasticsearch/xpack/idp/ManageServiceProviderRestIT.java +++ b/x-pack/plugin/identity-provider/qa/idp-rest-tests/src/javaRestTest/java/org/elasticsearch/xpack/idp/ManageServiceProviderRestIT.java @@ -10,7 +10,7 @@ import org.elasticsearch.client.Request; import org.elasticsearch.client.Response; import org.elasticsearch.client.ResponseException; -import org.elasticsearch.common.xcontent.ObjectPath; +import org.elasticsearch.xcontent.ObjectPath; import org.elasticsearch.xpack.idp.saml.sp.SamlServiceProviderIndex; import org.elasticsearch.xpack.idp.saml.sp.SamlServiceProviderIndex.DocumentVersion; import org.junit.Before; diff --git a/x-pack/plugin/identity-provider/qa/idp-rest-tests/src/javaRestTest/java/org/elasticsearch/xpack/idp/WildcardServiceProviderRestIT.java b/x-pack/plugin/identity-provider/qa/idp-rest-tests/src/javaRestTest/java/org/elasticsearch/xpack/idp/WildcardServiceProviderRestIT.java index 65b233ea80174..d5f0120797464 100644 --- a/x-pack/plugin/identity-provider/qa/idp-rest-tests/src/javaRestTest/java/org/elasticsearch/xpack/idp/WildcardServiceProviderRestIT.java +++ b/x-pack/plugin/identity-provider/qa/idp-rest-tests/src/javaRestTest/java/org/elasticsearch/xpack/idp/WildcardServiceProviderRestIT.java @@ -12,8 +12,8 @@ import org.elasticsearch.client.security.user.privileges.ApplicationResourcePrivileges; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.SecureString; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.security.authc.support.UsernamePasswordToken; import org.junit.Before; diff --git a/x-pack/plugin/identity-provider/src/internalClusterTest/java/org/elasticsearch/xpack/idp/action/SamlIdentityProviderTests.java b/x-pack/plugin/identity-provider/src/internalClusterTest/java/org/elasticsearch/xpack/idp/action/SamlIdentityProviderTests.java index a85e8eb4389b7..4362f01eb8042 100644 --- a/x-pack/plugin/identity-provider/src/internalClusterTest/java/org/elasticsearch/xpack/idp/action/SamlIdentityProviderTests.java +++ b/x-pack/plugin/identity-provider/src/internalClusterTest/java/org/elasticsearch/xpack/idp/action/SamlIdentityProviderTests.java @@ -16,8 +16,8 @@ import org.elasticsearch.client.ResponseException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.SecureString; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.core.Nullable; import org.elasticsearch.core.TimeValue; import org.elasticsearch.rest.RestStatus; @@ -58,7 +58,7 @@ import java.util.zip.Deflater; import java.util.zip.DeflaterOutputStream; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.xpack.core.security.authc.support.UsernamePasswordToken.basicAuthHeaderValue; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; diff --git a/x-pack/plugin/identity-provider/src/main/java/org/elasticsearch/xpack/idp/IdentityProviderPlugin.java b/x-pack/plugin/identity-provider/src/main/java/org/elasticsearch/xpack/idp/IdentityProviderPlugin.java index 2f8393f7eef94..93cc055a3bdc8 100644 --- a/x-pack/plugin/identity-provider/src/main/java/org/elasticsearch/xpack/idp/IdentityProviderPlugin.java +++ b/x-pack/plugin/identity-provider/src/main/java/org/elasticsearch/xpack/idp/IdentityProviderPlugin.java @@ -21,7 +21,7 @@ import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.SettingsFilter; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.env.Environment; import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.license.XPackLicenseState; diff --git a/x-pack/plugin/identity-provider/src/main/java/org/elasticsearch/xpack/idp/action/DeleteSamlServiceProviderResponse.java b/x-pack/plugin/identity-provider/src/main/java/org/elasticsearch/xpack/idp/action/DeleteSamlServiceProviderResponse.java index 6edff5c7ab11a..2d2fc186ecd2a 100644 --- a/x-pack/plugin/identity-provider/src/main/java/org/elasticsearch/xpack/idp/action/DeleteSamlServiceProviderResponse.java +++ b/x-pack/plugin/identity-provider/src/main/java/org/elasticsearch/xpack/idp/action/DeleteSamlServiceProviderResponse.java @@ -12,8 +12,8 @@ import org.elasticsearch.core.Nullable; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/x-pack/plugin/identity-provider/src/main/java/org/elasticsearch/xpack/idp/action/PutSamlServiceProviderRequest.java b/x-pack/plugin/identity-provider/src/main/java/org/elasticsearch/xpack/idp/action/PutSamlServiceProviderRequest.java index 0e2474d78c320..18352bd5a5759 100644 --- a/x-pack/plugin/identity-provider/src/main/java/org/elasticsearch/xpack/idp/action/PutSamlServiceProviderRequest.java +++ b/x-pack/plugin/identity-provider/src/main/java/org/elasticsearch/xpack/idp/action/PutSamlServiceProviderRequest.java @@ -15,7 +15,7 @@ import org.elasticsearch.common.ValidationException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.idp.saml.sp.SamlServiceProviderDocument; import java.io.IOException; diff --git a/x-pack/plugin/identity-provider/src/main/java/org/elasticsearch/xpack/idp/action/PutSamlServiceProviderResponse.java b/x-pack/plugin/identity-provider/src/main/java/org/elasticsearch/xpack/idp/action/PutSamlServiceProviderResponse.java index c48b7c150cd33..4b941152e21ae 100644 --- a/x-pack/plugin/identity-provider/src/main/java/org/elasticsearch/xpack/idp/action/PutSamlServiceProviderResponse.java +++ b/x-pack/plugin/identity-provider/src/main/java/org/elasticsearch/xpack/idp/action/PutSamlServiceProviderResponse.java @@ -10,8 +10,8 @@ import org.elasticsearch.action.ActionResponse; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/x-pack/plugin/identity-provider/src/main/java/org/elasticsearch/xpack/idp/saml/rest/action/RestDeleteSamlServiceProviderAction.java b/x-pack/plugin/identity-provider/src/main/java/org/elasticsearch/xpack/idp/saml/rest/action/RestDeleteSamlServiceProviderAction.java index 5e4a0a5a4f993..995f13859a6b6 100644 --- a/x-pack/plugin/identity-provider/src/main/java/org/elasticsearch/xpack/idp/saml/rest/action/RestDeleteSamlServiceProviderAction.java +++ b/x-pack/plugin/identity-provider/src/main/java/org/elasticsearch/xpack/idp/saml/rest/action/RestDeleteSamlServiceProviderAction.java @@ -9,7 +9,7 @@ import org.elasticsearch.action.support.WriteRequest; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/identity-provider/src/main/java/org/elasticsearch/xpack/idp/saml/rest/action/RestPutSamlServiceProviderAction.java b/x-pack/plugin/identity-provider/src/main/java/org/elasticsearch/xpack/idp/saml/rest/action/RestPutSamlServiceProviderAction.java index c79b46533de1e..68dfc0725a15a 100644 --- a/x-pack/plugin/identity-provider/src/main/java/org/elasticsearch/xpack/idp/saml/rest/action/RestPutSamlServiceProviderAction.java +++ b/x-pack/plugin/identity-provider/src/main/java/org/elasticsearch/xpack/idp/saml/rest/action/RestPutSamlServiceProviderAction.java @@ -9,8 +9,8 @@ import org.elasticsearch.action.support.WriteRequest; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/identity-provider/src/main/java/org/elasticsearch/xpack/idp/saml/rest/action/RestSamlInitiateSingleSignOnAction.java b/x-pack/plugin/identity-provider/src/main/java/org/elasticsearch/xpack/idp/saml/rest/action/RestSamlInitiateSingleSignOnAction.java index 24b89ef0bb071..e4a49dda805ba 100644 --- a/x-pack/plugin/identity-provider/src/main/java/org/elasticsearch/xpack/idp/saml/rest/action/RestSamlInitiateSingleSignOnAction.java +++ b/x-pack/plugin/identity-provider/src/main/java/org/elasticsearch/xpack/idp/saml/rest/action/RestSamlInitiateSingleSignOnAction.java @@ -7,10 +7,10 @@ package org.elasticsearch.xpack.idp.saml.rest.action; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/identity-provider/src/main/java/org/elasticsearch/xpack/idp/saml/rest/action/RestSamlMetadataAction.java b/x-pack/plugin/identity-provider/src/main/java/org/elasticsearch/xpack/idp/saml/rest/action/RestSamlMetadataAction.java index ae486274a62be..96fc8054db0a4 100644 --- a/x-pack/plugin/identity-provider/src/main/java/org/elasticsearch/xpack/idp/saml/rest/action/RestSamlMetadataAction.java +++ b/x-pack/plugin/identity-provider/src/main/java/org/elasticsearch/xpack/idp/saml/rest/action/RestSamlMetadataAction.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.idp.saml.rest.action; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/identity-provider/src/main/java/org/elasticsearch/xpack/idp/saml/rest/action/RestSamlValidateAuthenticationRequestAction.java b/x-pack/plugin/identity-provider/src/main/java/org/elasticsearch/xpack/idp/saml/rest/action/RestSamlValidateAuthenticationRequestAction.java index 07fed110c9ce9..a26a73b8968a3 100644 --- a/x-pack/plugin/identity-provider/src/main/java/org/elasticsearch/xpack/idp/saml/rest/action/RestSamlValidateAuthenticationRequestAction.java +++ b/x-pack/plugin/identity-provider/src/main/java/org/elasticsearch/xpack/idp/saml/rest/action/RestSamlValidateAuthenticationRequestAction.java @@ -7,10 +7,10 @@ package org.elasticsearch.xpack.idp.saml.rest.action; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/identity-provider/src/main/java/org/elasticsearch/xpack/idp/saml/sp/SamlServiceProviderDocument.java b/x-pack/plugin/identity-provider/src/main/java/org/elasticsearch/xpack/idp/saml/sp/SamlServiceProviderDocument.java index 4a11cdf9f3ff5..622d860a1acdd 100644 --- a/x-pack/plugin/identity-provider/src/main/java/org/elasticsearch/xpack/idp/saml/sp/SamlServiceProviderDocument.java +++ b/x-pack/plugin/identity-provider/src/main/java/org/elasticsearch/xpack/idp/saml/sp/SamlServiceProviderDocument.java @@ -14,11 +14,11 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.Nullable; import org.elasticsearch.xpack.core.ssl.CertParsingUtils; diff --git a/x-pack/plugin/identity-provider/src/main/java/org/elasticsearch/xpack/idp/saml/sp/SamlServiceProviderIndex.java b/x-pack/plugin/identity-provider/src/main/java/org/elasticsearch/xpack/idp/saml/sp/SamlServiceProviderIndex.java index 4534940d378fb..c91dde820ee67 100644 --- a/x-pack/plugin/identity-provider/src/main/java/org/elasticsearch/xpack/idp/saml/sp/SamlServiceProviderIndex.java +++ b/x-pack/plugin/identity-provider/src/main/java/org/elasticsearch/xpack/idp/saml/sp/SamlServiceProviderIndex.java @@ -36,11 +36,11 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.util.CachedSupplier; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.gateway.GatewayService; import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.index.get.GetResult; diff --git a/x-pack/plugin/identity-provider/src/main/java/org/elasticsearch/xpack/idp/saml/sp/WildcardServiceProvider.java b/x-pack/plugin/identity-provider/src/main/java/org/elasticsearch/xpack/idp/saml/sp/WildcardServiceProvider.java index 497e2ca2a95bc..fc42c8ff4ed74 100644 --- a/x-pack/plugin/identity-provider/src/main/java/org/elasticsearch/xpack/idp/saml/sp/WildcardServiceProvider.java +++ b/x-pack/plugin/identity-provider/src/main/java/org/elasticsearch/xpack/idp/saml/sp/WildcardServiceProvider.java @@ -8,17 +8,17 @@ package org.elasticsearch.xpack.idp.saml.sp; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.script.ScriptService; import org.elasticsearch.xpack.core.security.support.MustacheTemplateEvaluator; diff --git a/x-pack/plugin/identity-provider/src/main/java/org/elasticsearch/xpack/idp/saml/sp/WildcardServiceProviderResolver.java b/x-pack/plugin/identity-provider/src/main/java/org/elasticsearch/xpack/idp/saml/sp/WildcardServiceProviderResolver.java index b8d83f90fc7e6..e80ffab1adb9e 100644 --- a/x-pack/plugin/identity-provider/src/main/java/org/elasticsearch/xpack/idp/saml/sp/WildcardServiceProviderResolver.java +++ b/x-pack/plugin/identity-provider/src/main/java/org/elasticsearch/xpack/idp/saml/sp/WildcardServiceProviderResolver.java @@ -10,7 +10,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.elasticsearch.ElasticsearchException; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.cache.Cache; @@ -19,11 +19,11 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.iterable.Iterables; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentLocation; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentLocation; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParserUtils; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.env.Environment; import org.elasticsearch.script.ScriptService; import org.elasticsearch.watcher.FileChangesListener; diff --git a/x-pack/plugin/identity-provider/src/main/java/org/elasticsearch/xpack/idp/saml/support/SamlAuthenticationState.java b/x-pack/plugin/identity-provider/src/main/java/org/elasticsearch/xpack/idp/saml/support/SamlAuthenticationState.java index 065b6131a2b50..2022345390b12 100644 --- a/x-pack/plugin/identity-provider/src/main/java/org/elasticsearch/xpack/idp/saml/support/SamlAuthenticationState.java +++ b/x-pack/plugin/identity-provider/src/main/java/org/elasticsearch/xpack/idp/saml/support/SamlAuthenticationState.java @@ -7,15 +7,15 @@ package org.elasticsearch.xpack.idp.saml.support; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/x-pack/plugin/identity-provider/src/test/java/org/elasticsearch/xpack/idp/action/DeleteSamlServiceProviderResponseTests.java b/x-pack/plugin/identity-provider/src/test/java/org/elasticsearch/xpack/idp/action/DeleteSamlServiceProviderResponseTests.java index 90e88f5bc3aad..ddd3b102b3ee3 100644 --- a/x-pack/plugin/identity-provider/src/test/java/org/elasticsearch/xpack/idp/action/DeleteSamlServiceProviderResponseTests.java +++ b/x-pack/plugin/identity-provider/src/test/java/org/elasticsearch/xpack/idp/action/DeleteSamlServiceProviderResponseTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.idp.saml.test.IdpSamlTestCase; import java.util.Map; diff --git a/x-pack/plugin/identity-provider/src/test/java/org/elasticsearch/xpack/idp/action/PutSamlServiceProviderRequestTests.java b/x-pack/plugin/identity-provider/src/test/java/org/elasticsearch/xpack/idp/action/PutSamlServiceProviderRequestTests.java index f243e87c799dd..2b8c797658f2a 100644 --- a/x-pack/plugin/identity-provider/src/test/java/org/elasticsearch/xpack/idp/action/PutSamlServiceProviderRequestTests.java +++ b/x-pack/plugin/identity-provider/src/test/java/org/elasticsearch/xpack/idp/action/PutSamlServiceProviderRequestTests.java @@ -13,9 +13,9 @@ import org.elasticsearch.action.support.WriteRequest.RefreshPolicy; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.TestMatchers; import org.elasticsearch.test.VersionUtils; diff --git a/x-pack/plugin/identity-provider/src/test/java/org/elasticsearch/xpack/idp/saml/sp/SamlServiceProviderDocumentTests.java b/x-pack/plugin/identity-provider/src/test/java/org/elasticsearch/xpack/idp/saml/sp/SamlServiceProviderDocumentTests.java index 9dd34be72c2a5..f06785ffcf3fc 100644 --- a/x-pack/plugin/identity-provider/src/test/java/org/elasticsearch/xpack/idp/saml/sp/SamlServiceProviderDocumentTests.java +++ b/x-pack/plugin/identity-provider/src/test/java/org/elasticsearch/xpack/idp/saml/sp/SamlServiceProviderDocumentTests.java @@ -11,11 +11,11 @@ import org.elasticsearch.common.ValidationException; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.VersionUtils; import org.elasticsearch.xpack.idp.saml.test.IdpSamlTestCase; import org.hamcrest.MatcherAssert; diff --git a/x-pack/plugin/identity-provider/src/test/java/org/elasticsearch/xpack/idp/saml/sp/WildcardServiceProviderResolverTests.java b/x-pack/plugin/identity-provider/src/test/java/org/elasticsearch/xpack/idp/saml/sp/WildcardServiceProviderResolverTests.java index 9d0b684a50f2e..baa8441f1f45f 100644 --- a/x-pack/plugin/identity-provider/src/test/java/org/elasticsearch/xpack/idp/saml/sp/WildcardServiceProviderResolverTests.java +++ b/x-pack/plugin/identity-provider/src/test/java/org/elasticsearch/xpack/idp/saml/sp/WildcardServiceProviderResolverTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.idp.saml.sp; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.script.ScriptModule; import org.elasticsearch.script.ScriptService; import org.elasticsearch.script.mustache.MustacheScriptEngine; diff --git a/x-pack/plugin/identity-provider/src/test/java/org/elasticsearch/xpack/idp/saml/support/SamlAuthenticationStateTests.java b/x-pack/plugin/identity-provider/src/test/java/org/elasticsearch/xpack/idp/saml/support/SamlAuthenticationStateTests.java index 4dd7447acef30..4aa0a1bd0fc85 100644 --- a/x-pack/plugin/identity-provider/src/test/java/org/elasticsearch/xpack/idp/saml/support/SamlAuthenticationStateTests.java +++ b/x-pack/plugin/identity-provider/src/test/java/org/elasticsearch/xpack/idp/saml/support/SamlAuthenticationStateTests.java @@ -9,11 +9,11 @@ import org.elasticsearch.Version; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.VersionUtils; import org.elasticsearch.xpack.idp.saml.test.IdpSamlTestCase; import org.hamcrest.MatcherAssert; diff --git a/x-pack/plugin/ilm/qa/multi-cluster/src/test/java/org/elasticsearch/xpack/ilm/CCRIndexLifecycleIT.java b/x-pack/plugin/ilm/qa/multi-cluster/src/test/java/org/elasticsearch/xpack/ilm/CCRIndexLifecycleIT.java index a0460f0318bd2..e7476514f90d6 100644 --- a/x-pack/plugin/ilm/qa/multi-cluster/src/test/java/org/elasticsearch/xpack/ilm/CCRIndexLifecycleIT.java +++ b/x-pack/plugin/ilm/qa/multi-cluster/src/test/java/org/elasticsearch/xpack/ilm/CCRIndexLifecycleIT.java @@ -18,11 +18,11 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ObjectPath; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ObjectPath; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.xpack.ccr.ESCCRRestTestCase; import org.elasticsearch.xpack.core.ilm.LifecycleAction; @@ -39,7 +39,7 @@ import java.util.concurrent.TimeUnit; import static java.util.Collections.singletonMap; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.xpack.core.ilm.ShrinkIndexNameSupplier.SHRUNKEN_INDEX_PREFIX; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; diff --git a/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/TimeSeriesRestDriver.java b/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/TimeSeriesRestDriver.java index be94adcb95ea3..1f146d3f41933 100644 --- a/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/TimeSeriesRestDriver.java +++ b/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/TimeSeriesRestDriver.java @@ -19,11 +19,11 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.xpack.core.ilm.AllocateAction; import org.elasticsearch.xpack.core.ilm.DeleteAction; import org.elasticsearch.xpack.core.ilm.ForceMergeAction; @@ -45,7 +45,7 @@ import java.util.concurrent.TimeUnit; import static java.util.Collections.singletonMap; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.test.ESTestCase.randomAlphaOfLengthBetween; import static org.elasticsearch.test.ESTestCase.randomBoolean; import static org.elasticsearch.test.ESTestCase.waitUntil; diff --git a/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ilm/ChangePolicyforIndexIT.java b/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ilm/ChangePolicyforIndexIT.java index e488eb79a39b5..2783c21cd8ed6 100644 --- a/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ilm/ChangePolicyforIndexIT.java +++ b/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ilm/ChangePolicyforIndexIT.java @@ -14,7 +14,7 @@ import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.core.TimeValue; import org.elasticsearch.test.rest.ESRestTestCase; import org.elasticsearch.xpack.core.ilm.AllocateAction; @@ -33,7 +33,7 @@ import java.util.concurrent.TimeUnit; import static java.util.Collections.singletonMap; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.xpack.TimeSeriesRestDriver.createIndexWithSettings; import static org.elasticsearch.xpack.TimeSeriesRestDriver.createNewSingletonPolicy; import static org.elasticsearch.xpack.TimeSeriesRestDriver.indexDocument; diff --git a/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ilm/ExplainLifecycleIT.java b/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ilm/ExplainLifecycleIT.java index a726110e94c7b..b2f58e88b80e2 100644 --- a/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ilm/ExplainLifecycleIT.java +++ b/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ilm/ExplainLifecycleIT.java @@ -15,7 +15,7 @@ import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.core.TimeValue; import org.elasticsearch.test.rest.ESRestTestCase; import org.elasticsearch.xpack.core.ilm.DeleteAction; @@ -31,7 +31,7 @@ import java.util.Locale; import java.util.Map; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.xpack.TimeSeriesRestDriver.createFullPolicy; import static org.elasticsearch.xpack.TimeSeriesRestDriver.createIndexWithSettings; import static org.elasticsearch.xpack.TimeSeriesRestDriver.createNewSingletonPolicy; diff --git a/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ilm/LifecycleLicenseIT.java b/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ilm/LifecycleLicenseIT.java index 51529b987cebe..6468a4a249963 100644 --- a/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ilm/LifecycleLicenseIT.java +++ b/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ilm/LifecycleLicenseIT.java @@ -16,9 +16,9 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.license.License; import org.elasticsearch.license.TestUtils; import org.elasticsearch.test.rest.ESRestTestCase; diff --git a/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ilm/TimeSeriesDataStreamsIT.java b/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ilm/TimeSeriesDataStreamsIT.java index 3bf04dc1edba3..8a903a289d2c7 100644 --- a/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ilm/TimeSeriesDataStreamsIT.java +++ b/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ilm/TimeSeriesDataStreamsIT.java @@ -14,7 +14,7 @@ import org.elasticsearch.cluster.metadata.Template; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.rest.ESRestTestCase; import org.elasticsearch.xpack.core.ilm.CheckNotDataStreamWriteIndexStep; import org.elasticsearch.xpack.core.ilm.DeleteAction; diff --git a/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ilm/TimeSeriesLifecycleActionsIT.java b/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ilm/TimeSeriesLifecycleActionsIT.java index 1688de951fe3c..39da9598259a8 100644 --- a/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ilm/TimeSeriesLifecycleActionsIT.java +++ b/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ilm/TimeSeriesLifecycleActionsIT.java @@ -18,10 +18,10 @@ import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.core.CheckedRunnable; import org.elasticsearch.core.Nullable; import org.elasticsearch.core.TimeValue; @@ -57,7 +57,7 @@ import java.util.concurrent.TimeUnit; import static java.util.Collections.singletonMap; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.xpack.TimeSeriesRestDriver.createFullPolicy; import static org.elasticsearch.xpack.TimeSeriesRestDriver.createIndexWithSettings; import static org.elasticsearch.xpack.TimeSeriesRestDriver.createNewSingletonPolicy; diff --git a/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ilm/actions/SearchableSnapshotActionIT.java b/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ilm/actions/SearchableSnapshotActionIT.java index e95633d046821..52bc351e579ac 100644 --- a/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ilm/actions/SearchableSnapshotActionIT.java +++ b/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ilm/actions/SearchableSnapshotActionIT.java @@ -19,9 +19,9 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.rest.ESRestTestCase; import org.elasticsearch.xpack.core.ilm.DeleteAction; import org.elasticsearch.xpack.core.ilm.ForceMergeAction; @@ -47,7 +47,7 @@ import java.util.concurrent.TimeUnit; import static java.util.Collections.singletonMap; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.xpack.TimeSeriesRestDriver.createComposableTemplate; import static org.elasticsearch.xpack.TimeSeriesRestDriver.createNewSingletonPolicy; import static org.elasticsearch.xpack.TimeSeriesRestDriver.createPolicy; diff --git a/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ilm/actions/ShrinkActionIT.java b/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ilm/actions/ShrinkActionIT.java index 22933a3b8c7ce..9774ea5a76dbd 100644 --- a/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ilm/actions/ShrinkActionIT.java +++ b/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ilm/actions/ShrinkActionIT.java @@ -17,8 +17,8 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.rest.action.admin.indices.RestPutIndexTemplateAction; import org.elasticsearch.test.rest.ESRestTestCase; import org.elasticsearch.xpack.core.ilm.CheckTargetShardsCountStep; @@ -40,7 +40,7 @@ import static java.util.Collections.singletonMap; import static org.elasticsearch.cluster.metadata.IndexMetadata.SETTING_NUMBER_OF_SHARDS; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.xpack.TimeSeriesRestDriver.createIndexWithSettings; import static org.elasticsearch.xpack.TimeSeriesRestDriver.createNewSingletonPolicy; import static org.elasticsearch.xpack.TimeSeriesRestDriver.explainIndex; diff --git a/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/slm/SnapshotLifecycleRestIT.java b/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/slm/SnapshotLifecycleRestIT.java index 1f366664188d1..6bf0204fc4fae 100644 --- a/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/slm/SnapshotLifecycleRestIT.java +++ b/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/slm/SnapshotLifecycleRestIT.java @@ -22,14 +22,14 @@ import org.elasticsearch.common.compress.CompressedXContent; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.junit.annotations.TestIssueLogging; import org.elasticsearch.test.rest.ESRestTestCase; import org.elasticsearch.xpack.core.ilm.LifecycleSettings; @@ -50,7 +50,7 @@ import java.util.function.Function; import java.util.stream.Collectors; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.xpack.TimeSeriesRestDriver.createComposableTemplate; import static org.elasticsearch.xpack.TimeSeriesRestDriver.getStepKeyForIndex; import static org.elasticsearch.xpack.core.slm.history.SnapshotHistoryItem.CREATE_OPERATION; diff --git a/x-pack/plugin/ilm/qa/with-security/src/javaRestTest/java/org/elasticsearch/xpack/security/PermissionsIT.java b/x-pack/plugin/ilm/qa/with-security/src/javaRestTest/java/org/elasticsearch/xpack/security/PermissionsIT.java index 1bebd70b4ad7f..79d61ab6d2547 100644 --- a/x-pack/plugin/ilm/qa/with-security/src/javaRestTest/java/org/elasticsearch/xpack/security/PermissionsIT.java +++ b/x-pack/plugin/ilm/qa/with-security/src/javaRestTest/java/org/elasticsearch/xpack/security/PermissionsIT.java @@ -36,10 +36,10 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.repositories.fs.FsRepository; import org.elasticsearch.rest.RestStatus; @@ -62,7 +62,7 @@ import java.util.concurrent.TimeUnit; import static java.util.Collections.singletonMap; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.greaterThanOrEqualTo; diff --git a/x-pack/plugin/ilm/src/internalClusterTest/java/org/elasticsearch/xpack/ilm/IndexLifecycleInitialisationTests.java b/x-pack/plugin/ilm/src/internalClusterTest/java/org/elasticsearch/xpack/ilm/IndexLifecycleInitialisationTests.java index 30f364987c49f..2cae2cc15470c 100644 --- a/x-pack/plugin/ilm/src/internalClusterTest/java/org/elasticsearch/xpack/ilm/IndexLifecycleInitialisationTests.java +++ b/x-pack/plugin/ilm/src/internalClusterTest/java/org/elasticsearch/xpack/ilm/IndexLifecycleInitialisationTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.action.admin.indices.create.CreateIndexResponse; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.routing.RoutingNode; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.NamedWriteable; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.StreamInput; @@ -18,7 +18,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.time.DateFormatter; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.index.Index; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.test.ESIntegTestCase; diff --git a/x-pack/plugin/ilm/src/internalClusterTest/java/org/elasticsearch/xpack/ilm/UpdateSettingsStepTests.java b/x-pack/plugin/ilm/src/internalClusterTest/java/org/elasticsearch/xpack/ilm/UpdateSettingsStepTests.java index 769b7ea02eda9..70c0d322cc1fd 100644 --- a/x-pack/plugin/ilm/src/internalClusterTest/java/org/elasticsearch/xpack/ilm/UpdateSettingsStepTests.java +++ b/x-pack/plugin/ilm/src/internalClusterTest/java/org/elasticsearch/xpack/ilm/UpdateSettingsStepTests.java @@ -18,7 +18,7 @@ import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Setting.Property; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.env.Environment; import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.index.IndexModule; diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/cluster/metadata/MetadataMigrateToDataTiersRoutingService.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/cluster/metadata/MetadataMigrateToDataTiersRoutingService.java index 67d1ed5a4f1f7..7f5edb8d1489b 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/cluster/metadata/MetadataMigrateToDataTiersRoutingService.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/cluster/metadata/MetadataMigrateToDataTiersRoutingService.java @@ -17,7 +17,7 @@ import org.elasticsearch.cluster.metadata.Metadata; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.core.Nullable; import org.elasticsearch.core.Tuple; import org.elasticsearch.license.XPackLicenseState; diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/ExecuteStepsUpdateTask.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/ExecuteStepsUpdateTask.java index 0bce9dd212bad..25db1bb72ad00 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/ExecuteStepsUpdateTask.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/ExecuteStepsUpdateTask.java @@ -14,7 +14,7 @@ import org.elasticsearch.cluster.ClusterStateUpdateTask; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.ToXContentObject; import org.elasticsearch.index.Index; import org.elasticsearch.xpack.core.ilm.ClusterStateActionStep; import org.elasticsearch.xpack.core.ilm.ClusterStateWaitStep; diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycle.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycle.java index 5365a7df070f6..088ce1b8d69d5 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycle.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycle.java @@ -23,8 +23,8 @@ import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.SettingsFilter; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.internal.io.IOUtils; import org.elasticsearch.env.Environment; import org.elasticsearch.env.NodeEnvironment; diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycleRunner.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycleRunner.java index 4e8a137cce29c..e3fff06817d5b 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycleRunner.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycleRunner.java @@ -19,7 +19,7 @@ import org.elasticsearch.cluster.metadata.Metadata; import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.Priority; -import org.elasticsearch.common.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.ToXContentObject; import org.elasticsearch.core.Nullable; import org.elasticsearch.core.TimeValue; import org.elasticsearch.core.Tuple; diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycleService.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycleService.java index a9091276f63cd..1400b3f68acd2 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycleService.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycleService.java @@ -22,7 +22,7 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.component.Lifecycle.State; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.core.Nullable; import org.elasticsearch.core.TimeValue; import org.elasticsearch.gateway.GatewayService; diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycleTransition.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycleTransition.java index b0eae7d490286..1765f57fcc172 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycleTransition.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycleTransition.java @@ -18,10 +18,10 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.Index; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.xpack.core.ilm.ErrorStep; diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/PolicyStepsRegistry.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/PolicyStepsRegistry.java index 9753448a7ec89..26f77f3964231 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/PolicyStepsRegistry.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/PolicyStepsRegistry.java @@ -16,11 +16,11 @@ import org.elasticsearch.cluster.metadata.Metadata; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.core.Nullable; import org.elasticsearch.core.TimeValue; import org.elasticsearch.index.Index; diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/SetStepInfoUpdateTask.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/SetStepInfoUpdateTask.java index 60b0a40c57c39..620f7da7f9ee5 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/SetStepInfoUpdateTask.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/SetStepInfoUpdateTask.java @@ -14,8 +14,8 @@ import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.Index; import org.elasticsearch.xpack.core.ilm.LifecycleExecutionState; import org.elasticsearch.xpack.core.ilm.LifecycleSettings; diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/RestMoveToStepAction.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/RestMoveToStepAction.java index 86b6653f00b65..d4e34bd2de922 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/RestMoveToStepAction.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/RestMoveToStepAction.java @@ -9,7 +9,7 @@ package org.elasticsearch.xpack.ilm.action; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestToXContentListener; diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/RestPutLifecycleAction.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/RestPutLifecycleAction.java index 60301e6b5817a..978ba45ed03d4 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/RestPutLifecycleAction.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/RestPutLifecycleAction.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.ilm.action; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestToXContentListener; diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/TransportExplainLifecycleAction.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/TransportExplainLifecycleAction.java index 7b8b5d64c54b8..b8001d97dd861 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/TransportExplainLifecycleAction.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/TransportExplainLifecycleAction.java @@ -19,10 +19,10 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.core.Nullable; import org.elasticsearch.tasks.Task; import org.elasticsearch.threadpool.ThreadPool; diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/TransportMigrateToDataTiersAction.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/TransportMigrateToDataTiersAction.java index e45378ecfaa87..7e29dd77f8c40 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/TransportMigrateToDataTiersAction.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/TransportMigrateToDataTiersAction.java @@ -20,7 +20,7 @@ import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.Priority; import org.elasticsearch.common.inject.Inject; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.core.Tuple; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.tasks.Task; diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/TransportPutLifecycleAction.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/TransportPutLifecycleAction.java index 1daf13aa9a26b..ab48fa35803c7 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/TransportPutLifecycleAction.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/TransportPutLifecycleAction.java @@ -24,7 +24,7 @@ import org.elasticsearch.cluster.metadata.RepositoriesMetadata; import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.inject.Inject; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.tasks.Task; import org.elasticsearch.threadpool.ThreadPool; diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/history/ILMHistoryItem.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/history/ILMHistoryItem.java index fb9fe22921e29..2495e6d2ef3d7 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/history/ILMHistoryItem.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/history/ILMHistoryItem.java @@ -9,12 +9,12 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.xpack.core.ilm.LifecycleExecutionState; import java.io.IOException; diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/history/ILMHistoryStore.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/history/ILMHistoryStore.java index e0224330adc0d..7118187749c4f 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/history/ILMHistoryStore.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/history/ILMHistoryStore.java @@ -25,9 +25,9 @@ import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.threadpool.ThreadPool; import java.io.Closeable; diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/history/ILMHistoryTemplateRegistry.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/history/ILMHistoryTemplateRegistry.java index 74a413dba374b..f31bd9eaa6fc7 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/history/ILMHistoryTemplateRegistry.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/history/ILMHistoryTemplateRegistry.java @@ -10,7 +10,7 @@ import org.elasticsearch.client.Client; import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.xpack.core.ClientHelper; import org.elasticsearch.xpack.core.ilm.LifecycleSettings; diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/slm/SnapshotLifecycleTask.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/slm/SnapshotLifecycleTask.java index f4ef567dc6dae..3b5e4a9462d19 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/slm/SnapshotLifecycleTask.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/slm/SnapshotLifecycleTask.java @@ -22,9 +22,9 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.snapshots.SnapshotException; import org.elasticsearch.snapshots.SnapshotInfo; import org.elasticsearch.xpack.core.ClientHelper; diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/slm/action/RestPutSnapshotLifecycleAction.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/slm/action/RestPutSnapshotLifecycleAction.java index fe53a3b9babe8..92f66a793e90d 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/slm/action/RestPutSnapshotLifecycleAction.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/slm/action/RestPutSnapshotLifecycleAction.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.slm.action; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestToXContentListener; diff --git a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/cluster/metadata/MetadataMigrateToDataTiersRoutingServiceTests.java b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/cluster/metadata/MetadataMigrateToDataTiersRoutingServiceTests.java index b5ffe6af619cc..f97bc1d376910 100644 --- a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/cluster/metadata/MetadataMigrateToDataTiersRoutingServiceTests.java +++ b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/cluster/metadata/MetadataMigrateToDataTiersRoutingServiceTests.java @@ -17,10 +17,10 @@ import org.elasticsearch.cluster.metadata.Metadata; import org.elasticsearch.cluster.metadata.Template; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.TimeValue; import org.elasticsearch.core.Tuple; import org.elasticsearch.test.ESTestCase; diff --git a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/ExecuteStepsUpdateTaskTests.java b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/ExecuteStepsUpdateTaskTests.java index c38164acc6e01..dc85fe5944483 100644 --- a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/ExecuteStepsUpdateTaskTests.java +++ b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/ExecuteStepsUpdateTaskTests.java @@ -18,7 +18,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.transport.TransportAddress; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.index.Index; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.NodeRoles; diff --git a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/IndexLifecycleMetadataTests.java b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/IndexLifecycleMetadataTests.java index cee2e1aacfb5a..44fd254e1ec21 100644 --- a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/IndexLifecycleMetadataTests.java +++ b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/IndexLifecycleMetadataTests.java @@ -11,12 +11,12 @@ import org.elasticsearch.cluster.Diff; import org.elasticsearch.cluster.metadata.Metadata; import org.elasticsearch.cluster.metadata.Metadata.Custom; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable.Reader; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractDiffableSerializationTestCase; import org.elasticsearch.test.VersionUtils; import org.elasticsearch.xpack.core.ilm.AllocateAction; diff --git a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/IndexLifecycleRunnerTests.java b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/IndexLifecycleRunnerTests.java index 16b99a7a94478..2d14829ff10fc 100644 --- a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/IndexLifecycleRunnerTests.java +++ b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/IndexLifecycleRunnerTests.java @@ -23,11 +23,11 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.Index; import org.elasticsearch.test.ClusterServiceUtils; import org.elasticsearch.test.ESTestCase; diff --git a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/IndexLifecycleTransitionTests.java b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/IndexLifecycleTransitionTests.java index 25979cdded775..9e0f1bf3547c4 100644 --- a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/IndexLifecycleTransitionTests.java +++ b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/IndexLifecycleTransitionTests.java @@ -16,10 +16,10 @@ import org.elasticsearch.cluster.metadata.Metadata; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.core.TimeValue; import org.elasticsearch.index.Index; import org.elasticsearch.test.ESTestCase; diff --git a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/MoveToErrorStepUpdateTaskTests.java b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/MoveToErrorStepUpdateTaskTests.java index edd7d0a544fd5..858c57cefbe70 100644 --- a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/MoveToErrorStepUpdateTaskTests.java +++ b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/MoveToErrorStepUpdateTaskTests.java @@ -14,9 +14,9 @@ import org.elasticsearch.cluster.metadata.Metadata; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.Index; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.ilm.ErrorStep; diff --git a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/MoveToNextStepUpdateTaskTests.java b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/MoveToNextStepUpdateTaskTests.java index ef93516e65171..dac83e49a0ef2 100644 --- a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/MoveToNextStepUpdateTaskTests.java +++ b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/MoveToNextStepUpdateTaskTests.java @@ -13,7 +13,7 @@ import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.cluster.metadata.Metadata; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.index.Index; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.ilm.IndexLifecycleMetadata; diff --git a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/PolicyStepsRegistryTests.java b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/PolicyStepsRegistryTests.java index 7d1403b342078..81cf02f3fdb76 100644 --- a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/PolicyStepsRegistryTests.java +++ b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/PolicyStepsRegistryTests.java @@ -18,10 +18,10 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.transport.TransportAddress; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.Index; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.NodeRoles; diff --git a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/RandomStepInfo.java b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/RandomStepInfo.java index 8943beec8fa0a..d0b38c9a51bb0 100644 --- a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/RandomStepInfo.java +++ b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/RandomStepInfo.java @@ -8,8 +8,8 @@ package org.elasticsearch.xpack.ilm; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/SetStepInfoUpdateTaskTests.java b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/SetStepInfoUpdateTaskTests.java index 6cdd3b7bd3c02..1e1dd8963bc5f 100644 --- a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/SetStepInfoUpdateTaskTests.java +++ b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/SetStepInfoUpdateTaskTests.java @@ -18,10 +18,10 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.logging.Loggers; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.Index; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.MockLogAppender; diff --git a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/action/TransportExplainLifecycleActionTests.java b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/action/TransportExplainLifecycleActionTests.java index f78688ba6cf94..751787b1ebf24 100644 --- a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/action/TransportExplainLifecycleActionTests.java +++ b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/action/TransportExplainLifecycleActionTests.java @@ -9,8 +9,8 @@ import org.elasticsearch.Version; import org.elasticsearch.cluster.metadata.IndexMetadata; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.ilm.ErrorStep; import org.elasticsearch.xpack.core.ilm.IndexLifecycleExplainResponse; diff --git a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/history/ILMHistoryItemTests.java b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/history/ILMHistoryItemTests.java index b2265aabd9360..46a2b767480b1 100644 --- a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/history/ILMHistoryItemTests.java +++ b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/history/ILMHistoryItemTests.java @@ -8,14 +8,14 @@ package org.elasticsearch.xpack.ilm.history; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.ilm.LifecycleExecutionState; import java.io.IOException; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.startsWith; diff --git a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/history/ILMHistoryStoreTests.java b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/history/ILMHistoryStoreTests.java index 12894106814fa..7ae5871dd11c2 100644 --- a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/history/ILMHistoryStoreTests.java +++ b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/history/ILMHistoryStoreTests.java @@ -27,9 +27,9 @@ import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.TriFunction; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.test.ClusterServiceUtils; import org.elasticsearch.test.ESTestCase; diff --git a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/slm/SnapshotLifecyclePolicyTests.java b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/slm/SnapshotLifecyclePolicyTests.java index b2a05052c0a9e..1cf5b0f0622bb 100644 --- a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/slm/SnapshotLifecyclePolicyTests.java +++ b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/slm/SnapshotLifecyclePolicyTests.java @@ -11,7 +11,7 @@ import org.elasticsearch.common.ValidationException; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.slm.SnapshotLifecyclePolicy; import org.elasticsearch.xpack.core.slm.SnapshotLifecyclePolicyMetadataTests; diff --git a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/slm/SnapshotLifecycleTaskTests.java b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/slm/SnapshotLifecycleTaskTests.java index baf7ed3ccdf75..415acf0101af6 100644 --- a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/slm/SnapshotLifecycleTaskTests.java +++ b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/slm/SnapshotLifecycleTaskTests.java @@ -23,7 +23,7 @@ import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.TriFunction; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.snapshots.Snapshot; import org.elasticsearch.snapshots.SnapshotId; diff --git a/x-pack/plugin/logstash/src/javaRestTest/java/org/elasticsearch/xpack/test/rest/LogstashSystemIndexIT.java b/x-pack/plugin/logstash/src/javaRestTest/java/org/elasticsearch/xpack/test/rest/LogstashSystemIndexIT.java index f0ed138611bcf..ff583f6dd90ba 100644 --- a/x-pack/plugin/logstash/src/javaRestTest/java/org/elasticsearch/xpack/test/rest/LogstashSystemIndexIT.java +++ b/x-pack/plugin/logstash/src/javaRestTest/java/org/elasticsearch/xpack/test/rest/LogstashSystemIndexIT.java @@ -15,19 +15,18 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.test.SecuritySettingsSourceField; import org.elasticsearch.test.rest.ESRestTestCase; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.Map; -import static org.elasticsearch.xpack.core.security.authc.support.UsernamePasswordToken.basicAuthHeaderValue; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.is; diff --git a/x-pack/plugin/logstash/src/main/java/org/elasticsearch/xpack/logstash/Logstash.java b/x-pack/plugin/logstash/src/main/java/org/elasticsearch/xpack/logstash/Logstash.java index a8c7aeebef5f2..a0bcf9f866f85 100644 --- a/x-pack/plugin/logstash/src/main/java/org/elasticsearch/xpack/logstash/Logstash.java +++ b/x-pack/plugin/logstash/src/main/java/org/elasticsearch/xpack/logstash/Logstash.java @@ -16,7 +16,6 @@ import org.elasticsearch.common.settings.IndexScopedSettings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.SettingsFilter; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.index.codec.CodecService; import org.elasticsearch.indices.SystemIndexDescriptor; import org.elasticsearch.license.License; @@ -25,6 +24,7 @@ import org.elasticsearch.plugins.SystemIndexPlugin; import org.elasticsearch.rest.RestController; import org.elasticsearch.rest.RestHandler; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.action.XPackInfoFeatureAction; import org.elasticsearch.xpack.core.action.XPackUsageFeatureAction; import org.elasticsearch.xpack.logstash.action.DeletePipelineAction; @@ -43,9 +43,9 @@ import java.util.List; import java.util.function.Supplier; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.engine.EngineConfig.INDEX_CODEC_SETTING; import static org.elasticsearch.index.mapper.MapperService.SINGLE_MAPPING_NAME; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.xpack.core.ClientHelper.LOGSTASH_MANAGEMENT_ORIGIN; /** diff --git a/x-pack/plugin/logstash/src/main/java/org/elasticsearch/xpack/logstash/Pipeline.java b/x-pack/plugin/logstash/src/main/java/org/elasticsearch/xpack/logstash/Pipeline.java index a8f6364a17621..32b0cba78b6a1 100644 --- a/x-pack/plugin/logstash/src/main/java/org/elasticsearch/xpack/logstash/Pipeline.java +++ b/x-pack/plugin/logstash/src/main/java/org/elasticsearch/xpack/logstash/Pipeline.java @@ -7,16 +7,16 @@ package org.elasticsearch.xpack.logstash; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.ParseField; import java.time.Instant; import java.util.Arrays; import java.util.Iterator; import java.util.Map; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; public class Pipeline { diff --git a/x-pack/plugin/logstash/src/main/java/org/elasticsearch/xpack/logstash/action/GetPipelineResponse.java b/x-pack/plugin/logstash/src/main/java/org/elasticsearch/xpack/logstash/action/GetPipelineResponse.java index cb0b5ffe968ce..e10b9183520bc 100644 --- a/x-pack/plugin/logstash/src/main/java/org/elasticsearch/xpack/logstash/action/GetPipelineResponse.java +++ b/x-pack/plugin/logstash/src/main/java/org/elasticsearch/xpack/logstash/action/GetPipelineResponse.java @@ -11,8 +11,8 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Map; diff --git a/x-pack/plugin/logstash/src/main/java/org/elasticsearch/xpack/logstash/action/PutPipelineRequest.java b/x-pack/plugin/logstash/src/main/java/org/elasticsearch/xpack/logstash/action/PutPipelineRequest.java index 05a8cfcac5ec7..6f6bc18111262 100644 --- a/x-pack/plugin/logstash/src/main/java/org/elasticsearch/xpack/logstash/action/PutPipelineRequest.java +++ b/x-pack/plugin/logstash/src/main/java/org/elasticsearch/xpack/logstash/action/PutPipelineRequest.java @@ -12,7 +12,7 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.util.Objects; diff --git a/x-pack/plugin/logstash/src/main/java/org/elasticsearch/xpack/logstash/rest/RestDeletePipelineAction.java b/x-pack/plugin/logstash/src/main/java/org/elasticsearch/xpack/logstash/rest/RestDeletePipelineAction.java index d96f8473274c9..a01cccd62554f 100644 --- a/x-pack/plugin/logstash/src/main/java/org/elasticsearch/xpack/logstash/rest/RestDeletePipelineAction.java +++ b/x-pack/plugin/logstash/src/main/java/org/elasticsearch/xpack/logstash/rest/RestDeletePipelineAction.java @@ -9,12 +9,12 @@ import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.common.bytes.BytesArray; -import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.rest.action.RestActionListener; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.logstash.action.DeletePipelineAction; import org.elasticsearch.xpack.logstash.action.DeletePipelineRequest; import org.elasticsearch.xpack.logstash.action.DeletePipelineResponse; diff --git a/x-pack/plugin/logstash/src/main/java/org/elasticsearch/xpack/logstash/rest/RestPutPipelineAction.java b/x-pack/plugin/logstash/src/main/java/org/elasticsearch/xpack/logstash/rest/RestPutPipelineAction.java index e66b699c64a0d..aaf5adfeb97d1 100644 --- a/x-pack/plugin/logstash/src/main/java/org/elasticsearch/xpack/logstash/rest/RestPutPipelineAction.java +++ b/x-pack/plugin/logstash/src/main/java/org/elasticsearch/xpack/logstash/rest/RestPutPipelineAction.java @@ -9,12 +9,12 @@ import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.common.bytes.BytesArray; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestActionListener; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.logstash.Pipeline; import org.elasticsearch.xpack.logstash.action.PutPipelineAction; import org.elasticsearch.xpack.logstash.action.PutPipelineRequest; diff --git a/x-pack/plugin/logstash/src/test/java/org/elasticsearch/xpack/logstash/action/PutPipelineRequestTests.java b/x-pack/plugin/logstash/src/test/java/org/elasticsearch/xpack/logstash/action/PutPipelineRequestTests.java index 3b0b071888e1c..87606bd9d9143 100644 --- a/x-pack/plugin/logstash/src/test/java/org/elasticsearch/xpack/logstash/action/PutPipelineRequestTests.java +++ b/x-pack/plugin/logstash/src/test/java/org/elasticsearch/xpack/logstash/action/PutPipelineRequestTests.java @@ -8,8 +8,8 @@ package org.elasticsearch.xpack.logstash.action; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.test.AbstractWireSerializingTestCase; +import org.elasticsearch.xcontent.XContentType; public class PutPipelineRequestTests extends AbstractWireSerializingTestCase { diff --git a/x-pack/plugin/mapper-aggregate-metric/src/main/java/org/elasticsearch/xpack/aggregatemetric/mapper/AggregateDoubleMetricFieldMapper.java b/x-pack/plugin/mapper-aggregate-metric/src/main/java/org/elasticsearch/xpack/aggregatemetric/mapper/AggregateDoubleMetricFieldMapper.java index 2d05c34834754..78cdd68d668d8 100644 --- a/x-pack/plugin/mapper-aggregate-metric/src/main/java/org/elasticsearch/xpack/aggregatemetric/mapper/AggregateDoubleMetricFieldMapper.java +++ b/x-pack/plugin/mapper-aggregate-metric/src/main/java/org/elasticsearch/xpack/aggregatemetric/mapper/AggregateDoubleMetricFieldMapper.java @@ -17,8 +17,6 @@ import org.apache.lucene.util.NumericUtils; import org.elasticsearch.common.time.DateMathParser; import org.elasticsearch.common.util.BigArrays; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentSubParser; import org.elasticsearch.index.fielddata.IndexFieldData; import org.elasticsearch.index.fielddata.ScriptDocValues; import org.elasticsearch.index.fielddata.SortedBinaryDocValues; @@ -43,6 +41,8 @@ import org.elasticsearch.search.lookup.SearchLookup; import org.elasticsearch.search.sort.BucketedSort; import org.elasticsearch.search.sort.SortOrder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentSubParser; import org.elasticsearch.xpack.aggregatemetric.aggregations.support.AggregateMetricsValuesSourceType; import org.elasticsearch.xpack.aggregatemetric.fielddata.IndexAggregateDoubleMetricFieldData; import org.elasticsearch.xpack.aggregatemetric.fielddata.LeafAggregateDoubleMetricFieldData; diff --git a/x-pack/plugin/mapper-aggregate-metric/src/test/java/org/elasticsearch/xpack/aggregatemetric/mapper/AggregateDoubleMetricFieldMapperTests.java b/x-pack/plugin/mapper-aggregate-metric/src/test/java/org/elasticsearch/xpack/aggregatemetric/mapper/AggregateDoubleMetricFieldMapperTests.java index d51ba6f638ddf..8d35fe260c879 100644 --- a/x-pack/plugin/mapper-aggregate-metric/src/test/java/org/elasticsearch/xpack/aggregatemetric/mapper/AggregateDoubleMetricFieldMapperTests.java +++ b/x-pack/plugin/mapper-aggregate-metric/src/test/java/org/elasticsearch/xpack/aggregatemetric/mapper/AggregateDoubleMetricFieldMapperTests.java @@ -8,8 +8,6 @@ import org.apache.lucene.search.DocValuesFieldExistsQuery; import org.apache.lucene.search.Query; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.LuceneDocument; import org.elasticsearch.index.mapper.MappedFieldType; @@ -19,6 +17,8 @@ import org.elasticsearch.index.mapper.MapperTestCase; import org.elasticsearch.index.mapper.ParsedDocument; import org.elasticsearch.plugins.Plugin; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.xpack.aggregatemetric.AggregateMetricMapperPlugin; import org.hamcrest.Matchers; diff --git a/x-pack/plugin/mapper-constant-keyword/src/internalClusterTest/java/org/elasticsearch/xpack/constantkeyword/mapper/ConstantKeywordFieldMapperTests.java b/x-pack/plugin/mapper-constant-keyword/src/internalClusterTest/java/org/elasticsearch/xpack/constantkeyword/mapper/ConstantKeywordFieldMapperTests.java index 9d1ada321b47f..55002f83201e2 100644 --- a/x-pack/plugin/mapper-constant-keyword/src/internalClusterTest/java/org/elasticsearch/xpack/constantkeyword/mapper/ConstantKeywordFieldMapperTests.java +++ b/x-pack/plugin/mapper-constant-keyword/src/internalClusterTest/java/org/elasticsearch/xpack/constantkeyword/mapper/ConstantKeywordFieldMapperTests.java @@ -12,7 +12,7 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.compress.CompressedXContent; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.LuceneDocument; import org.elasticsearch.index.mapper.MappedFieldType; diff --git a/x-pack/plugin/mapper-constant-keyword/src/main/java/org/elasticsearch/xpack/constantkeyword/mapper/ConstantKeywordFieldMapper.java b/x-pack/plugin/mapper-constant-keyword/src/main/java/org/elasticsearch/xpack/constantkeyword/mapper/ConstantKeywordFieldMapper.java index 86f0f8a3f30d1..c8acbc7237b35 100644 --- a/x-pack/plugin/mapper-constant-keyword/src/main/java/org/elasticsearch/xpack/constantkeyword/mapper/ConstantKeywordFieldMapper.java +++ b/x-pack/plugin/mapper-constant-keyword/src/main/java/org/elasticsearch/xpack/constantkeyword/mapper/ConstantKeywordFieldMapper.java @@ -24,7 +24,7 @@ import org.elasticsearch.common.regex.Regex; import org.elasticsearch.common.time.DateMathParser; import org.elasticsearch.common.unit.Fuzziness; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.fielddata.IndexFieldData; import org.elasticsearch.index.fielddata.plain.ConstantIndexFieldData; import org.elasticsearch.index.mapper.ConstantFieldType; diff --git a/x-pack/plugin/mapper-unsigned-long/src/main/java/org/elasticsearch/xpack/unsignedlong/UnsignedLongFieldMapper.java b/x-pack/plugin/mapper-unsigned-long/src/main/java/org/elasticsearch/xpack/unsignedlong/UnsignedLongFieldMapper.java index 36d995cdecaf8..fa00dec94f064 100644 --- a/x-pack/plugin/mapper-unsigned-long/src/main/java/org/elasticsearch/xpack/unsignedlong/UnsignedLongFieldMapper.java +++ b/x-pack/plugin/mapper-unsigned-long/src/main/java/org/elasticsearch/xpack/unsignedlong/UnsignedLongFieldMapper.java @@ -21,7 +21,6 @@ import org.apache.lucene.util.BytesRef; import org.elasticsearch.common.Explicit; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.fielddata.IndexFieldData; import org.elasticsearch.index.fielddata.IndexNumericFieldData; import org.elasticsearch.index.fielddata.plain.SortedNumericIndexFieldData; @@ -39,6 +38,7 @@ import org.elasticsearch.index.query.SearchExecutionContext; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.lookup.SearchLookup; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.math.BigDecimal; diff --git a/x-pack/plugin/mapper-unsigned-long/src/test/java/org/elasticsearch/xpack/unsignedlong/UnsignedLongFieldMapperTests.java b/x-pack/plugin/mapper-unsigned-long/src/test/java/org/elasticsearch/xpack/unsignedlong/UnsignedLongFieldMapperTests.java index bae306e7cc86e..04aef6e4c2f8d 100644 --- a/x-pack/plugin/mapper-unsigned-long/src/test/java/org/elasticsearch/xpack/unsignedlong/UnsignedLongFieldMapperTests.java +++ b/x-pack/plugin/mapper-unsigned-long/src/test/java/org/elasticsearch/xpack/unsignedlong/UnsignedLongFieldMapperTests.java @@ -10,7 +10,6 @@ import org.apache.lucene.index.DocValuesType; import org.apache.lucene.index.IndexableField; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.mapper.MapperParsingException; @@ -19,6 +18,7 @@ import org.elasticsearch.index.mapper.ParsedDocument; import org.elasticsearch.index.termvectors.TermVectorsService; import org.elasticsearch.plugins.Plugin; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.math.BigInteger; diff --git a/x-pack/plugin/mapper-unsigned-long/src/test/java/org/elasticsearch/xpack/unsignedlong/UnsignedLongTests.java b/x-pack/plugin/mapper-unsigned-long/src/test/java/org/elasticsearch/xpack/unsignedlong/UnsignedLongTests.java index df470c2575d21..4d36702a51083 100644 --- a/x-pack/plugin/mapper-unsigned-long/src/test/java/org/elasticsearch/xpack/unsignedlong/UnsignedLongTests.java +++ b/x-pack/plugin/mapper-unsigned-long/src/test/java/org/elasticsearch/xpack/unsignedlong/UnsignedLongTests.java @@ -35,7 +35,6 @@ import java.util.Collections; import java.util.List; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.search.aggregations.AggregationBuilders.histogram; import static org.elasticsearch.search.aggregations.AggregationBuilders.max; import static org.elasticsearch.search.aggregations.AggregationBuilders.min; @@ -43,6 +42,7 @@ import static org.elasticsearch.search.aggregations.AggregationBuilders.sum; import static org.elasticsearch.search.aggregations.AggregationBuilders.terms; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; diff --git a/x-pack/plugin/mapper-version/src/internalClusterTest/java/org/elasticsearch/xpack/versionfield/VersionFieldIT.java b/x-pack/plugin/mapper-version/src/internalClusterTest/java/org/elasticsearch/xpack/versionfield/VersionFieldIT.java index f7fbf9cc5b282..d84cd91d6d2e5 100644 --- a/x-pack/plugin/mapper-version/src/internalClusterTest/java/org/elasticsearch/xpack/versionfield/VersionFieldIT.java +++ b/x-pack/plugin/mapper-version/src/internalClusterTest/java/org/elasticsearch/xpack/versionfield/VersionFieldIT.java @@ -8,18 +8,18 @@ package org.elasticsearch.xpack.versionfield; import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.search.aggregations.AggregationBuilders; import org.elasticsearch.search.aggregations.bucket.terms.Terms; import org.elasticsearch.search.aggregations.bucket.terms.Terms.Bucket; import org.elasticsearch.test.ESIntegTestCase; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.xpack.core.LocalStateCompositeXPackPlugin; import java.util.Collection; import java.util.List; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; public class VersionFieldIT extends ESIntegTestCase { diff --git a/x-pack/plugin/mapper-version/src/main/java/org/elasticsearch/xpack/versionfield/VersionStringFieldMapper.java b/x-pack/plugin/mapper-version/src/main/java/org/elasticsearch/xpack/versionfield/VersionStringFieldMapper.java index e692accff16b9..fa8a692749b25 100644 --- a/x-pack/plugin/mapper-version/src/main/java/org/elasticsearch/xpack/versionfield/VersionStringFieldMapper.java +++ b/x-pack/plugin/mapper-version/src/main/java/org/elasticsearch/xpack/versionfield/VersionStringFieldMapper.java @@ -30,7 +30,6 @@ import org.elasticsearch.common.lucene.BytesRefs; import org.elasticsearch.common.lucene.Lucene; import org.elasticsearch.common.unit.Fuzziness; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.core.Nullable; import org.elasticsearch.index.fielddata.IndexFieldData; import org.elasticsearch.index.fielddata.plain.SortedSetOrdinalsIndexFieldData; @@ -48,6 +47,7 @@ import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.support.CoreValuesSourceType; import org.elasticsearch.search.lookup.SearchLookup; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.versionfield.VersionEncoder.EncodedVersion; import java.io.IOException; diff --git a/x-pack/plugin/mapper-version/src/test/java/org/elasticsearch/xpack/versionfield/VersionStringFieldMapperTests.java b/x-pack/plugin/mapper-version/src/test/java/org/elasticsearch/xpack/versionfield/VersionStringFieldMapperTests.java index 84b1627361389..edd6510d54f00 100644 --- a/x-pack/plugin/mapper-version/src/test/java/org/elasticsearch/xpack/versionfield/VersionStringFieldMapperTests.java +++ b/x-pack/plugin/mapper-version/src/test/java/org/elasticsearch/xpack/versionfield/VersionStringFieldMapperTests.java @@ -13,9 +13,6 @@ import org.apache.lucene.index.IndexableFieldType; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.mapper.MapperParsingException; @@ -23,6 +20,9 @@ import org.elasticsearch.index.mapper.ParsedDocument; import org.elasticsearch.index.mapper.SourceToParse; import org.elasticsearch.plugins.Plugin; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.util.Collection; diff --git a/x-pack/plugin/mapper-version/src/test/java/org/elasticsearch/xpack/versionfield/VersionStringFieldTests.java b/x-pack/plugin/mapper-version/src/test/java/org/elasticsearch/xpack/versionfield/VersionStringFieldTests.java index 6178f91141c82..82d81e0c24f09 100644 --- a/x-pack/plugin/mapper-version/src/test/java/org/elasticsearch/xpack/versionfield/VersionStringFieldTests.java +++ b/x-pack/plugin/mapper-version/src/test/java/org/elasticsearch/xpack/versionfield/VersionStringFieldTests.java @@ -27,7 +27,7 @@ import java.util.Collection; import java.util.List; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; public class VersionStringFieldTests extends ESSingleNodeTestCase { diff --git a/x-pack/plugin/ml/qa/basic-multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/MlBasicMultiNodeIT.java b/x-pack/plugin/ml/qa/basic-multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/MlBasicMultiNodeIT.java index 72652a47c7556..9e870a900d5e5 100644 --- a/x-pack/plugin/ml/qa/basic-multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/MlBasicMultiNodeIT.java +++ b/x-pack/plugin/ml/qa/basic-multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/MlBasicMultiNodeIT.java @@ -13,7 +13,7 @@ import org.elasticsearch.client.Response; import org.elasticsearch.client.ResponseException; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.test.rest.ESRestTestCase; import org.yaml.snakeyaml.util.UriEncoder; @@ -24,7 +24,7 @@ import java.util.List; import java.util.Map; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasEntry; import static org.hamcrest.Matchers.is; diff --git a/x-pack/plugin/ml/qa/disabled/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/MlPluginDisabledIT.java b/x-pack/plugin/ml/qa/disabled/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/MlPluginDisabledIT.java index 2a42824ba967e..93c11bb1ccb56 100644 --- a/x-pack/plugin/ml/qa/disabled/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/MlPluginDisabledIT.java +++ b/x-pack/plugin/ml/qa/disabled/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/MlPluginDisabledIT.java @@ -9,10 +9,10 @@ import org.elasticsearch.client.Request; import org.elasticsearch.client.ResponseException; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.test.rest.ESRestTestCase; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.containsString; public class MlPluginDisabledIT extends ESRestTestCase { diff --git a/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/CategorizationIT.java b/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/CategorizationIT.java index f7cd5f14a2d6c..94f9374c96ee7 100644 --- a/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/CategorizationIT.java +++ b/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/CategorizationIT.java @@ -13,11 +13,11 @@ import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.action.support.WriteRequest; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.search.SearchHit; import org.elasticsearch.xpack.core.ml.datafeed.DatafeedConfig; diff --git a/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/ClassificationIT.java b/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/ClassificationIT.java index e67d7a3b7f35c..0119b703638a4 100644 --- a/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/ClassificationIT.java +++ b/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/ClassificationIT.java @@ -22,7 +22,7 @@ import org.elasticsearch.common.collect.MapBuilder; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.rest.RestStatus; diff --git a/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/DataFrameAnalysisCustomFeatureIT.java b/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/DataFrameAnalysisCustomFeatureIT.java index c4da2e83758ae..8876ed5800cc2 100644 --- a/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/DataFrameAnalysisCustomFeatureIT.java +++ b/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/DataFrameAnalysisCustomFeatureIT.java @@ -17,7 +17,7 @@ import org.elasticsearch.action.support.WriteRequest; import org.elasticsearch.common.collect.MapBuilder; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.SearchModule; diff --git a/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/DeleteExpiredDataIT.java b/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/DeleteExpiredDataIT.java index c29aeb9aa4d0e..a284843a307cd 100644 --- a/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/DeleteExpiredDataIT.java +++ b/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/DeleteExpiredDataIT.java @@ -18,11 +18,11 @@ import org.elasticsearch.action.update.UpdateAction; import org.elasticsearch.action.update.UpdateRequest; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.search.SearchHit; diff --git a/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/DeleteJobIT.java b/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/DeleteJobIT.java index 458d1acc3292a..e5845172a079a 100644 --- a/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/DeleteJobIT.java +++ b/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/DeleteJobIT.java @@ -9,9 +9,9 @@ import org.elasticsearch.action.index.IndexRequest; import org.elasticsearch.action.support.WriteRequest; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.xpack.core.ml.annotations.Annotation; import org.elasticsearch.xpack.core.ml.annotations.AnnotationIndex; import org.elasticsearch.xpack.core.ml.datafeed.DatafeedConfig; diff --git a/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/InferenceIngestIT.java b/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/InferenceIngestIT.java index cb54bd9e7725f..b4f423effc375 100644 --- a/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/InferenceIngestIT.java +++ b/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/InferenceIngestIT.java @@ -15,13 +15,13 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.test.ExternalTestCluster; diff --git a/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/MlNativeAutodetectIntegTestCase.java b/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/MlNativeAutodetectIntegTestCase.java index a16b7cd92fdd5..73bab18e0458d 100644 --- a/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/MlNativeAutodetectIntegTestCase.java +++ b/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/MlNativeAutodetectIntegTestCase.java @@ -13,12 +13,12 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.SearchHits; @@ -76,7 +76,7 @@ import java.util.concurrent.TimeUnit; import java.util.function.Function; -import static org.elasticsearch.common.xcontent.json.JsonXContent.jsonXContent; +import static org.elasticsearch.xcontent.json.JsonXContent.jsonXContent; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasSize; import static org.hamcrest.Matchers.in; diff --git a/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/MlNativeIntegTestCase.java b/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/MlNativeIntegTestCase.java index e74a097783f8d..0d12b24db03d9 100644 --- a/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/MlNativeIntegTestCase.java +++ b/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/MlNativeIntegTestCase.java @@ -29,7 +29,7 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.env.Environment; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.reindex.ReindexPlugin; diff --git a/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/ModelSnapshotRetentionIT.java b/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/ModelSnapshotRetentionIT.java index 799514842b1df..b028f117827e6 100644 --- a/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/ModelSnapshotRetentionIT.java +++ b/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/ModelSnapshotRetentionIT.java @@ -22,9 +22,9 @@ import org.elasticsearch.action.support.master.MasterNodeRequest; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.indices.TestIndexNameExpressionResolver; diff --git a/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/RegressionIT.java b/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/RegressionIT.java index 41de287bae325..97d3e2e2491af 100644 --- a/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/RegressionIT.java +++ b/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/RegressionIT.java @@ -16,7 +16,7 @@ import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.action.support.WriteRequest; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.SearchModule; diff --git a/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/RevertModelSnapshotIT.java b/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/RevertModelSnapshotIT.java index 68dc3aea8ceee..0ec7596557bd3 100644 --- a/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/RevertModelSnapshotIT.java +++ b/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/RevertModelSnapshotIT.java @@ -11,11 +11,11 @@ import org.elasticsearch.action.support.WriteRequest; import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.search.SearchHits; diff --git a/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/RunDataFrameAnalyticsIT.java b/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/RunDataFrameAnalyticsIT.java index 1777c9d8ee604..df3d297bfc7cd 100644 --- a/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/RunDataFrameAnalyticsIT.java +++ b/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/RunDataFrameAnalyticsIT.java @@ -15,7 +15,7 @@ import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.action.support.WriteRequest; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.search.SearchHit; diff --git a/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/TestFeatureResetIT.java b/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/TestFeatureResetIT.java index 70ad971869f23..10dd627c974f4 100644 --- a/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/TestFeatureResetIT.java +++ b/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/TestFeatureResetIT.java @@ -16,7 +16,7 @@ import org.elasticsearch.action.support.WriteRequest; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.common.bytes.BytesArray; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.tasks.TaskInfo; import org.elasticsearch.xpack.core.ml.MlMetadata; import org.elasticsearch.xpack.core.ml.action.PutDataFrameAnalyticsAction; diff --git a/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/TrainedModelIT.java b/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/TrainedModelIT.java index 41b3dddea9a29..fe0b2878a6513 100644 --- a/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/TrainedModelIT.java +++ b/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/TrainedModelIT.java @@ -24,12 +24,12 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.SecuritySettingsSourceField; import org.elasticsearch.test.rest.ESRestTestCase; import org.elasticsearch.xpack.core.ml.inference.persistence.InferenceIndexConstants; diff --git a/x-pack/plugin/ml/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/transforms/PainlessDomainSplitIT.java b/x-pack/plugin/ml/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/transforms/PainlessDomainSplitIT.java index ed17bbf16d669..32e4bd9ab4712 100644 --- a/x-pack/plugin/ml/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/transforms/PainlessDomainSplitIT.java +++ b/x-pack/plugin/ml/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/transforms/PainlessDomainSplitIT.java @@ -24,7 +24,7 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; diff --git a/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/license/MachineLearningLicensingIT.java b/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/license/MachineLearningLicensingIT.java index 9722cf03f35cf..ed77b0a6d717d 100644 --- a/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/license/MachineLearningLicensingIT.java +++ b/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/license/MachineLearningLicensingIT.java @@ -22,7 +22,7 @@ import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.TimeValue; import org.elasticsearch.license.License.OperationMode; import org.elasticsearch.persistent.PersistentTasksCustomMetadata; diff --git a/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/AnomalyJobCRUDIT.java b/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/AnomalyJobCRUDIT.java index ef430554946a0..c870668b83ce2 100644 --- a/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/AnomalyJobCRUDIT.java +++ b/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/AnomalyJobCRUDIT.java @@ -27,7 +27,7 @@ import org.elasticsearch.cluster.service.MasterService; import org.elasticsearch.common.settings.ClusterSettings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.xpack.core.ml.action.GetModelSnapshotsAction; import org.elasticsearch.xpack.core.ml.action.OpenJobAction; diff --git a/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/AutodetectResultProcessorIT.java b/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/AutodetectResultProcessorIT.java index faddc32bbe3d2..4b23426a2c675 100644 --- a/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/AutodetectResultProcessorIT.java +++ b/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/AutodetectResultProcessorIT.java @@ -25,8 +25,8 @@ import org.elasticsearch.common.settings.ClusterSettings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.reindex.ReindexPlugin; import org.elasticsearch.indices.TestIndexNameExpressionResolver; import org.elasticsearch.ingest.common.IngestCommonPlugin; @@ -98,7 +98,7 @@ import java.util.concurrent.atomic.AtomicReference; import static java.util.stream.Collectors.toList; -import static org.elasticsearch.common.xcontent.json.JsonXContent.jsonXContent; +import static org.elasticsearch.xcontent.json.JsonXContent.jsonXContent; import static org.elasticsearch.xpack.core.ml.job.persistence.AnomalyDetectorsIndex.createStateIndexAndAliasIfNecessary; import static org.hamcrest.Matchers.closeTo; import static org.hamcrest.Matchers.contains; diff --git a/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/BasicDistributedJobsIT.java b/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/BasicDistributedJobsIT.java index d24468b8ee1ad..8a75d4fa28a29 100644 --- a/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/BasicDistributedJobsIT.java +++ b/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/BasicDistributedJobsIT.java @@ -31,7 +31,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.persistent.PersistentTasksCustomMetadata; import org.elasticsearch.persistent.PersistentTasksCustomMetadata.PersistentTask; import org.elasticsearch.search.aggregations.AggregationBuilders; diff --git a/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/ChunkedTrainedModelRestorerIT.java b/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/ChunkedTrainedModelRestorerIT.java index 6919812c3000c..80f2481a80959 100644 --- a/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/ChunkedTrainedModelRestorerIT.java +++ b/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/ChunkedTrainedModelRestorerIT.java @@ -14,9 +14,9 @@ import org.elasticsearch.action.support.WriteRequest; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.xpack.core.ml.inference.TrainedModelConfig; import org.elasticsearch.xpack.core.ml.inference.persistence.InferenceIndexConstants; import org.elasticsearch.xpack.ml.MachineLearning; diff --git a/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/DataFrameAnalyticsCRUDIT.java b/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/DataFrameAnalyticsCRUDIT.java index 632f7a520f881..abd11ad6880d5 100644 --- a/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/DataFrameAnalyticsCRUDIT.java +++ b/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/DataFrameAnalyticsCRUDIT.java @@ -9,7 +9,7 @@ import org.elasticsearch.ResourceNotFoundException; import org.elasticsearch.client.OriginSettingClient; import org.elasticsearch.cluster.service.ClusterService; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.TimeValue; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.xpack.core.ClientHelper; diff --git a/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/JobResultsProviderIT.java b/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/JobResultsProviderIT.java index 43781ada934e2..fdf6bf647b60c 100644 --- a/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/JobResultsProviderIT.java +++ b/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/JobResultsProviderIT.java @@ -34,10 +34,10 @@ import org.elasticsearch.common.settings.ClusterSettings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.indices.TestIndexNameExpressionResolver; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.xpack.core.ClientHelper; diff --git a/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/MlAutoUpdateServiceIT.java b/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/MlAutoUpdateServiceIT.java index da9c922ef043a..5830a35e0d36d 100644 --- a/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/MlAutoUpdateServiceIT.java +++ b/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/MlAutoUpdateServiceIT.java @@ -16,7 +16,7 @@ import org.elasticsearch.cluster.node.DiscoveryNodeRole; import org.elasticsearch.cluster.node.DiscoveryNodes; import org.elasticsearch.common.transport.TransportAddress; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.indices.TestIndexNameExpressionResolver; import org.elasticsearch.xpack.core.ml.MlConfigIndex; import org.elasticsearch.xpack.core.ml.datafeed.DatafeedConfig; diff --git a/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/MlConfigMigratorIT.java b/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/MlConfigMigratorIT.java index c487e565963f3..f81bb8f6e4d73 100644 --- a/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/MlConfigMigratorIT.java +++ b/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/MlConfigMigratorIT.java @@ -31,9 +31,9 @@ import org.elasticsearch.common.settings.ClusterSettings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.Index; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.index.shard.ShardId; diff --git a/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/MlDistributedFailureIT.java b/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/MlDistributedFailureIT.java index 412e3491c5097..03c86adaeca4f 100644 --- a/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/MlDistributedFailureIT.java +++ b/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/MlDistributedFailureIT.java @@ -21,14 +21,14 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.core.CheckedRunnable; import org.elasticsearch.core.TimeValue; import org.elasticsearch.index.query.QueryBuilders; diff --git a/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/PyTorchStateStreamerIT.java b/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/PyTorchStateStreamerIT.java index 89c8e78f492e6..df82dc1e7614d 100644 --- a/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/PyTorchStateStreamerIT.java +++ b/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/PyTorchStateStreamerIT.java @@ -12,9 +12,9 @@ import org.elasticsearch.action.bulk.BulkResponse; import org.elasticsearch.action.index.IndexRequestBuilder; import org.elasticsearch.action.support.WriteRequest; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.xpack.core.ml.inference.TrainedModelConfig; import org.elasticsearch.xpack.core.ml.inference.persistence.InferenceIndexConstants; import org.elasticsearch.xpack.ml.MachineLearning; diff --git a/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/TestFeatureLicenseTrackingIT.java b/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/TestFeatureLicenseTrackingIT.java index 3b6f2fd184e4f..fd436d9412f5a 100644 --- a/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/TestFeatureLicenseTrackingIT.java +++ b/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/TestFeatureLicenseTrackingIT.java @@ -13,7 +13,7 @@ import org.elasticsearch.action.ingest.PutPipelineAction; import org.elasticsearch.action.ingest.PutPipelineRequest; import org.elasticsearch.common.bytes.BytesArray; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.license.GetFeatureUsageRequest; import org.elasticsearch.license.GetFeatureUsageResponse; import org.elasticsearch.license.TransportGetFeatureUsageAction; diff --git a/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/TrainedModelProviderIT.java b/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/TrainedModelProviderIT.java index 713b3412a8b4b..de5273851aeff 100644 --- a/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/TrainedModelProviderIT.java +++ b/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/TrainedModelProviderIT.java @@ -15,9 +15,9 @@ import org.elasticsearch.action.index.IndexResponse; import org.elasticsearch.action.support.WriteRequest; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.license.License; import org.elasticsearch.xpack.core.ml.action.GetTrainedModelsAction; import org.elasticsearch.xpack.core.ml.inference.TrainedModelConfig; diff --git a/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/UnusedStatsRemoverIT.java b/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/UnusedStatsRemoverIT.java index edd80d0c7881d..48b013613d7cb 100644 --- a/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/UnusedStatsRemoverIT.java +++ b/x-pack/plugin/ml/src/internalClusterTest/java/org/elasticsearch/xpack/ml/integration/UnusedStatsRemoverIT.java @@ -12,11 +12,11 @@ import org.elasticsearch.action.support.master.MasterNodeRequest; import org.elasticsearch.client.OriginSettingClient; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.indices.TestIndexNameExpressionResolver; import org.elasticsearch.tasks.TaskId; import org.elasticsearch.xpack.core.ClientHelper; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/MachineLearning.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/MachineLearning.java index 970f856ce5142..bf3b71b0eb93d 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/MachineLearning.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/MachineLearning.java @@ -31,7 +31,7 @@ import org.elasticsearch.cluster.node.DiscoveryNodes; import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.collect.MapBuilder; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.breaker.CircuitBreaker; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.settings.ClusterSettings; @@ -44,7 +44,7 @@ import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.concurrent.EsExecutors; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.env.Environment; import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.index.analysis.CharFilterFactory; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/MlConfigMigrator.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/MlConfigMigrator.java index ac72d3a9b050b..0b65b1593f6c7 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/MlConfigMigrator.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/MlConfigMigrator.java @@ -30,10 +30,10 @@ import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.EsExecutors; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.index.engine.VersionConflictEngineException; import org.elasticsearch.persistent.PersistentTasksCustomMetadata; import org.elasticsearch.xpack.core.ml.MlConfigIndex; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/MlIndexTemplateRegistry.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/MlIndexTemplateRegistry.java index 00b8d3042f4b5..83d67d02429cb 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/MlIndexTemplateRegistry.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/MlIndexTemplateRegistry.java @@ -10,7 +10,7 @@ import org.elasticsearch.client.Client; import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.xpack.core.ClientHelper; import org.elasticsearch.xpack.core.ml.MlStatsIndex; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportGetDataFrameAnalyticsAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportGetDataFrameAnalyticsAction.java index e450c5ebf1936..ae8b8c9f57fed 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportGetDataFrameAnalyticsAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportGetDataFrameAnalyticsAction.java @@ -11,10 +11,10 @@ import org.elasticsearch.action.support.ActionFilters; import org.elasticsearch.client.Client; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.inject.Inject; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.tasks.Task; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportGetFiltersAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportGetFiltersAction.java index 16010396202b7..2e8cba210ff4e 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportGetFiltersAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportGetFiltersAction.java @@ -10,10 +10,10 @@ import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.support.ActionFilters; import org.elasticsearch.client.Client; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.inject.Inject; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.tasks.Task; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportMlInfoAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportMlInfoAction.java index 245ce6e25fa5d..5fd68664dce27 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportMlInfoAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportMlInfoAction.java @@ -18,7 +18,7 @@ import org.elasticsearch.common.settings.ClusterSettings; import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.tasks.Task; import org.elasticsearch.transport.TransportService; import org.elasticsearch.xpack.core.ml.MachineLearningField; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportPostCalendarEventsAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportPostCalendarEventsAction.java index 7ace678151968..291c248855a3a 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportPostCalendarEventsAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportPostCalendarEventsAction.java @@ -16,9 +16,9 @@ import org.elasticsearch.action.support.WriteRequest; import org.elasticsearch.client.Client; import org.elasticsearch.common.inject.Inject; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.tasks.Task; import org.elasticsearch.transport.TransportService; import org.elasticsearch.xpack.core.ml.MlMetaIndex; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportPreviewDatafeedAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportPreviewDatafeedAction.java index baa896d23de32..5e5fd5d73cc4c 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportPreviewDatafeedAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportPreviewDatafeedAction.java @@ -17,7 +17,7 @@ import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.time.DateUtils; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.index.mapper.DateFieldMapper; import org.elasticsearch.tasks.Task; import org.elasticsearch.threadpool.ThreadPool; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportPutCalendarAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportPutCalendarAction.java index 42b6ad5c6fa1f..19f447d471577 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportPutCalendarAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportPutCalendarAction.java @@ -16,9 +16,9 @@ import org.elasticsearch.action.support.WriteRequest; import org.elasticsearch.client.Client; import org.elasticsearch.common.inject.Inject; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.index.engine.VersionConflictEngineException; import org.elasticsearch.tasks.Task; import org.elasticsearch.transport.TransportService; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportPutDataFrameAnalyticsAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportPutDataFrameAnalyticsAction.java index 6d6055e1f986a..2c634b85dce12 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportPutDataFrameAnalyticsAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportPutDataFrameAnalyticsAction.java @@ -22,8 +22,8 @@ import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.core.TimeValue; import org.elasticsearch.license.License; import org.elasticsearch.license.LicenseUtils; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportPutFilterAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportPutFilterAction.java index 09638234dbc17..5bf20c047d517 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportPutFilterAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportPutFilterAction.java @@ -17,9 +17,9 @@ import org.elasticsearch.action.support.WriteRequest; import org.elasticsearch.client.Client; import org.elasticsearch.common.inject.Inject; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.index.engine.VersionConflictEngineException; import org.elasticsearch.tasks.Task; import org.elasticsearch.transport.TransportService; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportPutTrainedModelAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportPutTrainedModelAction.java index 8101946471fb5..b8f5076e75e3b 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportPutTrainedModelAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportPutTrainedModelAction.java @@ -25,7 +25,7 @@ import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.license.License; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportStartDatafeedAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportStartDatafeedAction.java index 731d7d307b8b3..44249e8661eba 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportStartDatafeedAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportStartDatafeedAction.java @@ -28,7 +28,7 @@ import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.license.LicenseUtils; import org.elasticsearch.license.RemoteClusterLicenseChecker; import org.elasticsearch.license.XPackLicenseState; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportStartTrainedModelDeploymentAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportStartTrainedModelDeploymentAction.java index de0bcf8c6f9f0..d97bc0865029e 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportStartTrainedModelDeploymentAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportStartTrainedModelDeploymentAction.java @@ -26,7 +26,7 @@ import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.core.TimeValue; import org.elasticsearch.license.LicenseUtils; import org.elasticsearch.license.XPackLicenseState; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportUpdateFilterAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportUpdateFilterAction.java index 46817cf38d5b1..457d1ebeeb03e 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportUpdateFilterAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportUpdateFilterAction.java @@ -22,12 +22,12 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.engine.VersionConflictEngineException; import org.elasticsearch.tasks.Task; import org.elasticsearch.transport.TransportService; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportUpdateModelSnapshotAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportUpdateModelSnapshotAction.java index fa224594fe071..aaf0e2141c89c 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportUpdateModelSnapshotAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportUpdateModelSnapshotAction.java @@ -19,9 +19,9 @@ import org.elasticsearch.action.support.WriteRequest; import org.elasticsearch.client.Client; import org.elasticsearch.common.inject.Inject; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.tasks.Task; import org.elasticsearch.transport.TransportService; import org.elasticsearch.xpack.core.ml.action.UpdateModelSnapshotAction; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/categorization/CategorizeTextAggregationBuilder.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/categorization/CategorizeTextAggregationBuilder.java index e84167fd1d0a9..d2987ffd33356 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/categorization/CategorizeTextAggregationBuilder.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/categorization/CategorizeTextAggregationBuilder.java @@ -9,10 +9,10 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.aggregations.AbstractAggregationBuilder; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.AggregatorFactories; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/categorization/InternalCategorizationAggregation.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/categorization/InternalCategorizationAggregation.java index 92c51b8d75b4c..5f672b0ace66c 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/categorization/InternalCategorizationAggregation.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/categorization/InternalCategorizationAggregation.java @@ -13,8 +13,8 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.util.BytesRefHash; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.search.aggregations.AggregationExecutionException; import org.elasticsearch.search.aggregations.Aggregations; import org.elasticsearch.search.aggregations.InternalAggregation; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/correlation/BucketCorrelationAggregationBuilder.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/correlation/BucketCorrelationAggregationBuilder.java index 78262e02c7f5d..c7c4c671b2364 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/correlation/BucketCorrelationAggregationBuilder.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/correlation/BucketCorrelationAggregationBuilder.java @@ -7,13 +7,13 @@ package org.elasticsearch.xpack.ml.aggs.correlation; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.plugins.SearchPlugin; import org.elasticsearch.search.aggregations.pipeline.BucketHelpers; import org.elasticsearch.search.aggregations.pipeline.BucketMetricsPipelineAggregationBuilder; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/correlation/CorrelationNamedContentProvider.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/correlation/CorrelationNamedContentProvider.java index c9ce91be01d1f..41e3a4ea2066e 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/correlation/CorrelationNamedContentProvider.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/correlation/CorrelationNamedContentProvider.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.ml.aggs.correlation; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.plugins.spi.NamedXContentProvider; import java.util.Arrays; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/correlation/CountCorrelationFunction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/correlation/CountCorrelationFunction.java index 55c103fec5b98..021328cc3a419 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/correlation/CountCorrelationFunction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/correlation/CountCorrelationFunction.java @@ -7,12 +7,12 @@ package org.elasticsearch.xpack.ml.aggs.correlation; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.aggregations.AggregationExecutionException; import org.elasticsearch.search.aggregations.PipelineAggregationBuilder; import org.elasticsearch.search.aggregations.pipeline.MovingFunctions; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/correlation/CountCorrelationIndicator.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/correlation/CountCorrelationIndicator.java index f1da918c62815..4bf5b80766203 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/correlation/CountCorrelationIndicator.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/correlation/CountCorrelationIndicator.java @@ -7,15 +7,15 @@ package org.elasticsearch.xpack.ml.aggs.correlation; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Arrays; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/heuristic/PValueScore.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/heuristic/PValueScore.java index f365e4758cc94..51d9f5ee54682 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/heuristic/PValueScore.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/heuristic/PValueScore.java @@ -12,16 +12,16 @@ import org.apache.commons.math3.util.FastMath; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.aggregations.AggregationExecutionException; import org.elasticsearch.search.aggregations.bucket.terms.heuristic.NXYSignificanceHeuristic; import org.elasticsearch.search.aggregations.bucket.terms.heuristic.SignificanceHeuristic; import java.io.IOException; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class PValueScore extends NXYSignificanceHeuristic { public static final String NAME = "p_value"; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/inference/InferencePipelineAggregationBuilder.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/inference/InferencePipelineAggregationBuilder.java index 8550eff30248c..24b1f1f4af173 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/inference/InferencePipelineAggregationBuilder.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/inference/InferencePipelineAggregationBuilder.java @@ -10,15 +10,15 @@ import org.apache.lucene.util.SetOnce; import org.elasticsearch.action.ActionListener; import org.elasticsearch.client.Client; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ContextParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ContextParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.query.QueryRewriteContext; import org.elasticsearch.license.LicenseUtils; import org.elasticsearch.license.XPackLicenseState; @@ -49,7 +49,7 @@ import java.util.function.BiConsumer; import java.util.function.Supplier; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; import static org.elasticsearch.xpack.ml.utils.SecondaryAuthorizationUtils.useSecondaryAuthIfAvailable; public class InferencePipelineAggregationBuilder extends AbstractPipelineAggregationBuilder { diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/inference/InternalInferenceAggregation.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/inference/InternalInferenceAggregation.java index 17704a7611cac..57ea71b3ea32f 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/inference/InternalInferenceAggregation.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/inference/InternalInferenceAggregation.java @@ -9,7 +9,7 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.search.aggregations.InternalAggregation; import org.elasticsearch.xpack.core.ml.inference.results.InferenceResults; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/kstest/BucketCountKSTestAggregationBuilder.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/kstest/BucketCountKSTestAggregationBuilder.java index 6a960c89f89ba..e5435d3ce2b51 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/kstest/BucketCountKSTestAggregationBuilder.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/kstest/BucketCountKSTestAggregationBuilder.java @@ -8,13 +8,13 @@ package org.elasticsearch.xpack.ml.aggs.kstest; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.plugins.SearchPlugin; import org.elasticsearch.search.aggregations.pipeline.BucketHelpers; import org.elasticsearch.search.aggregations.pipeline.BucketMetricsPipelineAggregationBuilder; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/kstest/InternalKSTestAggregation.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/kstest/InternalKSTestAggregation.java index f6659409f4a9c..92c273c947713 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/kstest/InternalKSTestAggregation.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/kstest/InternalKSTestAggregation.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.ml.aggs.kstest; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.search.aggregations.InternalAggregation; import java.io.IOException; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/annotations/AnnotationPersister.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/annotations/AnnotationPersister.java index 280d04d8e24da..d7e3c19656d9b 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/annotations/AnnotationPersister.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/annotations/AnnotationPersister.java @@ -14,9 +14,9 @@ import org.elasticsearch.action.index.IndexRequest; import org.elasticsearch.core.Nullable; import org.elasticsearch.core.Tuple; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.xpack.core.ml.annotations.Annotation; import org.elasticsearch.xpack.core.ml.annotations.AnnotationIndex; import org.elasticsearch.xpack.ml.utils.persistence.ResultsPersisterService; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/autoscaling/MlScalingReason.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/autoscaling/MlScalingReason.java index ec0e0e6ce0335..e5861de515957 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/autoscaling/MlScalingReason.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/autoscaling/MlScalingReason.java @@ -11,7 +11,7 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.autoscaling.capacity.AutoscalingCapacity; import org.elasticsearch.xpack.autoscaling.capacity.AutoscalingDeciderResult; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/DatafeedJob.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/DatafeedJob.java index fe6c5f61f60a7..4fb0d3a523285 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/DatafeedJob.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/DatafeedJob.java @@ -18,7 +18,7 @@ import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.concurrent.ThreadContext; import org.elasticsearch.common.xcontent.XContentElasticsearchExtension; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.mapper.DateFieldMapper; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.xpack.core.ml.action.FlushJobAction; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/DatafeedJobBuilder.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/DatafeedJobBuilder.java index 3889fc1982618..a68f896db2245 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/DatafeedJobBuilder.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/DatafeedJobBuilder.java @@ -13,7 +13,7 @@ import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.license.RemoteClusterLicenseChecker; import org.elasticsearch.xpack.core.ml.datafeed.DatafeedConfig; import org.elasticsearch.xpack.core.ml.datafeed.DatafeedJobValidator; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/DatafeedManager.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/DatafeedManager.java index f42c0fc7afa8e..216d8b2a04a37 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/DatafeedManager.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/DatafeedManager.java @@ -18,9 +18,9 @@ import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.core.CheckedConsumer; import org.elasticsearch.core.Nullable; import org.elasticsearch.index.IndexNotFoundException; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/delayeddatacheck/DelayedDataDetectorFactory.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/delayeddatacheck/DelayedDataDetectorFactory.java index 3211579bd58ff..341fb56563bd7 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/delayeddatacheck/DelayedDataDetectorFactory.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/delayeddatacheck/DelayedDataDetectorFactory.java @@ -8,7 +8,7 @@ import org.elasticsearch.client.Client; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.xpack.core.ml.datafeed.DatafeedConfig; import org.elasticsearch.xpack.core.ml.datafeed.DelayedDataCheckConfig; import org.elasticsearch.xpack.core.ml.job.config.Job; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/extractor/DataExtractorFactory.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/extractor/DataExtractorFactory.java index 3fc779bd36b5f..11e0f886b5993 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/extractor/DataExtractorFactory.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/extractor/DataExtractorFactory.java @@ -10,7 +10,7 @@ import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.client.Client; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.license.RemoteClusterLicenseChecker; import org.elasticsearch.xpack.core.ClientHelper; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/extractor/aggregation/AggregationDataExtractorFactory.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/extractor/aggregation/AggregationDataExtractorFactory.java index c4a6d5a866e44..3bc294be358aa 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/extractor/aggregation/AggregationDataExtractorFactory.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/extractor/aggregation/AggregationDataExtractorFactory.java @@ -10,7 +10,7 @@ import org.elasticsearch.action.search.SearchRequestBuilder; import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.client.Client; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.xpack.core.ml.datafeed.DatafeedConfig; import org.elasticsearch.xpack.core.ml.datafeed.extractor.DataExtractor; import org.elasticsearch.xpack.core.ml.job.config.Job; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/extractor/aggregation/AggregationToJsonProcessor.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/extractor/aggregation/AggregationToJsonProcessor.java index a5f963c26b640..f3a73005a8433 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/extractor/aggregation/AggregationToJsonProcessor.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/extractor/aggregation/AggregationToJsonProcessor.java @@ -11,8 +11,8 @@ import org.apache.logging.log4j.message.ParameterizedMessage; import org.elasticsearch.core.Nullable; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.search.aggregations.Aggregation; import org.elasticsearch.search.aggregations.Aggregations; import org.elasticsearch.search.aggregations.bucket.MultiBucketsAggregation; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/extractor/aggregation/CompositeAggregationDataExtractorFactory.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/extractor/aggregation/CompositeAggregationDataExtractorFactory.java index be423ec6cdfc1..df86b8b0f498d 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/extractor/aggregation/CompositeAggregationDataExtractorFactory.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/extractor/aggregation/CompositeAggregationDataExtractorFactory.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.ml.datafeed.extractor.aggregation; import org.elasticsearch.client.Client; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.PipelineAggregationBuilder; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/extractor/aggregation/RollupDataExtractorFactory.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/extractor/aggregation/RollupDataExtractorFactory.java index 35c66f83128d4..e97e6ef896362 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/extractor/aggregation/RollupDataExtractorFactory.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/extractor/aggregation/RollupDataExtractorFactory.java @@ -11,7 +11,7 @@ import org.elasticsearch.action.search.SearchRequest; import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.client.Client; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramAggregationBuilder; import org.elasticsearch.search.aggregations.bucket.histogram.HistogramAggregationBuilder; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/extractor/chunked/ChunkedDataExtractorFactory.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/extractor/chunked/ChunkedDataExtractorFactory.java index 2fc5baca92637..85a2e6bb78fae 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/extractor/chunked/ChunkedDataExtractorFactory.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/extractor/chunked/ChunkedDataExtractorFactory.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.ml.datafeed.extractor.chunked; import org.elasticsearch.client.Client; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.xpack.core.ml.datafeed.DatafeedConfig; import org.elasticsearch.xpack.core.ml.datafeed.extractor.DataExtractor; import org.elasticsearch.xpack.ml.datafeed.DatafeedTimingStatsReporter; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/extractor/scroll/ScrollDataExtractorFactory.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/extractor/scroll/ScrollDataExtractorFactory.java index ee22fc7fbb25a..5966486dd5c14 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/extractor/scroll/ScrollDataExtractorFactory.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/extractor/scroll/ScrollDataExtractorFactory.java @@ -12,7 +12,7 @@ import org.elasticsearch.action.fieldcaps.FieldCapabilitiesRequest; import org.elasticsearch.action.fieldcaps.FieldCapabilitiesResponse; import org.elasticsearch.client.Client; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.xpack.core.ClientHelper; import org.elasticsearch.xpack.core.ml.datafeed.DatafeedConfig; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/extractor/scroll/SearchHitToJsonProcessor.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/extractor/scroll/SearchHitToJsonProcessor.java index 4267b78109528..eccadc58cba0f 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/extractor/scroll/SearchHitToJsonProcessor.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/extractor/scroll/SearchHitToJsonProcessor.java @@ -7,8 +7,8 @@ package org.elasticsearch.xpack.ml.datafeed.extractor.scroll; import org.elasticsearch.core.Releasable; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.search.SearchHit; import org.elasticsearch.xpack.ml.extractor.ExtractedField; import org.elasticsearch.xpack.ml.extractor.ExtractedFields; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/persistence/DatafeedConfigProvider.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/persistence/DatafeedConfigProvider.java index 96034a4b81f01..7e4ae0ebea54f 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/persistence/DatafeedConfigProvider.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/persistence/DatafeedConfigProvider.java @@ -30,12 +30,12 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.regex.Regex; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.index.engine.VersionConflictEngineException; import org.elasticsearch.index.query.BoolQueryBuilder; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/DataFrameAnalyticsTask.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/DataFrameAnalyticsTask.java index 8c85ea5ea2eb0..e5875d1948bca 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/DataFrameAnalyticsTask.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/DataFrameAnalyticsTask.java @@ -22,8 +22,8 @@ import org.elasticsearch.client.ParentTaskAssigningClient; import org.elasticsearch.core.Nullable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.query.IdsQueryBuilder; import org.elasticsearch.license.LicensedAllocatedPersistentTask; import org.elasticsearch.license.XPackLicenseState; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/StoredProgress.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/StoredProgress.java index 7b10c8e3218ee..a9a355c6f10c6 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/StoredProgress.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/StoredProgress.java @@ -7,10 +7,10 @@ package org.elasticsearch.xpack.ml.dataframe; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ml.utils.PhaseProgress; import java.io.IOException; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/persistence/DataFrameAnalyticsConfigProvider.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/persistence/DataFrameAnalyticsConfigProvider.java index a063be25ed6d6..c98b2ad8e65df 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/persistence/DataFrameAnalyticsConfigProvider.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/persistence/DataFrameAnalyticsConfigProvider.java @@ -26,12 +26,12 @@ import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.Nullable; import org.elasticsearch.core.TimeValue; import org.elasticsearch.index.IndexNotFoundException; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/process/AbstractNativeAnalyticsProcess.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/process/AbstractNativeAnalyticsProcess.java index 3560cfcd867da..35e2cbf58e939 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/process/AbstractNativeAnalyticsProcess.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/process/AbstractNativeAnalyticsProcess.java @@ -6,8 +6,8 @@ */ package org.elasticsearch.xpack.ml.dataframe.process; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.xpack.ml.process.AbstractNativeProcess; import org.elasticsearch.xpack.ml.process.NativeController; import org.elasticsearch.xpack.ml.process.ProcessPipes; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/process/AnalyticsBuilder.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/process/AnalyticsBuilder.java index a0eb710fee898..beb0cdcb58508 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/process/AnalyticsBuilder.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/process/AnalyticsBuilder.java @@ -7,9 +7,9 @@ package org.elasticsearch.xpack.ml.dataframe.process; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.xpack.ml.process.NativeController; import org.elasticsearch.xpack.ml.process.ProcessPipes; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/process/AnalyticsProcessConfig.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/process/AnalyticsProcessConfig.java index aa9348de13fbb..dcff09339b99c 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/process/AnalyticsProcessConfig.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/process/AnalyticsProcessConfig.java @@ -7,8 +7,8 @@ package org.elasticsearch.xpack.ml.dataframe.process; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ml.dataframe.analyses.DataFrameAnalysis; import org.elasticsearch.xpack.ml.extractor.ExtractedFields; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/process/ChunkedTrainedModelPersister.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/process/ChunkedTrainedModelPersister.java index 9da146b14b0f7..bf047d01e45ea 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/process/ChunkedTrainedModelPersister.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/process/ChunkedTrainedModelPersister.java @@ -17,7 +17,7 @@ import org.elasticsearch.action.admin.indices.refresh.RefreshResponse; import org.elasticsearch.common.Strings; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.license.License; import org.elasticsearch.xpack.core.ml.dataframe.DataFrameAnalyticsConfig; import org.elasticsearch.xpack.core.ml.dataframe.analyses.Classification; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/process/NativeAnalyticsProcess.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/process/NativeAnalyticsProcess.java index 9857c3762d9ad..b0a804f68dad6 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/process/NativeAnalyticsProcess.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/process/NativeAnalyticsProcess.java @@ -11,7 +11,7 @@ import org.apache.logging.log4j.message.ParameterizedMessage; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.client.Client; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.search.SearchHit; import org.elasticsearch.xpack.core.ml.job.persistence.AnomalyDetectorsIndex; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/process/NativeAnalyticsProcessFactory.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/process/NativeAnalyticsProcessFactory.java index 26245b135a165..d5179cbc8f75f 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/process/NativeAnalyticsProcessFactory.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/process/NativeAnalyticsProcessFactory.java @@ -11,7 +11,7 @@ import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.concurrent.EsRejectedExecutionException; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.core.internal.io.IOUtils; import org.elasticsearch.env.Environment; import org.elasticsearch.xpack.core.ml.dataframe.DataFrameAnalyticsConfig; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/process/NativeMemoryUsageEstimationProcess.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/process/NativeMemoryUsageEstimationProcess.java index 636b901b17d2b..f9f15845f35bd 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/process/NativeMemoryUsageEstimationProcess.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/process/NativeMemoryUsageEstimationProcess.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.ml.dataframe.process; import org.elasticsearch.client.Client; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.xpack.ml.dataframe.process.results.MemoryUsageEstimationResult; import org.elasticsearch.xpack.ml.process.NativeController; import org.elasticsearch.xpack.ml.process.ProcessPipes; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/process/results/AnalyticsResult.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/process/results/AnalyticsResult.java index 3e02e2b089633..9457fe35d35a8 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/process/results/AnalyticsResult.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/process/results/AnalyticsResult.java @@ -7,10 +7,10 @@ package org.elasticsearch.xpack.ml.dataframe.process.results; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ml.dataframe.stats.classification.ClassificationStats; import org.elasticsearch.xpack.core.ml.dataframe.stats.common.MemoryUsage; import org.elasticsearch.xpack.core.ml.dataframe.stats.outlierdetection.OutlierDetectionStats; @@ -21,7 +21,7 @@ import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class AnalyticsResult implements ToXContentObject { diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/process/results/MemoryUsageEstimationResult.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/process/results/MemoryUsageEstimationResult.java index a0d029bae44b8..1073a7741ee0e 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/process/results/MemoryUsageEstimationResult.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/process/results/MemoryUsageEstimationResult.java @@ -7,17 +7,17 @@ package org.elasticsearch.xpack.ml.dataframe.process.results; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class MemoryUsageEstimationResult implements ToXContentObject { diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/process/results/ModelMetadata.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/process/results/ModelMetadata.java index 375adaec54659..6abb4e7a11531 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/process/results/ModelMetadata.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/process/results/ModelMetadata.java @@ -7,10 +7,10 @@ package org.elasticsearch.xpack.ml.dataframe.process.results; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.metadata.FeatureImportanceBaseline; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.metadata.TotalFeatureImportance; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.metadata.Hyperparameters; @@ -19,8 +19,8 @@ import java.util.List; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class ModelMetadata implements ToXContentObject { diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/process/results/RowResults.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/process/results/RowResults.java index c0315498149e1..e1e5062d9fc85 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/process/results/RowResults.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/process/results/RowResults.java @@ -6,16 +6,16 @@ */ package org.elasticsearch.xpack.ml.dataframe.process.results; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Map; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; public class RowResults implements ToXContentObject { diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/process/results/TrainedModelDefinitionChunk.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/process/results/TrainedModelDefinitionChunk.java index 5e0fab5bd70c1..56a3da58f61b5 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/process/results/TrainedModelDefinitionChunk.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/process/results/TrainedModelDefinitionChunk.java @@ -7,18 +7,18 @@ package org.elasticsearch.xpack.ml.dataframe.process.results; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ml.inference.TrainedModelConfig; import org.elasticsearch.xpack.ml.inference.persistence.TrainedModelDefinitionDoc; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class TrainedModelDefinitionChunk implements ToXContentObject { diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/stats/StatsPersister.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/stats/StatsPersister.java index 38543e4875a71..0457c9d9d7936 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/stats/StatsPersister.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/stats/StatsPersister.java @@ -11,8 +11,8 @@ import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.message.ParameterizedMessage; import org.elasticsearch.action.support.WriteRequest; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; import org.elasticsearch.xpack.core.ml.MlStatsIndex; import org.elasticsearch.xpack.core.ml.utils.ToXContentParams; import org.elasticsearch.xpack.ml.notifications.DataFrameAnalyticsAuditor; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/steps/FinalStep.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/steps/FinalStep.java index 91e298fe86a24..2581a29f0d555 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/steps/FinalStep.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/dataframe/steps/FinalStep.java @@ -20,9 +20,9 @@ import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.xpack.core.ml.MlStatsIndex; import org.elasticsearch.xpack.core.ml.dataframe.DataFrameAnalyticsConfig; import org.elasticsearch.xpack.core.ml.dataframe.stats.common.DataCounts; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/ModelAliasMetadata.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/ModelAliasMetadata.java index 4a837791491c3..9dbfe78b75897 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/ModelAliasMetadata.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/ModelAliasMetadata.java @@ -14,13 +14,13 @@ import org.elasticsearch.cluster.DiffableUtils; import org.elasticsearch.cluster.NamedDiff; import org.elasticsearch.cluster.metadata.Metadata; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Collections; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/TrainedModelStatsService.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/TrainedModelStatsService.java index 43c8d5ab1bbfe..e8707accf4b6f 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/TrainedModelStatsService.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/TrainedModelStatsService.java @@ -25,9 +25,9 @@ import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.component.LifecycleListener; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.indices.InvalidAliasNameException; import org.elasticsearch.script.Script; import org.elasticsearch.script.ScriptType; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/allocation/TrainedModelAllocationMetadata.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/allocation/TrainedModelAllocationMetadata.java index c4e6e6b145665..ab38c24dafe97 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/allocation/TrainedModelAllocationMetadata.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/allocation/TrainedModelAllocationMetadata.java @@ -17,8 +17,8 @@ import org.elasticsearch.cluster.metadata.Metadata; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.inference.allocation.TrainedModelAllocation; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/deployment/DeploymentManager.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/deployment/DeploymentManager.java index 5cd6906464984..0e68a79744585 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/deployment/DeploymentManager.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/deployment/DeploymentManager.java @@ -19,10 +19,10 @@ import org.elasticsearch.client.Client; import org.elasticsearch.common.util.concurrent.AbstractRunnable; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.TimeValue; import org.elasticsearch.index.query.IdsQueryBuilder; import org.elasticsearch.rest.RestStatus; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/deployment/PyTorchResult.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/deployment/PyTorchResult.java index 8455e4d3c7bfb..50c9855a7f038 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/deployment/PyTorchResult.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/deployment/PyTorchResult.java @@ -10,12 +10,12 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.Nullable; import org.elasticsearch.xpack.core.ml.utils.MlParserUtils; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/modelsize/EnsembleSizeInfo.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/modelsize/EnsembleSizeInfo.java index bc488475c90b9..1a21f3600d0a5 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/modelsize/EnsembleSizeInfo.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/modelsize/EnsembleSizeInfo.java @@ -7,10 +7,10 @@ package org.elasticsearch.xpack.ml.inference.modelsize; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.ensemble.LogisticRegression; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.inference.EnsembleInferenceModel; @@ -21,8 +21,8 @@ import static org.apache.lucene.util.RamUsageEstimator.alignObjectSize; import static org.apache.lucene.util.RamUsageEstimator.sizeOfCollection; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; import static org.elasticsearch.xpack.ml.inference.modelsize.SizeEstimatorHelper.sizeOfDoubleArray; import static org.elasticsearch.xpack.ml.inference.modelsize.SizeEstimatorHelper.sizeOfStringCollection; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/modelsize/FrequencyEncodingSize.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/modelsize/FrequencyEncodingSize.java index b7d90075ab7ce..015935085af1f 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/modelsize/FrequencyEncodingSize.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/modelsize/FrequencyEncodingSize.java @@ -7,9 +7,9 @@ package org.elasticsearch.xpack.ml.inference.modelsize; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.inference.preprocessing.FrequencyEncoding; import java.io.IOException; @@ -21,7 +21,7 @@ import static org.apache.lucene.util.RamUsageEstimator.alignObjectSize; import static org.apache.lucene.util.RamUsageEstimator.shallowSizeOfInstance; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; import static org.elasticsearch.xpack.ml.inference.modelsize.SizeEstimatorHelper.sizeOfHashMap; import static org.elasticsearch.xpack.ml.inference.modelsize.SizeEstimatorHelper.sizeOfString; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/modelsize/MlModelSizeNamedXContentProvider.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/modelsize/MlModelSizeNamedXContentProvider.java index bcd2a9d63d96f..bada85ceae641 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/modelsize/MlModelSizeNamedXContentProvider.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/modelsize/MlModelSizeNamedXContentProvider.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.ml.inference.modelsize; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.plugins.spi.NamedXContentProvider; import org.elasticsearch.xpack.core.ml.inference.preprocessing.FrequencyEncoding; import org.elasticsearch.xpack.core.ml.inference.preprocessing.OneHotEncoding; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/modelsize/ModelSizeInfo.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/modelsize/ModelSizeInfo.java index 368a685691d0b..ef512b949e639 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/modelsize/ModelSizeInfo.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/modelsize/ModelSizeInfo.java @@ -8,10 +8,10 @@ package org.elasticsearch.xpack.ml.inference.modelsize; import org.apache.lucene.util.Accountable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.inference.InferenceDefinition; import org.elasticsearch.xpack.core.ml.utils.NamedXContentObjectHelper; @@ -21,8 +21,8 @@ import java.util.Objects; import static org.apache.lucene.util.RamUsageEstimator.alignObjectSize; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; public class ModelSizeInfo implements Accountable, ToXContentObject { diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/modelsize/OneHotEncodingSize.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/modelsize/OneHotEncodingSize.java index f2a62c24595e2..f8c0cb82880f9 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/modelsize/OneHotEncodingSize.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/modelsize/OneHotEncodingSize.java @@ -7,10 +7,10 @@ package org.elasticsearch.xpack.ml.inference.modelsize; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.inference.preprocessing.OneHotEncoding; import java.io.IOException; @@ -20,7 +20,7 @@ import java.util.stream.Collectors; import static org.apache.lucene.util.RamUsageEstimator.alignObjectSize; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; import static org.elasticsearch.xpack.ml.inference.modelsize.SizeEstimatorHelper.sizeOfHashMap; import static org.elasticsearch.xpack.ml.inference.modelsize.SizeEstimatorHelper.sizeOfString; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/modelsize/PreprocessorSize.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/modelsize/PreprocessorSize.java index 858bdd429d252..4bc681602ca89 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/modelsize/PreprocessorSize.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/modelsize/PreprocessorSize.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.ml.inference.modelsize; import org.apache.lucene.util.Accountable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.xpack.core.ml.utils.NamedXContentObject; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/modelsize/TargetMeanEncodingSize.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/modelsize/TargetMeanEncodingSize.java index 3c2dc393f75a5..334abf3b76775 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/modelsize/TargetMeanEncodingSize.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/modelsize/TargetMeanEncodingSize.java @@ -7,9 +7,9 @@ package org.elasticsearch.xpack.ml.inference.modelsize; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.inference.preprocessing.TargetMeanEncoding; import java.io.IOException; @@ -21,7 +21,7 @@ import static org.apache.lucene.util.RamUsageEstimator.alignObjectSize; import static org.apache.lucene.util.RamUsageEstimator.shallowSizeOfInstance; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; import static org.elasticsearch.xpack.ml.inference.modelsize.SizeEstimatorHelper.sizeOfHashMap; import static org.elasticsearch.xpack.ml.inference.modelsize.SizeEstimatorHelper.sizeOfString; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/modelsize/TreeSizeInfo.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/modelsize/TreeSizeInfo.java index cd2f7a063f47d..21d23bdf14927 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/modelsize/TreeSizeInfo.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/modelsize/TreeSizeInfo.java @@ -8,11 +8,11 @@ package org.elasticsearch.xpack.ml.inference.modelsize; import org.apache.lucene.util.Accountable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.inference.TreeInferenceModel; @@ -22,8 +22,8 @@ import static org.apache.lucene.util.RamUsageEstimator.NUM_BYTES_ARRAY_HEADER; import static org.apache.lucene.util.RamUsageEstimator.NUM_BYTES_OBJECT_REF; import static org.apache.lucene.util.RamUsageEstimator.alignObjectSize; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; import static org.elasticsearch.xpack.ml.inference.modelsize.SizeEstimatorHelper.sizeOfDoubleArray; public class TreeSizeInfo implements Accountable, ToXContentObject { diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/BertRequestBuilder.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/BertRequestBuilder.java index 4fe4e0392bcd6..2bac127ff4d9f 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/BertRequestBuilder.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/BertRequestBuilder.java @@ -8,8 +8,8 @@ package org.elasticsearch.xpack.ml.inference.nlp; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.xpack.ml.inference.nlp.tokenizers.BertTokenizer; import org.elasticsearch.xpack.ml.inference.nlp.tokenizers.TokenizationResult; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/NlpTask.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/NlpTask.java index 856481de738ba..23f2be2867481 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/NlpTask.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/NlpTask.java @@ -9,7 +9,7 @@ import org.elasticsearch.common.ValidationException; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.xpack.core.ml.inference.TrainedModelInput; import org.elasticsearch.xpack.core.ml.inference.results.InferenceResults; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/Vocabulary.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/Vocabulary.java index aa8611d0fa559..64b988f3dc0d4 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/Vocabulary.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/Vocabulary.java @@ -10,10 +10,10 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ml.inference.TrainedModelConfig; import org.elasticsearch.xpack.core.ml.inference.persistence.InferenceIndexConstants; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/tokenizers/WordPieceVocabulary.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/tokenizers/WordPieceVocabulary.java index 8534ccfda8f74..c7f2320c67f49 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/tokenizers/WordPieceVocabulary.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/tokenizers/WordPieceVocabulary.java @@ -7,11 +7,11 @@ package org.elasticsearch.xpack.ml.inference.nlp.tokenizers; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.List; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/persistence/ChunkedTrainedModelRestorer.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/persistence/ChunkedTrainedModelRestorer.java index 5f368616afafd..7063307294f4f 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/persistence/ChunkedTrainedModelRestorer.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/persistence/ChunkedTrainedModelRestorer.java @@ -19,10 +19,10 @@ import org.elasticsearch.core.CheckedFunction; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.sort.SortBuilders; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/persistence/TrainedModelDefinitionDoc.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/persistence/TrainedModelDefinitionDoc.java index 47a0f792cc530..02eb95323c76f 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/persistence/TrainedModelDefinitionDoc.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/persistence/TrainedModelDefinitionDoc.java @@ -6,14 +6,14 @@ */ package org.elasticsearch.xpack.ml.inference.persistence; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.inference.TrainedModelConfig; import org.elasticsearch.xpack.core.ml.inference.persistence.InferenceIndexConstants; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/persistence/TrainedModelProvider.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/persistence/TrainedModelProvider.java index 9d047ff565a87..b796760c5c5c1 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/persistence/TrainedModelProvider.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/persistence/TrainedModelProvider.java @@ -43,14 +43,14 @@ import org.elasticsearch.common.regex.Regex; import org.elasticsearch.common.util.set.Sets; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.index.engine.VersionConflictEngineException; import org.elasticsearch.index.query.BoolQueryBuilder; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/pytorch/process/NativePyTorchProcess.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/pytorch/process/NativePyTorchProcess.java index b7e14d8f7f76d..538233cfcef3e 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/pytorch/process/NativePyTorchProcess.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/pytorch/process/NativePyTorchProcess.java @@ -9,7 +9,7 @@ import org.elasticsearch.action.ActionListener; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.xpack.ml.inference.deployment.PyTorchResult; import org.elasticsearch.xpack.ml.process.AbstractNativeProcess; import org.elasticsearch.xpack.ml.process.NativeController; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/pytorch/process/PyTorchStateStreamer.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/pytorch/process/PyTorchStateStreamer.java index 70632d75ad8fd..7f5eecf671a4a 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/pytorch/process/PyTorchStateStreamer.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/pytorch/process/PyTorchStateStreamer.java @@ -12,7 +12,7 @@ import org.elasticsearch.action.ActionListener; import org.elasticsearch.client.Client; import org.elasticsearch.client.OriginSettingClient; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.xpack.ml.inference.persistence.ChunkedTrainedModelRestorer; import org.elasticsearch.xpack.ml.inference.persistence.TrainedModelDefinitionDoc; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/JobManager.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/JobManager.java index ca37c8bec5428..fbeff0abd45b1 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/JobManager.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/JobManager.java @@ -23,10 +23,10 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.core.CheckedConsumer; import org.elasticsearch.env.Environment; import org.elasticsearch.index.analysis.AnalysisRegistry; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/persistence/BatchedBucketsIterator.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/persistence/BatchedBucketsIterator.java index 30f57538837b9..6668ea6d02c12 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/persistence/BatchedBucketsIterator.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/persistence/BatchedBucketsIterator.java @@ -10,10 +10,10 @@ import org.elasticsearch.client.OriginSettingClient; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.search.SearchHit; import org.elasticsearch.xpack.core.ml.job.results.Bucket; import org.elasticsearch.xpack.core.ml.job.results.Result; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/persistence/BatchedInfluencersIterator.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/persistence/BatchedInfluencersIterator.java index 2105192ff9fc9..00a38699a7969 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/persistence/BatchedInfluencersIterator.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/persistence/BatchedInfluencersIterator.java @@ -10,10 +10,10 @@ import org.elasticsearch.client.OriginSettingClient; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.search.SearchHit; import org.elasticsearch.xpack.core.ml.job.results.Influencer; import org.elasticsearch.xpack.core.ml.job.results.Result; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/persistence/BatchedRecordsIterator.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/persistence/BatchedRecordsIterator.java index d2c0c34e7d10c..b91436c2d1d8e 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/persistence/BatchedRecordsIterator.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/persistence/BatchedRecordsIterator.java @@ -10,10 +10,10 @@ import org.elasticsearch.client.OriginSettingClient; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.search.SearchHit; import org.elasticsearch.xpack.core.ml.job.results.AnomalyRecord; import org.elasticsearch.xpack.core.ml.job.results.Result; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/persistence/JobConfigProvider.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/persistence/JobConfigProvider.java index cbe59b21c423e..b27c98b1b91e8 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/persistence/JobConfigProvider.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/persistence/JobConfigProvider.java @@ -32,12 +32,12 @@ import org.elasticsearch.common.regex.Regex; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.Nullable; import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.index.engine.VersionConflictEngineException; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/persistence/JobDataCountsPersister.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/persistence/JobDataCountsPersister.java index abc27de4283c6..e4bb744e3583f 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/persistence/JobDataCountsPersister.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/persistence/JobDataCountsPersister.java @@ -14,8 +14,8 @@ import org.elasticsearch.action.index.IndexRequest; import org.elasticsearch.action.support.WriteRequest; import org.elasticsearch.client.Client; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ml.job.persistence.AnomalyDetectorsIndex; import org.elasticsearch.xpack.core.ml.job.process.autodetect.state.DataCounts; import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper; @@ -25,7 +25,7 @@ import java.io.IOException; import java.time.Instant; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.xpack.core.ClientHelper.ML_ORIGIN; import static org.elasticsearch.xpack.core.ClientHelper.executeAsyncWithOrigin; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/persistence/JobRenormalizedResultsPersister.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/persistence/JobRenormalizedResultsPersister.java index 1e7bbf627d359..18347b0ac665c 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/persistence/JobRenormalizedResultsPersister.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/persistence/JobRenormalizedResultsPersister.java @@ -14,8 +14,8 @@ import org.elasticsearch.action.index.IndexRequest; import org.elasticsearch.client.Client; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ml.job.results.Bucket; import org.elasticsearch.xpack.core.ml.job.results.BucketInfluencer; import org.elasticsearch.xpack.ml.job.process.normalizer.BucketNormalizable; @@ -24,7 +24,7 @@ import java.io.IOException; import java.util.List; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.xpack.core.ClientHelper.ML_ORIGIN; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/persistence/JobResultsPersister.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/persistence/JobResultsPersister.java index 85040d9a3ad71..8ee8af4ef8891 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/persistence/JobResultsPersister.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/persistence/JobResultsPersister.java @@ -24,8 +24,8 @@ import org.elasticsearch.action.support.WriteRequest; import org.elasticsearch.client.OriginSettingClient; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.query.BoolQueryBuilder; import org.elasticsearch.index.query.IdsQueryBuilder; import org.elasticsearch.search.builder.SearchSourceBuilder; @@ -55,7 +55,7 @@ import java.util.Objects; import java.util.function.Supplier; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.xpack.core.ClientHelper.ML_ORIGIN; import static org.elasticsearch.xpack.core.ClientHelper.executeAsyncWithOrigin; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/persistence/JobResultsProvider.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/persistence/JobResultsProvider.java index 10d0fcd39b964..1c55fd2b489e6 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/persistence/JobResultsProvider.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/persistence/JobResultsProvider.java @@ -53,13 +53,13 @@ import org.elasticsearch.common.util.CollectionUtils; import org.elasticsearch.common.util.concurrent.ThreadContext; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.index.mapper.MapperService; import org.elasticsearch.index.mapper.NumberFieldMapper; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/persistence/SearchAfterJobsIterator.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/persistence/SearchAfterJobsIterator.java index 96c0de703170c..2eb7b27b220ee 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/persistence/SearchAfterJobsIterator.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/persistence/SearchAfterJobsIterator.java @@ -10,10 +10,10 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.client.OriginSettingClient; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.TermQueryBuilder; import org.elasticsearch.search.SearchHit; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/autodetect/AutodetectBuilder.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/autodetect/AutodetectBuilder.java index c516ace1d77df..3f5c8d77cdf88 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/autodetect/AutodetectBuilder.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/autodetect/AutodetectBuilder.java @@ -10,9 +10,9 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.env.Environment; import org.elasticsearch.xpack.core.XPackPlugin; import org.elasticsearch.xpack.core.ml.calendars.ScheduledEvent; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/autodetect/AutodetectCommunicator.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/autodetect/AutodetectCommunicator.java index 9c0331ff1ae4d..601af15523a11 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/autodetect/AutodetectCommunicator.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/autodetect/AutodetectCommunicator.java @@ -14,8 +14,8 @@ import org.elasticsearch.core.Nullable; import org.elasticsearch.common.util.concurrent.AbstractRunnable; import org.elasticsearch.common.util.concurrent.FutureUtils; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.analysis.AnalysisRegistry; import org.elasticsearch.xpack.core.ml.job.config.AnalysisConfig; import org.elasticsearch.xpack.core.ml.job.config.CategorizationAnalyzerConfig; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/autodetect/AutodetectProcessManager.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/autodetect/AutodetectProcessManager.java index 90c193ff1c1d5..ebf77194ce9fd 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/autodetect/AutodetectProcessManager.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/autodetect/AutodetectProcessManager.java @@ -27,9 +27,9 @@ import org.elasticsearch.common.util.concurrent.AbstractRunnable; import org.elasticsearch.common.util.concurrent.EsRejectedExecutionException; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.common.xcontent.XContentElasticsearchExtension; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.internal.io.IOUtils; import org.elasticsearch.index.analysis.AnalysisRegistry; import org.elasticsearch.indices.InvalidAliasNameException; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/autodetect/NativeAutodetectProcessFactory.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/autodetect/NativeAutodetectProcessFactory.java index db98f7d0c65cd..9434087f90588 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/autodetect/NativeAutodetectProcessFactory.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/autodetect/NativeAutodetectProcessFactory.java @@ -12,7 +12,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.concurrent.EsRejectedExecutionException; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.core.internal.io.IOUtils; import org.elasticsearch.env.Environment; import org.elasticsearch.xpack.core.ml.job.config.Job; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/autodetect/writer/AbstractDataToProcessWriter.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/autodetect/writer/AbstractDataToProcessWriter.java index cb04af1967004..4bacb48dbc1ed 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/autodetect/writer/AbstractDataToProcessWriter.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/autodetect/writer/AbstractDataToProcessWriter.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.ml.job.process.autodetect.writer; import org.apache.logging.log4j.Logger; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.ml.job.categorization.CategorizationAnalyzer; import org.elasticsearch.xpack.core.ml.job.config.AnalysisConfig; import org.elasticsearch.xpack.core.ml.job.config.DataDescription; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/autodetect/writer/AutodetectControlMsgWriter.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/autodetect/writer/AutodetectControlMsgWriter.java index b492c5a266dbe..26c4d2fd7e4b3 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/autodetect/writer/AutodetectControlMsgWriter.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/autodetect/writer/AutodetectControlMsgWriter.java @@ -8,9 +8,9 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.xpack.core.ml.calendars.ScheduledEvent; import org.elasticsearch.xpack.core.ml.job.config.DetectionRule; import org.elasticsearch.xpack.core.ml.job.config.MlFilter; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/autodetect/writer/DataToProcessWriter.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/autodetect/writer/DataToProcessWriter.java index 9ffecb9e7695e..91bdd84959430 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/autodetect/writer/DataToProcessWriter.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/autodetect/writer/DataToProcessWriter.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.ml.job.process.autodetect.writer; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.ml.job.categorization.CategorizationAnalyzer; import org.elasticsearch.xpack.core.ml.job.process.autodetect.state.DataCounts; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/autodetect/writer/JsonDataToProcessWriter.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/autodetect/writer/JsonDataToProcessWriter.java index d9979c2fb3e69..172ea0a8d9da2 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/autodetect/writer/JsonDataToProcessWriter.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/autodetect/writer/JsonDataToProcessWriter.java @@ -9,10 +9,10 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.ml.job.categorization.CategorizationAnalyzer; import org.elasticsearch.xpack.core.ml.job.config.AnalysisConfig; import org.elasticsearch.xpack.core.ml.job.config.DataDescription; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/autodetect/writer/ScheduledEventToRuleWriter.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/autodetect/writer/ScheduledEventToRuleWriter.java index a04cf51298814..fb5befeb4bcdc 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/autodetect/writer/ScheduledEventToRuleWriter.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/autodetect/writer/ScheduledEventToRuleWriter.java @@ -6,9 +6,9 @@ */ package org.elasticsearch.xpack.ml.job.process.autodetect.writer; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ml.job.config.DetectionRule; import java.io.IOException; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/autodetect/writer/XContentRecordReader.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/autodetect/writer/XContentRecordReader.java index 9cad97382c38e..f3d319df98574 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/autodetect/writer/XContentRecordReader.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/autodetect/writer/XContentRecordReader.java @@ -9,7 +9,7 @@ import com.fasterxml.jackson.core.JsonParseException; import org.apache.logging.log4j.Logger; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayDeque; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/normalizer/BucketInfluencerNormalizable.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/normalizer/BucketInfluencerNormalizable.java index e9b35b3a8988e..2224e0eeac634 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/normalizer/BucketInfluencerNormalizable.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/normalizer/BucketInfluencerNormalizable.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.ml.job.process.normalizer; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ml.job.results.BucketInfluencer; import java.io.IOException; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/normalizer/BucketNormalizable.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/normalizer/BucketNormalizable.java index 979675d589050..a827f5e1f6f50 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/normalizer/BucketNormalizable.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/normalizer/BucketNormalizable.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.ml.job.process.normalizer; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ml.job.results.Bucket; import java.io.IOException; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/normalizer/InfluencerNormalizable.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/normalizer/InfluencerNormalizable.java index acdbcfe1094e8..9e3d18a2d430e 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/normalizer/InfluencerNormalizable.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/normalizer/InfluencerNormalizable.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.ml.job.process.normalizer; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ml.job.results.Influencer; import java.io.IOException; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/normalizer/MultiplyingNormalizerProcess.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/normalizer/MultiplyingNormalizerProcess.java index bd9a0617a0480..b5cc04829b1b3 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/normalizer/MultiplyingNormalizerProcess.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/normalizer/MultiplyingNormalizerProcess.java @@ -8,10 +8,10 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.elasticsearch.common.xcontent.XContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.ml.job.process.normalizer.output.NormalizerResultHandler; import java.io.IOException; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/normalizer/Normalizable.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/normalizer/Normalizable.java index 29b56ebadb790..6ee4af900c053 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/normalizer/Normalizable.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/normalizer/Normalizable.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.ml.job.process.normalizer; -import org.elasticsearch.common.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.ToXContentObject; import java.util.List; import java.util.Objects; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/normalizer/NormalizerResult.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/normalizer/NormalizerResult.java index 7f55cf57ec4d3..cfa50b3c208f7 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/normalizer/NormalizerResult.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/normalizer/NormalizerResult.java @@ -6,13 +6,13 @@ */ package org.elasticsearch.xpack.ml.job.process.normalizer; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/normalizer/RecordNormalizable.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/normalizer/RecordNormalizable.java index 0a64cf02e6cb6..46a0c8582acc6 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/normalizer/RecordNormalizable.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/normalizer/RecordNormalizable.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.ml.job.process.normalizer; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ml.job.results.AnomalyRecord; import java.io.IOException; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/normalizer/output/NormalizerResultHandler.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/normalizer/output/NormalizerResultHandler.java index d75509ba1f34f..d2ce76d209ade 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/normalizer/output/NormalizerResultHandler.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/normalizer/output/NormalizerResultHandler.java @@ -10,11 +10,11 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.bytes.CompositeBytesReference; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContent; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContent; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.ml.job.process.normalizer.NormalizerResult; import java.io.IOException; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/results/AutodetectResult.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/results/AutodetectResult.java index 19c6ee04574c7..1294eb6f2b42e 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/results/AutodetectResult.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/results/AutodetectResult.java @@ -6,14 +6,14 @@ */ package org.elasticsearch.xpack.ml.job.results; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ml.annotations.Annotation; import org.elasticsearch.xpack.core.ml.job.process.autodetect.output.FlushAcknowledgement; import org.elasticsearch.xpack.core.ml.job.process.autodetect.state.CategorizerStats; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/retention/ExpiredResultsRemover.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/retention/ExpiredResultsRemover.java index ae341eb1b19ae..ef1efa7608016 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/retention/ExpiredResultsRemover.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/retention/ExpiredResultsRemover.java @@ -15,10 +15,10 @@ import org.elasticsearch.action.support.ThreadedActionListener; import org.elasticsearch.client.OriginSettingClient; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.TimeValue; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilders; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/snapshot/upgrader/SnapshotUpgradeTaskParams.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/snapshot/upgrader/SnapshotUpgradeTaskParams.java index f2769ce5ac0c8..f05688ddd6d5c 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/snapshot/upgrader/SnapshotUpgradeTaskParams.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/snapshot/upgrader/SnapshotUpgradeTaskParams.java @@ -8,11 +8,11 @@ package org.elasticsearch.xpack.ml.job.snapshot.upgrader; import org.elasticsearch.Version; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.persistent.PersistentTaskParams; import org.elasticsearch.xpack.core.ml.job.config.Job; import org.elasticsearch.xpack.core.ml.utils.MlTaskParams; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/notifications/AbstractMlAuditor.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/notifications/AbstractMlAuditor.java index 113cf39463ec0..864786f72e6b1 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/notifications/AbstractMlAuditor.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/notifications/AbstractMlAuditor.java @@ -12,7 +12,7 @@ import org.elasticsearch.client.Client; import org.elasticsearch.client.OriginSettingClient; import org.elasticsearch.cluster.service.ClusterService; -import org.elasticsearch.common.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContent; import org.elasticsearch.xpack.core.common.notifications.AbstractAuditMessage; import org.elasticsearch.xpack.core.common.notifications.AbstractAuditMessageFactory; import org.elasticsearch.xpack.core.common.notifications.AbstractAuditor; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/process/ControllerResponse.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/process/ControllerResponse.java index 412e0b7eb289a..b509ca77dca86 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/process/ControllerResponse.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/process/ControllerResponse.java @@ -7,10 +7,10 @@ package org.elasticsearch.xpack.ml.process; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/process/IndexingStateProcessor.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/process/IndexingStateProcessor.java index fa1fbdaacb6fb..0ec8a86a1a177 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/process/IndexingStateProcessor.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/process/IndexingStateProcessor.java @@ -17,10 +17,10 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.bytes.CompositeBytesReference; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.query.BoolQueryBuilder; import org.elasticsearch.index.query.IdsQueryBuilder; import org.elasticsearch.search.builder.SearchSourceBuilder; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/process/NativeController.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/process/NativeController.java index 547b3b9ed7488..0d87d5b3be3f2 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/process/NativeController.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/process/NativeController.java @@ -10,7 +10,7 @@ import org.apache.logging.log4j.Logger; import org.apache.lucene.util.SetOnce; import org.elasticsearch.ElasticsearchException; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.env.Environment; import org.elasticsearch.xpack.ml.process.logging.CppLogMessageHandler; import org.elasticsearch.xpack.ml.utils.NamedPipeHelper; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/process/ProcessResultsParser.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/process/ProcessResultsParser.java index d51788bb24aee..893636cdb778a 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/process/ProcessResultsParser.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/process/ProcessResultsParser.java @@ -9,12 +9,12 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.io.InputStream; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/process/logging/CppLogMessage.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/process/logging/CppLogMessage.java index b3eb20df1826d..74d359310c2c5 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/process/logging/CppLogMessage.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/process/logging/CppLogMessage.java @@ -6,14 +6,14 @@ */ package org.elasticsearch.xpack.ml.process.logging; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.time.Instant; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/process/logging/CppLogMessageHandler.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/process/logging/CppLogMessageHandler.java index 1f24ea8e7f29d..ebf4148149322 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/process/logging/CppLogMessageHandler.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/process/logging/CppLogMessageHandler.java @@ -17,12 +17,12 @@ import org.elasticsearch.common.bytes.CompositeBytesReference; import org.elasticsearch.common.util.concurrent.ConcurrentCollections; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContent; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContent; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import java.io.Closeable; import java.io.IOException; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/calendar/RestGetCalendarEventsAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/calendar/RestGetCalendarEventsAction.java index 4f60b1d03fbd1..f545fa1ad6809 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/calendar/RestGetCalendarEventsAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/calendar/RestGetCalendarEventsAction.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.ml.rest.calendar; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/calendar/RestGetCalendarsAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/calendar/RestGetCalendarsAction.java index 26d750a7daa32..9e109872b79bc 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/calendar/RestGetCalendarsAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/calendar/RestGetCalendarsAction.java @@ -8,7 +8,7 @@ import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/calendar/RestPostCalendarEventAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/calendar/RestPostCalendarEventAction.java index 29ace7f40c517..2c2c866ef79a3 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/calendar/RestPostCalendarEventAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/calendar/RestPostCalendarEventAction.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.ml.rest.calendar; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/calendar/RestPutCalendarAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/calendar/RestPutCalendarAction.java index 3121566d3fcee..b11857ad15108 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/calendar/RestPutCalendarAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/calendar/RestPutCalendarAction.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.ml.rest.calendar; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/datafeeds/RestPutDatafeedAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/datafeeds/RestPutDatafeedAction.java index 5596d8e832507..d07abd84537ff 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/datafeeds/RestPutDatafeedAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/datafeeds/RestPutDatafeedAction.java @@ -9,7 +9,7 @@ import org.elasticsearch.action.search.SearchRequest; import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/datafeeds/RestStartDatafeedAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/datafeeds/RestStartDatafeedAction.java index 74aea26622e2a..db37cf0539d68 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/datafeeds/RestStartDatafeedAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/datafeeds/RestStartDatafeedAction.java @@ -9,8 +9,8 @@ import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/datafeeds/RestStopDatafeedAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/datafeeds/RestStopDatafeedAction.java index 80c28656551c1..b6833b1327a27 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/datafeeds/RestStopDatafeedAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/datafeeds/RestStopDatafeedAction.java @@ -10,8 +10,8 @@ import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/datafeeds/RestUpdateDatafeedAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/datafeeds/RestUpdateDatafeedAction.java index 84b1282b04281..30dd834ebed5f 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/datafeeds/RestUpdateDatafeedAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/datafeeds/RestUpdateDatafeedAction.java @@ -9,7 +9,7 @@ import org.elasticsearch.action.search.SearchRequest; import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/dataframe/RestPostDataFrameAnalyticsUpdateAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/dataframe/RestPostDataFrameAnalyticsUpdateAction.java index 61f77c8980d6f..641c6d8c28a8a 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/dataframe/RestPostDataFrameAnalyticsUpdateAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/dataframe/RestPostDataFrameAnalyticsUpdateAction.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.ml.rest.dataframe; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestToXContentListener; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/dataframe/RestPutDataFrameAnalyticsAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/dataframe/RestPutDataFrameAnalyticsAction.java index 1da58e0372f75..f74b1820338cf 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/dataframe/RestPutDataFrameAnalyticsAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/dataframe/RestPutDataFrameAnalyticsAction.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.ml.rest.dataframe; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestToXContentListener; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/filter/RestPutFilterAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/filter/RestPutFilterAction.java index d7ee5508f458a..15970e413583d 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/filter/RestPutFilterAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/filter/RestPutFilterAction.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.ml.rest.filter; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/filter/RestUpdateFilterAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/filter/RestUpdateFilterAction.java index de9a635e09231..e32c02d03d065 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/filter/RestUpdateFilterAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/filter/RestUpdateFilterAction.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.ml.rest.filter; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/inference/RestGetTrainedModelsAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/inference/RestGetTrainedModelsAction.java index e3138aa50de87..1ede539da7310 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/inference/RestGetTrainedModelsAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/inference/RestGetTrainedModelsAction.java @@ -12,9 +12,9 @@ import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.common.logging.DeprecationCategory; import org.elasticsearch.common.logging.DeprecationLogger; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestChannel; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/inference/RestPutTrainedModelAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/inference/RestPutTrainedModelAction.java index effacbae02cc6..47dcc99fb6bff 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/inference/RestPutTrainedModelAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/inference/RestPutTrainedModelAction.java @@ -8,7 +8,7 @@ import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.core.RestApiVersion; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestToXContentListener; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/inference/RestPutTrainedModelDefinitionPartAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/inference/RestPutTrainedModelDefinitionPartAction.java index 665d5dc4cec88..517d2ed783d23 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/inference/RestPutTrainedModelDefinitionPartAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/inference/RestPutTrainedModelDefinitionPartAction.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.ml.rest.inference; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestToXContentListener; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/inference/RestPutTrainedModelVocabularyAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/inference/RestPutTrainedModelVocabularyAction.java index a135e073501af..3e35677383c53 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/inference/RestPutTrainedModelVocabularyAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/inference/RestPutTrainedModelVocabularyAction.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.ml.rest.inference; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestToXContentListener; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/job/RestDeleteJobAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/job/RestDeleteJobAction.java index 6fc36e3978747..c84ea38d316ea 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/job/RestDeleteJobAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/job/RestDeleteJobAction.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.ml.rest.job; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BytesRestResponse; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/job/RestFlushJobAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/job/RestFlushJobAction.java index 1793dedcb7658..501f427c8bfd6 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/job/RestFlushJobAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/job/RestFlushJobAction.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.ml.rest.job; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/job/RestForecastJobAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/job/RestForecastJobAction.java index 6311e8ffd9b6d..1249b583f2630 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/job/RestForecastJobAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/job/RestForecastJobAction.java @@ -8,7 +8,7 @@ import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/job/RestOpenJobAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/job/RestOpenJobAction.java index e0f3391bd44fa..732f1361bf357 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/job/RestOpenJobAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/job/RestOpenJobAction.java @@ -9,7 +9,7 @@ import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/job/RestPostJobUpdateAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/job/RestPostJobUpdateAction.java index 063352d4fa2e8..97bb44205b498 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/job/RestPostJobUpdateAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/job/RestPostJobUpdateAction.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.ml.rest.job; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/job/RestPutJobAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/job/RestPutJobAction.java index 56196ee2c7c59..f3b4244f246a8 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/job/RestPutJobAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/job/RestPutJobAction.java @@ -9,7 +9,7 @@ import org.elasticsearch.action.search.SearchRequest; import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/job/RestResetJobAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/job/RestResetJobAction.java index 7f568a9cc1f49..392add35d85c2 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/job/RestResetJobAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/job/RestResetJobAction.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.ml.rest.job; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/modelsnapshots/RestGetModelSnapshotsAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/modelsnapshots/RestGetModelSnapshotsAction.java index 30a7f3921a690..13037a98d98f7 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/modelsnapshots/RestGetModelSnapshotsAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/modelsnapshots/RestGetModelSnapshotsAction.java @@ -8,7 +8,7 @@ import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/modelsnapshots/RestRevertModelSnapshotAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/modelsnapshots/RestRevertModelSnapshotAction.java index 45a885d719645..126bf9a030985 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/modelsnapshots/RestRevertModelSnapshotAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/modelsnapshots/RestRevertModelSnapshotAction.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.ml.rest.modelsnapshots; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/modelsnapshots/RestUpdateModelSnapshotAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/modelsnapshots/RestUpdateModelSnapshotAction.java index 0a75450ab081d..0607d37ff4846 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/modelsnapshots/RestUpdateModelSnapshotAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/modelsnapshots/RestUpdateModelSnapshotAction.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.ml.rest.modelsnapshots; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/results/RestGetBucketsAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/results/RestGetBucketsAction.java index 8498231c10783..434dc5dd7d590 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/results/RestGetBucketsAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/results/RestGetBucketsAction.java @@ -8,7 +8,7 @@ import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/results/RestGetCategoriesAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/results/RestGetCategoriesAction.java index 4585b12441034..427ee825c873b 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/results/RestGetCategoriesAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/results/RestGetCategoriesAction.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.ml.rest.results; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/results/RestGetInfluencersAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/results/RestGetInfluencersAction.java index 55223dd5de265..096c8be1c1ef1 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/results/RestGetInfluencersAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/results/RestGetInfluencersAction.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.ml.rest.results; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/results/RestGetOverallBucketsAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/results/RestGetOverallBucketsAction.java index 3cf3e91c4943d..edd146ef81636 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/results/RestGetOverallBucketsAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/results/RestGetOverallBucketsAction.java @@ -8,7 +8,7 @@ import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/results/RestGetRecordsAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/results/RestGetRecordsAction.java index 349e3f85f3c37..1fcbd548b1044 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/results/RestGetRecordsAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/results/RestGetRecordsAction.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.ml.rest.results; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/validate/RestValidateDetectorAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/validate/RestValidateDetectorAction.java index 24f65e5b522c5..1094dee740fcd 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/validate/RestValidateDetectorAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/validate/RestValidateDetectorAction.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.ml.rest.validate; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/validate/RestValidateJobConfigAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/validate/RestValidateJobConfigAction.java index 46b5fe2305227..2d3aada108ef7 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/validate/RestValidateJobConfigAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/validate/RestValidateJobConfigAction.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.ml.rest.validate; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/utils/persistence/MlParserUtils.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/utils/persistence/MlParserUtils.java index 2b8e77ad7f2ab..ce7b420695a28 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/utils/persistence/MlParserUtils.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/utils/persistence/MlParserUtils.java @@ -10,10 +10,10 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.search.SearchHit; import java.io.IOException; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/utils/persistence/ResultsPersisterService.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/utils/persistence/ResultsPersisterService.java index f5750fcb00931..af81e108133ec 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/utils/persistence/ResultsPersisterService.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/utils/persistence/ResultsPersisterService.java @@ -31,9 +31,9 @@ import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.CancellableThreads; import org.elasticsearch.common.util.concurrent.ConcurrentCollections; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.xpack.core.ClientHelper; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/MachineLearningInfoTransportActionTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/MachineLearningInfoTransportActionTests.java index adbab4f7a1ce6..240b7d2348860 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/MachineLearningInfoTransportActionTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/MachineLearningInfoTransportActionTests.java @@ -26,9 +26,9 @@ import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.transport.TransportAddress; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.env.Environment; import org.elasticsearch.env.TestEnvironment; import org.elasticsearch.ingest.IngestStats; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/MlConfigMigrationEligibilityCheckTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/MlConfigMigrationEligibilityCheckTests.java index 302d8763af4b7..2fbb98f012144 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/MlConfigMigrationEligibilityCheckTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/MlConfigMigrationEligibilityCheckTests.java @@ -20,7 +20,7 @@ import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.settings.ClusterSettings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.index.Index; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.persistent.PersistentTasksCustomMetadata; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/MlConfigMigratorTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/MlConfigMigratorTests.java index 571fb7ebe7cfa..1d3efd6f72b4f 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/MlConfigMigratorTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/MlConfigMigratorTests.java @@ -17,7 +17,7 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.transport.TransportAddress; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.persistent.PersistentTasksCustomMetadata; import org.elasticsearch.search.SearchModule; import org.elasticsearch.test.ESTestCase; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/MlDailyMaintenanceServiceTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/MlDailyMaintenanceServiceTests.java index f23e57466705a..4e3bb953b35c0 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/MlDailyMaintenanceServiceTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/MlDailyMaintenanceServiceTests.java @@ -17,7 +17,7 @@ import org.elasticsearch.cluster.metadata.Metadata; import org.elasticsearch.cluster.node.DiscoveryNodes; import org.elasticsearch.cluster.service.ClusterService; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; import org.elasticsearch.persistent.PersistentTasksCustomMetadata; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/MlIndexTemplateRegistryTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/MlIndexTemplateRegistryTests.java index 259036d10cf8a..3e6590a3143f3 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/MlIndexTemplateRegistryTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/MlIndexTemplateRegistryTests.java @@ -21,12 +21,12 @@ import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.node.DiscoveryNodes; import org.elasticsearch.cluster.service.ClusterService; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.CollectionUtils; import org.elasticsearch.common.util.concurrent.EsExecutors; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.xpack.core.ilm.LifecycleAction; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/MlMetadataTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/MlMetadataTests.java index dd17cb9b2f8f6..ed8135f8763aa 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/MlMetadataTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/MlMetadataTests.java @@ -10,8 +10,8 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.SearchModule; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ml.MlMetadata; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/MlSingleNodeTestCase.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/MlSingleNodeTestCase.java index 9c742b8b55ce7..97101798a4dc1 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/MlSingleNodeTestCase.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/MlSingleNodeTestCase.java @@ -13,7 +13,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.reindex.ReindexPlugin; import org.elasticsearch.ingest.common.IngestCommonPlugin; import org.elasticsearch.license.LicenseService; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/TransportGetTrainedModelsStatsActionTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/TransportGetTrainedModelsStatsActionTests.java index 7e62738a08073..a4ddfc9b286b6 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/TransportGetTrainedModelsStatsActionTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/TransportGetTrainedModelsStatsActionTests.java @@ -21,9 +21,9 @@ import org.elasticsearch.common.settings.ClusterSettings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.EsExecutors; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.ingest.IngestDocument; import org.elasticsearch.ingest.IngestMetadata; import org.elasticsearch.ingest.IngestService; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/TransportStartDatafeedActionTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/TransportStartDatafeedActionTests.java index 62f5c200c2dad..bff4a9c4c5e5f 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/TransportStartDatafeedActionTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/action/TransportStartDatafeedActionTests.java @@ -11,7 +11,7 @@ import org.elasticsearch.Version; import org.elasticsearch.common.collect.MapBuilder; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.persistent.PersistentTasksCustomMetadata; import org.elasticsearch.search.SearchModule; import org.elasticsearch.tasks.TaskId; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/categorization/InternalCategorizationAggregationTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/categorization/InternalCategorizationAggregationTests.java index 749863b336fa2..50e74155fe04c 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/categorization/InternalCategorizationAggregationTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/categorization/InternalCategorizationAggregationTests.java @@ -10,8 +10,8 @@ import org.apache.lucene.util.BytesRef; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.CollectionUtils; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.plugins.SearchPlugin; import org.elasticsearch.search.aggregations.Aggregation; import org.elasticsearch.search.aggregations.InternalAggregations; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/categorization/ParsedCategorization.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/categorization/ParsedCategorization.java index b554f9cfc43e1..17ee466132214 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/categorization/ParsedCategorization.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/categorization/ParsedCategorization.java @@ -9,9 +9,9 @@ import org.apache.lucene.util.BytesRef; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParserUtils; import org.elasticsearch.search.aggregations.ParsedMultiBucketAggregation; import org.elasticsearch.search.aggregations.bucket.MultiBucketsAggregation; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/correlation/BucketCorrelationAggregationBuilderTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/correlation/BucketCorrelationAggregationBuilderTests.java index 27904ea64e16f..72f20667ef099 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/correlation/BucketCorrelationAggregationBuilderTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/correlation/BucketCorrelationAggregationBuilderTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.plugins.SearchPlugin; import org.elasticsearch.search.aggregations.AggregationBuilder; import org.elasticsearch.search.aggregations.BasePipelineAggregationTestCase; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/correlation/CountCorrelationIndicatorTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/correlation/CountCorrelationIndicatorTests.java index f6c2388d0881e..9858462cb97bc 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/correlation/CountCorrelationIndicatorTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/correlation/CountCorrelationIndicatorTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.ml.aggs.correlation; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.test.ESTestCase; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/heuristic/PValueScoreTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/heuristic/PValueScoreTests.java index 49ab829e3679b..f7bcce1e3b88f 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/heuristic/PValueScoreTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/heuristic/PValueScoreTests.java @@ -10,7 +10,7 @@ import org.apache.commons.math3.util.FastMath; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.search.SearchModule; import org.elasticsearch.search.aggregations.bucket.AbstractNXYSignificanceHeuristicTestCase; import org.elasticsearch.search.aggregations.bucket.terms.heuristic.SignificanceHeuristic; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/inference/InferencePipelineAggregationBuilderTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/inference/InferencePipelineAggregationBuilderTests.java index ee1dedd360613..0d7f2d996bb0c 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/inference/InferencePipelineAggregationBuilderTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/inference/InferencePipelineAggregationBuilderTests.java @@ -10,7 +10,7 @@ import org.apache.lucene.util.SetOnce; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.plugins.SearchPlugin; import org.elasticsearch.search.aggregations.AggregationBuilder; @@ -24,7 +24,6 @@ import org.elasticsearch.xpack.core.ml.inference.trainedmodel.RegressionConfigUpdateTests; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.ResultsFieldUpdate; import org.elasticsearch.xpack.ml.MachineLearning; -import org.elasticsearch.xpack.ml.aggs.inference.InferencePipelineAggregationBuilder; import org.elasticsearch.xpack.ml.inference.loadingservice.ModelLoadingService; import java.util.Collections; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/inference/InternalInferenceAggregationTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/inference/InternalInferenceAggregationTests.java index c2229862c59f5..7244464ea5211 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/inference/InternalInferenceAggregationTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/inference/InternalInferenceAggregationTests.java @@ -7,10 +7,10 @@ package org.elasticsearch.xpack.ml.aggs.inference; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.CollectionUtils; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.plugins.SearchPlugin; import org.elasticsearch.search.aggregations.Aggregation; import org.elasticsearch.search.aggregations.InvalidAggregationPathException; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/inference/ParsedInference.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/inference/ParsedInference.java index c7a9d72aafee7..8009e9a4b8533 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/inference/ParsedInference.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/inference/ParsedInference.java @@ -7,12 +7,12 @@ package org.elasticsearch.xpack.ml.aggs.inference; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.aggregations.ParsedAggregation; import org.elasticsearch.xpack.core.ml.inference.results.SingleValueInferenceResults; import org.elasticsearch.xpack.core.ml.inference.results.TopClassEntry; @@ -23,7 +23,7 @@ import java.util.List; import java.util.Map; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; import static org.elasticsearch.xpack.core.ml.inference.results.ClassificationInferenceResults.PREDICTION_PROBABILITY; import static org.elasticsearch.xpack.core.ml.inference.results.ClassificationInferenceResults.PREDICTION_SCORE; import static org.elasticsearch.xpack.core.ml.inference.results.SingleValueInferenceResults.FEATURE_IMPORTANCE; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/annotations/AnnotationPersisterTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/annotations/AnnotationPersisterTests.java index d026bd9ab8676..2777d9cf649ba 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/annotations/AnnotationPersisterTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/annotations/AnnotationPersisterTests.java @@ -21,7 +21,7 @@ import org.elasticsearch.core.Tuple; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.threadpool.ThreadPool; @@ -41,7 +41,7 @@ import java.util.List; import static org.elasticsearch.core.Tuple.tuple; -import static org.elasticsearch.common.xcontent.json.JsonXContent.jsonXContent; +import static org.elasticsearch.xcontent.json.JsonXContent.jsonXContent; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasSize; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/datafeed/DatafeedJobTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/datafeed/DatafeedJobTests.java index 0fee58a2b0b71..1678fe0dfacd6 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/datafeed/DatafeedJobTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/datafeed/DatafeedJobTests.java @@ -21,10 +21,10 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContent; import org.elasticsearch.common.xcontent.XContentElasticsearchExtension; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.TimeValue; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.mock.orig.Mockito; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/datafeed/DatafeedJobValidatorTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/datafeed/DatafeedJobValidatorTests.java index a79e1bf777aea..2b242ff17a2a1 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/datafeed/DatafeedJobValidatorTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/datafeed/DatafeedJobValidatorTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.ElasticsearchStatusException; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.search.SearchModule; import org.elasticsearch.search.aggregations.AggregationBuilders; import org.elasticsearch.search.aggregations.AggregatorFactories; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/datafeed/delayeddatacheck/DelayedDataDetectorFactoryTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/datafeed/delayeddatacheck/DelayedDataDetectorFactoryTests.java index fa9fea39f1331..41324a4f4748a 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/datafeed/delayeddatacheck/DelayedDataDetectorFactoryTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/datafeed/delayeddatacheck/DelayedDataDetectorFactoryTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.client.Client; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.search.SearchModule; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.ml.datafeed.DatafeedConfig; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/datafeed/extractor/DataExtractorFactoryTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/datafeed/extractor/DataExtractorFactoryTests.java index 2ccfbeae6f051..1e4bba67dd107 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/datafeed/extractor/DataExtractorFactoryTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/datafeed/extractor/DataExtractorFactoryTests.java @@ -13,7 +13,7 @@ import org.elasticsearch.client.Client; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.search.SearchModule; import org.elasticsearch.search.aggregations.AggregationBuilders; import org.elasticsearch.search.aggregations.AggregatorFactories; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/datafeed/extractor/aggregation/AggregationDataExtractorFactoryTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/datafeed/extractor/aggregation/AggregationDataExtractorFactoryTests.java index 654f7997007ee..9044551b085cc 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/datafeed/extractor/aggregation/AggregationDataExtractorFactoryTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/datafeed/extractor/aggregation/AggregationDataExtractorFactoryTests.java @@ -8,7 +8,7 @@ import org.elasticsearch.client.Client; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.search.SearchModule; import org.elasticsearch.search.aggregations.AggregationBuilders; import org.elasticsearch.search.aggregations.AggregatorFactories; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/datafeed/extractor/chunked/ChunkedDataExtractorFactoryTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/datafeed/extractor/chunked/ChunkedDataExtractorFactoryTests.java index ead06341acf20..7362038446405 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/datafeed/extractor/chunked/ChunkedDataExtractorFactoryTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/datafeed/extractor/chunked/ChunkedDataExtractorFactoryTests.java @@ -8,7 +8,7 @@ import org.elasticsearch.client.Client; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.search.SearchModule; import org.elasticsearch.search.aggregations.AggregationBuilders; import org.elasticsearch.search.aggregations.AggregatorFactories; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/dataframe/DataFrameAnalyticsTaskTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/dataframe/DataFrameAnalyticsTaskTests.java index c179372134c00..0088e4c99fbd5 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/dataframe/DataFrameAnalyticsTaskTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/dataframe/DataFrameAnalyticsTaskTests.java @@ -18,10 +18,10 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.persistent.PersistentTasksService; import org.elasticsearch.persistent.UpdatePersistentTaskStatusAction; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/dataframe/DestinationIndexTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/dataframe/DestinationIndexTests.java index 0fe48f85c18f2..d88c379801442 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/dataframe/DestinationIndexTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/dataframe/DestinationIndexTests.java @@ -32,8 +32,8 @@ import org.elasticsearch.common.collect.ImmutableOpenMap; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.xpack.core.ml.dataframe.DataFrameAnalyticsConfig; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/dataframe/StoredProgressTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/dataframe/StoredProgressTests.java index 96bdc074d205e..53c4b13587d62 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/dataframe/StoredProgressTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/dataframe/StoredProgressTests.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.ml.dataframe; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import org.elasticsearch.xpack.core.ml.utils.PhaseProgress; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/dataframe/extractor/DataFrameDataExtractorTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/dataframe/extractor/DataFrameDataExtractorTests.java index 1766fb16e0b08..cf8390ec2bd4f 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/dataframe/extractor/DataFrameDataExtractorTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/dataframe/extractor/DataFrameDataExtractorTests.java @@ -15,7 +15,7 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.rest.RestStatus; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/dataframe/inference/InferenceRunnerTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/dataframe/inference/InferenceRunnerTests.java index deb7b6a667254..ec06f8f2250c4 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/dataframe/inference/InferenceRunnerTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/dataframe/inference/InferenceRunnerTests.java @@ -14,8 +14,8 @@ import org.elasticsearch.client.Client; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.search.SearchHit; import org.elasticsearch.tasks.TaskId; import org.elasticsearch.test.ESTestCase; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/dataframe/process/AnalyticsProcessConfigTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/dataframe/process/AnalyticsProcessConfigTests.java index 08ad208062bb3..2564f87fe0a02 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/dataframe/process/AnalyticsProcessConfigTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/dataframe/process/AnalyticsProcessConfigTests.java @@ -8,10 +8,10 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.ml.dataframe.analyses.Classification; import org.elasticsearch.xpack.core.ml.dataframe.analyses.DataFrameAnalysis; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/dataframe/process/ChunkedTrainedModelPersisterTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/dataframe/process/ChunkedTrainedModelPersisterTests.java index 49be42cbcaee2..e2b00fa6dfac3 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/dataframe/process/ChunkedTrainedModelPersisterTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/dataframe/process/ChunkedTrainedModelPersisterTests.java @@ -11,7 +11,7 @@ import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.admin.indices.refresh.RefreshResponse; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.license.License; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.ml.dataframe.DataFrameAnalyticsConfig; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/dataframe/process/results/AnalyticsResultTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/dataframe/process/results/AnalyticsResultTests.java index 9714eee5a4386..446ac669d1cc9 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/dataframe/process/results/AnalyticsResultTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/dataframe/process/results/AnalyticsResultTests.java @@ -7,9 +7,9 @@ package org.elasticsearch.xpack.ml.dataframe.process.results; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.SearchModule; import org.elasticsearch.test.AbstractXContentTestCase; import org.elasticsearch.xpack.core.ml.dataframe.stats.classification.ClassificationStatsTests; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/dataframe/process/results/MemoryUsageEstimationResultTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/dataframe/process/results/MemoryUsageEstimationResultTests.java index ca6da18537f7d..2293ad4348126 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/dataframe/process/results/MemoryUsageEstimationResultTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/dataframe/process/results/MemoryUsageEstimationResultTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.ml.dataframe.process.results; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/dataframe/process/results/RowResultsTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/dataframe/process/results/RowResultsTests.java index 80d93b48f3019..cd4673c9452a4 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/dataframe/process/results/RowResultsTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/dataframe/process/results/RowResultsTests.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.ml.dataframe.process.results; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.util.HashMap; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/allocation/TrainedModelAllocationMetadataTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/allocation/TrainedModelAllocationMetadataTests.java index 3b6bbc0a4fbdd..1de97cc5991f3 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/allocation/TrainedModelAllocationMetadataTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/allocation/TrainedModelAllocationMetadataTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.ml.inference.allocation; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ml.action.StartTrainedModelDeploymentAction; import org.elasticsearch.xpack.core.ml.inference.allocation.TrainedModelAllocation; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/deployment/PyTorchResultTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/deployment/PyTorchResultTests.java index 89cd48467f390..6cf117ebd149b 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/deployment/PyTorchResultTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/deployment/PyTorchResultTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.ml.inference.deployment; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/ingest/InferenceProcessorFactoryTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/ingest/InferenceProcessorFactoryTests.java index 15ad0f97695ff..5ad5d00347fe2 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/ingest/InferenceProcessorFactoryTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/ingest/InferenceProcessorFactoryTests.java @@ -24,9 +24,9 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.transport.TransportAddress; import org.elasticsearch.common.util.concurrent.EsExecutors; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.ingest.IngestMetadata; import org.elasticsearch.ingest.PipelineConfiguration; import org.elasticsearch.test.ESTestCase; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/loadingservice/ModelLoadingServiceTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/loadingservice/ModelLoadingServiceTests.java index e066d60e83829..24494f19bd9c8 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/loadingservice/ModelLoadingServiceTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/loadingservice/ModelLoadingServiceTests.java @@ -27,9 +27,9 @@ import org.elasticsearch.common.transport.TransportAddress; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.ingest.IngestMetadata; import org.elasticsearch.ingest.PipelineConfiguration; import org.elasticsearch.license.XPackLicenseState; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/modelsize/EnsembleSizeInfoTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/modelsize/EnsembleSizeInfoTests.java index 4517c1af837f5..ad46943bc0028 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/modelsize/EnsembleSizeInfoTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/modelsize/EnsembleSizeInfoTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.ml.inference.modelsize; import org.elasticsearch.ElasticsearchException; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.ensemble.Ensemble; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.ensemble.EnsembleTests; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.inference.EnsembleInferenceModel; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/modelsize/FrequencyEncodingSizeTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/modelsize/FrequencyEncodingSizeTests.java index d8ed647750ff7..d23ff913de451 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/modelsize/FrequencyEncodingSizeTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/modelsize/FrequencyEncodingSizeTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.ml.inference.modelsize; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.inference.preprocessing.FrequencyEncoding; import org.elasticsearch.xpack.core.ml.inference.preprocessing.FrequencyEncodingTests; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/modelsize/ModelSizeInfoTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/modelsize/ModelSizeInfoTests.java index 4fb1787e98d41..ddda72cc77057 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/modelsize/ModelSizeInfoTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/modelsize/ModelSizeInfoTests.java @@ -8,11 +8,11 @@ package org.elasticsearch.xpack.ml.inference.modelsize; import org.elasticsearch.common.bytes.BytesArray; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/modelsize/OneHotEncodingSizeTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/modelsize/OneHotEncodingSizeTests.java index 6146342a8da66..9cbdde5c877b8 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/modelsize/OneHotEncodingSizeTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/modelsize/OneHotEncodingSizeTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.ml.inference.modelsize; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.inference.preprocessing.OneHotEncoding; import org.elasticsearch.xpack.core.ml.inference.preprocessing.OneHotEncodingTests; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/modelsize/SizeEstimatorTestCase.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/modelsize/SizeEstimatorTestCase.java index c8ed420a7ba53..7321d7f4fd557 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/modelsize/SizeEstimatorTestCase.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/modelsize/SizeEstimatorTestCase.java @@ -9,7 +9,7 @@ import org.apache.lucene.util.Accountable; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.ToXContentObject; import org.elasticsearch.test.AbstractXContentTestCase; import static org.hamcrest.Matchers.is; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/modelsize/TargetMeanEncodingSizeTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/modelsize/TargetMeanEncodingSizeTests.java index 0b1745e61376b..9c73c2cb5a37a 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/modelsize/TargetMeanEncodingSizeTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/modelsize/TargetMeanEncodingSizeTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.ml.inference.modelsize; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.inference.preprocessing.TargetMeanEncoding; import org.elasticsearch.xpack.core.ml.inference.preprocessing.TargetMeanEncodingTests; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/modelsize/TreeSizeInfoTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/modelsize/TreeSizeInfoTests.java index 78f6bfe895394..cd5398b35ab0a 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/modelsize/TreeSizeInfoTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/modelsize/TreeSizeInfoTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.ml.inference.modelsize; import org.elasticsearch.ElasticsearchException; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.inference.TreeInferenceModel; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.inference.TreeInferenceModelTests; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.tree.TreeTests; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/BertRequestBuilderTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/BertRequestBuilderTests.java index 490235e3e7fda..3b6fa5e622716 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/BertRequestBuilderTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/BertRequestBuilderTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.ElasticsearchStatusException; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.BertTokenization; import org.elasticsearch.xpack.ml.inference.nlp.tokenizers.BertTokenizer; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/TextClassificationProcessorTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/TextClassificationProcessorTests.java index eff3194fcd0b8..3338f149092c4 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/TextClassificationProcessorTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/TextClassificationProcessorTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.ml.inference.nlp; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.ml.inference.results.InferenceResults; import org.elasticsearch.xpack.core.ml.inference.results.WarningInferenceResults; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/ZeroShotClassificationProcessorTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/ZeroShotClassificationProcessorTests.java index 8c54ef4f6c2f9..82c41561a92a6 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/ZeroShotClassificationProcessorTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/ZeroShotClassificationProcessorTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.ml.inference.nlp; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.BertTokenization; import org.elasticsearch.xpack.core.ml.inference.trainedmodel.NlpConfig; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/persistence/TrainedModelDefinitionDocTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/persistence/TrainedModelDefinitionDocTests.java index c44a988d6a52c..fdf854ef9ce60 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/persistence/TrainedModelDefinitionDocTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/persistence/TrainedModelDefinitionDocTests.java @@ -8,8 +8,8 @@ package org.elasticsearch.xpack.ml.inference.persistence; import org.elasticsearch.common.bytes.BytesArray; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/persistence/TrainedModelProviderTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/persistence/TrainedModelProviderTests.java index f353a8221d459..b3bec37783773 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/persistence/TrainedModelProviderTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/persistence/TrainedModelProviderTests.java @@ -11,7 +11,7 @@ import org.elasticsearch.client.Client; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.index.query.BoolQueryBuilder; import org.elasticsearch.index.query.ConstantScoreQueryBuilder; import org.elasticsearch.index.query.QueryBuilder; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/trainedmodels/langident/LangIdentNeuralNetworkInferenceTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/trainedmodels/langident/LangIdentNeuralNetworkInferenceTests.java index 90700553da5ea..7092ad28592a7 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/trainedmodels/langident/LangIdentNeuralNetworkInferenceTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/trainedmodels/langident/LangIdentNeuralNetworkInferenceTests.java @@ -8,7 +8,7 @@ import org.elasticsearch.action.support.PlainActionFuture; import org.elasticsearch.client.Client; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.ml.action.GetTrainedModelsAction; import org.elasticsearch.xpack.core.ml.inference.MlInferenceNamedXContentProvider; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/JobManagerTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/JobManagerTests.java index ea9dd30119424..d557ec7df2c24 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/JobManagerTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/JobManagerTests.java @@ -29,10 +29,10 @@ import org.elasticsearch.common.document.DocumentField; import org.elasticsearch.common.settings.ClusterSettings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.env.Environment; import org.elasticsearch.env.TestEnvironment; import org.elasticsearch.index.Index; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/config/CategorizationAnalyzerConfigTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/config/CategorizationAnalyzerConfigTests.java index 5afcce23208b9..0e11b6855f601 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/config/CategorizationAnalyzerConfigTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/config/CategorizationAnalyzerConfigTests.java @@ -7,8 +7,8 @@ package org.elasticsearch.xpack.ml.job.config; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ml.job.config.CategorizationAnalyzerConfig; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/config/JobTaskStateTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/config/JobTaskStateTests.java index 992b11220fc6d..f4f9862dca8f1 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/config/JobTaskStateTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/config/JobTaskStateTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.ml.job.config; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ml.job.config.JobState; import org.elasticsearch.xpack.core.ml.job.config.JobTaskState; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/persistence/JobResultsProviderTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/persistence/JobResultsProviderTests.java index 2ba1a9c7ab3dc..b6d6cd397496f 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/persistence/JobResultsProviderTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/persistence/JobResultsProviderTests.java @@ -26,10 +26,10 @@ import org.elasticsearch.common.document.DocumentField; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.indices.TestIndexNameExpressionResolver; import org.elasticsearch.search.SearchHit; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/persistence/MockClientBuilder.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/persistence/MockClientBuilder.java index 4042bbae647c9..bdaffbea75e96 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/persistence/MockClientBuilder.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/persistence/MockClientBuilder.java @@ -29,7 +29,7 @@ import org.elasticsearch.common.document.DocumentField; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.SearchHits; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/persistence/StateStreamerTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/persistence/StateStreamerTests.java index ae1ea6b712d15..d118c2fc4ebe0 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/persistence/StateStreamerTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/persistence/StateStreamerTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.client.Client; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.mock.orig.Mockito; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/process/autodetect/AutodetectCommunicatorTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/process/autodetect/AutodetectCommunicatorTests.java index e3662d3eeeb1f..165e2553ccf20 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/process/autodetect/AutodetectCommunicatorTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/process/autodetect/AutodetectCommunicatorTests.java @@ -8,8 +8,8 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.env.Environment; import org.elasticsearch.env.TestEnvironment; import org.elasticsearch.index.analysis.AnalysisRegistry; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/process/autodetect/AutodetectProcessManagerTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/process/autodetect/AutodetectProcessManagerTests.java index 3892992f01313..50ba3baa09e7f 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/process/autodetect/AutodetectProcessManagerTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/process/autodetect/AutodetectProcessManagerTests.java @@ -22,8 +22,8 @@ import org.elasticsearch.common.util.concurrent.EsExecutors; import org.elasticsearch.common.util.concurrent.EsRejectedExecutionException; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.env.Environment; import org.elasticsearch.env.TestEnvironment; import org.elasticsearch.index.analysis.AnalysisRegistry; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/process/autodetect/NativeAutodetectProcessTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/process/autodetect/NativeAutodetectProcessTests.java index 053624af743ea..36f5734ac50f2 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/process/autodetect/NativeAutodetectProcessTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/process/autodetect/NativeAutodetectProcessTests.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.ml.job.process.autodetect; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.ml.job.config.ModelPlotConfig; import org.elasticsearch.xpack.ml.process.IndexingStateProcessor; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/process/autodetect/output/FlushAcknowledgementTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/process/autodetect/output/FlushAcknowledgementTests.java index a6863ca3abb02..214111c343926 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/process/autodetect/output/FlushAcknowledgementTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/process/autodetect/output/FlushAcknowledgementTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.ml.job.process.autodetect.output; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ml.job.process.autodetect.output.FlushAcknowledgement; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/process/autodetect/params/ForecastParamsTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/process/autodetect/params/ForecastParamsTests.java index d1336d608becb..6c51d39e3c4bf 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/process/autodetect/params/ForecastParamsTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/process/autodetect/params/ForecastParamsTests.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.ml.job.process.autodetect.params; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.TimeValue; import org.elasticsearch.test.ESTestCase; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/process/autodetect/writer/AbstractDataToProcessWriterTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/process/autodetect/writer/AbstractDataToProcessWriterTests.java index 580178e090b88..c4c519d6bad59 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/process/autodetect/writer/AbstractDataToProcessWriterTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/process/autodetect/writer/AbstractDataToProcessWriterTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.ml.job.process.autodetect.writer; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.env.Environment; import org.elasticsearch.env.TestEnvironment; import org.elasticsearch.index.analysis.AnalysisRegistry; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/process/autodetect/writer/JsonDataToProcessWriterTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/process/autodetect/writer/JsonDataToProcessWriterTests.java index 405205c8b9a52..7c8e9847a1d2f 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/process/autodetect/writer/JsonDataToProcessWriterTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/process/autodetect/writer/JsonDataToProcessWriterTests.java @@ -11,10 +11,10 @@ import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentGenerator; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentGenerator; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.env.Environment; import org.elasticsearch.env.TestEnvironment; import org.elasticsearch.index.analysis.AnalysisRegistry; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/process/autodetect/writer/XContentRecordReaderTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/process/autodetect/writer/XContentRecordReaderTests.java index 4002da1fc4f45..b323e0edde107 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/process/autodetect/writer/XContentRecordReaderTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/process/autodetect/writer/XContentRecordReaderTests.java @@ -9,11 +9,11 @@ import com.fasterxml.jackson.core.JsonParseException; import org.apache.logging.log4j.Logger; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.ml.job.process.CountingInputStream; import org.elasticsearch.xpack.ml.job.process.DataCountsReporter; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/process/normalizer/NormalizerResultTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/process/normalizer/NormalizerResultTests.java index 398f2f172aa9f..56060196757b2 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/process/normalizer/NormalizerResultTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/process/normalizer/NormalizerResultTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.ml.job.process.normalizer; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; public class NormalizerResultTests extends AbstractSerializingTestCase { diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/results/AutodetectResultTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/results/AutodetectResultTests.java index d8ac8d37ed761..74b01812d0b97 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/results/AutodetectResultTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/results/AutodetectResultTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.ml.job.results; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ml.annotations.Annotation; import org.elasticsearch.xpack.core.ml.annotations.AnnotationTests; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/results/BucketTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/results/BucketTests.java index 52fa7602e58a8..b237d0922c8a1 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/results/BucketTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/results/BucketTests.java @@ -7,8 +7,8 @@ package org.elasticsearch.xpack.ml.job.results; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ml.job.results.AnomalyRecord; import org.elasticsearch.xpack.core.ml.job.results.AnomalyRecordTests; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/results/CategoryDefinitionTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/results/CategoryDefinitionTests.java index cc8818f8d2031..e6eb545597ee0 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/results/CategoryDefinitionTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/results/CategoryDefinitionTests.java @@ -8,8 +8,8 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.ml.AbstractBWCSerializationTestCase; import org.elasticsearch.xpack.core.ml.job.results.CategoryDefinition; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/results/ForecastRequestStatsTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/results/ForecastRequestStatsTests.java index 825f876796442..6c39efefaf36b 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/results/ForecastRequestStatsTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/results/ForecastRequestStatsTests.java @@ -7,8 +7,8 @@ package org.elasticsearch.xpack.ml.job.results; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ml.job.results.ForecastRequestStats; import org.elasticsearch.xpack.core.ml.job.results.ForecastRequestStats.ForecastRequestStatus; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/results/ForecastTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/results/ForecastTests.java index e0e029a01132f..df27559c3217c 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/results/ForecastTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/results/ForecastTests.java @@ -7,8 +7,8 @@ package org.elasticsearch.xpack.ml.job.results; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ml.MachineLearningField; import org.elasticsearch.xpack.core.ml.job.results.Forecast; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/results/InfluenceTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/results/InfluenceTests.java index cebbf6479de84..06959551ff730 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/results/InfluenceTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/results/InfluenceTests.java @@ -7,8 +7,8 @@ package org.elasticsearch.xpack.ml.job.results; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ml.job.results.Influence; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/results/ModelPlotTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/results/ModelPlotTests.java index 3dde0aec27e1c..3463c4c503ede 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/results/ModelPlotTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/results/ModelPlotTests.java @@ -8,10 +8,10 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.ml.MachineLearningField; import org.elasticsearch.xpack.core.ml.job.results.ModelPlot; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/retention/AbstractExpiredJobDataRemoverTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/retention/AbstractExpiredJobDataRemoverTests.java index f21b8340ec579..905a43bf1dd29 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/retention/AbstractExpiredJobDataRemoverTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/retention/AbstractExpiredJobDataRemoverTests.java @@ -13,9 +13,9 @@ import org.elasticsearch.client.OriginSettingClient; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.SearchHits; import org.elasticsearch.tasks.TaskId; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/retention/ExpiredModelSnapshotsRemoverTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/retention/ExpiredModelSnapshotsRemoverTests.java index 30c553973a6a6..8b5cdde65ff3a 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/retention/ExpiredModelSnapshotsRemoverTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/retention/ExpiredModelSnapshotsRemoverTests.java @@ -13,7 +13,7 @@ import org.elasticsearch.action.support.master.AcknowledgedResponse; import org.elasticsearch.client.Client; import org.elasticsearch.client.OriginSettingClient; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.TimeValue; import org.elasticsearch.index.query.IdsQueryBuilder; import org.elasticsearch.index.reindex.DeleteByQueryAction; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/process/ControllerResponseTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/process/ControllerResponseTests.java index 7a44cc49d4b03..4e013bec3e63a 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/process/ControllerResponseTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/process/ControllerResponseTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.ml.process; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractXContentTestCase; import java.io.IOException; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/process/NativeControllerTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/process/NativeControllerTests.java index d57df37b37e16..6903726d15bc8 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/process/NativeControllerTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/process/NativeControllerTests.java @@ -8,7 +8,7 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.env.Environment; import org.elasticsearch.env.TestEnvironment; import org.elasticsearch.test.ESTestCase; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/process/ProcessResultsParserTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/process/ProcessResultsParserTests.java index 469c97a1fd1a1..9ede296e8910b 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/process/ProcessResultsParserTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/process/ProcessResultsParserTests.java @@ -7,10 +7,10 @@ package org.elasticsearch.xpack.ml.process; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParseException; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParseException; import org.elasticsearch.test.ESTestCase; import java.io.ByteArrayInputStream; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/process/logging/CppLogMessageTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/process/logging/CppLogMessageTests.java index 5a4401a101e38..944b270df57a5 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/process/logging/CppLogMessageTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/process/logging/CppLogMessageTests.java @@ -7,12 +7,12 @@ package org.elasticsearch.xpack.ml.process.logging; import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContent; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContent; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.AbstractSerializingTestCase; import java.io.IOException; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/rest/datafeeds/RestStartDatafeedActionTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/rest/datafeeds/RestStartDatafeedActionTests.java index 8a39529a04b12..89b9241673955 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/rest/datafeeds/RestStartDatafeedActionTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/rest/datafeeds/RestStartDatafeedActionTests.java @@ -8,7 +8,7 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.rest.FakeRestRequest; diff --git a/x-pack/plugin/monitoring/src/internalClusterTest/java/org/elasticsearch/xpack/monitoring/exporter/http/HttpExporterIT.java b/x-pack/plugin/monitoring/src/internalClusterTest/java/org/elasticsearch/xpack/monitoring/exporter/http/HttpExporterIT.java index 2929cd9549622..151f106eca4fe 100644 --- a/x-pack/plugin/monitoring/src/internalClusterTest/java/org/elasticsearch/xpack/monitoring/exporter/http/HttpExporterIT.java +++ b/x-pack/plugin/monitoring/src/internalClusterTest/java/org/elasticsearch/xpack/monitoring/exporter/http/HttpExporterIT.java @@ -26,13 +26,13 @@ import org.elasticsearch.common.time.DateFormatter; import org.elasticsearch.common.util.concurrent.ThreadContext; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.env.Environment; import org.elasticsearch.env.TestEnvironment; import org.elasticsearch.license.TestUtils; @@ -72,7 +72,7 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils.LAST_UPDATED_VERSION; import static org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils.TEMPLATE_VERSION; import static org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils.indexName; diff --git a/x-pack/plugin/monitoring/src/internalClusterTest/java/org/elasticsearch/xpack/monitoring/integration/MonitoringIT.java b/x-pack/plugin/monitoring/src/internalClusterTest/java/org/elasticsearch/xpack/monitoring/integration/MonitoringIT.java index de6454a317314..3ee2089fa1645 100644 --- a/x-pack/plugin/monitoring/src/internalClusterTest/java/org/elasticsearch/xpack/monitoring/integration/MonitoringIT.java +++ b/x-pack/plugin/monitoring/src/internalClusterTest/java/org/elasticsearch/xpack/monitoring/integration/MonitoringIT.java @@ -19,10 +19,10 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.time.DateFormatter; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.search.SearchHit; @@ -60,7 +60,7 @@ import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; -import static org.elasticsearch.common.xcontent.ToXContent.EMPTY_PARAMS; +import static org.elasticsearch.xcontent.ToXContent.EMPTY_PARAMS; import static org.elasticsearch.common.xcontent.support.XContentMapValues.extractValue; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.elasticsearch.threadpool.ThreadPool.Names.WRITE; diff --git a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/Monitoring.java b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/Monitoring.java index 17efb21fb23d2..7a15acc04fcf2 100644 --- a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/Monitoring.java +++ b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/Monitoring.java @@ -18,7 +18,7 @@ import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.SettingsFilter; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.env.Environment; import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.license.LicenseService; diff --git a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/MonitoringTemplateRegistry.java b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/MonitoringTemplateRegistry.java index d4f14d70fb61c..032213e3eafc6 100644 --- a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/MonitoringTemplateRegistry.java +++ b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/MonitoringTemplateRegistry.java @@ -14,7 +14,7 @@ import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.xpack.core.ClientHelper; import org.elasticsearch.xpack.core.monitoring.MonitoredSystem; diff --git a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/action/TransportMonitoringBulkAction.java b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/action/TransportMonitoringBulkAction.java index 8b3859f0435ff..e6a5ee8a86799 100644 --- a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/action/TransportMonitoringBulkAction.java +++ b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/action/TransportMonitoringBulkAction.java @@ -15,7 +15,7 @@ import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.inject.Inject; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.tasks.Task; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.TransportService; diff --git a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/collector/ccr/AutoFollowStatsMonitoringDoc.java b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/collector/ccr/AutoFollowStatsMonitoringDoc.java index d35f56ce085d2..d5e767d75b5e3 100644 --- a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/collector/ccr/AutoFollowStatsMonitoringDoc.java +++ b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/collector/ccr/AutoFollowStatsMonitoringDoc.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.monitoring.collector.ccr; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ccr.AutoFollowStats; import org.elasticsearch.xpack.core.monitoring.MonitoredSystem; import org.elasticsearch.xpack.core.monitoring.exporter.MonitoringDoc; diff --git a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/collector/ccr/FollowStatsMonitoringDoc.java b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/collector/ccr/FollowStatsMonitoringDoc.java index 5b987dec5043a..1554d5a082d78 100644 --- a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/collector/ccr/FollowStatsMonitoringDoc.java +++ b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/collector/ccr/FollowStatsMonitoringDoc.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.monitoring.collector.ccr; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ccr.ShardFollowNodeTaskStatus; import org.elasticsearch.xpack.core.monitoring.MonitoredSystem; import org.elasticsearch.xpack.core.monitoring.exporter.MonitoringDoc; diff --git a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/collector/cluster/ClusterStatsMonitoringDoc.java b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/collector/cluster/ClusterStatsMonitoringDoc.java index d61bfd5971902..332c1f3ec28bf 100644 --- a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/collector/cluster/ClusterStatsMonitoringDoc.java +++ b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/collector/cluster/ClusterStatsMonitoringDoc.java @@ -14,8 +14,8 @@ import org.elasticsearch.cluster.node.DiscoveryNodes; import org.elasticsearch.core.Nullable; import org.elasticsearch.common.collect.MapBuilder; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.license.License; import org.elasticsearch.xpack.core.XPackFeatureSet; import org.elasticsearch.xpack.core.monitoring.MonitoredSystem; diff --git a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/collector/enrich/EnrichCoordinatorDoc.java b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/collector/enrich/EnrichCoordinatorDoc.java index 51dd84b33a890..ed8683d4bf71d 100644 --- a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/collector/enrich/EnrichCoordinatorDoc.java +++ b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/collector/enrich/EnrichCoordinatorDoc.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.monitoring.collector.enrich; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.enrich.action.EnrichStatsAction.Response.CoordinatorStats; import org.elasticsearch.xpack.core.monitoring.MonitoredSystem; import org.elasticsearch.xpack.core.monitoring.exporter.MonitoringDoc; diff --git a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/collector/enrich/ExecutingPolicyDoc.java b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/collector/enrich/ExecutingPolicyDoc.java index a6441b59cdd74..e5dd723250623 100644 --- a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/collector/enrich/ExecutingPolicyDoc.java +++ b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/collector/enrich/ExecutingPolicyDoc.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.monitoring.collector.enrich; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.enrich.action.EnrichStatsAction.Response.ExecutingPolicy; import org.elasticsearch.xpack.core.monitoring.MonitoredSystem; import org.elasticsearch.xpack.core.monitoring.exporter.MonitoringDoc; diff --git a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/collector/indices/IndexRecoveryMonitoringDoc.java b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/collector/indices/IndexRecoveryMonitoringDoc.java index 86ecc713a9fcb..1417a0da90b90 100644 --- a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/collector/indices/IndexRecoveryMonitoringDoc.java +++ b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/collector/indices/IndexRecoveryMonitoringDoc.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.monitoring.collector.indices; import org.elasticsearch.action.admin.indices.recovery.RecoveryResponse; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.indices.recovery.RecoveryState; import org.elasticsearch.xpack.core.monitoring.MonitoredSystem; import org.elasticsearch.xpack.core.monitoring.exporter.MonitoringDoc; diff --git a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/collector/indices/IndexStatsMonitoringDoc.java b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/collector/indices/IndexStatsMonitoringDoc.java index 500c7a96a1723..36baa241d1806 100644 --- a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/collector/indices/IndexStatsMonitoringDoc.java +++ b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/collector/indices/IndexStatsMonitoringDoc.java @@ -13,7 +13,7 @@ import org.elasticsearch.cluster.routing.IndexRoutingTable; import org.elasticsearch.core.Nullable; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.monitoring.MonitoredSystem; import org.elasticsearch.xpack.core.monitoring.exporter.MonitoringDoc; import org.elasticsearch.xpack.monitoring.exporter.FilteredMonitoringDoc; diff --git a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/collector/indices/IndicesStatsMonitoringDoc.java b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/collector/indices/IndicesStatsMonitoringDoc.java index 3d3e6469d307c..a5cde39d4b5a4 100644 --- a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/collector/indices/IndicesStatsMonitoringDoc.java +++ b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/collector/indices/IndicesStatsMonitoringDoc.java @@ -10,7 +10,7 @@ import org.elasticsearch.action.admin.indices.stats.IndexStats; import org.elasticsearch.action.admin.indices.stats.ShardStats; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.monitoring.MonitoredSystem; import org.elasticsearch.xpack.core.monitoring.exporter.MonitoringDoc; import org.elasticsearch.xpack.monitoring.exporter.FilteredMonitoringDoc; diff --git a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/collector/ml/JobStatsMonitoringDoc.java b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/collector/ml/JobStatsMonitoringDoc.java index 17d1fc2135a9e..4784d56bb639a 100644 --- a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/collector/ml/JobStatsMonitoringDoc.java +++ b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/collector/ml/JobStatsMonitoringDoc.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.monitoring.collector.ml; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.ml.action.GetJobsStatsAction.Response.JobStats; import org.elasticsearch.xpack.core.monitoring.MonitoredSystem; import org.elasticsearch.xpack.core.monitoring.exporter.MonitoringDoc; diff --git a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/collector/node/NodeStatsMonitoringDoc.java b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/collector/node/NodeStatsMonitoringDoc.java index f58477128cbd5..3ffc1c64fa953 100644 --- a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/collector/node/NodeStatsMonitoringDoc.java +++ b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/collector/node/NodeStatsMonitoringDoc.java @@ -8,7 +8,7 @@ import org.elasticsearch.action.admin.cluster.node.stats.NodeStats; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.monitoring.MonitoredSystem; import org.elasticsearch.xpack.core.monitoring.exporter.MonitoringDoc; import org.elasticsearch.xpack.monitoring.exporter.FilteredMonitoringDoc; diff --git a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/collector/shards/ShardMonitoringDoc.java b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/collector/shards/ShardMonitoringDoc.java index 97b3826095c76..7c8d18ffe9d1f 100644 --- a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/collector/shards/ShardMonitoringDoc.java +++ b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/collector/shards/ShardMonitoringDoc.java @@ -8,7 +8,7 @@ import org.elasticsearch.cluster.routing.ShardRouting; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.monitoring.MonitoredSystem; import org.elasticsearch.xpack.core.monitoring.exporter.MonitoringDoc; import org.elasticsearch.xpack.monitoring.exporter.FilteredMonitoringDoc; diff --git a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/BytesReferenceMonitoringDoc.java b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/BytesReferenceMonitoringDoc.java index b09d32fbd2852..16dc44e3c3552 100644 --- a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/BytesReferenceMonitoringDoc.java +++ b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/BytesReferenceMonitoringDoc.java @@ -8,8 +8,8 @@ import org.elasticsearch.core.Nullable; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.monitoring.MonitoredSystem; import org.elasticsearch.xpack.core.monitoring.exporter.MonitoringDoc; diff --git a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/ExportException.java b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/ExportException.java index ee209d2da3ea1..2e052e5e9a001 100644 --- a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/ExportException.java +++ b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/ExportException.java @@ -9,7 +9,7 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.ArrayList; diff --git a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/FilteredMonitoringDoc.java b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/FilteredMonitoringDoc.java index 97b25e08bfd25..45861de3a3a02 100644 --- a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/FilteredMonitoringDoc.java +++ b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/FilteredMonitoringDoc.java @@ -10,9 +10,9 @@ import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.util.set.Sets; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.XContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.monitoring.MonitoredSystem; import org.elasticsearch.xpack.core.monitoring.exporter.MonitoringDoc; @@ -20,7 +20,7 @@ import java.io.InputStream; import java.util.Set; -import static org.elasticsearch.common.xcontent.NamedXContentRegistry.EMPTY; +import static org.elasticsearch.xcontent.NamedXContentRegistry.EMPTY; /** * {@link FilteredMonitoringDoc} are a kind of {@link MonitoringDoc} whose XContent diff --git a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/http/ClusterAlertHttpResource.java b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/http/ClusterAlertHttpResource.java index a74dd786406e3..5090ac2562d93 100644 --- a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/http/ClusterAlertHttpResource.java +++ b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/http/ClusterAlertHttpResource.java @@ -19,9 +19,9 @@ import org.elasticsearch.client.RestClient; import org.elasticsearch.core.CheckedFunction; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.XContent; +import org.elasticsearch.xcontent.XContent; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.license.XPackLicenseState; import java.util.Objects; diff --git a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/http/HttpExportBulk.java b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/http/HttpExportBulk.java index 9ee1ab4dc64d6..383ad61dd21fd 100644 --- a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/http/HttpExportBulk.java +++ b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/http/HttpExportBulk.java @@ -21,10 +21,10 @@ import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.time.DateFormatter; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.monitoring.exporter.MonitoringDoc; import org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils; import org.elasticsearch.xpack.monitoring.exporter.ExportBulk; diff --git a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/http/HttpExportBulkResponseListener.java b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/http/HttpExportBulkResponseListener.java index 6e562e87f9dde..c351d1c2ea440 100644 --- a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/http/HttpExportBulkResponseListener.java +++ b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/http/HttpExportBulkResponseListener.java @@ -11,10 +11,10 @@ import org.elasticsearch.client.Response; import org.elasticsearch.client.ResponseListener; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContent; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.util.Objects; diff --git a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/http/PublishableHttpResource.java b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/http/PublishableHttpResource.java index a4c6724f02761..eed5c90b18499 100644 --- a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/http/PublishableHttpResource.java +++ b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/http/PublishableHttpResource.java @@ -20,7 +20,7 @@ import org.elasticsearch.core.Nullable; import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.XContent; +import org.elasticsearch.xcontent.XContent; import org.elasticsearch.common.xcontent.XContentHelper; import org.elasticsearch.rest.RestStatus; diff --git a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/http/TemplateHttpResource.java b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/http/TemplateHttpResource.java index 5d2880b80b5dd..32e7346c6f9a1 100644 --- a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/http/TemplateHttpResource.java +++ b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/http/TemplateHttpResource.java @@ -12,7 +12,7 @@ import org.elasticsearch.client.RestClient; import org.elasticsearch.core.Nullable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils; import java.util.Collections; diff --git a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/http/VersionHttpResource.java b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/http/VersionHttpResource.java index 662038c315326..253d826a01917 100644 --- a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/http/VersionHttpResource.java +++ b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/http/VersionHttpResource.java @@ -17,7 +17,7 @@ import org.elasticsearch.client.ResponseListener; import org.elasticsearch.client.RestClient; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.json.JsonXContent; import java.io.IOException; import java.util.Map; diff --git a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/http/WatcherExistsHttpResource.java b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/http/WatcherExistsHttpResource.java index afa36edc1d575..ee4237ac6cbd8 100644 --- a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/http/WatcherExistsHttpResource.java +++ b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/http/WatcherExistsHttpResource.java @@ -14,9 +14,9 @@ import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.core.CheckedFunction; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.XContent; +import org.elasticsearch.xcontent.XContent; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.rest.RestStatus; import java.io.IOException; diff --git a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/local/LocalBulk.java b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/local/LocalBulk.java index c1c6e925edfe3..888e99efa9d04 100644 --- a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/local/LocalBulk.java +++ b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/local/LocalBulk.java @@ -17,7 +17,7 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.time.DateFormatter; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.monitoring.exporter.MonitoringDoc; import org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils; import org.elasticsearch.xpack.monitoring.exporter.ExportBulk; diff --git a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/local/LocalExporter.java b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/local/LocalExporter.java index bad592de621c2..be9bc32033daa 100644 --- a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/local/LocalExporter.java +++ b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/local/LocalExporter.java @@ -33,7 +33,7 @@ import org.elasticsearch.common.time.DateFormatter; import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.gateway.GatewayService; import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.license.LicenseStateListener; diff --git a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/rest/action/RestMonitoringBulkAction.java b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/rest/action/RestMonitoringBulkAction.java index 08d17092f58b5..52fc6792145b2 100644 --- a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/rest/action/RestMonitoringBulkAction.java +++ b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/rest/action/RestMonitoringBulkAction.java @@ -9,7 +9,7 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BytesRestResponse; diff --git a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/rest/action/RestMonitoringMigrateAlertsAction.java b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/rest/action/RestMonitoringMigrateAlertsAction.java index 7783d385cc7bc..0e643e80f6388 100644 --- a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/rest/action/RestMonitoringMigrateAlertsAction.java +++ b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/rest/action/RestMonitoringMigrateAlertsAction.java @@ -11,8 +11,8 @@ import java.util.List; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestChannel; diff --git a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/MonitoringInfoTransportActionTests.java b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/MonitoringInfoTransportActionTests.java index 4d125573bad8c..a10430f4d9f58 100644 --- a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/MonitoringInfoTransportActionTests.java +++ b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/MonitoringInfoTransportActionTests.java @@ -12,8 +12,8 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.VersionUtils; import org.elasticsearch.test.rest.yaml.ObjectPath; @@ -30,7 +30,7 @@ import java.util.Arrays; import java.util.List; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.CoreMatchers.nullValue; import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.core.Is.is; diff --git a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/MonitoringTestUtils.java b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/MonitoringTestUtils.java index 7cf5f64be60c9..7f1ff3173676a 100644 --- a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/MonitoringTestUtils.java +++ b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/MonitoringTestUtils.java @@ -11,7 +11,7 @@ import com.carrotsearch.randomizedtesting.generators.RandomStrings; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.transport.TransportAddress; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.RandomObjects; import org.elasticsearch.xpack.core.monitoring.MonitoredSystem; import org.elasticsearch.xpack.core.monitoring.action.MonitoringBulkDoc; diff --git a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/action/MonitoringBulkDocTests.java b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/action/MonitoringBulkDocTests.java index 941bfb923fd55..0ae43706366ee 100644 --- a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/action/MonitoringBulkDocTests.java +++ b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/action/MonitoringBulkDocTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.EqualsHashCodeTestUtils; import org.elasticsearch.test.RandomObjects; diff --git a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/action/MonitoringBulkRequestTests.java b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/action/MonitoringBulkRequestTests.java index 1ac607a6a66de..657faa9acb6e0 100644 --- a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/action/MonitoringBulkRequestTests.java +++ b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/action/MonitoringBulkRequestTests.java @@ -12,9 +12,9 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.RandomObjects; import org.elasticsearch.xpack.core.monitoring.MonitoredSystem; diff --git a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/action/TransportMonitoringBulkActionTests.java b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/action/TransportMonitoringBulkActionTests.java index 5040e26f87960..841df895e7d1c 100644 --- a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/action/TransportMonitoringBulkActionTests.java +++ b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/action/TransportMonitoringBulkActionTests.java @@ -23,9 +23,9 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.transport.TransportAddress; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.tasks.Task; import org.elasticsearch.tasks.TaskAwareRequest; diff --git a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/collector/cluster/ClusterStatsMonitoringDocTests.java b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/collector/cluster/ClusterStatsMonitoringDocTests.java index 8a89ea4d77136..90ab394b0647f 100644 --- a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/collector/cluster/ClusterStatsMonitoringDocTests.java +++ b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/collector/cluster/ClusterStatsMonitoringDocTests.java @@ -38,7 +38,7 @@ import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.discovery.DiscoveryModule; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.license.License; diff --git a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/collector/indices/IndexRecoveryMonitoringDocTests.java b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/collector/indices/IndexRecoveryMonitoringDocTests.java index 41f25a5388ec6..4c3362d4600b0 100644 --- a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/collector/indices/IndexRecoveryMonitoringDocTests.java +++ b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/collector/indices/IndexRecoveryMonitoringDocTests.java @@ -18,7 +18,7 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.transport.TransportAddress; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.indices.recovery.RecoveryState; import org.elasticsearch.transport.NodeDisconnectedException; diff --git a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/collector/indices/IndexStatsMonitoringDocTests.java b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/collector/indices/IndexStatsMonitoringDocTests.java index 2320a154c2a95..6ca74157fd62f 100644 --- a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/collector/indices/IndexStatsMonitoringDocTests.java +++ b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/collector/indices/IndexStatsMonitoringDocTests.java @@ -18,11 +18,11 @@ import org.elasticsearch.cluster.routing.UnassignedInfo; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.Index; import org.elasticsearch.index.cache.query.QueryCacheStats; import org.elasticsearch.index.cache.request.RequestCacheStats; diff --git a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/collector/indices/IndicesStatsMonitoringDocTests.java b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/collector/indices/IndicesStatsMonitoringDocTests.java index e69c9e3807ac6..4ebb26ed8ae69 100644 --- a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/collector/indices/IndicesStatsMonitoringDocTests.java +++ b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/collector/indices/IndicesStatsMonitoringDocTests.java @@ -14,7 +14,7 @@ import org.elasticsearch.cluster.routing.TestShardRouting; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.bulk.stats.BulkStats; import org.elasticsearch.index.search.stats.SearchStats; import org.elasticsearch.index.shard.DocsStats; diff --git a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/collector/ml/JobStatsMonitoringDocTests.java b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/collector/ml/JobStatsMonitoringDocTests.java index 34a7601017f55..bcbc679ec6fe5 100644 --- a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/collector/ml/JobStatsMonitoringDocTests.java +++ b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/collector/ml/JobStatsMonitoringDocTests.java @@ -13,7 +13,7 @@ import org.elasticsearch.common.transport.TransportAddress; import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.ml.action.GetJobsStatsAction.Response.JobStats; import org.elasticsearch.xpack.core.ml.job.config.JobState; import org.elasticsearch.xpack.core.ml.job.process.autodetect.state.CategorizationStatus; diff --git a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/collector/node/NodeStatsMonitoringDocTests.java b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/collector/node/NodeStatsMonitoringDocTests.java index 2f78e7dc9514a..65beae6eb8aad 100644 --- a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/collector/node/NodeStatsMonitoringDocTests.java +++ b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/collector/node/NodeStatsMonitoringDocTests.java @@ -13,10 +13,10 @@ import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.transport.TransportAddress; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.cache.query.QueryCacheStats; import org.elasticsearch.index.cache.request.RequestCacheStats; import org.elasticsearch.index.engine.SegmentsStats; diff --git a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/collector/shards/ShardsMonitoringDocTests.java b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/collector/shards/ShardsMonitoringDocTests.java index 22bf32ce9f0be..c10d2a7e893c1 100644 --- a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/collector/shards/ShardsMonitoringDocTests.java +++ b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/collector/shards/ShardsMonitoringDocTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.cluster.routing.ShardRouting; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.monitoring.MonitoredSystem; import org.elasticsearch.xpack.core.monitoring.exporter.MonitoringDoc; import org.elasticsearch.xpack.monitoring.MonitoringTestUtils; diff --git a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/BaseFilteredMonitoringDocTestCase.java b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/BaseFilteredMonitoringDocTestCase.java index c56f9ea4f1858..4055069b97765 100644 --- a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/BaseFilteredMonitoringDocTestCase.java +++ b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/BaseFilteredMonitoringDocTestCase.java @@ -8,9 +8,9 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.monitoring.MonitoredSystem; import org.elasticsearch.xpack.core.monitoring.exporter.MonitoringDoc; diff --git a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/BaseMonitoringDocTestCase.java b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/BaseMonitoringDocTestCase.java index 70c4a3fa7863b..d56cc646bb4ee 100644 --- a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/BaseMonitoringDocTestCase.java +++ b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/BaseMonitoringDocTestCase.java @@ -13,12 +13,12 @@ import org.elasticsearch.common.time.DateUtils; import org.elasticsearch.common.transport.TransportAddress; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.EqualsHashCodeTestUtils; import org.elasticsearch.xpack.core.monitoring.MonitoredSystem; diff --git a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/BytesReferenceMonitoringDocTests.java b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/BytesReferenceMonitoringDocTests.java index 4bde3aa5891b7..f1c364445cb29 100644 --- a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/BytesReferenceMonitoringDocTests.java +++ b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/BytesReferenceMonitoringDocTests.java @@ -8,9 +8,9 @@ import org.elasticsearch.common.UUIDs; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.EqualsHashCodeTestUtils; import org.elasticsearch.test.RandomObjects; import org.elasticsearch.xpack.core.monitoring.MonitoredSystem; diff --git a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/ClusterAlertsUtilTests.java b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/ClusterAlertsUtilTests.java index b5cacfad247ef..3ef782a947d49 100644 --- a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/ClusterAlertsUtilTests.java +++ b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/ClusterAlertsUtilTests.java @@ -18,7 +18,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.SettingsException; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.test.ESTestCase; diff --git a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/ExportersTests.java b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/ExportersTests.java index 4bf308aeb6ef8..b705f06069a8b 100644 --- a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/ExportersTests.java +++ b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/ExportersTests.java @@ -19,7 +19,7 @@ import org.elasticsearch.common.time.DateFormatter; import org.elasticsearch.common.util.concurrent.AbstractRunnable; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.gateway.GatewayService; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.test.ESTestCase; diff --git a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/http/ClusterAlertHttpResourceTests.java b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/http/ClusterAlertHttpResourceTests.java index 9b53f89c0bc82..4421868585032 100644 --- a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/http/ClusterAlertHttpResourceTests.java +++ b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/http/ClusterAlertHttpResourceTests.java @@ -16,8 +16,8 @@ import org.apache.http.entity.StringEntity; import org.elasticsearch.Version; import org.elasticsearch.client.Response; -import org.elasticsearch.common.xcontent.XContent; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContent; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.xpack.monitoring.exporter.ClusterAlertsUtil; diff --git a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/http/HttpExportBulkResponseListenerTests.java b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/http/HttpExportBulkResponseListenerTests.java index f71a05ae27d4e..63238a0486a82 100644 --- a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/http/HttpExportBulkResponseListenerTests.java +++ b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/http/HttpExportBulkResponseListenerTests.java @@ -10,12 +10,12 @@ import org.apache.http.entity.ContentType; import org.apache.http.entity.StringEntity; import org.elasticsearch.client.Response; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContent; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentParser.Token; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser.Token; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.mock.orig.Mockito; import org.elasticsearch.test.ESTestCase; diff --git a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/http/PublishableHttpResourceTests.java b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/http/PublishableHttpResourceTests.java index 31fcd5b1d019e..5a8b7223cd3d5 100644 --- a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/http/PublishableHttpResourceTests.java +++ b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/http/PublishableHttpResourceTests.java @@ -19,8 +19,8 @@ import org.elasticsearch.client.RestClient; import org.elasticsearch.core.CheckedFunction; import org.elasticsearch.common.SuppressLoggerChecks; -import org.elasticsearch.common.xcontent.XContent; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContent; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.xpack.monitoring.exporter.http.HttpResource.ResourcePublishResult; diff --git a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/local/LocalExporterIntegTests.java b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/local/LocalExporterIntegTests.java index 825c065b91ea9..511de30e35b0f 100644 --- a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/local/LocalExporterIntegTests.java +++ b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/local/LocalExporterIntegTests.java @@ -15,8 +15,8 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.time.DateFormatter; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.search.SearchHit; diff --git a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/local/LocalExporterResourceIntegTests.java b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/local/LocalExporterResourceIntegTests.java index c2fc28b1ce1a7..ef00abc658357 100644 --- a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/local/LocalExporterResourceIntegTests.java +++ b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/local/LocalExporterResourceIntegTests.java @@ -13,9 +13,9 @@ import org.elasticsearch.cluster.metadata.IndexTemplateMetadata; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ObjectPath; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ObjectPath; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.protocol.xpack.watcher.PutWatchRequest; import org.elasticsearch.search.SearchHit; @@ -35,7 +35,7 @@ import java.util.List; import java.util.Set; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.test.ESIntegTestCase.Scope.TEST; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.hamcrest.Matchers.containsString; diff --git a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/rest/action/RestMonitoringBulkActionTests.java b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/rest/action/RestMonitoringBulkActionTests.java index 6c1caeac19cbc..fe958b80c8bd3 100644 --- a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/rest/action/RestMonitoringBulkActionTests.java +++ b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/rest/action/RestMonitoringBulkActionTests.java @@ -11,11 +11,11 @@ import org.elasticsearch.core.CheckedConsumer; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesArray; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.rest.RestChannel; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.RestResponse; diff --git a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/rest/action/RestMonitoringMigrateAlertsActionTests.java b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/rest/action/RestMonitoringMigrateAlertsActionTests.java index e3bd90107e21b..7df7cc770b83f 100644 --- a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/rest/action/RestMonitoringMigrateAlertsActionTests.java +++ b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/rest/action/RestMonitoringMigrateAlertsActionTests.java @@ -11,7 +11,7 @@ import java.util.ArrayList; import java.util.List; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.rest.RestChannel; import org.elasticsearch.rest.RestResponse; import org.elasticsearch.rest.RestStatus; diff --git a/x-pack/plugin/ql/src/main/java/org/elasticsearch/xpack/ql/async/QlStatusResponse.java b/x-pack/plugin/ql/src/main/java/org/elasticsearch/xpack/ql/async/QlStatusResponse.java index 1ac1943d2f940..e729070feadda 100644 --- a/x-pack/plugin/ql/src/main/java/org/elasticsearch/xpack/ql/async/QlStatusResponse.java +++ b/x-pack/plugin/ql/src/main/java/org/elasticsearch/xpack/ql/async/QlStatusResponse.java @@ -12,7 +12,7 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.xcontent.StatusToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.xpack.core.async.StoredAsyncResponse; import org.elasticsearch.xpack.core.search.action.SearchStatusResponse; diff --git a/x-pack/plugin/ql/src/main/java/org/elasticsearch/xpack/ql/util/StringUtils.java b/x-pack/plugin/ql/src/main/java/org/elasticsearch/xpack/ql/util/StringUtils.java index ca139650cc682..6a5cf27de456e 100644 --- a/x-pack/plugin/ql/src/main/java/org/elasticsearch/xpack/ql/util/StringUtils.java +++ b/x-pack/plugin/ql/src/main/java/org/elasticsearch/xpack/ql/util/StringUtils.java @@ -10,9 +10,9 @@ import org.apache.lucene.util.CollectionUtil; import org.elasticsearch.common.Strings; import org.elasticsearch.core.Tuple; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.search.builder.SearchSourceBuilder; import org.elasticsearch.xpack.ql.QlIllegalArgumentException; diff --git a/x-pack/plugin/ql/src/test/java/org/elasticsearch/xpack/ql/action/QlStatusResponseTests.java b/x-pack/plugin/ql/src/test/java/org/elasticsearch/xpack/ql/action/QlStatusResponseTests.java index a8cc71e78500c..e482a4382c2d4 100644 --- a/x-pack/plugin/ql/src/test/java/org/elasticsearch/xpack/ql/action/QlStatusResponseTests.java +++ b/x-pack/plugin/ql/src/test/java/org/elasticsearch/xpack/ql/action/QlStatusResponseTests.java @@ -8,9 +8,9 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.test.AbstractWireSerializingTestCase; import org.elasticsearch.xpack.ql.async.QlStatusResponse; diff --git a/x-pack/plugin/ql/src/test/java/org/elasticsearch/xpack/ql/async/StoredAsyncResponseTests.java b/x-pack/plugin/ql/src/test/java/org/elasticsearch/xpack/ql/async/StoredAsyncResponseTests.java index 81e72556ce6b3..ef1cd3b94f531 100644 --- a/x-pack/plugin/ql/src/test/java/org/elasticsearch/xpack/ql/async/StoredAsyncResponseTests.java +++ b/x-pack/plugin/ql/src/test/java/org/elasticsearch/xpack/ql/async/StoredAsyncResponseTests.java @@ -11,7 +11,7 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.search.SearchModule; import org.elasticsearch.test.AbstractWireSerializingTestCase; import org.elasticsearch.xpack.core.async.StoredAsyncResponse; diff --git a/x-pack/plugin/ql/src/test/java/org/elasticsearch/xpack/ql/type/TypesTests.java b/x-pack/plugin/ql/src/test/java/org/elasticsearch/xpack/ql/type/TypesTests.java index b1647b43bb5f4..86e7c569e2ab6 100644 --- a/x-pack/plugin/ql/src/test/java/org/elasticsearch/xpack/ql/type/TypesTests.java +++ b/x-pack/plugin/ql/src/test/java/org/elasticsearch/xpack/ql/type/TypesTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.ql.type; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/x-pack/plugin/ql/test-fixtures/src/main/java/org/elasticsearch/xpack/ql/TestUtils.java b/x-pack/plugin/ql/test-fixtures/src/main/java/org/elasticsearch/xpack/ql/TestUtils.java index 7e91bf1ebb3f0..98a4197f917fa 100644 --- a/x-pack/plugin/ql/test-fixtures/src/main/java/org/elasticsearch/xpack/ql/TestUtils.java +++ b/x-pack/plugin/ql/test-fixtures/src/main/java/org/elasticsearch/xpack/ql/TestUtils.java @@ -14,11 +14,11 @@ import org.elasticsearch.client.RestClient; import org.elasticsearch.common.regex.Regex; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.core.PathUtils; import org.elasticsearch.core.SuppressForbidden; import org.elasticsearch.core.Tuple; import org.elasticsearch.test.rest.yaml.ObjectPath; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.xpack.ql.expression.Expression; import org.elasticsearch.xpack.ql.expression.FieldAttribute; import org.elasticsearch.xpack.ql.expression.Literal; diff --git a/x-pack/plugin/repositories-metering-api/src/main/java/org/elasticsearch/xpack/repositories/metering/action/RepositoriesMeteringResponse.java b/x-pack/plugin/repositories-metering-api/src/main/java/org/elasticsearch/xpack/repositories/metering/action/RepositoriesMeteringResponse.java index e80107c8401b8..209f9a4c00278 100644 --- a/x-pack/plugin/repositories-metering-api/src/main/java/org/elasticsearch/xpack/repositories/metering/action/RepositoriesMeteringResponse.java +++ b/x-pack/plugin/repositories-metering-api/src/main/java/org/elasticsearch/xpack/repositories/metering/action/RepositoriesMeteringResponse.java @@ -12,8 +12,8 @@ import org.elasticsearch.cluster.ClusterName; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.List; diff --git a/x-pack/plugin/repositories-metering-api/src/main/java/org/elasticsearch/xpack/repositories/metering/action/RepositoriesNodeMeteringResponse.java b/x-pack/plugin/repositories-metering-api/src/main/java/org/elasticsearch/xpack/repositories/metering/action/RepositoriesNodeMeteringResponse.java index 9a8d07166f7a0..31d7486a72dbb 100644 --- a/x-pack/plugin/repositories-metering-api/src/main/java/org/elasticsearch/xpack/repositories/metering/action/RepositoriesNodeMeteringResponse.java +++ b/x-pack/plugin/repositories-metering-api/src/main/java/org/elasticsearch/xpack/repositories/metering/action/RepositoriesNodeMeteringResponse.java @@ -11,10 +11,10 @@ import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.repositories.RepositoryStatsSnapshot; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.List; diff --git a/x-pack/plugin/repository-encrypted/src/main/java/org/elasticsearch/repositories/encrypted/EncryptedRepository.java b/x-pack/plugin/repository-encrypted/src/main/java/org/elasticsearch/repositories/encrypted/EncryptedRepository.java index 22a544a1c02cd..3f1cef4f090d5 100644 --- a/x-pack/plugin/repository-encrypted/src/main/java/org/elasticsearch/repositories/encrypted/EncryptedRepository.java +++ b/x-pack/plugin/repository-encrypted/src/main/java/org/elasticsearch/repositories/encrypted/EncryptedRepository.java @@ -28,7 +28,6 @@ import org.elasticsearch.common.io.stream.ReleasableBytesStreamOutput; import org.elasticsearch.common.settings.SecureString; import org.elasticsearch.common.util.BigArrays; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; import org.elasticsearch.core.CheckedConsumer; import org.elasticsearch.core.CheckedFunction; import org.elasticsearch.core.Tuple; @@ -41,6 +40,7 @@ import org.elasticsearch.repositories.SnapshotShardContext; import org.elasticsearch.repositories.blobstore.BlobStoreRepository; import org.elasticsearch.snapshots.SnapshotInfo; +import org.elasticsearch.xcontent.NamedXContentRegistry; import java.io.IOException; import java.io.InputStream; diff --git a/x-pack/plugin/repository-encrypted/src/main/java/org/elasticsearch/repositories/encrypted/EncryptedRepositoryPlugin.java b/x-pack/plugin/repository-encrypted/src/main/java/org/elasticsearch/repositories/encrypted/EncryptedRepositoryPlugin.java index 0048158bf14a3..48132ed40f712 100644 --- a/x-pack/plugin/repository-encrypted/src/main/java/org/elasticsearch/repositories/encrypted/EncryptedRepositoryPlugin.java +++ b/x-pack/plugin/repository-encrypted/src/main/java/org/elasticsearch/repositories/encrypted/EncryptedRepositoryPlugin.java @@ -18,7 +18,6 @@ import org.elasticsearch.common.settings.SecureString; import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.util.BigArrays; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; import org.elasticsearch.env.Environment; import org.elasticsearch.indices.recovery.RecoverySettings; import org.elasticsearch.license.License; @@ -29,6 +28,7 @@ import org.elasticsearch.plugins.RepositoryPlugin; import org.elasticsearch.repositories.Repository; import org.elasticsearch.repositories.blobstore.BlobStoreRepository; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.xpack.core.XPackPlugin; import java.security.GeneralSecurityException; diff --git a/x-pack/plugin/repository-encrypted/src/test/java/org/elasticsearch/repositories/encrypted/EncryptedRepositoryTests.java b/x-pack/plugin/repository-encrypted/src/test/java/org/elasticsearch/repositories/encrypted/EncryptedRepositoryTests.java index 1573a3ffa241b..6eff2e66a63b0 100644 --- a/x-pack/plugin/repository-encrypted/src/test/java/org/elasticsearch/repositories/encrypted/EncryptedRepositoryTests.java +++ b/x-pack/plugin/repository-encrypted/src/test/java/org/elasticsearch/repositories/encrypted/EncryptedRepositoryTests.java @@ -17,7 +17,6 @@ import org.elasticsearch.common.settings.SecureString; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.BigArrays; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; import org.elasticsearch.core.Tuple; import org.elasticsearch.indices.recovery.RecoverySettings; import org.elasticsearch.license.XPackLicenseState; @@ -25,6 +24,7 @@ import org.elasticsearch.repositories.blobstore.BlobStoreRepository; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.threadpool.ThreadPool; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.junit.Before; import java.io.ByteArrayInputStream; diff --git a/x-pack/plugin/repository-encrypted/src/test/java/org/elasticsearch/repositories/encrypted/LocalStateEncryptedRepositoryPlugin.java b/x-pack/plugin/repository-encrypted/src/test/java/org/elasticsearch/repositories/encrypted/LocalStateEncryptedRepositoryPlugin.java index d40a7e58e64b7..042fd5c7884fe 100644 --- a/x-pack/plugin/repository-encrypted/src/test/java/org/elasticsearch/repositories/encrypted/LocalStateEncryptedRepositoryPlugin.java +++ b/x-pack/plugin/repository-encrypted/src/test/java/org/elasticsearch/repositories/encrypted/LocalStateEncryptedRepositoryPlugin.java @@ -11,11 +11,11 @@ import org.elasticsearch.common.settings.SecureString; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.BigArrays; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; import org.elasticsearch.indices.recovery.RecoverySettings; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.repositories.SnapshotShardContext; import org.elasticsearch.repositories.blobstore.BlobStoreRepository; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.xpack.core.LocalStateCompositeXPackPlugin; import java.nio.file.Path; diff --git a/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/Rollup.java b/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/Rollup.java index 3858a99d88868..7ce204b09ec0b 100644 --- a/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/Rollup.java +++ b/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/Rollup.java @@ -19,7 +19,6 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.SettingsFilter; import org.elasticsearch.common.settings.SettingsModule; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; import org.elasticsearch.env.Environment; import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.persistent.PersistentTasksExecutor; @@ -35,6 +34,7 @@ import org.elasticsearch.threadpool.FixedExecutorBuilder; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.watcher.ResourceWatcherService; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.xpack.core.action.XPackInfoFeatureAction; import org.elasticsearch.xpack.core.action.XPackUsageFeatureAction; import org.elasticsearch.xpack.core.rollup.RollupField; diff --git a/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/action/RollupIndexCaps.java b/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/action/RollupIndexCaps.java index ca55aa2ea5284..a2a3eb26e98cf 100644 --- a/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/action/RollupIndexCaps.java +++ b/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/action/RollupIndexCaps.java @@ -11,16 +11,16 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.rollup.RollupField; import org.elasticsearch.xpack.core.rollup.action.GetRollupCapsAction; import org.elasticsearch.xpack.core.rollup.action.RollupJobCaps; @@ -33,7 +33,7 @@ import java.util.Objects; import java.util.stream.Collectors; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; public class RollupIndexCaps implements Writeable, ToXContentFragment { private static ParseField ROLLUP_JOBS = new ParseField("rollup_jobs"); diff --git a/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/action/TransportPutRollupJobAction.java b/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/action/TransportPutRollupJobAction.java index 0834b8da0e5ae..ecd03b3bede0d 100644 --- a/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/action/TransportPutRollupJobAction.java +++ b/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/action/TransportPutRollupJobAction.java @@ -36,8 +36,6 @@ import org.elasticsearch.common.logging.DeprecationCategory; import org.elasticsearch.common.logging.DeprecationLogger; import org.elasticsearch.common.time.DateUtils; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.core.CheckedConsumer; import org.elasticsearch.core.TimeValue; import org.elasticsearch.persistent.PersistentTasksCustomMetadata; @@ -46,6 +44,8 @@ import org.elasticsearch.tasks.Task; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.TransportService; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.ClientHelper; import org.elasticsearch.xpack.core.XPackPlugin; import org.elasticsearch.xpack.core.rollup.RollupField; diff --git a/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestDeleteRollupJobAction.java b/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestDeleteRollupJobAction.java index 79c872e6b49e3..f7702d18be4b6 100644 --- a/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestDeleteRollupJobAction.java +++ b/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestDeleteRollupJobAction.java @@ -8,12 +8,12 @@ package org.elasticsearch.xpack.rollup.rest; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.ParseField; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.rest.action.RestToXContentListener; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.xpack.core.rollup.action.DeleteRollupJobAction; import java.util.List; diff --git a/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestGetRollupCapsAction.java b/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestGetRollupCapsAction.java index 9d9d934b081ea..7072daaade562 100644 --- a/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestGetRollupCapsAction.java +++ b/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestGetRollupCapsAction.java @@ -8,11 +8,11 @@ package org.elasticsearch.xpack.rollup.rest; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.ParseField; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestToXContentListener; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.xpack.core.rollup.action.GetRollupCapsAction; import java.util.List; diff --git a/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestGetRollupIndexCapsAction.java b/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestGetRollupIndexCapsAction.java index 29202ad5a4e6c..5dfc4af19db1b 100644 --- a/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestGetRollupIndexCapsAction.java +++ b/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestGetRollupIndexCapsAction.java @@ -10,11 +10,11 @@ import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ParseField; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestToXContentListener; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.xpack.core.rollup.action.GetRollupIndexCapsAction; import java.util.List; diff --git a/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestGetRollupJobsAction.java b/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestGetRollupJobsAction.java index cc2b44032d3fc..1d481f4cacc35 100644 --- a/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestGetRollupJobsAction.java +++ b/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestGetRollupJobsAction.java @@ -8,11 +8,11 @@ package org.elasticsearch.xpack.rollup.rest; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.ParseField; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestToXContentListener; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.xpack.core.rollup.action.GetRollupJobsAction; import java.util.List; diff --git a/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/v2/TransportRollupAction.java b/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/v2/TransportRollupAction.java index 31d1125a91fa2..bc66f834575da 100644 --- a/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/v2/TransportRollupAction.java +++ b/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/v2/TransportRollupAction.java @@ -35,16 +35,16 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.index.Index; import org.elasticsearch.index.mapper.DateFieldMapper; import org.elasticsearch.index.mapper.NumberFieldMapper; import org.elasticsearch.tasks.Task; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.TransportService; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.aggregatemetric.mapper.AggregateDoubleMetricFieldMapper; import org.elasticsearch.xpack.core.ClientHelper; import org.elasticsearch.xpack.core.rollup.RollupActionConfig; diff --git a/x-pack/plugin/rollup/src/test/java/org/elasticsearch/xpack/rollup/action/PutJobActionRequestTests.java b/x-pack/plugin/rollup/src/test/java/org/elasticsearch/xpack/rollup/action/PutJobActionRequestTests.java index c3b55bec4fafe..d34c6da4d9c68 100644 --- a/x-pack/plugin/rollup/src/test/java/org/elasticsearch/xpack/rollup/action/PutJobActionRequestTests.java +++ b/x-pack/plugin/rollup/src/test/java/org/elasticsearch/xpack/rollup/action/PutJobActionRequestTests.java @@ -7,8 +7,8 @@ package org.elasticsearch.xpack.rollup.action; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.rollup.ConfigTestHelpers; import org.elasticsearch.xpack.core.rollup.action.PutRollupJobAction.Request; import org.junit.Before; diff --git a/x-pack/plugin/rollup/src/test/java/org/elasticsearch/xpack/rollup/job/RollupIndexerStateTests.java b/x-pack/plugin/rollup/src/test/java/org/elasticsearch/xpack/rollup/job/RollupIndexerStateTests.java index fa36733d37a96..5b0e5cc952334 100644 --- a/x-pack/plugin/rollup/src/test/java/org/elasticsearch/xpack/rollup/job/RollupIndexerStateTests.java +++ b/x-pack/plugin/rollup/src/test/java/org/elasticsearch/xpack/rollup/job/RollupIndexerStateTests.java @@ -16,7 +16,6 @@ import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.action.search.SearchResponseSections; import org.elasticsearch.action.search.ShardSearchFailure; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.SearchHits; import org.elasticsearch.search.aggregations.Aggregations; @@ -25,6 +24,7 @@ import org.elasticsearch.test.ESTestCase; import org.elasticsearch.threadpool.TestThreadPool; import org.elasticsearch.threadpool.ThreadPool; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.indexing.IndexerState; import org.elasticsearch.xpack.core.rollup.ConfigTestHelpers; import org.elasticsearch.xpack.core.rollup.RollupField; diff --git a/x-pack/plugin/rollup/src/test/java/org/elasticsearch/xpack/rollup/v2/RollupActionSingleNodeTests.java b/x-pack/plugin/rollup/src/test/java/org/elasticsearch/xpack/rollup/v2/RollupActionSingleNodeTests.java index 0d2c22f3a9ab6..d86d7e0cf204e 100644 --- a/x-pack/plugin/rollup/src/test/java/org/elasticsearch/xpack/rollup/v2/RollupActionSingleNodeTests.java +++ b/x-pack/plugin/rollup/src/test/java/org/elasticsearch/xpack/rollup/v2/RollupActionSingleNodeTests.java @@ -27,8 +27,6 @@ import org.elasticsearch.common.compress.CompressedXContent; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.time.DateFormatter; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.index.Index; import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.index.IndexService; @@ -49,6 +47,8 @@ import org.elasticsearch.search.aggregations.metrics.SumAggregationBuilder; import org.elasticsearch.search.aggregations.metrics.ValueCountAggregationBuilder; import org.elasticsearch.test.ESSingleNodeTestCase; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.xpack.aggregatemetric.AggregateMetricMapperPlugin; import org.elasticsearch.xpack.analytics.AnalyticsPlugin; import org.elasticsearch.xpack.core.LocalStateCompositeXPackPlugin; diff --git a/x-pack/plugin/search-business-rules/src/internalClusterTest/java/org/elasticsearch/xpack/searchbusinessrules/PinnedQueryBuilderIT.java b/x-pack/plugin/search-business-rules/src/internalClusterTest/java/org/elasticsearch/xpack/searchbusinessrules/PinnedQueryBuilderIT.java index ab95df2fb0b86..3c5a8b9dd272b 100644 --- a/x-pack/plugin/search-business-rules/src/internalClusterTest/java/org/elasticsearch/xpack/searchbusinessrules/PinnedQueryBuilderIT.java +++ b/x-pack/plugin/search-business-rules/src/internalClusterTest/java/org/elasticsearch/xpack/searchbusinessrules/PinnedQueryBuilderIT.java @@ -28,7 +28,7 @@ import java.util.Map; import static org.elasticsearch.action.search.SearchType.DFS_QUERY_THEN_FETCH; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertFirstHit; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertFourthHit; diff --git a/x-pack/plugin/search-business-rules/src/main/java/org/elasticsearch/xpack/searchbusinessrules/PinnedQueryBuilder.java b/x-pack/plugin/search-business-rules/src/main/java/org/elasticsearch/xpack/searchbusinessrules/PinnedQueryBuilder.java index 165be122a148d..f6e99afbd9996 100644 --- a/x-pack/plugin/search-business-rules/src/main/java/org/elasticsearch/xpack/searchbusinessrules/PinnedQueryBuilder.java +++ b/x-pack/plugin/search-business-rules/src/main/java/org/elasticsearch/xpack/searchbusinessrules/PinnedQueryBuilder.java @@ -15,17 +15,17 @@ import org.apache.lucene.util.NumericUtils; import org.elasticsearch.Version; import org.elasticsearch.common.regex.Regex; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.mapper.IdFieldMapper; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.query.AbstractQueryBuilder; @@ -42,8 +42,8 @@ import java.util.Objects; import java.util.stream.Collectors; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * A query that will promote selected documents (identified by ID) above matches produced by an "organic" query. In practice, some upstream diff --git a/x-pack/plugin/search-business-rules/src/test/java/org/elasticsearch/xpack/searchbusinessrules/PinnedQueryBuilderTests.java b/x-pack/plugin/search-business-rules/src/test/java/org/elasticsearch/xpack/searchbusinessrules/PinnedQueryBuilderTests.java index b9df0eea2b16e..c184d6d49747c 100644 --- a/x-pack/plugin/search-business-rules/src/test/java/org/elasticsearch/xpack/searchbusinessrules/PinnedQueryBuilderTests.java +++ b/x-pack/plugin/search-business-rules/src/test/java/org/elasticsearch/xpack/searchbusinessrules/PinnedQueryBuilderTests.java @@ -12,10 +12,10 @@ import org.apache.lucene.search.DisjunctionMaxQuery; import org.apache.lucene.search.Query; import org.elasticsearch.common.ParsingException; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.query.MatchAllQueryBuilder; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.SearchExecutionContext; diff --git a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsCanMatchOnCoordinatorIntegTests.java b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsCanMatchOnCoordinatorIntegTests.java index 587e298e45940..ceb29bf430ac0 100644 --- a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsCanMatchOnCoordinatorIntegTests.java +++ b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsCanMatchOnCoordinatorIntegTests.java @@ -18,7 +18,6 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.index.Index; import org.elasticsearch.index.mapper.DateFieldMapper; import org.elasticsearch.index.query.QueryBuilders; @@ -31,6 +30,7 @@ import org.elasticsearch.snapshots.mockstore.MockRepository; import org.elasticsearch.test.ESIntegTestCase; import org.elasticsearch.test.transport.MockTransportService; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.xpack.core.searchablesnapshots.MountSearchableSnapshotAction; import org.elasticsearch.xpack.core.searchablesnapshots.MountSearchableSnapshotRequest; import org.elasticsearch.xpack.searchablesnapshots.cache.shared.FrozenCacheService; diff --git a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsIntegTests.java b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsIntegTests.java index b4dda826f97f6..3454b7c96800c 100644 --- a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsIntegTests.java +++ b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsIntegTests.java @@ -37,7 +37,6 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.env.Environment; import org.elasticsearch.index.Index; import org.elasticsearch.index.IndexModule; @@ -50,6 +49,7 @@ import org.elasticsearch.snapshots.SnapshotId; import org.elasticsearch.snapshots.SnapshotInfo; import org.elasticsearch.snapshots.SnapshotsService; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.xpack.core.searchablesnapshots.MountSearchableSnapshotAction; import org.elasticsearch.xpack.core.searchablesnapshots.MountSearchableSnapshotRequest; import org.elasticsearch.xpack.core.searchablesnapshots.SearchableSnapshotShardStats; diff --git a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/cache/blob/SearchableSnapshotsBlobStoreCacheIntegTests.java b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/cache/blob/SearchableSnapshotsBlobStoreCacheIntegTests.java index ec639c641a9a8..cea0b30bfb9a2 100644 --- a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/cache/blob/SearchableSnapshotsBlobStoreCacheIntegTests.java +++ b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/cache/blob/SearchableSnapshotsBlobStoreCacheIntegTests.java @@ -28,8 +28,6 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.index.IndexService; import org.elasticsearch.index.shard.IndexShard; @@ -41,6 +39,8 @@ import org.elasticsearch.snapshots.SearchableSnapshotsSettings; import org.elasticsearch.snapshots.SnapshotId; import org.elasticsearch.test.InternalTestCluster; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.xpack.core.ClientHelper; import org.elasticsearch.xpack.core.searchablesnapshots.MountSearchableSnapshotRequest.Storage; import org.elasticsearch.xpack.core.searchablesnapshots.SearchableSnapshotShardStats; diff --git a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/cache/blob/SearchableSnapshotsBlobStoreCacheMaintenanceIntegTests.java b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/cache/blob/SearchableSnapshotsBlobStoreCacheMaintenanceIntegTests.java index 93bea63fccf85..0a514b2f97a26 100644 --- a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/cache/blob/SearchableSnapshotsBlobStoreCacheMaintenanceIntegTests.java +++ b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/cache/blob/SearchableSnapshotsBlobStoreCacheMaintenanceIntegTests.java @@ -19,8 +19,6 @@ import org.elasticsearch.common.UUIDs; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.core.TimeValue; import org.elasticsearch.core.Tuple; import org.elasticsearch.index.IndexNotFoundException; @@ -31,6 +29,8 @@ import org.elasticsearch.repositories.IndexId; import org.elasticsearch.repositories.fs.FsRepository; import org.elasticsearch.snapshots.SnapshotId; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.xpack.core.ClientHelper; import org.elasticsearch.xpack.core.searchablesnapshots.MountSearchableSnapshotRequest.Storage; import org.elasticsearch.xpack.searchablesnapshots.BaseFrozenSearchableSnapshotsIntegTestCase; diff --git a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/cache/full/SearchableSnapshotsPrewarmingIntegTests.java b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/cache/full/SearchableSnapshotsPrewarmingIntegTests.java index a41e9aa771f94..1224fff584e00 100644 --- a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/cache/full/SearchableSnapshotsPrewarmingIntegTests.java +++ b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/cache/full/SearchableSnapshotsPrewarmingIntegTests.java @@ -27,7 +27,6 @@ import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.util.BigArrays; import org.elasticsearch.common.util.concurrent.AtomicArray; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; import org.elasticsearch.core.Nullable; import org.elasticsearch.env.Environment; import org.elasticsearch.index.snapshots.blobstore.BlobStoreIndexShardSnapshot; @@ -47,6 +46,7 @@ import org.elasticsearch.snapshots.SnapshotId; import org.elasticsearch.test.ESSingleNodeTestCase; import org.elasticsearch.threadpool.ThreadPool; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.xpack.core.searchablesnapshots.MountSearchableSnapshotAction; import org.elasticsearch.xpack.core.searchablesnapshots.MountSearchableSnapshotRequest; import org.elasticsearch.xpack.searchablesnapshots.LocalStateSearchableSnapshots; diff --git a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/recovery/SearchableSnapshotRecoveryStateIntegrationTests.java b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/recovery/SearchableSnapshotRecoveryStateIntegrationTests.java index ad8805967e15c..2e7dac7d5833e 100644 --- a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/recovery/SearchableSnapshotRecoveryStateIntegrationTests.java +++ b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/recovery/SearchableSnapshotRecoveryStateIntegrationTests.java @@ -14,7 +14,6 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.BigArrays; import org.elasticsearch.common.util.CollectionUtils; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; import org.elasticsearch.core.SuppressForbidden; import org.elasticsearch.env.Environment; import org.elasticsearch.index.Index; @@ -34,6 +33,7 @@ import org.elasticsearch.repositories.fs.FsRepository; import org.elasticsearch.snapshots.SnapshotInfo; import org.elasticsearch.test.ESIntegTestCase; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.xpack.searchablesnapshots.BaseSearchableSnapshotsIntegTestCase; import org.elasticsearch.xpack.searchablesnapshots.SearchableSnapshots; import org.elasticsearch.xpack.searchablesnapshots.cache.full.CacheService; diff --git a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshots.java b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshots.java index f63df97f72cf2..a2ebf83bf4429 100644 --- a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshots.java +++ b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshots.java @@ -36,8 +36,6 @@ import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.common.util.concurrent.EsExecutors; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.core.Nullable; import org.elasticsearch.core.Releasables; import org.elasticsearch.core.TimeValue; @@ -74,6 +72,8 @@ import org.elasticsearch.threadpool.ScalingExecutorBuilder; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.watcher.ResourceWatcherService; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.XPackPlugin; import org.elasticsearch.xpack.core.action.XPackInfoFeatureAction; import org.elasticsearch.xpack.core.action.XPackUsageFeatureAction; @@ -127,11 +127,11 @@ import java.util.function.Supplier; import java.util.stream.Collectors; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.mapper.MapperService.SINGLE_MAPPING_NAME; import static org.elasticsearch.snapshots.SearchableSnapshotsSettings.SEARCHABLE_SNAPSHOT_STORE_TYPE; import static org.elasticsearch.snapshots.SearchableSnapshotsSettings.isPartialSearchableSnapshotIndex; import static org.elasticsearch.snapshots.SearchableSnapshotsSettings.isSearchableSnapshotStore; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.xpack.core.ClientHelper.SEARCHABLE_SNAPSHOTS_ORIGIN; import static org.elasticsearch.xpack.core.searchablesnapshots.SearchableSnapshotsConstants.SEARCHABLE_SNAPSHOT_FEATURE; import static org.elasticsearch.xpack.searchablesnapshots.SearchableSnapshotsUtils.emptyIndexCommit; diff --git a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/action/SearchableSnapshotsStatsResponse.java b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/action/SearchableSnapshotsStatsResponse.java index 5ea3213ca18b8..00a710421cb4c 100644 --- a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/action/SearchableSnapshotsStatsResponse.java +++ b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/action/SearchableSnapshotsStatsResponse.java @@ -11,8 +11,8 @@ import org.elasticsearch.cluster.routing.ShardRouting; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.index.Index; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.searchablesnapshots.SearchableSnapshotShardStats; import org.elasticsearch.xpack.core.searchablesnapshots.SearchableSnapshotShardStats.CacheIndexInputStats; diff --git a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/action/cache/TransportSearchableSnapshotsNodeCachesStatsAction.java b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/action/cache/TransportSearchableSnapshotsNodeCachesStatsAction.java index 342266ec8613f..f4594289b9e9e 100644 --- a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/action/cache/TransportSearchableSnapshotsNodeCachesStatsAction.java +++ b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/action/cache/TransportSearchableSnapshotsNodeCachesStatsAction.java @@ -22,14 +22,14 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.tasks.Task; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.TransportRequest; import org.elasticsearch.transport.TransportService; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.searchablesnapshots.SearchableSnapshots; import org.elasticsearch.xpack.searchablesnapshots.cache.shared.FrozenCacheService; diff --git a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/cache/blob/BlobStoreCacheService.java b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/cache/blob/BlobStoreCacheService.java index e4c7ba7d250ab..9a49130907e78 100644 --- a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/cache/blob/BlobStoreCacheService.java +++ b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/cache/blob/BlobStoreCacheService.java @@ -32,8 +32,6 @@ import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.common.util.concurrent.RunOnce; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.core.TimeValue; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.index.store.LuceneFilesExtensions; @@ -42,6 +40,8 @@ import org.elasticsearch.snapshots.SnapshotId; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.ConnectTransportException; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.searchablesnapshots.cache.common.ByteRange; import java.time.Instant; @@ -50,7 +50,7 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.xpack.core.ClientHelper.SEARCHABLE_SNAPSHOTS_ORIGIN; public class BlobStoreCacheService extends AbstractLifecycleComponent { diff --git a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/cache/blob/CachedBlob.java b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/cache/blob/CachedBlob.java index 8bb08554829a9..91d2900553444 100644 --- a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/cache/blob/CachedBlob.java +++ b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/cache/blob/CachedBlob.java @@ -10,8 +10,8 @@ import org.elasticsearch.Version; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.time.Instant; diff --git a/x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/AbstractSearchableSnapshotsRestTestCase.java b/x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/AbstractSearchableSnapshotsRestTestCase.java index 05da22b7ad48b..2f27f14b142d7 100644 --- a/x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/AbstractSearchableSnapshotsRestTestCase.java +++ b/x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/AbstractSearchableSnapshotsRestTestCase.java @@ -20,14 +20,14 @@ import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.search.builder.SearchSourceBuilder; import org.elasticsearch.test.rest.ESRestTestCase; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import java.io.IOException; import java.util.HashSet; @@ -38,7 +38,7 @@ import java.util.concurrent.TimeUnit; import java.util.function.Function; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.greaterThan; import static org.hamcrest.Matchers.greaterThanOrEqualTo; diff --git a/x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/action/MountSearchableSnapshotRequestTests.java b/x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/action/MountSearchableSnapshotRequestTests.java index dd2b7425c6931..be415f1415e4e 100644 --- a/x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/action/MountSearchableSnapshotRequestTests.java +++ b/x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/action/MountSearchableSnapshotRequestTests.java @@ -13,12 +13,12 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.core.TimeValue; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.test.AbstractWireSerializingTestCase; import org.elasticsearch.test.rest.FakeRestRequest; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.searchablesnapshots.MountSearchableSnapshotRequest; import java.io.IOException; diff --git a/x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/store/SearchableSnapshotDirectoryTests.java b/x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/store/SearchableSnapshotDirectoryTests.java index 5df48b757603a..2b3a06433cfcb 100644 --- a/x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/store/SearchableSnapshotDirectoryTests.java +++ b/x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/store/SearchableSnapshotDirectoryTests.java @@ -57,7 +57,6 @@ import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.common.util.MockBigArrays; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; import org.elasticsearch.core.CheckedFunction; import org.elasticsearch.core.PathUtils; import org.elasticsearch.core.PathUtilsForTesting; @@ -88,6 +87,7 @@ import org.elasticsearch.snapshots.SnapshotId; import org.elasticsearch.test.DummyShardLock; import org.elasticsearch.test.IndexSettingsModule; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.xpack.searchablesnapshots.AbstractSearchableSnapshotsTestCase; import org.elasticsearch.xpack.searchablesnapshots.cache.common.TestUtils; import org.elasticsearch.xpack.searchablesnapshots.cache.full.CacheService; diff --git a/x-pack/plugin/security/cli/src/main/java/org/elasticsearch/xpack/security/cli/CertificateGenerateTool.java b/x-pack/plugin/security/cli/src/main/java/org/elasticsearch/xpack/security/cli/CertificateGenerateTool.java index 74db3b41407a8..bddfb72764e9d 100644 --- a/x-pack/plugin/security/cli/src/main/java/org/elasticsearch/xpack/security/cli/CertificateGenerateTool.java +++ b/x-pack/plugin/security/cli/src/main/java/org/elasticsearch/xpack/security/cli/CertificateGenerateTool.java @@ -23,19 +23,18 @@ import org.elasticsearch.cli.Terminal; import org.elasticsearch.cli.UserException; import org.elasticsearch.common.ssl.PemUtils; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.core.SuppressForbidden; import org.elasticsearch.core.PathUtils; import org.elasticsearch.common.network.InetAddresses; -import org.elasticsearch.common.ssl.PemUtils; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.env.Environment; import org.elasticsearch.xpack.core.ssl.CertParsingUtils; diff --git a/x-pack/plugin/security/cli/src/main/java/org/elasticsearch/xpack/security/cli/CertificateTool.java b/x-pack/plugin/security/cli/src/main/java/org/elasticsearch/xpack/security/cli/CertificateTool.java index 212a7cbd76c73..e0036b721cbfc 100644 --- a/x-pack/plugin/security/cli/src/main/java/org/elasticsearch/xpack/security/cli/CertificateTool.java +++ b/x-pack/plugin/security/cli/src/main/java/org/elasticsearch/xpack/security/cli/CertificateTool.java @@ -29,18 +29,18 @@ import org.elasticsearch.common.ssl.PemUtils; import org.elasticsearch.core.CheckedConsumer; import org.elasticsearch.core.CheckedFunction; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.core.SuppressForbidden; import org.elasticsearch.core.PathUtils; import org.elasticsearch.common.network.InetAddresses; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.env.Environment; import org.elasticsearch.xpack.core.ssl.CertParsingUtils; diff --git a/x-pack/plugin/security/qa/operator-privileges-tests/src/javaRestTest/java/org/elasticsearch/xpack/security/operator/OperatorPrivilegesIT.java b/x-pack/plugin/security/qa/operator-privileges-tests/src/javaRestTest/java/org/elasticsearch/xpack/security/operator/OperatorPrivilegesIT.java index 9f54c087ebd05..429d1468fbe0b 100644 --- a/x-pack/plugin/security/qa/operator-privileges-tests/src/javaRestTest/java/org/elasticsearch/xpack/security/operator/OperatorPrivilegesIT.java +++ b/x-pack/plugin/security/qa/operator-privileges-tests/src/javaRestTest/java/org/elasticsearch/xpack/security/operator/OperatorPrivilegesIT.java @@ -14,9 +14,9 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.test.rest.ESRestTestCase; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import java.io.IOException; import java.nio.charset.StandardCharsets; diff --git a/x-pack/plugin/security/qa/security-basic/src/javaRestTest/java/org/elasticsearch/xpack/security/QueryApiKeyIT.java b/x-pack/plugin/security/qa/security-basic/src/javaRestTest/java/org/elasticsearch/xpack/security/QueryApiKeyIT.java index 2831ddbfd7a6a..57ece89a58fa2 100644 --- a/x-pack/plugin/security/qa/security-basic/src/javaRestTest/java/org/elasticsearch/xpack/security/QueryApiKeyIT.java +++ b/x-pack/plugin/security/qa/security-basic/src/javaRestTest/java/org/elasticsearch/xpack/security/QueryApiKeyIT.java @@ -11,7 +11,7 @@ import org.elasticsearch.client.Request; import org.elasticsearch.client.Response; import org.elasticsearch.client.ResponseException; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.Tuple; import org.elasticsearch.test.XContentTestUtils; diff --git a/x-pack/plugin/security/qa/security-trial/src/javaRestTest/java/org/elasticsearch/xpack/security/apikey/ApiKeyRestIT.java b/x-pack/plugin/security/qa/security-trial/src/javaRestTest/java/org/elasticsearch/xpack/security/apikey/ApiKeyRestIT.java index bc5cca4a04b74..3e6c185654ff2 100644 --- a/x-pack/plugin/security/qa/security-trial/src/javaRestTest/java/org/elasticsearch/xpack/security/apikey/ApiKeyRestIT.java +++ b/x-pack/plugin/security/qa/security-trial/src/javaRestTest/java/org/elasticsearch/xpack/security/apikey/ApiKeyRestIT.java @@ -14,7 +14,7 @@ import org.elasticsearch.client.security.support.ApiKey; import org.elasticsearch.core.Tuple; import org.elasticsearch.common.settings.SecureString; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.XContentTestUtils; import org.elasticsearch.xpack.core.security.authc.support.UsernamePasswordToken; import org.elasticsearch.xpack.security.SecurityOnTrialLicenseRestTestCase; diff --git a/x-pack/plugin/security/qa/service-account/src/javaRestTest/java/org/elasticsearch/xpack/security/authc/service/ServiceAccountIT.java b/x-pack/plugin/security/qa/service-account/src/javaRestTest/java/org/elasticsearch/xpack/security/authc/service/ServiceAccountIT.java index 8c8374b02f5eb..fecfc25580670 100644 --- a/x-pack/plugin/security/qa/service-account/src/javaRestTest/java/org/elasticsearch/xpack/security/authc/service/ServiceAccountIT.java +++ b/x-pack/plugin/security/qa/service-account/src/javaRestTest/java/org/elasticsearch/xpack/security/authc/service/ServiceAccountIT.java @@ -14,14 +14,14 @@ import org.elasticsearch.client.ResponseException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesArray; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.core.PathUtils; import org.elasticsearch.common.settings.SecureString; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.rest.ESRestTestCase; import org.elasticsearch.xpack.core.security.authz.store.ReservedRolesStore; import org.elasticsearch.xpack.core.security.user.KibanaSystemUser; diff --git a/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/BulkUpdateTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/BulkUpdateTests.java index 62f572890ded0..0c315164b3631 100644 --- a/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/BulkUpdateTests.java +++ b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/BulkUpdateTests.java @@ -14,7 +14,7 @@ import org.elasticsearch.client.RequestOptions; import org.elasticsearch.common.settings.SecureString; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.SecurityIntegTestCase; import org.elasticsearch.test.SecuritySettingsSource; import org.elasticsearch.test.SecuritySettingsSourceField; diff --git a/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/ClusterPrivilegeIntegrationTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/ClusterPrivilegeIntegrationTests.java index 07b694ee7d94d..e36e869707026 100644 --- a/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/ClusterPrivilegeIntegrationTests.java +++ b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/ClusterPrivilegeIntegrationTests.java @@ -19,7 +19,7 @@ import java.nio.file.Path; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.is; public class ClusterPrivilegeIntegrationTests extends AbstractPrivilegeTestCase { diff --git a/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/DlsFlsRequestCacheTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/DlsFlsRequestCacheTests.java index 0c69e574f5298..42c00c27292d7 100644 --- a/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/DlsFlsRequestCacheTests.java +++ b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/DlsFlsRequestCacheTests.java @@ -16,7 +16,7 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.settings.SecureString; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.cache.request.RequestCacheStats; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.script.mustache.MustachePlugin; diff --git a/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/DocumentLevelSecurityTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/DocumentLevelSecurityTests.java index 4aed0856f871e..babf200b73b62 100644 --- a/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/DocumentLevelSecurityTests.java +++ b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/DocumentLevelSecurityTests.java @@ -30,8 +30,8 @@ import org.elasticsearch.common.geo.ShapeRelation; import org.elasticsearch.common.settings.SecureString; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.TimeValue; import org.elasticsearch.index.query.FuzzyQueryBuilder; import org.elasticsearch.index.query.InnerHitBuilder; @@ -79,7 +79,7 @@ import static java.util.stream.Collectors.toList; import static org.elasticsearch.action.support.WriteRequest.RefreshPolicy.IMMEDIATE; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery; import static org.elasticsearch.index.query.QueryBuilders.termQuery; import static org.elasticsearch.integration.FieldLevelSecurityTests.openPointInTime; diff --git a/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/FieldLevelSecurityTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/FieldLevelSecurityTests.java index aac5f05162dce..72cbdc62b7345 100644 --- a/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/FieldLevelSecurityTests.java +++ b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/FieldLevelSecurityTests.java @@ -26,9 +26,9 @@ import org.elasticsearch.common.settings.SecureString; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.IndexModule; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilders; diff --git a/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/MultipleIndicesPermissionsTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/MultipleIndicesPermissionsTests.java index 8ef2410727c36..2253118c91481 100644 --- a/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/MultipleIndicesPermissionsTests.java +++ b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/MultipleIndicesPermissionsTests.java @@ -35,7 +35,7 @@ import java.util.Collections; import java.util.List; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery; import static org.elasticsearch.test.SecuritySettingsSource.SECURITY_REQUEST_OPTIONS; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount; diff --git a/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/SecurityClearScrollTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/SecurityClearScrollTests.java index 471cf679af6c7..20abc1c80ff3e 100644 --- a/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/SecurityClearScrollTests.java +++ b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/SecurityClearScrollTests.java @@ -13,7 +13,7 @@ import org.elasticsearch.action.search.MultiSearchRequestBuilder; import org.elasticsearch.action.search.MultiSearchResponse; import org.elasticsearch.action.search.SearchPhaseExecutionException; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.SecurityIntegTestCase; import org.elasticsearch.test.SecuritySettingsSourceField; import org.elasticsearch.xpack.core.security.SecurityField; diff --git a/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/license/LicensingTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/license/LicensingTests.java index 0a6dc0032b81b..322ce4aa9baf6 100644 --- a/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/license/LicensingTests.java +++ b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/license/LicensingTests.java @@ -54,7 +54,7 @@ import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.discovery.SettingsBasedSeedHostsProvider.DISCOVERY_SEED_HOSTS_SETTING; import static org.elasticsearch.license.LicenseService.LICENSE_EXPIRATION_WARNING_PERIOD; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures; diff --git a/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/authc/apikey/ApiKeySingleNodeTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/authc/apikey/ApiKeySingleNodeTests.java index 29d594232a358..c6f3cfcc51977 100644 --- a/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/authc/apikey/ApiKeySingleNodeTests.java +++ b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/authc/apikey/ApiKeySingleNodeTests.java @@ -18,7 +18,7 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.SecureString; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.TimeValue; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.test.SecuritySingleNodeTestCase; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/Security.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/Security.java index 701b8c9c2f8b8..fab59e2c02be6 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/Security.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/Security.java @@ -43,8 +43,8 @@ import org.elasticsearch.common.util.concurrent.EsExecutors; import org.elasticsearch.common.util.concurrent.ThreadContext; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.env.Environment; import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.http.HttpServerTransport; @@ -332,7 +332,7 @@ import static java.util.Collections.emptyList; import static java.util.Collections.emptyMap; import static java.util.Collections.singletonList; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.xpack.core.ClientHelper.SECURITY_ORIGIN; import static org.elasticsearch.xpack.core.XPackSettings.API_KEY_SERVICE_ENABLED_SETTING; import static org.elasticsearch.xpack.core.XPackSettings.HTTP_SSL_ENABLED; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/TransportCreateApiKeyAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/TransportCreateApiKeyAction.java index 78ae6e3c72797..4475153d32207 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/TransportCreateApiKeyAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/TransportCreateApiKeyAction.java @@ -11,7 +11,7 @@ import org.elasticsearch.action.support.ActionFilters; import org.elasticsearch.action.support.HandledTransportAction; import org.elasticsearch.common.inject.Inject; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.tasks.Task; import org.elasticsearch.transport.TransportService; import org.elasticsearch.xpack.core.security.SecurityContext; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/TransportGrantApiKeyAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/TransportGrantApiKeyAction.java index d400baa785f07..c7c14f06b0174 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/TransportGrantApiKeyAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/TransportGrantApiKeyAction.java @@ -13,7 +13,7 @@ import org.elasticsearch.action.support.HandledTransportAction; import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.tasks.Task; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.TransportRequest; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/role/TransportPutRoleAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/role/TransportPutRoleAction.java index fcb0ddc8f278d..8bd1fb4493fbf 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/role/TransportPutRoleAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/role/TransportPutRoleAction.java @@ -11,7 +11,7 @@ import org.elasticsearch.action.support.ActionFilters; import org.elasticsearch.action.support.HandledTransportAction; import org.elasticsearch.common.inject.Inject; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.tasks.Task; import org.elasticsearch.transport.TransportService; import org.elasticsearch.xpack.core.security.action.role.PutRoleAction; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/user/TransportHasPrivilegesAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/user/TransportHasPrivilegesAction.java index 52bdafe5d44ca..71144e2e880e8 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/user/TransportHasPrivilegesAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/user/TransportHasPrivilegesAction.java @@ -11,7 +11,7 @@ import org.elasticsearch.action.support.HandledTransportAction; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.inject.Inject; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.tasks.Task; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.TransportService; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/audit/logfile/LoggingAuditTrail.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/audit/logfile/LoggingAuditTrail.java index 6ebfacfad0481..74f7b08eb7424 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/audit/logfile/LoggingAuditTrail.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/audit/logfile/LoggingAuditTrail.java @@ -32,9 +32,9 @@ import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.Maps; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.node.Node; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.tasks.Task; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/ApiKeyService.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/ApiKeyService.java index 5c1b913e174b2..d0c8637bd1caf 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/ApiKeyService.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/ApiKeyService.java @@ -54,18 +54,18 @@ import org.elasticsearch.common.util.concurrent.FutureUtils; import org.elasticsearch.common.util.concurrent.ListenableFuture; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.InstantiatingObjectParser; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.InstantiatingObjectParser; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.common.xcontent.ObjectParserHelper; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentLocation; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentLocation; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.CharArrays; import org.elasticsearch.core.Nullable; import org.elasticsearch.core.TimeValue; @@ -128,8 +128,8 @@ import javax.crypto.SecretKeyFactory; import static org.elasticsearch.action.bulk.TransportSingleItemBulkWriteAction.toSingleItemBulkRequest; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; import static org.elasticsearch.search.SearchService.DEFAULT_KEEPALIVE_SETTING; import static org.elasticsearch.xpack.core.ClientHelper.SECURITY_ORIGIN; import static org.elasticsearch.xpack.core.ClientHelper.executeAsyncWithOrigin; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/TokenService.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/TokenService.java index cb2c2081ece56..254eb4024615e 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/TokenService.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/TokenService.java @@ -64,9 +64,9 @@ import org.elasticsearch.common.util.concurrent.AbstractRunnable; import org.elasticsearch.common.util.concurrent.ThreadContext; import org.elasticsearch.common.util.iterable.Iterables; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.Nullable; import org.elasticsearch.core.TimeValue; import org.elasticsearch.core.Tuple; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/UserToken.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/UserToken.java index 63241ed7a5206..fe76f41d63cf7 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/UserToken.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/UserToken.java @@ -12,8 +12,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.security.authc.Authentication; import java.io.IOException; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/esnative/NativeUsersStore.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/esnative/NativeUsersStore.java index 49058d0c06a83..de8e0ed2e9c62 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/esnative/NativeUsersStore.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/esnative/NativeUsersStore.java @@ -32,7 +32,7 @@ import org.elasticsearch.common.settings.SecureString; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.index.engine.DocumentMissingException; import org.elasticsearch.index.query.QueryBuilder; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/esnative/tool/ResetBuiltinPasswordTool.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/esnative/tool/ResetBuiltinPasswordTool.java index 7c29626822800..589c3539f067b 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/esnative/tool/ResetBuiltinPasswordTool.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/esnative/tool/ResetBuiltinPasswordTool.java @@ -17,8 +17,8 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.KeyStoreWrapper; import org.elasticsearch.common.settings.SecureString; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.core.CheckedFunction; import org.elasticsearch.env.Environment; import org.elasticsearch.xpack.core.security.support.Validation; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/esnative/tool/SetupPasswordTool.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/esnative/tool/SetupPasswordTool.java index 0a761f05c3a0a..c657140e42154 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/esnative/tool/SetupPasswordTool.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/esnative/tool/SetupPasswordTool.java @@ -23,8 +23,8 @@ import org.elasticsearch.common.settings.KeyStoreWrapper; import org.elasticsearch.common.settings.SecureString; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.env.Environment; import org.elasticsearch.xpack.core.XPackSettings; import org.elasticsearch.xpack.core.security.support.Validation; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/service/IndexServiceAccountTokenStore.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/service/IndexServiceAccountTokenStore.java index ca64552dffbcf..ee00c1dee7ee2 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/service/IndexServiceAccountTokenStore.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/service/IndexServiceAccountTokenStore.java @@ -33,8 +33,8 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.index.query.BoolQueryBuilder; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.threadpool.ThreadPool; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/support/ApiKeyGenerator.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/support/ApiKeyGenerator.java index cf7223381bd3a..e51c775acc423 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/support/ApiKeyGenerator.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/support/ApiKeyGenerator.java @@ -10,7 +10,7 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.ElasticsearchSecurityException; import org.elasticsearch.action.ActionListener; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.xpack.core.security.action.CreateApiKeyRequest; import org.elasticsearch.xpack.core.security.action.CreateApiKeyResponse; import org.elasticsearch.xpack.core.security.authc.Authentication; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/support/mapper/NativeRoleMappingStore.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/support/mapper/NativeRoleMappingStore.java index 89b8d4dbb66a0..75f548ea0dd91 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/support/mapper/NativeRoleMappingStore.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/support/mapper/NativeRoleMappingStore.java @@ -21,11 +21,11 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.script.ScriptService; @@ -58,7 +58,7 @@ import static org.elasticsearch.action.DocWriteResponse.Result.CREATED; import static org.elasticsearch.action.DocWriteResponse.Result.DELETED; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.search.SearchService.DEFAULT_KEEPALIVE_SETTING; import static org.elasticsearch.xpack.core.ClientHelper.SECURITY_ORIGIN; import static org.elasticsearch.xpack.core.ClientHelper.executeAsyncWithOrigin; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authz/store/FileRolesStore.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authz/store/FileRolesStore.java index f36f0127f866d..be853da129840 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authz/store/FileRolesStore.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authz/store/FileRolesStore.java @@ -18,9 +18,9 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.set.Sets; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.yaml.YamlXContent; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.yaml.YamlXContent; import org.elasticsearch.env.Environment; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.license.XPackLicenseState.Feature; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authz/store/NativePrivilegeStore.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authz/store/NativePrivilegeStore.java index fa9235b806b82..6e93709f9b395 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authz/store/NativePrivilegeStore.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authz/store/NativePrivilegeStore.java @@ -31,11 +31,11 @@ import org.elasticsearch.common.util.CollectionUtils; import org.elasticsearch.common.util.concurrent.ThreadContext; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.query.BoolQueryBuilder; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilders; @@ -63,7 +63,7 @@ import java.util.stream.Collector; import java.util.stream.Collectors; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.search.SearchService.DEFAULT_KEEPALIVE_SETTING; import static org.elasticsearch.xpack.core.ClientHelper.SECURITY_ORIGIN; import static org.elasticsearch.xpack.core.ClientHelper.executeAsyncWithOrigin; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authz/store/NativeRolesStore.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authz/store/NativeRolesStore.java index ef69b32b6970e..db207d559f80e 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authz/store/NativeRolesStore.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authz/store/NativeRolesStore.java @@ -29,9 +29,9 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.license.LicenseUtils; @@ -61,7 +61,7 @@ import java.util.function.BiConsumer; import java.util.function.Supplier; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.existsQuery; import static org.elasticsearch.search.SearchService.DEFAULT_KEEPALIVE_SETTING; import static org.elasticsearch.xpack.core.ClientHelper.SECURITY_ORIGIN; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/enrollment/ExternalEnrollmentTokenGenerator.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/enrollment/ExternalEnrollmentTokenGenerator.java index d7469c15056b7..90d0e30d3fae0 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/enrollment/ExternalEnrollmentTokenGenerator.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/enrollment/ExternalEnrollmentTokenGenerator.java @@ -14,8 +14,8 @@ import org.elasticsearch.common.UUIDs; import org.elasticsearch.common.io.Streams; import org.elasticsearch.common.settings.SecureString; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.core.Tuple; import org.elasticsearch.env.Environment; import org.elasticsearch.xpack.core.XPackSettings; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/operator/FileOperatorUsersStore.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/operator/FileOperatorUsersStore.java index 383fea15a3ad1..5d918df32754e 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/operator/FileOperatorUsersStore.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/operator/FileOperatorUsersStore.java @@ -13,14 +13,14 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.ValidationException; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.env.Environment; import org.elasticsearch.watcher.FileChangesListener; import org.elasticsearch.watcher.FileWatcher; @@ -42,8 +42,8 @@ import java.util.Objects; import java.util.Set; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; import static org.elasticsearch.xpack.security.operator.OperatorPrivileges.OPERATOR_PRIVILEGES_ENABLED; public class FileOperatorUsersStore { diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/SecurityRestFilter.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/SecurityRestFilter.java index 9ca77882aa567..253c72369be91 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/SecurityRestFilter.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/SecurityRestFilter.java @@ -16,8 +16,8 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.Maps; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.MediaType; -import org.elasticsearch.common.xcontent.MediaTypeRegistry; +import org.elasticsearch.xcontent.MediaType; +import org.elasticsearch.xcontent.MediaTypeRegistry; import org.elasticsearch.http.HttpChannel; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestChannel; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/RestAuthenticateAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/RestAuthenticateAction.java index 00136131804ae..b4295dee7e042 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/RestAuthenticateAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/RestAuthenticateAction.java @@ -9,8 +9,8 @@ import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/RestDelegatePkiAuthenticationAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/RestDelegatePkiAuthenticationAction.java index 7f2373e65704c..855a95601de8c 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/RestDelegatePkiAuthenticationAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/RestDelegatePkiAuthenticationAction.java @@ -11,8 +11,8 @@ import org.apache.logging.log4j.Logger; import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.license.LicenseUtils; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.BytesRestResponse; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/apikey/RestGetApiKeyAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/apikey/RestGetApiKeyAction.java index a240627e55aa3..d17755a1c8966 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/apikey/RestGetApiKeyAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/apikey/RestGetApiKeyAction.java @@ -10,7 +10,7 @@ import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/apikey/RestGrantApiKeyAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/apikey/RestGrantApiKeyAction.java index 981df656077ce..580d44f4f7d65 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/apikey/RestGrantApiKeyAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/apikey/RestGrantApiKeyAction.java @@ -11,11 +11,11 @@ import org.elasticsearch.ExceptionsHelper; import org.elasticsearch.action.support.WriteRequest; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.settings.SecureString; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.RestRequestFilter; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/apikey/RestInvalidateApiKeyAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/apikey/RestInvalidateApiKeyAction.java index a035abd8b680f..7c11cba8f3349 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/apikey/RestInvalidateApiKeyAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/apikey/RestInvalidateApiKeyAction.java @@ -8,11 +8,11 @@ package org.elasticsearch.xpack.security.rest.action.apikey; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/apikey/RestQueryApiKeyAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/apikey/RestQueryApiKeyAction.java index 598aa5a16fb65..c91f33eba6db7 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/apikey/RestQueryApiKeyAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/apikey/RestQueryApiKeyAction.java @@ -9,10 +9,10 @@ import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParserUtils; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.license.XPackLicenseState; @@ -27,7 +27,7 @@ import java.io.IOException; import java.util.List; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; import static org.elasticsearch.index.query.AbstractQueryBuilder.parseInnerQueryBuilder; import static org.elasticsearch.rest.RestRequest.Method.GET; import static org.elasticsearch.rest.RestRequest.Method.POST; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/enrollment/RestKibanaEnrollAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/enrollment/RestKibanaEnrollAction.java index acaa76dfb8a59..c993410b040ba 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/enrollment/RestKibanaEnrollAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/enrollment/RestKibanaEnrollAction.java @@ -9,7 +9,7 @@ import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/enrollment/RestNodeEnrollmentAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/enrollment/RestNodeEnrollmentAction.java index 06d0098eafb9f..507dddc029679 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/enrollment/RestNodeEnrollmentAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/enrollment/RestNodeEnrollmentAction.java @@ -9,7 +9,7 @@ import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/oauth2/RestGetTokenAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/oauth2/RestGetTokenAction.java index 15c565963245d..18ad3d75d6331 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/oauth2/RestGetTokenAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/oauth2/RestGetTokenAction.java @@ -12,14 +12,14 @@ import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionType; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.common.settings.SecureString; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestChannel; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/oauth2/RestInvalidateTokenAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/oauth2/RestInvalidateTokenAction.java index 7e73215767529..5f0b77ed76ff0 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/oauth2/RestInvalidateTokenAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/oauth2/RestInvalidateTokenAction.java @@ -7,13 +7,13 @@ package org.elasticsearch.xpack.security.rest.action.oauth2; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/oidc/RestOpenIdConnectAuthenticateAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/oidc/RestOpenIdConnectAuthenticateAction.java index e3cb2bdf1ec51..6d320445dcc0c 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/oidc/RestOpenIdConnectAuthenticateAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/oidc/RestOpenIdConnectAuthenticateAction.java @@ -9,11 +9,11 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/oidc/RestOpenIdConnectLogoutAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/oidc/RestOpenIdConnectLogoutAction.java index ce6bdb3bb901a..18d6d9ba023ef 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/oidc/RestOpenIdConnectLogoutAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/oidc/RestOpenIdConnectLogoutAction.java @@ -7,11 +7,11 @@ package org.elasticsearch.xpack.security.rest.action.oidc; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/oidc/RestOpenIdConnectPrepareAuthenticationAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/oidc/RestOpenIdConnectPrepareAuthenticationAction.java index a8edfa791b02e..f8fc28d761146 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/oidc/RestOpenIdConnectPrepareAuthenticationAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/oidc/RestOpenIdConnectPrepareAuthenticationAction.java @@ -9,11 +9,11 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/privilege/RestDeletePrivilegesAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/privilege/RestDeletePrivilegesAction.java index 770cdec56a7f9..17da1ffa1af75 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/privilege/RestDeletePrivilegesAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/privilege/RestDeletePrivilegesAction.java @@ -9,7 +9,7 @@ import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/privilege/RestGetBuiltinPrivilegesAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/privilege/RestGetBuiltinPrivilegesAction.java index b7c7f9e2f8d87..0694d1b51be88 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/privilege/RestGetBuiltinPrivilegesAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/privilege/RestGetBuiltinPrivilegesAction.java @@ -8,7 +8,7 @@ import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/privilege/RestGetPrivilegesAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/privilege/RestGetPrivilegesAction.java index 530e300f012c2..00a8ff9ba808d 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/privilege/RestGetPrivilegesAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/privilege/RestGetPrivilegesAction.java @@ -11,7 +11,7 @@ import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/privilege/RestPutPrivilegesAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/privilege/RestPutPrivilegesAction.java index ebf4fc1172313..7a360fee09ebf 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/privilege/RestPutPrivilegesAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/privilege/RestPutPrivilegesAction.java @@ -9,7 +9,7 @@ import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/role/RestDeleteRoleAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/role/RestDeleteRoleAction.java index e2a934e75534a..9dd8cf6fe7d54 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/role/RestDeleteRoleAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/role/RestDeleteRoleAction.java @@ -9,7 +9,7 @@ import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/role/RestGetRolesAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/role/RestGetRolesAction.java index 0af3d72ce2d1e..9e24909c2d6c5 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/role/RestGetRolesAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/role/RestGetRolesAction.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/role/RestPutRoleAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/role/RestPutRoleAction.java index 70d50ea3d974a..1002c33c99866 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/role/RestPutRoleAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/role/RestPutRoleAction.java @@ -9,7 +9,7 @@ import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/rolemapping/RestDeleteRoleMappingAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/rolemapping/RestDeleteRoleMappingAction.java index 843485e3f692b..2271b43fefa8c 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/rolemapping/RestDeleteRoleMappingAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/rolemapping/RestDeleteRoleMappingAction.java @@ -9,7 +9,7 @@ import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/rolemapping/RestGetRoleMappingsAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/rolemapping/RestGetRoleMappingsAction.java index 0aa2a95218fb0..954623c93cca0 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/rolemapping/RestGetRoleMappingsAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/rolemapping/RestGetRoleMappingsAction.java @@ -9,7 +9,7 @@ import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/rolemapping/RestPutRoleMappingAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/rolemapping/RestPutRoleMappingAction.java index c41bf7c1d88f6..9cef3c46cda02 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/rolemapping/RestPutRoleMappingAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/rolemapping/RestPutRoleMappingAction.java @@ -9,7 +9,7 @@ import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/saml/RestSamlAuthenticateAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/saml/RestSamlAuthenticateAction.java index 776ced6f4bec6..ab0113522409c 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/saml/RestSamlAuthenticateAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/saml/RestSamlAuthenticateAction.java @@ -9,13 +9,13 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/saml/RestSamlCompleteLogoutAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/saml/RestSamlCompleteLogoutAction.java index 4c74bd4c30985..007ef4dbb4c29 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/saml/RestSamlCompleteLogoutAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/saml/RestSamlCompleteLogoutAction.java @@ -11,12 +11,12 @@ import org.apache.logging.log4j.Logger; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/saml/RestSamlInvalidateSessionAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/saml/RestSamlInvalidateSessionAction.java index 3e2ac5b718d53..1fc57ab3d593f 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/saml/RestSamlInvalidateSessionAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/saml/RestSamlInvalidateSessionAction.java @@ -7,12 +7,12 @@ package org.elasticsearch.xpack.security.rest.action.saml; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/saml/RestSamlLogoutAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/saml/RestSamlLogoutAction.java index d1c3a520b0c88..d6701a8cde8c4 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/saml/RestSamlLogoutAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/saml/RestSamlLogoutAction.java @@ -7,12 +7,12 @@ package org.elasticsearch.xpack.security.rest.action.saml; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/saml/RestSamlPrepareAuthenticationAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/saml/RestSamlPrepareAuthenticationAction.java index 37a1e1f2f5858..7655fc101e981 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/saml/RestSamlPrepareAuthenticationAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/saml/RestSamlPrepareAuthenticationAction.java @@ -7,12 +7,12 @@ package org.elasticsearch.xpack.security.rest.action.saml; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/saml/RestSamlSpMetadataAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/saml/RestSamlSpMetadataAction.java index 9ba9bc34f9607..1a29806aa535a 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/saml/RestSamlSpMetadataAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/saml/RestSamlSpMetadataAction.java @@ -9,7 +9,7 @@ import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/user/RestChangePasswordAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/user/RestChangePasswordAction.java index 7312257e4ce53..46e8b7252a895 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/user/RestChangePasswordAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/user/RestChangePasswordAction.java @@ -11,7 +11,7 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/user/RestDeleteUserAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/user/RestDeleteUserAction.java index 24ebdd1016a00..e1cff5c99f8ce 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/user/RestDeleteUserAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/user/RestDeleteUserAction.java @@ -9,7 +9,7 @@ import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/user/RestGetUserPrivilegesAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/user/RestGetUserPrivilegesAction.java index 7a6c41291af2e..1b36d43f7c17c 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/user/RestGetUserPrivilegesAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/user/RestGetUserPrivilegesAction.java @@ -10,8 +10,8 @@ import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestChannel; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/user/RestGetUsersAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/user/RestGetUsersAction.java index 7da27c4b27660..287c109fbc1b3 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/user/RestGetUsersAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/user/RestGetUsersAction.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/user/RestHasPrivilegesAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/user/RestHasPrivilegesAction.java index 42106cef7767c..8737dfa11ef36 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/user/RestHasPrivilegesAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/user/RestHasPrivilegesAction.java @@ -12,9 +12,9 @@ import org.elasticsearch.core.Tuple; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/user/RestPutUserAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/user/RestPutUserAction.java index d3fde86d319a5..e0ab83efedbdf 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/user/RestPutUserAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/user/RestPutUserAction.java @@ -10,7 +10,7 @@ import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/user/RestSetEnabledAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/user/RestSetEnabledAction.java index 2af1cee89fae8..f4ab446183a25 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/user/RestSetEnabledAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/user/RestSetEnabledAction.java @@ -10,7 +10,7 @@ import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/support/SecurityIndexManager.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/support/SecurityIndexManager.java index 66055f831bee0..fc0301088fe7c 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/support/SecurityIndexManager.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/support/SecurityIndexManager.java @@ -35,7 +35,7 @@ import org.elasticsearch.cluster.metadata.Metadata; import org.elasticsearch.cluster.routing.IndexRoutingTable; import org.elasticsearch.cluster.service.ClusterService; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.gateway.GatewayService; import org.elasticsearch.index.Index; import org.elasticsearch.index.IndexNotFoundException; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/transport/filter/SecurityIpFilterRule.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/transport/filter/SecurityIpFilterRule.java index 54e4182aff1e4..d3234678928cb 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/transport/filter/SecurityIpFilterRule.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/transport/filter/SecurityIpFilterRule.java @@ -14,8 +14,8 @@ import org.elasticsearch.common.network.InetAddresses; import org.elasticsearch.common.network.NetworkAddress; import org.elasticsearch.common.transport.TransportAddress; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.net.Inet6Address; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/transport/netty4/SecurityNetty4HttpServerTransport.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/transport/netty4/SecurityNetty4HttpServerTransport.java index e6d89fa7359b2..36006a7cfae3b 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/transport/netty4/SecurityNetty4HttpServerTransport.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/transport/netty4/SecurityNetty4HttpServerTransport.java @@ -16,7 +16,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.ssl.SslConfiguration; import org.elasticsearch.common.util.BigArrays; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.http.HttpChannel; import org.elasticsearch.http.netty4.Netty4HttpServerTransport; import org.elasticsearch.threadpool.ThreadPool; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/transport/nio/SecurityNioHttpServerTransport.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/transport/nio/SecurityNioHttpServerTransport.java index f27dc9d0ce2f6..ffc5d0a4804be 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/transport/nio/SecurityNioHttpServerTransport.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/transport/nio/SecurityNioHttpServerTransport.java @@ -14,7 +14,7 @@ import org.elasticsearch.common.ssl.SslConfiguration; import org.elasticsearch.common.util.BigArrays; import org.elasticsearch.common.util.PageCacheRecycler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.http.nio.HttpReadWriteHandler; import org.elasticsearch.http.nio.NioHttpChannel; import org.elasticsearch.http.nio.NioHttpServerChannel; diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/test/SecurityIntegTestCase.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/test/SecurityIntegTestCase.java index 2e12d6e85c5e0..7cd919526b7b0 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/test/SecurityIntegTestCase.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/test/SecurityIntegTestCase.java @@ -28,8 +28,8 @@ import org.elasticsearch.common.settings.MockSecureSettings; import org.elasticsearch.common.settings.SecureString; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.gateway.GatewayService; import org.elasticsearch.index.Index; import org.elasticsearch.license.LicenseService; diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/core/security/action/privilege/PutPrivilegesRequestBuilderTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/core/security/action/privilege/PutPrivilegesRequestBuilderTests.java index 430f05be46426..efbde30d0dbc2 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/core/security/action/privilege/PutPrivilegesRequestBuilderTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/core/security/action/privilege/PutPrivilegesRequestBuilderTests.java @@ -8,7 +8,7 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.security.authz.privilege.ApplicationPrivilegeDescriptor; diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/SecurityInfoTransportActionTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/SecurityInfoTransportActionTests.java index efb58c445bdc7..be6f93292c8dc 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/SecurityInfoTransportActionTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/SecurityInfoTransportActionTests.java @@ -12,9 +12,9 @@ import org.elasticsearch.common.collect.MapBuilder; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.transport.TransportService; diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/role/PutRoleBuilderTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/role/PutRoleBuilderTests.java index aefb193b46339..67e7215f2c2d3 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/role/PutRoleBuilderTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/role/PutRoleBuilderTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.client.Client; import org.elasticsearch.common.bytes.BytesArray; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.client.NoOpClient; import org.elasticsearch.xpack.core.security.action.role.PutRoleRequestBuilder; diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/role/TransportPutRoleActionTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/role/TransportPutRoleActionTests.java index f4f3019d4ba5c..c847067eae9a2 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/role/TransportPutRoleActionTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/role/TransportPutRoleActionTests.java @@ -14,8 +14,8 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.index.query.MatchAllQueryBuilder; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.TermQueryBuilder; diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/saml/TransportSamlInvalidateSessionActionTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/saml/TransportSamlInvalidateSessionActionTests.java index a632115f3ca57..26b9cd8e8a096 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/saml/TransportSamlInvalidateSessionActionTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/saml/TransportSamlInvalidateSessionActionTests.java @@ -38,9 +38,9 @@ import org.elasticsearch.core.PathUtils; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.env.Environment; import org.elasticsearch.env.TestEnvironment; import org.elasticsearch.index.query.BoolQueryBuilder; diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/user/ChangePasswordRequestBuilderTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/user/ChangePasswordRequestBuilderTests.java index 79a2540d475e8..143aafd2d3d6e 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/user/ChangePasswordRequestBuilderTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/user/ChangePasswordRequestBuilderTests.java @@ -11,8 +11,8 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.SecureString; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.security.action.user.ChangePasswordRequest; import org.elasticsearch.xpack.core.security.action.user.ChangePasswordRequestBuilder; diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/user/HasPrivilegesRequestBuilderTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/user/HasPrivilegesRequestBuilderTests.java index c7f117fcd1727..2d4bbda40da76 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/user/HasPrivilegesRequestBuilderTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/user/HasPrivilegesRequestBuilderTests.java @@ -11,7 +11,7 @@ import org.elasticsearch.action.admin.cluster.stats.ClusterStatsAction; import org.elasticsearch.client.Client; import org.elasticsearch.common.bytes.BytesArray; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.security.action.user.HasPrivilegesRequest; import org.elasticsearch.xpack.core.security.action.user.HasPrivilegesRequestBuilder; diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/user/PutUserRequestBuilderTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/user/PutUserRequestBuilderTests.java index 7a74707b87a8e..aee71d6cc3a71 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/user/PutUserRequestBuilderTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/action/user/PutUserRequestBuilderTests.java @@ -12,8 +12,8 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.SecureString; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.security.action.user.PutUserRequest; import org.elasticsearch.xpack.core.security.action.user.PutUserRequestBuilder; diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/audit/logfile/LoggingAuditTrailFilterTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/audit/logfile/LoggingAuditTrailFilterTests.java index e552883a47627..d58570044f65e 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/audit/logfile/LoggingAuditTrailFilterTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/audit/logfile/LoggingAuditTrailFilterTests.java @@ -17,8 +17,8 @@ import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.mock.orig.Mockito; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.test.ESTestCase; diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/audit/logfile/LoggingAuditTrailTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/audit/logfile/LoggingAuditTrailTests.java index c2e94e56520dc..7a9273b33ab34 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/audit/logfile/LoggingAuditTrailTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/audit/logfile/LoggingAuditTrailTests.java @@ -32,9 +32,9 @@ import org.elasticsearch.common.transport.TransportAddress; import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.mock.orig.Mockito; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.tasks.Task; diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/ApiKeyServiceTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/ApiKeyServiceTests.java index f6e4545acbaf3..d42fab2b9e027 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/ApiKeyServiceTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/ApiKeyServiceTests.java @@ -38,12 +38,12 @@ import org.elasticsearch.common.util.concurrent.EsRejectedExecutionException; import org.elasticsearch.common.util.concurrent.ThreadContext; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.get.GetResult; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.test.ClusterServiceUtils; diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/AuthenticationServiceTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/AuthenticationServiceTests.java index 27b8e4ac84bdb..ab97c81482d78 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/AuthenticationServiceTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/AuthenticationServiceTests.java @@ -44,8 +44,8 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.transport.TransportAddress; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.env.Environment; import org.elasticsearch.env.TestEnvironment; import org.elasticsearch.index.get.GetResult; diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/TokenServiceMock.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/TokenServiceMock.java index c4f4fbc7cffc8..eb5856ffc02a6 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/TokenServiceMock.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/TokenServiceMock.java @@ -11,7 +11,7 @@ import org.elasticsearch.client.Client; import org.elasticsearch.common.UUIDs; import org.elasticsearch.common.settings.SecureString; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.XContentTestUtils; import org.elasticsearch.xpack.core.security.authc.Authentication; import org.elasticsearch.xpack.core.security.index.RestrictedIndicesNames; diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/TokenServiceTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/TokenServiceTests.java index 275c3faf8828b..73006313bf238 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/TokenServiceTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/TokenServiceTests.java @@ -47,10 +47,10 @@ import org.elasticsearch.common.settings.SecureString; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.Nullable; import org.elasticsearch.core.TimeValue; import org.elasticsearch.core.Tuple; diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/esnative/NativeUsersStoreTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/esnative/NativeUsersStoreTests.java index d1a90f7859521..500f9151aea40 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/esnative/NativeUsersStoreTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/esnative/NativeUsersStoreTests.java @@ -54,7 +54,7 @@ import java.util.concurrent.ExecutionException; import java.util.function.Consumer; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.seqno.SequenceNumbers.UNASSIGNED_SEQ_NO; import static org.hamcrest.CoreMatchers.containsString; import static org.hamcrest.CoreMatchers.equalTo; diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/esnative/tool/SetupPasswordToolTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/esnative/tool/SetupPasswordToolTests.java index aa3028447604e..68ae4d4bdbdc4 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/esnative/tool/SetupPasswordToolTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/esnative/tool/SetupPasswordToolTests.java @@ -17,10 +17,10 @@ import org.elasticsearch.common.settings.KeyStoreWrapper; import org.elasticsearch.common.settings.SecureString; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.env.Environment; import org.elasticsearch.env.TestEnvironment; import org.elasticsearch.protocol.xpack.XPackInfoResponse; diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/service/IndexServiceAccountTokenStoreTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/service/IndexServiceAccountTokenStoreTests.java index b70c68ba7d38e..3fb032d2ff297 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/service/IndexServiceAccountTokenStoreTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/service/IndexServiceAccountTokenStoreTests.java @@ -38,7 +38,7 @@ import org.elasticsearch.core.CharArrays; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.get.GetResult; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.search.SearchHit; diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/support/ApiKeyGeneratorTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/support/ApiKeyGeneratorTests.java index 4dc55f4ea23be..c514e21e4523c 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/support/ApiKeyGeneratorTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/support/ApiKeyGeneratorTests.java @@ -11,7 +11,7 @@ import org.elasticsearch.action.support.PlainActionFuture; import org.elasticsearch.common.settings.SecureString; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.security.action.CreateApiKeyRequest; import org.elasticsearch.xpack.core.security.action.CreateApiKeyResponse; diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/support/TokensInvalidationResultTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/support/TokensInvalidationResultTests.java index 2a7ee6ae7d1ce..f7a4b45a1771e 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/support/TokensInvalidationResultTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/support/TokensInvalidationResultTests.java @@ -9,9 +9,9 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.security.authc.support.TokensInvalidationResult; diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/support/mapper/ExpressionRoleMappingTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/support/mapper/ExpressionRoleMappingTests.java index 4961bd7304562..47e4611fa9403 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/support/mapper/ExpressionRoleMappingTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/support/mapper/ExpressionRoleMappingTests.java @@ -18,12 +18,12 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.env.Environment; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.VersionUtils; diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/AuthorizationServiceTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/AuthorizationServiceTests.java index 7d82d9991bf3d..57073154fe277 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/AuthorizationServiceTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/AuthorizationServiceTests.java @@ -96,7 +96,7 @@ import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.concurrent.ThreadContext; import org.elasticsearch.common.util.concurrent.ThreadContext.StoredContext; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.index.bulk.stats.BulkOperationListener; import org.elasticsearch.index.shard.IndexShard; diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/RBACEngineTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/RBACEngineTests.java index 56a63d0e77697..52f926511df9b 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/RBACEngineTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/RBACEngineTests.java @@ -27,7 +27,7 @@ import org.elasticsearch.common.collect.MapBuilder; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.license.GetLicenseAction; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.transport.TransportRequest; diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/RoleDescriptorTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/RoleDescriptorTests.java index 3ef23752890ea..a8e2371e7a2ac 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/RoleDescriptorTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/RoleDescriptorTests.java @@ -17,9 +17,9 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.TestMatchers; import org.elasticsearch.test.VersionUtils; @@ -38,7 +38,7 @@ import java.util.List; import java.util.Map; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.arrayContaining; import static org.hamcrest.Matchers.containsInAnyOrder; import static org.hamcrest.Matchers.containsString; diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/permission/FieldPermissionsTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/permission/FieldPermissionsTests.java index cfbdd4e8525ad..c7d8381607c4f 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/permission/FieldPermissionsTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/permission/FieldPermissionsTests.java @@ -8,7 +8,7 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.bytes.BytesArray; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.security.authz.RoleDescriptor; import org.elasticsearch.xpack.core.security.authz.permission.FieldPermissions; diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/store/CompositeRolesStoreTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/store/CompositeRolesStoreTests.java index f0533624ac927..26b4e014e4d39 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/store/CompositeRolesStoreTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/store/CompositeRolesStoreTests.java @@ -32,9 +32,9 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.Nullable; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.license.License.OperationMode; diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/store/FileRolesStoreTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/store/FileRolesStoreTests.java index 51c7663407ddc..0ce4b164f0cd2 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/store/FileRolesStoreTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/store/FileRolesStoreTests.java @@ -11,9 +11,9 @@ import org.apache.lucene.util.automaton.Automaton; import org.apache.lucene.util.automaton.MinimizationOperations; import org.apache.lucene.util.automaton.Operations; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.env.Environment; import org.elasticsearch.env.TestEnvironment; import org.elasticsearch.index.query.MatchAllQueryBuilder; diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/store/NativePrivilegeStoreTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/store/NativePrivilegeStoreTests.java index 64c0ba05161f7..907042edb1053 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/store/NativePrivilegeStoreTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/store/NativePrivilegeStoreTests.java @@ -29,8 +29,8 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.CollectionUtils; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.SearchHits; diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/store/NativeRolesStoreTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/store/NativeRolesStoreTests.java index a7e963763ef5d..6c11ac8bb01a9 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/store/NativeRolesStoreTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/store/NativeRolesStoreTests.java @@ -27,10 +27,10 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.Index; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.index.shard.ShardId; diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/enrollment/ExternalEnrollmentTokenGeneratorTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/enrollment/ExternalEnrollmentTokenGeneratorTests.java index fc430c00b5a4b..3d00971057941 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/enrollment/ExternalEnrollmentTokenGeneratorTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/enrollment/ExternalEnrollmentTokenGeneratorTests.java @@ -11,11 +11,11 @@ import org.elasticsearch.common.settings.MockSecureSettings; import org.elasticsearch.common.settings.SecureString; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.env.Environment; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.security.user.ElasticUser; diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/ingest/SetSecurityUserProcessorTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/ingest/SetSecurityUserProcessorTests.java index cfe533cd0c699..459f66444a999 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/ingest/SetSecurityUserProcessorTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/ingest/SetSecurityUserProcessorTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.ingest.IngestDocument; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.XPackSettings; diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/operator/FileOperatorUsersStoreTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/operator/FileOperatorUsersStoreTests.java index df66b76e80dd3..0c74968d9106a 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/operator/FileOperatorUsersStoreTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/operator/FileOperatorUsersStoreTests.java @@ -14,7 +14,7 @@ import org.elasticsearch.Version; import org.elasticsearch.common.logging.Loggers; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParseException; import org.elasticsearch.env.Environment; import org.elasticsearch.env.TestEnvironment; import org.elasticsearch.test.ESTestCase; diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/rest/RestRequestFilterTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/rest/RestRequestFilterTests.java index 2da7f263bcc9c..0abe05308608c 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/rest/RestRequestFilterTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/rest/RestRequestFilterTests.java @@ -8,9 +8,9 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.rest.FakeRestRequest; diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/rest/SecurityRestFilterTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/rest/SecurityRestFilterTests.java index 882d812f58df2..27660db8bf2bd 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/rest/SecurityRestFilterTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/rest/SecurityRestFilterTests.java @@ -14,10 +14,10 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.http.HttpChannel; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestChannel; diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/rest/SecurityRestFilterWarningHeadersTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/rest/SecurityRestFilterWarningHeadersTests.java index 467ae9d8eca90..c5d58ddaa69a6 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/rest/SecurityRestFilterWarningHeadersTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/rest/SecurityRestFilterWarningHeadersTests.java @@ -12,8 +12,8 @@ import org.elasticsearch.common.collect.MapBuilder; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestChannel; import org.elasticsearch.rest.RestHandler; diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/rest/action/apikey/RestCreateApiKeyActionTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/rest/action/apikey/RestCreateApiKeyActionTests.java index 93ec05ff05867..c1abf3df19c7d 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/rest/action/apikey/RestCreateApiKeyActionTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/rest/action/apikey/RestCreateApiKeyActionTests.java @@ -17,8 +17,8 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.settings.SecureString; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.env.Environment; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.AbstractRestChannel; diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/rest/action/apikey/RestGetApiKeyActionTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/rest/action/apikey/RestGetApiKeyActionTests.java index 29d681f2ef22b..88f5fdfac7255 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/rest/action/apikey/RestGetApiKeyActionTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/rest/action/apikey/RestGetApiKeyActionTests.java @@ -17,8 +17,8 @@ import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.common.collect.MapBuilder; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.env.Environment; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.AbstractRestChannel; diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/rest/action/apikey/RestInvalidateApiKeyActionTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/rest/action/apikey/RestInvalidateApiKeyActionTests.java index a273fe6243c76..c8d11455b0c21 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/rest/action/apikey/RestInvalidateApiKeyActionTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/rest/action/apikey/RestInvalidateApiKeyActionTests.java @@ -17,8 +17,8 @@ import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.env.Environment; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.AbstractRestChannel; diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/rest/action/apikey/RestQueryApiKeyActionTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/rest/action/apikey/RestQueryApiKeyActionTests.java index 8944386dd2450..5c23390d05b49 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/rest/action/apikey/RestQueryApiKeyActionTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/rest/action/apikey/RestQueryApiKeyActionTests.java @@ -15,8 +15,8 @@ import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.env.Environment; import org.elasticsearch.index.query.BoolQueryBuilder; import org.elasticsearch.index.query.MatchAllQueryBuilder; diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/rest/action/oauth2/RestGetTokenActionTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/rest/action/oauth2/RestGetTokenActionTests.java index dd3d68bdbbaa9..20c44780a9fc2 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/rest/action/oauth2/RestGetTokenActionTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/rest/action/oauth2/RestGetTokenActionTests.java @@ -10,11 +10,11 @@ import org.elasticsearch.ElasticsearchSecurityException; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.rest.AbstractRestChannel; import org.elasticsearch.rest.RestChannel; import org.elasticsearch.rest.RestResponse; diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/rest/action/oauth2/RestInvalidateTokenActionTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/rest/action/oauth2/RestInvalidateTokenActionTests.java index bc2d6b60ef701..4047e317b856d 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/rest/action/oauth2/RestInvalidateTokenActionTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/rest/action/oauth2/RestInvalidateTokenActionTests.java @@ -6,10 +6,10 @@ */ package org.elasticsearch.xpack.security.rest.action.oauth2; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.security.action.token.InvalidateTokenRequest; diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/rest/action/service/RestClearServiceAccountTokenStoreCacheActionTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/rest/action/service/RestClearServiceAccountTokenStoreCacheActionTests.java index 6eb14aefc6c49..5b05d7b004607 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/rest/action/service/RestClearServiceAccountTokenStoreCacheActionTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/rest/action/service/RestClearServiceAccountTokenStoreCacheActionTests.java @@ -11,7 +11,7 @@ import org.elasticsearch.cluster.ClusterName; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.test.rest.FakeRestRequest; diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/rest/action/user/RestGetUserPrivilegesActionTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/rest/action/user/RestGetUserPrivilegesActionTests.java index d9017a021892c..9981176f98a45 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/rest/action/user/RestGetUserPrivilegesActionTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/rest/action/user/RestGetUserPrivilegesActionTests.java @@ -12,7 +12,7 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.license.License; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.RestStatus; @@ -33,7 +33,7 @@ import java.util.LinkedHashSet; import java.util.Set; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.notNullValue; diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/rest/action/user/RestHasPrivilegesActionTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/rest/action/user/RestHasPrivilegesActionTests.java index 8cdd61f8f49a2..95fc553e51d96 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/rest/action/user/RestHasPrivilegesActionTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/rest/action/user/RestHasPrivilegesActionTests.java @@ -10,9 +10,9 @@ import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.license.License; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.RestChannel; diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/support/SecurityIndexManagerTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/support/SecurityIndexManagerTests.java index 46a7c7b5816cc..349320a752eb8 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/support/SecurityIndexManagerTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/support/SecurityIndexManagerTests.java @@ -36,7 +36,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.EsExecutors; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.gateway.GatewayService; import org.elasticsearch.index.Index; import org.elasticsearch.index.shard.ShardId; @@ -57,7 +57,7 @@ import java.util.concurrent.atomic.AtomicReference; import java.util.function.BiConsumer; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.instanceOf; import static org.hamcrest.Matchers.is; diff --git a/x-pack/plugin/shutdown/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/shutdown/NodeShutdownIT.java b/x-pack/plugin/shutdown/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/shutdown/NodeShutdownIT.java index 421ec0a9be37b..39d010cca3407 100644 --- a/x-pack/plugin/shutdown/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/shutdown/NodeShutdownIT.java +++ b/x-pack/plugin/shutdown/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/shutdown/NodeShutdownIT.java @@ -14,9 +14,9 @@ import org.elasticsearch.common.settings.SecureString; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.ObjectPath; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ObjectPath; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.core.Nullable; import org.elasticsearch.test.rest.ESRestTestCase; diff --git a/x-pack/plugin/shutdown/src/internalClusterTest/java/org/elasticsearch/xpack/shutdown/NodeShutdownTasksIT.java b/x-pack/plugin/shutdown/src/internalClusterTest/java/org/elasticsearch/xpack/shutdown/NodeShutdownTasksIT.java index c0c965029ebb9..cd72a97851c27 100644 --- a/x-pack/plugin/shutdown/src/internalClusterTest/java/org/elasticsearch/xpack/shutdown/NodeShutdownTasksIT.java +++ b/x-pack/plugin/shutdown/src/internalClusterTest/java/org/elasticsearch/xpack/shutdown/NodeShutdownTasksIT.java @@ -26,8 +26,6 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.settings.SettingsModule; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.env.Environment; import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.persistent.AllocatedPersistentTask; @@ -43,6 +41,8 @@ import org.elasticsearch.test.ESIntegTestCase; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.watcher.ResourceWatcherService; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Arrays; diff --git a/x-pack/plugin/shutdown/src/main/java/org/elasticsearch/xpack/shutdown/GetShutdownStatusAction.java b/x-pack/plugin/shutdown/src/main/java/org/elasticsearch/xpack/shutdown/GetShutdownStatusAction.java index 32428e223ad73..96676ea0f5598 100644 --- a/x-pack/plugin/shutdown/src/main/java/org/elasticsearch/xpack/shutdown/GetShutdownStatusAction.java +++ b/x-pack/plugin/shutdown/src/main/java/org/elasticsearch/xpack/shutdown/GetShutdownStatusAction.java @@ -14,8 +14,8 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Arrays; diff --git a/x-pack/plugin/shutdown/src/main/java/org/elasticsearch/xpack/shutdown/PutShutdownNodeAction.java b/x-pack/plugin/shutdown/src/main/java/org/elasticsearch/xpack/shutdown/PutShutdownNodeAction.java index 7a12d77e0aed3..56fc053059100 100644 --- a/x-pack/plugin/shutdown/src/main/java/org/elasticsearch/xpack/shutdown/PutShutdownNodeAction.java +++ b/x-pack/plugin/shutdown/src/main/java/org/elasticsearch/xpack/shutdown/PutShutdownNodeAction.java @@ -16,11 +16,11 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.core.Nullable; import org.elasticsearch.core.TimeValue; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; diff --git a/x-pack/plugin/shutdown/src/main/java/org/elasticsearch/xpack/shutdown/RestPutShutdownNodeAction.java b/x-pack/plugin/shutdown/src/main/java/org/elasticsearch/xpack/shutdown/RestPutShutdownNodeAction.java index a26678511a585..6530d98adb266 100644 --- a/x-pack/plugin/shutdown/src/main/java/org/elasticsearch/xpack/shutdown/RestPutShutdownNodeAction.java +++ b/x-pack/plugin/shutdown/src/main/java/org/elasticsearch/xpack/shutdown/RestPutShutdownNodeAction.java @@ -8,10 +8,10 @@ package org.elasticsearch.xpack.shutdown; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestToXContentListener; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.List; diff --git a/x-pack/plugin/shutdown/src/main/java/org/elasticsearch/xpack/shutdown/ShutdownPlugin.java b/x-pack/plugin/shutdown/src/main/java/org/elasticsearch/xpack/shutdown/ShutdownPlugin.java index cc9c49a9370cf..01e9debe6bec9 100644 --- a/x-pack/plugin/shutdown/src/main/java/org/elasticsearch/xpack/shutdown/ShutdownPlugin.java +++ b/x-pack/plugin/shutdown/src/main/java/org/elasticsearch/xpack/shutdown/ShutdownPlugin.java @@ -18,7 +18,6 @@ import org.elasticsearch.common.settings.IndexScopedSettings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.SettingsFilter; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; import org.elasticsearch.env.Environment; import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.plugins.ActionPlugin; @@ -29,6 +28,7 @@ import org.elasticsearch.script.ScriptService; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.watcher.ResourceWatcherService; +import org.elasticsearch.xcontent.NamedXContentRegistry; import java.util.Arrays; import java.util.Collection; diff --git a/x-pack/plugin/shutdown/src/main/java/org/elasticsearch/xpack/shutdown/SingleNodeShutdownStatus.java b/x-pack/plugin/shutdown/src/main/java/org/elasticsearch/xpack/shutdown/SingleNodeShutdownStatus.java index 8e9313743adbf..4be3d81201287 100644 --- a/x-pack/plugin/shutdown/src/main/java/org/elasticsearch/xpack/shutdown/SingleNodeShutdownStatus.java +++ b/x-pack/plugin/shutdown/src/main/java/org/elasticsearch/xpack/shutdown/SingleNodeShutdownStatus.java @@ -15,9 +15,9 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/x-pack/plugin/snapshot-repo-test-kit/src/internalClusterTest/java/org/elasticsearch/repositories/blobstore/testkit/RepositoryAnalysisFailureIT.java b/x-pack/plugin/snapshot-repo-test-kit/src/internalClusterTest/java/org/elasticsearch/repositories/blobstore/testkit/RepositoryAnalysisFailureIT.java index 44e730c89ad5f..67500b24362ed 100644 --- a/x-pack/plugin/snapshot-repo-test-kit/src/internalClusterTest/java/org/elasticsearch/repositories/blobstore/testkit/RepositoryAnalysisFailureIT.java +++ b/x-pack/plugin/snapshot-repo-test-kit/src/internalClusterTest/java/org/elasticsearch/repositories/blobstore/testkit/RepositoryAnalysisFailureIT.java @@ -23,7 +23,6 @@ import org.elasticsearch.common.util.BigArrays; import org.elasticsearch.common.util.concurrent.ConcurrentCollections; import org.elasticsearch.common.util.concurrent.CountDown; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; import org.elasticsearch.core.CheckedConsumer; import org.elasticsearch.core.Nullable; import org.elasticsearch.env.Environment; @@ -37,6 +36,7 @@ import org.elasticsearch.repositories.blobstore.BlobStoreRepository; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.snapshots.AbstractSnapshotIntegTestCase; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.xpack.core.LocalStateCompositeXPackPlugin; import org.junit.Before; diff --git a/x-pack/plugin/snapshot-repo-test-kit/src/internalClusterTest/java/org/elasticsearch/repositories/blobstore/testkit/RepositoryAnalysisSuccessIT.java b/x-pack/plugin/snapshot-repo-test-kit/src/internalClusterTest/java/org/elasticsearch/repositories/blobstore/testkit/RepositoryAnalysisSuccessIT.java index 2f883759b7fe0..d0d73f0959e5a 100644 --- a/x-pack/plugin/snapshot-repo-test-kit/src/internalClusterTest/java/org/elasticsearch/repositories/blobstore/testkit/RepositoryAnalysisSuccessIT.java +++ b/x-pack/plugin/snapshot-repo-test-kit/src/internalClusterTest/java/org/elasticsearch/repositories/blobstore/testkit/RepositoryAnalysisSuccessIT.java @@ -21,7 +21,6 @@ import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.common.util.BigArrays; import org.elasticsearch.common.util.concurrent.ConcurrentCollections; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; import org.elasticsearch.core.CheckedConsumer; import org.elasticsearch.core.Nullable; import org.elasticsearch.core.TimeValue; @@ -35,6 +34,7 @@ import org.elasticsearch.repositories.blobstore.BlobStoreRepository; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.snapshots.AbstractSnapshotIntegTestCase; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.xpack.core.LocalStateCompositeXPackPlugin; import org.junit.Before; diff --git a/x-pack/plugin/snapshot-repo-test-kit/src/main/java/org/elasticsearch/repositories/blobstore/testkit/BlobAnalyzeAction.java b/x-pack/plugin/snapshot-repo-test-kit/src/main/java/org/elasticsearch/repositories/blobstore/testkit/BlobAnalyzeAction.java index 92c6814ba794e..aaa8599512084 100644 --- a/x-pack/plugin/snapshot-repo-test-kit/src/main/java/org/elasticsearch/repositories/blobstore/testkit/BlobAnalyzeAction.java +++ b/x-pack/plugin/snapshot-repo-test-kit/src/main/java/org/elasticsearch/repositories/blobstore/testkit/BlobAnalyzeAction.java @@ -33,9 +33,6 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.core.Nullable; import org.elasticsearch.repositories.RepositoriesService; import org.elasticsearch.repositories.Repository; @@ -48,6 +45,9 @@ import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.TransportRequestOptions; import org.elasticsearch.transport.TransportService; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.ArrayList; diff --git a/x-pack/plugin/snapshot-repo-test-kit/src/main/java/org/elasticsearch/repositories/blobstore/testkit/RepositoryAnalyzeAction.java b/x-pack/plugin/snapshot-repo-test-kit/src/main/java/org/elasticsearch/repositories/blobstore/testkit/RepositoryAnalyzeAction.java index 91767c982fe6c..99d34a654744d 100644 --- a/x-pack/plugin/snapshot-repo-test-kit/src/main/java/org/elasticsearch/repositories/blobstore/testkit/RepositoryAnalyzeAction.java +++ b/x-pack/plugin/snapshot-repo-test-kit/src/main/java/org/elasticsearch/repositories/blobstore/testkit/RepositoryAnalyzeAction.java @@ -35,7 +35,6 @@ import org.elasticsearch.common.util.concurrent.ConcurrentCollections; import org.elasticsearch.common.util.concurrent.CountDown; import org.elasticsearch.common.xcontent.StatusToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.core.TimeValue; import org.elasticsearch.repositories.RepositoriesService; import org.elasticsearch.repositories.Repository; @@ -52,6 +51,7 @@ import org.elasticsearch.transport.TransportRequestOptions; import org.elasticsearch.transport.TransportResponseHandler; import org.elasticsearch.transport.TransportService; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.ArrayList; diff --git a/x-pack/plugin/snapshot-repo-test-kit/src/main/java/org/elasticsearch/repositories/blobstore/testkit/RepositoryPerformanceSummary.java b/x-pack/plugin/snapshot-repo-test-kit/src/main/java/org/elasticsearch/repositories/blobstore/testkit/RepositoryPerformanceSummary.java index 8ac0090390c24..3934cd5914820 100644 --- a/x-pack/plugin/snapshot-repo-test-kit/src/main/java/org/elasticsearch/repositories/blobstore/testkit/RepositoryPerformanceSummary.java +++ b/x-pack/plugin/snapshot-repo-test-kit/src/main/java/org/elasticsearch/repositories/blobstore/testkit/RepositoryPerformanceSummary.java @@ -11,8 +11,8 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.concurrent.atomic.LongAccumulator; diff --git a/x-pack/plugin/snapshot-repo-test-kit/src/main/java/org/elasticsearch/repositories/blobstore/testkit/RestRepositoryAnalyzeAction.java b/x-pack/plugin/snapshot-repo-test-kit/src/main/java/org/elasticsearch/repositories/blobstore/testkit/RestRepositoryAnalyzeAction.java index 83a159738db43..97c72967da862 100644 --- a/x-pack/plugin/snapshot-repo-test-kit/src/main/java/org/elasticsearch/repositories/blobstore/testkit/RestRepositoryAnalyzeAction.java +++ b/x-pack/plugin/snapshot-repo-test-kit/src/main/java/org/elasticsearch/repositories/blobstore/testkit/RestRepositoryAnalyzeAction.java @@ -8,12 +8,12 @@ package org.elasticsearch.repositories.blobstore.testkit; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.RestResponse; import org.elasticsearch.rest.action.RestCancellableNodeClient; import org.elasticsearch.rest.action.RestStatusToXContentListener; +import org.elasticsearch.xcontent.XContentBuilder; import java.util.List; diff --git a/x-pack/plugin/snapshot-repo-test-kit/src/main/java/org/elasticsearch/repositories/blobstore/testkit/SnapshotRepositoryTestKit.java b/x-pack/plugin/snapshot-repo-test-kit/src/main/java/org/elasticsearch/repositories/blobstore/testkit/SnapshotRepositoryTestKit.java index e0318fe97c165..02eb4805421cc 100644 --- a/x-pack/plugin/snapshot-repo-test-kit/src/main/java/org/elasticsearch/repositories/blobstore/testkit/SnapshotRepositoryTestKit.java +++ b/x-pack/plugin/snapshot-repo-test-kit/src/main/java/org/elasticsearch/repositories/blobstore/testkit/SnapshotRepositoryTestKit.java @@ -15,12 +15,12 @@ import org.elasticsearch.common.settings.IndexScopedSettings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.SettingsFilter; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.core.TimeValue; import org.elasticsearch.plugins.ActionPlugin; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.rest.RestController; import org.elasticsearch.rest.RestHandler; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.List; diff --git a/x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/search/GeoBoundingBoxQueryGeoShapeWithDocValuesIT.java b/x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/search/GeoBoundingBoxQueryGeoShapeWithDocValuesIT.java index a17e08ce64392..5ac7a160fc8ba 100644 --- a/x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/search/GeoBoundingBoxQueryGeoShapeWithDocValuesIT.java +++ b/x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/search/GeoBoundingBoxQueryGeoShapeWithDocValuesIT.java @@ -8,8 +8,8 @@ package org.elasticsearch.xpack.spatial.search; import org.elasticsearch.Version; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.search.geo.GeoBoundingBoxQueryIntegTestCase; import org.elasticsearch.test.VersionUtils; diff --git a/x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/search/GeoBoundingBoxQueryLegacyGeoShapeWithDocValuesIT.java b/x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/search/GeoBoundingBoxQueryLegacyGeoShapeWithDocValuesIT.java index 297c2c49c985a..9b77f243fecc1 100644 --- a/x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/search/GeoBoundingBoxQueryLegacyGeoShapeWithDocValuesIT.java +++ b/x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/search/GeoBoundingBoxQueryLegacyGeoShapeWithDocValuesIT.java @@ -8,8 +8,8 @@ package org.elasticsearch.xpack.spatial.search; import org.elasticsearch.Version; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.search.geo.GeoBoundingBoxQueryIntegTestCase; import org.elasticsearch.test.VersionUtils; diff --git a/x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/search/GeoShapeScriptDocValuesIT.java b/x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/search/GeoShapeScriptDocValuesIT.java index 24cb6fd862131..10a695d45a573 100644 --- a/x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/search/GeoShapeScriptDocValuesIT.java +++ b/x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/search/GeoShapeScriptDocValuesIT.java @@ -18,8 +18,8 @@ import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.common.document.DocumentField; import org.elasticsearch.common.geo.GeoBoundingBox; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.geo.GeometryTestUtils; import org.elasticsearch.geometry.Geometry; import org.elasticsearch.geometry.LinearRing; @@ -47,7 +47,7 @@ import java.util.Map; import java.util.function.Function; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse; import static org.hamcrest.Matchers.equalTo; diff --git a/x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/search/GeoShapeWithDocValuesIT.java b/x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/search/GeoShapeWithDocValuesIT.java index b7b943fdf106a..46fbfa775faf8 100644 --- a/x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/search/GeoShapeWithDocValuesIT.java +++ b/x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/search/GeoShapeWithDocValuesIT.java @@ -8,8 +8,8 @@ package org.elasticsearch.xpack.spatial.search; import org.elasticsearch.Version; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.mapper.MapperParsingException; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.search.geo.GeoShapeIntegTestCase; diff --git a/x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/search/GeoShapeWithDocValuesQueryTests.java b/x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/search/GeoShapeWithDocValuesQueryTests.java index 3f5406d320755..1cd9894810926 100644 --- a/x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/search/GeoShapeWithDocValuesQueryTests.java +++ b/x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/search/GeoShapeWithDocValuesQueryTests.java @@ -19,8 +19,8 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.geo.GeoJson; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.geo.GeometryTestUtils; import org.elasticsearch.geometry.MultiPoint; import org.elasticsearch.plugins.Plugin; @@ -32,7 +32,7 @@ import java.util.Collections; import static org.elasticsearch.action.support.WriteRequest.RefreshPolicy.IMMEDIATE; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.geoShapeQuery; public class GeoShapeWithDocValuesQueryTests extends GeoShapeQueryTestCase { diff --git a/x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/search/LegacyGeoShapeWithDocValuesIT.java b/x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/search/LegacyGeoShapeWithDocValuesIT.java index 6d0fbc2ba6f2b..333914d0e1880 100644 --- a/x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/search/LegacyGeoShapeWithDocValuesIT.java +++ b/x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/search/LegacyGeoShapeWithDocValuesIT.java @@ -9,9 +9,9 @@ import org.elasticsearch.Version; import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.geometry.Circle; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.search.geo.GeoShapeIntegTestCase; diff --git a/x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/search/ShapeQueryOverPointTests.java b/x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/search/ShapeQueryOverPointTests.java index ac69e7adc776b..7180f1ff2efc3 100644 --- a/x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/search/ShapeQueryOverPointTests.java +++ b/x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/search/ShapeQueryOverPointTests.java @@ -11,8 +11,8 @@ import org.elasticsearch.action.search.SearchRequestBuilder; import org.elasticsearch.common.Strings; import org.elasticsearch.common.geo.ShapeRelation; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.geometry.Line; import org.elasticsearch.geometry.LinearRing; import org.elasticsearch.geometry.MultiLine; diff --git a/x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/search/ShapeQueryOverShapeTests.java b/x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/search/ShapeQueryOverShapeTests.java index 173d68ee0e434..c93c84d9f4518 100644 --- a/x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/search/ShapeQueryOverShapeTests.java +++ b/x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/search/ShapeQueryOverShapeTests.java @@ -12,9 +12,9 @@ import org.elasticsearch.common.geo.GeoJson; import org.elasticsearch.common.geo.ShapeRelation; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.geometry.Geometry; import org.elasticsearch.geometry.GeometryCollection; import org.elasticsearch.geometry.MultiPoint; @@ -32,7 +32,7 @@ import java.util.Locale; import static org.elasticsearch.action.support.WriteRequest.RefreshPolicy.IMMEDIATE; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount; diff --git a/x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/search/ShapeQueryTestCase.java b/x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/search/ShapeQueryTestCase.java index 38acddc04c8e7..8f95ba0789b70 100644 --- a/x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/search/ShapeQueryTestCase.java +++ b/x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/search/ShapeQueryTestCase.java @@ -11,9 +11,9 @@ import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.common.Strings; import org.elasticsearch.common.geo.ShapeRelation; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.geometry.Circle; import org.elasticsearch.geometry.LinearRing; import org.elasticsearch.geometry.MultiPolygon; @@ -32,7 +32,7 @@ import java.util.List; import static org.elasticsearch.action.support.WriteRequest.RefreshPolicy.IMMEDIATE; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.not; diff --git a/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/SpatialPlugin.java b/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/SpatialPlugin.java index e87cda71ce500..307ee130e5ed4 100644 --- a/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/SpatialPlugin.java +++ b/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/SpatialPlugin.java @@ -10,7 +10,7 @@ import org.elasticsearch.action.ActionRequest; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.common.geo.GeoFormatterFactory; -import org.elasticsearch.common.xcontent.ContextParser; +import org.elasticsearch.xcontent.ContextParser; import org.elasticsearch.geometry.Geometry; import org.elasticsearch.index.mapper.Mapper; import org.elasticsearch.ingest.Processor; diff --git a/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/SpatialUsage.java b/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/SpatialUsage.java index b19690f3314cf..3c1b9bebd4a59 100644 --- a/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/SpatialUsage.java +++ b/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/SpatialUsage.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.spatial; import org.elasticsearch.cluster.node.DiscoveryNode; -import org.elasticsearch.common.xcontent.ContextParser; +import org.elasticsearch.xcontent.ContextParser; import org.elasticsearch.xpack.core.common.stats.EnumCounters; import org.elasticsearch.xpack.core.spatial.action.SpatialStatsAction; diff --git a/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/common/CartesianPoint.java b/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/common/CartesianPoint.java index cff2eb9673395..9ff460e1ac038 100644 --- a/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/common/CartesianPoint.java +++ b/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/common/CartesianPoint.java @@ -8,14 +8,14 @@ package org.elasticsearch.xpack.spatial.common; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentSubParser; -import org.elasticsearch.common.xcontent.support.MapXContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentSubParser; +import org.elasticsearch.xcontent.support.MapXContentParser; import org.elasticsearch.geometry.Geometry; import org.elasticsearch.geometry.ShapeType; import org.elasticsearch.geometry.utils.StandardValidator; diff --git a/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/index/fielddata/GeoShapeValues.java b/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/index/fielddata/GeoShapeValues.java index 6e52d1ea3c728..bb9f64f7af874 100644 --- a/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/index/fielddata/GeoShapeValues.java +++ b/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/index/fielddata/GeoShapeValues.java @@ -8,8 +8,8 @@ package org.elasticsearch.xpack.spatial.index.fielddata; import org.apache.lucene.util.BytesRef; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.geometry.Geometry; import org.elasticsearch.geometry.Rectangle; import org.elasticsearch.geometry.utils.GeographyValidator; diff --git a/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/index/mapper/PointFieldMapper.java b/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/index/mapper/PointFieldMapper.java index a5e652bd10332..979e657d3bf5e 100644 --- a/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/index/mapper/PointFieldMapper.java +++ b/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/index/mapper/PointFieldMapper.java @@ -16,7 +16,7 @@ import org.elasticsearch.common.geo.ShapeRelation; import org.elasticsearch.common.logging.DeprecationCategory; import org.elasticsearch.common.logging.DeprecationLogger; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.geometry.Geometry; import org.elasticsearch.geometry.Point; import org.elasticsearch.index.mapper.AbstractPointGeometryFieldMapper; diff --git a/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/index/query/ShapeQueryBuilder.java b/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/index/query/ShapeQueryBuilder.java index 5cf12dbe439bd..26866f3337c4d 100644 --- a/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/index/query/ShapeQueryBuilder.java +++ b/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/index/query/ShapeQueryBuilder.java @@ -11,8 +11,8 @@ import org.elasticsearch.common.geo.GeometryParser; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.geometry.Geometry; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.query.AbstractGeometryQueryBuilder; diff --git a/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/ingest/CircleProcessor.java b/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/ingest/CircleProcessor.java index 00e933e437e9b..991a0e4f92e17 100644 --- a/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/ingest/CircleProcessor.java +++ b/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/ingest/CircleProcessor.java @@ -8,14 +8,14 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.geo.GeometryParserFormat; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.support.MapXContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.support.MapXContentParser; import org.elasticsearch.geometry.Circle; import org.elasticsearch.geometry.Geometry; import org.elasticsearch.geometry.ShapeType; diff --git a/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/search/aggregations/GeoLineAggregationBuilder.java b/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/search/aggregations/GeoLineAggregationBuilder.java index fa434a637d765..55d04a25f0f13 100644 --- a/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/search/aggregations/GeoLineAggregationBuilder.java +++ b/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/search/aggregations/GeoLineAggregationBuilder.java @@ -6,12 +6,12 @@ */ package org.elasticsearch.xpack.spatial.search.aggregations; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.AggregationBuilder; diff --git a/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/search/aggregations/InternalGeoLine.java b/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/search/aggregations/InternalGeoLine.java index b76b5594ccad7..14813472f4974 100644 --- a/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/search/aggregations/InternalGeoLine.java +++ b/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/search/aggregations/InternalGeoLine.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.search.aggregations.InternalAggregation; import org.elasticsearch.search.sort.SortOrder; import org.elasticsearch.xpack.core.spatial.search.aggregations.GeoShapeMetricAggregation; diff --git a/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/action/SpatialStatsTransportActionTests.java b/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/action/SpatialStatsTransportActionTests.java index 21c27c860009c..ef9b2368c3e4d 100644 --- a/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/action/SpatialStatsTransportActionTests.java +++ b/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/action/SpatialStatsTransportActionTests.java @@ -14,10 +14,10 @@ import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ContextParser; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ContextParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.rest.yaml.ObjectPath; import org.elasticsearch.threadpool.ThreadPool; @@ -34,7 +34,7 @@ import java.util.stream.Collectors; import static java.util.Collections.emptyList; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.equalTo; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/index/mapper/CartesianFieldMapperTests.java b/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/index/mapper/CartesianFieldMapperTests.java index 4ee7988e564f4..9c205e2a4ba8e 100644 --- a/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/index/mapper/CartesianFieldMapperTests.java +++ b/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/index/mapper/CartesianFieldMapperTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.spatial.index.mapper; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.mapper.MapperParsingException; diff --git a/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/index/mapper/GeoShapeWithDocValuesFieldMapperTests.java b/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/index/mapper/GeoShapeWithDocValuesFieldMapperTests.java index 9566c7912bdbe..4df9681a0a00d 100644 --- a/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/index/mapper/GeoShapeWithDocValuesFieldMapperTests.java +++ b/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/index/mapper/GeoShapeWithDocValuesFieldMapperTests.java @@ -19,10 +19,10 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.geo.Orientation; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.mapper.Mapper; diff --git a/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/index/mapper/PointFieldMapperTests.java b/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/index/mapper/PointFieldMapperTests.java index 0daa8dc575f86..e4f7a189bed15 100644 --- a/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/index/mapper/PointFieldMapperTests.java +++ b/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/index/mapper/PointFieldMapperTests.java @@ -7,8 +7,8 @@ package org.elasticsearch.xpack.spatial.index.mapper; import org.apache.lucene.util.BytesRef; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.mapper.Mapper; diff --git a/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/index/mapper/ShapeFieldMapperTests.java b/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/index/mapper/ShapeFieldMapperTests.java index 1c75233ff52d0..94579496213f3 100644 --- a/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/index/mapper/ShapeFieldMapperTests.java +++ b/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/index/mapper/ShapeFieldMapperTests.java @@ -8,7 +8,7 @@ import org.apache.lucene.index.IndexableField; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContent; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.mapper.Mapper; diff --git a/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/index/query/GeoShapeWithDocValuesQueryTests.java b/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/index/query/GeoShapeWithDocValuesQueryTests.java index d89ced267c2ee..79add0358a40e 100644 --- a/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/index/query/GeoShapeWithDocValuesQueryTests.java +++ b/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/index/query/GeoShapeWithDocValuesQueryTests.java @@ -11,8 +11,8 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.geo.GeoJson; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.geo.GeometryTestUtils; import org.elasticsearch.geometry.MultiPoint; import org.elasticsearch.plugins.Plugin; @@ -24,7 +24,7 @@ import java.util.Collections; import static org.elasticsearch.action.support.WriteRequest.RefreshPolicy.IMMEDIATE; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.geoShapeQuery; public class GeoShapeWithDocValuesQueryTests extends GeoShapeQueryTestCase { diff --git a/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/index/query/LegacyGeoShapeWithDocValuesQueryTests.java b/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/index/query/LegacyGeoShapeWithDocValuesQueryTests.java index 8f8020c5ab1b9..e98e8a5c77b25 100644 --- a/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/index/query/LegacyGeoShapeWithDocValuesQueryTests.java +++ b/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/index/query/LegacyGeoShapeWithDocValuesQueryTests.java @@ -12,8 +12,8 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.geo.GeoJson; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.geo.GeometryTestUtils; import org.elasticsearch.geometry.Geometry; import org.elasticsearch.geometry.MultiPoint; @@ -30,7 +30,7 @@ import java.util.Collections; import static org.elasticsearch.action.support.WriteRequest.RefreshPolicy.IMMEDIATE; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.geoIntersectionQuery; import static org.elasticsearch.index.query.QueryBuilders.geoShapeQuery; import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery; diff --git a/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/index/query/ShapeQueryBuilderTests.java b/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/index/query/ShapeQueryBuilderTests.java index a4fab895df90f..c146d939299e2 100644 --- a/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/index/query/ShapeQueryBuilderTests.java +++ b/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/index/query/ShapeQueryBuilderTests.java @@ -18,10 +18,10 @@ import org.elasticsearch.common.geo.GeoJson; import org.elasticsearch.common.geo.ShapeRelation; import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.geometry.Geometry; import org.elasticsearch.geometry.ShapeType; import org.elasticsearch.index.get.GetResult; diff --git a/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/ingest/CircleProcessorTests.java b/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/ingest/CircleProcessorTests.java index 13f53e560710c..2da7f9e82fdab 100644 --- a/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/ingest/CircleProcessorTests.java +++ b/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/ingest/CircleProcessorTests.java @@ -18,11 +18,11 @@ import org.elasticsearch.common.geo.GeoJson; import org.elasticsearch.common.geo.ShapeRelation; import org.elasticsearch.common.geo.Orientation; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.geometry.Circle; import org.elasticsearch.geometry.Geometry; import org.elasticsearch.geometry.Point; diff --git a/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/search/aggregations/GeoLineAggregationBuilderTests.java b/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/search/aggregations/GeoLineAggregationBuilderTests.java index 88670355795b9..b97efa6eff4d6 100644 --- a/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/search/aggregations/GeoLineAggregationBuilderTests.java +++ b/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/search/aggregations/GeoLineAggregationBuilderTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.spatial.search.aggregations; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.aggregations.support.MultiValuesSourceFieldConfig; import org.elasticsearch.search.sort.SortOrder; import org.elasticsearch.test.AbstractSerializingTestCase; diff --git a/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/search/aggregations/InternalGeoLineTests.java b/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/search/aggregations/InternalGeoLineTests.java index 6c02f80229fa4..8c775c17d44e2 100644 --- a/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/search/aggregations/InternalGeoLineTests.java +++ b/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/search/aggregations/InternalGeoLineTests.java @@ -6,9 +6,9 @@ */ package org.elasticsearch.xpack.spatial.search.aggregations; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.util.CollectionUtils; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.plugins.SearchPlugin; import org.elasticsearch.search.aggregations.Aggregation; import org.elasticsearch.search.aggregations.ParsedAggregation; diff --git a/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/util/GeoTestUtils.java b/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/util/GeoTestUtils.java index 7e6bb4ca079b5..f89303658f2ec 100644 --- a/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/util/GeoTestUtils.java +++ b/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/util/GeoTestUtils.java @@ -14,14 +14,14 @@ import org.elasticsearch.common.geo.GeoJson; import org.elasticsearch.common.geo.GeoPoint; import org.elasticsearch.common.geo.GeometryParser; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.geo.GeometryTestUtils; import org.elasticsearch.geometry.Geometry; import org.elasticsearch.geometry.Rectangle; diff --git a/x-pack/plugin/sql/jdbc/src/main/java/org/elasticsearch/xpack/sql/jdbc/XContentSqlExtension.java b/x-pack/plugin/sql/jdbc/src/main/java/org/elasticsearch/xpack/sql/jdbc/XContentSqlExtension.java index 29ebcadc246ae..28b67ac5008fc 100644 --- a/x-pack/plugin/sql/jdbc/src/main/java/org/elasticsearch/xpack/sql/jdbc/XContentSqlExtension.java +++ b/x-pack/plugin/sql/jdbc/src/main/java/org/elasticsearch/xpack/sql/jdbc/XContentSqlExtension.java @@ -7,8 +7,8 @@ package org.elasticsearch.xpack.sql.jdbc; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentBuilderExtension; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilderExtension; import org.elasticsearch.xpack.sql.proto.StringUtils; import java.time.ZonedDateTime; diff --git a/x-pack/plugin/sql/jdbc/src/main/resources/META-INF/services/org.elasticsearch.common.xcontent.XContentBuilderExtension b/x-pack/plugin/sql/jdbc/src/main/resources/META-INF/services/org.elasticsearch.xcontent.XContentBuilderExtension similarity index 100% rename from x-pack/plugin/sql/jdbc/src/main/resources/META-INF/services/org.elasticsearch.common.xcontent.XContentBuilderExtension rename to x-pack/plugin/sql/jdbc/src/main/resources/META-INF/services/org.elasticsearch.xcontent.XContentBuilderExtension diff --git a/x-pack/plugin/sql/jdbc/src/test/java/org/elasticsearch/xpack/sql/jdbc/JdbcConfigurationDataSourceTests.java b/x-pack/plugin/sql/jdbc/src/test/java/org/elasticsearch/xpack/sql/jdbc/JdbcConfigurationDataSourceTests.java index 37ead27568149..d7d8d2d21dab7 100644 --- a/x-pack/plugin/sql/jdbc/src/test/java/org/elasticsearch/xpack/sql/jdbc/JdbcConfigurationDataSourceTests.java +++ b/x-pack/plugin/sql/jdbc/src/test/java/org/elasticsearch/xpack/sql/jdbc/JdbcConfigurationDataSourceTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.sql.jdbc; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.http.MockResponse; import java.io.IOException; diff --git a/x-pack/plugin/sql/jdbc/src/test/java/org/elasticsearch/xpack/sql/jdbc/JdbcHttpClientRequestTests.java b/x-pack/plugin/sql/jdbc/src/test/java/org/elasticsearch/xpack/sql/jdbc/JdbcHttpClientRequestTests.java index 450a2dada8188..d22f90d88e322 100644 --- a/x-pack/plugin/sql/jdbc/src/test/java/org/elasticsearch/xpack/sql/jdbc/JdbcHttpClientRequestTests.java +++ b/x-pack/plugin/sql/jdbc/src/test/java/org/elasticsearch/xpack/sql/jdbc/JdbcHttpClientRequestTests.java @@ -21,7 +21,7 @@ import org.elasticsearch.common.io.Streams; import org.elasticsearch.common.util.concurrent.ConcurrentCollections; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.mocksocket.MockHttpServer; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.sql.client.ConnectionConfiguration; diff --git a/x-pack/plugin/sql/jdbc/src/test/java/org/elasticsearch/xpack/sql/jdbc/TypeConverterTests.java b/x-pack/plugin/sql/jdbc/src/test/java/org/elasticsearch/xpack/sql/jdbc/TypeConverterTests.java index 999ffa6846bb7..10cc03ab236cd 100644 --- a/x-pack/plugin/sql/jdbc/src/test/java/org/elasticsearch/xpack/sql/jdbc/TypeConverterTests.java +++ b/x-pack/plugin/sql/jdbc/src/test/java/org/elasticsearch/xpack/sql/jdbc/TypeConverterTests.java @@ -7,9 +7,9 @@ package org.elasticsearch.xpack.sql.jdbc; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.ESTestCase; import java.sql.Date; diff --git a/x-pack/plugin/sql/jdbc/src/test/java/org/elasticsearch/xpack/sql/jdbc/VersionParityTests.java b/x-pack/plugin/sql/jdbc/src/test/java/org/elasticsearch/xpack/sql/jdbc/VersionParityTests.java index 54321e5b0a0d9..b6212745c4415 100644 --- a/x-pack/plugin/sql/jdbc/src/test/java/org/elasticsearch/xpack/sql/jdbc/VersionParityTests.java +++ b/x-pack/plugin/sql/jdbc/src/test/java/org/elasticsearch/xpack/sql/jdbc/VersionParityTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.Version; import org.elasticsearch.action.main.MainResponse; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.VersionUtils; import org.elasticsearch.test.http.MockResponse; import org.elasticsearch.xpack.sql.client.ClientVersion; diff --git a/x-pack/plugin/sql/qa/jdbc/src/main/java/org/elasticsearch/xpack/sql/qa/jdbc/FetchSizeTestCase.java b/x-pack/plugin/sql/qa/jdbc/src/main/java/org/elasticsearch/xpack/sql/qa/jdbc/FetchSizeTestCase.java index 4c5d29edd4bdb..b8af2ae44623a 100644 --- a/x-pack/plugin/sql/qa/jdbc/src/main/java/org/elasticsearch/xpack/sql/qa/jdbc/FetchSizeTestCase.java +++ b/x-pack/plugin/sql/qa/jdbc/src/main/java/org/elasticsearch/xpack/sql/qa/jdbc/FetchSizeTestCase.java @@ -8,8 +8,8 @@ import org.elasticsearch.client.Request; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.junit.Before; import java.io.IOException; diff --git a/x-pack/plugin/sql/qa/jdbc/src/main/java/org/elasticsearch/xpack/sql/qa/jdbc/JdbcIntegrationTestCase.java b/x-pack/plugin/sql/qa/jdbc/src/main/java/org/elasticsearch/xpack/sql/qa/jdbc/JdbcIntegrationTestCase.java index ed6f37b2daed0..4a1c687e88854 100644 --- a/x-pack/plugin/sql/qa/jdbc/src/main/java/org/elasticsearch/xpack/sql/qa/jdbc/JdbcIntegrationTestCase.java +++ b/x-pack/plugin/sql/qa/jdbc/src/main/java/org/elasticsearch/xpack/sql/qa/jdbc/JdbcIntegrationTestCase.java @@ -10,9 +10,9 @@ import org.elasticsearch.client.Response; import org.elasticsearch.core.CheckedConsumer; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.rest.ESRestTestCase; import org.elasticsearch.xpack.sql.jdbc.EsDataSource; import org.junit.After; diff --git a/x-pack/plugin/sql/qa/jdbc/src/main/java/org/elasticsearch/xpack/sql/qa/jdbc/ResultSetTestCase.java b/x-pack/plugin/sql/qa/jdbc/src/main/java/org/elasticsearch/xpack/sql/qa/jdbc/ResultSetTestCase.java index 0eb8320d47fce..bac40d80dff2d 100644 --- a/x-pack/plugin/sql/qa/jdbc/src/main/java/org/elasticsearch/xpack/sql/qa/jdbc/ResultSetTestCase.java +++ b/x-pack/plugin/sql/qa/jdbc/src/main/java/org/elasticsearch/xpack/sql/qa/jdbc/ResultSetTestCase.java @@ -14,8 +14,8 @@ import org.elasticsearch.common.CheckedSupplier; import org.elasticsearch.common.Strings; import org.elasticsearch.core.Tuple; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.sql.jdbc.EsType; import org.junit.Before; diff --git a/x-pack/plugin/sql/qa/mixed-node/src/test/java/org/elasticsearch/xpack/sql/qa/mixed_node/SqlCompatIT.java b/x-pack/plugin/sql/qa/mixed-node/src/test/java/org/elasticsearch/xpack/sql/qa/mixed_node/SqlCompatIT.java index 1b8864e5ff58b..cd9dd1d8fcc8a 100644 --- a/x-pack/plugin/sql/qa/mixed-node/src/test/java/org/elasticsearch/xpack/sql/qa/mixed_node/SqlCompatIT.java +++ b/x-pack/plugin/sql/qa/mixed-node/src/test/java/org/elasticsearch/xpack/sql/qa/mixed_node/SqlCompatIT.java @@ -13,10 +13,10 @@ import org.elasticsearch.client.Response; import org.elasticsearch.client.RestClient; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.core.internal.io.IOUtils; import org.elasticsearch.xpack.ql.TestNode; import org.elasticsearch.xpack.ql.TestNodes; diff --git a/x-pack/plugin/sql/qa/mixed-node/src/test/java/org/elasticsearch/xpack/sql/qa/mixed_node/SqlSearchIT.java b/x-pack/plugin/sql/qa/mixed-node/src/test/java/org/elasticsearch/xpack/sql/qa/mixed_node/SqlSearchIT.java index 026da06c46eba..02074ad9119f9 100644 --- a/x-pack/plugin/sql/qa/mixed-node/src/test/java/org/elasticsearch/xpack/sql/qa/mixed_node/SqlSearchIT.java +++ b/x-pack/plugin/sql/qa/mixed-node/src/test/java/org/elasticsearch/xpack/sql/qa/mixed_node/SqlSearchIT.java @@ -16,7 +16,7 @@ import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.NotEqualMessageBuilder; import org.elasticsearch.test.rest.ESRestTestCase; import org.elasticsearch.xpack.ql.TestNode; diff --git a/x-pack/plugin/sql/qa/server/multi-node/src/test/java/org/elasticsearch/xpack/sql/qa/multi_node/RestSqlMultinodeIT.java b/x-pack/plugin/sql/qa/server/multi-node/src/test/java/org/elasticsearch/xpack/sql/qa/multi_node/RestSqlMultinodeIT.java index 895f9165365ff..75a26d6642559 100644 --- a/x-pack/plugin/sql/qa/server/multi-node/src/test/java/org/elasticsearch/xpack/sql/qa/multi_node/RestSqlMultinodeIT.java +++ b/x-pack/plugin/sql/qa/server/multi-node/src/test/java/org/elasticsearch/xpack/sql/qa/multi_node/RestSqlMultinodeIT.java @@ -11,8 +11,8 @@ import org.elasticsearch.client.Response; import org.elasticsearch.client.RestClient; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.NotEqualMessageBuilder; import org.elasticsearch.test.rest.ESRestTestCase; diff --git a/x-pack/plugin/sql/qa/server/security/src/test/java/org/elasticsearch/xpack/sql/qa/security/RestSqlSecurityAsyncIT.java b/x-pack/plugin/sql/qa/server/security/src/test/java/org/elasticsearch/xpack/sql/qa/security/RestSqlSecurityAsyncIT.java index deeac8212161d..a2c19ee933612 100644 --- a/x-pack/plugin/sql/qa/server/security/src/test/java/org/elasticsearch/xpack/sql/qa/security/RestSqlSecurityAsyncIT.java +++ b/x-pack/plugin/sql/qa/server/security/src/test/java/org/elasticsearch/xpack/sql/qa/security/RestSqlSecurityAsyncIT.java @@ -14,11 +14,11 @@ import org.elasticsearch.client.ResponseException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.core.TimeValue; import org.elasticsearch.test.rest.ESRestTestCase; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.xpack.core.XPackPlugin; import org.elasticsearch.xpack.core.async.AsyncExecutionId; import org.elasticsearch.xpack.sql.qa.rest.BaseRestSqlTestCase; @@ -27,7 +27,7 @@ import java.io.IOException; import java.util.Map; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.xpack.core.security.authc.AuthenticationServiceField.RUN_AS_USER_HEADER; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; diff --git a/x-pack/plugin/sql/qa/server/security/src/test/java/org/elasticsearch/xpack/sql/qa/security/RestSqlSecurityIT.java b/x-pack/plugin/sql/qa/server/security/src/test/java/org/elasticsearch/xpack/sql/qa/security/RestSqlSecurityIT.java index 52e4a5876eb99..f094950f6f3f5 100644 --- a/x-pack/plugin/sql/qa/server/security/src/test/java/org/elasticsearch/xpack/sql/qa/security/RestSqlSecurityIT.java +++ b/x-pack/plugin/sql/qa/server/security/src/test/java/org/elasticsearch/xpack/sql/qa/security/RestSqlSecurityIT.java @@ -14,10 +14,10 @@ import org.elasticsearch.client.Response; import org.elasticsearch.client.ResponseException; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.cbor.CborXContent; -import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.core.Nullable; import org.elasticsearch.test.NotEqualMessageBuilder; +import org.elasticsearch.xcontent.cbor.CborXContent; +import org.elasticsearch.xcontent.json.JsonXContent; import org.hamcrest.Matcher; import org.hamcrest.Matchers; diff --git a/x-pack/plugin/sql/qa/server/security/src/test/java/org/elasticsearch/xpack/sql/qa/security/SqlSecurityTestCase.java b/x-pack/plugin/sql/qa/server/security/src/test/java/org/elasticsearch/xpack/sql/qa/security/SqlSecurityTestCase.java index 10762bddfb71a..d4737d53d60b5 100644 --- a/x-pack/plugin/sql/qa/server/security/src/test/java/org/elasticsearch/xpack/sql/qa/security/SqlSecurityTestCase.java +++ b/x-pack/plugin/sql/qa/server/security/src/test/java/org/elasticsearch/xpack/sql/qa/security/SqlSecurityTestCase.java @@ -17,10 +17,10 @@ import org.elasticsearch.client.Request; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.test.rest.ESRestTestCase; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.xpack.core.security.test.TestRestrictedIndices; import org.hamcrest.Matcher; import org.hamcrest.Matchers; diff --git a/x-pack/plugin/sql/qa/server/security/src/test/java/org/elasticsearch/xpack/sql/qa/security/UserFunctionIT.java b/x-pack/plugin/sql/qa/server/security/src/test/java/org/elasticsearch/xpack/sql/qa/security/UserFunctionIT.java index 5cde206baa2b6..b3a66a9e6a6a2 100644 --- a/x-pack/plugin/sql/qa/server/security/src/test/java/org/elasticsearch/xpack/sql/qa/security/UserFunctionIT.java +++ b/x-pack/plugin/sql/qa/server/security/src/test/java/org/elasticsearch/xpack/sql/qa/security/UserFunctionIT.java @@ -13,10 +13,10 @@ import org.elasticsearch.client.RequestOptions; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.test.NotEqualMessageBuilder; import org.elasticsearch.test.rest.ESRestTestCase; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.junit.After; import org.junit.Before; import org.junit.Rule; diff --git a/x-pack/plugin/sql/qa/server/src/main/java/org/elasticsearch/xpack/sql/qa/CustomDateFormatTestCase.java b/x-pack/plugin/sql/qa/server/src/main/java/org/elasticsearch/xpack/sql/qa/CustomDateFormatTestCase.java index d4d4721df786b..e21d8c9301469 100644 --- a/x-pack/plugin/sql/qa/server/src/main/java/org/elasticsearch/xpack/sql/qa/CustomDateFormatTestCase.java +++ b/x-pack/plugin/sql/qa/server/src/main/java/org/elasticsearch/xpack/sql/qa/CustomDateFormatTestCase.java @@ -14,8 +14,8 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.time.DateUtils; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.xpack.sql.proto.Mode; import org.elasticsearch.xpack.sql.qa.jdbc.JdbcIntegrationTestCase; import org.elasticsearch.xpack.sql.qa.rest.BaseRestSqlTestCase; diff --git a/x-pack/plugin/sql/qa/server/src/main/java/org/elasticsearch/xpack/sql/qa/FieldExtractorTestCase.java b/x-pack/plugin/sql/qa/server/src/main/java/org/elasticsearch/xpack/sql/qa/FieldExtractorTestCase.java index b99ddd8544eeb..ba4c7d9570e7e 100644 --- a/x-pack/plugin/sql/qa/server/src/main/java/org/elasticsearch/xpack/sql/qa/FieldExtractorTestCase.java +++ b/x-pack/plugin/sql/qa/server/src/main/java/org/elasticsearch/xpack/sql/qa/FieldExtractorTestCase.java @@ -12,10 +12,10 @@ import org.elasticsearch.client.Request; import org.elasticsearch.client.Response; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.core.Tuple; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.xpack.ql.util.Holder; import org.elasticsearch.xpack.sql.qa.rest.BaseRestSqlTestCase; import org.elasticsearch.xpack.sql.qa.rest.RestSqlTestCase; diff --git a/x-pack/plugin/sql/qa/server/src/main/java/org/elasticsearch/xpack/sql/qa/SqlProtocolTestCase.java b/x-pack/plugin/sql/qa/server/src/main/java/org/elasticsearch/xpack/sql/qa/SqlProtocolTestCase.java index 8e24532054aa6..4cd7d7d249b90 100644 --- a/x-pack/plugin/sql/qa/server/src/main/java/org/elasticsearch/xpack/sql/qa/SqlProtocolTestCase.java +++ b/x-pack/plugin/sql/qa/server/src/main/java/org/elasticsearch/xpack/sql/qa/SqlProtocolTestCase.java @@ -13,12 +13,12 @@ import org.elasticsearch.client.RequestOptions; import org.elasticsearch.client.Response; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.cbor.CborXContent; -import org.elasticsearch.common.xcontent.json.JsonXContent; -import org.elasticsearch.common.xcontent.smile.SmileXContent; -import org.elasticsearch.common.xcontent.yaml.YamlXContent; import org.elasticsearch.test.rest.ESRestTestCase; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.cbor.CborXContent; +import org.elasticsearch.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.smile.SmileXContent; +import org.elasticsearch.xcontent.yaml.YamlXContent; import org.elasticsearch.xpack.sql.proto.Mode; import java.io.IOException; diff --git a/x-pack/plugin/sql/qa/server/src/main/java/org/elasticsearch/xpack/sql/qa/cli/CliIntegrationTestCase.java b/x-pack/plugin/sql/qa/server/src/main/java/org/elasticsearch/xpack/sql/qa/cli/CliIntegrationTestCase.java index 5b8c70b137884..eb253e16cd848 100644 --- a/x-pack/plugin/sql/qa/server/src/main/java/org/elasticsearch/xpack/sql/qa/cli/CliIntegrationTestCase.java +++ b/x-pack/plugin/sql/qa/server/src/main/java/org/elasticsearch/xpack/sql/qa/cli/CliIntegrationTestCase.java @@ -8,10 +8,10 @@ import org.elasticsearch.client.Request; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.core.CheckedConsumer; import org.elasticsearch.test.rest.ESRestTestCase; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.xpack.sql.qa.cli.EmbeddedCli.SecurityConfig; import org.junit.After; import org.junit.Before; diff --git a/x-pack/plugin/sql/qa/server/src/main/java/org/elasticsearch/xpack/sql/qa/geo/GeoDataLoader.java b/x-pack/plugin/sql/qa/server/src/main/java/org/elasticsearch/xpack/sql/qa/geo/GeoDataLoader.java index 4d6b9fa3c0af9..d8d937fb813b4 100644 --- a/x-pack/plugin/sql/qa/server/src/main/java/org/elasticsearch/xpack/sql/qa/geo/GeoDataLoader.java +++ b/x-pack/plugin/sql/qa/server/src/main/java/org/elasticsearch/xpack/sql/qa/geo/GeoDataLoader.java @@ -17,9 +17,9 @@ import org.elasticsearch.client.RestClient; import org.elasticsearch.common.Strings; import org.elasticsearch.common.logging.Loggers; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.xpack.sql.qa.jdbc.SqlSpecTestCase; import java.io.BufferedReader; diff --git a/x-pack/plugin/sql/qa/server/src/main/java/org/elasticsearch/xpack/sql/qa/jdbc/DataLoader.java b/x-pack/plugin/sql/qa/server/src/main/java/org/elasticsearch/xpack/sql/qa/jdbc/DataLoader.java index 42eb9f9e1a0ce..e33b1f518f811 100644 --- a/x-pack/plugin/sql/qa/server/src/main/java/org/elasticsearch/xpack/sql/qa/jdbc/DataLoader.java +++ b/x-pack/plugin/sql/qa/server/src/main/java/org/elasticsearch/xpack/sql/qa/jdbc/DataLoader.java @@ -12,9 +12,9 @@ import org.elasticsearch.client.RestClient; import org.elasticsearch.common.CheckedBiConsumer; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.core.SuppressForbidden; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import java.io.BufferedReader; import java.io.IOException; diff --git a/x-pack/plugin/sql/qa/server/src/main/java/org/elasticsearch/xpack/sql/qa/jdbc/JdbcIntegrationTestCase.java b/x-pack/plugin/sql/qa/server/src/main/java/org/elasticsearch/xpack/sql/qa/jdbc/JdbcIntegrationTestCase.java index aa96509404de8..88efe11c1de43 100644 --- a/x-pack/plugin/sql/qa/server/src/main/java/org/elasticsearch/xpack/sql/qa/jdbc/JdbcIntegrationTestCase.java +++ b/x-pack/plugin/sql/qa/server/src/main/java/org/elasticsearch/xpack/sql/qa/jdbc/JdbcIntegrationTestCase.java @@ -9,11 +9,11 @@ import org.apache.http.util.EntityUtils; import org.elasticsearch.client.Request; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.core.CheckedConsumer; import org.elasticsearch.test.rest.ESRestTestCase; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.xpack.sql.jdbc.EsDataSource; import org.junit.After; diff --git a/x-pack/plugin/sql/qa/server/src/main/java/org/elasticsearch/xpack/sql/qa/jdbc/SysColumnsTestCase.java b/x-pack/plugin/sql/qa/server/src/main/java/org/elasticsearch/xpack/sql/qa/jdbc/SysColumnsTestCase.java index 61d2a8c305fef..76f6fc0b15c7d 100644 --- a/x-pack/plugin/sql/qa/server/src/main/java/org/elasticsearch/xpack/sql/qa/jdbc/SysColumnsTestCase.java +++ b/x-pack/plugin/sql/qa/server/src/main/java/org/elasticsearch/xpack/sql/qa/jdbc/SysColumnsTestCase.java @@ -9,9 +9,9 @@ import org.elasticsearch.client.Request; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.core.CheckedConsumer; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import java.io.IOException; import java.sql.Connection; diff --git a/x-pack/plugin/sql/qa/server/src/main/java/org/elasticsearch/xpack/sql/qa/rest/BaseRestSqlTestCase.java b/x-pack/plugin/sql/qa/server/src/main/java/org/elasticsearch/xpack/sql/qa/rest/BaseRestSqlTestCase.java index b40bfe2a2806f..82f0699446a76 100644 --- a/x-pack/plugin/sql/qa/server/src/main/java/org/elasticsearch/xpack/sql/qa/rest/BaseRestSqlTestCase.java +++ b/x-pack/plugin/sql/qa/server/src/main/java/org/elasticsearch/xpack/sql/qa/rest/BaseRestSqlTestCase.java @@ -11,9 +11,9 @@ import org.elasticsearch.client.Request; import org.elasticsearch.client.Response; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.cbor.CborXContent; -import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.test.rest.ESRestTestCase; +import org.elasticsearch.xcontent.cbor.CborXContent; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.xpack.sql.proto.Mode; import org.elasticsearch.xpack.sql.proto.StringUtils; diff --git a/x-pack/plugin/sql/qa/server/src/main/java/org/elasticsearch/xpack/sql/qa/rest/RestSqlTestCase.java b/x-pack/plugin/sql/qa/server/src/main/java/org/elasticsearch/xpack/sql/qa/rest/RestSqlTestCase.java index 411ccc5c7106c..795074084e279 100644 --- a/x-pack/plugin/sql/qa/server/src/main/java/org/elasticsearch/xpack/sql/qa/rest/RestSqlTestCase.java +++ b/x-pack/plugin/sql/qa/server/src/main/java/org/elasticsearch/xpack/sql/qa/rest/RestSqlTestCase.java @@ -19,11 +19,11 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.io.Streams; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.core.Nullable; import org.elasticsearch.core.Tuple; import org.elasticsearch.test.NotEqualMessageBuilder; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.xpack.sql.proto.Mode; import org.elasticsearch.xpack.sql.proto.StringUtils; import org.elasticsearch.xpack.sql.qa.ErrorsTestCase; diff --git a/x-pack/plugin/sql/qa/server/src/main/java/org/elasticsearch/xpack/sql/qa/rest/RestSqlUsageTestCase.java b/x-pack/plugin/sql/qa/server/src/main/java/org/elasticsearch/xpack/sql/qa/rest/RestSqlUsageTestCase.java index 856c42ded990b..0ab8a6810933c 100644 --- a/x-pack/plugin/sql/qa/server/src/main/java/org/elasticsearch/xpack/sql/qa/rest/RestSqlUsageTestCase.java +++ b/x-pack/plugin/sql/qa/server/src/main/java/org/elasticsearch/xpack/sql/qa/rest/RestSqlUsageTestCase.java @@ -12,8 +12,8 @@ import org.elasticsearch.client.Request; import org.elasticsearch.client.RequestOptions; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.test.rest.ESRestTestCase; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.xpack.sql.proto.Mode; import org.elasticsearch.xpack.sql.proto.StringUtils; import org.elasticsearch.xpack.sql.qa.FeatureMetric; diff --git a/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/AbstractSqlQueryRequest.java b/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/AbstractSqlQueryRequest.java index c1c40a8b59ceb..4419ac230cd16 100644 --- a/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/AbstractSqlQueryRequest.java +++ b/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/AbstractSqlQueryRequest.java @@ -10,18 +10,18 @@ import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.CompositeIndicesRequest; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentLocation; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentParser.Token; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentLocation; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser.Token; import org.elasticsearch.index.query.AbstractQueryBuilder; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.search.builder.SearchSourceBuilder; diff --git a/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/AbstractSqlRequest.java b/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/AbstractSqlRequest.java index 14b1c32fcfe52..be2b57f0e9d34 100644 --- a/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/AbstractSqlRequest.java +++ b/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/AbstractSqlRequest.java @@ -10,7 +10,7 @@ import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContent; import org.elasticsearch.xpack.sql.proto.Mode; import org.elasticsearch.xpack.sql.proto.RequestInfo; import org.elasticsearch.xpack.sql.proto.SqlVersion; diff --git a/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlClearCursorRequest.java b/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlClearCursorRequest.java index b37c34ca01bb3..6b0ce56a53749 100644 --- a/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlClearCursorRequest.java +++ b/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlClearCursorRequest.java @@ -9,9 +9,9 @@ import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.sql.proto.Mode; import org.elasticsearch.xpack.sql.proto.RequestInfo; @@ -19,8 +19,8 @@ import java.util.Objects; import static org.elasticsearch.action.ValidateActions.addValidationError; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; import static org.elasticsearch.xpack.sql.action.AbstractSqlQueryRequest.CLIENT_ID; import static org.elasticsearch.xpack.sql.action.AbstractSqlQueryRequest.VERSION; import static org.elasticsearch.xpack.sql.action.AbstractSqlQueryRequest.CURSOR; diff --git a/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlClearCursorResponse.java b/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlClearCursorResponse.java index 6e8b5d11b663d..204d692abd5b4 100644 --- a/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlClearCursorResponse.java +++ b/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlClearCursorResponse.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.xcontent.StatusToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.rest.RestStatus; import java.io.IOException; diff --git a/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlQueryRequest.java b/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlQueryRequest.java index 06e72ee1c903b..4527a25620534 100644 --- a/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlQueryRequest.java +++ b/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlQueryRequest.java @@ -8,14 +8,14 @@ import org.elasticsearch.Version; import org.elasticsearch.action.ActionRequestValidationException; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.tasks.Task; import org.elasticsearch.tasks.TaskId; diff --git a/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlQueryResponse.java b/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlQueryResponse.java index c7780841bf416..e494dd1cdfec6 100644 --- a/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlQueryResponse.java +++ b/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlQueryResponse.java @@ -11,8 +11,8 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.core.Nullable; import org.elasticsearch.xpack.ql.async.QlStatusResponse; import org.elasticsearch.xpack.sql.proto.ColumnInfo; diff --git a/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlTranslateRequest.java b/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlTranslateRequest.java index bbd4cc5088931..0d775e5888e46 100644 --- a/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlTranslateRequest.java +++ b/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlTranslateRequest.java @@ -10,9 +10,9 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.xpack.sql.proto.RequestInfo; import org.elasticsearch.xpack.sql.proto.SqlQueryRequest; diff --git a/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlTranslateResponse.java b/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlTranslateResponse.java index 64359c7ee3325..10a01ea566600 100644 --- a/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlTranslateResponse.java +++ b/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlTranslateResponse.java @@ -9,8 +9,8 @@ import org.elasticsearch.action.ActionResponse; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.search.builder.SearchSourceBuilder; import java.io.IOException; diff --git a/x-pack/plugin/sql/sql-action/src/test/java/org/elasticsearch/xpack/sql/action/SqlClearCursorRequestTests.java b/x-pack/plugin/sql/sql-action/src/test/java/org/elasticsearch/xpack/sql/action/SqlClearCursorRequestTests.java index 74f5fbee7628d..4829302e9bc69 100644 --- a/x-pack/plugin/sql/sql-action/src/test/java/org/elasticsearch/xpack/sql/action/SqlClearCursorRequestTests.java +++ b/x-pack/plugin/sql/sql-action/src/test/java/org/elasticsearch/xpack/sql/action/SqlClearCursorRequestTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.sql.action; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.sql.proto.Mode; import org.elasticsearch.xpack.sql.proto.RequestInfo; diff --git a/x-pack/plugin/sql/sql-action/src/test/java/org/elasticsearch/xpack/sql/action/SqlClearCursorResponseTests.java b/x-pack/plugin/sql/sql-action/src/test/java/org/elasticsearch/xpack/sql/action/SqlClearCursorResponseTests.java index ea3db6d7d0d13..403a30f705916 100644 --- a/x-pack/plugin/sql/sql-action/src/test/java/org/elasticsearch/xpack/sql/action/SqlClearCursorResponseTests.java +++ b/x-pack/plugin/sql/sql-action/src/test/java/org/elasticsearch/xpack/sql/action/SqlClearCursorResponseTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.sql.action; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; public class SqlClearCursorResponseTests extends AbstractSerializingTestCase { diff --git a/x-pack/plugin/sql/sql-action/src/test/java/org/elasticsearch/xpack/sql/action/SqlQueryRequestTests.java b/x-pack/plugin/sql/sql-action/src/test/java/org/elasticsearch/xpack/sql/action/SqlQueryRequestTests.java index 5a475b05e42c7..85b075ba7db07 100644 --- a/x-pack/plugin/sql/sql-action/src/test/java/org/elasticsearch/xpack/sql/action/SqlQueryRequestTests.java +++ b/x-pack/plugin/sql/sql-action/src/test/java/org/elasticsearch/xpack/sql/action/SqlQueryRequestTests.java @@ -11,10 +11,10 @@ import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.SearchModule; import org.elasticsearch.test.AbstractWireSerializingTestCase; import org.elasticsearch.test.ESTestCase; @@ -197,7 +197,7 @@ private SqlQueryRequest doParseInstance(XContentParser parser) { } /** - * This is needed because {@link SqlQueryRequest#toXContent(XContentBuilder, org.elasticsearch.common.xcontent.ToXContent.Params)} + * This is needed because {@link SqlQueryRequest#toXContent(XContentBuilder, ToXContent.Params)} * is not serializing {@link SqlTypedParamValue} according to the request's {@link Mode} and it shouldn't, in fact. * For testing purposes, different serializing methods for {@link SqlTypedParamValue} are necessary so that * {@link SqlQueryRequest#fromXContent(XContentParser)} populates {@link SqlTypedParamValue#hasExplicitType()} diff --git a/x-pack/plugin/sql/sql-action/src/test/java/org/elasticsearch/xpack/sql/action/SqlQueryResponseTests.java b/x-pack/plugin/sql/sql-action/src/test/java/org/elasticsearch/xpack/sql/action/SqlQueryResponseTests.java index cabfdfebec2bf..8eff11810fc44 100644 --- a/x-pack/plugin/sql/sql-action/src/test/java/org/elasticsearch/xpack/sql/action/SqlQueryResponseTests.java +++ b/x-pack/plugin/sql/sql-action/src/test/java/org/elasticsearch/xpack/sql/action/SqlQueryResponseTests.java @@ -9,10 +9,10 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.sql.proto.ColumnInfo; @@ -26,7 +26,7 @@ import java.util.Map; import java.util.function.Supplier; -import static org.elasticsearch.common.xcontent.ToXContent.EMPTY_PARAMS; +import static org.elasticsearch.xcontent.ToXContent.EMPTY_PARAMS; import static org.elasticsearch.xpack.sql.action.AbstractSqlQueryRequest.CURSOR; import static org.elasticsearch.xpack.sql.proto.Protocol.ID_NAME; import static org.elasticsearch.xpack.sql.proto.Protocol.IS_PARTIAL_NAME; diff --git a/x-pack/plugin/sql/sql-action/src/test/java/org/elasticsearch/xpack/sql/action/SqlRequestParsersTests.java b/x-pack/plugin/sql/sql-action/src/test/java/org/elasticsearch/xpack/sql/action/SqlRequestParsersTests.java index 44f3eb5d7c371..c0f4f06941546 100644 --- a/x-pack/plugin/sql/sql-action/src/test/java/org/elasticsearch/xpack/sql/action/SqlRequestParsersTests.java +++ b/x-pack/plugin/sql/sql-action/src/test/java/org/elasticsearch/xpack/sql/action/SqlRequestParsersTests.java @@ -9,11 +9,11 @@ import org.elasticsearch.Version; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.sql.proto.Mode; import org.elasticsearch.xpack.sql.proto.SqlTypedParamValue; diff --git a/x-pack/plugin/sql/sql-action/src/test/java/org/elasticsearch/xpack/sql/action/SqlTranslateRequestTests.java b/x-pack/plugin/sql/sql-action/src/test/java/org/elasticsearch/xpack/sql/action/SqlTranslateRequestTests.java index 3ef3dc8118552..4cf8f96735cfa 100644 --- a/x-pack/plugin/sql/sql-action/src/test/java/org/elasticsearch/xpack/sql/action/SqlTranslateRequestTests.java +++ b/x-pack/plugin/sql/sql-action/src/test/java/org/elasticsearch/xpack/sql/action/SqlTranslateRequestTests.java @@ -10,8 +10,8 @@ import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.search.SearchModule; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.test.ESTestCase; diff --git a/x-pack/plugin/sql/sql-client/src/main/java/org/elasticsearch/xpack/sql/client/HttpClient.java b/x-pack/plugin/sql/sql-client/src/main/java/org/elasticsearch/xpack/sql/client/HttpClient.java index 2983024000bb0..3d0975db216d3 100644 --- a/x-pack/plugin/sql/sql-client/src/main/java/org/elasticsearch/xpack/sql/client/HttpClient.java +++ b/x-pack/plugin/sql/sql-client/src/main/java/org/elasticsearch/xpack/sql/client/HttpClient.java @@ -8,12 +8,12 @@ import org.elasticsearch.core.Tuple; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.internal.io.Streams; import org.elasticsearch.xpack.sql.client.JreHttpUrlConnection.ResponseOrException; import org.elasticsearch.xpack.sql.proto.AbstractSqlRequest; diff --git a/x-pack/plugin/sql/sql-client/src/test/java/org/elasticsearch/xpack/sql/client/HttpClientRequestTests.java b/x-pack/plugin/sql/sql-client/src/test/java/org/elasticsearch/xpack/sql/client/HttpClientRequestTests.java index b619e6a6c7903..ab96ea46db09d 100644 --- a/x-pack/plugin/sql/sql-client/src/test/java/org/elasticsearch/xpack/sql/client/HttpClientRequestTests.java +++ b/x-pack/plugin/sql/sql-client/src/test/java/org/elasticsearch/xpack/sql/client/HttpClientRequestTests.java @@ -22,7 +22,7 @@ import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.concurrent.ConcurrentCollections; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.mocksocket.MockHttpServer; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.sql.proto.Mode; diff --git a/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/AbstractSqlRequest.java b/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/AbstractSqlRequest.java index 15f08c0156b5e..d588676e5c9e2 100644 --- a/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/AbstractSqlRequest.java +++ b/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/AbstractSqlRequest.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.sql.proto; -import org.elasticsearch.common.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.ToXContentFragment; import java.util.Objects; diff --git a/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/ColumnInfo.java b/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/ColumnInfo.java index 4de2eff20cfb8..b6781bc8bc46c 100644 --- a/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/ColumnInfo.java +++ b/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/ColumnInfo.java @@ -6,17 +6,17 @@ */ package org.elasticsearch.xpack.sql.proto; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * Information about a column returned with first query response. diff --git a/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/MainResponse.java b/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/MainResponse.java index 9e000767cea79..54c5c8db3be6c 100644 --- a/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/MainResponse.java +++ b/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/MainResponse.java @@ -7,9 +7,9 @@ package org.elasticsearch.xpack.sql.proto; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.util.Objects; diff --git a/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/ProtoUtils.java b/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/ProtoUtils.java index a91cf6fd6e5f5..ff8fc65b29a2f 100644 --- a/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/ProtoUtils.java +++ b/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/ProtoUtils.java @@ -7,10 +7,10 @@ package org.elasticsearch.xpack.sql.proto; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import java.io.ByteArrayOutputStream; import java.io.IOException; diff --git a/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/SqlClearCursorRequest.java b/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/SqlClearCursorRequest.java index b64f2f1e231c1..aef93723896c3 100644 --- a/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/SqlClearCursorRequest.java +++ b/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/SqlClearCursorRequest.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.sql.proto; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/SqlClearCursorResponse.java b/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/SqlClearCursorResponse.java index cf804df7e2645..437b8b7cccfea 100644 --- a/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/SqlClearCursorResponse.java +++ b/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/SqlClearCursorResponse.java @@ -6,13 +6,13 @@ */ package org.elasticsearch.xpack.sql.proto; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.XContentParser; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; /** * Response to the request to clean all SQL resources associated with the cursor for JDBC/CLI client diff --git a/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/SqlQueryRequest.java b/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/SqlQueryRequest.java index bea151703cb4b..694bd93e26059 100644 --- a/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/SqlQueryRequest.java +++ b/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/SqlQueryRequest.java @@ -9,8 +9,8 @@ import org.elasticsearch.core.Nullable; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.time.ZoneId; diff --git a/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/SqlQueryResponse.java b/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/SqlQueryResponse.java index 20d1da1e976da..e70ef6134ca2a 100644 --- a/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/SqlQueryResponse.java +++ b/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/SqlQueryResponse.java @@ -7,18 +7,18 @@ package org.elasticsearch.xpack.sql.proto; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; import static org.elasticsearch.xpack.sql.proto.Protocol.COLUMNS_NAME; import static org.elasticsearch.xpack.sql.proto.Protocol.CURSOR_NAME; import static org.elasticsearch.xpack.sql.proto.Protocol.ID_NAME; diff --git a/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/SqlTypedParamValue.java b/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/SqlTypedParamValue.java index 5972f326ebaa7..bbdf362a4366c 100644 --- a/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/SqlTypedParamValue.java +++ b/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/SqlTypedParamValue.java @@ -6,18 +6,18 @@ */ package org.elasticsearch.xpack.sql.proto; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentLocation; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentLocation; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; import static org.elasticsearch.xpack.sql.proto.ProtoUtils.parseFieldsValue; /** diff --git a/x-pack/plugin/sql/sql-proto/src/test/java/org/elasticsearch/xpack/sql/proto/ProtoUtilsTests.java b/x-pack/plugin/sql/sql-proto/src/test/java/org/elasticsearch/xpack/sql/proto/ProtoUtilsTests.java index 601d1a08a1e67..fc59c6e176d63 100644 --- a/x-pack/plugin/sql/sql-proto/src/test/java/org/elasticsearch/xpack/sql/proto/ProtoUtilsTests.java +++ b/x-pack/plugin/sql/sql-proto/src/test/java/org/elasticsearch/xpack/sql/proto/ProtoUtilsTests.java @@ -7,10 +7,10 @@ package org.elasticsearch.xpack.sql.proto; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/x-pack/plugin/sql/src/internalClusterTest/java/org/elasticsearch/xpack/sql/action/AsyncSqlSearchActionIT.java b/x-pack/plugin/sql/src/internalClusterTest/java/org/elasticsearch/xpack/sql/action/AsyncSqlSearchActionIT.java index 0352646c55a64..39b6733a00051 100644 --- a/x-pack/plugin/sql/src/internalClusterTest/java/org/elasticsearch/xpack/sql/action/AsyncSqlSearchActionIT.java +++ b/x-pack/plugin/sql/src/internalClusterTest/java/org/elasticsearch/xpack/sql/action/AsyncSqlSearchActionIT.java @@ -52,7 +52,7 @@ import java.util.concurrent.Executors; import java.util.function.Function; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertFutureThrows; import static org.hamcrest.Matchers.containsString; diff --git a/x-pack/plugin/sql/src/internalClusterTest/java/org/elasticsearch/xpack/sql/action/RestSqlCancellationIT.java b/x-pack/plugin/sql/src/internalClusterTest/java/org/elasticsearch/xpack/sql/action/RestSqlCancellationIT.java index fc7e087961842..69cbff5964645 100644 --- a/x-pack/plugin/sql/src/internalClusterTest/java/org/elasticsearch/xpack/sql/action/RestSqlCancellationIT.java +++ b/x-pack/plugin/sql/src/internalClusterTest/java/org/elasticsearch/xpack/sql/action/RestSqlCancellationIT.java @@ -33,7 +33,7 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.atomic.AtomicReference; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.instanceOf; diff --git a/x-pack/plugin/sql/src/internalClusterTest/java/org/elasticsearch/xpack/sql/action/SqlCancellationIT.java b/x-pack/plugin/sql/src/internalClusterTest/java/org/elasticsearch/xpack/sql/action/SqlCancellationIT.java index ae91d10d74f0e..784a31dccd6a3 100644 --- a/x-pack/plugin/sql/src/internalClusterTest/java/org/elasticsearch/xpack/sql/action/SqlCancellationIT.java +++ b/x-pack/plugin/sql/src/internalClusterTest/java/org/elasticsearch/xpack/sql/action/SqlCancellationIT.java @@ -21,7 +21,7 @@ import java.util.concurrent.Executors; import java.util.concurrent.Future; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.instanceOf; diff --git a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/execution/search/Querier.java b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/execution/search/Querier.java index 395fdf2cc472d..511acfb677558 100644 --- a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/execution/search/Querier.java +++ b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/execution/search/Querier.java @@ -16,7 +16,7 @@ import org.elasticsearch.client.Client; import org.elasticsearch.common.Strings; import org.elasticsearch.common.util.CollectionUtils; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.core.Nullable; import org.elasticsearch.core.TimeValue; import org.elasticsearch.core.Tuple; diff --git a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/execution/search/extractor/FieldHitExtractor.java b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/execution/search/extractor/FieldHitExtractor.java index bcb6c76bbe5e7..dce29c587a5d5 100644 --- a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/execution/search/extractor/FieldHitExtractor.java +++ b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/execution/search/extractor/FieldHitExtractor.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.geo.GeoPoint; import org.elasticsearch.common.geo.GeoUtils; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParseException; import org.elasticsearch.xpack.ql.execution.search.extractor.AbstractFieldHitExtractor; import org.elasticsearch.xpack.ql.execution.search.extractor.HitExtractor; import org.elasticsearch.xpack.ql.type.DataType; diff --git a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/expression/literal/geo/GeoShape.java b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/expression/literal/geo/GeoShape.java index 2094bd2bc0c98..c7d47c84b41e4 100644 --- a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/expression/literal/geo/GeoShape.java +++ b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/expression/literal/geo/GeoShape.java @@ -12,11 +12,11 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.geometry.Circle; import org.elasticsearch.geometry.Geometry; import org.elasticsearch.geometry.GeometryCollection; diff --git a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/expression/literal/interval/Interval.java b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/expression/literal/interval/Interval.java index a788888b7968f..1796d816c3c4b 100644 --- a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/expression/literal/interval/Interval.java +++ b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/expression/literal/interval/Interval.java @@ -7,8 +7,8 @@ package org.elasticsearch.xpack.sql.expression.literal.interval; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.ql.expression.function.scalar.IntervalScripting; import org.elasticsearch.xpack.ql.expression.gen.processor.ConstantNamedWriteable; import org.elasticsearch.xpack.ql.type.DataType; diff --git a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/RestSqlClearCursorAction.java b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/RestSqlClearCursorAction.java index a8862d31e477f..2130aa052958c 100644 --- a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/RestSqlClearCursorAction.java +++ b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/RestSqlClearCursorAction.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.sql.plugin; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestToXContentListener; diff --git a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/RestSqlQueryAction.java b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/RestSqlQueryAction.java index 53b0b84c014a0..de089729bcc97 100644 --- a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/RestSqlQueryAction.java +++ b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/RestSqlQueryAction.java @@ -8,9 +8,9 @@ package org.elasticsearch.xpack.sql.plugin; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.MediaType; -import org.elasticsearch.common.xcontent.MediaTypeRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.MediaType; +import org.elasticsearch.xcontent.MediaTypeRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestCancellableNodeClient; diff --git a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/RestSqlTranslateAction.java b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/RestSqlTranslateAction.java index 08eda3241063c..c6c7f9dae1621 100644 --- a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/RestSqlTranslateAction.java +++ b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/RestSqlTranslateAction.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.sql.plugin; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestToXContentListener; diff --git a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlMediaTypeParser.java b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlMediaTypeParser.java index dc764553928fb..a748948f10e77 100644 --- a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlMediaTypeParser.java +++ b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlMediaTypeParser.java @@ -7,10 +7,10 @@ package org.elasticsearch.xpack.sql.plugin; -import org.elasticsearch.common.xcontent.MediaType; -import org.elasticsearch.common.xcontent.MediaTypeRegistry; -import org.elasticsearch.common.xcontent.ParsedMediaType; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.MediaType; +import org.elasticsearch.xcontent.MediaTypeRegistry; +import org.elasticsearch.xcontent.ParsedMediaType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.xpack.sql.action.SqlQueryRequest; import org.elasticsearch.xpack.sql.proto.Mode; diff --git a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlPlugin.java b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlPlugin.java index d254416aeb42e..e5e270c655dbb 100644 --- a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlPlugin.java +++ b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlPlugin.java @@ -17,7 +17,7 @@ import org.elasticsearch.common.settings.IndexScopedSettings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.SettingsFilter; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.env.Environment; import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.license.License; diff --git a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlResponseListener.java b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlResponseListener.java index 200af40066d08..4ac4019d74efc 100644 --- a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlResponseListener.java +++ b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlResponseListener.java @@ -7,9 +7,9 @@ package org.elasticsearch.xpack.sql.plugin; -import org.elasticsearch.common.xcontent.MediaType; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.MediaType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestChannel; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlStatsResponse.java b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlStatsResponse.java index 9bcf872c8c952..35cb0e24faf69 100644 --- a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlStatsResponse.java +++ b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlStatsResponse.java @@ -14,8 +14,8 @@ import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.watcher.common.stats.Counters; import java.io.IOException; diff --git a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/TextFormat.java b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/TextFormat.java index 44206ad9e950c..913efd6b04125 100644 --- a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/TextFormat.java +++ b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/TextFormat.java @@ -8,7 +8,7 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.core.Tuple; -import org.elasticsearch.common.xcontent.MediaType; +import org.elasticsearch.xcontent.MediaType; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.xpack.ql.util.StringUtils; import org.elasticsearch.xpack.sql.SqlIllegalArgumentException; diff --git a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/querydsl/container/QueryContainer.java b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/querydsl/container/QueryContainer.java index 00695395456d2..c22a292c668ee 100644 --- a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/querydsl/container/QueryContainer.java +++ b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/querydsl/container/QueryContainer.java @@ -9,9 +9,9 @@ import org.elasticsearch.core.Nullable; import org.elasticsearch.common.Strings; import org.elasticsearch.core.Tuple; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.xpack.ql.execution.search.FieldExtraction; import org.elasticsearch.xpack.ql.expression.Attribute; import org.elasticsearch.xpack.ql.expression.AttributeMap; diff --git a/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/SqlInfoTransportActionTests.java b/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/SqlInfoTransportActionTests.java index 3d27f4a7bacab..8ed308cb5909f 100644 --- a/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/SqlInfoTransportActionTests.java +++ b/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/SqlInfoTransportActionTests.java @@ -16,7 +16,7 @@ import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.ObjectPath; +import org.elasticsearch.xcontent.ObjectPath; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.tasks.Task; import org.elasticsearch.test.ESTestCase; diff --git a/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/execution/search/extractor/TestBucket.java b/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/execution/search/extractor/TestBucket.java index b2bf7c5e88c54..68c6ad83df3e3 100644 --- a/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/execution/search/extractor/TestBucket.java +++ b/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/execution/search/extractor/TestBucket.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.sql.execution.search.extractor; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.search.aggregations.Aggregations; import org.elasticsearch.search.aggregations.bucket.composite.CompositeAggregation.Bucket; diff --git a/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/execution/search/extractor/TestMultiValueAggregation.java b/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/execution/search/extractor/TestMultiValueAggregation.java index dfc8b7ab13406..94a0b92696e1a 100644 --- a/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/execution/search/extractor/TestMultiValueAggregation.java +++ b/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/execution/search/extractor/TestMultiValueAggregation.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.sql.execution.search.extractor; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.search.aggregations.InternalAggregation; import org.elasticsearch.search.aggregations.metrics.InternalNumericMetricsAggregation; diff --git a/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/execution/search/extractor/TestSingleValueAggregation.java b/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/execution/search/extractor/TestSingleValueAggregation.java index 1f89662ef1713..3e0c9648f5660 100644 --- a/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/execution/search/extractor/TestSingleValueAggregation.java +++ b/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/execution/search/extractor/TestSingleValueAggregation.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.sql.execution.search.extractor; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.search.aggregations.InternalAggregation; import java.io.IOException; diff --git a/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/plugin/SqlMediaTypeParserTests.java b/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/plugin/SqlMediaTypeParserTests.java index 3da565a0b7fec..35aec123f0412 100644 --- a/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/plugin/SqlMediaTypeParserTests.java +++ b/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/plugin/SqlMediaTypeParserTests.java @@ -8,8 +8,8 @@ package org.elasticsearch.xpack.sql.plugin; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.MediaType; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.MediaType; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.rest.FakeRestRequest; diff --git a/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/plugin/TextFormatTests.java b/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/plugin/TextFormatTests.java index 9aa4b99b81ce5..6ab6474570b71 100644 --- a/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/plugin/TextFormatTests.java +++ b/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/plugin/TextFormatTests.java @@ -12,7 +12,7 @@ import java.util.Set; import java.util.stream.Collectors; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.rest.FakeRestRequest; diff --git a/x-pack/plugin/stack/src/main/java/org/elasticsearch/xpack/stack/StackPlugin.java b/x-pack/plugin/stack/src/main/java/org/elasticsearch/xpack/stack/StackPlugin.java index 0912fe2ded39a..6ff2da9fb92a9 100644 --- a/x-pack/plugin/stack/src/main/java/org/elasticsearch/xpack/stack/StackPlugin.java +++ b/x-pack/plugin/stack/src/main/java/org/elasticsearch/xpack/stack/StackPlugin.java @@ -12,7 +12,6 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; import org.elasticsearch.env.Environment; import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.plugins.ActionPlugin; @@ -21,6 +20,7 @@ import org.elasticsearch.script.ScriptService; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.watcher.ResourceWatcherService; +import org.elasticsearch.xcontent.NamedXContentRegistry; import java.util.Collection; import java.util.Collections; diff --git a/x-pack/plugin/stack/src/main/java/org/elasticsearch/xpack/stack/StackTemplateRegistry.java b/x-pack/plugin/stack/src/main/java/org/elasticsearch/xpack/stack/StackTemplateRegistry.java index 5a564448ecdb0..c35e6f0cf8fac 100644 --- a/x-pack/plugin/stack/src/main/java/org/elasticsearch/xpack/stack/StackTemplateRegistry.java +++ b/x-pack/plugin/stack/src/main/java/org/elasticsearch/xpack/stack/StackTemplateRegistry.java @@ -13,8 +13,8 @@ import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; import org.elasticsearch.threadpool.ThreadPool; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.xpack.core.ClientHelper; import org.elasticsearch.xpack.core.template.IndexTemplateConfig; import org.elasticsearch.xpack.core.template.IndexTemplateRegistry; diff --git a/x-pack/plugin/stack/src/test/java/org/elasticsearch/xpack/stack/StackTemplateRegistryTests.java b/x-pack/plugin/stack/src/test/java/org/elasticsearch/xpack/stack/StackTemplateRegistryTests.java index 206f6a793beea..3972f8ce2d48e 100644 --- a/x-pack/plugin/stack/src/test/java/org/elasticsearch/xpack/stack/StackTemplateRegistryTests.java +++ b/x-pack/plugin/stack/src/test/java/org/elasticsearch/xpack/stack/StackTemplateRegistryTests.java @@ -28,16 +28,16 @@ import org.elasticsearch.common.TriFunction; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.test.ClusterServiceUtils; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.client.NoOpClient; import org.elasticsearch.test.junit.annotations.TestLogging; import org.elasticsearch.threadpool.TestThreadPool; import org.elasticsearch.threadpool.ThreadPool; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.ilm.DeleteAction; import org.elasticsearch.xpack.core.ilm.ForceMergeAction; import org.elasticsearch.xpack.core.ilm.IndexLifecycleMetadata; diff --git a/x-pack/plugin/text-structure/src/main/java/org/elasticsearch/xpack/textstructure/structurefinder/NdJsonTextStructureFinder.java b/x-pack/plugin/text-structure/src/main/java/org/elasticsearch/xpack/textstructure/structurefinder/NdJsonTextStructureFinder.java index 662b8d54beb18..0f45c68cf9dfd 100644 --- a/x-pack/plugin/text-structure/src/main/java/org/elasticsearch/xpack/textstructure/structurefinder/NdJsonTextStructureFinder.java +++ b/x-pack/plugin/text-structure/src/main/java/org/elasticsearch/xpack/textstructure/structurefinder/NdJsonTextStructureFinder.java @@ -6,10 +6,10 @@ */ package org.elasticsearch.xpack.textstructure.structurefinder; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.core.Tuple; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.textstructure.structurefinder.FieldStats; import org.elasticsearch.xpack.core.textstructure.structurefinder.TextStructure; @@ -22,7 +22,7 @@ import java.util.SortedMap; import java.util.stream.Collectors; -import static org.elasticsearch.common.xcontent.json.JsonXContent.jsonXContent; +import static org.elasticsearch.xcontent.json.JsonXContent.jsonXContent; /** * Newline-delimited JSON. diff --git a/x-pack/plugin/text-structure/src/main/java/org/elasticsearch/xpack/textstructure/structurefinder/NdJsonTextStructureFinderFactory.java b/x-pack/plugin/text-structure/src/main/java/org/elasticsearch/xpack/textstructure/structurefinder/NdJsonTextStructureFinderFactory.java index 531743c44fea7..4c8a66637a8a6 100644 --- a/x-pack/plugin/text-structure/src/main/java/org/elasticsearch/xpack/textstructure/structurefinder/NdJsonTextStructureFinderFactory.java +++ b/x-pack/plugin/text-structure/src/main/java/org/elasticsearch/xpack/textstructure/structurefinder/NdJsonTextStructureFinderFactory.java @@ -6,9 +6,9 @@ */ package org.elasticsearch.xpack.textstructure.structurefinder; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.textstructure.structurefinder.TextStructure; import java.io.IOException; @@ -16,7 +16,7 @@ import java.util.List; import java.util.Locale; -import static org.elasticsearch.common.xcontent.json.JsonXContent.jsonXContent; +import static org.elasticsearch.xcontent.json.JsonXContent.jsonXContent; public class NdJsonTextStructureFinderFactory implements TextStructureFinderFactory { diff --git a/x-pack/plugin/transform/qa/multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformIT.java b/x-pack/plugin/transform/qa/multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformIT.java index c539f98f91a9a..86a828fd0903c 100644 --- a/x-pack/plugin/transform/qa/multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformIT.java +++ b/x-pack/plugin/transform/qa/multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformIT.java @@ -28,8 +28,8 @@ import org.elasticsearch.client.transform.transforms.pivot.TermsGroupSource; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.search.aggregations.AggregationBuilders; import org.elasticsearch.search.aggregations.AggregatorFactories; @@ -44,7 +44,7 @@ import java.util.Map; import java.util.concurrent.TimeUnit; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.greaterThan; import static org.hamcrest.Matchers.lessThan; diff --git a/x-pack/plugin/transform/qa/multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformIntegTestCase.java b/x-pack/plugin/transform/qa/multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformIntegTestCase.java index 0707a0a9d69aa..7db96bd01eb00 100644 --- a/x-pack/plugin/transform/qa/multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformIntegTestCase.java +++ b/x-pack/plugin/transform/qa/multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformIntegTestCase.java @@ -48,13 +48,13 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.query.MatchAllQueryBuilder; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.rest.RestStatus; @@ -79,7 +79,7 @@ import java.util.concurrent.TimeUnit; import java.util.function.Function; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.core.Is.is; abstract class TransformIntegTestCase extends ESRestTestCase { diff --git a/x-pack/plugin/transform/qa/multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/continuous/ContinuousTestCase.java b/x-pack/plugin/transform/qa/multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/continuous/ContinuousTestCase.java index cc832db3b07f2..a2d6961f13e6f 100644 --- a/x-pack/plugin/transform/qa/multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/continuous/ContinuousTestCase.java +++ b/x-pack/plugin/transform/qa/multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/continuous/ContinuousTestCase.java @@ -17,7 +17,7 @@ import org.elasticsearch.client.transform.transforms.TransformConfig; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.core.TimeValue; import org.elasticsearch.search.SearchModule; import org.elasticsearch.search.aggregations.AggregationBuilders; diff --git a/x-pack/plugin/transform/qa/multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/continuous/TransformContinuousIT.java b/x-pack/plugin/transform/qa/multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/continuous/TransformContinuousIT.java index d33172a15b68f..4e1bdeb9eccbf 100644 --- a/x-pack/plugin/transform/qa/multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/continuous/TransformContinuousIT.java +++ b/x-pack/plugin/transform/qa/multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/continuous/TransformContinuousIT.java @@ -35,9 +35,9 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.core.TimeValue; import org.elasticsearch.core.Tuple; @@ -63,7 +63,7 @@ import java.util.Set; import java.util.concurrent.TimeUnit; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.containsInRelativeOrder; import static org.hamcrest.Matchers.greaterThan; import static org.hamcrest.core.Is.is; diff --git a/x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformConfigurationIndexIT.java b/x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformConfigurationIndexIT.java index 08bbc2d6b39af..9d45b5f394823 100644 --- a/x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformConfigurationIndexIT.java +++ b/x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformConfigurationIndexIT.java @@ -14,7 +14,7 @@ import org.elasticsearch.client.Response; import org.elasticsearch.client.ResponseException; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.xpack.core.transform.TransformField; import org.elasticsearch.xpack.core.transform.transforms.TransformConfig; @@ -22,7 +22,7 @@ import java.io.IOException; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; public class TransformConfigurationIndexIT extends TransformRestTestCase { diff --git a/x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformGetAndGetStatsIT.java b/x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformGetAndGetStatsIT.java index 7c0e30f1e5760..c47ed62d250f9 100644 --- a/x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformGetAndGetStatsIT.java +++ b/x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformGetAndGetStatsIT.java @@ -29,7 +29,7 @@ import org.elasticsearch.client.transform.transforms.pivot.TermsGroupSource; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.search.SearchModule; diff --git a/x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformPivotRestIT.java b/x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformPivotRestIT.java index 976d436f32a5e..6b31684f92f3a 100644 --- a/x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformPivotRestIT.java +++ b/x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformPivotRestIT.java @@ -13,7 +13,7 @@ import org.elasticsearch.client.Response; import org.elasticsearch.client.ResponseException; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.junit.Before; @@ -27,7 +27,7 @@ import java.util.Map; import java.util.Set; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasEntry; diff --git a/x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformPivotRestSpecialCasesIT.java b/x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformPivotRestSpecialCasesIT.java index a9ad2b8bd43d3..abd3acde38082 100644 --- a/x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformPivotRestSpecialCasesIT.java +++ b/x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformPivotRestSpecialCasesIT.java @@ -11,7 +11,7 @@ import org.apache.http.entity.StringEntity; import org.elasticsearch.client.Request; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.rest.action.admin.indices.RestPutIndexTemplateAction; import org.junit.Before; @@ -20,7 +20,7 @@ import java.util.List; import java.util.Map; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.equalTo; public class TransformPivotRestSpecialCasesIT extends TransformRestTestCase { diff --git a/x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformProgressIT.java b/x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformProgressIT.java index 0c65751ab8322..38bcc325b7147 100644 --- a/x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformProgressIT.java +++ b/x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformProgressIT.java @@ -22,8 +22,8 @@ import org.elasticsearch.client.indices.CreateIndexResponse; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.search.aggregations.AggregationBuilders; @@ -49,7 +49,7 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicReference; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.xpack.transform.integration.TransformRestTestCase.REVIEWS_INDEX_NAME; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; diff --git a/x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformRestTestCase.java b/x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformRestTestCase.java index 0b420d59b5342..a5b2a4b5badbf 100644 --- a/x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformRestTestCase.java +++ b/x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformRestTestCase.java @@ -18,7 +18,7 @@ import org.elasticsearch.common.settings.SecureString; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.test.rest.ESRestTestCase; import org.elasticsearch.xpack.core.transform.TransformField; @@ -36,7 +36,7 @@ import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.equalTo; public abstract class TransformRestTestCase extends ESRestTestCase { diff --git a/x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformTaskFailedStateIT.java b/x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformTaskFailedStateIT.java index fdd18be61bee7..7748428560f35 100644 --- a/x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformTaskFailedStateIT.java +++ b/x-pack/plugin/transform/qa/single-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformTaskFailedStateIT.java @@ -12,7 +12,7 @@ import org.elasticsearch.client.Request; import org.elasticsearch.client.ResponseException; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.xpack.core.transform.transforms.TransformStats; @@ -23,7 +23,7 @@ import java.util.Map; import java.util.concurrent.TimeUnit; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.nullValue; import static org.hamcrest.Matchers.equalTo; diff --git a/x-pack/plugin/transform/src/internalClusterTest/java/org/elasticsearch/xpack/transform/integration/TransformInternalIndexIT.java b/x-pack/plugin/transform/src/internalClusterTest/java/org/elasticsearch/xpack/transform/integration/TransformInternalIndexIT.java index 99a625a35dcf2..3391eb40c89b9 100644 --- a/x-pack/plugin/transform/src/internalClusterTest/java/org/elasticsearch/xpack/transform/integration/TransformInternalIndexIT.java +++ b/x-pack/plugin/transform/src/internalClusterTest/java/org/elasticsearch/xpack/transform/integration/TransformInternalIndexIT.java @@ -15,9 +15,9 @@ import org.elasticsearch.action.index.IndexResponse; import org.elasticsearch.action.support.WriteRequest; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.ClientHelper; import org.elasticsearch.xpack.core.XPackSettings; import org.elasticsearch.xpack.core.transform.TransformField; diff --git a/x-pack/plugin/transform/src/internalClusterTest/java/org/elasticsearch/xpack/transform/persistence/TransformConfigManagerTests.java b/x-pack/plugin/transform/src/internalClusterTest/java/org/elasticsearch/xpack/transform/persistence/TransformConfigManagerTests.java index 3c6e7e2ebc2de..0581139437def 100644 --- a/x-pack/plugin/transform/src/internalClusterTest/java/org/elasticsearch/xpack/transform/persistence/TransformConfigManagerTests.java +++ b/x-pack/plugin/transform/src/internalClusterTest/java/org/elasticsearch/xpack/transform/persistence/TransformConfigManagerTests.java @@ -15,9 +15,9 @@ import org.elasticsearch.action.index.IndexRequest; import org.elasticsearch.action.support.WriteRequest; import org.elasticsearch.core.Tuple; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.xpack.core.ClientHelper; import org.elasticsearch.xpack.core.action.util.PageParams; import org.elasticsearch.xpack.core.transform.TransformMessages; diff --git a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/Transform.java b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/Transform.java index 458fdd4d8d7fd..55cb7a1a6cdda 100644 --- a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/Transform.java +++ b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/Transform.java @@ -32,8 +32,8 @@ import org.elasticsearch.common.settings.SettingsFilter; import org.elasticsearch.common.settings.SettingsModule; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.NamedXContentRegistry.Entry; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry.Entry; import org.elasticsearch.env.Environment; import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.indices.AssociatedIndexDescriptor; diff --git a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/TransformUsageTransportAction.java b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/TransformUsageTransportAction.java index fa359ab083efd..35863427d864d 100644 --- a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/TransformUsageTransportAction.java +++ b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/TransformUsageTransportAction.java @@ -18,7 +18,7 @@ import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; import org.elasticsearch.cluster.service.ClusterService; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.inject.Inject; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.persistent.PersistentTasksCustomMetadata; diff --git a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/action/TransportGetTransformAction.java b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/action/TransportGetTransformAction.java index d99d099c89971..8975da66d6a04 100644 --- a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/action/TransportGetTransformAction.java +++ b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/action/TransportGetTransformAction.java @@ -13,10 +13,10 @@ import org.elasticsearch.client.Client; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.service.ClusterService; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.inject.Inject; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.search.builder.SearchSourceBuilder; diff --git a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/action/TransportPreviewTransformAction.java b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/action/TransportPreviewTransformAction.java index 25a89b462adf6..bb43eb1226058 100644 --- a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/action/TransportPreviewTransformAction.java +++ b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/action/TransportPreviewTransformAction.java @@ -24,11 +24,11 @@ import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.logging.HeaderWarning; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.ingest.IngestService; import org.elasticsearch.license.License; @@ -62,7 +62,7 @@ import java.util.Map; import java.util.stream.Collectors; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.xpack.core.transform.action.PreviewTransformAction.DUMMY_DEST_INDEX_FOR_PREVIEW; public class TransportPreviewTransformAction extends HandledTransportAction { diff --git a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/action/compat/TransportGetTransformActionDeprecated.java b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/action/compat/TransportGetTransformActionDeprecated.java index b57d092d76f4b..74abea78a4492 100644 --- a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/action/compat/TransportGetTransformActionDeprecated.java +++ b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/action/compat/TransportGetTransformActionDeprecated.java @@ -11,7 +11,7 @@ import org.elasticsearch.client.Client; import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.inject.Inject; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.transport.TransportService; import org.elasticsearch.xpack.core.transform.action.compat.GetTransformActionDeprecated; import org.elasticsearch.xpack.transform.action.TransportGetTransformAction; diff --git a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/notifications/TransformAuditor.java b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/notifications/TransformAuditor.java index e3294adfc98e9..b025d48f76d8f 100644 --- a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/notifications/TransformAuditor.java +++ b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/notifications/TransformAuditor.java @@ -14,8 +14,8 @@ import org.elasticsearch.cluster.metadata.AliasMetadata; import org.elasticsearch.cluster.metadata.IndexTemplateMetadata; import org.elasticsearch.cluster.service.ClusterService; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.common.notifications.AbstractAuditor; import org.elasticsearch.xpack.core.transform.TransformMetadata; import org.elasticsearch.xpack.core.transform.notifications.TransformAuditMessage; diff --git a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/persistence/IndexBasedTransformConfigManager.java b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/persistence/IndexBasedTransformConfigManager.java index bdc1d8994df42..c7ee357051015 100644 --- a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/persistence/IndexBasedTransformConfigManager.java +++ b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/persistence/IndexBasedTransformConfigManager.java @@ -31,12 +31,12 @@ import org.elasticsearch.core.Tuple; import org.elasticsearch.common.regex.Regex; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.index.engine.VersionConflictEngineException; import org.elasticsearch.index.query.BoolQueryBuilder; diff --git a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/persistence/TransformInternalIndex.java b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/persistence/TransformInternalIndex.java index 8018095143191..974e25bbc6751 100644 --- a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/persistence/TransformInternalIndex.java +++ b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/persistence/TransformInternalIndex.java @@ -27,9 +27,9 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.mapper.MapperService; import org.elasticsearch.indices.SystemIndexDescriptor; import org.elasticsearch.xpack.core.common.notifications.AbstractAuditMessage; @@ -48,7 +48,7 @@ import java.io.IOException; import java.util.Collections; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.mapper.MapperService.SINGLE_MAPPING_NAME; import static org.elasticsearch.xpack.core.ClientHelper.TRANSFORM_ORIGIN; import static org.elasticsearch.xpack.core.ClientHelper.executeAsyncWithOrigin; diff --git a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/RestPutTransformAction.java b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/RestPutTransformAction.java index c1772da951823..6a4e3510bdfbe 100644 --- a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/RestPutTransformAction.java +++ b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/RestPutTransformAction.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.transform.rest.action; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestToXContentListener; diff --git a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/RestUpdateTransformAction.java b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/RestUpdateTransformAction.java index 213449a4a5da1..ba75b3de022f4 100644 --- a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/RestUpdateTransformAction.java +++ b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/RestUpdateTransformAction.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.transform.rest.action; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestToXContentListener; diff --git a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/compat/RestPreviewTransformActionDeprecated.java b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/compat/RestPreviewTransformActionDeprecated.java index dbce95fd63b60..0a19de7fc4373 100644 --- a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/compat/RestPreviewTransformActionDeprecated.java +++ b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/compat/RestPreviewTransformActionDeprecated.java @@ -9,7 +9,7 @@ import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.core.RestApiVersion; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestToXContentListener; diff --git a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/compat/RestPutTransformActionDeprecated.java b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/compat/RestPutTransformActionDeprecated.java index 6400c4373be44..ad5149ef3395d 100644 --- a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/compat/RestPutTransformActionDeprecated.java +++ b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/compat/RestPutTransformActionDeprecated.java @@ -9,7 +9,7 @@ import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.core.RestApiVersion; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestToXContentListener; diff --git a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/compat/RestUpdateTransformActionDeprecated.java b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/compat/RestUpdateTransformActionDeprecated.java index 2b193000c825e..f70b856b73ff9 100644 --- a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/compat/RestUpdateTransformActionDeprecated.java +++ b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/compat/RestUpdateTransformActionDeprecated.java @@ -9,7 +9,7 @@ import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.core.RestApiVersion; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestToXContentListener; diff --git a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/transforms/pivot/Pivot.java b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/transforms/pivot/Pivot.java index 1bbf932231ddc..2abef9402e61c 100644 --- a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/transforms/pivot/Pivot.java +++ b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/transforms/pivot/Pivot.java @@ -16,9 +16,9 @@ import org.elasticsearch.common.ValidationException; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.query.BoolQueryBuilder; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.search.aggregations.AggregationBuilder; @@ -45,7 +45,7 @@ import java.util.stream.Stream; import static java.util.stream.Collectors.toList; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; /** * The pivot transform function. This continually searches and pivots results according to the passed {@link PivotConfig} diff --git a/x-pack/plugin/transform/src/test/java/org/elasticsearch/xpack/transform/TransformMetadataTests.java b/x-pack/plugin/transform/src/test/java/org/elasticsearch/xpack/transform/TransformMetadataTests.java index 417b7e58a45bf..b63925bd02db0 100644 --- a/x-pack/plugin/transform/src/test/java/org/elasticsearch/xpack/transform/TransformMetadataTests.java +++ b/x-pack/plugin/transform/src/test/java/org/elasticsearch/xpack/transform/TransformMetadataTests.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.transform; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.transform.TransformMetadata; diff --git a/x-pack/plugin/transform/src/test/java/org/elasticsearch/xpack/transform/persistence/TransformIndexTests.java b/x-pack/plugin/transform/src/test/java/org/elasticsearch/xpack/transform/persistence/TransformIndexTests.java index 6cb7f0c83bc3b..674a36bcb0297 100644 --- a/x-pack/plugin/transform/src/test/java/org/elasticsearch/xpack/transform/persistence/TransformIndexTests.java +++ b/x-pack/plugin/transform/src/test/java/org/elasticsearch/xpack/transform/persistence/TransformIndexTests.java @@ -11,8 +11,8 @@ import org.elasticsearch.action.admin.indices.create.CreateIndexRequest; import org.elasticsearch.action.admin.indices.create.CreateIndexResponse; import org.elasticsearch.client.Client; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.transform.transforms.TransformConfigTests; import org.mockito.ArgumentCaptor; diff --git a/x-pack/plugin/transform/src/test/java/org/elasticsearch/xpack/transform/rest/action/RestDeleteTransformActionTests.java b/x-pack/plugin/transform/src/test/java/org/elasticsearch/xpack/transform/rest/action/RestDeleteTransformActionTests.java index 035a5b03f0632..167724c93cd48 100644 --- a/x-pack/plugin/transform/src/test/java/org/elasticsearch/xpack/transform/rest/action/RestDeleteTransformActionTests.java +++ b/x-pack/plugin/transform/src/test/java/org/elasticsearch/xpack/transform/rest/action/RestDeleteTransformActionTests.java @@ -9,10 +9,10 @@ import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.common.bytes.BytesArray; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.rest.FakeRestRequest; diff --git a/x-pack/plugin/transform/src/test/java/org/elasticsearch/xpack/transform/transforms/TransformNodesTests.java b/x-pack/plugin/transform/src/test/java/org/elasticsearch/xpack/transform/transforms/TransformNodesTests.java index 806ba04df4bf1..0b5622542efef 100644 --- a/x-pack/plugin/transform/src/test/java/org/elasticsearch/xpack/transform/transforms/TransformNodesTests.java +++ b/x-pack/plugin/transform/src/test/java/org/elasticsearch/xpack/transform/transforms/TransformNodesTests.java @@ -17,7 +17,7 @@ import org.elasticsearch.cluster.node.DiscoveryNodes; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.persistent.PersistentTaskParams; import org.elasticsearch.persistent.PersistentTasksCustomMetadata; import org.elasticsearch.test.ESTestCase; diff --git a/x-pack/plugin/transform/src/test/java/org/elasticsearch/xpack/transform/transforms/pivot/AggregationResultUtilsTests.java b/x-pack/plugin/transform/src/test/java/org/elasticsearch/xpack/transform/transforms/pivot/AggregationResultUtilsTests.java index 0d323b59495e3..790ce63d45f35 100644 --- a/x-pack/plugin/transform/src/test/java/org/elasticsearch/xpack/transform/transforms/pivot/AggregationResultUtilsTests.java +++ b/x-pack/plugin/transform/src/test/java/org/elasticsearch/xpack/transform/transforms/pivot/AggregationResultUtilsTests.java @@ -9,14 +9,14 @@ import org.elasticsearch.common.geo.GeoPoint; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.ContextParser; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ContextParser; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.script.Script; import org.elasticsearch.search.aggregations.Aggregation; import org.elasticsearch.search.aggregations.AggregationBuilder; diff --git a/x-pack/plugin/transform/src/test/java/org/elasticsearch/xpack/transform/transforms/pivot/PivotTests.java b/x-pack/plugin/transform/src/test/java/org/elasticsearch/xpack/transform/transforms/pivot/PivotTests.java index ac4463f57c5ac..e0864cf3aac7f 100644 --- a/x-pack/plugin/transform/src/test/java/org/elasticsearch/xpack/transform/transforms/pivot/PivotTests.java +++ b/x-pack/plugin/transform/src/test/java/org/elasticsearch/xpack/transform/transforms/pivot/PivotTests.java @@ -20,11 +20,11 @@ import org.elasticsearch.client.Client; import org.elasticsearch.common.ValidationException; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.search.SearchHit; diff --git a/x-pack/plugin/vector-tile/src/main/java/org/elasticsearch/xpack/vectortile/rest/VectorTileRequest.java b/x-pack/plugin/vector-tile/src/main/java/org/elasticsearch/xpack/vectortile/rest/VectorTileRequest.java index 53030aed0e8d0..d8aed908eeaa8 100644 --- a/x-pack/plugin/vector-tile/src/main/java/org/elasticsearch/xpack/vectortile/rest/VectorTileRequest.java +++ b/x-pack/plugin/vector-tile/src/main/java/org/elasticsearch/xpack/vectortile/rest/VectorTileRequest.java @@ -8,9 +8,6 @@ package org.elasticsearch.xpack.vectortile.rest; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.core.Booleans; import org.elasticsearch.core.CheckedFunction; import org.elasticsearch.geometry.Rectangle; @@ -28,6 +25,9 @@ import org.elasticsearch.search.sort.ScriptSortBuilder; import org.elasticsearch.search.sort.SortBuilder; import org.elasticsearch.search.sort.SortOrder; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; diff --git a/x-pack/plugin/vector-tile/src/main/java/org/elasticsearch/xpack/vectortile/rest/VectorTileUtils.java b/x-pack/plugin/vector-tile/src/main/java/org/elasticsearch/xpack/vectortile/rest/VectorTileUtils.java index 09fd711942965..43bc8bde7b571 100644 --- a/x-pack/plugin/vector-tile/src/main/java/org/elasticsearch/xpack/vectortile/rest/VectorTileUtils.java +++ b/x-pack/plugin/vector-tile/src/main/java/org/elasticsearch/xpack/vectortile/rest/VectorTileUtils.java @@ -12,9 +12,9 @@ import com.wdtinc.mapbox_vector_tile.encoding.MvtValue; import org.elasticsearch.common.util.Maps; -import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.util.Map; diff --git a/x-pack/plugin/vector-tile/src/test/java/org/elasticsearch/xpack/vectortile/rest/VectorTileRequestTests.java b/x-pack/plugin/vector-tile/src/test/java/org/elasticsearch/xpack/vectortile/rest/VectorTileRequestTests.java index 6bf88379cd65a..cd63fe150a3e0 100644 --- a/x-pack/plugin/vector-tile/src/test/java/org/elasticsearch/xpack/vectortile/rest/VectorTileRequestTests.java +++ b/x-pack/plugin/vector-tile/src/test/java/org/elasticsearch/xpack/vectortile/rest/VectorTileRequestTests.java @@ -11,10 +11,6 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.core.CheckedConsumer; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.TermQueryBuilder; @@ -30,6 +26,10 @@ import org.elasticsearch.search.sort.SortOrder; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.rest.FakeRestRequest; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.hamcrest.Matchers; import java.io.IOException; diff --git a/x-pack/plugin/vectors/src/internalClusterTest/java/org/elasticsearch/xpack/vectors/mapper/SparseVectorFieldMapperTests.java b/x-pack/plugin/vectors/src/internalClusterTest/java/org/elasticsearch/xpack/vectors/mapper/SparseVectorFieldMapperTests.java index cd9e24cea7825..f483f89486c7c 100644 --- a/x-pack/plugin/vectors/src/internalClusterTest/java/org/elasticsearch/xpack/vectors/mapper/SparseVectorFieldMapperTests.java +++ b/x-pack/plugin/vectors/src/internalClusterTest/java/org/elasticsearch/xpack/vectors/mapper/SparseVectorFieldMapperTests.java @@ -13,8 +13,8 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.compress.CompressedXContent; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.IndexService; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.MappedFieldType; diff --git a/x-pack/plugin/vectors/src/main/java/org/elasticsearch/xpack/vectors/mapper/DenseVectorFieldMapper.java b/x-pack/plugin/vectors/src/main/java/org/elasticsearch/xpack/vectors/mapper/DenseVectorFieldMapper.java index 383a6c9697365..b336cc19466c1 100644 --- a/x-pack/plugin/vectors/src/main/java/org/elasticsearch/xpack/vectors/mapper/DenseVectorFieldMapper.java +++ b/x-pack/plugin/vectors/src/main/java/org/elasticsearch/xpack/vectors/mapper/DenseVectorFieldMapper.java @@ -16,7 +16,7 @@ import org.apache.lucene.search.Query; import org.apache.lucene.util.BytesRef; import org.elasticsearch.Version; -import org.elasticsearch.common.xcontent.XContentParser.Token; +import org.elasticsearch.xcontent.XContentParser.Token; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.index.fielddata.IndexFieldData; import org.elasticsearch.index.mapper.ArraySourceValueFetcher; diff --git a/x-pack/plugin/vectors/src/test/java/org/elasticsearch/xpack/vectors/mapper/DenseVectorFieldMapperTests.java b/x-pack/plugin/vectors/src/test/java/org/elasticsearch/xpack/vectors/mapper/DenseVectorFieldMapperTests.java index c77621e414125..29d3c1e629da8 100644 --- a/x-pack/plugin/vectors/src/test/java/org/elasticsearch/xpack/vectors/mapper/DenseVectorFieldMapperTests.java +++ b/x-pack/plugin/vectors/src/test/java/org/elasticsearch/xpack/vectors/mapper/DenseVectorFieldMapperTests.java @@ -16,7 +16,7 @@ import org.apache.lucene.search.Query; import org.apache.lucene.util.BytesRef; import org.elasticsearch.Version; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.LuceneDocument; import org.elasticsearch.index.mapper.MappedFieldType; diff --git a/x-pack/plugin/voting-only-node/src/internalClusterTest/java/org/elasticsearch/cluster/coordination/votingonly/VotingOnlyNodePluginTests.java b/x-pack/plugin/voting-only-node/src/internalClusterTest/java/org/elasticsearch/cluster/coordination/votingonly/VotingOnlyNodePluginTests.java index 6a6593531aa2a..632b0a8e1a893 100644 --- a/x-pack/plugin/voting-only-node/src/internalClusterTest/java/org/elasticsearch/cluster/coordination/votingonly/VotingOnlyNodePluginTests.java +++ b/x-pack/plugin/voting-only-node/src/internalClusterTest/java/org/elasticsearch/cluster/coordination/votingonly/VotingOnlyNodePluginTests.java @@ -19,7 +19,6 @@ import org.elasticsearch.common.blobstore.BlobStore; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.BigArrays; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; import org.elasticsearch.discovery.MasterNotDiscoveredException; import org.elasticsearch.env.Environment; import org.elasticsearch.indices.recovery.RecoverySettings; @@ -32,6 +31,7 @@ import org.elasticsearch.snapshots.SnapshotState; import org.elasticsearch.test.ESIntegTestCase; import org.elasticsearch.test.ESIntegTestCase.Scope; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.hamcrest.Matchers; import java.util.Arrays; diff --git a/x-pack/plugin/voting-only-node/src/main/java/org/elasticsearch/cluster/coordination/votingonly/VotingOnlyNodePlugin.java b/x-pack/plugin/voting-only-node/src/main/java/org/elasticsearch/cluster/coordination/votingonly/VotingOnlyNodePlugin.java index ebc5e1d2a7a76..1ab35714c26db 100644 --- a/x-pack/plugin/voting-only-node/src/main/java/org/elasticsearch/cluster/coordination/votingonly/VotingOnlyNodePlugin.java +++ b/x-pack/plugin/voting-only-node/src/main/java/org/elasticsearch/cluster/coordination/votingonly/VotingOnlyNodePlugin.java @@ -25,7 +25,6 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; import org.elasticsearch.discovery.DiscoveryModule; import org.elasticsearch.env.Environment; import org.elasticsearch.env.NodeEnvironment; @@ -44,6 +43,7 @@ import org.elasticsearch.transport.TransportResponse; import org.elasticsearch.transport.TransportResponseHandler; import org.elasticsearch.watcher.ResourceWatcherService; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.xpack.core.action.XPackInfoFeatureAction; import org.elasticsearch.xpack.core.action.XPackUsageFeatureAction; diff --git a/x-pack/plugin/watcher/qa/rest/src/javaRestTest/java/org/elasticsearch/smoketest/SmokeTestWatcherTestSuiteIT.java b/x-pack/plugin/watcher/qa/rest/src/javaRestTest/java/org/elasticsearch/smoketest/SmokeTestWatcherTestSuiteIT.java index 4686eb7d935ed..eaca29a6db1a0 100644 --- a/x-pack/plugin/watcher/qa/rest/src/javaRestTest/java/org/elasticsearch/smoketest/SmokeTestWatcherTestSuiteIT.java +++ b/x-pack/plugin/watcher/qa/rest/src/javaRestTest/java/org/elasticsearch/smoketest/SmokeTestWatcherTestSuiteIT.java @@ -13,8 +13,8 @@ import org.elasticsearch.common.settings.SecureString; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.rest.yaml.ObjectPath; import org.elasticsearch.xpack.watcher.WatcherRestTestCase; @@ -22,7 +22,7 @@ import java.util.Map; import java.util.concurrent.atomic.AtomicReference; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.rest.action.search.RestSearchAction.TOTAL_HITS_AS_INT_PARAM; import static org.hamcrest.Matchers.greaterThanOrEqualTo; import static org.hamcrest.Matchers.hasEntry; diff --git a/x-pack/plugin/watcher/qa/with-monitoring/src/javaRestTest/java/org/elasticsearch/smoketest/MonitoringWithWatcherRestIT.java b/x-pack/plugin/watcher/qa/with-monitoring/src/javaRestTest/java/org/elasticsearch/smoketest/MonitoringWithWatcherRestIT.java index 46962d8051037..713e2f7344cd0 100644 --- a/x-pack/plugin/watcher/qa/with-monitoring/src/javaRestTest/java/org/elasticsearch/smoketest/MonitoringWithWatcherRestIT.java +++ b/x-pack/plugin/watcher/qa/with-monitoring/src/javaRestTest/java/org/elasticsearch/smoketest/MonitoringWithWatcherRestIT.java @@ -15,7 +15,7 @@ import java.io.IOException; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.xpack.watcher.WatcherRestTestCase.deleteAllWatcherData; import static org.hamcrest.Matchers.is; diff --git a/x-pack/plugin/watcher/qa/with-security/src/javaRestTest/java/org/elasticsearch/smoketest/SmokeTestWatcherWithSecurityIT.java b/x-pack/plugin/watcher/qa/with-security/src/javaRestTest/java/org/elasticsearch/smoketest/SmokeTestWatcherWithSecurityIT.java index bf8f076f0eee8..510b8df341505 100644 --- a/x-pack/plugin/watcher/qa/with-security/src/javaRestTest/java/org/elasticsearch/smoketest/SmokeTestWatcherWithSecurityIT.java +++ b/x-pack/plugin/watcher/qa/with-security/src/javaRestTest/java/org/elasticsearch/smoketest/SmokeTestWatcherWithSecurityIT.java @@ -14,7 +14,7 @@ import org.elasticsearch.common.settings.SecureString; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.test.rest.yaml.ObjectPath; import org.elasticsearch.xpack.watcher.WatcherRestTestCase; import org.junit.Before; @@ -23,7 +23,7 @@ import java.util.Map; import java.util.concurrent.atomic.AtomicReference; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.rest.action.search.RestSearchAction.TOTAL_HITS_AS_INT_PARAM; import static org.hamcrest.Matchers.greaterThanOrEqualTo; import static org.hamcrest.Matchers.hasEntry; diff --git a/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/actions/TimeThrottleIntegrationTests.java b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/actions/TimeThrottleIntegrationTests.java index d0190c22f902c..42365b38958e2 100644 --- a/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/actions/TimeThrottleIntegrationTests.java +++ b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/actions/TimeThrottleIntegrationTests.java @@ -8,7 +8,7 @@ import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ObjectPath; +import org.elasticsearch.xcontent.ObjectPath; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.protocol.xpack.watcher.PutWatchResponse; import org.elasticsearch.search.builder.SearchSourceBuilder; diff --git a/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/actions/email/EmailAttachmentTests.java b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/actions/email/EmailAttachmentTests.java index fb9274e0d89f6..d129010f9c5ae 100644 --- a/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/actions/email/EmailAttachmentTests.java +++ b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/actions/email/EmailAttachmentTests.java @@ -11,8 +11,8 @@ import org.elasticsearch.common.io.Streams; import org.elasticsearch.common.settings.MockSecureSettings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.test.http.MockResponse; import org.elasticsearch.test.http.MockWebServer; @@ -44,7 +44,7 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount; import static org.elasticsearch.xpack.watcher.actions.ActionBuilders.emailAction; import static org.elasticsearch.xpack.watcher.client.WatchSourceBuilders.watchBuilder; diff --git a/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/actions/throttler/ActionThrottleTests.java b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/actions/throttler/ActionThrottleTests.java index 72f73dc80633f..9084b7d2d339f 100644 --- a/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/actions/throttler/ActionThrottleTests.java +++ b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/actions/throttler/ActionThrottleTests.java @@ -9,9 +9,9 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.common.Strings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ObjectPath; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ObjectPath; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.watcher.actions.Action; import org.elasticsearch.xpack.core.watcher.client.WatchSourceBuilder; import org.elasticsearch.xpack.core.watcher.execution.ActionExecutionMode; diff --git a/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/condition/ArrayCompareConditionSearchTests.java b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/condition/ArrayCompareConditionSearchTests.java index 23af1a5d33de6..1aeada2bd155a 100644 --- a/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/condition/ArrayCompareConditionSearchTests.java +++ b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/condition/ArrayCompareConditionSearchTests.java @@ -7,8 +7,8 @@ package org.elasticsearch.xpack.watcher.condition; import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.search.aggregations.AggregationBuilders; import org.elasticsearch.xpack.core.watcher.condition.Condition; import org.elasticsearch.xpack.core.watcher.execution.WatchExecutionContext; @@ -21,7 +21,7 @@ import java.util.HashMap; import java.util.Map; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.xpack.watcher.test.WatcherTestUtils.mockExecutionContext; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.notNullValue; diff --git a/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/condition/CompareConditionSearchTests.java b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/condition/CompareConditionSearchTests.java index c4b1055cf8404..232c650dc496b 100644 --- a/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/condition/CompareConditionSearchTests.java +++ b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/condition/CompareConditionSearchTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.action.OriginalIndices; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.action.search.ShardSearchFailure; -import org.elasticsearch.common.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContent; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.SearchHits; diff --git a/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateHttpMappingsTests.java b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateHttpMappingsTests.java index 9743587ba92b7..245cf27574e45 100644 --- a/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateHttpMappingsTests.java +++ b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateHttpMappingsTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.cluster.metadata.MappingMetadata; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ObjectPath; +import org.elasticsearch.xcontent.ObjectPath; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.protocol.xpack.watcher.PutWatchResponse; import org.elasticsearch.search.aggregations.Aggregations; diff --git a/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateTransformMappingsTests.java b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateTransformMappingsTests.java index 8aa77462b1bc8..200fb03d2f1e7 100644 --- a/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateTransformMappingsTests.java +++ b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/history/HistoryTemplateTransformMappingsTests.java @@ -16,7 +16,7 @@ import java.util.Objects; import java.util.Optional; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.search.builder.SearchSourceBuilder.searchSource; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.elasticsearch.xpack.watcher.actions.ActionBuilders.loggingAction; diff --git a/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/input/chain/ChainIntegrationTests.java b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/input/chain/ChainIntegrationTests.java index 1a409d9f427c3..5e7e93bdfb68e 100644 --- a/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/input/chain/ChainIntegrationTests.java +++ b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/input/chain/ChainIntegrationTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.CollectionUtils; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.transport.netty4.Netty4Plugin; @@ -23,7 +23,7 @@ import java.util.Collection; import static org.elasticsearch.action.support.WriteRequest.RefreshPolicy.IMMEDIATE; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount; import static org.elasticsearch.xpack.watcher.actions.ActionBuilders.indexAction; import static org.elasticsearch.xpack.watcher.client.WatchSourceBuilders.watchBuilder; diff --git a/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/integration/BasicWatcherTests.java b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/integration/BasicWatcherTests.java index ab1cd72e0fa5c..442daef8b102c 100644 --- a/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/integration/BasicWatcherTests.java +++ b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/integration/BasicWatcherTests.java @@ -12,8 +12,8 @@ import org.elasticsearch.action.search.SearchType; import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.query.TermQueryBuilder; import org.elasticsearch.protocol.xpack.watcher.DeleteWatchResponse; import org.elasticsearch.protocol.xpack.watcher.PutWatchResponse; @@ -45,7 +45,7 @@ import java.util.List; import java.util.Map; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery; import static org.elasticsearch.index.query.QueryBuilders.matchQuery; import static org.elasticsearch.index.query.QueryBuilders.termQuery; diff --git a/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/integration/BootStrapTests.java b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/integration/BootStrapTests.java index 8c5f0b5abe47c..a8e16d3e0fd3d 100644 --- a/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/integration/BootStrapTests.java +++ b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/integration/BootStrapTests.java @@ -13,7 +13,7 @@ import org.elasticsearch.action.support.WriteRequest; import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.watcher.condition.ExecutableCondition; import org.elasticsearch.xpack.core.watcher.execution.ExecutionState; import org.elasticsearch.xpack.core.watcher.execution.TriggeredWatchStoreField; @@ -41,7 +41,7 @@ import java.util.concurrent.TimeUnit; import static org.elasticsearch.action.support.WriteRequest.RefreshPolicy.IMMEDIATE; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.termQuery; import static org.elasticsearch.search.builder.SearchSourceBuilder.searchSource; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; diff --git a/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/integration/ExecutionVarsIntegrationTests.java b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/integration/ExecutionVarsIntegrationTests.java index 959da9e9bde59..9bade2476fcd6 100644 --- a/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/integration/ExecutionVarsIntegrationTests.java +++ b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/integration/ExecutionVarsIntegrationTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.watcher.test.integration; import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.common.xcontent.ObjectPath; +import org.elasticsearch.xcontent.ObjectPath; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.protocol.xpack.watcher.PutWatchResponse; diff --git a/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/integration/HistoryIntegrationTests.java b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/integration/HistoryIntegrationTests.java index 2360275845d3b..b77dc1d0e945e 100644 --- a/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/integration/HistoryIntegrationTests.java +++ b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/integration/HistoryIntegrationTests.java @@ -8,8 +8,8 @@ import org.elasticsearch.action.admin.indices.mapping.get.GetMappingsResponse; import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.protocol.xpack.watcher.PutWatchResponse; import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.sort.SortBuilders; @@ -29,7 +29,7 @@ import java.util.Locale; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.mapper.MapperService.SINGLE_MAPPING_NAME; import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery; import static org.elasticsearch.search.builder.SearchSourceBuilder.searchSource; diff --git a/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/integration/HttpSecretsIntegrationTests.java b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/integration/HttpSecretsIntegrationTests.java index 425fbae38955b..212b9c7e6d202 100644 --- a/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/integration/HttpSecretsIntegrationTests.java +++ b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/integration/HttpSecretsIntegrationTests.java @@ -39,7 +39,7 @@ import java.util.Base64; import java.util.Map; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.xpack.watcher.actions.ActionBuilders.loggingAction; import static org.elasticsearch.xpack.watcher.actions.ActionBuilders.webhookAction; import static org.elasticsearch.xpack.watcher.client.WatchSourceBuilders.watchBuilder; diff --git a/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/integration/WatchAckTests.java b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/integration/WatchAckTests.java index 5baa8a75707bc..d2d00748af61c 100644 --- a/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/integration/WatchAckTests.java +++ b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/integration/WatchAckTests.java @@ -13,7 +13,7 @@ import org.elasticsearch.action.index.IndexResponse; import org.elasticsearch.action.support.WriteRequest; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.protocol.xpack.watcher.PutWatchResponse; import org.elasticsearch.xpack.core.watcher.actions.ActionStatus; import org.elasticsearch.xpack.core.watcher.execution.ExecutionState; diff --git a/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/integration/WatchMetadataTests.java b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/integration/WatchMetadataTests.java index b270cb6e41f38..7810050a99b3b 100644 --- a/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/integration/WatchMetadataTests.java +++ b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/integration/WatchMetadataTests.java @@ -8,7 +8,7 @@ import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ObjectPath; +import org.elasticsearch.xcontent.ObjectPath; import org.elasticsearch.xpack.core.watcher.execution.ActionExecutionMode; import org.elasticsearch.xpack.core.watcher.history.HistoryStoreField; import org.elasticsearch.xpack.core.watcher.transport.actions.execute.ExecuteWatchRequestBuilder; diff --git a/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/transform/TransformIntegrationTests.java b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/transform/TransformIntegrationTests.java index 337385376a9aa..d64fa0e495339 100644 --- a/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/transform/TransformIntegrationTests.java +++ b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/transform/TransformIntegrationTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.collect.MapBuilder; import org.elasticsearch.common.util.CollectionUtils; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.protocol.xpack.watcher.PutWatchResponse; diff --git a/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/transport/action/activate/ActivateWatchTests.java b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/transport/action/activate/ActivateWatchTests.java index 435f03ee43d89..f9a25ce1f63da 100644 --- a/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/transport/action/activate/ActivateWatchTests.java +++ b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/transport/action/activate/ActivateWatchTests.java @@ -13,9 +13,9 @@ import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.protocol.xpack.watcher.PutWatchResponse; import org.elasticsearch.xpack.core.watcher.execution.ExecutionState; import org.elasticsearch.xpack.core.watcher.support.xcontent.XContentSource; diff --git a/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/transport/action/delete/DeleteWatchTests.java b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/transport/action/delete/DeleteWatchTests.java index 4bd79c6c32cd3..0295a0f734932 100644 --- a/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/transport/action/delete/DeleteWatchTests.java +++ b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/transport/action/delete/DeleteWatchTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.action.ActionFuture; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ObjectPath; +import org.elasticsearch.xcontent.ObjectPath; import org.elasticsearch.protocol.xpack.watcher.DeleteWatchResponse; import org.elasticsearch.protocol.xpack.watcher.PutWatchResponse; import org.elasticsearch.test.http.MockResponse; diff --git a/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/watch/WatchStatusIntegrationTests.java b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/watch/WatchStatusIntegrationTests.java index d81bfeabd3c77..abbd0578a2783 100644 --- a/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/watch/WatchStatusIntegrationTests.java +++ b/x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/watch/WatchStatusIntegrationTests.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.watcher.watch; import org.elasticsearch.action.get.GetResponse; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.watcher.support.xcontent.XContentSource; import org.elasticsearch.xpack.core.watcher.transport.actions.get.GetWatchRequestBuilder; import org.elasticsearch.xpack.core.watcher.transport.actions.get.GetWatchResponse; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/Watcher.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/Watcher.java index 87e0947fd4316..b733172d6b7ea 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/Watcher.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/Watcher.java @@ -35,8 +35,8 @@ import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.concurrent.EsExecutors; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.core.internal.io.IOUtils; import org.elasticsearch.env.Environment; import org.elasticsearch.env.NodeEnvironment; @@ -201,7 +201,7 @@ import static java.util.Collections.emptyList; import static org.elasticsearch.common.settings.Setting.Property.NodeScope; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.mapper.MapperService.SINGLE_MAPPING_NAME; import static org.elasticsearch.xpack.core.ClientHelper.WATCHER_ORIGIN; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/WatcherIndexingListener.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/WatcherIndexingListener.java index 914b2d3e84647..7daac42b9eec6 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/WatcherIndexingListener.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/WatcherIndexingListener.java @@ -22,7 +22,7 @@ import org.elasticsearch.cluster.routing.ShardRouting; import org.elasticsearch.common.Strings; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.engine.Engine; import org.elasticsearch.index.shard.IndexingOperationListener; import org.elasticsearch.index.shard.ShardId; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/WatcherService.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/WatcherService.java index 955f7be4f9bd7..bc7bb6e94ae31 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/WatcherService.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/WatcherService.java @@ -29,7 +29,7 @@ import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.concurrent.AbstractRunnable; import org.elasticsearch.common.util.concurrent.EsExecutors; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.builder.SearchSourceBuilder; import org.elasticsearch.search.sort.SortBuilders; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/email/EmailAction.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/email/EmailAction.java index 0942aaf9b0daf..72a55f2ff6b92 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/email/EmailAction.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/email/EmailAction.java @@ -8,9 +8,9 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.watcher.actions.Action; import org.elasticsearch.xpack.core.watcher.common.secret.Secret; import org.elasticsearch.xpack.core.watcher.crypto.CryptoService; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/email/EmailActionFactory.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/email/EmailActionFactory.java index 7fc2c27756901..6c1200eaa6e5a 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/email/EmailActionFactory.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/email/EmailActionFactory.java @@ -8,7 +8,7 @@ import org.apache.logging.log4j.LogManager; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.watcher.actions.ActionFactory; import org.elasticsearch.xpack.watcher.common.text.TextTemplateEngine; import org.elasticsearch.xpack.watcher.notification.email.EmailService; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/index/ExecutableIndexAction.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/index/ExecutableIndexAction.java index 1fcbc53e8fca3..7e247c432af5f 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/index/ExecutableIndexAction.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/index/ExecutableIndexAction.java @@ -16,8 +16,8 @@ import org.elasticsearch.action.index.IndexResponse; import org.elasticsearch.client.Client; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.TimeValue; import org.elasticsearch.xpack.core.ClientHelper; import org.elasticsearch.xpack.core.watcher.actions.Action; @@ -35,7 +35,7 @@ import java.util.Map; import java.util.stream.Stream; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.xpack.core.watcher.support.Exceptions.illegalState; public class ExecutableIndexAction extends ExecutableAction { diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/index/IndexAction.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/index/IndexAction.java index c5cf149d79c9b..19a8dd8f91f10 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/index/IndexAction.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/index/IndexAction.java @@ -10,11 +10,11 @@ import org.elasticsearch.action.DocWriteRequest; import org.elasticsearch.action.support.WriteRequest.RefreshPolicy; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.time.DateUtils; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.watcher.actions.Action; import org.elasticsearch.xpack.core.watcher.support.WatcherDateTimeUtils; import org.elasticsearch.xpack.core.watcher.support.xcontent.XContentSource; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/index/IndexActionFactory.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/index/IndexActionFactory.java index 6010b22bdb7a4..9880f19ad1f9a 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/index/IndexActionFactory.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/index/IndexActionFactory.java @@ -10,7 +10,7 @@ import org.elasticsearch.client.Client; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.watcher.actions.ActionFactory; import java.io.IOException; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/jira/JiraAction.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/jira/JiraAction.java index 62897a83fe736..448cd46c69671 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/jira/JiraAction.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/jira/JiraAction.java @@ -9,9 +9,9 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.watcher.actions.Action; import org.elasticsearch.xpack.watcher.common.http.HttpProxy; import org.elasticsearch.xpack.watcher.notification.jira.JiraIssue; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/jira/JiraActionFactory.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/jira/JiraActionFactory.java index 7de5d0eea4920..856686e598ba9 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/jira/JiraActionFactory.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/jira/JiraActionFactory.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.watcher.actions.jira; import org.apache.logging.log4j.LogManager; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.watcher.actions.ActionFactory; import org.elasticsearch.xpack.watcher.common.text.TextTemplateEngine; import org.elasticsearch.xpack.watcher.notification.jira.JiraService; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/logging/LoggingAction.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/logging/LoggingAction.java index 6e80f0efaa0a1..71ab5d74357ff 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/logging/LoggingAction.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/logging/LoggingAction.java @@ -8,9 +8,9 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.watcher.actions.Action; import org.elasticsearch.xpack.watcher.common.text.TextTemplate; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/logging/LoggingActionFactory.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/logging/LoggingActionFactory.java index ff45e3923933b..36c86e41402c0 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/logging/LoggingActionFactory.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/logging/LoggingActionFactory.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.watcher.actions.logging; import org.apache.logging.log4j.LogManager; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.watcher.actions.ActionFactory; import org.elasticsearch.xpack.watcher.common.text.TextTemplateEngine; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/pagerduty/PagerDutyAction.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/pagerduty/PagerDutyAction.java index b908fed9770e3..43b9cda5e386d 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/pagerduty/PagerDutyAction.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/pagerduty/PagerDutyAction.java @@ -7,9 +7,9 @@ package org.elasticsearch.xpack.watcher.actions.pagerduty; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.watcher.actions.Action; import org.elasticsearch.xpack.watcher.notification.pagerduty.IncidentEvent; import org.elasticsearch.xpack.watcher.notification.pagerduty.SentEvent; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/pagerduty/PagerDutyActionFactory.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/pagerduty/PagerDutyActionFactory.java index 07c49fbc2fa22..faef7261531f0 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/pagerduty/PagerDutyActionFactory.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/pagerduty/PagerDutyActionFactory.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.watcher.actions.pagerduty; import org.apache.logging.log4j.LogManager; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.watcher.actions.ActionFactory; import org.elasticsearch.xpack.watcher.common.text.TextTemplateEngine; import org.elasticsearch.xpack.watcher.notification.pagerduty.PagerDutyService; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/slack/SlackAction.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/slack/SlackAction.java index 3fe151094082b..7b9fd56461ae8 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/slack/SlackAction.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/slack/SlackAction.java @@ -9,9 +9,9 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.watcher.actions.Action; import org.elasticsearch.xpack.watcher.common.http.HttpProxy; import org.elasticsearch.xpack.watcher.notification.slack.SentMessages; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/slack/SlackActionFactory.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/slack/SlackActionFactory.java index 41d66ec8dbbed..b1e62f52c04a0 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/slack/SlackActionFactory.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/slack/SlackActionFactory.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.watcher.actions.slack; import org.apache.logging.log4j.LogManager; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.watcher.actions.ActionFactory; import org.elasticsearch.xpack.watcher.common.text.TextTemplateEngine; import org.elasticsearch.xpack.watcher.notification.slack.SlackService; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/webhook/WebhookAction.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/webhook/WebhookAction.java index c206c08bc0294..325ee30e6b14c 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/webhook/WebhookAction.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/webhook/WebhookAction.java @@ -7,9 +7,9 @@ package org.elasticsearch.xpack.watcher.actions.webhook; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.watcher.actions.Action; import org.elasticsearch.xpack.watcher.common.http.HttpRequest; import org.elasticsearch.xpack.watcher.common.http.HttpRequestTemplate; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/webhook/WebhookActionFactory.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/webhook/WebhookActionFactory.java index a757559d66039..8932aa33ecb38 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/webhook/WebhookActionFactory.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/webhook/WebhookActionFactory.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.watcher.actions.webhook; import org.apache.logging.log4j.LogManager; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.watcher.actions.ActionFactory; import org.elasticsearch.xpack.watcher.common.http.HttpClient; import org.elasticsearch.xpack.watcher.common.text.TextTemplateEngine; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/common/http/BasicAuth.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/common/http/BasicAuth.java index fe60710a1851a..f7527aa5fc59e 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/common/http/BasicAuth.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/common/http/BasicAuth.java @@ -7,10 +7,10 @@ package org.elasticsearch.xpack.watcher.common.http; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.watcher.common.secret.Secret; import org.elasticsearch.xpack.core.watcher.crypto.CryptoService; import org.elasticsearch.xpack.core.watcher.support.xcontent.WatcherParams; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/common/http/HttpClient.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/common/http/HttpClient.java index d3987767fed30..62dd39d6e6187 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/common/http/HttpClient.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/common/http/HttpClient.java @@ -53,8 +53,8 @@ import org.elasticsearch.common.ssl.SslConfiguration; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.core.internal.io.Streams; import org.elasticsearch.xpack.core.common.socket.SocketAccess; import org.elasticsearch.xpack.core.ssl.SSLService; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/common/http/HttpContentType.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/common/http/HttpContentType.java index e97a004219447..e646f352a57c3 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/common/http/HttpContentType.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/common/http/HttpContentType.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.watcher.common.http; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import java.util.Locale; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/common/http/HttpProxy.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/common/http/HttpProxy.java index 7d2a666577a42..ddfd497dbc976 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/common/http/HttpProxy.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/common/http/HttpProxy.java @@ -7,11 +7,11 @@ package org.elasticsearch.xpack.watcher.common.http; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/common/http/HttpRequest.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/common/http/HttpRequest.java index 2d49806404220..e3738aa5b9850 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/common/http/HttpRequest.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/common/http/HttpRequest.java @@ -8,14 +8,14 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.rest.RestUtils; import org.elasticsearch.xpack.core.watcher.support.WatcherDateTimeUtils; import org.elasticsearch.xpack.core.watcher.support.WatcherUtils; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/common/http/HttpRequestTemplate.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/common/http/HttpRequestTemplate.java index 9dba774794ba1..c82f49f345219 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/common/http/HttpRequestTemplate.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/common/http/HttpRequestTemplate.java @@ -12,10 +12,10 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.collect.MapBuilder; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.rest.RestUtils; import org.elasticsearch.script.ScriptType; import org.elasticsearch.xpack.core.watcher.support.WatcherDateTimeUtils; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/common/http/HttpResponse.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/common/http/HttpResponse.java index 750f3ff40319f..1a91fe85ac844 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/common/http/HttpResponse.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/common/http/HttpResponse.java @@ -9,13 +9,13 @@ import io.netty.handler.codec.http.HttpHeaders; import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import java.io.IOException; import java.util.ArrayList; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/common/text/TextTemplate.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/common/text/TextTemplate.java index 43aa048a686d0..a747104731827 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/common/text/TextTemplate.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/common/text/TextTemplate.java @@ -7,10 +7,10 @@ package org.elasticsearch.xpack.watcher.common.text; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.script.Script; import org.elasticsearch.script.ScriptType; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/common/text/TextTemplateEngine.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/common/text/TextTemplateEngine.java index 37b83cac79d51..03a1d14b28d54 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/common/text/TextTemplateEngine.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/common/text/TextTemplateEngine.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.watcher.common.text; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.script.Script; import org.elasticsearch.script.ScriptService; import org.elasticsearch.script.ScriptType; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/condition/AbstractCompareCondition.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/condition/AbstractCompareCondition.java index bd1cc26d11f65..3da879e69780f 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/condition/AbstractCompareCondition.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/condition/AbstractCompareCondition.java @@ -6,8 +6,8 @@ */ package org.elasticsearch.xpack.watcher.condition; -import org.elasticsearch.common.xcontent.ObjectPath; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ObjectPath; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.watcher.condition.ExecutableCondition; import org.elasticsearch.xpack.core.watcher.execution.WatchExecutionContext; import org.elasticsearch.xpack.core.watcher.support.WatcherDateTimeUtils; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/condition/ArrayCompareCondition.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/condition/ArrayCompareCondition.java index 7d569a5faf6ab..7d95a6d3b29bf 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/condition/ArrayCompareCondition.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/condition/ArrayCompareCondition.java @@ -7,10 +7,10 @@ package org.elasticsearch.xpack.watcher.condition; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentUtils; -import org.elasticsearch.common.xcontent.ObjectPath; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentUtils; +import org.elasticsearch.xcontent.ObjectPath; import java.io.IOException; import java.time.Clock; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/condition/CompareCondition.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/condition/CompareCondition.java index 1bc3ace621863..05e561e1078df 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/condition/CompareCondition.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/condition/CompareCondition.java @@ -7,10 +7,10 @@ package org.elasticsearch.xpack.watcher.condition; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentUtils; -import org.elasticsearch.common.xcontent.ObjectPath; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentUtils; +import org.elasticsearch.xcontent.ObjectPath; import java.io.IOException; import java.time.Clock; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/condition/InternalAlwaysCondition.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/condition/InternalAlwaysCondition.java index 8719560036583..2a89ab896e1e2 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/condition/InternalAlwaysCondition.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/condition/InternalAlwaysCondition.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.watcher.condition; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.watcher.condition.AlwaysCondition; import org.elasticsearch.xpack.core.watcher.condition.ExecutableCondition; import org.elasticsearch.xpack.core.watcher.execution.WatchExecutionContext; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/condition/NeverCondition.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/condition/NeverCondition.java index 1765a24c9c7a9..68fa914b7618e 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/condition/NeverCondition.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/condition/NeverCondition.java @@ -7,8 +7,8 @@ package org.elasticsearch.xpack.watcher.condition; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.watcher.condition.ExecutableCondition; import org.elasticsearch.xpack.core.watcher.execution.WatchExecutionContext; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/condition/ScriptCondition.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/condition/ScriptCondition.java index a4d72f000ae0d..364ca197c410c 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/condition/ScriptCondition.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/condition/ScriptCondition.java @@ -7,8 +7,8 @@ package org.elasticsearch.xpack.watcher.condition; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.script.Script; import org.elasticsearch.script.ScriptService; import org.elasticsearch.xpack.core.watcher.condition.ExecutableCondition; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/execution/ExecutionService.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/execution/ExecutionService.java index aaf56c5b546cf..f0a1e193cec3f 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/execution/ExecutionService.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/execution/ExecutionService.java @@ -32,11 +32,11 @@ import org.elasticsearch.common.util.concurrent.EsRejectedExecutionException; import org.elasticsearch.common.util.concurrent.ThreadContext; import org.elasticsearch.common.util.iterable.Iterables; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.index.engine.DocumentMissingException; import org.elasticsearch.index.engine.VersionConflictEngineException; import org.elasticsearch.xpack.core.watcher.WatcherState; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/execution/TriggeredWatch.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/execution/TriggeredWatch.java index 695d76f0b2600..5128896d5646a 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/execution/TriggeredWatch.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/execution/TriggeredWatch.java @@ -7,14 +7,14 @@ package org.elasticsearch.xpack.watcher.execution; import org.elasticsearch.ElasticsearchException; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.watcher.execution.Wid; import org.elasticsearch.xpack.core.watcher.trigger.TriggerEvent; import org.elasticsearch.xpack.watcher.trigger.TriggerService; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/execution/TriggeredWatchStore.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/execution/TriggeredWatchStore.java index 76293cb5c4547..4290138d07e69 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/execution/TriggeredWatchStore.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/execution/TriggeredWatchStore.java @@ -27,9 +27,9 @@ import org.elasticsearch.cluster.routing.Preference; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.builder.SearchSourceBuilder; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/history/HistoryStore.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/history/HistoryStore.java index 89c1f7d401001..f99e81e51bdbe 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/history/HistoryStore.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/history/HistoryStore.java @@ -15,8 +15,8 @@ import org.elasticsearch.action.index.IndexRequest; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.metadata.IndexMetadata; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.xpack.core.watcher.history.HistoryStoreField; import org.elasticsearch.xpack.core.watcher.history.WatchRecord; import org.elasticsearch.xpack.core.watcher.support.xcontent.WatcherParams; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/InputFactory.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/InputFactory.java index e73a252277bb4..997d4657b65f0 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/InputFactory.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/InputFactory.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.watcher.input; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.watcher.input.ExecutableInput; import org.elasticsearch.xpack.core.watcher.input.Input; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/InputRegistry.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/InputRegistry.java index 9ca7171ad41bb..4b84de5303db2 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/InputRegistry.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/InputRegistry.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.watcher.input; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.watcher.input.ExecutableInput; import org.elasticsearch.xpack.watcher.input.chain.ChainInput; import org.elasticsearch.xpack.watcher.input.chain.ChainInputFactory; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/chain/ChainInput.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/chain/ChainInput.java index 76436f1e5e65d..678aa2ce4e1c2 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/chain/ChainInput.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/chain/ChainInput.java @@ -7,10 +7,10 @@ package org.elasticsearch.xpack.watcher.input.chain; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.Tuple; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.watcher.input.Input; import org.elasticsearch.xpack.core.watcher.watch.Payload; import org.elasticsearch.xpack.watcher.input.InputRegistry; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/chain/ChainInputFactory.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/chain/ChainInputFactory.java index 0f416543fdb35..ae8ce24e77364 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/chain/ChainInputFactory.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/chain/ChainInputFactory.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.watcher.input.chain; import org.elasticsearch.core.Tuple; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.watcher.input.ExecutableInput; import org.elasticsearch.xpack.core.watcher.input.Input; import org.elasticsearch.xpack.watcher.input.InputFactory; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/http/ExecutableHttpInput.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/http/ExecutableHttpInput.java index 6fb2559418b83..c33e3f497b4f9 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/http/ExecutableHttpInput.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/http/ExecutableHttpInput.java @@ -11,10 +11,10 @@ import org.apache.logging.log4j.LogManager; import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.watcher.execution.WatchExecutionContext; import org.elasticsearch.xpack.core.watcher.input.ExecutableInput; import org.elasticsearch.xpack.core.watcher.watch.Payload; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/http/HttpInput.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/http/HttpInput.java index 6e7a913e31099..0ee9f20802853 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/http/HttpInput.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/http/HttpInput.java @@ -8,9 +8,9 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.watcher.input.Input; import org.elasticsearch.xpack.core.watcher.watch.Payload; import org.elasticsearch.xpack.watcher.common.http.HttpContentType; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/http/HttpInputFactory.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/http/HttpInputFactory.java index 88192d49f2237..a9547dc5e32d8 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/http/HttpInputFactory.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/http/HttpInputFactory.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.watcher.input.http; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.watcher.common.http.HttpClient; import org.elasticsearch.xpack.watcher.common.text.TextTemplateEngine; import org.elasticsearch.xpack.watcher.input.InputFactory; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/none/NoneInputFactory.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/none/NoneInputFactory.java index d96011100aae0..7358061e47e92 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/none/NoneInputFactory.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/none/NoneInputFactory.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.watcher.input.none; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.watcher.input.none.NoneInput; import org.elasticsearch.xpack.watcher.input.InputFactory; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/search/ExecutableSearchInput.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/search/ExecutableSearchInput.java index f9f7578529fda..7156496933fce 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/search/ExecutableSearchInput.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/search/ExecutableSearchInput.java @@ -16,10 +16,10 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.script.Script; import org.elasticsearch.search.SearchHit; import org.elasticsearch.xpack.core.ClientHelper; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/search/SearchInput.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/search/SearchInput.java index 4ba5039ef8102..99657ca5b391d 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/search/SearchInput.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/search/SearchInput.java @@ -8,11 +8,11 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.time.DateUtils; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.watcher.input.Input; import org.elasticsearch.xpack.core.watcher.support.WatcherDateTimeUtils; import org.elasticsearch.xpack.core.watcher.watch.Payload; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/search/SearchInputFactory.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/search/SearchInputFactory.java index 526417aa72e34..5fc84df91621a 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/search/SearchInputFactory.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/search/SearchInputFactory.java @@ -9,8 +9,8 @@ import org.elasticsearch.client.Client; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.script.ScriptService; import org.elasticsearch.xpack.watcher.input.InputFactory; import org.elasticsearch.xpack.watcher.support.search.WatcherSearchTemplateService; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/simple/SimpleInput.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/simple/SimpleInput.java index f40d6d82d0ad8..1cfdc1b95ec04 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/simple/SimpleInput.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/simple/SimpleInput.java @@ -7,8 +7,8 @@ package org.elasticsearch.xpack.watcher.input.simple; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.watcher.input.Input; import org.elasticsearch.xpack.core.watcher.watch.Payload; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/simple/SimpleInputFactory.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/simple/SimpleInputFactory.java index d99fcd1f98834..3baf2efb03126 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/simple/SimpleInputFactory.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/simple/SimpleInputFactory.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.watcher.input.simple; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.watcher.input.InputFactory; import java.io.IOException; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/transform/TransformInput.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/transform/TransformInput.java index 520f85fa486a3..4a5fe3e26ce74 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/transform/TransformInput.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/transform/TransformInput.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.watcher.input.transform; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.watcher.input.Input; import org.elasticsearch.xpack.core.watcher.transform.Transform; import org.elasticsearch.xpack.core.watcher.watch.Payload; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/transform/TransformInputFactory.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/transform/TransformInputFactory.java index 3be5bd0b8a72d..f27c0aae63b63 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/transform/TransformInputFactory.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/transform/TransformInputFactory.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.watcher.input.transform; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParserUtils; import org.elasticsearch.xpack.core.watcher.transform.ExecutableTransform; import org.elasticsearch.xpack.core.watcher.transform.Transform; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/Attachment.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/Attachment.java index 19ec66a5129a5..6c5f421edace0 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/Attachment.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/Attachment.java @@ -10,9 +10,9 @@ import org.elasticsearch.core.SuppressForbidden; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.inject.Provider; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.watcher.notification.email.support.BodyPartSource; import javax.activation.DataHandler; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/DataAttachment.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/DataAttachment.java index 4b0715cc5dd1f..9e709e0888f42 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/DataAttachment.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/DataAttachment.java @@ -7,11 +7,11 @@ package org.elasticsearch.xpack.watcher.notification.email; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.watcher.watch.Payload; import java.io.IOException; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/Email.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/Email.java index 5d4317aaeed09..7b84e2c06052f 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/Email.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/Email.java @@ -7,14 +7,14 @@ package org.elasticsearch.xpack.watcher.notification.email; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.time.DateFormatter; import org.elasticsearch.common.time.DateFormatters; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import javax.mail.MessagingException; import javax.mail.internet.AddressException; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/EmailTemplate.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/EmailTemplate.java index 6d380c4342405..addae863a6fcd 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/EmailTemplate.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/EmailTemplate.java @@ -8,9 +8,9 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.watcher.common.text.TextTemplate; import org.elasticsearch.xpack.watcher.common.text.TextTemplateEngine; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/attachment/DataAttachment.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/attachment/DataAttachment.java index 67917c2df6a29..36f61071a31ce 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/attachment/DataAttachment.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/attachment/DataAttachment.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.watcher.notification.email.attachment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Objects; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/attachment/DataAttachmentParser.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/attachment/DataAttachmentParser.java index 428dd64dcbca2..54c3af37a18d5 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/attachment/DataAttachmentParser.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/attachment/DataAttachmentParser.java @@ -7,9 +7,9 @@ package org.elasticsearch.xpack.watcher.notification.email.attachment; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.watcher.execution.WatchExecutionContext; import org.elasticsearch.xpack.core.watcher.watch.Payload; import org.elasticsearch.xpack.watcher.notification.email.Attachment; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/attachment/EmailAttachmentParser.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/attachment/EmailAttachmentParser.java index 3a60340100b9f..3e3a8a6f2075e 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/attachment/EmailAttachmentParser.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/attachment/EmailAttachmentParser.java @@ -6,8 +6,8 @@ */ package org.elasticsearch.xpack.watcher.notification.email.attachment; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.watcher.execution.WatchExecutionContext; import org.elasticsearch.xpack.core.watcher.watch.Payload; import org.elasticsearch.xpack.watcher.notification.email.Attachment; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/attachment/EmailAttachments.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/attachment/EmailAttachments.java index 099ffe80dcb59..ffaecfe785e06 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/attachment/EmailAttachments.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/attachment/EmailAttachments.java @@ -6,9 +6,9 @@ */ package org.elasticsearch.xpack.watcher.notification.email.attachment; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentFragment; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Collection; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/attachment/EmailAttachmentsParser.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/attachment/EmailAttachmentsParser.java index 3a178673cd2a7..8487d6cda83ef 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/attachment/EmailAttachmentsParser.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/attachment/EmailAttachmentsParser.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.watcher.notification.email.attachment; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.watcher.notification.email.attachment.EmailAttachmentParser.EmailAttachment; import java.io.IOException; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/attachment/HttpEmailAttachementParser.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/attachment/HttpEmailAttachementParser.java index 1e36aea466749..f9642cc57a1b6 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/attachment/HttpEmailAttachementParser.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/attachment/HttpEmailAttachementParser.java @@ -8,10 +8,10 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.watcher.execution.WatchExecutionContext; import org.elasticsearch.xpack.core.watcher.watch.Payload; import org.elasticsearch.xpack.watcher.common.http.HttpClient; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/attachment/HttpRequestAttachment.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/attachment/HttpRequestAttachment.java index e1125ee98c9ae..f42672ea7d3df 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/attachment/HttpRequestAttachment.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/attachment/HttpRequestAttachment.java @@ -8,7 +8,7 @@ import org.elasticsearch.core.Nullable; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.watcher.common.http.HttpRequestTemplate; import java.io.IOException; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/attachment/ReportingAttachment.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/attachment/ReportingAttachment.java index 34a7016e340e0..921ef3d82909d 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/attachment/ReportingAttachment.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/attachment/ReportingAttachment.java @@ -7,9 +7,9 @@ package org.elasticsearch.xpack.watcher.notification.email.attachment; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.watcher.common.http.HttpProxy; import org.elasticsearch.xpack.watcher.common.http.BasicAuth; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/attachment/ReportingAttachmentParser.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/attachment/ReportingAttachmentParser.java index 53fb2dfceeb83..108f9b4b3868a 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/attachment/ReportingAttachmentParser.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/attachment/ReportingAttachmentParser.java @@ -10,7 +10,7 @@ import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.message.ParameterizedMessage; import org.elasticsearch.ElasticsearchException; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.logging.LoggerMessageFormat; @@ -19,10 +19,10 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.xpack.core.watcher.execution.WatchExecutionContext; import org.elasticsearch.xpack.core.watcher.watch.Payload; import org.elasticsearch.xpack.watcher.common.http.BasicAuth; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/support/BodyPartSource.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/support/BodyPartSource.java index 7bb86c35816a0..39875e5b95d50 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/support/BodyPartSource.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/support/BodyPartSource.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.watcher.notification.email.support; import org.elasticsearch.SpecialPermission; -import org.elasticsearch.common.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.ToXContentObject; import javax.activation.FileTypeMap; import javax.mail.MessagingException; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/jira/JiraAccount.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/jira/JiraAccount.java index 9cc0b29abebca..99291df845460 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/jira/JiraAccount.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/jira/JiraAccount.java @@ -14,11 +14,11 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.SettingsException; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.watcher.common.http.HttpClient; import org.elasticsearch.xpack.watcher.common.http.HttpMethod; import org.elasticsearch.xpack.watcher.common.http.HttpProxy; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/jira/JiraIssue.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/jira/JiraIssue.java index 53fd37c150544..8c57a0e1ef33c 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/jira/JiraIssue.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/jira/JiraIssue.java @@ -9,13 +9,13 @@ import org.apache.http.HttpStatus; import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.xpack.watcher.common.http.HttpRequest; import org.elasticsearch.xpack.watcher.common.http.HttpResponse; import org.elasticsearch.xpack.watcher.actions.jira.JiraAction; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/pagerduty/IncidentEvent.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/pagerduty/IncidentEvent.java index 9b440f0a7579e..755e14317f441 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/pagerduty/IncidentEvent.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/pagerduty/IncidentEvent.java @@ -8,12 +8,12 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.watcher.watch.Payload; import org.elasticsearch.xpack.watcher.common.http.HttpMethod; import org.elasticsearch.xpack.watcher.common.http.HttpProxy; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/pagerduty/IncidentEventContext.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/pagerduty/IncidentEventContext.java index 0cca55b8db8fd..9177bd408862e 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/pagerduty/IncidentEventContext.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/pagerduty/IncidentEventContext.java @@ -8,11 +8,11 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.watcher.common.text.TextTemplate; import org.elasticsearch.xpack.watcher.common.text.TextTemplateEngine; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/pagerduty/SentEvent.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/pagerduty/SentEvent.java index a211c06d6f19c..09b25caa73b91 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/pagerduty/SentEvent.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/pagerduty/SentEvent.java @@ -8,13 +8,13 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.xpack.core.watcher.support.xcontent.WatcherParams; import org.elasticsearch.xpack.watcher.actions.pagerduty.PagerDutyAction; import org.elasticsearch.xpack.watcher.common.http.HttpRequest; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/slack/SentMessages.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/slack/SentMessages.java index d41c7e6d62a78..b6e130b64b35b 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/slack/SentMessages.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/slack/SentMessages.java @@ -8,9 +8,9 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.watcher.support.xcontent.WatcherParams; import org.elasticsearch.xpack.watcher.common.http.HttpRequest; import org.elasticsearch.xpack.watcher.common.http.HttpResponse; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/slack/SlackAccount.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/slack/SlackAccount.java index 3dbedcc26e836..4b4ac36450525 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/slack/SlackAccount.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/slack/SlackAccount.java @@ -12,8 +12,8 @@ import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.SettingsException; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.watcher.common.http.HttpClient; import org.elasticsearch.xpack.watcher.common.http.HttpMethod; import org.elasticsearch.xpack.watcher.common.http.HttpProxy; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/slack/message/Action.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/slack/message/Action.java index b096a6f688b04..c892df76a1269 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/slack/message/Action.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/slack/message/Action.java @@ -6,11 +6,11 @@ */ package org.elasticsearch.xpack.watcher.notification.slack.message; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ObjectParser; -import org.elasticsearch.common.xcontent.ObjectParser.ValueType; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ObjectParser; +import org.elasticsearch.xcontent.ObjectParser.ValueType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.watcher.common.text.TextTemplate; import org.elasticsearch.xpack.watcher.common.text.TextTemplateEngine; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/slack/message/Attachment.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/slack/message/Attachment.java index 3383f0f890f87..d161b0c9c7d97 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/slack/message/Attachment.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/slack/message/Attachment.java @@ -7,10 +7,10 @@ package org.elasticsearch.xpack.watcher.notification.slack.message; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.watcher.common.text.TextTemplate; import org.elasticsearch.xpack.watcher.common.text.TextTemplateEngine; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/slack/message/DynamicAttachments.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/slack/message/DynamicAttachments.java index bf62346a3bb91..ddd802bfa4d8a 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/slack/message/DynamicAttachments.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/slack/message/DynamicAttachments.java @@ -7,10 +7,10 @@ package org.elasticsearch.xpack.watcher.notification.slack.message; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.ObjectPath; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.ObjectPath; import org.elasticsearch.xpack.watcher.common.text.TextTemplateEngine; import java.io.IOException; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/slack/message/Field.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/slack/message/Field.java index bc4d7c07ad97a..4d3bde01207d5 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/slack/message/Field.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/slack/message/Field.java @@ -7,10 +7,10 @@ package org.elasticsearch.xpack.watcher.notification.slack.message; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.watcher.common.text.TextTemplate; import org.elasticsearch.xpack.watcher.common.text.TextTemplateEngine; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/slack/message/MessageElement.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/slack/message/MessageElement.java index df73fb1c73e39..36dc3d0f5b110 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/slack/message/MessageElement.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/slack/message/MessageElement.java @@ -6,8 +6,8 @@ */ package org.elasticsearch.xpack.watcher.notification.slack.message; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; public interface MessageElement extends ToXContentObject { diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/slack/message/SlackMessage.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/slack/message/SlackMessage.java index c48522354354b..0cef2dccc1be1 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/slack/message/SlackMessage.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/slack/message/SlackMessage.java @@ -7,10 +7,10 @@ package org.elasticsearch.xpack.watcher.notification.slack.message; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.watcher.common.text.TextTemplate; import org.elasticsearch.xpack.watcher.common.text.TextTemplateEngine; import org.elasticsearch.core.Nullable; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestAckWatchAction.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestAckWatchAction.java index 4ff56ad2cc3fb..4d4e62d03f824 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestAckWatchAction.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestAckWatchAction.java @@ -9,7 +9,7 @@ import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.core.RestApiVersion; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestActivateWatchAction.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestActivateWatchAction.java index 0465e8d06f8f6..5e5297da6c0dc 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestActivateWatchAction.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestActivateWatchAction.java @@ -9,7 +9,7 @@ import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.core.RestApiVersion; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestDeleteWatchAction.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestDeleteWatchAction.java index 30ef33832d265..e7c93d9e415c1 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestDeleteWatchAction.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestDeleteWatchAction.java @@ -9,7 +9,7 @@ import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.core.RestApiVersion; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.protocol.xpack.watcher.DeleteWatchRequest; import org.elasticsearch.protocol.xpack.watcher.DeleteWatchResponse; import org.elasticsearch.rest.BaseRestHandler; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestExecuteWatchAction.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestExecuteWatchAction.java index be784cc15c37f..1013a1d65c1ee 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestExecuteWatchAction.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestExecuteWatchAction.java @@ -9,12 +9,12 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestGetWatchAction.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestGetWatchAction.java index 2e03eb4678225..ccbf7f7acc720 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestGetWatchAction.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestGetWatchAction.java @@ -9,7 +9,7 @@ import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.core.RestApiVersion; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestRequest; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestPutWatchAction.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestPutWatchAction.java index 1d0095fa51455..05b1ea2af5b07 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestPutWatchAction.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestPutWatchAction.java @@ -11,7 +11,7 @@ import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.common.lucene.uid.Versions; import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.protocol.xpack.watcher.PutWatchRequest; import org.elasticsearch.protocol.xpack.watcher.PutWatchResponse; import org.elasticsearch.rest.BaseRestHandler; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/WatcherIndexTemplateRegistry.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/WatcherIndexTemplateRegistry.java index 34d5d92447010..e9e3936c6ca76 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/WatcherIndexTemplateRegistry.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/WatcherIndexTemplateRegistry.java @@ -10,7 +10,7 @@ import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.xpack.core.template.IndexTemplateConfig; import org.elasticsearch.xpack.core.template.IndexTemplateRegistry; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/XContentFilterKeysUtils.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/XContentFilterKeysUtils.java index decaf64a17315..ca8a446a85c72 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/XContentFilterKeysUtils.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/XContentFilterKeysUtils.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.watcher.support; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; @@ -15,9 +15,9 @@ import java.util.Map; import java.util.Set; -import static org.elasticsearch.common.xcontent.XContentParser.Token.END_ARRAY; -import static org.elasticsearch.common.xcontent.XContentParser.Token.END_OBJECT; -import static org.elasticsearch.common.xcontent.XContentParser.Token.START_OBJECT; +import static org.elasticsearch.xcontent.XContentParser.Token.END_ARRAY; +import static org.elasticsearch.xcontent.XContentParser.Token.END_OBJECT; +import static org.elasticsearch.xcontent.XContentParser.Token.START_OBJECT; public final class XContentFilterKeysUtils { diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/search/WatcherSearchTemplateRequest.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/search/WatcherSearchTemplateRequest.java index d414aeb9a8e23..0dfcbe7bc022d 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/search/WatcherSearchTemplateRequest.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/search/WatcherSearchTemplateRequest.java @@ -10,14 +10,14 @@ import org.elasticsearch.action.search.SearchType; import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.script.Script; import org.elasticsearch.script.ScriptType; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/search/WatcherSearchTemplateService.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/search/WatcherSearchTemplateService.java index 1f830f900f11a..8b41499b4eb4a 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/search/WatcherSearchTemplateService.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/search/WatcherSearchTemplateService.java @@ -9,10 +9,10 @@ import org.elasticsearch.action.search.SearchRequest; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.script.Script; import org.elasticsearch.script.ScriptService; import org.elasticsearch.script.ScriptType; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/transform/script/ScriptTransform.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/transform/script/ScriptTransform.java index ef2ba303d357c..4c714bd18a48d 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/transform/script/ScriptTransform.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/transform/script/ScriptTransform.java @@ -7,8 +7,8 @@ package org.elasticsearch.xpack.watcher.transform.script; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.script.Script; import org.elasticsearch.xpack.core.watcher.transform.Transform; import org.elasticsearch.xpack.core.watcher.watch.Payload; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/transform/script/ScriptTransformFactory.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/transform/script/ScriptTransformFactory.java index ef0c8dfdc4aba..40d9d34ef26f2 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/transform/script/ScriptTransformFactory.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/transform/script/ScriptTransformFactory.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.watcher.transform.script; import org.apache.logging.log4j.LogManager; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.script.ScriptService; import org.elasticsearch.xpack.core.watcher.transform.TransformFactory; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/transform/search/SearchTransform.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/transform/search/SearchTransform.java index 4f785cb31d683..d4c3716d7dd82 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/transform/search/SearchTransform.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/transform/search/SearchTransform.java @@ -8,11 +8,11 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.time.DateUtils; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.watcher.support.WatcherDateTimeUtils; import org.elasticsearch.xpack.core.watcher.transform.Transform; import org.elasticsearch.xpack.core.watcher.watch.Payload; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/transform/search/SearchTransformFactory.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/transform/search/SearchTransformFactory.java index 0807a31626d6d..b7ae97a535ea6 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/transform/search/SearchTransformFactory.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/transform/search/SearchTransformFactory.java @@ -10,8 +10,8 @@ import org.elasticsearch.client.Client; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.script.ScriptService; import org.elasticsearch.xpack.core.watcher.transform.TransformFactory; import org.elasticsearch.xpack.watcher.support.search.WatcherSearchTemplateService; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/TransportAckWatchAction.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/TransportAckWatchAction.java index e887fd2384e61..82a4e8a389e88 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/TransportAckWatchAction.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/TransportAckWatchAction.java @@ -18,9 +18,9 @@ import org.elasticsearch.client.Client; import org.elasticsearch.cluster.routing.Preference; import org.elasticsearch.common.inject.Inject; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.transport.TransportService; @@ -41,7 +41,7 @@ import java.util.Arrays; import java.util.List; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.xpack.core.ClientHelper.WATCHER_ORIGIN; import static org.elasticsearch.xpack.core.ClientHelper.executeAsyncWithOrigin; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/TransportActivateWatchAction.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/TransportActivateWatchAction.java index c998063a5fcb9..8f41a6ba67622 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/TransportActivateWatchAction.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/TransportActivateWatchAction.java @@ -17,8 +17,8 @@ import org.elasticsearch.client.Client; import org.elasticsearch.cluster.routing.Preference; import org.elasticsearch.common.inject.Inject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.transport.TransportService; import org.elasticsearch.xpack.core.watcher.transport.actions.activate.ActivateWatchAction; @@ -35,7 +35,7 @@ import java.time.ZoneOffset; import java.time.ZonedDateTime; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.xpack.core.ClientHelper.WATCHER_ORIGIN; import static org.elasticsearch.xpack.core.ClientHelper.executeAsyncWithOrigin; import static org.elasticsearch.xpack.core.watcher.support.WatcherDateTimeUtils.writeDate; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/TransportExecuteWatchAction.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/TransportExecuteWatchAction.java index 702a060c98a8e..0479718965699 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/TransportExecuteWatchAction.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/TransportExecuteWatchAction.java @@ -17,9 +17,9 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.util.concurrent.AbstractRunnable; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.seqno.SequenceNumbers; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.threadpool.ThreadPool; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/TransportGetWatchAction.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/TransportGetWatchAction.java index a381c33fc7e3e..84b2c05d89b48 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/TransportGetWatchAction.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/TransportGetWatchAction.java @@ -14,8 +14,8 @@ import org.elasticsearch.cluster.routing.Preference; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.inject.Inject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.transport.TransportService; @@ -32,7 +32,7 @@ import java.time.ZoneOffset; import java.time.ZonedDateTime; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.xpack.core.ClientHelper.WATCHER_ORIGIN; import static org.elasticsearch.xpack.core.ClientHelper.executeAsyncWithOrigin; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/TransportPutWatchAction.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/TransportPutWatchAction.java index 5c458bde3c6f4..eea897a1352f4 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/TransportPutWatchAction.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/TransportPutWatchAction.java @@ -16,8 +16,8 @@ import org.elasticsearch.action.update.UpdateResponse; import org.elasticsearch.client.Client; import org.elasticsearch.common.inject.Inject; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.seqno.SequenceNumbers; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.protocol.xpack.watcher.PutWatchRequest; @@ -36,7 +36,7 @@ import java.time.ZonedDateTime; import java.util.Map; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.xpack.core.ClientHelper.WATCHER_ORIGIN; import static org.elasticsearch.xpack.core.ClientHelper.executeAsyncWithOrigin; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/TransportQueryWatchesAction.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/TransportQueryWatchesAction.java index adc470b445f0b..f122712e6fd34 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/TransportQueryWatchesAction.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/TransportQueryWatchesAction.java @@ -14,8 +14,8 @@ import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.client.Client; import org.elasticsearch.common.inject.Inject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.sort.FieldSortBuilder; @@ -36,7 +36,7 @@ import java.util.List; import java.util.stream.Collectors; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.xpack.core.ClientHelper.WATCHER_ORIGIN; import static org.elasticsearch.xpack.core.ClientHelper.executeAsyncWithOrigin; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/TriggerEngine.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/TriggerEngine.java index 7605e9057ca06..a94a8a262868a 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/TriggerEngine.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/TriggerEngine.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.watcher.trigger; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.watcher.trigger.Trigger; import org.elasticsearch.xpack.core.watcher.trigger.TriggerEvent; import org.elasticsearch.xpack.core.watcher.watch.Watch; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/TriggerService.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/TriggerService.java index b1d75d0b48479..eb0fd4b69828e 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/TriggerService.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/TriggerService.java @@ -8,7 +8,7 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.watcher.common.stats.Counters; import org.elasticsearch.xpack.core.watcher.trigger.Trigger; import org.elasticsearch.xpack.core.watcher.trigger.TriggerEvent; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/manual/ManualTrigger.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/manual/ManualTrigger.java index 4492d0f16961a..f9b0275e467b9 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/manual/ManualTrigger.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/manual/ManualTrigger.java @@ -7,8 +7,8 @@ package org.elasticsearch.xpack.watcher.trigger.manual; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.watcher.trigger.Trigger; import java.io.IOException; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/manual/ManualTriggerEngine.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/manual/ManualTriggerEngine.java index f673ac2da072a..c2d7328f82ec4 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/manual/ManualTriggerEngine.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/manual/ManualTriggerEngine.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.watcher.trigger.manual; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.watcher.trigger.TriggerEvent; import org.elasticsearch.xpack.core.watcher.watch.Watch; import org.elasticsearch.xpack.watcher.trigger.TriggerEngine; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/manual/ManualTriggerEvent.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/manual/ManualTriggerEvent.java index 1f79a066ad13b..76440d46517e5 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/manual/ManualTriggerEvent.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/manual/ManualTriggerEvent.java @@ -6,8 +6,8 @@ */ package org.elasticsearch.xpack.watcher.trigger.manual; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.watcher.trigger.TriggerEvent; import org.elasticsearch.xpack.watcher.trigger.TriggerService; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/CronSchedule.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/CronSchedule.java index b7d4248b25d9e..45974a4461705 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/CronSchedule.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/CronSchedule.java @@ -7,8 +7,8 @@ package org.elasticsearch.xpack.watcher.trigger.schedule; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/DailySchedule.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/DailySchedule.java index f653fff8446b0..1c746a43779d2 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/DailySchedule.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/DailySchedule.java @@ -7,9 +7,9 @@ package org.elasticsearch.xpack.watcher.trigger.schedule; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.watcher.trigger.schedule.support.DayTimes; import java.io.IOException; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/HourlySchedule.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/HourlySchedule.java index 50ad5ed4ecbdb..57e490d5cfae6 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/HourlySchedule.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/HourlySchedule.java @@ -7,10 +7,10 @@ package org.elasticsearch.xpack.watcher.trigger.schedule; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.util.CollectionUtils; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.watcher.trigger.schedule.support.DayTimes; import java.io.IOException; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/IntervalSchedule.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/IntervalSchedule.java index 83168dcfbd103..86cce192e9d7e 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/IntervalSchedule.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/IntervalSchedule.java @@ -7,9 +7,9 @@ package org.elasticsearch.xpack.watcher.trigger.schedule; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Locale; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/MonthlySchedule.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/MonthlySchedule.java index 1778cc16e30fd..6715146e558f7 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/MonthlySchedule.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/MonthlySchedule.java @@ -7,8 +7,8 @@ package org.elasticsearch.xpack.watcher.trigger.schedule; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.watcher.trigger.schedule.support.MonthTimes; import java.io.IOException; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/Schedule.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/Schedule.java index 598470d8eb787..61a5d83971ba9 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/Schedule.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/Schedule.java @@ -6,8 +6,8 @@ */ package org.elasticsearch.xpack.watcher.trigger.schedule; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.scheduler.SchedulerEngine; import java.io.IOException; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/ScheduleRegistry.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/ScheduleRegistry.java index bf44904dcd6eb..6689127fd33ec 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/ScheduleRegistry.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/ScheduleRegistry.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.watcher.trigger.schedule; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.HashMap; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/ScheduleTrigger.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/ScheduleTrigger.java index 8092dd54a1d87..4a67841e6c88e 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/ScheduleTrigger.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/ScheduleTrigger.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.watcher.trigger.schedule; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.watcher.trigger.Trigger; import java.io.IOException; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/ScheduleTriggerEngine.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/ScheduleTriggerEngine.java index 0fc4034e10ae9..9d4000152989f 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/ScheduleTriggerEngine.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/ScheduleTriggerEngine.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.watcher.trigger.schedule; import org.elasticsearch.core.Nullable; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.watcher.support.WatcherDateTimeUtils; import org.elasticsearch.xpack.core.watcher.trigger.TriggerEvent; import org.elasticsearch.xpack.watcher.trigger.TriggerEngine; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/ScheduleTriggerEvent.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/ScheduleTriggerEvent.java index b2f552611b599..b7e20fca27aa3 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/ScheduleTriggerEvent.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/ScheduleTriggerEvent.java @@ -7,9 +7,9 @@ package org.elasticsearch.xpack.watcher.trigger.schedule; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.watcher.support.WatcherDateTimeUtils; import org.elasticsearch.xpack.core.watcher.trigger.TriggerEvent; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/WeeklySchedule.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/WeeklySchedule.java index b41c0218a165c..47bafdf31d672 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/WeeklySchedule.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/WeeklySchedule.java @@ -7,8 +7,8 @@ package org.elasticsearch.xpack.watcher.trigger.schedule; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.watcher.trigger.schedule.support.WeekTimes; import java.io.IOException; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/YearlySchedule.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/YearlySchedule.java index 7fe0e2adce7ec..672e4e751142e 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/YearlySchedule.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/YearlySchedule.java @@ -7,8 +7,8 @@ package org.elasticsearch.xpack.watcher.trigger.schedule; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.watcher.trigger.schedule.support.YearTimes; import java.io.IOException; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/support/DayTimes.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/support/DayTimes.java index 459789a12a99e..2bc86a8ae1064 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/support/DayTimes.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/support/DayTimes.java @@ -8,8 +8,8 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.util.CollectionUtils; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.ArrayList; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/support/MonthTimes.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/support/MonthTimes.java index 298408fc0b652..02ec4bf2e4047 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/support/MonthTimes.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/support/MonthTimes.java @@ -9,8 +9,8 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.util.CollectionUtils; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Arrays; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/support/Times.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/support/Times.java index debde2d2f9846..f14d8d8d80cba 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/support/Times.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/support/Times.java @@ -6,8 +6,8 @@ */ package org.elasticsearch.xpack.watcher.trigger.schedule.support; -import org.elasticsearch.common.xcontent.ParseField; -import org.elasticsearch.common.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.xcontent.ToXContentObject; public interface Times extends ToXContentObject { diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/support/WeekTimes.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/support/WeekTimes.java index 27aaccfe15377..fa7cf3ea367f0 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/support/WeekTimes.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/support/WeekTimes.java @@ -7,8 +7,8 @@ package org.elasticsearch.xpack.watcher.trigger.schedule.support; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Arrays; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/support/YearTimes.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/support/YearTimes.java index 6d89c253f6562..6008889b4a9f0 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/support/YearTimes.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/trigger/schedule/support/YearTimes.java @@ -9,8 +9,8 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.util.CollectionUtils; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import java.io.IOException; import java.util.Arrays; diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/watch/WatchParser.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/watch/WatchParser.java index 31cbc2d94e0d7..44074861f8e67 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/watch/WatchParser.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/watch/WatchParser.java @@ -13,9 +13,9 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.watcher.actions.ActionRegistry; import org.elasticsearch.xpack.core.watcher.actions.ActionStatus; import org.elasticsearch.xpack.core.watcher.actions.ActionWrapper; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/WatcherInfoTransportActionTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/WatcherInfoTransportActionTests.java index d7043fc71ba7a..1afc70127d405 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/WatcherInfoTransportActionTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/WatcherInfoTransportActionTests.java @@ -17,9 +17,9 @@ import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.ObjectPath; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ObjectPath; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.license.MockLicenseState; import org.elasticsearch.tasks.Task; import org.elasticsearch.test.ESTestCase; @@ -41,7 +41,7 @@ import java.util.Collections; import java.util.List; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.containsInAnyOrder; import static org.hamcrest.Matchers.instanceOf; import static org.hamcrest.core.Is.is; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/WatcherMetadataSerializationTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/WatcherMetadataSerializationTests.java index e73c714e3a315..41a5c7e28d42d 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/WatcherMetadataSerializationTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/WatcherMetadataSerializationTests.java @@ -11,11 +11,11 @@ import org.elasticsearch.cluster.metadata.RepositoriesMetadata; import org.elasticsearch.cluster.metadata.RepositoryMetadata; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.XPackClientPlugin; import org.elasticsearch.xpack.core.watcher.WatcherMetadata; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/WatcherServiceTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/WatcherServiceTests.java index 82b1e86b709ce..cdbe141a683bc 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/WatcherServiceTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/WatcherServiceTests.java @@ -39,7 +39,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.EsExecutors; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.Index; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.search.SearchHit; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/ActionWrapperTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/ActionWrapperTests.java index 7065b73fccf6d..a7d87ff6f70c8 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/ActionWrapperTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/ActionWrapperTests.java @@ -7,10 +7,10 @@ package org.elasticsearch.xpack.watcher.actions; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.watcher.actions.Action; import org.elasticsearch.xpack.core.watcher.actions.ActionStatus; @@ -40,7 +40,7 @@ import java.util.List; import java.util.Map; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.hasKey; import static org.hamcrest.Matchers.hasSize; import static org.hamcrest.Matchers.instanceOf; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/email/EmailActionTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/email/EmailActionTests.java index 5783aa6cdb38c..c7491c1f747c0 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/email/EmailActionTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/email/EmailActionTests.java @@ -14,11 +14,11 @@ import org.elasticsearch.common.io.Streams; import org.elasticsearch.common.settings.ClusterSettings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.ssl.SSLService; import org.elasticsearch.xpack.core.watcher.actions.Action; @@ -63,7 +63,7 @@ import static java.util.Collections.emptyMap; import static java.util.Collections.singletonMap; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.xpack.watcher.test.WatcherTestUtils.mockExecutionContextBuilder; import static org.hamcrest.Matchers.arrayContainingInAnyOrder; import static org.hamcrest.Matchers.containsString; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/index/IndexActionTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/index/IndexActionTests.java index ec92e60ef956f..4966fb0a61713 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/index/IndexActionTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/index/IndexActionTests.java @@ -22,8 +22,8 @@ import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.Maps; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.Index; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.test.ESTestCase; @@ -51,7 +51,7 @@ import static java.util.Map.entry; import static org.elasticsearch.action.support.WriteRequest.RefreshPolicy; import static org.elasticsearch.common.util.set.Sets.newHashSet; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasEntry; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/jira/JiraActionFactoryTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/jira/JiraActionFactoryTests.java index 7558c44d8c226..6d0139420db1a 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/jira/JiraActionFactoryTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/jira/JiraActionFactoryTests.java @@ -6,14 +6,14 @@ */ package org.elasticsearch.xpack.watcher.actions.jira; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.watcher.notification.jira.JiraAccount; import org.elasticsearch.xpack.watcher.notification.jira.JiraService; import org.junit.Before; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.xpack.watcher.notification.jira.JiraAccountTests.randomIssueDefaults; import static org.elasticsearch.xpack.watcher.actions.ActionBuilders.jiraAction; import static org.hamcrest.Matchers.equalTo; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/jira/JiraActionTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/jira/JiraActionTests.java index 72706a2903824..91d837d6df77d 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/jira/JiraActionTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/jira/JiraActionTests.java @@ -12,10 +12,10 @@ import org.elasticsearch.common.settings.MockSecureSettings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.Maps; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.script.ScriptService; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.watcher.actions.Action; @@ -43,10 +43,10 @@ import static java.util.Collections.emptyMap; import static java.util.Collections.singletonMap; import static java.util.Map.entry; -import static org.elasticsearch.common.xcontent.XContentFactory.cborBuilder; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; -import static org.elasticsearch.common.xcontent.XContentFactory.smileBuilder; -import static org.elasticsearch.common.xcontent.XContentFactory.yamlBuilder; +import static org.elasticsearch.xcontent.XContentFactory.cborBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.smileBuilder; +import static org.elasticsearch.xcontent.XContentFactory.yamlBuilder; import static org.elasticsearch.xpack.watcher.test.WatcherTestUtils.mockExecutionContextBuilder; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.instanceOf; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/logging/LoggingActionTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/logging/LoggingActionTests.java index 0e741a10b8ca9..8815cb81debf2 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/logging/LoggingActionTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/logging/LoggingActionTests.java @@ -9,8 +9,8 @@ import org.apache.logging.log4j.Logger; import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.SuppressLoggerChecks; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.watcher.actions.Action; import org.elasticsearch.xpack.core.watcher.execution.WatchExecutionContext; @@ -29,7 +29,7 @@ import static java.util.Collections.emptyMap; import static java.util.Collections.singletonMap; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.xpack.watcher.actions.ActionBuilders.loggingAction; import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.CoreMatchers.notNullValue; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/pagerduty/PagerDutyActionFactoryTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/pagerduty/PagerDutyActionFactoryTests.java index 59faad745d415..cec665a41a1d4 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/pagerduty/PagerDutyActionFactoryTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/pagerduty/PagerDutyActionFactoryTests.java @@ -8,8 +8,8 @@ import org.elasticsearch.common.settings.ClusterSettings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.watcher.common.text.TextTemplateEngine; import org.elasticsearch.xpack.watcher.notification.pagerduty.PagerDutyAccount; @@ -18,7 +18,7 @@ import java.util.HashSet; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.xpack.watcher.actions.ActionBuilders.triggerPagerDutyAction; import static org.hamcrest.Matchers.is; import static org.mockito.Mockito.mock; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/pagerduty/PagerDutyActionTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/pagerduty/PagerDutyActionTests.java index 2f01e1dd06e30..b842b514d8f90 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/pagerduty/PagerDutyActionTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/pagerduty/PagerDutyActionTests.java @@ -10,10 +10,10 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.collect.MapBuilder; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.watcher.actions.Action; import org.elasticsearch.xpack.core.watcher.execution.WatchExecutionContext; @@ -38,7 +38,7 @@ import java.util.HashMap; import java.util.Map; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.xpack.watcher.actions.ActionBuilders.pagerDutyAction; import static org.elasticsearch.xpack.watcher.test.WatcherTestUtils.mockExecutionContextBuilder; import static org.hamcrest.Matchers.equalTo; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/slack/SlackActionFactoryTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/slack/SlackActionFactoryTests.java index 218ec36111464..76c16c7a4ef07 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/slack/SlackActionFactoryTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/slack/SlackActionFactoryTests.java @@ -8,8 +8,8 @@ import org.elasticsearch.common.settings.ClusterSettings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.watcher.common.text.TextTemplateEngine; import org.elasticsearch.xpack.watcher.notification.slack.SlackAccount; @@ -18,7 +18,7 @@ import java.util.HashSet; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.xpack.watcher.notification.slack.message.SlackMessageTests.createRandomTemplate; import static org.elasticsearch.xpack.watcher.actions.ActionBuilders.slackAction; import static org.hamcrest.Matchers.is; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/slack/SlackActionTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/slack/SlackActionTests.java index 8abcbebd9d852..307e9ca5ec2bb 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/slack/SlackActionTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/slack/SlackActionTests.java @@ -9,10 +9,10 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.collect.MapBuilder; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.watcher.actions.Action; import org.elasticsearch.xpack.core.watcher.execution.WatchExecutionContext; @@ -39,7 +39,7 @@ import static java.util.Collections.emptyMap; import static java.util.Collections.singletonMap; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.xpack.watcher.test.WatcherTestUtils.mockExecutionContextBuilder; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.instanceOf; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/webhook/WebhookActionTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/webhook/WebhookActionTests.java index 0a03e49df916f..b9e4c325fca84 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/webhook/WebhookActionTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/actions/webhook/WebhookActionTests.java @@ -9,9 +9,9 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.client.Client; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.env.Environment; import org.elasticsearch.env.TestEnvironment; import org.elasticsearch.test.ESTestCase; @@ -48,7 +48,7 @@ import java.util.Map; import static org.elasticsearch.core.TimeValue.timeValueSeconds; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.xpack.watcher.common.http.HttpClientTests.mockClusterService; import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.CoreMatchers.notNullValue; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/common/http/HttpClientTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/common/http/HttpClientTests.java index 624ca59831f5c..529e8abce1b5b 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/common/http/HttpClientTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/common/http/HttpClientTests.java @@ -25,7 +25,7 @@ import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.env.Environment; import org.elasticsearch.env.TestEnvironment; import org.elasticsearch.mocksocket.MockServerSocket; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/common/http/HttpProxyTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/common/http/HttpProxyTests.java index 458f9f5e44e28..928001e0ce514 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/common/http/HttpProxyTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/common/http/HttpProxyTests.java @@ -9,16 +9,16 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.nullValue; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/common/http/HttpRequestTemplateTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/common/http/HttpRequestTemplateTests.java index eae417edf464e..02f58c004fe01 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/common/http/HttpRequestTemplateTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/common/http/HttpRequestTemplateTests.java @@ -9,10 +9,10 @@ import io.netty.handler.codec.http.HttpHeaders; import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.watcher.support.xcontent.WatcherParams; import org.elasticsearch.xpack.watcher.common.text.TextTemplate; @@ -21,7 +21,7 @@ import java.util.Collections; import static java.util.Collections.emptyMap; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasEntry; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/common/http/HttpRequestTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/common/http/HttpRequestTests.java index 827d081c97297..3bb571b281b82 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/common/http/HttpRequestTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/common/http/HttpRequestTests.java @@ -9,16 +9,16 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.Strings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.watcher.support.xcontent.WatcherParams; import org.elasticsearch.xpack.core.watcher.support.xcontent.WatcherXContentParser; -import static org.elasticsearch.common.xcontent.XContentFactory.cborBuilder; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; -import static org.elasticsearch.common.xcontent.XContentFactory.smileBuilder; -import static org.elasticsearch.common.xcontent.XContentFactory.yamlBuilder; +import static org.elasticsearch.xcontent.XContentFactory.cborBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.smileBuilder; +import static org.elasticsearch.xcontent.XContentFactory.yamlBuilder; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.not; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/common/http/HttpResponseTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/common/http/HttpResponseTests.java index 654f5c3f94cd7..9f858a4aee53d 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/common/http/HttpResponseTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/common/http/HttpResponseTests.java @@ -8,9 +8,9 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.ESTestCase; import java.nio.charset.StandardCharsets; @@ -20,7 +20,7 @@ import static java.util.Collections.emptyMap; import static java.util.Collections.singletonMap; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.CoreMatchers.nullValue; import static org.hamcrest.Matchers.arrayContaining; import static org.hamcrest.Matchers.hasEntry; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/common/text/TextTemplateTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/common/text/TextTemplateTests.java index 184f09820412c..84d82579baf5d 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/common/text/TextTemplateTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/common/text/TextTemplateTests.java @@ -7,10 +7,10 @@ package org.elasticsearch.xpack.watcher.common.text; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.script.Script; import org.elasticsearch.script.ScriptService; import org.elasticsearch.script.ScriptType; @@ -26,7 +26,7 @@ import static java.util.Collections.singletonMap; import static java.util.Collections.unmodifiableMap; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/condition/AlwaysConditionTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/condition/AlwaysConditionTests.java index 96d912f4185b2..484ad45ddff27 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/condition/AlwaysConditionTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/condition/AlwaysConditionTests.java @@ -7,8 +7,8 @@ package org.elasticsearch.xpack.watcher.condition; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.script.Script; import org.elasticsearch.script.ScriptService; import org.elasticsearch.test.ESTestCase; @@ -16,7 +16,7 @@ import java.time.Clock; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.containsString; public class AlwaysConditionTests extends ESTestCase { diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/condition/ArrayCompareConditionTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/condition/ArrayCompareConditionTests.java index 925a663fa0b65..e96db300eba19 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/condition/ArrayCompareConditionTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/condition/ArrayCompareConditionTests.java @@ -8,9 +8,9 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.watcher.execution.WatchExecutionContext; import org.elasticsearch.xpack.core.watcher.watch.ClockMock; @@ -28,7 +28,7 @@ import java.util.List; import java.util.Map; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.xpack.watcher.test.WatcherTestUtils.mockExecutionContext; import static org.hamcrest.CoreMatchers.notNullValue; import static org.hamcrest.Matchers.is; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/condition/CompareConditionTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/condition/CompareConditionTests.java index 12ee58c67a3bc..4c58291c03c68 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/condition/CompareConditionTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/condition/CompareConditionTests.java @@ -8,9 +8,9 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.watcher.execution.WatchExecutionContext; import org.elasticsearch.xpack.core.watcher.watch.ClockMock; @@ -24,7 +24,7 @@ import java.util.Locale; import static java.util.Collections.singletonMap; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.xpack.watcher.test.WatcherTestUtils.mockExecutionContext; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.is; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/condition/NeverConditionTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/condition/NeverConditionTests.java index 5c24565fdec1b..84cb250779421 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/condition/NeverConditionTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/condition/NeverConditionTests.java @@ -7,12 +7,12 @@ package org.elasticsearch.xpack.watcher.condition; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.watcher.condition.ExecutableCondition; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.containsString; public class NeverConditionTests extends ESTestCase { diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/condition/ScriptConditionTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/condition/ScriptConditionTests.java index 39bdfd1eaa9b8..bceac4c6c40df 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/condition/ScriptConditionTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/condition/ScriptConditionTests.java @@ -15,10 +15,10 @@ import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.metadata.Metadata; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.script.GeneralScriptException; import org.elasticsearch.script.Script; @@ -44,7 +44,7 @@ import static java.util.Collections.emptyList; import static java.util.Collections.singletonMap; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.xpack.core.watcher.support.Exceptions.illegalArgument; import static org.elasticsearch.xpack.watcher.test.WatcherTestUtils.mockExecutionContext; import static org.hamcrest.Matchers.containsString; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/execution/ExecutionServiceTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/execution/ExecutionServiceTests.java index 0d99b3ee39c5b..3621dcc61317d 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/execution/ExecutionServiceTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/execution/ExecutionServiceTests.java @@ -27,12 +27,12 @@ import org.elasticsearch.common.util.concurrent.EsExecutors; import org.elasticsearch.common.util.concurrent.EsRejectedExecutionException; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ObjectPath; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ObjectPath; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.Index; import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.index.engine.VersionConflictEngineException; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/execution/TriggeredWatchStoreTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/execution/TriggeredWatchStoreTests.java index eba88240091d0..f88b167835297 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/execution/TriggeredWatchStoreTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/execution/TriggeredWatchStoreTests.java @@ -42,9 +42,9 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.index.Index; import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.index.shard.ShardId; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/input/InputRegistryTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/input/InputRegistryTests.java index 393884021b273..1d9930f149906 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/input/InputRegistryTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/input/InputRegistryTests.java @@ -7,11 +7,11 @@ package org.elasticsearch.xpack.watcher.input; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.ESTestCase; import static java.util.Collections.emptyMap; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.containsString; public class InputRegistryTests extends ESTestCase { diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/input/chain/ChainInputTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/input/chain/ChainInputTests.java index 497e0743a975f..d7a6db8260343 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/input/chain/ChainInputTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/input/chain/ChainInputTests.java @@ -11,11 +11,11 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.core.Tuple; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.SecuritySettingsSourceField; import org.elasticsearch.xpack.core.watcher.execution.WatchExecutionContext; @@ -35,7 +35,7 @@ import java.util.HashMap; import java.util.Map; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.xpack.watcher.actions.ActionBuilders.loggingAction; import static org.elasticsearch.xpack.watcher.client.WatchSourceBuilders.watchBuilder; import static org.elasticsearch.xpack.watcher.input.InputBuilders.chainInput; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/input/chain/ExecutableChainInputTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/input/chain/ExecutableChainInputTests.java index 406a4b7d977a2..5907a93cee918 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/input/chain/ExecutableChainInputTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/input/chain/ExecutableChainInputTests.java @@ -8,7 +8,7 @@ import org.elasticsearch.core.Nullable; import org.elasticsearch.core.Tuple; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.watcher.execution.WatchExecutionContext; import org.elasticsearch.xpack.core.watcher.execution.Wid; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/input/http/HttpInputTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/input/http/HttpInputTests.java index 6b25dd2f2d134..9f2a648b11b79 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/input/http/HttpInputTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/input/http/HttpInputTests.java @@ -11,14 +11,14 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.collect.MapBuilder; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ObjectPath; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ObjectPath; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.watcher.execution.WatchExecutionContext; import org.elasticsearch.xpack.core.watcher.support.xcontent.WatcherParams; @@ -47,7 +47,7 @@ import java.util.Map; import static java.util.Collections.singletonMap; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasEntry; import static org.hamcrest.Matchers.hasKey; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/input/simple/SimpleInputTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/input/simple/SimpleInputTests.java index 0cec36328ddd0..b19df1f6e5cd1 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/input/simple/SimpleInputTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/input/simple/SimpleInputTests.java @@ -7,8 +7,8 @@ package org.elasticsearch.xpack.watcher.input.simple; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.watcher.input.ExecutableInput; import org.elasticsearch.xpack.core.watcher.input.Input; @@ -20,7 +20,7 @@ import java.util.List; import java.util.Map; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.containsString; public class SimpleInputTests extends ESTestCase { diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/input/transform/TransformInputTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/input/transform/TransformInputTests.java index d4f9ca8c10c58..a23219c7685d4 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/input/transform/TransformInputTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/input/transform/TransformInputTests.java @@ -8,9 +8,9 @@ import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.script.MockScriptEngine; import org.elasticsearch.script.Script; import org.elasticsearch.script.ScriptService; @@ -34,7 +34,7 @@ import java.util.Collections; import java.util.Map; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.hasEntry; import static org.hamcrest.Matchers.is; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/notification/email/EmailTemplateTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/notification/email/EmailTemplateTests.java index d888082596033..8e5b55eae76c9 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/notification/email/EmailTemplateTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/notification/email/EmailTemplateTests.java @@ -7,10 +7,10 @@ package org.elasticsearch.xpack.watcher.notification.email; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.watcher.common.text.TextTemplate; import org.elasticsearch.xpack.watcher.test.MockTextTemplateEngine; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/notification/email/EmailTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/notification/email/EmailTests.java index 3387b25665fd8..144131bedcf25 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/notification/email/EmailTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/notification/email/EmailTests.java @@ -6,10 +6,10 @@ */ package org.elasticsearch.xpack.watcher.notification.email; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.ESTestCase; import java.time.Instant; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/notification/email/attachment/DataAttachmentParserTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/notification/email/attachment/DataAttachmentParserTests.java index b588159c6b101..66e766f6db12e 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/notification/email/attachment/DataAttachmentParserTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/notification/email/attachment/DataAttachmentParserTests.java @@ -8,10 +8,10 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.ESTestCase; import java.util.ArrayList; @@ -19,7 +19,7 @@ import java.util.List; import java.util.Map; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.hasSize; import static org.hamcrest.core.Is.is; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/notification/email/attachment/EmailAttachmentParsersTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/notification/email/attachment/EmailAttachmentParsersTests.java index 5aa067b46d031..04ddd89d7f32a 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/notification/email/attachment/EmailAttachmentParsersTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/notification/email/attachment/EmailAttachmentParsersTests.java @@ -7,11 +7,11 @@ package org.elasticsearch.xpack.watcher.notification.email.attachment; import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.watcher.execution.WatchExecutionContext; import org.elasticsearch.xpack.core.watcher.watch.Payload; @@ -28,7 +28,7 @@ import java.util.List; import java.util.Map; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.hasSize; import static org.hamcrest.Matchers.instanceOf; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/notification/email/attachment/HttpEmailAttachementParserTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/notification/email/attachment/HttpEmailAttachementParserTests.java index 9ffa99d78a749..e38b5374c2ea2 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/notification/email/attachment/HttpEmailAttachementParserTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/notification/email/attachment/HttpEmailAttachementParserTests.java @@ -9,9 +9,9 @@ import org.elasticsearch.ElasticsearchException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.collect.MapBuilder; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.watcher.execution.WatchExecutionContext; import org.elasticsearch.xpack.core.watcher.execution.Wid; @@ -33,7 +33,7 @@ import java.util.Map; import static java.nio.charset.StandardCharsets.UTF_8; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.xpack.watcher.test.WatcherTestUtils.mockExecutionContextBuilder; import static org.hamcrest.Matchers.hasSize; import static org.hamcrest.core.Is.is; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/notification/email/attachment/ReportingAttachmentParserTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/notification/email/attachment/ReportingAttachmentParserTests.java index 78dd1f142deee..e82402f84ace6 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/notification/email/attachment/ReportingAttachmentParserTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/notification/email/attachment/ReportingAttachmentParserTests.java @@ -13,9 +13,9 @@ import org.elasticsearch.common.settings.ClusterSettings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParseException; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.watcher.execution.WatchExecutionContext; import org.elasticsearch.xpack.core.watcher.execution.Wid; @@ -49,7 +49,7 @@ import java.util.Set; import java.util.stream.Collectors; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.xpack.watcher.notification.email.attachment.ReportingAttachmentParser.INTERVAL_SETTING; import static org.elasticsearch.xpack.watcher.notification.email.attachment.ReportingAttachmentParser.REPORT_WARNING_ENABLED_SETTING; import static org.elasticsearch.xpack.watcher.notification.email.attachment.ReportingAttachmentParser.REPORT_WARNING_TEXT; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/notification/jira/JiraIssueTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/notification/jira/JiraIssueTests.java index f8e53ed126264..e794cba6805ad 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/notification/jira/JiraIssueTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/notification/jira/JiraIssueTests.java @@ -8,8 +8,8 @@ import org.apache.http.HttpStatus; import org.elasticsearch.core.Tuple; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.watcher.support.xcontent.WatcherParams; import org.elasticsearch.xpack.watcher.common.http.HttpMethod; @@ -20,10 +20,10 @@ import java.util.HashMap; import java.util.Map; -import static org.elasticsearch.common.xcontent.XContentFactory.cborBuilder; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; -import static org.elasticsearch.common.xcontent.XContentFactory.smileBuilder; -import static org.elasticsearch.common.xcontent.XContentFactory.yamlBuilder; +import static org.elasticsearch.xcontent.XContentFactory.cborBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.smileBuilder; +import static org.elasticsearch.xcontent.XContentFactory.yamlBuilder; import static org.elasticsearch.xpack.watcher.notification.jira.JiraAccountTests.randomHttpError; import static org.elasticsearch.xpack.watcher.notification.jira.JiraAccountTests.randomIssueDefaults; import static org.elasticsearch.xpack.watcher.notification.jira.JiraIssue.resolveFailureReason; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/notification/pagerduty/IncidentEventTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/notification/pagerduty/IncidentEventTests.java index a37a05d317859..97d9b44ee6327 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/notification/pagerduty/IncidentEventTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/notification/pagerduty/IncidentEventTests.java @@ -7,9 +7,9 @@ package org.elasticsearch.xpack.watcher.notification.pagerduty; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.rest.yaml.ObjectPath; import org.elasticsearch.xpack.core.watcher.watch.Payload; @@ -21,7 +21,7 @@ import java.util.List; import java.util.Map; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.equalTo; public class IncidentEventTests extends ESTestCase { diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/notification/pagerduty/PagerDutyAccountsTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/notification/pagerduty/PagerDutyAccountsTests.java index 23f3f67423baa..8d697c66d6fe9 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/notification/pagerduty/PagerDutyAccountsTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/notification/pagerduty/PagerDutyAccountsTests.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.settings.ClusterSettings; import org.elasticsearch.common.settings.MockSecureSettings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.rest.yaml.ObjectPath; import org.elasticsearch.xpack.core.watcher.watch.Payload; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/notification/pagerduty/SentEventTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/notification/pagerduty/SentEventTests.java index e099297370bcc..765350a1e3e85 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/notification/pagerduty/SentEventTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/notification/pagerduty/SentEventTests.java @@ -7,17 +7,17 @@ package org.elasticsearch.xpack.watcher.notification.pagerduty; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.watcher.support.xcontent.WatcherParams; import org.elasticsearch.xpack.watcher.common.http.HttpRequest; import org.elasticsearch.xpack.watcher.common.http.HttpResponse; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.not; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/notification/slack/message/SlackMessageTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/notification/slack/message/SlackMessageTests.java index 8f9f42ae067de..3622d4285664b 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/notification/slack/message/SlackMessageTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/notification/slack/message/SlackMessageTests.java @@ -8,11 +8,11 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.watcher.support.xcontent.WatcherParams; import org.elasticsearch.xpack.watcher.common.http.HttpRequest; @@ -28,7 +28,7 @@ import java.util.Collections; import java.util.List; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.CoreMatchers.notNullValue; import static org.hamcrest.CoreMatchers.nullValue; import static org.hamcrest.Matchers.arrayContaining; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/rest/action/RestExecuteWatchActionTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/rest/action/RestExecuteWatchActionTests.java index 0b4d92be35ee4..44f5f9bd10921 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/rest/action/RestExecuteWatchActionTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/rest/action/RestExecuteWatchActionTests.java @@ -8,8 +8,8 @@ import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.common.bytes.BytesArray; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.rest.FakeRestRequest; import org.elasticsearch.test.rest.FakeRestRequest.Builder; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/support/FilterXContentTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/support/FilterXContentTests.java index 0b7d9d23e9582..e1b2ecf332425 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/support/FilterXContentTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/support/FilterXContentTests.java @@ -7,10 +7,10 @@ package org.elasticsearch.xpack.watcher.support; import org.elasticsearch.common.collect.MapBuilder; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.common.xcontent.ObjectPath; +import org.elasticsearch.xcontent.ObjectPath; import org.hamcrest.Matchers; import java.io.IOException; @@ -21,7 +21,7 @@ import java.util.Map; import java.util.Set; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.containsInAnyOrder; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasSize; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/support/VariablesTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/support/VariablesTests.java index b56b3b1c1f0d0..124386bed6e74 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/support/VariablesTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/support/VariablesTests.java @@ -6,7 +6,7 @@ */ package org.elasticsearch.xpack.watcher.support; -import org.elasticsearch.common.xcontent.ObjectPath; +import org.elasticsearch.xcontent.ObjectPath; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.watcher.execution.WatchExecutionContext; import org.elasticsearch.xpack.core.watcher.execution.Wid; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/support/WatcherDateTimeUtilsTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/support/WatcherDateTimeUtilsTests.java index e6be74f36dac1..3fe0966fea62f 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/support/WatcherDateTimeUtilsTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/support/WatcherDateTimeUtilsTests.java @@ -9,8 +9,8 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.watcher.support.WatcherDateTimeUtils; @@ -23,7 +23,7 @@ import static java.util.concurrent.TimeUnit.MILLISECONDS; import static java.util.concurrent.TimeUnit.MINUTES; import static java.util.concurrent.TimeUnit.SECONDS; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.xpack.core.watcher.support.WatcherDateTimeUtils.parseTimeValueSupportingFractional; import static org.hamcrest.CoreMatchers.nullValue; import static org.hamcrest.Matchers.either; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/support/WatcherIndexTemplateRegistryTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/support/WatcherIndexTemplateRegistryTests.java index 5170099171faa..3902ab399adff 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/support/WatcherIndexTemplateRegistryTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/support/WatcherIndexTemplateRegistryTests.java @@ -25,15 +25,15 @@ import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.node.DiscoveryNodes; import org.elasticsearch.cluster.service.ClusterService; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.collect.ImmutableOpenMap; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.EsExecutors; import org.elasticsearch.common.util.concurrent.ThreadContext; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.xpack.core.ilm.DeleteAction; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/support/WatcherTemplateTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/support/WatcherTemplateTests.java index cfa478ad06298..586157fff6d88 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/support/WatcherTemplateTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/support/WatcherTemplateTests.java @@ -9,7 +9,7 @@ import com.fasterxml.jackson.core.io.JsonStringEncoder; import org.elasticsearch.core.Nullable; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.script.ScriptContext; import org.elasticsearch.script.ScriptEngine; import org.elasticsearch.script.ScriptService; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/support/WatcherUtilsTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/support/WatcherUtilsTests.java index c1bebb13f39ca..54f907162959f 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/support/WatcherUtilsTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/support/WatcherUtilsTests.java @@ -12,12 +12,12 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.script.Script; import org.elasticsearch.script.ScriptType; @@ -34,7 +34,7 @@ import java.util.Map; import static java.util.Collections.singletonMap; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.xpack.core.watcher.support.WatcherDateTimeUtils.formatDate; import static org.elasticsearch.xpack.core.watcher.support.WatcherUtils.flattenModel; import static org.elasticsearch.xpack.watcher.input.search.ExecutableSearchInput.DEFAULT_SEARCH_TYPE; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/support/search/WatcherSearchTemplateRequestTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/support/search/WatcherSearchTemplateRequestTests.java index 1e5fc76c5a15c..e331a99caa9d3 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/support/search/WatcherSearchTemplateRequestTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/support/search/WatcherSearchTemplateRequestTests.java @@ -7,8 +7,8 @@ package org.elasticsearch.xpack.watcher.support.search; import org.elasticsearch.action.search.SearchType; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/support/xcontent/XContentSourceTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/support/xcontent/XContentSourceTests.java index 6652c153f6b8b..765d5226e99b0 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/support/xcontent/XContentSourceTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/support/xcontent/XContentSourceTests.java @@ -8,15 +8,15 @@ import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.watcher.support.xcontent.XContentSource; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; -import static org.elasticsearch.common.xcontent.XContentFactory.smileBuilder; -import static org.elasticsearch.common.xcontent.XContentFactory.yamlBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.smileBuilder; +import static org.elasticsearch.xcontent.XContentFactory.yamlBuilder; public class XContentSourceTests extends ESTestCase { public void testToXContent() throws Exception { diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/WatcherTestUtils.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/WatcherTestUtils.java index 20fceeb3e4b43..735031cf65346 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/WatcherTestUtils.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/WatcherTestUtils.java @@ -12,9 +12,9 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.search.builder.SearchSourceBuilder; @@ -70,7 +70,7 @@ import java.util.Map; import static java.util.Collections.emptyMap; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery; import static org.elasticsearch.search.builder.SearchSourceBuilder.searchSource; import static org.elasticsearch.test.ESTestCase.randomFrom; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/bench/WatcherExecutorServiceBenchmark.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/bench/WatcherExecutorServiceBenchmark.java index 8d4adb1f1d1b1..384735b9874ef 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/bench/WatcherExecutorServiceBenchmark.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/bench/WatcherExecutorServiceBenchmark.java @@ -9,7 +9,7 @@ import org.apache.logging.log4j.LogManager; import org.elasticsearch.client.Client; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.node.MockNode; import org.elasticsearch.node.Node; import org.elasticsearch.protocol.xpack.watcher.PutWatchRequest; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/bench/WatcherScheduleEngineBenchmark.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/bench/WatcherScheduleEngineBenchmark.java index 2e860ba5764f4..64902a520f6e0 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/bench/WatcherScheduleEngineBenchmark.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/bench/WatcherScheduleEngineBenchmark.java @@ -16,7 +16,7 @@ import org.elasticsearch.common.metrics.MeanMetric; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.monitor.jvm.JvmInfo; import org.elasticsearch.node.InternalSettingsPreparer; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/integration/SearchInputTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/integration/SearchInputTests.java index 60b8ce8d65b23..a41dd6ff70665 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/integration/SearchInputTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/integration/SearchInputTests.java @@ -17,13 +17,13 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.script.MockMustacheScriptEngine; import org.elasticsearch.script.ScriptContext; import org.elasticsearch.script.ScriptEngine; @@ -51,7 +51,7 @@ import java.util.HashMap; import java.util.Map; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.index.query.QueryBuilders.boolQuery; import static org.elasticsearch.index.query.QueryBuilders.matchQuery; import static org.elasticsearch.index.query.QueryBuilders.rangeQuery; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/integration/SearchTransformTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/integration/SearchTransformTests.java index ef68f26c598b8..b6a501902be36 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/integration/SearchTransformTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/integration/SearchTransformTests.java @@ -10,8 +10,8 @@ import org.elasticsearch.client.Client; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.script.MockScriptEngine; import org.elasticsearch.script.Script; import org.elasticsearch.script.ScriptEngine; @@ -27,7 +27,7 @@ import java.util.Collections; import java.util.Map; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.xpack.watcher.test.WatcherTestUtils.getRandomSupportedSearchType; import static org.hamcrest.Matchers.arrayContainingInAnyOrder; import static org.hamcrest.Matchers.equalTo; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/transform/chain/ChainTransformTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/transform/chain/ChainTransformTests.java index 969a5050e77d7..764d4641df61f 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/transform/chain/ChainTransformTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/transform/chain/ChainTransformTests.java @@ -9,9 +9,9 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.watcher.execution.WatchExecutionContext; import org.elasticsearch.xpack.core.watcher.transform.ExecutableTransform; @@ -30,7 +30,7 @@ import java.util.Map; import static java.util.Collections.singletonMap; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.hasKey; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/transform/script/ScriptTransformTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/transform/script/ScriptTransformTests.java index f33d03cb18c2e..8f1a74c9af980 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/transform/script/ScriptTransformTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/transform/script/ScriptTransformTests.java @@ -7,8 +7,8 @@ package org.elasticsearch.xpack.watcher.transform.script; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.script.Script; import org.elasticsearch.script.ScriptContext; import org.elasticsearch.script.ScriptException; @@ -28,7 +28,7 @@ import static java.util.Collections.emptyMap; import static java.util.Collections.singleton; import static java.util.Collections.singletonMap; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.xpack.core.watcher.support.Exceptions.illegalArgument; import static org.elasticsearch.xpack.watcher.test.WatcherTestUtils.mockExecutionContext; import static org.hamcrest.Matchers.containsString; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/QueryWatchesRequestTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/QueryWatchesRequestTests.java index 26e3c0f6433b9..68ab7a102e031 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/QueryWatchesRequestTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/QueryWatchesRequestTests.java @@ -10,8 +10,8 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.search.SearchModule; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/QueryWatchesResponseTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/QueryWatchesResponseTests.java index 1e143e49f6b15..d0d973c102277 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/QueryWatchesResponseTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/QueryWatchesResponseTests.java @@ -8,12 +8,12 @@ package org.elasticsearch.xpack.watcher.transport.action; import org.elasticsearch.client.Client; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.ContextParser; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ConstructingObjectParser; +import org.elasticsearch.xcontent.ContextParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.AbstractSerializingTestCase; import org.elasticsearch.xpack.core.watcher.support.xcontent.WatcherParams; import org.elasticsearch.xpack.core.watcher.support.xcontent.WatcherXContentParser; @@ -33,8 +33,8 @@ import java.util.ArrayList; import java.util.List; -import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.equalTo; import static org.mockito.Mockito.mock; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/WatchRequestValidationTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/WatchRequestValidationTests.java index 5002d3cbee847..77e1b62cb538d 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/WatchRequestValidationTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/WatchRequestValidationTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.protocol.xpack.watcher.PutWatchRequest; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.watcher.execution.ActionExecutionMode; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/execute/ExecuteWatchRequestTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/execute/ExecuteWatchRequestTests.java index 7769f58b8312f..9031fc5d3d620 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/execute/ExecuteWatchRequestTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/execute/ExecuteWatchRequestTests.java @@ -9,7 +9,7 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.watcher.transport.actions.execute.ExecuteWatchRequest; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/put/PutWatchSerializationTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/put/PutWatchSerializationTests.java index cc47aa5505550..7d9f4d36980d2 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/put/PutWatchSerializationTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/action/put/PutWatchSerializationTests.java @@ -10,8 +10,8 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.lucene.uid.Versions; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.protocol.xpack.watcher.PutWatchRequest; import org.elasticsearch.test.ESTestCase; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/actions/TransportWatcherStatsActionTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/actions/TransportWatcherStatsActionTests.java index 68e288cead716..cd83a0674f489 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/actions/TransportWatcherStatsActionTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/transport/actions/TransportWatcherStatsActionTests.java @@ -14,9 +14,9 @@ import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.rest.yaml.ObjectPath; import org.elasticsearch.threadpool.ThreadPool; @@ -33,7 +33,7 @@ import java.util.Arrays; import java.util.Collections; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.is; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/ScheduleTriggerEngineMock.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/ScheduleTriggerEngineMock.java index 11f10f75416e5..49f161efeced6 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/ScheduleTriggerEngineMock.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/ScheduleTriggerEngineMock.java @@ -9,7 +9,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xpack.core.watcher.watch.ClockMock; import org.elasticsearch.xpack.core.watcher.watch.Watch; import org.elasticsearch.xpack.watcher.trigger.schedule.ScheduleRegistry; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/CronScheduleTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/CronScheduleTests.java index 403a1e9a5ac1c..33c281ad54515 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/CronScheduleTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/CronScheduleTests.java @@ -8,14 +8,14 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import java.time.ZoneOffset; import java.time.ZonedDateTime; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.arrayWithSize; import static org.hamcrest.Matchers.hasItemInArray; import static org.hamcrest.Matchers.instanceOf; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/DailyScheduleTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/DailyScheduleTests.java index f76be544c6205..e1efc655d0c6e 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/DailyScheduleTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/DailyScheduleTests.java @@ -8,12 +8,12 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.xpack.watcher.trigger.schedule.support.DayTimes; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.xpack.watcher.support.Strings.join; import static org.hamcrest.Matchers.arrayContaining; import static org.hamcrest.Matchers.arrayWithSize; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/HourlyScheduleTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/HourlyScheduleTests.java index 3773dbde54d28..cc2b4c246d484 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/HourlyScheduleTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/HourlyScheduleTests.java @@ -8,16 +8,16 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.xpack.watcher.support.Strings; import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.arrayContaining; import static org.hamcrest.Matchers.arrayWithSize; import static org.hamcrest.Matchers.containsString; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/IntervalScheduleTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/IntervalScheduleTests.java index 1ecd63b5dfd98..88644e77ae1d2 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/IntervalScheduleTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/IntervalScheduleTests.java @@ -8,12 +8,12 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.test.ESTestCase; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.instanceOf; import static org.hamcrest.Matchers.is; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/MonthlyScheduleTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/MonthlyScheduleTests.java index 91fade8cfc803..dcf25ac8ea712 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/MonthlyScheduleTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/MonthlyScheduleTests.java @@ -8,13 +8,13 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.xpack.watcher.trigger.schedule.support.DayTimes; import org.elasticsearch.xpack.watcher.trigger.schedule.support.MonthTimes; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.xpack.watcher.support.Strings.join; import static org.hamcrest.Matchers.arrayContaining; import static org.hamcrest.Matchers.arrayWithSize; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/ScheduleRegistryTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/ScheduleRegistryTests.java index b2f542552e896..49f5898bd22c3 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/ScheduleRegistryTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/ScheduleRegistryTests.java @@ -8,15 +8,15 @@ import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.junit.Before; import java.util.HashSet; import java.util.Set; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.instanceOf; import static org.hamcrest.Matchers.is; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/ScheduleTestCase.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/ScheduleTestCase.java index 390c45f641e5d..f1dff3fa0d7a4 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/ScheduleTestCase.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/ScheduleTestCase.java @@ -7,8 +7,8 @@ package org.elasticsearch.xpack.watcher.trigger.schedule; import org.elasticsearch.common.util.CollectionUtils; -import org.elasticsearch.common.xcontent.ToXContentObject; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ToXContentObject; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.scheduler.Cron; import org.elasticsearch.xpack.watcher.trigger.schedule.support.DayOfWeek; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/ScheduleTriggerEventTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/ScheduleTriggerEventTests.java index 9404ea4c6e2cd..f343ffb7f60f7 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/ScheduleTriggerEventTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/ScheduleTriggerEventTests.java @@ -7,9 +7,9 @@ package org.elasticsearch.xpack.watcher.trigger.schedule; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.ESTestCase; import java.time.Clock; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/WeeklyScheduleTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/WeeklyScheduleTests.java index 985ce49f768c0..cdbe002ef61b7 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/WeeklyScheduleTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/WeeklyScheduleTests.java @@ -10,14 +10,14 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.xpack.watcher.trigger.schedule.support.DayOfWeek; import org.elasticsearch.xpack.watcher.trigger.schedule.support.DayTimes; import org.elasticsearch.xpack.watcher.trigger.schedule.support.WeekTimes; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.xpack.watcher.support.Strings.join; import static org.hamcrest.Matchers.arrayContaining; import static org.hamcrest.Matchers.arrayWithSize; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/YearlyScheduleTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/YearlyScheduleTests.java index 5399853ea3751..48a356d6a8d06 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/YearlyScheduleTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/trigger/schedule/YearlyScheduleTests.java @@ -10,13 +10,13 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.xpack.watcher.trigger.schedule.support.DayTimes; import org.elasticsearch.xpack.watcher.trigger.schedule.support.YearTimes; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.xpack.watcher.support.Strings.join; import static org.hamcrest.Matchers.arrayContaining; import static org.hamcrest.Matchers.arrayWithSize; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/watch/WatchStatusTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/watch/WatchStatusTests.java index e4d512e08909b..42395d6fe4f39 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/watch/WatchStatusTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/watch/WatchStatusTests.java @@ -8,9 +8,9 @@ import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.ToXContent; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.watcher.actions.ActionStatus; import org.elasticsearch.xpack.core.watcher.actions.ActionStatus.AckStatus.State; @@ -25,7 +25,7 @@ import java.util.HashMap; import java.util.Map; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasKey; import static org.hamcrest.Matchers.instanceOf; diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/watch/WatchTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/watch/WatchTests.java index f81607e2cf558..25eca54f91c4c 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/watch/WatchTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/watch/WatchTests.java @@ -13,14 +13,14 @@ import org.elasticsearch.action.search.SearchRequest; import org.elasticsearch.action.support.WriteRequest; import org.elasticsearch.client.Client; -import org.elasticsearch.common.xcontent.ParseField; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.query.MatchAllQueryBuilder; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.ScriptQueryBuilder; @@ -136,7 +136,7 @@ import static java.util.Collections.singletonMap; import static java.util.Collections.unmodifiableMap; import static org.elasticsearch.core.TimeValue.timeValueSeconds; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.search.builder.SearchSourceBuilder.searchSource; import static org.elasticsearch.xpack.watcher.input.InputBuilders.searchInput; import static org.elasticsearch.xpack.watcher.test.WatcherTestUtils.templateRequest; diff --git a/x-pack/plugin/wildcard/src/main/java/org/elasticsearch/xpack/wildcard/mapper/WildcardFieldMapper.java b/x-pack/plugin/wildcard/src/main/java/org/elasticsearch/xpack/wildcard/mapper/WildcardFieldMapper.java index af0a7d9213d47..b53f72c22e35f 100644 --- a/x-pack/plugin/wildcard/src/main/java/org/elasticsearch/xpack/wildcard/mapper/WildcardFieldMapper.java +++ b/x-pack/plugin/wildcard/src/main/java/org/elasticsearch/xpack/wildcard/mapper/WildcardFieldMapper.java @@ -47,7 +47,7 @@ import org.elasticsearch.common.lucene.search.AutomatonQueries; import org.elasticsearch.common.time.DateMathParser; import org.elasticsearch.common.unit.Fuzziness; -import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.index.analysis.AnalyzerScope; import org.elasticsearch.index.analysis.LowercaseNormalizer; import org.elasticsearch.index.analysis.NamedAnalyzer; diff --git a/x-pack/plugin/wildcard/src/test/java/org/elasticsearch/xpack/wildcard/mapper/WildcardFieldMapperTests.java b/x-pack/plugin/wildcard/src/test/java/org/elasticsearch/xpack/wildcard/mapper/WildcardFieldMapperTests.java index 184fe36f7af53..737bce58c9e4a 100644 --- a/x-pack/plugin/wildcard/src/test/java/org/elasticsearch/xpack/wildcard/mapper/WildcardFieldMapperTests.java +++ b/x-pack/plugin/wildcard/src/test/java/org/elasticsearch/xpack/wildcard/mapper/WildcardFieldMapperTests.java @@ -45,7 +45,7 @@ import org.elasticsearch.common.lucene.search.AutomatonQueries; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.Fuzziness; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.Index; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.cache.bitset.BitsetFilterCache; diff --git a/x-pack/qa/full-cluster-restart/src/test/java/org/elasticsearch/xpack/restart/FullClusterRestartIT.java b/x-pack/qa/full-cluster-restart/src/test/java/org/elasticsearch/xpack/restart/FullClusterRestartIT.java index 195ba1fa038d2..3374ea12b3aee 100644 --- a/x-pack/qa/full-cluster-restart/src/test/java/org/elasticsearch/xpack/restart/FullClusterRestartIT.java +++ b/x-pack/qa/full-cluster-restart/src/test/java/org/elasticsearch/xpack/restart/FullClusterRestartIT.java @@ -19,13 +19,13 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ObjectPath; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.ObjectPath; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.rest.RestStatus; diff --git a/x-pack/qa/kerberos-tests/src/test/java/org/elasticsearch/xpack/security/authc/kerberos/KerberosAuthenticationIT.java b/x-pack/qa/kerberos-tests/src/test/java/org/elasticsearch/xpack/security/authc/kerberos/KerberosAuthenticationIT.java index e0ea439dfa509..88ca019982348 100644 --- a/x-pack/qa/kerberos-tests/src/test/java/org/elasticsearch/xpack/security/authc/kerberos/KerberosAuthenticationIT.java +++ b/x-pack/qa/kerberos-tests/src/test/java/org/elasticsearch/xpack/security/authc/kerberos/KerberosAuthenticationIT.java @@ -19,8 +19,8 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.rest.ESRestTestCase; import org.ietf.jgss.GSSException; import org.junit.Before; diff --git a/x-pack/qa/multi-node/src/test/java/org/elasticsearch/multi_node/GlobalCheckpointSyncActionIT.java b/x-pack/qa/multi-node/src/test/java/org/elasticsearch/multi_node/GlobalCheckpointSyncActionIT.java index 52b62687db27e..d43d01947920f 100644 --- a/x-pack/qa/multi-node/src/test/java/org/elasticsearch/multi_node/GlobalCheckpointSyncActionIT.java +++ b/x-pack/qa/multi-node/src/test/java/org/elasticsearch/multi_node/GlobalCheckpointSyncActionIT.java @@ -12,11 +12,11 @@ import org.elasticsearch.common.settings.SecureString; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.test.rest.ESRestTestCase; import org.elasticsearch.test.rest.yaml.ObjectPath; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.equalTo; public class GlobalCheckpointSyncActionIT extends ESRestTestCase { diff --git a/x-pack/qa/multi-node/src/test/java/org/elasticsearch/multi_node/RollupIT.java b/x-pack/qa/multi-node/src/test/java/org/elasticsearch/multi_node/RollupIT.java index b8d0aff1e783a..65b7e5e2b63bc 100644 --- a/x-pack/qa/multi-node/src/test/java/org/elasticsearch/multi_node/RollupIT.java +++ b/x-pack/qa/multi-node/src/test/java/org/elasticsearch/multi_node/RollupIT.java @@ -15,10 +15,10 @@ import org.elasticsearch.common.settings.SecureString; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.ObjectPath; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.ObjectPath; +import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.test.rest.ESRestTestCase; @@ -32,7 +32,7 @@ import java.util.Map; import java.util.concurrent.TimeUnit; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.oneOf; diff --git a/x-pack/qa/oidc-op-tests/src/test/java/org/elasticsearch/xpack/security/authc/oidc/OpenIdConnectAuthIT.java b/x-pack/qa/oidc-op-tests/src/test/java/org/elasticsearch/xpack/security/authc/oidc/OpenIdConnectAuthIT.java index b4b19f3379fe1..b998ce8c1400f 100644 --- a/x-pack/qa/oidc-op-tests/src/test/java/org/elasticsearch/xpack/security/authc/oidc/OpenIdConnectAuthIT.java +++ b/x-pack/qa/oidc-op-tests/src/test/java/org/elasticsearch/xpack/security/authc/oidc/OpenIdConnectAuthIT.java @@ -41,9 +41,9 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.rest.ESRestTestCase; import org.elasticsearch.xpack.core.common.socket.SocketAccess; import org.elasticsearch.xpack.core.security.authc.support.UsernamePasswordToken; diff --git a/x-pack/qa/password-protected-keystore/src/test/java/org/elasticsearch/password_protected_keystore/ReloadSecureSettingsWithPasswordProtectedKeystoreRestIT.java b/x-pack/qa/password-protected-keystore/src/test/java/org/elasticsearch/password_protected_keystore/ReloadSecureSettingsWithPasswordProtectedKeystoreRestIT.java index 801848b4f35a6..5ecb2d074f5a2 100644 --- a/x-pack/qa/password-protected-keystore/src/test/java/org/elasticsearch/password_protected_keystore/ReloadSecureSettingsWithPasswordProtectedKeystoreRestIT.java +++ b/x-pack/qa/password-protected-keystore/src/test/java/org/elasticsearch/password_protected_keystore/ReloadSecureSettingsWithPasswordProtectedKeystoreRestIT.java @@ -11,10 +11,9 @@ import org.elasticsearch.common.settings.SecureString; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.ObjectPath; +import org.elasticsearch.xcontent.ObjectPath; import org.elasticsearch.test.rest.ESRestTestCase; -import static org.elasticsearch.xpack.core.security.authc.support.UsernamePasswordToken.basicAuthHeaderValue; import static org.hamcrest.Matchers.anyOf; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; diff --git a/x-pack/qa/rolling-upgrade-multi-cluster/src/test/java/org/elasticsearch/upgrades/AbstractMultiClusterUpgradeTestCase.java b/x-pack/qa/rolling-upgrade-multi-cluster/src/test/java/org/elasticsearch/upgrades/AbstractMultiClusterUpgradeTestCase.java index 78e932572885e..63a27afd64743 100644 --- a/x-pack/qa/rolling-upgrade-multi-cluster/src/test/java/org/elasticsearch/upgrades/AbstractMultiClusterUpgradeTestCase.java +++ b/x-pack/qa/rolling-upgrade-multi-cluster/src/test/java/org/elasticsearch/upgrades/AbstractMultiClusterUpgradeTestCase.java @@ -13,7 +13,7 @@ import org.elasticsearch.client.Response; import org.elasticsearch.client.RestClient; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.core.internal.io.IOUtils; import org.elasticsearch.test.rest.ESRestTestCase; import org.junit.AfterClass; diff --git a/x-pack/qa/rolling-upgrade-multi-cluster/src/test/java/org/elasticsearch/upgrades/CcrRollingUpgradeIT.java b/x-pack/qa/rolling-upgrade-multi-cluster/src/test/java/org/elasticsearch/upgrades/CcrRollingUpgradeIT.java index 7fb4000d668f5..97b0c5bb339b2 100644 --- a/x-pack/qa/rolling-upgrade-multi-cluster/src/test/java/org/elasticsearch/upgrades/CcrRollingUpgradeIT.java +++ b/x-pack/qa/rolling-upgrade-multi-cluster/src/test/java/org/elasticsearch/upgrades/CcrRollingUpgradeIT.java @@ -12,7 +12,7 @@ import org.elasticsearch.client.RestClient; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ObjectPath; +import org.elasticsearch.xcontent.ObjectPath; import org.elasticsearch.common.xcontent.support.XContentMapValues; import java.io.IOException; diff --git a/x-pack/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/MlJobSnapshotUpgradeIT.java b/x-pack/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/MlJobSnapshotUpgradeIT.java index 78ead88602901..f4f1ac8e93a9c 100644 --- a/x-pack/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/MlJobSnapshotUpgradeIT.java +++ b/x-pack/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/MlJobSnapshotUpgradeIT.java @@ -39,8 +39,8 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import org.elasticsearch.xpack.test.rest.XPackRestTestConstants; import java.io.IOException; diff --git a/x-pack/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/RollupDateHistoUpgradeIT.java b/x-pack/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/RollupDateHistoUpgradeIT.java index a9bc81edca58e..e957c3ea84d7a 100644 --- a/x-pack/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/RollupDateHistoUpgradeIT.java +++ b/x-pack/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/RollupDateHistoUpgradeIT.java @@ -10,7 +10,7 @@ import org.elasticsearch.client.Request; import org.elasticsearch.client.Response; import org.elasticsearch.core.Booleans; -import org.elasticsearch.common.xcontent.ObjectPath; +import org.elasticsearch.xcontent.ObjectPath; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.test.rest.ESRestTestCase; diff --git a/x-pack/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/TransformSurvivesUpgradeIT.java b/x-pack/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/TransformSurvivesUpgradeIT.java index 1cae10aeafb5a..f6419d5c3ae90 100644 --- a/x-pack/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/TransformSurvivesUpgradeIT.java +++ b/x-pack/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/TransformSurvivesUpgradeIT.java @@ -29,11 +29,11 @@ import org.elasticsearch.common.io.Streams; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.DeprecationHandler; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentParser; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.search.aggregations.AggregationBuilders; import org.elasticsearch.search.aggregations.AggregatorFactories; @@ -51,7 +51,7 @@ import java.util.stream.Collectors; import java.util.stream.Stream; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.xpack.test.rest.XPackRestTestConstants.TRANSFORM_INTERNAL_INDEX_PREFIX; import static org.elasticsearch.xpack.test.rest.XPackRestTestConstants.TRANSFORM_INTERNAL_INDEX_PREFIX_DEPRECATED; import static org.elasticsearch.xpack.test.rest.XPackRestTestConstants.TRANSFORM_NOTIFICATIONS_INDEX_PREFIX; diff --git a/x-pack/qa/runtime-fields/src/main/java/org/elasticsearch/xpack/runtimefields/test/CoreTestTranslater.java b/x-pack/qa/runtime-fields/src/main/java/org/elasticsearch/xpack/runtimefields/test/CoreTestTranslater.java index 4301d803d9b9f..eabf4287ce374 100644 --- a/x-pack/qa/runtime-fields/src/main/java/org/elasticsearch/xpack/runtimefields/test/CoreTestTranslater.java +++ b/x-pack/qa/runtime-fields/src/main/java/org/elasticsearch/xpack/runtimefields/test/CoreTestTranslater.java @@ -9,10 +9,6 @@ import org.elasticsearch.action.bulk.BulkRequestParser; import org.elasticsearch.action.index.IndexRequest; import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentLocation; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.index.mapper.BooleanFieldMapper; import org.elasticsearch.index.mapper.DateFieldMapper; @@ -30,6 +26,10 @@ import org.elasticsearch.test.rest.yaml.section.DoSection; import org.elasticsearch.test.rest.yaml.section.ExecutableSection; import org.elasticsearch.test.rest.yaml.section.SetupSection; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentLocation; +import org.elasticsearch.xcontent.XContentType; +import org.elasticsearch.xcontent.json.JsonXContent; import java.io.IOException; import java.util.ArrayList; diff --git a/x-pack/qa/saml-idp-tests/src/test/java/org/elasticsearch/xpack/security/authc/saml/SamlAuthenticationIT.java b/x-pack/qa/saml-idp-tests/src/test/java/org/elasticsearch/xpack/security/authc/saml/SamlAuthenticationIT.java index 1053b7220e7ab..66b06d443edbd 100644 --- a/x-pack/qa/saml-idp-tests/src/test/java/org/elasticsearch/xpack/security/authc/saml/SamlAuthenticationIT.java +++ b/x-pack/qa/saml-idp-tests/src/test/java/org/elasticsearch/xpack/security/authc/saml/SamlAuthenticationIT.java @@ -41,9 +41,9 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentFactory; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.rest.ESRestTestCase; import org.elasticsearch.xpack.core.common.socket.SocketAccess; import org.elasticsearch.xpack.core.security.authc.support.UsernamePasswordToken; diff --git a/x-pack/qa/src/main/java/org/elasticsearch/xpack/test/rest/XPackRestTestHelper.java b/x-pack/qa/src/main/java/org/elasticsearch/xpack/test/rest/XPackRestTestHelper.java index 6a99197d9f38b..9a82ee006f772 100644 --- a/x-pack/qa/src/main/java/org/elasticsearch/xpack/test/rest/XPackRestTestHelper.java +++ b/x-pack/qa/src/main/java/org/elasticsearch/xpack/test/rest/XPackRestTestHelper.java @@ -11,7 +11,7 @@ import org.elasticsearch.client.Request; import org.elasticsearch.client.RestClient; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.xcontent.json.JsonXContent; import java.util.Collections; import java.util.List; diff --git a/x-pack/qa/third-party/active-directory/src/test/java/org/elasticsearch/xpack/security/authc/ldap/AbstractAdLdapRealmTestCase.java b/x-pack/qa/third-party/active-directory/src/test/java/org/elasticsearch/xpack/security/authc/ldap/AbstractAdLdapRealmTestCase.java index 11ed0afb3bd6d..23e389a3a7692 100644 --- a/x-pack/qa/third-party/active-directory/src/test/java/org/elasticsearch/xpack/security/authc/ldap/AbstractAdLdapRealmTestCase.java +++ b/x-pack/qa/third-party/active-directory/src/test/java/org/elasticsearch/xpack/security/authc/ldap/AbstractAdLdapRealmTestCase.java @@ -18,7 +18,7 @@ import org.elasticsearch.common.settings.SecureString; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.ssl.SslVerificationMode; -import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.SecurityIntegTestCase; import org.elasticsearch.xpack.core.security.action.rolemapping.PutRoleMappingRequestBuilder; @@ -42,7 +42,7 @@ import java.util.function.Supplier; import java.util.stream.Collectors; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.xpack.core.security.authc.RealmSettings.getFullSettingKey; import static org.elasticsearch.xpack.core.security.authc.ldap.support.LdapSearchScope.ONE_LEVEL; import static org.elasticsearch.xpack.core.security.authc.ldap.support.LdapSearchScope.SUB_TREE; From c2fd94f7c5c20cee10378b655156b218c6507d9e Mon Sep 17 00:00:00 2001 From: Joe Gallo Date: Fri, 8 Oct 2021 15:18:48 -0400 Subject: [PATCH 243/250] Fix DataTierTests package and add a validation test (#78880) --- .../cluster/routing/allocation/DataTier.java | 3 ++- .../routing/allocation}/DataTierTests.java | 27 ++++++++++++++++--- 2 files changed, 25 insertions(+), 5 deletions(-) rename {x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core => server/src/test/java/org/elasticsearch/cluster/routing/allocation}/DataTierTests.java (86%) diff --git a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/DataTier.java b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/DataTier.java index b605f6580a008..34bda24bde330 100644 --- a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/DataTier.java +++ b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/DataTier.java @@ -175,7 +175,8 @@ public Settings getAdditionalIndexSettings(String indexName, boolean isDataStrea } } - private static final class DataTierSettingValidator implements Setting.Validator { + // visible for testing + static final class DataTierSettingValidator implements Setting.Validator { private static final Collection> dependencies = List.of( IndexModule.INDEX_STORE_TYPE_SETTING, diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/DataTierTests.java b/server/src/test/java/org/elasticsearch/cluster/routing/allocation/DataTierTests.java similarity index 86% rename from x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/DataTierTests.java rename to server/src/test/java/org/elasticsearch/cluster/routing/allocation/DataTierTests.java index 976fc11829783..807daa559ae88 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/DataTierTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/routing/allocation/DataTierTests.java @@ -1,17 +1,18 @@ /* * 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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ -package org.elasticsearch.xpack.core; +package org.elasticsearch.cluster.routing.allocation; import org.elasticsearch.Version; import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.node.DiscoveryNodeRole; import org.elasticsearch.cluster.node.DiscoveryNodes; -import org.elasticsearch.cluster.routing.allocation.DataTier; +import org.elasticsearch.cluster.routing.allocation.DataTier.DataTierSettingValidator; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.node.NodeRoleSettings; @@ -152,4 +153,22 @@ private static List randomNodes(final int numNodes) { } return nodesList; } + + public void testDataTierSettingValidator() { + DataTierSettingValidator validator = new DataTierSettingValidator(); + + // good values + validator.validate(null); + validator.validate(""); + validator.validate(" "); // a little surprising + validator.validate(DATA_WARM); + validator.validate(DATA_WARM + "," + DATA_HOT); + validator.validate(DATA_WARM + ","); // a little surprising + + // bad values + expectThrows(IllegalArgumentException.class, () -> validator.validate(" " + DATA_WARM)); + expectThrows(IllegalArgumentException.class, () -> validator.validate(DATA_WARM + " ")); + expectThrows(IllegalArgumentException.class, () -> validator.validate(DATA_WARM + ", ")); + expectThrows(IllegalArgumentException.class, () -> validator.validate(DATA_WARM + ", " + DATA_HOT)); + } } From cb983a9ed24db42d481a1ce7f280d807ecbe291c Mon Sep 17 00:00:00 2001 From: Costin Leau Date: Sun, 10 Oct 2021 23:04:19 +0300 Subject: [PATCH 244/250] EQL: Refine repeatable queries (#78895) Allow individual queries within a sequence to be repeated through a dedicated keyword without having physical duplication. Change from using [runs=2] to "with runs=2" Before: sequence queryA [runs=2] queryB queryC [runs=3] queryD Now: sequence queryA with runs=2 queryB queryC with runs=3 queryD Which essentially is the same as: sequence queryA queryA queryB queryC queryC queryC queryD but more concise. Supersedes #75082 --- .../resources/additional_test_queries.toml | 2 +- .../src/main/resources/test_queries.toml | 36 +- .../src/javaRestTest/resources/queries.toml | 4 +- x-pack/plugin/eql/src/main/antlr/EqlBase.g4 | 2 +- .../xpack/eql/parser/EqlBaseParser.java | 436 +++++++++--------- .../xpack/eql/parser/LogicalPlanTests.java | 2 +- .../eql/planner/QueryTranslatorFailTests.java | 4 +- 7 files changed, 241 insertions(+), 245 deletions(-) diff --git a/x-pack/plugin/eql/qa/common/src/main/resources/additional_test_queries.toml b/x-pack/plugin/eql/qa/common/src/main/resources/additional_test_queries.toml index 37aaa74a4f68a..36b479759742a 100644 --- a/x-pack/plugin/eql/qa/common/src/main/resources/additional_test_queries.toml +++ b/x-pack/plugin/eql/qa/common/src/main/resources/additional_test_queries.toml @@ -241,7 +241,7 @@ expected_event_ids = [ name = "sequenceWithMoreThan10Results-Runs" query = ''' sequence by unique_pid - [any where true] [runs=2] + [any where true] with runs=2 [any where serial_event_id < 72] ''' expected_event_ids = [ diff --git a/x-pack/plugin/eql/qa/common/src/main/resources/test_queries.toml b/x-pack/plugin/eql/qa/common/src/main/resources/test_queries.toml index 92a8bc4b5b974..4d47bfa6b5cae 100644 --- a/x-pack/plugin/eql/qa/common/src/main/resources/test_queries.toml +++ b/x-pack/plugin/eql/qa/common/src/main/resources/test_queries.toml @@ -561,7 +561,7 @@ name = "sequenceOneManyMany-Runs" query = ''' sequence [process where serial_event_id == 1] - [process where true] [runs=2] + [process where true] with runs=2 ''' expected_event_ids = [1, 2, 3] @@ -582,7 +582,7 @@ name = "sequenceConditionManyMany-Runs" query = ''' sequence [process where serial_event_id <= 3] - [process where true] [runs=2] + [process where true] with runs=2 ''' expected_event_ids = [1, 2, 3, 2, 3, 4, @@ -613,7 +613,7 @@ expected_event_ids = [1, 2, 3] name = "sequenceManyManyCondition-Runs" query = ''' sequence - [process where true] [runs=2] + [process where true] with runs=2 [process where serial_event_id <= 3] ''' expected_event_ids = [1, 2, 3] @@ -637,7 +637,7 @@ name = "sequenceThreeManyCondition1-Runs" query = ''' sequence [process where serial_event_id <= 4] - [process where true] [runs=3] + [process where true] with runs=3 ''' expected_event_ids = [1, 2, 3, 4, 2, 3, 4, 5, @@ -663,7 +663,7 @@ query = ''' sequence [process where true] [process where serial_event_id <= 4] - [process where true] [runs=2] + [process where true] with runs=2 ''' expected_event_ids = [1, 2, 3, 4, 2, 3, 4, 5, @@ -685,7 +685,7 @@ expected_event_ids = [1, 2, 3, 4, name = "sequenceThreeManyCondition3-Runs" query = ''' sequence - [process where true] [runs=2] + [process where true] with runs=2 [process where serial_event_id <= 4] [process where true] ''' @@ -707,7 +707,7 @@ expected_event_ids = [1, 2, 3, 4] name = "sequenceThreeManyCondition4-Runs" query = ''' sequence - [process where true] [runs=3] + [process where true] with runs=3 [process where serial_event_id <= 4] ''' expected_event_ids = [1, 2, 3, 4] @@ -754,7 +754,7 @@ name = "fourSequencesByPidWithUntil1-Runs" query = ''' sequence [process where opcode == 1] by unique_pid - [file where opcode == 0] by unique_pid [runs=3] + [file where opcode == 0] by unique_pid with runs=3 until [file where opcode == 2] by unique_pid ''' @@ -779,7 +779,7 @@ name = "fourSequencesByPidWithUntil2-Runs" query = ''' sequence [process where opcode == 1] by unique_pid - [file where opcode == 0] by unique_pid [runs=3] + [file where opcode == 0] by unique_pid with runs=3 until [file where opcode == 200] by unique_pid ''' @@ -813,7 +813,7 @@ name = "fourSequencesByPid-Runs" query = ''' sequence [process where opcode == 1] by unique_pid - [file where opcode == 0] by unique_pid [runs=3] + [file where opcode == 0] by unique_pid with runs=3 ''' expected_event_ids = [54, 55, 61, 67] @@ -834,7 +834,7 @@ name = "fourSequencesByPidAndProcessPath1-Runs" query = ''' sequence [process where opcode == 1] by unique_pid, process_path - [file where opcode == 0] by unique_pid, process_path [runs=3] + [file where opcode == 0] by unique_pid, process_path with runs=3 ''' expected_event_ids = [54, 55, 61, 67] @@ -856,7 +856,7 @@ name = "fourSequencesByPidAndProcessPathWithUntil-Runs" query = ''' sequence [process where opcode == 1] by unique_pid, process_path - [file where opcode == 0] by unique_pid, process_path [runs=3] + [file where opcode == 0] by unique_pid, process_path with runs=3 until [file where opcode == 200] by unique_pid, process_path ''' @@ -867,8 +867,8 @@ name = "fourSequencesByPidAndProcessPathWithUntil-RunsExtra" query = ''' sequence [process where opcode == 1] by unique_pid, process_path - [file where opcode == 0] by unique_pid, process_path [runs=2] - [file where opcode == 0] by unique_pid, process_path [runs=1] + [file where opcode == 0] by unique_pid, process_path with runs=2 + [file where opcode == 0] by unique_pid, process_path with runs=1 until [file where opcode == 200] by unique_pid, process_path ''' @@ -1026,7 +1026,7 @@ expected_event_ids = [1, 2, name = "doubleSameSequence-Runs" query = ''' sequence - [process where serial_event_id < 5] [runs=2] + [process where serial_event_id < 5] with runs=2 ''' expected_event_ids = [1, 2, 2, 3, @@ -1056,7 +1056,7 @@ expected_event_ids = [55, 61] name = "doubleSameSequenceWithBy-Runs" query = ''' sequence - [file where opcode==0] by unique_pid [runs=2] + [file where opcode==0] by unique_pid with runs=2 | head 1 ''' expected_event_ids = [55, 61] @@ -1087,7 +1087,7 @@ expected_event_ids = [55, 61] name = "doubleSameSequenceWithByUntilAndHead1-Runs" query = ''' sequence - [file where opcode==0 and file_name:"*.exe"] by unique_pid [runs=2] + [file where opcode==0 and file_name:"*.exe"] by unique_pid with runs=2 until [process where opcode==5000] by unique_ppid | head 1 ''' @@ -1108,7 +1108,7 @@ expected_event_ids = [] name = "doubleSameSequenceWithByUntilAndHead2-Runs" query = ''' sequence - [file where opcode==0 and file_name:"*.exe"] by unique_pid [runs=2] + [file where opcode==0 and file_name:"*.exe"] by unique_pid with runs=2 until [process where opcode==1] by unique_ppid | head 1 ''' diff --git a/x-pack/plugin/eql/qa/correctness/src/javaRestTest/resources/queries.toml b/x-pack/plugin/eql/qa/correctness/src/javaRestTest/resources/queries.toml index 3a2a7dac84b7b..42411b608a618 100644 --- a/x-pack/plugin/eql/qa/correctness/src/javaRestTest/resources/queries.toml +++ b/x-pack/plugin/eql/qa/correctness/src/javaRestTest/resources/queries.toml @@ -396,7 +396,7 @@ filters = [ ] query = ''' sequence by source_address, hostname with maxspan=5s - [security where hostname != "newyork" and event_id == 4625] [runs=4] + [security where hostname != "newyork" and event_id == 4625] with runs=4 ''' time = 2.8286166191101074 type = "sequence" @@ -433,7 +433,7 @@ filters = [ ] query = ''' sequence by source_address, hostname with maxspan=10s - [security where hostname != "newyork" and event_id == 4625] [runs=3] + [security where hostname != "newyork" and event_id == 4625] with runs=3 ''' time = 2.765869617462158 type = "sequence" diff --git a/x-pack/plugin/eql/src/main/antlr/EqlBase.g4 b/x-pack/plugin/eql/src/main/antlr/EqlBase.g4 index dfffb4aa06368..7e8100c9f651a 100644 --- a/x-pack/plugin/eql/src/main/antlr/EqlBase.g4 +++ b/x-pack/plugin/eql/src/main/antlr/EqlBase.g4 @@ -56,7 +56,7 @@ joinTerm ; sequenceTerm - : subquery (by=joinKeys)? (LB key=IDENTIFIER ASGN value=number RB)? + : subquery (by=joinKeys)? (WITH key=IDENTIFIER ASGN value=number)? ; subquery diff --git a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseParser.java b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseParser.java index 0043df2122746..5c2f94c026e77 100644 --- a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseParser.java +++ b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseParser.java @@ -845,9 +845,8 @@ public static class SequenceTermContext extends ParserRuleContext { public SubqueryContext subquery() { return getRuleContext(SubqueryContext.class,0); } - public TerminalNode LB() { return getToken(EqlBaseParser.LB, 0); } + public TerminalNode WITH() { return getToken(EqlBaseParser.WITH, 0); } public TerminalNode ASGN() { return getToken(EqlBaseParser.ASGN, 0); } - public TerminalNode RB() { return getToken(EqlBaseParser.RB, 0); } public JoinKeysContext joinKeys() { return getRuleContext(JoinKeysContext.class,0); } @@ -893,24 +892,22 @@ public final SequenceTermContext sequenceTerm() throws RecognitionException { } } - setState(154); + setState(152); _errHandler.sync(this); - switch ( getInterpreter().adaptivePredict(_input,15,_ctx) ) { - case 1: + _la = _input.LA(1); + if (_la==WITH) { { setState(148); - match(LB); + match(WITH); setState(149); ((SequenceTermContext)_localctx).key = match(IDENTIFIER); setState(150); match(ASGN); setState(151); ((SequenceTermContext)_localctx).value = number(); - setState(152); - match(RB); } - break; } + } } catch (RecognitionException re) { @@ -955,11 +952,11 @@ public final SubqueryContext subquery() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(156); + setState(154); match(LB); - setState(157); + setState(155); eventFilter(); - setState(158); + setState(156); match(RB); } } @@ -1003,7 +1000,7 @@ public final EventQueryContext eventQuery() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(160); + setState(158); eventFilter(); } } @@ -1053,28 +1050,28 @@ public final EventFilterContext eventFilter() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(164); + setState(162); _errHandler.sync(this); switch (_input.LA(1)) { case ANY: { - setState(162); + setState(160); match(ANY); } break; case STRING: case IDENTIFIER: { - setState(163); + setState(161); ((EventFilterContext)_localctx).event = eventValue(); } break; default: throw new NoViableAltException(this); } - setState(166); + setState(164); match(WHERE); - setState(167); + setState(165); expression(); } } @@ -1118,7 +1115,7 @@ public final ExpressionContext expression() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(169); + setState(167); booleanExpression(0); } } @@ -1248,7 +1245,7 @@ private BooleanExpressionContext booleanExpression(int _p) throws RecognitionExc int _alt; enterOuterAlt(_localctx, 1); { - setState(178); + setState(176); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,17,_ctx) ) { case 1: @@ -1257,9 +1254,9 @@ private BooleanExpressionContext booleanExpression(int _p) throws RecognitionExc _ctx = _localctx; _prevctx = _localctx; - setState(172); + setState(170); match(NOT); - setState(173); + setState(171); booleanExpression(5); } break; @@ -1268,11 +1265,11 @@ private BooleanExpressionContext booleanExpression(int _p) throws RecognitionExc _localctx = new ProcessCheckContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(174); + setState(172); ((ProcessCheckContext)_localctx).relationship = match(IDENTIFIER); - setState(175); + setState(173); match(OF); - setState(176); + setState(174); subquery(); } break; @@ -1281,13 +1278,13 @@ private BooleanExpressionContext booleanExpression(int _p) throws RecognitionExc _localctx = new BooleanDefaultContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(177); + setState(175); valueExpression(); } break; } _ctx.stop = _input.LT(-1); - setState(188); + setState(186); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,19,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { @@ -1295,7 +1292,7 @@ private BooleanExpressionContext booleanExpression(int _p) throws RecognitionExc if ( _parseListeners!=null ) triggerExitRuleEvent(); _prevctx = _localctx; { - setState(186); + setState(184); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,18,_ctx) ) { case 1: @@ -1303,11 +1300,11 @@ private BooleanExpressionContext booleanExpression(int _p) throws RecognitionExc _localctx = new LogicalBinaryContext(new BooleanExpressionContext(_parentctx, _parentState)); ((LogicalBinaryContext)_localctx).left = _prevctx; pushNewRecursionContext(_localctx, _startState, RULE_booleanExpression); - setState(180); + setState(178); if (!(precpred(_ctx, 2))) throw new FailedPredicateException(this, "precpred(_ctx, 2)"); - setState(181); + setState(179); ((LogicalBinaryContext)_localctx).operator = match(AND); - setState(182); + setState(180); ((LogicalBinaryContext)_localctx).right = booleanExpression(3); } break; @@ -1316,18 +1313,18 @@ private BooleanExpressionContext booleanExpression(int _p) throws RecognitionExc _localctx = new LogicalBinaryContext(new BooleanExpressionContext(_parentctx, _parentState)); ((LogicalBinaryContext)_localctx).left = _prevctx; pushNewRecursionContext(_localctx, _startState, RULE_booleanExpression); - setState(183); + setState(181); if (!(precpred(_ctx, 1))) throw new FailedPredicateException(this, "precpred(_ctx, 1)"); - setState(184); + setState(182); ((LogicalBinaryContext)_localctx).operator = match(OR); - setState(185); + setState(183); ((LogicalBinaryContext)_localctx).right = booleanExpression(2); } break; } } } - setState(190); + setState(188); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,19,_ctx); } @@ -1406,14 +1403,14 @@ public final ValueExpressionContext valueExpression() throws RecognitionExceptio ValueExpressionContext _localctx = new ValueExpressionContext(_ctx, getState()); enterRule(_localctx, 32, RULE_valueExpression); try { - setState(196); + setState(194); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,20,_ctx) ) { case 1: _localctx = new ValueExpressionDefaultContext(_localctx); enterOuterAlt(_localctx, 1); { - setState(191); + setState(189); operatorExpression(0); } break; @@ -1421,11 +1418,11 @@ public final ValueExpressionContext valueExpression() throws RecognitionExceptio _localctx = new ComparisonContext(_localctx); enterOuterAlt(_localctx, 2); { - setState(192); + setState(190); ((ComparisonContext)_localctx).left = operatorExpression(0); - setState(193); + setState(191); comparisonOperator(); - setState(194); + setState(192); ((ComparisonContext)_localctx).right = operatorExpression(0); } break; @@ -1544,7 +1541,7 @@ private OperatorExpressionContext operatorExpression(int _p) throws RecognitionE int _alt; enterOuterAlt(_localctx, 1); { - setState(205); + setState(203); _errHandler.sync(this); switch (_input.LA(1)) { case FALSE: @@ -1562,14 +1559,14 @@ private OperatorExpressionContext operatorExpression(int _p) throws RecognitionE _ctx = _localctx; _prevctx = _localctx; - setState(199); + setState(197); primaryExpression(); - setState(201); + setState(199); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,21,_ctx) ) { case 1: { - setState(200); + setState(198); predicate(); } break; @@ -1582,7 +1579,7 @@ private OperatorExpressionContext operatorExpression(int _p) throws RecognitionE _localctx = new ArithmeticUnaryContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(203); + setState(201); ((ArithmeticUnaryContext)_localctx).operator = _input.LT(1); _la = _input.LA(1); if ( !(_la==PLUS || _la==MINUS) ) { @@ -1593,7 +1590,7 @@ private OperatorExpressionContext operatorExpression(int _p) throws RecognitionE _errHandler.reportMatch(this); consume(); } - setState(204); + setState(202); operatorExpression(3); } break; @@ -1601,7 +1598,7 @@ private OperatorExpressionContext operatorExpression(int _p) throws RecognitionE throw new NoViableAltException(this); } _ctx.stop = _input.LT(-1); - setState(215); + setState(213); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,24,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { @@ -1609,7 +1606,7 @@ private OperatorExpressionContext operatorExpression(int _p) throws RecognitionE if ( _parseListeners!=null ) triggerExitRuleEvent(); _prevctx = _localctx; { - setState(213); + setState(211); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,23,_ctx) ) { case 1: @@ -1617,9 +1614,9 @@ private OperatorExpressionContext operatorExpression(int _p) throws RecognitionE _localctx = new ArithmeticBinaryContext(new OperatorExpressionContext(_parentctx, _parentState)); ((ArithmeticBinaryContext)_localctx).left = _prevctx; pushNewRecursionContext(_localctx, _startState, RULE_operatorExpression); - setState(207); + setState(205); if (!(precpred(_ctx, 2))) throw new FailedPredicateException(this, "precpred(_ctx, 2)"); - setState(208); + setState(206); ((ArithmeticBinaryContext)_localctx).operator = _input.LT(1); _la = _input.LA(1); if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << ASTERISK) | (1L << SLASH) | (1L << PERCENT))) != 0)) ) { @@ -1630,7 +1627,7 @@ private OperatorExpressionContext operatorExpression(int _p) throws RecognitionE _errHandler.reportMatch(this); consume(); } - setState(209); + setState(207); ((ArithmeticBinaryContext)_localctx).right = operatorExpression(3); } break; @@ -1639,9 +1636,9 @@ private OperatorExpressionContext operatorExpression(int _p) throws RecognitionE _localctx = new ArithmeticBinaryContext(new OperatorExpressionContext(_parentctx, _parentState)); ((ArithmeticBinaryContext)_localctx).left = _prevctx; pushNewRecursionContext(_localctx, _startState, RULE_operatorExpression); - setState(210); + setState(208); if (!(precpred(_ctx, 1))) throw new FailedPredicateException(this, "precpred(_ctx, 1)"); - setState(211); + setState(209); ((ArithmeticBinaryContext)_localctx).operator = _input.LT(1); _la = _input.LA(1); if ( !(_la==PLUS || _la==MINUS) ) { @@ -1652,14 +1649,14 @@ private OperatorExpressionContext operatorExpression(int _p) throws RecognitionE _errHandler.reportMatch(this); consume(); } - setState(212); + setState(210); ((ArithmeticBinaryContext)_localctx).right = operatorExpression(2); } break; } } } - setState(217); + setState(215); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,24,_ctx); } @@ -1728,23 +1725,23 @@ public final PredicateContext predicate() throws RecognitionException { enterRule(_localctx, 36, RULE_predicate); int _la; try { - setState(247); + setState(245); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,28,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { - setState(219); + setState(217); _errHandler.sync(this); _la = _input.LA(1); if (_la==NOT) { { - setState(218); + setState(216); match(NOT); } } - setState(221); + setState(219); ((PredicateContext)_localctx).kind = _input.LT(1); _la = _input.LA(1); if ( !(_la==IN || _la==IN_INSENSITIVE) ) { @@ -1755,34 +1752,34 @@ public final PredicateContext predicate() throws RecognitionException { _errHandler.reportMatch(this); consume(); } - setState(222); + setState(220); match(LP); - setState(223); + setState(221); expression(); - setState(228); + setState(226); _errHandler.sync(this); _la = _input.LA(1); while (_la==COMMA) { { { - setState(224); + setState(222); match(COMMA); - setState(225); + setState(223); expression(); } } - setState(230); + setState(228); _errHandler.sync(this); _la = _input.LA(1); } - setState(231); + setState(229); match(RP); } break; case 2: enterOuterAlt(_localctx, 2); { - setState(233); + setState(231); ((PredicateContext)_localctx).kind = _input.LT(1); _la = _input.LA(1); if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << LIKE) | (1L << LIKE_INSENSITIVE) | (1L << REGEX) | (1L << REGEX_INSENSITIVE) | (1L << SEQ))) != 0)) ) { @@ -1793,14 +1790,14 @@ public final PredicateContext predicate() throws RecognitionException { _errHandler.reportMatch(this); consume(); } - setState(234); + setState(232); constant(); } break; case 3: enterOuterAlt(_localctx, 3); { - setState(235); + setState(233); ((PredicateContext)_localctx).kind = _input.LT(1); _la = _input.LA(1); if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << LIKE) | (1L << LIKE_INSENSITIVE) | (1L << REGEX) | (1L << REGEX_INSENSITIVE) | (1L << SEQ))) != 0)) ) { @@ -1811,27 +1808,27 @@ public final PredicateContext predicate() throws RecognitionException { _errHandler.reportMatch(this); consume(); } - setState(236); + setState(234); match(LP); - setState(237); + setState(235); constant(); - setState(242); + setState(240); _errHandler.sync(this); _la = _input.LA(1); while (_la==COMMA) { { { - setState(238); + setState(236); match(COMMA); - setState(239); + setState(237); constant(); } } - setState(244); + setState(242); _errHandler.sync(this); _la = _input.LA(1); } - setState(245); + setState(243); match(RP); } break; @@ -1942,14 +1939,14 @@ public final PrimaryExpressionContext primaryExpression() throws RecognitionExce PrimaryExpressionContext _localctx = new PrimaryExpressionContext(_ctx, getState()); enterRule(_localctx, 38, RULE_primaryExpression); try { - setState(256); + setState(254); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,29,_ctx) ) { case 1: _localctx = new ConstantDefaultContext(_localctx); enterOuterAlt(_localctx, 1); { - setState(249); + setState(247); constant(); } break; @@ -1957,7 +1954,7 @@ public final PrimaryExpressionContext primaryExpression() throws RecognitionExce _localctx = new FunctionContext(_localctx); enterOuterAlt(_localctx, 2); { - setState(250); + setState(248); functionExpression(); } break; @@ -1965,7 +1962,7 @@ public final PrimaryExpressionContext primaryExpression() throws RecognitionExce _localctx = new DereferenceContext(_localctx); enterOuterAlt(_localctx, 3); { - setState(251); + setState(249); qualifiedName(); } break; @@ -1973,11 +1970,11 @@ public final PrimaryExpressionContext primaryExpression() throws RecognitionExce _localctx = new ParenthesizedExpressionContext(_localctx); enterOuterAlt(_localctx, 4); { - setState(252); + setState(250); match(LP); - setState(253); + setState(251); expression(); - setState(254); + setState(252); match(RP); } break; @@ -2037,37 +2034,37 @@ public final FunctionExpressionContext functionExpression() throws RecognitionEx try { enterOuterAlt(_localctx, 1); { - setState(258); + setState(256); ((FunctionExpressionContext)_localctx).name = functionName(); - setState(259); + setState(257); match(LP); - setState(268); + setState(266); _errHandler.sync(this); _la = _input.LA(1); if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << FALSE) | (1L << NOT) | (1L << NULL) | (1L << TRUE) | (1L << PLUS) | (1L << MINUS) | (1L << LP) | (1L << STRING) | (1L << INTEGER_VALUE) | (1L << DECIMAL_VALUE) | (1L << IDENTIFIER) | (1L << QUOTED_IDENTIFIER) | (1L << TILDE_IDENTIFIER))) != 0)) { { - setState(260); + setState(258); expression(); - setState(265); + setState(263); _errHandler.sync(this); _la = _input.LA(1); while (_la==COMMA) { { { - setState(261); + setState(259); match(COMMA); - setState(262); + setState(260); expression(); } } - setState(267); + setState(265); _errHandler.sync(this); _la = _input.LA(1); } } } - setState(270); + setState(268); match(RP); } } @@ -2111,7 +2108,7 @@ public final FunctionNameContext functionName() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(272); + setState(270); _la = _input.LA(1); if ( !(_la==IDENTIFIER || _la==TILDE_IDENTIFIER) ) { _errHandler.recoverInline(this); @@ -2224,14 +2221,14 @@ public final ConstantContext constant() throws RecognitionException { ConstantContext _localctx = new ConstantContext(_ctx, getState()); enterRule(_localctx, 44, RULE_constant); try { - setState(278); + setState(276); _errHandler.sync(this); switch (_input.LA(1)) { case NULL: _localctx = new NullLiteralContext(_localctx); enterOuterAlt(_localctx, 1); { - setState(274); + setState(272); match(NULL); } break; @@ -2240,7 +2237,7 @@ public final ConstantContext constant() throws RecognitionException { _localctx = new NumericLiteralContext(_localctx); enterOuterAlt(_localctx, 2); { - setState(275); + setState(273); number(); } break; @@ -2249,7 +2246,7 @@ public final ConstantContext constant() throws RecognitionException { _localctx = new BooleanLiteralContext(_localctx); enterOuterAlt(_localctx, 3); { - setState(276); + setState(274); booleanValue(); } break; @@ -2257,7 +2254,7 @@ public final ConstantContext constant() throws RecognitionException { _localctx = new StringLiteralContext(_localctx); enterOuterAlt(_localctx, 4); { - setState(277); + setState(275); string(); } break; @@ -2309,7 +2306,7 @@ public final ComparisonOperatorContext comparisonOperator() throws RecognitionEx try { enterOuterAlt(_localctx, 1); { - setState(280); + setState(278); _la = _input.LA(1); if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << EQ) | (1L << NEQ) | (1L << LT) | (1L << LTE) | (1L << GT) | (1L << GTE))) != 0)) ) { _errHandler.recoverInline(this); @@ -2361,7 +2358,7 @@ public final BooleanValueContext booleanValue() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(282); + setState(280); _la = _input.LA(1); if ( !(_la==FALSE || _la==TRUE) ) { _errHandler.recoverInline(this); @@ -2434,44 +2431,44 @@ public final QualifiedNameContext qualifiedName() throws RecognitionException { int _alt; enterOuterAlt(_localctx, 1); { - setState(284); + setState(282); identifier(); - setState(296); + setState(294); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,35,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { if ( _alt==1 ) { { - setState(294); + setState(292); _errHandler.sync(this); switch (_input.LA(1)) { case DOT: { - setState(285); + setState(283); match(DOT); - setState(286); + setState(284); identifier(); } break; case LB: { - setState(287); + setState(285); match(LB); - setState(289); + setState(287); _errHandler.sync(this); _la = _input.LA(1); do { { { - setState(288); + setState(286); match(INTEGER_VALUE); } } - setState(291); + setState(289); _errHandler.sync(this); _la = _input.LA(1); } while ( _la==INTEGER_VALUE ); - setState(293); + setState(291); match(RB); } break; @@ -2480,7 +2477,7 @@ public final QualifiedNameContext qualifiedName() throws RecognitionException { } } } - setState(298); + setState(296); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,35,_ctx); } @@ -2526,7 +2523,7 @@ public final IdentifierContext identifier() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(299); + setState(297); _la = _input.LA(1); if ( !(_la==IDENTIFIER || _la==QUOTED_IDENTIFIER) ) { _errHandler.recoverInline(this); @@ -2581,14 +2578,14 @@ public final TimeUnitContext timeUnit() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(301); + setState(299); number(); - setState(303); + setState(301); _errHandler.sync(this); _la = _input.LA(1); if (_la==IDENTIFIER) { { - setState(302); + setState(300); ((TimeUnitContext)_localctx).unit = match(IDENTIFIER); } } @@ -2656,14 +2653,14 @@ public final NumberContext number() throws RecognitionException { NumberContext _localctx = new NumberContext(_ctx, getState()); enterRule(_localctx, 56, RULE_number); try { - setState(307); + setState(305); _errHandler.sync(this); switch (_input.LA(1)) { case DECIMAL_VALUE: _localctx = new DecimalLiteralContext(_localctx); enterOuterAlt(_localctx, 1); { - setState(305); + setState(303); match(DECIMAL_VALUE); } break; @@ -2671,7 +2668,7 @@ public final NumberContext number() throws RecognitionException { _localctx = new IntegerLiteralContext(_localctx); enterOuterAlt(_localctx, 2); { - setState(306); + setState(304); match(INTEGER_VALUE); } break; @@ -2717,7 +2714,7 @@ public final StringContext string() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(309); + setState(307); match(STRING); } } @@ -2761,7 +2758,7 @@ public final EventValueContext eventValue() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(311); + setState(309); _la = _input.LA(1); if ( !(_la==STRING || _la==IDENTIFIER) ) { _errHandler.recoverInline(this); @@ -2813,7 +2810,7 @@ private boolean operatorExpression_sempred(OperatorExpressionContext _localctx, } public static final String _serializedATN = - "\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3\64\u013c\4\2\t\2"+ + "\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3\64\u013a\4\2\t\2"+ "\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13"+ "\t\13\4\f\t\f\4\r\t\r\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22"+ "\4\23\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31\t\31"+ @@ -2824,105 +2821,104 @@ private boolean operatorExpression_sempred(OperatorExpressionContext _localctx, "\br\n\b\r\b\16\bs\3\b\3\b\5\bx\n\b\3\t\3\t\3\t\3\t\3\t\7\t\177\n\t\f\t"+ "\16\t\u0082\13\t\5\t\u0084\n\t\3\n\3\n\3\n\3\n\7\n\u008a\n\n\f\n\16\n"+ "\u008d\13\n\3\13\3\13\5\13\u0091\n\13\3\f\3\f\5\f\u0095\n\f\3\f\3\f\3"+ - "\f\3\f\3\f\3\f\5\f\u009d\n\f\3\r\3\r\3\r\3\r\3\16\3\16\3\17\3\17\5\17"+ - "\u00a7\n\17\3\17\3\17\3\17\3\20\3\20\3\21\3\21\3\21\3\21\3\21\3\21\3\21"+ - "\5\21\u00b5\n\21\3\21\3\21\3\21\3\21\3\21\3\21\7\21\u00bd\n\21\f\21\16"+ - "\21\u00c0\13\21\3\22\3\22\3\22\3\22\3\22\5\22\u00c7\n\22\3\23\3\23\3\23"+ - "\5\23\u00cc\n\23\3\23\3\23\5\23\u00d0\n\23\3\23\3\23\3\23\3\23\3\23\3"+ - "\23\7\23\u00d8\n\23\f\23\16\23\u00db\13\23\3\24\5\24\u00de\n\24\3\24\3"+ - "\24\3\24\3\24\3\24\7\24\u00e5\n\24\f\24\16\24\u00e8\13\24\3\24\3\24\3"+ - "\24\3\24\3\24\3\24\3\24\3\24\3\24\7\24\u00f3\n\24\f\24\16\24\u00f6\13"+ - "\24\3\24\3\24\5\24\u00fa\n\24\3\25\3\25\3\25\3\25\3\25\3\25\3\25\5\25"+ - "\u0103\n\25\3\26\3\26\3\26\3\26\3\26\7\26\u010a\n\26\f\26\16\26\u010d"+ - "\13\26\5\26\u010f\n\26\3\26\3\26\3\27\3\27\3\30\3\30\3\30\3\30\5\30\u0119"+ - "\n\30\3\31\3\31\3\32\3\32\3\33\3\33\3\33\3\33\3\33\6\33\u0124\n\33\r\33"+ - "\16\33\u0125\3\33\7\33\u0129\n\33\f\33\16\33\u012c\13\33\3\34\3\34\3\35"+ - "\3\35\5\35\u0132\n\35\3\36\3\36\5\36\u0136\n\36\3\37\3\37\3 \3 \3 \2\4"+ - " $!\2\4\6\b\n\f\16\20\22\24\26\30\32\34\36 \"$&(*,.\60\62\64\668:<>\2"+ - "\13\3\2 !\3\2\"$\3\2\7\b\5\2\n\13\21\22\30\30\4\2//\61\61\3\2\32\37\4"+ - "\2\6\6\24\24\3\2/\60\4\2,,//\2\u014a\2@\3\2\2\2\4C\3\2\2\2\6F\3\2\2\2"+ - "\bP\3\2\2\2\nR\3\2\2\2\fW\3\2\2\2\16k\3\2\2\2\20y\3\2\2\2\22\u0085\3\2"+ - "\2\2\24\u008e\3\2\2\2\26\u0092\3\2\2\2\30\u009e\3\2\2\2\32\u00a2\3\2\2"+ - "\2\34\u00a6\3\2\2\2\36\u00ab\3\2\2\2 \u00b4\3\2\2\2\"\u00c6\3\2\2\2$\u00cf"+ - "\3\2\2\2&\u00f9\3\2\2\2(\u0102\3\2\2\2*\u0104\3\2\2\2,\u0112\3\2\2\2."+ - "\u0118\3\2\2\2\60\u011a\3\2\2\2\62\u011c\3\2\2\2\64\u011e\3\2\2\2\66\u012d"+ - "\3\2\2\28\u012f\3\2\2\2:\u0135\3\2\2\2<\u0137\3\2\2\2>\u0139\3\2\2\2@"+ - "A\5\6\4\2AB\7\2\2\3B\3\3\2\2\2CD\5\36\20\2DE\7\2\2\3E\5\3\2\2\2FJ\5\b"+ - "\5\2GI\5\20\t\2HG\3\2\2\2IL\3\2\2\2JH\3\2\2\2JK\3\2\2\2K\7\3\2\2\2LJ\3"+ - "\2\2\2MQ\5\f\7\2NQ\5\16\b\2OQ\5\32\16\2PM\3\2\2\2PN\3\2\2\2PO\3\2\2\2"+ - "Q\t\3\2\2\2RS\7\27\2\2ST\7\f\2\2TU\7\31\2\2UV\58\35\2V\13\3\2\2\2W`\7"+ - "\23\2\2XZ\5\22\n\2Y[\5\n\6\2ZY\3\2\2\2Z[\3\2\2\2[a\3\2\2\2\\^\5\n\6\2"+ - "]_\5\22\n\2^]\3\2\2\2^_\3\2\2\2_a\3\2\2\2`X\3\2\2\2`\\\3\2\2\2`a\3\2\2"+ - "\2ac\3\2\2\2bd\5\26\f\2cb\3\2\2\2de\3\2\2\2ec\3\2\2\2ef\3\2\2\2fi\3\2"+ - "\2\2gh\7\25\2\2hj\5\26\f\2ig\3\2\2\2ij\3\2\2\2j\r\3\2\2\2km\7\t\2\2ln"+ - "\5\22\n\2ml\3\2\2\2mn\3\2\2\2no\3\2\2\2oq\5\24\13\2pr\5\24\13\2qp\3\2"+ - "\2\2rs\3\2\2\2sq\3\2\2\2st\3\2\2\2tw\3\2\2\2uv\7\25\2\2vx\5\24\13\2wu"+ - "\3\2\2\2wx\3\2\2\2x\17\3\2\2\2yz\7+\2\2z\u0083\7/\2\2{\u0080\5 \21\2|"+ - "}\7&\2\2}\177\5 \21\2~|\3\2\2\2\177\u0082\3\2\2\2\u0080~\3\2\2\2\u0080"+ - "\u0081\3\2\2\2\u0081\u0084\3\2\2\2\u0082\u0080\3\2\2\2\u0083{\3\2\2\2"+ - "\u0083\u0084\3\2\2\2\u0084\21\3\2\2\2\u0085\u0086\7\5\2\2\u0086\u008b"+ - "\5\36\20\2\u0087\u0088\7&\2\2\u0088\u008a\5\36\20\2\u0089\u0087\3\2\2"+ - "\2\u008a\u008d\3\2\2\2\u008b\u0089\3\2\2\2\u008b\u008c\3\2\2\2\u008c\23"+ - "\3\2\2\2\u008d\u008b\3\2\2\2\u008e\u0090\5\30\r\2\u008f\u0091\5\22\n\2"+ - "\u0090\u008f\3\2\2\2\u0090\u0091\3\2\2\2\u0091\25\3\2\2\2\u0092\u0094"+ - "\5\30\r\2\u0093\u0095\5\22\n\2\u0094\u0093\3\2\2\2\u0094\u0095\3\2\2\2"+ - "\u0095\u009c\3\2\2\2\u0096\u0097\7\'\2\2\u0097\u0098\7/\2\2\u0098\u0099"+ - "\7\31\2\2\u0099\u009a\5:\36\2\u009a\u009b\7(\2\2\u009b\u009d\3\2\2\2\u009c"+ - "\u0096\3\2\2\2\u009c\u009d\3\2\2\2\u009d\27\3\2\2\2\u009e\u009f\7\'\2"+ - "\2\u009f\u00a0\5\34\17\2\u00a0\u00a1\7(\2\2\u00a1\31\3\2\2\2\u00a2\u00a3"+ - "\5\34\17\2\u00a3\33\3\2\2\2\u00a4\u00a7\7\4\2\2\u00a5\u00a7\5> \2\u00a6"+ - "\u00a4\3\2\2\2\u00a6\u00a5\3\2\2\2\u00a7\u00a8\3\2\2\2\u00a8\u00a9\7\26"+ - "\2\2\u00a9\u00aa\5\36\20\2\u00aa\35\3\2\2\2\u00ab\u00ac\5 \21\2\u00ac"+ - "\37\3\2\2\2\u00ad\u00ae\b\21\1\2\u00ae\u00af\7\r\2\2\u00af\u00b5\5 \21"+ - "\7\u00b0\u00b1\7/\2\2\u00b1\u00b2\7\17\2\2\u00b2\u00b5\5\30\r\2\u00b3"+ - "\u00b5\5\"\22\2\u00b4\u00ad\3\2\2\2\u00b4\u00b0\3\2\2\2\u00b4\u00b3\3"+ - "\2\2\2\u00b5\u00be\3\2\2\2\u00b6\u00b7\f\4\2\2\u00b7\u00b8\7\3\2\2\u00b8"+ - "\u00bd\5 \21\5\u00b9\u00ba\f\3\2\2\u00ba\u00bb\7\20\2\2\u00bb\u00bd\5"+ - " \21\4\u00bc\u00b6\3\2\2\2\u00bc\u00b9\3\2\2\2\u00bd\u00c0\3\2\2\2\u00be"+ - "\u00bc\3\2\2\2\u00be\u00bf\3\2\2\2\u00bf!\3\2\2\2\u00c0\u00be\3\2\2\2"+ - "\u00c1\u00c7\5$\23\2\u00c2\u00c3\5$\23\2\u00c3\u00c4\5\60\31\2\u00c4\u00c5"+ - "\5$\23\2\u00c5\u00c7\3\2\2\2\u00c6\u00c1\3\2\2\2\u00c6\u00c2\3\2\2\2\u00c7"+ - "#\3\2\2\2\u00c8\u00c9\b\23\1\2\u00c9\u00cb\5(\25\2\u00ca\u00cc\5&\24\2"+ - "\u00cb\u00ca\3\2\2\2\u00cb\u00cc\3\2\2\2\u00cc\u00d0\3\2\2\2\u00cd\u00ce"+ - "\t\2\2\2\u00ce\u00d0\5$\23\5\u00cf\u00c8\3\2\2\2\u00cf\u00cd\3\2\2\2\u00d0"+ - "\u00d9\3\2\2\2\u00d1\u00d2\f\4\2\2\u00d2\u00d3\t\3\2\2\u00d3\u00d8\5$"+ - "\23\5\u00d4\u00d5\f\3\2\2\u00d5\u00d6\t\2\2\2\u00d6\u00d8\5$\23\4\u00d7"+ - "\u00d1\3\2\2\2\u00d7\u00d4\3\2\2\2\u00d8\u00db\3\2\2\2\u00d9\u00d7\3\2"+ - "\2\2\u00d9\u00da\3\2\2\2\u00da%\3\2\2\2\u00db\u00d9\3\2\2\2\u00dc\u00de"+ - "\7\r\2\2\u00dd\u00dc\3\2\2\2\u00dd\u00de\3\2\2\2\u00de\u00df\3\2\2\2\u00df"+ - "\u00e0\t\4\2\2\u00e0\u00e1\7)\2\2\u00e1\u00e6\5\36\20\2\u00e2\u00e3\7"+ - "&\2\2\u00e3\u00e5\5\36\20\2\u00e4\u00e2\3\2\2\2\u00e5\u00e8\3\2\2\2\u00e6"+ - "\u00e4\3\2\2\2\u00e6\u00e7\3\2\2\2\u00e7\u00e9\3\2\2\2\u00e8\u00e6\3\2"+ - "\2\2\u00e9\u00ea\7*\2\2\u00ea\u00fa\3\2\2\2\u00eb\u00ec\t\5\2\2\u00ec"+ - "\u00fa\5.\30\2\u00ed\u00ee\t\5\2\2\u00ee\u00ef\7)\2\2\u00ef\u00f4\5.\30"+ - "\2\u00f0\u00f1\7&\2\2\u00f1\u00f3\5.\30\2\u00f2\u00f0\3\2\2\2\u00f3\u00f6"+ - "\3\2\2\2\u00f4\u00f2\3\2\2\2\u00f4\u00f5\3\2\2\2\u00f5\u00f7\3\2\2\2\u00f6"+ - "\u00f4\3\2\2\2\u00f7\u00f8\7*\2\2\u00f8\u00fa\3\2\2\2\u00f9\u00dd\3\2"+ - "\2\2\u00f9\u00eb\3\2\2\2\u00f9\u00ed\3\2\2\2\u00fa\'\3\2\2\2\u00fb\u0103"+ - "\5.\30\2\u00fc\u0103\5*\26\2\u00fd\u0103\5\64\33\2\u00fe\u00ff\7)\2\2"+ - "\u00ff\u0100\5\36\20\2\u0100\u0101\7*\2\2\u0101\u0103\3\2\2\2\u0102\u00fb"+ - "\3\2\2\2\u0102\u00fc\3\2\2\2\u0102\u00fd\3\2\2\2\u0102\u00fe\3\2\2\2\u0103"+ - ")\3\2\2\2\u0104\u0105\5,\27\2\u0105\u010e\7)\2\2\u0106\u010b\5\36\20\2"+ - "\u0107\u0108\7&\2\2\u0108\u010a\5\36\20\2\u0109\u0107\3\2\2\2\u010a\u010d"+ - "\3\2\2\2\u010b\u0109\3\2\2\2\u010b\u010c\3\2\2\2\u010c\u010f\3\2\2\2\u010d"+ - "\u010b\3\2\2\2\u010e\u0106\3\2\2\2\u010e\u010f\3\2\2\2\u010f\u0110\3\2"+ - "\2\2\u0110\u0111\7*\2\2\u0111+\3\2\2\2\u0112\u0113\t\6\2\2\u0113-\3\2"+ - "\2\2\u0114\u0119\7\16\2\2\u0115\u0119\5:\36\2\u0116\u0119\5\62\32\2\u0117"+ - "\u0119\5<\37\2\u0118\u0114\3\2\2\2\u0118\u0115\3\2\2\2\u0118\u0116\3\2"+ - "\2\2\u0118\u0117\3\2\2\2\u0119/\3\2\2\2\u011a\u011b\t\7\2\2\u011b\61\3"+ - "\2\2\2\u011c\u011d\t\b\2\2\u011d\63\3\2\2\2\u011e\u012a\5\66\34\2\u011f"+ - "\u0120\7%\2\2\u0120\u0129\5\66\34\2\u0121\u0123\7\'\2\2\u0122\u0124\7"+ - "-\2\2\u0123\u0122\3\2\2\2\u0124\u0125\3\2\2\2\u0125\u0123\3\2\2\2\u0125"+ - "\u0126\3\2\2\2\u0126\u0127\3\2\2\2\u0127\u0129\7(\2\2\u0128\u011f\3\2"+ - "\2\2\u0128\u0121\3\2\2\2\u0129\u012c\3\2\2\2\u012a\u0128\3\2\2\2\u012a"+ - "\u012b\3\2\2\2\u012b\65\3\2\2\2\u012c\u012a\3\2\2\2\u012d\u012e\t\t\2"+ - "\2\u012e\67\3\2\2\2\u012f\u0131\5:\36\2\u0130\u0132\7/\2\2\u0131\u0130"+ - "\3\2\2\2\u0131\u0132\3\2\2\2\u01329\3\2\2\2\u0133\u0136\7.\2\2\u0134\u0136"+ - "\7-\2\2\u0135\u0133\3\2\2\2\u0135\u0134\3\2\2\2\u0136;\3\2\2\2\u0137\u0138"+ - "\7,\2\2\u0138=\3\2\2\2\u0139\u013a\t\n\2\2\u013a?\3\2\2\2(JPZ^`eimsw\u0080"+ - "\u0083\u008b\u0090\u0094\u009c\u00a6\u00b4\u00bc\u00be\u00c6\u00cb\u00cf"+ - "\u00d7\u00d9\u00dd\u00e6\u00f4\u00f9\u0102\u010b\u010e\u0118\u0125\u0128"+ - "\u012a\u0131\u0135"; + "\f\3\f\5\f\u009b\n\f\3\r\3\r\3\r\3\r\3\16\3\16\3\17\3\17\5\17\u00a5\n"+ + "\17\3\17\3\17\3\17\3\20\3\20\3\21\3\21\3\21\3\21\3\21\3\21\3\21\5\21\u00b3"+ + "\n\21\3\21\3\21\3\21\3\21\3\21\3\21\7\21\u00bb\n\21\f\21\16\21\u00be\13"+ + "\21\3\22\3\22\3\22\3\22\3\22\5\22\u00c5\n\22\3\23\3\23\3\23\5\23\u00ca"+ + "\n\23\3\23\3\23\5\23\u00ce\n\23\3\23\3\23\3\23\3\23\3\23\3\23\7\23\u00d6"+ + "\n\23\f\23\16\23\u00d9\13\23\3\24\5\24\u00dc\n\24\3\24\3\24\3\24\3\24"+ + "\3\24\7\24\u00e3\n\24\f\24\16\24\u00e6\13\24\3\24\3\24\3\24\3\24\3\24"+ + "\3\24\3\24\3\24\3\24\7\24\u00f1\n\24\f\24\16\24\u00f4\13\24\3\24\3\24"+ + "\5\24\u00f8\n\24\3\25\3\25\3\25\3\25\3\25\3\25\3\25\5\25\u0101\n\25\3"+ + "\26\3\26\3\26\3\26\3\26\7\26\u0108\n\26\f\26\16\26\u010b\13\26\5\26\u010d"+ + "\n\26\3\26\3\26\3\27\3\27\3\30\3\30\3\30\3\30\5\30\u0117\n\30\3\31\3\31"+ + "\3\32\3\32\3\33\3\33\3\33\3\33\3\33\6\33\u0122\n\33\r\33\16\33\u0123\3"+ + "\33\7\33\u0127\n\33\f\33\16\33\u012a\13\33\3\34\3\34\3\35\3\35\5\35\u0130"+ + "\n\35\3\36\3\36\5\36\u0134\n\36\3\37\3\37\3 \3 \3 \2\4 $!\2\4\6\b\n\f"+ + "\16\20\22\24\26\30\32\34\36 \"$&(*,.\60\62\64\668:<>\2\13\3\2 !\3\2\""+ + "$\3\2\7\b\5\2\n\13\21\22\30\30\4\2//\61\61\3\2\32\37\4\2\6\6\24\24\3\2"+ + "/\60\4\2,,//\2\u0148\2@\3\2\2\2\4C\3\2\2\2\6F\3\2\2\2\bP\3\2\2\2\nR\3"+ + "\2\2\2\fW\3\2\2\2\16k\3\2\2\2\20y\3\2\2\2\22\u0085\3\2\2\2\24\u008e\3"+ + "\2\2\2\26\u0092\3\2\2\2\30\u009c\3\2\2\2\32\u00a0\3\2\2\2\34\u00a4\3\2"+ + "\2\2\36\u00a9\3\2\2\2 \u00b2\3\2\2\2\"\u00c4\3\2\2\2$\u00cd\3\2\2\2&\u00f7"+ + "\3\2\2\2(\u0100\3\2\2\2*\u0102\3\2\2\2,\u0110\3\2\2\2.\u0116\3\2\2\2\60"+ + "\u0118\3\2\2\2\62\u011a\3\2\2\2\64\u011c\3\2\2\2\66\u012b\3\2\2\28\u012d"+ + "\3\2\2\2:\u0133\3\2\2\2<\u0135\3\2\2\2>\u0137\3\2\2\2@A\5\6\4\2AB\7\2"+ + "\2\3B\3\3\2\2\2CD\5\36\20\2DE\7\2\2\3E\5\3\2\2\2FJ\5\b\5\2GI\5\20\t\2"+ + "HG\3\2\2\2IL\3\2\2\2JH\3\2\2\2JK\3\2\2\2K\7\3\2\2\2LJ\3\2\2\2MQ\5\f\7"+ + "\2NQ\5\16\b\2OQ\5\32\16\2PM\3\2\2\2PN\3\2\2\2PO\3\2\2\2Q\t\3\2\2\2RS\7"+ + "\27\2\2ST\7\f\2\2TU\7\31\2\2UV\58\35\2V\13\3\2\2\2W`\7\23\2\2XZ\5\22\n"+ + "\2Y[\5\n\6\2ZY\3\2\2\2Z[\3\2\2\2[a\3\2\2\2\\^\5\n\6\2]_\5\22\n\2^]\3\2"+ + "\2\2^_\3\2\2\2_a\3\2\2\2`X\3\2\2\2`\\\3\2\2\2`a\3\2\2\2ac\3\2\2\2bd\5"+ + "\26\f\2cb\3\2\2\2de\3\2\2\2ec\3\2\2\2ef\3\2\2\2fi\3\2\2\2gh\7\25\2\2h"+ + "j\5\26\f\2ig\3\2\2\2ij\3\2\2\2j\r\3\2\2\2km\7\t\2\2ln\5\22\n\2ml\3\2\2"+ + "\2mn\3\2\2\2no\3\2\2\2oq\5\24\13\2pr\5\24\13\2qp\3\2\2\2rs\3\2\2\2sq\3"+ + "\2\2\2st\3\2\2\2tw\3\2\2\2uv\7\25\2\2vx\5\24\13\2wu\3\2\2\2wx\3\2\2\2"+ + "x\17\3\2\2\2yz\7+\2\2z\u0083\7/\2\2{\u0080\5 \21\2|}\7&\2\2}\177\5 \21"+ + "\2~|\3\2\2\2\177\u0082\3\2\2\2\u0080~\3\2\2\2\u0080\u0081\3\2\2\2\u0081"+ + "\u0084\3\2\2\2\u0082\u0080\3\2\2\2\u0083{\3\2\2\2\u0083\u0084\3\2\2\2"+ + "\u0084\21\3\2\2\2\u0085\u0086\7\5\2\2\u0086\u008b\5\36\20\2\u0087\u0088"+ + "\7&\2\2\u0088\u008a\5\36\20\2\u0089\u0087\3\2\2\2\u008a\u008d\3\2\2\2"+ + "\u008b\u0089\3\2\2\2\u008b\u008c\3\2\2\2\u008c\23\3\2\2\2\u008d\u008b"+ + "\3\2\2\2\u008e\u0090\5\30\r\2\u008f\u0091\5\22\n\2\u0090\u008f\3\2\2\2"+ + "\u0090\u0091\3\2\2\2\u0091\25\3\2\2\2\u0092\u0094\5\30\r\2\u0093\u0095"+ + "\5\22\n\2\u0094\u0093\3\2\2\2\u0094\u0095\3\2\2\2\u0095\u009a\3\2\2\2"+ + "\u0096\u0097\7\27\2\2\u0097\u0098\7/\2\2\u0098\u0099\7\31\2\2\u0099\u009b"+ + "\5:\36\2\u009a\u0096\3\2\2\2\u009a\u009b\3\2\2\2\u009b\27\3\2\2\2\u009c"+ + "\u009d\7\'\2\2\u009d\u009e\5\34\17\2\u009e\u009f\7(\2\2\u009f\31\3\2\2"+ + "\2\u00a0\u00a1\5\34\17\2\u00a1\33\3\2\2\2\u00a2\u00a5\7\4\2\2\u00a3\u00a5"+ + "\5> \2\u00a4\u00a2\3\2\2\2\u00a4\u00a3\3\2\2\2\u00a5\u00a6\3\2\2\2\u00a6"+ + "\u00a7\7\26\2\2\u00a7\u00a8\5\36\20\2\u00a8\35\3\2\2\2\u00a9\u00aa\5 "+ + "\21\2\u00aa\37\3\2\2\2\u00ab\u00ac\b\21\1\2\u00ac\u00ad\7\r\2\2\u00ad"+ + "\u00b3\5 \21\7\u00ae\u00af\7/\2\2\u00af\u00b0\7\17\2\2\u00b0\u00b3\5\30"+ + "\r\2\u00b1\u00b3\5\"\22\2\u00b2\u00ab\3\2\2\2\u00b2\u00ae\3\2\2\2\u00b2"+ + "\u00b1\3\2\2\2\u00b3\u00bc\3\2\2\2\u00b4\u00b5\f\4\2\2\u00b5\u00b6\7\3"+ + "\2\2\u00b6\u00bb\5 \21\5\u00b7\u00b8\f\3\2\2\u00b8\u00b9\7\20\2\2\u00b9"+ + "\u00bb\5 \21\4\u00ba\u00b4\3\2\2\2\u00ba\u00b7\3\2\2\2\u00bb\u00be\3\2"+ + "\2\2\u00bc\u00ba\3\2\2\2\u00bc\u00bd\3\2\2\2\u00bd!\3\2\2\2\u00be\u00bc"+ + "\3\2\2\2\u00bf\u00c5\5$\23\2\u00c0\u00c1\5$\23\2\u00c1\u00c2\5\60\31\2"+ + "\u00c2\u00c3\5$\23\2\u00c3\u00c5\3\2\2\2\u00c4\u00bf\3\2\2\2\u00c4\u00c0"+ + "\3\2\2\2\u00c5#\3\2\2\2\u00c6\u00c7\b\23\1\2\u00c7\u00c9\5(\25\2\u00c8"+ + "\u00ca\5&\24\2\u00c9\u00c8\3\2\2\2\u00c9\u00ca\3\2\2\2\u00ca\u00ce\3\2"+ + "\2\2\u00cb\u00cc\t\2\2\2\u00cc\u00ce\5$\23\5\u00cd\u00c6\3\2\2\2\u00cd"+ + "\u00cb\3\2\2\2\u00ce\u00d7\3\2\2\2\u00cf\u00d0\f\4\2\2\u00d0\u00d1\t\3"+ + "\2\2\u00d1\u00d6\5$\23\5\u00d2\u00d3\f\3\2\2\u00d3\u00d4\t\2\2\2\u00d4"+ + "\u00d6\5$\23\4\u00d5\u00cf\3\2\2\2\u00d5\u00d2\3\2\2\2\u00d6\u00d9\3\2"+ + "\2\2\u00d7\u00d5\3\2\2\2\u00d7\u00d8\3\2\2\2\u00d8%\3\2\2\2\u00d9\u00d7"+ + "\3\2\2\2\u00da\u00dc\7\r\2\2\u00db\u00da\3\2\2\2\u00db\u00dc\3\2\2\2\u00dc"+ + "\u00dd\3\2\2\2\u00dd\u00de\t\4\2\2\u00de\u00df\7)\2\2\u00df\u00e4\5\36"+ + "\20\2\u00e0\u00e1\7&\2\2\u00e1\u00e3\5\36\20\2\u00e2\u00e0\3\2\2\2\u00e3"+ + "\u00e6\3\2\2\2\u00e4\u00e2\3\2\2\2\u00e4\u00e5\3\2\2\2\u00e5\u00e7\3\2"+ + "\2\2\u00e6\u00e4\3\2\2\2\u00e7\u00e8\7*\2\2\u00e8\u00f8\3\2\2\2\u00e9"+ + "\u00ea\t\5\2\2\u00ea\u00f8\5.\30\2\u00eb\u00ec\t\5\2\2\u00ec\u00ed\7)"+ + "\2\2\u00ed\u00f2\5.\30\2\u00ee\u00ef\7&\2\2\u00ef\u00f1\5.\30\2\u00f0"+ + "\u00ee\3\2\2\2\u00f1\u00f4\3\2\2\2\u00f2\u00f0\3\2\2\2\u00f2\u00f3\3\2"+ + "\2\2\u00f3\u00f5\3\2\2\2\u00f4\u00f2\3\2\2\2\u00f5\u00f6\7*\2\2\u00f6"+ + "\u00f8\3\2\2\2\u00f7\u00db\3\2\2\2\u00f7\u00e9\3\2\2\2\u00f7\u00eb\3\2"+ + "\2\2\u00f8\'\3\2\2\2\u00f9\u0101\5.\30\2\u00fa\u0101\5*\26\2\u00fb\u0101"+ + "\5\64\33\2\u00fc\u00fd\7)\2\2\u00fd\u00fe\5\36\20\2\u00fe\u00ff\7*\2\2"+ + "\u00ff\u0101\3\2\2\2\u0100\u00f9\3\2\2\2\u0100\u00fa\3\2\2\2\u0100\u00fb"+ + "\3\2\2\2\u0100\u00fc\3\2\2\2\u0101)\3\2\2\2\u0102\u0103\5,\27\2\u0103"+ + "\u010c\7)\2\2\u0104\u0109\5\36\20\2\u0105\u0106\7&\2\2\u0106\u0108\5\36"+ + "\20\2\u0107\u0105\3\2\2\2\u0108\u010b\3\2\2\2\u0109\u0107\3\2\2\2\u0109"+ + "\u010a\3\2\2\2\u010a\u010d\3\2\2\2\u010b\u0109\3\2\2\2\u010c\u0104\3\2"+ + "\2\2\u010c\u010d\3\2\2\2\u010d\u010e\3\2\2\2\u010e\u010f\7*\2\2\u010f"+ + "+\3\2\2\2\u0110\u0111\t\6\2\2\u0111-\3\2\2\2\u0112\u0117\7\16\2\2\u0113"+ + "\u0117\5:\36\2\u0114\u0117\5\62\32\2\u0115\u0117\5<\37\2\u0116\u0112\3"+ + "\2\2\2\u0116\u0113\3\2\2\2\u0116\u0114\3\2\2\2\u0116\u0115\3\2\2\2\u0117"+ + "/\3\2\2\2\u0118\u0119\t\7\2\2\u0119\61\3\2\2\2\u011a\u011b\t\b\2\2\u011b"+ + "\63\3\2\2\2\u011c\u0128\5\66\34\2\u011d\u011e\7%\2\2\u011e\u0127\5\66"+ + "\34\2\u011f\u0121\7\'\2\2\u0120\u0122\7-\2\2\u0121\u0120\3\2\2\2\u0122"+ + "\u0123\3\2\2\2\u0123\u0121\3\2\2\2\u0123\u0124\3\2\2\2\u0124\u0125\3\2"+ + "\2\2\u0125\u0127\7(\2\2\u0126\u011d\3\2\2\2\u0126\u011f\3\2\2\2\u0127"+ + "\u012a\3\2\2\2\u0128\u0126\3\2\2\2\u0128\u0129\3\2\2\2\u0129\65\3\2\2"+ + "\2\u012a\u0128\3\2\2\2\u012b\u012c\t\t\2\2\u012c\67\3\2\2\2\u012d\u012f"+ + "\5:\36\2\u012e\u0130\7/\2\2\u012f\u012e\3\2\2\2\u012f\u0130\3\2\2\2\u0130"+ + "9\3\2\2\2\u0131\u0134\7.\2\2\u0132\u0134\7-\2\2\u0133\u0131\3\2\2\2\u0133"+ + "\u0132\3\2\2\2\u0134;\3\2\2\2\u0135\u0136\7,\2\2\u0136=\3\2\2\2\u0137"+ + "\u0138\t\n\2\2\u0138?\3\2\2\2(JPZ^`eimsw\u0080\u0083\u008b\u0090\u0094"+ + "\u009a\u00a4\u00b2\u00ba\u00bc\u00c4\u00c9\u00cd\u00d5\u00d7\u00db\u00e4"+ + "\u00f2\u00f7\u0100\u0109\u010c\u0116\u0123\u0126\u0128\u012f\u0133"; public static final ATN _ATN = new ATNDeserializer().deserialize(_serializedATN.toCharArray()); static { diff --git a/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/parser/LogicalPlanTests.java b/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/parser/LogicalPlanTests.java index b5267a3241c90..d88da21a9efe2 100644 --- a/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/parser/LogicalPlanTests.java +++ b/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/parser/LogicalPlanTests.java @@ -180,7 +180,7 @@ public void testQuotedEventType() { } public void testRepeatedQuery() throws Exception { - LogicalPlan plan = parser.createStatement("sequence " + " [any where true] [runs=2]" + " [any where true]"); + LogicalPlan plan = parser.createStatement("sequence " + " [any where true] with runs=2" + " [any where true]"); plan = defaultPipes(plan); assertEquals(Sequence.class, plan.getClass()); Sequence seq = (Sequence) plan; diff --git a/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/planner/QueryTranslatorFailTests.java b/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/planner/QueryTranslatorFailTests.java index bfd66f28337bc..6fdd8fd7b7737 100644 --- a/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/planner/QueryTranslatorFailTests.java +++ b/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/planner/QueryTranslatorFailTests.java @@ -222,9 +222,9 @@ public void testSequenceWithTooLittleQueries() throws Exception { } public void testSequenceWithIncorrectOption() throws Exception { - EqlClientException e = expectThrows(EqlClientException.class, () -> plan("sequence [any where true] [repeat=123]")); + EqlClientException e = expectThrows(EqlClientException.class, () -> plan("sequence [any where true] with repeat=123")); String msg = e.getMessage(); - assertEquals("line 1:29: Unrecognized option [repeat], expecting [runs]", msg); + assertEquals("line 1:33: Unrecognized option [repeat], expecting [runs]", msg); } } From d2cae33074c0eed0597944358c75670fb3c56086 Mon Sep 17 00:00:00 2001 From: Yang Wang Date: Mon, 11 Oct 2021 16:39:04 +1100 Subject: [PATCH 245/250] Add v7 restCompat for invalidating API key with the id field (#78664) This PR restore the id field for InvaliateApiKey API so it can be used if the request explicitly requires v7 compatibility. Relates: #66671 --- x-pack/plugin/build.gradle | 1 - .../apikey/RestInvalidateApiKeyAction.java | 51 ++++++++++++++++--- 2 files changed, 44 insertions(+), 8 deletions(-) diff --git a/x-pack/plugin/build.gradle b/x-pack/plugin/build.gradle index 41c8a8479a952..7acd20167747d 100644 --- a/x-pack/plugin/build.gradle +++ b/x-pack/plugin/build.gradle @@ -98,7 +98,6 @@ tasks.named("yamlRestTestV7CompatTransform").configure{ task -> task.skipTest("rollup/put_job/Test basic put_job", "rollup was an experimental feature, also see #41227") task.skipTest("rollup/start_job/Test start job twice", "rollup was an experimental feature, also see #41227") task.skipTest("ml/trained_model_cat_apis/Test cat trained models", "A type field was added to cat.ml_trained_models #73660, this is a backwards compatible change. Still this is a cat api, and we don't support them with rest api compatibility. (the test would be very hard to transform too)") - task.skipTest("api_key/10_basic/Test invalidate api keys with single id", "waiting for https://github.com/elastic/elasticsearch/pull/78664") task.replaceKeyInDo("license.delete", "xpack-license.delete") task.replaceKeyInDo("license.get", "xpack-license.get") diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/apikey/RestInvalidateApiKeyAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/apikey/RestInvalidateApiKeyAction.java index 7c11cba8f3349..9bdfa9540ccc7 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/apikey/RestInvalidateApiKeyAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/apikey/RestInvalidateApiKeyAction.java @@ -8,8 +8,10 @@ package org.elasticsearch.xpack.security.rest.action.apikey; import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.xcontent.ParseField; +import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.core.RestApiVersion; +import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.xcontent.ConstructingObjectParser; import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xcontent.XContentParser; @@ -42,11 +44,7 @@ public final class RestInvalidateApiKeyAction extends SecurityBaseRestHandler { }); static { - PARSER.declareString(ConstructingObjectParser.optionalConstructorArg(), new ParseField("realm_name")); - PARSER.declareString(ConstructingObjectParser.optionalConstructorArg(), new ParseField("username")); - PARSER.declareString(ConstructingObjectParser.optionalConstructorArg(), new ParseField("name")); - PARSER.declareBoolean(ConstructingObjectParser.optionalConstructorArg(), new ParseField("owner")); - PARSER.declareStringArray(ConstructingObjectParser.optionalConstructorArg(), new ParseField("ids")); + initObjectParser(PARSER, false); } public RestInvalidateApiKeyAction(Settings settings, XPackLicenseState licenseState) { @@ -61,7 +59,7 @@ public List routes() { @Override protected RestChannelConsumer innerPrepareRequest(RestRequest request, NodeClient client) throws IOException { try (XContentParser parser = request.contentParser()) { - final InvalidateApiKeyRequest invalidateApiKeyRequest = PARSER.parse(parser, null); + final InvalidateApiKeyRequest invalidateApiKeyRequest = getObjectParser(request).parse(parser, null); return channel -> client.execute(InvalidateApiKeyAction.INSTANCE, invalidateApiKeyRequest, new RestBuilderListener(channel) { @Override @@ -78,4 +76,43 @@ public RestResponse buildResponse(InvalidateApiKeyResponse invalidateResp, public String getName() { return "xpack_security_invalidate_api_key"; } + + private ConstructingObjectParser getObjectParser(RestRequest request) { + if (request.getRestApiVersion() == RestApiVersion.V_7) { + final ConstructingObjectParser objectParser = new ConstructingObjectParser<>( + "invalidate_api_key_v7", a -> { + final String id = (String) a[5]; + @SuppressWarnings("unchecked") + final List ids = (List) a[4]; + if (id != null && ids != null) { + throw new IllegalArgumentException("Must use either [id] or [ids], not both at the same time"); + } + final String[] idsArray; + if (Strings.hasText(id)) { + idsArray = new String[] { id }; + } else if (ids != null) { + idsArray = ids.toArray(String[]::new); + } else { + idsArray = null; + } + return new InvalidateApiKeyRequest((String) a[0], (String) a[1], (String) a[2], + (a[3] == null) ? false : (Boolean) a[3], idsArray); + }); + initObjectParser(objectParser, true); + return objectParser; + } else { + return PARSER; + } + } + + private static void initObjectParser(ConstructingObjectParser objectParser, boolean restCompatMode) { + objectParser.declareString(ConstructingObjectParser.optionalConstructorArg(), new ParseField("realm_name")); + objectParser.declareString(ConstructingObjectParser.optionalConstructorArg(), new ParseField("username")); + objectParser.declareString(ConstructingObjectParser.optionalConstructorArg(), new ParseField("name")); + objectParser.declareBoolean(ConstructingObjectParser.optionalConstructorArg(), new ParseField("owner")); + objectParser.declareStringArray(ConstructingObjectParser.optionalConstructorArg(), new ParseField("ids")); + if (restCompatMode) { + objectParser.declareString(ConstructingObjectParser.optionalConstructorArg(), new ParseField("id").withAllDeprecated("ids")); + } + } } From 5f737a975952c448093cdd2b17ed97ea9a12a69b Mon Sep 17 00:00:00 2001 From: weizijun Date: Mon, 11 Oct 2021 15:31:47 +0800 Subject: [PATCH 246/250] Add @Override annotations to methods in EnrichPlugin class (#76873) --- .../main/java/org/elasticsearch/xpack/enrich/EnrichPlugin.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/EnrichPlugin.java b/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/EnrichPlugin.java index ea0b58a46afc1..a6d1ab15245ec 100644 --- a/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/EnrichPlugin.java +++ b/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/EnrichPlugin.java @@ -148,6 +148,7 @@ protected XPackLicenseState getLicenseState() { return XPackPlugin.getSharedLicenseState(); } + @Override public List> getActions() { return List.of( new ActionHandler<>(XPackInfoFeatureAction.ENRICH, EnrichInfoTransportAction.class), @@ -165,6 +166,7 @@ protected XPackLicenseState getLicenseState() { ); } + @Override public List getRestHandlers( Settings settings, RestController restController, @@ -236,6 +238,7 @@ public List getNamedWriteables() { ); } + @Override public List getNamedXContent() { return List.of( new NamedXContentRegistry.Entry(Metadata.Custom.class, new ParseField(EnrichMetadata.TYPE), EnrichMetadata::fromXContent) From 2e69f6d8208d0a695033762a84941f51089b1dbc Mon Sep 17 00:00:00 2001 From: Rene Groeschke Date: Mon, 11 Oct 2021 10:16:03 +0200 Subject: [PATCH 247/250] Simplify TestCluster extraJar configuration (#78837) Allow passing FileCollection instead of single Jar files. This makes using the API way easier as gradle configurations for resolving jars do not need to be resolved eagerly --- .../src/main/groovy/elasticsearch.fips.gradle | 16 +++++--------- .../gradle/TestClustersPluginFuncTest.groovy | 2 +- .../testclusters/ElasticsearchCluster.java | 5 +++-- .../testclusters/ElasticsearchNode.java | 21 ++++++++++++------- .../TestClusterConfiguration.java | 3 ++- 5 files changed, 24 insertions(+), 23 deletions(-) diff --git a/build-tools-internal/src/main/groovy/elasticsearch.fips.gradle b/build-tools-internal/src/main/groovy/elasticsearch.fips.gradle index 95608301d255f..51f7b65c549a9 100644 --- a/build-tools-internal/src/main/groovy/elasticsearch.fips.gradle +++ b/build-tools-internal/src/main/groovy/elasticsearch.fips.gradle @@ -31,26 +31,20 @@ if (BuildParams.inFipsJvm) { copy 'fips_java.policy' copy 'cacerts.bcfks' } + def extraFipsJarsConfiguration = configurations.detachedConfiguration(bcFips, bcTlsFips) project.afterEvaluate { - def extraFipsJars = configurations.detachedConfiguration(bcFips, bcTlsFips) // ensure that bouncycastle is on classpath for the all of test types, must happen in evaluateAfter since the rest tests explicitly // set the class path to help maintain pure black box testing, and here we are adding to that classpath tasks.withType(Test).configureEach { Test test -> - test.setClasspath(test.getClasspath().plus(extraFipsJars)) + test.setClasspath(test.getClasspath().plus(extraFipsJarsConfiguration)) } } pluginManager.withPlugin("elasticsearch.testclusters") { - afterEvaluate { - // This afterEvaluate hooks is required to avoid deprecated configuration resolution - // This configuration can be removed once system modules are available - def extraFipsJars = configurations.detachedConfiguration(bcFips, bcTlsFips) - testClusters.configureEach { - extraFipsJars.files.each { - extraJarFile it - } - } + // This configuration can be removed once system modules are available + testClusters.configureEach { + extraJarFiles extraFipsJarsConfiguration } tasks.withType(TestClustersAware).configureEach { dependsOn 'fipsResources' diff --git a/build-tools/src/integTest/groovy/org/elasticsearch/gradle/TestClustersPluginFuncTest.groovy b/build-tools/src/integTest/groovy/org/elasticsearch/gradle/TestClustersPluginFuncTest.groovy index 1fcc36172a417..38188104d8b0b 100644 --- a/build-tools/src/integTest/groovy/org/elasticsearch/gradle/TestClustersPluginFuncTest.groovy +++ b/build-tools/src/integTest/groovy/org/elasticsearch/gradle/TestClustersPluginFuncTest.groovy @@ -206,7 +206,7 @@ class TestClustersPluginFuncTest extends AbstractGradleFuncTest { testClusters { myCluster { testDistribution = 'default' - extraJarFile(file('${someJar().absolutePath}')) + extraJarFiles(files('${someJar().absolutePath}')) } } diff --git a/build-tools/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchCluster.java b/build-tools/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchCluster.java index b3cb26b9890ca..c68a9d2528218 100644 --- a/build-tools/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchCluster.java +++ b/build-tools/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchCluster.java @@ -14,6 +14,7 @@ import org.gradle.api.NamedDomainObjectContainer; import org.gradle.api.Project; import org.gradle.api.file.ArchiveOperations; +import org.gradle.api.file.FileCollection; import org.gradle.api.file.FileSystemOperations; import org.gradle.api.file.RegularFile; import org.gradle.api.logging.Logger; @@ -391,8 +392,8 @@ public void extraConfigFile(String destination, File from, PropertyNormalization } @Override - public void extraJarFile(File from) { - nodes.all(node -> node.extraJarFile(from)); + public void extraJarFiles(FileCollection from) { + nodes.all(node -> node.extraJarFiles(from)); } @Override diff --git a/build-tools/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchNode.java b/build-tools/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchNode.java index a30c551040612..97d234dccb017 100644 --- a/build-tools/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchNode.java +++ b/build-tools/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchNode.java @@ -140,7 +140,7 @@ public class ElasticsearchNode implements TestClusterConfiguration { private final LazyPropertyMap environment = new LazyPropertyMap<>("Environment", this); private final LazyPropertyList jvmArgs = new LazyPropertyList<>("JVM arguments", this); private final LazyPropertyMap extraConfigFiles = new LazyPropertyMap<>("Extra config files", this, FileEntry::new); - private final LazyPropertyList extraJarFiles = new LazyPropertyList<>("Extra jar files", this); + private final LazyPropertyList extraJarConfigurations = new LazyPropertyList<>("Extra jar files", this); private final List> credentials = new ArrayList<>(); final LinkedHashMap defaultConfig = new LinkedHashMap<>(); @@ -585,7 +585,7 @@ public synchronized void start() { private boolean canUseSharedDistribution() { // using original location can be too long due to MAX_PATH restrictions on windows CI // TODO revisit when moving to shorter paths on CI by using Teamcity - return OS.current() != OS.WINDOWS && extraJarFiles.size() == 0 && modules.size() == 0 && plugins.size() == 0; + return OS.current() != OS.WINDOWS && extraJarConfigurations.size() == 0 && modules.size() == 0 && plugins.size() == 0; } private void logToProcessStdout(String message) { @@ -648,10 +648,18 @@ private void copyExtraConfigFiles() { * //TODO: Remove this when system modules are available */ private void copyExtraJars() { + List extraJarFiles = this.extraJarConfigurations.stream() + .flatMap(fileCollection -> fileCollection.getFiles().stream()) + .collect(Collectors.toList()); + if (extraJarFiles.isEmpty() == false) { - logToProcessStdout("Setting up " + extraJarFiles.size() + " additional jar dependencies"); + logToProcessStdout("Setting up " + this.extraJarConfigurations.size() + " additional jar dependencies"); } extraJarFiles.forEach(from -> { + if (from.getName().endsWith(".jar") == false) { + throw new IllegalArgumentException("extra jar file " + from.toString() + " doesn't appear to be a JAR"); + } + Path destination = getDistroDir().resolve("lib").resolve(from.getName()); try { Files.copy(from.toPath(), destination, StandardCopyOption.REPLACE_EXISTING); @@ -700,11 +708,8 @@ public void extraConfigFile(String destination, File from, PropertyNormalization } @Override - public void extraJarFile(File from) { - if (from.toString().endsWith(".jar") == false) { - throw new IllegalArgumentException("extra jar file " + from.toString() + " doesn't appear to be a JAR"); - } - extraJarFiles.add(from); + public void extraJarFiles(FileCollection from) { + extraJarConfigurations.add(from); } @Override diff --git a/build-tools/src/main/java/org/elasticsearch/gradle/testclusters/TestClusterConfiguration.java b/build-tools/src/main/java/org/elasticsearch/gradle/testclusters/TestClusterConfiguration.java index 55406d6a1a676..6b5ebc61058c2 100644 --- a/build-tools/src/main/java/org/elasticsearch/gradle/testclusters/TestClusterConfiguration.java +++ b/build-tools/src/main/java/org/elasticsearch/gradle/testclusters/TestClusterConfiguration.java @@ -9,6 +9,7 @@ import org.elasticsearch.gradle.FileSupplier; import org.elasticsearch.gradle.PropertyNormalization; +import org.gradle.api.file.FileCollection; import org.gradle.api.file.RegularFile; import org.gradle.api.logging.Logging; import org.gradle.api.provider.Provider; @@ -90,7 +91,7 @@ public interface TestClusterConfiguration { void extraConfigFile(String destination, File from, PropertyNormalization normalization); - void extraJarFile(File from); + void extraJarFiles(FileCollection from); void user(Map userSpec); From 68ee6d4fe102334168865c64d39a08c6e239f50f Mon Sep 17 00:00:00 2001 From: Armin Braun Date: Mon, 11 Oct 2021 10:50:32 +0200 Subject: [PATCH 248/250] Introduce a Few Settings Singleton Instances (#78897) This is mostly motivated by the ILM steps changes, that showed up as hot in profiling since instantiating a `Settings` instance turns out to be somewhat expensive. Also cleans up a couple of other spots and some duplication as well. --- .../client/indices/CreateIndexRequest.java | 4 +- .../client/indices/IndexTemplateMetadata.java | 2 +- .../indices/PutIndexTemplateRequest.java | 4 +- .../recovery/SimpleRecoveryIT.java | 2 +- .../put/PutRepositoryRequest.java | 3 +- .../ClusterUpdateSettingsRequest.java | 5 +- .../restore/RestoreSnapshotRequest.java | 3 +- .../CreateIndexClusterStateUpdateRequest.java | 2 +- .../indices/create/CreateIndexRequest.java | 5 +- .../rollover/MetadataRolloverService.java | 4 +- .../settings/put/UpdateSettingsRequest.java | 3 +- .../template/put/PutIndexTemplateRequest.java | 3 +- .../cluster/metadata/IndexMetadata.java | 2 +- .../metadata/IndexTemplateMetadata.java | 2 +- .../cluster/metadata/Metadata.java | 4 +- .../MetadataCreateDataStreamService.java | 4 +- .../MetadataIndexTemplateService.java | 2 +- .../cluster/routing/allocation/DataTier.java | 46 ++++++++++++++++--- .../allocation/DiskThresholdMonitor.java | 10 ++-- .../common/settings/Settings.java | 2 - .../index/analysis/AnalysisRegistry.java | 2 +- .../org/elasticsearch/plugins/Plugin.java | 2 +- .../allocation/BalanceConfigurationTests.java | 2 +- .../index/IndexSortSettingsTests.java | 3 +- .../index/MergePolicySettingsTests.java | 5 +- .../cluster/ESAllocationTestCase.java | 2 +- .../analysis/MyFilterTokenFilterFactory.java | 2 +- .../xpack/core/ilm/ForceMergeAction.java | 13 +++--- .../xpack/core/ilm/MigrateAction.java | 6 +-- .../xpack/core/ilm/RolloverAction.java | 6 +-- .../xpack/core/ilm/SetPriorityAction.java | 5 +- .../rollup/v2/TransportRollupAction.java | 13 +++--- 32 files changed, 100 insertions(+), 73 deletions(-) diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/CreateIndexRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/CreateIndexRequest.java index 3e979b26e1ac4..758eb480935cb 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/CreateIndexRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/CreateIndexRequest.java @@ -36,8 +36,6 @@ import java.util.Objects; import java.util.Set; -import static org.elasticsearch.common.settings.Settings.Builder.EMPTY_SETTINGS; - /** * A request to create an index. */ @@ -47,7 +45,7 @@ public class CreateIndexRequest extends TimedRequest implements Validatable, ToX static final ParseField ALIASES = new ParseField("aliases"); private final String index; - private Settings settings = EMPTY_SETTINGS; + private Settings settings = Settings.EMPTY; private BytesReference mappings; private XContentType mappingsXContentType; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/IndexTemplateMetadata.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/IndexTemplateMetadata.java index 3733a712d3d4e..1017986beb544 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/IndexTemplateMetadata.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/IndexTemplateMetadata.java @@ -178,7 +178,7 @@ public static class Builder { private List indexPatterns; - private Settings settings = Settings.Builder.EMPTY_SETTINGS; + private Settings settings = Settings.EMPTY; private MappingMetadata mappings; diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/PutIndexTemplateRequest.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/PutIndexTemplateRequest.java index 76f4e4d1ec136..0bf518501e476 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/PutIndexTemplateRequest.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/indices/PutIndexTemplateRequest.java @@ -36,8 +36,6 @@ import java.util.Set; import java.util.stream.Collectors; -import static org.elasticsearch.common.settings.Settings.Builder.EMPTY_SETTINGS; - /** * A request to create an index template. */ @@ -53,7 +51,7 @@ public class PutIndexTemplateRequest extends TimedRequest implements ToXContentF private boolean create; - private Settings settings = EMPTY_SETTINGS; + private Settings settings = Settings.EMPTY; private BytesReference mappings = null; diff --git a/server/src/internalClusterTest/java/org/elasticsearch/recovery/SimpleRecoveryIT.java b/server/src/internalClusterTest/java/org/elasticsearch/recovery/SimpleRecoveryIT.java index 26da1657631f5..8231c733e08ce 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/recovery/SimpleRecoveryIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/recovery/SimpleRecoveryIT.java @@ -29,7 +29,7 @@ public Settings indexSettings() { } protected Settings recoverySettings() { - return Settings.Builder.EMPTY_SETTINGS; + return Settings.EMPTY; } @Override diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/put/PutRepositoryRequest.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/put/PutRepositoryRequest.java index 3aa500403062c..00acf3d04b83d 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/put/PutRepositoryRequest.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/put/PutRepositoryRequest.java @@ -21,7 +21,6 @@ import java.util.Map; import static org.elasticsearch.action.ValidateActions.addValidationError; -import static org.elasticsearch.common.settings.Settings.Builder.EMPTY_SETTINGS; import static org.elasticsearch.common.settings.Settings.readSettingsFromStream; import static org.elasticsearch.common.settings.Settings.writeSettingsToStream; @@ -39,7 +38,7 @@ public class PutRepositoryRequest extends AcknowledgedRequest r.transientSettings = t, (p, c) -> Settings.fromXContent(p), TRANSIENT); } - private Settings transientSettings = EMPTY_SETTINGS; - private Settings persistentSettings = EMPTY_SETTINGS; + private Settings transientSettings = Settings.EMPTY; + private Settings persistentSettings = Settings.EMPTY; public ClusterUpdateSettingsRequest(StreamInput in) throws IOException { super(in); diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/restore/RestoreSnapshotRequest.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/restore/RestoreSnapshotRequest.java index b22ec18234e1c..8eb5f6d48ecc2 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/restore/RestoreSnapshotRequest.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/restore/RestoreSnapshotRequest.java @@ -28,7 +28,6 @@ import java.util.Objects; import static org.elasticsearch.action.ValidateActions.addValidationError; -import static org.elasticsearch.common.settings.Settings.Builder.EMPTY_SETTINGS; import static org.elasticsearch.common.settings.Settings.readSettingsFromStream; import static org.elasticsearch.common.settings.Settings.writeSettingsToStream; import static org.elasticsearch.common.xcontent.support.XContentMapValues.nodeBooleanValue; @@ -49,7 +48,7 @@ public class RestoreSnapshotRequest extends MasterNodeRequest private String index; - private Settings settings = EMPTY_SETTINGS; + private Settings settings = Settings.EMPTY; private String mappings = "{}"; @@ -116,7 +115,7 @@ public CreateIndexRequest() { * @param index the name of the index */ public CreateIndexRequest(String index) { - this(index, EMPTY_SETTINGS); + this(index, Settings.EMPTY); } /** diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/MetadataRolloverService.java b/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/MetadataRolloverService.java index ef0586717ad87..c0354d0f404ee 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/MetadataRolloverService.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/rollover/MetadataRolloverService.java @@ -53,6 +53,8 @@ public class MetadataRolloverService { private static final Pattern INDEX_NAME_PATTERN = Pattern.compile("^.*-\\d+$"); private static final List VALID_ROLLOVER_TARGETS = List.of(ALIAS, DATA_STREAM); + public static final Settings HIDDEN_INDEX_SETTINGS = Settings.builder().put(IndexMetadata.SETTING_INDEX_HIDDEN, true).build(); + private final ThreadPool threadPool; private final MetadataCreateIndexService createIndexService; private final MetadataIndexAliasesService indexAliasesService; @@ -272,7 +274,7 @@ static CreateIndexClusterStateUpdateRequest prepareDataStreamCreateIndexRequest( final String targetIndexName, CreateIndexRequest createIndexRequest, final SystemDataStreamDescriptor descriptor) { - Settings settings = descriptor != null ? Settings.EMPTY : Settings.builder().put("index.hidden", true).build(); + Settings settings = descriptor != null ? Settings.EMPTY : HIDDEN_INDEX_SETTINGS; return prepareCreateIndexRequest(targetIndexName, targetIndexName, "rollover_data_stream", createIndexRequest, settings) .dataStreamName(dataStreamName) .systemDataStreamDescriptor(descriptor); diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/settings/put/UpdateSettingsRequest.java b/server/src/main/java/org/elasticsearch/action/admin/indices/settings/put/UpdateSettingsRequest.java index f2e5a17ef1800..810b00e78e16b 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/settings/put/UpdateSettingsRequest.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/settings/put/UpdateSettingsRequest.java @@ -31,7 +31,6 @@ import static org.elasticsearch.action.ValidateActions.addValidationError; import static org.elasticsearch.common.settings.Settings.readSettingsFromStream; import static org.elasticsearch.common.settings.Settings.writeSettingsToStream; -import static org.elasticsearch.common.settings.Settings.Builder.EMPTY_SETTINGS; /** * Request for an update index settings action @@ -43,7 +42,7 @@ public class UpdateSettingsRequest extends AcknowledgedRequest mappings; private final ImmutableOpenMap.Builder aliases; private final ImmutableOpenMap.Builder customMetadata; diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/IndexTemplateMetadata.java b/server/src/main/java/org/elasticsearch/cluster/metadata/IndexTemplateMetadata.java index e817a9c47af3e..a3237bb47791d 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/IndexTemplateMetadata.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/IndexTemplateMetadata.java @@ -245,7 +245,7 @@ public static class Builder { private List indexPatterns; - private Settings settings = Settings.Builder.EMPTY_SETTINGS; + private Settings settings = Settings.EMPTY; private final ImmutableOpenMap.Builder mappings; diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/Metadata.java b/server/src/main/java/org/elasticsearch/cluster/metadata/Metadata.java index d00d3dd27d9af..754ff3511eecc 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/Metadata.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/Metadata.java @@ -1029,8 +1029,8 @@ public static class Builder { private long version; private CoordinationMetadata coordinationMetadata = CoordinationMetadata.EMPTY_METADATA; - private Settings transientSettings = Settings.Builder.EMPTY_SETTINGS; - private Settings persistentSettings = Settings.Builder.EMPTY_SETTINGS; + private Settings transientSettings = Settings.EMPTY; + private Settings persistentSettings = Settings.EMPTY; private DiffableStringMap hashesOfConsistentSettings = DiffableStringMap.EMPTY; private final ImmutableOpenMap.Builder indices; diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/MetadataCreateDataStreamService.java b/server/src/main/java/org/elasticsearch/cluster/metadata/MetadataCreateDataStreamService.java index afa88ec61e729..0521937047981 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/MetadataCreateDataStreamService.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/MetadataCreateDataStreamService.java @@ -13,6 +13,7 @@ import org.elasticsearch.ResourceAlreadyExistsException; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.admin.indices.create.CreateIndexClusterStateUpdateRequest; +import org.elasticsearch.action.admin.indices.rollover.MetadataRolloverService; import org.elasticsearch.action.support.ActiveShardCount; import org.elasticsearch.action.support.ActiveShardsObserver; import org.elasticsearch.action.support.master.AcknowledgedResponse; @@ -22,7 +23,6 @@ import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.Priority; import org.elasticsearch.common.Strings; -import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; import org.elasticsearch.index.Index; import org.elasticsearch.index.mapper.DataStreamTimestampFieldMapper; @@ -195,7 +195,7 @@ static ClusterState createDataStream(MetadataCreateIndexService metadataCreateIn .systemDataStreamDescriptor(systemDataStreamDescriptor); if (isSystem == false) { - createIndexRequest.settings(Settings.builder().put("index.hidden", true).build()); + createIndexRequest.settings(MetadataRolloverService.HIDDEN_INDEX_SETTINGS); } try { diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/MetadataIndexTemplateService.java b/server/src/main/java/org/elasticsearch/cluster/metadata/MetadataIndexTemplateService.java index 5da664fae55f3..1b928f81cebd0 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/MetadataIndexTemplateService.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/MetadataIndexTemplateService.java @@ -1424,7 +1424,7 @@ public static class PutRequest { int order; Integer version; List indexPatterns; - Settings settings = Settings.Builder.EMPTY_SETTINGS; + Settings settings = Settings.EMPTY; String mappings = null; List aliases = new ArrayList<>(); diff --git a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/DataTier.java b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/DataTier.java index 34bda24bde330..9a1ab49f55748 100644 --- a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/DataTier.java +++ b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/DataTier.java @@ -21,12 +21,12 @@ import org.elasticsearch.snapshots.SearchableSnapshotsSettings; import java.util.Collection; +import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; import java.util.function.Function; -import java.util.stream.Collectors; /** * The {@code DataTier} class encapsulates the formalization of the "content", @@ -46,6 +46,12 @@ public class DataTier { public static final String TIER_PREFERENCE = "index.routing.allocation.include._tier_preference"; + private static final Settings DATA_CONTENT_TIER_PREFERENCE_SETTINGS = Settings.builder().put(TIER_PREFERENCE, DATA_CONTENT).build(); + + private static final Settings DATA_HOT_TIER_PREFERENCE_SETTINGS = Settings.builder().put(TIER_PREFERENCE, DATA_HOT).build(); + + private static final Settings NULL_TIER_PREFERENCE_SETTINGS = Settings.builder().putNull(TIER_PREFERENCE).build(); + public static final Setting TIER_PREFERENCE_SETTING = new Setting<>( new Setting.SimpleKey(TIER_PREFERENCE), DataTierSettingValidator::getDefaultTierPreference, @@ -66,6 +72,24 @@ public class DataTier { // Represents an ordered list of data tiers from frozen to hot (or slow to fast) private static final List ORDERED_FROZEN_TO_HOT_TIERS = List.of(DATA_FROZEN, DATA_COLD, DATA_WARM, DATA_HOT); + private static final Map PREFERENCE_TIER_CONFIGURATIONS; + + private static final Map PREFERENCE_TIER_CONFIGURATION_SETTINGS; + + static { + final Map tmp = new HashMap<>(); + final Map tmpSettings = new HashMap<>(); + for (int i = 0, ordered_frozen_to_hot_tiersSize = ORDERED_FROZEN_TO_HOT_TIERS.size(); i < ordered_frozen_to_hot_tiersSize; i++) { + String tier = ORDERED_FROZEN_TO_HOT_TIERS.get(i); + final String prefTierString = + String.join(",", ORDERED_FROZEN_TO_HOT_TIERS.subList(i, ORDERED_FROZEN_TO_HOT_TIERS.size())).intern(); + tmp.put(tier, prefTierString); + tmpSettings.put(tier, Settings.builder().put(DataTier.TIER_PREFERENCE, prefTierString).build()); + } + PREFERENCE_TIER_CONFIGURATIONS = Map.copyOf(tmp); + PREFERENCE_TIER_CONFIGURATION_SETTINGS = Map.copyOf(tmpSettings); + } + /** * Returns true if the given tier name is a valid tier */ @@ -79,11 +103,19 @@ public static boolean validTierName(String tierName) { * This is usually used in conjunction with {@link #TIER_PREFERENCE_SETTING}. */ public static String getPreferredTiersConfiguration(String targetTier) { - int indexOfTargetTier = ORDERED_FROZEN_TO_HOT_TIERS.indexOf(targetTier); - if (indexOfTargetTier == -1) { + final String res = PREFERENCE_TIER_CONFIGURATIONS.get(targetTier); + if (res == null) { + throw new IllegalArgumentException("invalid data tier [" + targetTier + "]"); + } + return res; + } + + public static Settings getPreferredTiersConfigurationSettings(String targetTier) { + final Settings res = PREFERENCE_TIER_CONFIGURATION_SETTINGS.get(targetTier); + if (res == null) { throw new IllegalArgumentException("invalid data tier [" + targetTier + "]"); } - return ORDERED_FROZEN_TO_HOT_TIERS.stream().skip(indexOfTargetTier).collect(Collectors.joining(",")); + return res; } /** @@ -155,7 +187,7 @@ public Settings getAdditionalIndexSettings(String indexName, boolean isDataStrea Set settings = indexSettings.keySet(); if (settings.contains(TIER_PREFERENCE)) { // just a marker -- this null value will be removed or overridden by the template/request settings - return Settings.builder().putNull(TIER_PREFERENCE).build(); + return NULL_TIER_PREFERENCE_SETTINGS; } else if (settings.stream().anyMatch(s -> s.startsWith(IndexMetadata.INDEX_ROUTING_REQUIRE_GROUP_PREFIX + ".")) || settings.stream().anyMatch(s -> s.startsWith(IndexMetadata.INDEX_ROUTING_EXCLUDE_GROUP_PREFIX + ".")) || settings.stream().anyMatch(s -> s.startsWith(IndexMetadata.INDEX_ROUTING_INCLUDE_GROUP_PREFIX + "."))) { @@ -167,9 +199,9 @@ public Settings getAdditionalIndexSettings(String indexName, boolean isDataStrea // tier if the index is part of a data stream, the "content" // tier if it is not. if (isDataStreamIndex) { - return Settings.builder().put(TIER_PREFERENCE, DATA_HOT).build(); + return DATA_HOT_TIER_PREFERENCE_SETTINGS; } else { - return Settings.builder().put(TIER_PREFERENCE, DATA_CONTENT).build(); + return DATA_CONTENT_TIER_PREFERENCE_SETTINGS; } } } diff --git a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/DiskThresholdMonitor.java b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/DiskThresholdMonitor.java index cf10c7f268d0b..26805e0175de6 100644 --- a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/DiskThresholdMonitor.java +++ b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/DiskThresholdMonitor.java @@ -56,6 +56,12 @@ public class DiskThresholdMonitor { private static final Logger logger = LogManager.getLogger(DiskThresholdMonitor.class); + private static final Settings READ_ONLY_ALLOW_DELETE_SETTINGS = Settings.builder() + .put(IndexMetadata.SETTING_READ_ONLY_ALLOW_DELETE, Boolean.TRUE.toString()).build(); + + private static final Settings NOT_READ_ONLY_ALLOW_DELETE_SETTINGS = + Settings.builder().putNull(IndexMetadata.SETTING_READ_ONLY_ALLOW_DELETE).build(); + private final DiskThresholdSettings diskThresholdSettings; private final Client client; private final Supplier clusterStateSupplier; @@ -351,9 +357,7 @@ protected void updateIndicesReadOnly(Set indicesToUpdate, ActionListener setLastRunTimeMillis(); listener.onFailure(e); }); - Settings readOnlySettings = readOnly ? Settings.builder() - .put(IndexMetadata.SETTING_READ_ONLY_ALLOW_DELETE, Boolean.TRUE.toString()).build() : - Settings.builder().putNull(IndexMetadata.SETTING_READ_ONLY_ALLOW_DELETE).build(); + Settings readOnlySettings = readOnly ? READ_ONLY_ALLOW_DELETE_SETTINGS : NOT_READ_ONLY_ALLOW_DELETE_SETTINGS; client.admin().indices().prepareUpdateSettings(indicesToUpdate.toArray(Strings.EMPTY_ARRAY)) .setSettings(readOnlySettings) .execute(wrappedListener.map(r -> null)); diff --git a/server/src/main/java/org/elasticsearch/common/settings/Settings.java b/server/src/main/java/org/elasticsearch/common/settings/Settings.java index f0944017818ad..4596aca5383c4 100644 --- a/server/src/main/java/org/elasticsearch/common/settings/Settings.java +++ b/server/src/main/java/org/elasticsearch/common/settings/Settings.java @@ -731,8 +731,6 @@ public Set keySet() { */ public static class Builder { - public static final Settings EMPTY_SETTINGS = new Builder().build(); - // we use a sorted map for consistent serialization when using getAsMap() private final Map map = new TreeMap<>(); diff --git a/server/src/main/java/org/elasticsearch/index/analysis/AnalysisRegistry.java b/server/src/main/java/org/elasticsearch/index/analysis/AnalysisRegistry.java index e81f02ea6a36c..991976a267077 100644 --- a/server/src/main/java/org/elasticsearch/index/analysis/AnalysisRegistry.java +++ b/server/src/main/java/org/elasticsearch/index/analysis/AnalysisRegistry.java @@ -532,7 +532,7 @@ public IndexAnalyzers build(IndexSettings indexSettings, if (analyzers.containsKey(DEFAULT_ANALYZER_NAME) == false) { analyzers.put(DEFAULT_ANALYZER_NAME, produceAnalyzer(DEFAULT_ANALYZER_NAME, - new StandardAnalyzerProvider(indexSettings, null, DEFAULT_ANALYZER_NAME, Settings.Builder.EMPTY_SETTINGS), + new StandardAnalyzerProvider(indexSettings, null, DEFAULT_ANALYZER_NAME, Settings.EMPTY), tokenFilterFactoryFactories, charFilterFactoryFactories, tokenizerFactoryFactories)); } NamedAnalyzer defaultAnalyzer = analyzers.get(DEFAULT_ANALYZER_NAME); diff --git a/server/src/main/java/org/elasticsearch/plugins/Plugin.java b/server/src/main/java/org/elasticsearch/plugins/Plugin.java index 88b0180b3b304..581b64c2e1b30 100644 --- a/server/src/main/java/org/elasticsearch/plugins/Plugin.java +++ b/server/src/main/java/org/elasticsearch/plugins/Plugin.java @@ -93,7 +93,7 @@ public Collection createComponents(Client client, ClusterService cluster * overwritten with the additional settings. These settings added if they don't exist. */ public Settings additionalSettings() { - return Settings.Builder.EMPTY_SETTINGS; + return Settings.EMPTY; } /** diff --git a/server/src/test/java/org/elasticsearch/cluster/routing/allocation/BalanceConfigurationTests.java b/server/src/test/java/org/elasticsearch/cluster/routing/allocation/BalanceConfigurationTests.java index a82749ca53432..4eccd82807a33 100644 --- a/server/src/test/java/org/elasticsearch/cluster/routing/allocation/BalanceConfigurationTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/routing/allocation/BalanceConfigurationTests.java @@ -264,7 +264,7 @@ public void testPersistedSettings() { public void testNoRebalanceOnPrimaryOverload() { Settings.Builder settings = Settings.builder(); AllocationService strategy = new AllocationService(randomAllocationDeciders(settings.build(), - new ClusterSettings(Settings.Builder.EMPTY_SETTINGS, ClusterSettings.BUILT_IN_CLUSTER_SETTINGS), random()), + new ClusterSettings(Settings.EMPTY, ClusterSettings.BUILT_IN_CLUSTER_SETTINGS), random()), new TestGatewayAllocator(), new ShardsAllocator() { /* * // this allocator tries to rebuild this scenario where a rebalance is diff --git a/server/src/test/java/org/elasticsearch/index/IndexSortSettingsTests.java b/server/src/test/java/org/elasticsearch/index/IndexSortSettingsTests.java index 00b0a8f8e164d..56d638cfc72df 100644 --- a/server/src/test/java/org/elasticsearch/index/IndexSortSettingsTests.java +++ b/server/src/test/java/org/elasticsearch/index/IndexSortSettingsTests.java @@ -28,7 +28,6 @@ import java.util.Collections; import java.util.function.Supplier; -import static org.elasticsearch.common.settings.Settings.Builder.EMPTY_SETTINGS; import static org.elasticsearch.index.IndexSettingsTests.newIndexMeta; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; @@ -40,7 +39,7 @@ private static IndexSettings indexSettings(Settings settings) { } public void testNoIndexSort() { - IndexSettings indexSettings = indexSettings(EMPTY_SETTINGS); + IndexSettings indexSettings = indexSettings(Settings.EMPTY); assertFalse(indexSettings.getIndexSortConfig().hasIndexSort()); } diff --git a/server/src/test/java/org/elasticsearch/index/MergePolicySettingsTests.java b/server/src/test/java/org/elasticsearch/index/MergePolicySettingsTests.java index 5396b0b880b49..0ac4001546953 100644 --- a/server/src/test/java/org/elasticsearch/index/MergePolicySettingsTests.java +++ b/server/src/test/java/org/elasticsearch/index/MergePolicySettingsTests.java @@ -16,7 +16,6 @@ import java.io.IOException; -import static org.elasticsearch.common.settings.Settings.Builder.EMPTY_SETTINGS; import static org.elasticsearch.index.IndexSettingsTests.newIndexMeta; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; @@ -54,7 +53,7 @@ public void testNoMerges() { } public void testUpdateSettings() throws IOException { - IndexSettings indexSettings = indexSettings(EMPTY_SETTINGS); + IndexSettings indexSettings = indexSettings(Settings.EMPTY); assertThat(indexSettings.getMergePolicy().getNoCFSRatio(), equalTo(0.1)); indexSettings = indexSettings(build(0.9)); assertThat((indexSettings.getMergePolicy()).getNoCFSRatio(), equalTo(0.9)); @@ -123,7 +122,7 @@ public void testTieredMergePolicySettingsUpdate() throws IOException { Settings.builder().put(MergePolicyConfig.INDEX_MERGE_POLICY_DELETES_PCT_ALLOWED_SETTING.getKey(), 53).build()))); final Throwable cause = exc.getCause(); assertThat(cause.getMessage(), containsString("must be <= 50.0")); - indexSettings.updateIndexMetadata(newIndexMeta("index", EMPTY_SETTINGS)); // see if defaults are restored + indexSettings.updateIndexMetadata(newIndexMeta("index", Settings.EMPTY)); // see if defaults are restored assertEquals(((EsTieredMergePolicy) indexSettings.getMergePolicy()).getForceMergeDeletesPctAllowed(), MergePolicyConfig.DEFAULT_EXPUNGE_DELETES_ALLOWED, 0.0d); assertEquals(((EsTieredMergePolicy) indexSettings.getMergePolicy()).getFloorSegmentMB(), diff --git a/test/framework/src/main/java/org/elasticsearch/cluster/ESAllocationTestCase.java b/test/framework/src/main/java/org/elasticsearch/cluster/ESAllocationTestCase.java index 1d6bc2b7b1dc6..4bbd085ab93f1 100644 --- a/test/framework/src/main/java/org/elasticsearch/cluster/ESAllocationTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/cluster/ESAllocationTestCase.java @@ -59,7 +59,7 @@ public Long getShardSize(ShardRouting shardRouting) { }; public static MockAllocationService createAllocationService() { - return createAllocationService(Settings.Builder.EMPTY_SETTINGS); + return createAllocationService(Settings.EMPTY); } public static MockAllocationService createAllocationService(Settings settings) { diff --git a/test/framework/src/main/java/org/elasticsearch/index/analysis/MyFilterTokenFilterFactory.java b/test/framework/src/main/java/org/elasticsearch/index/analysis/MyFilterTokenFilterFactory.java index c0bbeea51f3e0..388dac78f07db 100644 --- a/test/framework/src/main/java/org/elasticsearch/index/analysis/MyFilterTokenFilterFactory.java +++ b/test/framework/src/main/java/org/elasticsearch/index/analysis/MyFilterTokenFilterFactory.java @@ -17,7 +17,7 @@ public class MyFilterTokenFilterFactory extends AbstractTokenFilterFactory { public MyFilterTokenFilterFactory(IndexSettings indexSettings, Environment env, String name, Settings settings) { - super(indexSettings, name, Settings.Builder.EMPTY_SETTINGS); + super(indexSettings, name, Settings.EMPTY); } @Override diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/ForceMergeAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/ForceMergeAction.java index a34f22fe6918d..ab29f891f2269 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/ForceMergeAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/ForceMergeAction.java @@ -35,6 +35,11 @@ public class ForceMergeAction implements LifecycleAction { private static final Logger logger = LogManager.getLogger(ForceMergeAction.class); + private static final Settings READ_ONLY_SETTINGS = Settings.builder().put(IndexMetadata.SETTING_BLOCKS_WRITE, true).build(); + + private static final Settings BEST_COMPRESSION_SETTINGS = + Settings.builder().put(EngineConfig.INDEX_CODEC_SETTING.getKey(), CodecService.BEST_COMPRESSION_CODEC).build(); + public static final String NAME = "forcemerge"; public static final ParseField MAX_NUM_SEGMENTS_FIELD = new ParseField("max_num_segments"); public static final ParseField CODEC = new ParseField("index_codec"); @@ -113,10 +118,6 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws @Override public List toSteps(Client client, String phase, Step.StepKey nextStepKey) { - Settings readOnlySettings = Settings.builder().put(IndexMetadata.SETTING_BLOCKS_WRITE, true).build(); - Settings bestCompressionSettings = Settings.builder() - .put(EngineConfig.INDEX_CODEC_SETTING.getKey(), CodecService.BEST_COMPRESSION_CODEC).build(); - final boolean codecChange = codec != null && codec.equals(CodecService.BEST_COMPRESSION_CODEC); StepKey preForceMergeBranchingKey = new StepKey(phase, NAME, CONDITIONAL_SKIP_FORCE_MERGE_STEP); @@ -146,11 +147,11 @@ public List toSteps(Client client, String phase, Step.StepKey nextStepKey) CheckNotDataStreamWriteIndexStep checkNotWriteIndexStep = new CheckNotDataStreamWriteIndexStep(checkNotWriteIndex, readOnlyKey); UpdateSettingsStep readOnlyStep = - new UpdateSettingsStep(readOnlyKey, codecChange ? closeKey : forceMergeKey, client, readOnlySettings); + new UpdateSettingsStep(readOnlyKey, codecChange ? closeKey : forceMergeKey, client, READ_ONLY_SETTINGS); CloseIndexStep closeIndexStep = new CloseIndexStep(closeKey, updateCompressionKey, client); UpdateSettingsStep updateBestCompressionSettings = new UpdateSettingsStep(updateCompressionKey, - openKey, client, bestCompressionSettings); + openKey, client, BEST_COMPRESSION_SETTINGS); OpenIndexStep openIndexStep = new OpenIndexStep(openKey, waitForGreenIndexKey, client); WaitForIndexColorStep waitForIndexGreenStep = new WaitForIndexColorStep(waitForGreenIndexKey, forceMergeKey, ClusterHealthStatus.GREEN); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/MigrateAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/MigrateAction.java index 4765d26c773ef..2210f03db46e5 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/MigrateAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/MigrateAction.java @@ -25,7 +25,7 @@ import java.util.List; import java.util.Objects; -import static org.elasticsearch.cluster.routing.allocation.DataTier.getPreferredTiersConfiguration; +import static org.elasticsearch.cluster.routing.allocation.DataTier.getPreferredTiersConfigurationSettings; /** * A {@link LifecycleAction} which enables or disables the automatic migration of data between @@ -115,9 +115,7 @@ public List toSteps(Client client, String phase, StepKey nextStepKey) { return false; }); UpdateSettingsStep updateMigrationSettingStep = new UpdateSettingsStep(migrationKey, migrationRoutedKey, client, - Settings.builder() - .put(DataTier.TIER_PREFERENCE, getPreferredTiersConfiguration(targetTier)) - .build()); + getPreferredTiersConfigurationSettings(targetTier)); DataTierMigrationRoutedStep migrationRoutedStep = new DataTierMigrationRoutedStep(migrationRoutedKey, nextStepKey); return List.of(conditionalSkipActionStep, updateMigrationSettingStep, migrationRoutedStep); } else { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/RolloverAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/RolloverAction.java index f9b151361b091..038aec6477938 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/RolloverAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/RolloverAction.java @@ -41,6 +41,8 @@ public class RolloverAction implements LifecycleAction { public static final Setting LIFECYCLE_ROLLOVER_ALIAS_SETTING = Setting.simpleString(LIFECYCLE_ROLLOVER_ALIAS, Setting.Property.Dynamic, Setting.Property.IndexScope); + private static final Settings INDEXING_COMPLETE = Settings.builder().put(LifecycleSettings.LIFECYCLE_INDEXING_COMPLETE, true).build(); + private static final ConstructingObjectParser PARSER = new ConstructingObjectParser<>(NAME, a -> new RolloverAction((ByteSizeValue) a[0], (ByteSizeValue) a[1], (TimeValue) a[2], (Long) a[3])); @@ -155,8 +157,6 @@ public boolean isSafeAction() { @Override public List toSteps(Client client, String phase, Step.StepKey nextStepKey) { - Settings indexingComplete = Settings.builder().put(LifecycleSettings.LIFECYCLE_INDEXING_COMPLETE, true).build(); - StepKey waitForRolloverReadyStepKey = new StepKey(phase, NAME, WaitForRolloverReadyStep.NAME); StepKey rolloverStepKey = new StepKey(phase, NAME, RolloverStep.NAME); StepKey waitForActiveShardsKey = new StepKey(phase, NAME, WaitForActiveShardsStep.NAME); @@ -170,7 +170,7 @@ public List toSteps(Client client, String phase, Step.StepKey nextStepKey) UpdateRolloverLifecycleDateStep updateDateStep = new UpdateRolloverLifecycleDateStep(updateDateStepKey, setIndexingCompleteStepKey, System::currentTimeMillis); UpdateSettingsStep setIndexingCompleteStep = new UpdateSettingsStep(setIndexingCompleteStepKey, nextStepKey, - client, indexingComplete); + client, INDEXING_COMPLETE); return Arrays.asList(waitForRolloverReadyStep, rolloverStep, waitForActiveShardsStep, updateDateStep, setIndexingCompleteStep); } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/SetPriorityAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/SetPriorityAction.java index 361f5e763daef..e1ad51b4beb46 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/SetPriorityAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/SetPriorityAction.java @@ -35,6 +35,9 @@ public class SetPriorityAction implements LifecycleAction { private static final ConstructingObjectParser PARSER = new ConstructingObjectParser<>(NAME, a -> new SetPriorityAction((Integer) a[0])); + private static final Settings NULL_PRIORITY_SETTINGS = + Settings.builder().putNull(IndexMetadata.INDEX_PRIORITY_SETTING.getKey()).build(); + //package private for testing final Integer recoveryPriority; @@ -90,7 +93,7 @@ public boolean isSafeAction() { public List toSteps(Client client, String phase, StepKey nextStepKey) { StepKey key = new StepKey(phase, NAME, NAME); Settings indexPriority = recoveryPriority == null ? - Settings.builder().putNull(IndexMetadata.INDEX_PRIORITY_SETTING.getKey()).build() + NULL_PRIORITY_SETTINGS : Settings.builder().put(IndexMetadata.INDEX_PRIORITY_SETTING.getKey(), recoveryPriority).build(); return Collections.singletonList(new UpdateSettingsStep(key, nextStepKey, client, indexPriority)); } diff --git a/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/v2/TransportRollupAction.java b/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/v2/TransportRollupAction.java index bc66f834575da..f5e0b7fb5ace8 100644 --- a/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/v2/TransportRollupAction.java +++ b/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/v2/TransportRollupAction.java @@ -10,6 +10,7 @@ import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.admin.indices.create.CreateIndexClusterStateUpdateRequest; import org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest; +import org.elasticsearch.action.admin.indices.rollover.MetadataRolloverService; import org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsRequest; import org.elasticsearch.action.admin.indices.shrink.ResizeRequest; import org.elasticsearch.action.admin.indices.shrink.ResizeType; @@ -68,6 +69,9 @@ */ public class TransportRollupAction extends AcknowledgedTransportMasterNodeAction { + private static final Settings VISIBLE_INDEX_SETTINGS = Settings.builder().put(IndexMetadata.SETTING_INDEX_HIDDEN, false).build(); + private static final Settings WRITE_BLOCKED_SETTINGS = Settings.builder().put(IndexMetadata.SETTING_BLOCKS_WRITE, true).build(); + private final Client client; private final ClusterService clusterService; private final MetadataCreateIndexService metadataCreateIndexService; @@ -140,17 +144,14 @@ protected void masterOperation( "rollup", tmpIndexName, tmpIndexName - ).settings(Settings.builder().put(IndexMetadata.SETTING_INDEX_HIDDEN, true).build()) + ).settings(MetadataRolloverService.HIDDEN_INDEX_SETTINGS) .mappings(XContentHelper.convertToJson(BytesReference.bytes(mapping), false, XContentType.JSON)); RollupIndexerAction.Request rollupIndexerRequest = new RollupIndexerAction.Request(request); ResizeRequest resizeRequest = new ResizeRequest(request.getRollupIndex(), tmpIndexName); resizeRequest.setResizeType(ResizeType.CLONE); - resizeRequest.getTargetIndexRequest().settings(Settings.builder().put(IndexMetadata.SETTING_INDEX_HIDDEN, false).build()); - UpdateSettingsRequest updateSettingsReq = new UpdateSettingsRequest( - Settings.builder().put(IndexMetadata.SETTING_BLOCKS_WRITE, true).build(), - tmpIndexName - ); + resizeRequest.getTargetIndexRequest().settings(VISIBLE_INDEX_SETTINGS); + UpdateSettingsRequest updateSettingsReq = new UpdateSettingsRequest(WRITE_BLOCKED_SETTINGS, tmpIndexName); // 1. validate Rollup Config against Field Caps // 2. create hidden temporary index From 0a6b6d9d68b5903bc806e04aa2d302b290308320 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20Witek?= Date: Mon, 11 Oct 2021 11:55:35 +0200 Subject: [PATCH 249/250] [ML] Make ML indices hidden when the node becomes master (#77416) --- .../MlInitializationServiceIT.java | 116 +++++++++++ .../xpack/ml/MachineLearning.java | 22 ++- .../xpack/ml/MlInitializationService.java | 134 ++++++++++++- .../ml/MlInitializationServiceTests.java | 24 ++- .../MlHiddenIndicesFullClusterRestartIT.java | 185 ++++++++++++++++++ 5 files changed, 474 insertions(+), 7 deletions(-) create mode 100644 x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/MlInitializationServiceIT.java create mode 100644 x-pack/qa/full-cluster-restart/src/test/java/org/elasticsearch/xpack/restart/MlHiddenIndicesFullClusterRestartIT.java diff --git a/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/MlInitializationServiceIT.java b/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/MlInitializationServiceIT.java new file mode 100644 index 0000000000000..a3dc2475ba75a --- /dev/null +++ b/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/MlInitializationServiceIT.java @@ -0,0 +1,116 @@ +/* + * 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.ml.integration; + +import org.elasticsearch.ResourceAlreadyExistsException; +import org.elasticsearch.action.admin.indices.settings.get.GetSettingsResponse; +import org.elasticsearch.action.support.IndicesOptions; +import org.elasticsearch.cluster.metadata.IndexMetadata; +import org.elasticsearch.cluster.service.ClusterService; +import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.common.util.concurrent.EsExecutors; +import org.elasticsearch.threadpool.ThreadPool; +import org.elasticsearch.xpack.ml.MachineLearning; +import org.elasticsearch.xpack.ml.MlDailyMaintenanceService; +import org.elasticsearch.xpack.ml.MlInitializationService; +import org.junit.Before; + +import java.util.Arrays; +import java.util.Collections; +import java.util.stream.Stream; + +import static org.elasticsearch.cluster.metadata.IndexMetadata.SETTING_INDEX_HIDDEN; +import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.is; +import static org.hamcrest.Matchers.notNullValue; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +public class MlInitializationServiceIT extends MlNativeAutodetectIntegTestCase { + + private ThreadPool threadPool; + private MlInitializationService mlInitializationService; + + @Before + public void setUpMocks() { + threadPool = mock(ThreadPool.class); + when(threadPool.executor(ThreadPool.Names.SAME)).thenReturn(EsExecutors.DIRECT_EXECUTOR_SERVICE); + when(threadPool.executor(MachineLearning.UTILITY_THREAD_POOL_NAME)).thenReturn(EsExecutors.DIRECT_EXECUTOR_SERVICE); + MlDailyMaintenanceService mlDailyMaintenanceService = mock(MlDailyMaintenanceService.class); + ClusterService clusterService = mock(ClusterService.class); + mlInitializationService = new MlInitializationService(client(), threadPool, mlDailyMaintenanceService, clusterService); + } + + public void testThatMlIndicesBecomeHiddenWhenTheNodeBecomesMaster() throws Exception { + String[] mlHiddenIndexNames = { + ".ml-anomalies-7", + ".ml-state-000001", + ".ml-stats-000001", + ".ml-notifications-000002", + ".ml-annotations-6" + }; + String[] otherIndexNames = { "some-index-1", "some-other-index-2" }; + String[] allIndexNames = Stream.concat(Arrays.stream(mlHiddenIndexNames), Arrays.stream(otherIndexNames)).toArray(String[]::new); + + for (String indexName : mlHiddenIndexNames) { + try { + assertAcked(prepareCreate(indexName).setSettings(Collections.singletonMap(SETTING_INDEX_HIDDEN, randomBoolean()))); + } catch (ResourceAlreadyExistsException e) { + logger.info("Index " + indexName + "already exists: {}", e.getDetailedMessage()); + } + } + createIndex(otherIndexNames); + + GetSettingsResponse settingsResponse = + client().admin().indices().prepareGetSettings(allIndexNames) + .setIndicesOptions(IndicesOptions.LENIENT_EXPAND_OPEN_CLOSED_HIDDEN) + .get(); + assertThat(settingsResponse, is(notNullValue())); + for (String indexName : mlHiddenIndexNames) { + Settings settings = settingsResponse.getIndexToSettings().get(indexName); + assertThat(settings, is(notNullValue())); + } + for (String indexName : otherIndexNames) { + Settings settings = settingsResponse.getIndexToSettings().get(indexName); + assertThat(settings, is(notNullValue())); + assertThat( + "Index " + indexName + " expected not to be hidden but was", + settings.getAsBoolean(SETTING_INDEX_HIDDEN, false), is(equalTo(false))); + } + + mlInitializationService.onMaster(); + assertBusy(() -> assertTrue(mlInitializationService.areMlInternalIndicesHidden())); + + settingsResponse = + client().admin().indices().prepareGetSettings(allIndexNames) + .setIndicesOptions(IndicesOptions.LENIENT_EXPAND_OPEN_CLOSED_HIDDEN) + .get(); + assertThat(settingsResponse, is(notNullValue())); + for (String indexName : mlHiddenIndexNames) { + Settings settings = settingsResponse.getIndexToSettings().get(indexName); + assertThat(settings, is(notNullValue())); + assertThat( + "Index " + indexName + " expected to be hidden but wasn't, settings = " + settings, + settings.getAsBoolean(SETTING_INDEX_HIDDEN, false), is(equalTo(true))); + } + for (String indexName : otherIndexNames) { + Settings settings = settingsResponse.getIndexToSettings().get(indexName); + assertThat(settings, is(notNullValue())); + assertThat( + "Index " + indexName + " expected not to be hidden but was, settings = " + settings, + settings.getAsBoolean(SETTING_INDEX_HIDDEN, false), is(equalTo(false))); + } + } + + @Override + public Settings indexSettings() { + return Settings.builder().put(super.indexSettings()) + .put(IndexMetadata.SETTING_DATA_PATH, (String) null) + .build(); + } +} diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/MachineLearning.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/MachineLearning.java index bf3b71b0eb93d..0ab1a628ea285 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/MachineLearning.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/MachineLearning.java @@ -1419,15 +1419,29 @@ public static SystemIndexDescriptor getInferenceIndexSecurityDescriptor() { .build(); } - @Override - public Collection getAssociatedIndexDescriptors() { - return List.of( + /** + * These are the ML hidden indices. They are "associated" in the sense that if the ML system indices + * are backed up or deleted then these hidden indices should also be backed up or deleted. + */ + private static Collection ASSOCIATED_INDEX_DESCRIPTORS = + List.of( new AssociatedIndexDescriptor(RESULTS_INDEX_PREFIX + "*", "Results indices"), new AssociatedIndexDescriptor(STATE_INDEX_PREFIX + "*", "State indices"), new AssociatedIndexDescriptor(MlStatsIndex.indexPattern(), "ML stats index"), new AssociatedIndexDescriptor(".ml-notifications*", "ML notifications indices"), - new AssociatedIndexDescriptor(".ml-annotations*", "Ml annotations indices") + new AssociatedIndexDescriptor(".ml-annotations*", "ML annotations indices") ); + + @Override + public Collection getAssociatedIndexDescriptors() { + return ASSOCIATED_INDEX_DESCRIPTORS; + } + + public static String[] getMlHiddenIndexPatterns() { + return ASSOCIATED_INDEX_DESCRIPTORS + .stream() + .map(AssociatedIndexDescriptor::getIndexPattern) + .toArray(String[]::new); } @Override diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/MlInitializationService.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/MlInitializationService.java index b51df785b6e09..d4f6d69a51738 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/MlInitializationService.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/MlInitializationService.java @@ -6,13 +6,27 @@ */ package org.elasticsearch.xpack.ml; +import com.carrotsearch.hppc.cursors.ObjectObjectCursor; + import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.elasticsearch.action.ActionListener; +import org.elasticsearch.action.admin.indices.alias.IndicesAliasesAction; +import org.elasticsearch.action.admin.indices.alias.IndicesAliasesRequest; +import org.elasticsearch.action.admin.indices.alias.get.GetAliasesAction; +import org.elasticsearch.action.admin.indices.alias.get.GetAliasesRequest; +import org.elasticsearch.action.admin.indices.alias.get.GetAliasesResponse; +import org.elasticsearch.action.admin.indices.settings.get.GetSettingsRequest; +import org.elasticsearch.action.admin.indices.settings.get.GetSettingsResponse; +import org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsAction; +import org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsRequest; +import org.elasticsearch.action.support.IndicesOptions; +import org.elasticsearch.action.support.master.AcknowledgedResponse; import org.elasticsearch.action.support.master.MasterNodeRequest; import org.elasticsearch.client.Client; import org.elasticsearch.cluster.ClusterChangedEvent; import org.elasticsearch.cluster.ClusterStateListener; +import org.elasticsearch.cluster.metadata.AliasMetadata; import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.component.LifecycleListener; import org.elasticsearch.common.settings.Settings; @@ -20,15 +34,26 @@ import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.xpack.core.ml.annotations.AnnotationIndex; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Map; import java.util.Objects; import java.util.concurrent.atomic.AtomicBoolean; +import java.util.stream.Collectors; + +import static org.elasticsearch.cluster.metadata.IndexMetadata.SETTING_INDEX_HIDDEN; +import static org.elasticsearch.xpack.core.ClientHelper.ML_ORIGIN; +import static org.elasticsearch.xpack.core.ClientHelper.executeAsyncWithOrigin; -class MlInitializationService implements ClusterStateListener { +public class MlInitializationService implements ClusterStateListener { private static final Logger logger = LogManager.getLogger(MlInitializationService.class); private final Client client; + private final ThreadPool threadPool; private final AtomicBoolean isIndexCreationInProgress = new AtomicBoolean(false); + private final AtomicBoolean mlInternalIndicesHidden = new AtomicBoolean(false); private final MlDailyMaintenanceService mlDailyMaintenanceService; @@ -37,6 +62,7 @@ class MlInitializationService implements ClusterStateListener { MlInitializationService(Settings settings, ThreadPool threadPool, ClusterService clusterService, Client client, MlAssignmentNotifier mlAssignmentNotifier) { this(client, + threadPool, new MlDailyMaintenanceService( settings, Objects.requireNonNull(clusterService).getClusterName(), @@ -49,8 +75,10 @@ class MlInitializationService implements ClusterStateListener { } // For testing - MlInitializationService(Client client, MlDailyMaintenanceService dailyMaintenanceService, ClusterService clusterService) { + public MlInitializationService(Client client, ThreadPool threadPool, MlDailyMaintenanceService dailyMaintenanceService, + ClusterService clusterService) { this.client = Objects.requireNonNull(client); + this.threadPool = threadPool; this.mlDailyMaintenanceService = dailyMaintenanceService; clusterService.addListener(this); clusterService.addLifecycleListener(new LifecycleListener() { @@ -71,6 +99,7 @@ public void beforeStop() { public void onMaster() { mlDailyMaintenanceService.start(); + threadPool.executor(MachineLearning.UTILITY_THREAD_POOL_NAME).execute(this::makeMlInternalIndicesHidden); } public void offMaster() { @@ -112,5 +141,106 @@ MlDailyMaintenanceService getDailyMaintenanceService() { return mlDailyMaintenanceService; } + /** For testing */ + public boolean areMlInternalIndicesHidden() { + return mlInternalIndicesHidden.get(); + } + + private void makeMlInternalIndicesHidden() { + String[] mlHiddenIndexPatterns = MachineLearning.getMlHiddenIndexPatterns(); + + // Step 5: Handle errors encountered on the way. + ActionListener finalListener = ActionListener.wrap( + updateAliasesResponse -> { + if (updateAliasesResponse.isAcknowledged() == false) { + logger.error("One or more of the ML internal aliases could not be made hidden."); + return; + } + mlInternalIndicesHidden.set(true); + }, + e -> logger.error("An error occurred while making ML internal indices and aliases hidden", e) + ); + + // Step 4: Extract ML internal aliases that are not hidden and make them hidden. + ActionListener getAliasesResponseListener = ActionListener.wrap( + getAliasesResponse -> { + IndicesAliasesRequest indicesAliasesRequest = new IndicesAliasesRequest(); + for (ObjectObjectCursor> entry : getAliasesResponse.getAliases()) { + String index = entry.key; + String[] nonHiddenAliases = entry.value.stream() + .filter(metadata -> metadata.isHidden() == null || metadata.isHidden() == false) + .map(AliasMetadata::alias) + .toArray(String[]::new); + if (nonHiddenAliases.length == 0) { + continue; + } + indicesAliasesRequest.addAliasAction( + IndicesAliasesRequest.AliasActions.add() + .index(index) + .aliases(entry.value.stream().map(AliasMetadata::alias).toArray(String[]::new)) + .isHidden(true)); + } + if (indicesAliasesRequest.getAliasActions().isEmpty()) { + logger.debug("There are no ML internal aliases that need to be made hidden, [{}]", getAliasesResponse.getAliases()); + finalListener.onResponse(AcknowledgedResponse.TRUE); + return; + } + String indicesWithNonHiddenAliasesString = + indicesAliasesRequest.getAliasActions().stream() + .map(aliasAction -> aliasAction.indices()[0] + ": " + String.join(",", aliasAction.aliases())) + .collect(Collectors.joining("; ")); + logger.debug("The following ML internal aliases will now be made hidden: [{}]", indicesWithNonHiddenAliasesString); + executeAsyncWithOrigin(client, ML_ORIGIN, IndicesAliasesAction.INSTANCE, indicesAliasesRequest, finalListener); + }, + finalListener::onFailure + ); + + // Step 3: Once indices are hidden, fetch ML internal aliases to find out whether the aliases are hidden or not. + ActionListener updateSettingsListener = ActionListener.wrap( + updateSettingsResponse -> { + if (updateSettingsResponse.isAcknowledged() == false) { + logger.error("One or more of the ML internal indices could not be made hidden."); + return; + } + GetAliasesRequest getAliasesRequest = new GetAliasesRequest() + .indices(mlHiddenIndexPatterns) + .indicesOptions(IndicesOptions.LENIENT_EXPAND_OPEN_CLOSED_HIDDEN); + executeAsyncWithOrigin(client, ML_ORIGIN, GetAliasesAction.INSTANCE, getAliasesRequest, getAliasesResponseListener); + }, + finalListener::onFailure + ); + + // Step 2: Extract ML internal indices that are not hidden and make them hidden. + ActionListener getSettingsListener = ActionListener.wrap( + getSettingsResponse -> { + String[] nonHiddenIndices = + getSettingsResponse.getIndexToSettings().stream() + .filter(e -> e.getValue().getAsBoolean(SETTING_INDEX_HIDDEN, false) == false) + .map(Map.Entry::getKey) + .toArray(String[]::new); + if (nonHiddenIndices.length == 0) { + logger.debug("There are no ML internal indices that need to be made hidden, [{}]", getSettingsResponse); + updateSettingsListener.onResponse(AcknowledgedResponse.TRUE); + return; + } + String nonHiddenIndicesString = Arrays.stream(nonHiddenIndices).collect(Collectors.joining(", ")); + logger.debug("The following ML internal indices will now be made hidden: [{}]", nonHiddenIndicesString); + UpdateSettingsRequest updateSettingsRequest = + new UpdateSettingsRequest() + .indices(nonHiddenIndices) + .indicesOptions(IndicesOptions.LENIENT_EXPAND_OPEN_CLOSED_HIDDEN) + .settings(Collections.singletonMap(SETTING_INDEX_HIDDEN, true)); + executeAsyncWithOrigin(client, ML_ORIGIN, UpdateSettingsAction.INSTANCE, updateSettingsRequest, updateSettingsListener); + }, + finalListener::onFailure + ); + + // Step 1: Fetch ML internal indices settings to find out whether they are already hidden or not. + GetSettingsRequest getSettingsRequest = + new GetSettingsRequest() + .indices(mlHiddenIndexPatterns) + .indicesOptions(IndicesOptions.LENIENT_EXPAND_OPEN_CLOSED_HIDDEN); + client.admin().indices().getSettings(getSettingsRequest, getSettingsListener); + } } diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/MlInitializationServiceTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/MlInitializationServiceTests.java index eed3eef2050de..10c2a2dfc45b5 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/MlInitializationServiceTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/MlInitializationServiceTests.java @@ -6,9 +6,15 @@ */ package org.elasticsearch.xpack.ml; +import org.elasticsearch.action.ActionFuture; +import org.elasticsearch.action.admin.indices.settings.get.GetSettingsAction; +import org.elasticsearch.action.admin.indices.settings.get.GetSettingsResponse; +import org.elasticsearch.client.AdminClient; import org.elasticsearch.client.Client; +import org.elasticsearch.client.IndicesAdminClient; import org.elasticsearch.cluster.ClusterName; import org.elasticsearch.cluster.service.ClusterService; +import org.elasticsearch.common.collect.ImmutableOpenMap; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.threadpool.Scheduler; @@ -20,6 +26,7 @@ import static org.elasticsearch.mock.orig.Mockito.doAnswer; import static org.hamcrest.Matchers.is; import static org.mockito.Matchers.any; +import static org.mockito.Matchers.eq; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @@ -47,11 +54,25 @@ public void setUpMocks() { return null; }).when(executorService).execute(any(Runnable.class)); when(threadPool.executor(ThreadPool.Names.GENERIC)).thenReturn(executorService); + when(threadPool.executor(MachineLearning.UTILITY_THREAD_POOL_NAME)).thenReturn(executorService); Scheduler.ScheduledCancellable scheduledCancellable = mock(Scheduler.ScheduledCancellable.class); when(threadPool.schedule(any(), any(), any())).thenReturn(scheduledCancellable); when(clusterService.getClusterName()).thenReturn(CLUSTER_NAME); + + @SuppressWarnings("unchecked") + ActionFuture getSettingsResponseActionFuture = mock(ActionFuture.class); + when(getSettingsResponseActionFuture.actionGet()).thenReturn(new GetSettingsResponse(ImmutableOpenMap.of(), ImmutableOpenMap.of())); + IndicesAdminClient indicesAdminClient = mock(IndicesAdminClient.class); + when(indicesAdminClient.getSettings(any())).thenReturn(getSettingsResponseActionFuture); + AdminClient adminClient = mock(AdminClient.class); + when(adminClient.indices()).thenReturn(indicesAdminClient); + when(client.admin()).thenReturn(adminClient); + @SuppressWarnings("unchecked") + ActionFuture actionFuture = mock(ActionFuture.class); + when(actionFuture.actionGet()).thenReturn(new GetSettingsResponse(ImmutableOpenMap.of(), ImmutableOpenMap.of())); + when(client.execute(eq(GetSettingsAction.INSTANCE), any())).thenReturn(actionFuture); } public void testInitialize() { @@ -71,7 +92,8 @@ public void testInitialize_noMasterNode() { public void testNodeGoesFromMasterToNonMasterAndBack() { MlDailyMaintenanceService initialDailyMaintenanceService = mock(MlDailyMaintenanceService.class); - MlInitializationService initializationService = new MlInitializationService(client, initialDailyMaintenanceService, clusterService); + MlInitializationService initializationService = + new MlInitializationService(client, threadPool, initialDailyMaintenanceService, clusterService); initializationService.offMaster(); verify(initialDailyMaintenanceService).stop(); diff --git a/x-pack/qa/full-cluster-restart/src/test/java/org/elasticsearch/xpack/restart/MlHiddenIndicesFullClusterRestartIT.java b/x-pack/qa/full-cluster-restart/src/test/java/org/elasticsearch/xpack/restart/MlHiddenIndicesFullClusterRestartIT.java new file mode 100644 index 0000000000000..a4b2528dfa870 --- /dev/null +++ b/x-pack/qa/full-cluster-restart/src/test/java/org/elasticsearch/xpack/restart/MlHiddenIndicesFullClusterRestartIT.java @@ -0,0 +1,185 @@ +/* + * 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.restart; + +import com.fasterxml.jackson.databind.ObjectMapper; + +import org.elasticsearch.Version; +import org.elasticsearch.client.Request; +import org.elasticsearch.client.RequestOptions; +import org.elasticsearch.client.Response; +import org.elasticsearch.client.WarningsHandler; +import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.common.util.concurrent.ThreadContext; +import org.elasticsearch.common.xcontent.support.XContentMapValues; +import org.elasticsearch.core.Tuple; +import org.elasticsearch.upgrades.AbstractFullClusterRestartTestCase; +import org.elasticsearch.xpack.test.rest.XPackRestTestConstants; +import org.elasticsearch.xpack.test.rest.XPackRestTestHelper; +import org.junit.Before; + +import java.io.IOException; +import java.io.InputStreamReader; +import java.nio.charset.StandardCharsets; +import java.util.Base64; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static org.hamcrest.Matchers.aMapWithSize; +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.greaterThanOrEqualTo; +import static org.hamcrest.Matchers.is; +import static org.hamcrest.Matchers.notNullValue; +import static org.hamcrest.Matchers.nullValue; + +public class MlHiddenIndicesFullClusterRestartIT extends AbstractFullClusterRestartTestCase { + + private static final String JOB_ID = "ml-hidden-indices-old-cluster-job"; + private static final List, String>> EXPECTED_INDEX_ALIAS_PAIRS = + List.of( + Tuple.tuple(List.of(".ml-annotations-6"), ".ml-annotations-read"), + Tuple.tuple(List.of(".ml-annotations-6"), ".ml-annotations-write"), + Tuple.tuple(List.of(".ml-state", ".ml-state-000001"), ".ml-state-write"), + Tuple.tuple(List.of(".ml-anomalies-shared"), ".ml-anomalies-" + JOB_ID), + Tuple.tuple(List.of(".ml-anomalies-shared"), ".ml-anomalies-.write-" + JOB_ID) + ); + + @Override + protected Settings restClientSettings() { + String token = "Basic " + Base64.getEncoder().encodeToString("test_user:x-pack-test-password".getBytes(StandardCharsets.UTF_8)); + return Settings.builder() + .put(ThreadContext.PREFIX + ".Authorization", token) + .build(); + } + + @Before + public void waitForMlTemplates() throws Exception { + List templatesToWaitFor = (isRunningAgainstOldCluster() && getOldClusterVersion().before(Version.V_7_12_0)) + ? XPackRestTestConstants.ML_POST_V660_TEMPLATES + : XPackRestTestConstants.ML_POST_V7120_TEMPLATES; + boolean clusterUnderstandsComposableTemplates = + isRunningAgainstOldCluster() == false || getOldClusterVersion().onOrAfter(Version.V_7_8_0); + XPackRestTestHelper.waitForTemplates(client(), templatesToWaitFor, clusterUnderstandsComposableTemplates); + } + + public void testMlIndicesBecomeHidden() throws Exception { + if (isRunningAgainstOldCluster()) { + // trigger ML indices creation + createAnomalyDetectorJob(JOB_ID); + openAnomalyDetectorJob(JOB_ID); + + if (getOldClusterVersion().before(Version.V_7_7_0)) { + Map indexSettingsMap = contentAsMap(getMlIndicesSettings()); + Map aliasesMap = contentAsMap(getMlAliases()); + + assertThat("Index settings map was: " + indexSettingsMap, indexSettingsMap, is(aMapWithSize(greaterThanOrEqualTo(4)))); + for (Map.Entry e : indexSettingsMap.entrySet()) { + String indexName = e.getKey(); + @SuppressWarnings("unchecked") + Map settings = (Map) e.getValue(); + assertThat(settings, is(notNullValue())); + assertThat("Index " + indexName + " expected not to be hidden but was, settings = " + settings, + XContentMapValues.extractValue(settings, "settings", "index", "hidden"), + is(nullValue())); + } + + for (Tuple, String> indexAndAlias : EXPECTED_INDEX_ALIAS_PAIRS) { + List indices = indexAndAlias.v1(); + String alias = indexAndAlias.v2(); + for (String index : indices) { + assertThat( + indexAndAlias + " expected not be hidden but was, aliasesMap = " + aliasesMap, + XContentMapValues.extractValue(aliasesMap, index, "aliases", alias, "is_hidden"), + is(nullValue())); + } + } + } + } else { + Map indexSettingsMap = contentAsMap(getMlIndicesSettings()); + Map aliasesMap = contentAsMap(getMlAliases()); + + assertThat("Index settings map was: " + indexSettingsMap, indexSettingsMap, is(aMapWithSize(greaterThanOrEqualTo(4)))); + for (Map.Entry e : indexSettingsMap.entrySet()) { + String indexName = e.getKey(); + @SuppressWarnings("unchecked") + Map settings = (Map) e.getValue(); + assertThat(settings, is(notNullValue())); + assertThat("Index " + indexName + " expected to be hidden but wasn't, settings = " + settings, + XContentMapValues.extractValue(settings, "settings", "index", "hidden"), + is(equalTo("true"))); + } + + for (Tuple, String> indexAndAlias : EXPECTED_INDEX_ALIAS_PAIRS) { + List indices = indexAndAlias.v1(); + String alias = indexAndAlias.v2(); + assertThat( + indexAndAlias + " expected to be hidden but wasn't, aliasesMap = " + aliasesMap, + indices.stream() + .anyMatch(index -> + Boolean.TRUE.equals(XContentMapValues.extractValue(aliasesMap, index, "aliases", alias, "is_hidden"))), + is(true)); + } + } + } + + private Response getMlIndicesSettings() throws IOException { + Request getSettingsRequest = + new Request("GET", ".ml-anomalies-*,.ml-state*,.ml-stats-*,.ml-notifications*,.ml-annotations*/_settings"); + getSettingsRequest + .setOptions(RequestOptions.DEFAULT.toBuilder() + .setWarningsHandler(WarningsHandler.PERMISSIVE) + .build()); + Response getSettingsResponse = client().performRequest(getSettingsRequest); + assertThat(getSettingsResponse, is(notNullValue())); + return getSettingsResponse; + } + + private Response getMlAliases() throws IOException { + Request getAliasesRequest = + new Request("GET", ".ml-anomalies-*,.ml-state*,.ml-stats-*,.ml-notifications*,.ml-annotations*/_alias"); + getAliasesRequest + .setOptions(RequestOptions.DEFAULT.toBuilder() + .setWarningsHandler(WarningsHandler.PERMISSIVE) + .build()); + Response getAliasesResponse = client().performRequest(getAliasesRequest); + assertThat(getAliasesResponse, is(notNullValue())); + return getAliasesResponse; + } + + @SuppressWarnings("unchecked") + private static Map contentAsMap(Response response) throws IOException { + return new ObjectMapper().readValue( + new InputStreamReader(response.getEntity().getContent(), StandardCharsets.UTF_8), HashMap.class); + } + + private void createAnomalyDetectorJob(String jobId) throws IOException { + String jobConfig = + "{\n" + + " \"job_id\": \"" + jobId + "\",\n" + + " \"analysis_config\": {\n" + + " \"bucket_span\": \"10m\",\n" + + " \"detectors\": [{\n" + + " \"function\": \"metric\",\n" + + " \"field_name\": \"responsetime\"\n" + + " }]\n" + + " },\n" + + " \"data_description\": {}\n" + + "}"; + + Request putJobRequest = new Request("PUT", "/_ml/anomaly_detectors/" + jobId); + putJobRequest.setJsonEntity(jobConfig); + Response putJobResponse = client().performRequest(putJobRequest); + assertThat(putJobResponse.getStatusLine().getStatusCode(), equalTo(200)); + } + + private void openAnomalyDetectorJob(String jobId) throws IOException { + Request openJobRequest = new Request("POST", "/_ml/anomaly_detectors/" + jobId + "/_open"); + Response openJobResponse = client().performRequest(openJobRequest); + assertThat(openJobResponse.getStatusLine().getStatusCode(), equalTo(200)); + } +} From fd4dca8e14cd70faf02f75df9d3cd24ab749e326 Mon Sep 17 00:00:00 2001 From: Hendrik Muhs Date: Mon, 11 Oct 2021 12:22:56 +0200 Subject: [PATCH 250/250] [Transform] HLRC cleanups (#78909) removes some "data frame" leftovers in transform code, no functional changes --- .../client/TransformRequestConverters.java | 53 ++++++++----------- .../org/elasticsearch/client/TransformIT.java | 42 ++++++++------- .../TransformRequestConvertersTests.java | 36 +++++++------ .../TransformDocumentationIT.java | 6 +-- ...s.java => StartTransformRequestTests.java} | 2 +- ...java => UpdateTransformResponseTests.java} | 19 ++++--- 6 files changed, 78 insertions(+), 80 deletions(-) rename client/rest-high-level/src/test/java/org/elasticsearch/client/transform/{StartDataFrameTransformRequestTests.java => StartTransformRequestTests.java} (94%) rename client/rest-high-level/src/test/java/org/elasticsearch/client/transform/{UpdateDataFrameTransformResponseTests.java => UpdateTransformResponseTests.java} (79%) diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/TransformRequestConverters.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/TransformRequestConverters.java index 84a234578eebb..2f27675a9efe3 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/TransformRequestConverters.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/TransformRequestConverters.java @@ -38,10 +38,9 @@ final class TransformRequestConverters { private TransformRequestConverters() {} static Request putTransform(PutTransformRequest putRequest) throws IOException { - String endpoint = new RequestConverters.EndpointBuilder() - .addPathPartAsIs("_transform") - .addPathPart(putRequest.getConfig().getId()) - .build(); + String endpoint = new RequestConverters.EndpointBuilder().addPathPartAsIs("_transform") + .addPathPart(putRequest.getConfig().getId()) + .build(); Request request = new Request(HttpPut.METHOD_NAME, endpoint); request.setEntity(createEntity(putRequest, REQUEST_BODY_CONTENT_TYPE)); if (putRequest.getDeferValidation() != null) { @@ -50,25 +49,23 @@ static Request putTransform(PutTransformRequest putRequest) throws IOException { return request; } - static Request updateTransform(UpdateTransformRequest updateDataFrameTransformRequest) throws IOException { - String endpoint = new RequestConverters.EndpointBuilder() - .addPathPartAsIs("_transform") - .addPathPart(updateDataFrameTransformRequest.getId()) + static Request updateTransform(UpdateTransformRequest updateTransformRequest) throws IOException { + String endpoint = new RequestConverters.EndpointBuilder().addPathPartAsIs("_transform") + .addPathPart(updateTransformRequest.getId()) .addPathPart("_update") .build(); Request request = new Request(HttpPost.METHOD_NAME, endpoint); - request.setEntity(createEntity(updateDataFrameTransformRequest, REQUEST_BODY_CONTENT_TYPE)); - if (updateDataFrameTransformRequest.getDeferValidation() != null) { - request.addParameter(DEFER_VALIDATION, Boolean.toString(updateDataFrameTransformRequest.getDeferValidation())); + request.setEntity(createEntity(updateTransformRequest, REQUEST_BODY_CONTENT_TYPE)); + if (updateTransformRequest.getDeferValidation() != null) { + request.addParameter(DEFER_VALIDATION, Boolean.toString(updateTransformRequest.getDeferValidation())); } return request; } static Request getTransform(GetTransformRequest getRequest) { - String endpoint = new RequestConverters.EndpointBuilder() - .addPathPartAsIs("_transform") - .addPathPart(Strings.collectionToCommaDelimitedString(getRequest.getId())) - .build(); + String endpoint = new RequestConverters.EndpointBuilder().addPathPartAsIs("_transform") + .addPathPart(Strings.collectionToCommaDelimitedString(getRequest.getId())) + .build(); Request request = new Request(HttpGet.METHOD_NAME, endpoint); if (getRequest.getPageParams() != null && getRequest.getPageParams().getFrom() != null) { request.addParameter(PageParams.FROM.getPreferredName(), getRequest.getPageParams().getFrom().toString()); @@ -86,10 +83,7 @@ static Request getTransform(GetTransformRequest getRequest) { } static Request deleteTransform(DeleteTransformRequest deleteRequest) { - String endpoint = new RequestConverters.EndpointBuilder() - .addPathPartAsIs("_transform") - .addPathPart(deleteRequest.getId()) - .build(); + String endpoint = new RequestConverters.EndpointBuilder().addPathPartAsIs("_transform").addPathPart(deleteRequest.getId()).build(); Request request = new Request(HttpDelete.METHOD_NAME, endpoint); if (deleteRequest.getForce() != null) { request.addParameter(FORCE, Boolean.toString(deleteRequest.getForce())); @@ -98,11 +92,10 @@ static Request deleteTransform(DeleteTransformRequest deleteRequest) { } static Request startTransform(StartTransformRequest startRequest) { - String endpoint = new RequestConverters.EndpointBuilder() - .addPathPartAsIs("_transform") - .addPathPart(startRequest.getId()) - .addPathPartAsIs("_start") - .build(); + String endpoint = new RequestConverters.EndpointBuilder().addPathPartAsIs("_transform") + .addPathPart(startRequest.getId()) + .addPathPartAsIs("_start") + .build(); Request request = new Request(HttpPost.METHOD_NAME, endpoint); RequestConverters.Params params = new RequestConverters.Params(); if (startRequest.getTimeout() != null) { @@ -113,8 +106,7 @@ static Request startTransform(StartTransformRequest startRequest) { } static Request stopTransform(StopTransformRequest stopRequest) { - String endpoint = new RequestConverters.EndpointBuilder() - .addPathPartAsIs("_transform") + String endpoint = new RequestConverters.EndpointBuilder().addPathPartAsIs("_transform") .addPathPart(stopRequest.getId()) .addPathPartAsIs("_stop") .build(); @@ -151,11 +143,10 @@ static Request previewTransform(PreviewTransformRequest previewRequest) throws I } static Request getTransformStats(GetTransformStatsRequest statsRequest) { - String endpoint = new RequestConverters.EndpointBuilder() - .addPathPartAsIs("_transform") - .addPathPart(statsRequest.getId()) - .addPathPartAsIs("_stats") - .build(); + String endpoint = new RequestConverters.EndpointBuilder().addPathPartAsIs("_transform") + .addPathPart(statsRequest.getId()) + .addPathPartAsIs("_stats") + .build(); Request request = new Request(HttpGet.METHOD_NAME, endpoint); if (statsRequest.getPageParams() != null && statsRequest.getPageParams().getFrom() != null) { request.addParameter(PageParams.FROM.getPreferredName(), statsRequest.getPageParams().getFrom().toString()); diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/TransformIT.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/TransformIT.java index 5dce41530c838..5a492c6f39672 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/TransformIT.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/TransformIT.java @@ -44,8 +44,6 @@ import org.elasticsearch.client.transform.transforms.pivot.PivotConfig; import org.elasticsearch.client.transform.transforms.pivot.TermsGroupSource; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.xcontent.XContentBuilder; -import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.index.query.MatchAllQueryBuilder; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.search.SearchHit; @@ -53,6 +51,8 @@ import org.elasticsearch.search.aggregations.AggregatorFactories; import org.elasticsearch.search.builder.SearchSourceBuilder; import org.elasticsearch.search.sort.SortOrder; +import org.elasticsearch.xcontent.XContentBuilder; +import org.elasticsearch.xcontent.XContentType; import org.junit.After; import java.io.IOException; @@ -177,7 +177,7 @@ public void testCreateDelete() throws IOException { createIndex(sourceIndex); String id = "test-crud"; - TransformConfig transform = validDataFrameTransformConfig(id, sourceIndex, "pivot-dest"); + TransformConfig transform = validTransformConfig(id, sourceIndex, "pivot-dest"); TransformClient client = highLevelClient().transform(); AcknowledgedResponse ack = execute(new PutTransformRequest(transform), client::putTransform, client::putTransformAsync); @@ -199,7 +199,7 @@ public void testUpdate() throws IOException { createIndex(sourceIndex); String id = "test-update"; - TransformConfig transform = validDataFrameTransformConfigBuilder(id, sourceIndex, "pivot-dest").setSyncConfig( + TransformConfig transform = validTransformConfigBuilder(id, sourceIndex, "pivot-dest").setSyncConfig( TimeSyncConfig.builder().setField("timestamp").setDelay(TimeValue.timeValueSeconds(60)).build() ).build(); @@ -227,7 +227,7 @@ public void testCreateDeleteWithDefer() throws IOException { String sourceIndex = "missing-source-index"; String id = "test-with-defer"; - TransformConfig transform = validDataFrameTransformConfig(id, sourceIndex, "pivot-dest"); + TransformConfig transform = validTransformConfig(id, sourceIndex, "pivot-dest"); TransformClient client = highLevelClient().transform(); PutTransformRequest request = new PutTransformRequest(transform); request.setDeferValidation(true); @@ -243,7 +243,7 @@ public void testGetTransform() throws IOException { createIndex(sourceIndex); String id = "test-get"; - TransformConfig transform = validDataFrameTransformConfig(id, sourceIndex, "pivot-dest"); + TransformConfig transform = validTransformConfig(id, sourceIndex, "pivot-dest"); TransformClient client = highLevelClient().transform(); putTransform(transform); @@ -261,10 +261,10 @@ public void testGetAllAndPageTransforms() throws IOException { TransformClient client = highLevelClient().transform(); - TransformConfig transform = validDataFrameTransformConfig("test-get-all-1", sourceIndex, "pivot-dest-1"); + TransformConfig transform = validTransformConfig("test-get-all-1", sourceIndex, "pivot-dest-1"); putTransform(transform); - transform = validDataFrameTransformConfig("test-get-all-2", sourceIndex, "pivot-dest-2"); + transform = validTransformConfig("test-get-all-2", sourceIndex, "pivot-dest-2"); putTransform(transform); GetTransformRequest getRequest = new GetTransformRequest("_all"); @@ -299,7 +299,7 @@ public void testStartStop() throws IOException { createIndex(sourceIndex); String id = "test-stop-start"; - TransformConfig transform = validDataFrameTransformConfig(id, sourceIndex, "pivot-dest"); + TransformConfig transform = validTransformConfig(id, sourceIndex, "pivot-dest"); TransformClient client = highLevelClient().transform(); putTransform(transform); @@ -341,11 +341,14 @@ public void testPreview() throws IOException { createIndex(sourceIndex); indexData(sourceIndex); - TransformConfig transform = validDataFrameTransformConfig("test-preview", sourceIndex, null); + TransformConfig transform = validTransformConfig("test-preview", sourceIndex, null); TransformClient client = highLevelClient().transform(); - PreviewTransformResponse preview = - execute(new PreviewTransformRequest(transform), client::previewTransform, client::previewTransformAsync); + PreviewTransformResponse preview = execute( + new PreviewTransformRequest(transform), + client::previewTransform, + client::previewTransformAsync + ); assertExpectedPreview(preview); } @@ -355,12 +358,15 @@ public void testPreviewById() throws IOException { indexData(sourceIndex); String transformId = "test-preview-by-id"; - TransformConfig transform = validDataFrameTransformConfig(transformId, sourceIndex, "pivot-dest"); + TransformConfig transform = validTransformConfig(transformId, sourceIndex, "pivot-dest"); putTransform(transform); TransformClient client = highLevelClient().transform(); - PreviewTransformResponse preview = - execute(new PreviewTransformRequest(transformId), client::previewTransform, client::previewTransformAsync); + PreviewTransformResponse preview = execute( + new PreviewTransformRequest(transformId), + client::previewTransform, + client::previewTransformAsync + ); assertExpectedPreview(preview); } @@ -383,11 +389,11 @@ private static void assertExpectedPreview(PreviewTransformResponse preview) { assertThat(fields.get("avg_rating"), equalTo(Map.of("type", "double"))); } - private TransformConfig validDataFrameTransformConfig(String id, String source, String destination) { - return validDataFrameTransformConfigBuilder(id, source, destination).build(); + private TransformConfig validTransformConfig(String id, String source, String destination) { + return validTransformConfigBuilder(id, source, destination).build(); } - private TransformConfig.Builder validDataFrameTransformConfigBuilder(String id, String source, String destination) { + private TransformConfig.Builder validTransformConfigBuilder(String id, String source, String destination) { GroupConfig groupConfig = GroupConfig.builder().groupBy("reviewer", TermsGroupSource.builder().setField("user_id").build()).build(); AggregatorFactories.Builder aggBuilder = new AggregatorFactories.Builder(); aggBuilder.addAggregator(AggregationBuilders.avg("avg_rating").field("stars")); diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/TransformRequestConvertersTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/TransformRequestConvertersTests.java index 69c15c56b4a79..98f99ccb2b89b 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/TransformRequestConvertersTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/TransformRequestConvertersTests.java @@ -29,11 +29,11 @@ import org.elasticsearch.client.transform.transforms.TransformConfigUpdateTests; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; +import org.elasticsearch.search.SearchModule; +import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xcontent.NamedXContentRegistry; import org.elasticsearch.xcontent.XContentParser; import org.elasticsearch.xcontent.json.JsonXContent; -import org.elasticsearch.search.SearchModule; -import org.elasticsearch.test.ESTestCase; import java.io.IOException; import java.util.Collections; @@ -58,9 +58,8 @@ protected NamedXContentRegistry xContentRegistry() { return new NamedXContentRegistry(namedXContents); } - public void testPutDataFrameTransform() throws IOException { - PutTransformRequest putRequest = new PutTransformRequest( - TransformConfigTests.randomTransformConfig()); + public void testPutTransform() throws IOException { + PutTransformRequest putRequest = new PutTransformRequest(TransformConfigTests.randomTransformConfig()); Request request = TransformRequestConverters.putTransform(putRequest); assertThat(request.getParameters(), not(hasKey("defer_validation"))); assertEquals(HttpPut.METHOD_NAME, request.getMethod()); @@ -75,11 +74,12 @@ public void testPutDataFrameTransform() throws IOException { assertThat(request.getParameters(), hasEntry("defer_validation", Boolean.toString(putRequest.getDeferValidation()))); } - public void testUpdateDataFrameTransform() throws IOException { + public void testUpdateTransform() throws IOException { String transformId = randomAlphaOfLength(10); UpdateTransformRequest updateDataFrameTransformRequest = new UpdateTransformRequest( TransformConfigUpdateTests.randomTransformConfigUpdate(), - transformId); + transformId + ); Request request = TransformRequestConverters.updateTransform(updateDataFrameTransformRequest); assertThat(request.getParameters(), not(hasKey("defer_validation"))); assertEquals(HttpPost.METHOD_NAME, request.getMethod()); @@ -91,11 +91,13 @@ public void testUpdateDataFrameTransform() throws IOException { } updateDataFrameTransformRequest.setDeferValidation(true); request = TransformRequestConverters.updateTransform(updateDataFrameTransformRequest); - assertThat(request.getParameters(), - hasEntry("defer_validation", Boolean.toString(updateDataFrameTransformRequest.getDeferValidation()))); + assertThat( + request.getParameters(), + hasEntry("defer_validation", Boolean.toString(updateDataFrameTransformRequest.getDeferValidation())) + ); } - public void testDeleteDataFrameTransform() { + public void testDeleteTransform() { DeleteTransformRequest deleteRequest = new DeleteTransformRequest("foo"); Request request = TransformRequestConverters.deleteTransform(deleteRequest); @@ -110,7 +112,7 @@ public void testDeleteDataFrameTransform() { assertThat(request.getParameters(), hasEntry("force", "true")); } - public void testStartDataFrameTransform() { + public void testStartTransform() { String id = randomAlphaOfLength(10); TimeValue timeValue = null; if (randomBoolean()) { @@ -130,7 +132,7 @@ public void testStartDataFrameTransform() { } } - public void testStopDataFrameTransform() { + public void testStopTransform() { String id = randomAlphaOfLength(10); Boolean waitForCompletion = null; if (randomBoolean()) { @@ -177,7 +179,7 @@ public void testStopDataFrameTransform() { assertEquals(stopRequest.getAllowNoMatch(), Boolean.parseBoolean(request.getParameters().get(ALLOW_NO_MATCH))); } - public void testPreviewDataFrameTransform() throws IOException { + public void testPreviewTransform() throws IOException { PreviewTransformRequest previewRequest = new PreviewTransformRequest(TransformConfigTests.randomTransformConfig()); Request request = TransformRequestConverters.previewTransform(previewRequest); @@ -190,7 +192,7 @@ public void testPreviewDataFrameTransform() throws IOException { } } - public void testPreviewDataFrameTransformById() throws IOException { + public void testPreviewTransformById() throws IOException { String transformId = randomAlphaOfLengthBetween(1, 10); PreviewTransformRequest previewRequest = new PreviewTransformRequest(transformId); Request request = TransformRequestConverters.previewTransform(previewRequest); @@ -200,7 +202,7 @@ public void testPreviewDataFrameTransformById() throws IOException { assertThat(request.getEntity(), nullValue()); } - public void testGetDataFrameTransformStats() { + public void testGetTransformStats() { GetTransformStatsRequest getStatsRequest = new GetTransformStatsRequest("foo"); Request request = TransformRequestConverters.getTransformStats(getStatsRequest); @@ -230,7 +232,7 @@ public void testGetDataFrameTransformStats() { assertThat(request.getParameters(), hasEntry("allow_no_match", "false")); } - public void testGetDataFrameTransform() { + public void testGetTransform() { GetTransformRequest getRequest = new GetTransformRequest("bar"); Request request = TransformRequestConverters.getTransform(getRequest); @@ -260,7 +262,7 @@ public void testGetDataFrameTransform() { assertThat(request.getParameters(), hasEntry("allow_no_match", "false")); } - public void testGetDataFrameTransform_givenMulitpleIds() { + public void testGetTransform_givenMulitpleIds() { GetTransformRequest getRequest = new GetTransformRequest("foo", "bar", "baz"); Request request = TransformRequestConverters.getTransform(getRequest); diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/TransformDocumentationIT.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/TransformDocumentationIT.java index f5cc765f4cc24..1261ecfb59acb 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/TransformDocumentationIT.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/TransformDocumentationIT.java @@ -50,10 +50,10 @@ import org.elasticsearch.client.transform.transforms.pivot.PivotConfig; import org.elasticsearch.client.transform.transforms.pivot.TermsGroupSource; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.index.query.MatchAllQueryBuilder; import org.elasticsearch.search.aggregations.AggregationBuilders; import org.elasticsearch.search.aggregations.AggregatorFactories; +import org.elasticsearch.xcontent.XContentBuilder; import org.junit.After; import java.io.IOException; @@ -445,7 +445,7 @@ public void onFailure(Exception e) { } } - public void testDeleteDataFrameTransform() throws IOException, InterruptedException { + public void testDeleteTransform() throws IOException, InterruptedException { createIndex("source-data"); RestHighLevelClient client = highLevelClient(); @@ -670,7 +670,7 @@ public void onFailure(Exception e) { } } - public void testGetDataFrameTransform() throws IOException, InterruptedException { + public void testGetTransform() throws IOException, InterruptedException { createIndex("source-data"); GroupConfig groupConfig = GroupConfig.builder().groupBy("reviewer", TermsGroupSource.builder().setField("user_id").build()).build(); diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/StartDataFrameTransformRequestTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/StartTransformRequestTests.java similarity index 94% rename from client/rest-high-level/src/test/java/org/elasticsearch/client/transform/StartDataFrameTransformRequestTests.java rename to client/rest-high-level/src/test/java/org/elasticsearch/client/transform/StartTransformRequestTests.java index 9f04fd4f6c23e..2c8b7c3e795d3 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/StartDataFrameTransformRequestTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/StartTransformRequestTests.java @@ -15,7 +15,7 @@ import static org.hamcrest.Matchers.containsString; -public class StartDataFrameTransformRequestTests extends ESTestCase { +public class StartTransformRequestTests extends ESTestCase { public void testValidate_givenNullId() { StartTransformRequest request = new StartTransformRequest(null, null); Optional validate = request.validate(); diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/UpdateDataFrameTransformResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/UpdateTransformResponseTests.java similarity index 79% rename from client/rest-high-level/src/test/java/org/elasticsearch/client/transform/UpdateDataFrameTransformResponseTests.java rename to client/rest-high-level/src/test/java/org/elasticsearch/client/transform/UpdateTransformResponseTests.java index 1ae24640165e7..64303e1e4e40a 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/UpdateDataFrameTransformResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/transform/UpdateTransformResponseTests.java @@ -10,10 +10,10 @@ import org.elasticsearch.client.transform.transforms.TransformConfigTests; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.xcontent.NamedXContentRegistry; -import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.search.SearchModule; import org.elasticsearch.test.ESTestCase; +import org.elasticsearch.xcontent.NamedXContentRegistry; +import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; import java.util.Collections; @@ -21,16 +21,15 @@ import static org.elasticsearch.test.AbstractXContentTestCase.xContentTester; -public class UpdateDataFrameTransformResponseTests extends ESTestCase { +public class UpdateTransformResponseTests extends ESTestCase { public void testXContentParser() throws IOException { - xContentTester(this::createParser, - UpdateDataFrameTransformResponseTests::createTestInstance, - UpdateDataFrameTransformResponseTests::toXContent, - UpdateTransformResponse::fromXContent) - .assertToXContentEquivalence(false) - .supportsUnknownFields(false) - .test(); + xContentTester( + this::createParser, + UpdateTransformResponseTests::createTestInstance, + UpdateTransformResponseTests::toXContent, + UpdateTransformResponse::fromXContent + ).assertToXContentEquivalence(false).supportsUnknownFields(false).test(); } private static UpdateTransformResponse createTestInstance() {